Re: [PATCH 2/2] usb: cdnsp: Fix lack of removing request from pending list.

2021-04-19 Thread Peter Chen
n cdnsp_remove_request(pdev, preq, pep); > + return ret_rem ? ret_rem : ret_stop; > } > > static void cdnsp_zero_in_ctx(struct cdnsp_device *pdev) > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [PATCH 1/2] usb: gadget: f_uac2: Stop endpoint before enabling it.

2021-04-19 Thread Peter Chen
- else > - u_audio_stop_playback(>g_audio); > } else { > dev_err(dev, "%s:%d Error!\n", __func__, __LINE__); > return -EINVAL; To avoid this, you may use prm->ep_enabled to judge if the endpoint has already enabled. -- Thanks, Peter Chen

Re: [PATCH] usb: gadget: Fix double free of device descriptor pointers

2021-04-19 Thread Peter Chen
tors); > + f->hs_descriptors = NULL; > usb_free_descriptors(f->ss_descriptors); > + f->ss_descriptors = NULL; > usb_free_descriptors(f->ssp_descriptors); > + f->ssp_descriptors = NULL; > } > EXPORT_SYMBOL_GPL(usb_free_all_descriptors); > Reviewed-by: Peter Chen You may add Fixed-by tag, and cc to stable tree. -- Thanks, Peter Chen

Re: [PATCH] [v2] usb: cdns3: Fix runtime PM imbalance on error

2021-04-18 Thread Peter Chen
> + pm_runtime_put_sync(cdns->dev); > return ret; > + } > > /* >* Because interrupt line can be shared with other components in > -- > 2.17.1 > -- Thanks, Peter Chen

Re: [PATCH v2] usb: cdnsp: Fixes issue with Configure Endpoint command

2021-04-09 Thread Peter Chen
h: > diff --git a/drivers/usb/cdns3/cdnsp-gadget.h > b/drivers/usb/cdns3/cdnsp-gadget.h > index 6bbb26548c04..783ca8ffde00 100644 > --- a/drivers/usb/cdns3/cdnsp-gadget.h > +++ b/drivers/usb/cdns3/cdnsp-gadget.h > @@ -835,6 +835,7 @@ struct cdnsp_ep { > #define EP_WEDGE BIT(4) > #define EP0_HALTED_STATUSBIT(5) > #define EP_HAS_STREAMS BIT(6) > +#define EP_UNCONFIGURED BIT(7) > > bool skip; > }; > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [PATCH v2] usb: cdnsp: Fixes issue with Configure Endpoint command

2021-04-09 Thread Peter Chen
h: > diff --git a/drivers/usb/cdns3/cdnsp-gadget.h > b/drivers/usb/cdns3/cdnsp-gadget.h > index 6bbb26548c04..783ca8ffde00 100644 > --- a/drivers/usb/cdns3/cdnsp-gadget.h > +++ b/drivers/usb/cdns3/cdnsp-gadget.h > @@ -835,6 +835,7 @@ struct cdnsp_ep { > #define EP_WEDGE BIT(4) > #define EP0_HALTED_STATUSBIT(5) > #define EP_HAS_STREAMS BIT(6) > +#define EP_UNCONFIGURED BIT(7) > > bool skip; > }; > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [PATCH] usb: cdns3: Fix rumtime PM imbalance on error

2021-04-09 Thread Peter Chen
return ret; It doesn't need to delay entering runtime suspend, I prefer using pm_runtime_put_sync directly. -- Thanks, Peter Chen

Re: [PATCH] usb: cdnsp: Fixes issue with Configure Endpoint command

2021-04-02 Thread Peter Chen
et.h > >> @@ -830,11 +830,12 @@ struct cdnsp_ep { > >>unsigned int ep_state; > >> #define EP_ENABLEDBIT(0) > >> #define EP_DIS_IN_RROGRESS BIT(1) > >> -#define EP_HALTED BIT(2) > >> -#define EP_STOPPEDBIT(3) > >> -#define EP_WEDGE BIT(4) > >> -#define EP0_HALTED_STATUS BIT(5) > >> -#define EP_HAS_STREAMSBIT(6) > >> +#define EP_UNCONFIGURED BIT(2) > > > >Why add new flag as BIT(2), it causes many changes in this patch? > > In my feeling, EP_UNCONFIGURED is more associates with the first 2 flags, so > I've decided > put it after BIT(1). No, you may not add such relationship, each flag has its own meaning, otherwise, the sequence of flag bitmap may be changed again. Peter > > > > >> +#define EP_HALTED BIT(3) > >> +#define EP_STOPPEDBIT(4) > >> +#define EP_WEDGE BIT(5) > >> +#define EP0_HALTED_STATUS BIT(6) > >> +#define EP_HAS_STREAMSBIT(7) > >> > >>bool skip; > >> }; > >> -- > >> 2.25.1 > >> > > > >-- > > > >Thanks, > >Peter Chen > -- Thanks, Peter Chen

Re: [PATCH] usb: cdns3: delete repeated clear operations

2021-03-26 Thread Peter Chen
, 0, sizeof(*pdev->dcbaa)); > > pdev->dcbaa->dma = dma; > > > > cdnsp_write_64(dma, >op_regs->dcbaa_ptr); > >-- > >2.7.4 > > Regards, > Pawel Laszczak -- Thanks, Peter Chen

Re: [PATCH] usb: cdnsp: Fixes issue with Configure Endpoint command

2021-03-26 Thread Peter Chen
) > -#define EP_HALTEDBIT(2) > -#define EP_STOPPED BIT(3) > -#define EP_WEDGE BIT(4) > -#define EP0_HALTED_STATUSBIT(5) > -#define EP_HAS_STREAMS BIT(6) > +#define EP_UNCONFIGURED BIT(2) Why add new flag as BIT(2), it causes many changes in this patch? > +#define EP_HALTEDBIT(3) > +#define EP_STOPPED BIT(4) > +#define EP_WEDGE BIT(5) > +#define EP0_HALTED_STATUSBIT(6) > +#define EP_HAS_STREAMS BIT(7) > > bool skip; > }; > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [PATCH v2] usb: cdnsp: Fixes issue with dequeuing requests after disabling endpoint

2021-03-26 Thread Peter Chen
t; function. > Patch adds condition in cdnsp_gadget_ep_dequeue function which allows > dequeue requests only from enabled endpoint. > > Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD > Driver") > Signed-off-by: Pawel Laszczak > > --- >

Re: [PATCH v2] usb: cdns3: Optimize DMA request buffer allocation

2021-03-20 Thread Peter Chen
buf->dma, > + buf->dir); > > list_del(>list); > kfree(buf); > diff --git a/drivers/usb/cdns3/cdns3-gadget.h > b/drivers/usb/cdns3/cdns3-gadget.h > index ecf9b91..c5660f2 100644 > --- a/drivers/usb/cdns3/cdns3-gadget.h > +++ b/drivers/usb/cdns3/cdns3-gadget.h > @@ -12,6 +12,7 @@ > #ifndef __LINUX_CDNS3_GADGET > #define __LINUX_CDNS3_GADGET > #include > +#include > > /* > * USBSS-DEV register interface. > @@ -1205,6 +1206,7 @@ struct cdns3_aligned_buf { > void*buf; > dma_addr_t dma; > u32 size; > + enum dma_data_direction dir; > unsignedin_use:1; > struct list_headlist; > }; > -- > 2.4.5 > -- Thanks, Peter Chen

Re: [PATCH v2] usb: cdns3: Optimize DMA request buffer allocation

2021-03-20 Thread Peter Chen
ristoph, I would like to confirm the dma_alloc_noncoherent allocates the memory less than PAGE_SIZE if buffer size it would like to allocate is small (eg, 64 bytes)? -- Thanks, Peter Chen

Re: [PATCH v2 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110

2021-03-15 Thread Peter Chen
1.0 has been replaced by 1.1 specification > (UVC: 6.2.26) Class Video Control Interface Descriptor bcdUVC is not 1.1 > > Reviewed-by: Laurent Pinchart > Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen > > --- > Changlog: > v2: > - fixed typo in

Re: [PATCH 2/2] usb: cdns3: Optimize DMA request buffer allocation

2021-03-15 Thread Peter Chen
ing something here? My point is this unmap operation is useless since there is no user for aligned buf, and it calls kfree afterwards. You could also keep it as it has no harm. > > Also, I will post v2 of this patch which uses dma_*_noncoherent APIs > suggested by Christoph Hellwig. -- Thanks, Peter Chen

Re: [PATCH v4 2/2] usb: webcam: Invalid size of Processing Unit Descriptor

2021-03-15 Thread Peter Chen
Descriptor Test Video form > CV tool failed. To fix this issue patch adds bmVideoStandards into > uvc_processing_unit_descriptor structure. > > The bmVideoStandards field was added in UVC 1.1 and it wasn't part of > UVC 1.0a. > > Reviewed-by: Laurent Pinchart > Signed-off-by

Re: [PATCH 2/2] usb: cdns3: Optimize DMA request buffer allocation

2021-03-13 Thread Peter Chen
list); > + kfree(buf->buf); > kfree(buf); > } > > diff --git a/drivers/usb/cdns3/cdns3-gadget.h > b/drivers/usb/cdns3/cdns3-gadget.h > index ecf9b91..c5660f2 100644 > --- a/drivers/usb/cdns3/cdns3-gadget.h > +++ b/drivers/usb/cdns3/cdns3-gadget.h > @@ -12,6 +12,7 @@ > #ifndef __LINUX_CDNS3_GADGET > #define __LINUX_CDNS3_GADGET > #include > +#include > > /* > * USBSS-DEV register interface. > @@ -1205,6 +1206,7 @@ struct cdns3_aligned_buf { > void*buf; > dma_addr_t dma; > u32 size; > + enum dma_data_direction dir; > unsignedin_use:1; > struct list_headlist; > }; > -- > 1.7.1 > -- Thanks, Peter Chen

Re: [PATCH 1/2] usb: cdns3: Use dma_pool_* api to alloc trb pool

2021-03-13 Thread Peter Chen
t;eps_dma_pool); > + > usb_put_gadget(_dev->gadget); > cdns->gadget_dev = NULL; > return ret; > diff --git a/drivers/usb/cdns3/cdns3-gadget.h > b/drivers/usb/cdns3/cdns3-gadget.h > index 21fa461..ecf9b91 100644 > --- a/drivers/usb/cdns3/cdns3-gadget.h > +++ b/drivers/usb/cdns3/cdns3-gadget.h > @@ -1298,6 +1298,7 @@ struct cdns3_device { > > struct cdns3_usb_regs __iomem *regs; > > + struct dma_pool *eps_dma_pool; > struct usb_ctrlrequest *setup_buf; > dma_addr_t setup_dma; > void*zlp_buf; > -- > 1.7.1 > -- Thanks, Peter Chen

Re: [PATCH v2] usb: gadget: uvc: add bInterval checking for HS mode

2021-03-13 Thread Peter Chen
uvc_hs_streaming_ep.bInterval = opts->streaming_interval; > > uvc_ss_streaming_ep.wMaxPacketSize = cpu_to_le16(max_packet_size); > uvc_ss_streaming_ep.bInterval = opts->streaming_interval; > -- > 2.25.1 > Reviewed-by: Peter Chen -- Thanks, Peter Chen

Re: [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110

2021-03-13 Thread Peter Chen
B_DT_CS_INTERFACE, > .bDescriptorSubType = UVC_VC_HEADER, > - .bcdUVC = cpu_to_le16(0x0100), > + .bcdUVC = cpu_to_le16(0x0110), > .wTotalLength = 0, /* dynamic */ > .dwClockFrequency = cpu_to_le32(4800), > .bInCollection = 0, /* dynamic */ > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor

