Re: ath0 no longer attaches, cardbus problems?

From: Warner Losh <imp_at_bsdimp.com>
Date: Fri, 9 Sep 2011 22:11:10 -0600
On Sep 9, 2011, at 1:22 PM, Daniel Eischen wrote:

> I found the commit that broke ath for me, r222753,
> specifically, the change to /dev/cardbus/cardbus_cis.c.
> 
> To be sure, I updated to head using svn, and applied
> the patch included below.  ath attaches and works.  Without
> the patch, ath does not attach.
> 
> On another note, I've no idea why updating from a local
> CVS repo lead me down a wrong path.  It seems wrong that
> a 'cvs update -P -d -A -D "31 Mar 2011"' works and
> a 'cvs update -P -d -A -D "1 Apr 2011"' does not work.
> r222753 did not occur until much later (June 6).
> Once John asked me to try r220195, I switched to using
> svn.  When that worked, it seemed strange to me because
> nothing else committed after that on Mar 31 should have
> broke ath.
> 
> Anyway, culprit found.  Now what is the correct fix?

Do you need both chunks?  The second one seems redundant given the definition of bus_alloc_reosurce_any does exactly that.

Warner

> 
> 
> Index: sys/dev/cardbus/cardbus_cis.c
> ===================================================================
> --- sys/dev/cardbus/cardbus_cis.c	(revision 225463)
> +++ sys/dev/cardbus/cardbus_cis.c	(working copy)
> _at__at_ -441,6 +441,7 _at__at_
> {
> 	if (res != CIS_CONFIG_SPACE) {
> 		bus_release_resource(child, SYS_RES_MEMORY, rid, res);
> +		bus_delete_resource(child, SYS_RES_MEMORY, rid);
> 	}
> }
> 
> _at__at_ -477,7 +478,11 _at__at_
> 	}
> 
> 	/* allocate the memory space to read CIS */
> +#if 0
> 	res = bus_alloc_resource_any(child, SYS_RES_MEMORY, rid,
> +#else
> +	res = bus_alloc_resource(child, SYS_RES_MEMORY, rid, 0, ~0, 1,
> +#endif
> 	    rman_make_alignment_flags(4096) | RF_ACTIVE);
> 	if (res == NULL) {
> 		device_printf(cbdev, "Unable to allocate resource "
> 
> -- 
> DE
> 
> 
Received on Sat Sep 10 2011 - 02:14:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:17 UTC