From patchwork Sun Nov 3 08:59:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11224305 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AFAC1599 for ; Sun, 3 Nov 2019 09:00:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 750C22084D for ; Sun, 3 Nov 2019 09:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbfKCI7t (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 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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;