lkml.org 
[lkml]   [2008]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [patch 09/11] PAT x86: Add ioremap_wc support
From
Date
 > >I don't think that's a good idea. Drivers should be able to 
> >detect this somehow.
> >Handling UC mappings as WC will probably give very poor results.

> It is the other way. ioremap_wc aliases to ioremap_nocache.
> This was based on earlier feedback from Roland.

> >From: Roland Dreier [mailto:rdreier@cisco.com]
> >I think ioremap_wc() needs to be available on all archs for this to be
> >really useful to drivers. It can be a fallback to ioremap_nocache()
> >everywhere except 64-bit x86, but it's not nice for every driver that
> >wants to use this to need an "#ifdef X86" or whatever.

Yes... my basic point is simply that the kernel interfaces to this WC
stuff must be available on all architectures, even if it's stubbed out
on architectures that don't support write-combining or where it hasn't
been implemented yet. I think the only sane way to stub it out is to
fall back to uncached...

It's not going to be useful if drivers need crazy #ifdefs to decide
whether to use ioremap_wc(), pgprot_writecombine() or whatever. Just
look at the mess in drm_io_prot() in drm_vm.c to see what I want to
avoid.

Just to be explicit, my interest in this is that I want to be able to
merge the patch below and have the mlx4 driver still build and work on
every arch that has PCI support:

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index d8287d9..5eac9c6 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -381,8 +381,7 @@ static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
PAGE_SIZE, vma->vm_page_prot))
return -EAGAIN;
} else if (vma->vm_pgoff == 1 && dev->dev->caps.bf_reg_size != 0) {
- /* FIXME want pgprot_writecombine() for BlueFlame pages */
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);

if (io_remap_pfn_range(vma, vma->vm_start,
to_mucontext(context)->uar.pfn +


\
 
 \ /
  Last update: 2008-01-12 01:37    [W:0.111 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site