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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 04 Nov 2012 17:55:17 +0400
From:	Sergei Shtylyov <sshtylyov@...sta.com>
To:	Ming Lei <ming.lei@...onical.com>
CC:	"David S. Miller" <davem@...emloft.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Oliver Neukum <oneukum@...e.de>, netdev@...r.kernel.org,
	linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 5/5] usbnet: make device out of suspend before calling
 usbnet_read[write]_cmd

Hello.

On 04-11-2012 15:16, Ming Lei wrote:

    s/make/wake/ in the subject?

> This patche gets the runtime PM reference count before calling

    s/patche/patch/

> usbnet_read[write]_cmd, and puts it after completion of the
> usbnet_read[write]_cmd, so that the usb control message can always

    You probably meant usbnet_{read|write}_cmd() here and in the subject?

> be sent to one active device in the non-PM context.

> Signed-off-by: Ming Lei <ming.lei@...onical.com>
> ---
>   drivers/net/usb/usbnet.c |   18 ++++++++++++++----
>   1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index a7fb074..74caa67 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -1673,8 +1673,13 @@ out:
>   int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
>   		    u16 value, u16 index, void *data, u16 size)
>   {
> -	return __usbnet_read_cmd(dev, cmd, reqtype, value, index,
> -				 data, size);
> +	int ret;

    Empty line wouldn't hurt here, after declaration block.

> +	if (usb_autopm_get_interface(dev->intf) < 0)
> +		return -ENODEV;
> +	ret = __usbnet_read_cmd(dev, cmd, reqtype, value, index,
> +				data, size);
> +	usb_autopm_put_interface(dev->intf);
> +	return ret;
>   }
>   EXPORT_SYMBOL_GPL(usbnet_read_cmd);
>
> @@ -1685,8 +1690,13 @@ EXPORT_SYMBOL_GPL(usbnet_read_cmd);
>   int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
>   		     u16 value, u16 index, const void *data, u16 size)
>   {
> -	return __usbnet_write_cmd(dev, cmd, reqtype, value, index,
> -				  data, size);
> +	int ret;

    And here too...

> +	if (usb_autopm_get_interface(dev->intf) < 0)
> +		return -ENODEV;
> +	ret = __usbnet_write_cmd(dev, cmd, reqtype, value, index,
> +				 data, size);
> +	usb_autopm_put_interface(dev->intf);
> +	return ret;
>   }
>   EXPORT_SYMBOL_GPL(usbnet_write_cmd);

WBR, Sergei

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