LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Next April 28: boot failure on PowerPC with SLQB
From: Nick Piggin @ 2009-04-30 14:10 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christoph Lameter, linux-kernel, linuxppc-dev, Pekka Enberg,
	linux-next
In-Reply-To: <20090501000033.ecce9ed8.sfr@canb.auug.org.au>

On Fri, May 01, 2009 at 12:00:33AM +1000, Stephen Rothwell wrote:
> Hi Nick,
> 
> On Thu, 30 Apr 2009 15:05:42 +0200 Nick Piggin <npiggin@suse.de> wrote:
> >
> > Hmm, this might do it. The following code now passes some stress testing
> > in a userspace harness wheras before it did not (and was obviously wrong).
> 
> Indeed that allows it to boot fine.  Thanks.
> 
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

Great, thanks for reporting and testing. This one is especially
important because it is basically scribbling on random memory
:( Pekka, please apply.

Thanks,
Nick

^ permalink raw reply

* Re: Next April 28: boot failure on PowerPC with SLQB
From: Stephen Rothwell @ 2009-04-30 14:00 UTC (permalink / raw)
  To: Nick Piggin
  Cc: Christoph Lameter, linux-kernel, linuxppc-dev, Pekka Enberg,
	linux-next
In-Reply-To: <20090430130542.GF6900@wotan.suse.de>

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

Hi Nick,

On Thu, 30 Apr 2009 15:05:42 +0200 Nick Piggin <npiggin@suse.de> wrote:
>
> Hmm, this might do it. The following code now passes some stress testing
> in a userspace harness wheras before it did not (and was obviously wrong).

Indeed that allows it to boot fine.  Thanks.

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: [PATCH 0/9] powerpc/pci: clean up direct access to sysdata
From: Michael Ellerman @ 2009-04-30 13:49 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1241096999-11164-1-git-send-email-galak@kernel.crashing.org>

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

On Thu, 2009-04-30 at 08:09 -0500, Kumar Gala wrote:
> We shouldn't be accessing sysdata directly.  In the future we might have
> sysdata be a device_node on ppc32 to match ppc64.  Direct access would make that
> a bit difficult.
> 
> If someone can look at the iseries code I would appreciate that:
> 
> arch/powerpc/platforms/iseries/pci.c:           iomm_table[current_iomm_table_entry] = dev->sysdata;
> arch/powerpc/platforms/iseries/pci.c:                   iseries_ds_addr(dev->sysdata) | (bar_num << 24);
> arch/powerpc/platforms/iseries/pci.c:   pdev->sysdata = node;

It looks like it's basically doing the same logic as
pci_device_to_OF_node(), and fetch_dev_dn(), but there's probably some
reason why it's not using those.

Given how much new iseries hardware there is, I think we'd probably
rather leave the code as is. It's a device node anyway, so it doesn't
block your plans RE ppc32.

cheers

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

^ permalink raw reply

* Re: [2.6.29] MPC8560 Powerpc Port linux-2.6.29
From: Kumar Gala @ 2009-04-30 13:12 UTC (permalink / raw)
  To: Deepak Gaur; +Cc: linuxppc-dev
In-Reply-To: <20090430065054.M32339@cdotd.ernet.in>


On Apr 30, 2009, at 1:51 AM, Deepak Gaur wrote:

> Hello all
>
> I have a custom board with MPC8560 and 1GB DDR SDRAM. I am trying to  
> port linux - 2.6.29
> on this board. The U-BOOT is already ported on the board and is  
> working.
>
> The OS uImage is stored in code flash at address 0xe0000000 and OS  
> is booted by U-BOOT
> While OS do boot but after some prints weired errors start showing  
> up. Rootfile system
> is NFS based . I have checked the register values with Hardware  
> person using Trace32
> emulator and they are as expected.

1. what happens if you boot with mem=256M or something like that on  
the command line?
2. do you have CONFIG_HIGHMEM enabled?

- k

^ permalink raw reply

* [PATCH 9/9] powerpc/pci: clean up direct access to sysdata by celleb platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-8-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the device node to just
go get the pci_controller.  We can call pci_bus_to_host() for this
purpose.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/cell/celleb_pci.c       |   10 ++--------
 arch/powerpc/platforms/cell/celleb_scc_epci.c  |   13 ++-----------
 arch/powerpc/platforms/cell/celleb_scc_pciex.c |   12 ++----------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index f39a3b2..00eaaa7 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -162,8 +162,7 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,
 		unsigned int devfn, int where, int size, u32 *val)
 {
 	char *config;
-	struct device_node *node;
-	struct pci_controller *hose;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned int devno = devfn >> 3;
 	unsigned int fn = devfn & 0x7;
 
@@ -171,8 +170,6 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,
 	BUG_ON(where % size);
 
 	pr_debug("    fake read: bus=0x%x, ", bus->number);
-	node = (struct device_node *)bus->sysdata;
-	hose = pci_find_hose_for_OF_device(node);
 	config = get_fake_config_start(hose, devno, fn);
 
 	pr_debug("devno=0x%x, where=0x%x, size=0x%x, ", devno, where, size);
@@ -192,8 +189,7 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
 		unsigned int devfn, int where, int size, u32 val)
 {
 	char *config;
-	struct device_node *node;
-	struct pci_controller *hose;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	struct celleb_pci_resource *res;
 	unsigned int devno = devfn >> 3;
 	unsigned int fn = devfn & 0x7;
@@ -201,8 +197,6 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
 	/* allignment check */
 	BUG_ON(where % size);
 
-	node = (struct device_node *)bus->sysdata;
-	hose = pci_find_hose_for_OF_device(node);
 	config = get_fake_config_start(hose, devno, fn);
 
 	if (!config)
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 48ec88a..05b0db3 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -134,15 +134,11 @@ static int celleb_epci_read_config(struct pci_bus *bus,
 {
 	PCI_IO_ADDR epci_base;
 	PCI_IO_ADDR addr;
-	struct device_node *node;
-	struct pci_controller *hose;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 
 	/* allignment check */
 	BUG_ON(where % size);
 
-	node = (struct device_node *)bus->sysdata;
-	hose = pci_find_hose_for_OF_device(node);
-
 	if (!celleb_epci_get_epci_cfg(hose))
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
@@ -198,16 +194,11 @@ static int celleb_epci_write_config(struct pci_bus *bus,
 {
 	PCI_IO_ADDR epci_base;
 	PCI_IO_ADDR addr;
-	struct device_node *node;
-	struct pci_controller *hose;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 
 	/* allignment check */
 	BUG_ON(where % size);
 
-	node = (struct device_node *)bus->sysdata;
-	hose = pci_find_hose_for_OF_device(node);
-
-
 	if (!celleb_epci_get_epci_cfg(hose))
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
index 3e7e0f1..7fca09f 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
@@ -366,11 +366,7 @@ static void config_write_pciex_rc(unsigned int __iomem *base, uint32_t where,
 static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
 				 int where, int size, unsigned int *val)
 {
-	struct device_node *dn;
-	struct pci_controller *phb;
-
-	dn = bus->sysdata;
-	phb = pci_find_hose_for_OF_device(dn);
+	struct pci_controller *phb = pci_bus_to_host(bus);
 
 	if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) {
 		*val = ~0;
@@ -389,11 +385,7 @@ static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
 static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
 				  int where, int size, unsigned int val)
 {
-	struct device_node *dn;
-	struct pci_controller *phb;
-
-	dn = bus->sysdata;
-	phb = pci_find_hose_for_OF_device(dn);
+	struct pci_controller *phb = pci_bus_to_host(bus);
 
 	if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1)
 		return PCIBIOS_DEVICE_NOT_FOUND;
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 8/9] powerpc/pci: clean up direct access to sysdata by RTAS
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-7-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the device node but call
pci_bus_to_OF_node() for this purpose.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/kernel/rtas_pci.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 8869001..54e66da 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -93,10 +93,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
 {
 	struct device_node *busdn, *dn;
 
-	if (bus->self)
-		busdn = pci_device_to_OF_node(bus->self);
-	else
-		busdn = bus->sysdata;	/* must be a phb */
+	busdn = pci_bus_to_OF_node(bus);
 
 	/* Search only direct children of the bus */
 	for (dn = busdn->child; dn; dn = dn->sibling) {
@@ -140,10 +137,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
 {
 	struct device_node *busdn, *dn;
 
-	if (bus->self)
-		busdn = pci_device_to_OF_node(bus->self);
-	else
-		busdn = bus->sysdata;	/* must be a phb */
+	busdn = pci_bus_to_OF_node(bus);
 
 	/* Search only direct children of the bus */
 	for (dn = busdn->child; dn; dn = dn->sibling) {
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 6/9] powerpc/pci: clean up direct access to sysdata on tsi108 platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-5-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the pci_controller.  Instead
use pci_bus_to_host() for this purpose.  In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/tsi108_pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 24e1f5a..cf244a4 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -63,7 +63,7 @@ tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfunc,
 			   int offset, int len, u32 val)
 {
 	volatile unsigned char *cfg_addr;
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 
 	if (ppc_md.pci_exclude_device)
 		if (ppc_md.pci_exclude_device(hose, bus->number, devfunc))
@@ -149,7 +149,7 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 			  int len, u32 * val)
 {
 	volatile unsigned char *cfg_addr;
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	u32 temp;
 
 	if (ppc_md.pci_exclude_device)
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 7/9] powerpc/pci: clean up direct access to sysdata by powermac platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-6-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the device node but call
pci_bus_to_OF_node() for this purpose.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/powermac/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 45936c9..86f69a4 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -655,7 +655,7 @@ static int __init pmac_probe(void)
 /* Move that to pci.c */
 static int pmac_pci_probe_mode(struct pci_bus *bus)
 {
-	struct device_node *node = bus->sysdata;
+	struct device_node *node = pci_bus_to_OF_node(bus);
 
 	/* We need to use normal PCI probing for the AGP bus,
 	 * since the device for the AGP bridge isn't in the tree.
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 5/9] powerpc/pci: clean up direct access to sysdata by CHRP platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-4-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the pci_controller.  Instead
use pci_bus_to_host() for this purpose.  In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/chrp/pci.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index f6b0c51..8f67a39 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -34,7 +34,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
 			   int len, u32 *val)
 {
 	volatile void __iomem *cfg_data;
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 
 	if (bus->number > 7)
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -61,7 +61,7 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
 			    int len, u32 val)
 {
 	volatile void __iomem *cfg_data;
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 
 	if (bus->number > 7)
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -96,7 +96,7 @@ static struct pci_ops gg2_pci_ops =
 int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		     int len, u32 *val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
 		| (((bus->number - hose->first_busno) & 0xff) << 16)
 		| (hose->global_number << 24);
@@ -111,7 +111,7 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		      int len, u32 val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
 		| (((bus->number - hose->first_busno) & 0xff) << 16)
 		| (hose->global_number << 24);
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 4/9] powerpc/pci: clean up direct access to sysdata by 4xx platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-3-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the pci_controller.  Instead
use pci_bus_to_host() for this purpose.  In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/ppc4xx_pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 6a2d473..daefc93 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1295,7 +1295,7 @@ static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port
 static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
 				    int offset, int len, u32 *val)
 {
-	struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	struct ppc4xx_pciex_port *port =
 		&ppc4xx_pciex_ports[hose->indirect_type];
 	void __iomem *addr;
@@ -1352,7 +1352,7 @@ static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
 static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
 				     int offset, int len, u32 val)
 {
-	struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	struct ppc4xx_pciex_port *port =
 		&ppc4xx_pciex_ports[hose->indirect_type];
 	void __iomem *addr;
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 1/9] powerpc/pci: clean up direct access to sysdata by indirect ops
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev

We shouldn't directly access sysdata to get the pci_controller.  Instead
use pci_bus_to_host() for this purpose.  In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/indirect_pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index 7fd49c9..7ed8096 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -24,7 +24,7 @@ static int
 indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		     int len, u32 *val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	volatile void __iomem *cfg_data;
 	u8 cfg_type = 0;
 	u32 bus_no, reg;
@@ -82,7 +82,7 @@ static int
 indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		      int len, u32 val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	volatile void __iomem *cfg_data;
 	u8 cfg_type = 0;
 	u32 bus_no, reg;
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 3/9] powerpc/pci: clean up direct access to sysdata by 52xx platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-2-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the pci_controller.  Instead
use pci_bus_to_host() for this purpose.  In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/52xx/efika.c       |    4 ++--
 arch/powerpc/platforms/52xx/mpc52xx_pci.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index a2068fa..bcc69e1 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -34,7 +34,7 @@
 static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 			    int len, u32 * val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
 	    | (((bus->number - hose->first_busno) & 0xff) << 16)
 	    | (hose->global_number << 24);
@@ -49,7 +49,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
 			     int offset, int len, u32 val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
 	    | (((bus->number - hose->first_busno) & 0xff) << 16)
 	    | (hose->global_number << 24);
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 87ff522..dd43114 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -107,7 +107,7 @@ static int
 mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
 				int offset, int len, u32 *val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	u32 value;
 
 	if (ppc_md.pci_exclude_device)
@@ -164,7 +164,7 @@ static int
 mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
 				int offset, int len, u32 val)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	u32 value, mask;
 
 	if (ppc_md.pci_exclude_device)
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 2/9] powerpc/pci: clean up direct access to sysdata by FSL platforms
From: Kumar Gala @ 2009-04-30 13:10 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1241097015-11208-1-git-send-email-galak@kernel.crashing.org>

We shouldn't directly access sysdata to get the pci_controller.  Instead
use pci_bus_to_host() for this purpose.  In the future we might have
sysdata be a device_node to match ppc64 and unify the code between ppc32
& ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/fsl_pci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 78021d8..a364f80 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -188,7 +188,7 @@ static void __init setup_pci_pcsrbar(struct pci_controller *hose)
 
 void fsl_pcibios_fixup_bus(struct pci_bus *bus)
 {
-	struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	int i;
 
 	if ((bus->parent == hose->bus) &&
@@ -324,7 +324,7 @@ struct mpc83xx_pcie_priv {
 
 static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 
 	if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -350,7 +350,7 @@ static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
 static void __iomem *mpc83xx_pcie_remap_cfg(struct pci_bus *bus,
 					    unsigned int devfn, int offset)
 {
-	struct pci_controller *hose = bus->sysdata;
+	struct pci_controller *hose = pci_bus_to_host(bus);
 	struct mpc83xx_pcie_priv *pcie = hose->dn->data;
 	u8 bus_no = bus->number - hose->first_busno;
 	u32 dev_base = bus_no << 24 | devfn << 16;
-- 
1.6.0.6

^ permalink raw reply related

* [PATCH 0/9] powerpc/pci: clean up direct access to sysdata
From: Kumar Gala @ 2009-04-30 13:09 UTC (permalink / raw)
  To: linuxppc-dev

We shouldn't be accessing sysdata directly.  In the future we might have
sysdata be a device_node on ppc32 to match ppc64.  Direct access would make that
a bit difficult.

If someone can look at the iseries code I would appreciate that:

arch/powerpc/platforms/iseries/pci.c:           iomm_table[current_iomm_table_entry] = dev->sysdata;
arch/powerpc/platforms/iseries/pci.c:                   iseries_ds_addr(dev->sysdata) | (bar_num << 24);
arch/powerpc/platforms/iseries/pci.c:   pdev->sysdata = node;

- k

^ permalink raw reply

* Re: Next April 28: boot failure on PowerPC with SLQB
From: Nick Piggin @ 2009-04-30 13:05 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: Stephen Rothwell, Christoph Lameter, linux-kernel, linuxppc-dev,
	linux-next
In-Reply-To: <1241090429.19252.7.camel@penberg-laptop>

On Thu, Apr 30, 2009 at 02:20:29PM +0300, Pekka Enberg wrote:
> On Thu, 2009-04-30 at 13:18 +0200, Nick Piggin wrote:
> > OK thanks. So I think we have 2 problems. One with MAX_ORDER <= 9
> > that is fixed by the previous patch, and another which is probably
> > due to having no memory on node 0 which I will take another look
> > at now.
> > 
> > We can merge the previous patch now, though.
> 
> Hmm, I'll bet this BUG_ON triggers for Stephen.
> 
> diff --git a/mm/slqb.c b/mm/slqb.c
> index a651843..e4b3859 100644
> --- a/mm/slqb.c
> +++ b/mm/slqb.c
> @@ -1391,6 +1391,7 @@ static noinline void *__slab_alloc_page(struct kmem_cache *s,
>  		struct kmem_cache_node *n;
>  
>  		n = s->node_slab[slqb_page_to_nid(page)];
> +		BUG_ON(!n);
>  		l = &n->list;
>  		page->list = l;

Hmm, this might do it. The following code now passes some stress testing
in a userspace harness wheras before it did not (and was obviously wrong).

---
SLQB: fix dumb early allocation cache

The dumb early allocation cache had a bug where it could allow allocation
to go past the end of a page, which could cause crashes or random memory
corruption. Fix this and simplify the logic.

Signed-off-by: Nick Piggin <npiggin@suse.de>
---
 mm/slqb.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

Index: linux-2.6/mm/slqb.c
===================================================================
--- linux-2.6.orig/mm/slqb.c
+++ linux-2.6/mm/slqb.c
@@ -2185,8 +2185,11 @@ static void *kmem_cache_dyn_array_alloc(
 {
 	size_t size = sizeof(void *) * ids;
 
+	BUG_ON(!size);
+
 	if (unlikely(!slab_is_available())) {
 		static void *nextmem;
+		static size_t nextleft;
 		void *ret;
 
 		/*
@@ -2194,16 +2197,16 @@ static void *kmem_cache_dyn_array_alloc(
 		 * never get freed by definition so we can do it rather
 		 * simply.
 		 */
-		if (!nextmem) {
-			nextmem = alloc_pages_exact(size, GFP_KERNEL);
-			if (!nextmem)
-				return NULL;
+		if (size > nextleft) {
+                        nextmem = alloc_pages_exact(size, GFP_KERNEL);
+                        if (!nextmem)
+                                return NULL;
+			nextleft = roundup(size, PAGE_SIZE);
 		}
+
 		ret = nextmem;
-		nextmem = (void *)((unsigned long)ret + size);
-		if ((unsigned long)ret >> PAGE_SHIFT !=
-				(unsigned long)nextmem >> PAGE_SHIFT)
-			nextmem = NULL;
+		nextleft -= size;
+		nextmem += size;
 		memset(ret, 0, size);
 		return ret;
 	} else {

^ permalink raw reply

* Please pull from 'next' branch for 2.6.31
From: Kumar Gala @ 2009-04-30 11:58 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

Ben,

This tree is based of the linus's 2.6.30-rc4 as I figured that was a good
point to start a 'next' tree off of.

- k

Please pull from 'next' branch of

	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git next

to receive the following updates:

 Documentation/powerpc/dts-bindings/ecm.txt     |   64 ++
 Documentation/powerpc/dts-bindings/fsl/mcm.txt |   64 ++
 arch/powerpc/boot/dts/gef_ppc9a.dts            |   13
 arch/powerpc/boot/dts/gef_sbc310.dts           |   13
 arch/powerpc/boot/dts/gef_sbc610.dts           |   13
 arch/powerpc/boot/dts/ksi8560.dts              |   13
 arch/powerpc/boot/dts/mpc832x_mds.dts          |    1
 arch/powerpc/boot/dts/mpc832x_rdb.dts          |    1
 arch/powerpc/boot/dts/mpc8349emitx.dts         |    2
 arch/powerpc/boot/dts/mpc8349emitxgp.dts       |    1
 arch/powerpc/boot/dts/mpc834x_mds.dts          |    2
 arch/powerpc/boot/dts/mpc836x_mds.dts          |    1
 arch/powerpc/boot/dts/mpc8377_mds.dts          |    1
 arch/powerpc/boot/dts/mpc8378_mds.dts          |    1
 arch/powerpc/boot/dts/mpc8379_mds.dts          |    1
 arch/powerpc/boot/dts/mpc8536ds.dts            |   17
 arch/powerpc/boot/dts/mpc8540ads.dts           |   14
 arch/powerpc/boot/dts/mpc8541cds.dts           |   15
 arch/powerpc/boot/dts/mpc8544ds.dts            |   17
 arch/powerpc/boot/dts/mpc8548cds.dts           |   16
 arch/powerpc/boot/dts/mpc8555cds.dts           |   15
 arch/powerpc/boot/dts/mpc8560ads.dts           |   14
 arch/powerpc/boot/dts/mpc8568mds.dts           |   15
 arch/powerpc/boot/dts/mpc8572ds.dts            |   16
 arch/powerpc/boot/dts/mpc8572ds_36b.dts        |   16
 arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts |   15
 arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts |    1
 arch/powerpc/boot/dts/mpc8610_hpcd.dts         |   15
 arch/powerpc/boot/dts/mpc8641_hpcn.dts         |   15
 arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts     |  610 +++++++++++++++++++++++++
 arch/powerpc/boot/dts/sbc8349.dts              |    1
 arch/powerpc/boot/dts/sbc8548.dts              |   15
 arch/powerpc/boot/dts/sbc8560.dts              |   14
 arch/powerpc/boot/dts/sbc8641d.dts             |   15
 arch/powerpc/boot/dts/socrates.dts             |   14
 arch/powerpc/boot/dts/stx_gp3_8560.dts         |   14
 arch/powerpc/boot/dts/tqm8540.dts              |   14
 arch/powerpc/boot/dts/tqm8541.dts              |   14
 arch/powerpc/boot/dts/tqm8548-bigflash.dts     |   15
 arch/powerpc/boot/dts/tqm8548.dts              |   15
 arch/powerpc/boot/dts/tqm8555.dts              |   14
 arch/powerpc/boot/dts/tqm8560.dts              |   14
 arch/powerpc/include/asm/cpm1.h                |    2
 arch/powerpc/include/asm/cpm2.h                |    4
 arch/powerpc/include/asm/mpc86xx.h             |   33 -
 arch/powerpc/include/asm/pci-bridge.h          |    6
 arch/powerpc/oprofile/op_model_fsl_emb.c       |   14
 arch/powerpc/platforms/82xx/pq2ads.h           |   13
 arch/powerpc/platforms/85xx/mpc85xx_mds.c      |   29 -
 arch/powerpc/platforms/86xx/gef_ppc9a.c        |    1
 arch/powerpc/platforms/86xx/gef_sbc310.c       |    1
 arch/powerpc/platforms/86xx/gef_sbc610.c       |    1
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c     |    1
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c     |    1
 arch/powerpc/platforms/86xx/mpc86xx_smp.c      |    8
 arch/powerpc/platforms/86xx/sbc8641d.c         |    1
 arch/powerpc/platforms/8xx/mpc885ads.h         |    4
 arch/powerpc/platforms/fsl_uli1575.c           |   23
 arch/powerpc/sysdev/cpm2.c                     |    2
 arch/powerpc/sysdev/fsl_pci.c                  |    4
 arch/powerpc/sysdev/fsl_soc.c                  |   14
 61 files changed, 1149 insertions(+), 174 deletions(-)

Becky Bruce (2):
      powerpc/86xx: Add 36-bit device tree for mpc8641hpcn
      powerpc: make dma_window_* in pci_controller struct avail on 32b

Haiying Wang (1):
      powerpc/85xx: clean up for mpc8568_mds name

Kumar Gala (9):
      powerpc/fsl: Remove cell-index from PCI nodes
      powerpc: Refactor board check for PCI quirks on FSL boards with uli1575
      powerpc/fsl: use of_iomap() for rstcr mapping
      powerpc/85xx: Add binding for LAWs and ECM
      powerpc/85xx: Add new LAW & ECM device tree nodes for all 85xx systems
      powerpc/86xx: Add binding for LAWs and MCM
      powerpc/86xx: Add new LAW & MCM device tree nodes for all 86xx systems
      powerpc/cpm: Remove some cruft code and defines
      powerpc/86xx: clean up smp init code

Michael Ellerman (1):
      powerpc/oprofile: Remove unused dump_pmcs() in FSL oprofile

^ permalink raw reply

* Re: [PATCH 2/6] powerpc/qe: update risc allocation for QE
From: Kumar Gala @ 2009-04-30 11:48 UTC (permalink / raw)
  To: Haiying Wang; +Cc: linuxppc-dev
In-Reply-To: <12410288792524-git-send-email-Haiying.Wang@freescale.com>


On Apr 29, 2009, at 1:14 PM, Haiying Wang wrote:

> Change the RISC allocation to macros instead of enum, add function  
> to read the
> number of risc engines from the new property "num-riscs" under qe  
> node in dts.
> Add new property "num-riscs" description in qe.txt
>
> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
> ---
> .../powerpc/dts-bindings/fsl/cpm_qe/qe.txt         |    1 +
> arch/powerpc/include/asm/qe.h                      |   18 ++++++++----
> arch/powerpc/sysdev/qe_lib/qe.c                    |   28 +++++++++++ 
> +++++++++
> 3 files changed, 41 insertions(+), 6 deletions(-)

I'm wondering if these should be fsl,num-riscs or fsl,qe-num-riscs  
since its a new property.  Ditto for num-snums.

Also, shouldn't both of these be in the Required section of the binding.

- k

^ permalink raw reply

* Re: [PATCH] rapidio: add common mapping APIs for RapidIO memory access
From: Kumar Gala @ 2009-04-30 11:45 UTC (permalink / raw)
  To: Li Yang; +Cc: zw, netdev, linux-kernel, David Miller, linuxppc-dev, akpm
In-Reply-To: <2a27d3730904292210q67e18274nf6676a054b780639@mail.gmail.com>


On Apr 30, 2009, at 12:10 AM, Li Yang wrote:

> On Tue, Apr 28, 2009 at 7:39 PM, David Miller <davem@davemloft.net>  
> wrote:
>>
>> Please number your patches. :-/
>>
>> There is no way for anyone to be able to tell in what order
>> your changes should be applied.
>
> Sorry for that.  I thought I have added -n when doing the
> git-format-patch, but it turns out not the case. :(  Will double check
> next time.
>
> - Leo

Do you plan on reposting them?

- k

^ permalink raw reply

* Re: [PATCH 1/6] powerpc/85xx: clean up for mpc8568_mds name
From: Kumar Gala @ 2009-04-30 11:37 UTC (permalink / raw)
  To: Haiying Wang; +Cc: linuxppc-dev
In-Reply-To: <1241028878175-git-send-email-Haiying.Wang@freescale.com>


On Apr 29, 2009, at 1:14 PM, Haiying Wang wrote:

> Keep an unique machine def for the MPC8568 MDS board to handle some
> subtle differences between the future MDS board. Also set the bcsrs in
> setup_arch() only for mpc8568_mds because other mds has different  
> bcsr settings.
>
> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
> ---
> arch/powerpc/platforms/85xx/mpc85xx_mds.c |   29 ++++++++++++++ 
> +--------------
> 1 files changed, 15 insertions(+), 14 deletions(-)

applied to next

- k

^ permalink raw reply

* [PATCH v2] powerpc/cpm: Remove some cruft code and defines
From: Kumar Gala @ 2009-04-30 11:34 UTC (permalink / raw)
  To: linuxppc-dev

Kill of some old defines and macros that we no longer use like
CPM_MAP_ADDR, IMAP_ADDR and CPM_IRQ_OFFSET.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* Removed IMAP_ADDR since we killed its one user in the net-next tree

- k

 arch/powerpc/include/asm/cpm1.h        |    2 --
 arch/powerpc/include/asm/cpm2.h        |    4 ----
 arch/powerpc/platforms/82xx/pq2ads.h   |   13 -------------
 arch/powerpc/platforms/8xx/mpc885ads.h |    4 ----
 arch/powerpc/sysdev/cpm2.c             |    2 +-
 5 files changed, 1 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/include/asm/cpm1.h b/arch/powerpc/include/asm/cpm1.h
index 2ff7987..7685ffd 100644
--- a/arch/powerpc/include/asm/cpm1.h
+++ b/arch/powerpc/include/asm/cpm1.h
@@ -598,8 +598,6 @@ typedef struct risc_timer_pram {
 #define CICR_IEN		((uint)0x00000080)	/* Int. enable */
 #define CICR_SPS		((uint)0x00000001)	/* SCC Spread */
 
-#define IMAP_ADDR		(get_immrbase())
-
 #define CPM_PIN_INPUT     0
 #define CPM_PIN_OUTPUT    1
 #define CPM_PIN_PRIMARY   0
diff --git a/arch/powerpc/include/asm/cpm2.h b/arch/powerpc/include/asm/cpm2.h
index 0f5e8ff..990ff19 100644
--- a/arch/powerpc/include/asm/cpm2.h
+++ b/arch/powerpc/include/asm/cpm2.h
@@ -14,10 +14,6 @@
 #include <asm/cpm.h>
 #include <sysdev/fsl_soc.h>
 
-#ifdef CONFIG_PPC_85xx
-#define CPM_MAP_ADDR (get_immrbase() + 0x80000)
-#endif
-
 /* CPM Command register.
 */
 #define CPM_CR_RST	((uint)0x80000000)
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 984db42..6cf0f97 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -24,10 +24,6 @@
 
 #include <linux/seq_file.h>
 
-/* Backword-compatibility stuff for the drivers */
-#define CPM_MAP_ADDR		((uint)0xf0000000)
-#define CPM_IRQ_OFFSET 0
-
 /* The ADS8260 has 16, 32-bit wide control/status registers, accessed
  * only on word boundaries.
  * Not all are used (yet), or are interesting to us (yet).
@@ -44,14 +40,5 @@
 #define BCSR3_FETHIEN2		((uint)0x10000000)      /* 0 == enable*/
 #define BCSR3_FETH2_RST		((uint)0x80000000)      /* 0 == reset */
 
-/* cpm serial driver works with constants below */
-
-#define SIU_INT_SMC1		((uint)0x04+CPM_IRQ_OFFSET)
-#define SIU_INT_SMC2		((uint)0x05+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC1		((uint)0x28+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC2		((uint)0x29+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC3		((uint)0x2a+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC4		((uint)0x2b+CPM_IRQ_OFFSET)
-
 #endif /* __MACH_ADS8260_DEFS */
 #endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index a507666..19412f7 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -17,10 +17,6 @@
 
 #include <sysdev/fsl_soc.h>
 
-#define MPC8xx_CPM_OFFSET	(0x9c0)
-#define CPM_MAP_ADDR		(get_immrbase() + MPC8xx_CPM_OFFSET)
-#define CPM_IRQ_OFFSET		16     // for compability with cpm_uart driver
-
 /* Bits of interest in the BCSRs.
  */
 #define BCSR1_ETHEN		((uint)0x20000000)
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index fd969f0..eb59272 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -61,7 +61,7 @@ EXPORT_SYMBOL(cpm2_immr);
 void __init cpm2_reset(void)
 {
 #ifdef CONFIG_PPC_85xx
-	cpm2_immr = ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
+	cpm2_immr = ioremap(get_immrbase() + 0x80000, CPM_MAP_SIZE);
 #else
 	cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE);
 #endif
-- 
1.6.0.6

^ permalink raw reply related

* Re: [PATCH 2/4] powerpc: Move VSX load/stores into ppc-opcode.h
From: Kumar Gala @ 2009-04-30 11:28 UTC (permalink / raw)
  To: Michael Neuling; +Cc: Paul Mackerras, Milton Miller, linuxppc-dev
In-Reply-To: <20090430065801.A57921222D@localhost.localdomain>


On Apr 30, 2009, at 1:58 AM, Michael Neuling wrote:

> Cleans up the VSX load/store instructions by moving them into
> ppc-opcode.h.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
>

Acked-by: Kumar Gala <galak@kernel.crashing.org>

- k


> arch/powerpc/include/asm/ppc-opcode.h |   13 +++++++++++++
> arch/powerpc/include/asm/ppc_asm.h    |   10 ----------
> 2 files changed, 13 insertions(+), 10 deletions(-)
>
> Index: linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/ppc-opcode.h
> +++ linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
> @@ -25,6 +25,7 @@
> #define PPC_INST_LSWI			0x7c0004aa
> #define PPC_INST_LSWX			0x7c00042a
> #define PPC_INST_LWSYNC			0x7c2004ac
> +#define PPC_INST_LXVD2X			0x7c000698
> #define PPC_INST_MCRXR			0x7c000400
> #define PPC_INST_MCRXR_MASK		0xfc0007fe
> #define PPC_INST_MFSPR_PVR		0x7c1f42a6
> @@ -43,12 +44,14 @@
>
> #define PPC_INST_STSWI			0x7c0005aa
> #define PPC_INST_STSWX			0x7c00052a
> +#define PPC_INST_STXVD2X		0x7c000798
> #define PPC_INST_TLBILX			0x7c000024
> #define PPC_INST_WAIT			0x7c00007c
>
> /* macros to insert fields into opcodes */
> #define __PPC_RA(a)	(((a) & 0x1f) << 16)
> #define __PPC_RB(b)	(((b) & 0x1f) << 11)
> +#define __PPC_XS(s)	((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
> #define __PPC_T_TLB(t)	(((t) & 0x3) << 21)
> #define __PPC_WC(w)	(((w) & 0x3) << 21)
>
> @@ -70,4 +73,14 @@
> #define PPC_WAIT(w)		stringify_in_c(.long PPC_INST_WAIT | \
> 					__PPC_WC(w))
>
> +/*
> + * Define what the VSX XX1 form instructions will look like, then add
> + * the 128 bit load store instructions based on that.
> + */
> +#define VSX_XX1(s, a, b)	(__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
> +#define STXVD2X(s, a, b)	stringify_in_c(.long PPC_INST_STXVD2X | \
> +					       VSX_XX1((s), (a), (b)))
> +#define LXVD2X(s, a, b)		stringify_in_c(.long PPC_INST_LXVD2X | \
> +					       VSX_XX1((s), (a), (b)))
> +
> #endif /* _ASM_POWERPC_PPC_OPCODE_H */
> Index: linux-2.6-ozlabs/arch/powerpc/include/asm/ppc_asm.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/ppc_asm.h
> +++ linux-2.6-ozlabs/arch/powerpc/include/asm/ppc_asm.h
> @@ -76,16 +76,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR);				
> 				REST_10GPRS(22, base)
> #endif
>
> -/*
> - * Define what the VSX XX1 form instructions will look like, then add
> - * the 128 bit load store instructions based on that.
> - */
> -#define VSX_XX1(xs, ra, rb)	(((xs) & 0x1f) << 21 | ((ra) << 16) |  \
> -				 ((rb) << 11) | (((xs) >> 5)))
> -
> -#define STXVD2X(xs, ra, rb)	.long (0x7c000798 | VSX_XX1((xs), (ra),  
> (rb)))
> -#define LXVD2X(xs, ra, rb)	.long (0x7c000698 | VSX_XX1((xs), (ra),  
> (rb)))
> -
> #define SAVE_2GPRS(n, base)	SAVE_GPR(n, base); SAVE_GPR(n+1, base)
> #define SAVE_4GPRS(n, base)	SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
> #define SAVE_8GPRS(n, base)	SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)

^ permalink raw reply

* Re: [PATCH 1/4] powerpc: Cleanup macros in ppc-opcode.h
From: Kumar Gala @ 2009-04-30 11:27 UTC (permalink / raw)
  To: Michael Neuling; +Cc: Paul Mackerras, Milton Miller, linuxppc-dev
In-Reply-To: <20090430065801.96E951222C@localhost.localdomain>


On Apr 30, 2009, at 1:58 AM, Michael Neuling wrote:

> Make macros more braces happy.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
>
> arch/powerpc/include/asm/ppc-opcode.h |    8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)

