All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-19 21:56 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-06-19 21:56 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-usb, tglx, Sebastian Andrzej Siewior, Marcel Holtmann,
	Johan Hedberg

The USB completion callback does not disable interrupts while acquiring
the ->lock. We want to remove the local_irq_disable() invocation from
__usb_hcd_giveback_urb() and therefore it is required for the callback
handler to disable the interrupts while acquiring the lock.
The callback may be invoked either in IRQ or BH context depending on the
USB host controller.
Use the _irqsave variant of the locking primitives.

Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/bluetooth/btusb.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index f73a27ea28cc..f262163fecd5 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -509,9 +509,10 @@ static inline void btusb_free_frags(struct btusb_data =
*data)
 static int btusb_recv_intr(struct btusb_data *data, void *buffer, int coun=
t)
 {
 	struct sk_buff *skb;
+	unsigned long flags;
 	int err =3D 0;
=20
-	spin_lock(&data->rxlock);
+	spin_lock_irqsave(&data->rxlock, flags);
 	skb =3D data->evt_skb;
=20
 	while (count) {
@@ -556,7 +557,7 @@ static int btusb_recv_intr(struct btusb_data *data, voi=
d *buffer, int count)
 	}
=20
 	data->evt_skb =3D skb;
-	spin_unlock(&data->rxlock);
+	spin_unlock_irqrestore(&data->rxlock, flags);
=20
 	return err;
 }
@@ -564,9 +565,10 @@ static int btusb_recv_intr(struct btusb_data *data, vo=
id *buffer, int count)
 static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int coun=
t)
 {
 	struct sk_buff *skb;
+	unsigned long flags;
 	int err =3D 0;
=20
-	spin_lock(&data->rxlock);
+	spin_lock_irqsave(&data->rxlock, flags);
 	skb =3D data->acl_skb;
=20
 	while (count) {
@@ -613,7 +615,7 @@ static int btusb_recv_bulk(struct btusb_data *data, voi=
d *buffer, int count)
 	}
=20
 	data->acl_skb =3D skb;
-	spin_unlock(&data->rxlock);
+	spin_unlock_irqrestore(&data->rxlock, flags);
=20
 	return err;
 }
@@ -621,9 +623,10 @@ static int btusb_recv_bulk(struct btusb_data *data, vo=
id *buffer, int count)
 static int btusb_recv_isoc(struct btusb_data *data, void *buffer, int coun=
t)
 {
 	struct sk_buff *skb;
+	unsigned long flags;
 	int err =3D 0;
=20
-	spin_lock(&data->rxlock);
+	spin_lock_irqsave(&data->rxlock, flags);
 	skb =3D data->sco_skb;
=20
 	while (count) {
@@ -668,7 +671,7 @@ static int btusb_recv_isoc(struct btusb_data *data, voi=
d *buffer, int count)
 	}
=20
 	data->sco_skb =3D skb;
-	spin_unlock(&data->rxlock);
+	spin_unlock_irqrestore(&data->rxlock, flags);
=20
 	return err;
 }
@@ -1066,6 +1069,7 @@ static void btusb_tx_complete(struct urb *urb)
 	struct sk_buff *skb =3D urb->context;
 	struct hci_dev *hdev =3D (struct hci_dev *)skb->dev;
 	struct btusb_data *data =3D hci_get_drvdata(hdev);
+	unsigned long flags;
=20
 	BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
 	       urb->actual_length);
@@ -1079,9 +1083,9 @@ static void btusb_tx_complete(struct urb *urb)
 		hdev->stat.err_tx++;
=20
 done:
-	spin_lock(&data->txlock);
+	spin_lock_irqsave(&data->txlock, flags);
 	data->tx_in_flight--;
-	spin_unlock(&data->txlock);
+	spin_unlock_irqrestore(&data->txlock, flags);
=20
 	kfree(urb->setup_packet);
=20
--=20
2.17.1

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

* Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-19 21:56 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-06-19 21:56 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-usb, tglx, Sebastian Andrzej Siewior, Marcel Holtmann,
	Johan Hedberg

