From patchwork Thu Apr 23 07:30:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 11505147 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE09513B2 for ; Thu, 23 Apr 2020 07:30:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0C632076C for ; Thu, 23 Apr 2020 07:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbgDWHa1 (ORCPT ); Thu, 23 Apr 2020 03:30:27 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55812 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbgDWHa1 (ORCPT ); Thu, 23 Apr 2020 03:30:27 -0400 Received: from 61-220-137-37.hinet-ip.hinet.net ([61.220.137.37] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jRWJP-0007Ua-IC; Thu, 23 Apr 2020 07:30:20 +0000 From: Kai-Heng Feng To: yhchuang@realtek.com, kvalo@codeaurora.org Cc: Kai-Heng Feng , "David S. Miller" , linux-wireless@vger.kernel.org (open list:REALTEK WIRELESS DRIVER (rtw88)), netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/2] rtw88: Use udelay instead of usleep in atomic context Date: Thu, 23 Apr 2020 15:30:07 +0800 Message-Id: <20200423073007.3566-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200423063811.2636-2-kai.heng.feng@canonical.com> References: <20200423063811.2636-2-kai.heng.feng@canonical.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org It's incorrect to use usleep in atomic context. Switch to a macro which uses udelay instead of usleep to prevent the issue. Fixes: 6343a6d4b213 ("rtw88: Add delay on polling h2c command status bit") Signed-off-by: Kai-Heng Feng --- v2: - Add Fixes tag. drivers/net/wireless/realtek/rtw88/fw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index 245da96dfddc..8f998b4a7234 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -228,9 +228,9 @@ static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev, goto out; } - ret = read_poll_timeout(rtw_read8, box_state, - !((box_state >> box) & 0x1), 100, 3000, false, - rtwdev, REG_HMETFR); + ret = read_poll_timeout_atomic(rtw_read8, box_state, + !((box_state >> box) & 0x1), 100, 3000, + false, rtwdev, REG_HMETFR); if (ret) { rtw_err(rtwdev, "failed to send h2c command\n");