linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: yhchuang@realtek.com, kvalo@codeaurora.org
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	"David S. Miller" <davem@davemloft.net>,
	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	[thread overview]
Message-ID: <20200423073007.3566-1-kai.heng.feng@canonical.com> (raw)
In-Reply-To: <20200423063811.2636-2-kai.heng.feng@canonical.com>

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 <kai.heng.feng@canonical.com>
---
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");
-- 
2.17.1


  parent reply	other threads:[~2020-04-23  7:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23  6:38 [PATCH 1/2] iopoll: Introduce read_poll_timeout_atomic macro Kai-Heng Feng
2020-04-23  6:38 ` [PATCH 2/2] rtw88: Use udelay instead of usleep in atomic context Kai-Heng Feng
2020-04-23  6:49   ` Kalle Valo
2020-04-23  6:53     ` Kai-Heng Feng
2020-04-23  7:01       ` Kalle Valo
2020-04-23  7:30   ` Kai-Heng Feng [this message]
2020-04-23 16:07     ` [PATCH v2 " Kalle Valo
2020-05-06  8:31     ` Kalle Valo
2020-04-23  6:47 ` [PATCH 1/2] iopoll: Introduce read_poll_timeout_atomic macro Kalle Valo
2020-04-23 10:23   ` Mark Brown
2020-04-23 11:27     ` Kalle Valo
2020-04-23 14:47       ` Mark Brown
2020-04-23 15:13         ` Kalle Valo
2020-04-24 18:49 ` [PATCH v2 " Kai-Heng Feng
2020-05-06  8:30   ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200423073007.3566-1-kai.heng.feng@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yhchuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).