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] [day] [month] [year] [list]
Message-ID: <CACRpkdZYU7gJ4OiVaADu3oCJVqD+jJ6BwKVan6hSO_t6BJ4oqw@mail.gmail.com>
Date:   Mon, 19 Apr 2021 12:28:06 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Jonathan Cameron <jic23@...nel.org>
Cc:     Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Dinghao Liu <dinghao.liu@....edu.cn>,
        Kangjie Lu <kjlu@....edu>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        linux-iio <linux-iio@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

On Sun, Apr 18, 2021 at 11:43 AM Jonathan Cameron <jic23@...nel.org> wrote:

> I'm still far from completely convinced that it is 'necessary'
> to take the reference whilst going through this sequence because
> there is nothing to kick off the suspend until we tell it to use
> autosuspend.  However, I appreciate (much like taking locks in
> general in probe) that it makes it easy to see there is no race.

One part is related to hierarchy, in the past if this device would sit on
a I2C bus on an PCIE card, unless you take a reference (that
escalate upwards) the I2C bus host or PCIE card may decide
to go and runtime suspend, cutting communication with
your device.

Since 04f59143b571 the power state of I2C buses are
decoupled from the clients and we decided that the I2C (as
well as SPI hosts, separate commit) shall make sure PM
resume themselves when transmitting messages to clients.

So in this case, since it is an I2C device, we are probably
fine without grabbing a reference.

But this is not a general rule for any (non-slow) bus, so
the idiomatic pattern to follow is better like this.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