Received: by 10.192.165.156 with SMTP id m28csp203873imm; Tue, 10 Apr 2018 19:53:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/lAW2T8kv0NDTO3kroacx+VMgHzh/lH8k7mhNrsCmAkd2nKnCmoypfOhMvNoEXgzgLTskU X-Received: by 2002:a17:902:aa90:: with SMTP id d16-v6mr3029307plr.189.1523415192704; Tue, 10 Apr 2018 19:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523415192; cv=none; d=google.com; s=arc-20160816; b=GjMm4jBL8OT6n4NbDV106fqU4/MI1NYeplca+4hFLlUusLkuGdWMS9b2aero17BCPx 42Xj/LYog+r6vYMvjBElJrSy4O87EYMzyusF2HNF8wRgmDTtd16l8zNOZS/mlseLedYX nFJesB257BWeIAdOKd+Tna3m9K7HpE7zTnSoBe78xuR+JlkpzpCq4G3H61txVLDje08R ZaYVjovdH0FLMDNcaY82a0aL/r72Jlj7mgJZmbQshcgQmw154HtgBC1toW9YkfjwqHKH abJhvgnTB5TZv4WGUePYJDTdXCkOZM1yqu6HksM58xr++4kGRwnXT8VbaYVRPk2bYaaF cpsg== 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=RgSTMy7KDncUkvpw3DE/zkjDESROKzdw6Qsotvw8VxU=; b=AXSuAP2L3ewos2FHby/4In3Ahaj376iJYFyjobpq2sfFPpkMGb36ck2ekwYmw2R+5r IkFhocWTpV4gNic39xsE1tkHMEBsV6mg5wllr7vmWKfA/90YcWkoyFbf5zCpkcNpPL+I +r6vgL0jUXwTaidxPigc4d3vI5CeGykJVzrWH1YOKkQE+Pi5+ATENHeJzjBN7hU6p19d mQOoahBi1nAyT87O8I1Qc0RlHB3G1Ic5CW8ZGJOJmC3Qfv9IBs6i8b8kNVSyWCCS8xnA bDy2dXgZpU4SJ0RZ0YWESSO2b9bjPxjSZzS3+lRjh6Za2a3s81LxOTE+pEgiOr1oBT3t eBQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lv0zc4o/; 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 m29si78434pgc.32.2018.04.10.19.52.35; Tue, 10 Apr 2018 19:53:12 -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=Lv0zc4o/; 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 S1752943AbeDKCrY (ORCPT + 99 others); Tue, 10 Apr 2018 22:47:24 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:46404 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752768AbeDKCrX (ORCPT ); Tue, 10 Apr 2018 22:47:23 -0400 Received: by mail-pf0-f195.google.com with SMTP id h69so221747pfe.13; Tue, 10 Apr 2018 19:47:23 -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=RgSTMy7KDncUkvpw3DE/zkjDESROKzdw6Qsotvw8VxU=; b=Lv0zc4o/4oDKGhXJynbI3B1JRoNbULazSds+Nfp7q8hZn7SxRW2z/dg39mcZ9tgjO+ VUIg7fwAecHhfLCq6Oe+2n/wd+j+Zjq1wOZ4zkA+TZa3tdl6kRhuxNgZfXVcIBvwH8qj ezANE8xxuCze5ONCFi+v2AKqRiljZTz1XfEGPCL0+Qvv3M/USN/wyjeeD77LlFrDUqQu auKAtkIxIvq52TaT+XPnm9Ec1u7fc/HXK6jAACLhtdDXRCpLCJThczN71vsQzkDgpX9+ YbjV5hlgp8V178q36Lk9uiQuf1+9+PbIkok/FYCpf+6ArqvRjjTVrCcbjKXKj+Eo0Xoq FAcw== 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=RgSTMy7KDncUkvpw3DE/zkjDESROKzdw6Qsotvw8VxU=; b=TuuCGFBQvyIhyR+6A8nWKDtCq/kCQ/0zxu1TIx/reIeS4atIv3+I0gj+T46KQHZWrP wgYowPQbRy52HDx9zdEq1SckxUTJkBSUJIk/dUJGKOzrM8v+NiQ3oBSzPid8Q/ilNxRD IcvDXNC/XfPR40BZNVh6KOH3q8SV53Sn7rWJQlYyTpOZlXFA6IGPJwFt6papUDKhV/Dq XC9TqwCZ/x4H7VSSt3/QmxJnNqc4HoPkzha7a9v4B94bLwKILFAKZMrQAtGoZBaKCOus vTq1GNwGZWMpuyUnwec6Lpkq8p4xgDcFk8VfAoRXpWqKItXCZyCqn/Y8uhuBG9tTGivV 1qiQ== X-Gm-Message-State: ALQs6tDDZKfoDGwJsPqWMbeAqsa0etwVFX+SEBzpz/DXq/rhkeLvRMrE k2kje9ZM5hNgMPO8sR8GGOA= X-Received: by 10.99.116.67 with SMTP id e3mr2001313pgn.369.1523414842688; Tue, 10 Apr 2018 19:47:22 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id t23sm142317pgu.41.2018.04.10.19.47.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 19:47:22 -0700 (PDT) From: Jia-Ju Bai To: pierre@ossman.eu, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 3/3] mmc: wbsd: Replace mdelay with usleep_range in wbsd_pnp_resume Date: Wed, 11 Apr 2018 10:47:13 +0800 Message-Id: <1523414833-2714-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 wbsd_pnp_resume() is never called in atomic context. This function is only set as ".resume" in struct pnp_driver. Despite never getting called from atomic context, wbsd_pnp_resume() 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/mmc/host/wbsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c index 546aaf8..83e13cf 100644 --- a/drivers/mmc/host/wbsd.c +++ b/drivers/mmc/host/wbsd.c @@ -1890,7 +1890,7 @@ static int wbsd_pnp_resume(struct pnp_dev *pnp_dev) /* * Allow device to initialise itself properly. */ - mdelay(5); + usleep_range(5000, 6000); wbsd_init_device(host); return 0; -- 1.9.1