From: Alex Deucher <alexdeucher@gmail.com>
To: oushixiong1025@163.com
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Sunil Khatri" <sunil.khatri@amd.com>,
"Alexandre Demers" <alexandre.f.demers@gmail.com>,
"Boyuan Zhang" <boyuan.zhang@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
"Shixiong Ou" <oushixiong@kylinos.cn>
Subject: Re: [PATCH] drm/amdgpu: skip disabling audio when device is unplugged
Date: Thu, 7 Aug 2025 09:01:29 -0400 [thread overview]
Message-ID: <CADnq5_PSiQOqTF1VuJNOtSS1M8K5Ycp09PijaDn2eVUiWiCqwg@mail.gmail.com> (raw)
In-Reply-To: <20250807094719.56145-1-oushixiong1025@163.com>
On Thu, Aug 7, 2025 at 5:53 AM <oushixiong1025@163.com> wrote:
>
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> When Stopping lightdm and removing amdgpu driver are executed, the following
> error is triggered probably:
There's already a patch to fix this here:
https://gitlab.freedesktop.org/drm/amd/-/issues/4481
Alex
>
> Unable to handle kernel paging request at virtual address 0000000000005e00
> .....
> [ 2] [T10084] Call trace:
> [ 2] [T10084] amdgpu_device_wreg.part.0+0x58/0x110 [amdgpu]
> [ 2] [T10084] amdgpu_device_wreg+0x20/0x38 [amdgpu]
> [ 2] [T10084] dce_v6_0_audio_endpt_wreg+0x64/0xd8 [amdgpu]
> [ 2] [T10084] dce_v6_0_sw_fini+0xa0/0x118 [amdgpu]
> [ 2] [T10084] amdgpu_device_ip_fini.isra.0+0xdc/0x1e8 [amdgpu]
> [ 2] [T10084] amdgpu_device_fini_sw+0x2c/0x220 [amdgpu]
> [ 2] [T10084] amdgpu_driver_release_kms+0x20/0x40 [amdgpu]
> [ 2] [T10084] devm_drm_dev_init_release+0x8c/0xc0 [drm]
> [ 2] [T10084] devm_action_release+0x18/0x28
> [ 2] [T10084] release_nodes+0x5c/0xc8
> [ 2] [T10084] devres_release_all+0xa0/0x130
> [ 2] [T10084] device_unbind_cleanup+0x1c/0x70
> [ 2] [T10084] device_release_driver_internal+0x1e4/0x228
> [ 2] [T10084] driver_detach+0x90/0x100
> [ 2] [T10084] bus_remove_driver+0x74/0x100
> [ 2] [T10084] driver_unregister+0x34/0x68
> [ 2] [T10084] pci_unregister_driver+0x24/0x108
> [ 2] [T10084] amdgpu_exit+0x1c/0x3270 [amdgpu]
> [ 2] [T10084] __do_sys_delete_module.constprop.0+0x1d0/0x330
> [ 2] [T10084] __arm64_sys_delete_module+0x18/0x28
> [ 2] [T10084] invoke_syscall+0x4c/0x120
> [ 2] [T10084] el0_svc_common.constprop.0+0xc4/0xf0
> [ 2] [T10084] do_el0_svc+0x24/0x38
> [ 2] [T10084] el0_svc+0x24/0x88
> [ 2] [T10084] el0t_64_sync_handler+0x134/0x150
> [ 2] [T10084] el0t_64_sync+0x14c/0x150
> [ 2] [T10084] Code: f9401bf7 f9453e60 8b150000 d50332bf (b9000016)
> [ 2] [T10084] ---[ end trace 0000000000000000 ]---
>
> The adev->rmmio has been unmmaped in amdgpu_device_fini_hw().
>
> So skip disabling audio when device is unplugged.
>
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
> ---
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> index 276c025c4c03..48b29990da7f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> @@ -23,6 +23,7 @@
>
> #include <linux/pci.h>
>
> +#include <drm/drm_drv.h>
> #include <drm/drm_edid.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_modeset_helper.h>
> @@ -1459,8 +1460,10 @@ static void dce_v6_0_audio_fini(struct amdgpu_device *adev)
> if (!adev->mode_info.audio.enabled)
> return;
>
> - for (i = 0; i < adev->mode_info.audio.num_pins; i++)
> - dce_v6_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
> + if (!drm_dev_is_unplugged(adev_to_drm(adev))) {
> + for (i = 0; i < adev->mode_info.audio.num_pins; i++)
> + dce_v6_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
> + }
>
> adev->mode_info.audio.enabled = false;
> }
> --
> 2.25.1
>
prev parent reply other threads:[~2025-08-07 13:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 9:47 [PATCH] drm/amdgpu: skip disabling audio when device is unplugged oushixiong1025
2025-08-07 10:03 ` Christian König
2025-08-07 13:01 ` oushixiong
2025-08-07 13:24 ` Christian König
2025-08-07 13:59 ` oushixiong
2025-08-07 13:01 ` Alex Deucher [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=CADnq5_PSiQOqTF1VuJNOtSS1M8K5Ycp09PijaDn2eVUiWiCqwg@mail.gmail.com \
--to=alexdeucher@gmail.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=alexandre.f.demers@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=boyuan.zhang@amd.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oushixiong1025@163.com \
--cc=oushixiong@kylinos.cn \
--cc=simona@ffwll.ch \
--cc=sunil.khatri@amd.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;
as well as URLs for NNTP newsgroup(s).