2019-01-22 15:38:27

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 1/2] mt76: fix per-chain signal strength reporting

Fix an off-by-one error that resulted in not reporting the signal strength
for the first chain

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index ce9bb702045f..63fa27d2c404 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -648,7 +648,7 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,

status->chains = BIT(0);
signal = mt76x02_mac_get_rssi(dev, rxwi->rssi[0], 0);
- for (i = 1; i < nstreams; i++) {
+ for (i = 0; i < nstreams; i++) {
status->chains |= BIT(i);
status->chain_signal[i] = mt76x02_mac_get_rssi(dev,
rxwi->rssi[i],
--
2.17.0



2019-01-22 15:38:30

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 2/2] mt76: avoid scheduling tx queues for powersave stations

In case a tx queue wake call arrives after a client has transitioned to
powersave, make sure that the queue is not kept active until the client
has left powersave mode

Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/mediatek/mt76/tx.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 1ea08ce62713..ef38e8626da9 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -396,6 +396,11 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
bool probe;
int idx;

+ if (test_bit(MT_WCID_FLAG_PS, &wcid->flags)) {
+ *empty = true;
+ return 0;
+ }
+
skb = mt76_txq_dequeue(dev, mtxq, false);
if (!skb) {
*empty = true;
--
2.17.0


2019-01-23 10:20:28

by Stanislaw Gruszka

[permalink] [raw]
Subject: Re: [PATCH 1/2] mt76: fix per-chain signal strength reporting

On Tue, Jan 22, 2019 at 04:38:22PM +0100, Felix Fietkau wrote:
> Fix an off-by-one error that resulted in not reporting the signal strength
> for the first chain
>
> Signed-off-by: Felix Fietkau <[email protected]>

Not sure how serious this bug is, but I think patch should be marked:

Fixes: d9f8934ed147 ("mt76: move mt76x02_mac_process_rx in mt76x02-lib module")
Cc: [email protected] # 4.20+

Thanks
Stanislaw

> ---
> drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
> index ce9bb702045f..63fa27d2c404 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
> @@ -648,7 +648,7 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
>
> status->chains = BIT(0);
> signal = mt76x02_mac_get_rssi(dev, rxwi->rssi[0], 0);
> - for (i = 1; i < nstreams; i++) {
> + for (i = 0; i < nstreams; i++) {
> status->chains |= BIT(i);
> status->chain_signal[i] = mt76x02_mac_get_rssi(dev,
> rxwi->rssi[i],
> --
> 2.17.0
>

2019-01-23 12:11:13

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCH 1/2] mt76: fix per-chain signal strength reporting

>
> Fix an off-by-one error that resulted in not reporting the signal strength
> for the first chain
>
> Signed-off-by: Felix Fietkau <[email protected]>
> ---
> drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
> index ce9bb702045f..63fa27d2c404 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
> @@ -648,7 +648,7 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
>
> status->chains = BIT(0);
> signal = mt76x02_mac_get_rssi(dev, rxwi->rssi[0], 0);

Here I guess we can do:

signal = status->chain_signal[0] = mt76x02_mac_get_rssi(dev, rxwi->rssi[0], 0);

and avoid duplicated operations.

Regards,
Lorenzo

> - for (i = 1; i < nstreams; i++) {
> + for (i = 0; i < nstreams; i++) {
> status->chains |= BIT(i);
> status->chain_signal[i] = mt76x02_mac_get_rssi(dev,
> rxwi->rssi[i],
> --
> 2.17.0
>


--
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp;
umount; make clean; sleep