Bug 223463

Summary: CF card on PCMCIA adapter causes missed interrupts and system hangs
Product: [Fedora] Fedora Reporter: Peter F. Patel-Schneider <pfps>
Component: kernelAssignee: Peter Martuccelli <peterm>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: imc, jonstanley, notting, pfpschneider, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-30 16:06:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 427887    
Attachments:
Description Flags
dmesg output
none
/var/log/messages fragments
none
system information and logs related to CF problem none

Description Peter F. Patel-Schneider 2007-01-19 15:52:00 UTC
Description of problem:

Plugging and unplugging PCMCIA CF adapter (with CF card attached) does not work

Version-Release number of selected component (if applicable):


How reproducible:

Plug / unplug PCMCIA adapter, in this case a Kodak Picture Card Adapter with a
4GB Kingston Elite Pro CF card.

Steps to Reproduce:
1. Load current FC6
2. Plug PCMCIA adapter
3. Unplug PCMCIA adapter
  
Actual results:

Various undesired results, including
1/ CF card not mounted (and thus not visible)
2/ Lost interrupts (see dmesg output attached)
3/ Kernel BUG (see dmesg output attached)
4/ Complete system hang (/var/log/fragment just below)

Jan 19 10:27:39 idefix last message repeated 3 times
Jan 19 10:28:07 idefix kernel: pccard: card ejected from slot 0
Jan 19 10:28:07 idefix kernel: BUG: sleeping function called from invalid
context at kernel/rwsem.c:20
Jan 19 10:28:07 idefix kernel: in_atomic():0, irqs_disabled():1
Jan 19 10:28:07 idefix kernel:  [<c0405018>] dump_trace+0x69/0x1b6
Jan 19 10:28:07 idefix kernel:  [<c040517d>] show_trace_log_lvl+0x18/0x2c
Jan 19 10:28:07 idefix kernel:  [<c0405778>] show_trace+0xf/0x11
Jan 19 10:28:07 idefix kernel:  [<c0405875>] dump_stack+0x15/0x17
Jan 19 10:28:07 idefix kernel:  [<c043c402>] down_read+0x12/0x28
Jan 19 10:28:07 idefix kernel:  [<c04fb299>] pci_find_device+0x60/0xaf
Jan 19 10:28:07 idefix kernel:  [<c057140d>] init_hwif_default+0x28/0xeb
Jan 19 10:28:07 idefix kernel:  [<c0572116>] ide_unregister+0x2d7/0x61e
Jan 19 10:28:07 idefix kernel:  [<f8b10018>] ide_release+0x18/0x28 [ide_cs]
Jan 19 10:28:07 idefix kernel:  [<f8b10030>] ide_detach+0x8/0x14 [ide_cs]
Jan 19 10:28:07 idefix kernel:  [<c0583419>] pcmcia_device_remove+0x54/0xde
Jan 19 10:28:07 idefix kernel:  [<c055e5ed>] __device_release_driver+0x60/0x78
Jan 19 10:28:07 idefix kernel:  [<c055e999>] device_release_driver+0x32/0x48
Jan 19 10:28:07 idefix kernel:  [<c055e068>] bus_remove_device+0x6d/0x7d
Jan 19 10:28:07 idefix kernel:  [<c055cc30>] device_del+0x166/0x19a
Jan 19 10:28:07 idefix kernel:  [<c055cc6c>] device_unregister+0x8/0x10
Jan 19 10:28:07 idefix kernel:  [<c0583098>] pcmcia_card_remove+0x58/0x77
Jan 19 10:28:07 idefix kernel:  [<c0583a56>] ds_event+0x56/0x87
Jan 19 10:28:07 idefix kernel:  [<c057f727>] send_event+0x41/0x7e
Jan 19 10:28:07 idefix kernel:  [<c057f92b>] socket_shutdown+0xc/0xd8
Jan 19 10:28:07 idefix kernel:  [<c0580000>] pccardd+0x13b/0x1ee
Jan 19 10:28:07 idefix kernel:  [<c0439810>] kthread+0xc0/0xec
Jan 19 10:28:07 idefix kernel:  [<c0404c03>] kernel_thread_helper+0x7/0x10
Jan 19 10:28:07 idefix kernel:  =======================

Expected results:

CF card mounted and visible on GNOME desktop on card insert.
CF card dismounted on card removal.

Additional info:

The attachment is dmesg output covering insertion, removal, and reinsertion of card.

The exact same setup worked about two weeks ago.

