From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753052AbcHQLk6 (ORCPT ); Wed, 17 Aug 2016 07:40:58 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:39430 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbcHQLk5 (ORCPT ); Wed, 17 Aug 2016 07:40:57 -0400 To: Rob Clark , David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Julia Lawall From: Vaishali Thakkar Subject: Use of copy_from_user in msm_gem_submit.c while holding a spin_lock Message-ID: <57B44D2E.2030301@oracle.com> Date: Wed, 17 Aug 2016 17:10:30 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thank you. [1] http://lxr.free-electrons.com/source/drivers/gpu/drm/msm/msm_gem_submit.c#L85 -- Vaishali