ACPI / LPSS: Always disable I2C host controllers
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 18 Feb 2015 11:50:16 +0000 (13:50 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 18 Feb 2015 17:46:40 +0000 (18:46 +0100)
commit3293c7b8ec213a640f5ea2e5efeaa2b7559b1e19
tree1195778029368e8f5a923155f98fbf36671e1cad
parentf8f87c03627c464cbb14651c37da86f4f9f92059
ACPI / LPSS: Always disable I2C host controllers

On Baytrail and Braswell the BIOS might leave the I2C host controllers
enabled, probably because it uses them for its own purposes. This is fine
in normal cases because the I2C driver will disable the hardware when it
is probed anyway.

However, in case of suspend to disk it is different story. If the driver
happens to be compiled as a module the boot kernel never loads the driver
thus leaving host controllers enabled upon loading the hibernation image.

The I2C host controller interrupt mask register has default value of 0x8ff,
in other words it has most of the interrupts unmasked. When combined with
the fact that the host controller is enabled, the driver immediately starts
getting interrupts even before its resume hook is called (once IO-APIC is
resumed). Since the driver is not prepared for this it will crash the
kernel due to NULL pointer derefence because dev->msgs is NULL.

Unfortunately we were not able to get full backtrace to from the console
which could be reproduced here.

In order to fix this even when the driver is compiled as module, we disable
the I2C host controllers in byt_i2c_setup() before devices are created.

Reported-by: Yu Chen <yu.c.chen@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: 3.17+ <stable@vger.kernel.org> # 3.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_lpss.c
This page took 0.02714 seconds and 5 git commands to generate.