linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Alexandre Courbot <gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH V4 4/4] gpio: tegra: Add support for gpio debounce
Date: Mon, 25 Apr 2016 14:10:42 +0530	[thread overview]
Message-ID: <571DD80A.1030409@nvidia.com> (raw)
In-Reply-To: <CAAVeFuJykGNGj95r4P8vatxOA_yjsP1eQkDf9zS-dYV1piHTJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


On Monday 25 April 2016 11:06 AM, Alexandre Courbot wrote:
> Sorry, just realized I commented on v3...
>
> On Fri, Apr 22, 2016 at 7:09 PM, Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>> +       spinlock_t dbc_lock[4]; /* Lock for updating debounce count register */
> I'm nit'ing here, but maybe one spinlock shared by all ports would be
> enough? (the same would apply to lvl_lock, so feel free to do this as
> a separate patch) I don't think we expect *that* many concurrent
> accesses, do we?

Really no, but to make the stuff uniform, it should be fine here. If the 
registers are not conflicting then do not make under same lock.


>>   
>>
>>         spin_lock_irqsave(bank->dbc_lock[port], flags);
>>         if (bank->dbc_cnt[port] < debounce_ms) {
>>                 tegra_gpio_writel(tgi, debounce_ms, GPIO_DBC_CNT(tgi, offset));
>>                 bank->dbc_cnt[port] = debounce_ms;
>>         }
>>         spin_unlock_irqrestore(&bank->dbc_lock[port], flags);
>>
>> Which is nicer to the eyes.
>>


OK, this also looks fine. As I am goign to respin this for V5 (for gc as 
instance rather than pointer), I will take care of it.

      parent reply	other threads:[~2016-04-25  8:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 10:09 [PATCH V4 1/4] gpio: tegra: Don't open code of_device_get_match_data() Laxman Dewangan
2016-04-22 10:09 ` [PATCH V4 2/4] gpio: tegra: Make of_device_id compatible data to constant Laxman Dewangan
2016-04-22 10:09 ` [PATCH V4 3/4] gpio: tegra: Get rid of all file scoped global variables Laxman Dewangan
     [not found]   ` <1461319754-12040-3-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-25  5:13     ` Alexandre Courbot
2016-04-25  8:36       ` Laxman Dewangan
2016-04-25 10:00     ` Thierry Reding
2016-04-25  9:53       ` Laxman Dewangan
     [not found]         ` <571DE912.3060602-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-25 10:11           ` Thierry Reding
2016-04-22 10:09 ` [PATCH V4 4/4] gpio: tegra: Add support for gpio debounce Laxman Dewangan
2016-04-22 19:53   ` Stephen Warren
2016-04-25  5:36   ` Alexandre Courbot
     [not found]     ` <CAAVeFuJykGNGj95r4P8vatxOA_yjsP1eQkDf9zS-dYV1piHTJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-25  8:40       ` Laxman Dewangan [this message]

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=571DD80A.1030409@nvidia.com \
    --to=ldewangan-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).