Re: [PATCH] usb/hcd: Fix a NULL vs IS_ERR() bug in usb_hcd_setup_local_mem()

2019-06-11 Thread Sebastian Andrzej Siewior
On 2019-06-07 16:57:09 [+0300], Dan Carpenter wrote: > The devm_memremap() function doesn't return NULL, it returns error > pointers. > > Fixes: b0310c2f09bb ("USB: use genalloc for USB HCs with local memory") > Signed-off-by: Dan Carpenter Acked-by: Sebastian Andrzej Siewior Sebastian

Re: [PATCH v2] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data

2018-12-10 Thread Sebastian Andrzej Siewior
d update hso_probe to bail on error. > This issue has been assigned CVE-2018-19985. > > Reported-by: Hui Peng > Reported-by: Mathias Payer > Signed-off-by: Hui Peng > Signed-off-by: Mathias Payer > Signed-off-by: Greg Kroah-Hartman Reviewed-by: Sebastian Andrzej Siewior Sebastian

[PATCH] Revert "usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()"

2018-09-11 Thread Sebastian Andrzej Siewior
This reverts commit 6e22e3af7bb3a7b9dc53cb4687659f6e63fca427. The bug the patch describes to, has been already fixed in commit 2df6948428542 ("USB: cdc-wdm: don't enable interrupts in USB-giveback") so need to this, revert it. Signed-off-by: Sebastian Andrzej Siewior --- driver

Re: [PATCH v2] usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()

2018-09-11 Thread Sebastian Andrzej Siewior
On 2018-09-01 16:12:10 [+0800], Jia-Ju Bai wrote: > wdm_in_callback() is a completion handler function for the USB driver. > So it should not sleep. But it calls service_outstanding_interrupt(), > which calls usb_submit_urb() with GFP_KERNEL. At which point does wdm_in_callback() invoke service_

Re: [PATCH 0/3] media: use irqsave() in USB's complete callback + remove local_irq_save

2018-09-10 Thread Sebastian Andrzej Siewior
On 2018-09-10 06:25:57 [-0300], Mauro Carvalho Chehab wrote: > Em Mon, 10 Sep 2018 11:19:57 +0200 > Sebastian Andrzej Siewior escreveu: > > > I've been looking at my queue and compared to v4.19-rc3. As it turns > > out, everything was merged except for > >

[PATCH 3/3] usb: core: remove local_irq_save() around ->complete() handler

2018-09-10 Thread Sebastian Andrzej Siewior
andler. Remove local_irq_save() statement before invoking the ->complete handler. Cc: Alan Stern Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/core/hcd.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 1c21

[PATCH 2/3] media: tm6000: use irqsave() in USB's complete callback

2018-09-10 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Mauro Carvalho Chehab Signed-off-by: Sebastian Andrzej Siewior --- drivers/media/usb/tm6000/tm6000-video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 0/3] media: use irqsave() in USB's complete callback + remove local_irq_save