Acked-by: Kumar Gala <galak@kernel.crashing.org>

- k

>
>
> Index: linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/ppc-opcode.h
> +++ linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
> @@ -47,10 +47,10 @@
> #define PPC_INST_WAIT			0x7c00007c
>
> /* macros to insert fields into opcodes */
> -#define __PPC_RA(a)	((a & 0x1f) << 16)
> -#define __PPC_RB(b)	((b & 0x1f) << 11)
> -#define __PPC_T_TLB(t)	((t & 0x3) << 21)
> -#define __PPC_WC(w)	((w & 0x3) << 21)
> +#define __PPC_RA(a)	(((a) & 0x1f) << 16)
> +#define __PPC_RB(b)	(((b) & 0x1f) << 11)
> +#define __PPC_T_TLB(t)	(((t) & 0x3) << 21)
> +#define __PPC_WC(w)	(((w) & 0x3) << 21)
>
> /* Deal with instructions that older assemblers aren't aware of */
> #define	PPC_DCBAL(a, b)		stringify_in_c(.long PPC_INST_DCBAL | \

^ permalink raw reply

* Re: Next April 28: boot failure on PowerPC with SLQB
From: Nick Piggin @ 2009-04-30 11:26 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: Stephen Rothwell, Christoph Lameter, linux-kernel, linuxppc-dev,
	linux-next
