LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: pmf_register_irq_client gives sleep with locks held warning
From: Benjamin Herrenschmidt @ 2006-06-10 22:04 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Andrew Morton, linuxppc-dev list
In-Reply-To: <1149931638.3864.34.camel@johannes.berg>

On Sat, 2006-06-10 at 11:27 +0200, Johannes Berg wrote:
> On Sat, 2006-06-10 at 10:03 +1000, Benjamin Herrenschmidt wrote:
> 
> > > I don't think your patch is right, it seems to me that now
> > > pmf_unregister_irq_client races against pmf_do_irq: what happens when an
> > > interrupt comes in right in the middle of the list_del()?
> > 
> > Yeah, possibly... too late for 2.6.17 tho.
> 
> That's ok, we don't have any in-kernel users anyway. Alas the alsa
> people will be dissatisfied because they like to ship new drivers for
> old kernels or something. Oh well, I don't care.

We still want people to build out-of-tree for 2.6.17 (please keep the
git there for that), as it will take a while before 2.6.18 is here.

The remaining possible bug in the pmf irq code is probably harmless in
99.99% of the cases in practice :)

Ben.

^ permalink raw reply

* sleep / wake-up
From: Guennadi Liakhovetski @ 2006-06-10 18:39 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

This is a complete newbie question - just like I am on powerpc. How does 
one put to sleep / wake up an embedded ppc (mpc8241) system? Notice, I've 
never done it (sleep / suspend) on x86 either, and I only have a VERY 
vague idea of what it's all about... But I'd read if I knew what and where 
- half an hour googleing didn't bring any positive results apart from 
links to pbbuttonsd, which mainly describes ppc / apple notebooks.

What I'd like to know is a bit of theory - kernel-level support and 
user-level utilities, as well as what one does practically to put a ppc to 
sleep / wake it up.

Thanks
Guennadi
---
Guennadi Liakhovetski

^ permalink raw reply

* Re: 2.6.16-rc6-mm2
From: Felix Oxley @ 2006-06-10 15:40 UTC (permalink / raw)
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <448ADDA1.7090608@mbligh.org>


On 10 Jun 2006, at 15:56, Martin J. Bligh wrote:
>
> The non-PPC64 machines seem to have done a clean run for the first  
> time
> in a while ... yay!
>

Do you mean PowerBook G4 for example?
I have a been unable to compile 2.6.17-rc6-mm2 on my PowerBook.

As I, recently, reported here: http://lkml.org/lkml/2006/6/10/60

Error is:
CC      arch/powerpc/kernel/signal_32.o
arch/powerpc/kernel/signal_32.c: In function ‘handle_rt_signal’:
arch/powerpc/kernel/signal_32.c:763: error: request for member  
‘vdso_base’ in
something not a structure or union
arch/powerpc/kernel/signal_32.c:766: error: request for member  
‘vdso_base’ in
something not a structure or union
arch/powerpc/kernel/signal_32.c: In function ‘handle_signal’:
arch/powerpc/kernel/signal_32.c:1037: error: request for member  
‘vdso_base’ in
something not a structure or union
arch/powerpc/kernel/signal_32.c:1040: error: request for member  
‘vdso_base’ in
something not a structure or union
make[1]: *** [arch/powerpc/kernel/signal_32.o] Error 1
make: *** [arch/powerpc/kernel] Error 2

Any ideas?
Thanks,
Felix

^ permalink raw reply

* Re: 2.6.16-rc6-mm2
From: Andrew Morton @ 2006-06-10 16:43 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: linuxppc64-dev, Paul Mackerras, linux-kernel
In-Reply-To: <448ADDA1.7090608@mbligh.org>

On Sat, 10 Jun 2006 07:56:33 -0700
"Martin J. Bligh" <mbligh@mbligh.org> wrote:

> Andrew Morton wrote:
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17-rc6/2.6.17-rc6-mm2/
> > 
> > 
> > - Added the s390 git tree to the -mm lineup, as git-s390.patch (Martin
> >   Schwidefsky)
> > 
> > - ppc64 (on mac g5) fails to boot for me, due to changes in the powerpc tree.
> 
> Doesn't even build here.
> 
> arch/powerpc/platforms/built-in.o(.text+0x1053c): In function 
> `.scanlog_read':
> : undefined reference to `.rtas_extended_busy_delay_time'
> 
> Config:
> http://ftp.kernel.org/pub/linux/kernel/people/mbligh/config/abat/p570
> or
> http://ftp.kernel.org/pub/linux/kernel/people/mbligh/config/abat/power4
> 

Yes, the gremlins seems to have got at the powerpc tree.

> 
> The non-PPC64 machines seem to have done a clean run for the first time
> in a while ... yay!

That is good, thanks.

^ permalink raw reply

* [PATCH] powerpc: system call micro optimisation
From: Anton Blanchard @ 2006-06-10 15:15 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


In the syscall path we currently have:

       crclr   so
       mfcr    r9

If we shift the crclr up we can avoid a stall on some CPUs.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: kernel/arch/powerpc/kernel/entry_64.S
===================================================================
--- kernel.orig/arch/powerpc/kernel/entry_64.S	2006-04-26 08:03:05.380651922 -0500
+++ kernel/arch/powerpc/kernel/entry_64.S	2006-04-26 08:03:28.076523958 -0500
@@ -59,6 +59,7 @@ system_call_common:
 	beq-	1f
 	ld	r1,PACAKSAVE(r13)
 1:	std	r10,0(r1)
+	crclr	so
 	std	r11,_NIP(r1)
 	std	r12,_MSR(r1)
 	std	r0,GPR0(r1)
@@ -77,7 +78,6 @@ system_call_common:
 	std	r11,GPR11(r1)
 	std	r11,GPR12(r1)
 	std	r9,GPR13(r1)
-	crclr	so
 	mfcr	r9
 	mflr	r10
 	li	r11,0xc01

^ permalink raw reply

* [PATCH] Link error when futexes are disabled on 64bit architectures
From: Anton Blanchard @ 2006-06-10 15:01 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: akpm


If futexes are disabled we fail to link on ppc64.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: kernel/kernel/exit.c
===================================================================
--- kernel.orig/kernel/exit.c	2006-04-16 20:50:51.000000000 -0500
+++ kernel/kernel/exit.c	2006-04-16 21:05:32.570315496 -0500
@@ -906,7 +906,7 @@ fastcall NORET_TYPE void do_exit(long co
 	}
 	if (unlikely(tsk->robust_list))
 		exit_robust_list(tsk);
-#ifdef CONFIG_COMPAT
+#if defined(CONFIG_FUTEX) && defined(CONFIG_COMPAT)
 	if (unlikely(tsk->compat_robust_list))
 		compat_exit_robust_list(tsk);
 #endif

^ permalink raw reply

* Re: 2.6.16-rc6-mm2
From: Martin J. Bligh @ 2006-06-10 14:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
In-Reply-To: <20060609214024.2f7dd72c.akpm@osdl.org>

Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17-rc6/2.6.17-rc6-mm2/
> 
> 
> - Added the s390 git tree to the -mm lineup, as git-s390.patch (Martin
>   Schwidefsky)
> 
> - ppc64 (on mac g5) fails to boot for me, due to changes in the powerpc tree.

Doesn't even build here.

arch/powerpc/platforms/built-in.o(.text+0x1053c): In function 
`.scanlog_read':
: undefined reference to `.rtas_extended_busy_delay_time'

Config:
http://ftp.kernel.org/pub/linux/kernel/people/mbligh/config/abat/p570
or
http://ftp.kernel.org/pub/linux/kernel/people/mbligh/config/abat/power4


The non-PPC64 machines seem to have done a clean run for the first time
in a while ... yay!

M.

^ permalink raw reply

* Re: [PATCH 2/10 v2] Add the MPC8641 HPCN platform files.
From: Segher Boessenkool @ 2006-06-10 13:52 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org, Jon Loeliger
In-Reply-To: <1149890843.12687.66.camel@localhost.localdomain>

