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

2019-07-24 Thread Chunfeng Yun
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 connector, typically using an input GPIO to detect USB ID pin. This pat

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

2019-07-24 Thread Chunfeng Yun
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-off-by: Chunfeng Yun --- v8 changes: 1. rename the title 2. chang

[PATCH v8 04/11] dt-bindings: usb: mtu3: add properties about USB Role Switch

2019-07-24 Thread Chunfeng Yun
Now the USB Role Switch is supported, so add properties about it, and modify some description related. Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring --- v8 no changes v7 no changes v6 no changes v5 changes: 1. modify decription about extcon and vbus-supply properties 2. make this patch

[PATCH v8 05/11] usb: roles: Introduce stubs for the exiting functions in role.h.

2019-07-24 Thread Chunfeng Yun
From: Yu Chen This patch adds stubs for the exiting functions while CONFIG_USB_ROLE_SWITCH does not enabled. Cc: Greg Kroah-Hartman Cc: Heikki Krogerus Cc: Hans de Goede Cc: Andy Shevchenko Cc: John Stultz Reviewed-by: Heikki Krogerus Signed-off-by: Yu Chen Signed-off-by: Chunfeng Yun --

[PATCH v8 07/11] usb: roles: Add fwnode_usb_role_switch_get() function

2019-07-24 Thread Chunfeng Yun
From: Heikki Krogerus The fwnode_usb_role_switch_get() function is exactly the same as usb_role_switch_get(), except that it takes struct fwnode_handle as parameter instead of struct device. Signed-off-by: Heikki Krogerus Signed-off-by: Chunfeng Yun Tested-by: Biju Das --- v8: no changes v7:

[PATCH v8 08/11] usb: roles: get usb-role-switch from parent

2019-07-24 Thread Chunfeng Yun
when the USB host controller is the parent of the connector, usually type-B, sometimes don't need the graph, so we should check whether it's parent registers usb-role-switch or not firstly, and get it if exists. Signed-off-by: Heikki Krogerus Signed-off-by: Chunfeng Yun --- v8: no changes v7:

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

2019-07-24 Thread Chunfeng Yun
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 v7 no changes v6 no changes v5 changes: 1. add reviewed by Rob v4 no changes v3 changes: 1. add GPIO direction, and use fixed-regulator for

[PATCH v8 01/11] dt-binding: usb: add usb-role-switch property

2019-07-24 Thread Chunfeng Yun
Add a property usb-role-switch to tell the driver that use USB Role Switch framework to handle the role switch, it's useful when the driver has already supported other ways, such as extcon framework etc. Cc: Biju Das Cc: Yu Chen Signed-off-by: Chunfeng Yun Reviewed-by: Rob Herring Reviewed-by:

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

2019-07-24 Thread Chunfeng Yun
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 input GPIO to detect USB ID pin, and try to replace the function prov

[PATCH v8 11/11] usb: mtu3: register a USB Role Switch for dual role mode

2019-07-24 Thread Chunfeng Yun
Because extcon is not allowed for new bindings, and the dual role switch is supported by USB Role Switch, especially for Type-C drivers, so register a USB Role Switch to support the new way Signed-off-by: Chunfeng Yun --- v8 no changes v7 no changes v6 no changes v5 no changes v4 changes: 1. a

[PATCH v8 06/11] device connection: Add fwnode_connection_find_match()

2019-07-24 Thread Chunfeng Yun
From: Heikki Krogerus The fwnode_connection_find_match() function is exactly the same as device_connection_find_match(), except it takes struct fwnode_handle as parameter instead of struct device. That allows locating device connections before the device entries have been created. Signed-off-by:

[PATCH v8 09/11] usb: common: create Kconfig file

2019-07-24 Thread Chunfeng Yun
Create Kconfig file for USB common core, and move USB_LED_TRIG and USB_ULPI_BUS configs into the new file from the parent Kconfig, it will help to add new configs later. Signed-off-by: Chunfeng Yun --- v8: new patch --- drivers/usb/Kconfig| 35 +-- drive

Re: [PATCH v3 3/7] drivers: Introduce device lookup variants by fwnode

2019-07-24 Thread Robin Murphy
On 23/07/2019 23:18, Suzuki K Poulose wrote: Add a helper to match the firmware node handle of a device and provide wrappers for {bus/class/driver}_find_device() APIs to avoid proliferation of duplicate custom match functions. Cc: "David S. Miller" Cc: Doug Ledford Cc: Greg Kroah-Hartman Cc:

Re: [PATCH] ARM: imx25: provide a fixed regulator for usb phys

2019-07-24 Thread Uwe Kleine-König
Hello, On Thu, Jun 27, 2019 at 03:15:10AM +, Peter Chen wrote: > > > On 19-06-26 02:40, Peter Chen wrote: > > > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With > > > > this regula

