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:   Tue, 4 Jan 2022 15:58:55 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
Cc:     vishakha.joshi@...el.com, thierry.reding@...il.com,
        lee.jones@...aro.org, linux-pwm@...r.kernel.org,
        linux-kernel@...r.kernel.org, jarkko.nikula@...ux.intel.com,
        vijayakannan.ayyathurai@...el.com, bala.senthil@...el.com,
        tamal.saha@...el.com, lakshmi.bai.raja.subramanian@...el.com
Subject: Re: [PATCH v1 1/2] pwm: Add count to sysfs for Intel PWM driver

On Mon, Jan 03, 2022 at 01:14:54PM +0100, Uwe Kleine-König wrote:
> On Mon, Jan 03, 2022 at 01:46:09PM +0530, vishakha.joshi@...el.com wrote:
> > From: Vishakha Joshi <vishakha.joshi@...el.com>

...

> >  struct pwm_state {
> >  	u64 period;
> >  	u64 duty_cycle;
> > +	u32 count;
> >  	enum pwm_polarity polarity;
> >  	bool enabled;
> >  	bool usage_power;
> 
> This needs more documentation about what the semantic should be. E.g.
> what should .get_state return?

Good point. I guess ideally we should return the amount of the periods we still
need to produce, but I'm not sure if it can be done cleanly.

It would probably require a timer to be run in parallel, hence almost full
software implementation of the feature. (This answers the second concern)

> Also I doubt this is a good idea given that most controllers cannot
> implement it.
> 
> If we really want to support a count, I request that all drivers that
> don't support it get updated to refuse a request with count != 0.

Hmm... Not sure it worth it, perhaps taking into account above the -1
(in unsigned type) returned on ->get_state() can suffice as not supporting
feature?

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