From: Felix Fietkau <nbd@openwrt.org>
To: Oleksij Rempel <linux@rempel-privat.de>,
linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
kvalo@codeaurora.org, adrian@freebsd.org
Subject: Re: [PATCH 16/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain
Date: Fri, 20 Mar 2015 14:00:17 +0100 [thread overview]
Message-ID: <550C19E1.1020305@openwrt.org> (raw)
In-Reply-To: <1426855138-6121-17-git-send-email-linux@rempel-privat.de>
On 2015-03-20 13:38, Oleksij Rempel wrote:
> it is possible to reduce time needed for this function
> by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands
> in same buffer.
>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
> drivers/net/wireless/ath/ath9k/eeprom_4k.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
> index 291c1d1..56621be 100644
> --- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
> +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
> @@ -772,15 +772,16 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
> struct ar5416_eeprom_4k *eep,
> u8 txRxAttenLocal)
> {
> - REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0,
> - pModal->antCtrlChain[0]);
> + ENABLE_REG_RMW_BUFFER(ah);
> + REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0,
> + pModal->antCtrlChain[0], 0);
How about combining the WRITE/RMW buffering in ath9k_htc (automatically
deciding whether to use RMW or WRITE for the whole transaction), instead
of quirky looking REG_WRITE to REG_RMW conversions?
> - REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0),
> - (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) &
> - ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF |
> - AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) |
> - SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) |
> - SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF));
> + REG_RMW(ah, AR_PHY_TIMING_CTRL4(0),
> + (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) &
> + ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF |
> + AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) |
> + SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) |
> + SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), 0);
If you translate it to REG_RMW, you should get rid of the REG_READ part.
- Felix
next prev parent reply other threads:[~2015-03-20 13:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 12:38 [PATCH 00/18] reduce some of ath9k_htc performance problems Oleksij Rempel
2015-03-20 12:38 ` [PATCH 01/18] ath9k_htc: add new WMI_REG_RMW_CMDID command Oleksij Rempel
2015-03-20 12:38 ` [PATCH 02/18] ath9k: ar9271_hw_pa_cal - use defs instead of magin numbers Oleksij Rempel
2015-03-20 12:38 ` [PATCH 03/18] ath9k: ar9271_hw_pa_cal: use proper makroses Oleksij Rempel
2015-03-20 12:38 ` [PATCH 04/18] ath9k: ar9271_hw_pa_cal: use RMW buffer Oleksij Rempel
2015-03-20 12:38 ` [PATCH 05/18] ath9k: add multi_read to be compatible with ath9k_htc Oleksij Rempel
2015-03-20 12:38 ` [PATCH 06/18] ath9k: add new function ath9k_hw_read_array Oleksij Rempel
2015-03-20 12:38 ` [PATCH 07/18] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY Oleksij Rempel
2015-03-20 12:38 ` [PATCH 08/18] ath9k: use one shot read in ath9k_hw_update_mibstats Oleksij Rempel
2015-03-20 12:38 ` [PATCH 09/18] ath9k: ath9k_hw_loadnf: use REG_RMW Oleksij Rempel
2015-03-20 12:38 ` [PATCH 10/18] ath9k: write buffer related optimisation in ar5008_hw_set_channel_regs Oleksij Rempel
2015-03-20 12:38 ` [PATCH 11/18] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer Oleksij Rempel
2015-03-20 12:38 ` [PATCH 12/18] ath9k: use rmw buffer in ath9k_hw_set_operating_mode and ath9k_hw_reset Oleksij Rempel
2015-03-20 12:38 ` [PATCH 13/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-20 12:38 ` [PATCH 14/18] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW Oleksij Rempel
2015-03-20 12:38 ` [PATCH 15/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-20 12:38 ` [PATCH 16/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain Oleksij Rempel
2015-03-20 13:00 ` Felix Fietkau [this message]
2015-03-21 5:25 ` Oleksij Rempel
2015-03-21 8:07 ` [PATCH 16/18 v2] " Oleksij Rempel
2015-03-21 8:43 ` Kalle Valo
2015-03-20 12:38 ` [PATCH 17/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_board_values Oleksij Rempel
2015-03-20 12:38 ` [PATCH 18/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain Oleksij Rempel
2015-03-20 13:01 ` Felix Fietkau
2015-03-21 8:04 ` [PATCH 18/18 v2] " Oleksij Rempel
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=550C19E1.1020305@openwrt.org \
--to=nbd@openwrt.org \
--cc=adrian@freebsd.org \
--cc=ath9k-devel@lists.ath9k.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@rempel-privat.de \
/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).