Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: yanh <yanh@lemote.com>
To: Zhang Le <r0bertz@gentoo.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 3/3] MIPS: handle write_combine in pci_mmap_page_range
Date: Fri, 08 May 2009 16:54:47 +0800	[thread overview]
Message-ID: <1241772887.9177.139.camel@localhost.localdomain> (raw)
In-Reply-To: <a892c7470d85f9563cc74c766fb4dd7f2fa0b801.1241764065.git.r0bertz@gentoo.org>


在 2009-05-08五的 14:30 +0800,Zhang Le写道:
> Signed-off-by: Zhang Le <r0bertz@gentoo.org>
> ---
>  arch/mips/pci/pci.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
> index b0eb9e7..4ca53ef 100644
> --- a/arch/mips/pci/pci.c
> +++ b/arch/mips/pci/pci.c
> @@ -346,10 +346,14 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
>  		return -EINVAL;
>  
>  	/*
> -	 * Ignore write-combine; for now only return uncached mappings.
> +	 * For write-combine, return uncached accelerated mappings if CPU
> +	 * supports; otherwise, return uncached mappings.
>  	 */
>  	prot = pgprot_val(vma->vm_page_prot);
> -	prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
> +	if (write_combine && cpu_has_uncached_accelerated)
> +		prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED_ACCELERATED;
> +	else
> +		prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
>  	vma->vm_page_prot = __pgprot(prot);
This should be definietely wrong for MMIOs.
uncache accelleration should only be enabled for addresses which have no
side effect when doing write combine such as video memory.
>  
>  	return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,

  reply	other threads:[~2009-05-08  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08  6:30 [PATCH 0/3] Added uncached accelerated CPU feature Zhang Le
2009-05-08  6:30 ` [PATCH 1/3] MIPS: added cpu_has_uncached_accelerated feature Zhang Le
2009-05-08  6:30 ` [PATCH 2/3] MIPS: Loongson 2 has " Zhang Le
2009-05-08  6:30 ` [PATCH 3/3] MIPS: handle write_combine in pci_mmap_page_range Zhang Le
2009-05-08  8:54   ` yanh [this message]
2009-05-08 10:18     ` Zhang Le

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=1241772887.9177.139.camel@localhost.localdomain \
    --to=yanh@lemote.com \
    --cc=linux-mips@linux-mips.org \
    --cc=r0bertz@gentoo.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