The CF card operates normally when attached using a USB CF adapter.   The PCMCIA
card and CF card operate normally under Windows.

Comment 1 Peter F. Patel-Schneider 2007-01-19 15:52:00 UTC
Created attachment 145991 [details]
dmesg output

Comment 2 Peter F. Patel-Schneider 2007-04-26 22:30:25 UTC
The card works "better" in F7t4, in that it doesn't cause a crash, but it
doesn't work correctly.

Here is a short extract from /var/log/messages.  I'm not sure what the last line
is referring to.


Apr 26 17:10:04 localhost kernel: pccard: PCMCIA card inserted into slot 0
Apr 26 17:10:04 localhost kernel: cs: memory probe 0xe4300000-0xe7ffffff:
excluding 0xe4300000-0xe46cffff 0xe4e70000-0xe523ffff 0xe5db0000-0xe617ffff
0xe6cf0000-0xe70bffff
Apr 26 17:10:04 localhost kernel: pcmcia: registering new device pcmcia0.0
Apr 26 17:10:04 localhost kernel: ata7: PATA max PIO0 cmd 0x0001a100 ctl
0x0001a10e bmdma 0x00000000 irq 3
Apr 26 17:10:04 localhost kernel: scsi9 : pata_pcmcia
Apr 26 17:10:34 localhost kernel: ata7.00: qc timeout (cmd 0x91)
Apr 26 17:10:34 localhost kernel: ata7.00: failed to IDENTIFY (INIT_DEV_PARAMS
failed, err_mask=0x4)
Apr 26 17:11:05 localhost kernel: ata7.00: qc timeout (cmd 0x91)
Apr 26 17:11:05 localhost kernel: ata7.00: failed to IDENTIFY (INIT_DEV_PARAMS
failed, err_mask=0x4)
Apr 26 17:11:05 localhost kernel: ata7.00: limiting speed to UDMA7:PIO5
Apr 26 17:11:36 localhost kernel: ata7.00: qc timeout (cmd 0x91)
Apr 26 17:11:36 localhost kernel: ata7.00: failed to IDENTIFY (INIT_DEV_PARAMS
failed, err_mask=0x4)
Apr 26 17:11:36 localhost udevd-event[3258]: udev_rules_apply_format: unknown
format variable '$modalias'


Comment 3 Peter F. Patel-Schneider 2007-04-27 00:18:55 UTC
Further information on situation with F7t4:

If the card is in during startup, then it works fine, and can be unplugged and
replugged.  There is a message complaining about $modalias during startup, though.


Comment 4 Ian Collier 2007-08-22 21:27:53 UTC
This has been getting progressively worse for me on FC6 with each kernel update.
 It used to work, but gave the "BUG: sleeping function called from invalid
context" traceback whenever I removed the card (with occasional hangs).

Now with 2.6.22.1-32.fc6 it does not work at all.  Inserting the card gives this:

kernel: pccard: PCMCIA card inserted into slot 0
kernel: cs: memory probe 0xf0000000-0xf7ffffff: excluding 0xf0000000-0xf7ffffff
kernel: cs: memory probe 0xd0200000-0xdfffffff: excluding 0xd0200000-0xd11fffff 
0xd1a00000-0xd21fffff 0xd2a00000-0xd31fffff 0xd3a00000-0xd81fffff 0xd8a00000-0xd
91fffff 0xd9a00000-0xda1fffff 0xdaa00000-0xdb1fffff 0xdba00000-0xdc1fffff 0xdca0
0000-0xdd1fffff 0xdda00000-0xde1fffff 0xdea00000-0xdf1fffff 0xdfa00000-0xe01ffff
f
kernel: pcmcia: registering new device pcmcia0.0
kernel: hde: SAMSUNG CF/ATA, CFA DISK drive
kernel: ide2 at 0x3100-0x3107,0x310e on irq 3
kernel: hde: max request size: 128KiB
kernel: hde: 504320 sectors (258 MB) w/1KiB Cache, CHS=985/16/32
kernel:  hde:hde: status error: status=0x20 { DeviceFault }
kernel: ide: failed opcode was: unknown
kernel: hde: drive not ready for command
kernel: ide2: reset: success
kernel: hde: lost interrupt

System now appears to be completely hung, so a few minutes later I remove the
card and immediately get this:

