Re: [PATCH v10 1/2] usb: xhci : Add devaddr in struct usb_device

2019-05-17 Thread Jim Lin
Sorry, something went wrong. The result is not as expected in one of the tests. Abandon this series of patches. Will debug and resubmit later. Jim On 2019年05月16日 22:56, Alan Stern wrote: On Thu, 16 May 2019, Jim Lin wrote: The Clear_TT_Buffer request sent to the hub includes the address

[PATCH v10 0/2] usb: xhci: Add Clear_TT_Buffer

2019-05-16 Thread Jim Lin
b_clear_tt_buffer() to use. Another is to invoke usb_hub_clear_tt_buffer() for halt processing. Signed-off-by: Jim Lin Jim Lin (2): usb: xhci : Add devaddr in struct usb_device usb: xhci: Add Clear_TT_Buffer drivers/usb/core/hub.c | 4 +++- drivers/usb/host/xhci-ring.c | 27 ++

[PATCH v10 2/2] usb: xhci: Add Clear_TT_Buffer

2019-05-16 Thread Jim Lin
following Set_Interface requests to the device to get ACK successfully. Signed-off-by: Jim Lin --- v2: xhci_clear_tt_buffer_complete: add static, shorter indentation , remove its claiming in xhci.h v3: Add description for clearing_tt (xhci.h) v4: Remove clearing_tt flag because hub_tt_work has hu

[PATCH v10 1/2] usb: xhci : Add devaddr in struct usb_device

2019-05-16 Thread Jim Lin
address of the usb device, chosen and set by usb core. With xHC the controller hardware assigns the address, and won't be the same as devnum. Here we add devaddr in "struct usb_device" for usb_hub_clear_tt_buffer() to use. Signed-off-by: Jim Lin --- v2: xhci_clear_tt_buffer_com

[PATCH v3] usb: gadget: configfs: Fix KASAN use-after-free

2017-01-17 Thread Jim Lin
ring_copy kfree but configfs_composite_bind hasn't been run in time to assign new allocated "cn->configuration" pointer to "cn->strings.s". When "strlen(s->s) of usb_gadget_get_string is being executed, the dangling memory is accessed, "BUG: KASAN: use-after-free&quo

[PATCH v2] usb: gadget: configfs: Fix KASAN use-after-free

2017-01-17 Thread Jim Lin
as been released by usb_string_copy kfree but configfs_composite_bind hasn't been run in time to assign new allocated "cn->configuration" pointer to "cn->strings.s". When "strlen(s->s) of usb_gadget_get_string is being executed, the dangling memory is accessed, "BU

Re: [PATCH] usb: gadget: configfs: Fix KASAN use-after-free

2017-01-17 Thread Jim Lin
On 2017年01月17日 16:07, Felipe Balbi wrote: Hi, Jim Lin writes: When gadget is disconnected, running sequence is like this. . android_work: sent uevent USB_STATE=DISCONNECTED I'm gonna have to ask you to try with actual mainline where there are no Android changes. Let me rephrase and r

[PATCH] usb: gadget: configfs: Fix KASAN use-after-free

2017-01-17 Thread Jim Lin
ory is accessed, "BUG: KASAN: use-after-free" error occurs. Signed-off-by: Jim Lin --- drivers/usb/gadget/configfs.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 78c4497..39fea62

[PATCH 1/1] usb: xhci: Fix panic if disconnect

2016-07-20 Thread Jim Lin
m: kworker/0:1 Tainted: G U [] Workqueue: pm pm_runtime_work [] task: ffc0bc0e0bc0 ti: ffc0bc0ec000 task.ti: ffc0bc0ec000 [] PC is at xhci_stop_device.constprop.11+0xb4/0x1a4 This issue is found when running with realtek ethernet device (0bda:8153). Signed-off-by: Jim Lin --- driver

[PATCH 1/1] usb: xhci: Fix panic if disconnect

2016-07-20 Thread Jim Lin
m: kworker/0:1 Tainted: G U [] Workqueue: pm pm_runtime_work [] task: ffc0bc0e0bc0 ti: ffc0bc0ec000 task.ti: ffc0bc0ec000 [] PC is at xhci_stop_device.constprop.11+0xb4/0x1a4 This issue is found when running with realtek ethernet device (0bda:8153). Signed-off-by: Jim Lin --- driver

[PATCH v2 1/1] usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT

2016-05-20 Thread Jim Lin
Current __ffs_data_do_os_desc() of f_fs.c will check reserved1 field of OS_DESC_EXT_COMPAT and return -EINVAL if it's 1. But MS OS 1.0 Descriptors http://msdn.microsoft.com/en-us/library/windows/hardware/gg463179.aspx defines that field to be 1. Signed-off-by: Jim Lin --- v2: Rewording on c

[PATCH 1/1] usb: gadget: f_fs: Fix kernel panic if use_os_string not set

2016-05-13 Thread Jim Lin
If c->cdev->use_os_string flag is not set, don't need to invoke ffs_do_os_descs() in _ffs_func_bind. So uninitialized ext_compat_id pointer won't be accessed by __ffs_func_bind_do_os_desc to cause kernel panic. Signed-off-by: Jim Lin --- drivers/usb/gadget/func

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-05-05 Thread Jim Lin
On 2016年05月04日 18:37, Felipe Balbi wrote: * PGP Signed by an unknown key Hi, Jim Lin writes: In f_fs.c " static int __ffs_data_do_os_desc(enum ffs_os_desc_type type, struct usb_os_desc_header *h, void *data, unsigned len, void

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-05-05 Thread Jim Lin
On 2016年05月04日 18:37, Felipe Balbi wrote: * PGP Signed by an unknown key Hi, Jim Lin writes: In f_fs.c " static int __ffs_data_do_os_desc(enum ffs_os_desc_type type, struct usb_os_desc_header *h, void *data, unsigned len, void

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-05-04 Thread Jim Lin
On 2016年04月29日 19:57, Felipe Balbi wrote: * PGP Signed by an unknown key Hi, Jim Lin writes: On 2016年04月28日 20:21, Felipe Balbi wrote: I also attach git log of system/core/adb/usb_linux_client.cpp of Android N for your reference. " Author: Badhri Jagan Sridharan Date: Mon Oct 5 13:

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-04-29 Thread Jim Lin
On 2016年04月28日 20:21, Felipe Balbi wrote: I also attach git log of system/core/adb/usb_linux_client.cpp of Android N for your reference. " Author: Badhri Jagan Sridharan Date: Mon Oct 5 13:04:03 2015 -0700 adbd: Add os descriptor support for adb. Eventhough windows does not rely

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-04-28 Thread Jim Lin
On 2016年04月26日 16:49, Jim Lin wrote: On 2016年04月25日 20:01, Felipe Balbi wrote: * PGP Signed by an unknown key Is this happening on set_config() ? If that's the case, why is gadget->speed set to USB_SPEED_SUPER to start with ? Your controller should already have negotiated highspe

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-04-26 Thread Jim Lin
On 2016年04月25日 20:01, Felipe Balbi wrote: * PGP Signed by an unknown key Is this happening on set_config() ? If that's the case, why is gadget->speed set to USB_SPEED_SUPER to start with ? Your controller should already have negotiated highspeed which means function_descriptors() should have

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-04-25 Thread Jim Lin
On 2016年04月22日 19:52, Felipe Balbi wrote: * PGP Signed by an unknown key Hi Jim, Jim Lin writes: Android N adds os_desc_compat in v2_descriptor by init_functionfs() (system/core/adb/usb_linux_client.cpp) to support automatic install of MTP driver on Windows for USB device mode. Current

[PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-04-22 Thread Jim Lin
with v2_descriptor which has ss_descriptors filled. Signed-off-by: Jim Lin --- drivers/usb/gadget/function/f_fs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 73515d5..f5ea3df 100644 --- a/driver

RE: [PATCH v2 1/1] USB: EHCI: Tegra: Fix wrong register definition

2012-09-19 Thread Jim Lin
>-Original Message- >From: Greg KH [mailto:gre...@linuxfoundation.org] >Sent: Wednesday, September 19, 2012 4:04 PM >To: Jim Lin >Cc: swar...@wwwdotorg.org; linux-usb@vger.kernel.org; >linux-ker...@vger.kernel.org >Subject: Re: [PATCH v2 1/1] USB: EHCI: Tegr

RE: [PATCH v2 1/1] USB: EHCI: Tegra: Fix wrong register definition

2012-09-19 Thread Jim Lin
>-Original Message- >From: Greg KH [mailto:gre...@linuxfoundation.org] >Sent: Wednesday, September 19, 2012 2:29 PM >To: Jim Lin >Cc: swar...@wwwdotorg.org; linux-usb@vger.kernel.org; >linux-ker...@vger.kernel.org >Subject: Re: [PATCH v2 1/1] USB: EHCI: Tegr

Re: [PATCH v2 1/1] USB: EHCI: Tegra: Fix wrong register definition

2012-09-19 Thread Jim Lin
On Wed, 2012-09-19 at 14:29 +0800, Greg KH wrote: > On Wed, Sep 19, 2012 at 11:48:50AM +0800, Jim Lin wrote: > > Fix the issue that EHCI registers, hostpc[0] and usbmode_ex, > > are not correctly accessed on Tegra3 platform. > > > > Signed-off-by: Jim Lin > > --

[PATCH v2 1/1] USB: EHCI: Tegra: Fix wrong register definition

2012-09-18 Thread Jim Lin
Fix the issue that EHCI registers, hostpc[0] and usbmode_ex, are not correctly accessed on Tegra3 platform. Signed-off-by: Jim Lin --- Changes in v2: - Modify array size for reserved4[] only. - Note that defining hostpc[0] is for a variable-length object. include/linux/usb/ehci_def.h |2

[PATCH 1/1] USB: EHCI: Tegra: Fix wrong register definition

2012-09-18 Thread Jim Lin
Fix the issue that EHCI registers, hostpc[0] and usbmode_ex, are not correctly accessed on Tegra3 platform. Signed-off-by: Jim Lin --- include/linux/usb/ehci_def.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb