Re: [PATCH] usb: dwc3 dwc3_exynos_probe() change goto labels to meaningful names

2017-03-16 Thread Shuah Khan
On 01/30/2017 12:25 PM, Shuah Khan wrote: > Change goto labels to meaningful names from a series of errNs. > > Signed-off-by: Shuah Khan > --- > > Rebased to usb-next Hi Felipe, Are you planning to get this in or is there something you are waiting in for me to do?

Re: [PATCH] usb: dwc3 dwc3_exynos_probe() change goto labels to meaningful names

2017-03-17 Thread Shuah Khan
On 03/17/2017 12:24 AM, Vivek Gautam wrote: > On Tue, Jan 31, 2017 at 12:55 AM, Shuah Khan wrote: >> Change goto labels to meaningful names from a series of errNs. >> >> Signed-off-by: Shuah Khan >> --- >> >> Rebased to usb-next >

[PATCH 0/7] dwc3 - bug fixes and use meaningful goto labels

2017-03-24 Thread Shuah Khan
This patch series consists of two fixes and changes to goto labels to use meaningful names. While working on goto label changes, I noticed put_sync calls without successful get_sync in error legs. The first two patches are the fixes and the rest of the patches are goto label changes. Shuah

[PATCH 5/7] usb: dwc3: omap: change goto labels in this file to meaningful names

2017-03-24 Thread Shuah Khan
Change goto labels in this file to meaningful names. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/dwc3-omap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 55b12a9..ca0075a 100644 --- a/drivers/usb

[PATCH 2/7] usb: dwc3: dwc3-omap: fix dwc3_omap_probe() do put_sync when get_sync works

2017-03-24 Thread Shuah Khan
dwc3_omap_probe() does pm_runtime_put_sync() in its err1 handling when pm_runtime_get_sync() fails. Fix it to do put_sync only when get_sync succeeds. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/dwc3-omap.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH 4/7] usb: dwc3: exynos: change goto labels in this file to meaningful names

2017-03-24 Thread Shuah Khan
Change goto labels in this file to meaningful names Signed-off-by: Shuah Khan --- drivers/usb/dwc3/dwc3-exynos.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 98f74ff..11f31f4 100644

[PATCH 7/7] usb: dwc3: host: change goto labels in this file to meaningful names

2017-03-24 Thread Shuah Khan
Change goto labels in this file to meaningful names. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/host.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index 76f0b0d..eb264a9 100644 --- a/drivers/usb/dwc3/host.c

[PATCH 1/7] usb: dwc3: core: fix dwc3_probe() to not do put_sync when get_sync fails

2017-03-24 Thread Shuah Khan
dwc3_probe() does pm_runtime_put_sync() in its err1 handling when pm_runtime_get_sync() fails. Move the pm_runtime_put_sync() under err2 instead as it is used in error paths after pm_runtime_get_sync() succeeds. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/core.c | 2 +- 1 file changed, 1

[PATCH 6/7] usb: dwc3: gadget: change goto labels in this file to meaningful names

2017-03-24 Thread Shuah Khan
Change goto labels in this file to meaningful names. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/gadget.c | 56 +++ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8d44a2f

[PATCH 3/7] usb: dwc3: core: change goto labels to meaningful names

2017-03-24 Thread Shuah Khan
Change goto labels to meaningful names. Signed-off-by: Shuah Khan --- drivers/usb/dwc3/core.c | 62 - 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0fc7bef..f82786a 100644

Re: [PATCH 0/7] dwc3 - bug fixes and use meaningful goto labels

2017-03-27 Thread Shuah Khan
On 03/25/2017 01:51 AM, Felipe Balbi wrote: > > Hi, > > Shuah Khan writes: >> This patch series consists of two fixes and changes to goto labels > > we *NEVER* put cleanups and fixes together. > >> to use meaningful names. >> >> While working on

Re: [PATCH 2/6] usb: usbip tool: Fix get_nports()

2017-03-27 Thread Shuah Khan
On 03/26/2017 11:28 PM, Yuyang Du wrote: > On Mon, Mar 27, 2017 at 08:56:44AM +0200, Krzysztof Opasiak wrote: >> + Shuah Khan > > Sorry for not having sent to Shuah. Can you send me the patches - aren't in my inbox to review. thanks, -- Shuah > >> On 03/23/2

Re: [PATCH v2 1/6] usb: usbip: Remove unnecessary get_vdev()

2017-04-04 Thread Shuah Khan
unsigned long flags; >> @@ -601,7 +573,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct >> urb *urb, >> } >> >> out: >> -vhci_tx_urb(urb); >> +vhci_tx_urb(urb, vdev); >> spin_unlock_irqrestore(&vhci->lock, flags); &g

