Re: [PATCH v4] i2c: enable runtime PM for I2C adapter devicesenumerated from ACPI

From: Mika Westerberg
Date: Sat Oct 05 2013 - 04:04:09 EST


On Tue, Oct 01, 2013 at 04:09:42PM +0300, Mika Westerberg wrote:
> The ACPI specification requires the parent device to be powered on before
> any of its children. It can be only powered off when all the children are
> already off.
>
> Currently whenever there is no I2C traffic going on, the I2C controller
> driver can put the device into low power state transparently to its
> children (the I2C client devices). This violates the ACPI specification
> because now the parent device is in lower power state than its children.
>
> In order to keep ACPI happy we enable runtime PM for the I2C adapter device
> if we find out that the I2C controller was in fact an ACPI device. In
> addition to that we attach the I2C client devices to the ACPI power domain
> and make sure that they are powered on when the driver ->probe() is called.

It looks like Windows actually powers the I2C controller off independently
of the I2C client power state. We should probably do the same in Linux even
though it is not following what the ACPI spec says (but makes sense with
serial buses like I2C and SPI).

Wolfram, please don't apply this patch - we are going to do one more
iteration but this time we only attach devices to the ACPI power domain and
leave runtime PM alone.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/