Skip to content

Commit e7d7743

Browse files
committed
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"
2 parents 394c73d + 594fdba commit e7d7743

File tree

3 files changed

+6
-48
lines changed

3 files changed

+6
-48
lines changed

drivers/acpi/acpi_watchdog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ void __init acpi_watchdog_init(void)
7474
res.start = gas->address;
7575
if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
7676
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;
7878
} else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
7979
res.flags = IORESOURCE_IO;
80-
res.end = res.start + gas->access_width;
80+
res.end = res.start + gas->access_width - 1;
8181
} else {
8282
pr_warn("Unsupported address space: %u\n",
8383
gas->space_id);

drivers/acpi/battery.c

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static async_cookie_t async_cookie;
7070
static bool battery_driver_registered;
7171
static int battery_bix_broken_package;
7272
static int battery_notification_delay_ms;
73-
static int battery_full_discharging;
7473
static unsigned int cache_time = 1000;
7574
module_param(cache_time, uint, 0644);
7675
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
@@ -215,12 +214,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
215214
return -ENODEV;
216215
switch (psp) {
217216
case POWER_SUPPLY_PROP_STATUS:
218-
if (battery->state & ACPI_BATTERY_STATE_DISCHARGING) {
219-
if (battery_full_discharging && battery->rate_now == 0)
220-
val->intval = POWER_SUPPLY_STATUS_FULL;
221-
else
222-
val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
223-
} else if (battery->state & ACPI_BATTERY_STATE_CHARGING)
217+
if (battery->state & ACPI_BATTERY_STATE_DISCHARGING)
218+
val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
219+
else if (battery->state & ACPI_BATTERY_STATE_CHARGING)
224220
val->intval = POWER_SUPPLY_STATUS_CHARGING;
225221
else if (acpi_battery_is_charged(battery))
226222
val->intval = POWER_SUPPLY_STATUS_FULL;
@@ -1170,12 +1166,6 @@ battery_notification_delay_quirk(const struct dmi_system_id *d)
11701166
return 0;
11711167
}
11721168

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-
11791169
static const struct dmi_system_id bat_dmi_table[] __initconst = {
11801170
{
11811171
.callback = battery_bix_broken_package_quirk,
@@ -1193,38 +1183,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
11931183
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"),
11941184
},
11951185
},
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-
},
12281186
{},
12291187
};
12301188

drivers/watchdog/wdat_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static int wdat_wdt_probe(struct platform_device *pdev)
392392

393393
memset(&r, 0, sizeof(r));
394394
r.start = gas->address;
395-
r.end = r.start + gas->access_width;
395+
r.end = r.start + gas->access_width - 1;
396396
if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
397397
r.flags = IORESOURCE_MEM;
398398
} else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {

0 commit comments

Comments
 (0)