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

2018-09-10 Thread Ajay Gupta
Hi Peter, > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > +unsigned char buf1[USBC_MSG_OUT_SIZE]; > +unsigned char buf2[USBC_CONTROL_SIZE]; > +int status; > +u16 rab; > + > +memcpy(buf1, (u8

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > > 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

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

2018-09-10 Thread Peter Rosin
On 2018-09-11 00:22, 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. > >

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 23:53, Ajay Gupta wrote: > Hi Peter > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { + unsigned char buf1[USBC_MSG_OUT_SIZE]; + unsigned char buf2[USBC_CONTROL_SIZE]; + int status; + u16 rab; +

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

2018-09-10 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

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

2018-09-10 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

Re: [PATCH] usb: core: added uevent for over-current

2018-09-10 Thread Jon Flatley
On Mon, Sep 10, 2018 at 11:14 AM Greg KH wrote: > > On Fri, Aug 31, 2018 at 10:14:19AM -0700, Jon Flatley wrote: > > After commit 1cbd53c8cd85 ("usb: core: introduce per-port over-current > > counters") usb ports expose a sysfs value 'over_current_count' > > to user space. This value on its own

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

2018-09-10 Thread Ajay Gupta
Hi Peter > > > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > > > + unsigned char buf1[USBC_MSG_OUT_SIZE]; > > > + unsigned char buf2[USBC_CONTROL_SIZE]; > > > + int status; > > > + u16 rab; > > > + > > > + memcpy(buf1, (u8 *)(uc->ppm.data)

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 23:38, Ajay Gupta wrote: >> My guess is that with the above, you can actually program the I2C_MST_ADDR >> register inside the "if (Read)" branch and then remove the I2C_AQ_COMB | >> I2C_AQ_COMB_WRITE_FIRST | I2C_AQ_COMB_SAME_ADDR quirks. > > We need I2C_MST_ADDR to be programmed

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

2018-09-10 Thread Ajay Gupta
Hi Peter > > + if (msgs[i].flags & I2C_M_RD) { > > + /* gpu_i2c_read has implicit start and stop */ > > + status = gpu_i2c_read(i2cd, msgs[i].buf, > >> msgs[i].len); > > + if (status < 0) > > +

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

2018-09-10 Thread Ajay Gupta
Hi Peter > > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > > + unsigned char buf1[USBC_MSG_OUT_SIZE]; > > + unsigned char buf2[USBC_CONTROL_SIZE]; > > + int status; > > + u16 rab; > > + > > + memcpy(buf1, (u8 *)(uc->ppm.data) +

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 22:04, Ajay Gupta wrote: > Hi Peter, > > + if (msgs[i].flags & I2C_M_RD) { > + /* gpu_i2c_read has implicit start and stop */ > + status = gpu_i2c_read(i2cd, msgs[i].buf, >> msgs[i].len); > +

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > >>> + if (msgs[i].flags & I2C_M_RD) { > >>> + /* gpu_i2c_read has implicit start and stop */ > >>> + status = gpu_i2c_read(i2cd, msgs[i].buf, > msgs[i].len); > >>> + if (status < 0) > >>> +

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 19:43, Ajay Gupta wrote: > Hi Peter, > >>> + >>> + if (msgs[i].flags & I2C_M_RD) { >>> + /* gpu_i2c_read has implicit start and stop */ >>> + status = gpu_i2c_read(i2cd, msgs[i].buf, >>> msgs[i].len);

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 20:51, Ajay Gupta wrote: > +static int ucsi_ccg_send_data(struct ucsi_ccg *uc) { > + unsigned char buf1[USBC_MSG_OUT_SIZE]; > + unsigned char buf2[USBC_CONTROL_SIZE]; > + int status; > + u16 rab; > + > + memcpy(buf1, (u8 *)(uc->ppm.data) +

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > >>> +static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 > >>> +len) { > >>> + struct i2c_client *client = uc->client; > >>> + unsigned char buf[2]; > >>> + struct i2c_msg msgs[] = { > >>> + { > >>> + .addr = client->addr, > >>> +

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 19:32, Ajay Gupta wrote: >>> +static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len) >>> +{ >>> + struct i2c_client *client = uc->client; >>> + unsigned char buf[2]; >>> + struct i2c_msg msgs[] = { >>> + { >>> + .addr = client->addr,

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

2018-09-10 Thread Greg KH
On Fri, Sep 07, 2018 at 09:59:40AM +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. > > Change-Id:

Re: [PATCH] usb: core: added uevent for over-current

2018-09-10 Thread Greg KH
On Fri, Aug 31, 2018 at 10:14:19AM -0700, Jon Flatley wrote: > After commit 1cbd53c8cd85 ("usb: core: introduce per-port over-current > counters") usb ports expose a sysfs value 'over_current_count' > to user space. This value on its own is not very useful as it requires > manual polling. > > As

[PATCH] USB: handle NULL config in usb_find_alt_setting()

2018-09-10 Thread Alan Stern
usb_find_alt_setting() takes a pointer to a struct usb_host_config as an argument; it searches for an interface with specified interface and alternate setting numbers in that config. However, it crashes if the usb_host_config pointer argument is NULL. Since this is a general-purpose routine,

[PATCH 2/2] USB: fix error handling in usb_driver_claim_interface()

2018-09-10 Thread Alan Stern
The syzbot fuzzing project found a use-after-free bug in the USB core. The bug was caused by usbfs not unbinding from an interface when the USB device file was closed, which led another process to attempt the unbind later on, after the private data structure had been deallocated. The reason

[PATCH 1/2] USB: remove LPM management from usb_driver_claim_interface()

2018-09-10 Thread Alan Stern
usb_driver_claim_interface() disables and re-enables Link Power Management, but it shouldn't do either one, for the reasons listed below. This patch removes the two LPM-related function calls from the routine. The reason for disabling LPM in the analogous function usb_probe_interface() is so

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > > 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

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > > + > > + if (msgs[i].flags & I2C_M_RD) { > > + /* gpu_i2c_read has implicit start and stop */ > > + status = gpu_i2c_read(i2cd, msgs[i].buf, > > msgs[i].len); > > + if (status <

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 19:28, Peter Rosin wrote: > On 2018-09-10 18:08, Ajay Gupta wrote: >> Hi Peter, >> > + > + if (msgs[i].flags & I2C_M_RD) { > + /* gpu_i2c_read has implicit start and stop */ > + status = gpu_i2c_read(i2cd, msgs[i].buf,

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

2018-09-10 Thread Peter Rosin
On 2018-09-10 18:08, Ajay Gupta wrote: > Hi Peter, > + + if (msgs[i].flags & I2C_M_RD) { + /* gpu_i2c_read has implicit start and stop */ + status = gpu_i2c_read(i2cd, msgs[i].buf, msgs[i].len); + if (status < 0)

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

2018-09-10 Thread Ajay Gupta
Hi Peter, > >> + > >> + if (msgs[i].flags & I2C_M_RD) { > >> + /* gpu_i2c_read has implicit start and stop */ > >> + status = gpu_i2c_read(i2cd, msgs[i].buf, msgs[i].len); > >> + if (status < 0) > >> + return

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

2018-09-10 Thread Peter Rosin
On 2018-09-08 21:17, Peter Rosin wrote: >> + >> +if (msgs[i].flags & I2C_M_RD) { >> +/* gpu_i2c_read has implicit start and stop */ >> +status = gpu_i2c_read(i2cd, msgs[i].buf, msgs[i].len); >> +if (status < 0) >> +

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

2018-09-10 Thread Guenter Roeck
On 09/10/2018 04:58 AM, Heikki Krogerus wrote: Moving all the drivers that depend on the Port Controller Manager under a new directory drivers/usb/typec/tcpm/ and making Guenter Roeck the designated reviewer of that code. Signed-off-by: Heikki Krogerus Acked-by: Guenter Roeck --- Changes

Re: [PATCH 1/3] dt-bindings: usb: dwc2: add description for px30

2018-09-10 Thread Heiko Stuebner
Hi Greg, Felipe, Am Donnerstag, 2. August 2018, 15:01:31 CEST schrieb Heiko Stuebner: > From: Liang Chen > > This patch adds the compatible of dwc2 for PX30 SoCs. > > Signed-off-by: Liang Chen > Acked-by: Rob Herring > Signed-off-by: Heiko Stuebner Do you want to pick that patch through

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

2018-09-10 Thread Heikki Krogerus
Moving all the drivers that depend on the Port Controller Manager under a new directory drivers/usb/typec/tcpm/ and making Guenter Roeck the designated reviewer of that code. Signed-off-by: Heikki Krogerus --- Changes since v1: - Naming the directory tcpm instead of tcpci - Port controller

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

2018-09-10 Thread Heikki Krogerus
On Mon, Sep 10, 2018 at 12:17:56PM +0200, Hans de Goede wrote: > Hi, > > On 10-09-18 12:13, Heikki Krogerus wrote: > > On Sun, Sep 09, 2018 at 01:18:45PM +0200, Hans de Goede wrote: > > > Hi Saranya, Heikki, > > > > > > On 07-09-18 10:18, Heikki Krogerus wrote: > > > > +Hans > > > > > > > > On

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

2018-09-10 Thread Hans de Goede
Hi, On 10-09-18 12:13, Heikki Krogerus wrote: On Sun, Sep 09, 2018 at 01:18:45PM +0200, Hans de Goede wrote: Hi Saranya, Heikki, On 07-09-18 10:18, Heikki Krogerus wrote: +Hans On Fri, Sep 07, 2018 at 12:32:01PM +0530, saranya.go...@intel.com wrote: From: Saranya Gopal This patch adds

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

2018-09-10 Thread Heikki Krogerus
On Sun, Sep 09, 2018 at 01:18:45PM +0200, Hans de Goede wrote: > Hi Saranya, Heikki, > > On 07-09-18 10:18, Heikki Krogerus wrote: > > +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

Re: Possible race condition in f_mass_storage gadget during deinitialization. Kernel warning issued

2018-09-10 Thread Adrian Ambrożewicz
Thanks for the patch. I was happy to blindly apply it on my sources and check the result. Unfortunately it ended up with even worse crash than before. I've noticed that uninitialized stack variable "flags" is passed to spin_unlock_irqrestore . I've tried to tweak the patch and pass "flags" from

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

2018-09-10 Thread Heikki Krogerus
On Sat, Sep 08, 2018 at 06:37:12AM -0700, Guenter Roeck wrote: > On 09/08/2018 04:12 AM, Hans de Goede wrote: > > HI, > > > > On 07-09-18 18:19, Guenter Roeck wrote: > > > On Fri, Sep 07, 2018 at 05:06:12PM +0300, Heikki Krogerus wrote: > > > > On Fri, Sep 07, 2018 at 06:35:12AM -0700, Guenter