linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mt76x0: do not overwrite other MT_BBP(AGC, 8) fields
Date: Wed, 31 Oct 2018 11:07:18 +0100	[thread overview]
Message-ID: <20181031100718.GC9564@localhost.localdomain> (raw)
In-Reply-To: <1540971178-16407-1-git-send-email-sgruszka@redhat.com>

> MT_BBP(AGC, 8) register has values depend on band in
> mt76x0_bbp_switch_tab, so we should not overwrite other fields
> than MT_BBP_AGC_GAIN when setting gain.
> 
> This can fix performance issues when connecting to 2.4GHz AP.
> 
> Fixes: 4636a2544c3b ("mt76x0: phy: align channel gain logic to mt76x2 one")
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
> index ba98814ae47d..88dd0aa7e877 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
> @@ -690,10 +690,8 @@ static void mt76x0_phy_temp_sensor(struct mt76x02_dev *dev)
>  static void mt76x0_phy_set_gain_val(struct mt76x02_dev *dev)
>  {
>  	u8 gain = dev->cal.agc_gain_cur[0] - dev->cal.agc_gain_adjust;
> -	u32 val = 0x122c << 16 | 0xf2;
>  
> -	mt76_wr(dev, MT_BBP(AGC, 8),
> -		val | FIELD_PREP(MT_BBP_AGC_GAIN, gain));
> +	mt76_rmw_field(dev, MT_BBP(AGC, 8), MT_BBP_AGC_GAIN, gain);
>  
>  	if ((dev->mt76.chandef.chan->flags & IEEE80211_CHAN_RADAR) &&
>  	    !is_mt7630(dev))
> -- 
> 2.7.5
> 

Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

  reply	other threads:[~2018-10-31 10:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31  7:32 [PATCH] mt76x0: do not overwrite other MT_BBP(AGC, 8) fields Stanislaw Gruszka
2018-10-31 10:07 ` Lorenzo Bianconi [this message]
2018-11-01  9:47 ` Felix Fietkau

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=20181031100718.GC9564@localhost.localdomain \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=sgruszka@redhat.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).