All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Stephen Boyd <swboyd@chromium.org>
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 15:42:37 +0100	[thread overview]
Message-ID: <20210511144236.GL1336@shell.armlinux.org.uk> (raw)
In-Reply-To: <20210508074118.1621729-1-swboyd@chromium.org>

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.

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?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Stephen Boyd <swboyd@chromium.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] component: Move host device to end of device lists on binding
Date: Tue, 11 May 2021 15:42:37 +0100	[thread overview]
Message-ID: <20210511144236.GL1336@shell.armlinux.org.uk> (raw)
In-Reply-To: <20210508074118.1621729-1-swboyd@chromium.org>

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.

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?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  parent reply	other threads:[~2021-05-11 14:42 UTC|newest]

Thread overview: 34+ 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-08  7:41 ` Stephen Boyd
2021-05-10 11:59 ` Rafael J. Wysocki
2021-05-10 11:59   ` Rafael J. Wysocki
2021-05-11 17:59   ` Saravana Kannan
2021-05-11 17:59     ` Saravana Kannan
2021-05-10 16:05 ` Daniel Vetter
2021-05-10 16:05   ` Daniel Vetter
2021-05-10 17:52   ` Stephen Boyd
2021-05-10 17:52     ` Stephen Boyd
2021-05-10 18:26     ` Daniel Vetter
2021-05-10 18:26       ` Daniel Vetter
2021-05-10 19:08       ` Stephen Boyd
2021-05-10 19:08         ` Stephen Boyd
2021-05-11 10:52         ` Rafael J. Wysocki
2021-05-11 10:52           ` Rafael J. Wysocki
2021-05-11 13:39           ` Daniel Vetter
2021-05-11 13:39             ` Daniel Vetter
2021-05-11 17:19             ` Stephen Boyd
2021-05-11 17:19               ` Stephen Boyd
2021-05-11 17:25               ` Daniel Vetter
2021-05-11 17:25                 ` Daniel Vetter
2021-05-11 19:12               ` Saravana Kannan
2021-05-11 19:12                 ` Saravana Kannan
2021-05-11 17:00           ` Stephen Boyd
2021-05-11 17:00             ` Stephen Boyd
2021-05-11 17:20             ` Rafael J. Wysocki
2021-05-11 17:20               ` Rafael J. Wysocki
2021-05-13 13:40   ` Russell King - ARM Linux admin
2021-05-13 13:40     ` Russell King - ARM Linux admin
2021-05-11 14:42 ` Russell King - ARM Linux admin [this message]
2021-05-11 14:42   ` Russell King - ARM Linux admin
2021-05-11 17:22   ` Stephen Boyd
2021-05-11 17:22     ` Stephen Boyd

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=20210511144236.GL1336@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robdclark@gmail.com \
    --cc=swboyd@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.