From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755545AbdKOOXZ (ORCPT ); Wed, 15 Nov 2017 09:23:25 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:47293 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbdKOOXQ (ORCPT ); Wed, 15 Nov 2017 09:23:16 -0500 X-Google-Smtp-Source: AGs4zMbEmEDRZr7n/Vg1fvYLFPYaSES3c46BEBi29+GIQ5ivH/+c+0wEjC/RFsvAVRdeFMpO+yt+LA== Date: Wed, 15 Nov 2017 15:23:20 +0100 From: Johan Hovold To: abhijeet.kumar@intel.com Cc: Marcel Holtmann , Gustavo Padovan , Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface Message-ID: <20171115142320.GE11226@localhost> References: <1510747888-13912-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: <1510747888-13912-1-git-send-email-abhijeet.kumar@intel.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 15, 2017 at 05:41:28PM +0530, abhijeet.kumar@intel.com 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. > > Signed-off-by: Abhijeet Kumar > --- > drivers/bluetooth/btusb.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 7a5c06aaa181..588aabf991be 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -1444,6 +1444,12 @@ static void btusb_work(struct work_struct *work) > data->sco_skb = NULL; > spin_unlock_irqrestore(&data->rxlock, flags); > > + /* > + *Letting runtime PM know that we wish to use > + *the device in a short time. > + */ > + pm_runtime_get(&data->udev->dev); > + This is broken. Where is the corresponding put? And why would you need this at all, given that the interface is resumed at the start of this branch? > if (__set_isoc_interface(hdev, new_alts) < 0) > return; > } Johan