Skip to content

Commit 5374af3

Browse files
wqyoungintel-lab-lkp
authored andcommitted
phy: freescale: imx8qm-hsio: Fix a use of uninitialized mutex
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 torvalds#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: 82c56b6 ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support") Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
1 parent 9f9d41d commit 5374af3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/phy/freescale/phy-fsl-imx8qm-hsio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ static int imx_hsio_probe(struct platform_device *pdev)
590590
phy_set_drvdata(phy, lane);
591591
}
592592

593+
mutex_init(&priv->lock);
594+
593595
dev_set_drvdata(dev, priv);
594596
dev_set_drvdata(&pdev->dev, priv);
595597

0 commit comments

Comments
 (0)