RE: [PATCH v2 5/8] usb: chipidea: imx: add imx7ulp support

2019-05-14 Thread Peter Chen
> > On Tue, May 14, 2019 at 4:39 AM Peter Chen wrote: > > > > Add imx7ulp support > > Since you are adding a new flag CI_HDRC_PMQOS, it would be nice to expand the > commit log a bit to explain about it. Ok, I will. Thanks. Peter

[PATCH v2 0/8] Add imx7ulp USBOTG1 support

2019-05-14 Thread Peter Chen
unction is tested at imx7ulp-evk board. Thanks. Peter Chen (8): doc: dt-binding: mxs-usb-phy: add compatible for 7ulp usb: phy: phy-mxs-usb: add imx7ulp support doc: dt-binding: ci-hdrc-usb2: add compatible string for imx7ulp doc: dt-binding: usbmisc-imx: add compatible string for imx7ulp

[PATCH v2 1/8] doc: dt-binding: mxs-usb-phy: add compatible for 7ulp

2019-05-14 Thread Peter Chen
Add compatible for 7ulp USB PHY. Reviewed-by: Rob Herring Signed-off-by: Peter Chen --- Documentation/devicetree/bindings/phy/mxs-usb-phy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/mxs-usb-phy.txt b/Documentation/devicetree/bindings/phy/mxs

[PATCH v2 2/8] usb: phy: phy-mxs-usb: add imx7ulp support

2019-05-14 Thread Peter Chen
At imx7ulp, the USB related analog register is located in PHY register region too, so we need to control PLL at PHY driver directly. Signed-off-by: Peter Chen --- drivers/usb/phy/phy-mxs-usb.c | 76 ++- 1 file changed, 75 insertions(+), 1 deletion

[PATCH v2 7/8] ARM: dts: imx7ulp-evk: enable USBOTG1 support

2019-05-14 Thread Peter Chen
Enable USBOTG1 support for evk board, it is dual-role function port. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx7ulp-evk.dts | 35 +++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/imx7ulp-evk.dts b/arch/arm/boot/dts/imx7ulp-evk.dts

[PATCH v2 8/8] usb: chipidea: imx: "fsl,usbphy" phandle is not mandatory now

2019-05-14 Thread Peter Chen
Since the chipidea common code support get the USB PHY phandle from "phys", the glue layer is not mandatory to get the "fsl,usbphy" phandle any more. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH v2 6/8] ARM: dts: imx7ulp: add imx7ulp USBOTG1 support

2019-05-14 Thread Peter Chen
Add imx7ulp USBOTG1 support. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx7ulp.dtsi | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/imx7ulp.dtsi b/arch/arm/boot/dts/imx7ulp.dtsi index fca6e50f37c8..60c9ea116d0a 100644 --- a/arch/arm

[PATCH v2 4/8] doc: dt-binding: usbmisc-imx: add compatible string for imx7ulp

2019-05-14 Thread Peter Chen
Add compatible string for imx7ulp Reviewed-by: Rob Herring Signed-off-by: Peter Chen --- Documentation/devicetree/bindings/usb/usbmisc-imx.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt b/Documentation/devicetree/bindings/usb

[PATCH v2 5/8] usb: chipidea: imx: add imx7ulp support

2019-05-14 Thread Peter Chen
Add imx7ulp support Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 28 +++- drivers/usb/chipidea/usbmisc_imx.c | 4 include/linux/usb/chipidea.h | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea

[PATCH v2 3/8] doc: dt-binding: ci-hdrc-usb2: add compatible string for imx7ulp

2019-05-14 Thread Peter Chen
Add compatible string for imx7ulp. Reviewed-by: Rob Herring Signed-off-by: Peter Chen --- Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb

RE: [PATCH v3] usb: core: verify devicetree nodes for USB devices

2019-05-13 Thread Peter Chen
> On 2019-05-13 11:00, Peter Chen wrote: > >> On 2019-05-10 05:10, Peter Chen wrote: > >>>> Marek Szyprowski writes: > >>>>> Commit 69bec7259853 ("USB: core: let USB device know device node") > >>>>> added support fo

RE: [PATCH v3] usb: core: verify devicetree nodes for USB devices

2019-05-13 Thread Peter Chen
> > On 2019-05-10 05:10, Peter Chen wrote: > > > >> Marek Szyprowski writes: > >>> Commit 69bec7259853 ("USB: core: let USB device know device node") > >>> added support for attaching devicetree node for USB devices. The > >>>

RE: [PATCH 6/7] ARM: dts: imx7ulp: add imx7ulp USBOTG1 support

2019-05-06 Thread Peter Chen
> > > > ++ > > > > 1 file changed, 30 insertions(+) > > > > > > > > diff --git a/arch/arm/boot/dts/imx7ulp.dtsi > > > > b/arch/arm/boot/dts/imx7ulp.dtsi index fca6e50f37c8..e2944f98eac6 > > > > 100644 > > > > --- a/arch/arm/boot/dts/imx7ulp.dtsi > > > > +++ b/arch/arm

RE: [PATCH 6/7] ARM: dts: imx7ulp: add imx7ulp USBOTG1 support

2019-05-04 Thread Peter Chen
> > --- > > arch/arm/boot/dts/imx7ulp.dtsi | 30 ++ > > 1 file changed, 30 insertions(+) > > > > diff --git a/arch/arm/boot/dts/imx7ulp.dtsi > > b/arch/arm/boot/dts/imx7ulp.dtsi index fca6e50f37c8..e2944f98eac6 > > 100644 > > --- a/arch/arm/boot/dts/imx7ulp.dtsi > > +

[PATCH 5/7] usb: chipidea: imx: add imx7ulp support

2019-04-27 Thread Peter Chen
Add imx7ulp support Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 28 +++- drivers/usb/chipidea/usbmisc_imx.c | 4 include/linux/usb/chipidea.h | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea

[PATCH 7/7] ARM: dts: imx7ulp-evk: enable USBOTG1 support

2019-04-27 Thread Peter Chen
Enable USBOTG1 support for evk board, it is dual-role function port. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx7ulp-evk.dts | 35 +++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/imx7ulp-evk.dts b/arch/arm/boot/dts/imx7ulp-evk.dts

[PATCH 6/7] ARM: dts: imx7ulp: add imx7ulp USBOTG1 support

2019-04-27 Thread Peter Chen
Add imx7ulp USBOTG1 support. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx7ulp.dtsi | 30 ++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/boot/dts/imx7ulp.dtsi b/arch/arm/boot/dts/imx7ulp.dtsi index fca6e50f37c8..e2944f98eac6 100644 --- a/arch/arm

[PATCH 4/7] doc: dt-binding: usbmisc-imx: add compatible string for imx7ulp

2019-04-27 Thread Peter Chen
Add compatible string for imx7ulp Signed-off-by: Peter Chen --- Documentation/devicetree/bindings/usb/usbmisc-imx.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/usbmisc-imx.txt b/Documentation/devicetree/bindings/usb/usbmisc-imx.txt index

[PATCH 3/7] doc: dt-binding: ci-hdrc-usb2: add compatible string for imx7ulp

2019-04-27 Thread Peter Chen
Add compatible string for imx7ulp. Signed-off-by: Peter Chen --- Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt index

[PATCH 1/7] doc: dt-binding: mxs-usb-phy: add compatible for 7ulp

2019-04-27 Thread Peter Chen
Add compatible for 7ulp USB PHY. Signed-off-by: Peter Chen --- Documentation/devicetree/bindings/phy/mxs-usb-phy.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/mxs-usb-phy.txt b/Documentation/devicetree/bindings/phy/mxs-usb-phy.txt index

[PATCH 0/7] Add imx7ulp USBOTG1 support

2019-04-27 Thread Peter Chen
There is a dual-role USB controller at imx7ulp, we add support for it in this patch set, and the dual-role function is tested at imx7ulp-evk board. Thanks. Peter Chen (7): doc: dt-binding: mxs-usb-phy: add compatible for 7ulp usb: phy: phy-mxs-usb: add imx7ulp support doc: dt-binding: ci

[PATCH 2/7] usb: phy: phy-mxs-usb: add imx7ulp support

2019-04-27 Thread Peter Chen
At imx7ulp, the USB related analog register is located in PHY register region too, so we need to control PLL at PHY driver directly. Signed-off-by: Peter Chen --- drivers/usb/phy/phy-mxs-usb.c | 76 ++- 1 file changed, 75 insertions(+), 1 deletion

Re: [EXT] Re: Why there is a refcnt check when we change configfs property

2019-04-15 Thread Peter Chen
On Mon, Apr 15, 2019 at 5:40 PM Andrzej Pietrasiewicz wrote: > > Hi Peter, > > > > >> > >> Can you please describe your use case? > >> > >> Andrzej > > > > I would like to change parameters for function driver through configfs, > > below is the example for ncm and f_sourcesink cases, > > thanks.

RE: [EXT] Re: Why there is a refcnt check when we change configfs property

2019-04-11 Thread Peter Chen
> > > >>> > >>> Andrzej, would you tell us why you introduce refcnt for driver's > >>> configfs opts? And why it is needed to judge for "store" operation? > >>> > >> > >> The reason is that a function can be linked to more than one > >> configuration. Imagine this sequence: you create a function,

RE: Why there is a refcnt check when we change configfs property

2019-04-08 Thread Peter Chen
> > > > Andrzej, would you tell us why you introduce refcnt for driver's > > configfs opts? And why it is needed to judge for "store" operation? > > > > The reason is that a function can be linked to more than one configuration. > Imagine > this sequence: you create a function, set its paramete

RE: Why there is a refcnt check when we change configfs property

2019-04-04 Thread Peter Chen
> > Peter Chen writes: > > Hi Felipe, > > > > Do you know why? In that case, I can't change property, eg changing > > qmult at NCM like below: > > > > mkdir functions/ncm.0 > > ln -s functions/ncm.0 configs/c.1 > > echo 10 >

Why there is a refcnt check when we change configfs property

2019-04-02 Thread Peter Chen
mutex_unlock(&opts->lock); \ return ret; \ } \ \ CONFIGFS_ATTR(_f_##_opts_, qmul

Re: Using EHSET module

2019-03-10 Thread Peter Chen
BR,Peter Chen On Thu, Mar 7, 2019 at 11:26 PM Greg KH wrote: > > On Thu, Mar 07, 2019 at 03:24:29PM +0100, rchmielarz wrote: > > Hi, > > > > I'm trying to certify USB on our device that is running Linux 4.14. > > For windows systems we were using https://www.u

RE: [PATCH 1/2] usb: chipiea: add flags for id and vbus from external block

2019-03-05 Thread Peter Chen
> > > > > > > > > > > > > > > drivers/usb/chipidea/core.c | 2 ++ > > > > > include/linux/usb/chipidea.h > > > > > | > > > > > 4 > > > > > 2 files changed, 6 insertions(+) > > > > > > > > > > diff --git a/drivers/usb/chipidea/core.c > > > > > b/drivers/usb/chipidea/core.c index > > > > > 7bf

RE: Bus noise periodically causes ci_hdrc IRQ lockup

2019-03-01 Thread Peter Chen
> On 2/28/19 1:57 AM, Peter Chen wrote: > > > >>> Let me summary your observation: > >>> - bind/unbind ci_hdrc device can recover connection > >>> - Reset HUB can't recover, and will go the previous error state > >>> after reset >

RE: [PATCH 1/2] usb: chipiea: add flags for id and vbus from external block

2019-02-28 Thread Peter Chen
> > > > > > > drivers/usb/chipidea/core.c | 2 ++ include/linux/usb/chipidea.h | > > > 4 > > > 2 files changed, 6 insertions(+) > > > > > > diff --git a/drivers/usb/chipidea/core.c > > > b/drivers/usb/chipidea/core.c index > > > 7bfcbb2..0bfa850 100644 > > > --- a/drivers/usb/chipidea/cor

RE: Bus noise periodically causes ci_hdrc IRQ lockup

2019-02-27 Thread Peter Chen
> > Let me summary your observation: > > - bind/unbind ci_hdrc device can recover connection > > - Reset HUB can't recover, and will go the previous error state after > > reset > > > > From the register, we do see something abnormal, and the RX is > > waiting the SYNC Field. We need to see the d

RE: Bus noise periodically causes ci_hdrc IRQ lockup

2019-02-26 Thread Peter Chen
> >> Chandler > > From the above, we know the controller is at RX active status. But I > > am sorry I got the imprecise instruction from IC guys. The reason we > > do that is to know the RX status change during one packet, for your > > example, there are ISOC packets, so, measure time is about 2

[PATCH 1/5] usb: chipidea: imx: remove unused header files

2019-02-26 Thread Peter Chen
From: Jun Li Those 2 headers files are not required now. Signed-off-by: Jun Li Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index e81de9ca8729

[PATCH 4/5] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-02-26 Thread Peter Chen
ard compatibility if some users were actually relying on this mechanism. Signed-off-by: Paul Kocialkowski Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c

[PATCH 5/5] usb: chipidea: Refactor USB PHY selection and keep a single PHY

2019-02-26 Thread Peter Chen
obtained and the flow is easier to understand and follow. All error pointers (except for EPROBE_DEFER) are considered as PHY not found. Signed-off-by: Paul Kocialkowski Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 49 + 1 file changed, 32

[PATCH 3/5] usb: chipidea: imx: set power polarity

2019-02-26 Thread Peter Chen
as gpio and driven by a regulator. Also make use of of_property_read_bool. Signed-off-by: Philipp Puschmann Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 4 ++-- drivers/usb/chipidea/ci_hdrc_imx.h | 1 + drivers/usb/chipidea/usbmisc_imx.c | 7 +++ 3 files changed, 10

[PATCH 2/5] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high

2019-02-26 Thread Peter Chen
: Peter Chen --- Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt index adae82385dd6..a254386a91ad 100644 --- a/Documentation

[PATCH 0/5] usb: chipidea: updates for v5.1-rc1

2019-02-26 Thread Peter Chen
Hi Greg, Some small changes for chipidea drivers: - New dts property for VBUS power polarity - Improve USB PHY and Generic PHY handling Thanks. Jun Li (1): usb: chipidea: imx: remove unused header files Paul Kocialkowski (2): usb: chipidea: Grab the (legacy) USB PHY by phandle first usb:

RE: [PATCH 1/2] usb: chipiea: add flags for id and vbus from external block

2019-02-25 Thread Peter Chen
> drivers/usb/chipidea/core.c | 2 ++ > include/linux/usb/chipidea.h | 4 > 2 files changed, 6 insertions(+) > > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index > 7bfcbb2..0bfa850 100644 > --- a/drivers/usb/chipidea/core.c > +++ b/drivers/usb/chipidea/core.c >

RE: Bus noise periodically causes ci_hdrc IRQ lockup

2019-02-25 Thread Peter Chen
> > I suspect the controller is stuck at high speed. Chandler, would you please > > supply > below information: > > - If there is SOFs on the bus (you need to measure by probe) when the issue > occurs? > > - If the SOF can't be observed at bus, it means the disconnection > > can't be observed eith

RE: Bus noise periodically causes ci_hdrc IRQ lockup

2019-02-24 Thread Peter Chen
> On 2/23/19 3:17 AM, Greg KH wrote: > > On Fri, Feb 22, 2019 at 10:43:17AM -0500, Chandler Griscom wrote: > >> Hello, > >> > >> I am encountering an issue where noise on USB devices is causing the > >> host ci_hdrc driver to stall. The system contains an i.MX6 board > >> (UDOO) connected to a U

RE: [PATCH v1] usb: chipidea: tegra: Fix missed ci_hdrc_remove_device()

2019-02-24 Thread Peter Chen
atform_device *pdev) > { > struct tegra_udc *udc = platform_get_drvdata(pdev); > > + ci_hdrc_remove_device(udc->dev); > usb_phy_set_suspend(udc->phy, 1); > clk_disable_unprepare(udc->clk); > Acked-by: Peter Chen Hi Greg, would you still accept the bug-fix for this release (v5.0)? Or I send you later? Peter

RE: [PATCH v4 2/2] usb: chipidea: Refactor USB PHY selection and keep a single PHY

2019-02-22 Thread Peter Chen
> > Refactor the code in charge of looking up the USB PHY when no platdata is > provided. Attempt to get a generic USB PHY first, then look for a legacy USB > PHY > through device-tree and finally get any registered PHY with the correct type. > > This way, only a single USB PHY is obtained and

RE: [PATCH v3] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-02-21 Thread Peter Chen
> > Current code w/o your patch, it is possible both ci->phy and > > ci->usb_phy are valid if the USB PHY is not at the device tree, but generic > > PHY is > at the device tree. > > If you don't want to fix this issue with this patch, it is ok too. We could > > fix it later. > > I'm not sure I

RE: [PATCH v3] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-02-21 Thread Peter Chen
> > If there is a generic PHY node under USB controller, and there is a > > USB PHY at other sides, both ci->phy and ci->usb_phy are valid, I > > original thought it is the problem you met. > > Right, this is not the problem we are having. The problem is that legacy USB > PHYs > are not grabbed

RE: [PATCH v3] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-02-20 Thread Peter Chen
> > On Mon, 2019-02-18 at 03:04 +, Peter Chen wrote: > > > According to the chipidea driver bindings, the USB PHY is specified via > > > the > "phys" > > > phandle node. However, this only takes effect for USB PHYs that use > > >

RE: [PATCH v3] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-02-17 Thread Peter Chen
> According to the chipidea driver bindings, the USB PHY is specified via the > "phys" > phandle node. However, this only takes effect for USB PHYs that use the common > PHY framework. For legacy USB PHYs, a simple lookup based on the USB PHY > type is done instead. > > This does not play out w

RE: patch "usb: misc: usbtest: add super-speed isoc support" added to usb-testing

2019-02-15 Thread Peter Chen
you have any questions about this process, please let me know. > > > From 0d1ec194721f844a6b20f7f4854332adcebc6fb9 Mon Sep 17 00:00:00 2001 > From: Peter Chen > Date: Tue, 12 Feb 2019 08:57:27 + > Subject: usb: misc: usbtest: add super-speed isoc support > > The calc

RE: [PATCH v3 1/6] dt-bindings: add binding for USBSS-DRD controller.

2019-02-14 Thread Peter Chen
> > > > Hi Rob, > > >On Thu, Jan 31, 2019 at 11:52:28AM +, Pawel Laszczak wrote: > > >> This patch aim at documenting USB related dt-bindings for the > > >> Cadence USBSS-DRD controller. > > >> > > >> Signed-off-by: Pawel Laszczak > > >> --- > > >> .../devicetree/bindings/usb/cdns-usb3.txt

[PATCH 1/1] usb: misc: usbtest: add super-speed isoc support

2019-02-12 Thread Peter Chen
The calculation of packet number within microframe is different between high-speed and super-speed endpoint, we add support for super-speed in this patch. Cc: Pawel Laszczak Signed-off-by: Peter Chen --- drivers/usb/misc/usbtest.c | 28 1 file changed, 24

[PATCH 1/1] usb: phy: Kconfig: change FSL_USB2_OTG as tristate

2019-01-29 Thread Peter Chen
reference to `otg_statemachine' Cc: #v4.1+ Cc: Li Yang Reported-by: Mark Brown Signed-off-by: Peter Chen --- drivers/usb/phy/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index d7312eed6088..5444d2437475 100644

RE: [PATCH] usb: chipidea: imx: Remove unused include

2019-01-24 Thread Peter Chen
> Cc: Peter Chen ; Greg Kroah-Hartman > ; Alexander Shiyan > Subject: [PATCH] usb: chipidea: imx: Remove unused include > > Remove unused #include in drivers/usb/chipidea/ci_hdrc_imx.c > > Signed-off-by: Alexander Shiyan > --- > drivers/usb/chipidea/ci_hdrc_im

RE: [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high

2019-01-21 Thread Peter Chen
> Am 17.01.19 um 08:01 schrieb Peter Chen: > > > >> > >> The i.MX6q/dl USB controller may drive the usb power line directly, > >> but the polarity depends on the board. Reset state of the polarity is > >> low-active so add this property to allow i

RE: [PATCH] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-01-17 Thread Peter Chen
> On Thu, 2019-01-17 at 06:44 +0000, Peter Chen wrote: > > > > > On Wed, 2019-01-16 at 14:44 +0100, Thomas Petazzoni wrote: > > > > Well prior to your code, there was already a possibility for both > > > > ci->phy and ci->usb_phy to be val

RE: [PATCH 1/1] usb: chipidea: fix static checker warning for NULL pointer

2019-01-17 Thread Peter Chen
> > On Thu, Jan 17, 2019 at 09:24:20AM +, Peter Chen wrote: > > During the static checker, "data->usbmisc_data" may be NULL. > > I can not quite parse this sentance. Do you mean that a static checker found > this > issue? I think &qu

[PATCH 1/1] usb: chipidea: fix static checker warning for NULL pointer

2019-01-17 Thread Peter Chen
During the static checker, "data->usbmisc_data" may be NULL. Fix it by adding this pointer judgement before using. Reported-by: Dan Carpenter Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 0/1] usb: chipidea: fix for usb-linus

2019-01-17 Thread Peter Chen
Peter Chen (1): usb: chipidea: fix static checker warning for NULL pointer drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.14.1

RE: [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high

2019-01-16 Thread Peter Chen
> > The i.MX6q/dl USB controller may drive the usb power line directly, but the > polarity > depends on the board. Reset state of the polarity is low-active so add this > property > to allow it to be high-active. > As far as I know, most of i.mx USB controllers (except imx28/23, but they don

RE: [PATCH] usb: chipidea: Grab the (legacy) USB PHY by phandle first

2019-01-16 Thread Peter Chen
> > On Wed, 2019-01-16 at 14:44 +0100, Thomas Petazzoni wrote: > > Well prior to your code, there was already a possibility for both > > ci->phy and ci->usb_phy to be valid. I don't think it's really useful > > to avoid the fallback when a generic PHY has already been found, it's > > confusing.

Re: [BUG] rmmod g_mass_storage result to segmentation fault

2019-01-09 Thread Peter Chen
> > When running an imx_defconfig on a imx6q-sabrelite, rmmod g_mass_storage lead > to the following crash: > [ 143.952834] Internal error: Oops: 817 [#1] SMP ARM > [ 143.957639] Modules linked in: dmatest psmouse serport da9063_wdt wl12xx > wl18xx wlcore wlcore_sdio brcmfmac brcmutil mwifiex_s

RE: [PATCH] [V2] usb: chipidea: add a check for the availability of next child

2019-01-06 Thread Peter Chen
> > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c > b/drivers/usb/chipidea/ci_hdrc_msm.c > index 880009987460..813673eee815 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -250,6 +250,10 @@ static int ci_hdrc_msm_probe(struct platform_device >

RE: [PATCH v2 5/5] usb:cdns3 Add Cadence USB3 DRD Driver

2018-12-27 Thread Peter Chen
> > > >@@ -299,6 +306,7 @@ int cdns3_drd_init(struct cdns3 *cdns) > >cdns->version = CDNS3_CONTROLLER_V0; > >cdns->otg_v1_regs = NULL; > >cdns->otg_regs = regs; > >+ writel(0x1, &cdns->otg_v0_regs->simulate); > >dev_in

RE: [PATCH v2] usb: chipidea: add a check for the availability of next child

2018-12-26 Thread Peter Chen
> Signed-off-by: Kangjie Lu > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c > b/drivers/usb/chipidea/ci_hdrc_msm.c > index 880009987460..b7f7acef72d4 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +

RE: [PATCH] usb: chipidea: add a check for the availability of next child

2018-12-25 Thread Peter Chen
> Signed-off-by: Kangjie Lu > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c > b/drivers/usb/chipidea/ci_hdrc_msm.c > index 880009987460..7dc987b4036a 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++

[PATCH 1/1] usb: chipidea: fix static checker warning for NULL pointer

2018-12-23 Thread Peter Chen
During the static checker, "data->usbmisc_data" may be NULL. Fix it by this pointer judgement before using. Reported-by: Dan Carpenter Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

[GIT PULL] usb: chipidea: changes for v4.21-rc1

2018-12-17 Thread Peter Chen
the HSIC support for imx Peter Chen (4): usb: chipidea: add flag for imx hsic implementation usb: chipidea: imx: add HSIC support usb: chipidea: host: override ehci->hub_control doc: usb: ci-hdrc-usb2:

Re: [RFC PATCH v2 08/15] usb:cdns3: Implements device operations part of the API

2018-12-13 Thread Peter Chen
On Wed, Dec 12, 2018 at 3:49 AM Pawel Laszczak wrote: > > Hi, > > >On 10/12/18 7:42 AM, Peter Chen wrote: > >>>> +static struct usb_ep *cdns3_gadget_match_ep(struct usb_gadget *gadget, > >>>> +

Re: [PATCH v1 1/2] dt-bindings: add binding for USBSS-DRD controller.

2018-12-13 Thread Peter Chen
On Tue, Dec 11, 2018 at 6:19 PM Roger Quadros wrote: > > Pawel, > > On 10/12/18 14:39, Pawel Laszczak wrote: > > This patch aim at documenting USB related dt-bindings for the > > Cadence USBSS-DRD controller. > > > > Signed-off-by: Pawel Laszczak > > --- > > .../devicetree/bindings/usb/cdns3-usb

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 cons

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-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 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:

[PATCH v5 3/4] usb: chipidea: host: override ehci->hub_control

2018-12-10 Thread Peter Chen
The chipidea controller has some special requirements during suspend/resume, override common ehci->hub_control to implement it. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen --- drivers/usb/chipidea/host.c |

[PATCH v5 2/4] usb: chipidea: imx: add HSIC support

2018-12-10 Thread Peter Chen
needed Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 140 - drivers/usb/chipidea/ci_hdrc_imx.h | 9 ++- drivers/usb/chipidea/usbmisc_imx.c | 140

[PATCH v5 1/4] usb: chipidea: add flag for imx hsic implementation

2018-12-10 Thread Peter Chen
NXP (Freecale) imx HSIC design has some special requirements, add some flags at host code to handle them. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen --- drivers/usb/chipidea/host.c | 17 + include/linux/usb/chipidea.h | 3 +++ 2 files

[PATCH v5 4/4] doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups

2018-12-10 Thread Peter Chen
For USB HSIC, the data and strobe pin needs to be pulled down at default, we consider it as "idle" state. When the USB host is ready to be used, the strobe pin needs to be pulled up, we consider it as "active" state. Signed-off-by: Peter Chen --- .../devicetree/bindings/

[PATCH v5 0/4] usb: chipidea: imx: add HSIC support

2018-12-10 Thread Peter Chen
for binding-doc, and add the dts example [Patch 4/4] Changes for v2: - Compile error reported by kbuild robot [Patch 2/4] - Comment from Frieder Schrempf about code structure [Patch 2/4] - Comment from Fabio about adding example for pinctrl [Patch 4/4] Peter Chen (4): usb: chipidea: add flag

RE: [PATCH v4 4/4] doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups

2018-12-10 Thread Peter Chen
> > On Mon, Dec 10, 2018 at 6:09 AM Schrempf Frieder > wrote: > > > With a separate example for HSIC, we should probably leave the > > standard example unchanged (I think that was one of the reasons for > > adding a separate example). > > Yes, I agree. That would make the binding doc clearer.

Re: [RFC PATCH v2 08/15] usb:cdns3: Implements device operations part of the API

2018-12-09 Thread Peter Chen
> > +static struct cdns3_endpoint *cdns3_find_available_ss_ep(struct > > cdns3_device *priv_dev, > > + struct > > usb_endpoint_descriptor *desc) > > why is this function called ss_ep? This doesn't seem like only for superspeed > endpoints. >

[PATCH v4 4/4] doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups

2018-12-08 Thread Peter Chen
For USB HSIC, the data and strobe pin needs to be pulled down at default, we consider it as "idle" state. When the USB host is ready to be used, the strobe pin needs to be pulled up, we consider it as "active" state. Signed-off-by: Peter Chen --- .../devicetree/bindings/

[PATCH v4 2/4] usb: chipidea: imx: add HSIC support

2018-12-08 Thread Peter Chen
needed Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 140 - drivers/usb/chipidea/ci_hdrc_imx.h | 9 ++- drivers/usb/chipidea/usbmisc_imx.c | 140

[PATCH v4 3/4] usb: chipidea: host: override ehci->hub_control

2018-12-08 Thread Peter Chen
The chipidea controller has some special requirements during suspend/resume, override common ehci->hub_control to implement it. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen --- drivers/usb/chipidea/host.c |

[PATCH v4 0/4] usb: chipidea: imx: add HSIC support

2018-12-08 Thread Peter Chen
kbuild robot [Patch 2/4] - Comment from Frieder Schrempf about code structure [Patch 2/4] - Comment from Fabio about adding example for pinctrl [Patch 4/4] Peter Chen (4): usb: chipidea: add flag for imx hsic implementation usb: chipidea: imx: add HSIC support usb: chipidea: host: override

[PATCH v4 1/4] usb: chipidea: add flag for imx hsic implementation

2018-12-08 Thread Peter Chen
NXP (Freecale) imx HSIC design has some special requirements, add some flags at host code to handle them. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen --- drivers/usb/chipidea/host.c | 17 + include/linux/usb/chipidea.h | 3 +++ 2 files

Re: [RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-12-05 Thread Peter Chen
On Wed, Dec 5, 2018 at 4:55 PM Alan Douglas wrote: > > Hi Peter, > > On 05 December 2018 07:20, Pawel Laszczak wrote: > > Hi, > > > > >> >> > > >> >> Patch adds core.c and core.h file that implements initialization > > >> >> of platform driver and adds function responsible for selecting, > > >> >>

Re: [RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-12-05 Thread Peter Chen
> > > > On 04/12/18 10:50, Peter Chen wrote: > >>> + * Cadence USBSS DRD Driver. > >>> + * > >>> + * Copyright (C) 2018 Cadence. > >>> + * > >>> + * Author: Peter Chen > >>> + * Pawel Laszczak &

Re: [RFC PATCH v2 06/15] usb:cdns3: Adds Host support

2018-12-05 Thread Peter Chen
> > --- a/drivers/usb/cdns3/Makefile > > +++ b/drivers/usb/cdns3/Makefile > > @@ -2,4 +2,5 @@ obj-$(CONFIG_USB_CDNS3) += cdns3.o > > obj-$(CONFIG_USB_CDNS3_PCI_WRAP) += cdns3-pci.o > > > > cdns3-y := core.o drd.o > > +cdns3-$(CONFIG_U

RE: [PATCH v3 4/4] doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups

2018-12-04 Thread PETER CHEN
> On 04.12.18 21:01, Fabio Estevam wrote: > > Hi Frieder, > > > > On Tue, Dec 4, 2018 at 12:31 PM Schrempf Frieder > > wrote: > > > >> There are many other optional properties for this driver and a lot of > >> them are not in the given example. Maybe we should just keep the > >> pinctrls for HSI

Re: [RFC PATCH v2 05/15] usb:cdns3: Added DRD support

2018-12-04 Thread Peter Chen
On Sun, Nov 18, 2018 at 6:13 PM Pawel Laszczak wrote: > > Patch adds supports for detecting Host/Device mode. > Controller has additional OTG register that allow > implement even whole OTG functionality. > At this moment patch adds support only for detecting > the appropriate mode based on strap p

Re: [RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-12-04 Thread Peter Chen
:= core.o > >> cdns3-pci-y := cdns3-pci-wrap.o > >> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c > >> new file mode 100644 > >> index ..f9055d4da67f > >> --- /dev/null >

Re: [RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-12-04 Thread Peter Chen
> > + * Cadence USBSS DRD Driver. > > + * > > + * Copyright (C) 2018 Cadence. > > + * > > + * Author: Peter Chen > > + * Pawel Laszczak > > + */ > > + > > +#include > > +#include > > +#include > > +#include &g

Re: [RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-12-03 Thread Peter Chen
On Mon, Dec 3, 2018 at 4:34 AM Pawel Laszczak wrote: > > >> > >> Patch adds core.c and core.h file that implements initialization > >> of platform driver and adds function responsible for selecting, > >> switching and running appropriate Device/Host mode. > >> > >> Signed-off-by: Pawel Laszczak >

RE: [PATCH v2 2/3] usb: chipidea: imx: Warn if oc polarity isn't specified

2018-12-03 Thread PETER CHEN
> Signed-off-by: Uwe Kleine-König > --- > drivers/usb/chipidea/ci_hdrc_imx.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c > b/drivers/usb/chipidea/ci_hdrc_imx.c > index 80b4e4ef9b68..3dcfd0d97f94 100644 > --- a/drivers/usb/chipidea/ci_hdrc_imx.

RE: [PATCH 1/1] usb: chipidea: imx: improve the over current handling

2018-12-03 Thread PETER CHEN
> > On Mon, Dec 03, 2018 at 03:13:01AM +, PETER CHEN wrote: > > The current OC (Over Current) handling does not consider the default > > and bootloader OC setting well, in this commit, we reset OC setting > > according to dts value: > > - If property "di

[PATCH 1/1] usb: chipidea: imx: improve the over current handling

2018-12-02 Thread PETER CHEN
er control chips are low active for OC, we keep "over-current-active-high" property unchanging to reduce users effort. If this property is set, we set OC polarity as high explicitly; otherwise, we set it as low explicitly. Cc: stable Cc: Peter Chen Cc: Uwe Kleine-König Cc: Matthew

RE: [PATCH] usb: chipidea: imx: Allow OC polarity active low

2018-12-02 Thread PETER CHEN
> > > -Original Message- > > From: Matthew Starr > > Sent: 2018年11月30日 23:09 > > To: PETER CHEN ; linux-usb@vger.kernel.org; Jun Li > > > > Subject: RE: [PATCH] usb: chipidea: imx: Allow OC polarity active low > > > > > -Origin

Re: [RFC PATCH v2 04/15] usb:cdns3: Driver initialization code.

2018-11-29 Thread Peter Chen
index ..f9055d4da67f > --- /dev/null > +++ b/drivers/usb/cdns3/core.c > @@ -0,0 +1,413 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Cadence USBSS DRD Driver. > + * > + * Copyright (C) 2018 Cadence. > + * Please add NXP copyright too. > + *

RE: [RFC PATCH v2 02/15] usb:cdns3: Device side header file.

2018-11-29 Thread PETER CHEN
> + > +/* > + * USBSS-DEV register interface. > + * This corresponds to the USBSS Device Controller Interface */ > +/** > + * struct xhci_cap_regs - xHCI Host Controller Capability Registers. struct cdns3_usb_regs - device controller registers > +struct cdns3_device; > + > +struct cdns3_endp

RE: [RFC PATCH v2 07/15] usb:cdns3: Adds Device mode support - initialization.

2018-11-29 Thread PETER CHEN
> Roger Quadros writes: > >> +static void cdns3_gadget_config(struct cdns3_device *priv_dev) { > >> + struct cdns3_usb_regs __iomem *regs = priv_dev->regs; > >> + > >> + cdns3_ep0_config(priv_dev); > >> + > >> + /* enable interrupts for endpoint 0 (in and out) */ > >> + writel(EP_IEN_EP_OUT0

<    1   2   3   4   5   6   7   8   9   10   >