Skip to content

Commit 5e90198

Browse files
committed
Merge branches 'acpi-osl', 'acpi-tables', 'acpi-property', 'acpi-prm' and 'acpi-apei'
Merge assorted changes in ACPI library code for 6.14: - Use usleep_range() instead of msleep() in acpi_os_sleep() to reduce excessive delays due to timer inaccuracy, mostly affecting system suspend and resume (Rafael Wysocki). - Use str_enabled_disabled() string helpers in the ACPI tables parsing code to make it easier to follow (Sunil V L). - Update device properties parsing on systems using ACPI so that data firmware nodes resulting from _DSD evaluation are treated as available in firmware nodes walks (Sakari Ailus). - Fix missing guid_t declaration in linux/prmt.h (Robert Richter). - Update the GHES handling code to follow the global panic= instead of overriding it by force-rebooting the system after a fatal hw error has been reported (Borislav Petkov). * acpi-osl: ACPI: OSL: Use usleep_range() in acpi_os_sleep() * acpi-tables: ACPI: tables: Use string choice helpers * acpi-property: ACPI: property: Consider data nodes as being available * acpi-prm: ACPI: PRM: Fix missing guid_t declaration in linux/prmt.h * acpi-apei: APEI: GHES: Have GHES honor the panic= setting
6 parents 1457892 + bede543 + bff7165 + 1715960 + f4757d8 + 5c0e00a commit 5e90198

File tree

5 files changed

+35
-13
lines changed

5 files changed

+35
-13
lines changed

drivers/acpi/apei/ghes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ static struct gen_pool *ghes_estatus_pool;
173173
static struct ghes_estatus_cache __rcu *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE];
174174
static atomic_t ghes_estatus_cache_alloced;
175175

176-
static int ghes_panic_timeout __read_mostly = 30;
177-
178176
static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx)
179177
{
180178
phys_addr_t paddr;
@@ -983,14 +981,16 @@ static void __ghes_panic(struct ghes *ghes,
983981
struct acpi_hest_generic_status *estatus,
984982
u64 buf_paddr, enum fixed_addresses fixmap_idx)
985983
{
984+
const char *msg = GHES_PFX "Fatal hardware error";
985+
986986
__ghes_print_estatus(KERN_EMERG, ghes->generic, estatus);
987987

988988
ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
989989

990-
/* reboot to log the error! */
991990
if (!panic_timeout)
992-
panic_timeout = ghes_panic_timeout;
993-
panic("Fatal hardware error!");
991+
pr_emerg("%s but panic disabled\n", msg);
992+
993+
panic(msg);
994994
}
995995

996996
static int ghes_proc(struct ghes *ghes)

drivers/acpi/osl.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,27 @@ acpi_status acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler handler)
607607

608608
void acpi_os_sleep(u64 ms)
609609
{
610-
msleep(ms);
610+
u64 usec = ms * USEC_PER_MSEC, delta_us = 50;
611+
612+
/*
613+
* Use a hrtimer because the timer wheel timers are optimized for
614+
* cancelation before they expire and this timer is not going to be
615+
* canceled.
616+
*
617+
* Set the delta between the requested sleep time and the effective
618+
* deadline to at least 50 us in case there is an opportunity for timer
619+
* coalescing.
620+
*
621+
* Moreover, longer sleeps can be assumed to need somewhat less timer
622+
* precision, so sacrifice some of it for making the timer a more likely
623+
* candidate for coalescing by setting the delta to 1% of the sleep time
624+
* if it is above 5 ms (this value is chosen so that the delta is a
625+
* continuous function of the sleep time).
626+
*/
627+
if (ms > 5)
628+
delta_us = (USEC_PER_MSEC / 100) * ms;
629+
630+
usleep_range(usec, usec + delta_us);
611631
}
612632

613633
void acpi_os_stall(u32 us)

drivers/acpi/property.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ acpi_graph_get_remote_endpoint(const struct fwnode_handle *__fwnode)
14921492
static bool acpi_fwnode_device_is_available(const struct fwnode_handle *fwnode)
14931493
{
14941494
if (!is_acpi_device_node(fwnode))
1495-
return false;
1495+
return true;
14961496

14971497
return acpi_device_is_present(to_acpi_device_node(fwnode));
14981498
}

drivers/acpi/tables.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
5656
(struct acpi_madt_local_apic *)header;
5757
pr_debug("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",
5858
p->processor_id, p->id,
59-
(p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
59+
str_enabled_disabled(p->lapic_flags & ACPI_MADT_ENABLED));
6060
}
6161
break;
6262

@@ -66,7 +66,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
6666
(struct acpi_madt_local_x2apic *)header;
6767
pr_debug("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n",
6868
p->local_apic_id, p->uid,
69-
(p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
69+
str_enabled_disabled(p->lapic_flags & ACPI_MADT_ENABLED));
7070
}
7171
break;
7272

@@ -160,7 +160,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
160160
(struct acpi_madt_local_sapic *)header;
161161
pr_debug("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n",
162162
p->processor_id, p->id, p->eid,
163-
(p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
163+
str_enabled_disabled(p->lapic_flags & ACPI_MADT_ENABLED));
164164
}
165165
break;
166166

@@ -183,7 +183,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
183183
pr_debug("GICC (acpi_id[0x%04x] address[%llx] MPIDR[0x%llx] %s)\n",
184184
p->uid, p->base_address,
185185
p->arm_mpidr,
186-
(p->flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
186+
str_enabled_disabled(p->flags & ACPI_MADT_ENABLED));
187187

188188
}
189189
break;
@@ -218,7 +218,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
218218

219219
pr_debug("CORE PIC (processor_id[0x%02x] core_id[0x%02x] %s)\n",
220220
p->processor_id, p->core_id,
221-
(p->flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
221+
str_enabled_disabled(p->flags & ACPI_MADT_ENABLED));
222222
}
223223
break;
224224

@@ -228,7 +228,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
228228

229229
pr_debug("RISC-V INTC (acpi_uid[0x%04x] hart_id[0x%llx] %s)\n",
230230
p->uid, p->hart_id,
231-
(p->flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
231+
str_enabled_disabled(p->flags & ACPI_MADT_ENABLED));
232232
}
233233
break;
234234

include/linux/prmt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22

3+
#include <linux/uuid.h>
4+
35
#ifdef CONFIG_ACPI_PRMT
46
void init_prmt(void);
57
int acpi_call_prm_handler(guid_t handler_guid, void *param_buffer);

0 commit comments

Comments
 (0)