From: Dan Carpenter <dan.carpenter@linaro.org>
To: Rob Clark <robin.clark@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org
Subject: [bug report] drm/msm: Take lru lock once per submit_pin_objects()
Date: Fri, 1 Aug 2025 12:57:38 +0300 [thread overview]
Message-ID: <aIyPkrQl0YPu5ke2@stanley.mountain> (raw)
Hello Rob Clark,
Commit fc896cf3d691 ("drm/msm: Take lru lock once per
submit_pin_objects()") from Aug 2, 2023 (linux-next), leads to the
following Smatch static checker warning:
drivers/gpu/drm/msm/msm_gem.c:565 get_and_pin_iova_range_locked()
warn: sleeping in atomic context
drivers/gpu/drm/msm/msm_gem.c
546 static int get_and_pin_iova_range_locked(struct drm_gem_object *obj,
547 struct drm_gpuvm *vm, uint64_t *iova,
548 u64 range_start, u64 range_end)
549 {
550 struct drm_gpuva *vma;
551 int ret;
552
553 msm_gem_assert_locked(obj);
554
555 if (to_msm_bo(obj)->flags & MSM_BO_NO_SHARE)
556 return -EINVAL;
557
558 vma = get_vma_locked(obj, vm, range_start, range_end);
559 if (IS_ERR(vma))
560 return PTR_ERR(vma);
561
562 ret = msm_gem_pin_vma_locked(obj, vma);
563 if (!ret) {
564 *iova = vma->va.addr;
--> 565 pin_obj_locked(obj);
^^^^^^^^^^^^^^^^^^^^
This takes a mutex but Smatch thinks we're already holding a spinlock.
566 }
567
568 return ret;
569 }
The call tree is:
update_cursor() <- disables preempt
-> msm_gem_get_and_pin_iova()
-> msm_gem_get_and_pin_iova_range()
-> get_and_pin_iova_range_locked()
The update_cursor() function is holding
spin_lock_irqsave(&mdp4_crtc->cursor.lock, flags);
regards,
dan carpenter
reply other threads:[~2025-08-01 9:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=aIyPkrQl0YPu5ke2@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=robin.clark@oss.qualcomm.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