[PATCHSET] "client_t" patchset (formerly pcmcia-b15) re-diffed and updated

Dominik Brodowski linux at dominikbrodowski.de
Sun May 16 19:59:13 EDT 2004

On Sun, May 16, 2004 at 10:35:28PM +0100, Christoph Hellwig wrote:
> > 13-bug_on_dev_list_not_null
> > 
> > All in-kernel PCMCIA devices do unregister their client in their respective
> > ->detach() function after a REMOVAL event. So, AFAICS, the dev_list iteration
> > should always be false.
> synclink_cs and a bunch of pcmcia drivers still defer the unregistration
> (grep for DEV_STALE_* handling).  I've sent patches fixing this to the ISDN
> maintainers, but I haven't dealt with synclink_cs yet.

However, 12-direct_ordered_unbind causes the following. In case of an
ejection request (from cardmgr or because of physical removal) ds_event()
calls the event handler with CS_EVENT_CARD_REMOVAL, and only once that call
is completed, unbind_request() calls the ->detach function.

Taking synclink_cs as an example:

mgslpc_event() does, in
	    link->state &= ~DEV_PRESENT;
	    if (link->state & DEV_CONFIG) {
		    ((MGSLPC_INFO *)link->priv)->stop = 1;

mgslpc_release() includes     link->state &= ~DEV_CONFIG;

so that

mgslpc_detach(), which is called from unbind_request

    if (link->state & DEV_CONFIG) {
	    /* device is configured/active, mark it so when
	     * release() is called a proper detach() occurs.
	    if (debug_level >= DEBUG_LEVEL_INFO)
		    printk(KERN_DEBUG "synclinkpc: detach postponed, '%s' "
			   "still locked\n", link->dev->dev_name);
	    link->state |= DEV_STALE_LINK;

will never mark the link as DEV_STALE_LINK.

Same for the other PCMCIA drivers still using DEV_STALE_LINK. 
DEV_STALE_LINKs only occur if ->detach() is called _before_ the
event handler is notified with CS_EVENT_CARD_REMOVAL; and this
cannot happen if 12-direct_ordered_unbind is merged.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20040516/aa835e04/attachment.bin

More information about the linux-pcmcia mailing list