Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1514482ima; Wed, 24 Oct 2018 23:54:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5eDC8wxuAYhdMAHhEfs9Wlgl1BuQLNdSKxdO6OZRWjxYXVQk0jSVzlg9Q0F5R1sGHtuLFV6 X-Received: by 2002:a63:7b06:: with SMTP id w6mr353637pgc.288.1540450443817; Wed, 24 Oct 2018 23:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540450443; cv=none; d=google.com; s=arc-20160816; b=0CPvFPCJGXBSHmE0cMhTLbLysQgPs/J7JPcGWboVcxotY5wc5vVrftf0/k2pjXm48T 7aY5hq1Ri0YJTOuFN1/bzir4Mdx4/YEmfaIbR5UFAjktLQg46S3n5z+mrZTSNT+b301n sANlSzPVuC4HcEkKfFN+pRuV4aKteBB/DCgUibYyQqftK0X8Q1P/LcFURpdPvPQj/Fbh LFY5DEmPaKr41PsxiR+78nHerstu+Ri+W7q9fncYJ+R5SR3V51W5kqV8TKInrY8T0TZW kAcJMVwVpGOHxyE7IwxdmT9u2JS9OerFVvEGaumoqOaPaUxNfMo5XHm2ldgNMVgdHXil HWcQ== 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:dkim-signature; bh=xZcWlcKoxIvp2oN0SDfTpxhhXheBlMiscBUxHBaiXzs=; b=nkW0aH19oYz+Q1CF+KtGk2IlzVo7tukbiw7Q4mS8EfLaDCKP1myBiv6o1WT4uuVGmP p1fs8JuejTXpwCwKyW8Xr36h9M0GcYrttjiQzeelhzKpbF8O49z/Oimdli4ppZOV0Oed ITbI3htOZ0fHTb3BBhyc/PB+0gSILhcxKDeXF0QJ9fl64FQ8iqrlV5Cg6Kvf0w+0hAEF 6dAVWBnzlIv+ASbNDoXrD5H7N04GoGBoa77nSa5RzOCwR8yhEgSVAtjVd7wHQhiniV3k nGv1i8h8fIrSqi7xUzaovS28wGzU62+u4gB/9rfSbOq6NCi0wr7DJK+O1acmo/RricQU 1r0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=kLt1NHZs; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k198-v6si7491958pga.12.2018.10.24.23.53.48; Wed, 24 Oct 2018 23:54:03 -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; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=kLt1NHZs; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbeJYPYt (ORCPT + 99 others); Thu, 25 Oct 2018 11:24:49 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:47058 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726465AbeJYPYs (ORCPT ); Thu, 25 Oct 2018 11:24:48 -0400 Received: by mail-ed1-f68.google.com with SMTP id v22-v6so7354668edq.13 for ; Wed, 24 Oct 2018 23:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xZcWlcKoxIvp2oN0SDfTpxhhXheBlMiscBUxHBaiXzs=; b=kLt1NHZsB5c6TIM0cOmGi8q4XHFX2CT1wnyCu3aSOwLXb/fFZEuuDRESYsc3itY6TL tTy/n764AWCkVRNjYATrNdkX+s06n6XoXVNv4qgs1zGbtYgMuKi6fTBRW6aHR5q1rHYb IfJ+OhWd2aIQTdUZTumLNHNEkOotslQzmBj9fZKq4XtfKNnJAtFF0IK97Kr8puybXqUH QQ/dGED2vZXEcQX4dl0Zw11NIucMEL+gEuK3PA27AHKmskoFlhLIbSRN5aeVSoi3DGTz AYkFRxZESrvSLa6feR3K0utR81brsW4+UowNTOaF+yZs8jxwghqzR+b6DL1Ipbga3WnY +cug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xZcWlcKoxIvp2oN0SDfTpxhhXheBlMiscBUxHBaiXzs=; b=ZM3z7RWrJ/Z5SXE8gBNNK54z5ER4degcmgNqhMuX1iQXzfI8bMvXoKaZiwBWiP8QwJ RmWoez8EFuvDRLE6cDaGqDhFs3RiHh4L8LK/D00J0I70V+nnHhFKFNXmjuFOcln5mcMj LoD/cmmSNSD9coiSQIHIdODdQPdntezxu+ZNiSy5EL4l4w2+KuZDRq6hc4+sxHBaTZIo kUX6rw8ewkcRPmUvRHPLPAEhJunqf5CGLWOQvd76PUctfCz6mNY7TP2TeVXQeO2v2ViY JegW7oF/pr+TGqPcglRxTH1UZ3BdG1UAG0IvXOjW0Lsm3Cb+2YRzkXsijd6TCBi7xB5L +EKw== X-Gm-Message-State: AGRZ1gIXYUu5Swe0LKebGUm5CMbJmAw61hLzmywMSx2kRqOX9I7zFyod V9YvMOYEsTUFNPmkfD871g== X-Received: by 2002:a17:906:3010:: with SMTP id 16-v6mr460629ejz.4.1540450403964; Wed, 24 Oct 2018 23:53:23 -0700 (PDT) Received: from ?IPv6:2a02:908:1257:4460:1ab8:55c1:a639:6740? ([2a02:908:1257:4460:1ab8:55c1:a639:6740]) by smtp.gmail.com with ESMTPSA id g13-v6sm2444829edv.48.2018.10.24.23.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 23:53:23 -0700 (PDT) Subject: Re: [PATCH] drm: fix call_kern.cocci warnings (fwd) To: "Zhou, David(ChunMing)" , Julia Lawall Cc: "kbuild-all@01.org" , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , "linux-kernel@vger.kernel.org" References: From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <823eb7cc-ba7e-b816-1821-c73dfd4c70bf@googlemail.com> Date: Thu, 25 Oct 2018 08:53:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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 Am 25.10.18 um 03:28 schrieb Zhou, David(ChunMing): > Reviewed-by: Chunming Zhou NAK, GFP_ATOMIC should be avoided. The correct solution is to move the allocation out of the spinlock or drop the lock and reacquire. Christian. > >> -----Original Message----- >> From: Julia Lawall >> Sent: Thursday, October 25, 2018 2:57 AM >> To: Zhou, David(ChunMing) >> Cc: kbuild-all@01.org; intel-gfx@lists.freedesktop.org; dri- >> devel@lists.freedesktop.org; Christian König >> ; Gustavo Padovan >> ; Maarten Lankhorst >> ; Sean Paul ; David >> Airlie ; dri-devel@lists.freedesktop.org; linux- >> kernel@vger.kernel.org >> Subject: [PATCH] drm: fix call_kern.cocci warnings (fwd) >> >> 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 >> --- >> >> 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;