On Tue, Oct 25, 2011 at 1:34 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote: > [+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 Thanks for seeing this and bringing up the recent patch to remove atomicio.c Bjorn. If for some reason the atomicio.c removal patch is not taken then the fix here should follow what was done earlier in drivers/acpi/osl.c - see commit b3ba1efec2a Myron > -- > 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 > -- 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