Received: by 10.192.165.156 with SMTP id m28csp450344imm; Wed, 11 Apr 2018 01:40:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/qC+eVldC9LnCHBvgpTqeEKbn1tJDn882G5Rr/nSS8cN0bY/MTOgfb/sUgWG4wH82EwReV X-Received: by 2002:a17:902:5609:: with SMTP id h9-v6mr4047585pli.121.1523436020175; Wed, 11 Apr 2018 01:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523436020; cv=none; d=google.com; s=arc-20160816; b=AcSzPHcZ8oB5toxDRwTMFVXx6qYx2EgjPprkrcjGsVhwX8GfCw10Y7qmIWCJLb1S9s JCtjDFMWdOtpds57X9HThD3eiSGKxRcmRzggzgztFldSnC8TKQNxzJwMmmSXYtwfPb/j gXj0EwhW/Vx823mDYX2bIOw7wJv1cDLnAeJsTOPwl0mgFrbRTexTWFDun8ngCmTbVJz+ o5NbYZQ4KxWK3ZhmlDPvu03JzEu23Nm9U9LQyZI7zEo5Qae/ra0raXl0o0gN5MayqZ7o LrWiaV57ekPcIwGl35GBlkhWGxloNmZYwNk6+oyAT9EJt00LxEF/JBsuJZwfe+Ns5qGn OEgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=aBevJHrEgOM4u76hExiFyvI6eQHkbHhv/h6VJnhICCM=; b=EakteNZmMU4zKUR8mpQ6FhVMdCsudLkoY3Zy5nke6Fx3JaJOCGurT5vAoOYt81CkcV 7sa6BzFD1e1EiN1F+CNS4Kp5Vvf1di8A8PMK0gSsEA7HvC/pOXAD8YTSYspvUoAjnbgf wLERtHlZcjBGhryduSSVK0AXpyl9FCIGnXl4S4cyx2HsdtS4KuNkNGxVEWYwrM9dbvX/ g9zpX1LYM+Dimg66+sQjFgpqHztCEQd7OchptXl4hcuhWBVQl1/FngzWDi1m9onj4xqT VryW6G8fV92BZobJ6HoczfyRDMqtKspCf6bxB9PKD/ZPLTiK6L/33S9kgKh1OXsjLUn2 yqnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tRjAsVMy; 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 g4si514413pfm.358.2018.04.11.01.39.43; Wed, 11 Apr 2018 01:40:20 -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=tRjAsVMy; 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 S1752474AbeDKIgY (ORCPT + 99 others); Wed, 11 Apr 2018 04:36:24 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38749 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbeDKIgW (ORCPT ); Wed, 11 Apr 2018 04:36:22 -0400 Received: by mail-pf0-f196.google.com with SMTP id y69so598005pfb.5; Wed, 11 Apr 2018 01:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=aBevJHrEgOM4u76hExiFyvI6eQHkbHhv/h6VJnhICCM=; b=tRjAsVMy718uI1eor8vbTO/bU/n5O5nC6Ms59YBZj6ZYN0zlWoRAf5l08SyLCQcw/e W1ZQBfMgRMSvFqwFLpjXPDJCQs2GODG2Fxy7Vm4+TMEVC1RMf00Xo9kNm5Uy9FvjzQIe NIKnZ8H2uO6pWP8LBQdIG0DS1EHKYxpwkY7VKm4r/UNN6Pb/Esd450nHTJK8DMH4kYlZ Fg9dhe/9UY7/fDixqTiZax9sc8Gc/vWAunZap64scQDlfK0RsuhzwbCjwiTY2FwiY2bu FZZRIW8aNZz63rM738ah+CSFcfHVEjJdrXnJf6voJwYhSEa2oQ7pznkcq4ZKxlEyzGyF ylkw== 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-transfer-encoding :content-language; bh=aBevJHrEgOM4u76hExiFyvI6eQHkbHhv/h6VJnhICCM=; b=kYyQhCG689XfeNffGIbi6SxLhbtL679Kb++/f9PrwnHSNi+cIapDr7d5iCXc75RuRS szWSV4RNq3NvzDq1XKF621a6GZwhlWWuOD2lLKHrYPcb3lFGvBzkhw9ZWQ89ky6jZEni YfRphH/cJfJoEuwzZBwRJf9cKBeevzfktDzPx5gkzdCNyPCbnGoDej8l/0dKRBRBzv0u zqAP7TVfIt8Syaxg/ZjJikCkvNChC5AtFh8bRfhrTORugLWdu/VtwtDUrwayEmiEn2kt AyOvZDd4b3qSgXw68CVs+/XD5cNy/LY5WInT5p02zQAgPRx78pcTXjI41k6umCB1O03g 0vNQ== X-Gm-Message-State: ALQs6tCZ6S0b1UBwD6+lENjYuRyOxlPnOtOPtaK1txrvxtrnxWYYv9qp PU5vjWq4bNjWEyE1aAi6spIKbVBBUjg= X-Received: by 10.99.126.73 with SMTP id o9mr2771272pgn.168.1523435781992; Wed, 11 Apr 2018 01:36:21 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.53? ([2402:f000:1:1501:200:5efe:a66f:4635]) by smtp.gmail.com with ESMTPSA id d199sm1793365pfd.95.2018.04.11.01.36.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 01:36:21 -0700 (PDT) Subject: Re: [PATCH 1/2] ide: pdc202xx_new: Replace mdelay with usleep_range in detect_pll_input_clock To: Sergei Shtylyov , 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> <7558e956-62bd-39b9-6ff1-4d5f7ee2c9a3@cogentembedded.com> From: Jia-Ju Bai Message-ID: <00b11f19-0a4b-df83-923b-001bc5393229@gmail.com> Date: Wed, 11 Apr 2018 16:35:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <7558e956-62bd-39b9-6ff1-4d5f7ee2c9a3@cogentembedded.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/4/11 16:33, Sergei Shtylyov wrote: > 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 Oops, sorry for my fault. Thanks for telling me this :) I will modify it and send V2. Best wishes, Jia-Ju Bai