Skip to content

Commit a833f3d

Browse files
Arend Van SprielKalle Valo
authored andcommitted
brcmfmac: use atomic_t for statistic counter in struct brcmf_bus
The statistic counter is used in common layer and in the bus layer in different thread contexts so change to use atomic operations. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent ca2e99b commit a833f3d

File tree

2 files changed

+2
-2
lines changed
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

2 files changed

+2
-2
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct brcmf_bus {
138138
struct brcmf_pub *drvr;
139139
enum brcmf_bus_state state;
140140
uint maxctl;
141-
unsigned long tx_realloc;
141+
atomic_t tx_realloc;
142142
u32 chip;
143143
u32 chiprev;
144144
bool always_use_fws_queue;

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ static int brcmf_sdio_txpkt_hdalign(struct brcmf_sdio *bus, struct sk_buff *pkt)
20462046
head_pad = ((unsigned long)dat_buf % bus->head_align);
20472047
if (head_pad) {
20482048
if (skb_headroom(pkt) < head_pad) {
2049-
bus->sdiodev->bus_if->tx_realloc++;
2049+
atomic_inc(&bus->sdiodev->bus_if->tx_realloc);
20502050
head_pad = 0;
20512051
if (skb_cow(pkt, head_pad))
20522052
return -ENOMEM;

0 commit comments

Comments
 (0)