On Mon, 2016-03-14 at 11:03 -0400, Alan Stern wrote:
> On Mon, 14 Mar 2016, Oliver Neukum wrote:
> > It seems to me that hid_resume_common() needs to be split into three
> > parts
> >
> > a) doing the stuff for pending resets
> > b) conditionally restarting IO
> > c) reset the flag
>
> Daniel's problem involved hid_post_reset(), not hid_resume_common().
> Is that what you meant? Maybe I'm wrong, but it looks like
> hid_post_reset() just needs to check whether I/O should be started
> before trying to restart it.
Yes. That means that all that hid_post_reset() does before calling
hid_start_in() must be left unchanged and we can put the change into
a common code path.
> (It also looks like hid_resume() needs to clear the HID_SUSPENDED flag
> even when HID_STARTED isn't set.)
Exactly. Thus hid_resume_common() needs to be split. The code paths
for reset_resume(), post_reset() and resume() diverge too much. You will
see that they can be easily be reused if you split them into
those three parts.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html