lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200108112609.GN32742@smile.fi.intel.com>
Date:   Wed, 8 Jan 2020 13:26:09 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Yingjoe Chen <yingjoe.chen@...iatek.com>
Cc:     fengping yu <fengping.yu@...iatek.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
        Olof Johansson <olof@...om.net>,
        Aisheng Dong <aisheng.dong@....com>,
        Anson Huang <Anson.Huang@....com>,
        Maxime Ripard <mripard@...nel.org>,
        Leonard Crestez <leonard.crestez@....com>,
        Dinh Nguyen <dinguyen@...nel.org>,
        Marcin Juszkiewicz <marcin.juszkiewicz@...aro.org>,
        Valentin Schneider <valentin.schneider@....com>,
        Arnd Bergmann <arnd@...db.de>, Mark Brown <broonie@...nel.org>,
        Thierry Reding <treding@...dia.com>,
        YueHaibing <yuehaibing@...wei.com>,
        Stefan Agner <stefan@...er.cn>, Jacky Bai <ping.bai@....com>,
        Marco Felsch <m.felsch@...gutronix.de>,
        devicetree@...r.kernel.org, wsd_upstream@...iatek.com,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        linux-input@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH V2 2/2] drivers: input: keyboard

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.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