All of lore.kernel.org
 help / color / mirror / Atom feed
* CF to SATA bridge support
@ 2009-08-07 17:59 Mathieu GELI
  2009-08-08  3:21 ` Robert Hancock
  0 siblings, 1 reply; 10+ messages in thread
From: Mathieu GELI @ 2009-08-07 17:59 UTC (permalink / raw)
  To: linux-ide

Hello,

I'm having detection problems with a CF to SATA bridge on a 2.6.30
kernel (2.6.30-1-orion5x). Platform is Orion SoC (DNS-323 Dlink NAS)
The bridge is a "made in china" device with no real name : "CF TO SATA
Converter" can be read on the package. They mention "Linux support
whitout any additional drivers",
and DMA and Ultra DMA support (if CF supports it)

Tests have been done with a 128MB CFI et a 1GB CFII, no differences.

dmesg gives :

[    1.960000] SCSI subsystem initialized
[    2.180000] libata version 3.00 loaded.
[    2.230000] sata_mv sata_mv.0: version 1.28
[    2.230000] sata_mv sata_mv.0: slots 32 ports 2
[    2.240000] scsi0 : sata_mv
[    2.240000] scsi1 : sata_mv
[    2.250000] ata1: SATA max UDMA/133 irq 29
[    2.250000] ata2: SATA max UDMA/133 irq 29
[    2.770000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    2.800000] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
[    8.280000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    8.310000] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
[    8.310000] ata1: limiting SATA link speed to 1.5 Gbps
[   13.790000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[   13.820000] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
[   19.300000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[   19.300000] ata1: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x1 t4
[   19.310000] ata1: edma_err_cause=00001000 pp_flags=00000000
[   19.820000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[   19.840000] ata2.00: ATA-7: SAMSUNG HD103UJ, 1AA01118, max UDMA7
[   19.840000] ata2.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[   19.870000] ata2.00: configured for UDMA/133

(I have the system root on a regular samsung disk attached to the
second SATA slot)

loaded modules related to storage :
sd_mod                 34340  3
sata_mv                29300  3
libata                169188  1 sata_mv
scsi_mod              151332  2 sd_mod,libata

Looking at libata options I saw :
parm:           dma:DMA enable/disable (0x1==ATA, 0x2==ATAPI, 0x4==CF) (int)
I then tried option libata dma=3. No luck, same error log.

I'm unsure if the problem comes from the orion architecture (marvell
low-level sata driver ?) or is generic with 2.6.30 (I don't have SATA
PC hardware here to disambiguate that).
Any hints, directions I could look for are much appreciated !

Cheers

PS: bridge looks  rigorously like this
http://ucables.com/img/extra/CF-TO-SATA-CONVERTER-R45822-1.jpg

-- 
Mathieu

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

* Re: CF to SATA bridge support
  2009-08-07 17:59 CF to SATA bridge support Mathieu GELI
@ 2009-08-08  3:21 ` Robert Hancock
  2009-08-08 18:35   ` Mathieu GELI
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Hancock @ 2009-08-08  3:21 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: linux-ide, Mark Lord

On 08/07/2009 11:59 AM, Mathieu GELI wrote:
> Hello,
>
> I'm having detection problems with a CF to SATA bridge on a 2.6.30
> kernel (2.6.30-1-orion5x). Platform is Orion SoC (DNS-323 Dlink NAS)
> The bridge is a "made in china" device with no real name : "CF TO SATA
> Converter" can be read on the package. They mention "Linux support
> whitout any additional drivers",
> and DMA and Ultra DMA support (if CF supports it)
>
> Tests have been done with a 128MB CFI et a 1GB CFII, no differences.
>
> dmesg gives :
>
> [    1.960000] SCSI subsystem initialized
> [    2.180000] libata version 3.00 loaded.
> [    2.230000] sata_mv sata_mv.0: version 1.28
> [    2.230000] sata_mv sata_mv.0: slots 32 ports 2
> [    2.240000] scsi0 : sata_mv
> [    2.240000] scsi1 : sata_mv
> [    2.250000] ata1: SATA max UDMA/133 irq 29
> [    2.250000] ata2: SATA max UDMA/133 irq 29
> [    2.770000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [    2.800000] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
> [    8.280000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [    8.310000] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
> [    8.310000] ata1: limiting SATA link speed to 1.5 Gbps
> [   13.790000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
> [   13.820000] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
> [   19.300000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
> [   19.300000] ata1: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x1 t4
> [   19.310000] ata1: edma_err_cause=00001000 pp_flags=00000000
> [   19.820000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> [   19.840000] ata2.00: ATA-7: SAMSUNG HD103UJ, 1AA01118, max UDMA7
> [   19.840000] ata2.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
> [   19.870000] ata2.00: configured for UDMA/133

Hmm.. err_mask 0x2 seems to be HSM violation, and 
edma_err_cause=00001000 seems to be.. IORDY timeout? Not sure what that 
is supposed to indicate on this controller..

Mark, any ideas?

>
> (I have the system root on a regular samsung disk attached to the
> second SATA slot)
>
> loaded modules related to storage :
> sd_mod                 34340  3
> sata_mv                29300  3
> libata                169188  1 sata_mv
> scsi_mod              151332  2 sd_mod,libata
>
> Looking at libata options I saw :
> parm:           dma:DMA enable/disable (0x1==ATA, 0x2==ATAPI, 0x4==CF) (int)
> I then tried option libata dma=3. No luck, same error log.
>
> I'm unsure if the problem comes from the orion architecture (marvell
> low-level sata driver ?) or is generic with 2.6.30 (I don't have SATA
> PC hardware here to disambiguate that).
> Any hints, directions I could look for are much appreciated !
>
> Cheers
>
> PS: bridge looks  rigorously like this
> http://ucables.com/img/extra/CF-TO-SATA-CONVERTER-R45822-1.jpg
>


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

* Re: CF to SATA bridge support
  2009-08-08  3:21 ` Robert Hancock
