public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
@ 2004-08-29  8:01 Marc Strämke
  2004-08-29 13:38 ` Neil Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Marc Strämke @ 2004-08-29  8:01 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Hello all,

Iam running an embedded system out of Compactflash. Kernel version is 
2.4.27 (happens with all version i tried, 2.4.21-2.4.27).
The system is in use for a few month already, but i started to 
experience problems with a newer revision of the Compactflash Cards from 
Sandisk, when reading or writing to the device data gets corrupted and 
the following message is written to the logfiles:

hdb: drive not ready for command
hdb: status error: status=0x58 { DriveReady SeekComplete DataRequest }

hdb: drive not ready for command
hdb: irq timeout: status=0xd0 { Busy }

ide0: reset: master: error (0x0a?)


I tried setting a longer WAIT_DRQ timeout in ide.h, but that doesnt 
solve the problem (even with really large values, about 10 times the 
default).
One thing which is interesting about the new card is that it isnt 
detected by the kernel as a CFA device, but just a regular ATA device.

I attached the output of hdparm -I for both cards if that helps.
The IDE controller is a VIA VT82C586A/B/VT82C686/A/B/VT823x/A/C 
(according to /proc/pci).
lspci -vv output is attached too.

Thanks in Advance for any suggestions to this problem.

Marc Strämke



[-- Attachment #2: CF_CARD_IDS --]
[-- Type: text/plain, Size: 2057 bytes --]

Works: 
CompactFlash ATA device, with removable media
        Model Number:       SanDisk SDCFB-128
        Serial Number:      101913J0803Q3424
        Firmware Revision:  Vdi 1.24
Standards:
        Likely used: 4
Configuration:
        Logical         max     current
        cylinders       980     497
        heads           8       8
        sectors/track   32      63
        --
        bytes/track: 0  bytes/sector: 576
        CHS current addressable sectors:     250488
        LBA    user addressable sectors:     250880
        device size with M = 1024*1024:         122 MBytes
        device size with M = 1000*1000:         128 MBytes
Capabilities:
        LBA, IORDY(may be)(cannot be disabled)
        Buffer size: 1.0kB      bytes avail on r/w long: 4      Queue depth: 1
        Standby timer values: spec'd by Vendor
        R/W multiple sector transfer: Max = 1   Current = 1
        DMA: not supported
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns


does not works:

ATA device, with non-removable media
        Model Number:       SanDisk SDCFB-128
        Serial Number:      109909E2004C5801
        Firmware Revision:  HDX 2.15
Standards:
        Supported: 10
        Likely used: 10
Configuration:
        Logical         max     current
        cylinders       980     980
        heads           8       8
        sectors/track   32      32
        --
        CHS current addressable sectors:     250880
        LBA    user addressable sectors:     250880
        device size with M = 1024*1024:         122 MBytes
        device size with M = 1000*1000:         128 MBytes
Capabilities:
        LBA, IORDY(may be)(cannot be disabled)
        Queue depth: 1
        Standby timer values: spec'd by Vendor
        R/W multiple sector transfer: Max = 1   Current = 1
        DMA: mdma0 mdma1 *mdma2
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns

[-- Attachment #3: lspci --]
[-- Type: text/plain, Size: 5288 bytes --]

00:00.0 Class 0600: 1106:0691 (rev c4)
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
	Latency: 8
	Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
	Capabilities: [a0] AGP version 2.0
		Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3- Rate=x1,x2
		Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- Rate=<none>
	Capabilities: [c0] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:01.0 Class 0604: 1106:8598
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
	Latency: 0
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	Memory behind bridge: e4000000-e5ffffff
	BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B-
	Capabilities: [80] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:07.0 Class 0601: 1106:0686 (rev 40)
	Subsystem: 1106:0000
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0
	Capabilities: [c0] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:07.1 Class 0101: 1106:0571 (rev 06) (prog-if 8a [Master SecP PriP])
	Subsystem: 1106:0571
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 32
	Region 4: I/O ports at d000 [size=16]
	Capabilities: [c0] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:07.2 Class 0c03: 1106:3038 (rev 1a)
	Subsystem: 0925:1234
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 32, cache line size 08
	Interrupt: pin D routed to IRQ 12
	Region 4: I/O ports at d400 [size=32]
	Capabilities: [80] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:07.4 Class 0680: 1106:3057 (rev 40)
	Subsystem: 1106:3057
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Capabilities: [68] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0b.0 Class 0200: 10ec:8139 (rev 10)
	Subsystem: 10ec:8139
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 32 (8000ns min, 16000ns max)
	Interrupt: pin A routed to IRQ 10
	Region 0: I/O ports at d800 [size=256]
	Region 1: Memory at e7042000 (32-bit, non-prefetchable) [size=256]
	Expansion ROM at <unassigned> [disabled] [size=16K]
	Capabilities: [50] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0c.0 Class 0200: 10ec:8139 (rev 10)
	Subsystem: 10ec:8139
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 32 (8000ns min, 16000ns max)
	Interrupt: pin A routed to IRQ 11
	Region 0: I/O ports at dc00 [size=256]
	Region 1: Memory at e7040000 (32-bit, non-prefetchable) [size=256]
	Expansion ROM at <unassigned> [disabled] [size=16K]
	Capabilities: [50] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:13.0 Class ff00: 10b5:9050 (rev 02)
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Region 0: Memory at e7041000 (32-bit, non-prefetchable) [size=128]
	Region 1: I/O ports at e000 [size=128]
	Region 2: Memory at e7000000 (32-bit, non-prefetchable) [size=256K]

01:00.0 Class 0300: 102c:00c0 (rev 64)
	Subsystem: 102c:00c0
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Interrupt: pin A routed to IRQ 0
	Region 0: Memory at e4000000 (32-bit, non-prefetchable) [size=16M]
	Expansion ROM at <unassigned> [disabled] [size=256K]


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-29  8:01 Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus) Marc Strämke
@ 2004-08-29 13:38 ` Neil Horman
  2004-08-29 16:06   ` Marc Strämke
  0 siblings, 1 reply; 13+ messages in thread
From: Neil Horman @ 2004-08-29 13:38 UTC (permalink / raw)
  To: Marc Strämke; +Cc: linux-kernel

Marc Strämke wrote:

> Hello all,
>
> Iam running an embedded system out of Compactflash. Kernel version is 
> 2.4.27 (happens with all version i tried, 2.4.21-2.4.27).
> The system is in use for a few month already, but i started to 
> experience problems with a newer revision of the Compactflash Cards 
> from Sandisk, when reading or writing to the device data gets 
> corrupted and the following message is written to the logfiles:
>
> hdb: drive not ready for command
> hdb: status error: status=0x58 { DriveReady SeekComplete DataRequest }
>
> hdb: drive not ready for command
> hdb: irq timeout: status=0xd0 { Busy }
>
> ide0: reset: master: error (0x0a?)
>
>
> I tried setting a longer WAIT_DRQ timeout in ide.h, but that doesnt 
> solve the problem (even with really large values, about 10 times the 
> default).
> One thing which is interesting about the new card is that it isnt 
> detected by the kernel as a CFA device, but just a regular ATA device.
>
> I attached the output of hdparm -I for both cards if that helps.
> The IDE controller is a VIA VT82C586A/B/VT82C686/A/B/VT823x/A/C 
> (according to /proc/pci).
> lspci -vv output is attached too.
>
> Thanks in Advance for any suggestions to this problem.
>
> Marc Strämke
>
>
>------------------------------------------------------------------------
>
>Works: 
>CompactFlash ATA device, with removable media
>        Model Number:       SanDisk SDCFB-128
>        Serial Number:      101913J0803Q3424
>        Firmware Revision:  Vdi 1.24
>Standards:
>        Likely used: 4
>Configuration:
>        Logical         max     current
>        cylinders       980     497
>        heads           8       8
>        sectors/track   32      63
>        --
>        bytes/track: 0  bytes/sector: 576
>        CHS current addressable sectors:     250488
>        LBA    user addressable sectors:     250880
>        device size with M = 1024*1024:         122 MBytes
>        device size with M = 1000*1000:         128 MBytes
>Capabilities:
>        LBA, IORDY(may be)(cannot be disabled)
>        Buffer size: 1.0kB      bytes avail on r/w long: 4      Queue depth: 1
>        Standby timer values: spec'd by Vendor
>        R/W multiple sector transfer: Max = 1   Current = 1
>        DMA: not supported
>        PIO: pio0 pio1 pio2 pio3 pio4
>             Cycle time: no flow control=120ns  IORDY flow control=120ns
>
>
>does not works:
>
>ATA device, with non-removable media
>        Model Number:       SanDisk SDCFB-128
>        Serial Number:      109909E2004C5801
>        Firmware Revision:  HDX 2.15
>Standards:
>        Supported: 10
>        Likely used: 10
>Configuration:
>        Logical         max     current
>        cylinders       980     980
>        heads           8       8
>        sectors/track   32      32
>        --
>        CHS current addressable sectors:     250880
>        LBA    user addressable sectors:     250880
>        device size with M = 1024*1024:         122 MBytes
>        device size with M = 1000*1000:         128 MBytes
>Capabilities:
>        LBA, IORDY(may be)(cannot be disabled)
>        Queue depth: 1
>        Standby timer values: spec'd by Vendor
>        R/W multiple sector transfer: Max = 1   Current = 1
>        DMA: mdma0 mdma1 *mdma2
>             Cycle time: min=120ns recommended=120ns
>        PIO: pio0 pio1 pio2 pio3 pio4
>             Cycle time: no flow control=120ns  IORDY flow control=120ns
>  
>
>------------------------------------------------------------------------
>
>00:00.0 Class 0600: 1106:0691 (rev c4)
>	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
>	Latency: 8
>	Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
>	Capabilities: [a0] AGP version 2.0
>		Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3- Rate=x1,x2
>		Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- Rate=<none>
>	Capabilities: [c0] Power Management version 2
>		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:01.0 Class 0604: 1106:8598
>	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR-
>	Latency: 0
>	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>	Memory behind bridge: e4000000-e5ffffff
>	BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B-
>	Capabilities: [80] Power Management version 2
>		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:07.0 Class 0601: 1106:0686 (rev 40)
>	Subsystem: 1106:0000
>	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Latency: 0
>	Capabilities: [c0] Power Management version 2
>		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:07.1 Class 0101: 1106:0571 (rev 06) (prog-if 8a [Master SecP PriP])
>	Subsystem: 1106:0571
>	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Latency: 32
>	Region 4: I/O ports at d000 [size=16]
>	Capabilities: [c0] Power Management version 2
>		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:07.2 Class 0c03: 1106:3038 (rev 1a)
>	Subsystem: 0925:1234
>	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Latency: 32, cache line size 08
>	Interrupt: pin D routed to IRQ 12
>	Region 4: I/O ports at d400 [size=32]
>	Capabilities: [80] Power Management version 2
>		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:07.4 Class 0680: 1106:3057 (rev 40)
>	Subsystem: 1106:3057
>	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Capabilities: [68] Power Management version 2
>		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:0b.0 Class 0200: 10ec:8139 (rev 10)
>	Subsystem: 10ec:8139
>	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Latency: 32 (8000ns min, 16000ns max)
>	Interrupt: pin A routed to IRQ 10
>	Region 0: I/O ports at d800 [size=256]
>	Region 1: Memory at e7042000 (32-bit, non-prefetchable) [size=256]
>	Expansion ROM at <unassigned> [disabled] [size=16K]
>	Capabilities: [50] Power Management version 2
>		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:0c.0 Class 0200: 10ec:8139 (rev 10)
>	Subsystem: 10ec:8139
>	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Latency: 32 (8000ns min, 16000ns max)
>	Interrupt: pin A routed to IRQ 11
>	Region 0: I/O ports at dc00 [size=256]
>	Region 1: Memory at e7040000 (32-bit, non-prefetchable) [size=256]
>	Expansion ROM at <unassigned> [disabled] [size=16K]
>	Capabilities: [50] Power Management version 2
>		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
>		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>00:13.0 Class ff00: 10b5:9050 (rev 02)
>	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Region 0: Memory at e7041000 (32-bit, non-prefetchable) [size=128]
>	Region 1: I/O ports at e000 [size=128]
>	Region 2: Memory at e7000000 (32-bit, non-prefetchable) [size=256K]
>
>01:00.0 Class 0300: 102c:00c0 (rev 64)
>	Subsystem: 102c:00c0
>	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping+ SERR- FastB2B-
>	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>	Interrupt: pin A routed to IRQ 0
>	Region 0: Memory at e4000000 (32-bit, non-prefetchable) [size=16M]
>	Expansion ROM at <unassigned> [disabled] [size=256K]
>
>  
>
Its been awhile, but the last time that I looked at the relevant code, 
there was a table of drive vendor/device strings that were used to 
identify CFA devices and differentiate them from regular ide devices.  
If this particular device isn't a match in that table, it would be 
mis-identified, and that could be leading to your above problem.
Neil

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *nhorman@redhat.com
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-29 13:38 ` Neil Horman
@ 2004-08-29 16:06   ` Marc Strämke
  2004-08-30  0:08     ` Neil Horman
  0 siblings, 1 reply; 13+ messages in thread
