Skip to contentSkip to conversation

pwm: imx: set can_sleep flag for imx_pwm

PATCH Superseded Shawn Guo 3 participants 4 messages May 23, 2014 – Aug 7, 2014

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH v2 1/1 pwm: imx: set can_sleep flag for imx_pwm

The .config() hook imx_pwm_config() calls clk APIs like clk_prepare() and clk_get_rate(), which might sleep, so we need to set can_sleep flag on pwm_chip.

---
Changes since v1:
- Set can_sleep flag for both imx_pwm_v1 and imx_pwm_v2

 drivers/pwm/pwm-imx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-imx.c +1 -0
index d797c7b84c3f..5449d9150d40 100644
@@ -262,6 +262,7 @@ static int imx_pwm_probe(struct platform_device *pdev)
 	imx->chip.dev = &pdev->dev;
 	imx->chip.base = -1;
 	imx->chip.npwm = 1;
+	imx->chip.can_sleep = true;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	imx->mmio_base = devm_ioremap_resource(&pdev->dev, r);
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH v2 1/1 pwm: imx: set can_sleep flag for imx_pwm

Quoted 3 lines · Shawn Guo

The .config() hook imx_pwm_config() calls clk APIs like clk_prepare() and clk_get_rate(), which might sleep, so we need to set can_sleep flag on pwm_chip.

Wasn't there a bug that was fixed or at least made more obvious with this change? Is it worth mentioning in the commit log?

Otherwise

Uwe

Quoted 25 lines

---
Changes since v1:
- Set can_sleep flag for both imx_pwm_v1 and imx_pwm_v2

 drivers/pwm/pwm-imx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-imx.c +1 -0
index d797c7b84c3f..5449d9150d40 100644
@@ -262,6 +262,7 @@ static int imx_pwm_probe(struct platform_device *pdev)
 	imx->chip.dev = &pdev->dev;
 	imx->chip.base = -1;
 	imx->chip.npwm = 1;
+	imx->chip.can_sleep = true;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	imx->mmio_base = devm_ioremap_resource(&pdev->dev, r);
Signature · 1 line
1.8.3.2
Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
author
#2 lore raw

PATCH v2 1/1 pwm: imx: set can_sleep flag for imx_pwm

Quoted 6 lines · Uwe Kleine-K?nig
Quoted 3 lines · Shawn Guo

The .config() hook imx_pwm_config() calls clk APIs like clk_prepare() and clk_get_rate(), which might sleep, so we need to set can_sleep flag on pwm_chip.

Wasn't there a bug that was fixed or at least made more obvious with this change? Is it worth mentioning in the commit log?

The bug should be the one same as what we fixed on pwm-mxs[1]. But I did not try to trigger it on pwm-imx myself, because it's obvious.

Shawn

[1] http://article.gmane.org/gmane.linux.pwm/570

#3 lore raw

PATCH v2 1/1 pwm: imx: set can_sleep flag for imx_pwm

In reply to Shawn Guo
Quoted 11 lines · Shawn Guo

The .config() hook imx_pwm_config() calls clk APIs like clk_prepare() and clk_get_rate(), which might sleep, so we need to set can_sleep flag on pwm_chip.

---
Changes since v1:
- Set can_sleep flag for both imx_pwm_v1 and imx_pwm_v2

 drivers/pwm/pwm-imx.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140807/4e5cbc13/attachment.sig>