From: Laxman Dewangan <ldewangan@nvidia.com>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Linus Walleij <linus.walleij@linaro.org>,
Thierry Reding <thierry.reding@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.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@mail.gmail.com>
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@nvidia.com> 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.
prev parent reply other threads:[~2016-04-25 8:52 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
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
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
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@nvidia.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.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