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:   Thu, 24 Jun 2021 13:39:23 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Nicolas Saenz Julienne <nsaenzju@...hat.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Matt Ranostay <matt.ranostay@...sulko.com>
Subject: Re: [PATCH] iio: chemical: atlas-sensor: Avoid using irq_work

On Thu, Jun 24, 2021 at 1:01 PM Nicolas Saenz Julienne
<nsaenzju@...hat.com> wrote:
>
> The atlas sensor driver currently registers a threaded IRQ handler whose
> sole responsibility is to trigger an irq_work which will in turn run
> iio_trigger_poll() in IRQ context.
>
> This seems overkill given the fact that there already was a opportunity

an opportunity

> to run iio_trigger_poll() in IRQ context in the top half of the IRQ
> handler. So make use of it, ultimately avoiding a context switch, an
> IPI, and reducing latency.

...

> @@ -474,7 +465,7 @@ static irqreturn_t atlas_interrupt_handler(int irq, void *private)
>         struct iio_dev *indio_dev = private;
>         struct atlas_data *data = iio_priv(indio_dev);
>
> -       irq_work_queue(&data->work);
> +       iio_trigger_poll(data->trig);

Have you considered dropping atlas_interrupt_trigger_ops() altogether?

>         return IRQ_HANDLED;

...

>         if (client->irq > 0) {
>                 /* interrupt pin toggles on new conversion */
>                 ret = devm_request_threaded_irq(&client->dev, client->irq,

> -                               NULL, atlas_interrupt_handler,
> +                               atlas_interrupt_handler, NULL,

So, you move it from threaded IRQ to be a hard IRQ handler (we have a
separate call for this).
Can you guarantee that handling of those events will be fast enough?

>                                 IRQF_TRIGGER_RISING |
>                                 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>                                 "atlas_irq",


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