Re: usbip port number limits

2017-11-29 Thread Yuyang Du
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, > >> > >> On Fri, Nov 24, 2017 at 12:42:22PM +0100, Juan Zea wrote: > >>>

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

2017-11-29 Thread Yuyang Du
re up to work") Reported-by: Juan Zea <juan@qindel.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 713e941..6b3278c 100644 -

Re: usbip port number limits

2017-11-26 Thread Yuyang Du
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 simple I've changed it myself (I'm telling you just in case we're > missing something). > >The fingerprint reader, usb stick and wacom

Re: usbip port number limits

2017-11-23 Thread Yuyang Du
On Wed, Nov 22, 2017 at 09:38:27AM +0100, Juan Zea wrote: > I don't come up with any more detail... anything I'm missing? Hi Juan, Thank you so much for your patience. Really appreciate it. I came up with the following patch, with which at my side the BUG doesn't happen again with both a (low

Re: usbip port number limits

2017-11-22 Thread Yuyang Du
On Tue, Nov 21, 2017 at 07:33:41AM -0700, Shuah Khan wrote: > I have been debugging on 4.12 and this bad commit. Low speed devices can be > attached, but you see the following and then shutdown hangs. Oh, just tested a high speed USB stick, I got the message. I'm working on it. -- To unsubscribe

Re: usbip port number limits

2017-11-21 Thread Yuyang Du
Hi Juan, On Tue, Nov 21, 2017 at 12:24:01PM +0100, Juan Zea wrote: > Please excuse me... I have reported two different problems in this post, > and I think things are mixing up a bit. My bad. I've found two different > problems: > > 1.- When compiling vhci driver with multiple hubs (in

Re: usbip port number limits

2017-11-21 Thread Yuyang Du
Hi Shuah, On Tue, Nov 21, 2017 at 07:33:41AM -0700, Shuah Khan wrote: > > Thanks for finding the problem. usb2 devices don't work at all with the > offending commit: 03cd00d538a6feb0492cd153edf256ef7d7bd95e > > I have been debugging on 4.12 and this bad commit. Low speed devices can be >

Re: usbip port number limits

2017-11-20 Thread Yuyang Du
> > That led me to bisecting the problem with the fingerprint reader, and the > > culprit is here: > > > > 03cd00d538a6feb0492cd153edf256ef7d7bd95e is the first bad commit > > commit 03cd00d538a6feb0492cd153edf256ef7d7bd95e > > Author: Yuyang Du <yuyang...@intel.com> > >

Re: usbip port number limits

2017-11-14 Thread Yuyang Du
On Tue, Nov 14, 2017 at 04:17:33PM -0700, Shuah Khan wrote: > On 11/14/2017 01:36 PM, Shuah Khan wrote: > Hi Yuyang Du, > > I am looking at the USB3 support patch and not finding where > USB_SPEED_LOW is handled. Any reason why dropping support for > that? > Hi Shuah, It

[PATCH] usbip: Fix uninitialized variable bug in vhci

2017-06-27 Thread Yuyang Du
The patch 03cd00d538a6: "usbip: vhci-hcd: Set the vhci structure up to work" introduced a bug which uses a vairable without initialization in error handling code. Fix it. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Yuyang Du <yuyang...@intel.com>

Re: [bug report] usbip: vhci-hcd: Set the vhci structure up to work

2017-06-26 Thread Yuyang Du
Sorry. CC related people. On Mon, Jun 26, 2017 at 12:04:54PM +0800, Yuyang Du wrote: > Hi Dan, > > Thanks for the report. A patch to fix the bug follows: > > diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c > index 64c3860..2c4b2fd 100644 > --

Re: [bug report] usbip: vhci-hcd: Set the vhci structure up to work

2017-06-25 Thread Yuyang Du
ret; Thanks, Yuyang On Fri, Jun 23, 2017 at 01:46:01PM +0300, Dan Carpenter wrote: > Hello Yuyang Du, > > The patch 03cd00d538a6: "usbip: vhci-hcd: Set the vhci structure up > to work" from Jun 8, 2017, leads to the following static checker > warning: > >

