Bug 132507

Summary: permanent compact flash change detection in kernel 2.6.14-3
Product: [openSUSE] SUSE Linux 10.1 Reporter: Ulrich Holeschak <ulrich>
Component: KernelAssignee: Hannes Reinecke <hare>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: behlert, hare
Version: Alpha 2Keywords: beta_customer
Target Milestone: ---   
Hardware: i586   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ulrich Holeschak 2005-11-06 23:52:50 UTC
From SUSE kernel 2.6.14-3 on (works well in 2.6.13 and older SUSE kernels), complact flash hard disks connected with and CF-IDE adapter are permanently redetected.
I have found that the following lines have been removed in the ide-disk.c::idedisk_media_changed() in kernel 2.6.14-3:

        /* We get reliably notified from PCMCIA layer */
        if (drive->is_flash)
                return 0;

If i add these lines again (copied from kernel 2.6.13), all is OK.
Was there a reason to removes these lines?
Comment 1 Olaf Kirch 2005-11-15 11:32:45 UTC
Jens, Greg - any idea what to do with this?
Comment 3 Greg Kroah-Hartman 2005-11-15 22:05:05 UTC
What do you mean "permanently redetected"?

There was a nasty loop from udev opening the device to detect the kind of media,
which caused a new hotplug event from the driver, which looped again.  Is 
that what you are seeing here too?
Comment 4 Hannes Reinecke 2005-11-16 07:50:42 UTC
Yes. ide-cs drives will recreate partitions on _every_ call to open().
You can imagine for yourself what this means.

There was a discussion about this on lkml recently (cf '[patch] Re: 2.6.14-rc5-mm1 - ide-cs broken!').
It boils down to that PCMCIA CF cards are _not_ removeable from the kernel point of view, as (in roughly 80% of all cases) removing of the media implies a removal of the PCMCIA adapter, which will result in a complete teardown of all associated structures, including the IDE stack.
Allegedly there are some built-in CF card readers which are a) not USB and b) not removeable, but so far I haven't seen any of them.
For those case we would need blacklisting, sure.

Nevertheless, I've already re-added the patch in question (no-partition-check-for-pcmcia); feel free to replace it with the upstream version if and when it gets included.
So far all those attempts got vetoed by Alan Cox :-( 
Comment 5 Ulrich Holeschak 2005-11-16 08:56:36 UTC
What do you mean "permanently redetected":
Of course udev also runs crazy when the CF is detected permanently, but i tested with killing udev also. In this case i can still see the redectection of the device in the syslog, so redetection of the CF is NOT created by an udev loop ...

Comment 6 Hannes Reinecke 2006-03-09 11:03:22 UTC
As it's not udev triggering the loop in the first place but hal instead killing udev wouldn't help here.
Comment 7 Kay Sievers 2006-03-09 15:50:50 UTC
HAL can handle the additional events at open just fine, it does not cause a loop. I've comitted a udev yesterday, that should skip all persistent rules for removable IDE devices.
Comment 8 Hannes Reinecke 2006-03-13 15:28:57 UTC
So I'll close this; should be fixed by other means (ie udev).