[bug report] drm/amdgpu: add selftest framework for UMSCH

Alex Deucher alexdeucher at gmail.com
Wed Sep 6 13:26:26 UTC 2023


On Wed, Sep 6, 2023 at 8:25 AM Lang Yu <Lang.Yu at amd.com> wrote:
>
> On 09/06/ , Dan Carpenter wrote:
>
> Thanks for reporting this bug. Can you give a link to this bug report? Commit message requests it.
> ("Reported-by: should be immediately followed by Link: with a URL to the report")

For something reported on the mailing list you can just provide the
link the the mailing list archive:
Link: https://lists.freedesktop.org/archives/amd-gfx/2023-September/098254.html

Alex

>
> Regards,
> Lang
>
> > Hello Lang Yu,
> >
> > The patch 5d5eac7e8303: "drm/amdgpu: add selftest framework for
> > UMSCH" from Jun 21, 2023 (linux-next), leads to the following Smatch
> > static checker warning:
> >
> >       drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c:338 setup_umsch_mm_test()
> >       warn: unsigned error codes 'test->pasid'
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
> >     319 static int setup_umsch_mm_test(struct amdgpu_device *adev,
> >     320                           struct umsch_mm_test *test)
> >     321 {
> >     322         struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB0(0)];
> >     323         int r;
> >     324
> >     325         test->vm_cntx_cntl = hub->vm_cntx_cntl;
> >     326
> >     327         test->vm = kzalloc(sizeof(*test->vm), GFP_KERNEL);
> >     328         if (!test->vm) {
> >     329                 r = -ENOMEM;
> >     330                 return r;
> >     331         }
> >     332
> >     333         r = amdgpu_vm_init(adev, test->vm, -1);
> >     334         if (r)
> >     335                 goto error_free_vm;
> >     336
> >     337         test->pasid = amdgpu_pasid_alloc(16);
> > --> 338         if (test->pasid < 0) {
> >                     ^^^^^^^^^^^^^^^
> > Unsigned can't be less than zero.
> >
> >     339                 r = test->pasid;
> >     340                 goto error_fini_vm;
> >     341         }
> >     342
> >     343         r = amdgpu_bo_create_kernel(adev, sizeof(struct umsch_mm_test_ctx_data),
> >
> > regards,
> > dan carpenter


More information about the amd-gfx mailing list