2021-03-13 Thread Peter Chen
_unit_descriptor { > __u8 bControlSize; > __u8 bmControls[2]; > __u8 iProcessing; > + __u8 bmVideoStandards; > } __attribute__((__packed__)); > > #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n)) > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [PATCH 0/2] tracing: Detect unsafe dereferencing of pointers from trace events

2021-03-06 Thread Peter Chen
On 21-03-02 09:56:05, Steven Rostedt wrote: > On Tue, 2 Mar 2021 16:23:55 +0800 > Peter Chen wrote: > > s it looks like it uses %pa which IIUC from the printk code, it > > > >> dereferences the pointer to find it's virtual address. The event has

Re: [PATCH] usb: cdns3: Coherent memory allocation optimization

2021-03-05 Thread Peter Chen
,8 @@ static int cdns3_gadget_start(struct cdns *cdns) > err2: > cdns3_free_all_eps(priv_dev); > err1: > + dma_pool_destroy(priv_dev->eps_dma_pool); > + > usb_put_gadget(_dev->gadget); > cdns->gadget_dev = NULL; > return ret; > diff --git a/drivers/usb/cdns3/cdns3-gadget.h > b/drivers/usb/cdns3/cdns3-gadget.h > index 21fa461..c5660f2 100644 > --- a/drivers/usb/cdns3/cdns3-gadget.h > +++ b/drivers/usb/cdns3/cdns3-gadget.h > @@ -12,6 +12,7 @@ > #ifndef __LINUX_CDNS3_GADGET > #define __LINUX_CDNS3_GADGET > #include > +#include > > /* > * USBSS-DEV register interface. > @@ -1205,6 +1206,7 @@ struct cdns3_aligned_buf { > void*buf; > dma_addr_t dma; > u32 size; > + enum dma_data_direction dir; > unsignedin_use:1; > struct list_headlist; > }; > @@ -1298,6 +1300,7 @@ struct cdns3_device { > > struct cdns3_usb_regs __iomem *regs; > > + struct dma_pool *eps_dma_pool; > struct usb_ctrlrequest *setup_buf; > dma_addr_t setup_dma; > void*zlp_buf; > -- > 1.7.1 > I guess this issue may due to the size for DMA region is too small, try to enlarge the it (eg, CMA size). -- Thanks, Peter Chen

Re: [PATCH] usb: cdnsp: Fixes incorrect value in ISOC TRB

