Received: by 10.213.65.68 with SMTP id h4csp2450633imn; Mon, 9 Apr 2018 03:51:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx496xBoesQesZ+wLovqVCFper94jIm9vL+usg60F5jq8A29sihAqF1FTWmeFVwEwH6UgCe63 X-Received: by 2002:a17:902:6b49:: with SMTP id g9-v6mr38646359plt.75.1523271101700; Mon, 09 Apr 2018 03:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523271101; cv=none; d=google.com; s=arc-20160816; b=M42+gFBqsjLU66cWxYzoldaHzEzFnfr5oY6IFX5fVTI0iQYDPEE4DuPwuIv2iwdbnF UMQ13kHwrhD6+5pXmG08FdIgYv6GnGNk8MU4JTQtx6N2GyiGvMVBKOiK72y2jmumcT6C xJcYfcP8JCVUB1i4AH/gpKEf7JiU/Yp1l/fv0krASky/9QBzmolLnA1Gc8E9A5CMymTd 5r1bJCbUfs95sqz4ARCdAg92JZBVINENzto6MbGuWeEPl0gHP/I38XKVNCOri1Ja6O3O 31BAV4XwS1hi94zNZkFIOvVhC4yy+xaT7okAdmd4RZNYJ3rDIUOZo6Uduoc3CPS7v4cJ inbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=n7deUmCusxxgzOyCZWR2mOSsgr1sGoC60a9AGHu5nyg=; b=kt+yzw8KKKkEYqdPEQ15YPub4/AKl5B2f7uYwqJuDrHB453q9Tk8HbzZMpc01XLs+k kdDxp9hradJyO2o29q3mCudOcQPQPF+EQg3yEKq5cZX/EazJ3pbxOs5bLXdYsVipLh84 8JLxwa2aQQSs69ToFh+TkwNJHl0iBb/zCCGJnYgf6jHiJ4OYNvg8cZT9NP6OlVRMhnKp AGmmQTlFtTHGNWshOziaY3/IHXQhMFZ60NU2loTGNWqQOVQQ3kpAmbrRP9zacLjxiWB0 bAX4L0Ys4oJw7MzuQsNsOumTvc3ZBBvuc53LIHhKRME3cTZJSzlEKxzJADOZphy3Q05Q oqBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a8dPg7ay; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n20-v6si6941plp.663.2018.04.09.03.51.04; Mon, 09 Apr 2018 03:51:41 -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=@gmail.com header.s=20161025 header.b=a8dPg7ay; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751970AbeDIKrQ (ORCPT + 99 others); Mon, 9 Apr 2018 06:47:16 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44233 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbeDIKrO (ORCPT ); Mon, 9 Apr 2018 06:47:14 -0400 Received: by mail-pl0-f67.google.com with SMTP id b6-v6so4853866pla.11 for ; Mon, 09 Apr 2018 03:47:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=n7deUmCusxxgzOyCZWR2mOSsgr1sGoC60a9AGHu5nyg=; b=a8dPg7ayU0EUCxkTIHFjCcsX6syjiAR9uDKbo8i/2b3RenIINOtvQ/5bMAmclCrAsA mOfZ9mwPilf82qxPuLBf6jAjSDSSzGUulBh1asxjDfLrhfK7h8iYDdQVWW44MKfAjoET dNMOpU6fbohCLbf6K0pthQrbUSGkkYLX6exA0YTuen8jCtrzDfESuRikXIvOxZIFiIsW llkdsS1PRxi/F+t/PaSec73D+OMMAyz3VeNHt5yiFsGWZFGiJovd50M5ZZ/VX8Lq737A H3qv9DCrQtmuMdx4Vfk4GKKfGpJJBcKxD6mHSX1ESstHw35UHv1X1U5l1hQTfcwcJQj0 9zEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=n7deUmCusxxgzOyCZWR2mOSsgr1sGoC60a9AGHu5nyg=; b=NCCPgI7vyC8cLrnhizQQzwlMVpqtokY36FMhhZa8uSR2ymsEWL5FXlaoFYwrrjKJHU 1Q7NS5xjTA6XzF5hLnyyn7XwBmtdW5wp01qH5vnJaVCUvDJmFw5mdqWVnMoD7xkrv5w4 qqwz44poz3vfzAgoqZ/wO9hYtLtYc4QpFekbG/DIwTEtxMEX+HCFNZ1c4Yv2egzHXlIk msavd7M4Vrl/GUBFbV6neU4wbgc1B0XUW6WJ/AToXL5gya1MPh2tfKa7R9yJHruplLOY 2OkOkFI1b/7XhXoDVOCgu2cv41HGx7BXXa7dVOV5IGHTRtYvOMcbV1Z2mdzleWB+lX8M GSPg== X-Gm-Message-State: ALQs6tB/Tbtwo/I/zi7qNlrU61HKPROORDtEyYH9yMA0CvMESwtrQ7p2 TcHh/7X1EZlnIE9qwlJJWXM= X-Received: by 2002:a17:902:8505:: with SMTP id bj5-v6mr19549150plb.231.1523270834357; Mon, 09 Apr 2018 03:47:14 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id g8sm332716pfc.106.2018.04.09.03.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 03:47:13 -0700 (PDT) From: Jia-Ju Bai To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, pradeep.d.tewani@intel.com, subhransu.s.prusty@intel.com, dharageswari.r@intel.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] sound: soc: intel: bxt_rt298: Replace GFP_ATOMIC with GFP_KERNEL in broxton_audio_probe Date: Mon, 9 Apr 2018 18:47:07 +0800 Message-Id: <1523270827-22735-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org broxton_audio_probe() is never called in atomic context. This function is only set as ".probe" in "struct platform_driver". Despite never getting called from atomic context, broxton_audio_probe() calls devm_kzalloc() with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, to avoid busy waiting and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- sound/soc/intel/boards/bxt_rt298.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 7843104..8257830 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -578,7 +578,7 @@ static int broxton_audio_probe(struct platform_device *pdev) } } - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_ATOMIC); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; -- 1.9.1