From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>,
fengping yu <fengping.yu@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Olof Johansson <olof@lixom.net>,
Aisheng Dong <aisheng.dong@nxp.com>,
Anson Huang <Anson.Huang@nxp.com>,
Maxime Ripard <mripard@kernel.org>,
Leonard Crestez <leonard.crestez@nxp.com>,
Dinh Nguyen <dinguyen@kernel.org>,
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>,
Valentin Schneider <valentin.schneider@arm.com>,
Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
Thierry Reding <treding@nvidia.com>,
YueHaibing <yuehaibing@huawei.com>,
Stefan Agner <stefan@agner.cn>, Jacky Bai <ping.bai@nxp.com>,
Marco Felsch <m.felsch@pengutronix.de>,
devicetree@vger.kernel.org, wsd_upstream@mediatek.com,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-input@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 2/2] drivers: input: keyboard
Date: Thu, 9 Jan 2020 17:20:13 -0800 [thread overview]
Message-ID: <20200110012013.GR8314@dtor-ws> (raw)
In-Reply-To: <20200108112609.GN32742@smile.fi.intel.com>
On Wed, Jan 08, 2020 at 01:26:09PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 08, 2020 at 04:46:02PM +0800, Yingjoe Chen wrote:
> > On Wed, 2020-01-08 at 14:29 +0800, fengping yu wrote:
>
> > > + tasklet_init(&keypad->tasklet, kpd_keymap_handler,
> > > + (unsigned long)keypad);
> > > +
> > > + writew((u16)(keypad->key_debounce & KPD_DEBOUNCE_MASK),
> > > + keypad->base + KP_DEBOUNCE);
> >
> > You use a 13 bits mask and set it directly to KP_DEBOUNCE register. Are
> > you sure the debounce unit is ms?
> >
> > > +
> > > + /* register IRQ */
> > > + err = request_irq(keypad->irqnr, kpd_irq_handler, IRQF_TRIGGER_NONE,
> > > + KPD_NAME, keypad);
> >
> > please consider using devm_request_irq, otherwise you have to free it in
> > _remove function.
>
> No, you may not use devm_*_irq() when tasklets are in use. There is a nasty
> race condition.
>
> Actually the rule of thumb is to NOT use devm_*_irq() unless you exactly know
> what you are doing.
>
> P.S. Why simple not to switch to threaded IRQ handler and drop tasklet? In such
> case devm_*_irq() is fine.
Actually, we are simply reading iomem data and forward it to input
subsystem, there is no need to use threaded interrupt nor the tasklet.
Thanks.
--
Dmitry
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>, Jacky Bai <ping.bai@nxp.com>,
wsd_upstream@mediatek.com, Stefan Agner <stefan@agner.cn>,
Catalin Marinas <catalin.marinas@arm.com>,
Marco Felsch <m.felsch@pengutronix.de>,
Leonard Crestez <leonard.crestez@nxp.com>,
Will Deacon <will@kernel.org>, Anson Huang <Anson.Huang@nxp.com>,
YueHaibing <yuehaibing@huawei.com>,
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>,
linux-input@vger.kernel.org,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
Thierry Reding <treding@nvidia.com>,
Valentin Schneider <valentin.schneider@arm.com>,
devicetree@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Maxime Ripard <mripard@kernel.org>,
Mark Brown <broonie@kernel.org>,
linux-mediatek@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Aisheng Dong <aisheng.dong@nxp.com>,
linux-kernel@vger.kernel.org, Dinh Nguyen <dinguyen@kernel.org>,
Rob Herring <robh+dt@kernel.org>, Olof Johansson <olof@lixom.net>,
fengping yu <fengping.yu@mediatek.com>,
Shawn Guo <shawnguo@kernel.org>
Subject: Re: [PATCH V2 2/2] drivers: input: keyboard
Date: Thu, 9 Jan 2020 17:20:13 -0800 [thread overview]
Message-ID: <20200110012013.GR8314@dtor-ws> (raw)
In-Reply-To: <20200108112609.GN32742@smile.fi.intel.com>
On Wed, Jan 08, 2020 at 01:26:09PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 08, 2020 at 04:46:02PM +0800, Yingjoe Chen wrote:
> > On Wed, 2020-01-08 at 14:29 +0800, fengping yu wrote:
>
> > > + tasklet_init(&keypad->tasklet, kpd_keymap_handler,
> > > + (unsigned long)keypad);
> > > +
> > > + writew((u16)(keypad->key_debounce & KPD_DEBOUNCE_MASK),
> > > + keypad->base + KP_DEBOUNCE);
> >
> > You use a 13 bits mask and set it directly to KP_DEBOUNCE register. Are
> > you sure the debounce unit is ms?
> >
> > > +
> > > + /* register IRQ */
> > > + err = request_irq(keypad->irqnr, kpd_irq_handler, IRQF_TRIGGER_NONE,
> > > + KPD_NAME, keypad);
> >
> > please consider using devm_request_irq, otherwise you have to free it in
> > _remove function.
>
> No, you may not use devm_*_irq() when tasklets are in use. There is a nasty
> race condition.
>
> Actually the rule of thumb is to NOT use devm_*_irq() unless you exactly know
> what you are doing.
>
> P.S. Why simple not to switch to threaded IRQ handler and drop tasklet? In such
> case devm_*_irq() is fine.
Actually, we are simply reading iomem data and forward it to input
subsystem, there is no need to use threaded interrupt nor the tasklet.
Thanks.
--
Dmitry
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>, Jacky Bai <ping.bai@nxp.com>,
wsd_upstream@mediatek.com, Stefan Agner <stefan@agner.cn>,
Catalin Marinas <catalin.marinas@arm.com>,
Marco Felsch <m.felsch@pengutronix.de>,
Leonard Crestez <leonard.crestez@nxp.com>,
Will Deacon <will@kernel.org>, Anson Huang <Anson.Huang@nxp.com>,
YueHaibing <yuehaibing@huawei.com>,
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>,
linux-input@vger.kernel.org,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
Thierry Reding <treding@nvidia.com>,
Valentin Schneider <valentin.schneider@arm.com>,
devicetree@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Maxime Ripard <mripard@kernel.org>,
Mark Brown <broonie@kernel.org>,
linux-mediatek@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Aisheng Dong <aisheng.dong@nxp.com>,
linux-kernel@vger.kernel.org, Dinh Nguyen <dinguyen@kernel.org>,
Rob Herring <robh+dt@kernel.org>, Olof Johansson <olof@lixom.net>,
fengping yu <fengping.yu@mediatek.com>,
Shawn Guo <shawnguo@kernel.org>
Subject: Re: [PATCH V2 2/2] drivers: input: keyboard
Date: Thu, 9 Jan 2020 17:20:13 -0800 [thread overview]
Message-ID: <20200110012013.GR8314@dtor-ws> (raw)
In-Reply-To: <20200108112609.GN32742@smile.fi.intel.com>
On Wed, Jan 08, 2020 at 01:26:09PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 08, 2020 at 04:46:02PM +0800, Yingjoe Chen wrote:
> > On Wed, 2020-01-08 at 14:29 +0800, fengping yu wrote:
>
> > > + tasklet_init(&keypad->tasklet, kpd_keymap_handler,
> > > + (unsigned long)keypad);
> > > +
> > > + writew((u16)(keypad->key_debounce & KPD_DEBOUNCE_MASK),
> > > + keypad->base + KP_DEBOUNCE);
> >
> > You use a 13 bits mask and set it directly to KP_DEBOUNCE register. Are
> > you sure the debounce unit is ms?
> >
> > > +
> > > + /* register IRQ */
> > > + err = request_irq(keypad->irqnr, kpd_irq_handler, IRQF_TRIGGER_NONE,
> > > + KPD_NAME, keypad);
> >
> > please consider using devm_request_irq, otherwise you have to free it in
> > _remove function.
>
> No, you may not use devm_*_irq() when tasklets are in use. There is a nasty
> race condition.
>
> Actually the rule of thumb is to NOT use devm_*_irq() unless you exactly know
> what you are doing.
>
> P.S. Why simple not to switch to threaded IRQ handler and drop tasklet? In such
> case devm_*_irq() is fine.
Actually, we are simply reading iomem data and forward it to input
subsystem, there is no need to use threaded interrupt nor the tasklet.
Thanks.
--
Dmitry
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-01-10 1:20 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 6:29 Resend [PATCH V2] dt-bindings:input:keyboard:add MediaTek keypad controller binding fengping yu
2020-01-08 6:29 ` fengping yu
2020-01-08 6:29 ` fengping yu
2020-01-08 6:29 ` [PATCH V2 1/2] Documentation: devicetree: bindings: input fengping yu
2020-01-08 6:29 ` fengping yu
2020-01-10 1:16 ` Dmitry Torokhov
2020-01-10 1:16 ` Dmitry Torokhov
2020-01-10 1:16 ` Dmitry Torokhov
2020-01-08 6:29 ` [PATCH V2 2/2] drivers: input: keyboard fengping yu
2020-01-08 6:29 ` fengping yu
2020-01-08 7:11 ` Marco Felsch
2020-01-08 7:11 ` Marco Felsch
2020-01-08 7:11 ` Marco Felsch
2020-01-08 7:23 ` Marco Felsch
2020-01-08 7:23 ` Marco Felsch
2020-01-08 7:23 ` Marco Felsch
2020-01-08 8:46 ` Yingjoe Chen
2020-01-08 8:46 ` Yingjoe Chen
2020-01-08 11:26 ` Andy Shevchenko
2020-01-08 11:26 ` Andy Shevchenko
2020-01-08 11:26 ` Andy Shevchenko
2020-01-10 1:20 ` Dmitry Torokhov [this message]
2020-01-10 1:20 ` Dmitry Torokhov
2020-01-10 1:20 ` Dmitry Torokhov
2020-01-08 11:22 ` Andy Shevchenko
2020-01-08 11:22 ` Andy Shevchenko
2020-01-08 11:22 ` Andy Shevchenko
2020-01-10 1:32 ` Dmitry Torokhov
2020-01-10 1:32 ` Dmitry Torokhov
2020-01-10 1:32 ` Dmitry Torokhov
2020-01-10 7:35 ` Andy Shevchenko
2020-01-10 7:35 ` Andy Shevchenko
2020-01-10 7:35 ` Andy Shevchenko
2020-01-08 6:38 ` Resend [PATCH V2] dt-bindings:input:keyboard:add MediaTek keypad controller binding Marco Felsch
2020-01-08 6:38 ` Marco Felsch
2020-01-08 6:38 ` Marco Felsch
-- strict thread matches above, loose matches on Subject: below --
2019-12-27 1:37 [PATCH V2] drivers: input: keyboard: add mediatek matrix keypad driver fengping yu
2019-12-27 1:37 ` [PATCH V2 2/2] drivers: input: keyboard fengping yu
2019-12-27 1:34 [patch v2] drivers: input: keyboard: add mediatek matrix keypad drivers fengping.yu
2019-12-27 1:34 ` [PATCH V2 2/2] drivers: input: keyboard fengping.yu
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=20200110012013.GR8314@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=Anson.Huang@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=dinguyen@kernel.org \
--cc=fengping.yu@mediatek.com \
--cc=leonard.crestez@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=m.felsch@pengutronix.de \
--cc=marcin.juszkiewicz@linaro.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=olof@lixom.net \
--cc=ping.bai@nxp.com \
--cc=robh+dt@kernel.org \
--cc=shawnguo@kernel.org \
--cc=stefan@agner.cn \
--cc=treding@nvidia.com \
--cc=valentin.schneider@arm.com \
--cc=will@kernel.org \
--cc=wsd_upstream@mediatek.com \
--cc=yingjoe.chen@mediatek.com \
--cc=yuehaibing@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.