2018-09-10 Thread Sebastian Andrzej Siewior
I've been looking at my queue and compared to v4.19-rc3. As it turns out, everything was merged except for media: em28xx-audio: use irqsave() in USB's complete media: tm6000: use irqsave() in USB's complete callback I haven't seen any reply to those two patches (like asking for ch

[PATCH 1/3] media: em28xx-audio: use irqsave() in USB's complete callback

2018-09-10 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Mauro Carvalho Chehab Signed-off-by: Sebastian Andrzej Siewior --- drivers/media/usb/em28xx/em28xx-audio.c | 5 +++-- drivers/media/usb/em28xx/em28xx-core.c | 5 +++-- 2

[PATCH 07/12 v2] usb: usbtest: use irqsave() in USB's complete callback

2018-07-01 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Acked-by: Alan Stern Signed-off-by: Sebastian Andrzej Siewior --- v1…v2: don't enable interrupts while releasing the lock around unlink()

Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback

2018-07-01 Thread Sebastian Andrzej Siewior
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

Re: [PATCH 07/12] usb: usbtest: use irqsave() in USB's complete callback

2018-06-26 Thread Sebastian Andrzej Siewior
On 2018-06-25 11:15:06 [-0400], Alan Stern wrote: > > @@ -1152,9 +1153,9 @@ static void ctrl_complete(struct urb *urb) > > > > if (u == urb || !u->dev) > > continue; > > - spin_unlock(&ctx->lock); > > +

[PATCH 07/12] usb: usbtest: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/misc/usbtest.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git

[PATCH 06/12] usb: usb-skeleton: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
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: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/usb-skeleton.c | 10 ++ 1 file changed

[PATCH 09/12] usb: adutux: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/misc/adutux.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a

[PATCH 08/12] usb: wusbcore: remove excessive irqsave

2018-06-24 Thread Sebastian Andrzej Siewior
point. Remove the second irqsave: spin_lock_irqsave(&lock1, flags); spin_lock(&lock2); and eliminate the flags2 variable. Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/wusbcore/wa-xfer.c | 8 1 file changed, 4

[PATCH 12/12] usb: legousbtower: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Juergen Stuber Cc: Greg Kroah-Hartman Cc: legousb-de...@lists.sourceforge.net Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/misc/legousbtower.c | 5 +++-- 1

[PATCH 11/12] usb: ldusb: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/misc/ldusb.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 02/12] usb: cdc-wdm: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Cc: Oliver Neukum Cc: "Bjørn Mork" Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/class/cdc-wdm.c | 16 ++-- 1 file c

[PATCH 10/12] usb: iowarrior: remove intr_idx_lock

2018-06-24 Thread Sebastian Andrzej Siewior
ly place in driver that writes to it. Remove the intr_idx_lock lock because it is superfluous. Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/misc/iowarrior.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/

[PATCH 05/12] usb: usblp: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Pete Zaitcev Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/class/usblp.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions

[PATCH 01/12] usb: cdc-acm: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Oliver Neukum Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/class/cdc-acm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH 04/12] usb: usbfs: use irqsave() in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Cc: Alan Stern Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/core/devio.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 00/12] usb: Use irqsave in USB's complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
This is about using _irqsave() primitives in the completion callback in order to get rid of local_irq_save() in __usb_hcd_giveback_urb(). This is the last series. Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.or

[PATCH 03/12] usb: core: use irqsave() in sg_complete() complete callback

2018-06-24 Thread Sebastian Andrzej Siewior
either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Greg Kroah-Hartman Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/core/message.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a

[PATCH 10/12] usb: serial: symbolserial: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/symbolserial.c | 5

[PATCH 06/12] usb: serial: mos7840: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/mos7840.c | 5 +++-- 1

[PATCH 08/12] usb: serial: sierra: disable irq's for portdata lock

2018-06-23 Thread Sebastian Andrzej Siewior
From: John Ogness The portdata spinlock can be taken in interrupt context (via sierra_outdat_callback()). Disable interrupts when taking the portdata spinlock. Cc: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial

[PATCH 07/12] usb: serial: quatech2: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/quatech2.c | 5

[PATCH 09/12] usb: serial: sierra: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/sierra.c | 9

[PATCH 12/12] usb: serial: usb_wwan: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/usb_wwan.c | 5

[PATCH 11/12] usb: serial: ti_usb_3410_5052: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/ti_usb_3410_5052.c | 9

[PATCH 01/12] usb: serial: cyberjack: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/cyberjack.c | 17

[PATCH 03/12] usb: serial: io_edgeport: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/io_edgeport.c | 17

[PATCH 00/12] usb: serial: Use irqsave in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
This is about using _irqsave() primitives in the completion callback in order to get rid of local_irq_save() in __usb_hcd_giveback_urb(). Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH 02/12] usb: serial: digi_acceleport: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/digi_acceleport.c | 23

[PATCH 05/12] usb: serial: mos7720: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/mos7720.c | 5 +++-- 1

[PATCH 04/12] usb: serial: io_ti: use irqsave() in USB's complete callback

2018-06-23 Thread Sebastian Andrzej Siewior
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: Johan Hovold Cc: Greg Kroah-Hartman Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/serial/io_ti.c | 5 +++-- 1

Re: [PATCH 6/9] ALSA: usb: caiaq: use usb_fill_int_urb()

2018-06-22 Thread Sebastian Andrzej Siewior
On 2018-06-22 12:01:13 [+0200], Daniel Mack wrote: > Hmm, there is no such thing as usb_fill_iso_urb() in my tree, are you going > to add that? Yes. > The only part that needs attention is the interval parameter, which is > passed to usb_fill_int_urb() as 1 now, and hence urb->interval will also

Re: [PATCH 6/9] ALSA: usb: caiaq: use usb_fill_int_urb()

2018-06-21 Thread Sebastian Andrzej Siewior
On 2018-06-21 22:19:32 [+0200], Daniel Mack wrote: > On Tuesday, June 19, 2018 11:55 PM, Sebastian Andrzej Siewior wrote: > > Using usb_fill_int_urb() helps to find code which initializes an > > URB. A grep for members of the struct (like ->complete) reveal lots > &

Re: [PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback

2018-06-21 Thread Sebastian Andrzej Siewior
t; Cc: Marcel Holtmann > > Cc: Johan Hedberg > > Cc: linux-blueto...@vger.kernel.org > > Signed-off-by: Sebastian Andrzej Siewior > > --- > > drivers/bluetooth/btusb.c | 20 > > 1 file changed, 12 insertions(+), 8 deletions(-) > &g

Re: [PATCH 8/9] ALSA: usx2y: usbusx2yaudio: use usb_fill_int_urb()

2018-06-20 Thread Sebastian Andrzej Siewior
avoid two multiplication (one with overflow check and one without for the length argument). This requires to change the type `maxpacksize' to int so there is only one type involved in the multiplication. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siewior --- s

Re: [PATCH 8/9] ALSA: usx2y: usbusx2yaudio: use usb_fill_int_urb()

2018-06-20 Thread Sebastian Andrzej Siewior
ith overflow check and one without for the length argument). This requires to change the type `maxpacksize' to int so there is only one type involved in the multiplication. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/usx2y/usbusx2yau

Re: [PATCH 8/9] ALSA: usx2y: usbusx2yaudio: use usb_fill_int_urb()

2018-06-20 Thread Sebastian Andrzej Siewior
On 2018-06-20 14:51:12 [+0200], Takashi Iwai wrote: > On Tue, 19 Jun 2018 23:55:20 +0200, > Sebastian Andrzej Siewior wrote: > > - (*purb)->transfer_buffer = > > - kmalloc_array(subs->maxpacksize, > > -

Re: [PATCH 4/9 v2] ALSA: usb-audio: use usb_fill_int_urb()

2018-06-20 Thread Sebastian Andrzej Siewior
On 2018-06-20 15:21:49 [+0200], Takashi Iwai wrote: > > usb_fill_int_urb() ensures that syncinterval is within the allowed range > > on HS/SS. The interval value seems to come from > > snd_usb_parse_datainterval() which is bInterval - 1 and only in the rage > > 1 … 4. So in order to keep the magic

[PATCH 4/9 v2] ALSA: usb-audio: use usb_fill_int_urb()

2018-06-20 Thread Sebastian Andrzej Siewior
s that syncinterval is within the allowed range on HS/SS. The interval value seems to come from snd_usb_parse_datainterval() which is bInterval - 1 and only in the rage 1 … 4. So in order to keep the magic working I pass datainterval + 1. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian A

[PATCH] HID: usbhid: use irqsave() in USB's complete callback

2018-06-19 Thread Sebastian Andrzej Siewior
be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-in...@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/hid/usbhid/hid-core.c | 7 --- 1 f

[PATCH] Bluetooth: btusb: use irqsave() in URB's complete callback

2018-06-19 Thread Sebastian Andrzej Siewior
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 Cc: Johan Hedberg Cc: linux-blueto...@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/bluetooth/btusb.c | 20

[PATCH 4/9] ALSA: usb-audio: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
off-by: Sebastian Andrzej Siewior --- sound/usb/endpoint.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index c90607ebe155..bbc02db5b417 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@

[PATCH 9/9] ALSA: usx2y: usx2yhwdeppcm: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
ime. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/usx2y/usx2yhwdeppcm.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 4fd9

[PATCH 7/9] ALSA: usb-midi: use irqsave() in USB's complete callback

2018-06-19 Thread Sebastian Andrzej Siewior
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: Clemens Ladisch Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/midi.c | 5

[PATCH 6/9] ALSA: usb: caiaq: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. Cc: Daniel Mack Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/caiaq/audio.c |

ALSA: use irqsave() in URB completion + usb_fill_int_urb

2018-06-19 Thread Sebastian Andrzej Siewior
This series is mostly about using _irqsave() primitives in the completion callback in order to get rid of local_irq_save() in __usb_hcd_giveback_urb(). While at it, I also tried to move drivers to use usb_fill_int_urb() otherwise it is hard find users of a certain API. Sebastian -- To unsubscri

[PATCH 3/9] ALSA: ua101: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Clemens Ladisch Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/misc/ua101.c |

[PATCH 8/9] ALSA: usx2y: usbusx2yaudio: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
ove so ->transfer_buffer has to be NULL here. The `dev' and `transfer_size' assignments have been moved from usX2Y_urbs_start() to usX2Y_urbs_allocate() because they don't change overtime. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siewior

[PATCH 2/9] ALSA: line6: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. Data pointer & size is filled out later so they are not considered. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian

[PATCH 5/9] ALSA: usb: caiaq: audio: use irqsave() in USB's complete callback

2018-06-19 Thread Sebastian Andrzej Siewior
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: Daniel Mack Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: John Ogness Signed-off-by: Sebastian Andrzej Siewior --- sound/usb/caiaq/audio.c | 5

[PATCH 1/9] ALSA: 6fire: use usb_fill_int_urb()

2018-06-19 Thread Sebastian Andrzej Siewior
Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. usb6fire_comm_init_urb() passes no transfer length. Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Sebastian Andrzej Siew

[PATCH v4] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-14 Thread Sebastian Andrzej Siewior
pipeline in case of error") Cc: Robert Foss Cc: Oliver Neukum Signed-off-by: Sebastian Andrzej Siewior --- v3…v4: also cancel ->service_outs_intr during suspend. v2…v3: set WDM_READ once error recovery is done so the user does not see WDM_READ before the _last_ submit

Re: [PATCH v2] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-14 Thread Sebastian Andrzej Siewior
On 2018-06-14 10:44:20 [+0200], Oliver Neukum wrote: > On Mi, 2018-06-13 at 22:28 +0200, Sebastian Andrzej Siewior wrote: > > On 2018-06-13 19:43:55 [+0200], Oliver Neukum wrote: > Hi Sebastian, Hi Oliver, > > > I am just looking at your patch and I am wondering why > >

Re: [PATCH v2] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-13 Thread Sebastian Andrzej Siewior
On 2018-06-13 19:43:55 [+0200], Oliver Neukum wrote: > On Mi, 2018-06-13 at 18:28 +0200, Sebastian Andrzej Siewior wrote: > > The function service_outstanding_interrupt() will unconditionally enable > > interrupts during unlock and invoke usb_submit_urb() with GFP_KERNEL. > >

[PATCH v2] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-13 Thread Sebastian Andrzej Siewior
pipeline in case of error") Cc: Robert Foss Cc: Oliver Neukum Signed-off-by: Sebastian Andrzej Siewior --- On 2018-06-13 10:30:18 [+0200], Oliver Neukum wrote: > It seems to me that the core of the problem is handling an error > in irq context potentially. How about shifting it to a

Re: [PATCH] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-12 Thread Sebastian Andrzej Siewior
On 2018-06-12 20:28:27 [+0200], Bjørn Mork wrote: > Yes, the atomic case should be rare. It will only happen on errors, and > IIUC that's only to work around issues caused by reporting errors back > to userspace without actually wanting to err out anyway. Yup. The missing part is if this was done

Re: [PATCH] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-12 Thread Sebastian Andrzej Siewior
On 2018-06-12 12:43:01 [-0400], Alan Stern wrote: > On Tue, 12 Jun 2018, Sebastian Andrzej Siewior wrote: > > > In the code path > > __usb_hcd_giveback_urb() > > -> wdm_in_callback() > >-> service_outstanding_interrupt() > > > > T

[PATCH] USB: cdc-wdm: don't enable interrupts in USB-giveback

2018-06-12 Thread Sebastian Andrzej Siewior
Clear read pipeline in case of error") Cc: Robert Foss Cc: Oliver Neukum Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/class/cdc-wdm.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class

Re: Threaded interrupts for USB HCD instead of tasklets

2018-06-01 Thread Sebastian Andrzej Siewior
On 2018-05-22 15:14:17 [-0400], Alan Stern wrote: > Sorry, I don't understand that sentence at all. And I don't see how it > could be relevant to the point I was trying to make. > > Consider, for example, drivers/hid/usbhid/hid-core.c. In that file, > hid_io_error() is called by hid_irq_in(), w

Re: Threaded interrupts for USB HCD instead of tasklets

2018-05-23 Thread Sebastian Andrzej Siewior
On 2018-05-22 15:14:17 [-0400], Alan Stern wrote: > On Tue, 22 May 2018, Sebastian Andrzej Siewior wrote: > > > On 2018-05-07 11:37:29 [-0400], Alan Stern wrote: > > > > As far as I understand it there should be no deadlock. Without the > > > > local_irq_save(

Re: Threaded interrupts for USB HCD instead of tasklets

2018-05-22 Thread Sebastian Andrzej Siewior
On 2018-05-07 11:37:29 [-0400], Alan Stern wrote: > > As far as I understand it there should be no deadlock. Without the > > local_irq_save() things should not deadlock because the HCD invokes USB > > driver's (usb-storage for instance) ->complete callback always in the > > same way. If you mix the

Re: Threaded interrupts for USB HCD instead of tasklets

2018-05-07 Thread Sebastian Andrzej Siewior
On 2018-05-04 16:07:22 [-0400], Alan Stern wrote: > On Fri, 4 May 2018, Sebastian Andrzej Siewior wrote: > > > Hi Alan, > > > > I posted a RFC [0] to let the HCD complete the URB in threaded-IRQ > > context to avoid the softirq/tasklet. Mauro reported that this d

Threaded interrupts for USB HCD instead of tasklets

2018-05-04 Thread Sebastian Andrzej Siewior
Hi Alan, I posted a RFC [0] to let the HCD complete the URB in threaded-IRQ context to avoid the softirq/tasklet. Mauro reported that this does not help him and never came back after that. You did not oppose the approach as long as there is no performance issue which I did not see. Would you mind

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-04-16 Thread Sebastian Andrzej Siewior
On 2018-03-08 10:57:39 [+0100], To Mauro Carvalho Chehab wrote: > On 2018-02-27 14:39:34 [-0300], Mauro Carvalho Chehab wrote: > > Hi Sebastian, > Hi Mauro, > > > Sorry for taking some time to test it, has been busy those days... > :) > > > Anyway, I tested it today. Didn't work. It keep losing d

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-03-08 Thread Sebastian Andrzej Siewior
On 2018-02-27 14:39:34 [-0300], Mauro Carvalho Chehab wrote: > Hi Sebastian, Hi Mauro, > Sorry for taking some time to test it, has been busy those days... :) > Anyway, I tested it today. Didn't work. It keep losing data. Okay, this was unexpected. What I learned from the thread is that you use

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-22 Thread Sebastian Andrzej Siewior
On 2018-02-16 16:46:41 [-0500], Alan Stern wrote: > > The theaded interrupt runs SCHED_FIFO priority 50 by default. The only > > thing that can interrupt it are interrupts, a softirq (not ksoftirqd) > > and other tasks with a higher priority than 50. > > There should be no downside performance wise

Re: [RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-16 Thread Sebastian Andrzej Siewior
On 2018-02-16 13:29:01 [-0500], Alan Stern wrote: > We originally used tasklets because we didn't want to incur the delays > associated with running in a process context. It seems odd to be > reversing that decision now. The theaded interrupt runs SCHED_FIFO priority 50 by default. The only thi

[RFC PATCH] usb: hcd: complete URBs in threaded-IRQ context instead of tasklet

2018-02-16 Thread Sebastian Andrzej Siewior
The URBs from the root-hub never create an interrupt so I currently process them in a workqueue (I'm not sure if an URB-enqueue in the completion handler would break something). Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/core/hcd.c | 131 +++

[PATCH 24/25 v2] net/cdc_ncm: Replace tasklet with softirq hrtimer

2017-09-05 Thread Sebastian Andrzej Siewior
: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: net...@vger.kernel.org Acked-by: Greg Kroah-Hartman [bigeasy: using usb_get_intfdata() as suggested by Bjørn Mork] Signed-off-by: Sebastian Andrzej Siewior --- On 2017-08-31 15:57:04 [+0200], Bjørn Mork wrote: > I believe the struct usb

Re: [PATCH] usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer

2017-03-02 Thread Sebastian Andrzej Siewior
the > time the next transfer is scheduled. So skip this polling workaround for > Isoch transfer. > > Fixes: a655f481d83d6 ("usb: musb: musb_cppi41: handle pre-mature TX complete > interrupt") > Cc: #4.1+ > Reported-by: Alexandre Bailon > Signed-off-by: Bi

Re: [patch] usb: xhci-mem: use passed in GFP flags instead of GFP_KERNEL

2016-11-11 Thread Sebastian Andrzej Siewior
On 2016-11-10 22:33:17 [+0300], Dan Carpenter wrote: > We normally use the passed in gfp flags for allocations, it's just these > two which were missed. You seem to be right. xhci_mem_init() has only one caller with GFP_KERNEL as argument. You could unwind it. Acked-by: Sebastian Andr

Re: [PATCHv3 00/14] Equivalent of tcm_usb_gadget with configfs

2015-11-30 Thread Sebastian Andrzej Siewior
On 11/29/2015 07:16 AM, Nicholas A. Bellinger wrote: > Ping (2) on this series to Joel + Sebastian. ;) > > If there aren't any immediate objections on the fs/configfs/ side from > JLBEC, I'll assume this series can be added as target-pending/for-next > WIP code this week, yes..? Yes, please. If

Re: [PATCH 00/15] Equivalent of tcm_usb_gadget with configfs

2015-10-20 Thread Sebastian Andrzej Siewior
On 10/20/2015 02:32 PM, Andrzej Pietrasiewicz wrote: > Dear All, > > This series adds support to tcm usb gadget for composing it with configfs. oh great. With this you could have two tcm functions right? (that was one of the limitations of the legacy gadget due to the API we had). I will try to

Re: commit ef11982dd7a657512c362242508bb4021e0d67b6 breaks musb

2015-03-11 Thread Sebastian Andrzej Siewior
On 03/10/2015 10:22 PM, Felipe Balbi wrote: > On Thu, Mar 05, 2015 at 12:25:48PM +0530, Amit Virdi wrote: >> +cc Sebastian, Alan Stern >> >> Hello Felipe, >> >> On 2/28/2015 3:18 AM, Felipe Balbi wrote: >>> Hi Amit, >>> >>> commit ef11982dd7a657512c362242508bb4021e0d67b6 (Add support for >>> interr

Re: [PATCH] Fixing style warnings.

2015-03-03 Thread Sebastian Andrzej Siewior
On 03/03/2015 06:19 AM, cfredric wrote: > Signed-off-by: cfredric You could use your full name here. > --- > drivers/usb/core/buffer.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c > index 506b969..89f2e77 10064

Re: [PATCH] usb: phy: am335x-control: check return value of bus_find_device

2015-02-08 Thread Sebastian Andrzej Siewior
On 02/08/2015 04:29 PM, David Dueck wrote: > This fixes a potential null pointer dereference. > > Signed-off-by: David Dueck Acked-by: Sebastian Andrzej Siewior Fixes: d4332013919a ("driver core: dev_get_drvdata: Don't check for NULL dev") Greg, this is a regression

Re: [PATCH 2/2] usb: musb: try a race-free wakeup

2015-02-03 Thread Sebastian Andrzej Siewior
On 02/02/2015 11:44 PM, Bin Liu wrote: > Sebastian, Hi Bin, > I think I found the cause. Plugging a device behind a hub, this is > related to runtime PM, so the finish_resume_work() should also be > added in musb_runtime_resume(), also musb_host_resume_root_hub() > should not be moved as did in y

Re: [PATCH] usb: gadget: composite: Provide list of registered functions

2015-01-28 Thread Sebastian Andrzej Siewior
* Krzysztof Opasiak | 2015-01-28 13:38:33 [+0100]: >> the first thing a user of usb-gadget has to do, is create a >> directory, not a file. > >This: > >$ modprobe libcomposite >$ mount none -t configfs /sys/kernel/config/usb-gadget don't you mount it at config and cd to usb-gadget then? >$ mkdir

Re: [PATCH 2/2] usb: musb: try a race-free wakeup

2015-01-26 Thread Sebastian Andrzej Siewior
On 01/21/2015 06:06 PM, Bin Liu wrote: > Hi Sebastian, Hi Bin, > With this patch, hubs stop working on TI AM335x EVMs when autosuspend > is enabled. > > I booted the board, connected a hub to the USB1 host port, it got > enumerated properly, then connected a thumb drive to the hub, but the > dri

[PATCH] usb: musb: stuff leak of struct usb_hcd

2014-12-11 Thread Sebastian Andrzej Siewior
_host_free() basically a nop and the usb_hcd remains around for ever without anowner. This patch drops that NULL assignment for that reason. Fixes: 74c2e9360058 ("usb: musb: factor out hcd initalization") Cc: sta...@vger.kernel.org Cc: Daniel Mack Signed-off-by: Sebastian Andrzej Siewior -

Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()

2014-12-10 Thread Sebastian Andrzej Siewior
* 'Greg Kroah-Hartman' | 2014-12-09 11:54:15 [-0500]: >> You can unbind the HCD driver from the PCI-device via sysfs and this is >> not something not only a developer does. This "unbind" calls the remove >> function of the driver and the only difference between unbind and rmmod >> is that the modu

Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()

2014-12-09 Thread Sebastian Andrzej Siewior
On 12/09/2014 04:24 PM, 'Greg Kroah-Hartman' wrote: > On Mon, Dec 08, 2014 at 09:44:05AM +, David Laight wrote: >> From: Greg Kroah-Hartman >>> On Fri, Dec 05, 2014 at 09:03:57PM +0100, Sebastian Andrzej Siewior wrote: >>>> Consider the following scen

Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()

2014-12-08 Thread Sebastian Andrzej Siewior
* Sebastian Andrzej Siewior | 2014-12-06 00:23:27 [+0100]: >I had one patch doing that. Let me grab it out on Monday. okay, this is it. Laurent, any idea why this could not fly? I haven't seen anything odd so far. diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media

Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()

2014-12-05 Thread Sebastian Andrzej Siewior
* Alan Stern | 2014-12-05 16:21:02 [-0500]: >On Fri, 5 Dec 2014, Sebastian Andrzej Siewior wrote: >> So instead, I hold the device struct in the HCD and the HCD struct on >> every USB-buf-alloc. That means after a disconnect we still have a >> refcount on usb_hcd and device a

Re: [PATCH] usb: hcd: get/put device and hcd for hcd_buffers()

2014-12-05 Thread Sebastian Andrzej Siewior
* Greg Kroah-Hartman | 2014-12-05 13:19:32 [-0800]: >On Fri, Dec 05, 2014 at 09:03:57PM +0100, Sebastian Andrzej Siewior wrote: >> Consider the following scenario: >> - plugin a webcam >> - play the stream via gst-launch-0.10 v4l2src device=/dev/video0… >> - remove the

[PATCH] usb: hcd: get/put device and hcd for hcd_buffers()

2014-12-05 Thread Sebastian Andrzej Siewior
erspace using it. So instead, I hold the device struct in the HCD and the HCD struct on every USB-buf-alloc. That means after a disconnect we still have a refcount on usb_hcd and device and it will be cleaned "later" once the last USB-buffer is released. Signed-off-by: Sebastian Andr

[PATCH v4] usb: core: buffer: smallest buffer should start at ARCH_DMA_MINALIGN

2014-12-05 Thread Sebastian Andrzej Siewior
and extend them if there is need to. There is a BUILD_BUG_ON() now in case someone has a minalign of more than 128 bytes. Cc: sta...@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- v3…v4: rewrite as suggested per Alan Stern so it is less confusing. v2…v3: - rewrite and use usb_ini

[RFC PATCH] usb: musb: cppi41: replace TX-complete-timer by TX-FIFO-EMPTY interrupt

2014-12-04 Thread Sebastian Andrzej Siewior
s unchanged. - g_zero test 12 gives sometimes "did not went well" Testing is very welcome. Signed-off-by: Sebastian Andrzej Siewior --- drivers/usb/musb/musb_cppi41.c | 147 + drivers/usb/musb/musb_dsps.c | 90 - drivers/u

[PATCH v3] usb: core: buffer: smallest buffer should start at ARCH_DMA_MINALIGN

2014-12-03 Thread Sebastian Andrzej Siewior
There is a BUILD_BUG_ON() now in case someone has a minalign of more than 128 bytes. Cc: sta...@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- v2…v3: - rewrite and use usb_init_pool_max() instead. Albeit the value __alignof__(x) is known at compile time it can't

[PATCH 2/2] dma: cppi41: add a delay while setting the TD bit

2014-12-03 Thread Sebastian Andrzej Siewior
ueue after the teaddown descriptor. With this change, I observe that the transfer descriptor is released after 20-30 retry loops. Signed-off-by: Sebastian Andrzej Siewior --- drivers/dma/cppi41.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/dma/cppi41.c b/d

[PATCH 1/2] dma: cppi41: wait longer for the HW to return the descriptor

2014-12-03 Thread Sebastian Andrzej Siewior
ggers. Same test run on beaglebone black and the retries start at 122 and my max value so far was at 128. So lets rise the limit to 500. Signed-off-by: Sebastian Andrzej Siewior --- drivers/dma/cppi41.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/cppi41.c b

Re: [PATCH] usb: gadget: zero: fix INT endpoint assignment

2014-12-02 Thread Sebastian Andrzej Siewior
On 11/26/2014 10:40 PM, Alan Stern wrote: > On Wed, 26 Nov 2014, Sebastian Andrzej Siewior wrote: > >> On 11/26/2014 04:24 PM, Alan Stern wrote: >>>> On 11/25/2014 10:52 PM, Sebastian Andrzej Siewior wrote: >>>>> The max packet size within the FS descriptor

Re: [PATCH] usb: gadget: zero: fix INT endpoint assignment

2014-12-02 Thread Sebastian Andrzej Siewior
On 11/25/2014 08:39 PM, Paul Zimmerman wrote: >> diff --git a/drivers/usb/gadget/function/f_sourcesink.c >> b/drivers/usb/gadget/function/f_sourcesink.c >> index 80be25b32cd7..7d8f0216e1a6 100644 >> --- a/drivers/usb/gadget/function/f_sourcesink.c >> +++ b/drivers/usb/gadget/function/f_sourcesink.

  1   2   3   4   5   6   7   8   9   10   >