linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface
@ 2017-11-15 12:11 abhijeet.kumar
  2017-11-15 13:54 ` Marcel Holtmann
  2017-11-15 14:23 ` Johan Hovold
  0 siblings, 2 replies; 4+ messages in thread
From: abhijeet.kumar @ 2017-11-15 12:11 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, linux-bluetooth,
	linux-kernel
  Cc: abhijeet.kumar

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.

Signed-off-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
---
 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);
+
 			if (__set_isoc_interface(hdev, new_alts) < 0)
 				return;
 		}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface
  2017-11-15 12:11 [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface abhijeet.kumar
@ 2017-11-15 13:54 ` Marcel Holtmann
  2017-11-15 14:01   ` Bastien Nocera
  2017-11-15 14:23 ` Johan Hovold
  1 sibling, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2017-11-15 13:54 UTC (permalink / raw)
  To: abhijeet.kumar
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-kernel

Hi Abhijeet,

> 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 <abhijeet.kumar@intel.com>
> ---
> 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);
> +

the indentation is wrong here and the comment coding style if off. Please fix.

Regards

Marcel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface
  2017-11-15 13:54 ` Marcel Holtmann
@ 2017-11-15 14:01   ` Bastien Nocera
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien Nocera @ 2017-11-15 14:01 UTC (permalink / raw)
  To: Marcel Holtmann, abhijeet.kumar
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-kernel

On Wed, 2017-11-15 at 14:54 +0100, Marcel Holtmann wrote:
> Hi Abhijeet,
> 
> > 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 <abhijeet.kumar@intel.com>
> > ---
> > 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);
> > +
> 
> the indentation is wrong here and the comment coding style if off.
> Please fix.

And there's a typo in the commit message ("its interface").

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface
  2017-11-15 12:11 [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface abhijeet.kumar
  2017-11-15 13:54 ` Marcel Holtmann
@ 2017-11-15 14:23 ` Johan Hovold
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2017-11-15 14:23 UTC (permalink / raw)
  To: abhijeet.kumar
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, linux-bluetooth,
	linux-kernel

On Wed, Nov 15, 2017 at 05:41:28PM +0530, abhijeet.kumar@intel.com 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.
> 
> Signed-off-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-15 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15 12:11 [PATCH] Bluettoth: btusb: Prevent USB devices to autosuspend while setting interface abhijeet.kumar
2017-11-15 13:54 ` Marcel Holtmann
2017-11-15 14:01   ` Bastien Nocera
2017-11-15 14:23 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).