[PATCH] drm/amd: Fix a probing order problem on SDMA 2.4
Alex Deucher
alexdeucher at gmail.com
Tue Dec 12 17:39:43 UTC 2023
On Tue, Dec 12, 2023 at 12:37 PM Alex Deucher <alexdeucher at gmail.com> wrote:
>
> On Tue, Dec 12, 2023 at 12:30 PM Mario Limonciello
> <mario.limonciello at amd.com> wrote:
> >
> > commit 751e293f2c99 ("drm/amd: Move microcode init from sw_init to
> > early_init for SDMA v2.4") made a fateful mistake in
> > `adev->sdma.num_instances` wasn't declared when sdma_v2_4_init_microcode()
> > was run. This caused probing to fail.
> >
> > Move the declaration to right before sdma_v2_4_init_microcode().
> >
> > Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3043
> > Fixes: 751e293f2c99 ("drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4")
> > Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
>
> FWIW, looks like cik_sdma.c and sdma_v3_0.c never switched their
> microcode init to early init.
Nevermind, I had an old branch checked out.
>
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
>
> > ---
> > drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > index 45377a175250..8d5d86675a7f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> > @@ -813,12 +813,12 @@ static int sdma_v2_4_early_init(void *handle)
> > struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> > int r;
> >
> > + adev->sdma.num_instances = SDMA_MAX_INSTANCE;
> > +
> > r = sdma_v2_4_init_microcode(adev);
> > if (r)
> > return r;
> >
> > - adev->sdma.num_instances = SDMA_MAX_INSTANCE;
> > -
> > sdma_v2_4_set_ring_funcs(adev);
> > sdma_v2_4_set_buffer_funcs(adev);
> > sdma_v2_4_set_vm_pte_funcs(adev);
> > --
> > 2.34.1
> >
More information about the amd-gfx
mailing list