Received: by 10.213.65.68 with SMTP id h4csp931832imn; Sun, 18 Mar 2018 07:52:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELtI+7hLq8nZwdEXa5M7t4mZNr+R2aUDTPwHdFeSn89QwyMZjJEhl8BolYc3mH7W3W+ZxM6b X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr9227605plc.178.1521384736779; Sun, 18 Mar 2018 07:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521384736; cv=none; d=google.com; s=arc-20160816; b=u/yOlc9PKBu7YSAFUkLfc4F3uGl8jm4+gq/COSwRRUaKOrmjIHhh9o8yqGWUaiaYS3 LyeECOtNmGZRB9jKO8NrXGMibkYkCMmO/DPP0q1OFRhtyFA5rSCu3AJJD31jvjDjy2MJ ISoIrT2bvZOUBQE/RqozvLruSfcjZ06TxBNG8gc7jO1Xh2HwNgwDu0KkyZhbwOhae2Ru tc7gHmLeEcnHXqGwWUhJZYPAJ0httEjNxzftyCLNpeMFOs4HTilIrekMc6O+thSnYGGg cAL752xh2nLgZTOa4+hc/vVQmvM5sEczDYs71Qq78W48mrdXqAVDKx8cCYkETAShvOt4 RROQ== 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=pngEsKLqRlkzaw2V/DVuhn8pOqlqIYltY+6B6XTLIeM=; b=geEQBekb3d2SbJ6SUtPnDC4BvZM2K8wD0/f1nYflfW6noQ/Y+xlvTz1MpWRP6s/uel /O9b0OcnmyTWc/6HC0rAFkqA4U/r09MSw25pdRX0xttF24yWdzQ28vSKK1DTfmoAXn2B QcJhQfJ2y8BYUiXI+LUF7LBCV3iEHbD9IBp4fascjD7/bsP4GK2UuQ6Qs7/G/8sJ9SKo IDP2BZM6cx6ba9KamG5GTZU4lrhWs9++CogWTLmeroOWMhng59xDnJ0vDJttSAEuL9dg gxuibXdxDUQ17ZyhwAx3qkcnBL/bUSihxfgCcQ4+ovmD8jNd216PYA0HbujNAHsiFLN9 1dVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bYAZ8hGT; 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 3-v6si10338622plz.112.2018.03.18.07.52.02; Sun, 18 Mar 2018 07:52:16 -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=bYAZ8hGT; 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 S1754489AbeCROuq (ORCPT + 99 others); Sun, 18 Mar 2018 10:50:46 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35099 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbeCROuo (ORCPT ); Sun, 18 Mar 2018 10:50:44 -0400 Received: by mail-pg0-f66.google.com with SMTP id d1so5925864pgv.2; Sun, 18 Mar 2018 07:50:44 -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=pngEsKLqRlkzaw2V/DVuhn8pOqlqIYltY+6B6XTLIeM=; b=bYAZ8hGTsSCT3RzdzrVu/9ldZG2dTt7r/ouQIAUFAKJ1QGlKSAkedSeyvYQ9DKO3E6 vNzz6wzCcwODqmqFiGZ3ubW7tuc0q4Qrs64S82+FSZmkhCM4L9JJ8cvCAa0ejxLLp251 sWOJdGP0Qmmi8rhOh88uWMCW16q9pQ3s4DTa9S2J7GYD6WUjLRPRhaGpGtd5lRuYQCQG 0GlbdNGUNelWyy+atM1fwAZo1QbWBUonaVUXb/Lz7YytKJod27R9KR+PYhTf7blk3nOm hiqEf0A1bPfVGVS6vSl787Tb0IqjXZin/z63KPwmBPShCHH9aFW3uqboD4XYYQjtNSq5 rjqA== 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=pngEsKLqRlkzaw2V/DVuhn8pOqlqIYltY+6B6XTLIeM=; b=DyIdxf+LVEiZrSfJQgn7xdRChKNVrfHZehWAImbBU3xLArz55tcqhZ1hkvL8KcXHn6 2oY0MSV1ZBq/vTSbJJpWoB9NdqcylYG0R+ziHMeiY/cDbMqz/CHZkZzvExJzAWoy+P4Z WqTqP+sdCELLVFlETgzeYScELo8EbHBQlBeaO5ZEbZ+hccNkN/fT8ZcCHwmTFrl2tpA+ sQ3fBdEmqqqdq2Z50qK3a/e97h1P3bqa44ThOVH4pthXj8wK6W/Ufj/jkcaUxPihz2Ld EkedoCSdCSs7nismIKRXZSrs3frQjIVzZQrTxkPJAsnDtb+KMQ+PRuAGD8dmAoz2Phbe X3Tg== X-Gm-Message-State: AElRT7E/qV6uCoFuaFkwDcii1rvLKMSBuOHIlGzZHU5mg7znC7UaGgRj JHfZZBbjGnGKFFwI4qJgvpM= X-Received: by 10.98.144.205 with SMTP id q74mr3848198pfk.55.1521384644190; Sun, 18 Mar 2018 07:50:44 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:2c7e:2fdc:f812:6df0]) by smtp.gmail.com with ESMTPSA id b18sm23371755pfi.34.2018.03.18.07.50.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Mar 2018 07:50:43 -0700 (PDT) From: Jia-Ju Bai To: george.cherian@cavium.com, herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] crypto: cavium: cpt: Replace mdelay with msleep in cpt_device_init Date: Sun, 18 Mar 2018 22:50:38 +0800 Message-Id: <1521384638-23251-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 cpt_device_init() is never called in atomic context. The call chain ending up at cpt_device_init() is: [1] cpt_device_init() <- cpt_probe() cpt_probe() is only set as ".probe" in pci_driver structure "cpt_pci_driver". Despite never getting called from atomic context, cpt_device_init() calls mdelay(100), i.e. busy wait for 100ms. That 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. Signed-off-by: Jia-Ju Bai --- drivers/crypto/cavium/cpt/cptpf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/cavium/cpt/cptpf_main.c b/drivers/crypto/cavium/cpt/cptpf_main.c index 34a6d8b..06ad85a 100644 --- a/drivers/crypto/cavium/cpt/cptpf_main.c +++ b/drivers/crypto/cavium/cpt/cptpf_main.c @@ -436,7 +436,7 @@ static int cpt_device_init(struct cpt_device *cpt) /* Reset the PF when probed first */ cpt_reset(cpt); - mdelay(100); + msleep(100); /*Check BIST status*/ bist = (u64)cpt_check_bist_status(cpt); -- 1.9.1