lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTim_NRFV0ELzpOE6K539Wfxsw8j1eW-3TXLCrgOZ@mail.gmail.com>
Date:	Mon, 1 Nov 2010 17:04:35 +0200
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	tom.leiming@...il.com
Cc:	netdev@...r.kernel.org, oliver@...kum.org, davem@...emloft.net,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Ben Hutchings <ben@...adent.org.uk>,
	Joe Perches <joe@...ches.com>, stable@...nel.org
Subject: Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)

On Mon, Nov 1, 2010 at 4:05 PM,  <tom.leiming@...il.com> wrote:
> From: Ming Lei <tom.leiming@...il.com>
>
> Since usbnet already took usb runtime pm, we have to
> enable runtime pm for usb interface of usbnet, otherwise
> usb_autopm_get_interface may return failure and cause
> 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
> enabled.
>
> Cc: David Brownell <dbrownell@...rs.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@...e.de>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Ben Hutchings <ben@...adent.org.uk>
> Cc: Joe Perches <joe@...ches.com>
> Cc: Oliver Neukum <oliver@...kum.org>
> Cc: Andy Shevchenko <andy.shevchenko@...il.com>
> Cc: stable@...nel.org
> Signed-off-by: Ming Lei <tom.leiming@...il.com>
> ---
> v1: include header file
>
> ---
>  drivers/net/usb/usbnet.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index ca7fc9d..06b1dee 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -45,6 +45,7 @@
>  #include <linux/usb/usbnet.h>
>  #include <linux/slab.h>
>  #include <linux/kernel.h>
> +#include <linux/pm_runtime.h>
>
>  #define DRIVER_VERSION         "22-Aug-2005"
>
> @@ -1273,6 +1274,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
>        struct usb_device               *xdev;
>        int                             status;
>        const char                      *name;
> +       struct usb_driver       *driver = to_usb_driver(udev->dev.driver);
> +
> +       /*usbnet already took usb runtime pm, so have to enable the feature
> +       * for usb interface, otherwise usb_autopm_get_interface may return
> +       * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
> +       * */
Just minor: multiline comments doesn't follow the required style.

> +       if (!driver->supports_autosuspend) {
> +               driver->supports_autosuspend = 1;
> +               pm_runtime_enable(&udev->dev);
> +       }
>
>        name = udev->dev.driver->name;
>        info = (struct driver_info *) prod->driver_info;
> --
> 1.7.3
>
>



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