lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Mar 2019 13:34:56 +0100
From:   Thierry Reding <thierry.reding@...il.com>
To:     Paul Cercueil <paul@...pouillou.net>
Cc:     Daniel Lezcano <daniel.lezcano@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Paul Burton <paul.burton@...s.com>,
        James Hogan <jhogan@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Mathieu Malaterre <malat@...ian.org>, od@...c.me,
        linux-pwm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-watchdog@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-clk@...r.kernel.org
Subject: Re: [PATCH v10 15/27] pwm: jz4740: Allow selection of PWM channels 0
 and 1

On Sat, Mar 02, 2019 at 08:34:01PM -0300, Paul Cercueil wrote:
> The TCU channels 0 and 1 were previously reserved for system tasks, and
> thus unavailable for PWM.
> 
> Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> Tested-by: Mathieu Malaterre <malat@...ian.org>
> Tested-by: Artur Rojek <contact@...ur-rojek.eu>
> ---
> 
> Notes:
>          v6: New patch
>     
>          v7: No change
>     
>          v8: ingenic_tcu_[request,release]_channel are dropped. We now use
>              the memory resources provided to the driver to detect whether
>     	 or not we are allowed to use the TCU channel.
>     
>          v9: Drop previous system. Call a API function provided by the
>              clocksource driver to know if we can use the channel as PWM.
>     
>          v10: No change
> 
>  drivers/pwm/pwm-jz4740.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
> index f497388fc818..c914589d547b 100644
> --- a/drivers/pwm/pwm-jz4740.c
> +++ b/drivers/pwm/pwm-jz4740.c
> @@ -44,11 +44,7 @@ static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
>  	char clk_name[16];
>  	int ret;
>  
> -	/*
> -	 * Timers 0 and 1 are used for system tasks, so they are unavailable
> -	 * for use as PWMs.
> -	 */
> -	if (pwm->hwpwm < 2)
> +	if (!ingenic_tcu_pwm_can_use_chn(pwm->hwpwm))
>  		return -EBUSY;

Like I said earlier, I think this would be nicer to take a parameter to
a struct device * to remove the need for a global variable (at least for
this particular case).

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