From: Sergei Shtylyov <sshtylyov@mvista•com>
To: Ming Lei <ming.lei@canonical•com>
Cc: "David S. Miller" <davem@davemloft•net>,
Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
Oliver Neukum <oneukum@suse•de>,
netdev@vger•kernel.org, linux-usb@vger•kernel.org
Subject: Re: [PATCH v2 5/5] usbnet: make device out of suspend before calling usbnet_read[write]_cmd
Date: Sun, 04 Nov 2012 17:55:17 +0400 [thread overview]
Message-ID: <509673C5.1090005@mvista.com> (raw)
In-Reply-To: <1352027793-6608-6-git-send-email-ming.lei@canonical.com>
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@canonical•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
prev parent reply other threads:[~2012-11-04 13:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-04 11:16 [PATCH v2 0/5] usbnet: avoiding access auto-suspended device Ming Lei
[not found] ` <1352027793-6608-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2012-11-04 11:16 ` [PATCH v2 1/5] usbnet: introduce usbnet_read[write]_cmd_nopm Ming Lei
2012-11-04 11:16 ` [PATCH v2 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend Ming Lei
2012-11-04 11:16 ` [PATCH v2 4/5] usbnet: smsc95xx: apply the introduced usbnet_read[write]_cmd_nopm Ming Lei
2012-11-04 11:16 ` [PATCH v2 2/5] usbnet: smsc75xx: " Ming Lei
2012-11-04 11:16 ` [PATCH v2 5/5] usbnet: make device out of suspend before calling usbnet_read[write]_cmd Ming Lei
2012-11-04 13:55 ` Sergei Shtylyov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=509673C5.1090005@mvista.com \
--to=sshtylyov@mvista$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=linux-usb@vger$(echo .)kernel.org \
--cc=ming.lei@canonical$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=oneukum@suse$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox