From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Sneeker Yeh <sneeker.yeh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Mathias Nyman
<mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Huang Rui <ray.huang-5C7GfCeVMHo@public.gmane.org>,
Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Andy Green <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Jassi Brar
<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Sneeker Yeh <Sneeker.Yeh-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
Subject: Re: [PATCH v2 3/5] usb: dwc3: Add quirk for Synopsis device disconnection errata
Date: Mon, 19 Jan 2015 08:50:50 -0600 [thread overview]
Message-ID: <20150119145050.GF20386@saruman> (raw)
In-Reply-To: <1421654209-6486-4-git-send-email-Sneeker.Yeh-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 4768 bytes --]
Hi,
On Mon, Jan 19, 2015 at 03:56:47PM +0800, Sneeker Yeh wrote:
> Synopsis Designware USB3 IP earlier than v3.00a which is configured in silicon
> with DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1, would need a specific quirk to prevent
> xhci host controller from dying when device is disconnected.
>
> Since DWC_USB3_SUSPEND_ON_DISCONNECT_EN is an IP configuration whose state
> cannot be checked from software in runtime, it has to be enabled via platform
> data or device tree.
>
> Signed-off-by: Sneeker Yeh <Sneeker.Yeh-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
> ---
> Documentation/devicetree/bindings/usb/dwc3.txt | 17 +++++++++++++++++
> drivers/usb/dwc3/core.c | 6 ++++++
> drivers/usb/dwc3/core.h | 1 +
> drivers/usb/dwc3/host.c | 4 ++++
> drivers/usb/dwc3/platform_data.h | 1 +
> 5 files changed, 29 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> index cd7f045..1b78b29 100644
> --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
> @@ -37,6 +37,23 @@ Optional properties:
> - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal
> utmi_l1_suspend_n, false when asserts utmi_sleep_n
> - snps,hird-threshold: HIRD threshold
> + - snps,has_suspend_on_disconnect: true when IP is configured in silicon with
> + DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1, it can inject a
> + specific quirk to prevent xhci host controller from
> + dying when usb device is disconnected from root hub.
> + Since DWC_USB3_SUSPEND_ON_DISCONNECT_EN is an IP
> + configuration whose state cannot be checked from
> + software in runtime, it has to be enabled via platform
> + data or device tree.
> +
> + xhci host dying symptom here is caused by that
> + DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1
> + configuration makes IP auto-suspended after PORTCSC is
> + cleared when usb device detached, then an asynchronous
> + disconnection procedure might fail using endpoint
> + command that suspened IP won't have any response to.
> +
> + this issue is fixed when IP version >= 3.00a.
>
> This is usually a subnode to DWC3 glue to which it is connected.
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 25ddc39..fbceab1 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -838,6 +838,9 @@ static int dwc3_probe(struct platform_device *pdev)
> "snps,tx_de_emphasis_quirk");
> of_property_read_u8(node, "snps,tx_de_emphasis",
> &tx_de_emphasis);
> +
> + dwc->suspend_on_disconnect_quirk = of_property_read_bool(node,
> + "snps,has_suspend_on_disconnect");
> } else if (pdata) {
> dwc->maximum_speed = pdata->maximum_speed;
> dwc->has_lpm_erratum = pdata->has_lpm_erratum;
> @@ -864,6 +867,9 @@ static int dwc3_probe(struct platform_device *pdev)
> dwc->tx_de_emphasis_quirk = pdata->tx_de_emphasis_quirk;
> if (pdata->tx_de_emphasis)
> tx_de_emphasis = pdata->tx_de_emphasis;
> +
> + dwc->suspend_on_disconnect_quirk =
> + pdata->has_suspend_on_disconnect;
> }
>
> /* default to superspeed if no maximum_speed passed */
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 8090249..d7458ff 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -832,6 +832,7 @@ struct dwc3 {
>
> unsigned tx_de_emphasis_quirk:1;
> unsigned tx_de_emphasis:2;
> + unsigned suspend_on_disconnect_quirk:1;
you're missing the comment on the structure and these should be
alphabetically sorted.
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index 12bfd3c..9c42074 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -53,6 +53,10 @@ int dwc3_host_init(struct dwc3 *dwc)
> pdata.usb3_lpm_capable = 1;
> #endif
>
> + if ((dwc->revision < DWC3_REVISION_300A) &&
> + dwc->suspend_on_disconnect_quirk)
> + pdata.delay_portcsc_clear = 1;
> +
> ret = platform_device_add_data(xhci, &pdata, sizeof(pdata));
> if (ret) {
> dev_err(dwc->dev, "couldn't add platform data to xHCI device\n");
> diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
> index a3a3b6d..69562f1 100644
> --- a/drivers/usb/dwc3/platform_data.h
> +++ b/drivers/usb/dwc3/platform_data.h
> @@ -44,4 +44,5 @@ struct dwc3_platform_data {
>
> unsigned tx_de_emphasis_quirk:1;
> unsigned tx_de_emphasis:2;
> + unsigned has_suspend_on_disconnect:1;
needs a comment at the top of this structure and should sorted.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Sneeker Yeh <sneeker.yeh@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>, Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mathias Nyman <mathias.nyman@intel.com>,
Grant Likely <grant.likely@linaro.org>,
Huang Rui <ray.huang@amd.com>,
Kishon Vijay Abraham I <kishon@ti.com>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>,
Andy Green <andy.green@linaro.org>,
Jassi Brar <jaswinder.singh@linaro.org>,
Sneeker Yeh <Sneeker.Yeh@tw.fujitsu.com>
Subject: Re: [PATCH v2 3/5] usb: dwc3: Add quirk for Synopsis device disconnection errata
Date: Mon, 19 Jan 2015 08:50:50 -0600 [thread overview]
Message-ID: <20150119145050.GF20386@saruman> (raw)
In-Reply-To: <1421654209-6486-4-git-send-email-Sneeker.Yeh@tw.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 4743 bytes --]
Hi,
On Mon, Jan 19, 2015 at 03:56:47PM +0800, Sneeker Yeh wrote:
> Synopsis Designware USB3 IP earlier than v3.00a which is configured in silicon
> with DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1, would need a specific quirk to prevent
> xhci host controller from dying when device is disconnected.
>
> Since DWC_USB3_SUSPEND_ON_DISCONNECT_EN is an IP configuration whose state
> cannot be checked from software in runtime, it has to be enabled via platform
> data or device tree.
>
> Signed-off-by: Sneeker Yeh <Sneeker.Yeh@tw.fujitsu.com>
> ---
> Documentation/devicetree/bindings/usb/dwc3.txt | 17 +++++++++++++++++
> drivers/usb/dwc3/core.c | 6 ++++++
> drivers/usb/dwc3/core.h | 1 +
> drivers/usb/dwc3/host.c | 4 ++++
> drivers/usb/dwc3/platform_data.h | 1 +
> 5 files changed, 29 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> index cd7f045..1b78b29 100644
> --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
> @@ -37,6 +37,23 @@ Optional properties:
> - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal
> utmi_l1_suspend_n, false when asserts utmi_sleep_n
> - snps,hird-threshold: HIRD threshold
> + - snps,has_suspend_on_disconnect: true when IP is configured in silicon with
> + DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1, it can inject a
> + specific quirk to prevent xhci host controller from
> + dying when usb device is disconnected from root hub.
> + Since DWC_USB3_SUSPEND_ON_DISCONNECT_EN is an IP
> + configuration whose state cannot be checked from
> + software in runtime, it has to be enabled via platform
> + data or device tree.
> +
> + xhci host dying symptom here is caused by that
> + DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1
> + configuration makes IP auto-suspended after PORTCSC is
> + cleared when usb device detached, then an asynchronous
> + disconnection procedure might fail using endpoint
> + command that suspened IP won't have any response to.
> +
> + this issue is fixed when IP version >= 3.00a.
>
> This is usually a subnode to DWC3 glue to which it is connected.
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 25ddc39..fbceab1 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -838,6 +838,9 @@ static int dwc3_probe(struct platform_device *pdev)
> "snps,tx_de_emphasis_quirk");
> of_property_read_u8(node, "snps,tx_de_emphasis",
> &tx_de_emphasis);
> +
> + dwc->suspend_on_disconnect_quirk = of_property_read_bool(node,
> + "snps,has_suspend_on_disconnect");
> } else if (pdata) {
> dwc->maximum_speed = pdata->maximum_speed;
> dwc->has_lpm_erratum = pdata->has_lpm_erratum;
> @@ -864,6 +867,9 @@ static int dwc3_probe(struct platform_device *pdev)
> dwc->tx_de_emphasis_quirk = pdata->tx_de_emphasis_quirk;
> if (pdata->tx_de_emphasis)
> tx_de_emphasis = pdata->tx_de_emphasis;
> +
> + dwc->suspend_on_disconnect_quirk =
> + pdata->has_suspend_on_disconnect;
> }
>
> /* default to superspeed if no maximum_speed passed */
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 8090249..d7458ff 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -832,6 +832,7 @@ struct dwc3 {
>
> unsigned tx_de_emphasis_quirk:1;
> unsigned tx_de_emphasis:2;
> + unsigned suspend_on_disconnect_quirk:1;
you're missing the comment on the structure and these should be
alphabetically sorted.
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index 12bfd3c..9c42074 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -53,6 +53,10 @@ int dwc3_host_init(struct dwc3 *dwc)
> pdata.usb3_lpm_capable = 1;
> #endif
>
> + if ((dwc->revision < DWC3_REVISION_300A) &&
> + dwc->suspend_on_disconnect_quirk)
> + pdata.delay_portcsc_clear = 1;
> +
> ret = platform_device_add_data(xhci, &pdata, sizeof(pdata));
> if (ret) {
> dev_err(dwc->dev, "couldn't add platform data to xHCI device\n");
> diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
> index a3a3b6d..69562f1 100644
> --- a/drivers/usb/dwc3/platform_data.h
> +++ b/drivers/usb/dwc3/platform_data.h
> @@ -44,4 +44,5 @@ struct dwc3_platform_data {
>
> unsigned tx_de_emphasis_quirk:1;
> unsigned tx_de_emphasis:2;
> + unsigned has_suspend_on_disconnect:1;
needs a comment at the top of this structure and should sorted.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-19 14:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 7:56 [PATCH v2 0/5] Add support for Fujitsu USB host controller Sneeker Yeh
2015-01-19 7:56 ` Sneeker Yeh
2015-01-19 7:56 ` [PATCH v2 1/5] usb: dwc3: add Fujitsu Specific Glue layer Sneeker Yeh
2015-01-19 14:48 ` Felipe Balbi
2015-01-19 14:48 ` Felipe Balbi
2015-01-21 8:51 ` Sneeker Yeh
2015-01-19 7:56 ` [PATCH v2 2/5] usb: dwc3: add revision number DWC3_REVISION_300A Sneeker Yeh
2015-01-19 14:46 ` Felipe Balbi
2015-01-19 14:46 ` Felipe Balbi
2015-01-19 19:45 ` John Youn
2015-01-19 20:00 ` Felipe Balbi
2015-01-21 8:57 ` Sneeker Yeh
2015-01-21 8:57 ` Sneeker Yeh
2015-01-19 7:56 ` [PATCH v2 3/5] usb: dwc3: Add quirk for Synopsis device disconnection errata Sneeker Yeh
[not found] ` <1421654209-6486-4-git-send-email-Sneeker.Yeh-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
2015-01-19 14:50 ` Felipe Balbi [this message]
2015-01-19 14:50 ` Felipe Balbi
2015-01-21 9:02 ` Sneeker Yeh
2015-01-23 16:20 ` Felipe Balbi
2015-01-19 7:56 ` [PATCH v2 4/5] xhci: Platform: Set Synopsis device disconnection quirk based on platform data Sneeker Yeh
2015-01-19 14:51 ` Felipe Balbi
2015-01-19 14:51 ` Felipe Balbi
2015-01-21 8:55 ` Sneeker Yeh
2015-01-21 8:55 ` Sneeker Yeh
2015-01-19 7:56 ` [PATCH v2 5/5] xhci: add a quirk for device disconnection errata for Synopsis Designware USB3 core Sneeker Yeh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150119145050.GF20386@saruman \
--to=balbi-l0cymroini0@public.gmane.org \
--cc=Sneeker.Yeh-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org \
--cc=andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=kishon-l0cyMroinI0@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=ray.huang-5C7GfCeVMHo@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sneeker.yeh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.