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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 24 Oct 2020 21:28:38 +0200
From:   Krzysztof Kozlowski <krzk@...nel.org>
To:     Peng Fan <peng.fan@....com>
Cc:     "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        dl-linux-imx <linux-imx@....com>,
        "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] i2c: imx: use devm_request_threaded_irq to simplify
 code

On Sat, Oct 24, 2020 at 07:39:47AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH 1/2] i2c: imx: use devm_request_threaded_irq to simplify
> > code
> > 
> > On Fri, 23 Oct 2020 at 10:27, <peng.fan@....com> wrote:
> > >
> > > From: Peng Fan <peng.fan@....com>
> > >
> > > Use devm_request_threaded_irq to simplify code
> > >
> > > Signed-off-by: Peng Fan <peng.fan@....com>
> > > ---
> > >  drivers/i2c/busses/i2c-imx.c | 10 +++-------
> > >  1 file changed, 3 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/i2c/busses/i2c-imx.c
> > > b/drivers/i2c/busses/i2c-imx.c index e6f8d6e45a15..ba9d639223ec 100644
> > > --- a/drivers/i2c/busses/i2c-imx.c
> > > +++ b/drivers/i2c/busses/i2c-imx.c
> > > @@ -1216,8 +1216,8 @@ static int i2c_imx_probe(struct platform_device
> > *pdev)
> > >                 goto rpm_disable;
> > >
> > >         /* Request IRQ */
> > > -       ret = request_threaded_irq(irq, i2c_imx_isr, NULL, IRQF_SHARED,
> > > -                                  pdev->name, i2c_imx);
> > > +       ret = devm_request_threaded_irq(&pdev->dev, irq, i2c_imx_isr,
> > NULL, IRQF_SHARED,
> > > +                                       pdev->name, i2c_imx);
> > 
> > Really? You silently revert commit e50e4f0b85be ("i2c: imx: Fix external abort
> > on interrupt in exit paths"). This is not a simplification but serious change. NAK.
> > At least without proper reasoning of why this is suddenly safe.
> 
> Oh, I need look at git history before. But
> Is it because i2c interrupt enabled too early? I'll try your case on i.MX8M platform.

Shortly, it is because shared interrupts do not go well or at all with
devm-managed interrupt handlers. Probably they could be made working
with additional code, e.g. devm_free_irq() call or some additional
checks in interrupt handlers. But in that case there won't be much of
simplification.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