Re: [PATCH v2 2/6] usb: usbip tool: Fix get_nports()

2017-04-04 Thread Shuah Khan
get_nports() has been so wrong that even with 8 port > lines for instance, it gets 7 (I am guessing it is due to a '\n' mess). > Nevertheless, we fix it by reading the nports attribute. > > Reviewed-by: Krzysztof Opasiak Thanks for the review. > Signed-off-by: Yuyang

Re: [PATCH v2 4/6] usb: usbip tool: Fix refresh_imported_device_list()

2017-04-04 Thread Shuah Khan
dbg("controller %d", i); > + > + ret = parse_status(attr_status); > + if (ret != 0) > + return ret; usbip_vhci_driver_open() will fail even if one of these fails? Is that what you would want? thanks, -- Shuah > } >

Re: [PATCH v2 5/6] usb: usbip tool: Fix parse_status()

2017-04-04 Thread Shuah Khan
On 03/30/2017 06:28 PM, Yuyang Du wrote: > parse_status() reads the status file one by one, so it can only > update the available and according vhci_driver->idev's. What are you fixing? This change log doesn't me what is the bug and what is being fixed. thanks, -- Shuah

Re: [PATCH v2 6/6] usb: usbip tool: Remove empty lines

2017-04-04 Thread Shuah Khan
r *value) > { > int ret = 0; > No change log - also it could be combined with a prior patch. -- Shuah -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH] Regression fix revert: "Bluetooth: Add missing reset_resume dev_pm_ops"

2013-10-03 Thread Shuah Khan
rts commit 502f769662978a2fe99d0caed5e53e3006107381. Cc: Shuah Khan Cc: Gustavo Padovan Cc: sta...@vger.kernel.org Signed-off-by: Hans de Goede --- drivers/bluetooth/btusb.c | 1 - 1 file changed, 1 deletion(-) Patch has been applied to bluetooth.git. Thanks. why? Because we have one broken Dell Bluetooth dongle. Do we actuall

3.12.1 Virt dev invalid for slot_id 0x1 from drivers/usb/host/xhci.c

2013-11-25 Thread Shuah Khan
---[ cut here ]---- -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) shuah...@samsung.com | (970) 672-0658 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.

Re: 3.12.1 Virt dev invalid for slot_id 0x1 from drivers/usb/host/xhci.c

2013-11-27 Thread Shuah Khan
On 11/27/2013 02:59 PM, Sarah Sharp wrote: On Mon, Nov 25, 2013 at 11:41:47AM -0700, Shuah Khan wrote: I started seeing the following on my Samsung Series on 3.12.1 Is this bad? Looks like the following WARN_ON is firing: drivers/usb/host/xhci.c: if (WARN_ON(!virt_dev

[PATCH] staging/usbip: remove vhci_hcd vhci_hub_status change message

2014-01-21 Thread Shuah Khan
ation. [ 4062.716662] vhci_hcd: changed 0 Signed-off-by: Shuah Khan --- drivers/staging/usbip/vhci_hcd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 72391ef..adb6201 100644 --- a/drivers/staging/usbip/vhci_hcd.c

[PATCH] staging/usbip: Fix vhci_hcd attach failure error message to be informative

2014-01-22 Thread Shuah Khan
When attach fails due to unsupported and/or invalid bus speed, the message vhci_hcd prints out doesn't include any useful information as to what caused the failure. Change the message to be informative and use usb_speed_string() to get the right speed string from usb common. Signed-off-by:

[PATCH] staging/usbip: Change userspace to use linux include for usb_device_speed enum

2014-01-22 Thread Shuah Khan
Remove usb_device_speed enum define from usbip_common.h and change it to include linux/usb/ch9.h instead. Signed-off-by: Shuah Khan --- drivers/staging/usbip/userspace/libsrc/usbip_common.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/usbip

[PATCH] staging/usbip: Add missing speeds to userspace speed_strings array

2014-01-22 Thread Shuah Khan
Add speed strings for usb wireless and 3.0 to speed_strings array. Signed-off-by: Shuah Khan --- drivers/staging/usbip/userspace/libsrc/usbip_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_common.c b/drivers/staging/usbip/userspace

[PATCH] staging/usbip: Change vhci_hcd store_attach() device information message to include speed string

2014-01-22 Thread Shuah Khan
Change vhci_hcd store_attach() routine to include speed string in its device information message. The current call to dev_info() prints out speed number which is the enum number. Change to call usb_speed_string() to print speed string in addition to the number. Signed-off-by: Shuah Khan

[PATCH] staging/usbip: simplify usbip_dump_usb_device() udev->speed handling

2014-01-24 Thread Shuah Khan
Change usbip_dump_usb_device() to use usb_speed_string() and remove the code that does switch on udev->speed and builds custom speed strings. Signed-off-by: Shuah Khan --- drivers/staging/usbip/usbip_common.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) d

Re: [PATCH] staging/usbip: Add missing speeds to userspace speed_strings array

2014-01-24 Thread Shuah Khan
On 01/24/2014 10:08 AM, Thomas Pugliese wrote: On Wed, 22 Jan 2014, Shuah Khan wrote: Add speed strings for usb wireless and 3.0 to speed_strings array. Signed-off-by: Shuah Khan --- drivers/staging/usbip/userspace/libsrc/usbip_common.c | 2 ++ 1 file changed, 2 insertions(+) diff

Re: [PATCH] staging/usbip: Add missing speeds to userspace speed_strings array

2014-01-24 Thread Shuah Khan
On 01/24/2014 10:31 AM, Thomas Pugliese wrote: On Fri, 24 Jan 2014, Shuah Khan wrote: On 01/24/2014 10:08 AM, Thomas Pugliese wrote: On Wed, 22 Jan 2014, Shuah Khan wrote: Add speed strings for usb wireless and 3.0 to speed_strings array. Signed-off-by: Shuah Khan --- drivers

Re: [PATCH] staging/usbip: Change userspace to use linux include for usb_device_speed enum

2014-01-24 Thread Shuah Khan
On 01/22/2014 10:56 AM, Shuah Khan wrote: Remove usb_device_speed enum define from usbip_common.h and change it to include linux/usb/ch9.h instead. Signed-off-by: Shuah Khan --- drivers/staging/usbip/userspace/libsrc/usbip_common.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions

[PATCH v2] staging/usbip: userspace to use linux header for usb_device_speed enum, missing speeds to speed_strings array

2014-01-24 Thread Shuah Khan
Remove usb_device_speed enum define from usbip_common.h and change it to include linux/usb/ch9.h instead. Add speed strings for usb wireless and 3.0 to speed_strings array. Signed-off-by: Shuah Khan --- v2: combined the following two userspace patches and addressed comments. https://lkml.org

[PATCH 3/3] staging/usbip: change usbip userspace to include new uapi usbip.h

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. A new uapi usbip.h now defines the usbip device status for kernel and userspace to use. Change usbip userspace to include uapi usbip.h for usbip device status. Signed-off-by: Shuah Khan

[PATCH 0/3] staging/usbip: add new uapi header usbip.h

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. Adding an usbip uapi header file will define the kernel - userspace interface for this device status. Shuah Khan (3): staging/usbip: add uapi header to export usbip kernel interfaces staging

[PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. Adding an usbip uapi header file will define the kernel - userspace interface for this device status. Signed-off-by: Shuah Khan --- include/uapi/linux/Kbuild |1 + include/uapi/linux

[PATCH 2/3] staging/usbip: change usbip to include new uapi usbip.h

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. A new uapi usbip.h now defines the usbip device status for kernel and userspace to use. Change usbip kernel space to include uapi usbip.h for usbip device status. Signed-off-by: Shuah Khan

Re: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces

2014-02-28 Thread Shuah Khan
On 02/28/2014 03:15 PM, Greg KH wrote: On Thu, Feb 27, 2014 at 05:27:25PM -0700, Shuah Khan wrote: usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. Adding an usbip uapi header file will define the kernel - userspace interface for this device

[PATCH v2 3/3] staging/usbip: change usbip userspace to include new uapi usbip.h

2014-03-03 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. A new uapi usbip.h now defines the usbip device status for kernel and userspace to use. Change usbip userspace to include uapi usbip.h for usbip device status. Signed-off-by: Shuah Khan

[PATCH v2 1/3] staging/usbip: add uapi header to export usbip kernel interfaces

2014-03-03 Thread Shuah Khan
. When usbip moves to mainline drivers, this file should be moved under uapi/linux Signed-off-by: Shuah Khan --- drivers/staging/usbip/uapi/usbip.h | 26 ++ 1 file changed, 26 insertions(+) create mode 100644 drivers/staging/usbip/uapi/usbip.h diff --git a/drivers/staging

[PATCH v2 0/3] staging/usbip: add new uapi header usbip.h

2014-03-03 Thread Shuah Khan
. When usbip moves to mainline drivers, this file should be moved under uapi/linux usbip kernel and userspace are changed to use this new header file. Shuah Khan (3): staging/usbip: add uapi header to export usbip kernel interfaces staging/usbip: change usbip to include new uapi usbip.h staging

[PATCH v2 2/3] staging/usbip: change usbip to include new uapi usbip.h

2014-03-03 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. A new uapi usbip.h now defines the usbip device status for kernel and userspace to use. Change usbip kernel space to include uapi usbip.h for usbip device status. Signed-off-by: Shuah Khan

Re: [PATCH 01/12] staging: usbip: userspace: migrate usbip_bind to libudev

2014-03-06 Thread Shuah Khan
SYSFS_BUS_ID_SIZE + 4, "del %s", busid); - dbg("write \"%s\" to %s", buff, match_busid_attr->path); + dbg("write \"%s\" to %s", command, match_busid_attr_path); This messge could be removed. - rc = sysfs_write_attribute(match_busid_

Re: [PATCH 03/12] staging: usbip: userspace: migrate usbip_unbind to libudev

2014-03-06 Thread Shuah Khan
- sysfs_close_attribute(unbind_attr); - ret = 0; printf("unbind device on busid %s: complete\n", busid); Could you please change this to an info() -err_close_usbip_host_drv: - sysfs_close_driver(usbip_host_drv); +err_close_udev: + udev_device_unref(dev); + ude

Re: [PATCH 04/12] staging: usbip: userspace: migrate usbip_list to libudev

2014-03-06 Thread Shuah Khan
sysfs_close_device(intf); - } printf("\n"); - } - ret = 0; Do you need to delete this? Where does ret get set to 0 then? + udev_device_unref(dev); + } err_out: - sysfs_close_bus(ubus); + udev_enumerate_unref(enumerate)