@ 2009-08-08 18:35   ` Mathieu GELI
  2009-08-09 16:23     ` Mathieu GELI
  0 siblings, 1 reply; 10+ messages in thread
From: Mathieu GELI @ 2009-08-08 18:35 UTC (permalink / raw)
  To: Robert Hancock; +Cc: linux-ide, Mark Lord

> Hmm.. err_mask 0x2 seems to be HSM violation, and edma_err_cause=00001000
> seems to be.. IORDY timeout? Not sure what that is supposed to indicate on
> this controller..

Not sure what to think about the HSM violation but about the IORDY
timeout, does that [1] ring a bell ?
I think the clock is 150Mhz though.

[1] http://patchwork.ozlabs.org/patch/29080/

-- 
Mathieu

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

* Re: CF to SATA bridge support
  2009-08-08 18:35   ` Mathieu GELI
@ 2009-08-09 16:23     ` Mathieu GELI
  2009-08-10 13:33       ` Mark Lord
  0 siblings, 1 reply; 10+ messages in thread
From: Mathieu GELI @ 2009-08-09 16:23 UTC (permalink / raw)
  To: Robert Hancock; +Cc: linux-ide, Mark Lord

Investigating the IORDY problem I did cross-build a custom 2.6.30.4
(from kernel.org) arm kernel and patched it accordingly to [1].
What results is : Compact Flash is now *detected* but when using it in
real life (mkswap+swapon) things are getting bad.

at boot time :

[    2.190000] SCSI subsystem initialized
[    2.410000] libata version 3.00 loaded.
[    2.460000] sata_mv sata_mv.0: version 1.28
[    2.470000] sata_mv sata_mv.0: slots 32 ports 2
[    2.480000] scsi0 : sata_mv
[    2.480000] scsi1 : sata_mv
[    2.480000] ata1: SATA max UDMA/133 irq 29
[    2.490000] ata2: SATA max UDMA/133 irq 29
[    3.000000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    3.060000] ata1.00: CFA: LEXAR ATA FLASH, V2.02, max PIO4
[    3.060000] ata1.00: 2003904 sectors, multi 0: LBA
[    3.070000] ata1.00: applying bridge limits
[    3.110000] ata1.00: configured for PIO4
[    3.170000] ata1.00: configured for PIO4
[    3.170000] ata1: EH complete
[    3.170000] scsi 0:0:0:0: Direct-Access     ATA      LEXAR ATA
FLASH  V2.0 PQ: 0 ANSI: 5
[    3.690000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    3.710000] ata2.00: ATA-7: SAMSUNG HD103UJ, 1AA01118, max UDMA7
[    3.710000] ata2.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    3.740000] ata2.00: configured for UDMA/133
[    3.740000] scsi 1:0:0:0: Direct-Access     ATA      SAMSUNG
HD103UJ  1AA0 PQ: 0 ANSI: 5
[    5.750000] Driver 'sd' needs updating - please use bus_type methods
[    5.760000] sd 0:0:0:0: [sda] 2003904 512-byte hardware sectors:
(1.02 GB/978 MiB)
[    5.760000] sd 0:0:0:0: [sda] Write Protect is off
[    5.770000] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    5.770000] sd 0:0:0:0: [sda] Write cache: disabled, read cache:
enabled, doesn't support DPO or FUA
[    5.780000]  sda:<4>ata1: sata_mv: attempting PIO w/multiple DRQ:
this may fail due to h/w errata
[    5.810000]  sda1
[    5.810000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    5.860000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    5.870000] sd 1:0:0:0: [sdb] 1953525168 512-byte hardware sectors:
(1.00 TB/931 GiB)
[    5.880000] sd 1:0:0:0: [sdb] Write Protect is off
[    5.880000] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    5.880000] sd 1:0:0:0: [sdb] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[    5.890000]  sdb: sdb1 sdb2
[    5.900000] sd 1:0:0:0: [sdb] Attached SCSI disk
[    6.870000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    6.880000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    6.900000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    6.920000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    6.940000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    6.960000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    6.980000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    7.010000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
fail due to h/w errata
[    7.890000] device-mapper: uevent: version 1.0.3
[...]

and after swapon and running memory demanding application :
[ 2149.180000] ata1: hard resetting link
[ 2149.700000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 2149.780000] ata1.00: configured for PIO0
[ 2149.820000] ata1.00: configured for PIO0
[ 2149.820000] sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2149.830000] sd 0:0:0:0: [sda] Sense Key : Aborted Command [current]
[descriptor]
[ 2149.830000] Descriptor sense data with sense descriptors (in hex):
[ 2149.840000]         72 0b 47 00 00 00 00 0c 00 0a 80 00 00 00 00 00
[ 2149.850000]         00 00 80 f7
[ 2149.850000] sd 0:0:0:0: [sda] Add. Sense: Scsi parity error
[ 2149.860000] end_request: I/O error, dev sda, sector 33015
[ 2149.860000] Write-error on swap-device (8:0:33023)
[ 2149.870000] Write-error on swap-device (8:0:33031)
[ 2149.870000] Write-error on swap-device (8:0:33039)
[...]
[ 2150.010000] Write-error on swap-device (8:0:33271)
[ 2150.020000] ata1: EH complete
[ 2150.060000] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 2150.070000] ata1.00: cmd 30/00:00:f7:81:00/00:00:00:00:00/e0 tag 0
pio 131072 out
[ 2150.070000]          res 58/00:00:f7:81:00/00:00:00:00:00/e0 Emask
0x2 (HSM violation)
[ 2150.080000] ata1.00: status: { DRDY DRQ }
[ 2150.090000] ata1: hard resetting link

While that's happening, userland is unresponsive.

On a side note, just running hdparm on it doesn't trigger all those errors :

$ sudo hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   160 MB in  2.02 seconds =  79.31 MB/sec
 Timing buffered disk reads:   14 MB in  3.39 seconds =   4.13 MB/sec

Cheers

[1] http://patchwork.ozlabs.org/patch/29080/

-- 
Mathieu

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

* Re: CF to SATA bridge support
  2009-08-09 16:23     ` Mathieu GELI
@ 2009-08-10 13:33       ` Mark Lord
  2009-08-29 13:48         ` Mark Lord
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Lord @ 2009-08-10 13:33 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: Robert Hancock, linux-ide

Mathieu GELI wrote:
> Investigating the IORDY problem I did cross-build a custom 2.6.30.4
> (from kernel.org) arm kernel and patched it accordingly to [1].
> What results is : Compact Flash is now *detected* but when using it in
> real life (mkswap+swapon) things are getting bad.
> 
> at boot time :
> 
> [    2.190000] SCSI subsystem initialized
> [    2.410000] libata version 3.00 loaded.
> [    2.460000] sata_mv sata_mv.0: version 1.28
> [    2.470000] sata_mv sata_mv.0: slots 32 ports 2
> [    2.480000] scsi0 : sata_mv
> [    2.480000] scsi1 : sata_mv
> [    2.480000] ata1: SATA max UDMA/133 irq 29
> [    2.490000] ata2: SATA max UDMA/133 irq 29
> [    3.000000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [    3.060000] ata1.00: CFA: LEXAR ATA FLASH, V2.02, max PIO4
> [    3.060000] ata1.00: 2003904 sectors, multi 0: LBA
> [    3.070000] ata1.00: applying bridge limits
> [    3.110000] ata1.00: configured for PIO4
> [    3.170000] ata1.00: configured for PIO4
> [    3.170000] ata1: EH complete
> [    3.170000] scsi 0:0:0:0: Direct-Access     ATA      LEXAR ATA
> FLASH  V2.0 PQ: 0 ANSI: 5
> [    3.690000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> [    3.710000] ata2.00: ATA-7: SAMSUNG HD103UJ, 1AA01118, max UDMA7
> [    3.710000] ata2.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
> [    3.740000] ata2.00: configured for UDMA/133
> [    3.740000] scsi 1:0:0:0: Direct-Access     ATA      SAMSUNG
> HD103UJ  1AA0 PQ: 0 ANSI: 5
> [    5.750000] Driver 'sd' needs updating - please use bus_type methods
> [    5.760000] sd 0:0:0:0: [sda] 2003904 512-byte hardware sectors:
> (1.02 GB/978 MiB)
> [    5.760000] sd 0:0:0:0: [sda] Write Protect is off
> [    5.770000] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> [    5.770000] sd 0:0:0:0: [sda] Write cache: disabled, read cache:
> enabled, doesn't support DPO or FUA
> [    5.780000]  sda:<4>ata1: sata_mv: attempting PIO w/multiple DRQ:
> this may fail due to h/w errata
> [    5.810000]  sda1
> [    5.810000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    5.860000] sd 0:0:0:0: [sda] Attached SCSI removable disk
> [    5.870000] sd 1:0:0:0: [sdb] 1953525168 512-byte hardware sectors:
> (1.00 TB/931 GiB)
> [    5.880000] sd 1:0:0:0: [sdb] Write Protect is off
> [    5.880000] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
> [    5.880000] sd 1:0:0:0: [sdb] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [    5.890000]  sdb: sdb1 sdb2
> [    5.900000] sd 1:0:0:0: [sdb] Attached SCSI disk
> [    6.870000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    6.880000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    6.900000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    6.920000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    6.940000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    6.960000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    6.980000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    7.010000] ata1: sata_mv: attempting PIO w/multiple DRQ: this may
> fail due to h/w errata
> [    7.890000] device-mapper: uevent: version 1.0.3
> [...]
> 
> and after swapon and running memory demanding application :
> [ 2149.180000] ata1: hard resetting link
> [ 2149.700000] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
> [ 2149.780000] ata1.00: configured for PIO0
> [ 2149.820000] ata1.00: configured for PIO0
> [ 2149.820000] sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
> [ 2149.830000] sd 0:0:0:0: [sda] Sense Key : Aborted Command [current]
> [descriptor]
> [ 2149.830000] Descriptor sense data with sense descriptors (in hex):
> [ 2149.840000]         72 0b 47 00 00 00 00 0c 00 0a 80 00 00 00 00 00
> [ 2149.850000]         00 00 80 f7
> [ 2149.850000] sd 0:0:0:0: [sda] Add. Sense: Scsi parity error
> [ 2149.860000] end_request: I/O error, dev sda, sector 33015
> [ 2149.860000] Write-error on swap-device (8:0:33023)
> [ 2149.870000] Write-error on swap-device (8:0:33031)
> [ 2149.870000] Write-error on swap-device (8:0:33039)
> [...]
> [ 2150.010000] Write-error on swap-device (8:0:33271)
> [ 2150.020000] ata1: EH complete
> [ 2150.060000] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
> [ 2150.070000] ata1.00: cmd 30/00:00:f7:81:00/00:00:00:00:00/e0 tag 0
> pio 131072 out
> [ 2150.070000]          res 58/00:00:f7:81:00/00:00:00:00:00/e0 Emask
> 0x2 (HSM violation)
> [ 2150.080000] ata1.00: status: { DRDY DRQ }
> [ 2150.090000] ata1: hard resetting link
> 
> While that's happening, userland is unresponsive.
> 
> On a side note, just running hdparm on it doesn't trigger all those errors :
> 
> $ sudo hdparm -tT /dev/sda
> 
> /dev/sda:
>  Timing cached reads:   160 MB in  2.02 seconds =  79.31 MB/sec
>  Timing buffered disk reads:   14 MB in  3.39 seconds =   4.13 MB/sec
..

Those errors are on WRITEs, not READs, so no surprise that "hdparm -t" works.
This could be an IORDY issue, or just due to how the the Marvell chips
are buggy when doing PIO of more than a single sector.  That was the only
errata we didn't do a complete workaround for, because it's so ugly.  :)

I have a CF-to-SATA adapter due to arrive here from DealExtreme.com in the
next week or so.  Remind me, and I'll try it out on some of the Marvell cards
here and see what happens.

Cheers


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

* Re: CF to SATA bridge support
  2009-08-10 13:33       ` Mark Lord
@ 2009-08-29 13:48         ` Mark Lord
  2009-08-29 14:22           ` Mark Lord
  2009-08-29 15:59           ` Mark Lord
  0 siblings, 2 replies; 10+ messages in thread
From: Mark Lord @ 2009-08-29 13:48 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: Robert Hancock, linux-ide

Mark Lord wrote:
..
> Those errors are on WRITEs, not READs, so no surprise that "hdparm -t" works.
> This could be an IORDY issue, or just due to how the the Marvell chips
> are buggy when doing PIO of more than a single sector.  That was the only
> errata we didn't do a complete workaround for, because it's so ugly.  :)
> 
> I have a CF-to-SATA adapter due to arrive here from DealExtreme.com in the
> next week or so.  Remind me, and I'll try it out on some of the Marvell 
> cards here and see what happens.
..

Okay.  I don't actually have any of the system-on-chip (SoC) Marvell devices
like the one you are using there.  But they say that the SATA core on
the SoC is a Gen-IIe core, same as on the 7042 PCIe chipset.

So, I've plugged my UDMA-capable CF card into the CF-to-SATA adapter
and hotplugged that into a port on the 7042.

It works fine, reading/writing in UDMA mode 5.
Things also appear to be good with a Hitachi microdrive in PIO mode 3.

The CF-to-SATA adaptor I am using is this one:
   http://www.dealextreme.com/details.dx/sku.20317

Nice little device, compact, notebook compatible, and Fast!

Cheers

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

* Re: CF to SATA bridge support
  2009-08-29 13:48         ` Mark Lord
@ 2009-08-29 14:22           ` Mark Lord
  2009-08-29 15:47             ` Mark Lord
  2009-08-29 15:59           ` Mark Lord
  1 sibling, 1 reply; 10+ messages in thread
From: Mark Lord @ 2009-08-29 14:22 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: Robert Hancock, linux-ide

Mark Lord wrote:
> Mark Lord wrote:
> ..
>> Those errors are on WRITEs, not READs, so no surprise that "hdparm -t" 
>> works.
>> This could be an IORDY issue, or just due to how the the Marvell chips
>> are buggy when doing PIO of more than a single sector.  That was the only
>> errata we didn't do a complete workaround for, because it's so ugly.  :)
>>
>> I have a CF-to-SATA adapter due to arrive here from DealExtreme.com in 
>> the
>> next week or so.  Remind me, and I'll try it out on some of the 
>> Marvell cards here and see what happens.
> ..
> 
> Okay.  I don't actually have any of the system-on-chip (SoC) Marvell 
> devices
> like the one you are using there.  But they say that the SATA core on
> the SoC is a Gen-IIe core, same as on the 7042 PCIe chipset.
> 
> So, I've plugged my UDMA-capable CF card into the CF-to-SATA adapter
> and hotplugged that into a port on the 7042.
> 
> It works fine, reading/writing in UDMA mode 5.
> Things also appear to be good with a Hitachi microdrive in PIO mode 3.
> 
> The CF-to-SATA adaptor I am using is this one:
>   http://www.dealextreme.com/details.dx/sku.20317
> 
> Nice little device, compact, notebook compatible, and Fast!
..

