[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gVURXg4-OGDiOo-CR8CFymSJ76Hf6TOJJJB985WjnLHw@mail.gmail.com>
Date: Tue, 18 Dec 2018 01:03:20 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
ramalingam.c@...el.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Daniel Vetter <daniel.vetter@...el.com>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind
On Mon, Dec 17, 2018 at 8:48 PM Daniel Vetter <daniel@...ll.ch> wrote:
>
> On Thu, Dec 13, 2018 at 07:09:15PM +0100, Rafael J. Wysocki wrote:
> > On Thu, Dec 13, 2018 at 5:25 PM Daniel Vetter <daniel.vetter@...ll.ch> wrote:
> > >
> > > On Thu, Dec 13, 2018 at 5:18 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
> > > >
> > > > On Thu, Dec 13, 2018 at 1:36 PM Daniel Vetter <daniel.vetter@...ll.ch> wrote:
> >
> > [cut]
> >
> > > > > I can do the old code exactly, but afaict the non-NULL parent just
> > > > > takes care of the parent bus locking for us, instead of hand-rolling
> > > > > it in the caller. But if I missed something, I can easily undo that
> > > > > part.
> > > >
> > > > It is different if device links are present, but I'm not worried about
> > > > that case honestly. :-)
> > >
> > > What would change with device links? We have some cleanup plans to
> > > remove our usage for early/late s/r hooks with a device link, to make
> > > sure i915 resumes before snd_hda_intel. Digging more into the code I
> > > only see the temporary dropping of the parent's device_lock, but I
> > > have no idea what that even implies ...
> >
> > That's just it (which is why I said I was not worried).
> >
> > Running device_links_unbind_consumers() with the parent lock held may
> > deadlock if another child of the same parent also is a consumer of the
> > current device (which really is a corner case), but the current code
> > has this problem - it goes away with your change.
> >
> > But dev->bus->need_parent_lock checks are missing in there AFAICS, let
> > me cut a patch to fix that.
>
> With your patch before this one, are you ok with mine? Or want me to
> respin with a different flavour?
Having reconsidered this a bit I'm leaning towards annotating the
locks - if that works. After all, what is problematic is the lockdep
false-positive and addressing it that way would be most natural IMO.
Thanks,
Rafael
Powered by blists - more mailing lists