[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGs31L4R4XG_GxDU5u0kC9yCKYpq3k9998b6KH-OPq6CQA@mail.gmail.com>
Date: Wed, 17 Aug 2016 11:08:46 -0400
From: Rob Clark <robdclark@...il.com>
To: Vaishali Thakkar <vaishali.thakkar@...cle.com>
Cc: David Airlie <airlied@...ux.ie>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
freedreno@...ts.freedesktop.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: Use of copy_from_user in msm_gem_submit.c while holding a spin_lock
On Wed, Aug 17, 2016 at 7:40 AM, Vaishali Thakkar
<vaishali.thakkar@...cle.com> wrote:
> Hello,
>
> I was wondering about the call to copy_from_user in function submit_lookup_objects for drive
> /gpu/drm/msm/msm_gem_submit.c It calls copy_from_user[1] in a spin_lock, which is not normally
> allowed, due to the possibility of a deadlock.
>
> Is there some reason that I am overlooking why it is OK in this case? Is there some code in the
> same file which ensures that page fault will not occur when we are calling the function holding
> spin_lock?
hmm, probably just that it isn't typical to use a swap file on these
devices (and that lockdep/etc doesn't warn about it).. I guess we
probably need some sort of slow-path where we drop the lock and try
again in case there would be a fault..
BR,
-R
> Thank you.
>
> [1] http://lxr.free-electrons.com/source/drivers/gpu/drm/msm/msm_gem_submit.c#L85
>
> --
> Vaishali
Powered by blists - more mailing lists