On Mon, Sep 19, 2016 at 03:58:52PM +0200, Nicolai Stange wrote:
> > Can you try if the following patch cures the problem?
> Unfortunately not. That patch installs the check after the
> acpi_i2c_get_info() invocation which is part of the backtrace above.
Ah, indeed it needs to happen before we parse resources.
> I moved your check into i2c_get_info(), right in front of the IRQ
> handling and this works.
> Tested-by: Nicolai Stange <nicsta...@gmail.com>
> for this:
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 74e5aea..3f2b3cf 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -141,6 +141,7 @@ static int acpi_i2c_get_info(struct acpi_device *adev,
> struct list_head resource_list;
> struct resource_entry *entry;
> struct acpi_i2c_lookup lookup;
> + struct acpi_device *adapter_adev;
> int ret;
> if (acpi_bus_get_status(adev) || !adev->status.present ||
> @@ -163,6 +164,12 @@ static int acpi_i2c_get_info(struct acpi_device *adev,
> if (ret < 0 || !info->addr)
> return -EINVAL;
> + /* The adapter must be present */
> + if (acpi_bus_get_device(lookup.adapter_handle, &adapter_adev))
> + return -EINVAL;
> + if (acpi_bus_get_status(adapter_adev) || !adapter_adev->status.present)
> + return -EINVAL;;
> *adapter_handle = lookup.adapter_handle;
> /* Then fill IRQ number if any */
> But it is still true that acpi_i2c_register_devices() configures the
> interrupts for all ACPI I2C slaves attached to an available adapter,
> independent of whether their adapter is the one given as an argument or
> not. I can't tell whether this is desired, just a note...
You are right it should not do that. I'll send you an updated patch
shortly, can you try if it works?