last message repeated 2 times
kernel: ipw2200: Firmware error detected.  Restarting.
kernel: pccard: card ejected from slot 0
kernel: hde: irq timeout: status=0xff { Busy }
kernel: ide: failed opcode was: unknown
kernel: ide2: reset timed-out, status=0xff
kernel: hde: status timeout: status=0xff { Busy }
kernel: ide: failed opcode was: unknown
kernel: hde: drive not ready for command
kernel: ipw2200: Firmware error detected.  Restarting.
kernel: ide2: reset timed-out, status=0xff
kernel: end_request: I/O error, dev hde, sector 0
kernel: Buffer I/O error on device hde, logical block 0
[last two lines another 8 times]
kernel: Dev hde: unable to read RDB block 0
kernel:  unable to read partition table
kernel: ide-cs: hde: Vpp = 0.0
kernel: BUG: sleeping function called from invalid context at kernel/rwsem.c:20
kernel: in_atomic():0, irqs_disabled():1
kernel:  [<c043a052>] down_read+0x12/0x28
kernel:  [<c04f619a>] pci_get_subsys+0x71/0xf3
kernel:  [<c04f6232>] pci_get_device+0x16/0x19
kernel:  [<c056a640>] init_hwif_default+0x25/0xdd
kernel:  [<c056ab35>] ide_unregister+0x240/0x57c
kernel:  [<f0540018>] ide_release+0x18/0x28 [ide_cs]
kernel:  [<f0540030>] ide_detach+0x8/0x14 [ide_cs]
kernel:  [<c0584c02>] pcmcia_device_remove+0x50/0xb5
kernel:  [<c055801f>] __device_release_driver+0x6e/0x8b
kernel:  [<c05583f2>] device_release_driver+0x32/0x48
kernel:  [<c05579d7>] bus_remove_device+0x6a/0x7a
kernel:  [<c055611d>] device_del+0x1f5/0x266
kernel:  [<c0556196>] device_unregister+0x8/0x10
kernel:  [<c0584850>] pcmcia_card_remove+0x58/0x77
kernel:  [<c05851e0>] ds_event+0x56/0x87
kernel:  [<c0428092>] printk+0x1f/0x92
kernel:  [<c0580ff4>] send_event+0x3b/0x53
kernel:  [<c05811d3>] socket_shutdown+0xc/0xb3
kernel:  [<c0581296>] socket_remove+0x1c/0x26
kernel:  [<c058183e>] pccardd+0x12d/0x1ea
kernel:  [<c04222ad>] default_wake_function+0x0/0xc
kernel:  [<c0581711>] pccardd+0x0/0x1ea
kernel:  [<c0436f0e>] kthread+0x38/0x5e
kernel:  [<c0436ed6>] kthread+0x0/0x5e
kernel:  [<c0405b6b>] kernel_thread_helper+0x7/0x10
kernel:  =======================

The same CF card and PCMCIA adaptor works fine in my old FC2 laptop under
2.6.16-1.2111.

I ought to try having it in the machine at startup, I suppose.

Comment 5 Jon Stanley 2008-01-08 01:53:23 UTC
(This is a mass-update to all current FC6 kernel bugs in NEW state)

Hello,

I'm reviewing this bug list as part of the kernel bug triage project, an attempt
to isolate current bugs in the Fedora kernel.

http://fedoraproject.org/wiki/KernelBugTriage

I am CC'ing myself to this bug, however this version of Fedora is no longer
maintained.

Please attempt to reproduce this bug with a current version of Fedora (presently
Fedora 8). If the bug no longer exists, please close the bug or I'll do so in a
few days if there is no further information lodged.

Thanks for using Fedora!

Comment 6 Ian Collier 2008-01-20 22:53:32 UTC
This appears to be fixed in Fedora 8's current kernel, presumably as a result of
the move to libata.

Comment 7 Peter F. Patel-Schneider 2008-02-06 21:48:16 UTC
Created attachment 294155 [details]
/var/log/messages fragments

Comment 8 Peter F. Patel-Schneider 2008-02-06 21:53:31 UTC
The bug appears to be still in effect.  I just upgraded my IBM T60P to Fedora 8,
and am current for all packages.  Comment 7 has /var/log/messages fragments
showing behaviour.

Summary:  When system boots with PCMCIA - CF adapter in, everything works fine,
including removal and reinsertion.  When the system boots without the adapter,
inserting it does not work correctly, with the following messages (also in
attachment).

Feb  6 16:07:42 localhost kernel: pccard: PCMCIA card inserted into slot 0
Feb  6 16:07:42 localhost kernel: pcmcia: registering new device pcmcia0.0
Feb  6 16:07:42 localhost kernel: scsi6 : pata_pcmcia
Feb  6 16:07:42 localhost kernel: ata7: PATA max PIO0 cmd 0x0001a100 ctl
0x0001a10e bmdma 0x00000000 irq 3
Feb  6 16:08:13 localhost kernel: ata7.00: qc timeout (cmd 0x91)
Feb  6 16:08:13 localhost kernel: ata7.00: failed to IDENTIFY (INIT_DEV_PARAMS
failed, err_mask=0x4)
Feb  6 16:08:43 localhost kernel: ata7.00: qc timeout (cmd 0x91)
Feb  6 16:08:43 localhost kernel: ata7.00: failed to IDENTIFY (INIT_DEV_PARAMS
failed, err_mask=0x4)
Feb  6 16:08:43 localhost kernel: ata7.00: limiting speed to UDMA7:PIO5
Feb  6 16:09:14 localhost kernel: ata7.00: qc timeout (cmd 0x91)
Feb  6 16:09:14 localhost kernel: ata7.00: failed to IDENTIFY (INIT_DEV_PARAMS
failed, err_mask=0x4)
Feb  6 16:09:15 localhost kernel: ata7: EH pending after completion, repeating
EH (cnt=4)

Comment 9 Jon Stanley 2008-03-09 06:51:42 UTC
Hmm, there's conflicting data here.  Stupid question - is there a CF card in the
adapter when you insert it?  All of the real brains are in the card, not the
adapter, so if the adapter has no card, there could be issues with properly
detecting it.

Comment 10 Peter F. Patel-Schneider 2008-03-09 13:35:40 UTC
Created attachment 297355 [details]
system information and logs related to CF problem

I just tried again with the newest version of F8 (6.24 kernel) and problems
persist.  I have attached two scenarios - booting with the adapter and CF card
and inserting the adapter and CF card after boot.

Neither one works right any more.   Booting with the card ends up with an extra
desktop icon.  Inserting the card after boot doesn't seem to correctly set up
the card.

Comment 11 Peter F. Patel-Schneider 2008-03-21 00:45:37 UTC
This appears to be a known long-standing problem in lkml
http://lkml.org/lkml/2007/5/15/231
is a relevant message.

I don't know whether there is a current fix up there.  I couldn't find one after
looking quite closely.


Comment 12 Peter F. Patel-Schneider 2008-06-12 09:48:23 UTC
Current F9 does not fix the problem, but the behaviour is somewhat different. 
Here is a /var/log/messages exerpt:


Jun 12 05:44:04 idefix kernel: pccard: PCMCIA card inserted into slot 0
Jun 12 05:44:04 idefix kernel: cs: memory probe 0xe4300000-0xe7ffffff: excluding
0xe4300000-0xe46cffff 0xe4e70000-0xe523ffff 0xe5db0000-0xe617ffff
0xe6cf0000-0xe70bffff
Jun 12 05:44:04 idefix kernel: pcmcia: registering new device pcmcia0.0
Jun 12 05:44:04 idefix kernel: scsi7 : pata_pcmcia
Jun 12 05:44:04 idefix kernel: ata7: PATA max PIO0 cmd 0xa100 ctl 0xa10e irq 3
Jun 12 05:44:04 idefix kernel: ata7.00: CFA: SanDisk SDCFB-32, HAD 2.13, max PIO4
Jun 12 05:44:04 idefix kernel: ata7.00: 62720 sectors, multi 0: LBA 
Jun 12 05:44:04 idefix kernel: ata7.00: configured for PIO0
Jun 12 05:44:04 idefix kernel: isa bounce pool size: 16 pages
Jun 12 05:44:04 idefix kernel: scsi 7:0:0:0: Direct-Access     ATA      SanDisk
SDCFB-32 HAD  PQ: 0 ANSI: 5
Jun 12 05:44:04 idefix kernel: sd 7:0:0:0: [sdb] 62720 512-byte hardware sectors
(32 MB)
Jun 12 05:44:04 idefix kernel: sd 7:0:0:0: [sdb] Write Protect is off
Jun 12 05:44:04 idefix kernel: sd 7:0:0:0: [sdb] Write cache: disabled, read
cache: enabled, doesn't support DPO or FUA
Jun 12 05:44:04 idefix kernel: sd 7:0:0:0: [sdb] 62720 512-byte hardware sectors
(32 MB)
Jun 12 05:44:04 idefix kernel: sd 7:0:0:0: [sdb] Write Protect is off
Jun 12 05:44:04 idefix kernel: sd 7:0:0:0: [sdb] Write cache: disabled, read
cache: enabled, doesn't support DPO or FUA
Jun 12 05:44:34 idefix kernel:  sdb:<3>ata7.00: exception Emask 0x0 SAct 0x0
SErr 0x0 action 0x2 frozen
Jun 12 05:44:34 idefix kernel: ata7.00: cmd 20/00:08:00:00:00/00:00:00:00:00/e0
tag 0 pio 4096 in
Jun 12 05:44:34 idefix kernel:          res 40/00:00:00:00:00/00:00:00:00:00/00
Emask 0x4 (timeout)
Jun 12 05:44:34 idefix kernel: ata7.00: status: { DRDY }
Jun 12 05:44:34 idefix kernel: ata7: soft resetting link
Jun 12 05:44:34 idefix kernel: ata7.00: configured for PIO0
Jun 12 05:44:34 idefix kernel: ata7: EH complete
Jun 12 05:45:04 idefix kernel: ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0
action 0x2 frozen
Jun 12 05:45:04 idefix kernel: ata7.00: cmd 20/00:08:00:00:00/00:00:00:00:00/e0
tag 0 pio 4096 in
Jun 12 05:45:04 idefix kernel:          res 40/00:00:00:00:00/00:00:00:00:00/00
Emask 0x4 (timeout)
Jun 12 05:45:04 idefix kernel: ata7.00: status: { DRDY }
Jun 12 05:45:04 idefix kernel: ata7: soft resetting link
Jun 12 05:45:05 idefix kernel: ata7.00: configured for PIO0
Jun 12 05:45:05 idefix kernel: ata7: EH complete
Jun 12 05:45:35 idefix kernel: ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0
action 0x2 frozen
Jun 12 05:45:35 idefix kernel: ata7.00: cmd 20/00:08:00:00:00/00:00:00:00:00/e0
tag 0 pio 4096 in
Jun 12 05:45:35 idefix kernel:          res 40/00:00:00:00:00/00:00:00:00:00/00
Emask 0x4 (timeout)
Jun 12 05:45:35 idefix kernel: ata7.00: status: { DRDY }
Jun 12 05:45:35 idefix kernel: ata7: soft resetting link
Jun 12 05:45:35 idefix kernel: ata7.00: configured for PIO0
Jun 12 05:45:35 idefix kernel: ata7: EH complete
Jun 12 05:46:05 idefix kernel: ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0
action 0x2 frozen
Jun 12 05:46:05 idefix kernel: ata7.00: cmd 20/00:08:00:00:00/00:00:00:00:00/e0
tag 0 pio 4096 in
Jun 12 05:46:05 idefix kernel:          res 40/00:00:00:00:00/00:00:00:00:00/00
Emask 0x4 (timeout)
Jun 12 05:46:05 idefix kernel: ata7.00: status: { DRDY }
Jun 12 05:46:05 idefix kernel: ata7: soft resetting link
Jun 12 05:46:05 idefix kernel: ata7.00: configured for PIO0
Jun 12 05:46:05 idefix kernel: ata7: EH complete
Jun 12 05:46:35 idefix kernel: ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0
action 0x2 frozen
Jun 12 05:46:35 idefix kernel: ata7.00: cmd 20/00:08:00:00:00/00:00:00:00:00/e0
tag 0 pio 4096 in
Jun 12 05:46:35 idefix kernel:          res 40/00:00:00:00:00/00:00:00:00:00/00
Emask 0x4 (timeout)
Jun 12 05:46:35 idefix kernel: ata7.00: status: { DRDY }
Jun 12 05:46:35 idefix kernel: ata7: soft resetting link
Jun 12 05:46:35 idefix kernel: ata7.00: configured for PIO0
Jun 12 05:46:35 idefix kernel: ata7: EH complete


Comment 13 Peter F. Patel-Schneider 2008-09-26 21:41:56 UTC
In current F9, things seem to be working.  I'll try in F10 beta, and if it works there I'll declare victory.

Comment 14 Peter F. Patel-Schneider 2008-09-26 23:24:20 UTC
Oops, I spoke too soon.  There are still problems, similar to those in the past.

Comment 15 Bug Zapper 2008-11-26 07:08:59 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 17 Peter F. Patel-Schneider 2009-04-29 23:23:56 UTC
I haven't seen any of these problems for quite a while.   I expect that something in F10 or F11 (which I am running) has fixed the problem.

I suggest closing with status RAWHIDE.