From patchwork Tue Jan 9 01:40:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10150845 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2A2760223 for ; Tue, 9 Jan 2018 01:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C92F5289C0 for ; Tue, 9 Jan 2018 01:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDB4D289CB; Tue, 9 Jan 2018 01:36:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ADBA289C0 for ; Tue, 9 Jan 2018 01:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756493AbeAIBga (ORCPT ); Mon, 8 Jan 2018 20:36:30 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:46273 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756364AbeAIBg1 (ORCPT ); Mon, 8 Jan 2018 20:36:27 -0500 Received: by mail-pg0-f67.google.com with SMTP id r2so6867237pgq.13; Mon, 08 Jan 2018 17:36:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ITRRsL46ZqZbuL+hizmJ9HMwBupXBDxi2363ppnDMXs=; b=f4XOrEhPtBojS/g/F+EoXfswSF4s0IxGVpllvzZRBsJWoLvwHcxxzF+sPwdArx/9Ku +S+NNxEXcOA9vdfm8WRSP2rEybPQCK6tJXwfxzYmpf/8nk1j571ag4/mDpI07Y2WjBcw L49sNV0Bkiw+o/XJw3dznDE2RZqFD7cM46VrtmxXNy4/IH5HFTVkj3mv6yhppbdOk8w2 LNAOogv+2O+TsBre1OWLLwvlYvYvnhYgIjJoFMRy22UCRyvDZ9Se8nt4WL/4KVzH7For tiGumU4bfOhn8XFpJlLEUTEoZNRUQ17EImL7thEqRfejBOhoOclSij67t9Ut7RmtRWqy ZImA== 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=ITRRsL46ZqZbuL+hizmJ9HMwBupXBDxi2363ppnDMXs=; b=RF5ei6/RVxVHDH93vN49DqkRO3knLzOUBGtWoVa3MpR4xnZFlFK8lowOMNNc4YzhXv mt5VRm/ITk176lduJeBT8seoFTW7ZRJYvt0Co3o+NbHJFDy+hSwonEURd1OgNW/r/OjB svH7tUvQyMAbJkAFlAyFvOkHZzWp2yqeDErjXtMxAzT5wJzH1rgxROH6tjr3rnewlPZA 1VyD6/ttBO5CmACbO+JpJUSIZYQNclW13VS1k5IBfavoSvmORSQ5veqdo2SHwjAD1pfu EtUOV8TJseU95V7ZoCdpaRi3E4DdQA/JLMFYAWCOjAB5rqDc/TvM8tiW8FJ4/3uR4Bi0 06Tg== X-Gm-Message-State: AKGB3mKbjz3X1tK8wUCuJI2KTg8KMK66G0le4WOMS+5iu/iuQAdr9PVj t0pFKEGnxtPMMKgFZE1nnxI= X-Google-Smtp-Source: ACJfBovzEIs+vTNDGd7l46qJDAyuAWQzd7Qk92o7/VEuWqNAB5M/fZiebqBH38e20qFsfJVzYilT+Q== X-Received: by 10.98.36.69 with SMTP id r66mr12057200pfj.96.1515461786192; Mon, 08 Jan 2018 17:36:26 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:507c:66bc:7da5:8371]) by smtp.gmail.com with ESMTPSA id q74sm27704299pfd.134.2018.01.08.17.36.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 17:36:25 -0800 (PST) From: Jia-Ju Bai To: Larry.Finger@lwfinger.net, kvalo@codeaurora.org, kstewart@linuxfoundation.org, johannes.berg@intel.com, tiwai@suse.de, gregkh@linuxfoundation.org, colin.king@canonical.com, andrew.zaborowski@intel.com Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, Jia-Ju Bai Subject: [PATCH v2] b43: Replace mdelay with usleep_range in b43_radio_2057_init_post Date: Tue, 9 Jan 2018 09:40:06 +0800 Message-Id: <1515462006-6144-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP b43_radio_2057_init_post is not called in an interrupt handler nor holding a spinlock. The function mdelay in it can be replaced with usleep_range, to reduce busy wait. Signed-off-by: Jia-Ju Bai Acked-by: Larry Finger --- v2: * Replace mdelay with usleep_range, instead of msleep in v1. Thank Larry for good advice. --- drivers/net/wireless/broadcom/b43/phy_n.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c index a5557d7..f2a2f41 100644 --- a/drivers/net/wireless/broadcom/b43/phy_n.c +++ b/drivers/net/wireless/broadcom/b43/phy_n.c @@ -1031,7 +1031,7 @@ static void b43_radio_2057_init_post(struct b43_wldev *dev) b43_radio_set(dev, R2057_RFPLL_MISC_CAL_RESETN, 0x78); b43_radio_set(dev, R2057_XTAL_CONFIG2, 0x80); - mdelay(2); + usleep_range(2000, 3000); b43_radio_mask(dev, R2057_RFPLL_MISC_CAL_RESETN, ~0x78); b43_radio_mask(dev, R2057_XTAL_CONFIG2, ~0x80);