mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, Bob Picco <bob.picco@hp.com>,
	Clemens Ladisch <clemens@ladisch.de>
Subject: [PATCH 1/7] HPET: Fix mmap() of /dev/hpet
Date: Tue, 04 Oct 2005 14:41:32 +0200 (MEST)	[thread overview]
Message-ID: <20051004124132.23057.29853.schnuffi@turing> (raw)
In-Reply-To: <20051004124126.23057.75614.schnuffi@turing>

From: Keir Fraser <keir@xensource.com>

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>

Index: linux-2.6.13/drivers/char/hpet.c
===================================================================
--- linux-2.6.13.orig/drivers/char/hpet.c	2005-10-03 22:52:30.000000000 +0200
+++ linux-2.6.13/drivers/char/hpet.c	2005-10-03 22:53:09.000000000 +0200
@@ -279,7 +279,6 @@ static int hpet_mmap(struct file *file, 
 
 	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)) {

  reply	other threads:[~2005-10-04 12:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-04 12:41 [PATCH 0/7] more HPET fixes and enhancements Clemens Ladisch
2005-10-04 12:41 ` Clemens Ladisch [this message]
2005-10-04 12:41 ` [PATCH 2/7] HPET: fix HPET_INFO calls from kernel space Clemens Ladisch
2005-10-04 12:41 ` [PATCH 3/7] HPET: fix division by zero in HPET_INFO Clemens Ladisch
2005-10-04 12:41 ` [PATCH 4/7] HPET: fix uninitialized variable in hpet_register() Clemens Ladisch
2005-10-04 12:41 ` [PATCH 5/7] HPET: fix access to multiple HPET devices Clemens Ladisch
2005-10-04 12:41 ` [PATCH 6/7] HPET: remove superfluous indirections Clemens Ladisch
2005-10-04 12:42 ` [PATCH 7/7] HPET: simplify initialization message Clemens Ladisch
2005-10-10 14:17 ` [PATCH 0/7] more HPET fixes and enhancements Bob Picco
2005-10-15  2:30 ` Randy.Dunlap
2005-10-17 16:30   ` Clemens Ladisch
2005-10-18  9:19     ` Takashi Iwai

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=20051004124132.23057.29853.schnuffi@turing \
    --to=clemens@ladisch.de \
    --cc=akpm@osdl.org \
    --cc=bob.picco@hp.com \
    --cc=linux-kernel@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

Powered by JetHome