aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-07-06 12:49:27 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-06 17:05:25 -0400
commitdd242a080d178c36442a0bb28b6acf6f126d0569 (patch)
tree906ab6313421c750df1f19dd032028e23c30403d
parent6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c (diff)
ACPI / LPSS: Only call pwm_add_table() for the first PWM controller
At least on the UP board SBC both PWMs are enabled leading to us trying to add the same pwm_lookup twice, which leads to the following: [ 0.902224] list_add double add: new=ffffffffb8efd400, prev=ffffffffb8efd400, next=ffffffffb8eeede0. [ 0.912466] ------------[ cut here ]------------ [ 0.917624] kernel BUG at lib/list_debug.c:31! [ 0.922588] invalid opcode: 0000 [#1] SMP ... [ 1.027450] Call Trace: [ 1.030185] pwm_add_table+0x4c/0x90 [ 1.034181] bsw_pwm_setup+0x1a/0x20 [ 1.038175] acpi_lpss_create_device+0xfe/0x420 ... This commit fixes this by only calling pwm_add_table() for the first PWM controller (which is the one used for the backlight). Link: https://bugzilla.redhat.com/show_bug.cgi?id=1458599 Fixes: bf7696a12071 (acpi: lpss: call pwm_add_table() for BSW...) Fixes: 04434ab5120a (ACPI / LPSS: Call pwm_add_table() for Bay Trail...) Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: 4.11+ <stable@vger.kernel.org> # 4.11+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpi_lpss.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 10347e3d73ad..5bd58bd4ab05 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -85,6 +85,7 @@ static const struct lpss_device_desc lpss_dma_desc = {
85}; 85};
86 86
87struct lpss_private_data { 87struct lpss_private_data {
88 struct acpi_device *adev;
88 void __iomem *mmio_base; 89 void __iomem *mmio_base;
89 resource_size_t mmio_size; 90 resource_size_t mmio_size;
90 unsigned int fixed_clk_rate; 91 unsigned int fixed_clk_rate;
@@ -155,6 +156,12 @@ static struct pwm_lookup byt_pwm_lookup[] = {
155 156
156static void byt_pwm_setup(struct lpss_private_data *pdata) 157static void byt_pwm_setup(struct lpss_private_data *pdata)
157{ 158{
159 struct acpi_device *adev = pdata->adev;
160
161 /* Only call pwm_add_table for the first PWM controller */
162 if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
163 return;
164
158 if (!acpi_dev_present("INT33FD", NULL, -1)) 165 if (!acpi_dev_present("INT33FD", NULL, -1))
159 pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup)); 166 pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup));
160} 167}
@@ -180,6 +187,12 @@ static struct pwm_lookup bsw_pwm_lookup[] = {
180 187
181static void bsw_pwm_setup(struct lpss_private_data *pdata) 188static void bsw_pwm_setup(struct lpss_private_data *pdata)
182{ 189{
190 struct acpi_device *adev = pdata->adev;
191
192 /* Only call pwm_add_table for the first PWM controller */
193 if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
194 return;
195
183 pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup)); 196 pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup));
184} 197}
185 198
@@ -456,6 +469,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
456 goto err_out; 469 goto err_out;
457 } 470 }
458 471
472 pdata->adev = adev;
459 pdata->dev_desc = dev_desc; 473 pdata->dev_desc = dev_desc;
460 474
461 if (dev_desc->setup) 475 if (dev_desc->setup)