Skip to content

Commit 8d3fe85

Browse files
committed
Merge tag 'acpi-4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix two issues in the ACPI SoC drivers (Intel LPSS and AMD APD), a crash in the PCC mailbox initialization code and a WDAT watchdog initialization failure. Specifics: - Fix a device ID of Hisilicon Hip07/08 in the ACPI APD (AMD SoC) driver (Hanjun Guo). - Fix list corruption (introduced during the 4.11 cycle) in the ACPI LPSS (Intel SoC) driver (Hans de Goede). - Fix PCC mailbox handling code crash during initialization when PCCT is not present and PCC channel 0 is requested (Hoan Tran). - Fix a WDAT watchdog initialization issue causing platform device creation to fail due to partially overlapping address ranges in resources (Ryan Kennedy)" * tag 'acpi-4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: APD: Fix HID for Hisilicon Hip07/08 mailbox: pcc: Fix crash when request PCC channel 0 ACPI / watchdog: Fix init failure with overlapping register regions ACPI / LPSS: Only call pwm_add_table() for the first PWM controller
2 parents 73784fb + 3de559d commit 8d3fe85

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

drivers/acpi/acpi_apd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
180180
{ "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
181181
{ "BRCM900D", APD_ADDR(vulcan_spi_desc) },
182182
{ "CAV900D", APD_ADDR(vulcan_spi_desc) },
183-
{ "HISI0A21", APD_ADDR(hip07_i2c_desc) },
184-
{ "HISI0A22", APD_ADDR(hip08_i2c_desc) },
183+
{ "HISI02A1", APD_ADDR(hip07_i2c_desc) },
184+
{ "HISI02A2", APD_ADDR(hip08_i2c_desc) },
185185
#endif
186186
{ }
187187
};

drivers/acpi/acpi_lpss.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ static const struct lpss_device_desc lpss_dma_desc = {
8585
};
8686

8787
struct lpss_private_data {
88+
struct acpi_device *adev;
8889
void __iomem *mmio_base;
8990
resource_size_t mmio_size;
9091
unsigned int fixed_clk_rate;
@@ -155,6 +156,12 @@ static struct pwm_lookup byt_pwm_lookup[] = {
155156

156157
static void byt_pwm_setup(struct lpss_private_data *pdata)
157158
{
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+
158165
if (!acpi_dev_present("INT33FD", NULL, -1))
159166
pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup));
160167
}
@@ -180,6 +187,12 @@ static struct pwm_lookup bsw_pwm_lookup[] = {
180187

181188
static void bsw_pwm_setup(struct lpss_private_data *pdata)
182189
{
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+
183196
pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup));
184197
}
185198

@@ -456,6 +469,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
456469
goto err_out;
457470
}
458471

472+
pdata->adev = adev;
459473
pdata->dev_desc = dev_desc;
460474

461475
if (dev_desc->setup)

drivers/acpi/acpi_watchdog.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ void __init acpi_watchdog_init(void)
8686

8787
found = false;
8888
resource_list_for_each_entry(rentry, &resource_list) {
89-
if (resource_contains(rentry->res, &res)) {
89+
if (rentry->res->flags == res.flags &&
90+
resource_overlaps(rentry->res, &res)) {
91+
if (res.start < rentry->res->start)
92+
rentry->res->start = res.start;
93+
if (res.end > rentry->res->end)
94+
rentry->res->end = res.end;
9095
found = true;
9196
break;
9297
}

drivers/mailbox/pcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static struct mbox_controller pcc_mbox_ctrl = {};
9292
*/
9393
static struct mbox_chan *get_pcc_channel(int id)
9494
{
95-
if (id < 0 || id > pcc_mbox_ctrl.num_chans)
95+
if (id < 0 || id >= pcc_mbox_ctrl.num_chans)
9696
return ERR_PTR(-ENOENT);
9797

9898
return &pcc_mbox_channels[id];

0 commit comments

Comments
 (0)