Received: by 10.192.165.156 with SMTP id m28csp416590imm; Wed, 11 Apr 2018 00:57:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx49VPxsGAOUrj6wnkjKO3aaQ3gJU2XwoSg1liPteghhTqQq45gqRxD24j/6TecasWQB+KZZD X-Received: by 10.99.117.2 with SMTP id q2mr2733920pgc.248.1523433479343; Wed, 11 Apr 2018 00:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523433479; cv=none; d=google.com; s=arc-20160816; b=QJkEA74/XZnNpaESYzoX1MXACMi8On3/WCySjY7+NKiWR8WYWo6u2DCKVIhuZUO3on wiU4SGqWeU9m/ei7/euvMEP8AykVsS1HXmzGHNeT7fFSOFoXhmq/kAZZ+KZuiyHeHTOZ vWEVdlz1OsWLpdIpbo219yShwkQ/nMGveLInZq248qmJqFIzKOgeNkL3r7AR2/WSgloB ErxNSv4PI2qPoYE1vcHHjvmSd6up8UzPlev7lfim0OVrJeM+8lS7Rv3H8tmCDtWDGH0q FZIn9bQlFREZ7poPY3l4JFbA8U8hdQhzOTW58EOsups/lPbCIL2NGRcVdXnShc3vINq3 dLHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=jsCiNtdkSQhDPcMgmygOCz/Ti5AI07qaKwSdf8C1SaI=; b=xEHFn2c6XhSw0hhx3QOiKqZGMqUD7lKl2DSyHZQFYyzkf2q1s0kF9UmepQ1xds5Lib 9A1vIAKkcYQLpTempXr3Tbx/94pHZPkq30Qd1fF0UVJe6zEDwvET74jCBwXSrUCrYIMO BO3OxqS1713CJxSaTsVKg1rW6PPUbFPoTrPoCHClJmhQIn8OlA1PjObBabB/SVlOkgj2 tho9a+8GgCXiSuECJzRcBoHwV/WD/4LJL07QbssFP1WP5XfaEuGnu17GXKDVGYW7vZk0 7iwqcHD5XiJR9Janq0dY+5HtS1CwsW+terwToFiGUq4n8xRhsetUnd6bKfwhRRISIaiK hYWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KWXrhnIX; 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 r138si403701pgr.84.2018.04.11.00.57.22; Wed, 11 Apr 2018 00:57:59 -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=KWXrhnIX; 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 S1752558AbeDKHxK (ORCPT + 99 others); Wed, 11 Apr 2018 03:53:10 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:38738 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752470AbeDKHxH (ORCPT ); Wed, 11 Apr 2018 03:53:07 -0400 Received: by mail-io0-f193.google.com with SMTP id b20so1378378iof.5; Wed, 11 Apr 2018 00:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jsCiNtdkSQhDPcMgmygOCz/Ti5AI07qaKwSdf8C1SaI=; b=KWXrhnIXW6vU5hi1Vee+mGow+RZMYMA3XKnwQgvhXkMcSpYECRI9W1TIqcGgflaNob wWOnbe+dSXpDujbXlI+zbOLqKhNSicxlz6mG17xtGU/zvIBDsMBZxnvss6zdu2FTGWUG FkAL6Paj/515cKbFZKJsoCWNuv+4JBBxjDaWkCQy4hNRLk3zJMALK4tODeqA0A1dcQ/6 kgQnUQNGrVuT1FC05zuBPRzRuyF2AHKDMHKMOfH3sVljCT33O7CMoB+w8FVQhJ6H+8rQ fsoLXx97KuNmCcJYJ7RmOanBOGXKurQEdXiu5Xzx659am1OsuBsHaED+jQqmnWEqXzMJ X2Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jsCiNtdkSQhDPcMgmygOCz/Ti5AI07qaKwSdf8C1SaI=; b=OqKB+rptYBQBXG5S7ALFNSQcxku/SHLNnBciHDJd02lXDCzi5yd574DFYIsYk/Aa4m mUlz9pNx3cPY1WeQQage+3+kSTNjWVJznJ3iNrl+AV8B1ok80klzj0jIYLseplebq6nT WEPblac9FMjS2s8dh7cwM0xGSoVgBqjj38BerZE075TSXIAEv6bD1CM0S0IlLTjvClZW JZLqhakhbF2hasZXLm3s5aj2OWKXkSG+HwVx9X0njvSoBtrucpq6UQsKjeDH/vtFk0aB trtk0r0DbCMSggCdfqJBAT890oGfZXghp3xBdJsTjZ1YeBRamTy/C/Ff4O0ypxGIYFQJ d4vQ== X-Gm-Message-State: ALQs6tA8iVgkBm1XIvCPPqswTxGZDGu9y2DEuCwDRjpJk39Q9zHsl92W Hk0fKB0g9zEHBEQhZAxZ1wA= X-Received: by 10.107.3.71 with SMTP id 68mr3853589iod.66.1523433187053; Wed, 11 Apr 2018 00:53:07 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id 7sm268936ioo.14.2018.04.11.00.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 00:53:06 -0700 (PDT) From: Jia-Ju Bai To: davem@davemloft.net, frankt@promise.com, andre@linux-ide.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 2/2] ide: pdc202xx_new: Replace mdelay with msleep in init_chipset_pdcnew Date: Wed, 11 Apr 2018 15:52:56 +0800 Message-Id: <1523433176-3954-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org init_chipset_pdcnew() is never called in atomic context. This function is only set as ".init_chipset" in struct ide_port_info. Despite never getting called from atomic context, init_chipset_pdcnew() 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/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..a654491 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c @@ -403,7 +403,7 @@ static int init_chipset_pdcnew(struct pci_dev *dev) outb(pll_ctl1, sec_dma_base + 0x03); /* Wait the PLL circuit to be stable */ - mdelay(30); + msleep(30); #ifdef DEBUG /* -- 1.9.1