In-Reply-To: <1241090429.19252.7.camel@penberg-laptop>

On Thu, Apr 30, 2009 at 02:20:29PM +0300, Pekka Enberg wrote:
> On Thu, 2009-04-30 at 13:18 +0200, Nick Piggin wrote:
> > OK thanks. So I think we have 2 problems. One with MAX_ORDER <= 9
> > that is fixed by the previous patch, and another which is probably
> > due to having no memory on node 0 which I will take another look
> > at now.
> > 
> > We can merge the previous patch now, though.
> 
> Hmm, I'll bet this BUG_ON triggers for Stephen.
> 
> diff --git a/mm/slqb.c b/mm/slqb.c
> index a651843..e4b3859 100644
> --- a/mm/slqb.c
> +++ b/mm/slqb.c
> @@ -1391,6 +1391,7 @@ static noinline void *__slab_alloc_page(struct kmem_cache *s,
>  		struct kmem_cache_node *n;
>  
>  		n = s->node_slab[slqb_page_to_nid(page)];
> +		BUG_ON(!n);
>  		l = &n->list;
>  		page->list = l;

Yes I'm betting it does, but I can't see why it should. CPU0 should
have node_slab allocated for node 1 if node 1 has memory. And
conversely, slqb_page_to_nid(page) should never evaluate to 0 if
node 0 has no memory online.

^ permalink raw reply

* Re: Next April 28: boot failure on PowerPC with SLQB
From: Pekka Enberg @ 2009-04-30 11:20 UTC (permalink / raw)
  To: Nick Piggin
  Cc: Stephen Rothwell, Christoph Lameter, linux-kernel, linuxppc-dev,
	linux-next
In-Reply-To: <20090430111825.GC6900@wotan.suse.de>

On Thu, 2009-04-30 at 13:18 +0200, Nick Piggin wrote:
> OK thanks. So I think we have 2 problems. One with MAX_ORDER <= 9
> that is fixed by the previous patch, and another which is probably
> due to having no memory on node 0 which I will take another look
> at now.
> 
> We can merge the previous patch now, though.

Hmm, I'll bet this BUG_ON triggers for Stephen.

diff --git a/mm/slqb.c b/mm/slqb.c
index a651843..e4b3859 100644
--- a/mm/slqb.c
+++ b/mm/slqb.c
@@ -1391,6 +1391,7 @@ static noinline void *__slab_alloc_page(struct kmem_cache *s,
 		struct kmem_cache_node *n;
 
 		n = s->node_slab[slqb_page_to_nid(page)];
+		BUG_ON(!n);
 		l = &n->list;
 		page->list = l;
 

^ permalink raw reply related

* Re: Next April 28: boot failure on PowerPC with SLQB
From: Nick Piggin @ 2009-04-30 11:18 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christoph Lameter, linux-kernel, linuxppc-dev, Pekka Enberg,
	linux-next
In-Reply-To: <20090430210004.05a61841.sfr@canb.auug.org.au>

On Thu, Apr 30, 2009 at 09:00:04PM +1000, Stephen Rothwell wrote:
> Hi Pekka, Nick,
> 
> On Thu, 30 Apr 2009 13:38:04 +0300 Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> >
> > Stephen, does this patch fix all the boot problems for you as well?
> 
> Unfortunately not, I am still getting this:
> 
> Memory: 1967708k/2097152k available (9836k kernel code, 129444k reserved, 1440k data, 8422k bss, 2092k init)
> Calibrating delay loop... 1021.95 BogoMIPS (lpj=2043904)
> Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
> Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
> Mount-cache hash table entries: 256
> Unable to handle kernel paging request for data at address 0x00000008
> Faulting instruction address: 0xc00000000010ea18
> Oops: Kernel access of bad area, sig: 11 [#1]
> SMP NR_CPUS=128 NUMA pSeries
> Modules linked in:
> NIP: c00000000010ea18 LR: c00000000010e9e8 CTR: 0000000000000001
> REGS: c000000000b07690 TRAP: 0300   Not tainted  (2.6.30-rc3-autokern1)
> MSR: 8000000000009032 <EE,ME,IR,DR>  CR: 48000082  XER: 00000005
> DAR: 0000000000000008, DSISR: 0000000042000000
> TASK = c0000000009d55d0[0] 'swapper' THREAD: c000000000b04000 CPU: 0
> GPR00: c00000007e001030 c000000000b07910 c000000000b05588 c000000000b4a680 
> GPR04: c00000007e001000 c0000000009d5f18 0000000000000002 c0000000009d5f18 
> GPR08: 000000000000001a 0000000000000001 0000000000000000 0000000000000001 
> GPR12: 0000000088000084 c000000000b53280 0000000000000000 0000000003500000 
> GPR16: c0000000006c8f70 c0000000006c76e8 0000000000000000 00000000003d8800 
> GPR20: 0000000003cc7d90 c0000000007c7d90 0000000000000010 0000000000000000 
> GPR24: c000000000b656f0 f000000003347488 c000000000b4a680 f000000003347488 
> GPR28: c00000007e001180 c00000007e001000 c000000000a6f010 f0000000033474a8 
> NIP [c00000000010ea18] .__slab_alloc_page+0x380/0x3dc
> LR [c00000000010e9e8] .__slab_alloc_page+0x350/0x3dc
> Call Trace:
> [c000000000b07910] [c00000000010e9e8] .__slab_alloc_page+0x350/0x3dc (unreliable)
> [c000000000b079d0] [c00000000010f408] .__remote_slab_alloc+0x60/0x138
> [c000000000b07a80] [c000000000110d40] .__kmalloc_track_caller+0xb4/0x23c
> [c000000000b07b30] [c0000000000ec6e8] .kstrdup+0x4c/0x8c
> [c000000000b07bd0] [c000000000136f88] .alloc_vfsmnt+0xb0/0x178
> [c000000000b07c70] [c00000000011cb80] .vfs_kern_mount+0x40/0xf8
> [c000000000b07d10] [c0000000007ae460] .sysfs_init+0x90/0x108
> [c000000000b07db0] [c0000000007ad058] .mnt_init+0xbc/0x254
> [c000000000b07e50] [c0000000007aca00] .vfs_caches_init+0x150/0x184
> [c000000000b07ee0] [c000000000790a30] .start_kernel+0x418/0x484
> [c000000000b07f90] [c000000000008368] .start_here_common+0x1c/0x34
> Instruction dump:
> 60000000 e93d0040 e97d0028 381d0030 7fa4eb78 e95d0030 7f43d378 39290001 
> 396b0001 f93d0040 f97d0028 f95b0020 <fbea0008> fbfd0030 f81f0008 4bfffb59 
> ---[ end trace 31fd0ba7d8756001 ]---
> 
> This is back to what I got before Nick's first patch.
> 
> This partition has 2G of memory on node 1 (nothing in node 0) starting at
> address 0.  The kernel is using 64k pages.

OK thanks. So I think we have 2 problems. One with MAX_ORDER <= 9
that is fixed by the previous patch, and another which is probably
due to having no memory on node 0 which I will take another look
at now.

We can merge the previous patch now, though.
 

> Let me now if I can tell you anything else or try something.

Thanks,
Nick

^ 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