Re: [PATCHv5] usbnet: Resubmit interrupt URB once if halted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 23, 2011 at 11:36 PM, Oliver Neukum <oliver@xxxxxxxxxx> wrote:
> Am Freitag, 22. April 2011, 17:59:15 schrieb Paul Stewart:
>> >
>> >>       free_netdev(net);
>> >>       usb_put_dev (xdev);
>> >>  }
>> >> @@ -1285,6 +1291,10 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
>> >>                * wake the device
>> >>                */
>> >>               netif_device_attach (dev->net);
>> >> +
>> >> +             /* Stop interrupt URBs */
>> >> +             if (dev->interrupt)
>> >> +                     usb_kill_urb(dev->interrupt);
>> >>       }
>> >>       return 0;
>> >>  }
>> >
>> > There is a subtle question here: When is the best time to kill the
>> > interrupt URB?  Without knowing any of the details, I'd guess that the
>> > interrupt URB reports asynchronous events and the driver could run into
>> > trouble if one of those events occurred while everything else was
>> > turned off.  This suggests that the interrupt URB should be killed as
>> > soon as possible rather than as late as possible.  But maybe it doesn't
>> > matter; it all depends on the design of the driver.
>>
>> I'm not sure I can answer this question either.  As it stands, nobody
>> was killing them before.  Just trying to make it better.
>
> Hm. Are we looking at the same code?

Perhaps not.  I'm working out of the netdev-2.6 git repository.  Is
this the wrong place?

> usbnet_suspend now has:
>
>                /*
>                 * accelerate emptying of the rx and queues, to avoid
>                 * having everything error out.
>                 */
>                netif_device_detach (dev->net);
>                usbnet_terminate_urbs(dev);
>                usb_kill_urb(dev->interrupt);
>
> This suggests that if you want to resubmit the interrupt URB in resume()
> you do it first. Which drivers use the interrupt URB?

The asix driver uses it fo signal link status.

>
>        Regards
>                Oliver
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux