diff mbox

[RESEND] pwm: brcmstb: Don't set can_sleep flag

Message ID 1448347392.17722.1.camel@ingics.com
State Rejected
Headers show

Commit Message

Axel Lin Nov. 24, 2015, 6:43 a.m. UTC
The .can_sleep flag is used for some PWM controllers that can't be used
in atomic context. Not such case for this driver, so don't set the
can_sleep flag.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Brian Norris <computersforpeace@gmail.com>
---
This patch was sent on http://www.spinics.net/lists/linux-pwm/msg03506.html

 drivers/pwm/pwm-brcmstb.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Thierry Reding Nov. 24, 2015, 4:27 p.m. UTC | #1
On Tue, Nov 24, 2015 at 02:43:12PM +0800, Axel Lin wrote:
> The .can_sleep flag is used for some PWM controllers that can't be used
> in atomic context. Not such case for this driver, so don't set the
> can_sleep flag.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> Reviewed-by: Brian Norris <computersforpeace@gmail.com>
> ---
> This patch was sent on http://www.spinics.net/lists/linux-pwm/msg03506.html
> 
>  drivers/pwm/pwm-brcmstb.c | 1 -
>  1 file changed, 1 deletion(-)

There's some discussion currently about marking all drivers can_sleep
and modify all users to cope with it correctly. The reason is that we
introduced a mutex in pwm_enable() and pwm_set_polarity() which means
that PWM devices effectively can't be used from interrupt or atomic
contexts.

It also means that the driver is actually currently correct, so I'd
like to leave it as-is until the users have been sorted out, at which
point we can simply get rid of can_sleep.

Thierry
diff mbox

Patch

diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c
index 423ce08..f58039b 100644
--- a/drivers/pwm/pwm-brcmstb.c
+++ b/drivers/pwm/pwm-brcmstb.c
@@ -270,7 +270,6 @@  static int brcmstb_pwm_probe(struct platform_device *pdev)
 	p->chip.ops = &brcmstb_pwm_ops;
 	p->chip.base = -1;
 	p->chip.npwm = 2;
-	p->chip.can_sleep = true;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	p->base = devm_ioremap_resource(&pdev->dev, res);