I just now remembered that you were trying with an old Lexar CF card.
Well, I have an even older one :) here:  16MB.

Plugged that one into it, and libata selected PIO3 for it.
hdparm thinks it really is no better than PIO2 at best.

It works, reading and writing.

Cheers

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

* Re: CF to SATA bridge support
  2009-08-29 14:22           ` Mark Lord
@ 2009-08-29 15:47             ` Mark Lord
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Lord @ 2009-08-29 15:47 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: Robert Hancock, linux-ide

Oh, waitasec.. dagnabbit.. I got my cables confused.

Need to retest now.

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

* Re: CF to SATA bridge support
  2009-08-29 13:48         ` Mark Lord
  2009-08-29 14:22           ` Mark Lord
@ 2009-08-29 15:59           ` Mark Lord
  2009-08-29 16:10             ` Mark Lord
  1 sibling, 1 reply; 10+ messages in thread
From: Mark Lord @ 2009-08-29 15:59 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: Robert Hancock, linux-ide

Mark Lord wrote:
> Mark Lord wrote:
> ..
>> Those errors are on WRITEs, not READs, so no surprise that "hdparm -t" 
>> works.
>> This could be an IORDY issue, or just due to how the the Marvell chips
>> are buggy when doing PIO of more than a single sector.  That was the only
>> errata we didn't do a complete workaround for, because it's so ugly.  :)
>>
>> I have a CF-to-SATA adapter due to arrive here from DealExtreme.com in 
>> the
>> next week or so.  Remind me, and I'll try it out on some of the 
>> Marvell cards here and see what happens.
..

Okay, here we go again.  This time I'm using the correct cable
to the correct SATA controller.  :)

The 32GB UDMA-capable CF-Card works fine for reading/writing
when hotplugged to the Marvell 7042 SATA adaptor.  But.. it did have
some initial stuttering in the logs:

HOTPLUGGING NOW:
[   40.955329] ata11: exception Emask 0x10 SAct 0x0 SErr 0x4010000 action 0xe frozen
[   40.955396] ata11: edma_err_cause=00000010 pp_flags=00000000, dev connect
[   40.955448] ata11: SError: { PHYRdyChg DevExch }
[   40.955503] ata11: hard resetting link
[   46.888022] ata11: link is slow to respond, please be patient (ready=0)
[   50.976034] ata11: SRST failed (errno=-16)
[   50.976105] ata11: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[   50.976111] ata11: link online but device misclassified, retrying
[   50.976114] ata11: hard resetting link
[   51.856044] ata11: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[   51.880207] ata11.00: CFA: CF Card, Ver2.19, max UDMA/100
[   51.880210] ata11.00: 63045360 sectors, multi 0: LBA 
[   51.880223] ata11.00: applying bridge limits
[   51.896228] ata11.00: configured for UDMA/100
[   51.896236] ata11: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0x1 t4
[   51.896289] ata11: edma_err_cause=00000020 pp_flags=00000000, SError=00180000
[   51.920226] ata11.00: configured for UDMA/100
[   51.920233] ata11: EH complete
[   51.920339] scsi 10:0:0:0: Direct-Access     ATA      CF Card          Ver2 PQ: 0 ANSI: 5
[   51.920481] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[   51.920501] sd 10:0:0:0: [sdb] Write Protect is off
[   51.920504] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   51.920535] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   51.920639] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[   51.920657] sd 10:0:0:0: [sdb] Write Protect is off
[   51.920660] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   51.920690] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   51.920694]  sdb: sdb1 sdb2
[   51.924771] sd 10:0:0:0: [sdb] Attached SCSI removable disk
[   51.924851] sd 10:0:0:0: Attached scsi generic sg2 type 0

UBUNTU NOW TRIES TO AUTOMOUNT THE TWO PARTITIONS:
[   52.132086] kjournald starting.  Commit interval 5 seconds
[   52.593861] EXT3 FS on sdb1, internal journal
[   52.593868] EXT3-fs: mounted filesystem with ordered data mode.
[   52.611825] EXT4-fs: barriers enabled
[   52.618484] kjournald2 starting.  Commit interval 5 seconds
[   53.082025] EXT4 FS on sdb2, internal journal on sdb2:8
[   53.082030] EXT4-fs: delayed allocation enabled
[   53.082032] EXT4-fs: file extents enabled
[   53.082155] EXT4-fs: mballoc enabled
[   53.082160] EXT4-fs: mounted filesystem with ordered data mode.
[   53.148535] ata11.00: exception Emask 0x0 SAct 0x0 SErr 0x280000 action 0x6 frozen
[   53.148535] ata11.00: edma_err_cause=00000020 pp_flags=00000001, SError=00080000
[   53.148535] ata11: SError: { 10B8B BadCRC }
[   53.148535] ata11.00: cmd c8/00:f8:80:24:04/00:00:00:00:00/e0 tag 0 dma 126976 in
[   53.148535]          res d0/00:f8:80:24:04/00:00:00:00:00/e0 Emask 0x12 (ATA bus error)
[   53.148535] ata11.00: status: { Busy }
[   53.148535] ata11: hard resetting link
[   53.636026] ata11: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[   53.676226] ata11.00: configured for UDMA/100
[   53.700232] ata11.00: configured for UDMA/100
[   53.700241] sd 10:0:0:0: [sdb] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK
[   53.700246] sd 10:0:0:0: [sdb] Sense Key : Aborted Command [current] [descriptor]
[   53.700252] Descriptor sense data with sense descriptors (in hex):
[   53.700255]         72 0b 47 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
[   53.700268]         00 04 24 80 
[   53.700273] sd 10:0:0:0: [sdb] Add. Sense: Scsi parity error
[   53.700279] end_request: I/O error, dev sdb, sector 271488
[   53.700351] ata11: EH complete
[   53.700373] EXT4-fs error (device sdb2): __ext4_get_inode_loc: <5>sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[   53.700430] sd 10:0:0:0: [sdb] Write Protect is off
[   53.700433] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   53.700463] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   53.700479] unable to read inode block - inode=32743, block=2562
[   53.700506] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[   53.703345] sd 10:0:0:0: [sdb] Write Protect is off
[   53.703349] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   53.703388] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   84.276379] ata11.00: exception Emask 0x0 SAct 0x0 SErr 0x100000 action 0x6 frozen
[   84.276444] ata11.00: edma_err_cause=00000020 pp_flags=00000001, SError=00100000
[   84.276509] ata11: SError: { Dispar }
[   84.276560] ata11.00: cmd ca/00:08:f0:e4:03/00:00:00:00:00/e0 tag 0 dma 4096 out
[   84.276562]          res d0/00:08:f0:e4:03/00:00:00:00:00/e0 Emask 0x12 (ATA bus error)
[   84.276687] ata11.00: status: { Busy }
[   84.276738] ata11: hard resetting link
[   84.752043] ata11: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[   84.792226] ata11.00: configured for UDMA/100
[   84.816244] ata11.00: configured for UDMA/100
[   84.816251] ata11: EH complete
[   84.820902] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[   84.823276] sd 10:0:0:0: [sdb] Write Protect is off
[   84.823279] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   85.751705] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   85.754175] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[   85.754194] sd 10:0:0:0: [sdb] Write Protect is off
[   85.754197] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[   85.754227] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   94.226353] EXT4-fs: mballoc: 0 blocks 0 reqs (0 success)
[   94.226357] EXT4-fs: mballoc: 0 extents scanned, 0 goal hits, 0 2^N hits, 0 breaks, 0 lost
[   94.226360] EXT4-fs: mballoc: 0 generated and it took 0
[   94.226362] EXT4-fs: mballoc: 0 preallocated, 0 discarded
[  109.737249] ata11: limiting SATA link speed to 1.5 Gbps
[  109.737249] ata11.00: exception Emask 0x0 SAct 0x0 SErr 0x100000 action 0x6 frozen
[  109.737249] ata11.00: edma_err_cause=00000020 pp_flags=00000001, SError=00100000
[  109.737249] ata11: SError: { Dispar }
[  109.737249] ata11.00: cmd c8/00:00:00:2a:00/00:00:00:00:00/e0 tag 0 dma 131072 in
[  109.737249]          res d0/00:00:00:2a:00/00:00:00:00:00/e0 Emask 0x12 (ATA bus error)
[  109.737249] ata11.00: status: { Busy }
[  109.737249] ata11: hard resetting link
[  110.224035] ata11: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[  110.264228] ata11.00: configured for UDMA/100
[  110.288226] ata11.00: configured for UDMA/100
[  110.288233] ata11: EH complete
[  110.296128] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[  110.299660] sd 10:0:0:0: [sdb] Write Protect is off
[  110.299663] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  110.306738] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  110.313811] sd 10:0:0:0: [sdb] 63045360 512-byte hardware sectors: (32.2 GB/30.0 GiB)
[  110.317344] sd 10:0:0:0: [sdb] Write Protect is off
[  110.317348] sd 10:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  110.324411] sd 10:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA

FROM THIS POINT ONWARD, ALL WAS FINE, READING/WRITING, WHATEVER.

Cheers

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

* Re: CF to SATA bridge support
  2009-08-29 15:59           ` Mark Lord
@ 2009-08-29 16:10             ` Mark Lord
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Lord @ 2009-08-29 16:10 UTC (permalink / raw)
  To: Mathieu GELI; +Cc: Robert Hancock, linux-ide

The ancient 16MB Lexar PIO-only CF-Card did not fare so well.
It crapped out similar to how Mathieu reported,
with lots of HSM errors on WRITEs.  READs were fine, though.

HOTPLUGGING NOW:
[  461.060770] ata11: exception Emask 0x10 SAct 0x0 SErr 0x4010000 action 0xe frozen
[  461.060774] ata11: edma_err_cause=00000010 pp_flags=00000000, dev connect
[  461.060778] ata11: SError: { PHYRdyChg DevExch }
[  461.060785] ata11: hard resetting link
[  461.816019] ata11: SATA link down (SStatus 0 SControl 300)
[  461.816026] ata11: EH complete
[  464.644462] ata12: exception Emask 0x10 SAct 0x0 SErr 0x4010000 action 0xe frozen
[  464.644465] ata12: edma_err_cause=00000010 pp_flags=00000000, dev connect
[  464.644469] ata12: SError: { PHYRdyChg DevExch }
[  464.644475] ata12: hard resetting link
[  465.524031] ata12: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  465.552206] ata12.00: CFA: LEXAR ATA_FLASH, V1.00, max PIO3
[  465.552210] ata12.00: 32128 sectors, multi 0: LBA 
[  465.552225] ata12.00: applying bridge limits
[  465.564244] ata12.00: configured for PIO3 (device error ignored)
[  465.588253] ata12.00: configured for PIO3 (device error ignored)
[  465.588258] ata12: EH complete
[  465.588360] scsi 11:0:0:0: Direct-Access     ATA      LEXAR ATA_FLASH  V1.0 PQ: 0 ANSI: 5
[  465.588501] sd 11:0:0:0: [sdb] 32128 512-byte hardware sectors: (16.4 MB/15.6 MiB)
[  465.588521] sd 11:0:0:0: [sdb] Write Protect is off
[  465.588524] sd 11:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  465.588555] sd 11:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  465.588661] sd 11:0:0:0: [sdb] 32128 512-byte hardware sectors: (16.4 MB/15.6 MiB)
[  465.588680] sd 11:0:0:0: [sdb] Write Protect is off
[  465.588683] sd 11:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[  465.588713] sd 11:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  465.588717]  sdb:<4>ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.617448]  sdb1
[  465.617586] sd 11:0:0:0: [sdb] Attached SCSI removable disk
[  465.617665] sd 11:0:0:0: Attached scsi generic sg2 type 0

UBUNTU NOW TRIES TO AUTOMOUNT THE PARTITIONS:
[  465.632756] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.646726] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.654445] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.662477] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.670420] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.688374] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.694437] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.702436] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata
[  465.710438] ata12: sata_mv: attempting PIO w/multiple DRQ: this may fail due to h/w errata

OKAY, MOUNTED.  NOW WE TRY TO WRITE/SYNC SOME DATA:
[  511.784629] ata12.00: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen
[  511.784634] ata12.00: edma_err_cause=00001000 pp_flags=00000000
[  511.784640] ata12.00: cmd 30/00:01:41:00:00/00:00:00:00:00/e0 tag 0 pio 512 out
[  511.784642]          res 58/00:01:41:00:00/00:00:00:00:00/e0 Emask 0x2 (HSM violation)
[  511.784645] ata12.00: status: { DRDY DRQ }
[  511.784651] ata12: hard resetting link
[  512.260030] ata12: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  512.300230] ata12.00: configured for PIO3 (device error ignored)
[  512.324235] ata12.00: configured for PIO3 (device error ignored)
[  512.324242] ata12: EH complete
[  512.332131] ata12.00: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen
[  512.332134] ata12.00: edma_err_cause=00001000 pp_flags=00000000
[  512.332140] ata12.00: cmd 30/00:01:41:00:00/00:00:00:00:00/e0 tag 0 pio 512 out
[  512.332141]          res 58/00:01:41:00:00/00:00:00:00:00/e0 Emask 0x2 (HSM violation)
[  512.332145] ata12.00: status: { DRDY DRQ }
[  512.332149] ata12: hard resetting link
[  512.808029] ata12: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  512.848229] ata12.00: configured for PIO3 (device error ignored)
[  512.872229] ata12.00: configured for PIO3 (device error ignored)
[  512.872236] ata12: EH complete
[  512.880136] ata12.00: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen
[  512.880140] ata12.00: edma_err_cause=00001000 pp_flags=00000000
[  512.880145] ata12.00: cmd 30/00:01:41:00:00/00:00:00:00:00/e0 tag 0 pio 512 out
[  512.880147]          res 58/00:01:41:00:00/00:00:00:00:00/e0 Emask 0x2 (HSM violation)
[  512.880150] ata12.00: status: { DRDY DRQ }
[  512.880154] ata12: hard resetting link
[  513.356029] ata12: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[  513.396229] ata12.00: configured for PIO3 (device error ignored)
[  513.420229] ata12.00: configured for PIO3 (device error ignored)
[  513.420237] ata12: EH complete
[  513.428128] ata12: limiting SATA link speed to 1.5 Gbps
[  513.428132] ata12.00: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen
[  513.428135] ata12.00: edma_err_cause=00001000 pp_flags=00000000
[  513.428140] ata12.00: cmd 30/00:01:41:00:00/00:00:00:00:00/e0 tag 0 pio 512 out
[  513.428142]          res 58/00:01:41:00:00/00:00:00:00:00/e0 Emask 0x2 (HSM violation)

On the surface of things, I'd say that, yes, this is the multiple-DRQ
errata biting us.  The Marvell chips don't synchronize ATA status
register updates correctly with DRQ and interrupts.  So a special
polling sequence is supposed to be required to make it all play nicely.

And the current sata_mv doesn't do that (yet).

So I suppose we'll have to clone ata_pio_task() and ata_sff_hsm_move()
and hack them for the funky Marvell errata to get this to work correctly.
That's a LOT of code, which is why I was/am hesitant to do it before now.

Anyone else want to have a go at it?
I can describe the exact protocol sequence required
for avoiding the errata issues.

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

end of thread, other threads:[~2009-08-29 16:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07 17:59 CF to SATA bridge support Mathieu GELI
2009-08-08  3:21 ` Robert Hancock
2009-08-08 18:35   ` Mathieu GELI
2009-08-09 16:23     ` Mathieu GELI
2009-08-10 13:33       ` Mark Lord
2009-08-29 13:48         ` Mark Lord
2009-08-29 14:22           ` Mark Lord
2009-08-29 15:47             ` Mark Lord
2009-08-29 15:59           ` Mark Lord
2009-08-29 16:10             ` Mark Lord

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.