The USB completion callback does not disable interrupts while acquiring
the ->lock. We want to remove the local_irq_disable() invocation from
__usb_hcd_giveback_urb() and therefore it is required for the callback
handler to disable the interrupts while acquiring the lock.
The callback may be invoked either in IRQ or BH context depending on the
USB host controller.
Use the _irqsave variant of the locking primitives.

Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/bluetooth/btusb.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index f73a27ea28cc..f262163fecd5 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -509,9 +509,10 @@ static inline void btusb_free_frags(struct btusb_data *data)
 static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
 {
 	struct sk_buff *skb;
+	unsigned long flags;
 	int err = 0;
 
-	spin_lock(&data->rxlock);
+	spin_lock_irqsave(&data->rxlock, flags);
 	skb = data->evt_skb;
 
 	while (count) {
@@ -556,7 +557,7 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
 	}
 
 	data->evt_skb = skb;
-	spin_unlock(&data->rxlock);
+	spin_unlock_irqrestore(&data->rxlock, flags);
 
 	return err;
 }
@@ -564,9 +565,10 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
 static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)
 {
 	struct sk_buff *skb;
+	unsigned long flags;
 	int err = 0;
 
-	spin_lock(&data->rxlock);
+	spin_lock_irqsave(&data->rxlock, flags);
 	skb = data->acl_skb;
 
 	while (count) {
@@ -613,7 +615,7 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)
 	}
 
 	data->acl_skb = skb;
-	spin_unlock(&data->rxlock);
+	spin_unlock_irqrestore(&data->rxlock, flags);
 
 	return err;
 }
@@ -621,9 +623,10 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)
 static int btusb_recv_isoc(struct btusb_data *data, void *buffer, int count)
 {
 	struct sk_buff *skb;
+	unsigned long flags;
 	int err = 0;
 
-	spin_lock(&data->rxlock);
+	spin_lock_irqsave(&data->rxlock, flags);
 	skb = data->sco_skb;
 
 	while (count) {
@@ -668,7 +671,7 @@ static int btusb_recv_isoc(struct btusb_data *data, void *buffer, int count)
 	}
 
 	data->sco_skb = skb;
-	spin_unlock(&data->rxlock);
+	spin_unlock_irqrestore(&data->rxlock, flags);
 
 	return err;
 }
@@ -1066,6 +1069,7 @@ static void btusb_tx_complete(struct urb *urb)
 	struct sk_buff *skb = urb->context;
 	struct hci_dev *hdev = (struct hci_dev *)skb->dev;
 	struct btusb_data *data = hci_get_drvdata(hdev);
+	unsigned long flags;
 
 	BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status,
 	       urb->actual_length);
@@ -1079,9 +1083,9 @@ static void btusb_tx_complete(struct urb *urb)
 		hdev->stat.err_tx++;
 
 done:
-	spin_lock(&data->txlock);
+	spin_lock_irqsave(&data->txlock, flags);
 	data->tx_in_flight--;
-	spin_unlock(&data->txlock);
+	spin_unlock_irqrestore(&data->txlock, flags);
 
 	kfree(urb->setup_packet);
 

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

* Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-21 12:43   ` Marcel Holtmann
  0 siblings, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2018-06-21 12:43 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Greg Kroah-Hartman
  Cc: open list:BLUETOOTH DRIVERS, linux-usb, Thomas Gleixner, Johan Hedberg

Hi Sebastian,

> The USB completion callback does not disable interrupts while acquiring
> the ->lock. We want to remove the local_irq_disable() invocation from
> __usb_hcd_giveback_urb() and therefore it is required for the callback
> handler to disable the interrupts while acquiring the lock.
> The callback may be invoked either in IRQ or BH context depending on the
> USB host controller.
> Use the _irqsave variant of the locking primitives.
> 
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Johan Hedberg <johan.hedberg@gmail.com>
> Cc: linux-bluetooth@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)

can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?

Regards

Marcel


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

* Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-21 12:43   ` Marcel Holtmann
  0 siblings, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2018-06-21 12:43 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, Greg Kroah-Hartman
  Cc: open list:BLUETOOTH DRIVERS, linux-usb, Thomas Gleixner, Johan Hedberg

Hi Sebastian,

> The USB completion callback does not disable interrupts while acquiring
> the ->lock. We want to remove the local_irq_disable() invocation from
> __usb_hcd_giveback_urb() and therefore it is required for the callback
> handler to disable the interrupts while acquiring the lock.
> The callback may be invoked either in IRQ or BH context depending on the
> USB host controller.
> Use the _irqsave variant of the locking primitives.
> 
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Johan Hedberg <johan.hedberg@gmail.com>
> Cc: linux-bluetooth@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)

can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?

Regards

Marcel
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-21 12:52     ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-06-21 12:52 UTC (permalink / raw)
  To: Marcel Holtmann, Alan Stern
  Cc: Greg Kroah-Hartman, open list:BLUETOOTH DRIVERS, linux-usb,
	Thomas Gleixner, Johan Hedberg

On 2018-06-21 14:43:41 [+0200], Marcel Holtmann wrote:
> Hi Sebastian,
Hi Marcel,

> > The USB completion callback does not disable interrupts while acquiring
> > the ->lock. We want to remove the local_irq_disable() invocation from
> > __usb_hcd_giveback_urb() and therefore it is required for the callback
> > handler to disable the interrupts while acquiring the lock.
> > The callback may be invoked either in IRQ or BH context depending on the
> > USB host controller.
> > Use the _irqsave variant of the locking primitives.
> > 
> > Cc: Marcel Holtmann <marcel@holtmann.org>
> > Cc: Johan Hedberg <johan.hedberg@gmail.com>
> > Cc: linux-bluetooth@vger.kernel.org
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > ---
> > drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> > 1 file changed, 12 insertions(+), 8 deletions(-)
> 
> can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?
+Alan.

EHCI completes in BH since v3.12-rc1. In order to get rid of that
local_irq_save() in USB core code I need to make sure that the USB
device driver(s) use irqsave primitives. See
  https://lkml.kernel.org/r/Pine.LNX.4.44L0.1806011629140.1404-100000@iolanthe.rowland.org

> Regards
> 
> Marcel

Sebastian

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

* Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-21 12:52     ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-06-21 12:52 UTC (permalink / raw)
  To: Marcel Holtmann, Alan Stern
  Cc: Greg Kroah-Hartman, open list:BLUETOOTH DRIVERS, linux-usb,
	Thomas Gleixner, Johan Hedberg

On 2018-06-21 14:43:41 [+0200], Marcel Holtmann wrote:
> Hi Sebastian,
Hi Marcel,

> > The USB completion callback does not disable interrupts while acquiring
> > the ->lock. We want to remove the local_irq_disable() invocation from
> > __usb_hcd_giveback_urb() and therefore it is required for the callback
> > handler to disable the interrupts while acquiring the lock.
> > The callback may be invoked either in IRQ or BH context depending on the
> > USB host controller.
> > Use the _irqsave variant of the locking primitives.
> > 
> > Cc: Marcel Holtmann <marcel@holtmann.org>
> > Cc: Johan Hedberg <johan.hedberg@gmail.com>
> > Cc: linux-bluetooth@vger.kernel.org
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > ---
> > drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> > 1 file changed, 12 insertions(+), 8 deletions(-)
> 
> can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?
+Alan.

EHCI completes in BH since v3.12-rc1. In order to get rid of that
local_irq_save() in USB core code I need to make sure that the USB
device driver(s) use irqsave primitives. See
  https://lkml.kernel.org/r/Pine.LNX.4.44L0.1806011629140.1404-100000@iolanthe.rowland.org

> Regards
> 
> Marcel

Sebastian
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-21 15:34       ` Alan Stern
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Stern @ 2018-06-21 15:34 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Marcel Holtmann, Greg Kroah-Hartman, open list:BLUETOOTH DRIVERS,
	linux-usb, Thomas Gleixner, Johan Hedberg

On Thu, 21 Jun 2018, Sebastian Andrzej Siewior wrote:

> On 2018-06-21 14:43:41 [+0200], Marcel Holtmann wrote:
> > Hi Sebastian,
> Hi Marcel,
> 
> > > The USB completion callback does not disable interrupts while acquiring
> > > the ->lock. We want to remove the local_irq_disable() invocation from
> > > __usb_hcd_giveback_urb() and therefore it is required for the callback
> > > handler to disable the interrupts while acquiring the lock.
> > > The callback may be invoked either in IRQ or BH context depending on the
> > > USB host controller.
> > > Use the _irqsave variant of the locking primitives.
> > > 
> > > Cc: Marcel Holtmann <marcel@holtmann.org>
> > > Cc: Johan Hedberg <johan.hedberg@gmail.com>
> > > Cc: linux-bluetooth@vger.kernel.org
> > > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > > ---
> > > drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> > > 1 file changed, 12 insertions(+), 8 deletions(-)
> > 
> > can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?
> +Alan.
> 
> EHCI completes in BH since v3.12-rc1. In order to get rid of that
> local_irq_save() in USB core code I need to make sure that the USB
> device driver(s) use irqsave primitives. See
>   https://lkml.kernel.org/r/Pine.LNX.4.44L0.1806011629140.1404-100000@iolanthe.rowland.org

Hi, Marcel!

Yes, Sebastian is right.  We are aiming to make it possible for the USB 
core to invoke URB completion handlers with interrupts enabled, in 
order to reduce latency (since USB interrupt processing can take a 
fairly long time).  And of course, this means completion handlers have 
to work correctly regardless of whether interrupts are enabled or 
disabled.

Currently ehci-hcd supports this possibility.  Other host controller 
drivers may follow along; I'd like to see xhci-hcd do this too.

Alan Stern

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

* Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-06-21 15:34       ` Alan Stern
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Stern @ 2018-06-21 15:34 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: Marcel Holtmann, Greg Kroah-Hartman, open list:BLUETOOTH DRIVERS,
	linux-usb, Thomas Gleixner, Johan Hedberg

On Thu, 21 Jun 2018, Sebastian Andrzej Siewior wrote:

> On 2018-06-21 14:43:41 [+0200], Marcel Holtmann wrote:
> > Hi Sebastian,
> Hi Marcel,
> 
> > > The USB completion callback does not disable interrupts while acquiring
> > > the ->lock. We want to remove the local_irq_disable() invocation from
> > > __usb_hcd_giveback_urb() and therefore it is required for the callback
> > > handler to disable the interrupts while acquiring the lock.
> > > The callback may be invoked either in IRQ or BH context depending on the
> > > USB host controller.
> > > Use the _irqsave variant of the locking primitives.
> > > 
> > > Cc: Marcel Holtmann <marcel@holtmann.org>
> > > Cc: Johan Hedberg <johan.hedberg@gmail.com>
> > > Cc: linux-bluetooth@vger.kernel.org
> > > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > > ---
> > > drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> > > 1 file changed, 12 insertions(+), 8 deletions(-)
> > 
> > can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?
> +Alan.
> 
> EHCI completes in BH since v3.12-rc1. In order to get rid of that
> local_irq_save() in USB core code I need to make sure that the USB
> device driver(s) use irqsave primitives. See
>   https://lkml.kernel.org/r/Pine.LNX.4.44L0.1806011629140.1404-100000@iolanthe.rowland.org

Hi, Marcel!

Yes, Sebastian is right.  We are aiming to make it possible for the USB 
core to invoke URB completion handlers with interrupts enabled, in 
order to reduce latency (since USB interrupt processing can take a 
fairly long time).  And of course, this means completion handlers have 
to work correctly regardless of whether interrupts are enabled or 
disabled.

Currently ehci-hcd supports this possibility.  Other host controller 
drivers may follow along; I'd like to see xhci-hcd do this too.

Alan Stern
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-07-01 15:19         ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-07-01 15:19 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Alan Stern, Greg Kroah-Hartman, open list:BLUETOOTH DRIVERS,
	linux-usb, Thomas Gleixner, Johan Hedberg

On 2018-06-21 11:34:15 [-0400], Alan Stern wrote:
> On Thu, 21 Jun 2018, Sebastian Andrzej Siewior wrote:
> 
> > On 2018-06-21 14:43:41 [+0200], Marcel Holtmann wrote:
> > > can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?
> > +Alan.
> > 
> > EHCI completes in BH since v3.12-rc1. In order to get rid of that
> > local_irq_save() in USB core code I need to make sure that the USB
> > device driver(s) use irqsave primitives. See
> >   https://lkml.kernel.org/r/Pine.LNX.4.44L0.1806011629140.1404-100000@iolanthe.rowland.org
> 
> Hi, Marcel!
Hi Marcel,

> Yes, Sebastian is right.  We are aiming to make it possible for the USB 
> core to invoke URB completion handlers with interrupts enabled, in 
> order to reduce latency (since USB interrupt processing can take a 
> fairly long time).  And of course, this means completion handlers have 
> to work correctly regardless of whether interrupts are enabled or 
> disabled.