Re: WARNING in snd_usb_motu_microbookii_communicate/usb_submit_urb

2019-07-24 Thread Takashi Iwai
On Tue, 23 Jul 2019 19:03:29 +0200, Andrey Konovalov wrote: > > (Takashi, with your helper check syzkaller now generates a new bug > report (not reported by syzbot yet due to breakage during kernel boot > on 5.3-rc1, so see below) and I guess this has to do with a missing ep > != NULL check). > >

[PATCH] USB: core: hcd-pci: Use dev_get_drvdata where possible

2019-07-24 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/usb/core/hcd-pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 03432467b05f..03

[PATCH] usb: gadget: pch_udc: Use dev_get_drvdata

2019-07-24 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/usb/gadget/udc/pch_udc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c inde

Re: WARNING in snd_usb_motu_microbookii_communicate/usb_submit_urb

2019-07-24 Thread Andrey Konovalov
On Wed, Jul 24, 2019 at 3:15 PM Takashi Iwai wrote: > > On Tue, 23 Jul 2019 19:03:29 +0200, > Andrey Konovalov wrote: > > > > (Takashi, with your helper check syzkaller now generates a new bug > > report (not reported by syzbot yet due to breakage during kernel boot > > on 5.3-rc1, so see below) a

KERNEL CRASH when using XHCI devices (affects any architecture, any USB device)

2019-07-24 Thread Maik Stohn
KERNEL CRASH when using XHCI devices (affects any architecture, any USB device) This was already reported as a kernel bug in bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=204257) but I got told to report it here since it is usb related... Affected kernels: 5.2, 5.2.1, 5.2.2, 5.3-rc1, .

general protection fault in __pm_runtime_resume

2019-07-24 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:6a3599ce 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=1556235860 kernel config: https://syzkaller.appspot.com/x/.

Re: WARNING in snd_usb_motu_microbookii_communicate/usb_submit_urb

