linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.19 2/4] ehca: hcp_phyp.c: correct page mapping in 64k page mode
@ 2006-11-05 20:41 Hoang-Nam Nguyen
  2006-11-07 19:25 ` Roland Dreier
  0 siblings, 1 reply; 11+ messages in thread
From: Hoang-Nam Nguyen @ 2006-11-05 20:41 UTC (permalink / raw)
  To: rolandd; +Cc: linuxppc-dev, raisch, linux-kernel, openib-general

[-- 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;
 }
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-11-13 16:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-05 20:41 [PATCH 2.6.19 2/4] ehca: hcp_phyp.c: correct page mapping in 64k page mode Hoang-Nam Nguyen
2006-11-07 19:25 ` 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

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).