>>> Cascade handling is changing with my genirq port. It will be easy to
>>> adapt though. Same comments howveer, you should have a device- 
>>> tree node
>>> for the 8259 (under an ISA bridge, those shall really be in the
>>> device-tree). In general, on-board bridges should be in the  
>>> device-tree,
>>> only slots or standardly routed child PCI devices need not.
>>
>> Can you send me an example?
>
> I'll try to dig something. Power3 at least has MPIC<->8259 cascade, as
> do some IBM blades when running bare metal kernels.

On the blades, the 8259 isn't cascaded to the MPIC.  And we disable
it completely anyway ;-)


Segher

^ permalink raw reply

* [PATCH] powerpc: Fix HV bit handling on non partitioned machines
From: Anton Blanchard @ 2006-06-10 13:14 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


On non partitioned machines we currently set the HV bit in kernel space
only. It turns out we are supposed to maintain the HV bit in both user
and kernel space.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/include/asm-powerpc/reg.h
===================================================================
--- build.orig/include/asm-powerpc/reg.h	2006-05-27 10:02:39.000000000 +1000
+++ build/include/asm-powerpc/reg.h	2006-05-27 10:09:46.000000000 +1000
@@ -93,8 +93,8 @@
 #define MSR_LE		__MASK(MSR_LE_LG)	/* Little Endian */
 
 #ifdef CONFIG_PPC64
-#define MSR_		MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF
-#define MSR_KERNEL      MSR_ | MSR_SF | MSR_HV
+#define MSR_		MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV
+#define MSR_KERNEL      MSR_ | MSR_SF
 
 #define MSR_USER32	MSR_ | MSR_PR | MSR_EE
 #define MSR_USER64	MSR_USER32 | MSR_SF

^ permalink raw reply

* [PATCH] powerpc: cleanup dma_mapping_ops
From: Anton Blanchard @ 2006-06-10 13:04 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


For pseries IOMMU bypass I want to be able to fall back to the regular
IOMMU ops. Do this by creating a dma_mapping_ops struct, and convert
the others while at it.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/kernel/pci_iommu.c
===================================================================
--- build.orig/arch/powerpc/kernel/pci_iommu.c	2006-06-10 11:37:31.000000000 +1000
+++ build/arch/powerpc/kernel/pci_iommu.c	2006-06-10 22:35:25.000000000 +1000
@@ -148,13 +148,17 @@ static int pci_iommu_dma_supported(struc
 		return 1;
 }
 
+struct dma_mapping_ops pci_iommu_ops = {
+	.alloc_coherent = pci_iommu_alloc_coherent,
+	.free_coherent = pci_iommu_free_coherent,
+	.map_single = pci_iommu_map_single,
+	.unmap_single = pci_iommu_unmap_single,
+	.map_sg = pci_iommu_map_sg,
+	.unmap_sg = pci_iommu_unmap_sg,
+	.dma_supported = pci_iommu_dma_supported,
+};
+
 void pci_iommu_init(void)
 {
-	pci_dma_ops.alloc_coherent = pci_iommu_alloc_coherent;
-	pci_dma_ops.free_coherent = pci_iommu_free_coherent;
-	pci_dma_ops.map_single = pci_iommu_map_single;
-	pci_dma_ops.unmap_single = pci_iommu_unmap_single;
-	pci_dma_ops.map_sg = pci_iommu_map_sg;
-	pci_dma_ops.unmap_sg = pci_iommu_unmap_sg;
-	pci_dma_ops.dma_supported = pci_iommu_dma_supported;
+	pci_dma_ops = pci_iommu_ops;
 }
Index: build/arch/powerpc/kernel/pci_direct_iommu.c
===================================================================
--- build.orig/arch/powerpc/kernel/pci_direct_iommu.c	2006-06-08 10:57:36.000000000 +1000
+++ build/arch/powerpc/kernel/pci_direct_iommu.c	2006-06-10 22:35:25.000000000 +1000
@@ -82,13 +82,17 @@ static int pci_direct_dma_supported(stru
 	return mask < 0x100000000ull;
 }
 
+static struct dma_mapping_ops pci_direct_ops = {
+	.alloc_coherent = pci_direct_alloc_coherent,
+	.free_coherent = pci_direct_free_coherent,
+	.map_single = pci_direct_map_single,
+	.unmap_single = pci_direct_unmap_single,
+	.map_sg = pci_direct_map_sg,
+	.unmap_sg = pci_direct_unmap_sg,
+	.dma_supported = pci_direct_dma_supported,
+};
+
 void __init pci_direct_iommu_init(void)
 {
-	pci_dma_ops.alloc_coherent = pci_direct_alloc_coherent;
-	pci_dma_ops.free_coherent = pci_direct_free_coherent;
-	pci_dma_ops.map_single = pci_direct_map_single;
-	pci_dma_ops.unmap_single = pci_direct_unmap_single;
-	pci_dma_ops.map_sg = pci_direct_map_sg;
-	pci_dma_ops.unmap_sg = pci_direct_unmap_sg;
-	pci_dma_ops.dma_supported = pci_direct_dma_supported;
+	pci_dma_ops = pci_direct_ops;
 }
Index: build/arch/powerpc/platforms/cell/iommu.c
===================================================================
--- build.orig/arch/powerpc/platforms/cell/iommu.c	2006-06-08 10:57:36.000000000 +1000
+++ build/arch/powerpc/platforms/cell/iommu.c	2006-06-10 22:35:25.000000000 +1000
@@ -473,6 +473,16 @@ static int cell_dma_supported(struct dev
 	return mask < 0x100000000ull;
 }
 
+static struct dma_mapping_ops cell_iommu_ops = {
+	.alloc_coherent = cell_alloc_coherent,
+	.free_coherent = cell_free_coherent,
+	.map_single = cell_map_single,
+	.unmap_single = cell_unmap_single,
+	.map_sg = cell_map_sg,
+	.unmap_sg = cell_unmap_sg,
+	.dma_supported = cell_dma_supported,
+};
+
 void cell_init_iommu(void)
 {
 	int setup_bus = 0;
@@ -498,11 +508,5 @@ void cell_init_iommu(void)
 		}
 	}
 
-	pci_dma_ops.alloc_coherent = cell_alloc_coherent;
-	pci_dma_ops.free_coherent = cell_free_coherent;
-	pci_dma_ops.map_single = cell_map_single;
-	pci_dma_ops.unmap_single = cell_unmap_single;
-	pci_dma_ops.map_sg = cell_map_sg;
-	pci_dma_ops.unmap_sg = cell_unmap_sg;
-	pci_dma_ops.dma_supported = cell_dma_supported;
+	pci_dma_ops = cell_iommu_ops;
 }

^ permalink raw reply

* Re: [PATCH] powerpc: console_initcall ordering issues
From: Arnd Bergmann @ 2006-06-10 12:53 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: akpm, paulus, Milton Miller
In-Reply-To: <20060610121622.GQ23891@krispykreme>

Am Saturday 10 June 2006 14:16 schrieb Anton Blanchard:
> The add_preferred_console call in rtas_console.c was not causing the
> console to be selected. It turns out that the add_preferred_console
> was being called after the hvc_console driver was registered. It only
> works when it is called before the console driver is registered.

Great, thanks for nailing this one down. We've had multiple people trying
without success to figure out why it couldn't automatically find the console.

	Arnd <><

^ permalink raw reply

* [PATCH] powerpc: console_initcall ordering issues
From: Anton Blanchard @ 2006-06-10 12:16 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: akpm, paulus


From: Milton Miller <miltonm@bga.com>

The add_preferred_console call in rtas_console.c was not causing the
console to be selected. It turns out that the add_preferred_console
was being called after the hvc_console driver was registered. It only
works when it is called before the console driver is registered.

Reorder hvc_console.o after the hvc_console drivers to allow the selection
during console_initcall processing.

