From: Xiaolei Wang <xiaolei.wang@windriver.com>
To: <hongxing.zhu@nxp.com>, <l.stach@pengutronix.de>,
<lorenzo.pieralisi@arm.com>, <robh@kernel.org>, <kw@linux.com>,
<bhelgaas@google.com>, <shawnguo@kernel.org>,
<s.hauer@pengutronix.de>, <kernel@pengutronix.de>,
<festevam@gmail.com>
Cc: <linux-imx@nxp.com>, <linux-pci@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] pci: imx: disable reglator when imx6_pcie_probe fails
Date: Mon, 17 Jan 2022 18:17:35 +0800 [thread overview]
Message-ID: <20220117101735.3512039-1-xiaolei.wang@windriver.com> (raw)
From: wrsadmin <wrsadmin@pek-xwang8-d1.corp.ad.wrs.com>
disable reglator when imx6_pcie_probe fails,
otherwise the following calltrace will appear
[ 3.785075] ------------[ cut here ]------------
[ 3.788142] Registering SWP/SWPB emulation handler
[ 3.789853] WARNING: CPU: 0 PID: 7 at drivers/regulator/core.c:2257 _regulator_put.part.0+0x1bc/0x1e0
[ 3.795680] Loading compiled-in X.509 certificates
[ 3.803947] Modules linked in:
[ 3.811922] CPU: 0 PID: 7 Comm: kworker/u8:0 Not tainted 5.16.0-10645-g3c750c7b6143-dirty #9
[ 3.820393] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 3.826945] Workqueue: events_unbound async_run_entry_fn
[ 3.832304] unwind_backtrace from show_stack+0x10/0x14
[ 3.837569] show_stack from dump_stack_lvl+0x58/0x70
[ 3.842663] dump_stack_lvl from __warn+0xd8/0x114
[ 3.847493] __warn from warn_slowpath_fmt+0x5c/0xc4
[ 3.852490] warn_slowpath_fmt from _regulator_put.part.0+0x1bc/0x1e0
[ 3.858968] _regulator_put.part.0 from regulator_put+0x2c/0x3c
[ 3.864918] regulator_put from release_nodes+0x50/0x178
[ 3.870270] release_nodes from devres_release_all+0x80/0xd0
[ 3.875968] devres_release_all from really_probe+0xdc/0x30c
[ 3.881661] really_probe from __driver_probe_device+0x80/0xe4
[ 3.887522] __driver_probe_device from driver_probe_device+0x30/0xd4
[ 3.893991] driver_probe_device from __driver_attach_async_helper+0x20/0x38
[ 3.901068] __driver_attach_async_helper from async_run_entry_fn+0x20/0xb4
[ 3.908059] async_run_entry_fn from process_one_work+0x298/0x7d0
[ 3.914188] process_one_work from worker_thread+0x30/0x510
[ 3.919792] worker_thread from kthread+0x128/0x14c
[ 3.924705] kthread from ret_from_fork+0x14/0x38
[ 3.929443] Exception stack(0xc20cbfb0 to 0xc20cbff8)
[ 3.934521] bfa0: 00000000 00000000 00000000 00000000
[ 3.942722] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 3.950922] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 3.957677] irq event stamp: 1207
[ 3.961024] hardirqs last enabled at (1215): [<c0198270>] __up_console_sem+0x50/0x60
[ 3.968974] hardirqs last disabled at (1224): [<c019825c>] __up_console_sem+0x3c/0x60
[ 3.976911] softirqs last enabled at (1206): [<c010150c>] __do_softirq+0x2ec/0x5a4
[ 3.984669] softirqs last disabled at (1197): [<c012ef08>] irq_exit+0x18c/0x20c
[ 3.992021] ---[ end trace 45a52c023bf8fb33 ]---
Signed-off-by: wrsadmin <wrsadmin@pek-xwang8-d1.corp.ad.wrs.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 6974bd5aa116..f8279a15463b 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1216,7 +1216,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
ret = dw_pcie_host_init(&pci->pp);
if (ret < 0)
- return ret;
+ goto err_vpcie;
if (pci_msi_enabled()) {
u8 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_MSI);
@@ -1226,6 +1226,11 @@ static int imx6_pcie_probe(struct platform_device *pdev)
}
return 0;
+
+err_vpcie:
+ regulator_disable(imx6_pcie->vpcie);
+
+ return ret;
}
static void imx6_pcie_shutdown(struct platform_device *pdev)
--
2.25.1
next reply other threads:[~2022-01-17 10:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 10:17 Xiaolei Wang [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-01-17 10:21 [PATCH] pci: imx: disable reglator when imx6_pcie_probe fails Xiaolei Wang
2022-01-17 23:17 ` Bjorn Helgaas
2022-01-18 1:00 ` Hongxing Zhu
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=20220117101735.3512039-1-xiaolei.wang@windriver.com \
--to=xiaolei.wang@windriver.com \
--cc=bhelgaas@google.com \
--cc=festevam@gmail.com \
--cc=hongxing.zhu@nxp.com \
--cc=kernel@pengutronix.de \
--cc=kw@linux.com \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).