[PATCH] pwm: bcm2835: Fix NPD in suspend/resume

Florian Fainelli posted 1 patch 2 years, 1 month ago
drivers/pwm/pwm-bcm2835.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] pwm: bcm2835: Fix NPD in suspend/resume
Posted by Florian Fainelli 2 years, 1 month ago
When 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") was
sent out on October 11th,, there was still a call to
platform_set_drvdata() which would ensure that the driver private data
structure could be used in bcm2835_pwm_{suspend,resume}.

A cleanup now merged as commit commit 2ce7b7f6704c ("pwm: bcm2835:
Simplify using devm functions") removed that call which would now cause
a NPD in bcm2835_pwm_{suspend,resume} as a consequence.

Fixes: 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/pwm/pwm-bcm2835.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c
index 9777babd5b95..ab30667f4f95 100644
--- a/drivers/pwm/pwm-bcm2835.c
+++ b/drivers/pwm/pwm-bcm2835.c
@@ -155,6 +155,8 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
 	pc->chip.ops = &bcm2835_pwm_ops;
 	pc->chip.npwm = 2;
 
+	platform_set_drvdata(pdev, pc);
+
 	ret = devm_pwmchip_add(&pdev->dev, &pc->chip);
 	if (ret < 0)
 		return dev_err_probe(&pdev->dev, ret,
-- 
2.34.1
Re: [PATCH] pwm: bcm2835: Fix NPD in suspend/resume
Posted by Thierry Reding 2 years, 1 month ago
On Mon, 13 Nov 2023 08:46:32 -0800, Florian Fainelli wrote:
> When 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") was
> sent out on October 11th,, there was still a call to
> platform_set_drvdata() which would ensure that the driver private data
> structure could be used in bcm2835_pwm_{suspend,resume}.
> 
> A cleanup now merged as commit commit 2ce7b7f6704c ("pwm: bcm2835:
> Simplify using devm functions") removed that call which would now cause
> a NPD in bcm2835_pwm_{suspend,resume} as a consequence.
> 
> [...]

Applied, thanks!

[1/1] pwm: bcm2835: Fix NPD in suspend/resume
      commit: fba7e9f839d7fcb0888094697da45c5668226455

Best regards,
-- 
Thierry Reding <thierry.reding@gmail.com>
Re: [PATCH] pwm: bcm2835: Fix NPD in suspend/resume
Posted by Uwe Kleine-König 2 years, 1 month ago
On Tue, Nov 28, 2023 at 06:49:22PM +0100, Thierry Reding wrote:
> 
> On Mon, 13 Nov 2023 08:46:32 -0800, Florian Fainelli wrote:
> > When 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") was
> > sent out on October 11th,, there was still a call to
> > platform_set_drvdata() which would ensure that the driver private data
> > structure could be used in bcm2835_pwm_{suspend,resume}.
> > 
> > A cleanup now merged as commit commit 2ce7b7f6704c ("pwm: bcm2835:
> > Simplify using devm functions") removed that call which would now cause
> > a NPD in bcm2835_pwm_{suspend,resume} as a consequence.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/1] pwm: bcm2835: Fix NPD in suspend/resume
>       commit: fba7e9f839d7fcb0888094697da45c5668226455

This one should IMHO go into v6.7. Do you intend to send it to Linus
during the current cycle?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Re: [PATCH] pwm: bcm2835: Fix NPD in suspend/resume
Posted by Uwe Kleine-König 2 years, 1 month ago
Hello Thierry,

On Tue, Nov 28, 2023 at 09:55:48PM +0100, Uwe Kleine-König wrote:
> On Tue, Nov 28, 2023 at 06:49:22PM +0100, Thierry Reding wrote:
> > 
> > On Mon, 13 Nov 2023 08:46:32 -0800, Florian Fainelli wrote:
> > > When 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") was
> > > sent out on October 11th,, there was still a call to
> > > platform_set_drvdata() which would ensure that the driver private data
> > > structure could be used in bcm2835_pwm_{suspend,resume}.
> > > 
> > > A cleanup now merged as commit commit 2ce7b7f6704c ("pwm: bcm2835:
> > > Simplify using devm functions") removed that call which would now cause
> > > a NPD in bcm2835_pwm_{suspend,resume} as a consequence.
> > > 
> > > [...]
> > 
> > Applied, thanks!
> > 
> > [1/1] pwm: bcm2835: Fix NPD in suspend/resume
> >       commit: fba7e9f839d7fcb0888094697da45c5668226455
> 
> This one should IMHO go into v6.7. Do you intend to send it to Linus
> during the current cycle?

We know since > 2 weeks now that the pwm-bcm2835 driver is broken in
v6.7-rc1 and there is a fix since day 0.

If you continue to be silent about this (here and at
https://lore.kernel.org/linux-pwm/20231121112029.gyv3gqirlycysyr4@pengutronix.de)
I intend to send a PR to Linus with this fix on Friday next week.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Re: [PATCH] pwm: bcm2835: Fix NPD in suspend/resume
Posted by Uwe Kleine-König 2 years, 1 month ago
Hello,

On Mon, Nov 13, 2023 at 08:46:32AM -0800, Florian Fainelli wrote:
> When 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") was
> sent out on October 11th,, there was still a call to
> platform_set_drvdata() which would ensure that the driver private data
> structure could be used in bcm2835_pwm_{suspend,resume}.
> 
> A cleanup now merged as commit commit 2ce7b7f6704c ("pwm: bcm2835:
> Simplify using devm functions") removed that call which would now cause
> a NPD in bcm2835_pwm_{suspend,resume} as a consequence.
> 
> Fixes: 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume")
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>

oops, indeed.

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |