* 40-wire cable detected when directly connected
@ 2008-01-10 17:24 Tobias Müller
2008-01-11 3:53 ` Tejun Heo
0 siblings, 1 reply; 13+ messages in thread
From: Tobias Müller @ 2008-01-10 17:24 UTC (permalink / raw)
To: linux-ide
Hello!
I'm running 2.6.24-rc7 with an Addonics AD4CFPRJ Quad-CF PCI Controller
(http://www.addonics.com/products/flash_memory_reader/ad4cfprj.asp) using
Silicon Image PCI0680 chipset which is connected direct (no cables) with 2
Compact-Flash Cards.
In configured
CONFIG_ATA=y
CONFIG_PATA_SIL680=y
and the controller is correclty found, but it complains about 40-wire cables,
but I'm not using any cables
at all.
Is there a solution to disable this check or to correct this?
Regards
Tobias
dmesg reports
[ 32.577206] pata_sil680 0000:03:04.0: version 0.4.8
[ 32.577230] sil680: 133MHz clock.
[ 32.577302] ACPI: PCI Interrupt 0000:03:04.0[A] -> GSI 16 (level, low) ->
IRQ 16
[ 32.577986] PCI: Setting latency timer of device 0000:03:04.0 to 64
[ 32.578062] scsi4 : pata_sil680
[ 32.578232] scsi5 : pata_sil680
[ 32.578337] ata5: PATA max UDMA/133 irq 16
[ 32.578399] ata6: PATA max UDMA/133 irq 16
[ 32.732289] ata5.00: ATA-4: SanDisk SDCFX4-8192, HDX 4.20, max UDMA/66
[ 32.732353] ata5.00: 16007040 sectors, multi 0: LBA
[ 32.732422] ata5.00: limited to UDMA/33 due to 40-wire cable
[ 32.733155] ata5.00: configured for UDMA/33
[ 32.892034] ata6.00: ATA-4: SanDisk SDCFX3-2048, HDX 4.08, max MWDMA2
[ 32.892099] ata6.00: 4001760 sectors, multi 0: LBA
[ 32.911705] ata6.00: configured for MWDMA2
[ 32.911856] scsi 4:0:0:0: Direct-Access ATA SanDisk SDCFX4-8 HDX
PQ: 0 ANSI: 5
[ 32.912062] sd 4:0:0:0: [sdc] 16007040 512-byte hardware sectors (8196 MB)
[ 32.912135] sd 4:0:0:0: [sdc] Write Protect is off
[ 32.912198] sd 4:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[ 32.912215] sd 4:0:0:0: [sdc] Write cache: disabled, read cache: enabled,
doesn't support DPO or FUA
[ 32.912357] sd 4:0:0:0: [sdc] 16007040 512-byte hardware sectors (8196 MB)
[ 32.912429] sd 4:0:0:0: [sdc] Write Protect is off
[ 32.912492] sd 4:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[ 32.912508] sd 4:0:0:0: [sdc] Write cache: disabled, read cache: enabled,
doesn't support DPO or FUA
[ 32.912604] sdc: sdc1 sdc2
[ 32.913353] sd 4:0:0:0: [sdc] Attached SCSI disk
[ 32.913554] scsi 5:0:0:0: Direct-Access ATA SanDisk SDCFX3-2 HDX
PQ: 0 ANSI: 5
[ 32.913746] sd 5:0:0:0: [sdd] 4001760 512-byte hardware sectors (2049 MB)
[ 32.913819] sd 5:0:0:0: [sdd] Write Protect is off
[ 32.913882] sd 5:0:0:0: [sdd] Mode Sense: 00 3a 00 00
[ 32.913898] sd 5:0:0:0: [sdd] Write cache: disabled, read cache: enabled,
doesn't support DPO or FUA
[ 32.914026] sd 5:0:0:0: [sdd] 4001760 512-byte hardware sectors (2049 MB)
[ 32.914099] sd 5:0:0:0: [sdd] Write Protect is off
[ 32.914161] sd 5:0:0:0: [sdd] Mode Sense: 00 3a 00 00
[ 32.914176] sd 5:0:0:0: [sdd] Write cache: disabled, read cache: enabled,
doesn't support DPO or FUA
[ 32.914273] sdd: sdd1
[ 32.915200] sd 5:0:0:0: [sdd] Attached SCSI dis
lspci -v
03:04.0 RAID bus controller: Silicon Image, Inc. PCI0680 Ultra ATA-133 Host
Controller (rev 02)
Subsystem: Silicon Image, Inc. Winic W-680 (Silicon Image 680 based)
Flags: bus master, medium devsel, latency 64, IRQ 16
I/O ports at df00 [size=8]
I/O ports at de00 [size=4]
I/O ports at dd00 [size=8]
I/O ports at dc00 [size=4]
I/O ports at db00 [size=16]
Memory at fdcff000 (32-bit, non-prefetchable) [size=256]
[virtual] Expansion ROM at fdb00000 [disabled] [size=512K]
Capabilities: [60] Power Management version 2
Kernel driver in use: pata_sil680
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: 40-wire cable detected when directly connected 2008-01-10 17:24 40-wire cable detected when directly connected Tobias Müller @ 2008-01-11 3:53 ` Tejun Heo 2008-01-11 11:47 ` Tobias Müller 2008-01-11 13:56 ` Alan Cox 0 siblings, 2 replies; 13+ messages in thread From: Tejun Heo @ 2008-01-11 3:53 UTC (permalink / raw) To: Tobias Müller; +Cc: linux-ide Tobias Müller wrote: > Hello! > > I'm running 2.6.24-rc7 with an Addonics AD4CFPRJ Quad-CF PCI Controller > (http://www.addonics.com/products/flash_memory_reader/ad4cfprj.asp) using > Silicon Image PCI0680 chipset which is connected direct (no cables) with 2 > Compact-Flash Cards. > > In configured > CONFIG_ATA=y > CONFIG_PATA_SIL680=y > > and the controller is correclty found, but it complains about 40-wire cables, > but I'm not using any cables > at all. > > Is there a solution to disable this check or to correct this? The usual way to correct this is to add a whitelist to override cable detection. Laptops can be identified using dmi data and add-on cards hopefully with subsystem. Dang... Addonics didn't set Subsystem. I don't know very well about CF but does it even fill UDMA/33? What does 'dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct' say? You can increase count for more reliable result. -- tejun ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-11 3:53 ` Tejun Heo @ 2008-01-11 11:47 ` Tobias Müller 2008-01-12 3:26 ` Tejun Heo 2008-01-12 14:38 ` Bartlomiej Zolnierkiewicz 2008-01-11 13:56 ` Alan Cox 1 sibling, 2 replies; 13+ messages in thread From: Tobias Müller @ 2008-01-11 11:47 UTC (permalink / raw) To: linux-ide [-- Attachment #1: Type: text/plain, Size: 1577 bytes --] Tejun Heo schrieb: > I don't know very well about CF but does it even fill UDMA/33? What > does 'dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct' say? You > can increase count for more reliable result. 16+0 Datensätze ein 16+0 Datensätze aus 16777216 Bytes (17 MB) kopiert, 0,561688 s, 29,9 MB/s And hdparm -I /dev/sdc says it should be compatible to udma5. /dev/sdc: ATA device, with non-removable media Model Number: SanDisk SDCFX4-8192 Serial Number: 010611E2297S0510 Firmware Revision: HDX 4.20 Standards: Supported: 4 Likely used: 4 Configuration: Logical max current cylinders 15880 15880 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16007040 LBA user addressable sectors: 16007040 device size with M = 1024*1024: 7815 MBytes device size with M = 1000*1000: 8195 MBytes (8 GB) Capabilities: LBA, IORDY(may be)(cannot be disabled) Standby timer values: spec'd by Vendor R/W multiple sector transfer: Max = 4 Current = 0 DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns Commands/features: Enabled Supported: Write cache * CFA feature set [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/x-pkcs7-signature, Size: 3389 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-11 11:47 ` Tobias Müller @ 2008-01-12 3:26 ` Tejun Heo 2008-01-12 13:40 ` Tobias Müller 2008-01-12 14:38 ` Bartlomiej Zolnierkiewicz 1 sibling, 1 reply; 13+ messages in thread From: Tejun Heo @ 2008-01-12 3:26 UTC (permalink / raw) To: Tobias Müller; +Cc: linux-ide, Alan Cox [-- Attachment #1: Type: text/plain, Size: 867 bytes --] [cc'ing Alan, thanks for the information on the other message] Tobias Müller wrote: > Tejun Heo schrieb: >> I don't know very well about CF but does it even fill UDMA/33? What >> does 'dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct' say? You >> can increase count for more reliable result. > > 16+0 Datensätze ein > 16+0 Datensätze aus > 16777216 Bytes (17 MB) kopiert, 0,561688 s, 29,9 MB/s Hmmm... yeah, it almost fills UDMA/33. I wonder whether it would go higher. > And hdparm -I /dev/sdc says it should be compatible to udma5. > > DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 Please apply the attached patch and specify libata.force_cbl=80 as kernel boot parameter. If you load libata from initrd or after boot you need to pass 'force_cbl=80' as module parameter. How you do it depends on your distro. Thanks. -- tejun [-- Attachment #2: patch --] [-- Type: text/plain, Size: 2180 bytes --] diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4753a18..8c93878 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -119,6 +119,10 @@ int libata_noacpi = 0; module_param_named(noacpi, libata_noacpi, int, 0444); MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in probe/suspend/resume when set"); +int libata_force_cbl = 0; +module_param_named(force_cbl, libata_force_cbl, int, 0644); +MODULE_PARM_DESC(force_cbl, "force PATA cable type (0=keep, 40=40c, 80=80c)"); + MODULE_AUTHOR("Jeff Garzik"); MODULE_DESCRIPTION("Library module for ATA devices"); MODULE_LICENSE("GPL"); diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 21a81cd..7e53215 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -2296,9 +2296,27 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, /* PDIAG- should have been released, ask cable type if post-reset */ if (ata_is_host_link(link) && ap->ops->cable_detect && - (ehc->i.flags & ATA_EHI_DID_RESET)) + (ehc->i.flags & ATA_EHI_DID_RESET)) { ap->cbl = ap->ops->cable_detect(ap); + if (!(ap->flags & ATA_FLAG_SATA) && libata_force_cbl) { + switch (libata_force_cbl) { + case 40: + ata_port_printk(ap, KERN_INFO, "forcing 40c\n"); + ap->cbl = ATA_CBL_PATA40; + break; + case 80: + ata_port_printk(ap, KERN_INFO, "forcing 80c\n"); + ap->cbl = ATA_CBL_PATA80; + break; + default: + ata_port_printk(ap, KERN_WARNING, + "invalid force_cbl value %d\n", + libata_force_cbl); + } + } + } + /* Configure new devices forward such that user doesn't see * device detection messages backwards. */ diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index bbe59c2..b990a8d 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@ -60,6 +60,7 @@ extern int atapi_dmadir; extern int atapi_passthru16; extern int libata_fua; extern int libata_noacpi; +extern int libata_force_cbl; extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, u64 block, u32 n_block, unsigned int tf_flags, ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 3:26 ` Tejun Heo @ 2008-01-12 13:40 ` Tobias Müller 2008-01-13 6:06 ` Tejun Heo 0 siblings, 1 reply; 13+ messages in thread From: Tobias Müller @ 2008-01-12 13:40 UTC (permalink / raw) To: linux-ide [-- Attachment #1: Type: text/plain, Size: 1005 bytes --] Hi > Please apply the attached patch and specify libata.force_cbl=80 as > kernel boot parameter. If you load libata from initrd or after boot you > need to pass 'force_cbl=80' as module parameter. How you do it depends > on your distro. [ 41.116289] ata7: forcing 80c [ 41.116356] ata7.00: ATA-4: SanDisk SDCFX4-8192, HDX 4.20, max UDMA/66 [ 41.116420] ata7.00: 16007040 sectors, multi 0: LBA [ 41.116489] ata7.00: limited to UDMA/33 due to 40-wire cable [ 41.117219] ata7.00: configured for UDMA/33 Speed is still the same and hdparm -I /dev/sdc sill says [...] Capabilities: LBA, IORDY(may be)(cannot be disabled) Standby timer values: spec'd by Vendor R/W multiple sector transfer: Max = 4 Current = 0 DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns [...] Regards Tobias [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/x-pkcs7-signature, Size: 3389 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 13:40 ` Tobias Müller @ 2008-01-13 6:06 ` Tejun Heo 0 siblings, 0 replies; 13+ messages in thread From: Tejun Heo @ 2008-01-13 6:06 UTC (permalink / raw) To: Tobias Müller; +Cc: linux-ide Tobias Müller wrote: > Hi > >> Please apply the attached patch and specify libata.force_cbl=80 as >> kernel boot parameter. If you load libata from initrd or after boot you >> need to pass 'force_cbl=80' as module parameter. How you do it depends >> on your distro. Ah.. right. I'm brewing more complete debug helper patch. I'll take the above into consideration. -- tejun ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-11 11:47 ` Tobias Müller 2008-01-12 3:26 ` Tejun Heo @ 2008-01-12 14:38 ` Bartlomiej Zolnierkiewicz 2008-01-12 14:29 ` Tobias Müller 1 sibling, 1 reply; 13+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2008-01-12 14:38 UTC (permalink / raw) To: Tobias Müller; +Cc: linux-ide On Friday 11 January 2008, Tobias Müller wrote: > Tejun Heo schrieb: > > I don't know very well about CF but does it even fill UDMA/33? What > > does 'dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct' say? You > > can increase count for more reliable result. > > 16+0 Datensätze ein > 16+0 Datensätze aus > 16777216 Bytes (17 MB) kopiert, 0,561688 s, 29,9 MB/s > > And hdparm -I /dev/sdc says it should be compatible to udma5. [...] Please send 'hdparm --Istdout /dev/hdc' output. Thanks, Bart ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 14:38 ` Bartlomiej Zolnierkiewicz @ 2008-01-12 14:29 ` Tobias Müller 2008-01-12 16:09 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 13+ messages in thread From: Tobias Müller @ 2008-01-12 14:29 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz, linux-ide [-- Attachment #1: Type: text/plain, Size: 1377 bytes --] Bartlomiej Zolnierkiewicz schrieb: > Please send 'hdparm --Istdout /dev/hdc' output. /dev/sdc: 044a 3e08 0000 0010 0000 0240 003f 00f4 3f80 0000 2020 2020 3031 3036 3131 4532 3239 3753 3035 3130 0002 0002 0004 4844 5820 342e 3230 5361 6e44 6973 6b20 5344 4346 5834 2d38 3139 3220 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 0004 0000 0300 0000 0200 0000 0007 3e08 0010 003f 3f80 00f4 0100 3f80 00f4 0000 0007 0003 0078 0078 0078 0078 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0010 0000 0020 4004 4000 0000 0004 4000 041f 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0082 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/x-pkcs7-signature, Size: 3389 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 14:29 ` Tobias Müller @ 2008-01-12 16:09 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:14 ` Bartlomiej Zolnierkiewicz ` (2 more replies) 0 siblings, 3 replies; 13+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2008-01-12 16:09 UTC (permalink / raw) To: Tobias Müller; +Cc: linux-ide, Tejun Heo, Alan Cox On Saturday 12 January 2008, Tobias Müller wrote: > Bartlomiej Zolnierkiewicz schrieb: > > Please send 'hdparm --Istdout /dev/hdc' output. > > /dev/sdc: [...] Thanks, device has no cable detection (no surprise here, it is a CF card) so over-riding only host side cable detection won't work. As a workaround you can try using IDE subsystem siimage driver and pass "idex=ata66" option or modify Tejun's patch to also override device side cable detection by replacing ATA_CBL_PATA80 with ATA_CBL_PATA40_SHORT. I've re-read the whole thread and it seems that the possible solution for Addonics card would be to detect it by PCI Subsystem Vendor/Device IDs. Could you send the output of 'lspci -vvv -xxx' command? Bart ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 16:09 ` Bartlomiej Zolnierkiewicz @ 2008-01-12 16:14 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:22 ` Tobias Müller 2008-01-12 17:23 ` Tobias Müller 2 siblings, 0 replies; 13+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2008-01-12 16:14 UTC (permalink / raw) To: Tobias Müller; +Cc: linux-ide, Tejun Heo, Alan Cox On Saturday 12 January 2008, Bartlomiej Zolnierkiewicz wrote: [...] > I've re-read the whole thread and it seems that the possible solution for > Addonics card would be to detect it by PCI Subsystem Vendor/Device IDs. It seems I wasn't paying enough attention, Tejun already thought of this but unfortunately Addonics didn't set custom Subsystem IDs. > Could you send the output of 'lspci -vvv -xxx' command? Still may be useful. Bart ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 16:09 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:14 ` Bartlomiej Zolnierkiewicz @ 2008-01-12 16:22 ` Tobias Müller 2008-01-12 17:23 ` Tobias Müller 2 siblings, 0 replies; 13+ messages in thread From: Tobias Müller @ 2008-01-12 16:22 UTC (permalink / raw) To: linux-ide [-- Attachment #1: Type: text/plain, Size: 2305 bytes --] Hi Bartlomiej Zolnierkiewicz schrieb: > As a workaround you can try using IDE subsystem siimage driver and pass > "idex=ata66" option or modify Tejun's patch to also override device side > cable detection by replacing ATA_CBL_PATA80 with ATA_CBL_PATA40_SHORT. I'll try this. > Could you send the output of 'lspci -vvv -xxx' command? 03:04.0 RAID bus controller: Silicon Image, Inc. PCI0680 Ultra ATA-133 Host Controller (rev 02) Subsystem: Silicon Image, Inc. Winic W-680 (Silicon Image 680 based) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 64, Cache Line Size: 4 bytes Interrupt: pin A routed to IRQ 16 Region 0: I/O ports at df00 [size=8] Region 1: I/O ports at de00 [size=4] Region 2: I/O ports at dd00 [size=8] Region 3: I/O ports at dc00 [size=4] Region 4: I/O ports at db00 [size=16] Region 5: Memory at fdcff000 (32-bit, non-prefetchable) [size=256] [virtual] Expansion ROM at fdb00000 [disabled] [size=512K] Capabilities: [60] Power Management version 2 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=2 PME- Kernel driver in use: pata_sil680 00: 95 10 80 06 07 00 90 02 02 00 04 01 01 40 00 00 10: 01 df 00 00 01 de 00 00 01 dd 00 00 01 dc 00 00 20: 01 db 00 00 00 f0 cf fd 00 00 00 00 95 10 80 36 30: 00 00 00 00 60 00 00 00 00 00 00 00 0f 01 00 00 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60: 01 00 22 06 00 40 00 64 00 00 00 00 00 00 00 00 70: 08 00 00 00 00 60 1f 7c 08 00 00 00 00 30 1f 7c 80: 03 00 00 00 02 00 00 00 00 00 11 00 09 19 22 51 90: 00 fe 00 0d ff ff ff 3b 00 00 00 19 00 00 00 00 a0: 01 62 c1 10 c1 10 8a 32 c1 10 92 43 07 40 09 40 b0: 01 62 c1 10 c1 10 8a 32 c1 10 92 43 00 40 09 40 c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Regards Tobias [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/x-pkcs7-signature, Size: 3389 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-12 16:09 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:14 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:22 ` Tobias Müller @ 2008-01-12 17:23 ` Tobias Müller 2 siblings, 0 replies; 13+ messages in thread From: Tobias Müller @ 2008-01-12 17:23 UTC (permalink / raw) To: linux-ide [-- Attachment #1.1: Type: text/plain, Size: 3210 bytes --] Hi Bartlomiej Zolnierkiewicz schrieb: > As a workaround you can try using IDE subsystem siimage driver and pass > "idex=ata66" option or modify Tejun's patch to also override device side > cable detection by replacing ATA_CBL_PATA80 with ATA_CBL_PATA40_SHORT. I changed some code in libata=core.c in ata_dev_xfermask (see patch2), that xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA) isn't set, when forcing 80c. Everything seems to work now. I have a about 41 MB/s while reading. Regards Tobias dmesg says [ 40.854101] ata7: PATA max UDMA/133 irq 16 [ 40.854162] ata8: PATA max UDMA/133 irq 16 [ 41.008881] ata7: forcing 80c [ 41.008949] ata7.00: ATA-4: SanDisk SDCFX4-8192, HDX 4.20, max UDMA/66 [ 41.009014] ata7.00: 16007040 sectors, multi 0: LBA [ 41.009751] ata7.00: configured for UDMA/66 [ 41.168606] ata8: forcing 80c [ 41.168673] ata8.00: ATA-4: SanDisk SDCFX3-2048, HDX 4.08, max MWDMA2 [ 41.168738] ata8.00: 4001760 sectors, multi 0: LBA [ 41.188267] ata8.00: configured for MWDMA2 [ 41.188418] scsi 6:0:0:0: Direct-Access ATA SanDisk SDCFX4-8 HDX PQ: 0 ANSI: 5 [ 41.188622] sd 6:0:0:0: [sdc] 16007040 512-byte hardware sectors (8196 MB) [ 41.188696] sd 6:0:0:0: [sdc] Write Protect is off [ 41.188759] sd 6:0:0:0: [sdc] Mode Sense: 00 3a 00 00 [ 41.188776] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 41.188918] sd 6:0:0:0: [sdc] 16007040 512-byte hardware sectors (8196 MB) [ 41.188990] sd 6:0:0:0: [sdc] Write Protect is off [ 41.189054] sd 6:0:0:0: [sdc] Mode Sense: 00 3a 00 00 [ 41.189070] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 41.189167] sdc: sdc1 sdc2 [ 41.189880] sd 6:0:0:0: [sdc] Attached SCSI disk [ 41.190092] scsi 7:0:0:0: Direct-Access ATA SanDisk SDCFX3-2 HDX PQ: 0 ANSI: 5 [ 41.190283] sd 7:0:0:0: [sdd] 4001760 512-byte hardware sectors (2049 MB) [ 41.190357] sd 7:0:0:0: [sdd] Write Protect is off [ 41.190419] sd 7:0:0:0: [sdd] Mode Sense: 00 3a 00 00 [ 41.190436] sd 7:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 41.190567] sd 7:0:0:0: [sdd] 4001760 512-byte hardware sectors (2049 MB) [ 41.190640] sd 7:0:0:0: [sdd] Write Protect is off [ 41.190702] sd 7:0:0:0: [sdd] Mode Sense: 00 3a 00 00 [ 41.190719] sd 7:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 41.190815] sdd: sdd1 [ 41.191733] sd 7:0:0:0: [sdd] Attached SCSI disk hdparm -I /dev/sda [...] Capabilities: LBA, IORDY(may be)(cannot be disabled) Standby timer values: spec'd by Vendor R/W multiple sector transfer: Max = 4 Current = 0 DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 *udma4 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns [...] dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct 16+0 Datensätze ein 16+0 Datensätze aus 16777216 Bytes (17 MB) kopiert, 0,402367 s, 41,7 MB/s [-- Attachment #1.2: patch2 --] [-- Type: text/plain, Size: 3893 bytes --] diff --git a/linux-2.6.24-rc7/drivers/ata/libata-core.c b/linux-2.6.24-rc7-twam/drivers/ata/libata-core.c index 4753a18..ac5a0d4 100644 --- a/linux-2.6.24-rc7/drivers/ata/libata-core.c +++ b/linux-2.6.24-rc7-twam/drivers/ata/libata-core.c @@ -119,6 +119,10 @@ int libata_noacpi = 0; module_param_named(noacpi, libata_noacpi, int, 0444); MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in probe/suspend/resume when set"); +int libata_force_cbl = 0; +module_param_named(force_cbl, libata_force_cbl, int, 0644); +MODULE_PARM_DESC(force_cbl, "force PATA cable type (0=keep, 40=40c, 80=80c)"); + MODULE_AUTHOR("Jeff Garzik"); MODULE_DESCRIPTION("Library module for ATA devices"); MODULE_LICENSE("GPL"); @@ -4318,16 +4322,29 @@ static void ata_dev_xfermask(struct ata_device *dev) * drive side as well. Cases where we know a 40wire cable * is used safely for 80 are not checked here. */ - if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA)) - /* UDMA/44 or higher would be available */ - if ((ap->cbl == ATA_CBL_PATA40) || - (ata_is_40wire(dev) && - (ap->cbl == ATA_CBL_PATA_UNK || - ap->cbl == ATA_CBL_PATA80))) { - ata_dev_printk(dev, KERN_WARNING, - "limited to UDMA/33 due to 40-wire cable\n"); - xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); + if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA)) { + switch (libata_force_cbl) { + case 40: + /* limit to UDMA/33 */ + ata_dev_printk(dev, KERN_INFO, "forcing 40c\n"); + xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); + break; + case 80: + /* ignore cable checks */ + ata_dev_printk(dev, KERN_INFO, "forcing 80c\n"); + break; + default: + /* UDMA/44 or higher would be available */ + if ((ap->cbl == ATA_CBL_PATA40) || + (ata_is_40wire(dev) && + (ap->cbl == ATA_CBL_PATA_UNK || + ap->cbl == ATA_CBL_PATA80))) { + ata_dev_printk(dev, KERN_WARNING, + "limited to UDMA/33 due to 40-wire cable\n"); + xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); + } } + } ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask, &dev->udma_mask); diff --git a/linux-2.6.24-rc7/drivers/ata/libata-eh.c b/linux-2.6.24-rc7-twam/drivers/ata/libata-eh.c index f0124a8..7c607e0 100644 --- a/linux-2.6.24-rc7/drivers/ata/libata-eh.c +++ b/linux-2.6.24-rc7-twam/drivers/ata/libata-eh.c @@ -2288,9 +2288,27 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, /* PDIAG- should have been released, ask cable type if post-reset */ if (ata_is_host_link(link) && ap->ops->cable_detect && - (ehc->i.flags & ATA_EHI_DID_RESET)) + (ehc->i.flags & ATA_EHI_DID_RESET)) { ap->cbl = ap->ops->cable_detect(ap); + if (!(ap->flags & ATA_FLAG_SATA) && libata_force_cbl) { + switch (libata_force_cbl) { + case 40: + ata_port_printk(ap, KERN_INFO, "forcing 40c\n"); + ap->cbl = ATA_CBL_PATA40; + break; + case 80: + ata_port_printk(ap, KERN_INFO, "forcing 80c\n"); + ap->cbl = ATA_CBL_PATA80; + break; + default: + ata_port_printk(ap, KERN_WARNING, + "invalid force_cbl value %d\n", + libata_force_cbl); + } + } + } + /* Configure new devices forward such that user doesn't see * device detection messages backwards. */ diff --git a/linux-2.6.24-rc7/drivers/ata/libata.h b/linux-2.6.24-rc7-twam/drivers/ata/libata.h index bbe59c2..b990a8d 100644 --- a/linux-2.6.24-rc7/drivers/ata/libata.h +++ b/linux-2.6.24-rc7-twam/drivers/ata/libata.h @@ -60,6 +60,7 @@ extern int atapi_dmadir; extern int atapi_passthru16; extern int libata_fua; extern int libata_noacpi; +extern int libata_force_cbl; extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, u64 block, u32 n_block, unsigned int tf_flags, [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/x-pkcs7-signature, Size: 3389 bytes --] ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: 40-wire cable detected when directly connected 2008-01-11 3:53 ` Tejun Heo 2008-01-11 11:47 ` Tobias Müller @ 2008-01-11 13:56 ` Alan Cox 1 sibling, 0 replies; 13+ messages in thread From: Alan Cox @ 2008-01-11 13:56 UTC (permalink / raw) To: Tejun Heo; +Cc: Tobias Müller, linux-ide > I don't know very well about CF but does it even fill UDMA/33? What > does 'dd if=/dev/sdc of=/dev/null bs=1M count=16 iflag=direct' say? You > can increase count for more reliable result. Some CF hardware can manage UDMA33, almost no adapters and cable convertors can however. I don't know if any of the 40pin CF connectors are rated for over UDMA33 (but they are 40 wire so that is correct ;)) Alan ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-01-13 6:06 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-01-10 17:24 40-wire cable detected when directly connected Tobias Müller 2008-01-11 3:53 ` Tejun Heo 2008-01-11 11:47 ` Tobias Müller 2008-01-12 3:26 ` Tejun Heo 2008-01-12 13:40 ` Tobias Müller 2008-01-13 6:06 ` Tejun Heo 2008-01-12 14:38 ` Bartlomiej Zolnierkiewicz 2008-01-12 14:29 ` Tobias Müller 2008-01-12 16:09 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:14 ` Bartlomiej Zolnierkiewicz 2008-01-12 16:22 ` Tobias Müller 2008-01-12 17:23 ` Tobias Müller 2008-01-11 13:56 ` Alan Cox
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).