From: quanyang.wang@windriver.com
To: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Richard Zhu <hongxing.zhu@nxp.com>, Frank Li <Frank.Li@nxp.com>
Cc: Quanyang Wang <quanyang.wang@windriver.com>,
linux-phy@lists.infradead.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] phy: freescale: imx8qm-hsio: Fix a use of uninitialized mutex
Date: Thu, 31 Jul 2025 10:07:17 +0800 [thread overview]
Message-ID: <20250731020717.2240392-1-quanyang.wang@windriver.com> (raw)
From: Quanyang Wang <quanyang.wang@windriver.com>
Using an uninitialized mutex leads to the following warning when
CONFIG_DEBUG_MUTEXES is enabled.
DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: CPU: 2 PID: 49 at kernel/locking/mutex.c:577 __mutex_lock+0x690/0x820
Modules linked in:
CPU: 2 UID: 0 PID: 49 Comm: kworker/u16:2 Not tainted 6.16.0-04405-g4b290aae788e #23 PREEMPT
Hardware name: Freescale i.MX8QM MEK (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __mutex_lock+0x690/0x820
lr : __mutex_lock+0x690/0x820
sp : ffff8000830b3900
x29: ffff8000830b3960 x28: ffff80008223bac0 x27: 0000000000000000
x26: ffff000802fc4680 x25: ffff000800019a0d x24: 0000000000000000
x23: ffff8000806f0d6c x22: 0000000000000002 x21: 0000000000000000
x20: ffff8000830b3930 x19: ffff000802338090 x18: fffffffffffe6138
x17: 67657220796d6d75 x16: 6420676e69737520 x15: 0000000000000038
x14: 0000000000000000 x13: ffff8000822636f0 x12: 000000000000044a
x11: 000000000000016e x10: ffff8000822bd940 x9 : ffff8000822636f0
x8 : 00000000ffffefff x7 : ffff8000822bb6f0 x6 : 000000000000016e
x5 : 000000000000016f x4 : 40000000fffff16e x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0008003b8000
Call trace:
__mutex_lock+0x690/0x820 (P)
mutex_lock_nested+0x24/0x30
imx_hsio_power_on+0x4c/0x764
phy_power_on+0x7c/0x12c
imx_sata_enable+0x1ec/0x488
imx_ahci_probe+0x1a4/0x560
platform_probe+0x5c/0x98
really_probe+0xac/0x298
__driver_probe_device+0x78/0x12c
driver_probe_device+0xd8/0x160
__device_attach_driver+0xb8/0x138
bus_for_each_drv+0x88/0xe8
__device_attach+0xa0/0x190
device_initial_probe+0x14/0x20
bus_probe_device+0xac/0xb0
deferred_probe_work_func+0x8c/0xc8
process_one_work+0x1e4/0x440
worker_thread+0x1b4/0x350
kthread+0x138/0x214
ret_from_fork+0x10/0x20
Fixes: 82c56b6dd24f ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support")
Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
---
drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
index 5dca93cd325c8..c97b7ae3f5b63 100644
--- a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
+++ b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
@@ -590,6 +590,8 @@ static int imx_hsio_probe(struct platform_device *pdev)
phy_set_drvdata(phy, lane);
}
+ mutex_init(&priv->lock);
+
dev_set_drvdata(dev, priv);
dev_set_drvdata(&pdev->dev, priv);
--
2.43.0
next reply other threads:[~2025-07-31 2:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 2:07 quanyang.wang [this message]
2025-07-31 23:23 ` [PATCH] phy: freescale: imx8qm-hsio: Fix a use of uninitialized mutex Frank Li
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=20250731020717.2240392-1-quanyang.wang@windriver.com \
--to=quanyang.wang@windriver.com \
--cc=Frank.Li@nxp.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=vkoul@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).