linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "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>
Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind
Date: Thu, 13 Dec 2018 19:09:15 +0100	[thread overview]
Message-ID: <CAJZ5v0hOiL1oWGCmFv2N8-0UvCibXz02DhdFMyUQsQZ1hDjV=w@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uHACB5-ak0b_BT-HoAmXHZ9EaCNTt7WuqckNWKQM-g2fQ@mail.gmail.com>

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.

Cheers,
Rafael

  reply	other threads:[~2018-12-13 18:09 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 [this message]
2018-12-17 19:48               ` Daniel Vetter
2018-12-18  0:03                 ` Rafael J. Wysocki

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='CAJZ5v0hOiL1oWGCmFv2N8-0UvCibXz02DhdFMyUQsQZ1hDjV=w@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).