Received: by 10.192.165.148 with SMTP id m20csp194977imm; Thu, 26 Apr 2018 19:15:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGoMiREE4BZk+rmgMslGbS0EtLnd92opCcM1j28sNR1PF106blUluUdMGUNHa+CyJ/tqrf X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr464548ple.377.1524795330925; Thu, 26 Apr 2018 19:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524795330; cv=none; d=google.com; s=arc-20160816; b=tckGr2wQgd8u2BmoLrHky7/spZpN+ddxn0G90JLnaPOnLDf9l8iIzd0Mwo22xsufhC pNYeB5Ym4QOVkKrtE3yJaV62mPQUkBGkI3xfKy7RHISFEBcky3JsAvq5iMqddIuyhlkB McKu5ZAm+JcwwmyClwqukCxlKNmf+tBtwXMzw2DiXujUGkT9k2zeh62E/D8cuFk+X/Yj ldLkd4aHZ6MBUiEXrTqUEXKwlwCuSY3QZi4TNa3GhxNeNHOuuHoPckCsjdvS37bem9Af gw3/irB4Rpy+gNOtb9bEO86mYvH66LV/2ISC/aYh9/Q4ow5OTejJqXlF2YpVW0bDEyCq YpYQ== 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=ONkoKh+TCt8kvmBrSqugNhGFFxZpwc3hOdc7ke0BcvM=; b=Rq5CyTumg4fpjh4hJeTFgvnUB4FDhuVeqeaTTQk8Duy3jPoUSfjgM1+bzbTJnTxHx9 7Yl900HHwossUVa1Dqadc0YJLcuuVFinTOobRCoxhzMGJ28xbgiCcukSuH4qwRZMr2VP W6na22KUhGMx7oEwjJqo8+EfVq3mjpKGJqyYfAjMReYIi2708jG281bR/asIspHVSPaK dqhQtE/6XvBOnjtg37DFPLuZzwd9hJDpMlAOMSIM/90kp12/brOM1tG4uOyDEs6jsAvD sTuykyhqGmCUz11uze+DiFUC2VLttPOhQv7O2dbmmeogWzgfKudsTja26/DfztkJs2v1 8IFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hrHNolmE; 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 i65si258780pfb.343.2018.04.26.19.15.17; Thu, 26 Apr 2018 19:15:30 -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=hrHNolmE; 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 S1757345AbeD0CN6 (ORCPT + 99 others); Thu, 26 Apr 2018 22:13:58 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35540 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757197AbeD0CN4 (ORCPT ); Thu, 26 Apr 2018 22:13:56 -0400 Received: by mail-pf0-f194.google.com with SMTP id j5so309400pfh.2; Thu, 26 Apr 2018 19:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ONkoKh+TCt8kvmBrSqugNhGFFxZpwc3hOdc7ke0BcvM=; b=hrHNolmEXAwRGN189TmXT8EOjl6k2IeRuh019JQ7Hz2cwK3DMyge/JMWHn5HkvPDij IyMI0Sl76HhB9ExcxIswN6hfHud4rFZfxDfktrGRP842G6oYEgfEFHPldDBhgOB67rvs HLRYkre1vdt7o6POXmgecqMsxgQum9bRzAsHO85ofWocvGywacZ7/MYVujaAQRtn8U1f VVQuOT6roOc/6wfBlt5xLCOPowMHkcCH9ZbHArIEfJX/HcUWwEGuuFjZ8l8BuL4zLvHN tYrEZ6MU2094NbluPxvm20yxuwNS+vG/UaRyHcYvOsLxipPiwgAOoaipEa15mgM9iWBZ 4iFA== 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=ONkoKh+TCt8kvmBrSqugNhGFFxZpwc3hOdc7ke0BcvM=; b=gut6XHogWCJYQnRg4tTX5A3uG33fwZLAR9TbpyakmStKkYU9tGWlKKPG9E6AR1Jb+V +H2l41S3f8PTb++oh/Owj2DDQ0OkJbzOem8yRN19sMBV5bgOcinMqLfdEbhdPYrXNmRa Axzyrdxt57WdZCaf1cDYBUgLfj0vad+bYvZW0thZ94HcwXdqO7qysBvniXcRZL/xis3p zH0IV+IK+h/F3zQ7HAeDTCDuHzVULBz+Zyi8l/Aq7YsF58sFEmZIswgC8HHLWrDpOKZa lySBJiBGSbbNfgVrwAla3loAEHoiiC39y8rOC5CEuoFdT0k9UFH9UJd4zSSQVMnlak4q h5Qw== X-Gm-Message-State: ALQs6tDOK8iw/VmbNB4A+pt9nNe6n1Ty3Tt5eVZ0Sb3m8cew+hbZs/nq XMYfN5K/gcNr65+LRuawnZ30pIWK X-Received: by 2002:a17:902:bd46:: with SMTP id b6-v6mr495521plx.170.1524795235942; Thu, 26 Apr 2018 19:13:55 -0700 (PDT) Received: from localhost.localdomain ([70.102.96.7]) by smtp.gmail.com with ESMTPSA id u86sm267613pfg.71.2018.04.26.19.13.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 19:13:55 -0700 (PDT) Date: Thu, 26 Apr 2018 19:13:53 -0700 From: Eduardo Valentin To: Jia-Ju Bai Cc: rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] thermal: armada_thermal: Replace mdelay with usleep_range in armada380_init_sensor Message-ID: <20180427021352.GC30803@localhost.localdomain> References: <1523348008-29461-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523348008-29461-1-git-send-email-baijiaju1990@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 04:13:28PM +0800, Jia-Ju Bai wrote: > armada380_init_sensor() is never called in atomic context. > > armada380_init_sensor() is set as ".init_sensor" in > struct armada_thermal_data. > ".init_sensor" is called armada_thermal_probe(). > armada_thermal_probe() is set as ".probe" in struct platform_driver. > This function is not called in atomic context. > > Despite never getting called from atomic context, armada380_init_sensor() > calls mdelay() to busily wait. > This is not necessary and can be replaced with usleep_range() to > avoid busy waiting. > > This is found by a static analysis tool named DCNS written by myself. > And I also manually check it. > > Signed-off-by: Jia-Ju Bai > --- > drivers/thermal/armada_thermal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c > index ae75328..c289ae4 100644 > --- a/drivers/thermal/armada_thermal.c > +++ b/drivers/thermal/armada_thermal.c > @@ -143,7 +143,7 @@ static void armada380_init_sensor(struct platform_device *pdev, > if (!(reg & A380_HW_RESET)) { > reg |= A380_HW_RESET; > writel(reg, priv->control); > - mdelay(10); > + usleep_range(10000, 11000); This does not apply: checking file drivers/thermal/armada_thermal.c Hunk #1 FAILED at 143. 1 out of 1 hunk FAILED That mdelay() is not existing anymore. > } > } > > -- > 1.9.1 >