Received: by 10.192.165.156 with SMTP id m28csp202060imm; Tue, 10 Apr 2018 19:50:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx489NjZIsL/uS3m6rllUPj6GGxWrQQwoiD9OVZYSGObKFsd5QICBR0Qsig4gDDCGZ2vokSKO X-Received: by 10.101.97.1 with SMTP id z1mr2128808pgu.134.1523415039950; Tue, 10 Apr 2018 19:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523415039; cv=none; d=google.com; s=arc-20160816; b=MAuWcM8lgrW6DZHjTDyC012wzh8kGMspa5jXilvYMyVSbABZMRNZYnbxmCWf/LJVsk A5fjcVbFGF00A3zIeJ7XLYx4bupW+73VOy9oAC6RJSQ++uaeL7/d++fSHZyIB4u2qqjf X5yc6Vv6Sihkw3r2SwKnkTzifsUVdQDAZrzoUnawH+oO8hauY1Uv5pfDAFrcRWOybci0 awVZ71vQoWdA+9HoFDguTpx5d2zeDgFG+nWsb0CfiQXDT4g/SIAKfKTcCR6ytbZuSdXZ zQ9wA6BLBFWZaitCUlbTtEAnHciTb7YMBSNDrhMnwM/53Di8bsUoCiZPPTOK3CeTjAic Wzow== 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=eI1puaVXw5+uV+REDEJLLxPZq6wm5iHrNtg21/Mkbb0=; b=pf/GLcsZenZ3uJAf2qNdATzmOhFV3FCsfcNtAuljTmxc6jzscy/dlFtdMaRpBIcLpd Eohw03mkIngEvVvUw7RpZD41QU53onD/axrPqFoAUUF35o9Bef2o58PKCdtXzYczhBGn Ga/uTz0Qd97ajbUv7eS0gk4PiVw8+ZqDiv1HbLOTi3KiIhKZGx4cLup2Em3WecswtxL8 QdU4QliRjzfM1UpQB723xezBaYXIIDuI1oQxUKMUfAMCGfEPWYO0XXjjXlm8R2L73NC0 7XxWC3fJchqgda/ZeDE5E0ObeFDycPOMC+p94MqHmz4xpqMd8YNOvVjN8C8Im9wZkxzZ jHKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bii8fgBw; 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 t14si101582pgc.92.2018.04.10.19.50.03; Tue, 10 Apr 2018 19:50:39 -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=Bii8fgBw; 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 S1752870AbeDKCrI (ORCPT + 99 others); Tue, 10 Apr 2018 22:47:08 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36900 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752458AbeDKCrH (ORCPT ); Tue, 10 Apr 2018 22:47:07 -0400 Received: by mail-pg0-f68.google.com with SMTP id r14so107716pgq.4; Tue, 10 Apr 2018 19:47: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=eI1puaVXw5+uV+REDEJLLxPZq6wm5iHrNtg21/Mkbb0=; b=Bii8fgBwpmaEhyiugXbuuDMQC7uacHP/Qjm8sL4PJ77UEjWCGaR9wzA0Pu1VjnnPkO 5ce5ZSZODRwc+v40byVRrRY2Fr+Ip6sZSB6DxP4RnYReKq8kB3Pk37YrBf9YMmLR473q sn4X0TwqvPrFE1HxvcjbDgVMCOZhWFfAhbnGPyNrZrio/9HTd7aRaL9bYQJS7SdjjF4n kEOZV7gLHsdxF8baXGUwQ3yW4SC1JNH6CanT8y3HXa8awuOkx3liqlR0cbcp1Mc0HUpd cM4BKToWUsTwt2HrDEOaxgHdnbPDKYapPP4hJyXp8YgH/DXUP9LMbNDtFZcvvDuWPV4y gRkg== 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=eI1puaVXw5+uV+REDEJLLxPZq6wm5iHrNtg21/Mkbb0=; b=o2NYK8GUkzQ98h/IITXTygYZLYvYVwxppyjdBBd+LFwYo2cPRHDzY3xur4wjDqW2Pn x7fNgLOERsRkV4CT4bK1a2MCf6S3ggrb3/fyUa4rvVHLHE0ZZPHdnSoXQdt9AYfSjsBm URgTuiidQFyy5S1VrnwD7+aPDW/3K+QdMViopTkGLKriKyBqTvgMUZ569OwbW+qHgxC5 lUUHKwk5EcQljEG0cC6R+7/+q+cRBIIjqy12VcIOelTyfSn3hTA2bbDIJ+eEv335Z1+L AT4RaWQMTuxRjAcF7FH48xd3LM98QLPXsQOe0DyqGsPTj3lwJkKbJxsIEhr4ug9FGvVA rWQw== X-Gm-Message-State: ALQs6tDYIFhB6ZTMtoQWBGL4YP8gydCaQPm5jk1V/n68lq9/YJX5jC5P c20zn5ELiGWpPymNEFFNjrpYaZ5F X-Received: by 10.98.73.214 with SMTP id r83mr2440052pfi.76.1523414827000; Tue, 10 Apr 2018 19:47:07 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id f11sm138920pgq.34.2018.04.10.19.47.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 19:47:06 -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 2/3] mmc: wbsd: Replace mdelay with usleep_range in wbsd_platform_resume Date: Wed, 11 Apr 2018 10:47:01 +0800 Message-Id: <1523414821-2670-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_platform_resume() is never called in atomic context. This function is only set as ".resume" in struct platform_driver. Despite never getting called from atomic context, wbsd_platform_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..17d36c1 100644 --- a/drivers/mmc/host/wbsd.c +++ b/drivers/mmc/host/wbsd.c @@ -1846,7 +1846,7 @@ static int wbsd_platform_resume(struct platform_device *dev) /* * Allow device to initialise itself properly. */ - mdelay(5); + usleep_range(5000, 6000); wbsd_init_device(host); return 0; -- 1.9.1