Re: [tip: timers/core] clocksource/drivers/timer-probe: Avoid creating dead devices

From: Saravana Kannan
Date: Thu Mar 26 2020 - 13:36:32 EST


On Thu, Mar 26, 2020 at 3:18 AM Daniel Lezcano
<daniel.lezcano@xxxxxxxxxx> wrote:
>
>
> Hi Saravana,
>
> On 25/03/2020 23:56, Saravana Kannan wrote:
> > On Wed, Mar 25, 2020 at 2:47 PM Thomas Gleixner
> > <tglx@xxxxxxxxxxxxx> wrote:
> >>
> >> Saravana Kannan <saravanak@xxxxxxxxxx> writes:
> >>> On Tue, Mar 24, 2020 at 11:34 AM Saravana Kannan
> >>> <saravanak@xxxxxxxxxx> wrote: I took a closer look. So two
> >>> different drivers [1] [2] are saying they know how to handle
> >>> "arm,vexpress-sysreg" and are expecting to run at the same
> >>> time. That seems a bit unusual to me. I wonder if this is a
> >>> violation of the device-driver model because this expectation
> >>> would never be allowed if these device drivers were actual
> >>> drivers registered with driver-core. But that's a discussion
> >>> for another time.
> >>>
> >>> To fix this issue you are facing, this patch should work:
> >>> https://lore.kernel.org/lkml/20200324195302.203115-1-saravanak@xxxxxxxxxx/T/#u
> >>
> >>
> >>>
> >>>
> >>>
> > Sorry, that's not a fix. That's a crude hack.
> >
> > If device nodes are being handled by drivers without binding a
> > driver to struct devices, then not setting OF_POPULATED is wrong.
> > So the original patch sets it. There are also very valid reasons
> > for allowing OF_POPULATED to be cleared by a driver as discussed
> > here [1].
> >
> > The approach of the original patch (setting the flag and letting
> > the driver sometimes clear it) is also followed by many other
> > frameworks like irq, clk, i2c, etc. Even ingenic-timer.c already
> > does it for the exact same reason.
> >
> > So, why is the vexpress fix a crude hack?
> >
> >> As this is also causing trouble on tegra30-cardhu-a04 the only
> >> sane solution is to revert it and start over with a proper
> >> solution for the vexpress problem and a root cause analysis for
> >> the tegra.
> >
> > If someone can tell me which of the timer drivers are relevant for
> > tegra30-cardhu-a04, I can help fix it. If you want to revert the
> > original patch first before waiting for a tegra fix, that's okay by
> > me.
>
>
> It seems the OF_POPULATED flag change spotted something wrong in
> different drivers and that is a good thing. Thanks for your patch for
> that.
>
> Without putting in question your analysis, we need to stabilize the
> release, can you send a revert of your patch?
>
> Let's try to figure out what is happening and fix the issues in the
> other drivers for the next cycle.

Make sense. Will do soon.

-Saravana

>
> Thanks
>
> -- Daniel
>
>
>
> --
> <http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs
>
> Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
> <http://twitter.com/#!/linaroorg> Twitter |
> <http://www.linaro.org/linaro-blog/> Blog