mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ACPI, IO memory pre-mapping and atomic accessing
Some ACPI IO accessing need to be done in atomic context. For example, APEI ERST operations may be used for permanent storage in hardware error handler. That is, it may be called in atomic contexts such as IRQ or NMI, etc. And, ERST/EINJ implement their operations via IO memory/port accessing. But the IO memory accessing method provided by ACPI (acpi_read/acpi_write) maps the IO memory during it is accessed, so it can not be used in atomic context. To solve the issue, the IO memory should be pre-mapped during EINJ/ERST initializing. A linked list is used to record which memory area has been mapped, when memory is accessed in hardware error handler, search the linked list for the mapped virtual address from the given physical address. Signed-off-by: Huang Ying <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
parent
e40152ee1e
commit
15651291a2
3 changed files with 371 additions and 0 deletions
10
include/acpi/atomicio.h
Normal file
10
include/acpi/atomicio.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef ACPI_ATOMIC_IO_H
|
||||
#define ACPI_ATOMIC_IO_H
|
||||
|
||||
int acpi_pre_map_gar(struct acpi_generic_address *reg);
|
||||
int acpi_post_unmap_gar(struct acpi_generic_address *reg);
|
||||
|
||||
int acpi_atomic_read(u64 *val, struct acpi_generic_address *reg);
|
||||
int acpi_atomic_write(u64 val, struct acpi_generic_address *reg);
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue