Re: [PATCH v10 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-07 Thread Peter Rosin
On 2018-09-08 02:09, Ajay Gupta wrote: > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller > over I2C interface. > > This UCSI I2C driver uses I2C bus driver interface for communicating > with Type-C controller. > > Signed-off-by: Ajay Gupta > Reviewed-by: Andy Shevchenko > Acked-by

RE: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Peter Rosin
On September 7, 2018 11:48:37 PM GMT+02:00, Ajay Gupta wrote: >> >> Per your comments on v8, the address has to be programmed before >the >> >> transfer, but you fail to do that if the first message is a read. >> > This will never happen. Hint: I2C_AQ_COMB_WRITE_FIRST >> >> Yes, it will. If the

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

2018-09-07 Thread Anurag Kumar Vulisha
HI Thinh, >> --- >> drivers/usb/dwc3/core.h | 7 +++ >> drivers/usb/dwc3/gadget.c | 36 >> 2 files changed, 43 insertions(+) >> >> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index >> 5bfb625..0b255e97 100644 >> --- a/drivers/usb/dw

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

2018-09-07 Thread Anurag Kumar Vulisha
Hi Thinh, >On 9/7/2018 6:14 AM, Anurag Kumar Vulisha wrote: >> Availability of TRB's are calculated using dwc3_calc_trbs_left(), >> which determines available TRB's based on the HWO bit set in a TRB. >> >> __dwc3_prepare_one_trb() is called with a TRB which needs to be >> prepared for transfer. Th

[PATCH v10 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko R

[PATCH v10 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-07 Thread Ajay Gupta
Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C interface. This UCSI I2C driver uses I2C bus driver interface for communicating with Type-C controller. Signed-off-by: Ajay Gupta Reviewed-by: Andy Shevchenko Acked-by: Heikki Krogerus --- Changes from v1 -> v2 Fixe

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

2018-09-07 Thread Thinh Nguyen
Hi Anurag, On 9/7/2018 6:14 AM, Anurag Kumar Vulisha wrote: > Availability of TRB's are calculated using dwc3_calc_trbs_left(), which > determines available TRB's based on the HWO bit set in a TRB. > > __dwc3_prepare_one_trb() is called with a TRB which needs to be prepared > for transfer. This __

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

2018-09-07 Thread Thinh Nguyen
On 9/7/2018 6:14 AM, 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 deadlock, tim

RE: [PATCH v9 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-07 Thread Ajay Gupta
Hi Peter, > >>> + memcpy(buf1, ((const void *)uc->ppm.data) + 0x20, sizeof(buf1)); > >>> + memcpy(buf2, ((const void *)uc->ppm.data) + 0x8, sizeof(buf2)); > >>> + > >>> + status = ccg_write(uc, *(u16 *)buf, buf1, sizeof(buf1)); > >> > >> This seems to be endian-dependent. May I suggest that you do

RE: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Ajay Gupta
Hi Peter, > >> Hmm, what do you need to sync read/write with? > > What if there are multiple clients and each of them wants to use I2C bus for > read/write? > > Even in UCSI client, user may want to change alt mode which will > > result in read/write request in a thread. So we have to synchronize b

Re: [PATCH v9 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-07 Thread Peter Rosin
On 2018-09-07 19:28, Ajay Gupta wrote: > Hi Peter, > >> -Original Message- >> From: Peter Rosin >> Sent: Friday, September 7, 2018 2:13 AM >> To: Ajay Gupta ; w...@the-dreams.de; >> heikki.kroge...@linux.intel.com >> Cc: linux-usb@vger.kernel.org; linux-...@vger.kernel.org >> Subject: Re:

Re: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Peter Rosin
On 2018-09-07 19:15, Ajay Gupta wrote: > Hi Peter, >>> Signed-off-by: Ajay Gupta >>> Reviewed-by: Andy Shevchenko >>> Reviewed-by: Heikki Krogerus >>> --- >>> Changes from v1 -> v2 >>> None >>> Changes from v2 -> v3 >>> Fixed review comments from Andy and Thierry >>> Rename i2c-gpu.c

RE: [PATCH v9 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-07 Thread Ajay Gupta
Hi Peter, > -Original Message- > From: Peter Rosin > Sent: Friday, September 7, 2018 2:13 AM > To: Ajay Gupta ; w...@the-dreams.de; > heikki.kroge...@linux.intel.com > Cc: linux-usb@vger.kernel.org; linux-...@vger.kernel.org > Subject: Re: [PATCH v9 2/2] usb: typec: ucsi: add support for

RE: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Ajay Gupta
Hi Peter, > > Signed-off-by: Ajay Gupta > > Reviewed-by: Andy Shevchenko > > Reviewed-by: Heikki Krogerus > > --- > > Changes from v1 -> v2 > > None > > Changes from v2 -> v3 > > Fixed review comments from Andy and Thierry > > Rename i2c-gpu.c -> i2c-nvidia-gpu.c > > Changes from v3

Re: WARNING: ODEBUG bug in vudc_probe

2018-09-07 Thread Dmitry Vyukov
On Fri, Sep 7, 2018 at 6:20 PM, Shuah Khan wrote: > On 09/07/2018 10:14 AM, Dmitry Vyukov wrote: >> On Fri, Sep 7, 2018 at 6:03 PM, Shuah Khan wrote: >>> Hi Dmitry, >>> >>> On 09/07/2018 04:54 AM, Dmitry Vyukov wrote: Hi, I am getting the following error while booting kernel on ups

Re: WARNING: ODEBUG bug in vudc_probe

2018-09-07 Thread Shuah Khan
On 09/07/2018 10:14 AM, Dmitry Vyukov wrote: > On Fri, Sep 7, 2018 at 6:03 PM, Shuah Khan wrote: >> Hi Dmitry, >> >> On 09/07/2018 04:54 AM, Dmitry Vyukov wrote: >>> Hi, >>> >>> I am getting the following error while booting kernel on upstream >>> commit a49a9dcce802b3651013f659813df1361d306172, c

Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Guenter Roeck
On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote: > On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote: > > On 09/07/2018 05:56 AM, Heikki Krogerus wrote: > > > Moving all the drivers that depend on the Port Controller > > > Manager under a new a new directory drivers/usb/

Re: WARNING: ODEBUG bug in vudc_probe

2018-09-07 Thread Dmitry Vyukov
On Fri, Sep 7, 2018 at 6:03 PM, Shuah Khan wrote: > Hi Dmitry, > > On 09/07/2018 04:54 AM, Dmitry Vyukov wrote: >> Hi, >> >> I am getting the following error while booting kernel on upstream >> commit a49a9dcce802b3651013f659813df1361d306172, config is attached. >> Seems there is some kind of reso

Re: WARNING: ODEBUG bug in vudc_probe

2018-09-07 Thread Shuah Khan
Hi Dmitry, On 09/07/2018 04:54 AM, Dmitry Vyukov wrote: > Hi, > > I am getting the following error while booting kernel on upstream > commit a49a9dcce802b3651013f659813df1361d306172, config is attached. > Seems there is some kind of resource leak. > > Thanks Odd. This commit has nothing to do w

Re: usb 3-1: device descriptor read/64, error -110

2018-09-07 Thread Alan Stern
On Fri, 7 Sep 2018, Cristian wrote: > Hello, > > Open report in: > https://bugzilla.kernel.org/show_bug.cgi?id=201037 > > dmesg: > [7.008154] usb 3-1: device descriptor read/64, error -110 Here's some more of the log: [7.008154] usb 3-1: device descriptor read/64, error -110 [7.281

usb 3-1: device descriptor read/64, error -110

2018-09-07 Thread Cristian
Hello, Open report in: https://bugzilla.kernel.org/show_bug.cgi?id=201037 dmesg: [7.008154] usb 3-1: device descriptor read/64, error -110 Best regards, -- Cristian Aravena Romero (caravena)

Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Heikki Krogerus
On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter Roeck wrote: > On 09/07/2018 05:56 AM, Heikki Krogerus wrote: > > Moving all the drivers that depend on the Port Controller > > Manager under a new a new directory drivers/usb/typec/tcpci/ > > and making Guenter Roeck as the designated reviewer of t

Re: [PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Guenter Roeck
On 09/07/2018 05:56 AM, Heikki Krogerus wrote: Moving all the drivers that depend on the Port Controller Manager under a new a new directory drivers/usb/typec/tcpci/ and making Guenter Roeck as the designated reviewer of that code. Signed-off-by: Heikki Krogerus --- Hi guys, This should be fa

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

2018-09-07 Thread Anurag Kumar Vulisha
Availability of TRB's are calculated using dwc3_calc_trbs_left(), which determines available TRB's based on the HWO bit set in a TRB. __dwc3_prepare_one_trb() is called with a TRB which needs to be prepared for transfer. This __dwc3_prepare_one_trb() calls dwc3_calc_trbs_left() to determine total

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

2018-09-07 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 queue

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

2018-09-07 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. Non

[PATCH v3 0/8] usb: dwc3: Fix broken BULK stream support to dwc3 gadget driver

2018-09-07 Thread Anurag Kumar Vulisha
These patch series fixes the broken BULK streaming support in dwc3 gadget driver. Changes in v3: 1. Added the changes suggested by "Thinh Nguyen" Changes in v2: 1. Added "usb: dwc3:" in subject heading Anurag Kumar Vulisha (8): usb: dwc3: Correct the logic for checking TRB full

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

2018-09-07 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 __dwc

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

2018-09-07 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, devic

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

2018-09-07 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. None Changes in v2: 1. None --- drivers/usb/

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

2018-09-07 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 Revie

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

2018-09-07 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 t

[PATCH] usb: typec: Group all TCPCI/TCPM code together

2018-09-07 Thread Heikki Krogerus
Moving all the drivers that depend on the Port Controller Manager under a new a new directory drivers/usb/typec/tcpci/ and making Guenter Roeck as the designated reviewer of that code. Signed-off-by: Heikki Krogerus --- Hi guys, This should be fairly trivial change. There is no functional effec

Re: [PATCH] usb: typec: don't disable sink or source on initialization

2018-09-07 Thread Guenter Roeck
On 09/07/2018 03:34 AM, Heikki Krogerus wrote: +Guenter On Thu, Sep 06, 2018 at 01:26:44PM -0600, Angus Ainslie (Purism) wrote: If the board is being powered by USB disabling the source and sink can remove power from the board. Default to source and sink enabled. Seems to me that might viola

Re: [PATCH] usb: typec: don't disable sink or source on initialization

2018-09-07 Thread Heikki Krogerus
+Guenter On Thu, Sep 06, 2018 at 01:26:44PM -0600, Angus Ainslie (Purism) wrote: > If the board is being powered by USB disabling the source and sink > can remove power from the board. Default to source and sink enabled. > > Signed-off-by: Angus Ainslie (Purism) > --- > drivers/usb/typec/tcpm.c

Re: [PATCH v3 02/10] usb: roles: Handle driver reference counting

2018-09-07 Thread Heikki Krogerus
On Thu, Sep 06, 2018 at 10:59:34PM +0200, Hans de Goede wrote: > HI, > > On 04-09-18 13:22, Heikki Krogerus wrote: > > This fixes potential "BUG: unable to handle kernel paging > > request at ..." from happening. > > > > Fixes: fde0aa6c175a ("usb: common: Small class for USB role switches") > > C

Re: [PATCH] usb: typec: don't disable sink or source on initialization

2018-09-07 Thread Sergei Shtylyov
Hello! On 9/6/2018 10:26 PM, Angus Ainslie (Purism) wrote: If the board is being powered by USB disabling the source and sink can remove power from the board. Default to source and sink enabled. Signed-off-by: Angus Ainslie (Purism) --- drivers/usb/typec/tcpm.c | 8 +--- 1 file changed

Re: [PATCH v9 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-07 Thread Peter Rosin
On 2018-09-07 01:56, Ajay Gupta wrote: > Latest NVIDIA GPU card has USB Type-C interface. There is a > Type-C controller which can be accessed over I2C. > > This driver adds I2C bus driver to communicate with Type-C controller. > I2C client driver will be part of USB Type-C UCSI driver. > > Signe

Re: [PATCH v9 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-07 Thread Peter Rosin
On 2018-09-07 01:56, Ajay Gupta wrote: > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller > over I2C interface. > > This UCSI I2C driver uses I2C bus driver interface for communicating > with Type-C controller. > > Signed-off-by: Ajay Gupta > Reviewed-by: Andy Shevchenko > Acked-by

Re: [PATCH v2] usb: xhci: fix interrupt transfer error happened on MTK platforms

2018-09-07 Thread Greg Kroah-Hartman
On Fri, Sep 07, 2018 at 04:43:46PM +0800, Chunfeng Yun wrote: > Hi, > > On Fri, 2018-09-07 at 09:42 +0200, Greg Kroah-Hartman wrote: > > On Fri, Sep 07, 2018 at 03:29:12PM +0800, Chunfeng Yun wrote: > > > The MTK xHCI controller use some reserved bytes in endpoint context for > > > bandwidth sched

Re: [RFC 3/3] stk1160: Use non-coherent buffers for USB transfers

2018-09-07 Thread Tomasz Figa
On Fri, Aug 31, 2018 at 2:59 AM Christoph Hellwig wrote: > > > + dma_sync_single_for_cpu(&urb->dev->dev, urb->transfer_dma, > > + urb->transfer_buffer_length, DMA_FROM_DEVICE); > > You can't ue dma_sync_single_for_cpu on non-coherent dma buffers, > which is one of the major issues

Re: [PATCH v2] usb: xhci: fix interrupt transfer error happened on MTK platforms

2018-09-07 Thread Chunfeng Yun
Hi, On Fri, 2018-09-07 at 09:42 +0200, Greg Kroah-Hartman wrote: > On Fri, Sep 07, 2018 at 03:29:12PM +0800, Chunfeng Yun wrote: > > The MTK xHCI controller use some reserved bytes in endpoint context for > > bandwidth scheduling, so need keep them in xhci_endpoint_copy(); > > If they are "reserv

Re: [PATCH V6] roles: Fix USB 3.0 OTG issue on Intel platform

2018-09-07 Thread Greg KH
On Fri, Sep 07, 2018 at 11:33:23AM +0300, Felipe Balbi wrote: > > Hi Greg, > > "Gopal, Saranya" writes: > >> > diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c > >> b/drivers/usb/roles/intel-xhci-usb-role-switch.c > >> > index dad2d19..0d1ea82 100644 > >> > --- a/drivers/usb/roles/int

RE: [PATCH V6] roles: Fix USB 3.0 OTG issue on Intel platform

2018-09-07 Thread Felipe Balbi
Hi Greg, "Gopal, Saranya" writes: >> > diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c >> b/drivers/usb/roles/intel-xhci-usb-role-switch.c >> > index dad2d19..0d1ea82 100644 >> > --- a/drivers/usb/roles/intel-xhci-usb-role-switch.c >> > +++ b/drivers/usb/roles/intel-xhci-usb-role-swi

Re: [PATCH V6] roles: Fix USB 3.0 OTG issue on Intel platform

2018-09-07 Thread Heikki Krogerus
+Hans On Fri, Sep 07, 2018 at 12:32:01PM +0530, saranya.go...@intel.com wrote: > From: Saranya Gopal > > This patch adds static DRD mode for host/device > mode switch. This fixes the issue where device > mode was not working after DUT switches to host > mode with 3.0 OTG connector. > > Signed-o

RE: [PATCH V6] roles: Fix USB 3.0 OTG issue on Intel platform

2018-09-07 Thread Gopal, Saranya
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Friday, September 07, 2018 12:49 PM > To: Gopal, Saranya > Cc: linux-usb@vger.kernel.org; heikki.kroge...@linux.intel.com; Kuppuswamy, > Sathyanarayanan ; K V, Abhilash > ; Balaji, M > Subject: Re: [PATCH

Re: [PATCH v2] usb: xhci: fix interrupt transfer error happened on MTK platforms

2018-09-07 Thread Greg Kroah-Hartman
On Fri, Sep 07, 2018 at 03:29:12PM +0800, Chunfeng Yun wrote: > The MTK xHCI controller use some reserved bytes in endpoint context for > bandwidth scheduling, so need keep them in xhci_endpoint_copy(); If they are "reserved" shouldn't they be properly named? And by using reserved bytes, isn't th

Re: [PATCH V2 1/4] USB: serial: f81232: clear overrun flag

2018-09-07 Thread Ji-Ze Hong (Peter Hong)
Hi, Johan Hovold 於 2018/9/5 下午 10:39 寫道: Looks like you ignored Oliver's comment that you needed to take care of any pending lsr work both and close and suspend. I'll add the cancel operation when suspend() with next version. Thanks -- With Best Regards, Peter Hong

[PATCH v2] usb: xhci: fix interrupt transfer error happened on MTK platforms

2018-09-07 Thread Chunfeng Yun
The MTK xHCI controller use some reserved bytes in endpoint context for bandwidth scheduling, so need keep them in xhci_endpoint_copy(); The issue is introduced by: commit f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset") It resets endpoints and will drop bandw

Re: [PATCH V6] roles: Fix USB 3.0 OTG issue on Intel platform

2018-09-07 Thread Greg KH
On Fri, Sep 07, 2018 at 12:32:01PM +0530, saranya.go...@intel.com wrote: > From: Saranya Gopal > > This patch adds static DRD mode for host/device > mode switch. This fixes the issue where device > mode was not working after DUT switches to host > mode with 3.0 OTG connector. > > Signed-off-by:

[PATCH V6] roles: Fix USB 3.0 OTG issue on Intel platform

2018-09-07 Thread saranya . gopal
From: Saranya Gopal This patch adds static DRD mode for host/device mode switch. This fixes the issue where device mode was not working after DUT switches to host mode with 3.0 OTG connector. Signed-off-by: Saranya Gopal Signed-off-by: M Balaji Reviewed-by: Heikki Krogerus Reviewed-by: Kuppus