All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: John Youn <John.Youn@synopsys.com>
Cc: <balbi@ti.com>, <linux-usb@vger.kernel.org>,
	<david.fisher1@synopsys.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH 5/6] usb: dwc3: Add dis_enblslpm_quirk
Date: Thu, 1 Oct 2015 21:06:19 -0500	[thread overview]
Message-ID: <20151002020619.GC2534@saruman.tx.rr.com> (raw)
In-Reply-To: <70fc2a4db129c44cc8ed7f1597d4501927683b52.1443748471.git.johnyoun@synopsys.com>

[-- Attachment #1: Type: text/plain, Size: 5337 bytes --]

On Sat, Sep 26, 2015 at 12:31:08AM -0700, John Youn wrote:
> Add a quirk to clear the GUSB2PHYCFG.ENBLSLPM bit, which controls
> whether the PHY receives the suspend signal from the controller.
> 
> Certain Synopsys prototyping PHY boards are not able to meet timings
> constraints for LPM. This allows the PHY to meet those timings by
> leaving the PHY clock running during suspend.
> 
> Cc: <stable@vger.kernel.org> # v3.18+
> Signed-off-by: John Youn <johnyoun@synopsys.com>

let's split this patch up. First we add the flag, and on a separate patch you
use it in dwc3-pci.c

> ---
>  Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++
>  drivers/usb/dwc3/core.c                        | 6 ++++++
>  drivers/usb/dwc3/core.h                        | 4 ++++
>  drivers/usb/dwc3/dwc3-pci.c                    | 1 +
>  drivers/usb/dwc3/platform_data.h               | 1 +
>  5 files changed, 14 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> index 8c7d585..9ff48e0 100644
> --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
> @@ -35,6 +35,8 @@ Optional properties:
>  			LTSSM during USB3 Compliance mode.
>   - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy.
>   - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
> + - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG,
> +			disabling the suspend signal to the PHY.
>   - 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
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 566cca1..ca19027 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -515,6 +515,9 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
>  	if (dwc->dis_u2_susphy_quirk)
>  		reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
>  
> +	if (dwc->dis_enblslpm_quirk)
> +		reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM;
> +
>  	dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
>  
>  	return 0;
> @@ -911,6 +914,8 @@ static int dwc3_probe(struct platform_device *pdev)
>  				"snps,dis_u3_susphy_quirk");
>  	dwc->dis_u2_susphy_quirk = device_property_read_bool(dev,
>  				"snps,dis_u2_susphy_quirk");
> +	dwc->dis_enblslpm_quirk = device_property_read_bool(dev,
> +				"snps,dis_enblslpm_quirk");
>  
>  	dwc->tx_de_emphasis_quirk = device_property_read_bool(dev,
>  				"snps,tx_de_emphasis_quirk");
> @@ -944,6 +949,7 @@ static int dwc3_probe(struct platform_device *pdev)
>  		dwc->rx_detect_poll_quirk = pdata->rx_detect_poll_quirk;
>  		dwc->dis_u3_susphy_quirk = pdata->dis_u3_susphy_quirk;
>  		dwc->dis_u2_susphy_quirk = pdata->dis_u2_susphy_quirk;
> +		dwc->dis_enblslpm_quirk = pdata->dis_enblslpm_quirk;
>  
>  		dwc->tx_de_emphasis_quirk = pdata->tx_de_emphasis_quirk;
>  		if (pdata->tx_de_emphasis)
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 7446467..a87ef34 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -179,6 +179,7 @@
>  #define DWC3_GUSB2PHYCFG_PHYSOFTRST	(1 << 31)
>  #define DWC3_GUSB2PHYCFG_SUSPHY		(1 << 6)
>  #define DWC3_GUSB2PHYCFG_ULPI_UTMI	(1 << 4)
> +#define DWC3_GUSB2PHYCFG_ENBLSLPM	(1 << 8)
>  
>  /* Global USB2 PHY Vendor Control Register */
>  #define DWC3_GUSB2PHYACC_NEWREGREQ	(1 << 25)
> @@ -721,6 +722,8 @@ struct dwc3_scratchpad_array {
>   * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk
>   * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy
>   * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy
> + * @dis_enblslpm_quirk: set if we clear enblslpm in GUSB2PHYCFG,
> + *                      disabling the suspend signal to the PHY.
>   * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk
>   * @tx_de_emphasis: Tx de-emphasis value
>   * 	0	- -6dB de-emphasis
> @@ -862,6 +865,7 @@ struct dwc3 {
>  	unsigned		rx_detect_poll_quirk:1;
>  	unsigned		dis_u3_susphy_quirk:1;
>  	unsigned		dis_u2_susphy_quirk:1;
> +	unsigned		dis_enblslpm_quirk:1;
>  
>  	unsigned		tx_de_emphasis_quirk:1;
>  	unsigned		tx_de_emphasis:2;
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index 4479a41..b34bd79 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -118,6 +118,7 @@ static int dwc3_pci_quirks(struct pci_dev *pdev)
>  		memset(&pdata, 0, sizeof(pdata));
>  		pdata.usb3_lpm_capable = true;
>  		pdata.has_lpm_erratum = true;
> +		pdata.dis_enblslpm_quirk = true;
>  
>  		return platform_device_add_data(pci_get_drvdata(pdev), &pdata,
>  						sizeof(pdata));
> diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
> index 400b197..2bb4d3a 100644
> --- a/drivers/usb/dwc3/platform_data.h
> +++ b/drivers/usb/dwc3/platform_data.h
> @@ -42,6 +42,7 @@ struct dwc3_platform_data {
>  	unsigned rx_detect_poll_quirk:1;
>  	unsigned dis_u3_susphy_quirk:1;
>  	unsigned dis_u2_susphy_quirk:1;
> +	unsigned dis_enblslpm_quirk:1;
>  
>  	unsigned tx_de_emphasis_quirk:1;
>  	unsigned tx_de_emphasis:2;
> -- 
> 2.5.0.GIT
> 

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-10-02  2:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  1:14 [PATCH 0/6] usb: dwc3: Various updates for Synopsys platforms John Youn
2015-08-07 18:04 ` [PATCH 2/6] usb: dwc3: pci: Add the Synopsys HAPS AXI Product ID John Youn
2015-08-07 18:47 ` [PATCH 3/6] usb: dwc3: pci: Add the PCI Product ID for Synopsys USB 3.1 John Youn
2015-09-05  2:15 ` [PATCH 1/6] usb: dwc3: Support Synopsys USB 3.1 IP John Youn
2015-10-02  2:03   ` Felipe Balbi
2015-10-02  3:09     ` John Youn
2015-10-02 14:05       ` Felipe Balbi
2015-10-02 19:16         ` John Youn
2015-10-02 19:21           ` Felipe Balbi
2015-10-02 22:02             ` Greg KH
2015-10-03  0:33               ` Felipe Balbi
2015-10-03  1:14                 ` John Youn
2015-10-03  5:54                   ` Greg KH
2015-10-02 19:47       ` John Youn
2015-10-02 19:55         ` Felipe Balbi
2015-09-26  6:47 ` [PATCH 6/6] usb: dwc3: pci: trivial: Formatting John Youn
2015-09-26  7:11 ` [PATCH 4/6] usb: dwc3: pci: Add platform data for Synopsys HAPS John Youn
2015-09-26  7:31 ` [PATCH 5/6] usb: dwc3: Add dis_enblslpm_quirk John Youn
2015-10-02  2:06   ` Felipe Balbi [this message]

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=20151002020619.GC2534@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=John.Youn@synopsys.com \
    --cc=david.fisher1@synopsys.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.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.