Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1180526 > unrolled thread
| Started by | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| First post | 2015-07-09 10:20 +0200 |
| Last post | 2015-07-10 11:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/3] brcmfmac: dhd_sdio.c: use existing atomic_or primitive Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2015-07-09 10:20 +0200
Re: [PATCH 2/3] brcmfmac: dhd_sdio.c: use existing atomic_or primitive Arend van Spriel <arend@broadcom.com> - 2015-07-10 11:10 +0200
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Date | 2015-07-09 10:20 +0200 |
| Subject | [PATCH 2/3] brcmfmac: dhd_sdio.c: use existing atomic_or primitive |
| Message-ID | <pKfdL-6cK-1@gated-at.bofh.it> |
There's already a generic implementation so use that instead.
---
I'm not sure if the driver usage of atomic_or?() is correct in terms of
storage size of @val for 64 bit arches.
Assuming LP64 programming model for linux on say x86_64: atomic_or()
callers in this driver use long (sana 64 bit) storage and pass it to
atomic_orr/atomic_or which downcasts it to 32 bits. Is that OK ?
---
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Cc: Daniel Kim <dekim@broadcom.com>
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list@broadcom.com
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: netdev@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
drivers/net/wireless/brcm80211/brcmfmac/sdio.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
index d36f5f3d931b..f990e3d0e696 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
@@ -2564,15 +2564,6 @@ static inline void brcmf_sdio_clrintr(struct brcmf_sdio *bus)
}
}
-static void atomic_orr(int val, atomic_t *v)
-{
- int old_val;
-
- old_val = atomic_read(v);
- while (atomic_cmpxchg(v, old_val, val | old_val) != old_val)
- old_val = atomic_read(v);
-}
-
static int brcmf_sdio_intr_rstatus(struct brcmf_sdio *bus)
{
struct brcmf_core *buscore;
@@ -2595,7 +2586,7 @@ static int brcmf_sdio_intr_rstatus(struct brcmf_sdio *bus)
if (val) {
brcmf_sdiod_regwl(bus->sdiodev, addr, val, &ret);
bus->sdcnt.f1regdata++;
- atomic_orr(val, &bus->intstatus);
+ atomic_or(val, &bus->intstatus);
}
return ret;
@@ -2712,7 +2703,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
/* Keep still-pending events for next scheduling */
if (intstatus)
- atomic_orr(intstatus, &bus->intstatus);
+ atomic_or(intstatus, &bus->intstatus);
brcmf_sdio_clrintr(bus);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Arend van Spriel <arend@broadcom.com> |
|---|---|
| Date | 2015-07-10 11:10 +0200 |
| Message-ID | <pKCtI-417-13@gated-at.bofh.it> |
| In reply to | #1180526 |
On 07/10/2015 06:49 AM, Vineet Gupta wrote: > On Thursday 09 July 2015 11:55 PM, Arend van Spriel wrote: >> On 07/09/2015 10:13 AM, Vineet Gupta wrote: >>>> There's already a generic implementation so use that instead. >> There is or there was? If there is now I am fine with this patch, but if >> it already was there the author might have had a reason for adding a >> local function and I would like to hear that reason. >> > > atomic_orr() was introduced to this driver with > > 2014-03-06 5cbb9c285bdc brcmfmac: Use atomic functions for intstatus update. > > as it seems atomic_set_mask() was not available cross arch. And atomic_or() in > generic code was indeed introduced after that > > 2014-04-23 560cb12a4080 locking,arch: Rewrite generic atomic support > > Hence likely the reason author went with home grown atomic_orr() Hi Vineet Thanks for looking into the timeline. Will look into it and let you know. Regards, Arend > -Vineet > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web