ExpressCard compact flash card DMA setting is wrong

Bug #713487 reported by Damon Lynch
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm using Natty alpha 2 with the latest updates, running on a Lenovo T400s. When using a Lexar ExpressCard CompactFlash (CF) reader in the ExpressCard slot, the speed of this high speed device is very slow because the wrong settings are being used by the kernel.

This is the product: http://www.lexar.com/products/lexar-professional-expresscard-compactflash-cf-reader?category=213

Some relevant dmesg output:

[ 1.308314] udev[74]: starting version 165
[ 1.355564] pata_jmicron 0000:05:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 1.355610] pata_jmicron 0000:05:00.0: setting latency timer to 64
[ 1.362895] scsi0 : pata_jmicron
[ 1.366095] scsi1 : pata_jmicron
[ 1.366145] ata1: PATA max UDMA/100 cmd 0x4020 ctl 0x4014 bmdma 0x4000 irq 19
[ 1.366148] ata2: PATA max UDMA/100 cmd 0x4018 ctl 0x4010 bmdma 0x4008 irq 19
[ 1.382061] e1000e: Intel(R) PRO/1000 Network Driver - 1.2.20-k2
[ 1.382063] e1000e: Copyright(c) 1999 - 2011 Intel Corporation.
[ 1.382095] e1000e 0000:00:19.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
[ 1.382106] e1000e 0000:00:19.0: setting latency timer to 64
[ 1.382248] e1000e 0000:00:19.0: irq 43 for MSI/MSI-X
[ 1.560701] ata1.00: CFA: TRANSCEND, 20091215, max UDMA/133
[ 1.560704] ata1.00: 125059072 sectors, multi 0: LBA
[ 1.560707] ata1.00: limited to UDMA/33 due to 40-wire cable
[ 1.580098] usb 1-6: new high speed USB device using ehci_hcd and address 3
[ 1.600683] ata1.00: configured for UDMA/33
[ 1.600837] scsi 0:0:0:0: Direct-Access ATA TRANSCEND 2009 PQ: 0 ANSI: 5
[ 1.600983] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1.601000] sd 0:0:0:0: [sda] 125059072 512-byte logical blocks: (64.0 GB/59.6 GiB)
[ 1.601047] sd 0:0:0:0: [sda] Write Protect is off
[ 1.601049] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.601076] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1.602198] sda: sda1
[ 1.602554] sd 0:0:0:0: [sda] Attached SCSI disk

"limited to UDMA/33 due to 40-wire cable" is obviously a key point here.

Relevant output from sudo lspci -vv:
05:00.0 IDE interface: JMicron Technology Corp. JMB368 IDE controller (prog-if 85 [Master SecO PriO])
 Subsystem: JMicron Technology Corp. JMB368 IDE controller
 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
 Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
 Latency: 0, Cache Line Size: 64 bytes
 Interrupt: pin A routed to IRQ 19
 Region 0: I/O ports at 4020 [size=8]
 Region 1: I/O ports at 4014 [size=4]
 Region 2: I/O ports at 4018 [size=8]
 Region 3: I/O ports at 4010 [size=4]
 Region 4: I/O ports at 4000 [size=16]
 [virtual] Expansion ROM at f2900000 [disabled] [size=64K]
 Capabilities: [68] Power Management version 2
  Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
  Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
 Capabilities: [50] Express (v1) Legacy Endpoint, MSI 01
  DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
   ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
  DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
   RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
   MaxPayload 128 bytes, MaxReadReq 512 bytes
  DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq+ AuxPwr- TransPend-
  LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 <1us, L1 <16us
   ClockPM- Surprise- LLActRep- BwNot-
  LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
   ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
  LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
 Capabilities: [70] MSI: Enable- Count=1/1 Maskable- 64bit-
  Address: 00000000 Data: 0000
 Kernel driver in use: pata_jmicron
 Kernel modules: pata_jmicron

From hdparm:

/dev/sda:

 Model=TRANSCEND, FwRev=20091215, SerialNo=20100521 000008F4
 Config={ HardSect NotMFM Fixed DTR>10Mbs }
 RawCHS=16383/15/63, TrkSize=0, SectSize=576, ECCbytes=4
 BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off
 CurCHS=65535/15/63, CurSects=61930575, LBA=yes, LBAsects=125059072
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4
 DMA modes: mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5 udma6
 AdvancedPM=yes: disabled (255) WriteCache=disabled

 * signifies the current active mode

hdparm cannot set a higher speed mode:

