netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: elder@linaro.org
Cc: kuba@kernel.org, evgreen@chromium.org, subashab@codeaurora.org,
	cpratapa@codeaurora.org, bjorn.andersson@linaro.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/5] net: ipa: use atomic exchange for suspend reference
Date: Tue, 08 Sep 2020 20:27:31 -0700 (PDT)	[thread overview]
Message-ID: <20200908.202731.923992684489468023.davem@davemloft.net> (raw)
In-Reply-To: <20200909002127.21089-2-elder@linaro.org>

From: Alex Elder <elder@linaro.org>
Date: Tue,  8 Sep 2020 19:21:23 -0500

> We take a single IPA clock reference to keep the clock running
> until we get a system suspend operation.  When a system suspend
> request arrives, we drop that reference, and if that's the last
> reference (likely) we'll proceed with suspending endpoints and
> disabling the IPA core clock and interconnects.
> 
> In most places we simply set the reference count to 0 or 1
> atomically.  Instead--primarily to catch coding errors--use an
> atomic exchange to update the reference count value, and report
> an error in the event the previous value was unexpected.
> 
> In a few cases it's not hard to see that the error message should
> never be reported.  Report them anyway, but add some excitement
> to the message by ending it with an exclamation point.
> 
> Signed-off-by: Alex Elder <elder@linaro.org>

Please use refcount_t if you're wanting to validate things like
this.

Thank you.

  reply	other threads:[~2020-09-09  3:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09  0:21 [PATCH net-next 0/5] net: ipa: wake up system on RX available Alex Elder
2020-09-09  0:21 ` [PATCH net-next 1/5] net: ipa: use atomic exchange for suspend reference Alex Elder
2020-09-09  3:27   ` David Miller [this message]
2020-09-09 13:43     ` Alex Elder
2020-09-09 21:14       ` David Miller
2020-09-09 21:23         ` Alex Elder
2020-09-09  0:21 ` [PATCH net-next 2/5] net: ipa: manage endpoints separate from clock Alex Elder
2020-09-09  0:21 ` [PATCH net-next 3/5] net: ipa: use device_init_wakeup() Alex Elder
2020-09-09  0:21 ` [PATCH net-next 4/5] net: ipa: enable wakeup on IPA interrupt Alex Elder
2020-09-09  0:21 ` [PATCH net-next 5/5] net: ipa: do not enable GSI interrupt for wakeup Alex Elder

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=20200908.202731.923992684489468023.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=elder@linaro.org \
    --cc=evgreen@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    /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).