From: Jack Steiner <steiner@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Fedora-ia64-list] kernel 2.6.16-1.2097_FC6 unbootable on Itanium
Date: Thu, 30 Mar 2006 17:10:31 +0000 [thread overview]
Message-ID: <20060330171031.GA8366@sgi.com> (raw)
In-Reply-To: <442AB6DD.4020800@sgi.com>
On Thu, Mar 30, 2006 at 09:53:39AM -0700, Bjorn Helgaas wrote:
> On Thursday 30 March 2006 08:16, Jack Steiner wrote:
> > acpi_os_map_memory() has changed the order of checking the EFI attributes on
> > pages being mapped. In 2.6.15, if the EFI map indicates that an address
> > supports both cached & uncached references, acpi_os_map_memory() would map
> > it as cached.
>
> > OLD:
> > acpi_os_map_memory
> > if (EFI_MEMORY_WB & efi_mem_attributes(phys)) {
> > *virt = (void __iomem *)phys_to_virt(phys);
> > } else {
> > *virt = ioremap(phys, size);
> > }
> >
> > NEW
> > acpi_os_map_memory() unconditionally calls ioremap() to do the
> > mapping
> >
> > ioremap
> > if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC))
> > return __ioremap(offset, size);
> >
> > if (efi_mem_attribute_range(offset, size, EFI_MEMORY_WB))
> > return phys_to_virt(offset);
>
> I debated whether to check for UC or WB first, and I think I got it
> wrong. My reasoning for UC first was that it was a smaller change
> for the typical case CSR mapping case, because ioremap() used to
> *always* return UC mappings.
>
> But efi_memmap_init() collects full granules of WB memory, without
> regard for whether they also support UC. So if ioremap() needs to
> work for main memory (which is slightly strange in itself, but seems
> to be the precedent), it needs to prefer WB mappings when possible.
>
> > Earlier in the boot, the ACPI tables are unconditionally references as cached:
> >
> > char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
> > {
> > return __va(phys_addr);
> > }
>
> This seems suspicious to me. But we look at some of these ACPI tables
> prior to calling efi_memmap_init(), so it might not be safe to use
> ioremap() yet. It's conceivable that a platform could place ACPI
> tables in UC-only ROM, and this would blow up. But I guess we
> haven't tripped over that yet.
>
> Does the patch below solve your immediate problem?
Looks good.
>
>
> [IA64] ioremap() should prefer WB over UC
>
> efi_memmap_init() collects full granules of WB memory, without
> regard for whether they also support UC. So in order for ioremap()
> to work for main memory, it must prefer WB mappings when possible.
>
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
>
> Index: work-mm5/arch/ia64/mm/ioremap.c
> =================================> --- work-mm5.orig/arch/ia64/mm/ioremap.c 2006-03-23 10:22:40.000000000 -0700
> +++ work-mm5/arch/ia64/mm/ioremap.c 2006-03-30 09:36:57.000000000 -0700
> @@ -21,12 +21,12 @@
> void __iomem *
> ioremap (unsigned long offset, unsigned long size)
> {
> - if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC))
> - return __ioremap(offset, size);
> -
> if (efi_mem_attribute_range(offset, size, EFI_MEMORY_WB))
> return phys_to_virt(offset);
>
> + if (efi_mem_attribute_range(offset, size, EFI_MEMORY_UC))
> + return __ioremap(offset, size);
> +
> /*
> * Someday this should check ACPI resources so we
> * can do the right thing for hot-plugged regions.
--
Thanks
Jack Steiner (steiner@sgi.com) 651-683-5302
Principal Engineer SGI - Silicon Graphics, Inc.
next prev parent reply other threads:[~2006-03-30 17:10 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-29 16:33 [Fedora-ia64-list] kernel 2.6.16-1.2097_FC6 unbootable on Itanium Prarit Bhargava
2006-03-29 16:34 ` Prarit Bhargava
2006-03-29 16:55 ` Chen, Kenneth W
2006-03-29 18:55 ` Prarit Bhargava
2006-03-29 19:01 ` Greg Edwards
2006-03-29 19:55 ` Chen, Kenneth W
2006-03-29 20:13 ` Luck, Tony
2006-03-29 20:51 ` Grant Grundler
2006-03-29 20:57 ` [Fedora-ia64-list] kernel 2.6.16-1.2097_FC6 unbootable on James Bottomley
2006-03-29 20:58 ` [Fedora-ia64-list] kernel 2.6.16-1.2097_FC6 unbootable on Itanium Luck, Tony
2006-03-29 21:36 ` Émeric Maschino
2006-03-29 22:04 ` Jack Steiner
2006-03-30 8:57 ` Jes Sorensen
2006-03-30 9:04 ` Jes Sorensen
2006-03-30 9:08 ` Jes Sorensen
2006-03-30 9:14 ` Keith Owens
2006-03-30 10:11 ` Jes Sorensen
2006-03-30 12:29 ` Jes Sorensen
2006-03-30 13:24 ` Jes Sorensen
2006-03-30 15:16 ` Jack Steiner
2006-03-30 15:42 ` Prarit Bhargava
2006-03-30 15:43 ` David Mosberger-Tang
2006-03-30 15:49 ` Jack Steiner
2006-03-30 15:53 ` David Mosberger-Tang
2006-03-30 16:34 ` H. J. Lu
2006-03-30 16:38 ` Prarit Bhargava
2006-03-30 16:45 ` H. J. Lu
2006-03-30 16:52 ` Prarit Bhargava
2006-03-30 16:53 ` Bjorn Helgaas
2006-03-30 17:10 ` Jack Steiner [this message]
2006-03-30 18:23 ` Luck, Tony
2006-03-30 18:23 ` Prarit Bhargava
2006-03-30 18:54 ` Grant Grundler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060330171031.GA8366@sgi.com \
--to=steiner@sgi.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox