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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191114170449.GG27773@google.com>
Date:   Thu, 14 Nov 2019 09:04:49 -0800
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Rob Clark <robdclark@...il.com>
Cc:     Rob Clark <robdclark@...omium.org>,
        Stephen Boyd <sboyd@...nel.org>,
        Taniya Das <tdas@...eaurora.org>,
        Michael Turquette <mturquette@...libre.com>,
        David Brown <david.brown@...aro.org>,
        Rajendra Nayak <rnayak@...eaurora.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        "open list:ARM/QUALCOMM SUPPORT" <linux-soc@...r.kernel.org>,
        linux-clk <linux-clk@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>, Rob Herring <robh@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Jordan Crouse <jcrouse@...eaurora.org>,
        Jeykumar Sankaran <jsanka@...eaurora.org>,
        Sean Paul <seanpaul@...omium.org>
Subject: Re: [PATCH v4 5/5] clk: qcom: Add Global Clock controller (GCC)
 driver for SC7180

On Wed, Nov 13, 2019 at 09:30:57PM -0800, Rob Clark wrote:
> On Wed, Nov 13, 2019 at 5:03 PM Matthias Kaehlcke <mka@...omium.org> wrote:
> >
> > On Fri, Nov 08, 2019 at 11:40:53AM -0800, Rob Clark wrote:
> > > On Fri, Nov 8, 2019 at 10:42 AM Stephen Boyd <sboyd@...nel.org> wrote:
> > > >
> > > > Quoting Rob Clark (2019-11-08 08:54:23)
> > > > > On Thu, Nov 7, 2019 at 10:35 PM Stephen Boyd <sboyd@...nel.org> wrote:
> > > > > >
> > > > > > Quoting Rob Clark (2019-11-07 18:06:19)
> > > > > > > On Thu, Nov 7, 2019 at 1:06 PM Stephen Boyd <sboyd@...nel.org> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > NULL is a valid clk pointer returned by clk_get(). What is the display
> > > > > > > > driver doing that makes it consider NULL an error?
> > > > > > > >
> > > > > > >
> > > > > > > do we not have an iface clk?  I think the driver assumes we should
> > > > > > > have one, rather than it being an optional thing.. we could ofc change
> > > > > > > that
> > > > > >
> > > > > > I think some sort of AHB clk is always enabled so the plan is to just
> > > > > > hand back NULL to the caller when they call clk_get() on it and nobody
> > > > > > should be the wiser when calling clk APIs with a NULL iface clk. The
> > > > > > common clk APIs typically just return 0 and move along. Of course, we'll
> > > > > > also turn the clk on in the clk driver so that hardware can function
> > > > > > properly, but we don't need to expose it as a clk object and all that
> > > > > > stuff if we're literally just slamming a bit somewhere and never looking
> > > > > > back.
> > > > > >
> > > > > > But it sounds like we can't return NULL for this clk for some reason? I
> > > > > > haven't tried to track it down yet but I think Matthias has found it
> > > > > > causes some sort of problem in the display driver.
> > > > > >
> > > > >
> > > > > ok, I guess we can change the dpu code to allow NULL..  but what would
> > > > > the return be, for example on a different SoC where we do have an
> > > > > iface clk, but the clk driver isn't enabled?  Would that also return
> > > > > NULL?  I guess it would be nice to differentiate between those cases..
> > > > >
> > > >
> > > > So the scenario is DT describes the clk
> > > >
> > > >  dpu_node {
> > > >      clocks = <&cc AHB_CLK>;
> > > >      clock-names = "iface";
> > > >  }
> > > >
> > > > but the &cc node has a driver that doesn't probe?
> > > >
> > > > I believe in this scenario we return -EPROBE_DEFER because we assume we
> > > > should wait for the clk driver to probe and provide the iface clk. See
> > > > of_clk_get_hw_from_clkspec() and how it looks through a list of clk
> > > > providers and tries to match the &cc phandle to some provider.
> > > >
> > > > Once the driver probes, the match will happen and we'll be able to look
> > > > up the clk in the provider with __of_clk_get_hw_from_provider(). If
> > > > the clk provider decides that there isn't a clk object, it will return
> > > > NULL and then eventually clk_hw_create_clk() will turn the NULL return
> > > > value into a NULL pointer to return from clk_get().
> > > >
> > >
> > > ok, that was the scenario I was worried about (since unclk'd register
> > > access tends to be insta-reboot and hard to debug)..  so I think it
> > > should be ok to make dpu just ignore NULL clks.
> > >
> > > From a quick look, I think something like the attached (untested).
> >
> > The driver appears to be happy with it, at least at probe() time.
> 
> Ok, I suppose I should re-send the dpu patch to the appropriate
> lists.. does that count as a Tested-by?

Ack

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