> > > >Not entirely true.  OHCI tries to safeguard against broken drivers,
> > > >and in 2.5 anything using the new HCD code in usbcore does the
> > > >same safeguarding.  (Such as EHCI ...)  The UHCI drivers may do
> > > >things differently.
> > >
> > > Actually I would not call it broken driver. I think it make sense for HCD
> > > or USB core to cancel all outstanding requests prior to calling 
> > 'disconnect'.
> >
> >Not without (a) defining a new URB status code to indicate
> >"canceled due to disconnect, and (b) doing a major rework
> >of the relationship between the hub driver and the HCDs.
>
> (a) == -ENOENT (ie URB killed). It doesn't really matter who called unlink_urb.
> We can add new one if it does.

At first blush, I can't agree that the reason doesn't matter.

Overloading status codes causes problems ... robust
software can't afford to be in the "guess which of N cases
this code indicates" business.

Here's a scenario:  driver unlinks an URB for its own
reasons (planning to submit new ones) at the same
time someone unplugs the device.  In your model, the
driver would automatically be getting confused about
whether it's OK to submit new URBs.

(That said, I still think that having both ECONNRESET
and ENOENT for async and sync unlink [respectively]
is pointless and confusing.  But nobody's gotten around
to a patch to clean up that mess.)


> >It'd be possible to do (b) in the context of 2.5, but that'd be
> >a fair amount of work.
>
> But you're saying that OHCI and EHCI already do that ?

No, that's not what I said at all.  The order of the disconnect
and completion callbacks would be rather different in the
model you proposed an in the current "safeguard against
nasty driver bugs" model.


> > > Why can't HCD just cancel them itself before calling
> > > disconnect ?
> >
> >As I wrote earlier, the HCD isn't calling disconnect.  It's
> >the hub driver.
>
> I meant any part of USB core. Whoever calls disconnect
> could potentially tell HCD to cancel all requests on this device.

The "potential" is that substantial (b) rework.

- Dave




_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to