2021-03-05 Thread Peter Chen
- start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count); > + (u32)(start_cycle ? 0 : 1) | TRB_SIA | TRB_TBC(burst_count); > > /* Fill the rest of the TRB fields, and remaining normal TRBs. */ > for (i = 0; i < trbs_per_td; i++) { > -- > 2.25.1 > -- Thanks, Peter Chen

Re: [RFC PATCH] USB:XHCI:Modify XHCI driver for USB2.0 controller

2021-03-03 Thread Peter Chen
3 device is plugged, since there are no RX signal on the bus, the device will not enable USB3 logic, and only USB2 signals will be on the bus, there are only USB devices on USB2 roothub later. So, any issues you have met? -- Thanks, Peter Chen

Re: [PATCH 0/2] tracing: Detect unsafe dereferencing of pointers from trace events

2021-03-03 Thread Peter Chen
On 21-03-02 09:56:05, Steven Rostedt wrote: > On Tue, 2 Mar 2021 16:23:55 +0800 > Peter Chen wrote: > > s it looks like it uses %pa which IIUC from the printk code, it > > > >> dereferences the pointer to find it's virtual address. The event has

Re: [PATCH 0/2] tracing: Detect unsafe dereferencing of pointers from trace events

2021-03-02 Thread Peter Chen
On 21-03-01 05:27:04, Pawel Laszczak wrote: > > + Peter Chen - Maintainer of CDNS3 driver > > > > >[ Resending with an address that should work for Felipe ] > > > >On Sat, 27 Feb 2021 14:18:02 -0500 > >Steven Rostedt wrote: > > > >> On Fri,

Re: [PATCH] usb: cdnsp: Removes some useless trace events

2021-02-05 Thread Peter Chen
--- > > drivers/usb/cdns3/cdnsp-ep0.c| 5 - > > drivers/usb/cdns3/cdnsp-gadget.c | 2 -- > > drivers/usb/cdns3/cdnsp-ring.c | 1 - > > drivers/usb/cdns3/cdnsp-trace.h | 10 -- > > 4 files changed, 18 deletions(-) > > Acked-by: Greg Kroah-Hartman Applied, thanks Pawel. -- Thanks, Peter Chen

Re: [PATCH] usb: cdns3: Add support for TI's AM64 SoC

2021-01-22 Thread Peter Chen
= { > { .compatible = "ti,j721e-usb", }, > + { .compatible = "ti,am64-usb", }, > {}, > }; > MODULE_DEVICE_TABLE(of, cdns_ti_of_match); > -- > 2.17.1 > Applied, thanks. -- Thanks, Peter Chen

Re: [PATCH 1/1] usb: xhci: setup packets don't need DMA mapping

2021-01-14 Thread Peter Chen
On 21-01-14 13:00:21, Alan Stern wrote: > On Thu, Jan 14, 2021 at 01:04:02PM +0800, Peter Chen wrote: > > On 21-01-14 11:59:07, Daewoong Kim wrote: > > > DMA mapping of urb->setup_packet is not necessary for xHCI host > > > controllers. The xHCI specification says

Re: [PATCH 1/1] usb: xhci: setup packets don't need DMA mapping

2021-01-13 Thread Peter Chen
the host controller use PIO > + * for setup packets? > + */ > u8 otg_port; /* 0, or number of OTG/HNP port */ > unsigned is_b_host:1; /* true during some HNP roleswitches */ > unsigned b_hnp_enable:1;/* OTG: did A-Host enable HNP? */ > -- > 2.17.1 > -- Thanks, Peter Chen

Re: Infinite recursion in device_reorder_to_tail() due to circular device links

2021-01-13 Thread Peter Chen
phan, You could try to get the PHY at parent driver (drivers/usb/chipidea/ci_hdrc_msm.c) to see the difference. -- Thanks, Peter Chen

RE: [PATCH v2] usb: cdnsp: fixes undefined reference to cdns_remove

2021-01-13 Thread Peter Chen
> > > > Issue occurs for USB/CDNS3/CDNSP kernel configuration: > > CONFIG_USB=m > > CONFIG_USB_CDNS_SUPPORT=y > > CONFIG_USB_CDNS3=m > > CONFIG_USB_CDNS3_PCI_WRAP=m > > CONFIG_USB_CDNSP_PCI=y > > > > Reported-by: Randy Dunlap > > Signed-off-by: Pawel Laszczak > > After removing the v1 patch

Re: [PATCH v3 0/9] Support Runtime PM and host mode by Tegra ChipIdea USB driver

2021-01-12 Thread Peter Chen
On 21-01-12 09:56:37, Dmitry Osipenko wrote: > 29.12.2020 17:26, Dmitry Osipenko пишет: > > 29.12.2020 08:16, Peter Chen пишет: > >> On 20-12-18 15:02:37, Dmitry Osipenko wrote: > >>> This series implements Runtime PM support for the Tegra ChipIdea USB > &

RE: [PATCH] usb: cdnsp: fixes undefined reference to cdns_remove

2021-01-11 Thread Peter Chen
> > On 1/11/21 6:42 AM, Pawel Laszczak wrote: > > Patch fixes the following errors: > > ld: drivers/usb/cdns3/cdnsp-pci.o: in function `cdnsp_pci_remove': > > cdnsp-pci.c:(.text+0x80): undefined reference to `cdns_remove' > > ld: drivers/usb/cdns3/cdnsp-pci.o: in function `cdnsp_pci_probe': > >

Re: [PATCH] usb: cdns3: Adds missing __iomem markers

2021-01-11 Thread Peter Chen
dl(cdns->otg_cdnsp_regs->did) == OTG_CDNSP_DID) { > >+cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem > >*) > > >otg_cdnsp_regs->ien; > > cdns->version = CDNSP_CONTROLLER_V2; > > } else { > >-cdns->otg_irq_regs = (struct cdns_otg_irq_regs *) > >+cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem > >*) > > >otg_v1_regs->ien; > > writel(1, >otg_v1_regs->simulate); > > cdns->version = CDNS3_CONTROLLER_V1; > >-- > >2.17.1 > -- Thanks, Peter Chen

Re: [PATCH] Revert "usb: gadget: Quieten gadget config message"

2021-01-07 Thread Peter Chen
ad it to know if current USB gadget enumerated and what speed is recognized, reading from the console by eyes is the quickest way. Without this message, there is no any messages when the USB gadget connects to host. If enable debug message, there are too many messages, but I think most developers may only need one information message to know if enumeration is established correctly. -- Thanks, Peter Chen

Re: [PATCH v3 0/9] Support Runtime PM and host mode by Tegra ChipIdea USB driver

2020-12-28 Thread Peter Chen
inor patch "Specify TX FIFO threshold in UDC SoC info" > just for completeness, since we can now switch OTG to host mode in > the ChipIdea driver. Although, OTG support remains a work-in-progress > for now. > > v2: - Improved comments in the code as it was suggeste

RE: [PATCH] usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720

2020-12-24 Thread Peter Chen
> > > > > > If not supported by ATF, then where to power on and off PHY since no other > place calls PHY APIs? Is it always on? > > > > Yes, in this case (when -EOPNOTSUPP is returned) SMC API is not > > supported by ATF, and PHY is always on. > > To make it clear, core/hcd.c function

RE: [PATCH] usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720

2020-12-24 Thread Peter Chen
> > > + /* Old bindings miss the PHY handle */ > > > + phy = of_phy_get(dev->of_node, "usb3-phy"); > > > + if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER) > > > + return -EPROBE_DEFER; > > > > Doesn't need to judge IS_ERR(phy). > > Ok, I can remove it. I used same condition which is

Re: [PATCH v2] usb: host: xhci-plat: fix support for XHCI_SKIP_PHY_INIT quirk