I don't see this patch in linux-next. Do you still need some kind of
confirmation or has this been resolved?

> Currently ehci-hcd supports this possibility.  Other host controller 
> drivers may follow along; I'd like to see xhci-hcd do this too.
> 
> Alan Stern

Sebastian

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

* Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-07-01 15:19         ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-07-01 15:19 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Alan Stern, Greg Kroah-Hartman, open list:BLUETOOTH DRIVERS,
	linux-usb, Thomas Gleixner, Johan Hedberg

On 2018-06-21 11:34:15 [-0400], Alan Stern wrote:
> On Thu, 21 Jun 2018, Sebastian Andrzej Siewior wrote:
> 
> > On 2018-06-21 14:43:41 [+0200], Marcel Holtmann wrote:
> > > can I get an ACK from someone ensuring that this is the direction we are going with the USB host controllers?
> > +Alan.
> > 
> > EHCI completes in BH since v3.12-rc1. In order to get rid of that
> > local_irq_save() in USB core code I need to make sure that the USB
> > device driver(s) use irqsave primitives. See
> >   https://lkml.kernel.org/r/Pine.LNX.4.44L0.1806011629140.1404-100000@iolanthe.rowland.org
> 
> Hi, Marcel!
Hi Marcel,

> Yes, Sebastian is right.  We are aiming to make it possible for the USB 
> core to invoke URB completion handlers with interrupts enabled, in 
> order to reduce latency (since USB interrupt processing can take a 
> fairly long time).  And of course, this means completion handlers have 
> to work correctly regardless of whether interrupts are enabled or 
> disabled.

I don't see this patch in linux-next. Do you still need some kind of
confirmation or has this been resolved?

> Currently ehci-hcd supports this possibility.  Other host controller 
> drivers may follow along; I'd like to see xhci-hcd do this too.
> 
> Alan Stern

Sebastian
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-07-06 10:46   ` Marcel Holtmann
  0 siblings, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2018-07-06 10:46 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-bluetooth, linux-usb, Thomas Gleixner, Johan Hedberg

Hi Sebastian,

> The USB completion callback does not disable interrupts while acquiring
> the ->lock. We want to remove the local_irq_disable() invocation from
> __usb_hcd_giveback_urb() and therefore it is required for the callback
> handler to disable the interrupts while acquiring the lock.
> The callback may be invoked either in IRQ or BH context depending on the
> USB host controller.
> Use the _irqsave variant of the locking primitives.
> 
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Johan Hedberg <johan.hedberg@gmail.com>
> Cc: linux-bluetooth@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Bluetooth: btusb: use irqsave() in URB's complete callback
@ 2018-07-06 10:46   ` Marcel Holtmann
  0 siblings, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2018-07-06 10:46 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-bluetooth, linux-usb, Thomas Gleixner, Johan Hedberg

Hi Sebastian,

> The USB completion callback does not disable interrupts while acquiring
> the ->lock. We want to remove the local_irq_disable() invocation from
> __usb_hcd_giveback_urb() and therefore it is required for the callback
> handler to disable the interrupts while acquiring the lock.
> The callback may be invoked either in IRQ or BH context depending on the
> USB host controller.
> Use the _irqsave variant of the locking primitives.
> 
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Johan Hedberg <johan.hedberg@gmail.com>
> Cc: linux-bluetooth@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> drivers/bluetooth/btusb.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-07-06 10:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19 21:56 [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback Sebastian Andrzej Siewior
2018-06-19 21:56 ` Sebastian Andrzej Siewior
2018-06-21 12:43 ` [PATCH] " Marcel Holtmann
2018-06-21 12:43   ` Marcel Holtmann
2018-06-21 12:52   ` [PATCH] " Sebastian Andrzej Siewior
2018-06-21 12:52     ` Sebastian Andrzej Siewior
2018-06-21 15:34     ` [PATCH] " Alan Stern
2018-06-21 15:34       ` Alan Stern
2018-07-01 15:19       ` [PATCH] " Sebastian Andrzej Siewior
2018-07-01 15:19         ` Sebastian Andrzej Siewior
2018-07-06 10:46 ` [PATCH] " Marcel Holtmann
2018-07-06 10:46   ` Marcel Holtmann

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.