Received: by 10.192.165.156 with SMTP id m28csp448394imm; Wed, 11 Apr 2018 01:37:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ijQ8BUCiZpeHhjrTZdfh96EulT6lq254E5vC9FMX7DF0t+J6jr1yrzgsEzK4U/EthzEk7 X-Received: by 2002:a17:902:8f8b:: with SMTP id z11-v6mr4128650plo.8.1523435853875; Wed, 11 Apr 2018 01:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523435853; cv=none; d=google.com; s=arc-20160816; b=uyWLILV3d2almDEiuGTkEvitOpEYY+s2zEJd0GcetL05y/56Fyr+gvF8e4/v+b2sau AdWrXil//4NPwnTi7/fNg6IpDnKwbUij9vvU69zcKolFzIXU9Nx16cPZdQpwRfSQTChx ZJ3tm2SzvanhXOKI1SoeQ2jE24zYQt50xT1PmiWWpukszsknad1X8Sf91X+Sa9yCexvV 0BX5VO0ctw8ImvedzFG1a/Po3ErHe7tqxoM6cnvDt019KR5t5yl1xEvgR7DzP5B6MMpF k8l35bEBeSVsEP9gkRd2+CtPD++sp3QVCNFQKkxvjgvwudUuOt1TwBfnjPTQU0q1U+gF 9a2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=/QXnZ9WalwXelLG0rol+cZx2nPhArLUaLoqidSyqP20=; b=R/C1MrVjdSFZ4Q00kfN9452/7/6yAQGQdbNdpcXtmV6PMWWAISW7NdA6cU1F1ajnRi KGKVAVLYSUmjocrvZDO8imosgJVzaWfYI5RX2PRVkoHjOgIQDT9K4TqWA2heFtV9nfuq gJ8VpnWMGrOMszd0QCQBya5RAvvxo6eZwmox9MvWcwiWRogzbaq2unI5Va5guJ4QLPHu /c0h05UVHZ6qe0J9C3/v6SnrFWCl72OQKvY6o7fxJDSpgtzXT5Tmzh8b0wga07A1UdT8 MxQbBxSz6yhnFsT7awUAbZ5+JE+FJY5vrF1k4sLRc3objbN6seGI87j1yDjyTz4wTaLT gisA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=g6EoSvh/; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y62si451988pfd.309.2018.04.11.01.36.57; Wed, 11 Apr 2018 01:37:33 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=g6EoSvh/; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752535AbeDKIeI (ORCPT + 99 others); Wed, 11 Apr 2018 04:34:08 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:38805 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbeDKIeD (ORCPT ); Wed, 11 Apr 2018 04:34:03 -0400 Received: by mail-lf0-f67.google.com with SMTP id u3-v6so1424684lff.5 for ; Wed, 11 Apr 2018 01:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/QXnZ9WalwXelLG0rol+cZx2nPhArLUaLoqidSyqP20=; b=g6EoSvh/8pjPy6iJr9VpOEizd/I6LOK0yB7uOG2Od/BqxO3c98CHNQSUUlZqRLTwXk AETaG57gUWokXvKIE2Ld1mX3y/iHVUUPD8q9eNvidqYqtv4IxNv4SnMsd7/4jpwrX77F k4/yYMizf+xPjwL7e6up1tOdKD+M4sUdzwk9n9sqIKlYX21jpN7honNxg9J3LSQO/kWK xzxVcMASqd7t8VqgJVRQ+XjeZt3kS6RXncDzTeev3K6Men/YA0tiwQtgo1sW9rsZq6ib 7heiAycu385itN/MzgcPoGDpuEFWzPQp/zEkI05nuSnTWluGwFLMMzbqaFxjRl5RnCxK ObsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/QXnZ9WalwXelLG0rol+cZx2nPhArLUaLoqidSyqP20=; b=ED/+MevI3fkG+m8zPNTcnjGyAxUydGHVRxXrbsvJQGqETHcEvZhEPJI48EbgQleQor PUUhVHh5GRW9Wh8eUGtz8Vc5/URao3oBtDZleaQU+yshWitMEpT245uoSqj5BZEfCDQO sCunmR7a4Fa0fsAc/gwjbRI3KXTl7DnM4QanFuBKTbcQMgLAfuD6KtFkaoGcjuLr7h4g TvbcFlhmsp1jyJOf/llw2qhGGqbSLnQdYiqNNiSpGcnzsDD8ffzOI1G85q9RKQx2iMuL Wj1VdzurS1DhYzqB3LOXy/f/B41IoW1+xfZ3PhlgDH16O7h1RqEu980OioEoSg8hZGyr Ph6g== X-Gm-Message-State: ALQs6tA6Jd6M+LcBWpA6FygU+Pm0mc48OSpol8/KiiFeVGWS+tRP2nM8 4P1uE49UIFBmN5PIU3Vz/MiA+LIXt7A= X-Received: by 10.46.50.11 with SMTP id y11mr2483171ljy.149.1523435641504; Wed, 11 Apr 2018 01:34:01 -0700 (PDT) Received: from [192.168.0.127] ([31.173.84.47]) by smtp.gmail.com with ESMTPSA id i89-v6sm155904lfk.12.2018.04.11.01.34.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 01:34:00 -0700 (PDT) Subject: Re: [PATCH 1/2] ide: pdc202xx_new: Replace mdelay with usleep_range in detect_pll_input_clock To: Jia-Ju Bai , davem@davemloft.net, frankt@promise.com, andre@linux-ide.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org References: <1523433162-3910-1-git-send-email-baijiaju1990@gmail.com> From: Sergei Shtylyov Message-ID: <7558e956-62bd-39b9-6ff1-4d5f7ee2c9a3@cogentembedded.com> Date: Wed, 11 Apr 2018 11:33:59 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1523433162-3910-1-git-send-email-baijiaju1990@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 4/11/2018 10:52 AM, Jia-Ju Bai wrote: > detect_pll_input_clock() is never called in atomic context. > > detect_pll_input_clock() is only called by init_chipset_pdcnew(), which > is set as ".init_chipset" in struct ide_port_info. > This function is not called in atomic context. > > Despite never getting called from atomic context, detect_pll_input_clock() > 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/ide/pdc202xx_new.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c > index b33646b..6afa66d 100644 > --- a/drivers/ide/pdc202xx_new.c > +++ b/drivers/ide/pdc202xx_new.c > @@ -258,7 +258,7 @@ static long detect_pll_input_clock(unsigned long dma_base) > outb(scr1 | 0x40, dma_base + 0x03); > > /* Let the counter run for 10 ms. */ > - mdelay(10); > + usleep_range(10); This function takes 2 arguments. [...] MBR, Sergei