Re: [PATCH net 1/2] r8152: add pre_reset and post_reset

From: Oliver Neukum
Date: Tue Jul 28 2015 - 08:06:52 EST


On Tue, 2015-07-28 at 09:52 +0000, Hayes Wang wrote:
> Oliver Neukum [mailto:oneukum@xxxxxxxx]
> > Sent: Tuesday, July 28, 2015 4:53 PM
> [...]
> > > + return 0;
> > > +
> > > + netdev = tp->netdev;
> > > + if (!netif_running(netdev))
> > > + return 0;
> > > +
> > > + ret = usb_autopm_get_interface(intf);
> > > + if (ret < 0)
> > > + return ret;
> >
> > What sense does this make?
> >
> [...]
> > > + return 0;
> > > +
> > > + netdev = tp->netdev;
> > > + if (!netif_running(netdev))
> > > + return 0;
> > > +
> > > + ret = usb_autopm_get_interface(intf);
> >
> > The device will be awake.
>
> I don't sure if the device would be in runtimesuspend, so I wake it up by myself.
> I think you mean I don't have to do this. I would remove them and resend the
> patch. Thanks.

Usbcore will resume the device.

HTH
Oliver

A.
/* Prevent autosuspend during the reset */
usb_autoresume_device(udev);

if (config) {
for (i = 0; i < config->desc.bNumInterfaces; ++i) {
struct usb_interface *cintf = config->interface[i];
struct usb_driver *drv;
int unbind = 0;

if (cintf->dev.driver) {
drv = to_usb_driver(cintf->dev.driver);
if (drv->pre_reset && drv->post_reset)
unbind = (drv->pre_reset)(cintf);




--
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/