linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
@ 2024-08-26 12:49 Jinjie Ruan
  2024-08-26 12:49 ` [PATCH -next 1/2] " Jinjie Ruan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jinjie Ruan @ 2024-08-26 12:49 UTC (permalink / raw)
  To: william.zhang, kursad.oney, jonas.gorski,
	bcm-kernel-feedback-list, broonie, anand.gore, florian.fainelli,
	rafal, linux-spi, linux-arm-kernel, linux-kernel
  Cc: ruanjinjie

Fix missing pm_runtime_disable().

Jinjie Ruan (2):
  spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
  spi: bcmbca-hsspi: Use devm_spi_alloc_host()

 drivers/spi/spi-bcmbca-hsspi.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

-- 
2.34.1



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

* [PATCH -next 1/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
  2024-08-26 12:49 [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Jinjie Ruan
@ 2024-08-26 12:49 ` Jinjie Ruan
  2024-08-28 19:07   ` William Zhang
  2024-08-26 12:49 ` [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host() Jinjie Ruan
  2024-08-30 13:26 ` [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Jinjie Ruan @ 2024-08-26 12:49 UTC (permalink / raw)
  To: william.zhang, kursad.oney, jonas.gorski,
	bcm-kernel-feedback-list, broonie, anand.gore, florian.fainelli,
	rafal, linux-spi, linux-arm-kernel, linux-kernel
  Cc: ruanjinjie

The pm_runtime_disable() is missing in remove function, use
devm_pm_runtime_enable() to fix it. So the pm_runtime_disable() in
the probe error path can also be removed.

Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI controller")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-bcmbca-hsspi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index e48a56c68ce7..f465daa473d0 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -539,12 +539,14 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 			goto out_put_host;
 	}
 
-	pm_runtime_enable(&pdev->dev);
+	ret = devm_pm_runtime_enable(&pdev->dev);
+	if (ret)
+		goto out_put_host;
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
 	if (ret) {
 		dev_err(&pdev->dev, "couldn't register sysfs group\n");
-		goto out_pm_disable;
+		goto out_put_host;
 	}
 
 	/* register and we are done */
@@ -558,8 +560,6 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 
 out_sysgroup_disable:
 	sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
-out_pm_disable:
-	pm_runtime_disable(&pdev->dev);
 out_put_host:
 	spi_controller_put(host);
 out_disable_pll_clk:
-- 
2.34.1



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

* [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
  2024-08-26 12:49 [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Jinjie Ruan
  2024-08-26 12:49 ` [PATCH -next 1/2] " Jinjie Ruan
@ 2024-08-26 12:49 ` Jinjie Ruan
  2024-08-28 19:09   ` William Zhang
  2024-08-30 13:26 ` [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Jinjie Ruan @ 2024-08-26 12:49 UTC (permalink / raw)
  To: william.zhang, kursad.oney, jonas.gorski,
	bcm-kernel-feedback-list, broonie, anand.gore, florian.fainelli,
	rafal, linux-spi, linux-arm-kernel, linux-kernel
  Cc: ruanjinjie

Use devm_spi_alloc_host() so that there's no need to call
spi_controller_put() in the error path.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-bcmbca-hsspi.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index f465daa473d0..d936104a41ec 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -480,7 +480,7 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 		}
 	}
 
-	host = spi_alloc_host(&pdev->dev, sizeof(*bs));
+	host = devm_spi_alloc_host(&pdev->dev, sizeof(*bs));
 	if (!host) {
 		ret = -ENOMEM;
 		goto out_disable_pll_clk;
@@ -536,17 +536,17 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 		ret = devm_request_irq(dev, irq, bcmbca_hsspi_interrupt, IRQF_SHARED,
 			       pdev->name, bs);
 		if (ret)
-			goto out_put_host;
+			goto out_disable_pll_clk;
 	}
 
 	ret = devm_pm_runtime_enable(&pdev->dev);
 	if (ret)
-		goto out_put_host;
+		goto out_disable_pll_clk;
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
 	if (ret) {
 		dev_err(&pdev->dev, "couldn't register sysfs group\n");
-		goto out_put_host;
+		goto out_disable_pll_clk;
 	}
 
 	/* register and we are done */
@@ -560,8 +560,6 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 
 out_sysgroup_disable:
 	sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
-out_put_host:
-	spi_controller_put(host);
 out_disable_pll_clk:
 	clk_disable_unprepare(pll_clk);
 out_disable_clk:
-- 
2.34.1



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

* RE: [PATCH -next 1/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
  2024-08-26 12:49 ` [PATCH -next 1/2] " Jinjie Ruan
@ 2024-08-28 19:07   ` William Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: William Zhang @ 2024-08-28 19:07 UTC (permalink / raw)
  To: Jinjie Ruan, Kursad Oney, jonas.gorski, bcm-kernel-feedback-list,
	broonie, Anand Gore, Florian Fainelli, rafal, linux-spi,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]

Hi Jinjie,

> -----Original Message-----
> From: Jinjie Ruan <ruanjinjie@huawei.com>
> Sent: Monday, August 26, 2024 5:49 AM
> To: william.zhang@broadcom.com; kursad.oney@broadcom.com;
> jonas.gorski@gmail.com; bcm-kernel-feedback-list@broadcom.com;
> broonie@kernel.org; anand.gore@broadcom.com;
> florian.fainelli@broadcom.com; rafal@milecki.pl;
linux-spi@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Cc: ruanjinjie@huawei.com
> Subject: [PATCH -next 1/2] spi: bcmbca-hsspi: Fix missing
> pm_runtime_disable()
>
> The pm_runtime_disable() is missing in remove function, use
> devm_pm_runtime_enable() to fix it. So the pm_runtime_disable() in
> the probe error path can also be removed.
>
> Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI
> controller")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/spi/spi-bcmbca-hsspi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-bcmbca-hsspi.c
b/drivers/spi/spi-bcmbca-hsspi.c
> index e48a56c68ce7..f465daa473d0 100644
> --- a/drivers/spi/spi-bcmbca-hsspi.c
> +++ b/drivers/spi/spi-bcmbca-hsspi.c
> @@ -539,12 +539,14 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>  			goto out_put_host;
>  	}
>
> -	pm_runtime_enable(&pdev->dev);
> +	ret = devm_pm_runtime_enable(&pdev->dev);
> +	if (ret)
> +		goto out_put_host;
>
>  	ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
>  	if (ret) {
>  		dev_err(&pdev->dev, "couldn't register sysfs group\n");
> -		goto out_pm_disable;
> +		goto out_put_host;
>  	}
>
>  	/* register and we are done */
> @@ -558,8 +560,6 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>
>  out_sysgroup_disable:
>  	sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
> -out_pm_disable:
> -	pm_runtime_disable(&pdev->dev);
>  out_put_host:
>  	spi_controller_put(host);
>  out_disable_pll_clk:
> --
> 2.34.1

Reviewed-by: William Zhang <william.zhang@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

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

* RE: [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
  2024-08-26 12:49 ` [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host() Jinjie Ruan
@ 2024-08-28 19:09   ` William Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: William Zhang @ 2024-08-28 19:09 UTC (permalink / raw)
  To: Jinjie Ruan, Kursad Oney, jonas.gorski, bcm-kernel-feedback-list,
	broonie, Anand Gore, Florian Fainelli, rafal, linux-spi,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

Hi Jinjie,

> -----Original Message-----
> From: Jinjie Ruan <ruanjinjie@huawei.com>
> Sent: Monday, August 26, 2024 5:49 AM
> To: william.zhang@broadcom.com; kursad.oney@broadcom.com;
> jonas.gorski@gmail.com; bcm-kernel-feedback-list@broadcom.com;
> broonie@kernel.org; anand.gore@broadcom.com;
> florian.fainelli@broadcom.com; rafal@milecki.pl;
linux-spi@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Cc: ruanjinjie@huawei.com
> Subject: [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
>
> Use devm_spi_alloc_host() so that there's no need to call
> spi_controller_put() in the error path.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/spi/spi-bcmbca-hsspi.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/spi/spi-bcmbca-hsspi.c
b/drivers/spi/spi-bcmbca-hsspi.c
> index f465daa473d0..d936104a41ec 100644
> --- a/drivers/spi/spi-bcmbca-hsspi.c
> +++ b/drivers/spi/spi-bcmbca-hsspi.c
> @@ -480,7 +480,7 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>  		}
>  	}
>
> -	host = spi_alloc_host(&pdev->dev, sizeof(*bs));
> +	host = devm_spi_alloc_host(&pdev->dev, sizeof(*bs));
>  	if (!host) {
>  		ret = -ENOMEM;
>  		goto out_disable_pll_clk;
> @@ -536,17 +536,17 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>  		ret = devm_request_irq(dev, irq, bcmbca_hsspi_interrupt,
> IRQF_SHARED,
>  			       pdev->name, bs);
>  		if (ret)
> -			goto out_put_host;
> +			goto out_disable_pll_clk;
>  	}
>
>  	ret = devm_pm_runtime_enable(&pdev->dev);
>  	if (ret)
> -		goto out_put_host;
> +		goto out_disable_pll_clk;
>
>  	ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
>  	if (ret) {
>  		dev_err(&pdev->dev, "couldn't register sysfs group\n");
> -		goto out_put_host;
> +		goto out_disable_pll_clk;
>  	}
>
>  	/* register and we are done */
> @@ -560,8 +560,6 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>
>  out_sysgroup_disable:
>  	sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
> -out_put_host:
> -	spi_controller_put(host);
>  out_disable_pll_clk:
>  	clk_disable_unprepare(pll_clk);
>  out_disable_clk:
> --
> 2.34.1

Reviewed-by: William Zhang <william.zhang@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

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

* Re: [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
  2024-08-26 12:49 [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Jinjie Ruan
  2024-08-26 12:49 ` [PATCH -next 1/2] " Jinjie Ruan
  2024-08-26 12:49 ` [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host() Jinjie Ruan
@ 2024-08-30 13:26 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-08-30 13:26 UTC (permalink / raw)
  To: william.zhang, kursad.oney, jonas.gorski,
	bcm-kernel-feedback-list, anand.gore, florian.fainelli, rafal,
	linux-spi, linux-arm-kernel, linux-kernel, Jinjie Ruan

On Mon, 26 Aug 2024 20:49:01 +0800, Jinjie Ruan wrote:
> Fix missing pm_runtime_disable().
> 
> Jinjie Ruan (2):
>   spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
>   spi: bcmbca-hsspi: Use devm_spi_alloc_host()
> 
> drivers/spi/spi-bcmbca-hsspi.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable()
      commit: 11543f534adf7436239da26e5efa495adb47615d
[2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
      commit: deb269e0394f2c75e1735132e29fa2f5181e107a

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark



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

end of thread, other threads:[~2024-08-30 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26 12:49 [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Jinjie Ruan
2024-08-26 12:49 ` [PATCH -next 1/2] " Jinjie Ruan
2024-08-28 19:07   ` William Zhang
2024-08-26 12:49 ` [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host() Jinjie Ruan
2024-08-28 19:09   ` William Zhang
2024-08-30 13:26 ` [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Mark Brown

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).