From: Marc Strämke @ 2004-08-29 16:06 UTC (permalink / raw)
  To: linux-kernel

Neil Horman wrote:
> Its been awhile, but the last time that I looked at the relevant code, 
> there was a table of drive vendor/device strings that were used to 
> identify CFA devices and differentiate them from regular ide devices.  
> If this particular device isn't a match in that table, it would be 
> mis-identified, and that could be leading to your above problem.
> Neil
> 

Thx for the suggestion. The only table i could find is in 
drive_is_flashcard, which is only checked if drive->removable is set, 
which is not the case with the newer card (but is with the old one).
Another thing which is weird is that the old card returns an id->config 
value of 0x848a which according to manuals from SanDisk is for a 
Compactflash card NOT running in True Ide mode, but instead in memory 
mapped IO mode (iam no expert for Compactflash, so i dont even know the 
exact difference), but as far as i can tell are both cards wired by the 
IDE adapter so that they should run in True IDE mode, and if i 
understand the Compactflash specification correctly, this is the only 
mode of operation which is electrically compatible with the IDE/ATA bus, 
isnt it?
I tried forcing both the drive->removable and drive->is_flash flags to 
the true, my dmesg output then shows me the card as a CFA DISK drive, 
but i still get the same errors when reading or writing from/to the device.