Signed-Off-By: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: kernel/drivers/char/Makefile
===================================================================
--- kernel.orig/drivers/char/Makefile	2006-06-05 22:49:52.056236490 -0500
+++ kernel/drivers/char/Makefile	2006-06-05 22:50:12.918997949 -0500
@@ -41,9 +41,9 @@ obj-$(CONFIG_N_HDLC)		+= n_hdlc.o
 obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
 obj-$(CONFIG_SX)		+= sx.o generic_serial.o
 obj-$(CONFIG_RIO)		+= rio/ generic_serial.o
-obj-$(CONFIG_HVC_DRIVER)	+= hvc_console.o
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_vio.o hvsi.o
 obj-$(CONFIG_HVC_RTAS)		+= hvc_rtas.o
+obj-$(CONFIG_HVC_DRIVER)	+= hvc_console.o
 obj-$(CONFIG_RAW_DRIVER)	+= raw.o
 obj-$(CONFIG_SGI_SNSC)		+= snsc.o snsc_event.o
 obj-$(CONFIG_MMTIMER)		+= mmtimer.o

^ permalink raw reply

* [PATCH] powerpc: Fix shared processor and mdelay interaction
From: Anton Blanchard @ 2006-06-10 11:25 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


Paul and Ben found an interaction with mdelay on shared processor where
mdelay can have large errors.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/include/asm-powerpc/delay.h
===================================================================
--- build.orig/include/asm-powerpc/delay.h	2006-06-08 10:57:41.000000000 +1000
+++ build/include/asm-powerpc/delay.h	2006-06-10 21:15:02.000000000 +1000
@@ -17,5 +17,18 @@
 extern void __delay(unsigned long loops);
 extern void udelay(unsigned long usecs);
 
+/*
+ * On shared processor machines the generic implementation of mdelay can
+ * result in large errors. While each iteration of the loop inside mdelay
+ * is supposed to take 1ms, the hypervisor could sleep our partition for
+ * longer (eg 10ms). With the right timing these errors can add up.
+ *
+ * Since there is no 32bit overflow issue on 64bit kernels, just call
+ * udelay directly.
+ */
+#ifdef CONFIG_PPC64
+#define mdelay(n)	udelay((n) * 1000)
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DELAY_H */
Index: build/include/linux/delay.h
===================================================================
--- build.orig/include/linux/delay.h	2006-06-08 10:57:41.000000000 +1000
+++ build/include/linux/delay.h	2006-06-10 21:04:58.000000000 +1000
@@ -25,10 +25,7 @@ extern unsigned long loops_per_jiffy;
 #define MAX_UDELAY_MS	5
 #endif
 
-#ifdef notdef
-#define mdelay(n) (\
-	{unsigned long __ms=(n); while (__ms--) udelay(1000);})
-#else
+#ifndef mdelay
 #define mdelay(n) (\
 	(__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \
 	({unsigned long __ms=(n); while (__ms--) udelay(1000);}))

^ permalink raw reply

* [PATCH] powerpc: node local IOMMU tables
From: Anton Blanchard @ 2006-06-10 10:58 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


Allocate IOMMU tables node local.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/kernel/iommu.c
===================================================================
--- build.orig/arch/powerpc/kernel/iommu.c	2006-05-27 10:01:01.000000000 +1000
+++ build/arch/powerpc/kernel/iommu.c	2006-05-27 10:05:56.000000000 +1000
@@ -418,10 +418,11 @@ void iommu_unmap_sg(struct iommu_table *
  * Build a iommu_table structure.  This contains a bit map which
  * is used to manage allocation of the tce space.
  */
-struct iommu_table *iommu_init_table(struct iommu_table *tbl)
+struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
 {
 	unsigned long sz;
 	static int welcomed = 0;
+	struct page *page;
 
 	/* Set aside 1/4 of the table for large allocations. */
 	tbl->it_halfpoint = tbl->it_size * 3 / 4;
@@ -429,10 +430,10 @@ struct iommu_table *iommu_init_table(str
 	/* number of bytes needed for the bitmap */
 	sz = (tbl->it_size + 7) >> 3;
 
-	tbl->it_map = (unsigned long *)__get_free_pages(GFP_ATOMIC, get_order(sz));
-	if (!tbl->it_map)
+	page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz));
+	if (!page)
 		panic("iommu_init_table: Can't allocate %ld bytes\n", sz);
-
+	tbl->it_map = page_address(page);
 	memset(tbl->it_map, 0, sz);
 
 	tbl->it_hint = 0;
Index: build/arch/powerpc/platforms/pseries/iommu.c
===================================================================
--- build.orig/arch/powerpc/platforms/pseries/iommu.c	2006-05-27 10:02:39.000000000 +1000
+++ build/arch/powerpc/platforms/pseries/iommu.c	2006-05-27 10:08:16.000000000 +1000
@@ -368,10 +368,11 @@ static void iommu_bus_setup_pSeries(stru
 	pci->phb->dma_window_size = 0x8000000ul;
 	pci->phb->dma_window_base_cur = 0x8000000ul;
 
-	tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
+	tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
+			   pci->phb->node);
 
 	iommu_table_setparms(pci->phb, dn, tbl);
-	pci->iommu_table = iommu_init_table(tbl);
+	pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
 
 	/* Divide the rest (1.75GB) among the children */
 	pci->phb->dma_window_size = 0x80000000ul;
@@ -414,12 +415,12 @@ static void iommu_bus_setup_pSeriesLP(st
 
 		ppci->bussubno = bus->number;
 
-		tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
-						    GFP_KERNEL);
+		tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
+				   ppci->phb->node);
 
 		iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
 
-		ppci->iommu_table = iommu_init_table(tbl);
+		ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
 	}
 
 	if (pdn != dn)
@@ -442,9 +443,11 @@ static void iommu_dev_setup_pSeries(stru
 	 */
 	if (!dev->bus->self) {
 		DBG(" --> first child, no bridge. Allocating iommu table.\n");
-		tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
+		tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
+				   PCI_DN(dn)->phb->node);
 		iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl);
-		PCI_DN(mydn)->iommu_table = iommu_init_table(tbl);
+		PCI_DN(dn)->iommu_table = iommu_init_table(tbl,
+						PCI_DN(dn)->phb->node);
 
 		return;
 	}
@@ -526,12 +529,12 @@ static void iommu_dev_setup_pSeriesLP(st
 		/* iommu_table_setparms_lpar needs bussubno. */
 		pci->bussubno = pci->phb->bus->number;
 
-		tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
-						    GFP_KERNEL);
+		tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
+				   pci->phb->node);
 
 		iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
 
-		pci->iommu_table = iommu_init_table(tbl);
+		pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
 	}
 
 	if (pdn != dn)
Index: build/arch/powerpc/sysdev/dart_iommu.c
===================================================================
--- build.orig/arch/powerpc/sysdev/dart_iommu.c	2006-05-27 10:01:01.000000000 +1000
+++ build/arch/powerpc/sysdev/dart_iommu.c	2006-05-27 10:05:56.000000000 +1000
@@ -246,7 +246,7 @@ static void iommu_table_dart_setup(void)
 	iommu_table_dart.it_base = (unsigned long)dart_vbase;
 	iommu_table_dart.it_index = 0;
 	iommu_table_dart.it_blocksize = 1;
-	iommu_init_table(&iommu_table_dart);
+	iommu_init_table(&iommu_table_dart, -1);
 
 	/* Reserve the last page of the DART to avoid possible prefetch
 	 * past the DART mapped area
Index: build/arch/powerpc/platforms/iseries/iommu.c
===================================================================
--- build.orig/arch/powerpc/platforms/iseries/iommu.c	2006-05-27 10:02:39.000000000 +1000
+++ build/arch/powerpc/platforms/iseries/iommu.c	2006-05-27 10:05:56.000000000 +1000
@@ -173,7 +173,7 @@ void iommu_devnode_init_iSeries(struct d
 	/* Look for existing tce table */
 	pdn->iommu_table = iommu_table_find(tbl);
 	if (pdn->iommu_table == NULL)
