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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 7 Apr 2014 13:28:23 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Hans-Christian Egtvedt <egtvedt@...fundet.no>
Cc:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Haavard Skinnemoen <hskinnemoen@...il.com>,
	Bryan Wu <cooloney@...il.com>,
	Richard Purdie <rpurdie@...ys.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jingoo Han <jg1.han@...sung.com>, linux-leds@...r.kernel.org,
	linux-pwm@...r.kernel.org, linux-fbdev@...r.kernel.org
Subject: Re: [PATCH 09/16] avr32/at32ap: switch to the generic PWM framework

On Wed, Mar 19, 2014 at 03:18:20PM +0100, Hans-Christian Egtvedt wrote:
> Around Wed 19 Mar 2014 14:03:22 +0100 or thereabout, Alexandre Belloni wrote:
> > Switch to the pwm/pwm-atmel driver instead of misc/atmel_pwm
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
> 
> Acked-by: Hans-Christian Egtvedt <egtvedt@...fundet.no>
> 
> > ---
> >  arch/avr32/mach-at32ap/at32ap700x.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
> > index a1f4d1e91b52..db85b5ec3351 100644
> > --- a/arch/avr32/mach-at32ap/at32ap700x.c
> > +++ b/arch/avr32/mach-at32ap/at32ap700x.c
> > @@ -1553,7 +1553,7 @@ static struct resource atmel_pwm0_resource[] __initdata = {
> >  	IRQ(24),
> >  };
> >  static struct clk atmel_pwm0_mck = {
> > -	.name		= "pwm_clk",
> > +	.name		= "at91sam9rl-pwm",
> 
> I found this a tiny bit weird, but found the matching instance in
> drivers/pwm/pwm-atmel.c
> 
> IMHO it would initially have been better to call it atpwm_v1 or something
> similar, more generic. But I guess that is too late to change at this point.

Generally when you call clk_get(dev, NULL), you'll pass in the consumer
device as "dev". Now the avr32 clock implementation compares that to the
device associated with the clock, which for the case of the PWM pwm0_mck
is the PWM controller (at32_add_device_pwm() for reference). So it seems
to be set up properly (the PWM controller is the consumer).

Also since the consumer ID isn't specified to the clk_get() call, the
name of the clock (what's being changed in the above hunk) shouldn't
matter because it won't match anyway.

Now that I look at it more closely, I wonder how clk_get(dev, NULL) can
even work on avr32, since there's no check for id == NULL and therefore
NULL will be blindly passed into strcmp() and then crash.

Thierry

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