TIA for any further hints,
Marc


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-29 16:06   ` Marc Strämke
@ 2004-08-30  0:08     ` Neil Horman
  2004-08-30  1:07       ` Marcelo Tosatti
  2004-08-30  7:12       ` Meelis Roos
  0 siblings, 2 replies; 13+ messages in thread
From: Neil Horman @ 2004-08-30  0:08 UTC (permalink / raw)
  To: Marc Strämke; +Cc: linux-kernel

Marc Strämke wrote:

> Neil Horman wrote:
>
>> Its been awhile, but the last time that I looked at the relevant 
>> code, there was a table of drive vendor/device strings that were used 
>> to identify CFA devices and differentiate them from regular ide 
>> devices.  If this particular device isn't a match in that table, it 
>> would be mis-identified, and that could be leading to your above 
>> problem.
>> Neil
>>
>
> Thx for the suggestion. The only table i could find is in 
> drive_is_flashcard, which is only checked if drive->removable is set, 
> which is not the case with the newer card (but is with the old one).
> Another thing which is weird is that the old card returns an 
> id->config value of 0x848a which according to manuals from SanDisk is 
> for a Compactflash card NOT running in True Ide mode, but instead in 
> memory mapped IO mode (iam no expert for Compactflash, so i dont even 
> know the exact difference), but as far as i can tell are both cards 
> wired by the IDE adapter so that they should run in True IDE mode, and 
> if i understand the Compactflash specification correctly, this is the 
> only mode of operation which is electrically compatible with the 
> IDE/ATA bus, isnt it?
> I tried forcing both the drive->removable and drive->is_flash flags to 
> the true, my dmesg output then shows me the card as a CFA DISK drive, 
> but i still get the same errors when reading or writing from/to the 
> device.
>
> TIA for any further hints,
> Marc
>
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

What kernel are you looking at?  I'm looking at 2.4.21, and it seems to 
get checked more-or-less universally.  Also, I noticed this:
|| !strncmp(id->model, "SunDisk SDCFB", 13)    /* SunDisk */
I've not heard of SunDisk.  SunDisk->SanDisk == Typo?
Are you using a SanDisk CFA card?  Could this perhaps be part of your issue?
Neil