-		pdn->iommu_table = iommu_init_table(tbl);
+		pdn->iommu_table = iommu_init_table(tbl, -1);
 	else
 		kfree(tbl);
 }
Index: build/include/asm-powerpc/iommu.h
===================================================================
--- build.orig/include/asm-powerpc/iommu.h	2006-05-27 10:01:01.000000000 +1000
+++ build/include/asm-powerpc/iommu.h	2006-05-27 10:05:56.000000000 +1000
@@ -67,7 +67,8 @@ extern void iommu_free_table(struct devi
 /* Initializes an iommu_table based in values set in the passed-in
  * structure
  */
-extern struct iommu_table *iommu_init_table(struct iommu_table * tbl);
+extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
+					    int nid);
 
 extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
 		struct scatterlist *sglist, int nelems, unsigned long mask,
Index: build/arch/powerpc/kernel/vio.c
===================================================================
--- build.orig/arch/powerpc/kernel/vio.c	2006-05-27 10:02:39.000000000 +1000
+++ build/arch/powerpc/kernel/vio.c	2006-05-27 10:09:21.000000000 +1000
@@ -60,9 +60,9 @@ static void __init iommu_vio_init(void)
 	vio_iommu_table = veth_iommu_table;
 	vio_iommu_table.it_offset += veth_iommu_table.it_size;
 
-	if (!iommu_init_table(&veth_iommu_table))
+	if (!iommu_init_table(&veth_iommu_table, -1))
 		printk("Virtual Bus VETH TCE table failed.\n");
-	if (!iommu_init_table(&vio_iommu_table))
+	if (!iommu_init_table(&vio_iommu_table, -1))
 		printk("Virtual Bus VIO TCE table failed.\n");
 }
 #endif
@@ -98,7 +98,7 @@ static struct iommu_table *vio_build_iom
 		tbl->it_busno = 0;
 		tbl->it_type = TCE_VB;
 
-		return iommu_init_table(tbl);
+		return iommu_init_table(tbl, -1);
 	}
 }
 

^ permalink raw reply

* [PATCH] powerpc: pcibus_to_node fixes
From: Anton Blanchard @ 2006-06-10 10:53 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


of_node_to_nid returns -1 if the associativity cannot be found. This
means pcibus_to_cpumask has to be careful not to pass a negative index into
node_to_cpumask.

Since pcibus_to_node could be used a lot, and of_node_to_nid is slow (it
walks a list doing strcmps), lets also cache the node in the
pci_controller struct.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/kernel/pci_64.c
===================================================================
--- build.orig/arch/powerpc/kernel/pci_64.c	2006-06-10 11:45:51.000000000 +1000
+++ build/arch/powerpc/kernel/pci_64.c	2006-06-10 11:45:54.000000000 +1000
@@ -227,8 +227,10 @@ struct pci_controller * pcibios_alloc_co
 	pci_setup_pci_controller(phb);
 	phb->arch_data = dev;
 	phb->is_dynamic = mem_init_done;
-	if (dev)
+	if (dev) {
+		PHB_SET_NODE(phb, of_node_to_nid(dev));
 		add_linux_pci_domain(dev, phb);
+	}
 	return phb;
 }
 
@@ -1415,3 +1417,12 @@ long sys_pciconfig_iobase(long which, un
 
 	return -EOPNOTSUPP;
 }
+
+#ifdef CONFIG_NUMA
+int pcibus_to_node(struct pci_bus *bus)
+{
+	struct pci_controller *phb = pci_bus_to_host(bus);
+	return phb->node;
+}
+EXPORT_SYMBOL(pcibus_to_node);
+#endif
Index: build/include/asm-powerpc/pci-bridge.h
===================================================================
--- build.orig/include/asm-powerpc/pci-bridge.h	2006-06-10 11:45:51.000000000 +1000
+++ build/include/asm-powerpc/pci-bridge.h	2006-06-10 11:45:54.000000000 +1000
@@ -6,6 +6,7 @@
 #include <asm-ppc/pci-bridge.h>
 #else
 
+#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/list.h>
 
