RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-17 Thread Felipe Balbi
Hi, Pawel Laszczak writes: > +static irqreturn_t cdns3_device_irq_handler(int irq, void *data) > +{ > + struct cdns3_device *priv_dev; > + struct cdns3 *cdns = data; > + irqreturn_t ret = IRQ_NONE; > + unsigned long flags; > + u32 reg; > + > + priv_dev =

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-17 Thread Pawel Laszczak
Hi, > +static irqreturn_t cdns3_device_irq_handler(int irq, void *data) +{ + struct cdns3_device *priv_dev; + struct cdns3 *cdns = data; + irqreturn_t ret = IRQ_NONE; + unsigned long flags; + u32 reg; + + priv_dev = cdns->gadget_dev; +

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-17 Thread Felipe Balbi
Hi, Pawel Laszczak writes: > + case USB_REQ_SET_ISOCH_DELAY: > + sprintf(str, "Set Isochronous Delay Delay: %d ns", wValue); > + break; > + default: > + sprintf(str, > + "SETUP BRT: %02x BR: %02x V: %04x I: %04x L: %04x\n", > +

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-17 Thread Pawel Laszczak
Hi Felipe > >Pawel Laszczak writes: > > + case USB_REQ_SET_ISOCH_DELAY: + sprintf(str, "Set Isochronous Delay Delay: %d ns", wValue); + break; + default: + sprintf(str, + "SETUP BRT: %02x BR: %02x V: %04x I: %04x L:

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-16 Thread Pawel Laszczak
Hi, > >On 12/12/18 12:22 PM, Felipe Balbi wrote: >> >> Hi >> >> Pawel Laszczak writes: > + cdns->phy = devm_phy_get(dev, "cdns3,usbphy"); > + if (IS_ERR(cdns->phy)) { > + ret = PTR_ERR(cdns->phy); > + if (ret == -ENOSYS || ret == -ENODEV) { Are you sure

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-16 Thread Pawel Laszczak
Hi Peter >On Mon, Dec 10, 2018 at 8:55 PM Pawel Laszczak wrote: >> >> This patch introduce new Cadence USBSS DRD driver >> to linux kernel. >> >> The Cadence USBSS DRD Driver is a highly >> configurable IP Core which can be >> instantiated as Dual-Role Device (DRD), >> Peripheral Only and Host

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-14 Thread kbuild test robot
Hi Pawel, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on usb/usb-testing] [also build test WARNING on v4.20-rc6 next-20181214] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-13 Thread Kishon Vijay Abraham I
On 12/12/18 12:22 PM, Felipe Balbi wrote: > > Hi > > Pawel Laszczak writes: + cdns->phy = devm_phy_get(dev, "cdns3,usbphy"); + if (IS_ERR(cdns->phy)) { + ret = PTR_ERR(cdns->phy); + if (ret == -ENOSYS || ret == -ENODEV) { >>> >>> Are you sure you can

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-12 Thread Peter Chen
> > > > Felipe, I use Dynamic Debug for debugging, and show debug messages > > with "dmesg" after testing/debugging. I see dwc3 using trace, any > > benefits for switching to trace? > > The benefits I see are > Thanks, bin. > - *by default*, the debug log doesn't have to go through uart

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-12 Thread Bin Liu
Peter, On Wed, Dec 12, 2018 at 10:04:25AM +0800, Peter Chen wrote: [snip] > > >I strongly advise against using dev_dbg() for debugging. Even more so > > >inside your IRQ handler. > > Felipe, I use Dynamic Debug for debugging, and show debug messages with > "dmesg" after testing/debugging. I

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-12 Thread Peter Chen
> > > > Interrupt handler (hardirq context) at CPU0, and process at CPU1, eg > > role switch, unload module, etc. > > the process at CPU1 would need to disable interrupts (spin_lock_irq() or > spin_lock_irqsave()), not the hardirq on CPU0 as that already runs with > interrrupts > disabled. >

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-12 Thread Felipe Balbi
Peter Chen writes: >> >> >> +irqreturn_t ret = IRQ_NONE; >> >> >> +unsigned long flags; >> >> >> +u32 reg; >> >> >> + >> >> >> +priv_dev = cdns->gadget_dev; >> >> >> +spin_lock_irqsave(_dev->lock, flags); >> >> > >> >> >you're already running in hardirq context. Why do you

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Peter Chen
> >> >> + USB_CMD_STMODE | > >> >> + > >> >> + USB_STS_TMODE_SEL(tmode - 1)); > >> > > >> >I'm 90% sure this won't work. There's a reason why we only enter the > >> >requested test mode from status stage. How have you tested this? > >> > > > > What's the

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Felipe Balbi
Peter Chen writes: >> >> +tmode = le16_to_cpu(ctrl->wIndex); >> >> + >> >> +if (!set || (tmode & 0xff) != 0) >> >> +return -EINVAL; >> >> + >> >> +switch (tmode >> 8) { >> >> +case TEST_J: >> >> +case TEST_K: >> >> +

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Felipe Balbi
Hi Pawel Laszczak writes: >>> + cdns->phy = devm_phy_get(dev, "cdns3,usbphy"); >>> + if (IS_ERR(cdns->phy)) { >>> + ret = PTR_ERR(cdns->phy); >>> + if (ret == -ENOSYS || ret == -ENODEV) { >> >>Are you sure you can get ENOSYS here? Have you checked output of >>checkpatch

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Peter Chen
> >> +tmode = le16_to_cpu(ctrl->wIndex); > >> + > >> +if (!set || (tmode & 0xff) != 0) > >> +return -EINVAL; > >> + > >> +switch (tmode >> 8) { > >> +case TEST_J: > >> +case TEST_K: > >> +case TEST_SE0_NAK:

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Pawel Laszczak
Hi, > >Pawel Laszczak writes: >> +static int cdns3_probe(struct platform_device *pdev) >> +{ >> +struct device *dev = >dev; >> +struct resource *res; >> +struct cdns3 *cdns; >> +void __iomem *regs; >> +int ret; >> + >> +cdns = devm_kzalloc(dev, sizeof(*cdns), GFP_KERNEL);

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Felipe Balbi
Hi, Pawel Laszczak writes: >>I think what Felipe meant was to only combine the gadget driver code into one >>patch. >> >>The series could be split into 6 patches like so. >>-dt binding >>-pci glue >>-core driver >>-host driver >>-gadget driver >>-drd driver > > Felipe wrote: > " > Frankly, I

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Felipe Balbi
Hi, Pawel Laszczak writes: > +static int cdns3_probe(struct platform_device *pdev) > +{ > + struct device *dev = >dev; > + struct resource *res; > + struct cdns3 *cdns; > + void __iomem *regs; > + int ret; > + > + cdns = devm_kzalloc(dev, sizeof(*cdns), GFP_KERNEL); > +

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Felipe Balbi
Hi, Roger Quadros writes: >> This patch introduce new Cadence USBSS DRD driver >> to linux kernel. >> >> The Cadence USBSS DRD Driver is a highly >> configurable IP Core which can be >> instantiated as Dual-Role Device (DRD), >> Peripheral Only and Host Only (XHCI) >> configurations. >> >>

RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Pawel Laszczak
Hi, >On 10/12/18 14:39, Pawel Laszczak wrote: >> This patch introduce new Cadence USBSS DRD driver >> to linux kernel. >> >> The Cadence USBSS DRD Driver is a highly >> configurable IP Core which can be >> instantiated as Dual-Role Device (DRD), >> Peripheral Only and Host Only (XHCI) >>

Re: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-11 Thread Roger Quadros
Pawel, On 10/12/18 14:39, Pawel Laszczak wrote: > This patch introduce new Cadence USBSS DRD driver > to linux kernel. > > The Cadence USBSS DRD Driver is a highly > configurable IP Core which can be > instantiated as Dual-Role Device (DRD), > Peripheral Only and Host Only (XHCI) >