Re: ath0 no longer attaches, cardbus problems?

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 7 Sep 2011 17:35:34 -0400
On Wednesday, September 07, 2011 4:18:25 pm Daniel Eischen wrote:
> On Tue, 6 Sep 2011, John Baldwin wrote:
> 
> > On Tuesday, September 06, 2011 3:34:58 pm Daniel Eischen wrote:
> >> On Tue, 6 Sep 2011, John Baldwin wrote:
> >>>
> >>> Looks like I had a typo in my original e-mail, try
> >>>   "debug.acpi.disabled=hostres"
> >>> rather than "debug.acpi.disable=hostres".
> >>
> >> Ok, I'll try that.
> 
> Setting debug.acpi.disabled=hostres in /boot/loader.conf
> did not help.  I tried this with a recent kernel from HEAD.

Did it remove the 'pcib0: decoding ....' lines from a verbose dmesg?

> More info.  I've found that kernels:
> 
>    March 31 - work, ath attaches and works
> 
>    April 1 - June 6: panic on cardbus attach
> 
>    June 7 - HEAD: work, but ath doesn't attach
> 
> 
> I found the commit that fixed the panic:
> 
>    Index: sys/dev/pci/pci.c
>    ===================================================================
>    RCS file: /opt/FreeBSD/cvs/src/sys/dev/pci/pci.c,v
>    retrieving revision 1.420
>    retrieving revision 1.421
>    diff -u -r1.420 -r1.421
>    --- sys/dev/pci/pci.c   3 May 2011 17:37:24 -0000       1.420
>    +++ sys/dev/pci/pci.c   6 Jun 2011 13:21:11 -0000       1.421
>    _at__at_ -2576,6 +2576,17 _at__at_
>            uint16_t cmd;
>            struct resource *res;
> 
>    +       /*
>    +        * The BAR may already exist if the device is a CardBus card
>    +        * whose CIS is stored in this BAR.
>    +        */
>    +       pm = pci_find_bar(dev, reg);
>    +       if (pm != NULL) {
>    +               maprange = pci_maprange(pm->pm_value);
>    +               barlen = maprange == 64 ? 2 : 1;
>    +               return (barlen);
>    +       }
>    +
>            pci_read_bar(dev, reg, &map, &testval);
>            if (PCI_BAR_MEM(map)) {
>                    type = SYS_RES_MEMORY;
> 
> 
> I applied this patch to the April 1st kernel (which previously
> paniced) and was able to boot the kernel.  ath still does not
> attach.
> 
> So the commit that broke my cardbus ath occurred on April 1.

Hmm.  There are no PCI or Cardbus commits on April 1.  There are some ath(4) 
changes though including two HAL changes:

Author: adrian
Date: Sat Apr  2 00:24:13 2011
New Revision: 220258
URL: http://svn.freebsd.org/changeset/base/220258

Log:
  Add some more debugging

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar2133.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar2133.c    Sat Apr  2 00:08:32 2011        
(r220257)
+++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c    Sat Apr  2 00:24:13 2011        
(r220258)
_at__at_ -251,11 +251,19 _at__at_ ar2133SetRfRegs(struct ath_hal *ah, cons
        
        /* Only the 5 or 2 GHz OB/DB need to be set for a mode */
        if (IEEE80211_IS_CHAN_2GHZ(chan)) {
+               HALDEBUG(ah, HAL_DEBUG_EEPROM, "%s: 2ghz: OB_2:%d, DB_2:%d\n",
+                   __func__,
+                   ath_hal_eepromGet(ah, AR_EEP_OB_2, AH_NULL),
+                   ath_hal_eepromGet(ah, AR_EEP_DB_2, AH_NULL));
                ar5416ModifyRfBuffer(priv->Bank6Data,
                    ath_hal_eepromGet(ah, AR_EEP_OB_2, AH_NULL), 3, 197, 0);
                ar5416ModifyRfBuffer(priv->Bank6Data,
                    ath_hal_eepromGet(ah, AR_EEP_DB_2, AH_NULL), 3, 194, 0);
        } else {
+               HALDEBUG(ah, HAL_DEBUG_EEPROM, "%s: 5ghz: OB_5:%d, DB_5:%d\n",
+                   __func__,
+                   ath_hal_eepromGet(ah, AR_EEP_OB_5, AH_NULL),
+                   ath_hal_eepromGet(ah, AR_EEP_DB_5, AH_NULL));
                ar5416ModifyRfBuffer(priv->Bank6Data,
                    ath_hal_eepromGet(ah, AR_EEP_OB_5, AH_NULL), 3, 203, 0);
                ar5416ModifyRfBuffer(priv->Bank6Data,

Date: Sat Apr  2 00:27:22 2011
New Revision: 220259
URL: http://svn.freebsd.org/changeset/base/220259

Log:
  From ath9k - clear the RX descriptor status before recycling it.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c       Sat Apr  2 00:24:13 
2011        (r220258)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c       Sat Apr  2 00:27:22 
2011        (r220259)
_at__at_ -67,6 +67,7 _at__at_ ar5416SetupRxDesc(struct ath_hal *ah, st
     uint32_t size, u_int flags)
 {
        struct ar5416_desc *ads = AR5416DESC(ds);
+       HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
 
        HALASSERT((size &~ AR_BufLen) == 0);
 
_at__at_ -77,6 +78,10 _at__at_ ar5416SetupRxDesc(struct ath_hal *ah, st
        /* this should be enough */
        ads->ds_rxstatus8 &= ~AR_RxDone;
 
+       /* clear the rest of the status fields */
+       if (! pCap->halAutoSleepSupport)
+               OS_MEMZERO(&(ads->u), sizeof(ads->u));
+
        return AH_TRUE;
 }
 
> 
> -- 
> DE
> 

-- 
John Baldwin
Received on Wed Sep 07 2011 - 19:35:36 UTC

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