linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Rob Clark <robdclark@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] component: Move host device to end of device lists on binding
Date: Tue, 11 May 2021 10:22:21 -0700	[thread overview]
Message-ID: <CAE-0n5039Zf+60qiQFExN49=iCBBEGC5JVgOQ+cJ8PeYnA=BZg@mail.gmail.com> (raw)
In-Reply-To: <20210511144236.GL1336@shell.armlinux.org.uk>

Quoting Russell King - ARM Linux admin (2021-05-11 07:42:37)
> On Sat, May 08, 2021 at 12:41:18AM -0700, Stephen Boyd wrote:
> > Within the component device framework this usually isn't that bad
> > because the real driver work is done at bind time via
> > component{,master}_ops::bind(). It becomes a problem when the driver
> > core, or host driver, wants to operate on the component device outside
> > of the bind/unbind functions, e.g. via 'remove' or 'shutdown'. The
> > driver core doesn't understand the relationship between the host device
> > and the component devices and could possibly try to operate on component
> > devices when they're already removed from the system or shut down.
>
> You really are not supposed to be doing anything with component devices
> once they have been unbound. You can do stuff with them only between the
> bind() and the unbind() callbacks for the host device.

Got it. The device is not unbound in this case so this isn't the
problem.

>
> Access to the host devices outside of that is totally undefined and
> should not be done.
>
> The shutdown callback should be fine as long as the other devices are
> still bound, but there will be implications if the shutdown order
> matters.
>
> However, randomly pulling devices around in the DPM list sounds to me
> like a very bad idea. What happens if such re-orderings result in a
> child device being shutdown after a parent device has been shut down?
>

Fair enough. I'll cook up a 'component' bus and see if that can fix this
properly. It will add a new device for the aggregate driver that does
the bind/unbind so the host/parent device will still be ordered on the
DPM list at the same place. The new aggregate device will be after the
components and we'll attach the PM ops and shutdown hooks to that.

      reply	other threads:[~2021-05-11 17:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  7:41 [PATCH] component: Move host device to end of device lists on binding Stephen Boyd
2021-05-10 11:59 ` Rafael J. Wysocki
2021-05-11 17:59   ` Saravana Kannan
2021-05-10 16:05 ` Daniel Vetter
2021-05-10 17:52   ` Stephen Boyd
2021-05-10 18:26     ` Daniel Vetter
2021-05-10 19:08       ` Stephen Boyd
2021-05-11 10:52         ` Rafael J. Wysocki
2021-05-11 13:39           ` Daniel Vetter
2021-05-11 17:19             ` Stephen Boyd
2021-05-11 17:25               ` Daniel Vetter
2021-05-11 19:12               ` Saravana Kannan
2021-05-11 17:00           ` Stephen Boyd
2021-05-11 17:20             ` Rafael J. Wysocki
2021-05-13 13:40   ` Russell King - ARM Linux admin
2021-05-11 14:42 ` Russell King - ARM Linux admin
2021-05-11 17:22   ` Stephen Boyd [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='CAE-0n5039Zf+60qiQFExN49=iCBBEGC5JVgOQ+cJ8PeYnA=BZg@mail.gmail.com' \
    --to=swboyd@chromium.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=rafael@kernel.org \
    --cc=robdclark@gmail.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).