lkml.org 
[lkml]   [2023]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v13 2/2] clk: clk-loongson2: add clock controller driver support
    From
    On 13/03/2023 19:20, Stephen Boyd wrote:
    >>>> The CONFIG_64BIT not enabled in your config file, I will add a depend on
    >>>> "CONFIG_64BIT" in my clock driver to fix this compile error.
    >>>
    >>> Do you need to use readq() here? Can you read two 32-bit registers with
    >>> readl() and put them together for a 64-bit number?
    >>
    >> If the platform supports 64-bit reads and these are actually one
    >> register, then readq makes sense - code is more readable, smaller, more
    >> efficient.
    >>
    >
    > Please read the section in Documentation/driver-api/device-io.rst about
    > hi_lo_readq() and <linux/io-64-nonatomic-lo-hi.h>. We shouldn't need to
    > restrict the driver to CONFIG_64BIT. Instead, include one of these
    > header files to get the IO access primitives.

    These primitives are for 32bit access. Quoting: "on 32-bit
    architectures". What's the point of them if the code *will never* run on
    32-bit? It will be a fake choice of linux/io-64-nonatomic-lo-hi.h or
    linux/io-64-nonatomic-hi-lo.h misleading users to think this was tested
    on 32-bit.

    Best regards,
    Krzysztof

    \
     
     \ /
      Last update: 2023-03-27 00:57    [W:3.367 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site