Re: [PATCH v3 2/2] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-05 Thread Suwan Kim
On Fri, Aug 02, 2019 at 04:41:52PM -0600, shuah wrote: > Hi Suwan, > > On 8/2/19 11:36 AM, Suwan Kim wrote: > > There are bugs on vhci with usb 3.0 storage device. > > This sentence doesn't make sense to me. What bugs? Ca you eloborate? Alan's patch description "usb-storage: Set virt_boundary_ma

Re: [heads-up] deadlock in configfs_symlink()

2019-08-05 Thread Felipe Balbi
Hi, On Sun, Aug 4, 2019 at 11:48 PM Al Viro wrote: > > On Sun, Aug 04, 2019 at 09:31:43PM +0100, Al Viro wrote: > > > FWIW, the following reproduces the deadlock on mainline: > > > > dd if=/dev/zero of=/tmp/image bs=1M count=20 > > modprobe dummy_hcd > > modprobe configfs > > mount -t configfs no

RE: [PATCH 2/5] usb: chipidea: add role switch class support

2019-08-05 Thread Jun Li
Hi > -Original Message- > From: Peter Chen > Sent: 2019年8月5日 12:57 > To: Jun Li ; Peter Chen > Cc: Greg Kroah-Hartman ; dl-linux-imx > ; USB list > Subject: RE: [PATCH 2/5] usb: chipidea: add role switch class support > > > > > > > > USB role is fully controlled by usb role switch consu

Re: [PATCH 05/14] gpio: lpc32xx: allow building on non-lpc32xx targets

2019-08-05 Thread Bartosz Golaszewski
pt., 2 sie 2019 o 13:20 Arnd Bergmann napisał(a): > > On Fri, Aug 2, 2019 at 9:10 AM Bartosz Golaszewski > wrote: > > > -#include > > > -#include > > > +#define _GPREG(x) (x) > > > > What purpose does this macro serve? > > > > > > > > #define LPC32XX_GPIO_P3_INP_ST

Re: About usb_new_device() API

2019-08-05 Thread Mayuresh Kulkarni
On Fri, 2019-08-02 at 12:27 -0400, Alan Stern wrote: > On Fri, 2 Aug 2019, Mayuresh Kulkarni wrote: > > > > > Hi Alan, > > > > Thanks a lot for clearing out the confusion. > > > > Our USB device can operate in 2 mutually exclusive modes: one is > > normal > > composite USB audio mode and other

Re: KASAN: use-after-free Read in usb_free_coherent

2019-08-05 Thread Oliver Neukum
Am Donnerstag, den 01.08.2019, 11:52 +0100 schrieb Suzuki K Poulose: > > Looks like the yurex_delete() drops the ref count on the dev->udev > way early in the function and then later tries to see if there > are any other buffers associated with it worth releasing. So, > I am guessing moving the us

[PATCH] NFC: nfcmrvl: fix gpio-handling regression

2019-08-05 Thread Johan Hovold
Fix two reset-gpio sanity checks which were never converted to use gpio_is_valid(), and make sure to use -EINVAL to indicate a missing reset line also for the UART-driver module parameter and for the USB driver. This specifically prevents the UART and USB drivers from incidentally trying to reques

Re: [PATCH v8 00/11] add USB GPIO based connection detection driver

2019-08-05 Thread Linus Walleij
On Wed, Jul 24, 2019 at 10:51 AM Chunfeng Yun wrote: > Because the USB Connector is introduced and the requirement of > usb-connector.txt binding, the old way using extcon to support > USB Dual-Role switch is now deprecated, meanwhile there is no > available common driver when use Type-B connecto

Re: [PATCH v8 03/11] dt-bindings: usb: add binding for USB GPIO based connection detection driver

2019-08-05 Thread Linus Walleij
On Wed, Jul 24, 2019 at 10:51 AM Chunfeng Yun wrote: > It's used to support dual role switch via GPIO when use Type-B > receptacle, typically the USB ID pin is connected to an input > GPIO, and also used to enable/disable device when the USB Vbus > pin is connected to an input GPIO. > > Signed-of

Re: [PATCH v8 02/11] dt-bindings: connector: add optional properties for Type-B

2019-08-05 Thread Linus Walleij
On Wed, Jul 24, 2019 at 10:51 AM Chunfeng Yun wrote: > Add id-gpios, vbus-gpios, vbus-supply and pinctrl properties for > usb-b-connector > > Signed-off-by: Chunfeng Yun > Reviewed-by: Rob Herring > --- > v8 no changes Reviewed-by: Linus Walleij Yours, Linus Walleij

