From: John Olender <john.olender@gmail.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 15/30] drm/amdgpu/mes11: drop all BUG()s
Date: Wed, 8 Jul 2026 10:48:07 -0400 [thread overview]
Message-ID: <58c2249d-2bc1-4745-bce4-8e25ff769dfd@gmail.com> (raw)
In-Reply-To: <20260707154203.2603209-15-alexander.deucher@amd.com>
On 7/7/26 11:41 AM, Alex Deucher wrote:
> There's no need to crash the kernel for these cases.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> index 72ca7302bbfbc..ee5229ae3d75e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> @@ -86,7 +86,7 @@ static void mes_v11_0_ring_set_wptr(struct amdgpu_ring *ring)
> ring->wptr);
> WDOORBELL64(ring->doorbell_index, ring->wptr);
> } else {
> - BUG();
> + dev_warn(adev->dev, "mes_v11_0_ring_set_wptr() requires doorbell!\n");
Per scripts/checkpatch.pl:
WARNING: Prefer using '"%s...", __func__' to using 'mes_v11_0_ring_set_wptr', this function's name, in a string
> }
> }
>
> @@ -97,12 +97,15 @@ static u64 mes_v11_0_ring_get_rptr(struct amdgpu_ring *ring)
>
> static u64 mes_v11_0_ring_get_wptr(struct amdgpu_ring *ring)
> {
> + struct amdgpu_device *adev = ring->adev;
> u64 wptr;
>
> - if (ring->use_doorbell)
> + if (ring->use_doorbell) {
> wptr = atomic64_read((atomic64_t *)ring->wptr_cpu_addr);
> - else
> - BUG();
> + } else {
> + dev_warn(adev->dev, "mes_v11_0_ring_get_wptr() requires doorbell!\n");
See above. Interestingly, scripts/checkpatch.pl doesn't catch this one.
There are additional prints like this in the series.
Thanks,
John
> + wptr = 0;
> + }
> return wptr;
> }
>
> @@ -294,7 +297,7 @@ static int convert_to_mes_queue_type(int queue_type)
> else if (queue_type == AMDGPU_RING_TYPE_SDMA)
> return MES_QUEUE_TYPE_SDMA;
> else
> - BUG();
> + WARN(1, "Invalid queue type %d\n", queue_type);
> return -1;
> }
>
> @@ -1544,7 +1547,7 @@ static int mes_v11_0_queue_init(struct amdgpu_device *adev,
> else if (pipe == AMDGPU_MES_SCHED_PIPE)
> ring = &adev->mes.ring[0];
> else
> - BUG();
> + WARN(1, "Invalid MES pipe %d\n", pipe);
>
> if ((pipe == AMDGPU_MES_SCHED_PIPE) &&
> (amdgpu_in_reset(adev) || adev->in_suspend)) {
> @@ -1627,7 +1630,7 @@ static int mes_v11_0_mqd_sw_init(struct amdgpu_device *adev,
> else if (pipe == AMDGPU_MES_SCHED_PIPE)
> ring = &adev->mes.ring[0];
> else
> - BUG();
> + return -EINVAL;
>
> if (ring->mqd_obj)
> return 0;
next prev parent reply other threads:[~2026-07-08 14:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 15:41 [PATCH 01/30] drm/amdgpu: return an error instead of BUG() for CSA bo_va Alex Deucher
2026-07-07 15:41 ` [PATCH 02/30] drm/amdgpu/gfx11: WARN() rather than BUG() for invalid SDMA engine Alex Deucher
2026-07-07 15:41 ` [PATCH 03/30] drm/amdgpu/gfx12: " Alex Deucher
2026-07-07 15:41 ` [PATCH 04/30] drm/amdgpu/gfx12.1: " Alex Deucher
2026-07-07 15:41 ` [PATCH 05/30] drm/amdgpu/atomfirmware: WARN() rather than BUG() Alex Deucher
2026-07-07 15:41 ` [PATCH 06/30] drm/amdgpu/cgs: " Alex Deucher
2026-07-07 15:41 ` [PATCH 07/30] drm/amdgpu/ucode: " Alex Deucher
2026-07-07 15:41 ` [PATCH 08/30] drm/amdgpu/cik_sdma: replace BUG() with an error Alex Deucher
2026-07-07 15:41 ` [PATCH 09/30] drm/amdgpu/sdma2.4: " Alex Deucher
2026-07-07 15:41 ` [PATCH 10/30] drm/amdgpu/sdma3.0: " Alex Deucher
2026-07-07 15:41 ` [PATCH 11/30] drm/amdgpu/si: drop BUG()s Alex Deucher
2026-07-07 15:41 ` [PATCH 12/30] drm/amdgpu/gmc6: replace BUG() with an error Alex Deucher
2026-07-07 15:41 ` [PATCH 13/30] drm/amdgpu/imu11: WARN() rather than BUG() Alex Deucher
2026-07-07 15:41 ` [PATCH 14/30] drm/amdgpu/imu12: " Alex Deucher
2026-07-07 15:41 ` [PATCH 15/30] drm/amdgpu/mes11: drop all BUG()s Alex Deucher
2026-07-08 14:48 ` John Olender [this message]
2026-07-07 15:41 ` [PATCH 16/30] drm/amdgpu/mes12: " Alex Deucher
2026-07-07 15:41 ` [PATCH 17/30] drm/amdgpu/mes12.1: " Alex Deucher
2026-07-07 15:41 ` [PATCH 18/30] drm/amdgpu/psp11: replace BUG() with an error Alex Deucher
2026-07-07 15:41 ` [PATCH 19/30] drm/amdgpu/psp13: " Alex Deucher
2026-07-07 15:41 ` [PATCH 20/30] drm/amdgpu/psp13.0.4: " Alex Deucher
2026-07-07 15:41 ` [PATCH 21/30] drm/amdgpu/psp14: " Alex Deucher
2026-07-07 15:41 ` [PATCH 22/30] drm/amdgpu/gfx6: drop all BUG()s Alex Deucher
2026-07-07 15:41 ` [PATCH 23/30] drm/amdgpu/gfx7: " Alex Deucher
2026-07-07 15:41 ` [PATCH 24/30] drm/amdgpu/gfx8: " Alex Deucher
2026-07-07 15:41 ` [PATCH 25/30] drm/amdgpu/gfx9: " Alex Deucher
2026-07-07 15:41 ` [PATCH 26/30] drm/amdgpu/gfx9.4.3: " Alex Deucher
2026-07-07 15:42 ` [PATCH 27/30] drm/amdgpu/gfx10: " Alex Deucher
2026-07-07 15:42 ` [PATCH 28/30] drm/amdgpu/gfx11: " Alex Deucher
2026-07-07 15:42 ` [PATCH 29/30] drm/amdgpu/gfx12: " Alex Deucher
2026-07-07 15:42 ` [PATCH 30/30] drm/amdgpu/gfx12.1: " Alex Deucher
2026-07-07 16:53 ` Russell, Kent
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=58c2249d-2bc1-4745-bce4-8e25ff769dfd@gmail.com \
--to=john.olender@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.