All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Ying <Ying.Liu@freescale.com>
To: Shawn Guo <shawn.guo@freescale.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	kernel@pengutronix.de
Subject: Re: [PATCH] pwm: imx: set can_sleep flag for imx_pwm_v2
Date: Fri, 23 May 2014 14:40:04 +0800	[thread overview]
Message-ID: <537EED44.7030906@freescale.com> (raw)
In-Reply-To: <1400824114-27148-1-git-send-email-shawn.guo@freescale.com>

Hi Shawn,

On 05/23/2014 01:48 PM, Shawn Guo wrote:
> The .config() hook of imx_pwm_data_v2 calls clk_get_rate() which might
> sleep, so we need to set can_sleep flag on it.
> 
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
>  drivers/pwm/pwm-imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
> index d797c7b84c3f..ab3809fb36a7 100644
> --- a/drivers/pwm/pwm-imx.c
> +++ b/drivers/pwm/pwm-imx.c
> @@ -272,6 +272,9 @@ static int imx_pwm_probe(struct platform_device *pdev)
>  	imx->config = data->config;
>  	imx->set_enable = data->set_enable;
>  
> +	if (data == &imx_pwm_data_v2)
> +		imx->chip.can_sleep = true;
> +
>  	ret = pwmchip_add(&imx->chip);
>  	if (ret < 0)
>  		return ret;
> 

clk_prepare_enable()/clk_disable_unprepare() called in imx_pwm_config() may sleep.

So, the can_sleep flag should be true for both i.MX PWM v1 and v2, right?

-- 
Liu Ying

WARNING: multiple messages have this Message-ID (diff)
From: Ying.Liu@freescale.com (Liu Ying)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pwm: imx: set can_sleep flag for imx_pwm_v2
Date: Fri, 23 May 2014 14:40:04 +0800	[thread overview]
Message-ID: <537EED44.7030906@freescale.com> (raw)
In-Reply-To: <1400824114-27148-1-git-send-email-shawn.guo@freescale.com>

Hi Shawn,

On 05/23/2014 01:48 PM, Shawn Guo wrote:
> The .config() hook of imx_pwm_data_v2 calls clk_get_rate() which might
> sleep, so we need to set can_sleep flag on it.
> 
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
>  drivers/pwm/pwm-imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
> index d797c7b84c3f..ab3809fb36a7 100644
> --- a/drivers/pwm/pwm-imx.c
> +++ b/drivers/pwm/pwm-imx.c
> @@ -272,6 +272,9 @@ static int imx_pwm_probe(struct platform_device *pdev)
>  	imx->config = data->config;
>  	imx->set_enable = data->set_enable;
>  
> +	if (data == &imx_pwm_data_v2)
> +		imx->chip.can_sleep = true;
> +
>  	ret = pwmchip_add(&imx->chip);
>  	if (ret < 0)
>  		return ret;
> 

clk_prepare_enable()/clk_disable_unprepare() called in imx_pwm_config() may sleep.

So, the can_sleep flag should be true for both i.MX PWM v1 and v2, right?

-- 
Liu Ying

  reply	other threads:[~2014-05-23  6:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  5:48 [PATCH] pwm: imx: set can_sleep flag for imx_pwm_v2 Shawn Guo
2014-05-23  5:48 ` Shawn Guo
2014-05-23  6:40 ` Liu Ying [this message]
2014-05-23  6:40   ` Liu Ying
2014-05-23  7:05   ` Shawn Guo
2014-05-23  7:05     ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537EED44.7030906@freescale.com \
    --to=ying.liu@freescale.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=shawn.guo@freescale.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.