From: Daniel Vetter <daniel@ffwll.ch>
To: Young Xiao <92siuyang@gmail.com>
Cc: alexander.deucher@amd.com, christian.koenig@amd.com,
David1.Zhou@amd.com, airlied@linux.ie, daniel@ffwll.ch,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd: fix hotplug race at startup
Date: Fri, 14 Jun 2019 17:00:41 +0200 [thread overview]
Message-ID: <20190614150041.GA23020@phenom.ffwll.local> (raw)
In-Reply-To: <1560511763-2140-1-git-send-email-92siuyang@gmail.com>
On Fri, Jun 14, 2019 at 07:29:23PM +0800, Young Xiao wrote:
> We should check mode_config_initialized flag in amdgpu_hotplug_work_func.
>
> See commit 7f98ca454ad3 ("drm/radeon: fix hotplug race at startup") for details.
>
> Signed-off-by: Young Xiao <92siuyang@gmail.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> index af4c3b1..13186d6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> @@ -85,6 +85,9 @@ static void amdgpu_hotplug_work_func(struct work_struct *work)
> struct drm_mode_config *mode_config = &dev->mode_config;
> struct drm_connector *connector;
>
> + if (!adev->mode_info.mode_config_initialized)
> + return;
I think you want to delay your hotplug initialization until you're ready
to serve hotplug events, this here is fairly racy ...
-Daniel
> +
> mutex_lock(&mode_config->mutex);
> list_for_each_entry(connector, &mode_config->connector_list, head)
> amdgpu_connector_hotplug(connector);
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2019-06-14 15:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 11:29 Young Xiao
2019-06-14 15:00 ` Daniel Vetter [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=20190614150041.GA23020@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=92siuyang@gmail.com \
--cc=David1.Zhou@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.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 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®