Re: [PATCH v6] amba: Remove deferred device addition

From: Saravana Kannan
Date: Wed Jul 27 2022 - 20:11:42 EST


On Wed, Jul 27, 2022 at 3:16 PM Russell King (Oracle)
<linux@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, Jul 27, 2022 at 11:19:35AM -0700, Saravana Kannan wrote:
> > The uevents generated for an amba device need PID and CID information
> > that's available only when the amba device is powered on, clocked and
> > out of reset. So, if those resources aren't available, the information
> > can't be read to generate the uevents. To workaround this requirement,
> > if the resources weren't available, the device addition was deferred and
> > retried periodically.
> >
> > However, this deferred addition retry isn't based on resources becoming
> > available. Instead, it's retried every 5 seconds and causes arbitrary
> > probe delays for amba devices and their consumers.
> >
> > Also, maintaining a separate deferred-probe like mechanism is
> > maintenance headache.
> >
> > With this commit, instead of deferring the device addition, we simply
> > defer the generation of uevents for the device and probing of the device
> > (because drivers needs PID and CID to match) until the PID and CID
> > information can be read. This allows us to delete all the amba specific
> > deferring code and also avoid the arbitrary probing delays.
>
> Oh, this is absolutely horrible. I can apply it cleanly to my "misc"
> branch, but it then conflicts when I re-merge my tree for the for-next
> thing (which is only supposed to be for sfr - the hint is in the name!)
> for-next is basically my "fixes" plus "misc" branch and anything else I
> want sfr to pick up for the -next tree.

Btw, this is the repo I was using because I couldn't find any amba repo.
git://git.armlinux.org.uk/~rmk/linux-arm.git

Is the misc branch visible somewhere because I don't see it in that
repo? Or is that just a local branch? Also, what does sfr stand for
(s* for next)?

In case this helps, all the conflicts are due to this commit:
8030aa3ce12e ARM: 9207/1: amba: fix refcount underflow if
amba_device_add() fails

It's fixing bugs in code I'm deleting. So if you revert that, I can
give you a patch that'll apply across 5.18 and 5.19.

Let me know if you want me to do that.

> Applying this has to be on top of that merge commit, otherwise the
> conflicts are horrid, but that then means I need to send Linus the
> for-next merge commit (which I don't normally do.)
>
> Gah, we have too many changes to drivers/bus/amba.c in this cycle,
> some of them which have been submitted for 5.19 as fixes (and thus
> are not in 5.18-rc1 which the misc branch is based upon for other
> patch dependency reasons) and others in the misc branch for the next
> cycle - and now your patch wants both, which I can't do without
> rebasing the misc branch.
>
> Sadly, getting these changes into GregKH's tree will just create a
> conflict between Greg's tree and my tree.
>
> Can we postpone this please?

I guess? It's not like I can force either of you :) Or maybe you can
ask Greg to pick it up after he picks up your for-next?

Anyway, whatever option can get this pulled in reasonably soon is fine
by me -- I can send out v7 on whatever tree you want. I've been
nursing this patch for a year and I want to get it in before I hit
more conflicts/issues and give up on it :)

-Saravana