-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *nhorman@redhat.com
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30  0:08     ` Neil Horman
@ 2004-08-30  1:07       ` Marcelo Tosatti
  2004-08-30  7:01         ` Marc Strämke
  2004-08-30 13:04         ` Alan Cox
  2004-08-30  7:12       ` Meelis Roos
  1 sibling, 2 replies; 13+ messages in thread
From: Marcelo Tosatti @ 2004-08-30  1:07 UTC (permalink / raw)
  To: Neil Horman; +Cc: Marc Strämke, linux-kernel

On Sun, Aug 29, 2004 at 08:08:01PM -0400, Neil Horman wrote:
> Marc Strämke wrote:
> 
> >Neil Horman wrote:
> >
> >>Its been awhile, but the last time that I looked at the relevant 
> >>code, there was a table of drive vendor/device strings that were used 
> >>to identify CFA devices and differentiate them from regular ide 
> >>devices.  If this particular device isn't a match in that table, it 
> >>would be mis-identified, and that could be leading to your above 
> >>problem.
> >>Neil
> >>
> >
> >Thx for the suggestion. The only table i could find is in 
> >drive_is_flashcard, which is only checked if drive->removable is set, 
> >which is not the case with the newer card (but is with the old one).
> >Another thing which is weird is that the old card returns an 
> >id->config value of 0x848a which according to manuals from SanDisk is 
> >for a Compactflash card NOT running in True Ide mode, but instead in 
> >memory mapped IO mode (iam no expert for Compactflash, so i dont even 
> >know the exact difference), but as far as i can tell are both cards 
> >wired by the IDE adapter so that they should run in True IDE mode, and 
> >if i understand the Compactflash specification correctly, this is the 
> >only mode of operation which is electrically compatible with the 
> >IDE/ATA bus, isnt it?
> >I tried forcing both the drive->removable and drive->is_flash flags to 
> >the true, my dmesg output then shows me the card as a CFA DISK drive, 
> >but i still get the same errors when reading or writing from/to the 
> >device.
> >
> >TIA for any further hints,
> >Marc
> >
> >-
> >To unsubscribe from this list: send the line "unsubscribe 
> >linux-kernel" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >Please read the FAQ at  http://www.tux.org/lkml/
> 
> What kernel are you looking at?  I'm looking at 2.4.21, and it seems to 
> get checked more-or-less universally.  Also, I noticed this:
> || !strncmp(id->model, "SunDisk SDCFB", 13)    /* SunDisk */
> I've not heard of SunDisk.  SunDisk->SanDisk == Typo?
> Are you using a SanDisk CFA card?  Could this perhaps be part of your issue?

Indeed this is a typo but has been fixed on 2.4.26:

        if (drive->removable && id != NULL) {
                if (id->config == 0x848a) return 1;     /* CompactFlash */
                if (!strncmp(id->model, "KODAK ATA_FLASH", 15)  /* Kodak */
                 || !strncmp(id->model, "Hitachi CV", 10)       /* Hitachi */
                 || !strncmp(id->model, "SunDisk SDCFB", 13)    /* old SanDisk */
                 || !strncmp(id->model, "SanDisk SDCFB", 13)    /* SanDisk */
                 || !strncmp(id->model, "HAGIWARA HPC", 12)     /* Hagiwara */
                 || !strncmp(id->model, "LEXAR ATA_FLASH", 15)  /* Lexar */
                 || !strncmp(id->model, "ATA_FLASH", 9))        /* Simple Tech */
                {

I haven't got much of a clue about IDE, but I can see the newer card supports
DMA, and the older doesnt, but you are probably not using DMA on that? whats
the output of "hdparm /dev/hda".

Also can you show us dmesg from both old and new cards.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30  1:07       ` Marcelo Tosatti
@ 2004-08-30  7:01         ` Marc Strämke
  2004-08-30 14:23           ` Neil Horman
  2004-08-30 13:04         ` Alan Cox
  1 sibling, 1 reply; 13+ messages in thread
From: Marc Strämke @ 2004-08-30  7:01 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1752 bytes --]

Marcelo Tosatti wrote:
> Indeed this is a typo but has been fixed on 2.4.26:
> 
>         if (drive->removable && id != NULL) {
It never gets past this check because drive->removable is not set!

>                 if (id->config == 0x848a) return 1;     /* CompactFlash */
>                 if (!strncmp(id->model, "KODAK ATA_FLASH", 15)  /* Kodak */
>                  || !strncmp(id->model, "Hitachi CV", 10)       /* Hitachi */
>                  || !strncmp(id->model, "SunDisk SDCFB", 13)    /* old SanDisk */
>                  || !strncmp(id->model, "SanDisk SDCFB", 13)    /* SanDisk */
>                  || !strncmp(id->model, "HAGIWARA HPC", 12)     /* Hagiwara */
>                  || !strncmp(id->model, "LEXAR ATA_FLASH", 15)  /* Lexar */
>                  || !strncmp(id->model, "ATA_FLASH", 9))        /* Simple Tech */
>                 {
> 
> I haven't got much of a clue about IDE, but I can see the newer card supports
> DMA, and the older doesnt, but you are probably not using DMA on that? whats
> the output of "hdparm /dev/hda".
Ive attached the hdparm output, which is exactly the same for both cards.

> 
> Also can you show us dmesg from both old and new cards.
> 
I've noticed another interesting thing, when doing the same stuff which 
bails out on the new card (reading or writing larger amounts of data), 
sometimes with the old card a kernel message "VFS: Disk change detected 
on device 03:00" appears in the logfiles, which doesnt appear with the 
new card.

Also attached are the both dmesg outputs from booting up and the 
occurence of the error, respectively the disk change event. This logs 
are from an Adeos/Rtai patched kernel, but the exact same problem 
appears when booting with a stock 2.4.27 kernel to.


[-- Attachment #2: hdparm_output --]
[-- Type: text/plain, Size: 270 bytes --]


/dev/ide/host0/bus0/target1/lun0/disc:
 multcount    =  0 (off)
 IO_support   =  1 (32-bit)
 unmaskirq    =  1 (on)
 using_dma    =  0 (off)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 980/8/32, sectors = 250880, start = 0

[-- Attachment #3: dmesg_functioning --]
[-- Type: text/plain, Size: 7644 bytes --]

d upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
ACPI: Power Button (FF) [PWRF]
ACPI: Processor [CPU0] (supports C1 C2, 2 throttling states)
parport0: PC-style at 0x378 [PCSPP,EPP]
parport_pc: Via 686A parallel port: io=0x378
vesafb: framebuffer at 0xe5000000, mapped to 0xc8806000, size 1875k
vesafb: mode is 800x600x16, linelength=1600, pages=0
vesafb: protected mode interface info at c000:9570
vesafb: scrolling: redraw
vesafb: directcolor: size=0:5:6:5, shift=0:11:5:0
Console: switching to colour frame buffer device 100x37
fb0: VESA VGA frame buffer device
Detected PS/2 Mouse Port.
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI ISAPNP enabled
keyboard: Timeout - AT keyboard not present?(ed)
keyboard: Timeout - AT keyboard not present?(f4)
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
ttyS02 at 0x03e8 (irq = 4) is a 16550A
lp0: using parport0 (polling).
Real Time Clock Driver v1.10f
Non-volatile memory driver v1.2
loop: loaded (max 8 devices)
8139too Fast Ethernet driver 0.9.26
eth0: RealTek RTL8139 at 0xc89dc000, 00:60:e0:03:2b:3f, IRQ 11
eth0:  Identified 8139 chip type 'RTL-8139C'
eth1: RealTek RTL8139 at 0xc89de000, 00:60:e0:03:2b:3e, IRQ 10
eth1:  Identified 8139 chip type 'RTL-8139C'
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
    ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:pio, hdd:pio
hda: SanDisk SDCFB-128, CFA DISK drive
ide2: ports already in use, skipping probe
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: attached ide-disk driver.
hda: 250880 sectors (128 MB) w/1KiB Cache, CHS=980/8/32
Partition check:
 /dev/ide/host0/bus0/target0/lun0: p1
SCSI subsystem driver Revision: 1.00
kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
host/uhci.c: USB Universal Host Controller Interface driver v1.1
host/uhci.c: USB UHCI at I/O 0xd400, IRQ 12
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
usb.c: registered new driver usblp
printer.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 8192 bind 16384)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
 /dev/ide/host0/bus0/target0/lun0: p1
 /dev/ide/host0/bus0/target0/lun0: p1
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 132k freed
hub.c: new USB device 00:07.2-2, assigned address 2
hub.c: USB hub found
hub.c: 4 ports detected
Adeos: Domain RTAI registered.
RTAI 3.0r4 mounted over Adeos 2.4r14/x86.
hub.c: new USB device 00:07.2-2.4, assigned address 3


==== RT memory manager v1.3 Loaded. ====


***** STARTING THE UP REAL TIME SCHEDULER WITH LINUX *****
***** FP SUPPORT AND READY FOR A PERIODIC TIMER *****
***<> LINUX TICK AT 100 (HZ) <>***
***<> CALIBRATED CPU FREQUENCY 800034000 (HZ) <>***
***<> CALIBRATED TIMER-INTERRUPT-TO-SCHEDULER LATENCY 2689 (ns) <>***
***<> CALIBRATED ONE SHOT SETUP TIME 2009 (ns) <>***
***<> COMPILER: gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)***

RTAI libm init
Io Memory at 0xc7d10020Found CIF50
Dualport length=8192 
Setting CIF IRQ State
Devflags 0x20 Hostflags 0xe0
reseting CIF50
Devflags 0xa0 Hostflags 0xe0
reset command accepted
Initialising Controller
Size of a progstep is 56
Size of visu_dpram is 2145
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,1), internal journal
: USB HID v1.10 Device [American Power Conversion Back-UPS RS 500 FW:30.j4.I USB FW:j4] on usb1:3.0
Cif50 Reseted
Hilscher Firmware Name:CANopen CIF50CAN
Hilscher Firmware Version:V01.072 22.01.04
Downloading Bus parameters
Start Sequence acced error=0
Amount data transferred in msg 42 of 42 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
Start Sequence acced error=0
Amount data transferred in msg 150 of 150 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
Start Sequence acced error=0
Amount data transferred in msg 67 of 67 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
Start Sequence acced error=0
Amount data transferred in msg 76 of 76 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
Start Sequence acced error=0
Amount data transferred in msg 83 of 83 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
Start Sequence acced error=0
Amount data transferred in msg 94 of 94 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
Start Sequence acced error=0
Amount data transferred in msg 42 of 42 
message receiver 16	 sender 3 	nr 25 	command 0 	error 0 answer 68
Download command acced error=0
message receiver 16	 sender 3 	nr 26 	command 0 	error 0 answer 69
End download sequence acced error=0
writing master conf with ln=45
network started
message receiver 16	 sender 3 	nr 23 	command 0 	error 0 answer 68
Download command acced error=0
writing master conf with ln=11
network started
message receiver 16	 sender 3 	nr 23 	command 0 	error 0 answer 68
Download command acced error=0
Inputs at 0xc7d10020 ouputs at 0xc7d10e20
**************
EL/Plasma Control Version 0.0.1 started
**************
Reset Elplasma
Command received id=10
Using new parameters  Oeffnungstemp is 280  kp_druck is 39/1000
Command received id=7
Command received id=9
Set cooling option to 0
VFS: Disk change detected on device 03:00
 /dev/ide/host0/bus0/target0/lun0: p1
VFS: Disk change detected on device 03:00
 /dev/ide/host0/bus0/target0/lun0: p1

[-- Attachment #4: dmesg_non_functioning --]
[-- Type: text/plain, Size: 7012 bytes --]

Linux version 2.4.27-adeos (root@EltroLinux35) (gcc-Version 3.3.4 (Debian 1:3.3.4-6sarge1)) #32 Mo Aug 30 08:58:44 CEST 2004
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000008000000 (usable)
 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
128MB LOWMEM available.
On node 0 totalpages: 32768
zone(0): 4096 pages.
zone(1): 28672 pages.
zone(2): 0 pages.
ACPI: Unable to locate RSDP
Kernel command line: vga=0x314 root=/dev/nfs rw nfsroot=1.1.1.35:/nfs_root/ver1 ip=dhcp devfs=nomount BOOT_IMAGE=vmlinuz auto
No local APIC present or hardware disabled
Initializing CPU#0
Adeos 2.4r14/x86: Root domain Linux registered.
Detected 800.031 MHz processor.
Console: colour dummy device 80x25
Calibrating delay loop... 1599.07 BogoMIPS
Memory: 126408k/131072k available (1673k kernel code, 4280k reserved, 607k data, 132k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 8192 (order: 3, 32768 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
CPU: L1 I Cache: 64K (32 bytes/line), D cache 64K (32 bytes/line)
CPU: L2 Cache: 64K (32 bytes/line)
CPU:     After generic, caps: 00803135 80803035 00000000 00000000
CPU:             Common caps: 00803135 80803035 00000000 00000000
CPU: Centaur VIA Samuel 2 stepping 03
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
Adeos: Pipelining started.
mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au)
mtrr: detected mtrr type: Intel
ACPI: Subsystem revision 20040326
ACPI: Interpreter disabled.
PCI: PCI BIOS revision 2.10 entry at 0xfb510, last bus=1
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI: Using IRQ router VIA [1106/0686] at 00:07.0
PCI: Disabling Via external APIC routing
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
parport_pc: Via 686A parallel port disabled in BIOS
vesafb: framebuffer at 0xe4000000, mapped to 0xc8800000, size 1875k
vesafb: mode is 800x600x16, linelength=1600, pages=0
vesafb: protected mode interface info at c000:9570
vesafb: scrolling: redraw
vesafb: directcolor: size=0:5:6:5, shift=0:11:5:0
Console: switching to colour frame buffer device 100x37
fb0: VESA VGA frame buffer device
Detected PS/2 Mouse Port.
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI ISAPNP enabled
keyboard: Timeout - AT keyboard not present?(ed)
keyboard: Timeout - AT keyboard not present?(f4)
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
ttyS02 at 0x03e8 (irq = 4) is a 16550A
kmod: failed to exec /sbin/modprobe -s -k parport_lowlevel, errno = 2
lp: driver loaded but no devices found
Real Time Clock Driver v1.10f
Non-volatile memory driver v1.2
loop: loaded (max 8 devices)
8139too Fast Ethernet driver 0.9.26
PCI: Found IRQ 10 for device 00:0b.0
eth0: RealTek RTL8139 at 0xc89d6000, 00:60:e0:81:5b:14, IRQ 10
eth0:  Identified 8139 chip type 'RTL-8139C'
PCI: Found IRQ 11 for device 00:0c.0
eth1: RealTek RTL8139 at 0xc89d8000, 00:60:e0:81:5b:13, IRQ 11
eth1:  Identified 8139 chip type 'RTL-8139C'
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
    ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:pio, hdb:DMA
    ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:pio, hdd:pio
hdb: C/H/S=0/0/0 from BIOS ignored
hdb: SanDisk SDCFB-128, ATA DISK drive
ide2: ports already in use, skipping probe
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdb: attached ide-disk driver.
hdb: 250880 sectors (128 MB) w/1KiB Cache, CHS=980/8/32
Partition check:
 /dev/ide/host0/bus0/target1/lun0: p1
SCSI subsystem driver Revision: 1.00
kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
host/uhci.c: USB Universal Host Controller Interface driver v1.1
PCI: Found IRQ 12 for device 00:07.2
host/uhci.c: USB UHCI at I/O 0xd400, IRQ 12
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
usb.c: registered new driver usblp
printer.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 1024 buckets, 8Kbytes
TCP: Hash tables configured (established 8192 bind 16384)
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
eth1: link down
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 1.1.1.25, my address is 1.1.1.179
IP-Config: Complete:
      device=eth0, addr=1.1.1.179, mask=255.255.255.0, gw=255.255.255.255,
     host=1.1.1.179, domain=eltropuls, nis-domain=(none),
     bootserver=1.1.1.25, rootserver=1.1.1.35, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 1.1.1.35
Looking up port of RPC 100005/1 on 1.1.1.35
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 132k freed
Adeos: Domain RTAI registered.
RTAI 3.0r4 mounted over Adeos 2.4r14/x86.


==== RT memory manager v1.3 Loaded. ====


***** STARTING THE UP REAL TIME SCHEDULER WITH LINUX *****
***** FP SUPPORT AND READY FOR A PERIODIC TIMER *****
***<> LINUX TICK AT 100 (HZ) <>***
***<> CALIBRATED CPU FREQUENCY 800031000 (HZ) <>***
***<> CALIBRATED TIMER-INTERRUPT-TO-SCHEDULER LATENCY 2689 (ns) <>***
***<> CALIBRATED ONE SHOT SETUP TIME 2009 (ns) <>***
***<> COMPILER: gcc version 3.3.4 (Debian 1:3.3.4-6sarge1)***

RTAI libm init
eth1: link down
hdb: status error: status=0x58 { DriveReady SeekComplete DataRequest }

hdb: drive not ready for command
hdb: status error: status=0x58 { DriveReady SeekComplete DataRequest }

hdb: drive not ready for command
hdb: irq timeout: status=0xd0 { Busy }

ide0: reset: master: error (0x0a?)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the   IDE bus)
  2004-08-30  0:08     ` Neil Horman
  2004-08-30  1:07       ` Marcelo Tosatti
@ 2004-08-30  7:12       ` Meelis Roos
  1 sibling, 0 replies; 13+ messages in thread
