lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_Njw0uFYnB7--A=0Zv78ETLeXpNvH6Zc4znpTPLLQgwkA@mail.gmail.com>
Date:   Tue, 17 Jan 2023 16:03:01 -0500
From:   Alex Deucher <alexdeucher@...il.com>
To:     Hamza Mahfooz <hamza.mahfooz@....com>
Cc:     amd-gfx@...ts.freedesktop.org, Leo Li <sunpeng.li@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
        Roman Li <roman.li@....com>, dri-devel@...ts.freedesktop.org,
        Nicholas Kazlauskas <nicholas.kazlauskas@....com>,
        Fangzhi Zuo <Jerry.Zuo@....com>,
        Aurabindo Pillai <aurabindo.pillai@....com>,
        hersen wu <hersenxs.wu@....com>, Wayne Lin <Wayne.Lin@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd/display: fix issues with driver unload

On Tue, Jan 17, 2023 at 3:55 PM Hamza Mahfooz <hamza.mahfooz@....com> wrote:
>
> Currently, we run into a number of WARN()s when attempting to unload the
> amdgpu driver (e.g. using "modprobe -r amdgpu"). These all stem from
> calling drm_encoder_cleanup() too early. So, to fix this we can stop
> calling drm_encoder_cleanup() in amdgpu_dm_fini() and instead have it be
> called from amdgpu_dm_encoder_destroy(). Also, we don't need to free in
> amdgpu_dm_encoder_destroy() since mst_encoders[] isn't explicitly
> allocated by the slab allocater.
>
> Fixes: f74367e492ba ("drm/amdgpu/display: create fake mst encoders ahead of time (v4)")
> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@....com>

Reviewed-by: Alex Deucher <alexander.deucher@....com>

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c           | 4 ----
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 -
>  2 files changed, 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 9547037857b6..5cc14ed2e93e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1733,10 +1733,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
>                 adev->dm.vblank_control_workqueue = NULL;
>         }
>
> -       for (i = 0; i < adev->dm.display_indexes_num; i++) {
> -               drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
> -       }
> -
>         amdgpu_dm_destroy_drm_device(&adev->dm);
>
>  #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index bbeeee7c5d7c..5fa9bab95038 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -492,7 +492,6 @@ static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs
>  static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
>  {
>         drm_encoder_cleanup(encoder);
> -       kfree(encoder);
>  }
>
>  static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {
> --
> 2.39.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