Re: [PATCH v5 1/4] usb: usbip tool: Check the return of get_nports()

2017-06-07 Thread Yuyang Du
On Tue, Jun 06, 2017 at 09:36:50AM -0600, Shuah Khan wrote: > On 05/22/2017 04:20 AM, Yuyang Du wrote: > > From: Yuyang Du <yuyang...@intel.com> > > > > If we get nonpositive number of ports, there is no sense to > > continue, then fail gracefully.

[PATCH v3 7/9] usbip: Add USB_SPEED_SUPER as valid arg

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> With this patch, USB_SPEED_SUPER is a valid speed when attaching a USB3 SuperSpeed device. Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.samsung.com> --- drivers/usb/usbip/vhci_sysfs.c | 1 + 1 file ch

[PATCH v3 5/9] usbip: vhci-hcd: Set the vhci structure up to work

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> This patch enables the new vhci structure. Its lock protects both the USB2 hub and the shared USB3 hub. Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.samsung.com> --- drivers/usb/usbip/vhci.h |

[PATCH v3 8/9] usbip: vhci-hcd: Add USB3 port status bits

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> As USB3 has (slightly) different bit meanings in the port status. Add a new status bit array for USB3. Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.samsung.com> --- drivers/usb/usb

[PATCH v3 4/9] usbip: vhci-hcd: Rework vhci_hcd_init

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> A vhci struct is added as the platform-specific data to the vhci platform device, in order to get the vhci by its platform device. This is done in vhci_hcd_init(). Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@

[PATCH v3 9/9] usbip: vhci-hcd: Clean up the code by adding a new macro

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> Each vhci has 2*VHCI_HC_PORTS ports, in which VHCI_HC_PORTS ports are HighSpeed (or below), and VHCI_HC_PORTS are SuperSpeed. This new macro VHCI_PORTS reflects this configuration. Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shua

[PATCH v3 3/9] usbip: vhci-hcd: Move VHCI platform device into vhci struct

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> Every VHCI is a platform device, so move the platform_device struct into the VHCI struct. Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.samsung.com> --- drivers/usb/usbip/vhci.h | 3 ++- drivers/us

[PATCH v3 6/9] usbip: vhci-hcd: Add USB3 SuperSpeed support

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> This patch adds a USB3 HCD to an existing USB2 HCD and provides the support of SuperSpeed, in case the device can only be enumerated with SuperSpeed. The bulk of the added code in usb3_bos_desc and hub_control to support SuperSpeed is borrowe

[PATCH v3 1/9] usbip: vhci-hcd: Rename function names to reflect their struct names

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> These helper function names are renamed to have their full struct names to avoid confusion: - hcd_to_vhci() -> hcd_to_vhci_hcd() - vhci_to_hcd() -> vhci_hcd_to_hcd() - vdev_to_vhci() -> vdev_to_vhci_hcd() Signed-off-by: Yuyang Du <y

[PATCH v3 0/9] usbip: Enable USB3 SuperSpeed

2017-06-07 Thread Yuyang Du
ed-bys v2: - Remove set_link_state() since it is not used Regards, Yuyang -- Yuyang Du (9): usbip: vhci-hcd: Rename function names to reflect their struct names usbip: vhci-hcd: Add vhci struct usbip: vhci-hcd: Move VHCI platform device into vhci struct usbip: vhci-hcd: Rework vhci_hcd_in

[PATCH v3 2/9] usbip: vhci-hcd: Add vhci struct

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> In order to support SuperSpeed devices, a USB3 HCD is added to share the USB2 HCD. As a result, a VHCI is composed of two vhci_hcds associated with the two HCDs respectively. So we add another level of abstraction, vhci, and thus this vhci structure.

[PATCH v6 0/4] usb: usbip: Fix ports and port status