@@ -22,6 +23,7 @@
 struct pci_controller {
 	struct pci_bus *bus;
 	char is_dynamic;
+	int node;
 	void *arch_data;
 	struct list_head list_node;
 
@@ -165,6 +167,12 @@ static inline unsigned long pci_address_
 #define PCI_PROBE_NORMAL	0	/* Do normal PCI probing */
 #define PCI_PROBE_DEVTREE	1	/* Instantiate from device tree */
 
+#ifdef CONFIG_NUMA
+#define PHB_SET_NODE(PHB, NODE)		((PHB)->node = (NODE))
+#else
+#define PHB_SET_NODE(PHB, NODE)		((PHB)->node = -1)
+#endif
+
 #endif /* CONFIG_PPC64 */
 #endif /* __KERNEL__ */
 #endif
Index: build/include/asm-powerpc/topology.h
===================================================================
--- build.orig/include/asm-powerpc/topology.h	2006-06-10 11:45:51.000000000 +1000
+++ build/include/asm-powerpc/topology.h	2006-06-10 11:46:31.000000000 +1000
@@ -32,13 +32,13 @@ static inline int node_to_first_cpu(int 
 
 int of_node_to_nid(struct device_node *device);
 
-#ifdef CONFIG_PPC64
-#define pcibus_to_node(bus)	(of_node_to_nid(bus->sysdata))
-#define pcibus_to_cpumask(bus)	(node_to_cpumask(of_node_to_nid(bus->sysdata)))
-#else
-#define pcibus_to_node(node)    (-1)
-#define pcibus_to_cpumask(bus)	(cpu_online_map)
-#endif
+struct pci_bus;
+extern int pcibus_to_node(struct pci_bus *bus);
+
+#define pcibus_to_cpumask(bus)	(pcibus_to_node(bus) == -1 ? \
+					CPU_MASK_ALL : \
+					node_to_cpumask(pcibus_to_node(bus)) \
+				)
 
 /* sched_domains SD_NODE_INIT for PPC64 machines */
 #define SD_NODE_INIT (struct sched_domain) {		\

^ permalink raw reply

* [PATCH] powerpc: Update pseries defconfig
From: Anton Blanchard @ 2006-06-10 10:37 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


pseries defconfig updates:

- Enable jsm and re-enable qlogic FC drivers as modules.
- Enable ocfs2, autofs4 and fuse filesystems as modules.
- Enable Kprobes.
- Enable ebus, binfmt_misc, sas attrs, md5 reshape, hvc rtas backend and
  some infiniband options.
- Finally disable debug options: DEBUG_MUTEXES and DEBUG_STACK_USAGE.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/configs/pseries_defconfig
===================================================================
--- build.orig/arch/powerpc/configs/pseries_defconfig	2006-05-28 07:36:12.000000000 +1000
+++ build/arch/powerpc/configs/pseries_defconfig	2006-05-28 07:36:31.000000000 +1000
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17-rc1
-# Wed Apr 19 11:48:00 2006
+# Linux kernel version: 2.6.17-rc4
+# Sun May 28 07:26:56 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -11,6 +11,7 @@ CONFIG_GENERIC_HARDIRQS=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_COMPAT=y
@@ -126,8 +127,9 @@ CONFIG_RTAS_PROC=y
 CONFIG_RTAS_FLASH=m
 # CONFIG_MMIO_NVRAM is not set
 CONFIG_IBMVIO=y
-# CONFIG_IBMEBUS is not set
+CONFIG_IBMEBUS=y
 # CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
 # CONFIG_CPU_FREQ is not set
 # CONFIG_WANT_EARLY_SERIAL is not set
 
@@ -143,7 +145,7 @@ CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT is not set
 # CONFIG_PREEMPT_BKL is not set
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
+CONFIG_BINFMT_MISC=m
 CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
 CONFIG_HOTPLUG_CPU=y
@@ -155,6 +157,7 @@ CONFIG_EEH=y
 CONFIG_SCANLOG=m
 CONFIG_LPARCFG=y
 CONFIG_NUMA=y
+CONFIG_NODES_SHIFT=4
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_DEFAULT=y
@@ -467,7 +470,7 @@ CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_SPI_ATTRS=y
 CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
-# CONFIG_SCSI_SAS_ATTRS is not set
+CONFIG_SCSI_SAS_ATTRS=m
 
 #
 # SCSI low-level drivers
@@ -499,13 +502,18 @@ CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
-# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+CONFIG_SCSI_SYM53C8XX_MMIO=y
 CONFIG_SCSI_IPR=y
 CONFIG_SCSI_IPR_TRACE=y
 CONFIG_SCSI_IPR_DUMP=y
-# CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
-# CONFIG_SCSI_QLA_FC is not set
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE=y
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+CONFIG_SCSI_QLA24XX=m
 CONFIG_SCSI_LPFC=m
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -521,7 +529,7 @@ CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_MD_RAID10=m
 CONFIG_MD_RAID5=y
-# CONFIG_MD_RAID5_RESHAPE is not set
+CONFIG_MD_RAID5_RESHAPE=y
 CONFIG_MD_RAID6=m
 CONFIG_MD_MULTIPATH=m
 CONFIG_MD_FAULTY=m
@@ -764,7 +772,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_ICOM=m
-# CONFIG_SERIAL_JSM is not set
+CONFIG_SERIAL_JSM=m
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -773,7 +781,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_TIPAR is not set
 CONFIG_HVC_DRIVER=y
 CONFIG_HVC_CONSOLE=y
-# CONFIG_HVC_RTAS is not set
+CONFIG_HVC_RTAS=y
 CONFIG_HVCS=m
 
 #
@@ -1031,9 +1039,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_ACECAD is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_MTOUCH is not set
-# CONFIG_USB_ITMTOUCH is not set
-# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_TOUCHSCREEN is not set
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
@@ -1105,16 +1111,25 @@ CONFIG_USB_MON=y
 # CONFIG_NEW_LEDS is not set
 
 #
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
 # InfiniBand support
 #
 CONFIG_INFINIBAND=m
-# CONFIG_INFINIBAND_USER_MAD is not set
-# CONFIG_INFINIBAND_USER_ACCESS is not set
+CONFIG_INFINIBAND_USER_MAD=m
+CONFIG_INFINIBAND_USER_ACCESS=m
 CONFIG_INFINIBAND_MTHCA=m
-# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
+CONFIG_INFINIBAND_MTHCA_DEBUG=y
 CONFIG_INFINIBAND_IPOIB=m
-# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
-# CONFIG_INFINIBAND_SRP is not set
+CONFIG_INFINIBAND_IPOIB_DEBUG=y
+# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
+CONFIG_INFINIBAND_SRP=m
 
 #
 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
@@ -1159,15 +1174,15 @@ CONFIG_XFS_EXPORT=y
 CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
-# CONFIG_OCFS2_FS is not set
+CONFIG_OCFS2_FS=m
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
-CONFIG_AUTOFS_FS=m
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
 
 #
 # CD-ROM/DVD Filesystems
@@ -1199,7 +1214,7 @@ CONFIG_TMPFS=y
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
-# CONFIG_CONFIGFS_FS is not set
+CONFIG_CONFIGFS_FS=m
 
 #
 # Miscellaneous filesystems
@@ -1317,7 +1332,7 @@ CONFIG_ZLIB_DEFLATE=m
 #
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
-# CONFIG_KPROBES is not set
+CONFIG_KPROBES=y
 
 #
 # Kernel hacking
@@ -1329,7 +1344,7 @@ CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
-CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -1339,17 +1354,13 @@ CONFIG_DEBUG_FS=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
-CONFIG_DEBUG_STACK_USAGE=y
+# CONFIG_DEBUG_STACK_USAGE is not set
 CONFIG_DEBUGGER=y
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 CONFIG_IRQSTACKS=y
 # CONFIG_BOOTX_TEXT is not set
-# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
-# CONFIG_PPC_EARLY_DEBUG_G5 is not set
-# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
-# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
-# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
 
 #
 # Security options

^ permalink raw reply

* [PATCH] powerpc: Remove stale 64bit on 32bit kernel code
From: Anton Blanchard @ 2006-06-10 10:32 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


Remove some stale POWER3/POWER4/970 on 32bit kernel support.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/kernel/cputable.c
===================================================================
--- build.orig/arch/powerpc/kernel/cputable.c	2006-06-10 11:37:31.000000000 +1000
+++ build/arch/powerpc/kernel/cputable.c	2006-06-10 11:39:51.000000000 +1000
@@ -189,17 +189,11 @@ struct cpu_spec	cpu_specs[] = {
 		.oprofile_type		= PPC_OPROFILE_POWER4,
 		.platform		= "ppc970",
 	},
-#endif /* CONFIG_PPC64 */
-#if defined(CONFIG_PPC64) || defined(CONFIG_POWER4)
 	{	/* PPC970FX */
 		.pvr_mask		= 0xffff0000,
 		.pvr_value		= 0x003c0000,
 		.cpu_name		= "PPC970FX",
-#ifdef CONFIG_PPC32
-		.cpu_features		= CPU_FTRS_970_32,
-#else
 		.cpu_features		= CPU_FTRS_PPC970,
-#endif
 		.cpu_user_features	= COMMON_USER_POWER4 |
 			PPC_FEATURE_HAS_ALTIVEC_COMP,
 		.icache_bsize		= 128,
@@ -210,8 +204,6 @@ struct cpu_spec	cpu_specs[] = {
 		.oprofile_type		= PPC_OPROFILE_POWER4,
 		.platform		= "ppc970",
 	},
-#endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */
-#ifdef CONFIG_PPC64
 	{	/* PPC970MP */
 		.pvr_mask		= 0xffff0000,
 		.pvr_value		= 0x00440000,
Index: build/include/asm-powerpc/cputable.h
===================================================================
--- build.orig/include/asm-powerpc/cputable.h	2006-06-10 11:37:33.000000000 +1000
+++ build/include/asm-powerpc/cputable.h	2006-06-10 11:39:51.000000000 +1000
@@ -300,13 +300,6 @@ extern void do_cpu_ftr_fixups(unsigned l
 	    CPU_FTR_COMMON)
 #define CPU_FTRS_CLASSIC32	(CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
 	    CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
-#define CPU_FTRS_POWER3_32	(CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
-	    CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
-#define CPU_FTRS_POWER4_32	(CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
-	    CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN)
-#define CPU_FTRS_970_32	(CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
-	    CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | \
-	    CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN)
 #define CPU_FTRS_8XX	(CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB)
 #define CPU_FTRS_40X	(CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
 	    CPU_FTR_NODSISRALIGN)
