Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'acpi-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
"Fix a couple of configuration issues in the ACPI watchdog (WDAT)
driver (Mika Westerberg) and make it possible to disable that driver
at boot time in case it still does not work as expected (Jean
Delvare)"

* tag 'acpi-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: watchdog: Set default timeout in probe
ACPI: watchdog: Fix gas->access_width usage
ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro
ACPI: watchdog: Allow disabling WDAT at boot

+42 -5
+4
Documentation/admin-guide/kernel-parameters.txt
··· 136 136 dynamic table installation which will install SSDT 137 137 tables to /sys/firmware/acpi/tables/dynamic. 138 138 139 + acpi_no_watchdog [HW,ACPI,WDT] 140 + Ignore the ACPI-based watchdog interface (WDAT) and let 141 + a native driver control the watchdog device instead. 142 + 139 143 acpi_rsdp= [ACPI,EFI,KEXEC] 140 144 Pass the RSDP address to the kernel, mostly used 141 145 on machines running EFI runtime service to boot the
+12 -3
drivers/acpi/acpi_watchdog.c
··· 55 55 } 56 56 #endif 57 57 58 + static bool acpi_no_watchdog; 59 + 58 60 static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void) 59 61 { 60 62 const struct acpi_table_wdat *wdat = NULL; 61 63 acpi_status status; 62 64 63 - if (acpi_disabled) 65 + if (acpi_disabled || acpi_no_watchdog) 64 66 return NULL; 65 67 66 68 status = acpi_get_table(ACPI_SIG_WDAT, 0, ··· 89 87 return !!acpi_watchdog_get_wdat(); 90 88 } 91 89 EXPORT_SYMBOL_GPL(acpi_has_watchdog); 90 + 91 + /* ACPI watchdog can be disabled on boot command line */ 92 + static int __init disable_acpi_watchdog(char *str) 93 + { 94 + acpi_no_watchdog = true; 95 + return 1; 96 + } 97 + __setup("acpi_no_watchdog", disable_acpi_watchdog); 92 98 93 99 void __init acpi_watchdog_init(void) 94 100 { ··· 136 126 gas = &entries[i].register_region; 137 127 138 128 res.start = gas->address; 129 + res.end = res.start + ACPI_ACCESS_BYTE_WIDTH(gas->access_width) - 1; 139 130 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 140 131 res.flags = IORESOURCE_MEM; 141 - res.end = res.start + ALIGN(gas->access_width, 4) - 1; 142 132 } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { 143 133 res.flags = IORESOURCE_IO; 144 - res.end = res.start + gas->access_width - 1; 145 134 } else { 146 135 pr_warn("Unsupported address space: %u\n", 147 136 gas->space_id);
+24 -1
drivers/watchdog/wdat_wdt.c
··· 54 54 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" 55 55 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 56 56 57 + #define WDAT_DEFAULT_TIMEOUT 30 58 + 59 + static int timeout = WDAT_DEFAULT_TIMEOUT; 60 + module_param(timeout, int, 0); 61 + MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=" 62 + __MODULE_STRING(WDAT_DEFAULT_TIMEOUT) ")"); 63 + 57 64 static int wdat_wdt_read(struct wdat_wdt *wdat, 58 65 const struct wdat_instruction *instr, u32 *value) 59 66 { ··· 396 389 397 390 memset(&r, 0, sizeof(r)); 398 391 r.start = gas->address; 399 - r.end = r.start + gas->access_width - 1; 392 + r.end = r.start + ACPI_ACCESS_BYTE_WIDTH(gas->access_width) - 1; 400 393 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 401 394 r.flags = IORESOURCE_MEM; 402 395 } else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { ··· 444 437 return ret; 445 438 446 439 platform_set_drvdata(pdev, wdat); 440 + 441 + /* 442 + * Set initial timeout so that userspace has time to configure the 443 + * watchdog properly after it has opened the device. In some cases 444 + * the BIOS default is too short and causes immediate reboot. 445 + */ 446 + if (timeout * 1000 < wdat->wdd.min_hw_heartbeat_ms || 447 + timeout * 1000 > wdat->wdd.max_hw_heartbeat_ms) { 448 + dev_warn(dev, "Invalid timeout %d given, using %d\n", 449 + timeout, WDAT_DEFAULT_TIMEOUT); 450 + timeout = WDAT_DEFAULT_TIMEOUT; 451 + } 452 + 453 + ret = wdat_wdt_set_timeout(&wdat->wdd, timeout); 454 + if (ret) 455 + return ret; 447 456 448 457 watchdog_set_nowayout(&wdat->wdd, nowayout); 449 458 return devm_watchdog_register_device(dev, &wdat->wdd);
+2 -1
include/acpi/actypes.h
··· 532 532 strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE) 533 533 534 534 /* 535 - * Algorithm to obtain access bit width. 535 + * Algorithm to obtain access bit or byte width. 536 536 * Can be used with access_width of struct acpi_generic_address and access_size of 537 537 * struct acpi_resource_generic_register. 538 538 */ 539 539 #define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2)) 540 + #define ACPI_ACCESS_BYTE_WIDTH(size) (1 << ((size) - 1)) 540 541 541 542 /******************************************************************************* 542 543 *