2017-06-07 Thread Yuyang Du
vhci_hcd* dir in platform to learn how many we have as suggested by Krzysztof - Minor coding changes Thanks, Yuyang -- Yuyang Du (4): usb: usbip tool: Check the return of get_nports() usb: usbip tool: Add ncontrollers in vhci_driver structure usb: usbip tool: Fix refresh_imported_device_list() u

[PATCH v6 1/4] usb: usbip tool: Check the return of get_nports()

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> If we get nonpositive number of ports, there is no sense to continue, then fail gracefully. In addition, the commit 0775a9cbc694e8c72 ("usbip: vhci extension: modifications to vhci driver") introduced configurable numbers of controllers a

[PATCH v6 2/4] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-and-reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuya

[PATCH v6 4/4] usb: usbip tool: Fix parse_status()

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> In parse_status(), all nports number of idev's are initiated to 0 by memset(), it is simply wrong, because parse_status() reads the status sys file one by one, therefore, it can only update the according vhci_driver->idev's for it to parse.

[PATCH v6 3/4] usb: usbip tool: Fix refresh_imported_device_list()

2017-06-07 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Reviewed-by: Krzysztof Opasiak <k.

[PATCH v5 0/4] usb: usbip: Fix ports and port status

2017-05-22 Thread Yuyang Du
rn how many we have as suggested by Krzysztof - Minor coding changes Thanks, Yuyang -- Yuyang Du (4): usb: usbip tool: Check the return of get_nports() usb: usbip tool: Add ncontrollers in vhci_driver structure usb: usbip tool: Fix refresh_imported_device_list() usb: usbip tool: Fi

[PATCH v5 2/4] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-05-22 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-and-reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuya

[PATCH v5 1/4] usb: usbip tool: Check the return of get_nports()

2017-05-22 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> If we get nonpositive number of ports, there is no sense to continue, then fail gracefully. In addition, the commit 0775a9cbc694e8c72 ("usbip: vhci extension: modifications to vhci driver") introduced configurable numbers of controllers a

[PATCH v5 3/4] usb: usbip tool: Fix refresh_imported_device_list()

2017-05-22 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Reviewed-by: Krzysztof Opasiak <k.

[PATCH v5 4/4] usb: usbip tool: Fix parse_status()

2017-05-22 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> In parse_status(), all nports number of idev's are initiated to 0 by memset(), it is simply wrong, because parse_status() reads the status sys file one by one, therefore, it can only update the according vhci_driver->idev's for it to parse.

Re: [PATCH v2 0/9] usbip: Enable USB3 SuperSpeed

2017-05-22 Thread Yuyang Du
Hi Shuah, On Fri, May 19, 2017 at 04:55:40PM -0600, Shuah Khan wrote: > > > > v2: > > - Remove set_link_state() since it is not used > > > > Regards, > > Yuyang > > Hi Yuyang, > > Thanks for the patch series. I will try to review this next week > on my business trip. If not, I will

Re: [PATCH v4 1/4] usb: usbip tool: Check the return of get_nports()

2017-05-22 Thread Yuyang Du
On Mon, May 22, 2017 at 12:13:12PM +0300, Sergei Shtylyov wrote: > >+if (vhci_driver->nports <= 0) { > >+err("no available ports"); > >+goto err; > >+} > >+else if (vhci_driver->nports > MAXNPORT) { > > } and *else if* should be on te same line. Not sure

[PATCH v4 4/4] usb: usbip tool: Fix parse_status()

2017-05-22 Thread Yuyang Du
ng.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 38 ++-- tools/usb/usbip/src/usbip_attach.c | 2 ++ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/

[PATCH v4 1/4] usb: usbip tool: Check the return of get_nports()

2017-05-22 Thread Yuyang Du
er maximum, MAXNPORT. If exceeded, the idev array will be overflown. We fix it by validating the nports to make sure the port number max is not exceeded. Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.sa

[PATCH v4 3/4] usb: usbip tool: Fix refresh_imported_device_list()

2017-05-22 Thread Yuyang Du
The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Y

[PATCH v4 0/4] usb: usbip: Fix ports and port status

2017-05-22 Thread Yuyang Du
From: Yuyang Du <yuyang...@linux.intel.com> The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced several bugs relating to the number of ports amd the port status. In addition, a small improvement is made to the vhci_hcd module. v4: - Fi

[PATCH v4 2/4] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-05-22 Thread Yuyang Du
A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-and-reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/

Re: [PATCH resend v3 1/4] usb: usbip tool: Check the return of get_nports()

2017-05-19 Thread Yuyang Du
On Thu, May 18, 2017 at 03:53:04PM +0300, Sergei Shtylyov wrote: > >+if (vhci_driver->nports <=0) { > >Please add a space after <= too. Indeed. Thanks. Hi Greg, Do you want me to send another version to fix this? Thanks, Yuyang -- To unsubscribe from this list: send the line

Re: [PATCH resend v3 1/4] usb: usbip tool: Check the return of get_nports()

2017-05-18 Thread Yuyang Du
On Thu, May 18, 2017 at 03:53:04PM +0300, Sergei Shtylyov wrote: > >From: Yuyang Du <yuyang...@intel.com> > > > >If we get nonpositive number of ports, there is no sense to > >Negative? Negative and zero. -- To unsubscribe from this list: send the line "

[PATCH v2 8/9] usbip: vhci-hcd: Add USB3 port status bits

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> As USB3 has (slightly) different bit meanings in the port status. Add a new status bit array for USB3. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c | 56 +++- 1 file

[PATCH v2 2/9] usbip: vhci-hcd: Add vhci struct

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> In order to support SuperSpeed devices, a USB3 HCD is added to share the USB2 HCD. As a result, a VHCI is composed of two vhci_hcds associated with the two HCDs respectively. So we add another level of abstraction, vhci, and thus this vhci structure.

[PATCH v2 9/9] usbip: vhci-hcd: Clean up the code by adding a new macro

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> Each vhci has 2*VHCI_HC_PORTS ports, in which VHCI_HC_PORTS ports are HighSpeed (or below), and VHCI_HC_PORTS are SuperSpeed. This new macro VHCI_PORTS reflects this configuration. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/

[PATCH v2 1/9] usbip: vhci-hcd: Rename function names to reflect their struct names

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> These helper function names are renamed to have their full struct names to avoid confusion: - hcd_to_vhci() -> hcd_to_vhci_hcd() - vhci_to_hcd() -> vhci_hcd_to_hcd() - vdev_to_vhci() -> vdev_to_vhci_hcd() Signed-off-by: Yuyang Du <y

[PATCH v2 3/9] usbip: vhci-hcd: Move VHCI platform device into vhci struct

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> Every VHCI is a platform device, so move the platform_device struct into the VHCI struct. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci.h | 3 ++- drivers/usb/usbip/vhci_hcd.c | 17 - drive

[PATCH v2 4/9] usbip: vhci-hcd: Rework vhci_hcd_init

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> A vhci struct is added as the platform-specific data to the vhci platform device, in order to get the vhci by its platform device. This is done in vhci_hcd_init(). Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c

[PATCH v2 0/9] usbip: Enable USB3 SuperSpeed

2017-05-18 Thread Yuyang Du
- Remove set_link_state() since it is not used Regards, Yuyang -- Yuyang Du (9): usbip: vhci-hcd: Rename function names to reflect their struct names usbip: vhci-hcd: Add vhci struct usbip: vhci-hcd: Move VHCI platform device into vhci struct usbip: vhci-hcd: Rework vhci_hcd_init usbip: vhc

[PATCH v2 7/9] usbip: Add USB_SPEED_SUPER as valid arg

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> With this patch, USB_SPEED_SUPER is a valid speed when attaching a USB3 SuperSpeed device. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_sysfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/usbip/vh

[PATCH v2 5/9] usbip: vhci-hcd: Set the vhci structure up to work

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> This patch enables the new vhci structure. Its lock protects both the USB2 hub and the shared USB3 hub. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci.h | 2 - drivers/usb/usbip/vhci_h

[PATCH v2 6/9] usbip: vhci-hcd: Add USB3 SuperSpeed support

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> This patch adds a USB3 HCD to an existing USB2 HCD and provides the support of SuperSpeed, in case the device can only be enumerated with SuperSpeed. The bulk of the added code in usb3_bos_desc and hub_control to support SuperSpeed is borrowe

[PATCH resend v3 1/4] usb: usbip tool: Check the return of get_nports()

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> If we get nonpositive number of ports, there is no sense to continue, then fail gracefully. In addition, the commit 0775a9cbc694e8c72 ("usbip: vhci extension: modifications to vhci driver") introduced configurable numbers of controllers a

[PATCH resend v3 4/4] usb: usbip tool: Fix parse_status()

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> In parse_status(), all nports number of idev's are initiated to 0 by memset(), it is simply wrong, because parse_status() reads the status sys file one by one, therefore, it can only update the according vhci_driver->idev's for it to parse.

[PATCH resend v3 0/4] usb: usbip: Fix ports and port status

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced several bugs relating to the number of ports amd the port status. In addition, a small improvement is made to the vhci_hcd module. resend: - Remov

[PATCH resend v3 2/4] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-and-reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuya

[PATCH resend v3 3/4] usb: usbip tool: Fix refresh_imported_device_list()

2017-05-18 Thread Yuyang Du
From: Yuyang Du <yuyang...@intel.com> The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Reviewed-by: Krzysztof Opasiak <k.

Re: [PATCH 2/9] usbip: vhci-hcd: Add vhci struct

2017-04-14 Thread Yuyang Du
On Fri, Apr 14, 2017 at 11:29:14AM +0200, Oliver Neukum wrote: > > > what is the motivation for this change? That is the way XHCI > > > does it. But why do that when you export something over > > > a network? Are you ever going to use both VHCIs? > > > > I, a usbip client, could use a LowSpeed

Re: [PATCH 2/9] usbip: vhci-hcd: Add vhci struct

2017-04-14 Thread Yuyang Du
Hi Oliver, > what is the motivation for this change? That is the way XHCI > does it. But why do that when you export something over > a network? Are you ever going to use both VHCIs? I, a usbip client, could use a LowSpeed device and a SuperSpeed device from usbip host/hosts at the same time.

[PATCH 9/9] usbip: vhci-hcd: Clean up the code by adding a new macro

2017-04-12 Thread Yuyang Du
Each vhci has 2*VHCI_HC_PORTS ports, in which VHCI_HC_PORTS ports are HighSpeed (or below), and VHCI_HC_PORTS are SuperSpeed. This new macro VHCI_PORTS reflects this configuration. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci.h | 5 - drivers/usb

[PATCH 8/9] usbip: vhci-hcd: Add USB3 port status bits

2017-04-12 Thread Yuyang Du
As USB3 has (slightly) different bit meanings in the port status. Add a new status bit array for USB3. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c | 56 +++- 1 file changed, 50 insertions(+), 6 deletions(-) diff

[PATCH 0/9] usbip: Enable USB3 SuperSpeed

2017-04-12 Thread Yuyang Du
ds, Yuyang -- Yuyang Du (9): usbip: vhci-hcd: Rename function names to reflect their struct names usbip: vhci-hcd: Add vhci struct usbip: vhci-hcd: Move VHCI platform device into vhci struct usbip: vhci-hcd: Rework vhci_hcd_init usbip: vhci-hcd: Set the vhci structure up to work usbip: vhci-hcd

[PATCH 6/9] usbip: vhci-hcd: Add USB3 SuperSpeed support

2017-04-12 Thread Yuyang Du
adget: dummy_hcd: add SuperSpeed support"). With this patch, each vhci will have VHCI_HC_PORTS HighSpeed ports and VHCI_HC_PORTS SuperSpeed ports. Suggested-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci.h

[PATCH 7/9] usbip: Add USB_SPEED_SUPER as valid arg

2017-04-12 Thread Yuyang Du
With this patch, USB_SPEED_SUPER is a valid speed when attaching a USB3 SuperSpeed device. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_sysfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c

[PATCH 5/9] usbip: vhci-hcd: Set the vhci structure up to work

2017-04-12 Thread Yuyang Du
This patch enables the new vhci structure. Its lock protects both the USB2 hub and the shared USB3 hub. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci.h | 2 - drivers/usb/usbip/vhci_hcd.c | 206 - drivers/usb

[PATCH 1/9] usbip: vhci-hcd: Rename function names to reflect their struct names

2017-04-12 Thread Yuyang Du
These helper function names are renamed to have their full struct names to avoid confusion: - hcd_to_vhci() -> hcd_to_vhci_hcd() - vhci_to_hcd() -> vhci_hcd_to_hcd() - vdev_to_vhci() -> vdev_to_vhci_hcd() Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vh

[PATCH 2/9] usbip: vhci-hcd: Add vhci struct

2017-04-12 Thread Yuyang Du
In order to support SuperSpeed devices, a USB3 HCD is added to share the USB2 HCD. As a result, a "VHCI" is composed of two vhci_hcds associated with the two HCDs respectively. So we add another level of abstraction, vhci, and thus this vhci structure. Signed-off-by: Yuyang

[PATCH 3/9] usbip: vhci-hcd: Move VHCI platform device into vhci struct

2017-04-12 Thread Yuyang Du
Every VHCI is a platform device, so move the platform_device struct into the VHCI struct. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci.h | 3 ++- drivers/usb/usbip/vhci_hcd.c | 17 - drivers/usb/usbip/vhci_sysfs.c | 6 +++--- 3 files c

[PATCH 4/9] usbip: vhci-hcd: Rework vhci_hcd_init

2017-04-12 Thread Yuyang Du
A vhci struct is added as the platform-specific data to the vhci platform device, in order to get the vhci by its platform device. This is done in vhci_hcd_init(). Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c

Re: [PATCH v3 3/6] usb: usbip tool: Check the return of get_nports()

2017-04-11 Thread Yuyang Du
On Tue, Apr 11, 2017 at 08:51:13AM -0600, Shuah Khan wrote: > > Please bear with me. I was out sick most of last week. till catching Hope you are all well now :) > Could you please pick this up. > > Acked-by: Shuah Khan Thanks, Shuah. Yuyang -- To unsubscribe from

