From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
ramalingam.c@intel.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Daniel Vetter <daniel.vetter@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind
Date: Tue, 18 Dec 2018 01:03:20 +0100 [thread overview]
Message-ID: <CAJZ5v0gVURXg4-OGDiOo-CR8CFymSJ76Hf6TOJJJB985WjnLHw@mail.gmail.com> (raw)
In-Reply-To: <20181217194804.GJ21184@phenom.ffwll.local>
On Mon, Dec 17, 2018 at 8:48 PM Daniel Vetter <daniel@ffwll.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@ffwll.ch> wrote:
> > >
> > > On Thu, Dec 13, 2018 at 5:18 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> > > >
> > > > On Thu, Dec 13, 2018 at 1:36 PM Daniel Vetter <daniel.vetter@ffwll.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
prev parent reply other threads:[~2018-12-18 0:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 8:46 [PATCH] drivers/base: use a worker for sysfs unbind Daniel Vetter
2018-12-10 10:06 ` Greg Kroah-Hartman
2018-12-10 10:18 ` Daniel Vetter
2018-12-10 10:20 ` Daniel Vetter
2018-12-12 11:08 ` Daniel Vetter
2018-12-12 11:19 ` Greg Kroah-Hartman
2018-12-12 12:40 ` Daniel Vetter
2018-12-13 9:38 ` Rafael J. Wysocki
2018-12-13 9:58 ` Daniel Vetter
2018-12-13 10:23 ` Rafael J. Wysocki
2018-12-13 11:05 ` Rafael J. Wysocki
2018-12-13 12:36 ` Daniel Vetter
2018-12-13 16:18 ` Rafael J. Wysocki
2018-12-13 16:25 ` Daniel Vetter
2018-12-13 18:09 ` Rafael J. Wysocki
2018-12-17 19:48 ` Daniel Vetter
2018-12-18 0:03 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJZ5v0gVURXg4-OGDiOo-CR8CFymSJ76Hf6TOJJJB985WjnLHw@mail.gmail.com \
--to=rafael@kernel.org \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ramalingam.c@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).