PCI: imx6: fix occasional link failure
Subsystems (2)
PATCH 1/1 PCI: imx6: fix occasional link failure
According to the IMX6 reference manuals, REF_SSP_EN (Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.
Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/pci/host/pci-imx6.c +6 -5
@@ -256,11 +256,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)struct imx6_pcie *imx6_pcie =to_imx6_pcie (pp);int ret; -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); - ret =clk_prepare_enable (imx6_pcie->pcie_phy);if (ret) {dev_err (pp->dev,"unable to enable pcie_phy clock\n" );
@@ -282,6 +277,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)/* allow the clocks to stabilize */ usleep_range (200 ,500 ); +/* power up core phy and enable ref clock */ +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); +/* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid (imx6_pcie->reset_gpio)) {gpio_set_value (imx6_pcie->reset_gpio,0 );
Signature · 1 line
1.8.3.2
Hi Tim:
Quoted 38 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tim Harvey
Sent: Friday, August 08, 2014 2:37 PM
To: [email protected]
Cc: Fabio Estevam; Guo Shawn-R65073; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH] PCI: imx6: fix occasional link failureAccording to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/pci/host/pci-imx6.c index renamed from drivers/pci/host/pci-imx6.c +0
-01be6073..9b6bab9 100644
drivers/pci/host/pci-imx6.c +0
-5@@ -256,11 +256,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)struct imx6_pcie *imx6_pcie =to_imx6_pcie (pp);int ret; -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); - ret =clk_prepare_enable (imx6_pcie->pcie_phy);if (ret) {drivers/pci/host/pci-imx6.c +0
-0dev_err(pp->dev, "unable to enable pcie_phy clock\n"); @@ -282,6
drivers/pci/host/pci-imx6.c static int imx6_pcie_deassert_core_reset(struct pcie_port *pp) · line 285
Quoted 10 lines
drivers/pci/host/pci-imx6.c +7
-0+277,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp) /* allow the clocks to stabilize */ usleep_range(200, 500); +/* power up core phy and enable ref clock */ +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); +
[Richard] It's better add some comments into the codes, why Enable_pcie_clock should be placed before ssp_en is set. For example:
- enable_pcie_clock should be call before ssp_en is set, since that ssp_en control the phy_ref clk gate, turn on it after the source of the pcie clks are stable.
Best Regards
Richard Zhu
Quoted 10 lines
drivers/pci/host/pci-imx6.c +0
-1/* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid (imx6_pcie->reset_gpio)) {gpio_set_value (imx6_pcie->reset_gpio,0 ); --1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.
</formletter>
Fabio Estevam
reviewerQuoted 8 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>
Thanks, Tim.
Marek,
Does this fix the PCI linkup failures you reported earlier?
Regards,
Fabio Estevam
Marek Vasut
Acked-byQuoted 8 lines · Fabio Estevam
Quoted 7 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Quoted 7 lines
Quoted 1 line
Signed-off-by Tim Harvey <[email protected]>Thanks, Tim.
Marek,
Does this fix the PCI linkup failures you reported earlier?
I currently don't have the board available, so I will moan later if this is still broken. Please go ahead and apply, the patch looks good to me:
Best regards,
Marek Vasut
Quoted 8 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>
Thanks for the patch, Tim:
Quoted 8 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>
Applied to pci/host-imx6 for v3.18 with acks from Marek and Lucas, thanks!
Quoted 36 lines
--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/pci/host/pci-imx6.c +6
-5@@ -256,11 +256,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)struct imx6_pcie *imx6_pcie =to_imx6_pcie (pp);int ret; -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); - ret =clk_prepare_enable (imx6_pcie->pcie_phy);if (ret) {dev_err (pp->dev,"unable to enable pcie_phy clock\n" );@@ -282,6 +277,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)/* allow the clocks to stabilize */ usleep_range (200 ,500 ); +/* power up core phy and enable ref clock */ +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); +/* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid (imx6_pcie->reset_gpio)) {gpio_set_value (imx6_pcie->reset_gpio,0 );Signature · 1 line
1.8.3.2
Quoted 11 lines · Bjorn Helgaas
Quoted 8 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>Applied to pci/host-imx6 for v3.18 with acks from Marek and Lucas, thanks!
Thanks!
Best regards,
Marek Vasut
A message that is not in the archive (sent off-list or not yet received): Message-Id: <[email protected]
PATCH 1/1 PCI: imx6: fix occasional link failure
According to the IMX6 reference manuals, REF_SSP_EN (Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.
Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
---
v2:
- added Tested-by Fabio Estevam
- added Acked-by Marek Vasut
--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/pci/host/pci-imx6.c +6 -5
@@ -256,11 +256,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)struct imx6_pcie *imx6_pcie =to_imx6_pcie (pp);int ret; -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); - ret =clk_prepare_enable (imx6_pcie->pcie_phy);if (ret) {dev_err (pp->dev,"unable to enable pcie_phy clock\n" );
@@ -282,6 +277,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)/* allow the clocks to stabilize */ usleep_range (200 ,500 ); +/* power up core phy and enable ref clock */ +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); +/* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid (imx6_pcie->reset_gpio)) {gpio_set_value (imx6_pcie->reset_gpio,0 );
Signature · 1 line
1.8.3.2
Bjorn Helgaas
maintainerQuoted 10 lines · Tim Harvey
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Signed-off-by Tim Harvey <[email protected]>Tested-by Fabio Estevam <[email protected]>Acked-by Marek Vasut <[email protected]>
I'm looking for the comment update requested by Richard, and an ack from Richard and/or Lucas. Also, please add the stable tag if you want it (see Documentation/stable_kernel_rules.txt for details).
Bjorn
Quoted 42 lines
---
v2:
- added Tested-by Fabio Estevam
- added Acked-by Marek Vasut--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/pci/host/pci-imx6.c +6
-5@@ -256,11 +256,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)struct imx6_pcie *imx6_pcie =to_imx6_pcie (pp);int ret; -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); - ret =clk_prepare_enable (imx6_pcie->pcie_phy);if (ret) {dev_err (pp->dev,"unable to enable pcie_phy clock\n" );@@ -282,6 +277,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)/* allow the clocks to stabilize */ usleep_range (200 ,500 ); +/* power up core phy and enable ref clock */ +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); +/* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid (imx6_pcie->reset_gpio)) {gpio_set_value (imx6_pcie->reset_gpio,0 );Signature · 1 line
1.8.3.2
Lucas Stach
Acked-byAm Freitag, den 05.09.2014, 11:32 -0600 schrieb Bjorn Helgaas:
Quoted 8 lines · Tim Harvey
Quoted 7 lines
According to the IMX6 reference manuals,
REF_SSP_EN(Reference clock enable for SS function) must remain deasserted until the reference clock is running at the appropriate frequency.Without this patch we find a high link failure rate (>5%) on certain IMX6 boards at various temperatures.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Tim Harvey <[email protected]>Tested-by Fabio Estevam <[email protected]>Acked-by Marek Vasut <[email protected]>I'm looking for the comment update requested by Richard, and an ack from Richard and/or Lucas. Also, please add the stable tag if you want it (see
Documentation/stable_kernel_rules.txtfor details).
We already have a comment some line above regarding clock stabilization, so I don't think another one is strictly needed. Especially as this initialization order is clearly defined by the reference manual.
So with or without the comment added:
Quoted 48 lines
Bjorn
Quoted 42 lines
---
v2:
- added Tested-by Fabio Estevam
- added Acked-by Marek Vasut--- drivers/pci/host/pci-imx6.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)drivers/pci/host/pci-imx6.c +6
-5@@ -256,11 +256,6 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)struct imx6_pcie *imx6_pcie =to_imx6_pcie (pp);int ret; -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); -regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , -IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); - ret =clk_prepare_enable (imx6_pcie->pcie_phy);if (ret) {dev_err (pp->dev,"unable to enable pcie_phy clock\n" );@@ -282,6 +277,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)/* allow the clocks to stabilize */ usleep_range (200 ,500 ); +/* power up core phy and enable ref clock */ +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_TEST_PD ,0 <<18 ); +regmap_update_bits (imx6_pcie->iomuxc_gpr,IOMUXC_GPR1 , +IMX6Q_GPR1_PCIE_REF_CLK_EN ,1 <<16 ); +/* Some boards don't have PCIe reset GPIO. */ if (gpio_is_valid (imx6_pcie->reset_gpio)) {gpio_set_value (imx6_pcie->reset_gpio,0 );Signature · 1 line
1.8.3.2--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ |