Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2006 13:54:09 -0600
From:      Eric Anderson <anderson@centtech.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Seagate 4GB CF drive in pccard slot won't work
Message-ID:  <4422FCE1.7040105@centtech.com>
In-Reply-To: <441F2302.8050402@centtech.com>
References:  <441ED31B.6030500@centtech.com>	<20060320.091339.133982805.imp@bsdimp.com>	<441ED6F2.3020504@centtech.com> <20060320.115438.97293590.imp@bsdimp.com> <441F2302.8050402@centtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eric Anderson wrote:
> M. Warner Losh wrote:
>> In message: <441ED6F2.3020504@centtech.com>
>>             Eric Anderson <anderson@centtech.com> writes:
>> : M. Warner Losh wrote:
>> : > In message: <441ED31B.6030500@centtech.com>
>> : >             Eric Anderson <anderson@centtech.com> writes:
>> : > : M. Warner Losh wrote:
>> : > : > In message: <441EBC32.2070508@centtech.com>
>> : > : >             Eric Anderson <anderson@centtech.com> writes:
>> : > : > : Warner Losh wrote:
>> : > : > : >> I'm running the latest 6.1-*, and inserting a cf->pccard 
>> reader with a : > : > : >> 4GB seagate cf drive installed gives me 
>> these messages:
>> : > : > : >>
>> : > : > : >> cbb0: ready never happened, status = 0d
>> : > : > : >> pcib3: pccard0 requested memory range 
>> 0xdfb00000-0xdfbfffff: good
>> : > : > : >> pccard0: Card has no functions!
>> : > : > : >> cbb0: PC Card card activation failed
>> : > : > : >>     : > : > : >
>> : > : > : > Something bad happened on the way to the forum...  Please 
>> set
>> : > : > : > hw.cbb.debug=1 and hw.pccard.debug=1 and try again.
>> : > : > : >   : > : > : : > : > : Here's the latest snippet from 
>> /var/log/messages with those two set:
>> : > : > : : > : > : Mar 20 08:27:47 neutrino kernel: Status is 
>> 0x30001911
>> : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: card inserted: 
>> event=0x00000000, : > : > : state=30001911
>> : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: chip_socket_enable
>> : > : > : Mar 20 08:27:47 neutrino kernel: cbb_pcic_socket_enable:
>> : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: cbb_power: 2V
>> : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: ready never 
>> happened, status = 0d
>> : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: read_cis
>> : > : > : Mar 20 08:27:47 neutrino kernel: pcib3: pccard0 requested 
>> memory range : > : > : 0xdfb00000-0xdfbfffff: good
>> : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: check_cis_quirks
>> : > : > : Mar 20 08:27:47 neutrino kernel: pccard0: Card has no 
>> functions!
>> : > : > : Mar 20 08:27:47 neutrino kernel: cbb0: PC Card card 
>> activation failed
>> : > : > : : > : > : : > : > : Anything else I can provide?
>> : > : > : : > : > : Also - when inserting this card in the slot, my 
>> system freezes for about : > : > : 5-6 seconds.
>> : > : >
>> : > : > hw.pccard.cis_debug=1 may help.
>> : > : >
>> : > : > The 2V cbb power looks very wrong, however...
>> : > : >
>> : > : > Warner
>> : > : >   : > : : > : Here's what I get with that enabled:
>> : > : : > : Mar 20 10:06:16 neutrino kernel: Status is 0x30001911
>> : > : Mar 20 10:06:16 neutrino kernel: cbb0: card inserted: 
>> event=0x00000000, : > : state=30001911
>> : > : Mar 20 10:06:16 neutrino kernel: pccard0: chip_socket_enable
>> : > : Mar 20 10:06:16 neutrino kernel: cbb_pcic_socket_enable:
>> : > : Mar 20 10:06:16 neutrino kernel: cbb0: cbb_power: 2V
>> : > : Mar 20 10:06:16 neutrino kernel: cbb0: ready never happened, 
>> status = 0d
>> : > : Mar 20 10:06:16 neutrino kernel: pccard0: read_cis
>> : > : Mar 20 10:06:16 neutrino kernel: pcib3: pccard0 requested 
>> memory range : > : 0xdfb00000-0xdfbfffff: good
>> : > : Mar 20 10:06:16 neutrino kernel: cis mem map 0xe7642000 
>> (resource: : > : 0xdfb10000)
>> : > : Mar 20 10:06:16 neutrino kernel: pccard0: CIS tuple chain:
>> : > : Mar 20 10:06:16 neutrino kernel: CISTPL_END
>> : > : Mar 20 10:06:16 neutrino kernel: ff
>> : > : Mar 20 10:06:16 neutrino kernel: cis mem map e7642000
>> : > : Mar 20 10:06:16 neutrino kernel: CISTPL_LINKTARGET expected, 
>> code ff : > : observed
>> : > : Mar 20 10:06:16 neutrino kernel: pccard0: check_cis_quirks
>> : > : Mar 20 10:06:16 neutrino kernel: pccard0: Card has no functions!
>> : > : Mar 20 10:06:16 neutrino kernel: cbb0: PC Card card activation 
>> failed
>> : > : : > : : > : Thanks for the quick reply!
>> : >
>> : > Based on what you've provided, here's my current theory of the 
>> crime:
>> : >
>> : > (1) The card is inserted.
>> : > (2) The bridge somehow thinks it is a X.X V card.  It reports 
>> this as
>> : >     2V in the dmesg because I arbitarily assigned numbers to X 
>> and Y.
>> : > (3) There's two ways this can happen.  One: is that new cards 
>> have been
>> : >     released that implement this standard and your bridge is 
>> detecting
>> : >     it, but either the card or bridge fails to implement it
>> : >     correctly.  Two: There is a problem with the bridge's memory
>> : >     allocation, so the cbb driver is really talking to something
>> : >     else.  Three: the bridge has a bug in detecting X.X V cards and
>> : >     they should be ignored.
>> : >
>> : > I'm guessing 'Three' is most likely.  How's your hacking skills?
>> : >   : : :) well, I'm really good at breaking things.   Point in the 
>> direction, : and I'll start looking.
>> Try apply the following (you'll have to do it by hand).  This turns
>> off the XV and YV bits always.  This code is src/sys/dev/pccbb/pccbb.c
>>
>> Warner
>>
>> static int
>> cbb_do_power(device_t brdev)
>> {
>>     struct cbb_softc *sc = device_get_softc(brdev);
>>     uint32_t voltage, curpwr;
>>     uint32_t status;
>>
>>     /* Don't enable OE (output enable) until power stable */
>>     exca_clrb(&sc->exca[0], EXCA_PWRCTL, EXCA_PWRCTL_OE);
>>
>> -    voltage = cbb_detect_voltage(brdev);
>> +    voltage = cbb_detect_voltage(brdev) & ~(CARD_XV_CARD | 
>> CARD_YV_CARD);
>>     curpwr = cbb_current_voltage(brdev);
>>     status = cbb_get(sc, CBB_SOCKET_STATE);
>>     if ((status & CBB_STATE_POWER_CYCLE) && (voltage & curpwr))
>>         return 0;
>>     /* Prefer lowest voltage supported */
>>     cbb_power(brdev, CARD_OFF);
>>     if (voltage & CARD_YV_CARD)
>>         cbb_power(brdev, CARD_VCC(YV));
>>     else if (voltage & CARD_XV_CARD)
>>         cbb_power(brdev, CARD_VCC(XV));
>>     else if (voltage & CARD_3V_CARD)
>>         cbb_power(brdev, CARD_VCC(3));
>>     else if (voltage & CARD_5V_CARD)
>>         cbb_power(brdev, CARD_VCC(5));
>>     else {
>>         device_printf(brdev, "Unknown card voltage\n");
>>         return (ENXIO);
>>     }
>>     return (0);
>> }
>>   
>
> Yep - that makes it find it:
>
> Mar 20 15:43:22 neutrino kernel: pcib3: pccard0 requested memory range 
> 0xdfb00000-0xdfbfffff: good
> Mar 20 15:43:22 neutrino kernel: pccard0: CIS version PCCARD 2.0 or 2.1
> Mar 20 15:43:22 neutrino kernel: pccard0: CIS info: SEAGATE, ST1
> Mar 20 15:43:22 neutrino kernel: pccard0: Manufacturer code 0x111, 
> product 0x0
> Mar 20 15:43:22 neutrino kernel: pccard0: function 0: fixed disk, ccr 
> addr 200 mask f
> Mar 20 15:43:22 neutrino kernel: pccard0: function 0, config table 
> entry 0: memory card; irq mask 0; mwait_required rdybsy_active powerdown
> Mar 20 15:43:22 neutrino kernel: pccard0: function 0, config table 
> entry 1: I/O card; irq mask ffff; iomask 4, iospace 0-f; rdybsy_active 
> io8 io16 irqshare irqpulse irqlevel powerdown
> Mar 20 15:43:22 neutrino kernel: pccard0: function 0, config table 
> entry 2: I/O card; irq mask 4000; iomask a, iospace 1f0-1f7 3f6-3f7; 
> rdybsy_active io8 io16 irqshare irqpulse irqlevel powerdown
> Mar 20 15:43:22 neutrino kernel: pccard0: function 0, config table 
> entry 3: I/O card; irq mask 4000; iomask a, iospace 170-177 376-377; 
> rdybsy_active io8 io16 irqshare irqpulse irqlevel powerdown
> Mar 20 15:43:22 neutrino kernel: pcib3: pccard0 requested memory range 
> 0xdfb00000-0xdfbfffff: good
> Mar 20 15:43:22 neutrino kernel: ata2: <SEAGATE ST1> at port 
> 0x100-0x10f irq 19 function 0 config 1 on pccard0
> Mar 20 15:43:22 neutrino kernel: ata2: reset tp1 mask=01 ostat0=50 
> ostat1=00
> Mar 20 15:43:22 neutrino kernel: ata2: stat0=0x50 err=0x01 lsb=0x00 
> msb=0x00
> Mar 20 15:43:22 neutrino kernel: ata2: reset tp2 stat0=50 stat1=00 
> devices=0x1<ATA_MASTER>
> Mar 20 15:43:22 neutrino kernel: ata2: [MPSAFE]
> Mar 20 15:43:22 neutrino kernel: ata0-master: pio=PIO4 
> wdma=UNSUPPORTED udma=UNSUPPORTED cable=40 wire
> Mar 20 15:43:23 neutrino kernel: ata2: reiniting channel ..
> Mar 20 15:43:23 neutrino kernel: ata2: reset tp1 mask=01 ostat0=d0 
> ostat1=00
> Mar 20 15:43:23 neutrino kernel: ata2: stat0=0x50 err=0x01 lsb=0x00 
> msb=0x00
> Mar 20 15:43:23 neutrino kernel: ata2: reset tp2 stat0=50 stat1=00 
> devices=0x1<ATA_MASTER>
> Mar 20 15:43:23 neutrino kernel: ata2: reinit done ..
> Mar 20 15:43:23 neutrino kernel: ad4: FAILURE - SETFEATURES ENABLE 
> RCACHE timed out
> Mar 20 15:43:23 neutrino kernel: ad4: 3906MB <Seagate ST64022CF 3.01> 
> at ata2-master PIO4
> Mar 20 15:43:23 neutrino kernel: ad4: 7999488 sectors [7936C/16H/63S] 
> 1 sectors/interrupt 1 depth queue
> Mar 20 15:43:23 neutrino kernel: GEOM: new disk ad4
>
> With all the debugging turned on:
>
> Mar 20 15:46:44 neutrino kernel: Status is 0x30001911
> Mar 20 15:46:44 neutrino kernel: cbb0: card inserted: 
> event=0x00000000, state=30001911
> Mar 20 15:46:44 neutrino kernel: pccard0: chip_socket_enable
> Mar 20 15:46:44 neutrino kernel: cbb_pcic_socket_enable:
> Mar 20 15:46:44 neutrino kernel: cbb0: cbb_power: 3V
> Mar 20 15:46:44 neutrino kernel: pccard0: read_cis
> Mar 20 15:46:44 neutrino kernel: pcib3: pccard0 requested memory range 
> 0xdfb00000-0xdfbfffff: good
> Mar 20 15:46:44 neutrino kernel: cis mem map 0xe755a000 (resource: 
> 0xdfb10000)
> Mar 20 15:46:44 neutrino kernel: pccard0: CIS tuple chain:
> Mar 20 15:46:44 neutrino kernel: CISTPL_DEVICE type=funcspec speed=ext
> Mar 20 15:46:44 neutrino kernel: 01 04 df 12 01 ff
> Mar 20 15:46:44 neutrino kernel: unhandled CISTPL 1c
> Mar 20 15:46:44 neutrino kernel: 1c 05 03 df 12 01 ff
> Mar 20 15:46:44 neutrino kernel: unhandled CISTPL 18
> Mar 20 15:46:44 neutrino kernel: 18 02 df 01
> Mar 20 15:46:44 neutrino kernel: CISTPL_MANFID
> Mar 20 15:46:44 neutrino kernel: 20 04 11 01 00 00
> Mar 20 15:46:44 neutrino kernel: CISTPL_VERS_1
> Mar 20 15:46:44 neutrino kernel: 15 0f 04 01 53 45 41 47 41 54 45 00 
> 53 54 31 00
> Mar 20 15:46:44 neutrino kernel: ff
> Mar 20 15:46:44 neutrino kernel: CISTPL_FUNCID
> Mar 20 15:46:44 neutrino kernel: 21 02 04 01
> Mar 20 15:46:44 neutrino kernel: CISTPL_FUNCE
> Mar 20 15:46:44 neutrino kernel: 22 02 01 01
> Mar 20 15:46:44 neutrino kernel: CISTPL_FUNCE
> Mar 20 15:46:44 neutrino kernel: 22 03 02 08 0f
> Mar 20 15:46:44 neutrino kernel: CISTPL_CONFIG
> Mar 20 15:46:44 neutrino kernel: 1a 05 01 07 00 02 0f
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 0c c0 c0 a1 27 55 4d 5d b6 1e 08 
> 00 20
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 07 00 01 21 b5 1e b6 1e
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 0e c1 41 99 27 55 4d 5d b6 1e 64 
> f0 ff ff 20
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 07 01 01 21 b5 1e b6 1e
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 13 c2 41 99 27 55 4d 5d b6 1e ea 
> 61 f0 01 07
> Mar 20 15:46:44 neutrino kernel: f6 03 01 ee 20
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 07 02 01 21 b5 1e b6 1e
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 13 c3 41 99 27 55 4d 5d b6 1e ea 
> 61 70 01 07
> Mar 20 15:46:44 neutrino kernel: 76 03 01 ee 20
> Mar 20 15:46:44 neutrino kernel: CISTPL_CFTABLE_ENTRY
> Mar 20 15:46:44 neutrino kernel: 1b 07 03 01 21 b5 1e b6 1e
> Mar 20 15:46:44 neutrino kernel: unhandled CISTPL 14
> Mar 20 15:46:44 neutrino kernel: CISTPL_NO_LINK
> Mar 20 15:46:44 neutrino kernel: 14 00
> Mar 20 15:46:44 neutrino kernel: CISTPL_END
> Mar 20 15:46:44 neutrino kernel: ff
> Mar 20 15:46:44 neutrino kernel: pccard0: check_cis_quirks
> Mar 20 15:46:44 neutrino kernel: pccard0: CIS version PCCARD 2.0 or 2.1
> Mar 20 15:46:44 neutrino kernel: pccard0: CIS info: SEAGATE, ST1
> Mar 20 15:46:44 neutrino kernel: pccard0: Manufacturer code 0x111, 
> product 0x0
> Mar 20 15:46:44 neutrino kernel: pccard0: function 0: fixed disk, ccr 
> addr 200 mask f
> Mar 20 15:46:44 neutrino kernel: pccard0: function 0, config table 
> entry 0: memory card; irq mask 0; mwait_required rdybsy_active powerdown
> Mar 20 15:46:44 neutrino kernel: pccard0: function 0, config table 
> entry 1: I/O card; irq mask ffff; iomask 4, iospace 0-f; rdybsy_active 
> io8 io16 irqshare irqpulse irqlevel powerdown
> Mar 20 15:46:44 neutrino kernel: pccard0: function 0, config table 
> entry 2: I/O card; irq mask 4000; iomask a, iospace 1f0-1f7 3f6-3f7; 
> rdybsy_active io8 io16 irqshare irqpulse irqlevel powerdown
> Mar 20 15:46:44 neutrino kernel: pccard0: function 0, config table 
> entry 3: I/O card; irq mask 4000; iomask a, iospace 170-177 376-377; 
> rdybsy_active io8 io16 irqshare irqpulse irqlevel powerdown
> Mar 20 15:46:44 neutrino kernel: pccard0: functions scanning
> Mar 20 15:46:44 neutrino kernel: pccard0: Card has 1 functions. 
> pccard_mfc is 0
> Mar 20 15:46:44 neutrino kernel: pccard0: I/O rid 0 start 0 end ffffffff
> Mar 20 15:46:44 neutrino kernel: cbb_pcic_socket_enable:
> Mar 20 15:46:44 neutrino kernel: cbb0: cbb_power: 0V
> Mar 20 15:46:44 neutrino kernel: cbb0: cbb_power: 3V
> Mar 20 15:46:44 neutrino kernel: pcib3: pccard0 requested memory range 
> 0xdfb00000-0xdfbfffff: good
> Mar 20 15:46:44 neutrino kernel: pccard0: ccr_res == 
> dfb01000-dfb013ff, base=200
> Mar 20 15:46:44 neutrino kernel: pccard0: function 0 CCR at 0 offset 
> 200: 41 80 2e 0, 0 0 0 0, 0
> Mar 20 15:46:44 neutrino kernel: ata2: <SEAGATE ST1> at port 
> 0x100-0x10f irq 19 function 0 config 1 on pccard0
> Mar 20 15:46:44 neutrino kernel: ata2: reset tp1 mask=01 ostat0=50 
> ostat1=00
> Mar 20 15:46:44 neutrino kernel: ata2: stat0=0x50 err=0x01 lsb=0x00 
> msb=0x00
> Mar 20 15:46:44 neutrino kernel: ata2: reset tp2 stat0=50 stat1=00 
> devices=0x1<ATA_MASTER>
> Mar 20 15:46:44 neutrino kernel: ata2: [MPSAFE]
> Mar 20 15:46:44 neutrino kernel: ata0-master: pio=PIO4 
> wdma=UNSUPPORTED udma=UNSUPPORTED cable=40 wire
> Mar 20 15:46:46 neutrino kernel: ata2: reiniting channel ..
> Mar 20 15:46:46 neutrino kernel: ata2: reset tp1 mask=01 ostat0=d0 
> ostat1=00
> Mar 20 15:46:46 neutrino kernel: ata2: stat0=0x50 err=0x01 lsb=0x00 
> msb=0x00
> Mar 20 15:46:46 neutrino kernel: ata2: reset tp2 stat0=50 stat1=00 
> devices=0x1<ATA_MASTER>
> Mar 20 15:46:46 neutrino kernel: ata2: reinit done ..
> Mar 20 15:46:46 neutrino kernel: ad4: FAILURE - SETFEATURES ENABLE 
> RCACHE timed out
> Mar 20 15:46:46 neutrino kernel: ad4: 3906MB <Seagate ST64022CF 3.01> 
> at ata2-master PIO4
> Mar 20 15:46:46 neutrino kernel: ad4: 7999488 sectors [7936C/16H/63S] 
> 1 sectors/interrupt 1 depth queue
> Mar 20 15:46:46 neutrino kernel: GEOM: new disk ad4
> Mar 20 15:46:46 neutrino kernel: ad4: Adaptec check1 failed
> Mar 20 15:46:46 neutrino kernel: ad4: LSI (v3) check1 failed
> Mar 20 15:46:46 neutrino kernel: ad4: LSI (v2) check1 failed
> Mar 20 15:46:46 neutrino kernel: ad4: FreeBSD check1 failed
> Mar 20 15:46:46 neutrino kernel: pccard0: function 0 CCR at 0 offset 
> 200 mask f: 41 82 2e 0, 4a 4a 4a 4a, 4a
>
>
> Anything else you would like me to do?

Is this a 'fix' or a workaround?  If it's a fix, do you think it'll get 
included and trickled down to 6.1 in time?


Thanks!

Eric




-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4422FCE1.7040105>