Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [bug report] drm/xe/svm: Implement prefetch support for SVM ranges
Date: Mon, 26 May 2025 18:06:38 +0300	[thread overview]
Message-ID: <aDSDfusiM8QGQwFS@stanley.mountain> (raw)

Hello Himal Prasad Ghimiray,

Commit 09ba0a8f06cd ("drm/xe/svm: Implement prefetch support for SVM
ranges") from May 13, 2025 (linux-next), leads to the following
Smatch static checker warning:

	drivers/gpu/drm/xe/xe_vm.c:2922 prefetch_ranges()
	warn: passing positive error code 's32min-(-96),(-94)-(-15),(-13)-(-12),(-10)-(-2),1' to 'ERR_PTR'

drivers/gpu/drm/xe/xe_vm.c
    2917 
    2918                 err = xe_svm_range_get_pages(vm, svm_range, &ctx);
    2919                 if (err) {
    2920                         if (err == -EOPNOTSUPP || err == -EFAULT || err == -EPERM)
    2921                                 err = -ENODATA;
--> 2922                         drm_dbg(&vm->xe->drm, "Get pages failed, asid=%u, gpusvm=%p, errno=%pe\n",
    2923                                 vm->usm.asid, &vm->svm.gpusvm, ERR_PTR(err));

The comments on walk_page_range() say it can return > 0 on success but
the comments on hmm_range_fault() say it can never return > 0.  Smatch
does a naive reading of the code and thinks that it can return > 0.

Presumably the comments are correct but the code is too tricky for me.

I can easily silence this in Smatch by adding deleting the positive
returns from hmm_range_fault() from the cross function DB.  Can someone
confirm that's the correct thing to do?

    2924                         return err;
    2925                 }
    2926                 xe_svm_range_debug(svm_range, "PREFETCH - RANGE GET PAGES DONE");
    2927         }
    2928 
    2929         return err;
    2930 }

regards,
dan carpenter

             reply	other threads:[~2025-05-26 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26 15:06 Dan Carpenter [this message]
2025-05-26 16:45 ` [bug report] drm/xe/svm: Implement prefetch support for SVM ranges Ghimiray, Himal Prasad
     [not found]   ` <20250603222952.GD407166@ziepe.ca>
2025-06-04 14:54     ` Simona Vetter
2025-06-04 17:29       ` Dan Carpenter
     [not found]       ` <20250604145657.GB17991@ziepe.ca>
2025-06-04 17:30         ` Dan Carpenter

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=aDSDfusiM8QGQwFS@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jgg@ziepe.ca \
    /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