From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753323AbdKJQHg (ORCPT ); Fri, 10 Nov 2017 11:07:36 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50810 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbdKJQHf (ORCPT ); Fri, 10 Nov 2017 11:07:35 -0500 Date: Fri, 10 Nov 2017 17:07:45 +0100 From: Greg Kroah-Hartman To: Abhijeet@vger.kernel.org, Kumar@vger.kernel.org Cc: Jaejoong Kim , Jonathan Corbet , Abhijeet Kumar , Mauro Carvalho Chehab , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB :core :Prevent USB devices to autosuspend while setting interface Message-ID: <20171110160745.GA4090@kroah.com> References: <1510329728-26491-1-git-send-email-abhijeet.kumar@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510329728-26491-1-git-send-email-abhijeet.kumar@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 10, 2017 at 09:32:07PM +0530, Abhijeet@vger.kernel.org wrote: > From: Abhijeet Kumar > > 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 > --- > 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