$ sudo hdparm -X udma5 /dev/sda

/dev/sda:
 setting xfermode to 69 (UltraDMA mode5)
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: linux-image-2.6.38-1-generic 2.6.38-1.28
Regression: No
Reproducible: Yes
ProcVersionSignature: Ubuntu 2.6.38-1.28-generic 2.6.38-rc2
Uname: Linux 2.6.38-1-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.23.
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: damon 1362 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xf2820000 irq 45'
   Mixer name : 'Conexant CX20585'
   Components : 'HDA:14f15069,17aa2132,00100302'
   Controls : 8
   Simple ctrls : 5
Card29.Amixer.info:
 Card hw:29 'ThinkPadEC'/'ThinkPad Console Audio Control at EC reg 0x30, fw 6HHT14WW-1.02'
   Mixer name : 'ThinkPad EC 6HHT14WW-1.02'
   Components : ''
   Controls : 1
   Simple ctrls : 1
Card29.Amixer.values:
 Simple mixer control 'Console',0
   Capabilities: pswitch pswitch-joined penum
   Playback channels: Mono
   Mono: Playback [on]
Date: Fri Feb 4 21:48:33 2011
HibernationDevice: RESUME=UUID=bc754809-bf19-44d5-ace4-6e4028ee147c
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110202)
MachineType: LENOVO 2801CTO
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, user)
 LANG=en_US.UTF-8
 LC_MESSAGES=en_US.utf8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-1-generic root=UUID=1a217fba-4cce-4ad8-b624-8d17416b2f1c ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-2.6.38-1-generic N/A
 linux-backports-modules-2.6.38-1-generic N/A
 linux-firmware 1.46
SourcePackage: linux
dmi.bios.date: 12/09/2010
dmi.bios.vendor: LENOVO
dmi.bios.version: 6HET34WW (1.19 )
dmi.board.name: 2801CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6HET34WW(1.19):bd12/09/2010:svnLENOVO:pn2801CTO:pvrThinkPadT400s:rvnLENOVO:rn2801CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 2801CTO
dmi.product.version: ThinkPad T400s
dmi.sys.vendor: LENOVO

Revision history for this message
Damon Lynch (dlynch3) wrote :
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Damon,

If you could also please test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Damon Lynch (dlynch3) wrote :

Hi Jeremy,

I've tested it using the latest upstream kernel, from today:

$cat /proc/version
Linux version 2.6.38-020638rc6-generic (root@zinc) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #201102220910 SMP Tue Feb 22 09:12:52 UTC 2011

The bug is present in upstream too:

[ 1.687119] scsi0 : pata_jmicron
[ 1.692480] scsi1 : pata_jmicron
[ 1.692523] ata1: PATA max UDMA/100 cmd 0x4020 ctl 0x4014 bmdma 0x4000 irq 19
[ 1.692525] ata2: PATA max UDMA/100 cmd 0x4018 ctl 0x4010 bmdma 0x4008 irq 19
[ 1.870088] usb 1-6: new high speed USB device using ehci_hcd and address 3
[ 1.890676] ata1.00: CFA: TRANSCEND, 20091215, max UDMA/133
[ 1.890678] ata1.00: 125059072 sectors, multi 0: LBA
[ 1.890681] ata1.00: limited to UDMA/33 due to 40-wire cable
[ 1.930831] ata1.00: configured for UDMA/33
[ 1.930984] scsi 0:0:0:0: Direct-Access ATA TRANSCEND 2009 PQ: 0 ANSI: 5
[ 1.931132] sd 0:0:0:0: [sda] 125059072 512-byte logical blocks: (64.0 GB/59.6 GiB)
[ 1.931144] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1.931181] sd 0:0:0:0: [sda] Write Protect is off
[ 1.931184] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.931371] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1.932525] sda: sda1
[ 1.932904] sd 0:0:0:0: [sda] Attached SCSI disk
[

tags: removed: needs-upstream-testing
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Christopher A. Chavez (chrstphrchvz) wrote :

I have the same Lexar Expresscard CompactFlash reader, and encountered this issue is still present in Ubuntu 17.10, even when using mainline kernel (4.14.2).

Changed in linux (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Christopher A. Chavez (chrstphrchvz) wrote :

After a little more digging, I came across the original reporter's correspondence on the linux-ide mailing list which determined because the adapter appears as a generic JMicron PCIe to PATA controller, it couldn't be reliably whitelisted without affecting other devices with the same controller. For reference, the workaround is to use module parameter libata.force=80c.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.