2020-12-23 Thread Peter Chen
)) > + > + if (priv) { > + ret = xhci_priv_init_quirk(hcd); > + if (ret) > + goto disable_usb_phy; > + } > + > + if ((xhci->quirks & XHCI_SKIP_PHY_INIT) || (priv && (priv->quirks & > XHCI_SKIP_PHY_INIT))) > hcd->skip_phy_initialization = 1; I am not sure if others agree with you move the position of xhci_priv_init_quirk, Let's see Mathias opinion. -- Thanks, Peter Chen

Re: [PATCH] usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720

2020-12-23 Thread Peter Chen
_on(phy); > + if (ret == -EOPNOTSUPP) { > + /* Skip initializatin of XHCI PHY when it is unsupported by > firmware */ > + dev_warn(dev, "PHY unsupported by firmware\n"); > + xhci->quirks |= XHCI_SKIP_PHY_INIT; > + } > + if (ret) > + goto phy_exit; > + > + phy_power_off(phy); > +phy_exit: > + phy_exit(phy); > +phy_put: > + of_phy_put(phy); > +phy_out: > + You do power on and off again only want to know if PHY has already powered at ATF, right? -- Thanks, Peter Chen

Re: [PATCH] usb: host: xhci-plat: fix support for XHCI_SKIP_PHY_INIT quirk

2020-12-22 Thread Peter Chen
On 20-12-22 14:30:51, Pali Rohár wrote: > On Tuesday 22 December 2020 10:23:27 Pali Rohár wrote: > > On Tuesday 22 December 2020 02:14:45 Peter Chen wrote: > > > On 20-12-21 16:09:03, Pali Rohár wrote: > > > > Currently init_quirk callbacks for xh

Re: [PATCH] usb: host: xhci-plat: fix support for XHCI_SKIP_PHY_INIT quirk

2020-12-21 Thread Peter Chen
roblem you have met? In structure xhci_plat_priv, the quirks are defined at .quirks entry which is got at below code. .init_quirk is the routine if special initializations are needed. if (pdev->dev.of_node) priv_match = of_device_get_match_data(>dev); else

RE: [PATCH v1 5/8] usb: chipidea: tegra: Support host mode

2020-12-16 Thread Peter Chen
> >> > >> struct tegra_usb_soc_info { > >>unsigned long flags; > >> + unsigned int txfifothresh; > >> + enum usb_dr_mode dr_mode; > >> +}; > >> + > >> +static const struct tegra_usb_soc_info tegra20_ehci_soc_info = { > >> + .flags = CI_HDRC_REQUIRES_ALIGNED_DMA | > >> +

Re: [PATCH v1 5/8] usb: chipidea: tegra: Support host mode

2020-12-15 Thread Peter Chen
_length); > + urb->transfer_buffer = temp->data; > + > + urb->transfer_flags |= URB_ALIGNED_TEMP_BUFFER; > + > + return 0; > +} > + > +static int ci_hdrc_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, > +gfp_t mem_flags) > +{ > + int ret; > + > + ret = ci_hdrc_alloc_dma_aligned_buffer(urb, mem_flags); > + if (ret) > + return ret; > + > + ret = usb_hcd_map_urb_for_dma(hcd, urb, mem_flags); > + if (ret) > + ci_hdrc_free_dma_aligned_buffer(urb); > + > + return ret; > +} > + > +static void ci_hdrc_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) > +{ > + usb_hcd_unmap_urb_for_dma(hcd, urb); > + ci_hdrc_free_dma_aligned_buffer(urb); > +} > + > int ci_hdrc_host_init(struct ci_hdrc *ci) > { > struct ci_role_driver *rdrv; > @@ -366,6 +460,11 @@ int ci_hdrc_host_init(struct ci_hdrc *ci) > rdrv->name = "host"; > ci->roles[CI_ROLE_HOST] = rdrv; > > + if (ci->platdata->flags & CI_HDRC_REQUIRES_ALIGNED_DMA) { > + ci_ehci_hc_driver.map_urb_for_dma = ci_hdrc_map_urb_for_dma; > + ci_ehci_hc_driver.unmap_urb_for_dma = ci_hdrc_unmap_urb_for_dma; > + } > + > return 0; > } > > diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h > index 025b41687ce9..edf3342507f1 100644 > --- a/include/linux/usb/chipidea.h > +++ b/include/linux/usb/chipidea.h > @@ -88,6 +88,12 @@ struct ci_hdrc_platform_data { > struct pinctrl_state *pins_default; > struct pinctrl_state *pins_host; > struct pinctrl_state *pins_device; > + > + /* platform-specific hooks */ > + int (*hub_control)(struct ci_hdrc *ci, u16 typeReq, u16 wValue, > +u16 wIndex, char *buf, u16 wLength, > +bool *done, unsigned long *flags); > + void (*enter_lpm)(struct ci_hdrc *ci, bool enable); > }; > > /* Default offset of capability registers */ > -- > 2.29.2 > -- Thanks, Peter Chen

Re: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Peter Chen
m. I based on peter.chen-usb/for-usb-next. > >> > >> Also I can't open the url from kernel test robot report. > >> Maybe there is some temporary issue with server. > >> > > > >Thanks for checking it, I have already pushed your other four patches. > >Besides, there is still a build error issue for new cdns3 driver. > > > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-data=04%7C01%7Cpeter.chen%40nxp.com%7Cf036cd7630664c9e0c5c08d8a0c0a637%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637436096594708469%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=DLBFVB2px5GgA6Y%2FTU4DrfVru6z3P4RXz2x7BSpdE4o%3Dreserved=0 > >usb/msg206073.html__;!!EHscmS1ygiU1lA!X6rYk64ILtzjyHW903LAhBRjMKi9C2eyJWEXVlEZm0ly2BiNzY2wK46Ulq7q5w$ > > > > Did you applied: [PATCH] usb: cdnsp: Fix for undefined reference to > `usb_hcd_is_primary_hcd' ? > Applied now. -- Thanks, Peter Chen

