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]
Message-ID: <CAMuHMdUMeGEnkVDvVk=NZMrnNXDUxDOgcqfORf+My8jkCza3SA@mail.gmail.com>
Date:   Thu, 7 Feb 2019 16:05:58 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Simon Horman <horms+renesas@...ge.net.au>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Magnus Damm <magnus.damm@...il.com>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        linux-clk <linux-clk@...r.kernel.org>,
        Fabrizio Castro <fabrizio.castro@...renesas.com>,
        Biju Das <biju.das@...renesas.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 3/5] clk: renesas: rcar-gen3: Support Z and Z2 clocks
 with high frequency parents

Hi Simon,

On Thu, Feb 7, 2019 at 2:36 PM Simon Horman <horms+renesas@...ge.net.au> wrote:
> Support Z and Z2 clocks with parent frequencies greater than UINT32_MAX Hz
> (~4.29GHz).
>
> The DIV_ROUND_CLOSEST_ULL() macro accepts a 64bit dividend and 32bit
> divisor. This leads to truncation of the dividend, which is the Z or Z2

truncation of the divisor.

> parent clock frequency in HZ, on platforms where frequency of that clock is
> greater than UINT32_MAX Hz.
>
> To resolve this problem the DIV64_U64_ROUND_CLOSEST() macro, which an

which takes an

> unsigned 32bit dividend and divisor, is introduced.

64-bit

> An earlier version of this patch made use of the existing
> DIV_ROUND_CLOSEST() macro, which accepts the prevailing type of the
> dividend and divisor. However, this does not compile on 32bit systems, such
> as i386 and mips, when called with the types used at this callsite, an
> unsigned long long dividend and unsigned long divisor.

Thanks for fixing this!

> This work is in preparation for supporting the Z2 cloco on the R-Car Gen3
> E3 (r8a77990) SoC which has a 4.8GHz parent clock.
>
> Signed-off-by: Simon Horman <horms+renesas@...ge.net.au>

With the above fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>

> ---
> v4: Add and use DIV64_U64_ROUND_CLOSEST
>
> v2: New patch
> ---
>  drivers/clk/renesas/rcar-gen3-cpg.c |  4 ++--
>  include/linux/math64.h              | 13 +++++++++++++

While I have no issue taking this change through the clk-renesas tree if
Andrew provides his Acked-by, I think the introduction of
DIV64_U64_ROUND_CLOSEST() should be a separate patch.

However, given commit 68600f623d69da42 ("mm: don't miss the last page
because of round-off error") added both DIV64_U64_ROUND_UP() and its
user under mm/, there's precedence for not splitting it off...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