linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.19-rc3 2/2] ehea: 64K page support fix
@ 2006-10-25 11:12 Jan-Bernd Themann
  2006-10-25 16:21 ` Anton Blanchard
  0 siblings, 1 reply; 3+ messages in thread
From: Jan-Bernd Themann @ 2006-10-25 11:12 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel, linux-ppc,
	Christoph Raisch, Marcus Eder

This patch fixes the 64K page support

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
---
 drivers/net/ehea/ehea.h      |    2 +-
 drivers/net/ehea/ehea_phyp.h |   14 +++++++++++++-
 drivers/net/ehea/ehea_qmr.c  |   13 +++++++------
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index b40724f..cd412b5 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@ #include <asm/abs_addr.h>
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0034"
+#define DRV_VERSION	"EHEA_0040"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
 	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_phyp.h b/drivers/net/ehea/ehea_phyp.h
index fa51e3b..59ab646 100644
--- a/drivers/net/ehea/ehea_phyp.h
+++ b/drivers/net/ehea/ehea_phyp.h
@@ -81,15 +81,27 @@ #define NELR_PORTSTATE_CHG	EHEA_BMASK_IB
 static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel,
 				 u64 paddr_user)
 {
+#ifdef CONFIG_PPC_64K_PAGES
+	/* To support 64k pages we must round to 64k page boundary */
+	epas->kernel.addr =
+		ioremap((paddr_kernel & 0xFFFFFFFFFFFF0000), PAGE_SIZE) +
+		(paddr_kernel & 0xFFFF);
+#else
 	epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE);
+#endif
 	epas->user.addr = paddr_user;
 }
 
 static inline void hcp_epas_dtor(struct h_epas *epas)
 {
+#ifdef CONFIG_PPC_64K_PAGES
+	if (epas->kernel.addr)
+		iounmap((void __iomem*)((u64)epas->kernel.addr &
+					0xFFFFFFFFFFFF0000));
+#else
 	if (epas->kernel.addr)
 		iounmap(epas->kernel.addr);
-
+#endif
 	epas->user.addr = 0;
 	epas->kernel.addr = 0;
 }
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index 3e18623..3daedfa 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -512,7 +512,7 @@ int ehea_reg_mr_adapter(struct ehea_adap
 
 	start = KERNELBASE;
 	end = (u64)high_memory;
-	nr_pages = (end - start) / PAGE_SIZE;
+	nr_pages = (end - start) / EHEA_PAGESIZE;
 
 	pt =  kzalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!pt) {
@@ -538,9 +538,9 @@ int ehea_reg_mr_adapter(struct ehea_adap
 		if (nr_pages > 1) {
 			u64 num_pages = min(nr_pages, (u64)512);
 			for (i = 0; i < num_pages; i++)
-				pt[i] = virt_to_abs((void*)(((u64)start)
-							     + ((k++) *
-								PAGE_SIZE)));
+				pt[i] = virt_to_abs((void*)(((u64)start) +
+							    ((k++) *
+							     EHEA_PAGESIZE)));
 
 			hret = ehea_h_register_rpage_mr(adapter->handle,
 							adapter->mr.handle, 0,
@@ -548,8 +548,9 @@ int ehea_reg_mr_adapter(struct ehea_adap
 							num_pages);
 			nr_pages -= num_pages;
 		} else {
-			u64 abs_adr = virt_to_abs((void*)(((u64)start)
-							   + (k * PAGE_SIZE)));
+			u64 abs_adr = virt_to_abs((void*)(((u64)start) +
+							  (k * EHEA_PAGESIZE)));
+
 			hret = ehea_h_register_rpage_mr(adapter->handle,
 							adapter->mr.handle, 0,
 							0, abs_adr,1);

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

* Re: [PATCH 2.6.19-rc3 2/2] ehea: 64K page support fix
  2006-10-25 11:12 [PATCH 2.6.19-rc3 2/2] ehea: 64K page support fix Jan-Bernd Themann
@ 2006-10-25 16:21 ` Anton Blanchard
  2006-10-26 13:00   ` Jan-Bernd Themann
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2006-10-25 16:21 UTC (permalink / raw)
  To: Jan-Bernd Themann
  Cc: Thomas Klein, Jeff Garzik, Jan-Bernd Themann, netdev,
	linux-kernel, linux-ppc, Christoph Raisch, Marcus Eder


Hi,

> +#ifdef CONFIG_PPC_64K_PAGES
> +	/* To support 64k pages we must round to 64k page boundary */
> +	epas->kernel.addr =
> +		ioremap((paddr_kernel & 0xFFFFFFFFFFFF0000), PAGE_SIZE) +
> +		(paddr_kernel & 0xFFFF);
> +#else
>  	epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE);
> +#endif

Cant you just use PAGE_MASK, ~PAGE_MASK and remove the ifdefs
completely?

Anton

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

* Re: [PATCH 2.6.19-rc3 2/2] ehea: 64K page support fix
  2006-10-25 16:21 ` Anton Blanchard
@ 2006-10-26 13:00   ` Jan-Bernd Themann
  0 siblings, 0 replies; 3+ messages in thread
From: Jan-Bernd Themann @ 2006-10-26 13:00 UTC (permalink / raw)
  To: Anton Blanchard
  Cc: Thomas Klein, Jeff Garzik, Jan-Bernd Themann, netdev,
	linux-kernel, linux-ppc, Christoph Raisch, Marcus Eder

Hi,

that is right, I'll send a new patch

Thanks,
Jan-Bernd

On Wednesday 25 October 2006 18:21, Anton Blanchard wrote:
> 
> Hi,
> 
> > +#ifdef CONFIG_PPC_64K_PAGES
> > +	/* To support 64k pages we must round to 64k page boundary */
> > +	epas->kernel.addr =
> > +		ioremap((paddr_kernel & 0xFFFFFFFFFFFF0000), PAGE_SIZE) +
> > +		(paddr_kernel & 0xFFFF);
> > +#else
> >  	epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE);
> > +#endif
> 
> Cant you just use PAGE_MASK, ~PAGE_MASK and remove the ifdefs
> completely?
> 
> Anton
> 

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

end of thread, other threads:[~2006-10-26 13:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 11:12 [PATCH 2.6.19-rc3 2/2] ehea: 64K page support fix Jan-Bernd Themann
2006-10-25 16:21 ` Anton Blanchard
2006-10-26 13:00   ` Jan-Bernd Themann

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