Skip to content

Commit

Permalink
[PATCH] Fix mmap() of /dev/hpet
Browse files Browse the repository at this point in the history
The address passed to io_remap_pfn_range() in hpet_mmap() does not need to
be converted using __pa(): it is already a physical address.  This bug was
found and the patch suggested by Clay Harris.

I introduced this particular bug when making io_remap_pfn_range changes a
few months ago.  In fact mmap()ing /dev/hpet has *never* previously worked:
before my changes __pa() was being executed on an ioremap()ed virtual
address, which is also invalid.

Signed-off-by: Keir Fraser <keir@xensource.com>
Cc: Robert Picco <Robert.Picco@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Keir Fraser authored and Linus Torvalds committed Sep 23, 2005
1 parent 7243cc0 commit 609725f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma)

vma->vm_flags |= VM_IO;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
addr = __pa(addr);

if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
PAGE_SIZE, vma->vm_page_prot)) {
Expand Down

0 comments on commit 609725f

Please sign in to comment.