* [PATCH] ACPI: Fix logic for removing mappings in 'acpi_unmap' @ 2012-02-09 16:36 Myron Stowe 2012-02-09 16:42 ` Bjorn Helgaas 0 siblings, 1 reply; 4+ messages in thread From: Myron Stowe @ 2012-02-09 16:36 UTC (permalink / raw) To: lenb; +Cc: linux-acpi, ying.huang, tony.luck, bhelgaas, trenn, linux-kernel From: Myron Stowe <mstowe@redhat.com> Make sure the removal of mappings uses the same logic that put the mappings in place. Signed-off-by: Myron Stowe <myron.stowe@redhat.com> --- drivers/acpi/osl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 412a1e0..5aef087 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -347,7 +347,7 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) unsigned long pfn; pfn = pg_off >> PAGE_SHIFT; - if (page_is_ram(pfn)) + if (should_use_kmap(pfn)) kunmap(pfn_to_page(pfn)); else iounmap(vaddr); ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI: Fix logic for removing mappings in 'acpi_unmap' 2012-02-09 16:36 [PATCH] ACPI: Fix logic for removing mappings in 'acpi_unmap' Myron Stowe @ 2012-02-09 16:42 ` Bjorn Helgaas 2012-02-10 0:08 ` Myron Stowe 0 siblings, 1 reply; 4+ messages in thread From: Bjorn Helgaas @ 2012-02-09 16:42 UTC (permalink / raw) To: Myron Stowe; +Cc: lenb, linux-acpi, ying.huang, tony.luck, trenn, linux-kernel On Thu, Feb 9, 2012 at 8:36 AM, Myron Stowe <myron.stowe@redhat.com> wrote: > From: Myron Stowe <mstowe@redhat.com> > > Make sure the removal of mappings uses the same logic that put the > mappings in place. > > Signed-off-by: Myron Stowe <myron.stowe@redhat.com> > --- > > drivers/acpi/osl.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c > index 412a1e0..5aef087 100644 > --- a/drivers/acpi/osl.c > +++ b/drivers/acpi/osl.c > @@ -347,7 +347,7 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) > unsigned long pfn; > > pfn = pg_off >> PAGE_SHIFT; > - if (page_is_ram(pfn)) > + if (should_use_kmap(pfn)) > kunmap(pfn_to_page(pfn)); > else > iounmap(vaddr); > Whatever happened to the question of why we have arch-specific ioremap() behavior? It's good to make map/unmap symmetric, but it'd be better to get rid of the ioremap/kmap hack. Bjorn ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI: Fix logic for removing mappings in 'acpi_unmap' 2012-02-09 16:42 ` Bjorn Helgaas @ 2012-02-10 0:08 ` Myron Stowe 2012-02-10 2:19 ` Bjorn Helgaas 0 siblings, 1 reply; 4+ messages in thread From: Myron Stowe @ 2012-02-10 0:08 UTC (permalink / raw) To: Bjorn Helgaas Cc: Myron Stowe, lenb, linux-acpi, ying.huang, tony.luck, trenn, linux-kernel, mingo On Thu, 2012-02-09 at 08:42 -0800, Bjorn Helgaas wrote: > On Thu, Feb 9, 2012 at 8:36 AM, Myron Stowe <myron.stowe@redhat.com> wrote: > > From: Myron Stowe <mstowe@redhat.com> > > > > Make sure the removal of mappings uses the same logic that put the > > mappings in place. > > > > Signed-off-by: Myron Stowe <myron.stowe@redhat.com> > > --- > > > > drivers/acpi/osl.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c > > index 412a1e0..5aef087 100644 > > --- a/drivers/acpi/osl.c > > +++ b/drivers/acpi/osl.c > > @@ -347,7 +347,7 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) > > unsigned long pfn; > > > > pfn = pg_off >> PAGE_SHIFT; > > - if (page_is_ram(pfn)) > > + if (should_use_kmap(pfn)) > > kunmap(pfn_to_page(pfn)); > > else > > iounmap(vaddr); > > > > Whatever happened to the question of why we have arch-specific > ioremap() behavior? It's good to make map/unmap symmetric, but it'd > be better to get rid of the ioremap/kmap hack. +cc ingo We never received any explanation for why ioremap() failed for Ying with RAM on x86. Last I saw Ying asked Ingo for some input here but there was never any reply - http://marc.info/?l=linux-acpi&m=132788392604738&w=2 I like your idea of possibly changing ioremap's implementation so that it would handle requests related to RAM - by using kmap() internally when necessary - so that a *user* wouldn't need to care what architecture we're on. I, however, feel like I don't have enough experience with the memory management subsystem to know if such a tactic would fly or not so was uncomfortable proceeding along those lines. As a result, I just wanted to get this in for the meantime. Myron > > Bjorn ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI: Fix logic for removing mappings in 'acpi_unmap' 2012-02-10 0:08 ` Myron Stowe @ 2012-02-10 2:19 ` Bjorn Helgaas 0 siblings, 0 replies; 4+ messages in thread From: Bjorn Helgaas @ 2012-02-10 2:19 UTC (permalink / raw) To: Myron Stowe Cc: Myron Stowe, lenb, linux-acpi, ying.huang, tony.luck, trenn, linux-kernel, mingo On Thu, Feb 9, 2012 at 4:08 PM, Myron Stowe <mstowe@redhat.com> wrote: > On Thu, 2012-02-09 at 08:42 -0800, Bjorn Helgaas wrote: >> On Thu, Feb 9, 2012 at 8:36 AM, Myron Stowe <myron.stowe@redhat.com> wrote: >> > From: Myron Stowe <mstowe@redhat.com> >> > >> > Make sure the removal of mappings uses the same logic that put the >> > mappings in place. >> > >> > Signed-off-by: Myron Stowe <myron.stowe@redhat.com> >> > --- >> > >> > drivers/acpi/osl.c | 2 +- >> > 1 files changed, 1 insertions(+), 1 deletions(-) >> > >> > diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c >> > index 412a1e0..5aef087 100644 >> > --- a/drivers/acpi/osl.c >> > +++ b/drivers/acpi/osl.c >> > @@ -347,7 +347,7 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) >> > unsigned long pfn; >> > >> > pfn = pg_off >> PAGE_SHIFT; >> > - if (page_is_ram(pfn)) >> > + if (should_use_kmap(pfn)) >> > kunmap(pfn_to_page(pfn)); >> > else >> > iounmap(vaddr); >> > >> >> Whatever happened to the question of why we have arch-specific >> ioremap() behavior? It's good to make map/unmap symmetric, but it'd >> be better to get rid of the ioremap/kmap hack. > > +cc ingo > > We never received any explanation for why ioremap() failed for Ying with > RAM on x86. Last I saw Ying asked Ingo for some input here but there > was never any reply - > http://marc.info/?l=linux-acpi&m=132788392604738&w=2 > > I like your idea of possibly changing ioremap's implementation so that > it would handle requests related to RAM - by using kmap() internally > when necessary - so that a *user* wouldn't need to care what > architecture we're on. I, however, feel like I don't have enough > experience with the memory management subsystem to know if such a tactic > would fly or not so was uncomfortable proceeding along those lines. As > a result, I just wanted to get this in for the meantime. I dunno if you're comfortable with it, but you can always propose a patch doing it how you think it should be done. People are more apt to respond to a concrete patch than to an abstract question about why things are the way they are. Bjorn ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-10 2:19 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-02-09 16:36 [PATCH] ACPI: Fix logic for removing mappings in 'acpi_unmap' Myron Stowe 2012-02-09 16:42 ` Bjorn Helgaas 2012-02-10 0:08 ` Myron Stowe 2012-02-10 2:19 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).