diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-22 19:20:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-22 19:20:25 -0400 |
commit | e7d7743f1be5f15caebbf13713d1eb0a5f08b5c2 (patch) | |
tree | bf4f5acaee7dea9aeb98c5a08c1be084354903db | |
parent | 394c73d396284897207dbb1bad2a43e621cb9dac (diff) | |
parent | 594fdbaab739f82b3a712b88beb483ca1ca250ee (diff) |
Merge tag 'acpi-4.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki:
"These revert one recent commit that added incorrect battery quirks for
some Asus systems and fix an off-by-one error in the watchdog driver
based on the ACPI WDAT table.
Specifics:
- Revert the recent change adding battery quirks for Asus GL502VSK
and UX305LA as these quirks turn out to be inadequate and possibly
premature (Daniel Drake).
- Fix an off-by-one error in the resource allocation part of the
watchdog driver based on the ACPI WDAT table (Takashi Iwai)"
* tag 'acpi-4.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / watchdog: Fix off-by-one error at resource assignment
Revert "ACPI / battery: Add quirk for Asus GL502VSK and UX305LA"
-rw-r--r-- | drivers/acpi/acpi_watchdog.c | 4 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 48 | ||||
-rw-r--r-- | drivers/watchdog/wdat_wdt.c | 2 |
3 files changed, 6 insertions, 48 deletions
diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c index 11b113f8e367..ebb626ffb5fa 100644 --- a/drivers/acpi/acpi_watchdog.c +++ b/drivers/acpi/acpi_watchdog.c | |||
@@ -74,10 +74,10 @@ void __init acpi_watchdog_init(void) | |||
74 | res.start = gas->address; | 74 | res.start = gas->address; |
75 | if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { | 75 | if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
76 | res.flags = IORESOURCE_MEM; | 76 | res.flags = IORESOURCE_MEM; |
77 | res.end = res.start + ALIGN(gas->access_width, 4); | 77 | res.end = res.start + ALIGN(gas->access_width, 4) - 1; |
78 | } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { | 78 | } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { |
79 | res.flags = IORESOURCE_IO; | 79 | res.flags = IORESOURCE_IO; |
80 | res.end = res.start + gas->access_width; | 80 | res.end = res.start + gas->access_width - 1; |
81 | } else { | 81 | } else { |
82 | pr_warn("Unsupported address space: %u\n", | 82 | pr_warn("Unsupported address space: %u\n", |
83 | gas->space_id); | 83 | gas->space_id); |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 7128488a3a72..f2eb6c37ea0a 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -70,7 +70,6 @@ static async_cookie_t async_cookie; | |||
70 | static bool battery_driver_registered; | 70 | static bool battery_driver_registered; |
71 | static int battery_bix_broken_package; | 71 | static int battery_bix_broken_package; |
72 | static int battery_notification_delay_ms; | 72 | static int battery_notification_delay_ms; |
73 | static int battery_full_discharging; | ||
74 | static unsigned int cache_time = 1000; | 73 | static unsigned int cache_time = 1000; |
75 | module_param(cache_time, uint, 0644); | 74 | module_param(cache_time, uint, 0644); |
76 | MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); | 75 | MODULE_PARM_DESC(cache_time, "cache time in milliseconds"); |
@@ -215,12 +214,9 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
215 | return -ENODEV; | 214 | return -ENODEV; |
216 | switch (psp) { | 215 | switch (psp) { |
217 | case POWER_SUPPLY_PROP_STATUS: | 216 | case POWER_SUPPLY_PROP_STATUS: |
218 | if (battery->state & ACPI_BATTERY_STATE_DISCHARGING) { | 217 | if (battery->state & ACPI_BATTERY_STATE_DISCHARGING) |
219 | if (battery_full_discharging && battery->rate_now == 0) | 218 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; |
220 | val->intval = POWER_SUPPLY_STATUS_FULL; | 219 | else if (battery->state & ACPI_BATTERY_STATE_CHARGING) |
221 | else | ||
222 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; | ||
223 | } else if (battery->state & ACPI_BATTERY_STATE_CHARGING) | ||
224 | val->intval = POWER_SUPPLY_STATUS_CHARGING; | 220 | val->intval = POWER_SUPPLY_STATUS_CHARGING; |
225 | else if (acpi_battery_is_charged(battery)) | 221 | else if (acpi_battery_is_charged(battery)) |
226 | val->intval = POWER_SUPPLY_STATUS_FULL; | 222 | val->intval = POWER_SUPPLY_STATUS_FULL; |
@@ -1170,12 +1166,6 @@ battery_notification_delay_quirk(const struct dmi_system_id *d) | |||
1170 | return 0; | 1166 | return 0; |
1171 | } | 1167 | } |
1172 | 1168 | ||
1173 | static int __init battery_full_discharging_quirk(const struct dmi_system_id *d) | ||
1174 | { | ||
1175 | battery_full_discharging = 1; | ||
1176 | return 0; | ||
1177 | } | ||
1178 | |||
1179 | static const struct dmi_system_id bat_dmi_table[] __initconst = { | 1169 | static const struct dmi_system_id bat_dmi_table[] __initconst = { |
1180 | { | 1170 | { |
1181 | .callback = battery_bix_broken_package_quirk, | 1171 | .callback = battery_bix_broken_package_quirk, |
@@ -1193,38 +1183,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = { | |||
1193 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"), | 1183 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"), |
1194 | }, | 1184 | }, |
1195 | }, | 1185 | }, |
1196 | { | ||
1197 | .callback = battery_full_discharging_quirk, | ||
1198 | .ident = "ASUS GL502VSK", | ||
1199 | .matches = { | ||
1200 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
1201 | DMI_MATCH(DMI_PRODUCT_NAME, "GL502VSK"), | ||
1202 | }, | ||
1203 | }, | ||
1204 | { | ||
1205 | .callback = battery_full_discharging_quirk, | ||
1206 | .ident = "ASUS UX305LA", | ||
1207 | .matches = { | ||
1208 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
1209 | DMI_MATCH(DMI_PRODUCT_NAME, "UX305LA"), | ||
1210 | }, | ||
1211 | }, | ||
1212 | { | ||
1213 | .callback = battery_full_discharging_quirk, | ||
1214 | .ident = "ASUS UX360UA", | ||
1215 | .matches = { | ||
1216 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
1217 | DMI_MATCH(DMI_PRODUCT_NAME, "UX360UA"), | ||
1218 | }, | ||
1219 | }, | ||
1220 | { | ||
1221 | .callback = battery_full_discharging_quirk, | ||
1222 | .ident = "ASUS UX410UAK", | ||
1223 | .matches = { | ||
1224 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
1225 | DMI_MATCH(DMI_PRODUCT_NAME, "UX410UAK"), | ||
1226 | }, | ||
1227 | }, | ||
1228 | {}, | 1186 | {}, |
1229 | }; | 1187 | }; |
1230 | 1188 | ||
diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c index 6d1fbda0f461..0da9943d405f 100644 --- a/drivers/watchdog/wdat_wdt.c +++ b/drivers/watchdog/wdat_wdt.c | |||
@@ -392,7 +392,7 @@ static int wdat_wdt_probe(struct platform_device *pdev) | |||
392 | 392 | ||
393 | memset(&r, 0, sizeof(r)); | 393 | memset(&r, 0, sizeof(r)); |
394 | r.start = gas->address; | 394 | r.start = gas->address; |
395 | r.end = r.start + gas->access_width; | 395 | r.end = r.start + gas->access_width - 1; |
396 | if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { | 396 | if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
397 | r.flags = IORESOURCE_MEM; | 397 | r.flags = IORESOURCE_MEM; |
398 | } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { | 398 | } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { |