linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: linux-wireless@vger.kernel.org
Cc: Helmut Schaa <helmut.schaa@googlemail.com>,
	Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [PATCH 10/11] rt2800: replace msleep() with usleep_range() on channel switch
Date: Mon, 19 Dec 2016 11:52:56 +0100	[thread overview]
Message-ID: <1482144777-16760-11-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1482144777-16760-1-git-send-email-sgruszka@redhat.com>

msleep(1) can sleep much more time then requested 1ms, this is not good
on channel switch, which we want to be performed fast (i.e. to make scan
faster). Replace msleep() with usleep_range(), which has much smaller
maximum sleeping time boundary.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 29d98e4..0220184 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -2110,7 +2110,9 @@ static void rt2800_config_channel_rf3xxx(struct rt2x00_dev *rt2x00dev,
 	rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr);
 	rt2x00_set_field8(&rfcsr, RFCSR30_RF_CALIBRATION, 1);
 	rt2800_rfcsr_write(rt2x00dev, 30, rfcsr);
-	msleep(1);
+
+	usleep_range(1000, 1500);
+
 	rt2x00_set_field8(&rfcsr, RFCSR30_RF_CALIBRATION, 0);
 	rt2800_rfcsr_write(rt2x00dev, 30, rfcsr);
 }
@@ -3442,7 +3444,7 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
 		}
 	}
 
-	msleep(1);
+	usleep_range(1000, 1500);
 
 	/*
 	 * Clear channel statistic counters
-- 
1.7.1

  parent reply	other threads:[~2016-12-19 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 10:52 [PATCH 00/11] rt2800 patches 19.12.2016 Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 01/11] rt2800: make rx ampdu_factor depend on number of rx chains Stanislaw Gruszka
2016-12-30 12:08   ` Kalle Valo
2016-12-19 10:52 ` [PATCH 02/11] rt2800: don't set ht parameters for non-aggregated frames Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 03/11] rt2800: set minimum MPDU and PSDU lengths to sane values Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 04/11] rt2800: set MAX_PSDU len according to remote STAs capabilities Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 05/11] rt2800: rename adjust_freq_offset function Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 06/11] rt2800: warn if doing VCO recalibration for unknow RF chip Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 07/11] rt2800: perform VCO recalibration for RF5592 chip Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 08/11] rt2x00: merge agc and vco works with link tuner Stanislaw Gruszka
2016-12-19 10:52 ` [PATCH 09/11] rt2800: replace mdelay by usleep on vco calibration Stanislaw Gruszka
2016-12-19 10:52 ` Stanislaw Gruszka [this message]
2016-12-19 10:52 ` [PATCH 11/11] rt2x00: add mutex to synchronize config and link tuner Stanislaw Gruszka
2016-12-30 12:04   ` [11/11] " 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=1482144777-16760-11-git-send-email-sgruszka@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).