* Re: crash in kmem_cache_init
From: Olaf Hering @ 2008-01-18 22:57 UTC (permalink / raw)
To: Christoph Lameter
Cc: lee.schermerhorn, Linux MM, Mel Gorman, linux-kernel,
linuxppc-dev, Pekka Enberg, Aneesh Kumar K.V, hanth Aravamudan,
KAMEZAWA Hiroyuki
In-Reply-To: <Pine.LNX.4.64.0801181414200.8924@schroedinger.engr.sgi.com>
On Fri, Jan 18, Christoph Lameter wrote:
> Could you try this patch?
Does not help, same crash.
^ permalink raw reply
* Re: ping 127.0.0.1 takes too much
From: Scott Wood @ 2008-01-18 22:48 UTC (permalink / raw)
To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E264A1A@aquib01a>
DI BACCO ANTONIO - technolabs wrote:
> I have two different boards: one with MPC875 running at 66 MHz cpu/66
> MHz bus, one with MPC880 running at 132 MHz cpu /66MHz bus, I load the
> same kernel and root file system on both the boards that have only
> different u-boot(s).
>
> If I do a ping 127.0.0.1 on the MPC875 I get a round trip of 0.300 ms,
> while on the other one I get 0.900 ms, I expected the opposite.
>
> Could be an issue with memory configuration? In the formula to calculate
> the PTx on the MPC885RM manual I used 66 MHz as "system clock" for the
> first board and 132 MHz for the second board. Probably this is a mistake
> because "system clock" should be the bus clock but how this can so
> adversely affect the ping round trip?
Are you sure the timebase clock is what the kernel thinks it is? Does
the time-of-day clock progress at the correct rate?
-Scott
^ permalink raw reply
* Re: crash in kmem_cache_init
From: Christoph Lameter @ 2008-01-18 22:38 UTC (permalink / raw)
To: Mel Gorman
Cc: lee.schermerhorn, Olaf Hering, Linux MM, linux-kernel,
linuxppc-dev, Pekka Enberg, Aneesh Kumar K.V, hanth Aravamudan,
KAMEZAWA Hiroyuki
In-Reply-To: <Pine.LNX.4.64.0801181414200.8924@schroedinger.engr.sgi.com>
On Fri, 18 Jan 2008, Christoph Lameter wrote:
> Memoryless nodes: Set N_NORMAL_MEMORY for a node if we do not support HIGHMEM
If !CONFIG_HIGHMEM then
enum node_states {
#ifdef CONFIG_HIGHMEM
N_HIGH_MEMORY, /* The node has regular or high memory */
#else
N_HIGH_MEMORY = N_NORMAL_MEMORY,
#endif
So
for_each_online_node(nid) {
pg_data_t *pgdat = NODE_DATA(nid);
free_area_init_node(nid, pgdat, NULL,
find_min_pfn_for_node(nid), NULL);
/* Any memory on that node */
if (pgdat->node_present_pages)
node_set_state(nid, N_HIGH_MEMORY);
^^^ sets N_NORMAL_MEMORY
check_for_regular_memory(pgdat);
}
^ permalink raw reply
* ping 127.0.0.1 takes too much
From: DI BACCO ANTONIO - technolabs @ 2008-01-18 22:33 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 717 bytes --]
I have two different boards: one with MPC875 running at 66 MHz cpu/66 MHz bus, one with MPC880 running at 132 MHz cpu /66MHz bus, I load the same kernel and root file system on both the boards that have only different u-boot(s).
If I do a ping 127.0.0.1 on the MPC875 I get a round trip of 0.300 ms, while on the other one I get 0.900 ms, I expected the opposite.
Could be an issue with memory configuration? In the formula to calculate the PTx on the MPC885RM manual I used 66 MHz as "system clock" for the first board and 132 MHz for the second board. Probably this is a mistake because "system clock" should be the bus clock but how this can so adversely affect the ping round trip?
Thank you,
Antonio.
[-- Attachment #2: Type: text/html, Size: 1134 bytes --]
^ permalink raw reply
* Re: [PATCH 05/10] powerpc: Add crash kernel support for 85xx
From: Kumar Gala @ 2008-01-18 22:29 UTC (permalink / raw)
To: Dale Farnsworth; +Cc: linuxppc-dev
In-Reply-To: <20071214172315.GA26448@xyzzy.farnsworth.org>
On Dec 14, 2007, at 11:23 AM, Dale Farnsworth wrote:
> On Fri, Dec 14, 2007 at 10:48:58AM -0600, Kumar Gala wrote:
>> On Nov 22, 2007, at 9:46 AM, Dale Farnsworth wrote:
>>
>>> Add the ability to build a ppc_85xx kernel to run at a physical
>>> address of 32MB.
>>>
>>> Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
>>> ---
>>> arch/powerpc/Kconfig | 2 +-
>>> arch/powerpc/kernel/head_fsl_booke.S | 23 ++++++++++++++++++-----
>>> arch/powerpc/mm/fsl_booke_mmu.c | 6 +++---
>>> 3 files changed, 22 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index 805b4d1..d405298 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -253,7 +253,7 @@ config KEXEC
>>>
>>> config CRASH_DUMP
>>> bool "Build a kdump crash kernel (EXPERIMENTAL)"
>>> - depends on PPC_MULTIPLATFORM && EXPERIMENTAL
>>> + depends on (PPC_MULTIPLATFORM || PPC_85xx) && EXPERIMENTAL
>>> help
>>> Build a kernel suitable for use as a kdump capture kernel.
>>> The kernel will be linked at a different address than normal, and
>>> diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/
>>> kernel/head_fsl_booke.S
>>> index 4b98227..1c9685f 100644
>>> --- a/arch/powerpc/kernel/head_fsl_booke.S
>>> +++ b/arch/powerpc/kernel/head_fsl_booke.S
>>> @@ -41,6 +41,12 @@
>>> #include <asm/asm-offsets.h>
>>> #include "head_booke.h"
>>>
>>> +#ifdef CONFIG_CRASH_DUMP
>>> +#define INITIAL_BOOKE_PAGESZ (BOOKE_PAGESZ_64M)
>>> +#else
>>> +#define INITIAL_BOOKE_PAGESZ (BOOKE_PAGESZ_16M)
>>> +#endif
>>
>> I'm ok with bumping the first page to 64M in all cases.
>
> OK, I'll make that change in the next rev. Thanks.
I'm about to commit a version of this patch, why did you need to bump
to 64M?
>
>
> <snip>
>
>> The rest looks good. Does this mean we can boot a e500 kernel at a
>> non-zero physical address? (can we run or is the non-zero phy just
>> for a short period of init time).
>
> Yes, with this series of patches, we can boot and run with a classic
> ppc
> or e500 kernel at 32MB physical (0xc2000000 virtual). Note that on
> classic, we still need memory at phys 0 for the exception vectors.
> On e500 IIRC, we don't use the vectors at phys 0, but we still write
> the trampoline vectors there. I just didn't bother making that
> conditional.
trampoline vectors?
> I'll post an updated series soon, with hopes of getting it into 2.6.25
- k
^ permalink raw reply
* Re: [PATCH 4/4] IB/ehca: Prevent RDMA-related connection failures
From: Roland Dreier @ 2008-01-18 22:27 UTC (permalink / raw)
To: Joachim Fenkes
Cc: LKML, OF-EWG, LinuxPPC-Dev, Christoph Raisch, OF-General,
Stefan Roscher
In-Reply-To: <200801171507.25145.fenkes@de.ibm.com>
thanks, applied 1-4.
^ permalink raw reply
* Re: A file of 5 MB on tmpfs file system uses 5 MB of RAM or more?
From: Scott Wood @ 2008-01-18 22:25 UTC (permalink / raw)
To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E264A19@aquib01a>
DI BACCO ANTONIO - technolabs wrote:
> No I simply did several malloc(s) without writing to the allocated space.
>
> This means that the pages are not allocated really?
Correct.
-Scott
^ permalink raw reply
* RE: A file of 5 MB on tmpfs file system uses 5 MB of RAM or more?
From: DI BACCO ANTONIO - technolabs @ 2008-01-18 22:23 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-embedded
In-Reply-To: <20080118155853.GA15620@ld0162-tx32.am.freescale.net>
[-- Attachment #1: Type: text/plain, Size: 777 bytes --]
No I simply did several malloc(s) without writing to the allocated space.
This means that the pages are not allocated really?
-----Original Message-----
From: Scott Wood [mailto:scottwood@freescale.com]
Sent: Fri 18/01/2008 16.58
To: DI BACCO ANTONIO - technolabs
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: A file of 5 MB on tmpfs file system uses 5 MB of RAM or more?
On Fri, Jan 18, 2008 at 02:15:02PM +0100, DI BACCO ANTONIO - technolabs wrote:
> I have a linux-2.6.19.2 board with an MPC880 with 16MB ram and 16 MB
> flash.
> Normally I have 9-10 MB of free RAM.
>
> If I allocate 5 MB of ram memory, the system continues to work normally,
Are you sure the RAM was actually allocated (i.e. did you write to all of
the pages)?
-Scott
[-- Attachment #2: Type: text/html, Size: 1346 bytes --]
^ permalink raw reply
* Re: crash in kmem_cache_init
From: Nish Aravamudan @ 2008-01-18 22:19 UTC (permalink / raw)
To: Christoph Lameter
Cc: lee.schermerhorn, Olaf Hering, Linux MM, Mel Gorman, linux-kernel,
linuxppc-dev, Pekka Enberg, Aneesh Kumar K.V, hanth Aravamudan,
KAMEZAWA Hiroyuki
In-Reply-To: <Pine.LNX.4.64.0801181414200.8924@schroedinger.engr.sgi.com>
On 1/18/08, Christoph Lameter <clameter@sgi.com> wrote:
> Could you try this patch?
>
> Memoryless nodes: Set N_NORMAL_MEMORY for a node if we do not support
> HIGHMEM
>
> It seems that we only scan through zones to set N_NORMAL_MEMORY only if
> CONFIG_HIGHMEM and CONFIG_NUMA are set. We need to set
> N_NORMAL_MEMORY
> in the !CONFIG_HIGHMEM case.
I'm testing this exact patch right now on the machine Mel saw the issues with.
Thanks,
Nish
^ permalink raw reply
* Re: crash in kmem_cache_init
From: Christoph Lameter @ 2008-01-18 22:16 UTC (permalink / raw)
To: Olaf Hering
Cc: lee.schermerhorn, Linux MM, Mel Gorman, linux-kernel,
linuxppc-dev, Pekka Enberg, Aneesh Kumar K.V, hanth Aravamudan,
KAMEZAWA Hiroyuki
In-Reply-To: <20080118213011.GC10491@csn.ul.ie>
Could you try this patch?
Memoryless nodes: Set N_NORMAL_MEMORY for a node if we do not support HIGHMEM
It seems that we only scan through zones to set N_NORMAL_MEMORY only if
CONFIG_HIGHMEM and CONFIG_NUMA are set. We need to set N_NORMAL_MEMORY
in the !CONFIG_HIGHMEM case.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c 2008-01-18 14:08:41.000000000 -0800
+++ linux-2.6/mm/page_alloc.c 2008-01-18 14:13:34.000000000 -0800
@@ -3812,7 +3812,6 @@ restart:
/* Any regular memory on that node ? */
static void check_for_regular_memory(pg_data_t *pgdat)
{
-#ifdef CONFIG_HIGHMEM
enum zone_type zone_type;
for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) {
@@ -3820,7 +3819,6 @@ static void check_for_regular_memory(pg_
if (zone->present_pages)
node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY);
}
-#endif
}
/**
^ permalink raw reply
* [PATCH/RFCv3] [POWERPC] Add support for freescale watchdog to CPM serial driver.
From: Jochen Friedrich @ 2008-01-18 22:12 UTC (permalink / raw)
To: linuxppc-dev list; +Cc: Scott Wood, linux-kernel
If a freescale watchdog device node is present, reset the watchdog
while waiting for serial input.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/powerpc/boot/Makefile | 2 +-
arch/powerpc/boot/cpm-serial.c | 6 +++
arch/powerpc/boot/cuboot-8xx.c | 1 +
arch/powerpc/boot/ops.h | 8 ++++
arch/powerpc/boot/watchdog.c | 81 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 97 insertions(+), 1 deletions(-)
create mode 100644 arch/powerpc/boot/watchdog.c
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index d1e625c..66edf77 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -56,7 +56,7 @@ src-wlib := string.S crt0.S stdio.c main.c \
gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
- fsl-soc.c mpc8xx.c pq2.c
+ fsl-soc.c mpc8xx.c pq2.c watchdog.c
src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c
index 28296fa..56b5fda 100644
--- a/arch/powerpc/boot/cpm-serial.c
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -6,6 +6,9 @@
*
* It is assumed that the firmware (or the platform file) has already set
* up the port.
+ *
+ * If a watchdog node exists, periodically reset the watchdog while waiting
+ * for console input.
*/
#include "types.h"
@@ -154,6 +157,9 @@ static void cpm_serial_putc(unsigned char c)
static unsigned char cpm_serial_tstc(void)
{
+
+ watchdog_poke();
+
barrier();
return !(rbdf->sc & 0x8000);
}
diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c
index c202c88..767670e 100644
--- a/arch/powerpc/boot/cuboot-8xx.c
+++ b/arch/powerpc/boot/cuboot-8xx.c
@@ -43,5 +43,6 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
CUBOOT_INIT();
fdt_init(_dtb_start);
serial_console_init();
+ watchdog_init();
platform_ops.fixups = platform_fixups;
}
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 6036a98..cc97e2b 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -70,6 +70,12 @@ struct serial_console_data {
void (*close)(void);
};
+/* Watchdog operations */
+struct watchdog_ops {
+ void (*poke)(void);
+};
+extern struct watchdog_ops watchdog_ops;
+
struct loader_info {
void *promptr;
unsigned long initrd_addr, initrd_size;
@@ -86,6 +92,8 @@ int mpsc_console_init(void *devp, struct serial_console_data *scdp);
int cpm_console_init(void *devp, struct serial_console_data *scdp);
int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp);
int uartlite_console_init(void *devp, struct serial_console_data *scdp);
+void watchdog_poke(void);
+void watchdog_init(void);
void *simple_alloc_init(char *base, unsigned long heap_size,
unsigned long granularity, unsigned long max_allocs);
extern void flush_cache(void *, unsigned long);
diff --git a/arch/powerpc/boot/watchdog.c b/arch/powerpc/boot/watchdog.c
new file mode 100644
index 0000000..2bdee77
--- /dev/null
+++ b/arch/powerpc/boot/watchdog.c
@@ -0,0 +1,81 @@
+/*
+ * PQ Watchdog
+ *
+ * Copyright 2008 Jochen Friedrich <jochen@scram.de>
+ *
+ * Search for PowerQUICC type watchdog devices. Provide a callback to
+ * periodically reset the watchdog while waiting for console input.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "types.h"
+#include "io.h"
+#include "ops.h"
+
+struct watchdog_ops watchdog_ops;
+
+/* pq Watchdog */
+
+struct pq_wdt {
+ u32 res0;
+ u32 swcrr; /* System watchdog control register */
+ u32 swcnr; /* System watchdog count register */
+ u8 res1[2];
+ u16 swsrr; /* System watchdog service register */
+};
+
+static struct pq_wdt *pq_wdt;
+
+static void pq_poke(void)
+{
+ out_be16(&pq_wdt->swsrr, 0x556c);
+ out_be16(&pq_wdt->swsrr, 0xaa39);
+}
+
+static void pq_init(void *wdt_node)
+{
+ int n;
+ void *reg_virt[2];
+ unsigned long reg_phys;
+
+ n = getprop(wdt_node, "virtual-reg", reg_virt, sizeof(reg_virt));
+ if (n < (int)sizeof(reg_virt)) {
+ if (!dt_xlate_reg(wdt_node, 0, ®_phys, NULL))
+ return;
+ reg_virt[0] = (void *)reg_phys;
+ }
+ pq_wdt = reg_virt[0];
+ if (pq_wdt)
+ watchdog_ops.poke = pq_poke;
+}
+
+/* generic watchdog */
+
+void watchdog_poke(void)
+{
+ if (watchdog_ops.poke)
+ watchdog_ops.poke();
+}
+
+void watchdog_init(void)
+{
+ void *watchdog;
+
+ watchdog = finddevice("/soc/wdt");
+ if (watchdog && (dt_is_compatible(watchdog, "fsl,pq1-wdt") ||
+ dt_is_compatible(watchdog, "fsl,pq2-wdt") ||
+ dt_is_compatible(watchdog, "fsl,pq2pro-wdt")))
+ pq_init(watchdog);
+}
--
1.5.3.8
^ permalink raw reply related
* Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
From: Kumar Gala @ 2008-01-18 22:08 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: Scott Wood, linuxppc-dev, linux-kernel, Alan Cox
In-Reply-To: <47912088.4040507@scram.de>
On Jan 18, 2008, at 3:56 PM, Jochen Friedrich wrote:
> Hi Kumar,
>
>>> Ok now that makes sense, thanks
>> So I'll ask, what serial input are you waiting for from the boot
>> wrapper?
>
> It's the editor for the kernel command line.
thanks, learn something everyday.
- k
^ permalink raw reply
* External audio clock with MPC5200B
From: Jon Smirl @ 2008-01-18 21:56 UTC (permalink / raw)
To: Linux/PPC Development
Has anyone tried using an external audio clock chip with the MPC5200B?
We've discovered that the on-chip clock dividers aren't flexible
enough and have too much error in the final frequencies. The level of
error is ok for iPod type use but not for playing broadcast music.
192K sample rate is totally messed up with a 2.7% error.
Note to chip designers - USB and 44.1Khz are not compatible
frequencies and can't share the same PLL without FractionalN dividers
on the audio clock. Freescale MX31/MX21 both have separate PLLs for
UBS and audio.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
From: Jochen Friedrich @ 2008-01-18 21:56 UTC (permalink / raw)
To: Kumar Gala; +Cc: Scott Wood, linuxppc-dev, linux-kernel, Alan Cox
In-Reply-To: <EC416CBA-9200-4D71-8D95-39798937203D@kernel.crashing.org>
Hi Kumar,
>> Ok now that makes sense, thanks
>
> So I'll ask, what serial input are you waiting for from the boot wrapper?
It's the editor for the kernel command line.
Thanks,
Jochen
^ permalink raw reply
* Re: [PATCH] fsl_soc: Fix get_immrbase() to use ranges, rather than reg.
From: Kumar Gala @ 2008-01-18 21:53 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080114162935.GA27862@ld0162-tx32.am.freescale.net>
On Mon, 14 Jan 2008, Scott Wood wrote:
> The reg property in fsl soc nodes should be removed.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> arch/powerpc/sysdev/fsl_soc.c | 14 +++++++++++---
> 1 files changed, 11 insertions(+), 3 deletions(-)
applied. (dropped the size == 12 check).
- k
^ permalink raw reply
* Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
From: Scott Wood @ 2008-01-18 21:54 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Alan Cox, linux-kernel
In-Reply-To: <EC416CBA-9200-4D71-8D95-39798937203D@kernel.crashing.org>
Kumar Gala wrote:
> So I'll ask, what serial input are you waiting for from the boot wrapper?
The bootwrapper has a command line editing prompt. It's fairly
gratuitous in the presence of semi-decent firmware, but it's there
nonetheless.
-Scott
^ permalink raw reply
* Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
From: Kumar Gala @ 2008-01-18 21:51 UTC (permalink / raw)
To: Alan Cox; +Cc: Scott Wood, linuxppc-dev, linux-kernel
In-Reply-To: <20080118204030.48fbb683@lxorguk.ukuu.org.uk>
On Jan 18, 2008, at 2:40 PM, Alan Cox wrote:
> On Fri, 18 Jan 2008 19:47:43 +0100
> Jochen Friedrich <jochen@scram.de> wrote:
>
>> Hi Alan,
>>
>>>> If a freescale watchdog device node is present, reset the watchdog
>>>> while waiting for serial input.
>>>
>>> Why ? We normally rely on user space for watchdog management as
>>> only the
>>> fact user space is behaving really proves a box is happy ?
>>
>> This is in the boot wrapper code, not in the linux kernel.
>
> Ok now that makes sense, thanks
So I'll ask, what serial input are you waiting for from the boot
wrapper?
- k
^ permalink raw reply
* Re: crash in kmem_cache_init
From: Christoph Lameter @ 2008-01-18 21:43 UTC (permalink / raw)
To: Mel Gorman
Cc: linuxppc-dev, Olaf Hering, Pekka Enberg, linux-kernel, Linux MM
In-Reply-To: <20080118213011.GC10491@csn.ul.ie>
On Fri, 18 Jan 2008, Mel Gorman wrote:
> static void check_for_regular_memory(pg_data_t *pgdat)
> {
> #ifdef CONFIG_HIGHMEM
> enum zone_type zone_type;
>
> for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) {
> struct zone *zone = &pgdat->node_zones[zone_type];
> if (zone->present_pages)
> node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY);
> }
> #endif
> }
>
> i.e. go through the other zones and if any of them have memory, set
> N_NORMAL_MEMORY. But... it only does this on CONFIG_HIGHMEM which on
> PPC64 is not going to be set so N_NORMAL_MEMORY never gets set on
> POWER.... That sounds bad.
Argh. We may need to do a
node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY) in the !HIGHMEM case.
> and one of them is in kmem_cache_init(). That seems very significant.
> Christoph, can you think of possibilities of where N_NORMAL_MEMORY not
> being set would cause trouble for slab?
Yes. That results in the per node structures not being created and thus l3
== NULL. Explains our failures.
^ permalink raw reply
* Re: crash in kmem_cache_init
From: Mel Gorman @ 2008-01-18 21:30 UTC (permalink / raw)
To: Christoph Lameter
Cc: linuxppc-dev, Olaf Hering, Pekka Enberg, linux-kernel, Linux MM
In-Reply-To: <Pine.LNX.4.64.0801181043290.30348@schroedinger.engr.sgi.com>
On (18/01/08 10:47), Christoph Lameter didst pronounce:
> On Thu, 17 Jan 2008, Olaf Hering wrote:
>
> > early_node_map[1] active PFN ranges
> > 1: 0 -> 892928
> > Could not find start_pfn for node 0
>
> Corrupted min_pfn?
>
Doubtful. Node 0 has no memory but it is still being initialised.
Still, I looked closer at what is going on when that message gets
displayed and I see this in free_area_init_nodes()
for_each_online_node(nid) {
pg_data_t *pgdat = NODE_DATA(nid);
free_area_init_node(nid, pgdat, NULL,
find_min_pfn_for_node(nid), NULL);
/* Any memory on that node */
if (pgdat->node_present_pages)
node_set_state(nid, N_HIGH_MEMORY);
check_for_regular_memory(pgdat);
}
This "Any memory on that node" thing is new and it says if there is any
memory on the node, set N_HIGH_MEMORY. Fine I guess, I haven't tracked these
changes closely. It calls check_for_regular_memory() which looks like
static void check_for_regular_memory(pg_data_t *pgdat)
{
#ifdef CONFIG_HIGHMEM
enum zone_type zone_type;
for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) {
struct zone *zone = &pgdat->node_zones[zone_type];
if (zone->present_pages)
node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY);
}
#endif
}
i.e. go through the other zones and if any of them have memory, set
N_NORMAL_MEMORY. But... it only does this on CONFIG_HIGHMEM which on
PPC64 is not going to be set so N_NORMAL_MEMORY never gets set on
POWER.... That sounds bad.
mel@arnold:~/git/linux-2.6/mm$ grep -n N_NORMAL_MEMORY slab.c
1593: for_each_node_state(nid, N_NORMAL_MEMORY) {
1971: for_each_node_state(node, N_NORMAL_MEMORY) {
2102: for_each_node_state(node, N_NORMAL_MEMORY) {
3818: for_each_node_state(node, N_NORMAL_MEMORY) {
and one of them is in kmem_cache_init(). That seems very significant.
Christoph, can you think of possibilities of where N_NORMAL_MEMORY not
being set would cause trouble for slab?
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
^ permalink raw reply
* Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
From: Alan Cox @ 2008-01-18 20:40 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: Scott Wood, linuxppc-dev, linux-kernel
In-Reply-To: <4790F44F.8020009@scram.de>
On Fri, 18 Jan 2008 19:47:43 +0100
Jochen Friedrich <jochen@scram.de> wrote:
> Hi Alan,
>
> >> If a freescale watchdog device node is present, reset the watchdog
> >> while waiting for serial input.
> >
> > Why ? We normally rely on user space for watchdog management as only the
> > fact user space is behaving really proves a box is happy ?
>
> This is in the boot wrapper code, not in the linux kernel.
Ok now that makes sense, thanks
^ permalink raw reply
* Re: [RFC/PATCH 1/2] [POWERPC] mpc5200: normalize compatible property bindings
From: John Rigby @ 2008-01-18 20:33 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20080118170443.10592.97538.stgit@trillian.secretlab.ca>
Looks fine to me.
Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Update MPC5200 drivers to also look for compatible properties in the
> form "fsl,mpc5200-*" to better conform to open firmware generic names
> recommended practice as published here:
>
> http://www.openfirmware.org/1275/practice/gnames/gnamv14a.html
>
> This patch should *not* break compatibility with older device trees
> which do not use the 'fsl,' prefix. The drivers will still bind against
> the older names also.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
>
^ permalink raw reply
* [patch 11/16] PS3: Add logical performance monitor repository routines
From: Geoff Levand @ 2008-01-18 20:32 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, Takashi Yamamoto
In-Reply-To: <20080118202612.422185192@am.sony.com>
From: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Add repository routines for the PS3 Logical Performance Monitor.
Signed-off-by: Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
v2: o Correct Yamamoto-san's mail addr.
v3: o Change num_pu and pu_id to type u64.
o Add comments to describe some symbol names.
arch/powerpc/platforms/ps3/platform.h | 12 +++--
arch/powerpc/platforms/ps3/repository.c | 75 +++++++++++++++++++++++++++++++-
2 files changed, 83 insertions(+), 4 deletions(-)
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -180,10 +180,10 @@ int ps3_repository_read_stor_dev_region(
unsigned int dev_index, unsigned int region_index,
unsigned int *region_id, u64 *region_start, u64 *region_size);
-/* repository pu and memory info */
+/* repository logical pu and memory info */
-int ps3_repository_read_num_pu(unsigned int *num_pu);
-int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
+int ps3_repository_read_num_pu(u64 *num_pu);
+int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id);
int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
int ps3_repository_read_region_total(u64 *region_total);
@@ -194,9 +194,15 @@ int ps3_repository_read_mm_info(u64 *rm_
int ps3_repository_read_num_be(unsigned int *num_be);
int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
+int ps3_repository_read_be_id(u64 node_id, u64 *be_id);
int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
+/* repository performance monitor info */
+
+int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
+ u64 *rights);
+
/* repository 'Other OS' area */
int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -711,6 +711,35 @@ int ps3_repository_read_stor_dev_region(
return result;
}
+/**
+ * ps3_repository_read_num_pu - Number of logical PU processors for this lpar.
+ */
+
+int ps3_repository_read_num_pu(u64 *num_pu)
+{
+ *num_pu = 0;
+ return read_node(PS3_LPAR_ID_CURRENT,
+ make_first_field("bi", 0),
+ make_field("pun", 0),
+ 0, 0,
+ num_pu, NULL);
+}
+
+/**
+ * ps3_repository_read_pu_id - Read the logical PU id.
+ * @pu_index: Zero based index.
+ * @pu_id: The logical PU id.
+ */
+
+int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id)
+{
+ return read_node(PS3_LPAR_ID_CURRENT,
+ make_first_field("bi", 0),
+ make_field("pu", pu_index),
+ 0, 0,
+ pu_id, NULL);
+}
+
int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size)
{
return read_node(PS3_LPAR_ID_CURRENT,
@@ -883,6 +912,10 @@ int ps3_repository_read_boot_dat_info(u6
: ps3_repository_read_boot_dat_size(size);
}
+/**
+ * ps3_repository_read_num_be - Number of physical BE processors in the system.
+ */
+
int ps3_repository_read_num_be(unsigned int *num_be)
{
int result;
@@ -898,6 +931,12 @@ int ps3_repository_read_num_be(unsigned
return result;
}
+/**
+ * ps3_repository_read_be_node_id - Read the physical BE processor node id.
+ * @be_index: Zero based index.
+ * @node_id: The BE processor node id.
+ */
+
int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id)
{
return read_node(PS3_LPAR_ID_PME,
@@ -908,6 +947,22 @@ int ps3_repository_read_be_node_id(unsig
node_id, NULL);
}
+/**
+ * ps3_repository_read_be_id - Read the physical BE processor id.
+ * @node_id: The BE processor node id.
+ * @be_id: The BE processor id.
+ */
+
+int ps3_repository_read_be_id(u64 node_id, u64 *be_id)
+{
+ return read_node(PS3_LPAR_ID_PME,
+ make_first_field("be", 0),
+ node_id,
+ 0,
+ 0,
+ be_id, NULL);
+}
+
int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq)
{
return read_node(PS3_LPAR_ID_PME,
@@ -924,11 +979,29 @@ int ps3_repository_read_be_tb_freq(unsig
u64 node_id;
*tb_freq = 0;
- result = ps3_repository_read_be_node_id(0, &node_id);
+ result = ps3_repository_read_be_node_id(be_index, &node_id);
return result ? result
: ps3_repository_read_tb_freq(node_id, tb_freq);
}
+int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
+ u64 *rights)
+{
+ int result;
+ u64 node_id;
+
+ *lpar = 0;
+ *rights = 0;
+ result = ps3_repository_read_be_node_id(be_index, &node_id);
+ return result ? result
+ : read_node(PS3_LPAR_ID_PME,
+ make_first_field("be", 0),
+ node_id,
+ make_field("lpm", 0),
+ make_field("priv", 0),
+ lpar, rights);
+}
+
#if defined(DEBUG)
int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
--
^ permalink raw reply
* [patch 16/16] PS3: Update ps3_defconfig
From: Geoff Levand @ 2008-01-18 20:33 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080118202612.422185192@am.sony.com>
Update ps3_defconfig.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
arch/powerpc/configs/ps3_defconfig | 49 ++++++++++++++++++++++++++-----------
1 file changed, 35 insertions(+), 14 deletions(-)
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc4
-# Tue Dec 4 22:49:57 2007
+# Linux kernel version: 2.6.24-rc8
+# Wed Jan 16 14:31:21 2008
#
CONFIG_PPC64=y
@@ -103,6 +103,7 @@ CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
@@ -154,7 +155,6 @@ CONFIG_PPC_PS3=y
# CONFIG_PS3_ADVANCED is not set
CONFIG_PS3_HTAB_SIZE=20
# CONFIG_PS3_DYNAMIC_DMA is not set
-CONFIG_PS3_USE_LPAR_ADDR=y
CONFIG_PS3_VUART=y
CONFIG_PS3_PS3AV=y
CONFIG_PS3_SYS_MANAGER=y
@@ -162,6 +162,7 @@ CONFIG_PS3_STORAGE=y
CONFIG_PS3_DISK=y
CONFIG_PS3_ROM=y
CONFIG_PS3_FLASH=y
+CONFIG_PS3_LPM=m
CONFIG_PPC_CELL=y
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PPC_IBM_CELL_BLADE is not set
@@ -225,7 +226,7 @@ CONFIG_HAVE_MEMORY_PRESENT=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
-CONFIG_SPARSEMEM_VMEMMAP=y
+# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
CONFIG_SPLIT_PTLOCK_CPUS=4
@@ -338,7 +339,26 @@ CONFIG_IPV6_SIT=y
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
-# CONFIG_BT is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIVHCI is not set
# CONFIG_AF_RXRPC is not set
#
@@ -666,14 +686,14 @@ CONFIG_LOGO_LINUX_CLUT224=y
#
# Sound
#
-CONFIG_SOUND=y
+CONFIG_SOUND=m
#
# Advanced Linux Sound Architecture
#
-CONFIG_SND=y
-CONFIG_SND_TIMER=y
-CONFIG_SND_PCM=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
# CONFIG_SND_SEQUENCER is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
@@ -702,7 +722,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
#
# ALSA PowerPC devices
#
-CONFIG_SND_PS3=y
+CONFIG_SND_PS3=m
CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
#
@@ -747,7 +767,7 @@ CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=y
+CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
#
@@ -761,13 +781,13 @@ CONFIG_USB_DEVICEFS=y
#
# USB Host Controller Drivers
#
-CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD=m
# CONFIG_USB_EHCI_SPLIT_ISO is not set
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
# CONFIG_USB_EHCI_TT_NEWSCHED is not set
CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
# CONFIG_USB_ISP116X_HCD is not set
-CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_HCD_PPC_OF is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1033,7 +1053,8 @@ CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_INSTRUMENTATION=y
-# CONFIG_PROFILING is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
# CONFIG_KPROBES is not set
# CONFIG_MARKERS is not set
--
^ permalink raw reply
* [patch 15/16] PS3: Revove use lpar address workaround
From: Geoff Levand @ 2008-01-18 20:32 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080118202612.422185192@am.sony.com>
Remove the PS3 workaround needed to support sparsemem SPU mappings.
The SPU mappings no longer use sparsemem, so this workaround is no
longer needed.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
arch/powerpc/platforms/ps3/Kconfig | 11 -----------
arch/powerpc/platforms/ps3/mm.c | 16 ++++------------
include/asm-powerpc/sparsemem.h | 5 -----
3 files changed, 4 insertions(+), 28 deletions(-)
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -61,17 +61,6 @@ config PS3_DYNAMIC_DMA
This support is mainly for Linux kernel development. If unsure,
say N.
-config PS3_USE_LPAR_ADDR
- depends on PPC_PS3 && EXPERIMENTAL
- bool "PS3 use lpar address space"
- default y
- help
- This option is solely for experimentation by experts. Disables
- translation of lpar addresses. SPE support currently won't work
- without this set to y.
-
- If you have any doubt, choose the default y.
-
config PS3_VUART
depends on PPC_PS3
tristate
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -36,11 +36,6 @@
#endif
enum {
-#if defined(CONFIG_PS3_USE_LPAR_ADDR)
- USE_LPAR_ADDR = 1,
-#else
- USE_LPAR_ADDR = 0,
-#endif
#if defined(CONFIG_PS3_DYNAMIC_DMA)
USE_DYNAMIC_DMA = 1,
#else
@@ -137,11 +132,8 @@ static struct map map;
unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr)
{
BUG_ON(is_kernel_addr(phys_addr));
- if (USE_LPAR_ADDR)
- return phys_addr;
- else
- return (phys_addr < map.rm.size || phys_addr >= map.total)
- ? phys_addr : phys_addr + map.r1.offset;
+ return (phys_addr < map.rm.size || phys_addr >= map.total)
+ ? phys_addr : phys_addr + map.r1.offset;
}
EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
@@ -309,7 +301,7 @@ static int __init ps3_mm_add_memory(void
BUG_ON(!mem_init_done);
- start_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
+ start_addr = map.rm.size;
start_pfn = start_addr >> PAGE_SHIFT;
nr_pages = (map.r1.size + PAGE_SIZE - 1) >> PAGE_SHIFT;
@@ -1007,7 +999,7 @@ static int dma_sb_region_create_linear(s
if (r->offset + r->len > map.rm.size) {
/* Map (part of) 2nd RAM chunk */
- virt_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
+ virt_addr = map.rm.size;
len = r->len;
if (r->offset >= map.rm.size)
virt_addr += r->offset - map.rm.size;
--- a/include/asm-powerpc/sparsemem.h
+++ b/include/asm-powerpc/sparsemem.h
@@ -10,13 +10,8 @@
*/
#define SECTION_SIZE_BITS 24
-#if defined(CONFIG_PS3_USE_LPAR_ADDR)
-#define MAX_PHYSADDR_BITS 47
-#define MAX_PHYSMEM_BITS 47
-#else
#define MAX_PHYSADDR_BITS 44
#define MAX_PHYSMEM_BITS 44
-#endif
#ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end);
--
^ permalink raw reply
* [patch 12/16] PS3: Add logical performance monitor device support
From: Geoff Levand @ 2008-01-18 20:32 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20080118202612.422185192@am.sony.com>
Add PS3 logical performance monitor device support to the
PS3 system-bus and platform device registration routines.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
v2: o Add enum ps3_lpm_tb_type.
o Remove redundant enclosing structure and return proper
error codes from ps3_register_lpm_devices().
v3: o Add lpm.node_id to struct ps3_system_bus_device.
o Cleanup repository discovery logic.
arch/powerpc/platforms/ps3/device-init.c | 85 +++++++++++++++++++++++++++++++
arch/powerpc/platforms/ps3/system-bus.c | 5 +
include/asm-powerpc/ps3.h | 8 ++
3 files changed, 98 insertions(+)
create mode 100644 arch/powerpc/platforms/ps3/lpm.c
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -31,6 +31,89 @@
#include "platform.h"
+static int __init ps3_register_lpm_devices(void)
+{
+ int result;
+ u64 tmp1;
+ u64 tmp2;
+ struct ps3_system_bus_device *dev;
+
+ pr_debug(" -> %s:%d\n", __func__, __LINE__);
+
+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ if (!dev)
+ return -ENOMEM;
+
+ dev->match_id = PS3_MATCH_ID_LPM;
+ dev->dev_type = PS3_DEVICE_TYPE_LPM;
+
+ /* The current lpm driver only supports a single BE processor. */
+
+ result = ps3_repository_read_be_node_id(0, &dev->lpm.node_id);
+
+ if (result) {
+ pr_debug("%s:%d: ps3_repository_read_be_node_id failed \n",
+ __func__, __LINE__);
+ goto fail_read_repo;
+ }
+
+ result = ps3_repository_read_lpm_privileges(dev->lpm.node_id, &tmp1,
+ &dev->lpm.rights);
+
+ if (result) {
+ pr_debug("%s:%d: ps3_repository_read_lpm_privleges failed \n",
+ __func__, __LINE__);
+ goto fail_read_repo;
+ }
+
+ lv1_get_logical_partition_id(&tmp2);
+
+ if (tmp1 != tmp2) {
+ pr_debug("%s:%d: wrong lpar\n",
+ __func__, __LINE__);
+ result = -ENODEV;
+ goto fail_rights;
+ }
+
+ if (!(dev->lpm.rights & PS3_LPM_RIGHTS_USE_LPM)) {
+ pr_debug("%s:%d: don't have rights to use lpm\n",
+ __func__, __LINE__);
+ result = -EPERM;
+ goto fail_rights;
+ }
+
+ pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n",
+ __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
+ dev->lpm.rights);
+
+ result = ps3_repository_read_pu_id(0, &dev->lpm.pu_id);
+
+ if (result) {
+ pr_debug("%s:%d: ps3_repository_read_pu_id failed \n",
+ __func__, __LINE__);
+ goto fail_read_repo;
+ }
+
+ result = ps3_system_bus_device_register(dev);
+
+ if (result) {
+ pr_debug("%s:%d ps3_system_bus_device_register failed\n",
+ __func__, __LINE__);
+ goto fail_register;
+ }
+
+ pr_debug(" <- %s:%d\n", __func__, __LINE__);
+ return 0;
+
+
+fail_register:
+fail_rights:
+fail_read_repo:
+ kfree(dev);
+ pr_debug(" <- %s:%d: failed\n", __func__, __LINE__);
+ return result;
+}
+
/**
* ps3_setup_gelic_device - Setup and register a gelic device instance.
*
@@ -827,6 +910,8 @@ static int __init ps3_register_devices(v
ps3_register_sound_devices();
+ ps3_register_lpm_devices();
+
pr_debug(" <- %s:%d\n", __func__, __LINE__);
return 0;
}
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -715,6 +715,7 @@ int ps3_system_bus_device_register(struc
static unsigned int dev_ioc0_count;
static unsigned int dev_sb_count;
static unsigned int dev_vuart_count;
+ static unsigned int dev_lpm_count;
if (!dev->core.parent)
dev->core.parent = &ps3_system_bus;
@@ -737,6 +738,10 @@ int ps3_system_bus_device_register(struc
snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
"vuart_%02x", ++dev_vuart_count);
break;
+ case PS3_DEVICE_TYPE_LPM:
+ snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
+ "lpm_%02x", ++dev_lpm_count);
+ break;
default:
BUG();
};
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -317,6 +317,7 @@ enum ps3_match_id {
PS3_MATCH_ID_STOR_FLASH = 8,
PS3_MATCH_ID_SOUND = 9,
PS3_MATCH_ID_GRAPHICS = 10,
+ PS3_MATCH_ID_LPM = 11,
};
#define PS3_MODULE_ALIAS_EHCI "ps3:1"
@@ -329,11 +330,13 @@ enum ps3_match_id {
#define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8"
#define PS3_MODULE_ALIAS_SOUND "ps3:9"
#define PS3_MODULE_ALIAS_GRAPHICS "ps3:10"
+#define PS3_MODULE_ALIAS_LPM "ps3:11"
enum ps3_system_bus_device_type {
PS3_DEVICE_TYPE_IOC0 = 1,
PS3_DEVICE_TYPE_SB,
PS3_DEVICE_TYPE_VUART,
+ PS3_DEVICE_TYPE_LPM,
};
/**
@@ -350,6 +353,11 @@ struct ps3_system_bus_device {
struct ps3_dma_region *d_region; /* SB, IOC0 */
struct ps3_mmio_region *m_region; /* SB, IOC0*/
unsigned int port_number; /* VUART */
+ struct { /* LPM */
+ u64 node_id;
+ u64 pu_id;
+ u64 rights;
+ } lpm;
/* struct iommu_table *iommu_table; -- waiting for BenH's cleanups */
struct device core;
--
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox