Re: Totally broken PCI PM calls

From: Dmitry Torokhov
Date: Mon Oct 11 2004 - 23:14:59 EST


On Monday 11 October 2004 10:00 pm, David Brownell wrote:
> On Monday 11 October 2004 4:08 pm, Benjamin Herrenschmidt wrote:
> > On Tue, 2004-10-12 at 08:58, Dmitry Torokhov wrote:
> >
> > > Yes, I think that devices that failed to resume (and all their children)
> > > have to be moved by the core resume function into a separate list and
> > > then destroyed (again by the driver core).
>
> OHCI has to do this when the controller loses power during suspend;
> which includes many suspend-to-disk cases. It marks the devices dead,
> kills the I/O queues, and then makes khubd do all the work.
>

Yes, I see that. But so far every bus implements it in its own way - USB,
IEEE1394, serio, pcmcia... It would be nice if there was a standard
mechanism to deal with that situation. And actually a standard way of
pruning part of the device tree which is useful for other things as well.

>
> > > For that we might need to add
> > > bus_type->remove_device() handler as it seems that all buses do alot
> > > of work outside of driver->remove handlers. The remove_device should
> > > accept additional argument - something like dead_device that would
> > > suggest that driver should not be alarmed by any errors during unbind/
> > > removal process as the device (or rather usually its parent) is simply
> > > not there anynore.
> >
> > They already do... think USB...
>
> USB decided against the extra argument; drivers don't much care
> at that point. And anyway, they can tell the device is gone by looking
> at status codes returned by URB completion or submission.
>

It really depends on the bus I think... I do not know USB well enough but
does status code gives you enough information to determine that the device
is gone or it's just not responding for mose reason? I probably would not
want to log errors when device is really gone, but when I fail to talk to
it becuase its stuck I would complain.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/