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, 6 Mar 2020 08:44:40 +0100
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Guru Das Srinagesh <gurus@...eaurora.org>
Cc:     linux-pwm@...r.kernel.org,
        Thierry Reding <thierry.reding@...il.com>,
        Subbaraman Narayanamurthy <subbaram@...eaurora.org>,
        linux-kernel@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [RESEND v6 1/2] pwm: Convert drivers to use 64-bit period and
 duty cycle

Hello,

On Mon, Mar 02, 2020 at 11:34:22AM -0800, Guru Das Srinagesh wrote:
> Because period and duty cycle are defined in the PWM framework structs
> as ints with units of nanoseconds, the maximum time duration that can be
> set is limited to ~2.147 seconds. Redefining them as u64 values will
> enable larger time durations to be set.
> 
> As a first step, prepare drivers to handle the switch to u64 period and
> duty_cycle by making the relevant fixes to those drivers that use the
> period and duty_cycle pwm struct members in division operations, viz.
> replacing the division operations with 64-bit division macros as
> appropriate. The actual switch to u64 period and duty_cycle follows as a
> separate patch.
> 
> Where the dividend is 64-bit but the divisor is 32-bit, use *_ULL
> macros:
> - DIV_ROUND_UP_ULL
> - DIV_ROUND_CLOSEST_ULL
> - div_u64
> 
> Where the divisor is 64-bit (dividend may be 32-bit or 64-bit), use
> DIV64_* macros:
> - DIV64_U64_ROUND_CLOSEST
> - div64_u64
> 
> The kbuild test robot helped to improve this patch by catching a couple
> of code sites that had to be adapted.
> 
> Signed-off-by: Guru Das Srinagesh <gurus@...eaurora.org>
> ---
>  drivers/clk/clk-pwm.c                      | 2 +-
>  drivers/gpu/drm/i915/display/intel_panel.c | 2 +-
>  drivers/hwmon/pwm-fan.c                    | 2 +-
>  drivers/media/rc/ir-rx51.c                 | 3 ++-
>  drivers/pwm/pwm-clps711x.c                 | 2 +-
>  drivers/pwm/pwm-imx-tpm.c                  | 2 +-
>  drivers/pwm/pwm-imx27.c                    | 5 ++---
>  drivers/pwm/pwm-sifive.c                   | 2 +-
>  drivers/pwm/pwm-sti.c                      | 5 +++--
>  drivers/pwm/pwm-stm32-lp.c                 | 2 +-
>  drivers/pwm/pwm-sun4i.c                    | 2 +-
>  drivers/video/backlight/pwm_bl.c           | 3 ++-

I guess we need acks from the affected maintainers. While I think the
changes are fine I think you won't evade having to expand the audience
of your patch and (depending on feedback) maybe split this patch up
further.

Best regards
Uwe

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