From patchwork Wed Oct 24 18:57:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 10654879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 798C613A9 for ; Wed, 24 Oct 2018 18:57:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67CF12B081 for ; Wed, 24 Oct 2018 18:57:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B9CF2B09F; Wed, 24 Oct 2018 18:57:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 118EF2B081 for ; Wed, 24 Oct 2018 18:57:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BEF26E2D9; Wed, 24 Oct 2018 18:57:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 76C2F6E2D8; Wed, 24 Oct 2018 18:57:31 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.54,421,1534802400"; d="scan'208";a="352679581" Received: from 30.9-255-62.static.virginmediabusiness.co.uk (HELO [172.16.5.17]) ([62.255.9.30]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 20:57:29 +0200 Date: Wed, 24 Oct 2018 19:57:27 +0100 (BST) From: Julia Lawall X-X-Sender: jll@hadrien To: Chunming Zhou Subject: [PATCH] drm: fix call_kern.cocci warnings (fwd) Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?iso-8859-15?q?Christian_K=F6nig?= , kbuild-all@01.org, Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Chunming Zhou --- 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;