Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1487126
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [REGRESSION? v4.8] i2c-core: acpi_i2c_get_info() touches non-existent devices |
| Date | 2016-09-20 10:00 +0200 |
| Message-ID | <sjo8a-8uA-3@gated-at.bofh.it> (permalink) |
| References | <sj2AF-3cw-9@gated-at.bofh.it> <sj2AF-3cw-7@gated-at.bofh.it> <sj6Ei-5Vj-67@gated-at.bofh.it> <sj7h0-69i-21@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
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. > > So, > > Tested-by: Nicolai Stange <nicstange@gmail.com> Thanks. > 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?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [REGRESSION? v4.8] i2c-core: acpi_i2c_get_info() touches non-existent devices Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-19 11:00 +0200
Re: [REGRESSION? v4.8] i2c-core: acpi_i2c_get_info() touches non-existent devices Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-19 15:20 +0200
Re: [REGRESSION? v4.8] i2c-core: acpi_i2c_get_info() touches non-existent devices Nicolai Stange <nicstange@gmail.com> - 2016-09-19 16:00 +0200
Re: [REGRESSION? v4.8] i2c-core: acpi_i2c_get_info() touches non-existent devices Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-20 10:00 +0200
[PATCH] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-20 10:10 +0200
Re: [PATCH] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Nicolai Stange <nicstange@gmail.com> - 2016-09-20 12:40 +0200
Re: [PATCH] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-20 12:50 +0200
[PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-20 16:10 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Nicolai Stange <nicstange@gmail.com> - 2016-09-20 20:50 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Wolfram Sang <wsa@the-dreams.de> - 2016-09-21 07:50 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-21 10:50 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Wolfram Sang <wsa@the-dreams.de> - 2016-09-21 18:20 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-22 11:00 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Wolfram Sang <wsa@the-dreams.de> - 2016-09-22 11:00 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-09-22 11:30 +0200
Re: [PATCH v2] i2c / ACPI: Do not touch an I2C device if it belongs to another adapter Wolfram Sang <wsa@the-dreams.de> - 2016-09-22 20:30 +0200
csiph-web