Skip to contentSkip to conversation

brcmsmac: fix shift on 4 bit masked value

PATCH In review Colin King 3 participants 5 messages Mar 18, 2021 – Apr 21, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 brcmsmac: fix shift on 4 bit masked value

From: Colin Ian King <[email protected]>

The calculation of offtune_val seems incorrect, the u16 value in pi->tx_rx_cal_radio_saveregs[2] is being masked with 0xf0 and then shifted 8 places right so that always ends up as a zero result. I believe the intended shift was 4 bits to the right. Fix this.

[Note: not tested, I don't have the H/W]

Addresses-Coverity: ("Operands don't affect result")

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c +1 -1
index 8580a2754789..2c04bae6e21c 100644
@@ -26329,7 +26329,7 @@ static void wlc_phy_rxcal_radio_setup_nphy(struct brcms_phy *pi, u8 rx_core)
 
 					offtune_val =
 						(pi->tx_rx_cal_radio_saveregs
-						 [2] & 0xF0) >> 8;
+						 [2] & 0xF0) >> 4;
 					offtune_val =
 						(offtune_val <= 0x7) ? 0xF : 0;
 
Signature · 1 line
2.30.2
#1 lore raw
Quoted 7 lines · Colin King

From: Colin Ian King <[email protected]>

The calculation of offtune_val seems incorrect, the u16 value in pi->tx_rx_cal_radio_saveregs[2] is being masked with 0xf0 and then shifted 8 places right so that always ends up as a zero result. I believe the intended shift was 4 bits to the right. Fix this.

Quoted 5 lines

[Note: not tested, I don't have the H/W]

Addresses-Coverity: ("Operands don't affect result")

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")

Can someone ack this?

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Colin King
Quoted 7 lines · Colin King

From: Colin Ian King <[email protected]>

The calculation of offtune_val seems incorrect, the u16 value in pi->tx_rx_cal_radio_saveregs[2] is being masked with 0xf0 and then shifted 8 places right so that always ends up as a zero result. I believe the intended shift was 4 bits to the right. Fix this.

Quoted 5 lines

[Note: not tested, I don't have the H/W]

Addresses-Coverity: ("Operands don't affect result")

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")

I think this needs review from someone familiar with the hardware.

Patch set to Changes Requested.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw
Quoted 11 lines · Kalle Valo
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The calculation of offtune_val seems incorrect, the u16 value in pi->tx_rx_cal_radio_saveregs[2] is being masked with 0xf0 and then shifted 8 places right so that always ends up as a zero result. I believe the intended shift was 4 bits to the right. Fix this.

[Note: not tested, I don't have the H/W]

Quoted 7 lines
Quoted 3 lines

Addresses-Coverity: ("Operands don't affect result")

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")

I think this needs review from someone familiar with the hardware.

Patch set to Changes Requested.

What "change" are you requesting here?

Likely there needs to be some other setting for the patch.

Perhaps "deferred" as you seem to be requesting a review and there's no actual change necessary, just approval from someone with the hardware and that someone test the patch.

#4 lore raw
Quoted 16 lines · Joe Perches
Quoted 15 lines · Kalle Valo
Quoted 12 lines · Colin King

From: Colin Ian King <[email protected]>

The calculation of offtune_val seems incorrect, the u16 value in pi->tx_rx_cal_radio_saveregs[2] is being masked with 0xf0 and then shifted 8 places right so that always ends up as a zero result. I believe the intended shift was 4 bits to the right. Fix this.

[Note: not tested, I don't have the H/W]

Addresses-Coverity: ("Operands don't affect result")

Fixes 5b435de0d786 ("net: wireless: add brcm80211 drivers")
Quoted 5 lines
Quoted 3 lines

I think this needs review from someone familiar with the hardware.

Patch set to Changes Requested.

What "change" are you requesting here?

Don't take patchwork states literally, a better name for this state would be "Needs work" or something like that.

Quoted 5 lines

Likely there needs to be some other setting for the patch.

Perhaps "deferred" as you seem to be requesting a review and there's no actual change necessary, just approval from someone with the hardware and that someone test the patch.

I already asked for help on April 7th and nobody replied, so I'm dropping this now. The patch can be resent if/when the change is confirmed to be correct.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches