Received: by 10.223.176.5 with SMTP id f5csp1987898wra; Thu, 8 Feb 2018 06:46:28 -0800 (PST) X-Google-Smtp-Source: AH8x227RrNwx5UknR63+XORPP6XqUl4Ug4JlfZFx+g8lTDLesqtkY1IdFPhuH3Tx2Om3pR670lwP X-Received: by 10.98.131.139 with SMTP id h133mr877382pfe.155.1518101188446; Thu, 08 Feb 2018 06:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518101188; cv=none; d=google.com; s=arc-20160816; b=oxsKjxTAHyK7ZIvXaKbMt4+XVlkHswL6zXcN/rXINX5EA547THRwvrT1z0E6tcWo4u HK9uY+f/7ol5d0PFqndO2+F+RD3kR9Sc2FCw8RXmDf7B52b5atiVxL3ylIPvUetmDByH ch60NgZwVyGutwEG4bwmxs+HQo/TJh3fXOqwqodr2kkT3vjRvy35jzO80z9kfgNfoTsg +f+WyYhx3Jlc4HchCkpC8FJXReefrgi2k6TJbynUIZYAl6nIVjR5r41uk9rSOMPK+YZS 5kbCn6vhFrl78g2NjH/beEvEBAx0FgolpcAQOFgeLHvCvjn2QpWzAVDw0SwzyTJzC7bY Mdug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=vjJs6oZNMafa3xfAP1MjRN6cUlSdzkN389G/dcGT3QI=; b=MqwGVC6k4KJUYyfz/WNnoJAjRdRbyop47HrJMOAfT0Oe58NtmCkOtc71MOaGH3gRvj NbYHwKfzRgKnj/WG8rKPuTH5Znev213RMquPfuuznMDSsa4CFgpHo3HwQTqBDq2gld2k y2bDXfLEpQnuszqox4VlxsFoK3yQTaw3U1Y/fvQe2wfNrIs3wVno8wbr/Ozaz5t6+y0Q JydQE/tuCB/A8wMw3HwtLz1ehlplpl+23TUvg3QPtFBYIC+CHDrLrRaZ7dhI42VEpVGb BxnyzvKHW3vrAR+41N4pI87ZK4idRxGdUma8cnI8bjKCDkxQgqtRl0F99ROwJVxp7VEM MqcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c6EOInev; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o128si29588pfo.68.2018.02.08.06.46.14; Thu, 08 Feb 2018 06:46:28 -0800 (PST) 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=@linaro.org header.s=google header.b=c6EOInev; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752220AbeBHOpV (ORCPT + 99 others); Thu, 8 Feb 2018 09:45:21 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:44046 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbeBHOpR (ORCPT ); Thu, 8 Feb 2018 09:45:17 -0500 Received: by mail-pg0-f68.google.com with SMTP id j9so1116163pgp.11 for ; Thu, 08 Feb 2018 06:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vjJs6oZNMafa3xfAP1MjRN6cUlSdzkN389G/dcGT3QI=; b=c6EOInevzurokxAp/DwxuhX0OCKLx2p0R/YaPX3E1jBYTGfsdUyyGLkGhw5ffOYDBc KhPPkPLUMY9BY39a46BU70JE+L7mLnd0HGujiGPoWNIONKcSZroTjXAfnoDyfimAC6Lh xOudFjQGlGeKbWZUQa574C0+q1ugkcuksThjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vjJs6oZNMafa3xfAP1MjRN6cUlSdzkN389G/dcGT3QI=; b=Ty5ArhG6r/hcKJeRI1uy0e6sNe/5L07qd+hujGTLBTr9eEVRXPlmVufxVNjouAJ3ro Guo3GYy4D6L1Zaf2YzPtnVKNZN1fShEM+taNvL96ZEDXn1gpvvH/DcXDzF6yvLtf9pZz HW0yll1/Z552o2pi+yrfJ4mrj7ElkyxMbtbeSyvmZu6c5/6V+o1O8YbAdD7bHNspQr5d UzcyegCCuAya7DTItx17CUcpCZ0L3TnkXpZc2S5pJ+wGB6zAztBUVe4zpvvmIcLA97DF s3o+wrD8+MwIlpdUnQurRdTrLF8o9FpzcPGTZxtwnTYt4LgZYZk5aXZ2BS+rQHFBbQXl +/Sw== X-Gm-Message-State: APf1xPDZKbQ7C13Zs3XIjATsYlHpGNX3t0I36IaP8RXjTx4Hf34XVJ5T l3wFxf546h6pkmge+xq8ZjbN+Q== X-Received: by 10.98.34.139 with SMTP id p11mr897884pfj.119.1518101116496; Thu, 08 Feb 2018 06:45:16 -0800 (PST) Received: from localhost ([122.172.61.199]) by smtp.gmail.com with ESMTPSA id t66sm219399pgc.89.2018.02.08.06.45.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 06:45:15 -0800 (PST) Date: Thu, 8 Feb 2018 20:15:13 +0530 From: Viresh Kumar To: Jia-Ju Bai Cc: vireshk@kernel.org, nm@ti.com, sboyd@codeaurora.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] opp: cpu: Replace GFP_ATOMIC with GFP_KERNEL in dev_pm_opp_init_cpufreq_table Message-ID: <20180208144513.GW28462@vireshk-i7> References: <1516956529-32264-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516956529-32264-1-git-send-email-baijiaju1990@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26-01-18, 16:48, Jia-Ju Bai wrote: > After checking all possible call chains to > dev_pm_opp_init_cpufreq_table() here, > my tool finds that this function is never called in atomic context, > namely never in an interrupt handler or holding a spinlock. > And dev_pm_opp_init_cpufreq_table() calls dev_pm_opp_get_opp_count(), > which calls mutex_lock that can sleep. > It indicates that atmtcp_v_send() can call functions which may sleep. > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. > > This is found by a static analysis tool named DCNS written by myself. > > Signed-off-by: Jia-Ju Bai > --- > drivers/opp/cpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/opp/cpu.c b/drivers/opp/cpu.c > index 2d87bc1..0c09107 100644 > --- a/drivers/opp/cpu.c > +++ b/drivers/opp/cpu.c > @@ -55,7 +55,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev, > if (max_opps <= 0) > return max_opps ? max_opps : -ENODATA; > > - freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_ATOMIC); > + freq_table = kcalloc((max_opps + 1), sizeof(*freq_table), GFP_KERNEL); > if (!freq_table) > return -ENOMEM; Applied thanks. -- viresh