Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1559871ima; Thu, 25 Oct 2018 00:51:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5e/XXtEYgZlzTQEcu7ZbsYxTQVLJZWzbQtQgcLt4RXl6pXpk9wE8cm8fUdJGCIa0UwXVdIx X-Received: by 2002:a62:5547:: with SMTP id j68-v6mr519492pfb.166.1540453904713; Thu, 25 Oct 2018 00:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540453904; cv=none; d=google.com; s=arc-20160816; b=T1GAe6Wr71hkgUVsBiSRnPzzzvl4S+hlbmmrOtGJXkUwipTq5yaVVLFi0+Y6f/ATwh eKOZ6/4n6v4Dokw3T/4zmSDGifeuDkFlOt6NziLPBr4Ba4ECSOKOxo5rKI1M9nPf4Kw6 YsZb6xO46D6l0uNng1nUi0cNQwbS0do4ZSsrDxtbb5GGEx/tFvZVwa1pNWVkYV1G8f6S 9GTV8VLLshTpFiGqT41dhpRAIknhIT97aZ4Wftc7fUv/OH1LkyQ43vSF1CjKZ0rr3IxZ ZSemIVFf/kF6llKkZCKMfVBiwfE3IrMfdqbwFT3uBjfV4+A6u2jfaM98F7FUSuYJ9cF9 ttUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Qp9qiV1kkCL2X4vGWURx+yFd5qF3WREqsffBD/7LKS8=; b=E7/2QGzfvboU3j36FOIpixsYSaoOX7HqsVSN1ucBvJVq8g1iO+3F0kKpm9M4jTKSCz nL8eI48VPDEQqu+ZNLepmp6u8nf3QvaCfajEncLQ/8G/tpNlSZ6LLQDtFFL/UCahGv7q F36/ONqRIq/rwL3TnBCF3V6CB/3LA8tbvx6fWIHRrgjaKZ0hk6mVoykd6QQ9HFpTQ/ii ZXxrVx5789gqQ6cdGIxT6QXlTgs/3K3b4/KNod45sZI3dUWCo5WIqGleZYA5gcNw5zJV qa47pBRhFGBJjsYSUWKIoOTGTJbvhTSejBlVoMGpL34UUaJHJP/bv074HUK5MzqfUt5w rxQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si7133633plt.330.2018.10.25.00.51.29; Thu, 25 Oct 2018 00:51:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbeJYQWR (ORCPT + 99 others); Thu, 25 Oct 2018 12:22:17 -0400 Received: from mga12.intel.com ([192.55.52.136]:40401 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbeJYQWR (ORCPT ); Thu, 25 Oct 2018 12:22:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 00:50:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,423,1534834800"; d="scan'208";a="94874090" Received: from reinig-mobl1.ger.corp.intel.com (HELO [10.252.35.227]) ([10.252.35.227]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2018 00:50:40 -0700 Subject: Re: [PATCH] drm: fix call_kern.cocci warnings (fwd) To: Julia Lawall , Chunming Zhou Cc: kbuild-all@01.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, =?UTF-8?Q?Christian_K=c3=b6nig?= , Gustavo Padovan , Sean Paul , David Airlie , linux-kernel@vger.kernel.org References: From: Maarten Lankhorst Message-ID: <995c8e64-46d3-7320-744e-b9bd1cb66530@linux.intel.com> Date: Thu, 25 Oct 2018 09:50:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Op 24-10-18 om 20:57 schreef Julia Lawall: > The containing function is called with a spin_lock held, so GFP_KERNEL > can't be used. > > julia > > ---------- Forwarded message ---------- > Date: Tue, 23 Oct 2018 17:14:25 +0800 > From: kbuild test robot > To: kbuild@01.org > Cc: Julia Lawall > Subject: [PATCH] drm: fix call_kern.cocci warnings > > CC: kbuild-all@01.org > CC: intel-gfx@lists.freedesktop.org > CC: dri-devel@lists.freedesktop.org > TO: Chunming Zhou > CC: "Christian K?nig" > CC: Gustavo Padovan > CC: Maarten Lankhorst > CC: Sean Paul > CC: David Airlie > CC: dri-devel@lists.freedesktop.org > CC: linux-kernel@vger.kernel.org > > From: kbuild test robot > > drivers/gpu/drm/drm_syncobj.c:202:4-14: ERROR: function drm_syncobj_find_signal_pt_for_point called on line 390 inside lock on line 389 but uses GFP_KERNEL > > Find functions that refer to GFP_KERNEL but are called with locks held. > > Semantic patch information: > The proposed change of converting the GFP_KERNEL is not necessarily the > correct one. It may be desired to unlock the lock, or to not call the > function under the lock in the first place. > > Generated by: scripts/coccinelle/locks/call_kern.cocci > > Fixes: 48197bc564c7 ("drm: add syncobj timeline support v9") > CC: Chunming Zhou > Signed-off-by: kbuild test robot The issue appears to be real and the patch looks sane. Chunming Zhou, do you want to fix it like this, or preallocate a fence obj? If former, just ack. :) ~Maarten > > tree: git://anongit.freedesktop.org/drm/drm-tip drm-tip > head: 8d7ffd2298c607c3e1a16f94d51450d7940fd6a7 > commit: 48197bc564c7a1888c86024a1ba4f956e0ec2300 [1968/2033] drm: add syncobj timeline support v9 > :::::: branch date: 4 hours ago > :::::: commit date: 5 days ago > > Please take the patch only if it's a positive warning. Thanks! > > drm_syncobj.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/drivers/gpu/drm/drm_syncobj.c > +++ b/drivers/gpu/drm/drm_syncobj.c > @@ -199,7 +199,7 @@ static struct dma_fence > (point <= syncobj->timeline)) { > struct drm_syncobj_stub_fence *fence = > kzalloc(sizeof(struct drm_syncobj_stub_fence), > - GFP_KERNEL); > + GFP_ATOMIC); > > if (!fence) > return NULL;