Re: [PATCH] usb: dwc3: core: Add quirk for enabling AutoRetry feature in the controller

2018-07-25 Thread Rob Herring
On Sat, Jul 21, 2018 at 03:58:40PM +0530, Anurag Kumar Vulisha wrote: > By default when core sees any transaction error(CRC or overflow) > it replies with terminating retry ACK (Retry=1 and Nump == 0). > Enabling this Auto Retry feature in controller, on seeing any > transaction errors makes the

Re: [PATCH 4/5] memstick: rtsx_usb_ms: Support runtime power management

2018-07-25 Thread Alan Stern
On Wed, 25 Jul 2018, Kai-Heng Feng wrote: > In order to let host's parent device, rtsx_usb, to use USB remote wake > up signaling to do card detection, it needs to be suspended. Hence it's > necessary to add runtime PM support for the memstick host. > > To keep memstick host stays suspended when

Re: [PATCH 2/5] memstick: Prevent memstick host from getting runtime suspended during card detection

2018-07-25 Thread Alan Stern
On Wed, 25 Jul 2018, Kai-Heng Feng wrote: > We can use MEMSTICK_POWER_{ON,OFF} along with pm_runtime_{get,put} > helpers to let memstick host support runtime pm. > > There's a small window between memstick_detect_change() and its queued > work, memstick_check(). In this window the rpm count may

Re: [PATCH 2/6] module: add support for symbol namespaces.

2018-07-25 Thread Lucas De Marchi
On Wed, Jul 25, 2018 at 8:55 AM Jessica Yu wrote: > > +++ Martijn Coenen [24/07/18 09:56 +0200]: > >I did find an issue with my approach: > > > >On Mon, Jul 16, 2018 at 2:21 PM, Martijn Coenen wrote: > >> The ELF symbols are renamed to include the namespace with an asm label; > >> for example,

Re: [PATCH 2/6] module: add support for symbol namespaces.

2018-07-25 Thread Jessica Yu
+++ Martijn Coenen [24/07/18 09:56 +0200]: I did find an issue with my approach: On Mon, Jul 16, 2018 at 2:21 PM, Martijn Coenen wrote: The ELF symbols are renamed to include the namespace with an asm label; for example, symbol 'usb_stor_suspend' in namespace USB_STORAGE becomes

