Received: by 10.192.165.148 with SMTP id m20csp194118imm; Thu, 26 Apr 2018 19:14:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZriTAdinvoELtxAhX2dlyhBMHxuA7b3mgc/0fMy0NU8hMvre+eOe+weq5JDvkDsRZk5Hp10 X-Received: by 2002:a65:414d:: with SMTP id x13-v6mr437065pgp.223.1524795242886; Thu, 26 Apr 2018 19:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524795242; cv=none; d=google.com; s=arc-20160816; b=X4JlX08lutUOM2cjshfBmT3o9cXF/DJE2T6/S7mCzCq6dWCvQDr7A+1KfuSUlYj49f kRkn4xHRGqgn4NEfoPZhQneLO6TEz77aiil5IpiXbcyF2TWkh5Zyf6dB63+Xs8OvNKgy DkeoZ9QftPeSHw4X/eLsRcBotL/IFIH41tcA7g5CtJxt1+z8xMKmDJjqX6bsWHwEz4Vm 9ViUDqJjoyEu/4XsPtwym8xIvXjr9hcFAUQBQi+YBChUREALsyZTD1DFEHT7EkcwN6iT MXpMQ/Vz7rsFFlAUrd3Z0RTjvr2F+QOwRTg95jGcUZEdy3nSYtgg6tPmSHPGen9GGYDl kQfQ== 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=GM86NL1Qo+sQ9CWW0sBeYc8HCvg4aqQ5epxJKYssuPY=; b=BjAm03MwPZHwTQlB8HUYjr5l0bDqdr7j0wVDu0IJpiCqOtqUB4AycLxLhpEYgbXidw yzS7DnA9mHDoE5CIirw1Th3V6Q7Y7QzBt3gBU1905WSH+2Y22GmGr+B9C9k3pIIWUNLi +g7czKE2biJcUsY4Vww2I0QHe65/oLazPJMqUWGczj3+MUM9oqlYVlJO5yOYG0dEbs1k +3F+L6X/fYoXq2uihhqPvGrZ4SyBrcxzS3NsF3UBucZ3pKDOu6ryDKJQoiHLBD26ssqm Lh9E3gsdcuhTKEsq2ippm/z2rSPkT3q9eSxWik4gyxMVeuKMDNJRALvYDj5aHtNw80u9 9pIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cuVGkv86; 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 62si254252pfw.173.2018.04.26.19.13.48; Thu, 26 Apr 2018 19:14:02 -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=cuVGkv86; 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 S932342AbeD0CMO (ORCPT + 99 others); Thu, 26 Apr 2018 22:12:14 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:39943 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754298AbeD0CMM (ORCPT ); Thu, 26 Apr 2018 22:12:12 -0400 Received: by mail-pf0-f196.google.com with SMTP id f189so297209pfa.7; Thu, 26 Apr 2018 19:12:11 -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=GM86NL1Qo+sQ9CWW0sBeYc8HCvg4aqQ5epxJKYssuPY=; b=cuVGkv86CNoogB/ViSDIUdHhL6vrdhA9Gb3Xombb9WT0n4VQZ6gGjG7/b2KyL30Cod M5/wbDA4kMc1DpvX2Vt8ibcZAvrXOb1y3fGQDgxvj4j/ehK9o5PTy41S1THdZ4OXjKY8 Z9vWXSxopgAyDdUTWwUxx1Ur3HrO44sdA16LUCWmkJ9aLmDHjd0pJNYwTvMvnsrJQ+Mi ZDb9+PLsKHtI1/eVN8xivBMZNbf3nYzIP2Zl8URcPBbIUuwqI23AxIBhX/7C2P7n3A0d 8JZW7WL4W2fExzuLxU4NfA7uuOUG3k9+iHzesuw2BIvPly4TwjKO1tv6r3yYo5AhgsM0 parQ== 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=GM86NL1Qo+sQ9CWW0sBeYc8HCvg4aqQ5epxJKYssuPY=; b=mGaOCvR2j4cZF98ghgp7EyRje3XLBGIx80EgWRMnoqR6gjSc40LGxMpPO02oxFqImI USs9fLN71YjmlcoqOlXPpVI8Y9UXtJgVhM9bBcGuLY2jNsgNe+AdiRJuh+ESyekhpz8r CCHeZNGyrHF/1A2/HzW+xytwflzwKV0MlQ36t8ZrSZ+Bu/rSV8l50Xjlh8TNCjgiZ4x8 0AoztSgM1RldGds98+bLJvUo9LnocclKqPZLMkYYHMrBmFRmuZpgCwRWjQASG0DRapTj tcyDOzbFvrcX3QnQwfQyIzgpJ/V4EbVy9nzI5QtRj9aFKfroGBwEhI3pCgWAdTgSgAU5 fqFw== X-Gm-Message-State: ALQs6tDzu4vcQH/aWGI2sW9YpRpsA1DObIHVKIwgL/UGYPJeSgn8Slv5 wnriuf1S6NPE2zt+lDcS4SU= X-Received: by 2002:a17:902:1aa:: with SMTP id b39-v6mr495296plb.120.1524795130689; Thu, 26 Apr 2018 19:12:10 -0700 (PDT) Received: from localhost.localdomain ([70.102.96.7]) by smtp.gmail.com with ESMTPSA id 206sm104450pfy.51.2018.04.26.19.12.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 19:12:10 -0700 (PDT) Date: Thu, 26 Apr 2018 19:12:07 -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 2/3] thermal: armada_thermal: Replace mdelay with msleep in armada375_init_sensor Message-ID: <20180427021204.GB30803@localhost.localdomain> References: <1523347996-29417-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523347996-29417-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:16PM +0800, Jia-Ju Bai wrote: > armada375_init_sensor() is never called in atomic context. > > armada375_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, armada375_init_sensor() > calls mdelay() to busily wait. > This is not necessary and can be replaced with msleep() 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 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c > index ae75328..0825a7a 100644 > --- a/drivers/thermal/armada_thermal.c > +++ b/drivers/thermal/armada_thermal.c > @@ -127,11 +127,11 @@ static void armada375_init_sensor(struct platform_device *pdev, > reg &= ~A375_HW_RESETn; > > writel(reg, priv->control + 4); > - mdelay(20); > + msleep(20); > > reg |= A375_HW_RESETn; > writel(reg, priv->control + 4); > - mdelay(50); > + msleep(50); Already done: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/thermal/armada_thermal.c#n144 > } > > static void armada380_init_sensor(struct platform_device *pdev, > -- > 1.9.1 >