From: Meelis Roos @ 2004-08-30  7:12 UTC (permalink / raw)
  To: nhorman, linux-kernel

NH> I've not heard of SunDisk.  SunDisk->SanDisk == Typo?

Nope. It was called SunDisk at first but then Sun told them to change
their name and they changed it to SanDisk. There a CF disks with both
names in the wild. But there's no problem, recent kernels (both 2.4 and
2.6) recognize both names as CFA.

-- 
Meelis Roos

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30  1:07       ` Marcelo Tosatti
  2004-08-30  7:01         ` Marc Strämke
@ 2004-08-30 13:04         ` Alan Cox
  1 sibling, 0 replies; 13+ messages in thread
From: Alan Cox @ 2004-08-30 13:04 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Neil Horman, Marc Strämke, Linux Kernel Mailing List

On Llu, 2004-08-30 at 02:07, Marcelo Tosatti wrote:
> Indeed this is a typo but has been fixed on 2.4.26:

Its not a typo - "SunDisk" long ago got forced to change their
name to "Sandisk" (which is a nice little joke) [1]

Alan
[1]- sans disk - without disk 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30  7:01         ` Marc Strämke
@ 2004-08-30 14:23           ` Neil Horman
  2004-08-30 15:49             ` Marc Strämke
  0 siblings, 1 reply; 13+ messages in thread
