[+cc Myron] On Tue, Oct 25, 2011 at 12:39 PM, Luck, Tony <tony.luck@xxxxxxxxx> wrote: >> Myron posted a nice patch recently to remove atomicio.c altogether: >> http://marc.info/?l=linux-acpi&m=131733358818849&w=2 >> >> I haven't seen any response to it, but I think it's a nice approach >> and it gets rid of all this special-case pre-map, post-unmap, atomic >> read/write stuff. > > Does that meet the needs of the: > > panic in NMI/machine check context > kmsg_dump > pstore > ERST > acpi reads & writes > > call chain? I thought that atomicio was created for paths where the normal > acpi operations had problems in NMI contexts. Yes, it should meet those needs. The reason we couldn't use acpi_read() in NMI contexts was that it did an ioremap(), which may need to allocate memory. Therefore, we added acpi_pre_map_gar(), which did the ioremap() early, in process context, and acpi_atomic_read(), which relies on that mapping to perform the access. Myron's work adds acpi_os_map_generic_address(), which is basically the same as acpi_pre_map_gar(). You call this in process context, and it does the ioremap() and saves the resulting mapping. Then he changed acpi_os_read_memory() (the guts of acpi_read()) so it only does the ioremap() if there's no existing mapping. The net result is that acpi_read() should now be safe in NMI context, as long as you are reading things you've previously mapped with acpi_os_map_generic_address(). Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html