From: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
To: rolandd@cisco.com
Cc: linuxppc-dev@ozlabs.org, raisch@de.ibm.com,
linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH 2.6.19 2/4] ehca: hcp_phyp.c: correct page mapping in 64k page mode
Date: Sun, 5 Nov 2006 21:41:28 +0100 [thread overview]
Message-ID: <200611052141.29030.hnguyen@de.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]
Hello Roland!
This is another patch of ehca for 64k page support. It fixes a bug that maps
4k aligned addresses in 64k page mode in a wrong way.
Thanks!
Nam
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
---
hcp_phyp.c | 5 +++--0018_64kpage_ioremap.patch
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.c b/drivers/infiniband/hw/ehca/hcp_phyp.c
index 0b1a477..6237252 100644
--- a/drivers/infiniband/hw/ehca/hcp_phyp.c
+++ b/drivers/infiniband/hw/ehca/hcp_phyp.c
@@ -44,13 +44,14 @@ #include "hipz_hw.h"
int hcall_map_page(u64 physaddr, u64 *mapaddr)
{
- *mapaddr = (u64)(ioremap(physaddr, EHCA_PAGESIZE));
+ *mapaddr = (u64)ioremap((physaddr & PAGE_MASK), PAGE_SIZE) +
+ (physaddr & (~PAGE_MASK));
return 0;
}
int hcall_unmap_page(u64 mapaddr)
{
- iounmap((volatile void __iomem*)mapaddr);
+ iounmap((void __iomem*)(mapaddr & PAGE_MASK));
return 0;
}
[-- Attachment #2: roland_svnehca_0018_64kpage_ioremap.patch --]
[-- Type: text/x-diff, Size: 615 bytes --]
diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.c b/drivers/infiniband/hw/ehca/hcp_phyp.c
index 0b1a477..6237252 100644
--- a/drivers/infiniband/hw/ehca/hcp_phyp.c
+++ b/drivers/infiniband/hw/ehca/hcp_phyp.c
@@ -44,13 +44,14 @@ #include "hipz_hw.h"
int hcall_map_page(u64 physaddr, u64 *mapaddr)
{
- *mapaddr = (u64)(ioremap(physaddr, EHCA_PAGESIZE));
+ *mapaddr = (u64)ioremap((physaddr & PAGE_MASK), PAGE_SIZE) +
+ (physaddr & (~PAGE_MASK));
return 0;
}
int hcall_unmap_page(u64 mapaddr)
{
- iounmap((volatile void __iomem*)mapaddr);
+ iounmap((void __iomem*)(mapaddr & PAGE_MASK));
return 0;
}
next reply other threads:[~2006-11-05 20:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-05 20:41 Hoang-Nam Nguyen [this message]
2006-11-07 19:25 ` [PATCH 2.6.19 2/4] ehca: hcp_phyp.c: correct page mapping in 64k page mode Roland Dreier
2006-11-08 10:22 ` Christoph Raisch
2006-11-08 22:06 ` Roland Dreier
2006-11-09 6:36 ` Paul Mackerras
2006-11-09 21:58 ` Roland Dreier
2006-11-10 7:49 ` [openib-general] " Christoph Raisch
2006-11-10 8:46 ` Paul Mackerras
2006-11-13 16:39 ` Roland Dreier
2006-11-13 16:40 ` Christoph Raisch
2006-11-13 16:40 ` Roland Dreier
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=200611052141.29030.hnguyen@de.ibm.com \
--to=hnguyen@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=openib-general@openib.org \
--cc=raisch@de.ibm.com \
--cc=rolandd@cisco.com \
/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;
as well as URLs for NNTP newsgroup(s).