From: Neil Horman @ 2004-08-30 14:23 UTC (permalink / raw)
  To: Marc Strämke; +Cc: linux-kernel

Marc Strämke wrote:
> Marcelo Tosatti wrote:
> 
>> Indeed this is a typo but has been fixed on 2.4.26:
>>
>>         if (drive->removable && id != NULL) {
> 
> It never gets past this check because drive->removable is not set!
Theres actually a more interesting difference to notice:

In the working dmesg output I see this:
 > hda: SanDisk SDCFB-128, CFA DISK drive

While in the non working dmesg output we have:
 > hdb: SanDisk SDCFB-128, ATA DISK drive

Tracing back through the code it looks to me like we get the ATA disk 
print in the event that this test in do_identify:
/*
  * Check for an ATAPI device
  */
  if (cmd == WIN_PIDENTIFY) {

that would explain why the drive_is_flashcard test is getting skipped, 
why setting removable is making no difference, and why your card is 
being identified as an ATA device.  It looks as though the WIN_PIDENTIFY 
command is sent down to this routine from ide_probe_for_drive in this 
snip of code:

/* if !(success||timed-out) */
                 if (do_probe(drive, WIN_IDENTIFY) >= 2) {
                         /* look for ATAPI device */
                         (void) do_probe(drive, WIN_PIDENTIFY);
                 }

So it would seem that WIN_PIDENTIFY is issued only if a WIN_IDENTIFY 
command fails with an rc greater than 2.  I would suggest instrumenting 
this area of the code to see what the WIN_IDENTIFY command is returning 
on the working and non-working systems.  I'm betting you will find a 
difference, and we'll be able to track down the problem from there.

HTH
Neil
-- 
/***************************************************
  *Neil Horman
  *Software Engineer
  *Red Hat, Inc.
  *nhorman@redhat.com
  *gpg keyid: 1024D / 0x92A74FA1
  *http://pgp.mit.edu
  ***************************************************/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30 15:49             ` Marc Strämke
@ 2004-08-30 15:23               ` Alan Cox
  2004-08-30 17:10               ` Neil Horman
  1 sibling, 0 replies; 13+ messages in thread
From: Alan Cox @ 2004-08-30 15:23 UTC (permalink / raw)
  To: Marc Strämke; +Cc: Linux Kernel Mailing List

On Llu, 2004-08-30 at 16:49, Marc Strämke wrote:
> Both Cards, the old and the new on dont get to the ATAPI probing (which 
> seems correct to me, or is compactflash an ATAPI device???)

CF cards in IDE mode appear as ATA disk not ATAPI

> So the data the does return indeed marks it as an ATA harddisk, and not 
> as a compactflash card, the real question then is why doesnt it work as 
> a harddisk, which according to the specifications it should? Iam not 
> really experienced in the ide stuff, so iam not sure what the 
> CompactFlash detection in linux changes in behaviour.

It basically changes the removable drive behaviour. It could
also be useful for knowing when we need to be careful as
CF cards are both fragile and have some different commands.

What is the CF card connected to. One possibility is that
something after boot is powering the CF card off and on or
switching its mode before we see it.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30 14:23           ` Neil Horman
@ 2004-08-30 15:49             ` Marc Strämke
  2004-08-30 15:23               ` Alan Cox
  2004-08-30 17:10               ` Neil Horman
  0 siblings, 2 replies; 13+ messages in thread
From: Marc Strämke @ 2004-08-30 15:49 UTC (permalink / raw)
  To: linux-kernel

> Tracing back through the code it looks to me like we get the ATA disk 
> print in the event that this test in do_identify:
> /*
>  * Check for an ATAPI device
>  */
>  if (cmd == WIN_PIDENTIFY) {
> 
> that would explain why the drive_is_flashcard test is getting skipped, 
> why setting removable is making no difference, and why your card is 
> being identified as an ATA device.  It looks as though the WIN_PIDENTIFY 
> command is sent down to this routine from ide_probe_for_drive in this 
> snip of code:
> 
> /* if !(success||timed-out) */
>                 if (do_probe(drive, WIN_IDENTIFY) >= 2) {
>                         /* look for ATAPI device */
>                         (void) do_probe(drive, WIN_PIDENTIFY);
>                 }
Both Cards, the old and the new on dont get to the ATAPI probing (which 
seems correct to me, or is compactflash an ATAPI device???)


> 
> So it would seem that WIN_PIDENTIFY is issued only if a WIN_IDENTIFY 
> command fails with an rc greater than 2.  I would suggest instrumenting 
WIN_IDENTIFY returns a rc of 0 (for success) with both the old and the 
new card. Still the old ones gets detected as CFA!


One thing i did notice when tracing these functions, is that the new 
card returns 0x44a in drive->id->config, while the old one returns 
0x848a, according to the manual from 
SanDisk(http://www.sandisk.com/pdf/industrial/ProdManualIndustrialGradeATAv2.6.pdf) 
Should only be returned in memory mapped(cardbus/pc-card) mode, and not 
in True IDE mode, which the card is appearently running, otherwise the 
bios couldnt not boot from it, nor would the electrical interface be 
compatible (if i get the manual right). That is imo why hdparm -I doesnt 
detect the card as beein removable and Compactflash too, i looked as the 
sourcode of hdparm, and it seems to read the ATA configuration registers 
trough a proc file, and interpret it directly (without intervention of 
the kernel).
So the data the does return indeed marks it as an ATA harddisk, and not 
as a compactflash card, the real question then is why doesnt it work as 
a harddisk, which according to the specifications it should? Iam not 
really experienced in the ide stuff, so iam not sure what the 
CompactFlash detection in linux changes in behaviour.
I can get the kernel to report it as a "CFA DISK Drive" in dmesg by 
forcing the flags i mentioned before, but the error is exactly the same.

Thx for your help,
Marc


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30 15:49             ` Marc Strämke
  2004-08-30 15:23               ` Alan Cox
@ 2004-08-30 17:10               ` Neil Horman
  2004-08-30 17:31                 ` Marc Strämke
  1 sibling, 1 reply; 13+ messages in thread
From: Neil Horman @ 2004-08-30 17:10 UTC (permalink / raw)
  To: Marc Strämke; +Cc: linux-kernel

Marc Strämke wrote:
<snip>
> One thing i did notice when tracing these functions, is that the new 
> card returns 0x44a in drive->id->config, while the old one returns 
> 0x848a, according to the manual from 
> SanDisk(http://www.sandisk.com/pdf/industrial/ProdManualIndustrialGradeATAv2.6.pdf) 
> Should only be returned in memory mapped(cardbus/pc-card) mode, and not 
> in True IDE mode, which the card is appearently running, otherwise the 
> bios couldnt not boot from it, nor would the electrical interface be 
> compatible (if i get the manual right). That is imo why hdparm -I doesnt 
> detect the card as beein removable and Compactflash too, i looked as the 
> sourcode of hdparm, and it seems to read the ATA configuration registers 
> trough a proc file, and interpret it directly (without intervention of 
> the kernel).
> So the data the does return indeed marks it as an ATA harddisk, and not 
> as a compactflash card, the real question then is why doesnt it work as 
> a harddisk, which according to the specifications it should? Iam not 
> really experienced in the ide stuff, so iam not sure what the 
> CompactFlash detection in linux changes in behaviour.
> I can get the kernel to report it as a "CFA DISK Drive" in dmesg by 
> forcing the flags i mentioned before, but the error is exactly the same.
> 
Sorry, I've been mixed up here.  I've been focused on the removable flag 
aspect of this problem.  To level set here:

1) older SanDisk cards are detected as CFA devices and are working, but 
not bootable.

2) newer SanDisk cards are detected as ATA disks, and are bootable as 
such, but do not seem to be operating correctly (the aforementioned ide 
errors).


Is this correct?

The first question to answer is, which mode do you want to operate in? 
(I assume True IDE is what you're after, but just to be sure). 
According to the Manual you provided the link to, CFA cards select which 
mode the operate in (CFA or ATA) from poweron based on a sampling of pin 
0x0E. on the physical interface (from section 3.7 on page 43).   So it 
seems you have two supposedly identical pieces of hardware that are 
configuring themselves from poweron in opposing ways based on the 
electrical characteristics of the same bus pin.  If this is correct, 
then I would be forced to conclude:

a) the state of that bus pin is fluctuating.
b) the CompactFlash cards that you have treat that pin differently

Either way, it seems that you have two cards which should be, but are 
not getting detected/configured in the same way.  That would somewhat 
suggest to me electrical issues on your bus, which may account for the 
ide errors you are seeing.

Neil
> Thx for your help,
> Marc
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


-- 
/***************************************************
  *Neil Horman
  *Software Engineer
  *Red Hat, Inc.
  *nhorman@redhat.com
  *gpg keyid: 1024D / 0x92A74FA1
  *http://pgp.mit.edu
  ***************************************************/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus)
  2004-08-30 17:10               ` Neil Horman
@ 2004-08-30 17:31                 ` Marc Strämke
  0 siblings, 0 replies; 13+ messages in thread
From: Marc Strämke @ 2004-08-30 17:31 UTC (permalink / raw)
  To: linux-kernel

Neil Horman wrote:
> <snip<
> 
> 1) older SanDisk cards are detected as CFA devices and are working, but 
> not bootable.
> 
> 2) newer SanDisk cards are detected as ATA disks, and are bootable as 
> such, but do not seem to be operating correctly (the aforementioned ide 
> errors).
> 
> 
> Is this correct?

Not fully, actually both are bootable, but the second one gets 
read/write errors after booting, and when accessed after booting from 
another boot device (NFS)

for the other points, actually both cards are used in the same adapter 
hardware. I can switch both cards in ONE system, and the error only 
appears with the newer card.

I found some other subtlety, in the dmesg of the nonworking card there 
is a message:

hdb: C/H/S=0/0/0 from BIOS ignored

which doesnt appear with the working card, so the card is already 
treated differently by the bios, or the different information from the 
bios somehow interfers with hardware probing? (just speculating on this 
point)
I will do some more tests and tell you what i find out.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-08-30 17:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-29  8:01 Problem accessing Sandisk CompactFlash Cards (Connected to the IDE bus) Marc Strämke
2004-08-29 13:38 ` Neil Horman
2004-08-29 16:06   ` Marc Strämke
2004-08-30  0:08     ` Neil Horman
2004-08-30  1:07       ` Marcelo Tosatti
2004-08-30  7:01         ` Marc Strämke
2004-08-30 14:23           ` Neil Horman
2004-08-30 15:49             ` Marc Strämke
2004-08-30 15:23               ` Alan Cox
2004-08-30 17:10               ` Neil Horman
2004-08-30 17:31                 ` Marc Strämke
2004-08-30 13:04         ` Alan Cox
2004-08-30  7:12       ` Meelis Roos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox