Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH v2] phy: freescale: Initialize priv->lock
@ 2025-09-25  1:38 Xiaolei Wang
  2025-09-25  3:58 ` Frank Li
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Xiaolei Wang @ 2025-09-25  1:38 UTC (permalink / raw)
  To: Frank.li, vkoul, kishon, shawnguo, s.hauer, kernel, festevam
  Cc: linux-phy, imx, linux-arm-kernel, linux-kernel

Initialize priv->lock to fix the following warning.

WARNING: CPU: 0 PID: 12 at kernel/locking/mutex.c:577 __mutex_lock+0x70c/0x8b8
 Modules linked in:
 Hardware name: Freescale i.MX8QM MEK (DT)
 Call trace:
  __mutex_lock+0x70c/0x8b8 (P)
  mutex_lock_nested+0x24/0x30
  imx_hsio_power_on+0x4c/0x764
  phy_power_on+0x7c/0x12c
  imx_pcie_host_init+0x1d0/0x4d4
  dw_pcie_host_init+0x188/0x4b0
  imx_pcie_probe+0x324/0x6f4
  platform_probe+0x5c/0x98
  really_probe+0xbc/0x29c
  __driver_probe_device+0x78/0x12c
  driver_probe_device+0xd8/0x160
  __device_attach_driver+0xb8/0x138
  bus_for_each_drv+0x84/0xe4
  __device_attach_async_helper+0xb8/0xdc
  async_run_entry_fn+0x34/0xe0
  process_one_work+0x220/0x694
  worker_thread+0x1c0/0x36c
  kthread+0x14c/0x224

Fixes: 82c56b6dd24f ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
---
v1: https://patchwork.kernel.org/project/imx/patch/20250923141611.1295395-1-xiaolei.wang@windriver.com/

v2: Use devm_mutex_init() instead of mutex_init()

 drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
index 5dca93cd325c..977d21d753a5 100644
--- a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
+++ b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
@@ -533,7 +533,7 @@ static struct phy *imx_hsio_xlate(struct device *dev,
 
 static int imx_hsio_probe(struct platform_device *pdev)
 {
-	int i;
+	int i, ret;
 	void __iomem *off;
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
@@ -545,6 +545,9 @@ static int imx_hsio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	priv->dev = &pdev->dev;
 	priv->drvdata = of_device_get_match_data(dev);
+	ret = devm_mutex_init(dev, &priv->lock);
+	if (ret)
+		return ret;
 
 	/* Get HSIO configuration mode */
 	if (of_property_read_string(np, "fsl,hsio-cfg", &priv->hsio_cfg))
-- 
2.43.0


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

* Re: [PATCH v2] phy: freescale: Initialize priv->lock
  2025-09-25  1:38 [PATCH v2] phy: freescale: Initialize priv->lock Xiaolei Wang
@ 2025-09-25  3:58 ` Frank Li
  2025-11-19  8:40 ` Neil Armstrong
  2025-11-20 17:11 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2025-09-25  3:58 UTC (permalink / raw)
  To: Xiaolei Wang
  Cc: vkoul, kishon, shawnguo, s.hauer, kernel, festevam, linux-phy,
	imx, linux-arm-kernel, linux-kernel

On Thu, Sep 25, 2025 at 09:38:06AM +0800, Xiaolei Wang wrote:
> Initialize priv->lock to fix the following warning.
>
> WARNING: CPU: 0 PID: 12 at kernel/locking/mutex.c:577 __mutex_lock+0x70c/0x8b8
>  Modules linked in:
>  Hardware name: Freescale i.MX8QM MEK (DT)
>  Call trace:
>   __mutex_lock+0x70c/0x8b8 (P)
>   mutex_lock_nested+0x24/0x30
>   imx_hsio_power_on+0x4c/0x764
>   phy_power_on+0x7c/0x12c
>   imx_pcie_host_init+0x1d0/0x4d4
>   dw_pcie_host_init+0x188/0x4b0
>   imx_pcie_probe+0x324/0x6f4
>   platform_probe+0x5c/0x98
>   really_probe+0xbc/0x29c
>   __driver_probe_device+0x78/0x12c
>   driver_probe_device+0xd8/0x160
>   __device_attach_driver+0xb8/0x138
>   bus_for_each_drv+0x84/0xe4
>   __device_attach_async_helper+0xb8/0xdc
>   async_run_entry_fn+0x34/0xe0
>   process_one_work+0x220/0x694
>   worker_thread+0x1c0/0x36c
>   kthread+0x14c/0x224
>
> Fixes: 82c56b6dd24f ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support")
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> v1: https://patchwork.kernel.org/project/imx/patch/20250923141611.1295395-1-xiaolei.wang@windriver.com/
>
> v2: Use devm_mutex_init() instead of mutex_init()
>
>  drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> index 5dca93cd325c..977d21d753a5 100644
> --- a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> +++ b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> @@ -533,7 +533,7 @@ static struct phy *imx_hsio_xlate(struct device *dev,
>
>  static int imx_hsio_probe(struct platform_device *pdev)
>  {
> -	int i;
> +	int i, ret;
>  	void __iomem *off;
>  	struct device *dev = &pdev->dev;
>  	struct device_node *np = dev->of_node;
> @@ -545,6 +545,9 @@ static int imx_hsio_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	priv->dev = &pdev->dev;
>  	priv->drvdata = of_device_get_match_data(dev);
> +	ret = devm_mutex_init(dev, &priv->lock);
> +	if (ret)
> +		return ret;
>
>  	/* Get HSIO configuration mode */
>  	if (of_property_read_string(np, "fsl,hsio-cfg", &priv->hsio_cfg))
> --
> 2.43.0
>

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

* Re: [PATCH v2] phy: freescale: Initialize priv->lock
  2025-09-25  1:38 [PATCH v2] phy: freescale: Initialize priv->lock Xiaolei Wang
  2025-09-25  3:58 ` Frank Li
@ 2025-11-19  8:40 ` Neil Armstrong
  2025-11-20 17:11 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2025-11-19  8:40 UTC (permalink / raw)
  To: Xiaolei Wang, Frank.li, vkoul, kishon, shawnguo, s.hauer, kernel,
	festevam
  Cc: linux-phy, imx, linux-arm-kernel, linux-kernel

On 9/25/25 03:38, Xiaolei Wang wrote:
> Initialize priv->lock to fix the following warning.
> 
> WARNING: CPU: 0 PID: 12 at kernel/locking/mutex.c:577 __mutex_lock+0x70c/0x8b8
>   Modules linked in:
>   Hardware name: Freescale i.MX8QM MEK (DT)
>   Call trace:
>    __mutex_lock+0x70c/0x8b8 (P)
>    mutex_lock_nested+0x24/0x30
>    imx_hsio_power_on+0x4c/0x764
>    phy_power_on+0x7c/0x12c
>    imx_pcie_host_init+0x1d0/0x4d4
>    dw_pcie_host_init+0x188/0x4b0
>    imx_pcie_probe+0x324/0x6f4
>    platform_probe+0x5c/0x98
>    really_probe+0xbc/0x29c
>    __driver_probe_device+0x78/0x12c
>    driver_probe_device+0xd8/0x160
>    __device_attach_driver+0xb8/0x138
>    bus_for_each_drv+0x84/0xe4
>    __device_attach_async_helper+0xb8/0xdc
>    async_run_entry_fn+0x34/0xe0
>    process_one_work+0x220/0x694
>    worker_thread+0x1c0/0x36c
>    kthread+0x14c/0x224
> 
> Fixes: 82c56b6dd24f ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support")
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---
> v1: https://patchwork.kernel.org/project/imx/patch/20250923141611.1295395-1-xiaolei.wang@windriver.com/
> 
> v2: Use devm_mutex_init() instead of mutex_init()
> 
>   drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> index 5dca93cd325c..977d21d753a5 100644
> --- a/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> +++ b/drivers/phy/freescale/phy-fsl-imx8qm-hsio.c
> @@ -533,7 +533,7 @@ static struct phy *imx_hsio_xlate(struct device *dev,
>   
>   static int imx_hsio_probe(struct platform_device *pdev)
>   {
> -	int i;
> +	int i, ret;
>   	void __iomem *off;
>   	struct device *dev = &pdev->dev;
>   	struct device_node *np = dev->of_node;
> @@ -545,6 +545,9 @@ static int imx_hsio_probe(struct platform_device *pdev)
>   		return -ENOMEM;
>   	priv->dev = &pdev->dev;
>   	priv->drvdata = of_device_get_match_data(dev);
> +	ret = devm_mutex_init(dev, &priv->lock);
> +	if (ret)
> +		return ret;
>   
>   	/* Get HSIO configuration mode */
>   	if (of_property_read_string(np, "fsl,hsio-cfg", &priv->hsio_cfg))

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

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

* Re: [PATCH v2] phy: freescale: Initialize priv->lock
  2025-09-25  1:38 [PATCH v2] phy: freescale: Initialize priv->lock Xiaolei Wang
  2025-09-25  3:58 ` Frank Li
  2025-11-19  8:40 ` Neil Armstrong
@ 2025-11-20 17:11 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2025-11-20 17:11 UTC (permalink / raw)
  To: Frank.li, kishon, shawnguo, s.hauer, kernel, festevam,
	Xiaolei Wang
  Cc: linux-phy, imx, linux-arm-kernel, linux-kernel


On Thu, 25 Sep 2025 09:38:06 +0800, Xiaolei Wang wrote:
> Initialize priv->lock to fix the following warning.
> 
> WARNING: CPU: 0 PID: 12 at kernel/locking/mutex.c:577 __mutex_lock+0x70c/0x8b8
>  Modules linked in:
>  Hardware name: Freescale i.MX8QM MEK (DT)
>  Call trace:
>   __mutex_lock+0x70c/0x8b8 (P)
>   mutex_lock_nested+0x24/0x30
>   imx_hsio_power_on+0x4c/0x764
>   phy_power_on+0x7c/0x12c
>   imx_pcie_host_init+0x1d0/0x4d4
>   dw_pcie_host_init+0x188/0x4b0
>   imx_pcie_probe+0x324/0x6f4
>   platform_probe+0x5c/0x98
>   really_probe+0xbc/0x29c
>   __driver_probe_device+0x78/0x12c
>   driver_probe_device+0xd8/0x160
>   __device_attach_driver+0xb8/0x138
>   bus_for_each_drv+0x84/0xe4
>   __device_attach_async_helper+0xb8/0xdc
>   async_run_entry_fn+0x34/0xe0
>   process_one_work+0x220/0x694
>   worker_thread+0x1c0/0x36c
>   kthread+0x14c/0x224
> 
> [...]

Applied, thanks!

[1/1] phy: freescale: Initialize priv->lock
      commit: 95e5905698983df94069e185f9eb3c67c7cf75d5

Best regards,
-- 
~Vinod



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

end of thread, other threads:[~2025-11-20 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-25  1:38 [PATCH v2] phy: freescale: Initialize priv->lock Xiaolei Wang
2025-09-25  3:58 ` Frank Li
2025-11-19  8:40 ` Neil Armstrong
2025-11-20 17:11 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox