linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Hante Meuleman <meuleman@broadcom.com>
Subject: Re: [PATCH 10/14] brcmfmac: Use atomic functions for intstatus update.
Date: Wed, 26 Feb 2014 13:20:44 +0100	[thread overview]
Message-ID: <530DDC1C.9070803@broadcom.com> (raw)
In-Reply-To: <CAGVrzcaNp6j4pN5d7LaWaFi0xexbvDzgwt-csEUw3tBfUwpXZQ@mail.gmail.com>

On 02/26/2014 12:38 AM, Florian Fainelli wrote:
> Hi Arend,
> 
> 2014-02-25 11:30 GMT-08:00 Arend van Spriel <arend@broadcom.com>:
>> From: Hante Meuleman <meuleman@broadcom.com>
>>
>> The intstatus in sdio code can be updated from different
>> threads. To protect intstatus access, atomic functions are
>> used. One of them is set_bit, but this function is not
>> guaranteed atomic on all platforms. The loop was replaced
>> with local created OR function.
>>
>> Reviewed-by: Arend Van Spriel <arend@broadcom.com>
>> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
>> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
>> Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
>> Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>> ---
>>  drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c |   29 ++++++++++----------
>>  1 file changed, 15 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
>> index ac61419..90ff406 100644
>> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
>> @@ -2444,12 +2444,21 @@ 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);
>> +}
> 
> Is not atomic_set_mask() doing the same thing?

You are right. Hante thought that one was not supported on all archs,
but asm-generic provides a fallback for those. I will revise this patch.

Thanks,
Arend


  reply	other threads:[~2014-02-26 12:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 19:30 [PATCH 00/14] brcmfmac: driver cleanup and rework Arend van Spriel
2014-02-25 19:30 ` [PATCH 01/14] brcmfmac: add delay before unregistering the network device Arend van Spriel
2014-02-25 19:59   ` Johannes Berg
2014-02-26  9:07     ` Arend van Spriel
2014-02-26  9:17       ` Johannes Berg
2014-02-26  9:28         ` Arend van Spriel
2014-02-26  9:37           ` Johannes Berg
2014-02-26 10:43             ` Arend van Spriel
2014-02-26 11:10               ` Johannes Berg
2014-02-26 11:34                 ` Arend van Spriel
2014-02-26 11:48                   ` Johannes Berg
2014-02-26 12:18                     ` Arend van Spriel
2014-02-26 12:22                       ` Johannes Berg
2014-02-26 12:35                         ` Arend van Spriel
2014-02-25 19:30 ` [PATCH 02/14] brcmfmac: Make firmeware roaming a module param Arend van Spriel
2014-02-25 19:30 ` [PATCH 03/14] brcmfmac: fix use of skb control buffer in SDIO driver part Arend van Spriel
2014-02-25 19:30 ` [PATCH 04/14] brcmfmac: remove unused variable data_len from brcmf_sdio_bus_txdata() Arend van Spriel
2014-02-25 19:30 ` [PATCH 05/14] brcmfmac: Correct header debug dump for sdio tx hdrs Arend van Spriel
2014-02-25 19:30 ` [PATCH 06/14] brcmfmac: de-init driver layers in correct order Arend van Spriel
2014-02-25 19:30 ` [PATCH 07/14] brcmfmac: Minimize SDIO dpc scheduling Arend van Spriel
2014-02-25 19:30 ` [PATCH 08/14] brcmfmac: Remove immediate sleep support from SDIO Arend van Spriel
2014-02-25 19:30 ` [PATCH 09/14] brcmfmac: Small cleanup of redundant code Arend van Spriel
2014-02-25 19:30 ` [PATCH 10/14] brcmfmac: Use atomic functions for intstatus update Arend van Spriel
2014-02-25 23:38   ` Florian Fainelli
2014-02-26 12:20     ` Arend van Spriel [this message]
2014-02-25 19:30 ` [PATCH 11/14] brcmfmac: Put frame sdio tx error handling in sub function Arend van Spriel
2014-02-25 19:30 ` [PATCH 12/14] brcmfmac: Correct mcs index report Arend van Spriel
2014-02-25 19:30 ` [PATCH 13/14] brcmfmac: use pre-allocated scatter-gather table for txglomming Arend van Spriel
2014-02-25 19:30 ` [PATCH 14/14] brcmfmac: reset suspend flag upon sdio suspend failure Arend van Spriel

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=530DDC1C.9070803@broadcom.com \
    --to=arend@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=meuleman@broadcom.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).