mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: huang ying <huang.ying.caritas@gmail.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	x86@kernel.org
Subject: Re: [PATCH] EFI: Do not use __pa() to get the physical address of an ioremapped memory range
Date: Wed, 14 Sep 2011 20:16:50 +0100	[thread overview]
Message-ID: <1316027810.3466.78.camel@mfleming-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <CAC=cRTPb17tnRqDtwFMkUV7wM9=uoayerK-nj_T25EkXuWgyMg@mail.gmail.com>

On Tue, 2011-09-13 at 16:48 +0800, huang ying wrote:
> On Mon, Sep 12, 2011 at 10:52 PM, Matt Fleming <matt@console-pimps.org> wrote:
> > On Fri, 2011-09-02 at 13:12 +0800, huang ying wrote:
> >> On Thu, Sep 1, 2011 at 8:28 PM, Matt Fleming <matt@console-pimps.org> wrote:
> >> >
> >> > Hmm.. does anyone know why we ioremap_cache() the memory on
> >> > CONFIG_X86_32 instead of ioremap_nocache()? In the case of
> >> > EFI_MEMORY_MAPPED_IO the memory really needs to be uncached. Then if
> >> > we've ioremap'd the memory we should skip set_memory_uc() altogether,
> >> > no?
> >>
> >> Because whether the mapping should be cached is determined by md->attr
> >> instead of md->type.  And besides UC, we may add WC, etc support.
> >
> > Confused.
> >
> > The CONFIG_X86_64 version of efi_ioremap() looks like this,
> >
> > void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
> >                                 u32 type)
> > {
> >        unsigned long last_map_pfn;
> >
> >        if (type == EFI_MEMORY_MAPPED_IO)
> >                return ioremap(phys_addr, size);
> >
> > Which uses md->type to figure out if we should call ioremap(), which on
> > x86 is #define'd to ioremap_nocache(). CONFIG_X86_32 doesn't do this,
> > but it looks to me like it should.
> 
> I don't think this type based solution is the perfect one.

Why? What else would you suggest?

-- 
Matt Fleming, Intel Open Source Technology Center


  reply	other threads:[~2011-09-14 19:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01  6:55 Zhang Rui
2011-09-01  8:14 ` Zhang Rui
2011-09-01 12:28   ` Matt Fleming
2011-09-02  2:18     ` Zhang Rui
2011-09-02  5:12     ` huang ying
2011-09-12 14:52       ` Matt Fleming
2011-09-13  8:48         ` huang ying
2011-09-14 19:16           ` Matt Fleming [this message]
2011-09-15  1:22         ` Shaohua Li
2011-09-15  1:52           ` Zhang Rui
2011-09-15  3:21             ` huang ying

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=1316027810.3466.78.camel@mfleming-mobl1.ger.corp.intel.com \
    --to=matt@console-pimps.org \
    --cc=huang.ying.caritas@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rui.zhang@intel.com \
    --cc=x86@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

all inboxes | Powered by JetHome®