Re: [PATCH v3 3/6] usb: usbip tool: Check the return of get_nports()

2017-04-11 Thread Yuyang Du
Hi Greg, On Tue, Apr 11, 2017 at 04:13:50PM +0200, Greg KH wrote: > > Please send patches out, no need to wait, I'll just wait to apply them > for the review, you can always build on top of previous series. Got it. Thank you. Yuyang -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH v3 3/6] usb: usbip tool: Check the return of get_nports()

2017-04-11 Thread Yuyang Du
Hi Shuah, Could you please take a look at these patches? I got more patches that sit on these to send out. Thanks, Yuyang On Thu, Apr 06, 2017 at 06:03:24AM +0800, Yuyang Du wrote: > If we get nonpositive number of ports, there is no sense to > continue, then fail gracefully. > >

Re: [PATCH v3 3/6] usb: usbip tool: Check the return of get_nports()

2017-04-09 Thread Yuyang Du
On Fri, Apr 07, 2017 at 03:41:37PM +0200, Krzysztof Opasiak wrote: > > > On 04/06/2017 12:03 AM, Yuyang Du wrote: > >If we get nonpositive number of ports, there is no sense to > >continue, then fail gracefully. > > > >In addition, the commit 0775a9cb

[PATCH v3 0/6] usb: usbip: Fix ports and port status

2017-04-06 Thread Yuyang Du
the return of ncontrollers - Add a few Reviewed-bys and Acked-bys - Minor coding changes v2: - Remove ncontrollers RO attr as suggested by Krzysztof - As a result, scandir vhci_hcd* dir in platform to learn how many we have as suggested by Krzysztof - Minor coding changes Thanks, Yuyang -- Yuyang Du

[PATCH v3 3/6] usb: usbip tool: Check the return of get_nports()

2017-04-06 Thread Yuyang Du
er maximum, MAXNPORT. If exceeded, the idev array will be overflown. We fix it by validating the nports to make sure the port number max is not exceeded. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 10 +- 1 file changed, 9 insertions(+), 1 deletio

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

2017-04-06 Thread Yuyang Du
e, 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 <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.samsung.com> --- tools/usb/usb

[PATCH v3 4/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-06 Thread Yuyang Du
A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_d

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

2017-04-06 Thread Yuyang Du
vhci_tx_urb() should be able to get the vhci_device from its caller vhci_urb_enqueue(), instead of brutal-force searching it. Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> Acked-by: Shuah Khan <shua...@osg.samsung.com> ---

[PATCH v3 5/6] usb: usbip tool: Fix refresh_imported_device_list()

2017-04-06 Thread Yuyang Du
The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Y

[PATCH v3 6/6] usb: usbip tool: Fix parse_status()

2017-04-06 Thread Yuyang Du
ng.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 38 ++-- tools/usb/usbip/src/usbip_attach.c | 2 ++ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/

Re: [PATCH v2 3/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-05 Thread Yuyang Du
On Wed, Apr 05, 2017 at 11:46:06AM +0200, Krzysztof Opasiak wrote: > > > On 04/04/2017 09:08 PM, Yuyang Du wrote: > >Hi Krzysztof, > > > >On Tue, Apr 04, 2017 at 04:52:32PM +0200, Krzysztof Opasiak wrote: > >> > >> > >>On 03/31/2017 02

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

2017-04-04 Thread Yuyang Du
Hi Khan, On Tue, Apr 04, 2017 at 11:14:33AM -0600, Shuah Khan wrote: > On 03/30/2017 06:28 PM, Yuyang Du wrote: > > The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications > > to vhci driver") introduced multiple controllers, but the status > > of th

Re: [PATCH v2 3/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-04-04 Thread Yuyang Du
Hi Krzysztof, On Tue, Apr 04, 2017 at 04:52:32PM +0200, Krzysztof Opasiak wrote: > > > On 03/31/2017 02:28 AM, Yuyang Du wrote: > >A new field ncontrollers is added to the vhci_driver structure. > >And this field is stored by scanning the vhci_hcd* dirs in the > >plat

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

2017-03-31 Thread Yuyang Du
Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/tools/usb/usbip/libsrc/vhci_driver.c index f596ef4..d34a482 100644 --- a/tools/usb/usbip/libsrc/vhci_driver.c

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

2017-03-31 Thread Yuyang Du
parse_status() reads the status file one by one, so it can only update the available and according vhci_driver->idev's. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 36 +++- tools/usb/usbip/src/usbip_attach

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

2017-03-31 Thread Yuyang Du
vhci_tx_urb() should be able to get the vhci_device from its caller vhci_urb_enqueue(), instead of brutal-force searching it. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c | 32 ++-- 1 file changed, 2 insertions(+), 30 del

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

2017-03-31 Thread Yuyang Du
The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vh

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

2017-03-31 Thread Yuyang Du
e, 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 <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 28 +

[PATCH v2 0/6] usb: usbip: Fix ports and port status

2017-03-31 Thread Yuyang Du
Krzysztof - As a result, scandir vhci_hcd* dir in platform to learn how many we have as suggested by Krzysztof - Minor coding changes Thanks, Yuyang -- Yuyang Du (6): usb: usbip: Remove unnecessary get_vdev() usb: usbip tool: Fix get_nports() usb: usbip tool: Add ncontrollers in vhci_driver struc

[PATCH v2 3/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-03-31 Thread Yuyang Du
A new field ncontrollers is added to the vhci_driver structure. And this field is stored by scanning the vhci_hcd* dirs in the platform udev. Suggested-by: Krzysztof Opasiak <k.opas...@samsung.com> Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_d

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

2017-03-31 Thread Yuyang Du
Hi Krzysztof, On Mon, Mar 27, 2017 at 04:31:42PM +0200, Krzysztof Opasiak wrote: > > > On 03/27/2017 07:25 AM, Yuyang Du wrote: > >On Mon, Mar 27, 2017 at 09:07:50AM +0200, Krzysztof Opasiak wrote: > >> > >>As now we have multiple controllers I would be mo

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

2017-03-27 Thread Yuyang Du
On Mon, Mar 27, 2017 at 09:07:50AM +0200, Krzysztof Opasiak wrote: > > As now we have multiple controllers I would be more than happy if we > could fix functions like this one to take a controller as a > parameter and invoke commands on it instead hardcoding loops like > this one with some

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

2017-03-27 Thread Yuyang Du
On Mon, Mar 27, 2017 at 08:56:44AM +0200, Krzysztof Opasiak wrote: > + Shuah Khan Sorry for not having sent to Shuah. > On 03/23/2017 03:46 AM, Yuyang Du wrote: ... > As strtoul() returns long and get_nports() should return int I'd > prefer to do here some explicit cast to int t

Re: [PATCH 3/6] usb: usbip: Export the number of VHCI controllers in a sysfs file

2017-03-27 Thread Yuyang Du
On Mon, Mar 27, 2017 at 09:00:06AM +0200, Krzysztof Opasiak wrote: > >+static ssize_t ncontrollers_show(struct device *dev, struct > >device_attribute *attr, > >+ char *out) > >+{ > >+char *s = out; > >+ > >+out += sprintf(out, "%d\n", vhci_num_controllers); > >+

[PATCH v2] usb: gadget: dummy_hcd: Fix wrong power status bit clear/reset in dummy_hub_control()

2017-03-23 Thread Yuyang Du
This fixes the commit: 1cd8fd2887e1 ("usb: gadget: dummy_hcd: add SuperSpeed support"). In the case of ClearPortFeature and USB_PORT_FEAT_POWER, simply clear the right bit regardless of what the wValue is. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/gadget

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

2017-03-23 Thread Yuyang Du
parse_status() reads the status file one by one, so it can only update the available and according vhci_driver->idev's. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 34 ++ tools/usb/usbip/src/usbip_attach.c |

[PATCH 5/6] usb: usbip tool: Fix refresh_imported_device_list()

2017-03-23 Thread Yuyang Du
The commit 0775a9cbc694e8c7 ("usbip: vhci extension: modifications to vhci driver") introduced multiple controllers, but the status of the ports are only extracted from the first status file, fix it. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vh

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

2017-03-23 Thread Yuyang Du
vhci_tx_urb() should be able to get the vhci_device from its caller vhci_urb_enqueue(), instead of brutal-force searching it. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- drivers/usb/usbip/vhci_hcd.c | 32 ++-- 1 file changed, 2 insertions(+), 30 del

[PATCH 4/6] usb: usbip tool: Add ncontrollers in vhci_driver structure

2017-03-23 Thread Yuyang Du
This field is read from the newly added ncontroller sysfs. Signed-off-by: Yuyang Du <yuyang...@intel.com> --- tools/usb/usbip/libsrc/vhci_driver.c | 18 +- tools/usb/usbip/libsrc/vhci_driver.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/usb

[PATCH 0/6] usb: usbip: Fix ports and port status

2017-03-23 Thread Yuyang Du
t. Thanks, Yuyang -- Yuyang Du (6): usb: usbip: Remove unnecessary get_vdev() usb: usbip tool: Fix get_nports() usb: usbip: Export the number of VHCI controllers in a sysfs file usb: usbip tool: Add ncontrollers in vhci_driver structure and store usb: usbip tool: Fix refresh_imported_d

  1   2   >