From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4D74CA9EB0 for ; Sun, 3 Nov 2019 08:59:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C125C2084D for ; Sun, 3 Nov 2019 08:59:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbfKCI7t (ORCPT ); Sun, 3 Nov 2019 03:59:49 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:39017 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbfKCI7t (ORCPT ); Sun, 3 Nov 2019 03:59:49 -0500 X-IronPort-AV: E=Sophos;i="5.68,262,1569276000"; d="scan'208";a="410041714" Received: from abo-45-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.45]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Nov 2019 09:59:47 +0100 Date: Sun, 3 Nov 2019 09:59:47 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Can Guo cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, cang@codeaurora.org, Venkat Gopalakrishnan , Alim Akhtar , Avri Altman , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Tomas Winkler , Subhash Jadavani , open list , kbuild-all@lists.01.org Subject: [PATCH] scsi: ufs: fix call_kern.cocci warnings Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kbuild test robot Function ufshcd_dump_regs called from ufshcd_intr inside a lock but uses GFP_KERNEL. Generated by: scripts/coccinelle/locks/call_kern.cocci Fixes: 3393ec7d5dc1 ("scsi: ufs: Fix irq return code") CC: Venkat Gopalakrishnan Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Can-Guo/UFS-driver-general-fixes-bundle-3/20191103-092121 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next :::::: branch date: 2 hours ago :::::: commit date: 2 hours ago Another approach would be to reorganize the code to not use this function in printing the error message from the interrupt handler, or to reorganize the code in some other way. ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -117,7 +117,7 @@ int ufshcd_dump_regs(struct ufs_hba *hba if (offset % 4 != 0 || len % 4 != 0) /* keep readl happy */ return -EINVAL; - regs = kzalloc(len, GFP_KERNEL); + regs = kzalloc(len, GFP_ATOMIC); if (!regs) return -ENOMEM;