All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Abhijeet@vger.kernel.org, Kumar@vger.kernel.org
Cc: Jaejoong Kim <climbbb.kim@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Abhijeet Kumar <abhijeet.kumar@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB :core :Prevent USB devices to autosuspend while setting interface
Date: Fri, 10 Nov 2017 17:07:45 +0100	[thread overview]
Message-ID: <20171110160745.GA4090@kroah.com> (raw)
In-Reply-To: <1510329728-26491-1-git-send-email-abhijeet.kumar@intel.com>

On Fri, Nov 10, 2017 at 09:32:07PM +0530, Abhijeet@vger.kernel.org wrote:
> From: Abhijeet Kumar <abhijeet.kumar@intel.com>
> 
> Runtime resume USB device in order to ensure that PM framework knows
> that the we might be using the device in a short time and doesn't
> autosuspend the device while we update it's interface. Without this
> change, if device autosuspends and the kernel polling for block
> devices is disabled through sysfs at runtime or through bootargs, then
> storage devices might never unmount since the disconnect IRQ wont be
> kicked at all.
> 
> Signed-off-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
> ---
>  drivers/usb/core/message.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
> index 371a07d874a3..54a9accf88cb 100644
> --- a/drivers/usb/core/message.c
> +++ b/drivers/usb/core/message.c
> @@ -1305,6 +1305,11 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
>  	if (iface->unregistering)
>  		return -ENODEV;
>  
> +	/*Letting runtime PM know that we wish to use the device in a
> +	 * short time.
> +	 */

Please place comments int the correct style.

> +	pm_runtime_get(&iface->dev);
> +

No dropping of the pm_runtime when we are finished?

This feels really wrong to me...

greg k-h

  reply	other threads:[~2017-11-10 16:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 16:02 [PATCH] USB :core :Prevent USB devices to autosuspend while setting interface Abhijeet, Kumar
2017-11-10 16:07 ` Greg Kroah-Hartman [this message]
2017-11-10 16:30 ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2017-11-10 12:49 Abhijeet, Kumar
2017-11-10 12:54 ` Felipe Balbi

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=20171110160745.GA4090@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Abhijeet@vger.kernel.org \
    --cc=Kumar@vger.kernel.org \
    --cc=abhijeet.kumar@intel.com \
    --cc=climbbb.kim@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.