Re: [PATCH 05/12] staging: usbip: userspace: re-add interface information listing

2014-03-06 Thread Shuah Khan
; 0) { + dbg("usbip_net_send failed: pdu_uinf"); Same comment as above. + return -1; + } + } } return 0; You have my Reviewed-by after making the recommended changes. Reviewed-by: Shuah Khan -- Shuah -- Shuah

Re: [PATCH 08/12] staging: usbip: userspace: migrate usbip_host_driver to libudev

2014-03-06 Thread Shuah Khan
,7 @@ static int recv_request_import(int sockfd) } PACK_OP_IMPORT_REQUEST(0, &req); - dlist_for_each_data(host_driver->edev_list, edev, - struct usbip_exported_device) { + list_for_each(&host_driver->edev_list, edev, node) {

Re: [PATCH 09/12] staging: usbip: userspace: remove class device infrastructure in vhci_driver

2014-03-06 Thread Shuah Khan
| 178 - .../staging/usbip/userspace/libsrc/vhci_driver.h | 4 - 2 files changed, 182 deletions(-) After these changes, is there a need for struct usbip_class_device ?? -- Shuah -- Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America

Re: [PATCH 10/12] staging: usbip: userspace: migrate vhci_driver to libudev

2014-03-06 Thread Shuah Khan
failed"); return -1; } diff --git a/drivers/staging/usbip/userspace/libsrc/vhci_driver.h b/drivers/staging/usbip/userspace/libsrc/vhci_driver.h index e72baa0..8a84fdf 100644 --- a/drivers/staging/usbip/userspace/libsrc/vhci_driver.h +++ b/drivers/staging/usbip/userspace

[PATCH] staging/usbip: userspace - fix usbipd SIGSEGV from refresh_exported_devices()

2014-03-24 Thread Shuah Khan
ff-by: Shuah Khan --- drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c index c5bf60b..92

[PATCH] staging/usbip: fix store_attach() sscanf return value check

2014-03-24 Thread Shuah Khan
. As a result, sscanf() will always fail even when the input buffer is correct. Signed-off-by: Shuah Khan --- drivers/staging/usbip/vhci_sysfs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c index

Re: [PATCH] staging/usbip: fix store_attach() sscanf return value check

2014-03-24 Thread Shuah Khan
On 03/24/2014 06:38 PM, Greg KH wrote: On Mon, Mar 24, 2014 at 05:12:09PM -0600, Shuah Khan wrote: Fix commit - 88fa1ebfa21b5deaaad2dc88ecd9f6af91796cf7 What do you mean by this line? Nothing really. Sloppiness on my part. I was keeping notes as I was chasing the problem and those ended

[PATCH v2] staging/usbip: fix store_attach() sscanf return value check

2014-03-25 Thread Shuah Khan
: Shuah Khan --- v2: Fixed changelog drivers/staging/usbip/vhci_sysfs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c index e098032..1ff24e9 100644 --- a/drivers/staging/usbip/vhci_sysfs.c +++ b/drivers

Re: [PATCH 0/3] usbip: move usbip out of staging

2014-08-07 Thread Shuah Khan
a maintainer for this code? I don't want to see it sit >> "ownerless" in the kernel tree. Will you be willing to do this? >> > > Yes. But I should be briefed about that responsibilities will this involve. > If you would like a back-up, I can volunteer to be co-m

Re: [PATCH 0/3] usbip: move usbip out of staging

2014-08-11 Thread Shuah Khan
t;> >> Also, any bug reports or questions about the code would come to you >> first, along with the rest of the linux-usb@vger developers, you aren't >> alone in this at all. >> > > Ok, this sounds good. I suppose sending you the patches involves > picking them up

[PATCH] selftests: add sleep between detach and usbip list -l

2019-05-02 Thread Shuah Khan
Add a sleep between detach and check for exportable devices to avoid the following segfault from libc-2.27.so [ 6268.136108] usbip[5565]: segfault at 0 ip 7f2a947bddfd sp 7ffd1a8705e8 error 4 in libc-2.27.so[7f2a94703000+1e7000] Signed-off-by: Shuah Khan --- tools/testing/selftests

[PATCH] usbip: usbip_host: cleanup do_rebind() return path

2019-05-02 Thread Shuah Khan
Cleanup do_rebind() return path and use common return path. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_main.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index bf8a5feb0ee9..2e4bfccd4bfc

Re: [usb:usb-linus] BUILD REGRESSION c1a145a3ed9a40f3b6145feb97789e8eb49c5566

2019-05-23 Thread Shuah Khan
e-in-stub_disconnect-different-lock-contexts-for-basic-block │   └── drivers-usb-usbip-stub_dev.c:sparse:sparse:context-imbalance-in-stub_probe-different-lock-contexts-for-basic-block └── x86_64-allyesconfig └── drivers-usb-usbip-stub_dev.c:second-lock-on-line Shuah, I just got this new rep

[PATCH] usbip: tools: usbipd: exclude exported devices from exportable device list

2018-03-21 Thread Shuah Khan
: Shuah Khan --- tools/usb/usbip/src/usbipd.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/usb/usbip/src/usbipd.c b/tools/usb/usbip/src/usbipd.c index f8ff735eb100..32864c52942d 100644 --- a/tools/usb/usbip/src/usbipd.c +++ b/tools/usb/usbip/src/usbipd.c

[PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-02 Thread Shuah Khan
vhci_hcd module can be removed even when devices are attached. Fix to prevent module removal when devices are still attached. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_sysfs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/usb

[PATCH] usbip: vhci_hcd: Fix usb device and sockfd leaks

2018-04-02 Thread Shuah Khan
vhci_hcd fails to do reset to put usb device and sockfd in the module remove/stop paths. Fix the leak. Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip

Re: [PATCH] usbip: vhci_hcd: Fix usb device and sockfd leaks

2018-04-03 Thread Shuah Khan
On 04/03/2018 12:56 AM, Greg KH wrote: > On Mon, Apr 02, 2018 at 02:52:32PM -0600, Shuah Khan wrote: >> vhci_hcd fails to do reset to put usb device and sockfd in the >> module remove/stop paths. Fix the leak. >> >> Signed-off-by: Shuah Khan > > Should this

Re: [PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-03 Thread Shuah Khan
On 04/03/2018 12:56 AM, Greg KH wrote: > On Mon, Apr 02, 2018 at 02:52:31PM -0600, Shuah Khan wrote: >> vhci_hcd module can be removed even when devices are attached. Fix to >> prevent module removal when devices are still attached. >> >> Signed-off-by: Shuah Khan &

Re: [PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-04 Thread Shuah Khan
On 04/04/2018 02:25 AM, Oliver Neukum wrote: > Am Dienstag, den 03.04.2018, 09:56 -0600 schrieb Shuah Khan: >> This is a virtual device associated to a real physical device on a different >> system. My concern is that if the module gets removed accidentally then it >> could

Re: [PATCH] usbip: vhci_hcd: Fix usb device and sockfd leaks

2018-04-05 Thread Shuah Khan
will send patch for v4.4.126 that you can apply for this fix. thanks, -- Shuah -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-05 Thread Shuah Khan
d to apply! Possible dependencies: > 0775a9cbc694 ("usbip: vhci extension: modifications to vhci driver") > 3920ad4951e2 ("usbip: vhc_hcd: prevent module being removed while device > are attached") This patch will not go into Linus's tree. Please don't p

[PATCH] usbip: usbip_host: fix to hold parent lock for device_attach() calls

2018-04-05 Thread Shuah Khan
usbip_host calls device_attach() without holding dev->parent lock. Fix it. Signed-off-by: Shuah Khan Cc: stable --- drivers/usb/usbip/stub_main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index c31c8402a

[PATCH] usbip: usbip_event: fix to not print kernel pointer address

2018-04-05 Thread Shuah Khan
Fix it to not print kernel pointer address. Remove the conditional and debug message as it isn't very useful. Signed-off-by: Shuah Khan Cc: stable --- drivers/usb/usbip/usbip_event.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/

[PATCH] usbip: vhci_hcd: check rhport before using in vhci_hub_control()

2018-04-05 Thread Shuah Khan
Validate !rhport < 0 before using it to access port_status array. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 20e3d4609583..d11f3f8dad40 100

Re: [PATCH] usbip: vhci_hcd: check rhport before using in vhci_hub_control()

2018-04-06 Thread Shuah Khan
On 04/06/2018 02:01 AM, Sergei Shtylyov wrote: > Hello! > > On 4/6/2018 1:31 AM, Shuah Khan wrote: > >> Validate !rhport < 0 before using it to access port_status array. > >    Why '!'? > I should have explained it better in the commit log. rhport is

[PATCH 2/3] usbip: usbip_host: delete device from busid_table after rebind

2018-04-11 Thread Shuah Khan
. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index d41d0cdeec0f..fb46bd62d538 100644 --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip/stub_main.c

[PATCH 1/3] usbip: usbip_host: refine probe and disconnect debug msgs to be useful

2018-04-11 Thread Shuah Khan
Refine probe and disconnect debug msgs to be useful and say what is in progress. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c index dd8ef36ab10e

[PATCH 3/3] usbip: usbip_host: run rebind from exit when module is removed

2018-04-11 Thread Shuah Khan
the devices to their original drivers. This includes cleanup changes and moving device_attach() code to a common routine to be called from rebind_store() and usbip_host_exit(). Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_dev.c | 6 + drivers/usb/usbip/stub_main.c | 60

Re: [REBASED PATCH 1/2] usbip: usbip_host: delete device from busid_table after rebind

2018-04-30 Thread Shuah Khan
On 04/30/2018 04:48 PM, Greg KH wrote: > On Mon, Apr 30, 2018 at 04:17:19PM -0600, Shuah Khan (Samsung OSG) wrote: >> Device is left in the busid_table after unbind and rebind. Rebind >> initiates usb bus scan and the original driver claims the device. >> After rescan the dev

Re: [PATCH] usbip: usbip_host: fix bad unlock balance during stub_probe()

2018-05-16 Thread Shuah Khan
On 05/15/2018 11:49 PM, Greg KH wrote: > On Tue, May 15, 2018 at 05:57:23PM -0600, Shuah Khan (Samsung OSG) wrote: >> stub_probe() calls put_busid_priv() in an error path when device isn't >> found in the busid_table. Fix it by making put_busid_priv() safe to be >&g

Re: [PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-18 Thread Shuah Khan
re() doesn't call valid_port() - can you make the change to have attach_store() call valid_port() to protect that code path. > > Thanks for the change. I'll wait for Shuah's ack/review before queueing > this up just as she knows that codebase much better than anyone else. > > thanks, -- Shuah -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-22 Thread Shuah Khan
ed) > +static int valid_args(__u32 *pdev_nr, __u32 *rhport, > + enum usb_device_speed speed) > { > if (!valid_port(pdev_nr, rhport)) { > return 0; > @@ -322,7 +330,7 @@ static ssize_t attach_store(struct device *dev, struct > device_att

Re: [PATCH] usbip: dynamically allocate idev by nports found in sysfs

2018-05-22 Thread Shuah Khan
uot;platform" > #define USBIP_VHCI_DEVICE_NAME "vhci_hcd.0" > -#define MAXNPORT 128 > > enum hub_speed { > HUB_SPEED_HIGH = 0, > @@ -41,7 +40,7 @@ struct usbip_vhci_driver { > > int ncontrollers; > int nports; > - struct usbip_imported

Re: [PATCH v2] usbip: dynamically allocate idev by nports found in sysfs

2018-05-22 Thread Shuah Khan
aca2167051 100644 > --- a/tools/usb/usbip/libsrc/vhci_driver.h > +++ b/tools/usb/usbip/libsrc/vhci_driver.h > @@ -13,7 +13,6 @@ > > #define USBIP_VHCI_BUS_TYPE "platform" > #define USBIP_VHCI_DEVICE_NAME "vhci_hcd.0" > -#define MAXNPORT 128 > > enum hub_

Re: [PATCH v3] usbip: dynamically allocate idev by nports found in sysfs

2018-05-23 Thread Shuah Khan
d. I think this patch is incomplete and more changes are needed to the code that references the idev array. I can't take this patch. thanks, -- Shuah -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org Mo

Re: [PATCH] usbip: tools: Install all headers needed for libusbip development

2017-10-02 Thread Shuah Khan
common.h vhci_driver.h usbip_host_driver.h \ > + list.h sysfs_utils.h usbip_host_common.h) > > dist_man_MANS := $(addprefix doc/, usbip.8 usbipd.8) > Looks good to me. Acked-by: Shuah Khan Thanks for catching this. signature.asc Description: OpenPGP digital signature

Re: [PATCH 02/24] USB: usbip: Remove redundant license text

2017-11-06 Thread Shuah Khan
remove the 700+ different ways that files in > the kernel describe the GPL license text. And there's unneeded stuff > like the address (sometimes incorrect) for the FSF which is never > needed. > > No copyright headers or other non-license-description text was removed. > &

Re: [PATCH 1/2] usbip: fix off-by-one frame number calculation

2017-11-07 Thread Shuah Khan
0x7ff rather than >> before it. >> >> Signed-off-by: Arnd Bergmann > > Looks good to me: > Reviewed-by: Krzysztof Opasiak > Acked-by: Shuah Khan thanks, -- Shuah -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] usbip: use monotonic timestamps

2017-11-07 Thread Shuah Khan
exact rate >> when correcting for NTP. I picked monotonic time since it doesn't >> change the speed to the existing code and should be better >> synchronized with other machines we talk to. >> >> Signed-off-by: Arnd Bergmann > > Looks good to me: > Re

Re: usbip port number limits

2017-11-14 Thread Shuah Khan
iled a bug at > bugzilla with the specific device and kernel versions: > https://bugzilla.kernel.org/show_bug.cgi?id=197867 Will you be able to send me complete dmesg for this. I see excerpts but not the full dmesg. Also, will you be able to revert the usb3 commit 1c9de5bf428612458427943b7

Re: usbip port number limits

2017-11-14 Thread Shuah Khan
On 11/14/2017 01:36 PM, Shuah Khan wrote: > On 11/14/2017 09:25 AM, Juan Zea wrote: >> Hi, >> >>I've been working on the issue. This is what I found about >> multi-controller setup: >> >> The problem comes from the usbip tool trying to conne

Re: usbip port number limits

2017-11-15 Thread Shuah Khan
Hi Juan, On 11/15/2017 07:43 AM, Juan Zea wrote: > >>> Also, will you be able to revert the usb3 commit >>> 1c9de5bf428612458427943b724bea51abde520a >>> >>> and see if any of the problems go away. >>> >>> thanks, >>> -- Sh

Re: usbip port number limits

2017-11-15 Thread Shuah Khan
3 devices connecting to usb2 ports, and not the other >> way round. >> > > Ok, that sounds right, but then... why having usb2 ports at all? Isn't it a > nuisance to maintain code that duplicates the hubs if usb3 ports can do the > job?> Some systems have both usb2 and usb3 ports. You can't get rid of usb2 or usb support. More specifically LOW_SPEED, and HIGH_SPEED support can't be removed. usb2 devices work in usb3 port due to backwards protocol compatibility. You will see xhci, ehci drivers in the for this very same reason. thanks, -- Shuah -- 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 http://vger.kernel.org/majordomo-info.html

Re: usbip port number limits

2017-11-21 Thread Shuah Khan
On 11/21/2017 04:24 AM, Juan Zea wrote: >> - Mensaje original - >> De: "Yuyang Du" >> Para: "Shuah Khan" >> CC: "Juan Zea" , sh...@kernel.org, "Bjørn Mork" >> , linux-usb@vger.kernel.org, "Valentina Manea"

Re: usbip port number limits

2017-11-28 Thread Shuah Khan
in case we're >> missing something). >> >>The fingerprint reader, usb stick and wacom tablet work :) > > Good to hear that. > >> I've also checked the same patch can be applied to kernel master and it >> works. So... is that the solution? > >

Re: usbip port number limits

2017-11-28 Thread Shuah Khan
On 11/28/2017 11:32 AM, Shuah Khan wrote: > On 11/26/2017 06:33 PM, Yuyang Du wrote: >> Hi Juan, >> >> On Fri, Nov 24, 2017 at 12:42:22PM +0100, Juan Zea wrote: >>>The patch doesn't apply cleanly with the patch command, but given it is >>> that si

[PATCH] usbip: fix usbip attach to find a port that matches the requested speed

2017-11-29 Thread Shuah Khan
. Reported-by: Juan Zea Signed-off-by: Shuah Khan --- tools/usb/usbip/libsrc/vhci_driver.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/tools/usb/usbip/libsrc/vhci_driver.c index 5727dfb15a83..8a1cd1616de4 100644 --- a/tools

Re: usbip port number limits

2017-11-29 Thread Shuah Khan
On 11/29/2017 07:25 PM, Yuyang Du wrote: > Hi Shuah, > > On Tue, Nov 28, 2017 at 05:09:18PM -0700, Shuah Khan wrote: >> On 11/28/2017 11:32 AM, Shuah Khan wrote: >>> On 11/26/2017 06:33 PM, Yuyang Du wrote: >>>> Hi Juan, >>>> >>>&

Re: [PATCH] usbip: fix usbip attach to find a port that matches the requested speed

2017-11-30 Thread Shuah Khan
On 11/30/2017 01:20 AM, Greg KH wrote: > On Wed, Nov 29, 2017 at 03:24:22PM -0700, Shuah Khan wrote: >> usbip attach fails to find a free port when the device on the first port >> is a USB_SPEED_SUPER device and non-super speed device is being attached. >> It keeps checki

Re: [PATCH] usbip: Fix USB device hang due to wrong enabling of scatter-gather

2017-11-30 Thread Shuah Khan
vhci = *((void **)dev_get_platdata(hcd->self.controller)); > - hcd->self.sg_tablesize = ~0; > if (usb_hcd_is_primary_hcd(hcd)) { > vhci->vhci_hcd_hs = hcd_to_vhci_hcd(hcd); > vhci->vhci_hcd_hs->vhci = vhci; > This need to go into stable as well

Re: [PATCH 1/2] usbip: Delete an error message for a failed memory allocation in two functions

2017-12-05 Thread Shuah Khan
v->dev, "allocate setup_packet\n"); If Coccinelle found this as an extra message, there is something wrong with the Coccinelle script. This is not an extra message. This message is for the second kmemdup() failure and is necessary. > usbip_event_add(ud, SDEV_EVENT_ER

Re: [PATCH 2/2] usbip: Use common error handling code in stub_recv_cmd_submit()

2017-12-05 Thread Shuah Khan
_submit(struct stub_device > *sdev, > } > > usbip_dbg_stub_rx("Leave\n"); > + return; > + > +add_event_malloc_failure: > + usbip_event_add(ud, SDEV_EVENT_ERROR_MALLOC); > } > > /* recv a pdu */ > I am restructuring this ro

Re: [PATCH] tools/usbip: fixes build with musl libc toolchain

2017-12-06 Thread Shuah Khan
ed only once > for each function it appears in > Makefile:407: recipe for target 'usbipd.o' failed > make[3]: *** [usbipd.o] Error 1 > > Signed-off-by: Julien BOIBESSOT > --- Thanks for the patch. Greg, Please pick this up. Acked-by: Shuah Khan thanks, -- Sh

Re: [PATCH] tools/usbip: fixes potential (minor) "buffer overflow" (detected on recent gcc with -Werror)

2017-12-07 Thread Shuah Khan
es the buffer overflow, we might have a bigger problem. That said, this patch looks good to fix the warming. Greg, Could you please pick this patch up. Acked-by: Shuah Khan thanks, -- Shuah -- 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 http://vger.kernel.org/majordomo-info.html

[PATCH 3/4] usbip: prevent vhci_hcd driver from leaking a socket pointer address

2017-12-07 Thread Shuah Khan
ot used at the moment and it was made visible as a convenient way to find IP address from socket pointer address by looking up /proc/net/{tcp,tcp6}. As this opens a security hole, the fix replaces socket pointer address with sockfd. Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_common.

[PATCH 4/4] usbip: fix stub_send_ret_submit() vulnerability to null transfer_buffer

2017-12-07 Thread Shuah Khan
stub_send_ret_submit() handles urb with a potential null transfer_buffer, when it replays a packet with potential malicious data that could contain a null buffer. Add a check for the condition when actual_length > 0 and transfer_buffer is null. Signed-off-by: Shuah Khan --- drivers/usb/us

[PATCH 2/4] usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input

2017-12-07 Thread Shuah Khan
-by: Shuah Khan --- drivers/usb/usbip/stub_rx.c | 35 +++ 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c index 4d61063c259d..493ac2928391 100644 --- a/drivers/usb/usbip/stub_rx.c +++ b/drivers

[PATCH 0/4] USB over IP Secuurity fixes

2017-12-07 Thread Shuah Khan
Jakub Jirasek from Secunia Research at Flexera reported security vulnerabilities in the USB over IP driver. This patch series all the 4 reported problems. Jakub, could you please suggest an email address I can use for the Reported-by tag? Shuah Khan (4): usbip: fix stub_rx: get_pipe() to

<    1   2   3   4   >