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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 Oct 2021 17:18:15 +0200
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Maíra Canal <maira.canal@....br>
Cc:     Sean Young <sean@...s.org>, kernel test robot <lkp@...el.com>,
        mchehab@...nel.org, thierry.reding@...il.com,
        Lee Jones <lee.jones@...aro.org>, llvm@...ts.linux.dev,
        kbuild-all@...ts.01.org, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org
Subject: Re: [PATCH v4] media: rc: pwm-ir-tx: Switch to atomic PWM API

Hello,

On Fri, Oct 29, 2021 at 09:08:29AM -0300, Maíra Canal wrote:
> I would like to thank you guys for the attention and this interesting
> discussion. I'm looking for some work in the kernel and I would like
> to know if you guys have any suggestions for beginner tasks in this
> subsystem. I have solid knowledge in C programming, but I started in
> the kernel a couple of weeks ago. Anyway, thank you for all the
> feedback.

If you want something mathematically demanding, you can pick up the
patch I pointed out to Sean, I think I won't find the time in the near
future to work on this.

The background is that PWM drivers have to round most requests and there
is no uniformity among drivers and so if a consumer (e.g. the pwm-ir
driver) requests say 20000 ns, it will get 18000 from some drivers and
maybe 25000 from others. So the idea is to have a function
pwm_round_state that has fixed rounding rules such that a consumer can
pick the best setting for their use-case.

Something more mechanic in the PWM area is to convert drivers that still
implement .config/.enable/.disable to .apply. See
http://patchwork.ozlabs.org/project/linux-pwm/patch/20211029105617.210178-1-u.kleine-koenig@pengutronix.de/
for an example. The well-known good template is pwm_apply_legacy() after
applying
http://patchwork.ozlabs.org/project/linux-pwm/list/?series=251456 .

If you want something more global: The prototype of the remove callbacks
for platform devices returns an int:

	https://elixir.bootlin.com/linux/v5.15-rc7/source/include/linux/platform_device.h#L206

However the returned value is (nearly) ignored by the driver core:

	https://elixir.bootlin.com/linux/v5.15-rc7/source/drivers/base/platform.c#L1433

The longterm goal is to change the prototype of .remove to return void.
As a first step making all functions return 0 is a worthwile project.

The same problem exists for several other buses, one patch I sent to
work on this goal for i2c is:

	https://lore.kernel.org/r/20211021105657.72572-1-u.kleine-koenig@pengutronix.de

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