From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Ricardo Cañuelo" <ricardo.canuelo@collabora.com>,
dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
kernel@collabora.com, andrzej.hajda@intel.com,
narmstrong@baylibre.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org
Subject: Re: [PATCH 1/2 RESEND] drm/bridge: parade-ps8640: avoid race condition on driver unbinding
Date: Fri, 18 Mar 2022 11:21:59 +0100 [thread overview]
Message-ID: <bb78f340-4a37-33ad-55d6-805f64e1389c@collabora.com> (raw)
In-Reply-To: <20220311093406.4068019-2-ricardo.canuelo@collabora.com>
Il 11/03/22 10:34, Ricardo Cañuelo ha scritto:
> When unbinding a DRM master driver there's a race condition that
> sometimes results in an invalid vm access when userspace (gnome-shell)
> issues a DRM_IOCTL_MODE_GETCONNECTOR ioctl right after a bridge has been
> removed from an encoder's bridge chain.
>
> This means that once a bridge has been disabled and gone through
> ps8640_post_disable(), if ps8640_bridge_get_edid() runs afterwards as a
> result of that ioctl call it will call drm_bridge_chain_pre_enable()
> and drm_bridge_chain_post_disable() again in a bridge that has been
> already detached.
>
> Setting `ps_bridge->pre_enabled = false` at a later stage of the
> bringdown path and calling drm_bridge_chain_pre_enable() inside
> ps8640_bridge_get_edid() only if needed avoid this, although a proper
> subsystem-wide fix would be the proper solution, since the same type of
> race conditions might happen somewhere else.
>
> Tested on an Acer Chromebook R13 (Elm, MT8173) with Debian Sid.
>
> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> drivers/gpu/drm/bridge/parade-ps8640.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
next prev parent reply other threads:[~2022-03-18 10:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 9:34 [PATCH 0/2 RESEND] Mitigate race condition problems when unbinding DRM driver Ricardo Cañuelo
2022-03-11 9:34 ` [PATCH 1/2 RESEND] drm/bridge: parade-ps8640: avoid race condition on driver unbinding Ricardo Cañuelo
2022-03-18 10:21 ` AngeloGioacchino Del Regno [this message]
2022-03-11 9:34 ` [PATCH 2/2 RESEND] drm/bridge: Add extra checks in pre_enable and post_enable Ricardo Cañuelo
2022-03-18 10:21 ` AngeloGioacchino Del Regno
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=bb78f340-4a37-33ad-55d6-805f64e1389c@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=narmstrong@baylibre.com \
--cc=ricardo.canuelo@collabora.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
all inboxes | Powered by JetHome®