RE: [PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Anurag Kumar Vulisha
>-Original Message- >From: Andy Shevchenko [mailto:andy.shevche...@gmail.com] >Sent: Wednesday, July 25, 2018 8:55 PM >To: Anurag Kumar Vulisha >Cc: Felipe Balbi ; Greg Kroah-Hartman >; v.anuragku...@gmail.com; USB u...@vger.kernel.org>; Linux Kernel Mailing List >Subject: Re: [PATCH

[PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection

2018-07-25 Thread Kai-Heng Feng
Although rtsx_usb doesn't support card removal detection, card insertion will resume rtsx_usb by USB remote wakeup signaling. When rtsx_usb gets resumed, also resumes its child devices, rtsx_usb_sdmmc and rtsx_usb_ms, to notify them there's a card in its slot. Signed-off-by: Kai-Heng Feng ---

[PATCH 5/5] misc: rtsx_usb: / memstick: rtsx_usb_ms: Avoid long delay before system suspend

2018-07-25 Thread Kai-Heng Feng
There's a long power-on delay at the end of rtsx_usb_ms_set_param(). This delay is noticeable right before system suspend. To prevent already suspended memstick host from getting powered on by PM core, use DPM_FLAG_SMART_SUSPEND to avoid the situation. Signed-off-by: Kai-Heng Feng ---

[PATCH 4/5] memstick: rtsx_usb_ms: Support runtime power management

2018-07-25 Thread Kai-Heng Feng
In order to let host's parent device, rtsx_usb, to use USB remote wake up signaling to do card detection, it needs to be suspended. Hence it's necessary to add runtime PM support for the memstick host. To keep memstick host stays suspended when it's not in use, convert the card detection function

[PATCH 2/5] memstick: Prevent memstick host from getting runtime suspended during card detection

2018-07-25 Thread Kai-Heng Feng
We can use MEMSTICK_POWER_{ON,OFF} along with pm_runtime_{get,put} helpers to let memstick host support runtime pm. There's a small window between memstick_detect_change() and its queued work, memstick_check(). In this window the rpm count may go down to zero before the memstick host powers on,

[PATCH 3/5] memstick: rtsx_usb_ms: Use ms_dev() helper

2018-07-25 Thread Kai-Heng Feng
Use ms_dev() helper for consistency. Signed-off-by: Kai-Heng Feng --- drivers/memstick/host/rtsx_usb_ms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rtsx_usb_ms.c index 4f64563df7de..cd12f3d1c088 100644

[PATCH 0/5 v3] Keep rtsx_usb suspended when there's no card

2018-07-25 Thread Kai-Heng Feng
Hi, This is based on Ulf's work [1] [2]. This patch series can keep rtsx_usb suspended, to save ~0.5W on Intel platforms and ~1.5W on AMD platforms. [1] https://patchwork.kernel.org/patch/10440583/ [2] https://patchwork.kernel.org/patch/10445725/ Kai-Heng Feng (5): misc: rtsx_usb: Use USB

Re: [PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Andy Shevchenko
On Wed, Jul 25, 2018 at 6:14 PM, Anurag Kumar Vulisha wrote: >>> +/* >>> + * Timeout value in msecs used by stream_timeout_timer when streams >>> +are enabled */ >>> +#define STREAM_TIMEOUT 50 >> >>Perhaps, STREAM_TIMEOUT_MS 50 >> >>Dunno about this driver, but it's a usual practice to

RE: [PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Anurag Kumar Vulisha
Hi Andy, Thanks for your review comments, please find my comments inline >-Original Message- >From: Andy Shevchenko [mailto:andy.shevche...@gmail.com] >Sent: Wednesday, July 25, 2018 8:36 PM >To: Anurag Kumar Vulisha >Cc: Felipe Balbi ; Greg Kroah-Hartman >; v.anuragku...@gmail.com;

Re: [PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Andy Shevchenko
On Wed, Jul 25, 2018 at 2:51 PM, Anurag Kumar Vulisha wrote: > According to dwc3 databook when streams are used, it may be possible > for the host and device become out of sync, where device may wait for > host to issue prime transcation and host may wait for device to issue > erdy. To avoid such

[PATCH 5/8] usb: dwc3: don't issue no-op trb for stream capable endpoints

2018-07-25 Thread Anurag Kumar Vulisha
The stream capable endpoints require stream id to be given when issuing START TRANSFER. While issuing no-op trb the stream id is not yet known, so don't issue no-op trb's on stream capable endpoints. Signed-off-by: Anurag Kumar Vulisha --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1

[PATCH 3/8] usb: dwc3: make controller clear transfer resources after complete

2018-07-25 Thread Anurag Kumar Vulisha
To start transfer with another stream id, controller needs to free previously allocated transfer resource. This will be automatically done by the controller at the time of XferComplete Event. This patch updates the code to issue XferComplete event once all transfers are done by setting LST bit in

[PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Anurag Kumar Vulisha
According to dwc3 databook when streams are used, it may be possible for the host and device become out of sync, where device may wait for host to issue prime transcation and host may wait for device to issue erdy. To avoid such deadlock, timeout needs to be implemented. After timeout occurs,

[PATCH 8/8] usb: dwc3: Check MISSED ISOC bit only for ISOC endpoints

2018-07-25 Thread Anurag Kumar Vulisha
When streaming is enabled on BULK endpoints and LST bit is set observed MISSED ISOC bit set in event->status for BULK ep. Since this bit is only valid for isocronous endpoints, changed the code to check for isocrnous endpoints when MISSED ISOC bit is set. Signed-off-by: Anurag Kumar Vulisha ---

[PATCH 6/8] usb: dwc3: check for requests in started list for stream capable endpoints

2018-07-25 Thread Anurag Kumar Vulisha
For stream capable endpoints, uas layer can queue mulpile requests on single ep with different stream ids. So, there can be multiple pending requests waiting to be transferred. This patch changes the code to check for any pending requests waiting to be transferred on ep started_list and calls

[PATCH 7/8] usb: dwc3: Check for IOC/LST bit in both event->status and TRB->ctrl fields

2018-07-25 Thread Anurag Kumar Vulisha
The present code in dwc3_gadget_ep_reclaim_completed_trb() will check for IOC/LST bit in the event->status and returns if IOC/LST bit is set. This logic doesn't work if multiple TRBs are queued per request and the IOC/LST bit is set on the last TRB of that request. Consider an example where a

[PATCH 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb()

2018-07-25 Thread Anurag Kumar Vulisha
In __dwc3_prepare_one_trb(), IOC bit is set if the total number of available TRB's are zero. The number of available TRBs are calculated using dwc3_calc_trbs_left(), which determines TRBs full or not based on HWO bit set in the TRB. During preparation of TRB __dwc3_prepare_one_trb() is always

[PATCH 2/8] usb: dwc3: update stream id in depcmd

2018-07-25 Thread Anurag Kumar Vulisha
For stream capable endpoints, stream id related information needs to be updated into DEPCMD while issuing START TRANSFER. This patch does the same. Signed-off-by: Anurag Kumar Vulisha --- drivers/usb/dwc3/gadget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c

[PATCH 0/8] fix broken BULK stream support to dwc3 gadget driver

2018-07-25 Thread Anurag Kumar Vulisha
These patch series fixes the broken BULK streaming support in dwc3 gadget driver. Anurag Kumar Vulisha (8): usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() usb: dwc3: update stream id in depcmd usb: dwc3: make controller clear transfer resources after

Re: [PATCH] Driver for MaxLinear/Exar USB (UART) Serial Adapters

2018-07-25 Thread Oliver Neukum
On Di, 2018-07-24 at 15:36 -0700, Patong Yang wrote: > +static int xrusb_ctrl_msg(struct xrusb *xrusb, > + int request, int value, void *buf, int len) > +{ > + int rv = usb_control_msg(xrusb->dev, > + usb_sndctrlpipe(xrusb->dev, 0), > + request, > +