Merge branches 'acpi-soc', 'acpi-wdat' and 'acpi-cppc'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Aug 2017 18:30:18 +0000 (20:30 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Aug 2017 18:30:18 +0000 (20:30 +0200)
* acpi-soc:
  ACPI: APD: Fix HID for Hisilicon Hip07/08
  ACPI / LPSS: Only call pwm_add_table() for the first PWM controller

* acpi-wdat:
  ACPI / watchdog: Fix init failure with overlapping register regions

* acpi-cppc:
  mailbox: pcc: Fix crash when request PCC channel 0

drivers/acpi/acpi_apd.c
drivers/acpi/acpi_lpss.c
drivers/acpi/acpi_watchdog.c
drivers/mailbox/pcc.c

index fc6c416f8724670aef2f29d4d81d373ed400dcd5..d5999eb41c00176e840d90b84241ab855c8881c4 100644 (file)
@@ -180,8 +180,8 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
        { "APMC0D0F", APD_ADDR(xgene_i2c_desc) },
        { "BRCM900D", APD_ADDR(vulcan_spi_desc) },
        { "CAV900D",  APD_ADDR(vulcan_spi_desc) },
-       { "HISI0A21", APD_ADDR(hip07_i2c_desc) },
-       { "HISI0A22", APD_ADDR(hip08_i2c_desc) },
+       { "HISI02A1", APD_ADDR(hip07_i2c_desc) },
+       { "HISI02A2", APD_ADDR(hip08_i2c_desc) },
 #endif
        { }
 };
index e51a1e98e62f4f5ab5f2132184e9686ab1a1f3a9..f88caf5aab76217d73feb277b1918e399cc61beb 100644 (file)
@@ -85,6 +85,7 @@ static const struct lpss_device_desc lpss_dma_desc = {
 };
 
 struct lpss_private_data {
+       struct acpi_device *adev;
        void __iomem *mmio_base;
        resource_size_t mmio_size;
        unsigned int fixed_clk_rate;
@@ -155,6 +156,12 @@ static struct pwm_lookup byt_pwm_lookup[] = {
 
 static void byt_pwm_setup(struct lpss_private_data *pdata)
 {
+       struct acpi_device *adev = pdata->adev;
+
+       /* Only call pwm_add_table for the first PWM controller */
+       if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
+               return;
+
        if (!acpi_dev_present("INT33FD", NULL, -1))
                pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup));
 }
@@ -180,6 +187,12 @@ static struct pwm_lookup bsw_pwm_lookup[] = {
 
 static void bsw_pwm_setup(struct lpss_private_data *pdata)
 {
+       struct acpi_device *adev = pdata->adev;
+
+       /* Only call pwm_add_table for the first PWM controller */
+       if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
+               return;
+
        pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup));
 }
 
@@ -456,6 +469,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
                goto err_out;
        }
 
+       pdata->adev = adev;
        pdata->dev_desc = dev_desc;
 
        if (dev_desc->setup)
index 8c4e0a18460a78df600067da69537e6256d6bc1c..bf22c29d25179e937523c026c8028f644f3379f6 100644 (file)
@@ -86,7 +86,12 @@ void __init acpi_watchdog_init(void)
 
                found = false;
                resource_list_for_each_entry(rentry, &resource_list) {
-                       if (resource_contains(rentry->res, &res)) {
+                       if (rentry->res->flags == res.flags &&
+                           resource_overlaps(rentry->res, &res)) {
+                               if (res.start < rentry->res->start)
+                                       rentry->res->start = res.start;
+                               if (res.end > rentry->res->end)
+                                       rentry->res->end = res.end;
                                found = true;
                                break;
                        }
index ac91fd0d62c6e4e22c57ab354ceb56adfdaee48e..cbca5e51b9759c57813b8579a2d38318bab39e02 100644 (file)
@@ -92,7 +92,7 @@ static struct mbox_controller pcc_mbox_ctrl = {};
  */
 static struct mbox_chan *get_pcc_channel(int id)
 {
-       if (id < 0 || id > pcc_mbox_ctrl.num_chans)
+       if (id < 0 || id >= pcc_mbox_ctrl.num_chans)
                return ERR_PTR(-ENOENT);
 
        return &pcc_mbox_channels[id];