Re: [PATCH v8 10/11] usb: common: add USB GPIO based connection detection driver

2019-08-05 Thread Linus Walleij
On Wed, Jul 24, 2019 at 10:51 AM Chunfeng Yun wrote: > Due to the requirement of usb-connector.txt binding, the old way > using extcon to support USB Dual-Role switch is now deprecated > when use Type-B connector. > This patch introduces a driver of Type-B connector which typically > uses an inpu

Race condition when accessing authorized_default for a root hub

2019-08-05 Thread Thiébaud Weksteen
Hi, I believe there is a race condition for userland in hcd.c where the kernel sends a uevent before the underlying sysfs is fully populated: (drivers/usb/core/hcd.c) /* starting here, usbcore will pay attention to this root hub */ retval = register_root_hub(hcd); if

Re: [PATCH 0/2] usb: xhci: dbc: 2 smalll fixes for 'xhci_dbc_alloc_requests()'

2019-08-05 Thread Mathias Nyman
On 31.7.2019 15.51, Christophe JAILLET wrote: Christophe JAILLET (2): usb: xhci: dbc: Simplify error handling in 'xhci_dbc_alloc_requests()' usb: xhci: dbc: Use GFP_KERNEL instead of GFP_ATOMIC in 'xhci_dbc_alloc_requests()' drivers/usb/host/xhci-dbgtty.c | 4 ++-- 1 file changed

Re: Race condition when accessing authorized_default for a root hub

2019-08-05 Thread Greg Kroah-Hartman
On Mon, Aug 05, 2019 at 12:29:27PM +0200, Thiébaud Weksteen wrote: > Hi, > > I believe there is a race condition for userland in hcd.c where the > kernel sends a uevent before the underlying sysfs is fully populated: > > (drivers/usb/core/hcd.c) > /* starting here, usbcore will pay atte

[PATCH] usb: yurex: Fix use-after-free in yurex_delete

2019-08-05 Thread Suzuki K Poulose
syzbot reported the following crash [0]: BUG: KASAN: use-after-free in usb_free_coherent+0x79/0x80 drivers/usb/core/usb.c:928 Read of size 8 at addr 8881b18599c8 by task syz-executor.4/16007 CPU: 0 PID: 16007 Comm: syz-executor.4 Not tainted 5.3.0-rc2+ #23 Hardware name: Google Google Compute

Re: [PATCH v3] USB: serial: option: Add support for ZTE MF871A

2019-08-05 Thread Johan Hovold
On Sat, Jul 20, 2019 at 10:23:18PM +0900, Yoshiaki Okamoto wrote: > This patch adds support for MF871A USB modem (aka Speed USB STICK U03) > to option driver. This modem is manufactured by ZTE corporation, and > sold by KDDI. > Co-developed-by: Hiroyuki Yamamoto > Signed-off-by: Hiroyuki Yamamoto

Re: [PATCH v6] USB: serial: option: add D-Link DWM-222 device ID

2019-08-05 Thread Johan Hovold
On Wed, Jul 17, 2019 at 11:11:34AM +0200, Rogan Dawes wrote: > Add device id for D-Link DWM-222 A2. > > MI_00 D-Link HS-USB Diagnostics > MI_01 D-Link HS-USB Modem > MI_02 D-Link HS-USB AT Port > MI_03 D-Link HS-USB NMEA > MI_04 D-Link HS-USB WWAN Adapter (qmi_wwan) > MI_05 USB Mass Storage Device

RE: [PATCH] usb: devio: fix mmap() on non-coherent DMA architectures

2019-08-05 Thread David Laight
From: gavi...@thegavinli.com > Sent: 01 August 2019 23:02 > > On architectures that are not (or are optionally) DMA coherent, > dma_alloc_coherent() returns an address into the vmalloc space, > and calling virt_to_phys() on this address returns an unusable > physical address. So? what is the code

Re: [PATCH 1/2] usb: serial: option: Add the BroadMobi BM818 card

2019-08-05 Thread Johan Hovold
On Wed, Jul 24, 2019 at 07:52:26AM -0700, Angus Ainslie (Purism) wrote: > From: Bob Ham > > Add a VID:PID for the BroadModi BM818 M.2 card Would you mind posting the output of usb-devices (or lsusb -v) for this device? > Signed-off-by: Bob Ham > Signed-off-by: Angus Ainslie (Purism) > --- >

KASAN: use-after-free Read in adu_disconnect

2019-08-05 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasan.git usb-fuzzer console output: https://syzkaller.appspot.com/x/log.txt?x=148af1b260 kernel config: https://syzkaller.appspot.com/x/.

KASAN: use-after-free Read in usbhid_wait_io

2019-08-05 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasan.git usb-fuzzer console output: https://syzkaller.appspot.com/x/log.txt?x=136bed1a60 kernel config: https://syzkaller.appspot.com/x/.

possible deadlock in usb_deregister_dev

2019-08-05 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasan.git usb-fuzzer console output: https://syzkaller.appspot.com/x/log.txt?x=13b5bc8a60 kernel config: https://syzkaller.appspot.com/x/.

WARNING in usbtouch_reset_resume

2019-08-05 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasan.git usb-fuzzer console output: https://syzkaller.appspot.com/x/log.txt?x=1104baf860 kernel config: https://syzkaller.appspot.com/x/.

WARNING in __iforce_usb_xmit/usb_submit_urb

2019-08-05 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasan.git usb-fuzzer console output: https://syzkaller.appspot.com/x/log.txt?x=10809e0c60 kernel config: https://syzkaller.appspot.com/x/.

Re: BUG: logitech-djreceiver: probe failed with error 7

2019-08-05 Thread Jiri Kosina
On Tue, 23 Jul 2019, Michael Bowcutt wrote: > Hi, > > On the latest batch commit to the hid/hid tree, my USB keyboard + mouse > stopped working. I was able to determine that it was caused by > dbcbabf7da921f98beefb4a6f4b91eb62d072076 which affects > drivers/hid/hid-logitech-dj.c, but have not bee

Re: KASAN: use-after-free Read in hiddev_release

2019-08-05 Thread Jiri Kosina
On Mon, 5 Aug 2019, Hillf Danton wrote: > 1, no dev no open. > > --- a/drivers/hid/usbhid/hiddev.c > +++ b/drivers/hid/usbhid/hiddev.c > @@ -284,6 +284,10 @@ static int hiddev_open(struct inode *ino > spin_unlock_irq(&list->hiddev->list_lock); > > mutex_lock(&hiddev->existancelock);

KASAN: slab-out-of-bounds Write in lg4ff_init

2019-08-05 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasan.git usb-fuzzer console output: https://syzkaller.appspot.com/x/log.txt?x=144c21dc60 kernel config: https://syzkaller.appspot.com/x/.

Re: [PATCH 03/14] watchdog: pnx4008_wdt: allow compile-testing

2019-08-05 Thread Sylvain Lemieux
Acked-by: Sylvain Lemieux On Wed, Jul 31, 2019 at 4:36 PM Guenter Roeck wrote: > > On Wed, Jul 31, 2019 at 10:26:35PM +0200, Arnd Bergmann wrote: > > On Wed, Jul 31, 2019 at 10:23 PM Guenter Roeck wrote: > > > > > > On Wed, Jul 31, 2019 at 09:56:45PM +0200, Arnd Bergmann wrote: > > > > The only

Re: [PATCH 04/14] serial: lpc32xx_hs: allow compile-testing

2019-08-05 Thread Sylvain Lemieux
Acked-by: Sylvain Lemieux On Thu, Aug 1, 2019 at 1:58 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 31, 2019 at 09:56:46PM +0200, Arnd Bergmann wrote: > > The only thing that prevents building this driver on other > > platforms is the mach/hardware.h include, which is not actually > > used here a

Re: [PATCH 02/14] usb: udc: lpc32xx: allow compile-testing

2019-08-05 Thread Sylvain Lemieux
Acked-by: Sylvain Lemieux On Thu, Aug 1, 2019 at 1:58 AM Greg Kroah-Hartman wrote: > > On Wed, Jul 31, 2019 at 09:56:44PM +0200, Arnd Bergmann wrote: > > The only thing that prevents building this driver on other > > platforms is the mach/hardware.h include, which is not actually > > used here a

Re: [PATCH v2] USB: Disable USB2 LPM at shutdown

2019-08-05 Thread Kai-Heng Feng
Hi Greg, at 17:22, Kai-Heng Feng wrote: at 22:17, Alan Stern wrote: I agree with Kai-Heng, this seems like a fairly light-weight solution to a reasonable problem. Thanks for your review. As to the issue of how much it will slow down system shutdowns, I have no idea. Probably not very m

Re: [PATCH v2] USB: Disable USB2 LPM at shutdown

2019-08-05 Thread Greg KH
On Mon, Aug 05, 2019 at 08:58:33PM +0800, Kai-Heng Feng wrote: > Hi Greg, > > at 17:22, Kai-Heng Feng wrote: > > > at 22:17, Alan Stern wrote: > > > > > > I agree with Kai-Heng, this seems like a fairly light-weight solution > > > to a reasonable problem. > > > > Thanks for your review. > >

Re: About usb_new_device() API

2019-08-05 Thread Alan Stern
On Mon, 5 Aug 2019, Mayuresh Kulkarni wrote: > I think I found what is happening here: > - Looks like, the USB audio class driver is > calling usb_enable_autosuspend(). The audio maintainers must have some good reason for doing that, but I don't know what it is. Normally kernel drivers are not

Re: [PATCH v1] usb: usbfs: fix double-free of usb memory upon submiturb error

2019-08-05 Thread Alan Stern
On Sun, 4 Aug 2019 gavi...@thegavinli.com wrote: > From: Gavin Li > > Upon an error within proc_do_submiturb(), dec_usb_memory_use_count() > gets called once by the error handling tail and again by free_async(). > Remove the first call. > > Signed-off-by: Gavin Li > --- > drivers/usb/core/dev

[RESEND] [PATCH v2] USB: Disable USB2 LPM at shutdown

2019-08-05 Thread Kai-Heng Feng
The QCA Rome USB Bluetooth controller has several issues once LPM gets enabled: - Fails to get enumerated in coldboot. [1] - Drains more power (~ 0.2W) when the system is in S5. [2] - Disappears after a warmboot. [2] The issue happens because the device lingers at LPM L1 in S5, so device can't get

Re: KASAN: slab-out-of-bounds Write in lg4ff_init

2019-08-05 Thread Oliver Neukum
Am Montag, den 05.08.2019, 05:38 -0700 schrieb syzbot: > Hello, > > syzbot found the following crash on: > > HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.tx

Re: KASAN: slab-out-of-bounds Write in lg4ff_init

2019-08-05 Thread syzbot
Hello, syzbot has tested the proposed patch and the reproducer did not trigger crash: Reported-and-tested-by: syzbot+94e2b9e9c7d1dd332...@syzkaller.appspotmail.com Tested on: commit: e96407b4 usb-fuzzer: main usb gadget fuzzer driver git tree: https://github.com/google/kasa

Re: KASAN: slab-out-of-bounds Write in lg4ff_init

2019-08-05 Thread Andrey Konovalov
On Mon, Aug 5, 2019 at 4:34 PM Oliver Neukum wrote: > > Am Montag, den 05.08.2019, 05:38 -0700 schrieb syzbot: > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:e96407b4 usb-fuzzer: main usb gadget fuzzer driver > > git tree: https://github.com/google/kasan.git

Re: [PATCH 1/2] usb: serial: option: Add the BroadMobi BM818 card

2019-08-05 Thread Bob Ham
On 05/08/2019 12:47, Johan Hovold wrote: > On Wed, Jul 24, 2019 at 07:52:26AM -0700, Angus Ainslie (Purism) wrote: >> From: Bob Ham >> >> Add a VID:PID for the BroadModi BM818 M.2 card > > Would you mind posting the output of usb-devices (or lsusb -v) for this > device? T: Bus=01 Lev=03 Prnt=40

Re: [PATCH v3 2/2] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-05 Thread shuah
On 8/5/19 2:04 AM, Suwan Kim wrote: On Fri, Aug 02, 2019 at 04:41:52PM -0600, shuah wrote: Hi Suwan, On 8/2/19 11:36 AM, Suwan Kim wrote: There are bugs on vhci with usb 3.0 storage device. This sentence doesn't make sense to me. What bugs? Ca you eloborate? Alan's patch description "usb-s

Re: [PATCH v3 1/2] usbip: Skip DMA mapping and unmapping for urb at vhci

2019-08-05 Thread shuah
On 8/4/19 11:23 PM, Suwan Kim wrote: On Fri, Aug 02, 2019 at 04:22:27PM -0600, shuah wrote: On 8/2/19 11:36 AM, Suwan Kim wrote: vhci doesn’t do DMA for remote device. Actually, the real DMA operation is done by network card driver. vhci just passes virtual address of the buffer to the network

Re: [PATCH] usb: devio: fix mmap() on non-coherent DMA architectures

2019-08-05 Thread Greg KH
On Fri, Aug 02, 2019 at 10:57:00AM -0700, Gavin Li wrote: > usbfs mmap() looks like it was introduced for 4.6 in commit > f7d34b445abc, so it should probably be backported to 4.9 and onwards. > This issue has been present since the introduction of the feature. > > One sidenote: this patch will cau

[PATCH] usb: dwc2: gadget: Fix kill_all_requests race

2019-08-05 Thread John Keeping
When a gadget is disabled, kill_all_requests() can be called simultaneously from both a user process via dwc2_hsotg_pullup() and from the interrupt handler if the hardware detects disconnection. Since we drop the lock in dwc2_hsotg_complete_request() in order to call the completion handler, this m

Re: About usb_new_device() API

2019-08-05 Thread Mayuresh Kulkarni
On Mon, 2019-08-05 at 10:07 -0400, Alan Stern wrote: > On Mon, 5 Aug 2019, Mayuresh Kulkarni wrote: > > > > > I think I found what is happening here: > > - Looks like, the USB audio class driver is > > calling usb_enable_autosuspend(). > The audio maintainers must have some good reason for doing

Re: [PATCH] NFC: nfcmrvl: fix gpio-handling regression

2019-08-05 Thread David Miller
From: Johan Hovold Date: Mon, 5 Aug 2019 12:00:55 +0200 > Fix two reset-gpio sanity checks which were never converted to use > gpio_is_valid(), and make sure to use -EINVAL to indicate a missing > reset line also for the UART-driver module parameter and for the USB > driver. > > This specifical

[PATCH v2] usb: typec: ucsi: add support for separate DP altmode devices

2019-08-05 Thread Ajay Gupta
From: Ajay Gupta CCGx controller used on NVIDIA GPU card has two separate display altmode for two DP pin assignments. UCSI specification doesn't prohibits using separate display altmode. Current UCSI Type-C framework expects only one display altmode for all DP pin assignment. This patch squashes

Re: [PATCH] usb: devio: fix mmap() on non-coherent DMA architectures

2019-08-05 Thread Gavin Li
The purpose of this section of code is to map that memory into userspace, and the code before this patch would incorrectly calculate the pfn required to do so. This patch simply changes it to use the correct function to do so rather than doing it from scratch. On Mon, Aug 5, 2019 at 4:37 AM David

[PATCH] usb: gadget: atmel_usba_udc: Mark expected switch fall-through

2019-08-05 Thread Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: at91_dt_defconfig arm): drivers/usb/gadget/udc/atmel_usba_udc.c:329:13: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva --- drivers

[PATCH] USB: gadget: udc: s3c2410_udc: Mark expected switch fall-throughs

2019-08-05 Thread Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: tct_hammer_defconfig arm): drivers/usb/gadget/udc/s3c2410_udc.c:314:7: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/usb/gadget/udc/s3c2410_udc.c:418:7: warnin

[PATCH] USB: musb: convert platform driver to use dev_groups

2019-08-05 Thread Greg Kroah-Hartman
Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" any sysfs files. Cc: Bin Liu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/musb_core.c | 22 +++---

[PATCH] USB: chipidea: convert platform driver to use dev_groups

2019-08-05 Thread Greg Kroah-Hartman
Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" any sysfs files. Cc: Peter Chen Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/core.c | 13 ++--- 1 fil

[PATCH] USB: usbip: convert platform driver to use dev_groups

2019-08-05 Thread Greg Kroah-Hartman
Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" any sysfs files. Cc: Valentina Manea Cc: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/vudc.h |

[PATCH] USB: phy: tahvo: convert platform driver to use dev_groups

2019-08-05 Thread Greg Kroah-Hartman
Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" any sysfs files. Cc: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/phy/phy-tahvo.c | 18 +++---

[PATCH] USB: phy: mv-usb: convert platform driver to use dev_groups

2019-08-05 Thread Greg Kroah-Hartman
Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" any sysfs files. Cc: Felipe Balbi Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/phy/phy-mv-usb.

[PATCH] USB: typec: ucsi_ccg: convert i2c driver to use dev_groups

2019-08-05 Thread Greg Kroah-Hartman
The driver core now supports the option to automatically create and remove any needed sysfs attribute files for a driver when the device is bound/removed from it. Convert the uscsi_ccg code to use that instead of trying to create sysfs files "by hand". Cc: Heikki Krogerus Cc: Ajay Gupta Cc: Wol

Re: [PATCH] USB: usbip: convert platform driver to use dev_groups

2019-08-05 Thread shuah
On 8/5/19 1:36 PM, Greg Kroah-Hartman wrote: Platform drivers now have the option to have the platform core create and remove any needed sysfs attribute files. So take advantage of that and do not register "by hand" any sysfs files. Cc: Valentina Manea Cc: Shuah Khan Signed-off-by: Greg Kroah