All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail
@ 2020-08-31  7:53 Chuanjia Liu
  2020-08-31 14:41 ` Aw: " Frank Wunderlich
  2020-09-10 18:40 ` Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Chuanjia Liu @ 2020-08-31  7:53 UTC (permalink / raw)
  To: u-boot

On the mt7623 platform, if one port enable fail and other port
enable succeed. It will hang on when using pci enum
because the resource was not released correctly.

Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/pci/pcie_mediatek.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pcie_mediatek.c b/drivers/pci/pcie_mediatek.c
index ad34f7c597..55b6a40f25 100644
--- a/drivers/pci/pcie_mediatek.c
+++ b/drivers/pci/pcie_mediatek.c
@@ -443,29 +443,36 @@ static void mtk_pcie_enable_port(struct mtk_pcie_port *port)
 
 	err = clk_enable(&port->sys_ck);
 	if (err)
-		goto exit;
+		goto err_sys_clk;
 
 	err = reset_assert(&port->reset);
 	if (err)
-		goto exit;
+		goto err_reset;
 
 	err = reset_deassert(&port->reset);
 	if (err)
-		goto exit;
+		goto err_reset;
 
 	err = generic_phy_init(&port->phy);
 	if (err)
-		goto exit;
+		goto err_phy_init;
 
 	err = generic_phy_power_on(&port->phy);
 	if (err)
-		goto exit;
+		goto err_phy_on;
 
 	if (!mtk_pcie_startup_port(port))
 		return;
 
 	pr_err("Port%d link down\n", port->slot);
-exit:
+
+	generic_phy_power_off(&port->phy);
+err_phy_on:
+	generic_phy_exit(&port->phy);
+err_phy_init:
+err_reset:
+	clk_disable(&port->sys_ck);
+err_sys_clk:
 	mtk_pcie_port_free(port);
 }
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Aw: [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail
  2020-08-31  7:53 [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail Chuanjia Liu
@ 2020-08-31 14:41 ` Frank Wunderlich
  2020-09-10 18:40 ` Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2020-08-31 14:41 UTC (permalink / raw)
  To: u-boot

Hi,

thank you for fixing this issue :)

regards Frank


> Gesendet: Montag, 31. August 2020 um 09:53 Uhr
> Von: "Chuanjia Liu" <Chuanjia.Liu@mediatek.com>
> On the mt7623 platform, if one port enable fail and other port
> enable succeed. It will hang on when using pci enum
> because the resource was not released correctly.
>
> Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
> Tested-by: Frank Wunderlich <frank-w@public-files.de>

if fixes-Tag is needed:

Fixes: 42d37450e5 ("pci: mediatek: add PCIe controller support for MT7623")

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail
  2020-08-31  7:53 [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail Chuanjia Liu
  2020-08-31 14:41 ` Aw: " Frank Wunderlich
@ 2020-09-10 18:40 ` Tom Rini
  2020-09-10 18:59   ` Frank Wunderlich
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2020-09-10 18:40 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 31, 2020 at 03:53:12PM +0800, Chuanjia Liu wrote:

> On the mt7623 platform, if one port enable fail and other port
> enable succeed. It will hang on when using pci enum
> because the resource was not released correctly.
> 
> Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
> Tested-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/next, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200910/5a1b1edf/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail
  2020-09-10 18:40 ` Tom Rini
@ 2020-09-10 18:59   ` Frank Wunderlich
  2020-09-10 19:33     ` Tom Rini
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Wunderlich @ 2020-09-10 18:59 UTC (permalink / raw)
  To: u-boot

Am 10. September 2020 20:40:10 MESZ schrieb Tom Rini <trini@konsulko.com>:
>Applied to u-boot/next, thanks!

Thanks

Can it be applied to current release too as it is a fix (hang till watchdog reset on pci enum if no card inserted in pcie slot,but sata chip connected)?
regards Frank

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail
  2020-09-10 18:59   ` Frank Wunderlich
@ 2020-09-10 19:33     ` Tom Rini
  2020-09-10 19:42       ` Frank Wunderlich
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2020-09-10 19:33 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 10, 2020 at 08:59:05PM +0200, Frank Wunderlich wrote:

> Am 10. September 2020 20:40:10 MESZ schrieb Tom Rini <trini@konsulko.com>:
> >Applied to u-boot/next, thanks!
> 
> Thanks
> 
> Can it be applied to current release too as it is a fix (hang till watchdog reset on pci enum if no card inserted in pcie slot,but sata chip connected)?

Yes, OK, thanks for letting me know.  I've queued this up for master
when I push again.  Is there anything else currently that's outstanding
for MediaTek and should be in this release?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200910/e568beb0/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail
  2020-09-10 19:33     ` Tom Rini
@ 2020-09-10 19:42       ` Frank Wunderlich
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2020-09-10 19:42 UTC (permalink / raw)
  To: u-boot

Am 10. September 2020 21:33:01 MESZ schrieb Tom Rini <trini@konsulko.com>:

>Yes, OK, thanks for letting me know.  I've queued this up for master
>when I push again.  Is there anything else currently that's outstanding
>for MediaTek and should be in this release?

Hi,

For my boards only xhci 0.96 support is outstanding,but this is more functionality than bugfix and missing it does not break (only usb not working on bpi r2/r64). So i guess it will go in next.
regards Frank

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-10 19:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31  7:53 [PATCH] PCI: mediatek: Release the resource when PCIe enable port fail Chuanjia Liu
2020-08-31 14:41 ` Aw: " Frank Wunderlich
2020-09-10 18:40 ` Tom Rini
2020-09-10 18:59   ` Frank Wunderlich
2020-09-10 19:33     ` Tom Rini
2020-09-10 19:42       ` Frank Wunderlich

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.