Re: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Peter Chen
,7 @@ static u32 cdnsp_get_max_esit_payload(struct > >> usb_gadget *g, > >>/* SuperSpeedPlus Isoc ep sending over 48k per EIST. */ > >>if (g->speed >= USB_SPEED_SUPER_PLUS && > >>USB_SS_SSP_ISOC_COMP(pep->endpoint.desc->bmAttributes)) > >> - return le32_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); > >> + return le16_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); > >>/* SuperSpeed or SuperSpeedPlus Isoc ep with less than 48k per esit */ > >>else if (g->speed >= USB_SPEED_SUPER) > >>return le16_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); > >> @@ -1184,11 +1185,11 @@ static int cdnsp_setup_port_arrays(struct > >> cdnsp_device *pdev) > >> > >>trace_cdnsp_init("Found USB 2.0 ports and USB 3.0 ports."); > >> > >> - pdev->usb2_port.regs = (struct cdnsp_port_regs *) > >> + pdev->usb2_port.regs = (struct cdnsp_port_regs __iomem *) > >> (>op_regs->port_reg_base + NUM_PORT_REGS * > >>(pdev->usb2_port.port_num - 1)); > >> > >> - pdev->usb3_port.regs = (struct cdnsp_port_regs *) > >> + pdev->usb3_port.regs = (struct cdnsp_port_regs __iomem *) > >> (>op_regs->port_reg_base + NUM_PORT_REGS * > >>(pdev->usb3_port.port_num - 1)); > >> > >> diff --git a/drivers/usb/cdns3/cdnsp-ring.c > >> b/drivers/usb/cdns3/cdnsp-ring.c > >> index 874d9ff5406c..e15e13ba27dc 100644 > >> --- a/drivers/usb/cdns3/cdnsp-ring.c > >> +++ b/drivers/usb/cdns3/cdnsp-ring.c > >> @@ -1432,7 +1432,7 @@ static bool cdnsp_handle_event(struct cdnsp_device > >> *pdev) > >>unsigned int comp_code; > >>union cdnsp_trb *event; > >>bool update_ptrs = true; > >> - __le32 cycle_bit; > >> + u32 cycle_bit; > >>int ret = 0; > >>u32 flags; > >> > >> @@ -2198,7 +2198,7 @@ static int cdnsp_queue_isoc_tx(struct cdnsp_device > >> *pdev, > >> * inverted in the first TDs isoc TRB. > >> */ > >>field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) | > >> - !start_cycle | TRB_SIA | TRB_TBC(burst_count); > >> + start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count); > >> > >>/* Fill the rest of the TRB fields, and remaining normal TRBs. */ > >>for (i = 0; i < trbs_per_td; i++) { > >> diff --git a/drivers/usb/cdns3/cdnsp-trace.h > >> b/drivers/usb/cdns3/cdnsp-trace.h > >> index b68e282464d2..a9de1daadf07 100644 > >> --- a/drivers/usb/cdns3/cdnsp-trace.h > >> +++ b/drivers/usb/cdns3/cdnsp-trace.h > >> @@ -620,7 +620,7 @@ DECLARE_EVENT_CLASS(cdnsp_log_slot_ctx, > >>TP_fast_assign( > >>__entry->info = le32_to_cpu(ctx->dev_info); > >>__entry->info2 = le32_to_cpu(ctx->dev_port); > >> - __entry->int_target = le64_to_cpu(ctx->int_target); > >> + __entry->int_target = le32_to_cpu(ctx->int_target); > >>__entry->state = le32_to_cpu(ctx->dev_state); > >>), > >>TP_printk("%s", cdnsp_decode_slot_context(__entry->info, > >> -- > >> 2.17.1 > >> > > -- > > Regards > Pawel Laszcak -- Thanks, Peter Chen

Re: [PATCH] usb: cdns3: Adds missing __iomem markers

2020-12-14 Thread Peter Chen
n"); > 463 return ret; >464} >465 >466state = readl(>otg_regs->sts); >467if (OTGSTS_OTG_NRDY(state)) { >468dev_err(cdns->dev, "Cadence USB3 OTG device not > ready\n"); >469return -ENODEV; >470} >471 >472return 0; >473} >474 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fhyperkitty%2Flist%2Fkbuild-all%40lists.01.orgdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=v9fQGKZKobtIysXu43lCekV%2FoXCc2EZZXIxoTtQpSdw%3Dreserved=0 -- Thanks, Peter Chen

Re: [PATCH -next] usb: phy: convert comma to semicolon

2020-12-14 Thread Peter Chen
On 20-12-11 16:54:28, Zheng Yongjun wrote: > Replace a comma between expression statements by a semicolon. > > Signed-off-by: Zheng Yongjun Reviewed-by: Peter Chen Peter > --- > drivers/usb/phy/phy-isp1301-omap.c | 10 +- > 1 file changed, 5 insertions(+), 5 dele

Re: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Peter Chen
(struct cdnsp_device > *pdev) > unsigned int comp_code; > union cdnsp_trb *event; > bool update_ptrs = true; > - __le32 cycle_bit; > + u32 cycle_bit; > int ret = 0; > u32 flags; > > @@ -2198,7 +2198,7 @@ static int cdnsp_queue_isoc_tx(struct cdnsp_device > *pdev, >* inverted in the first TDs isoc TRB. >*/ > field = TRB_TYPE(TRB_ISOC) | TRB_TLBPC(last_burst_pkt) | > - !start_cycle | TRB_SIA | TRB_TBC(burst_count); > + start_cycle ? 0 : 1 | TRB_SIA | TRB_TBC(burst_count); > > /* Fill the rest of the TRB fields, and remaining normal TRBs. */ > for (i = 0; i < trbs_per_td; i++) { > diff --git a/drivers/usb/cdns3/cdnsp-trace.h b/drivers/usb/cdns3/cdnsp-trace.h > index b68e282464d2..a9de1daadf07 100644 > --- a/drivers/usb/cdns3/cdnsp-trace.h > +++ b/drivers/usb/cdns3/cdnsp-trace.h > @@ -620,7 +620,7 @@ DECLARE_EVENT_CLASS(cdnsp_log_slot_ctx, > TP_fast_assign( > __entry->info = le32_to_cpu(ctx->dev_info); > __entry->info2 = le32_to_cpu(ctx->dev_port); > - __entry->int_target = le64_to_cpu(ctx->int_target); > + __entry->int_target = le32_to_cpu(ctx->int_target); > __entry->state = le32_to_cpu(ctx->dev_state); > ), > TP_printk("%s", cdnsp_decode_slot_context(__entry->info, > -- > 2.17.1 > -- Thanks, Peter Chen

Re: linux-next: Tree for Dec 9 (usb/cdns3)

2020-12-10 Thread Peter Chen
NS3=m > CONFIG_USB_CDNS3_GADGET=y > CONFIG_USB_CDNS3_HOST=y > > Problem is mostly that CONFIG_USB=m and CONFIG_USB_GADGET=y. > > > Full randconfig file is attached. > > > thanks. > -- > ~Randy > Reported-by: Randy Dunlap -- Thanks, Peter Chen

Re: [PATCH v5 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-12-09 Thread Peter Chen
th USBSS driver. > the patch 10: Adds USBSSP DRD IP driver entry to MAINTAINERS file. Pawel, there are several issues are reported for this patch set after I add it to my -next tree, and the merge windows is near. I drop this set for v5.11-rc1, but keep it at my -next tree. Peter > > Chan

Re: [PATCH] PCI: Remove pci_try_set_mwi

2020-12-09 Thread Peter Chen
On 20-12-09 09:31:21, Heiner Kallweit wrote: > drivers/usb/chipidea/ci_hdrc_pci.c| 2 +- For chipidea changes: Acked-by: Peter Chen Peter > drivers/usb/gadget/udc/amd5536udc_pci.c | 2 +- > drivers/usb/gadget/udc/net2280.c | 2 +- > drivers/us

RE: [PATCH -next] usb: cdns3: fix warning when USB_CDNS_HOST is not set

2020-12-08 Thread Peter Chen
ct usb_hcd *hcd) >^~~ > Applied both, thanks. Peter > Signed-off-by: Randy Dunlap > Cc: Peter Chen > Cc: Pawel Laszczak > Cc: Roger Quadros > Cc: linux-...@vger.kernel.org > Cc: Greg Kroah-Hartman > --- > dri

Re: [PATCH -next] usb: cdnsp: Mark cdnsp_gadget_ops with static keyword

2020-12-08 Thread Peter Chen
.wakeup = cdnsp_gadget_wakeup, > .set_selfpowered = cdnsp_gadget_set_selfpowered, > -- Applied, thanks. -- Thanks, Peter Chen

Re: [PATCH] drivers: usb: gadget: prefer pr_*() functions over raw printk()

2020-12-08 Thread Peter Chen
; > + pr_info("fusb300_ep0fail\n"); > } > > if (int_grp1 & FUSB300_IGR1_CX_SETUP_INT) { > - printk(KERN_INFO "fusb300_ep0setup\n"); > + pr_info("fusb300_ep0setup\n"); > if (setup_packet(fusb300, )) { > spin_unlock(>lock); > if (fusb300->driver->setup(>gadget, ) < 0) > @@ -1209,16 +1209,16 @@ static irqreturn_t fusb300_irq(int irq, void > *_fusb300) > } > > if (int_grp1 & FUSB300_IGR1_CX_CMDEND_INT) > - printk(KERN_INFO "fusb300_cmdend\n"); > + pr_info("fusb300_cmdend\n"); > > > if (int_grp1 & FUSB300_IGR1_CX_OUT_INT) { > - printk(KERN_INFO "fusb300_cxout\n"); > + pr_info("fusb300_cxout\n"); > fusb300_ep0out(fusb300); > } > > if (int_grp1 & FUSB300_IGR1_CX_IN_INT) { > - printk(KERN_INFO "fusb300_cxin\n"); > + pr_info("fusb300_cxin\n"); > fusb300_ep0in(fusb300); > } > > diff --git a/drivers/usb/gadget/udc/goku_udc.c > b/drivers/usb/gadget/udc/goku_udc.c > index 3e1267d38774..4f225552861a 100644 > --- a/drivers/usb/gadget/udc/goku_udc.c > +++ b/drivers/usb/gadget/udc/goku_udc.c > @@ -1748,7 +1748,7 @@ static int goku_probe(struct pci_dev *pdev, const > struct pci_device_id *id) > int retval; > > if (!pdev->irq) { > - printk(KERN_ERR "Check PCI %s IRQ setup!\n", pci_name(pdev)); > + pr_err("Check PCI %s IRQ setup!\n", pci_name(pdev)); > retval = -ENODEV; > goto err; > } > diff --git a/drivers/usb/gadget/udc/r8a66597-udc.h > b/drivers/usb/gadget/udc/r8a66597-udc.h > index 9a115caba661..fa4d62c32ea1 100644 > --- a/drivers/usb/gadget/udc/r8a66597-udc.h > +++ b/drivers/usb/gadget/udc/r8a66597-udc.h > @@ -247,7 +247,7 @@ static inline u16 get_xtal_from_pdata(struct > r8a66597_platdata *pdata) > clock = XTAL48; > break; > default: > - printk(KERN_ERR "r8a66597: platdata clock is wrong.\n"); > + pr_err("r8a66597: platdata clock is wrong.\n"); > break; > } > > -- > 2.11.0 > -- Thanks, Peter Chen

RE: [RESEND PATCH] MAINTAINERS: Add myself as a reviewer for CADENCE USB3 DRD IP DRIVER

2020-12-08 Thread Peter Chen
> Resending the patch to add more viewers. > > > > MAINTAINERS | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/MAINTAINERS b/MAINTAINERS index > > 6aac0f845f34..ff9bd7d18d94 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > >

RE: [PATCH v5 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-12-08 Thread Peter Chen
ader file for driver, 7 is the main part that implements all > functionality of driver and 8 introduces tracepoints. > The patch 9: Adds cdns3 prefixes to files related with USBSS driver. > the patch 10: Adds USBSSP DRD IP driver entry to MAINTAINERS file. > Applied, tha

RE: [PATCH 04/15] usb: misc: ehset: update to use the usb_control_msg_{send|recv}() API

2020-12-06 Thread Peter Chen
> For this reason, instances of usb_control_msg() have been replaced with > usb_control_msg_{recv|send}() appropriately. > > Signed-off-by: Anant Thazhemadam Reviewed-by: Peter Chen Peter > --- > drivers/usb/misc/ehset.c | 70 ++-- > 1 file

Re: [PATCH v4 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-12-05 Thread Peter Chen
On 20-12-05 11:12:44, Aswath Govindraju wrote: > Hi, > On 04/12/20 6:49 am, Peter Chen wrote: > > > >> This patch introduce new Cadence USBSS DRD driver to linux kernel. > >> > >> The Cadence USBSS DRD Controller is a highly configurable IP Core which can &

Re: [PATCH v4 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-12-03 Thread Peter Chen
rs/usb/cdns3/cdns3-plat.c @@ -4,7 +4,7 @@ * * Copyright (C) 2018-2020 Cadence. * Copyright (C) 2017-2018 NXP - * Copyright (C) 2019 Texas Instrumentsq + * Copyright (C) 2019 Texas Instruments * * * Author: Peter Chen static int cdns3_plat_runtime_resume(struct device *dev) { -

RE: [PATCH v4 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-12-03 Thread Peter Chen
fixes > > Changlog from v2: > - removed not used pdev parameter from cdnsp_read/wite_64 functions > - fixed incorrect value assigned to CDNSP_ENDPOINTS_NUM (32 -> 31) > - replaced some constant value with CDNSP_ENDPOINTS_NUM macro > - replaced 'true' with '1' in bits description in cdnsp

RE: linux-next: Signed-off-by missing for commit in the usb-chipidea-next tree

2020-12-01 Thread Peter Chen
> > Hi all, > > Commits > > b140b354d127 ("usb: typec: Add type sysfs attribute file for partners") > a67ad71c6468 ("usb: common: ulpi: Constify static attribute_group struct") > 61336e5db8f9 ("usb: typec: Constify static attribute_group structs") > f18890ead25d ("USB: core: Constify

Re: [PATCH v2 1/5] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above

2020-12-01 Thread Peter Chen
> > From: Will McVicker > Reviewed-by: Peter Chen Peter > Align the SuperSpeed Plus bitrate for f_rndis to match f_ncm's ncm_bitrate > defined by commit 1650113888fe ("usb: gadget: f_ncm: add SuperSpeed > descriptors > for CDC NCM"). > > Cc: Felipe Balbi

Re: [PATCH v2 1/5] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above

2020-11-29 Thread Peter Chen
: Felipe Balbi > Cc: EJ Hsu > Cc: Peter Chen > Cc: stable > Signed-off-by: Will McVicker > Signed-off-by: Greg Kroah-Hartman > --- > drivers/usb/gadget/function/f_rndis.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadg

Re: [PATCH v2 5/5] USB: gadget: f_fs: remove likely/unlikely

2020-11-29 Thread Peter Chen
t; it actually matters. > > Cc: Felipe Balbi > Reported-by: Peter Chen > Signed-off-by: Greg Kroah-Hartman Reviewed-by: Peter Chen > --- > drivers/usb/gadget/function/f_fs.c | 179 ++--- > 1 file changed, 89 insertions(+), 90 deletions(-) > >

Re: [PATCH 4/4] USB: gadget: f_midi: setup SuperSpeed Plus descriptors

2020-11-27 Thread Peter Chen
f->ss_descriptors) > goto fail_f_midi; Add one blank line, otherwise: Reviewed-by: Peter Chen Peter > + if (gadget_is_superspeed_plus(c->cdev->gadget)) { > + f->ssp_descriptors = > usb_copy_descriptors(midi_fun

RE: [PATCH] usb: cdns3: Fix hardware based role switch

2020-11-27 Thread Peter Chen
> Hi Peter, > > On 25/11/2020 14:49, Roger Quadros wrote: > > Hardware based role switch is broken as the driver always skips it. > > Fix this by registering for SW role switch only if 'usb-role-switch' > > property is present in the device tree. > > > > Fixes: 50642709f659 ("usb: cdns3: core:

RE: [PATCH v3 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-11-24 Thread Peter Chen
>>> The patch 9: Adds cdns3 prefixes to files related with USBSS driver. > >>> the patch 10: Adds USBSSP DRD IP driver entry to MAINTAINERS file. > >>> > >>> Changlog from v2: > >>> - removed not used pdev parameter from cdnsp_read/wite_64

Re: [PATCH v3 10/10] MAINTAINERS: add Cadence USBSSP DRD IP driver entry

2020-11-24 Thread Peter Chen
t; +X: drivers/usb/cdns3/cdnsp* > + > +CADENCE USBSSP DRD IP DRIVER > +M: Pawel Laszczak > +L: linux-...@vger.kernel.org > +S: Maintained > +F: drivers/usb/cdns3/ > +X: drivers/usb/cdns3/cdns3* > Hi Pawel, You may add "T" for which tree for cdns3 ssp driver. -- Thanks, Peter Chen

Re: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch class"

2020-11-24 Thread Peter Chen
On 20-11-24 14:22:25, Roger Quadros wrote: > Peter, > > On 24/11/2020 13:47, Peter Chen wrote: > > On 20-11-24 12:33:34, Roger Quadros wrote: > > > > > > > > > > > > I am sorry about that. Do you use role switch /sys entry, if you > >

Re: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch class"

2020-11-24 Thread Peter Chen
); > - goto err3; > + if (device_property_read_bool(cdns->dev, "usb-role-switch")) { > + cdns->role_sw = usb_role_switch_register(dev, _desc); > + if (IS_ERR(cdns->role_sw)) { > + ret = PTR_ERR(cdns->role_sw); > + dev_warn(dev, "Unable to register Role Switch\n"); > + goto err3; > + } > } > if (cdns->wakeup_irq) { > > > > cheers, > -roger > -- > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- Thanks, Peter Chen

RE: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch class"

2020-11-24 Thread Peter Chen
Best regards, Peter Chen > -Original Message- > From: Roger Quadros > Sent: 2020年11月24日 17:39 > To: Peter Chen > Cc: paw...@cadence.com; gre...@linuxfoundation.org; ba...@kernel.org; > linux-...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATC

Re: [PATCH v3 00/10] Introduced new Cadence USBSSP DRD Driver.

2020-11-23 Thread Peter Chen
with CDNSP_ENDPOINTS_NUM macro > - replaced 'true' with '1' in bits description in cdnsp-gadget.h file > - fixed some typos > - some other less important changes suggested by Peter Chen Hi Pawel, I have updated my -next tree as the latest usb-next tree which v5.10-rc4 is included, would y

Re: [PATCH] usb: cdns3: fix NULL pointer dereference on no platform data

2020-11-23 Thread Peter Chen
t;quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW) > + if (cdns->pdata && (cdns->pdata->quirks & > CDNS3_DEFAULT_PM_RUNTIME_ALLOW)) > cdns->xhci_plat_data->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; > > ret = platform_device_add_data(xhci, cdns->xhci_plat_data, Thanks for fixing it, already applied to -next tree. -- Thanks, Peter Chen

Re: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch class"

2020-11-23 Thread Peter Chen
quot;usb-role-switch" property at dts to judge if SoC OTG signals or external signals for role switch. If you have not used it, I prefer only setting cdns->role_sw for role switch use cases. -- Thanks, Peter Chen

Re: [PATCH v2] usb: gadget: mass_storage: fix error return code in msg_bind()

2020-11-16 Thread Peter Chen
tor by otg capabilities") > Reported-by: Hulk Robot > Signed-off-by: Chen Zhou Reviewed-by: Peter Chen Peter > --- > drivers/usb/gadget/legacy/mass_storage.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/legacy/mass_storag

Re: [PATCH 3/3] usb: gadget: configfs: Add a specific configFS reset callback

2020-11-16 Thread Peter Chen
y: Wesley Cheng Reviewed-by: Peter Chen > --- > drivers/usb/gadget/configfs.c | 24 +++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c > index 56051bb97349..80ca7ff2fb97 100644 >

Re: [PATCH 2/3] usb: gadget: composite: Split composite reset and disconnect

2020-11-16 Thread Peter Chen
e 500/900 mA (HS/SS) while in the CONFIGURED state, and only 100 mA > in the connected and UNCONFIGURED state. > > Signed-off-by: Wesley Cheng Reviewed-by: Peter Chen Peter > --- > drivers/usb/gadget/composite.c | 21 +++-- > include/linux/usb/composite.h

Re: [PATCH 1/3] usb: dwc3: gadget: Introduce a DWC3 VBUS draw callback

2020-11-16 Thread Peter Chen
.udc_set_speed = dwc3_gadget_set_speed, > .get_config_params = dwc3_gadget_config_params, > + .vbus_draw = dwc3_gadget_vbus_draw, > }; > Reviewed-by: Peter Chen -- Thanks, Peter Chen

RE: linux-next: build failure after merge of the usb-chipidea-next tree

2020-11-13 Thread Peter Chen
> > After merging the usb-chipidea-next tree, today's linux-next build (powerpc > allyesconfig) failed like this: > > In file included from drivers/usb/chipidea/trace.h:18, > from drivers/usb/chipidea/trace.c:11: > drivers/usb/chipidea/ci.h: In function 'ci_otg_is_fsm_mode':

RE: linux-next: Fixes tag needs some work in the usb-chipidea-fixes tree

2020-11-12 Thread Peter Chen
> > In commit > > 3d4ee0b42f65 ("usb: cdns3: gadget: initialize link_trb as NULL") > > Fixes tag > > Fixes: 4e218882eb5a ("usb: cdns3: gadget: improve the dump TRB operation > > has these problem(s): > > - Subject has leading but no trailing parentheses > - Subject has leading but

Re: [PATCH v2 08/10] usb: cdnsp: Add tracepoints for CDNSP driver

2020-11-10 Thread Peter Chen
On 20-11-06 12:42:58, Pawel Laszczak wrote: > Patch adds the series of tracepoints that can be used for > debugging issues detected in driver. > > Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen > --- > drivers/usb/cdns3/Makefile | 5 + > drivers/usb/cdns3

Re: [PATCH v2 09/10] usb: cdns3: Change file names for cdns3 driver.

2020-11-10 Thread Peter Chen
7a7a9dd 100644 > --- a/drivers/usb/cdns3/trace.h > +++ b/drivers/usb/cdns3/cdns3-trace.h > @@ -19,8 +19,8 @@ > #include > #include > #include "core.h" > -#include "gadget.h" > -#include "debug.h" > +#include "cdns3-gadget.h" > +#include "cdns3-debug.h" > > #define CDNS3_MSG_MAX500 > > @@ -565,6 +565,6 @@ DEFINE_EVENT(cdns3_log_request_handled, > cdns3_request_handled, > #define TRACE_INCLUDE_PATH . > > #undef TRACE_INCLUDE_FILE > -#define TRACE_INCLUDE_FILE trace > +#define TRACE_INCLUDE_FILE cdns3-trace > > #include > -- > 2.17.1 > -- Thanks, Peter Chen

Re: [PATCH v2 06/10] usb: cdnsp: Device side header file for CDNSP driver

2020-11-10 Thread Peter Chen
On 20-11-06 12:42:56, Pawel Laszczak wrote: > Patch defines macros, registers and structures used by > Device side driver. > > Because the size of main patch is very big, I’ve decided to create > separate patch for cdnsp-gadget.h. It should simplify reviewing the code. > > Signed-off-by: Pawel

Re: [PATCH v2 03/10] usb: cdns3: Moves reusable code to separate module

2020-11-10 Thread Peter Chen
ivers/usb/cdns3/drd.h > >> +++ b/drivers/usb/cdns3/drd.h > >> @@ -209,8 +209,8 @@ int cdns3_get_vbus(struct cdns3 *cdns); > >> int cdns3_drd_init(struct cdns3 *cdns); > >> int cdns3_drd_exit(struct cdns3 *cdns); > >> int cdns3_drd_update_mode(struct cdns3 *cdns); > >> -int cdns3_drd_gadget_on(struct cdns3 *cdns); > >> -void cdns3_drd_gadget_off(struct cdns3 *cdns); > >> +extern int cdns3_drd_gadget_on(struct cdns3 *cdns); > >> +extern void cdns3_drd_gadget_off(struct cdns3 *cdns); > >> int cdns3_drd_host_on(struct cdns3 *cdns); > >> void cdns3_drd_host_off(struct cdns3 *cdns); > >> > >> -- > >> 2.17.1 > >> > > -- > Thanks > Pawel Laszczak -- Thanks, Peter Chen

Re: [PATCH v2 03/10] usb: cdns3: Moves reusable code to separate module

2020-11-10 Thread Peter Chen
ct cdns3 *cdns) > > return ret; > } > +EXPORT_SYMBOL_GPL(cdns3_init); > > /** > * cdns3_remove - unbind drd driver and clean up > @@ -487,6 +490,7 @@ int cdns3_remove(struct cdns3 *cdns) > > return 0; > } > +EXPORT_SYMBOL_GPL(cdns3_remove); &

Re: [PATCH v2 01/10] usb: cdns3: Add support for DRD CDNSP

2020-11-10 Thread Peter Chen
PHYRST_A_ENABLE BIT(0) > @@ -170,6 +214,5 @@ int cdns3_drd_gadget_on(struct cdns3 *cdns); > void cdns3_drd_gadget_off(struct cdns3 *cdns); > int cdns3_drd_host_on(struct cdns3 *cdns); > void cdns3_drd_host_off(struct cdns3 *cdns); > -int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode); > > #endif /* __LINUX_CDNS3_DRD */ > -- > 2.17.1 > -- Thanks, Peter Chen

Re: [PATCH] Fix default q_len for usb_f_printer gadget driver

2020-10-30 Thread Peter Chen
d-off-by: Michael R Sweet Reviewed-by: Peter Chen Peter > --- > drivers/usb/gadget/function/f_printer.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/drivers/usb/gadget/function/f_printer.c > b/drivers/usb/gadget/function/f_printer.c > index 9c7ed2539ff7

RE: [PATCH v2 31/39] docs: ABI: cleanup several ABI documents

2020-10-30 Thread Peter Chen
Acked-by: Peter Chen For: Documentation/ABI/testing/usb-charger-uevent Peter

Re: [PATCH 05/17] phy: freescale: convert to devm_platform_ioremap_resource

2020-10-29 Thread Peter Chen
return PTR_ERR(imx_phy->clk); > } > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - imx_phy->base = devm_ioremap_resource(dev, res); > + imx_phy->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(imx_phy->base)) > return PTR_ERR(imx_phy->base); > Reviewed-by: Peter Chen -- Thanks, Peter Chen

Re: [PATCH 04/17] phy: cadence: convert to devm_platform_ioremap_resource

2020-10-29 Thread Peter Chen
void __iomem *base; > struct clk *clk; > @@ -502,8 +501,7 @@ static int cdns_sierra_phy_probe(struct platform_device > *pdev) > sp->dev = dev; > sp->init_data = data; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = de

RE: [PATCH v3] usb: cdns3: Variable 'length' set but not used

2020-10-28 Thread Peter Chen
> Peter, > > It looks like you missed the " [PATCH v3] usb: cdns3: Variable 'length' set > but > not used" > > It's quite important because compiler complains for this when I use W=1. > Pawel, it is the bug-fix, and located at branch: for-usb-fixes. > Thanks, > Pawel > > >> > > >> > A

RE: [PATCH v3] usb: cdns3: Variable 'length' set but not used

2020-10-28 Thread Peter Chen
> > > > >> Peter, > >> > >> It looks like you missed the " [PATCH v3] usb: cdns3: Variable > >> 'length' set but not used" > >> > >> It's quite important because compiler complains for this when I use W=1. > >> > > > >Pawel, it is the bug-fix, and located at branch: for-usb-fixes. > > But I

RE: [PATCH v3] usb: cdns3: Variable 'length' set but not used

2020-10-26 Thread Peter Chen
> > > > A gentle ping. > > > > I assume that you should add this and the rest overdue cdsn3 patches > > as first to you ci-for-usb-next branch. > > Am I right? > > > > Hi Pawel, > > I queued them locally, and I waited for v5.10-rc1 which was out yesterday, > then > I will apply them, and add

RE: [PATCH v3] usb: cdns3: Variable 'length' set but not used

2020-10-26 Thread Peter Chen
> > A gentle ping. > > I assume that you should add this and the rest overdue cdsn3 patches as first > to you ci-for-usb-next branch. > Am I right? > Hi Pawel, I queued them locally, and I waited for v5.10-rc1 which was out yesterday, then I will apply them, and add cdns3 patches to my

RE: [PATCH] usb: gadget: fsl: fix null pointer checking

2020-10-16 Thread Peter Chen
ct ep_queue_head *qh; > > - if (!_ep || _ep->desc || !(_ep->desc->bEndpointAddress&0xF)) > + if (!_ep || !_ep->desc || !(_ep->desc->bEndpointAddress&0xF)) > return -ENODEV; > Reviewed-by: Peter Chen Peter

RE: [PATCH v3] usb: cdns3: Rids of duplicate error message

2020-10-13 Thread Peter Chen
> On failure, the platform_get_irq_byname prints an error message so, patch typo, "message, so patch..." Otherwise: Acked-by: Peter Chen Peter > removes error message related to this function from core.c file. > > A change was suggested during reviewing CDNSP

Re: [PATCH v2] usb: cdns3: Rids of duplicate error message

2020-10-12 Thread Peter Chen
; > cdns->dev_regs = regs; > > > cdns->otg_irq = platform_get_irq_byname(pdev, "otg"); > > > - if (cdns->otg_irq == -EPROBE_DEFER) > > > - return cdns->otg_irq; > > > - > > > - if (cdns->otg_irq < 0) { > > > - dev_err(dev, "couldn't get otg irq\n"); > > > + if (cdns->otg_irq < 0) > > > return cdns->otg_irq; > > > - } > > > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg"); > > > if (!res) { > > > > > > > -- > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- Thanks, Peter Chen

  1   2   3   4   5   6   7   8   9   10   >