@@ -367,12 +360,6 @@ enum {
 #else
 	    CPU_FTRS_GENERIC_32 |
 #endif
-#ifdef CONFIG_PPC64BRIDGE
-	    CPU_FTRS_POWER3_32 |
-#endif
-#ifdef CONFIG_POWER4
-	    CPU_FTRS_POWER4_32 | CPU_FTRS_970_32 |
-#endif
 #ifdef CONFIG_8xx
 	    CPU_FTRS_8XX |
 #endif
@@ -412,12 +399,6 @@ enum {
 #else
 	    CPU_FTRS_GENERIC_32 &
 #endif
-#ifdef CONFIG_PPC64BRIDGE
-	    CPU_FTRS_POWER3_32 &
-#endif
-#ifdef CONFIG_POWER4
-	    CPU_FTRS_POWER4_32 & CPU_FTRS_970_32 &
-#endif
 #ifdef CONFIG_8xx
 	    CPU_FTRS_8XX &
 #endif
Index: build/arch/powerpc/Makefile
===================================================================
--- build.orig/arch/powerpc/Makefile	2006-06-10 11:36:57.000000000 +1000
+++ build/arch/powerpc/Makefile	2006-06-10 11:39:51.000000000 +1000
@@ -108,7 +108,6 @@ ifeq ($(CONFIG_6xx),y)
 CFLAGS		+= -mcpu=powerpc
 endif
 
-cpu-as-$(CONFIG_PPC64BRIDGE)	+= -Wa,-mppc64bridge
 cpu-as-$(CONFIG_4xx)		+= -Wa,-m405
 cpu-as-$(CONFIG_6xx)		+= -Wa,-maltivec
 cpu-as-$(CONFIG_POWER4)		+= -Wa,-maltivec
Index: build/arch/powerpc/mm/hash_low_32.S
===================================================================
--- build.orig/arch/powerpc/mm/hash_low_32.S	2006-06-10 11:36:57.000000000 +1000
+++ build/arch/powerpc/mm/hash_low_32.S	2006-06-10 11:39:51.000000000 +1000
@@ -74,12 +74,6 @@ _GLOBAL(hash_page_sync)
  */
 	.text
 _GLOBAL(hash_page)
-#ifdef CONFIG_PPC64BRIDGE
-	mfmsr	r0
-	clrldi	r0,r0,1		/* make sure it's in 32-bit mode */
-	MTMSRD(r0)
-	isync
-#endif
 	tophys(r7,0)			/* gets -KERNELBASE into r7 */
 #ifdef CONFIG_SMP
 	addis	r8,r7,mmu_hash_lock@h
@@ -285,7 +279,6 @@ Hash_base = 0xc0180000
 Hash_bits = 12				/* e.g. 256kB hash table */
 Hash_msk = (((1 << Hash_bits) - 1) * 64)
 
-#ifndef CONFIG_PPC64BRIDGE
 /* defines for the PTE format for 32-bit PPCs */
 #define PTE_SIZE	8
 #define PTEG_SIZE	64
@@ -299,21 +292,6 @@ Hash_msk = (((1 << Hash_bits) - 1) * 64)
 #define SET_V(r)	oris r,r,PTE_V@h
 #define CLR_V(r,t)	rlwinm r,r,0,1,31
 
-#else
-/* defines for the PTE format for 64-bit PPCs */
-#define PTE_SIZE	16
-#define PTEG_SIZE	128
-#define LG_PTEG_SIZE	7
-#define LDPTEu		ldu
-#define STPTE		std
-#define CMPPTE		cmpd
-#define PTE_H		2
-#define PTE_V		1
-#define TST_V(r)	andi. r,r,PTE_V
-#define SET_V(r)	ori r,r,PTE_V
-#define CLR_V(r,t)	li t,PTE_V; andc r,r,t
-#endif /* CONFIG_PPC64BRIDGE */
-
 #define HASH_LEFT	31-(LG_PTEG_SIZE+Hash_bits-1)
 #define HASH_RIGHT	31-LG_PTEG_SIZE
 
@@ -331,14 +309,8 @@ BEGIN_FTR_SECTION
 END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT)
 
 	/* Construct the high word of the PPC-style PTE (r5) */
-#ifndef CONFIG_PPC64BRIDGE
 	rlwinm	r5,r3,7,1,24		/* put VSID in 0x7fffff80 bits */
 	rlwimi	r5,r4,10,26,31		/* put in API (abbrev page index) */
-#else /* CONFIG_PPC64BRIDGE */
-	clrlwi	r3,r3,8			/* reduce vsid to 24 bits */
-	sldi	r5,r3,12		/* shift vsid into position */
-	rlwimi	r5,r4,16,20,24		/* put in API (abbrev page index) */
-#endif /* CONFIG_PPC64BRIDGE */
 	SET_V(r5)			/* set V (valid) bit */
 
 	/* Get the address of the primary PTE group in the hash table (r3) */
@@ -516,14 +488,8 @@ _GLOBAL(flush_hash_pages)
 	add	r3,r3,r0		/* note code below trims to 24 bits */
 
 	/* Construct the high word of the PPC-style PTE (r11) */
-#ifndef CONFIG_PPC64BRIDGE
 	rlwinm	r11,r3,7,1,24		/* put VSID in 0x7fffff80 bits */
 	rlwimi	r11,r4,10,26,31		/* put in API (abbrev page index) */
-#else /* CONFIG_PPC64BRIDGE */
-	clrlwi	r3,r3,8			/* reduce vsid to 24 bits */
-	sldi	r11,r3,12		/* shift vsid into position */
-	rlwimi	r11,r4,16,20,24		/* put in API (abbrev page index) */
-#endif /* CONFIG_PPC64BRIDGE */
 	SET_V(r11)			/* set V (valid) bit */
 
 #ifdef CONFIG_SMP
Index: build/arch/powerpc/mm/ppc_mmu_32.c
===================================================================
--- build.orig/arch/powerpc/mm/ppc_mmu_32.c	2006-06-10 11:36:57.000000000 +1000
+++ build/arch/powerpc/mm/ppc_mmu_32.c	2006-06-10 11:39:51.000000000 +1000
@@ -42,11 +42,7 @@ unsigned long _SDR1;
 
 union ubat {			/* BAT register values to be loaded */
 	BAT	bat;
-#ifdef CONFIG_PPC64BRIDGE
-	u64	word[2];
-#else
 	u32	word[2];
-#endif
 } BATS[4][2];			/* 4 pairs of IBAT, DBAT */
 
 struct batrange {		/* stores address ranges mapped by BATs */
@@ -220,15 +216,9 @@ void __init MMU_init_hw(void)
 
 	if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
 
-#ifdef CONFIG_PPC64BRIDGE
-#define LG_HPTEG_SIZE	7		/* 128 bytes per HPTEG */
-#define SDR1_LOW_BITS	(lg_n_hpteg - 11)
-#define MIN_N_HPTEG	2048		/* min 256kB hash table */
-#else
 #define LG_HPTEG_SIZE	6		/* 64 bytes per HPTEG */
 #define SDR1_LOW_BITS	((n_hpteg - 1) >> 10)
 #define MIN_N_HPTEG	1024		/* min 64kB hash table */
-#endif
 
 	/*
 	 * Allow 1 HPTE (1/8 HPTEG) for each page of memory.
Index: build/include/asm-ppc/mmu.h
===================================================================
--- build.orig/include/asm-ppc/mmu.h	2006-06-10 11:36:57.000000000 +1000
+++ build/include/asm-ppc/mmu.h	2006-06-10 11:39:51.000000000 +1000
@@ -29,20 +29,11 @@ typedef unsigned long mm_context_t;
 
 /* Hardware Page Table Entry */
 typedef struct _PTE {
-#ifdef CONFIG_PPC64BRIDGE
-	unsigned long long vsid:52;
-	unsigned long api:5;
-	unsigned long :5;
-	unsigned long h:1;
-	unsigned long v:1;
-	unsigned long long rpn:52;
-#else /* CONFIG_PPC64BRIDGE */
 	unsigned long v:1;	/* Entry is valid */
 	unsigned long vsid:24;	/* Virtual segment identifier */
 	unsigned long h:1;	/* Hash algorithm indicator */
 	unsigned long api:6;	/* Abbreviated page index */
 	unsigned long rpn:20;	/* Real (physical) page number */
-#endif /* CONFIG_PPC64BRIDGE */
 	unsigned long    :3;	/* Unused */
 	unsigned long r:1;	/* Referenced */
 	unsigned long c:1;	/* Changed */
@@ -83,11 +74,7 @@ typedef struct _P601_BATU {	/* Upper par
 } P601_BATU;
 
 typedef struct _BATU {		/* Upper part of BAT (all except 601) */
-#ifdef CONFIG_PPC64BRIDGE
-	unsigned long long bepi:47;
-#else /* CONFIG_PPC64BRIDGE */
 	unsigned long bepi:15;	/* Effective page index (virtual address) */
-#endif /* CONFIG_PPC64BRIDGE */
 	unsigned long :4;	/* Unused */
 	unsigned long bl:11;	/* Block size mask */
 	unsigned long vs:1;	/* Supervisor valid */
@@ -102,11 +89,7 @@ typedef struct _P601_BATL {	/* Lower par
 } P601_BATL;
 
 typedef struct _BATL {		/* Lower part of BAT (all except 601) */
-#ifdef CONFIG_PPC64BRIDGE
-	unsigned long long brpn:47;
-#else /* CONFIG_PPC64BRIDGE */
 	unsigned long brpn:15;	/* Real page index (physical address) */
-#endif /* CONFIG_PPC64BRIDGE */
 	unsigned long :10;	/* Unused */
 	unsigned long w:1;	/* Write-thru cache */
 	unsigned long i:1;	/* Cache inhibit */
Index: build/arch/um/sys-ppc/misc.S
===================================================================
--- build.orig/arch/um/sys-ppc/misc.S	2006-06-10 11:36:57.000000000 +1000
+++ build/arch/um/sys-ppc/misc.S	2006-06-10 11:39:51.000000000 +1000
@@ -23,14 +23,10 @@
 #define CACHE_LINE_SIZE		16
 #define LG_CACHE_LINE_SIZE	4
 #define MAX_COPY_PREFETCH	1
-#elif !defined(CONFIG_PPC64BRIDGE)
+#else
 #define CACHE_LINE_SIZE		32
 #define LG_CACHE_LINE_SIZE	5
 #define MAX_COPY_PREFETCH	4
-#else
-#define CACHE_LINE_SIZE		128
-#define LG_CACHE_LINE_SIZE	7
-#define MAX_COPY_PREFETCH	1
 #endif /* CONFIG_4xx || CONFIG_8xx */
 
 	.text

^ permalink raw reply

* [PATCH] powerpc: Optimise some TOC usage
From: Anton Blanchard @ 2006-06-10 10:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


Micro-optimisation - add no-minimal-toc to some more arch/powerpc Makefiles.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/lib/Makefile
===================================================================
--- build.orig/arch/powerpc/lib/Makefile	2006-05-27 09:52:19.000000000 +1000
+++ build/arch/powerpc/lib/Makefile	2006-05-27 09:52:27.000000000 +1000
@@ -2,6 +2,10 @@
 # Makefile for ppc-specific library files..
 #
 
+ifeq ($(CONFIG_PPC64),y)
+EXTRA_CFLAGS		+= -mno-minimal-toc
+endif
+
 ifeq ($(CONFIG_PPC_MERGE),y)
 obj-y			:= string.o strcase.o
 obj-$(CONFIG_PPC32)	+= div64.o copy_32.o checksum_32.o
Index: build/arch/powerpc/oprofile/Makefile
===================================================================
--- build.orig/arch/powerpc/oprofile/Makefile	2006-05-27 09:52:19.000000000 +1000
+++ build/arch/powerpc/oprofile/Makefile	2006-05-27 09:52:27.000000000 +1000
@@ -1,3 +1,7 @@
+ifeq ($(CONFIG_PPC64),y)
+EXTRA_CFLAGS	+= -mno-minimal-toc
+endif
+
 obj-$(CONFIG_OPROFILE) += oprofile.o
 
 DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
Index: build/arch/powerpc/sysdev/Makefile
===================================================================
--- build.orig/arch/powerpc/sysdev/Makefile	2006-05-27 09:52:19.000000000 +1000
+++ build/arch/powerpc/sysdev/Makefile	2006-05-27 09:52:27.000000000 +1000
@@ -1,3 +1,7 @@
+ifeq ($(CONFIG_PPC64),y)
+EXTRA_CFLAGS			+= -mno-minimal-toc
+endif
+
 obj-$(CONFIG_MPIC)		+= mpic.o
 obj-$(CONFIG_PPC_INDIRECT_PCI)	+= indirect_pci.o
 obj-$(CONFIG_PPC_I8259)		+= i8259.o
Index: build/arch/powerpc/platforms/pseries/Makefile
===================================================================
--- build.orig/arch/powerpc/platforms/pseries/Makefile	2006-05-27 09:52:19.000000000 +1000
+++ build/arch/powerpc/platforms/pseries/Makefile	2006-05-27 09:52:27.000000000 +1000
@@ -1,3 +1,7 @@
+ifeq ($(CONFIG_PPC64),y)
+EXTRA_CFLAGS		+= -mno-minimal-toc
+endif
+
 obj-y			:= pci.o lpar.o hvCall.o nvram.o reconfig.o \
 			   setup.o iommu.o ras.o rtasd.o pci_dlpar.o \
 			   firmware.o

^ permalink raw reply

* [PATCH] powerpc: 64bit FPSCR support
From: Anton Blanchard @ 2006-06-10 10:18 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


Add 64bit FPSCR support. This requires a new form of mtfsf instruction.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/kernel/fpu.S
===================================================================
--- build.orig/arch/powerpc/kernel/fpu.S	2006-06-08 10:57:36.000000000 +1000
+++ build/arch/powerpc/kernel/fpu.S	2006-06-10 11:38:37.000000000 +1000
@@ -72,7 +72,7 @@ _GLOBAL(load_up_fpu)
 	std	r12,_MSR(r1)
 #endif
 	lfd	fr0,THREAD_FPSCR(r5)
-	mtfsf	0xff,fr0
+	MTFSF_L(fr0)
 	REST_32FPRS(0, r5)
 #ifndef CONFIG_SMP
 	subi	r4,r5,THREAD
@@ -127,7 +127,7 @@ _GLOBAL(giveup_fpu)
 
 _GLOBAL(cvt_fd)
 	lfd	0,THREAD_FPSCR(r5)	/* load up fpscr value */
-	mtfsf	0xff,0
+	MTFSF_L(0)
 	lfs	0,0(r3)
 	stfd	0,0(r4)
 	mffs	0
@@ -136,7 +136,7 @@ _GLOBAL(cvt_fd)
 
 _GLOBAL(cvt_df)
 	lfd	0,THREAD_FPSCR(r5)	/* load up fpscr value */
-	mtfsf	0xff,0
+	MTFSF_L(0)
 	lfd	0,0(r3)
 	stfs	0,0(r4)
 	mffs	0
Index: build/arch/powerpc/kernel/vector.S
===================================================================
--- build.orig/arch/powerpc/kernel/vector.S	2006-06-08 10:57:36.000000000 +1000
+++ build/arch/powerpc/kernel/vector.S	2006-06-10 11:38:37.000000000 +1000
@@ -53,12 +53,12 @@ fpenable:
 	stfd	fr31,8(r1)
 	LDCONST(fr1, fpzero)
 	mffs	fr31
-	mtfsf	0xff,fr1
+	MTFSF_L(fr1)
 	blr
 
 fpdisable:
 	mtlr	r12
-	mtfsf	0xff,fr31
+	MTFSF_L(fr31)
 	lfd	fr31,8(r1)
 	lfd	fr1,16(r1)
 	lfd	fr0,24(r1)
Index: build/include/asm-powerpc/reg.h
===================================================================
--- build.orig/include/asm-powerpc/reg.h	2006-06-10 11:37:33.000000000 +1000
+++ build/include/asm-powerpc/reg.h	2006-06-10 11:38:37.000000000 +1000
@@ -499,6 +499,19 @@
 #define MMCR0_PMC2_LOADMISSTIME	0x5
 #endif
 
+/*
+ * An mtfsf instruction with the L bit set. On CPUs that support this a
+ * full 64bits of FPSCR is restored and on other CPUs it is ignored.
+ *
+ * Until binutils gets the new form of mtfsf, hardwire the instruction.
+ */
+#ifdef CONFIG_PPC64
+#define MTFSF_L(REG) \
+	.long (0xfc00058e | ((0xff) << 17) | ((REG) << 11) | (1 << 25))
+#else
+#define MTFSF_L(REG)	mtfsf	0xff, (REG)
+#endif
+
 /* Processor Version Register (PVR) field extraction */
 
 #define PVR_VER(pvr)	(((pvr) >>  16) & 0xFFFF)	/* Version field */

^ permalink raw reply

* [PATCH] powerpc: Fix pseries IOMMU allocations
From: Anton Blanchard @ 2006-06-10 10:00 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linuxppc-dev, paulus
In-Reply-To: <20060606141135.GB6974@lst.de>


> Make sure dma_alloc_coherent allocates memory from the local node.  This
> is important on Cell where we avoid going through the slow cpu
> interconnect.
> 
> Note:  I could only test this patch on Cell, it should be verified on
> some pseries machine by thos that have the hardware.

Looks like this patch is merged in Pauls tree and breaking pseries boot.
The patch below should fix it.

--

The arguments to alloc_pages_node were reversed, resulting in IOMMU
allocation failures. Fix it.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/arch/powerpc/kernel/iommu.c
===================================================================
--- build.orig/arch/powerpc/kernel/iommu.c	2006-06-10 19:49:51.000000000 +1000
+++ build/arch/powerpc/kernel/iommu.c	2006-06-10 19:52:12.000000000 +1000
@@ -561,7 +561,7 @@ void *iommu_alloc_coherent(struct iommu_
 		return NULL;
 
 	/* Alloc enough pages (and possibly more) */
-	page = alloc_pages_node(flag, order, node);
+	page = alloc_pages_node(node, flag, order);
 	if (!page)
 		return NULL;
 	ret = page_address(page);

^ permalink raw reply

* Re: pmf_register_irq_client gives sleep with locks held warning
From: Johannes Berg @ 2006-06-10  9:27 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Andrew Morton, linuxppc-dev list
In-Reply-To: <1149897784.12687.87.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

On Sat, 2006-06-10 at 10:03 +1000, Benjamin Herrenschmidt wrote:

> > I don't think your patch is right, it seems to me that now
> > pmf_unregister_irq_client races against pmf_do_irq: what happens when an
> > interrupt comes in right in the middle of the list_del()?
> 
> Yeah, possibly... too late for 2.6.17 tho.

That's ok, we don't have any in-kernel users anyway. Alas the alsa
people will be dissatisfied because they like to ship new drivers for
old kernels or something. Oh well, I don't care.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

^ permalink raw reply

* Re: Re: RFC: dma_mmap_coherent() for powerpc/ppc architecture and ALSA?
From: Gerhard Pircher @ 2006-06-10  8:22 UTC (permalink / raw)
  To: Lee Revell, benh; +Cc: linuxppc-dev, alsa-devel, linux-kernel

> -------- Original-Nachricht --------
> Datum: Fri, 09 Jun 2006 20:46:32 -0400
> Von: Lee Revell <rlrevell@joe-job.com>
> An: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Betreff: Re: RFC: dma_mmap_coherent() for powerpc/ppc architecture and 
> ALSA?
> 
> On Sat, 2006-06-10 at 10:34 +1000, Benjamin Herrenschmidt wrote:
> > > This leads me to the question, if there are any plans to include the 
> > > dma_mmap_coherent() function (for powerpc/ppc and/or any other
> > > platform) in one of the next kernel versions and if an adapation of
> > > the ALSA drivers is planned. Or is there a simple way (hack) to fix
> > > this problem?
> > 
> > You are welcome to do a patch implementing this :)
> 
> Please cc: alsa-devel when you do so.

:)

Well, implementing the dma_mmap_coherent() function isn't the problem, because it is already implemented for the ARM architecture. But as far as I understand this would require a rewrite of all the ALSA drivers (or at least a rewrite of the ALSA's DMA helper functions).

Original mail included for alsa-devel mailing list:

> I'm trying to adapt Linux for the AmigaOne, which is a G3/G4 PPC desktop 
> system with a non cache coherent northbridge (MAI ArticiaS), a VIA82C686B 
> southbridge and the U-boot firmware. Due to the cache coherency problem I 
> compiled in the CONFIG_NOT_COHERENT_CACHE option
> (arch/ppc/kernel/dma-mapping.c) in the AmigaOne Linux kernel.

> While that fixes the DMA data corruption problem, it causes a kernel oops 
> or a complete system lookup after starting sound playback. With kernel
> versions =<2.6.14 the oops messages refered to a BUG() entry in
> mm/rmap.c. Therefore I tried out a newer kernel (2.6.16.15), where the
> oops refers to the ALSA function snd_pcm_mmap_data_nopage() implemented
> in pcm_native.c.

> Well, after searching a while in some old linux kernel threads, I found
> this thread here:
> http://www.thisishull.net/showthread.php?t=22080&page=3&pp=10

> Based on the information in this thread, I came to the conclusion that
> ALSA simply won't work on non cache coherent architectures (except ARM),
> because the generic DMA API was never expanded to support the
> functionality required by ALSA (namely mapping dma pages into user space > with dma_mmap_coherent()).

> This leads me to the question, if there are any plans to include the
> dma_mmap_coherent() function (for powerpc/ppc and/or any other platform)
> in one of the next kernel versions and if an adapation of the ALSA
> drivers is planned. Or is there a simple way (hack) to fix this problem?

Gerhard

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

^ permalink raw reply

* Re: [PATCH] powerpc vdso updates
From: Benjamin Herrenschmidt @ 2006-06-10  6:30 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linuxppc-dev list, Ingo Molnar, Paul Mackerras
In-Reply-To: <20060610031543.GH23891@krispykreme>

On Sat, 2006-06-10 at 13:15 +1000, Anton Blanchard wrote:
> Hi Ben,
> 
> > This patch cleans up some locking & error handling in the ppc vdso and
> > moves the vdso base pointer from the thread struct to the mm context
> > where it more logically belongs. It brings the powerpc implementation
> > closer to Ingo's new x86 one and also adds an arch_vma_name() function
> > allowing to print [vsdo] in /proc/<pid>/maps if Ingo's x86 vdso patch is
> > also applied.
> 
> Im getting this on the current powerpc git tree:
> 
> arch/powerpc/kernel/signal_32.c: In function 'handle_rt_signal':
> arch/powerpc/kernel/signal_32.c:763: error: request for member
> 'vdso_base' in something not a structure or union
> 
> It looks like we use the mm_context_t definition in asm-ppc/mmu.h for
> 32bit ARCH=powerpc builds and need vdso_base there too.

Yes, I have a patch almost ready for that.

Ben.

^ permalink raw reply

* Re: [PATCH] powerpc vdso updates
From: Anton Blanchard @ 2006-06-10  3:15 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Ingo Molnar, Paul Mackerras
In-Reply-To: <1148961097.15722.11.camel@localhost.localdomain>


Hi Ben,

> This patch cleans up some locking & error handling in the ppc vdso and
> moves the vdso base pointer from the thread struct to the mm context
> where it more logically belongs. It brings the powerpc implementation
> closer to Ingo's new x86 one and also adds an arch_vma_name() function
> allowing to print [vsdo] in /proc/<pid>/maps if Ingo's x86 vdso patch is
> also applied.

Im getting this on the current powerpc git tree:

arch/powerpc/kernel/signal_32.c: In function 'handle_rt_signal':
arch/powerpc/kernel/signal_32.c:763: error: request for member
'vdso_base' in something not a structure or union

It looks like we use the mm_context_t definition in asm-ppc/mmu.h for
32bit ARCH=powerpc builds and need vdso_base there too.

Anton

^ permalink raw reply

* Re: [PATCH] reorg RTAS delay code
From: Anton Blanchard @ 2006-06-10  2:08 UTC (permalink / raw)
  To: John Rose; +Cc: Paul Mackerras, Nathan Lynch, External List
In-Reply-To: <20060610020453.GF23891@krispykreme>

 
> Looks like you missed one:
> 
> WARNING: ".rtas_extended_busy_delay_time" [arch/powerpc/platforms/pseries/scanlog.ko] undefined!

And a missing export:

WARNING: ".rtas_busy_delay" [arch/powerpc/kernel/rtas_flash.ko] undefined!

ANton

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox