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] [day] [month] [year] [list]
Message-ID:
 <ZQ0PR01MB1253F2D9469337E68CE501C19F0EA@ZQ0PR01MB1253.CHNPR01.prod.partner.outlook.cn>
Date: Fri, 27 Dec 2024 08:42:01 +0000
From: William Qiu <william.qiu@...rfivetech.com>
To: Uwe Kleine-König <ukleinek@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>, Hal Feng
	<hal.feng@...rfivetech.com>, Philipp Zabel <p.zabel@...gutronix.de>
Subject: RE: [PATCH v16] pwm: opencores: Add PWM driver support



> -----Original Message-----
> From: Uwe Kleine-König <ukleinek@...nel.org>
> Sent: 2024年12月27日 16:38
> To: William Qiu <william.qiu@...rfivetech.com>
> Cc: linux-kernel@...r.kernel.org; linux-pwm@...r.kernel.org; Hal Feng
> <hal.feng@...rfivetech.com>; Philipp Zabel <p.zabel@...gutronix.de>
> Subject: Re: [PATCH v16] pwm: opencores: Add PWM driver support
> 
> On Tue, Dec 24, 2024 at 01:53:03AM +0000, William Qiu wrote:
> > > -----Original Message-----
> > > From: Uwe Kleine-König <ukleinek@...nel.org>
> > > Sent: 2024年12月24日 1:12
> > > To: William Qiu <william.qiu@...rfivetech.com>
> > > Cc: linux-kernel@...r.kernel.org; linux-pwm@...r.kernel.org; Hal
> > > Feng <hal.feng@...rfivetech.com>; Philipp Zabel
> > > <p.zabel@...gutronix.de>
> > > Subject: Re: [PATCH v16] pwm: opencores: Add PWM driver support
> > >
> > > Hello William,
> > >
> > > On Mon, Dec 23, 2024 at 02:47:59AM +0000, William Qiu wrote:
> > > > > > +	duty_data = mul_u64_u32_div(state->duty_cycle,
> > > > > > +ddata->clk_rate,
> > > > > NSEC_PER_SEC);
> > > > > > +	if (!duty_data)
> > > > > > +		return -EINVAL;
> > > > >
> > > > > I can understand that period_data == 0 is an error, but
> > > > > duty_data ==
> > > > > 0 could/should just work?!
> > > >
> > > > It means no need to check whether the duty is valid?
> > >
> > > No, it means that I expect that duty_data == 0 is a valid setting
> > > and most controllers support it.
> > >
> > > Best regards
> > > Uwe
> >
> > So we just need to check duty < 0?
> 
> I'm not sure I understand this question. You can assume that
> state->duty_cycle is >= 0 in the driver callback.
> 
> If the hardware doesn't support duty_cycle == 0, add a comment and proper
> error handling. (i.e. return with -EINVAL if the requested duty_cycle is too low
> to be implemented.)
> 
> Best regards
> Uwe

I see. I'll check it and send v17 soon.

Thanks,
William

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