2019-07-24 Thread Takashi Iwai
On Wed, 24 Jul 2019 15:33:21 +0200, Andrey Konovalov wrote: > > On Wed, Jul 24, 2019 at 3:15 PM Takashi Iwai wrote: > > > > On Tue, 23 Jul 2019 19:03:29 +0200, > > Andrey Konovalov wrote: > > > > > > (Takashi, with your helper check syzkaller now generates a new bug > > > report (not reported by

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

2019-07-24 Thread Oliver Neukum
Am Dienstag, den 23.07.2019, 05:48 -0700 schrieb syzbot: > > Freed by task 243: > save_stack+0x1b/0x80 /mm/kasan/common.c:71 > set_track /mm/kasan/common.c:79 [inline] > __kasan_slab_free+0x130/0x180 /mm/kasan/common.c:451 > slab_free_hook /mm/slub.c:1421 [inline] > slab_free_freelist_ho

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

2019-07-24 Thread Andrey Konovalov
On Wed, Jul 24, 2019 at 4:17 PM Oliver Neukum wrote: > > Am Dienstag, den 23.07.2019, 05:48 -0700 schrieb syzbot: > > > > Freed by task 243: > > save_stack+0x1b/0x80 /mm/kasan/common.c:71 > > set_track /mm/kasan/common.c:79 [inline] > > __kasan_slab_free+0x130/0x180 /mm/kasan/common.c:451 >

Re: KERNEL CRASH when using XHCI devices (affects any architecture, any USB device)

2019-07-24 Thread Greg KH
On Wed, Jul 24, 2019 at 03:27:51PM +0200, Maik Stohn wrote: > KERNEL CRASH when using XHCI devices (affects any architecture, any USB > device) > > This was already reported as a kernel bug in bugzilla > (https://bugzilla.kernel.org/show_bug.cgi?id=204257) but I got told to report > it here si

Re: KERNEL CRASH when using XHCI devices (affects any architecture, any USB device)

2019-07-24 Thread Maik Stohn
> > Am 24.07.2019 um 16:20 schrieb Greg KH : > > On Wed, Jul 24, 2019 at 03:27:51PM +0200, Maik Stohn wrote: >> KERNEL CRASH when using XHCI devices (affects any architecture, any USB >> device) >> >> This was already reported as a kernel bug in bugzilla >> (https://bugzilla.kernel.org/show_b

[PATCH] usb: typec: tcpm: Add NULL check before dereferencing config

2019-07-24 Thread Guenter Roeck
When instantiating tcpm on an NXP OM 13588 board with NXP PTN5110, the following crash is seen when writing into the 'preferred_role' sysfs attribute. Unable to handle kernel NULL pointer dereference at virtual address 0028 pgd = f69149ad [0028] *pgd= Internal error: Oops: 5 [#1] T

[PATCH v2] usb: typec: tcpm: Add NULL check before dereferencing config

2019-07-24 Thread Guenter Roeck
When instantiating tcpm on an NXP OM 13588 board with NXP PTN5110, the following crash is seen when writing into the 'preferred_role' sysfs attribute. Unable to handle kernel NULL pointer dereference at virtual address 0028 pgd = f69149ad [0028] *pgd= Internal error: Oops: 5 [#1] T

Re: Titan Ridge xHCI may stop to working after re-plugging the dock

2019-07-24 Thread Mathias Nyman
On 22.7.2019 12.44, Kai-Heng Feng wrote: Hi Mika and Mathias, I’ve filed a bug [1] which renders docking station unusable. I am not sure it's a bug in PCI, Thunderbolt or xHCI so raise the issue to you both. [1] https://bugzilla.kernel.org/show_bug.cgi?id=203885 Kai-Heng I upgraded the sy

[PATCH 2/2] net: usb: qmi_wwan: Add the BroadMobi BM818 card

2019-07-24 Thread Angus Ainslie (Purism)
From: Bob Ham The BroadMobi BM818 M.2 card uses the QMI protocol Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) --- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 69e0a2acfcb0..b6dc5d71

[PATCH 0/2] Add the BroadMobi BM818 card

2019-07-24 Thread Angus Ainslie (Purism)
Add qmi_wwan and option support for the BroadMobi BM818 Bob Ham (2): usb: serial: option: Add the BroadMobi BM818 card net: usb: qmi_wwan: Add the BroadMobi BM818 card drivers/net/usb/qmi_wwan.c | 1 + drivers/usb/serial/option.c | 2 ++ 2 files changed, 3 insertions(+) -- 2.17.1

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

2019-07-24 Thread Angus Ainslie (Purism)
From: Bob Ham Add a VID:PID for the BroadModi BM818 M.2 card Signed-off-by: Bob Ham Signed-off-by: Angus Ainslie (Purism) --- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index c1582fbd1150..674a68e

Re: KERNEL CRASH when using XHCI devices (affects any architecture, any USB device)

2019-07-24 Thread Greg KH
On Wed, Jul 24, 2019 at 04:34:06PM +0200, Maik Stohn wrote: > > > > Am 24.07.2019 um 16:20 schrieb Greg KH : > > > > On Wed, Jul 24, 2019 at 03:27:51PM +0200, Maik Stohn wrote: > >> KERNEL CRASH when using XHCI devices (affects any architecture, any USB > >> device) > >> > >> This was already

Re: KERNEL CRASH when using XHCI devices (affects any architecture, any USB device)

2019-07-24 Thread Mathias Nyman
On 24.7.2019 17.34, Maik Stohn wrote: Am 24.07.2019 um 16:20 schrieb Greg KH : On Wed, Jul 24, 2019 at 03:27:51PM +0200, Maik Stohn wrote: KERNEL CRASH when using XHCI devices (affects any architecture, any USB device) This was already reported as a kernel bug in bugzilla (https://bugzilla.k

Re: [Patch V5 4/8] dt-bindings: usb: Add NVIDIA Tegra XUSB device mode controller binding

2019-07-24 Thread Rob Herring
On Fri, Jul 05, 2019 at 05:11:47PM +0530, Nagarjuna Kristam wrote: > Add device-tree binding documentation for the XUSB device mode controller > present on Tegra210 SoC. This controller supports the USB 3.0 > specification. > > Signed-off-by: Nagarjuna Kristam > Reviewed-by: JC Kuo > --- > .../

Re: KERNEL CRASH when using XHCI devices (affects any architecture, any USB device)

2019-07-24 Thread Maik Stohn
> > Am 24.07.2019 um 18:03 schrieb Mathias Nyman : > > On 24.7.2019 17.34, Maik Stohn wrote: >>> >>> Am 24.07.2019 um 16:20 schrieb Greg KH : >>> >>> On Wed, Jul 24, 2019 at 03:27:51PM +0200, Maik Stohn wrote: KERNEL CRASH when using XHCI devices (affects any architecture, any USB de

lk5.1.18: tcpm: another NULL pointer deref

2019-07-24 Thread Douglas Gilbert
Hi, Same hardware setup as last time*** (NXP OM13588 + SAMA5D2_Xplained + lk 5.1.18) but not sure exactly how it was triggered. I was using the NXP test monitor (NXP software) with another OM13588+KL27Z at the other end of the USB Type C cable (it is also a PD DRP). When I looked back at the Linux

Re: lk5.1.18: tcpm: another NULL pointer deref

2019-07-24 Thread Guenter Roeck
On 7/24/19 9:51 AM, Douglas Gilbert wrote: Hi, Same hardware setup as last time*** (NXP OM13588 + SAMA5D2_Xplained + lk 5.1.18) but not sure exactly how it was triggered. I was using the NXP test monitor (NXP software) with another OM13588+KL27Z at the other end of the USB Type C cable (it is als

xhci-hcd errors with Qualcomm based modem and Asmedia ASM1042A

2019-07-24 Thread Daniele Palmas
Hello all, I've a system with kernel 4.14.127 that is showing unexpected xhci-hcd (ASM1042A) errors with a Qualcomm based modem, when running the following test: - signal strength qmi requests looping every few seconds on /dev/cdc-wdm (driver qmi_wwan) - iperf tcp data connection test on the mode

[PATCH 5.2 340/413] signal/usb: Replace kill_pid_info_as_cred with kill_pid_usb_asyncio

2019-07-24 Thread Greg Kroah-Hartman
From: Eric W. Biederman commit 70f1b0d34bdf03065fe869e93cc17cad1ea20c4a upstream. The usb support for asyncio encoded one of it's values in the wrong field. It should have used si_value but instead used si_addr which is not present in the _rt union member of struct siginfo. The practical resul

[PATCH 5.1 308/371] signal/usb: Replace kill_pid_info_as_cred with kill_pid_usb_asyncio

2019-07-24 Thread Greg Kroah-Hartman
From: Eric W. Biederman commit 70f1b0d34bdf03065fe869e93cc17cad1ea20c4a upstream. The usb support for asyncio encoded one of it's values in the wrong field. It should have used si_value but instead used si_addr which is not present in the _rt union member of struct siginfo. The practical resul

Re: [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting

2019-07-24 Thread Rob Herring
On Fri, Jul 12, 2019 at 02:42:05PM +0800, Ran Wang wrote: > Some Layerscape paltforms (such as LS1088A, LS2088A, etc) encounter USB > detect failues when adding dma-coherent to DWC3 node. This is because the > HW default cache type configuration of those SoC are not right, need to > be updated in D

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

2019-07-24 Thread Oliver Neukum
Am Dienstag, den 23.07.2019, 05:48 -0700 schrieb syzbot: > Hello, > > syzbot found the following crash on: > > HEAD commit:6a3599ce 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.

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

2019-07-24 Thread Alan Stern
On Wed, 24 Jul 2019, Oliver Neukum wrote: > Am Dienstag, den 23.07.2019, 05:48 -0700 schrieb syzbot: > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:6a3599ce usb-fuzzer: main usb gadget fuzzer driver > > git tree: https://github.com/google/kasan.git usb-fuzz

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

2019-07-24 Thread syzbot
Hello, syzbot tried to test the proposed patch but build/boot failed: T1] devtmpfs: initialized [2.873454][T1] clocksource: jiffies: mask: 0x max_cycles: 0x, max_idle_ns: 1911260446275 ns [2.873454][T1] futex hash table entries: 512 (order: 4, 65536 byt

RE: [PATCH V2 1/2] usb: dwc3: Add node to update cache type setting

2019-07-24 Thread Ran Wang
Hi Rob, On Thursday, July 25, 2019 04:42 Rob Herring wrote: > > On Fri, Jul 12, 2019 at 02:42:05PM +0800, Ran Wang wrote: > > Some Layerscape paltforms (such as LS1088A, LS2088A, etc) encounter > > USB detect failues when adding dma-coherent to DWC3 node. This is > > because the HW default cache

[RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-24 Thread Guenter Roeck
TCPM may receive PD messages associated with unknown or unsupported alternate modes. If that happens, calls to typec_match_altmode() will return NULL. The tcpm code does not currently take this into account. This results in crashes. Unable to handle kernel NULL pointer dereference at virtual addre

Re: general protection fault in __pm_runtime_resume

2019-07-24 Thread syzbot
syzbot has found a reproducer for the following crash on: HEAD commit:6a3599ce 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=108edb6860 kernel config: https://syzkaller.ap

Trabaja conmigo

2019-07-24 Thread lzz
Hola, Tenemos algunas finanzas en su nombre de familia amablemente Póngase en contacto conmigo aquí [(info.attltz...@gmail.com)] para más información. Saludos, Lutz

Re: [PATCH v2] usb: typec: tcpm: Add NULL check before dereferencing config

2019-07-24 Thread Jun Li
Guenter Roeck 于2019年7月24日周三 下午10:40写道: > > When instantiating tcpm on an NXP OM 13588 board with NXP PTN5110, > the following crash is seen when writing into the 'preferred_role' > sysfs attribute. > > Unable to handle kernel NULL pointer dereference at virtual address 0028 > pgd = f69149ad >