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]
Message-ID: <CAHQZ30DP1asiMj7hoebQQvGqE36sBDjaFmp3ju3eUEF1PruFeg@mail.gmail.com>
Date:   Tue, 13 Sep 2022 12:56:37 -0600
From:   Raul Rangel <rrangel@...omium.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Linux ACPI <linux-acpi@...r.kernel.org>,
        linux-input <linux-input@...r.kernel.org>,
        "jingle.wu" <jingle.wu@....com.tw>,
        "Limonciello, Mario" <mario.limonciello@....com>,
        Tim Van Patten <timvp@...gle.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Hans de Goede <hdegoede@...hat.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Wolfram Sang <wsa@...nel.org>,
        "open list:I2C SUBSYSTEM HOST DRIVERS" <linux-i2c@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 07/13] i2c: acpi: Use ACPI wake capability bit to set wake_irq

On Tue, Sep 13, 2022 at 12:33 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Tue, Sep 13, 2022 at 12:07:53PM -0600, Raul Rangel wrote:
> > On Tue, Sep 13, 2022 at 11:26 AM Andy Shevchenko
> > <andriy.shevchenko@...ux.intel.com> wrote:
> > >
> > > On Mon, Sep 12, 2022 at 04:13:11PM -0600, Raul E Rangel wrote:
> > > > Device tree already has a mechanism to pass the wake_irq. It does this
> > > > by looking for the wakeup-source property and setting the
> > > > I2C_CLIENT_WAKE flag. This CL adds the ACPI equivalent. It uses the
> > > > ACPI interrupt wake flag to determine if the interrupt can be used to
> > > > wake the system. Previously the i2c drivers had to make assumptions and
> > > > blindly enable the wake IRQ. This can cause spurious wake events. e.g.,
> > > > If there is a device with an Active Low interrupt and the device gets
> > > > powered off while suspending, the interrupt line will go low since it's
> > > > no longer powered and wakes the system. For this reason we should
> > > > respect the board designers wishes and honor the wake bit defined on the
> > > > interrupt.
> >
> > >
> > > > +                     if (irq > 0 && acpi_wake_capable)
> > > > +                             client->flags |= I2C_CLIENT_WAKE;
> > >
> > > Why do we need a parameter and can't simply set this flag inside the callee?
> >
> > Are you suggesting `i2c_acpi_get_irq` modify the `client->flags`? IMO
> > that's a little surprising since the I wouldn't expect a `get`
> > function to modify it's parameters. I'm fine implementing it if others
> > agree though.
>


> This is similar to what of_i2c_get_board_info() does, no?
> Note: _get_ there.
>

`*info` is an out parameter in that case. Ideally I would have
`i2c_acpi_get_irq`, `acpi_dev_gpio_irq_get_wake`,
`platform_get_irq_optional`, and `i2c_dev_irq_from_resources` all
return a `struct irq_info {int irq; bool wake_capable;}`. This would
be a larger change though.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