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: <20171012231709.GH18706@codeaurora.org>
Date:   Thu, 12 Oct 2017 16:17:09 -0700
From:   Stephen Boyd <sboyd@...eaurora.org>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     linux-clk@...r.kernel.org, Stephen Warren <swarren@...dotorg.org>,
        linux-fbdev@...r.kernel.org,
        Michael Turquette <mturquette@...libre.com>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        linux-kernel@...r.kernel.org, Hans de Goede <hdegoede@...hat.com>,
        Russell King <linux@...linux.org.uk>,
        Shawn Guo <shawnguo@...nel.org>,
        Dong Aisheng <aisheng.dong@....com>
Subject: Re: [RFC PATCH] clk: move of_clk_get_parent_count() declaration to
 <linux/__clk.h>

On 10/05, Masahiro Yamada wrote:
> The clock consumer, drivers/video/fbdev/simplefb.c, includes
> <linux/clk-provider.h> just for calling of_clk_get_parent_count().
> This is ugly.
> 
> Looking at simplefb_clocks_get(), of_clk_get_parent_count() seems
> useful for clock consumers as well as for clock providers.
> 
> Unfortunately, we do not have a good home for declarations shared
> between consumers and providers.
> 
> Create a new header <linux/__clk.h>, and move it over to it.  This
> header must be included via <linux/clk.h> or <linux/clk-provider.h>
> (this is why it is prefixed with double-underscore).  Add #error
> so the build terminates if it is included directly.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> ---

How about we add a get_all_the_clks_for_the_device() sort of API
that uses the bulk clk code but also allocates the array by
reading the number of clks from DT? Please think of a better name
of course. We can figure out how to handle non-DT platforms if we
need to. With clkdev we could probably handle it with some sort
of lookup table search given a device name. Don't add that part
until we have a user though. I assume simplefb is all DT
platforms?

Either way, it looks like what we really want here is a way to
get every clk for a device and not look at the details. USB has a
similar case, which I think Shawn Guo/Dong Aisheng was trying to
add an OF based bulk clk_get() API called of_clk_bulk_get()
for[1]. If this get all clks API works there too then we should
use it. If it can be non-DT specific, even better.

[1] http://lkml.kernel.org/r/1506415441-4435-1-git-send-email-aisheng.dong@nxp.com

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