[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190614150041.GA23020@phenom.ffwll.local>
Date: Fri, 14 Jun 2019 17:00:41 +0200
From: Daniel Vetter <daniel@...ll.ch>
To: Young Xiao <92siuyang@...il.com>
Cc: alexander.deucher@....com, christian.koenig@....com,
David1.Zhou@....com, airlied@...ux.ie, daniel@...ll.ch,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd: fix hotplug race at startup
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@...il.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
Powered by blists - more mailing lists