linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "lukas@wunner.de" <lukas@wunner.de>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Cc: "agk@redhat.com" <agk@redhat.com>,
	"phil@raspberrypi.org" <phil@raspberrypi.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"m.duckeck@kunbus.de" <m.duckeck@kunbus.de>,
	"snitzer@redhat.com" <snitzer@redhat.com>
Subject: Re: [PATCH 1/4] bitops: Introduce assign_bit()
Date: Wed, 23 Aug 2017 17:09:48 +0000	[thread overview]
Message-ID: <1503508187.2484.9.camel@wdc.com> (raw)
In-Reply-To: <CACRpkdaa7JXhjgGxG=eMZxh2kfC3MJ4O_Sc5h5qZsmL5sWNVmg@mail.gmail.com>

On Wed, 2017-08-23 at 09:32 +0200, Linus Walleij wrote:
> Can someone explain when I use the bitop_foo() and when I
> use the __bitop_foo(). I am asking so I can understand patch
> 2/4 in this series.

That's easy. From Documentation/core-api/atomic_ops.rst:

----------------------------------------------------------------------
Finally, there are non-atomic versions of the bitmask operations
provided.  They are used in contexts where some other higher-level SMP
locking scheme is being used to protect the bitmask, and thus less
expensive non-atomic operations may be used in the implementation.
They have names similar to the above bitmask operation interfaces,
except that two underscores are prefixed to the interface name. ::

	void __set_bit(unsigned long nr, volatile unsigned long *addr);
	void __clear_bit(unsigned long nr, volatile unsigned long *addr);
	void __change_bit(unsigned long nr, volatile unsigned long *addr);
	int __test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
	int __test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
	int __test_and_change_bit(unsigned long nr, volatile unsigned long *addr);

These non-atomic variants also do not require any special memory
barrier semantics.
----------------------------------------------------------------------

Bart.

  reply	other threads:[~2017-08-23 17:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 13:12 [PATCH 0/4] GPIO driver for Maxim MAX3191x Lukas Wunner
2017-08-21 13:12 ` [PATCH 3/4] dt-bindings: gpio: max3191x: Document new driver Lukas Wunner
2017-08-23  0:48   ` Rob Herring
2017-08-23  9:44     ` Lukas Wunner
     [not found]       ` <20170823094438.GA12416-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-08-23 13:03         ` Rob Herring
2017-09-05  8:16     ` Lukas Wunner
2017-10-04 19:31       ` Lukas Wunner
2017-08-21 13:12 ` [PATCH 1/4] bitops: Introduce assign_bit() Lukas Wunner
2017-08-21 16:18   ` Bart Van Assche
2017-08-22  8:30     ` Lukas Wunner
2017-08-22  9:27       ` Peter Zijlstra
2017-08-22 10:04         ` Lukas Wunner
2017-08-23  7:32   ` Linus Walleij
2017-08-23 17:09     ` Bart Van Assche [this message]
2017-08-24 19:52       ` Linus Walleij
2017-08-21 13:12 ` [PATCH 4/4] gpio: Add driver for Maxim MAX3191x industrial serializer Lukas Wunner
     [not found]   ` <df530ae703fcfdf52d27a1b6d19b6d1a4724b103.1503319573.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-08-23  8:09     ` Linus Walleij
2017-08-21 13:12 ` [PATCH 2/4] gpio: Introduce ->get_multiple callback Lukas Wunner
2017-08-23  7:38   ` Linus Walleij
2017-08-27 17:34     ` Lukas Wunner
2017-08-31 13:48       ` Linus Walleij
2017-08-31 15:46         ` Lukas Wunner
2017-09-03 14:58           ` Linus Walleij
2017-10-04 20:32   ` Lukas Wunner
2017-10-07 11:23     ` Linus Walleij
2017-10-12 11:15       ` Lukas Wunner

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=1503508187.2484.9.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=agk@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=m.duckeck@kunbus.de \
    --cc=phil@raspberrypi.org \
    --cc=snitzer@redhat.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).