* [PATCH 5/5] powerpc/numa: Remove duplicate RECLAIM_DISTANCE definition
From: Anton Blanchard @ 2011-07-25 2:33 UTC (permalink / raw)
To: mingo, peterz, benh; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20110725023311.175792493@samba.org>
We have two identical definitions of RECLAIM_DISTANCE, looks like
the patch got applied twice. Remove one.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-2.6-work/arch/powerpc/include/asm/topology.h
===================================================================
--- linux-2.6-work.orig/arch/powerpc/include/asm/topology.h 2011-07-25 12:15:33.059921510 +1000
+++ linux-2.6-work/arch/powerpc/include/asm/topology.h 2011-07-25 12:15:46.750174446 +1000
@@ -19,16 +19,6 @@ struct device_node;
#define RECLAIM_DISTANCE 10
/*
- * Before going off node we want the VM to try and reclaim from the local
- * node. It does this if the remote distance is larger than RECLAIM_DISTANCE.
- * With the default REMOTE_DISTANCE of 20 and the default RECLAIM_DISTANCE of
- * 20, we never reclaim and go off node straight away.
- *
- * To fix this we choose a smaller value of RECLAIM_DISTANCE.
- */
-#define RECLAIM_DISTANCE 10
-
-/*
* Avoid creating an extra level of balancing (SD_ALLNODES) on the largest
* POWER7 boxes which have a maximum of 32 nodes.
*/
^ permalink raw reply
* [PATCH 0/3] pseries kexec fixes
From: Anton Blanchard @ 2011-07-25 11:46 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
Here are a few pseries kexec fixes after testing on a recent version
version.
Anton
^ permalink raw reply
* [PATCH 1/3] powerpc/pseries: Fix kexec on recent firmware versions
From: Anton Blanchard @ 2011-07-25 11:46 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev, stable
In-Reply-To: <20110725114631.778346293@samba.org>
Recent versions of firmware will fail to unmap the virtual processor
area if we have a dispatch trace log registered. This causes kexec
to fail.
If a trace log is registered this patch unregisters it before the
SLB shadow and virtual processor areas, fixing the problem.
The address argument is ignored by firmware on unregister so we
may as well remove it.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
---
Index: linux-powerpc/arch/powerpc/platforms/pseries/kexec.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/kexec.c 2011-07-25 21:06:49.510413446 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/kexec.c 2011-07-25 21:06:52.340464687 +1000
@@ -26,6 +26,17 @@ static void pseries_kexec_cpu_down(int c
/* Don't risk a hypervisor call if we're crashing */
if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
unsigned long addr;
+ int ret;
+
+ if (get_lppaca()->dtl_enable_mask) {
+ ret = unregister_dtl(hard_smp_processor_id());
+ if (ret) {
+ pr_err("WARNING: DTL deregistration for cpu "
+ "%d (hw %d) failed with %d\n",
+ smp_processor_id(),
+ hard_smp_processor_id(), ret);
+ }
+ }
addr = __pa(get_slb_shadow());
if (unregister_slb_shadow(hard_smp_processor_id(), addr))
Index: linux-powerpc/arch/powerpc/platforms/pseries/dtl.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/dtl.c 2011-07-25 21:06:49.520413628 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/dtl.c 2011-07-25 21:06:52.340464687 +1000
@@ -181,7 +181,7 @@ static void dtl_stop(struct dtl *dtl)
lppaca_of(dtl->cpu).dtl_enable_mask = 0x0;
- unregister_dtl(hwcpu, __pa(dtl->buf));
+ unregister_dtl(hwcpu);
}
static u64 dtl_current_index(struct dtl *dtl)
Index: linux-powerpc/arch/powerpc/platforms/pseries/plpar_wrappers.h
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/plpar_wrappers.h 2011-07-25 21:06:49.500413264 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/plpar_wrappers.h 2011-07-25 21:06:52.340464687 +1000
@@ -73,9 +73,9 @@ static inline long register_slb_shadow(u
return vpa_call(0x3, cpu, vpa);
}
-static inline long unregister_dtl(unsigned long cpu, unsigned long vpa)
+static inline long unregister_dtl(unsigned long cpu)
{
- return vpa_call(0x6, cpu, vpa);
+ return vpa_call(0x6, cpu, 0);
}
static inline long register_dtl(unsigned long cpu, unsigned long vpa)
^ permalink raw reply
* [PATCH 2/3] powerpc/pseries: Cleanup VPA registration and deregistration errors
From: Anton Blanchard @ 2011-07-25 11:46 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
In-Reply-To: <20110725114631.778346293@samba.org>
Make the VPA, SLB shadow and DTL registration and deregistration
functions print consistent messages on error. I needed the firmware
error code while chasing a kexec bug but we weren't printing it.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-powerpc/arch/powerpc/platforms/pseries/kexec.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/kexec.c 2011-07-25 21:06:52.340464687 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/kexec.c 2011-07-25 21:06:56.260535670 +1000
@@ -39,17 +39,20 @@ static void pseries_kexec_cpu_down(int c
}
addr = __pa(get_slb_shadow());
- if (unregister_slb_shadow(hard_smp_processor_id(), addr))
- printk("SLB shadow buffer deregistration of "
- "cpu %u (hw_cpu_id %d) failed\n",
+ ret = unregister_slb_shadow(hard_smp_processor_id(), addr);
+ if (ret) {
+ pr_err("WARNING: SLB shadow buffer deregistration "
+ "for cpu %d (hw %d) failed with %d\n",
smp_processor_id(),
- hard_smp_processor_id());
+ hard_smp_processor_id(), ret);
+ }
addr = __pa(get_lppaca());
- if (unregister_vpa(hard_smp_processor_id(), addr)) {
- printk("VPA deregistration of cpu %u (hw_cpu_id %d) "
- "failed\n", smp_processor_id(),
- hard_smp_processor_id());
+ ret = unregister_vpa(hard_smp_processor_id(), addr);
+ if (ret) {
+ pr_err("WARNING: VPA deregistration for cpu %d "
+ "(hw %d) failed with %d\n", smp_processor_id(),
+ hard_smp_processor_id(), ret);
}
}
}
Index: linux-powerpc/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/lpar.c 2011-07-25 21:06:49.440412178 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/lpar.c 2011-07-25 21:06:56.260535670 +1000
@@ -67,9 +67,8 @@ void vpa_init(int cpu)
ret = register_vpa(hwcpu, addr);
if (ret) {
- printk(KERN_ERR "WARNING: vpa_init: VPA registration for "
- "cpu %d (hw %d) of area %lx returns %ld\n",
- cpu, hwcpu, addr, ret);
+ pr_err("WARNING: VPA registration for cpu %d (hw %d) of area "
+ "%lx failed with %ld\n", cpu, hwcpu, addr, ret);
return;
}
/*
@@ -80,10 +79,9 @@ void vpa_init(int cpu)
if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
ret = register_slb_shadow(hwcpu, addr);
if (ret)
- printk(KERN_ERR
- "WARNING: vpa_init: SLB shadow buffer "
- "registration for cpu %d (hw %d) of area %lx "
- "returns %ld\n", cpu, hwcpu, addr, ret);
+ pr_err("WARNING: SLB shadow buffer registration for "
+ "cpu %d (hw %d) of area %lx failed with %ld\n",
+ cpu, hwcpu, addr, ret);
}
/*
@@ -100,8 +98,9 @@ void vpa_init(int cpu)
dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
ret = register_dtl(hwcpu, __pa(dtl));
if (ret)
- pr_warn("DTL registration failed for cpu %d (%ld)\n",
- cpu, ret);
+ pr_err("WARNING: DTL registration of cpu %d (hw %d) "
+ "failed with %ld\n", smp_processor_id(),
+ hwcpu, ret);
lppaca_of(cpu).dtl_enable_mask = 2;
}
}
Index: linux-powerpc/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/setup.c 2011-07-25 21:06:49.450412359 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/setup.c 2011-07-25 21:06:56.260535670 +1000
@@ -324,8 +324,9 @@ static int alloc_dispatch_logs(void)
dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
ret = register_dtl(hard_smp_processor_id(), __pa(dtl));
if (ret)
- pr_warn("DTL registration failed for boot cpu %d (%d)\n",
- smp_processor_id(), ret);
+ pr_err("WARNING: DTL registration of cpu %d (hw %d) failed "
+ "with %d\n", smp_processor_id(),
+ hard_smp_processor_id(), ret);
get_paca()->lppaca_ptr->dtl_enable_mask = 2;
return 0;
^ permalink raw reply
* [PATCH 3/3] powerpc/pseries: Simplify vpa deregistration functions
From: Anton Blanchard @ 2011-07-25 11:46 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
In-Reply-To: <20110725114631.778346293@samba.org>
The VPA, SLB shadow and DTL degistration functions do not need an
address, so simplify things and remove it.
Also cleanup pseries_kexec_cpu_down a bit by storing the cpu IDs
in local variables.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-powerpc/arch/powerpc/platforms/pseries/hotplug-cpu.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/hotplug-cpu.c 2011-07-25 21:06:49.390411273 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/hotplug-cpu.c 2011-07-25 21:06:57.380555950 +1000
@@ -135,7 +135,7 @@ static void pseries_mach_cpu_die(void)
get_lppaca()->idle = 0;
if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) {
- unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
+ unregister_slb_shadow(hwcpu);
/*
* Call to start_secondary_resume() will not return.
@@ -150,7 +150,7 @@ static void pseries_mach_cpu_die(void)
WARN_ON(get_preferred_offline_state(cpu) != CPU_STATE_OFFLINE);
set_cpu_current_state(cpu, CPU_STATE_OFFLINE);
- unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
+ unregister_slb_shadow(hwcpu);
rtas_stop_self();
/* Should never get here... */
Index: linux-powerpc/arch/powerpc/platforms/pseries/kexec.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/kexec.c 2011-07-25 21:06:56.260535670 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/kexec.c 2011-07-25 21:09:20.033141478 +1000
@@ -25,34 +25,30 @@ static void pseries_kexec_cpu_down(int c
{
/* Don't risk a hypervisor call if we're crashing */
if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
- unsigned long addr;
int ret;
+ int cpu = smp_processor_id();
+ int hwcpu = hard_smp_processor_id();
if (get_lppaca()->dtl_enable_mask) {
- ret = unregister_dtl(hard_smp_processor_id());
+ ret = unregister_dtl(hwcpu);
if (ret) {
pr_err("WARNING: DTL deregistration for cpu "
"%d (hw %d) failed with %d\n",
- smp_processor_id(),
- hard_smp_processor_id(), ret);
+ cpu, hwcpu, ret);
}
}
- addr = __pa(get_slb_shadow());
- ret = unregister_slb_shadow(hard_smp_processor_id(), addr);
+ ret = unregister_slb_shadow(hwcpu);
if (ret) {
pr_err("WARNING: SLB shadow buffer deregistration "
"for cpu %d (hw %d) failed with %d\n",
- smp_processor_id(),
- hard_smp_processor_id(), ret);
+ cpu, hwcpu, ret);
}
- addr = __pa(get_lppaca());
- ret = unregister_vpa(hard_smp_processor_id(), addr);
+ ret = unregister_vpa(hwcpu);
if (ret) {
pr_err("WARNING: VPA deregistration for cpu %d "
- "(hw %d) failed with %d\n", smp_processor_id(),
- hard_smp_processor_id(), ret);
+ "(hw %d) failed with %d\n", cpu, hwcpu, ret);
}
}
}
Index: linux-powerpc/arch/powerpc/platforms/pseries/plpar_wrappers.h
===================================================================
--- linux-powerpc.orig/arch/powerpc/platforms/pseries/plpar_wrappers.h 2011-07-25 21:06:52.340464687 +1000
+++ linux-powerpc/arch/powerpc/platforms/pseries/plpar_wrappers.h 2011-07-25 21:06:57.380555950 +1000
@@ -53,9 +53,9 @@ static inline long vpa_call(unsigned lon
return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
}
-static inline long unregister_vpa(unsigned long cpu, unsigned long vpa)
+static inline long unregister_vpa(unsigned long cpu)
{
- return vpa_call(0x5, cpu, vpa);
+ return vpa_call(0x5, cpu, 0);
}
static inline long register_vpa(unsigned long cpu, unsigned long vpa)
@@ -63,9 +63,9 @@ static inline long register_vpa(unsigned
return vpa_call(0x1, cpu, vpa);
}
-static inline long unregister_slb_shadow(unsigned long cpu, unsigned long vpa)
+static inline long unregister_slb_shadow(unsigned long cpu)
{
- return vpa_call(0x7, cpu, vpa);
+ return vpa_call(0x7, cpu, 0);
}
static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)
^ permalink raw reply
* mtu issue with gianfar driver
From: Kumar Reddy Suresh-B22303 @ 2011-07-25 11:47 UTC (permalink / raw)
To: linuxppc-dev@lists.ozlabs.org
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
Hi All,
A problem was observed in gianfar driver when the interface MTU was modified to a small value.
FYI Kernel Version : 2.6.32 on PPC.
Like if we change the interface mtu to say 100, ping traffic with size greater than 450 is failing.
It was observed that packets ( ping requests) going out of that interface are getting properly fragmented, but the return packets ( ping replies ) are getting dropped by the interface.
To fix this issue the function gfar_change_mtu() in gianfar.c was modified as below:
rx_buffer_size is restored to DEFAULT_RX_BUFFER_SIZE as indicated in RED in the code snippet below
------------------------- CODE SNIPPET BEGIN ----------------------------------
tempsize =
(frame_size & ~(INCREMENTAL_BUFFER_SIZE - 1)) +
INCREMENTAL_BUFFER_SIZE;
if (tempsize < DEFAULT_RX_BUFFER_SIZE )
tempsize = DEFAULT_RX_BUFFER_SIZE;
/* Only stop and start the controller if it isn't already
* stopped, and we changed something */
if ((oldsize != tempsize) && (dev->flags & IFF_UP))
stop_gfar(dev);
priv->rx_buffer_size = tempsize;
dev->mtu = new_mtu;
------------------------- CODE SNIPPET END----------------------------------
If this fix OK? What is the impact of this change on overall behavior?
Best Regards,
- Suresh
[-- Attachment #2: Type: text/html, Size: 8406 bytes --]
^ permalink raw reply
* Re: [PATCH 0/5] ppc64 scheduler fixes
From: Peter Zijlstra @ 2011-07-25 12:41 UTC (permalink / raw)
To: Anton Blanchard; +Cc: mingo, linuxppc-dev, linux-kernel
In-Reply-To: <20110725023311.175792493@samba.org>
On Mon, 2011-07-25 at 12:33 +1000, Anton Blanchard wrote:
> Here are a set of ppc64 scheduler fixes that help with some
> multi node performance issues.
They look fine to me. I'll probably ping you when I'll rip out all that
SD_NODES_PER_DOMAIN crap for good, but until then I'm fine with you
fiddling it for ppc64.
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
^ permalink raw reply
* Re: Linux 3.0 boot failure on the Powerbook G4
From: Michael Büsch @ 2011-07-25 13:03 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1311549818.25044.587.camel@pasglop>
On Mon, 25 Jul 2011 09:23:38 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Hrm.. the faulting address is outside of the zImage. Odd.
>
> Can you try loading a plain vmlinux instead ? (feel free to strip it).
The plain unstripped vmlinux boots fine:
mb@maggie:~$ uname -a
Linux maggie 3.0.0 #3 PREEMPT Sun Jul 24 11:51:30 CEST 2011 ppc GNU/Linux
Is there something going wrong in the uncompress trampoline?
--
Greetings, Michael.
^ permalink raw reply
* [GIT PULL] Please pull powerpc.git next branch
From: Kumar Gala @ 2011-07-25 14:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
[ a few minor fixes ]
The following changes since commit 50d2a4223bb875d1e3a7ee97d40dd03bf31ce1b7:
powerpc: Copy back TIF flags on return from softirq stack (2011-07-22 13:38:58 +1000)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git next
Fabio Baltieri (1):
powerpc/85xx: fix mpic configuration in CAMP mode
Timur Tabi (1):
drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 3 ++-
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 5 +++--
drivers/virt/fsl_hypervisor.c | 1 +
3 files changed, 6 insertions(+), 3 deletions(-)
^ permalink raw reply
* Re: perf PPC: kernel panic with callchains and context switch events
From: David Ahern @ 2011-07-25 15:38 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Anton Blanchard
Cc: LKML, linux-perf-users, Paul Mackerras, linuxppc-dev
In-Reply-To: <1311558949.25044.614.camel@pasglop>
Hi Ben:
On 07/24/2011 07:55 PM, Benjamin Herrenschmidt wrote:
> On Sun, 2011-07-24 at 11:18 -0600, David Ahern wrote:
>> On 07/20/2011 03:57 PM, David Ahern wrote:
>>> I am hoping someone familiar with PPC can help understand a panic that
>>> is generated when capturing callchains with context switch events.
>>>
>>> Call trace is below. The short of it is that walking the callchain
>>> generates a page fault. To handle the page fault the mmap_sem is needed,
>>> but it is currently held by setup_arg_pages. setup_arg_pages calls
>>> shift_arg_pages with the mmap_sem held. shift_arg_pages then calls
>>> move_page_tables which has a cond_resched at the top of its for loop. If
>>> the cond_resched() is removed from move_page_tables everything works
>>> beautifully - no panics.
>>>
>>> So, the question: is it normal for walking the stack to trigger a page
>>> fault on PPC? The panic is not seen on x86 based systems.
>>
>> Can anyone confirm whether page faults while walking the stack are
>> normal for PPC? We really want to use the context switch event with
>> callchains and need to understand whether this behavior is normal. Of
>> course if it is normal, a way to address the problem without a panic
>> will be needed.
>
> Now that leads to interesting discoveries :-) Becky, can you read all
> the way and let me know what you think ?
>
> So, trying to walk the user stack directly will potentially cause page
> faults if it's done by direct access. So if you're going to do it in a
> spot where you can't afford it, you need to pagefault_disable() I
> suppose. I think the problem with our existing code is that it's missing
> those around __get_user_inatomic().
>
> In fact, arguably, we don't want the hash code from modifying the hash
> either (or even hashing things in). Our 64-bit code handles it today in
> perf_callchain.c in a way that involves pretty much duplicating the
> functionality of __get_user_pages_fast() as used by x86 (see below), but
> as a fallback from a direct access which misses the pagefault_disable()
> as well.
>
> I think it comes from an old assumption that this would always be called
> from an nmi, and the explicit tracepoints broke that assumption.
>
> In fact we probably want to bump the NMI count, not just the IRQ count
> as pagefault_disable() does, to make sure we prevent hashing.
>
> x86 does things differently, using __get_user_pages_fast() (a variant of
> get_user_page_fast() that doesn't fallback to normal get_user_pages()).
>
> Now, we could do the same (use __gup_fast too), but I can see a
> potential issue with ppc 32-bit platforms that have 64-bit PTEs, since
> we could end up GUP'ing in the middle of the two accesses.
>
> Becky: I think gup_fast is generally broken on 32-bit with 64-bit PTE
> because of that, the problem isn't specific to perf backtraces, I'll
> propose a solution further down.
>
> Now, on x86, there is a similar problem with PAE, which is handled by
>
> - having gup disable IRQs
> - rely on the fact that to change from a valid value to another valid
> value, the PTE will first get invalidated, which requires an IPI
> and thus will be blocked by our interrupts being off
>
> We do the first part, but the second part will break if we use HW TLB
> invalidation broadcast (yet another reason why those are bad, I think I
> will write a blog entry about it one of these days).
>
> I think we can work around this while keeping our broadcast TLB
> invalidations by having the invalidation code also increment a global
> generation count (using the existing lock used by the invalidation code,
> all 32-bit platforms have such a lock).
>
> From there, gup_fast can be changed to, with proper ordering, check the
> generation count around the loading of the PTE and loop if it has
> changed, kind-of a seqlock.
>
> We also need the NMI count bump if we are going to try to keep the
> attempt at doing a direct access first for perfs.
>
> Becky, do you feel like giving that a shot or should I find another
> victim ? (Or even do it myself ... ) :-)
Did you have something in mind besides the patch Anton sent? We'll give
that one a try and see how it works. (Thanks, Anton!)
David
>
> Cheers,
> Ben.
>
>> Thanks,
>> David
>>
>>>
>>> [<b0180e00>]rb_erase+0x1b4/0x3e8
>>> [<b00430f4>]__dequeue_entity+0x50/0xe8
>>> [<b0043304>]set_next_entity+0x178/0x1bc
>>> [<b0043440>]pick_next_task_fair+0xb0/0x118
>>> [<b02ada80>]schedule+0x500/0x614
>>> [<b02afaa8>]rwsem_down_failed_common+0xf0/0x264
>>> [<b02afca0>]rwsem_down_read_failed+0x34/0x54
>>> [<b02aed4c>]down_read+0x3c/0x54
>>> [<b0023b58>]do_page_fault+0x114/0x5e8
>>> [<b001e350>]handle_page_fault+0xc/0x80
>>> [<b0022dec>]perf_callchain+0x224/0x31c
>>> [<b009ba70>]perf_prepare_sample+0x240/0x2fc
>>> [<b009d760>]__perf_event_overflow+0x280/0x398
>>> [<b009d914>]perf_swevent_overflow+0x9c/0x10c
>>> [<b009db54>]perf_swevent_ctx_event+0x1d0/0x230
>>> [<b009dc38>]do_perf_sw_event+0x84/0xe4
>>> [<b009dde8>]perf_sw_event_context_switch+0x150/0x1b4
>>> [<b009de90>]perf_event_task_sched_out+0x44/0x2d4
>>> [<b02ad840>]schedule+0x2c0/0x614
>>> [<b0047dc0>]__cond_resched+0x34/0x90
>>> [<b02adcc8>]_cond_resched+0x4c/0x68
>>> [<b00bccf8>]move_page_tables+0xb0/0x418
>>> [<b00d7ee0>]setup_arg_pages+0x184/0x2a0
>>> [<b0110914>]load_elf_binary+0x394/0x1208
>>> [<b00d6e28>]search_binary_handler+0xe0/0x2c4
>>> [<b00d834c>]do_execve+0x1bc/0x268
>>> [<b0015394>]sys_execve+0x84/0xc8
>>> [<b001df10>]ret_from_syscall+0x0/0x3c
>>>
>>> Thanks,
>>> David
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
^ permalink raw reply
* Re: [PATCH 13/14] 85xx: consolidate of_platform_bus_probe calls
From: Scott Wood @ 2011-07-25 15:40 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov; +Cc: Paul Mackerras, Linux PPC Development
In-Reply-To: <CALT56yOZkLW=AmkyX77g5agxfBb0h7Fz8Q_enth-CJycJ3SkFA@mail.gmail.com>
On Sat, 23 Jul 2011 01:45:53 +0400
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> I see your point. I just wasn't thinking too much about ot-of-tree trees.
> My thought was that if someone updates the kernel, he can also update the dtb.
Sometimes there are firmware dependencies that make that difficult. And
even if it's just user laziness/forgetfulness, that still translates to
extra support requests.
> Could you please update the lbc.txt suggesting the compatibility
> with simple-bus for lbc? Or you thing that it would be wrong?
>
> I think we should define compatibility list as "fsl,mpcXXXX-localbus",
> "fsl,pqXXXXX-localbus", "simple-bus", noting that by default new
> platforms/boards should only use "simple-bus" internally. Does this
> look reasonable for you? I can then try to provide a patch.
I'm OK with saying that localbus nodes should have simple-bus in new trees,
and defining canonical compatible values (chips with eLBC should be
"fsl,XXXX-elbc", "fsl,elbc", "simple-bus"). I'm not sure what you mean by
"should only use simple-bus internally", especially in the context of the
binding.
> What do you suggest/prefer? To add .name="localbus" to generic code
> or to have board-specific hooks (like one for mpc834xemitx)?
Just add localbus to the generic table.
-Scott
^ permalink raw reply
* [PATCH] powerpc/nvram: Add compression to fit more oops output into NVRAM
From: Jim Keniston @ 2011-07-25 17:54 UTC (permalink / raw)
To: benh, linuxppc-dev
Capture more than twice as much text from the printk buffer, and
compress it to fit it in the lnx,oops-log NVRAM partition. You
can view the compressed text using the new (as of July 20) --unzip
option of the nvram command in the powerpc-utils package.
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 6 +
arch/powerpc/platforms/pseries/nvram.c | 171 +++++++++++++++++++++++++++++++-
2 files changed, 168 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 58625d1..41f69ae 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -249,10 +249,12 @@ extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
#define ERR_FLAG_ALREADY_LOGGED 0x0
#define ERR_FLAG_BOOT 0x1 /* log was pulled from NVRAM on boot */
#define ERR_TYPE_RTAS_LOG 0x2 /* from rtas event-scan */
-#define ERR_TYPE_KERNEL_PANIC 0x4 /* from panic() */
+#define ERR_TYPE_KERNEL_PANIC 0x4 /* from die()/panic() */
+#define ERR_TYPE_KERNEL_PANIC_GZ 0x8 /* ditto, compressed */
/* All the types and not flags */
-#define ERR_TYPE_MASK (ERR_TYPE_RTAS_LOG | ERR_TYPE_KERNEL_PANIC)
+#define ERR_TYPE_MASK \
+ (ERR_TYPE_RTAS_LOG | ERR_TYPE_KERNEL_PANIC | ERR_TYPE_KERNEL_PANIC_GZ)
#define RTAS_DEBUG KERN_DEBUG "RTAS: "
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 00cc3a0..a76b228 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -18,6 +18,8 @@
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/kmsg_dump.h>
+#include <linux/ctype.h>
+#include <linux/zlib.h>
#include <asm/uaccess.h>
#include <asm/nvram.h>
#include <asm/rtas.h>
@@ -78,8 +80,41 @@ static struct kmsg_dumper nvram_kmsg_dumper = {
#define NVRAM_RTAS_READ_TIMEOUT 5 /* seconds */
static unsigned long last_unread_rtas_event; /* timestamp */
-/* We preallocate oops_buf during init to avoid kmalloc during oops/panic. */
-static char *oops_buf;
+/*
+ * For capturing and compressing an oops or panic report...
+
+ * big_oops_buf[] holds the uncompressed text we're capturing.
+ *
+ * oops_buf[] holds the compressed text, preceded by a prefix.
+ * The prefix is just a u16 holding the length of the compressed* text.
+ * (*Or uncompressed, if compression fails.) oops_buf[] gets written
+ * to NVRAM.
+ *
+ * oops_len points to the prefix. oops_data points to the compressed text.
+ *
+ * +- oops_buf
+ * | +- oops_data
+ * v v
+ * +------------+-----------------------------------------------+
+ * | length | text |
+ * | (2 bytes) | (oops_data_sz bytes) |
+ * +------------+-----------------------------------------------+
+ * ^
+ * +- oops_len
+ *
+ * We preallocate these buffers during init to avoid kmalloc during oops/panic.
+ */
+static size_t big_oops_buf_sz;
+static char *big_oops_buf, *oops_buf;
+static u16 *oops_len;
+static char *oops_data;
+static size_t oops_data_sz;
+
+/* Compression parameters */
+#define COMPR_LEVEL 6
+#define WINDOW_BITS 12
+#define MEM_LEVEL 4
+static struct z_stream_s stream;
static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
{
@@ -387,11 +422,44 @@ static void __init nvram_init_oops_partition(int rtas_partition_exists)
sizeof(rtas_log_partition));
}
oops_buf = kmalloc(oops_log_partition.size, GFP_KERNEL);
+ if (!oops_buf) {
+ pr_err("nvram: No memory for %s partition\n",
+ oops_log_partition.name);
+ return;
+ }
+ oops_len = (u16*) oops_buf;
+ oops_data = oops_buf + sizeof(u16);
+ oops_data_sz = oops_log_partition.size - sizeof(u16);
+
+ /*
+ * Figure compression (preceded by elimination of each line's <n>
+ * severity prefix) will reduce the oops/panic report to at most
+ * 45% of its original size.
+ */
+ big_oops_buf_sz = (oops_data_sz * 100) / 45;
+ big_oops_buf = kmalloc(big_oops_buf_sz, GFP_KERNEL);
+ if (big_oops_buf) {
+ stream.workspace = kmalloc(zlib_deflate_workspacesize(
+ WINDOW_BITS, MEM_LEVEL), GFP_KERNEL);
+ if (!stream.workspace) {
+ pr_err("nvram: No memory for compression workspace; "
+ "skipping compression of %s partition data\n",
+ oops_log_partition.name);
+ kfree(big_oops_buf);
+ big_oops_buf = NULL;
+ }
+ } else {
+ pr_err("No memory for uncompressed %s data; "
+ "skipping compression\n", oops_log_partition.name);
+ stream.workspace = NULL;
+ }
+
rc = kmsg_dump_register(&nvram_kmsg_dumper);
if (rc != 0) {
pr_err("nvram: kmsg_dump_register() failed; returned %d\n", rc);
kfree(oops_buf);
- return;
+ kfree(big_oops_buf);
+ kfree(stream.workspace);
}
}
@@ -473,7 +541,83 @@ static int clobbering_unread_rtas_event(void)
NVRAM_RTAS_READ_TIMEOUT);
}
-/* our kmsg_dump callback */
+/* Squeeze out each line's <n> severity prefix. */
+static size_t elide_severities(char *buf, size_t len)
+{
+ char *in, *out, *buf_end = buf + len;
+ /* Assume a <n> at the very beginning marks the start of a line. */
+ int newline = 1;
+
+ in = out = buf;
+ while (in < buf_end) {
+ if (newline && in+3 <= buf_end &&
+ *in == '<' && isdigit(in[1]) && in[2] == '>') {
+ in += 3;
+ newline = 0;
+ } else {
+ newline = (*in == '\n');
+ *out++ = *in++;
+ }
+ }
+ return out - buf;
+}
+
+/* Derived from logfs_compress() */
+static int nvram_compress(const void *in, void *out, size_t inlen,
+ size_t outlen)
+{
+ int err, ret;
+
+ ret = -EIO;
+ err = zlib_deflateInit2(&stream, COMPR_LEVEL, Z_DEFLATED, WINDOW_BITS,
+ MEM_LEVEL, Z_DEFAULT_STRATEGY);
+ if (err != Z_OK)
+ goto error;
+
+ stream.next_in = in;
+ stream.avail_in = inlen;
+ stream.total_in = 0;
+ stream.next_out = out;
+ stream.avail_out = outlen;
+ stream.total_out = 0;
+
+ err = zlib_deflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END)
+ goto error;
+
+ err = zlib_deflateEnd(&stream);
+ if (err != Z_OK)
+ goto error;
+
+ if (stream.total_out >= stream.total_in)
+ goto error;
+
+ ret = stream.total_out;
+error:
+ return ret;
+}
+
+/* Compress the text from big_oops_buf into oops_buf. */
+static int zip_oops(size_t text_len)
+{
+ int zipped_len = nvram_compress(big_oops_buf, oops_data, text_len,
+ oops_data_sz);
+ if (zipped_len < 0) {
+ pr_err("nvram: compression failed; returned %d\n", zipped_len);
+ pr_err("nvram: logging uncompressed oops/panic report\n");
+ return -1;
+ }
+ *oops_len = (u16) zipped_len;
+ return 0;
+}
+
+/*
+ * This is our kmsg_dump callback, called after an oops or panic report
+ * has been written to the printk buffer. We want to capture as much
+ * of the printk buffer as possible. First, capture as much as we can
+ * that we think will compress sufficiently to fit in the lnx,oops-log
+ * partition. If that's too much, go back and capture uncompressed text.
+ */
static void oops_to_nvram(struct kmsg_dumper *dumper,
enum kmsg_dump_reason reason,
const char *old_msgs, unsigned long old_len,
@@ -482,6 +626,8 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
static unsigned int oops_count = 0;
static bool panicking = false;
size_t text_len;
+ unsigned int err_type = ERR_TYPE_KERNEL_PANIC_GZ;
+ int rc = -1;
switch (reason) {
case KMSG_DUMP_RESTART:
@@ -509,8 +655,19 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
if (clobbering_unread_rtas_event())
return;
- text_len = capture_last_msgs(old_msgs, old_len, new_msgs, new_len,
- oops_buf, oops_log_partition.size);
+ if (big_oops_buf) {
+ text_len = capture_last_msgs(old_msgs, old_len,
+ new_msgs, new_len, big_oops_buf, big_oops_buf_sz);
+ text_len = elide_severities(big_oops_buf, text_len);
+ rc = zip_oops(text_len);
+ }
+ if (rc != 0) {
+ text_len = capture_last_msgs(old_msgs, old_len,
+ new_msgs, new_len, oops_data, oops_data_sz);
+ err_type = ERR_TYPE_KERNEL_PANIC;
+ *oops_len = (u16) text_len;
+ }
+
(void) nvram_write_os_partition(&oops_log_partition, oops_buf,
- (int) text_len, ERR_TYPE_KERNEL_PANIC, ++oops_count);
+ (int) (sizeof(*oops_len) + *oops_len), err_type, ++oops_count);
}
^ permalink raw reply related
* [PATCH] powerpc: mtspr/mtmsr should take an unsigned long
From: Scott Wood @ 2011-07-25 21:02 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
Add a cast in case the caller passes in a different type, as it would
if mtspr/mtmsr were functions.
Previously, if a 64-bit type was passed in on 32-bit, GCC would bind the
constraint to a pair of registers, and would substitute the first register
in the pair in the asm code. This corresponds to the upper half of the
64-bit register, which is generally not the desired behavior.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
If you're wondering why you'd pass a 64-bit value to one of these macros
on 32-bit, it came up when trying to load an SPR from kvm_vcpu_arch_shared.
arch/powerpc/include/asm/reg.h | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 213d1d7..1b45133 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1007,13 +1007,16 @@
#define mtmsrd(v) __mtmsrd((v), 0)
#define mtmsr(v) mtmsrd(v)
#else
-#define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v) : "memory")
+#define mtmsr(v) asm volatile("mtmsr %0" : \
+ : "r" ((unsigned long)(v)) \
+ : "memory")
#endif
#define mfspr(rn) ({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \
: "=r" (rval)); rval;})
-#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)\
+#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : \
+ : "r" ((unsigned long)(v)) \
: "memory")
#ifdef __powerpc64__
--
1.7.4.1
^ permalink raw reply related
* [PATCH] powerpc: return the_cpu_ spec from identify_cpu
From: Scott Wood @ 2011-07-25 21:04 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
Commit af9eef3c7b1ed004c378c89b87642f4937337d50 caused cpu_setup to see
the_cpu_spec, rather than the source struct. However, on 32-bit, the
return value of identify_cpu was being used for feature fixups, and
identify_cpu was returning the source struct. So if cpu_setup patches
the feature bits, the update won't affect the fixups.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/kernel/cputable.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 9fb9332..fa44ff5 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -2051,7 +2051,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
static struct cpu_spec the_cpu_spec;
-static void __init setup_cpu_spec(unsigned long offset, struct cpu_spec *s)
+static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
+ struct cpu_spec *s)
{
struct cpu_spec *t = &the_cpu_spec;
struct cpu_spec old;
@@ -2114,6 +2115,8 @@ static void __init setup_cpu_spec(unsigned long offset, struct cpu_spec *s)
t->cpu_setup(offset, t);
}
#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
+
+ return t;
}
struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
@@ -2124,10 +2127,8 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
s = PTRRELOC(s);
for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) {
- if ((pvr & s->pvr_mask) == s->pvr_value) {
- setup_cpu_spec(offset, s);
- return s;
- }
+ if ((pvr & s->pvr_mask) == s->pvr_value)
+ return setup_cpu_spec(offset, s);
}
BUG();
--
1.7.4.1
^ permalink raw reply related
* [PATCH] powerpc/32: pass device tree address as u64 to machine_init
From: Scott Wood @ 2011-07-25 21:29 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
u64 is used rather than phys_addr_t to keep things simple, as
this is called from assembly code.
Update callers to pass a 64-bit address in r3/r4. Other unused
register assignments that were once parameters to machine_init
are dropped.
For FSL BookE, look up the physical address of the device tree from the
effective address passed in r3 by the loader. This is required for
situations where memory does not start at zero (due to AMP or IOMMU-less
virtualization), and thus the IMA doesn't start at zero, and thus the
device tree effective address does not equal the physical address.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
Tested on fsl booke and 83xx.
arch/powerpc/kernel/head_32.S | 7 ++---
arch/powerpc/kernel/head_40x.S | 15 ++---------
arch/powerpc/kernel/head_44x.S | 16 ++----------
arch/powerpc/kernel/head_8xx.S | 13 ++--------
arch/powerpc/kernel/head_fsl_booke.S | 42 +++++++++++++++++++++-------------
arch/powerpc/kernel/setup_32.c | 2 +-
6 files changed, 39 insertions(+), 56 deletions(-)
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index ba250d5..0654dba 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -139,8 +139,7 @@ __start:
trap
#endif /* CONFIG_PPC_PMAC */
-1: mr r31,r3 /* save parameters */
- mr r30,r4
+1: mr r31,r3 /* save device tree ptr */
li r24,0 /* cpu # */
/*
@@ -964,8 +963,8 @@ start_here:
* Do early platform-specific initialization,
* and set up the MMU.
*/
- mr r3,r31
- mr r4,r30
+ li r3,0
+ mr r4,r31
bl machine_init
bl __save_cpu_setup
bl MMU_init
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index a91626d..872a6af 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -58,13 +58,7 @@
_ENTRY(_stext);
_ENTRY(_start);
- /* Save parameters we are passed.
- */
- mr r31,r3
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
+ mr r31,r3 /* save device tree ptr */
/* We have to turn on the MMU right away so we get cache modes
* set correctly.
@@ -849,11 +843,8 @@ start_here:
/*
* Decide what sort of machine this is and initialize the MMU.
*/
- mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
+ li r3,0
+ mr r4,r31
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index f8e971b..b725dab 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -61,14 +61,7 @@ _ENTRY(_start);
* of abatron_pteptrs
*/
nop
-/*
- * Save parameters we are passed
- */
- mr r31,r3
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
+ mr r31,r3 /* save device tree ptr */
li r24,0 /* CPU number */
bl init_cpu_state
@@ -120,11 +113,8 @@ _ENTRY(_start);
/*
* Decide what sort of machine this is and initialize the MMU.
*/
- mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
+ li r3,0
+ mr r4,r31
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 1cbf64e..b68cb17 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -76,11 +76,7 @@ _ENTRY(_start);
*/
.globl __start
__start:
- mr r31,r3 /* save parameters */
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
+ mr r31,r3 /* save device tree ptr */
/* We have to turn on the MMU right away so we get cache modes
* set correctly.
@@ -723,11 +719,8 @@ start_here:
/*
* Decide what sort of machine this is and initialize the MMU.
*/
- mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
+ li r3,0
+ mr r4,r31
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 985638d..c86f0eb 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -63,17 +63,30 @@ _ENTRY(_start);
* of abatron_pteptrs
*/
nop
-/*
- * Save parameters we are passed
- */
- mr r31,r3
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
- li r25,0 /* phys kernel start (low) */
- li r24,0 /* CPU number */
- li r23,0 /* phys kernel start (high) */
+
+ /* Translate device tree address to physical, save in r30/r31 */
+ mfmsr r16
+ mfspr r17,SPRN_PID
+ rlwinm r17,r17,16,0x3fff0000 /* turn PID into MAS6[SPID] */
+ rlwimi r17,r16,28,0x00000001 /* turn MSR[DS] into MAS6[SAS] */
+ mtspr SPRN_MAS6,r17
+
+ tlbsx 0,r3 /* must succeed */
+
+ mfspr r16,SPRN_MAS1
+ mfspr r20,SPRN_MAS3
+ rlwinm r17,r16,25,0x1f /* r17 = log2(page size) */
+ li r18,1024
+ slw r18,r18,r17 /* r18 = page size */
+ addi r18,r18,-1
+ and r19,r3,r18 /* r19 = page offset */
+ andc r31,r20,r18 /* r3 = page base */
+ or r31,r31,r19 /* r3 = devtree phys addr */
+ mfspr r30,SPRN_MAS7
+
+ li r25,0 /* phys kernel start (low) */
+ li r24,0 /* CPU number */
+ li r23,0 /* phys kernel start (high) */
/* We try to not make any assumptions about how the boot loader
* setup or used the TLBs. We invalidate all mappings from the
@@ -198,11 +211,8 @@ _ENTRY(__early_start)
/*
* Decide what sort of machine this is and initialize the MMU.
*/
- mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
+ mr r3,r30
+ mr r4,r31
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 209135a..c1ce863 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -117,7 +117,7 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
* This is called very early on the boot process, after a minimal
* MMU environment has been set up but before MMU_init is called.
*/
-notrace void __init machine_init(unsigned long dt_ptr)
+notrace void __init machine_init(u64 dt_ptr)
{
lockdep_init();
--
1.7.4.1
^ permalink raw reply related
* [git pull] Please pull powerpc.git next branch
From: Benjamin Herrenschmidt @ 2011-07-26 4:17 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list
Hi Linus !
Here's the powerpc batch for this merge window (there might still be a
handful of small fixes coming later this week depending on my mood but
here's the bulk at least). There's a couple of trivial merge conflicts
with your tree, let me know if you prefer that I fix them myself.
No big highlights, mostly a random collection of bug fixes and
improvements (the big highlight is the base KVM support for P7 and
970 which has been merged via Avi's tree).
Cheers,
Ben.
The following changes since commit 750e06992d49666a7589aac555eb3bb68e4dbb88:
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging (2011-07-25 14:10:34 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next
Akinobu Mita (2):
powerpc/pseries: Introduce pSeries_reconfig_notify()
powerpc/pseries: Improve error code on reconfiguration notifier failure
Andrew Gabbasov (1):
powerpc: Exporting boot_cpuid_phys
Anton Blanchard (9):
powerpc: Use -mtraceback=no
powerpc/pseries/hvconsole: Fix dropped console output
powerpc: Sync pseries and ppc64 defconfigs
powerpc: Disable IRQs off tracer in ppc64 defconfig
powerpc: Add mpt2sas driver to pseries and ppc64 defconfig
powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs
powerpc/irq: Quieten irq mapping printks
powerpc/pseries: Fix hvterm_raw_get_chars to accept < 16 chars, fixing xmon
hvc_console: Add kdb support
Ashish Kalra (2):
powerpc/85xx: Save scratch registers to thread info instead of using SPRGs.
powerpc: introduce the ePAPR embedded hypervisor vmpic driver
Baruch Siach (1):
MAINTAINERS: add arch/powerpc/platforms/85xx/ to the 85xx entry
Becky Bruce (3):
powerpc: Whitespace fix to include/asm/pgtable-ppc64.h
powerpc: mem_init should call memblock_is_reserved with phys_addr_t
powerpc: Create next_tlbcam_idx percpu variable for FSL_BOOKE
Benjamin Herrenschmidt (12):
Merge remote branch 'jwb/next' into next
powerpc/hvsi: Move HVSI protocol definitions to a header file
powerpc/pseries: Factor HVSI header struct in packet definitions
powerpc/udbg: Register udbg console generically
powerpc/pseries: Re-implement HVSI as part of hvc_vio
powerpc/pseries: Move hvsi support into a library
Merge remote branch 'origin/master' into next
powerpc: Fix build problem with default ppc_md.progress commit
powerpc/hvsi: Fix conflict with old HVSI driver
powerpc/pseries: Fix hvc_vio.c build due to recent changes
Merge remote-tracking branch 'jwb/next' into next
powerpc: Copy back TIF flags on return from softirq stack
Christian Kujau (1):
Document powerpc udbg-immortal
Dave Carroll (2):
powerpc: Move free_initmem to common code
powerpc: Add printk companion for ppc_md.progress
Dave Kleikamp (3):
powerpc/44x: don't use tlbivax on AMP systems
powerpc/44x: boot wrapper: allow kernel to load into non-zero address
powerpc/47x: allow kernel to be loaded in higher physical memory
Dmitry Eremin-Solenikov (7):
powerpc/mpic: Support compiling with DEBUG enabled
powerpc/85xx: tqm8540 - add description for onboard flash
powerpc/85xx: specify interrupt for pq3-localbus devices
powerpc/maple: Enable scom access functions on Maple
powerpc/maple: Register CPC925 EDAC device on all boards with CPC925
powerpc: Correct annotations of pmu registration functions
powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards
Fabio Baltieri (1):
powerpc/85xx: fix mpic configuration in CAMP mode
Felix Radensky (1):
powerpc/p1022ds: Remove fixed-link property from ethernet nodes.
Hendrik Brueckner (1):
hvc_console: Improve tty/console put_chars handling
Josh Boyer (3):
ppc4xx: Add crypto and RNG entries to Sequoia DTS
MAINTAINERS: Update PowerPC 4xx entry
powerpc/4xx: Move PCIE printk to proper function
Kumar Gala (18):
powerpc/book3e: Clarify HW table walk enable/disable message
powerpc: Rename e55xx_smp_defconfig to corenet64_smp_defconfig
powerpc: Add a defconfig for 'corenet' 32-bit platforms
powerpc/85xx: Add P5020DS device tree
powerpc/85xx: Add P3041DS device tree
powerpc/85xx: Updates to P4080DS device tree
powerpc/85xx: Cleanup PCIe support on corenet_ds boards
powerpc/fsl_pci: Simplify matching logic for PCI_FIXUP_HEADER
powerpc/pci: Move FSL fixup from 32-bit to common
powerpc/85xx: Add PCI support in 64-bit mode on P5020DS
powerpc/qe: Limit QE support to ppc32
powerpc/85xx: Add P4080 SoC device tree include stub
powerpc/85xx: Add P3041 SoC device tree include stub
powerpc/85xx: Add P5020 SoC device tree include stub
driver core: Add ability for arch code to setup pdev_archdata
powerpc: implement arch_setup_pdev_archdata
powerpc: Dont require a dma_ops struct to set dma mask
powerpc/64: Make server perfmon only built on ppc64 server devices
Laurentiu TUDOR (1):
powerpc/85xx: Remove stale BUG_ON in mpc85xx_smp_init
Lei Xu (2):
powerpc/85xx: Update device tree to add nand info for p5020ds
powerpc/85xx: Update device tree to add nand info for p3041ds
Mathias Krause (1):
powerpc: Remove redundant set_fs(USER_DS)
Matt Evans (1):
powerpc: Fix early boot accounting of CPUs
Michael Ellerman (1):
powerpc: Add jump label support
Michael Neuling (3):
powerpc: Fix doorbell type shift
powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
powerpc: Add CFAR to oops output
Mike Williams (1):
powerpc/4xx: Update Canyonlands and Glacier boards DTS to add HW RNG support
Mingkai Hu (1):
powerpc/85xx: Add p2040 RDB board support
Paul Mackerras (1):
powerpc: Avoid extra indirect function call in sending IPIs
Prabhakar Kushwaha (2):
powerpc/85xx: Add host-pci(e) bridge only for RC
powerpc/85xx: Add P1010RDB board support
Roy Zang (1):
powerpc/85xx: Add basic P1023RDS board support
Scott Wood (4):
powerpc/85xx: Set up doorbells even with no mpic
powerpc/e500mc: Add support for the wait instruction in e500_idle
powerpc/book3e-64: Reraise doorbell when masked by soft-irq-disable
powerpc/book3e-64: use a separate TLB handler when linear map is bolted
Stefan Roese (1):
powerpc/44x: Use correct phy-address dt nodes on taishan.dts
Stuart Yoder (1):
powerpc: make irq_choose_cpu() available to all PIC drivers
Timur Tabi (12):
powerpc: introduce ePAPR embedded hypervisor hcall interface
powerpc: add Freescale hypervisor partition control functions
powerpc/85xx: add board support for the Freescale hypervisor
powerpc/p1022ds: add missing iounmap calls to platform file
powerpc/85xx: clamp the P1022DS DIU pixel clock to allowed values
powerpc/85xx: enable the framebuffer console for the defconfigs
powerpc/86xx: improve calculation of DIU pixel clock on the MPC8610 HPCD
powerpc/86xx: enable the framebuffer console on the MPC8610 HPCD
powerpc/85xx: disable timebase synchronization under the hypervisor
drivers/virt: introduce Freescale hypervisor management driver
powerpc/85xx: add hypervisor config entries to corenet_smp_defconfig
drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
Tony Breeds (2):
powerpc/4xx: Add check_link to struct ppc4xx_pciex_hwops
powerpc/mm: Fix output of total_ram.
Documentation/ioctl/ioctl-number.txt | 1 +
Documentation/kernel-parameters.txt | 5 +
MAINTAINERS | 3 +-
arch/powerpc/Kconfig | 3 +-
arch/powerpc/Kconfig.debug | 15 +
arch/powerpc/Makefile | 2 +-
arch/powerpc/boot/dts/canyonlands.dts | 5 +
arch/powerpc/boot/dts/glacier.dts | 8 +-
arch/powerpc/boot/dts/mpc8568mds.dts | 2 +
arch/powerpc/boot/dts/p1010rdb.dts | 280 ++++++
arch/powerpc/boot/dts/p1010si.dtsi | 376 ++++++++
arch/powerpc/boot/dts/p1022ds.dts | 2 -
arch/powerpc/boot/dts/p1023rds.dts | 546 ++++++++++++
arch/powerpc/boot/dts/p2040rdb.dts | 166 ++++
arch/powerpc/boot/dts/p2040si.dtsi | 623 +++++++++++++
arch/powerpc/boot/dts/p3041ds.dts | 214 +++++
arch/powerpc/boot/dts/p3041si.dtsi | 660 ++++++++++++++
arch/powerpc/boot/dts/p4080ds.dts | 533 +-----------
arch/powerpc/boot/dts/p4080si.dtsi | 661 ++++++++++++++
arch/powerpc/boot/dts/p5020ds.dts | 215 +++++
arch/powerpc/boot/dts/p5020si.dtsi | 652 ++++++++++++++
arch/powerpc/boot/dts/sequoia.dts | 12 +
arch/powerpc/boot/dts/socrates.dts | 2 +
arch/powerpc/boot/dts/taishan.dts | 4 +-
arch/powerpc/boot/dts/tqm8540.dts | 42 +
arch/powerpc/boot/dts/tqm8548-bigflash.dts | 2 +
arch/powerpc/boot/dts/tqm8548.dts | 2 +
arch/powerpc/boot/dts/tqm8560.dts | 2 +
arch/powerpc/boot/dts/xpedite5200.dts | 2 +
arch/powerpc/boot/dts/xpedite5200_xmon.dts | 2 +
arch/powerpc/boot/treeboot-iss4xx.c | 23 +-
arch/powerpc/configs/44x/iss476-smp_defconfig | 6 +-
arch/powerpc/configs/85xx/p1023rds_defconfig | 173 ++++
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig | 5 +
arch/powerpc/configs/corenet32_smp_defconfig | 187 ++++
...e55xx_smp_defconfig => corenet64_smp_defconfig} | 0
arch/powerpc/configs/mpc85xx_defconfig | 12 +-
arch/powerpc/configs/mpc85xx_smp_defconfig | 10 +-
arch/powerpc/configs/ppc64_defconfig | 16 +-
arch/powerpc/configs/pseries_defconfig | 3 +
arch/powerpc/include/asm/dbell.h | 2 +-
arch/powerpc/include/asm/ehv_pic.h | 40 +
arch/powerpc/include/asm/epapr_hcalls.h | 502 +++++++++++
arch/powerpc/include/asm/exception-64e.h | 52 +-
arch/powerpc/include/asm/fsl_hcalls.h | 655 ++++++++++++++
arch/powerpc/include/asm/hvsi.h | 94 ++
arch/powerpc/include/asm/irq.h | 2 +
arch/powerpc/include/asm/jump_label.h | 47 +
arch/powerpc/include/asm/mmu.h | 12 +-
arch/powerpc/include/asm/pSeries_reconfig.h | 2 +-
arch/powerpc/include/asm/paca.h | 7 +-
arch/powerpc/include/asm/pgtable-ppc64.h | 3 +-
arch/powerpc/include/asm/processor.h | 5 +
arch/powerpc/include/asm/reg.h | 4 +-
arch/powerpc/include/asm/setup.h | 4 +
arch/powerpc/include/asm/smp.h | 3 +-
arch/powerpc/include/asm/udbg.h | 1 +
arch/powerpc/kernel/Makefile | 1 +
arch/powerpc/kernel/asm-offsets.c | 3 +
arch/powerpc/kernel/crash.c | 6 +-
arch/powerpc/kernel/dma.c | 4 +-
arch/powerpc/kernel/exceptions-64e.S | 22 +-
arch/powerpc/kernel/head_44x.S | 42 +-
arch/powerpc/kernel/head_64.S | 2 +-
arch/powerpc/kernel/head_booke.h | 42 +-
arch/powerpc/kernel/head_fsl_booke.S | 49 +-
arch/powerpc/kernel/idle_e500.S | 12 +
arch/powerpc/kernel/irq.c | 50 +-
arch/powerpc/kernel/jump_label.c | 23 +
arch/powerpc/kernel/misc_64.S | 4 +-
arch/powerpc/kernel/mpc7450-pmu.c | 2 +-
arch/powerpc/kernel/pci-common.c | 18 +
arch/powerpc/kernel/pci_32.c | 19 -
arch/powerpc/kernel/perf_event.c | 2 +-
arch/powerpc/kernel/power4-pmu.c | 2 +-
arch/powerpc/kernel/power5+-pmu.c | 2 +-
arch/powerpc/kernel/power5-pmu.c | 2 +-
arch/powerpc/kernel/power6-pmu.c | 2 +-
arch/powerpc/kernel/power7-pmu.c | 2 +-
arch/powerpc/kernel/ppc970-pmu.c | 2 +-
arch/powerpc/kernel/process.c | 4 +-
arch/powerpc/kernel/prom.c | 16 +-
arch/powerpc/kernel/setup-common.c | 27 +-
arch/powerpc/kernel/setup_32.c | 4 +-
arch/powerpc/kernel/setup_64.c | 6 +-
arch/powerpc/kernel/smp.c | 30 +-
arch/powerpc/kernel/udbg.c | 5 +
arch/powerpc/mm/44x_mmu.c | 13 +-
arch/powerpc/mm/init_32.c | 32 -
arch/powerpc/mm/init_64.c | 16 -
arch/powerpc/mm/mem.c | 35 +-
arch/powerpc/mm/tlb_hash32.c | 4 +
arch/powerpc/mm/tlb_low_64e.S | 206 +++++
arch/powerpc/mm/tlb_nohash.c | 64 +-
arch/powerpc/platforms/85xx/Kconfig | 31 +
arch/powerpc/platforms/85xx/Makefile | 3 +
arch/powerpc/platforms/85xx/corenet_ds.c | 41 +-
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 3 +-
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 5 +-
arch/powerpc/platforms/85xx/p1010rdb.c | 122 +++
arch/powerpc/platforms/85xx/p1022_ds.c | 18 +-
arch/powerpc/platforms/85xx/p1023_rds.c | 162 ++++
arch/powerpc/platforms/85xx/p2040_rdb.c | 88 ++
arch/powerpc/platforms/85xx/p3041_ds.c | 28 +-
arch/powerpc/platforms/85xx/p4080_ds.c | 38 +-
arch/powerpc/platforms/85xx/p5020_ds.c | 32 +-
arch/powerpc/platforms/85xx/smp.c | 30 +-
arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 107 +--
arch/powerpc/platforms/Kconfig | 6 +-
arch/powerpc/platforms/Kconfig.cputype | 2 +-
arch/powerpc/platforms/iseries/smp.c | 2 +-
arch/powerpc/platforms/maple/setup.c | 41 +-
arch/powerpc/platforms/powermac/setup.c | 3 -
arch/powerpc/platforms/powermac/smp.c | 2 +-
arch/powerpc/platforms/pseries/dlpar.c | 10 +-
arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 +-
arch/powerpc/platforms/pseries/hotplug-memory.c | 16 +-
arch/powerpc/platforms/pseries/hvconsole.c | 2 +-
arch/powerpc/platforms/pseries/lpar.c | 191 ----
arch/powerpc/platforms/pseries/pseries.h | 3 +-
arch/powerpc/platforms/pseries/reconfig.c | 28 +-
arch/powerpc/platforms/pseries/setup.c | 5 +-
arch/powerpc/platforms/pseries/smp.c | 2 +-
arch/powerpc/platforms/wsp/smp.c | 2 +-
arch/powerpc/sysdev/Makefile | 1 +
arch/powerpc/sysdev/ehv_pic.c | 302 +++++++
arch/powerpc/sysdev/fsl_pci.c | 83 +--
arch/powerpc/sysdev/fsl_soc.c | 27 +
arch/powerpc/sysdev/fsl_soc.h | 3 +
arch/powerpc/sysdev/mpic.c | 38 +-
arch/powerpc/sysdev/ppc4xx_pci.c | 147 ++--
drivers/Kconfig | 2 +
drivers/Makefile | 3 +
drivers/base/platform.c | 21 +
drivers/cpufreq/Kconfig | 5 +
drivers/cpufreq/Kconfig.powerpc | 7 +
drivers/cpufreq/Makefile | 5 +
drivers/cpufreq/maple-cpufreq.c | 309 +++++++
drivers/of/platform.c | 4 +-
drivers/tty/hvc/Kconfig | 5 +
drivers/tty/hvc/Makefile | 3 +-
drivers/tty/hvc/hvc_console.c | 70 ++-
drivers/tty/hvc/hvc_console.h | 4 +
drivers/tty/hvc/hvc_vio.c | 408 ++++++++-
drivers/tty/hvc/hvsi.c | 129 +--
drivers/tty/hvc/hvsi_lib.c | 426 +++++++++
drivers/virt/Kconfig | 32 +
drivers/virt/Makefile | 5 +
drivers/virt/fsl_hypervisor.c | 938 ++++++++++++++++++++
include/linux/Kbuild | 1 +
include/linux/fsl_hypervisor.h | 241 +++++
include/linux/platform_device.h | 1 +
152 files changed, 10499 insertions(+), 1441 deletions(-)
create mode 100644 arch/powerpc/boot/dts/p1010rdb.dts
create mode 100644 arch/powerpc/boot/dts/p1010si.dtsi
create mode 100644 arch/powerpc/boot/dts/p1023rds.dts
create mode 100644 arch/powerpc/boot/dts/p2040rdb.dts
create mode 100644 arch/powerpc/boot/dts/p2040si.dtsi
create mode 100644 arch/powerpc/boot/dts/p3041ds.dts
create mode 100644 arch/powerpc/boot/dts/p3041si.dtsi
create mode 100644 arch/powerpc/boot/dts/p4080si.dtsi
create mode 100644 arch/powerpc/boot/dts/p5020ds.dts
create mode 100644 arch/powerpc/boot/dts/p5020si.dtsi
create mode 100644 arch/powerpc/configs/85xx/p1023rds_defconfig
create mode 100644 arch/powerpc/configs/corenet32_smp_defconfig
rename arch/powerpc/configs/{e55xx_smp_defconfig => corenet64_smp_defconfig} (100%)
create mode 100644 arch/powerpc/include/asm/ehv_pic.h
create mode 100644 arch/powerpc/include/asm/epapr_hcalls.h
create mode 100644 arch/powerpc/include/asm/fsl_hcalls.h
create mode 100644 arch/powerpc/include/asm/hvsi.h
create mode 100644 arch/powerpc/include/asm/jump_label.h
create mode 100644 arch/powerpc/kernel/jump_label.c
create mode 100644 arch/powerpc/platforms/85xx/p1010rdb.c
create mode 100644 arch/powerpc/platforms/85xx/p1023_rds.c
create mode 100644 arch/powerpc/platforms/85xx/p2040_rdb.c
create mode 100644 arch/powerpc/sysdev/ehv_pic.c
create mode 100644 drivers/cpufreq/Kconfig.powerpc
create mode 100644 drivers/cpufreq/maple-cpufreq.c
create mode 100644 drivers/tty/hvc/hvsi_lib.c
create mode 100644 drivers/virt/Kconfig
create mode 100644 drivers/virt/Makefile
create mode 100644 drivers/virt/fsl_hypervisor.c
create mode 100644 include/linux/fsl_hypervisor.h
^ permalink raw reply
* Re: [PATCH v2 2/4] powerpc, mpc52xx: add a4m072 board support
From: Heiko Schocher @ 2011-07-26 4:52 UTC (permalink / raw)
To: linuxppc-dev; +Cc: devicetree-discuss, Wolfgang Denk
In-Reply-To: <1308739150-31527-1-git-send-email-hs@denx.de>
Hello,
Heiko Schocher wrote:
> Signed-off-by: Heiko Schocher <hs@denx.de>
> cc: Grant Likely <grant.likely@secretlab.ca>
> cc: devicetree-discuss@ozlabs.org
> cc: Wolfgang Denk <wd@denx.de>
> cc: Wolfram Sang <w.sang@pengutronix.de>
> ---
> For this patchseries following patch is needed:
>
> http://patchwork.ozlabs.org/patch/91919/
>
> Grant? Do you have some comments on that patch?
>
> changes for v2:
> add comment from Wolfram Sang:
> use mpc5200.dtsi
>
> arch/powerpc/boot/dts/a4m072.dts | 172 ++++++++++++++++++++++++++
> arch/powerpc/platforms/52xx/mpc5200_simple.c | 1 +
> 2 files changed, 173 insertions(+), 0 deletions(-)
> create mode 100644 arch/powerpc/boot/dts/a4m072.dts
Are there some more comments or is this ready for going
to mainline?
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply
* Re: [PATCH 1/4] net, phy: am79c874 support
From: Heiko Schocher @ 2011-07-26 4:55 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-netdev, Wolfgang Denk
In-Reply-To: <1308729311-15375-2-git-send-email-hs@denx.de>
Hello,
Heiko Schocher wrote:
> Signed-off-by: Heiko Schocher <hs@denx.de>
> cc: linux-netdev@vger.kernel.org
> cc: Wolfgang Denk <wd@denx.de>
> ---
> drivers/net/phy/Kconfig | 5 ++
> drivers/net/phy/Makefile | 1 +
> drivers/net/phy/amd79.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 115 insertions(+), 0 deletions(-)
> create mode 100644 drivers/net/phy/amd79.c
Are there some more comments or is this patch ready for going
to mainline?
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply
* [PATCH] powerpc/85xx: fix memory controller compatible for edac
From: Shaohui Xie @ 2011-07-26 5:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mm-commits, Shaohui Xie, kumar.gala, avorontsov, akpm, davem
compatible in dts has been changed, so driver need to update accordingly.
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
apply for http://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git
'next' branch.
drivers/edac/mpc85xx_edac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 13f6cc5..94c064a 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -1253,7 +1253,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
{ .compatible = "fsl,p1020-memory-controller", },
{ .compatible = "fsl,p1021-memory-controller", },
{ .compatible = "fsl,p2020-memory-controller", },
- { .compatible = "fsl,p4080-memory-controller", },
+ { .compatible = "fsl,qoriq-memory-controller", },
{},
};
MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
--
1.6.4
^ permalink raw reply related
* [PATCH] powerpc: Fix device tree claim code
From: Anton Blanchard @ 2011-07-26 6:47 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
I have a box that fails in OF during boot with:
DEFAULT CATCH!, exception-handler=fff00400
at %SRR0: 49424d2c4c6f6768 %SRR1: 800000004000b002
ie "IBM,Logh". OF got corrupted with a device tree string.
Looking at make_room and alloc_up, we claim the first chunk (1 MB)
but we never claim any more. mem_end is always set to alloc_top
which is the top of our available address space, guaranteeing we will
never call alloc_up and claim more memory.
Also alloc_up wasn't setting alloc_bottom to the bottom of the
available address space.
This doesn't help the box to boot, but we at least fail with
an obvious error. We could relocate the device tree in a future
patch.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
---
Index: linux-powerpc/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/kernel/prom_init.c 2011-07-26 12:37:56.142915032 +1000
+++ linux-powerpc/arch/powerpc/kernel/prom_init.c 2011-07-26 16:31:31.481793248 +1000
@@ -1020,7 +1020,7 @@ static unsigned long __init alloc_up(uns
}
if (addr == 0)
return 0;
- RELOC(alloc_bottom) = addr;
+ RELOC(alloc_bottom) = addr + size;
prom_debug(" -> %x\n", addr);
prom_debug(" alloc_bottom : %x\n", RELOC(alloc_bottom));
@@ -1834,7 +1834,7 @@ static void __init *make_room(unsigned l
chunk = alloc_up(room, 0);
if (chunk == 0)
prom_panic("No memory for flatten_device_tree (claim failed)");
- *mem_end = RELOC(alloc_top);
+ *mem_end = chunk + room;
}
ret = (void *)*mem_start;
@@ -2053,7 +2053,7 @@ static void __init flatten_device_tree(v
mem_start = (unsigned long)alloc_up(room, PAGE_SIZE);
if (mem_start == 0)
prom_panic("Can't allocate initial device-tree chunk\n");
- mem_end = RELOC(alloc_top);
+ mem_end = mem_start + room;
/* Get root of tree */
root = call_prom("peer", 1, 1, (phandle)0);
^ permalink raw reply
* [PATCH] powerpc: Clean up some panic messages in prom_init
From: Anton Blanchard @ 2011-07-26 6:47 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
Add a newline to the panic messages in make_room. Also fix a
comment that suggested our chunk size is 4Mb. It's 1MB.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-powerpc/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/kernel/prom_init.c 2011-07-26 16:32:14.692650932 +1000
+++ linux-powerpc/arch/powerpc/kernel/prom_init.c 2011-07-26 16:32:47.323298072 +1000
@@ -1830,10 +1830,12 @@ static void __init *make_room(unsigned l
if (room > DEVTREE_CHUNK_SIZE)
room = DEVTREE_CHUNK_SIZE;
if (room < PAGE_SIZE)
- prom_panic("No memory for flatten_device_tree (no room)");
+ prom_panic("No memory for flatten_device_tree "
+ "(no room)\n");
chunk = alloc_up(room, 0);
if (chunk == 0)
- prom_panic("No memory for flatten_device_tree (claim failed)");
+ prom_panic("No memory for flatten_device_tree "
+ "(claim failed)\n");
*mem_end = chunk + room;
}
@@ -2042,7 +2044,7 @@ static void __init flatten_device_tree(v
/*
* Check how much room we have between alloc top & bottom (+/- a
- * few pages), crop to 4Mb, as this is our "chuck" size
+ * few pages), crop to 1MB, as this is our "chunk" size
*/
room = RELOC(alloc_top) - RELOC(alloc_bottom) - 0x4000;
if (room > DEVTREE_CHUNK_SIZE)
^ permalink raw reply
* RE: [PATCH 3/4] powerpc/85xx: Merge PCI/PCI Express error management registers
From: Xie Shaohui-B21989 @ 2011-07-26 6:48 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev@lists.ozlabs.org, Jiang Kai-B18973
In-Reply-To: <1311244195-4418-1-git-send-email-Shaohui.Xie@freescale.com>
>-----Original Message-----
>From: Xie Shaohui-B21989
>Sent: Thursday, July 21, 2011 6:30 PM
>To: linuxppc-dev@lists.ozlabs.org
>Cc: Gala Kumar-B11780; Jiang Kai-B18973; Kumar Gala; Xie Shaohui-B21989
>Subject: [PATCH 3/4] powerpc/85xx: Merge PCI/PCI Express error management
>registers
>
>From: Kai.Jiang <Kai.Jiang@freescale.com>
>
>There are some differences of register offset and definition between pci
>and pcie error management registers. While, some other pci/pcie error
>management registers are nearly the same.
>
>Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
>Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
>---
> arch/powerpc/sysdev/fsl_pci.h | 31 +++++++++++++++++++++++++------
> 1 files changed, 25 insertions(+), 6 deletions(-)
>
>difg --gite a/arch/powerpc/sysdev/fsl_pci.h
>b/arch/powerpc/sysdev/fsl_pci.h index a39ed5c..60a76e9 100644
>--- a/arch/powerpc/sysdev/fsl_pci.h
>+++ b/arch/powerpc/sysdev/fsl_pci.h
>@@ -74,13 +74,32 @@ struct ccsr_pci {
> */
> struct pci_inbound_window_regs piw[4];
>
>+/* Merge PCI/PCI Express error management registers */
> __be32 pex_err_dr; /* 0x.e00 - PCI/PCIE error detect
>register */
>- u8 res21[4];
>- __be32 pex_err_en; /* 0x.e08 - PCI/PCIE error interrupt
>enable register */
>- u8 res22[4];
>- __be32 pex_err_disr; /* 0x.e10 - PCI/PCIE error
>disable register */
>- u8 res23[12];
>- __be32 pex_err_cap_stat; /* 0x.e20 - PCI/PCIE error capture
>status register */
>+ __be32 pex_err_cap_dr; /* 0x.e04 */
>+ /* - PCI error capture disabled register */
>+ /* - PCIE has no this register */
>+ __be32 pex_err_en; /* 0x.e08 */
>+ /* - PCI/PCIE error interrupt enable
>register*/
>+ __be32 pex_err_attrib; /* 0x.e0c */
>+ /* - PCI error attributes capture register
>*/
>+ /* - PCIE has no this register */
>+ __be32 pex_err_disr; /* 0x.e10 */
>+ /* - PCI error address capture register */
>+ /* - PCIE error disable register */
>+ __be32 pex_err_ext_addr; /* 0x.e14 */
>+ /* - PCI error extended addr capture
>register*/
>+ /* - PCIE has no this register */
>+ __be32 pex_err_dl; /* 0x.e18 */
>+ /* - PCI error data low capture register */
>+ /* - PCIE has no this register */
>+ __be32 pex_err_dh; /* 0x.e1c */
>+ /* - PCI error data high capture register */
>+ /* - PCIE has no this register */
>+ __be32 pex_err_cap_stat; /* 0x.e20 */
>+ /* - PCI gasket timer register */
>+ /* - PCIE error capture status register */
>+
> u8 res24[4];
> __be32 pex_err_cap_r0; /* 0x.e28 - PCIE error capture
>register 0 */
> __be32 pex_err_cap_r1; /* 0x.e2c - PCIE error capture
>register 0 */
>--
>1.6.4
[Xie Shaohui] I've verified this patch can apply for galak/powerpc.git 'nex=
t' branch with no change.
Best Regards,=20
Shaohui Xie
^ permalink raw reply
* RE: [PATCH 4/4] edac/85xx: PCI/PCIE error interrupt edac support.
From: Xie Shaohui-B21989 @ 2011-07-26 6:51 UTC (permalink / raw)
To: linuxppc-dev@lists.ozlabs.org, Kumar Gala
Cc: mm-commits@vger.kernel.org, avorontsov@mvista.com,
Jiang Kai-B18973, akpm@linux-foundation.org, davem@davemloft.net
In-Reply-To: <1311244404-4463-1-git-send-email-Shaohui.Xie@freescale.com>
I've verified this patch can apply for galak/powerpc.git 'next' branch with=
no change.
Best Regards,=20
Shaohui Xie=20
>-----Original Message-----
>From: Xie Shaohui-B21989
>Sent: Thursday, July 21, 2011 6:33 PM
>To: linuxppc-dev@lists.ozlabs.org
>Cc: Gala Kumar-B11780; mm-commits@vger.kernel.org; avorontsov@mvista.com;
>davem@davemloft.net; grant.likely@secretlab.ca; akpm@linux-foundation.org;
>Jiang Kai-B18973; Kumar Gala; Xie Shaohui-B21989
>Subject: [PATCH 4/4] edac/85xx: PCI/PCIE error interrupt edac support.
>
>From: Kai.Jiang <Kai.Jiang@freescale.com>
>
>Add pcie error interrupt edac support for mpc85xx and p4080.
>mpc85xx uses the legacy interrupt report mechanism - the error interrupts
>are reported directly to mpic. While, p4080 attaches most of error
>interrupts to interrupt 0. And report error interrupt to mpic via
>interrupt 0. This patch can handle both of them.
>
>
>Due to the error management register offset and definition
>
>difference between pci and pcie, use ccsr_pci structure to merge pci and
>pcie edac code into one.
>
>Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
>Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
>---
> drivers/edac/mpc85xx_edac.c | 239 ++++++++++++++++++++++++++++++++------
>----
> drivers/edac/mpc85xx_edac.h | 17 +--
> 2 files changed, 188 insertions(+), 68 deletions(-)
>
>diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
>index b048a5f..dde156f 100644
>--- a/drivers/edac/mpc85xx_edac.c
>+++ b/drivers/edac/mpc85xx_edac.c
>@@ -1,5 +1,6 @@
> /*
> * Freescale MPC85xx Memory Controller kenel module
>+ * Copyright (c) 2011 Freescale Semiconductor, Inc.
> *
> * Author: Dave Jiang <djiang@mvista.com>
> *
>@@ -21,6 +22,8 @@
>
> #include <linux/of_platform.h>
> #include <linux/of_device.h>
>+#include <include/asm/pci.h>
>+#include <sysdev/fsl_pci.h>
> #include "edac_module.h"
> #include "edac_core.h"
> #include "mpc85xx_edac.h"
>@@ -34,14 +37,6 @@ static int edac_mc_idx; static u32
>orig_ddr_err_disable; static u32 orig_ddr_err_sbe;
>
>-/*
>- * PCI Err defines
>- */
>-#ifdef CONFIG_PCI
>-static u32 orig_pci_err_cap_dr;
>-static u32 orig_pci_err_en;
>-#endif
>-
> static u32 orig_l2_err_disable;
> #ifdef CONFIG_FSL_SOC_BOOKE
> static u32 orig_hid1[2];
>@@ -151,37 +146,52 @@ static void mpc85xx_pci_check(struct
>edac_pci_ctl_info *pci) {
> struct mpc85xx_pci_pdata *pdata =3D pci->pvt_info;
> u32 err_detect;
>+ struct ccsr_pci *reg =3D pdata->pci_reg;
>+
>+ err_detect =3D in_be32(&pdata->pci_reg->pex_err_dr);
>+
>+ if (pdata->pcie_flag) {
>+ printk(KERN_ERR "PCIE error(s) detected\n");
>+ printk(KERN_ERR "PCIE ERR_DR register: 0x%08x\n", err_detect);
>+ printk(KERN_ERR "PCIE ERR_CAP_STAT register: 0x%08x\n",
>+ in_be32(®->pex_err_cap_stat));
>+ printk(KERN_ERR "PCIE ERR_CAP_R0 register: 0x%08x\n",
>+ in_be32(®->pex_err_cap_r0));
>+ printk(KERN_ERR "PCIE ERR_CAP_R1 register: 0x%08x\n",
>+ in_be32(®->pex_err_cap_r1));
>+ printk(KERN_ERR "PCIE ERR_CAP_R2 register: 0x%08x\n",
>+ in_be32(®->pex_err_cap_r2));
>+ printk(KERN_ERR "PCIE ERR_CAP_R3 register: 0x%08x\n",
>+ in_be32(®->pex_err_cap_r3));
>+ } else {
>+ /* master aborts can happen during PCI config cycles */
>+ if (!(err_detect & ~(PCI_EDE_MULTI_ERR | PCI_EDE_MST_ABRT))) {
>+ out_be32(®->pex_err_dr, err_detect);
>+ return;
>+ }
>
>- err_detect =3D in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR);
>-
>- /* master aborts can happen during PCI config cycles */
>- if (!(err_detect & ~(PCI_EDE_MULTI_ERR | PCI_EDE_MST_ABRT))) {
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect);
>- return;
>+ printk(KERN_ERR "PCI error(s) detected\n");
>+ printk(KERN_ERR "PCI/X ERR_DR register: 0x%08x\n", err_detect);
>+ printk(KERN_ERR "PCI/X ERR_ATTRIB register: 0x%08x\n",
>+ in_be32(®->pex_err_attrib));
>+ printk(KERN_ERR "PCI/X ERR_ADDR register: 0x%08x\n",
>+ in_be32(®->pex_err_disr));
>+ printk(KERN_ERR "PCI/X ERR_EXT_ADDR register: 0x%08x\n",
>+ in_be32(®->pex_err_ext_addr));
>+ printk(KERN_ERR "PCI/X ERR_DL register: 0x%08x\n",
>+ in_be32(®->pex_err_dl));
>+ printk(KERN_ERR "PCI/X ERR_DH register: 0x%08x\n",
>+ in_be32(®->pex_err_dh));
>+
>+ if (err_detect & PCI_EDE_PERR_MASK)
>+ edac_pci_handle_pe(pci, pci->ctl_name);
>+
>+ if ((err_detect & ~PCI_EDE_MULTI_ERR) & ~PCI_EDE_PERR_MASK)
>+ edac_pci_handle_npe(pci, pci->ctl_name);
> }
>
>- printk(KERN_ERR "PCI error(s) detected\n");
>- printk(KERN_ERR "PCI/X ERR_DR register: %#08x\n", err_detect);
>-
>- printk(KERN_ERR "PCI/X ERR_ATTRIB register: %#08x\n",
>- in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ATTRIB));
>- printk(KERN_ERR "PCI/X ERR_ADDR register: %#08x\n",
>- in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR));
>- printk(KERN_ERR "PCI/X ERR_EXT_ADDR register: %#08x\n",
>- in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EXT_ADDR));
>- printk(KERN_ERR "PCI/X ERR_DL register: %#08x\n",
>- in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DL));
>- printk(KERN_ERR "PCI/X ERR_DH register: %#08x\n",
>- in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DH));
>-
> /* clear error bits */
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect);
>-
>- if (err_detect & PCI_EDE_PERR_MASK)
>- edac_pci_handle_pe(pci, pci->ctl_name);
>-
>- if ((err_detect & ~PCI_EDE_MULTI_ERR) & ~PCI_EDE_PERR_MASK)
>- edac_pci_handle_npe(pci, pci->ctl_name);
>+ out_be32(®->pex_err_dr, err_detect);
> }
>
> static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id) @@ -190,7
>+200,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
> struct mpc85xx_pci_pdata *pdata =3D pci->pvt_info;
> u32 err_detect;
>
>- err_detect =3D in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR);
>+ err_detect =3D in_be32(&pdata->pci_reg->pex_err_dr);
>
> if (!err_detect)
> return IRQ_NONE;
>@@ -200,11 +210,99 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void
>*dev_id)
> return IRQ_HANDLED;
> }
>
>+#define MPC85XX_MPIC_EIMR0 0x3910
>+/*
>+ * This function is for error interrupt ORed mechanism.
>+ * This mechanism attaches most functions' error interrupts to interrupt
>0.
>+ * And report error interrupt to mpic via interrupt 0.
>+ * EIMR0 - Error Interrupt Mask Register 0.
>+ *
>+ * This function check whether the device support error interrupt ORed
>+ * mechanism via device tree. If supported, umask pcie error interrupt
>+ * bit in EIMR0.
>+ */
>+static int mpc85xx_err_int_en(struct device *op) {
>+ u32 *int_cell =3D NULL;
>+ struct device_node *np =3D NULL;
>+ void __iomem *mpic_base =3D NULL;
>+ u32 reg_tmp =3D 0;
>+ u32 int_len =3D 0;
>+ struct resource r;
>+ int res =3D 0;
>+
>+ if (!op->of_node)
>+ return -EINVAL;
>+ /*
>+ * Unmask pcie error interrupt bit in EIMR0
>+ * extend interrupt specifier has 4 cells. For the 3rd cell:
>+ * 0 -- normal interrupt; 1 -- error interrupt.
>+ */
>+ int_cell =3D (u32 *)of_get_property(op->of_node, "interrupts",
>&int_len);
>+ if ((int_len/sizeof(u32)) =3D=3D 4) {
>+ /* soc has error interrupt integration handling mechanism */
>+ if (*(int_cell + 2) =3D=3D 1) {
>+ np =3D of_find_node_by_type(NULL, "open-pic");
>+
>+ if (of_address_to_resource(np, 0, &r)) {
>+ printk(KERN_ERR
>+ "%s:Failed to map mpic regs\n", __func__);
>+ of_node_put(np);
>+ res =3D -ENOMEM;
>+ goto err;
>+ }
>+
>+ if (!request_mem_region(r.start,
>+ r.end - r.start + 1, "mpic")) {
>+ printk(KERN_ERR
>+ "%s:Error while requesting mem region\n",
>+ __func__);
>+ res =3D -EBUSY;
>+ goto err;
>+ }
>+
>+ mpic_base =3D ioremap(r.start, r.end - r.start + 1);
>+ if (!mpic_base) {
>+ printk(KERN_ERR
>+ "%s:Unable to map mpic regs\n", __func__);
>+ res =3D -ENOMEM;
>+ goto err_ioremap;
>+ }
>+
>+ reg_tmp =3D in_be32(mpic_base + MPC85XX_MPIC_EIMR0);
>+ out_be32(mpic_base + MPC85XX_MPIC_EIMR0,
>+ reg_tmp & ~(1 << (31 - *(int_cell + 3))));
>+ iounmap(mpic_base);
>+ release_mem_region(r.start, r.end - r.start + 1);
>+ of_node_put(np);
>+ }
>+ }
>+
>+ return 0;
>+err_ioremap:
>+ release_mem_region(r.start, r.end - r.start + 1);
>+err:
>+
>+ return res;
>+}
>+
>+static int mpc85xx_pcie_find_capability(struct device_node *np) {
>+ struct pci_controller *hose;
>+ if (!np)
>+ return -EINVAL;
>+
>+ hose =3D pci_find_hose_for_OF_device(np);
>+ return early_find_capability(hose, hose->bus->number,
>+ 0, PCI_CAP_ID_EXP);
>+}
>+
> static int __devinit mpc85xx_pci_err_probe(struct platform_device *op) {
> struct edac_pci_ctl_info *pci;
> struct mpc85xx_pci_pdata *pdata;
> struct resource r;
>+ struct ccsr_pci *reg =3D NULL;
> int res =3D 0;
>
> if (!devres_open_group(&op->dev, mpc85xx_pci_err_probe, GFP_KERNEL))
>@@ -217,6 +315,10 @@ static int __devinit mpc85xx_pci_err_probe(struct
>platform_device *op)
> pdata =3D pci->pvt_info;
> pdata->name =3D "mpc85xx_pci_err";
> pdata->irq =3D NO_IRQ;
>+
>+ if (mpc85xx_pcie_find_capability(op->dev.of_node) > 0)
>+ pdata->pcie_flag =3D 1;
>+
> dev_set_drvdata(&op->dev, pci);
> pci->dev =3D &op->dev;
> pci->mod_name =3D EDAC_MOD_STR;
>@@ -235,37 +337,40 @@ static int __devinit mpc85xx_pci_err_probe(struct
>platform_device *op)
> goto err;
> }
>
>- /* we only need the error registers */
>- r.start +=3D 0xe00;
>-
> if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
> pdata->name)) {
>- printk(KERN_ERR "%s: Error while requesting mem region\n",
>- __func__);
>+ printk(KERN_ERR
>+ "%s:Error while requesting mem region\n", __func__);
> res =3D -EBUSY;
> goto err;
> }
>
>- pdata->pci_vbase =3D devm_ioremap(&op->dev, r.start,
>resource_size(&r));
>- if (!pdata->pci_vbase) {
>+ pdata->pci_reg =3D devm_ioremap(&op->dev, r.start, resource_size(&r));
>+ if (!pdata->pci_reg) {
> printk(KERN_ERR "%s: Unable to setup PCI err regs\n",
>__func__);
> res =3D -ENOMEM;
> goto err;
> }
>
>- orig_pci_err_cap_dr =3D
>- in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR);
>-
>- /* PCI master abort is expected during config cycles */
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR, 0x40);
>+ if (mpc85xx_err_int_en(&op->dev) < 0)
>+ goto err;
>
>- orig_pci_err_en =3D in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN);
>+ reg =3D pdata->pci_reg;
>+ /* disable pci/pcie error detect */
>+ if (pdata->pcie_flag) {
>+ pdata->orig_pci_err_dr =3D in_be32(®->pex_err_disr);
>+ out_be32(®->pex_err_disr, ~0);
>+ } else {
>+ pdata->orig_pci_err_dr =3D in_be32(®->pex_err_cap_dr);
>+ out_be32(®->pex_err_cap_dr, ~0);
>+ }
>
>- /* disable master abort reporting */
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, ~0x40);
>+ /* disable all pcie error interrupt */
>+ pdata->orig_pci_err_en =3D in_be32(®->pex_err_en);
>+ out_be32(®->pex_err_en, 0);
>
>- /* clear error bits */
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, ~0);
>+ /* clear all error bits */
>+ out_be32(®->pex_err_dr, ~0);
>
> if (edac_pci_add_device(pci, pdata->edac_idx) > 0) {
> debugf3("%s(): failed edac_pci_add_device()\n", __func__); @@
>-275,7 +380,7 @@ static int __devinit mpc85xx_pci_err_probe(struct
>platform_device *op)
> if (edac_op_state =3D=3D EDAC_OPSTATE_INT) {
> pdata->irq =3D irq_of_parse_and_map(op->dev.of_node, 0);
> res =3D devm_request_irq(&op->dev, pdata->irq,
>- mpc85xx_pci_isr, IRQF_DISABLED,
>+ mpc85xx_pci_isr, IRQF_SHARED,
> "[EDAC] PCI err", pci);
> if (res < 0) {
> printk(KERN_ERR
>@@ -290,6 +395,17 @@ static int __devinit mpc85xx_pci_err_probe(struct
>platform_device *op)
> pdata->irq);
> }
>
>+ if (pdata->pcie_flag) {
>+ /* enable all pcie error interrupt & error detect */
>+ out_be32(®->pex_err_en, ~0);
>+ out_be32(®->pex_err_disr, 0);
>+ } else {
>+ /* PCI master abort is expected during config cycles */
>+ out_be32(®->pex_err_cap_dr, PCI_ERR_CAP_DR_DIS_MST);
>+ /* disable master abort reporting */
>+ out_be32(®->pex_err_en, PCI_ERR_EN_DIS_MST);
>+ }
>+
> devres_remove_group(&op->dev, mpc85xx_pci_err_probe);
> debugf3("%s(): success\n", __func__);
> printk(KERN_INFO EDAC_MOD_STR " PCI err registered\n"); @@ -311,10
>+427,13 @@ static int mpc85xx_pci_err_remove(struct platform_device *op)
>
> debugf0("%s()\n", __func__);
>
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR,
>- orig_pci_err_cap_dr);
>+ if (pdata->pcie_flag)
>+ out_be32(&pdata->pci_reg->pex_err_disr, pdata-
>>orig_pci_err_dr);
>+ else
>+ out_be32(&pdata->pci_reg->pex_err_cap_dr,
>+ pdata->orig_pci_err_dr);
>
>- out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, orig_pci_err_en);
>+ out_be32(&pdata->pci_reg->pex_err_en, pdata->orig_pci_err_en);
>
> edac_pci_del_device(pci->dev);
>
>@@ -333,6 +452,12 @@ static struct of_device_id mpc85xx_pci_err_of_match[]
>=3D {
> {
> .compatible =3D "fsl,mpc8540-pci",
> },
>+ {
>+ .compatible =3D "fsl,mpc8548-pcie",
>+ },
>+ {
>+ .compatible =3D "fsl,p4080-pcie",
>+ },
> {},
> };
> MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match); diff --git
>a/drivers/edac/mpc85xx_edac.h b/drivers/edac/mpc85xx_edac.h index
>932016f..d0e7b11 100644
>--- a/drivers/edac/mpc85xx_edac.h
>+++ b/drivers/edac/mpc85xx_edac.h
>@@ -131,16 +131,8 @@
> #define PCI_EDE_PERR_MASK (PCI_EDE_TGT_PERR | PCI_EDE_MST_PERR | \
> PCI_EDE_ADDR_PERR)
>
>-#define MPC85XX_PCI_ERR_DR 0x0000
>-#define MPC85XX_PCI_ERR_CAP_DR 0x0004
>-#define MPC85XX_PCI_ERR_EN 0x0008
>-#define MPC85XX_PCI_ERR_ATTRIB 0x000c
>-#define MPC85XX_PCI_ERR_ADDR 0x0010
>-#define MPC85XX_PCI_ERR_EXT_ADDR 0x0014
>-#define MPC85XX_PCI_ERR_DL 0x0018
>-#define MPC85XX_PCI_ERR_DH 0x001c
>-#define MPC85XX_PCI_GAS_TIMR 0x0020
>-#define MPC85XX_PCI_PCIX_TIMR 0x0024
>+#define PCI_ERR_CAP_DR_DIS_MST 0x40
>+#define PCI_ERR_EN_DIS_MST (~0x40)
>
> struct mpc85xx_mc_pdata {
> char *name;
>@@ -159,8 +151,11 @@ struct mpc85xx_l2_pdata { struct mpc85xx_pci_pdata {
> char *name;
> int edac_idx;
>- void __iomem *pci_vbase;
> int irq;
>+ struct ccsr_pci *pci_reg;
>+ u8 pcie_flag;
>+ u32 orig_pci_err_dr;
>+ u32 orig_pci_err_en;
> };
>
> #endif
>--
>1.6.4
^ permalink raw reply
* RE: [PATCH 2/2 v2] eSDHC: Fix errors when booting kernel with fsl esdhc
From: Zang Roy-R61911 @ 2011-07-26 10:29 UTC (permalink / raw)
To: Anton Vorontsov
Cc: Wood Scott-B07421, Xu Lei-B33228, linux-mmc@vger.kernel.org,
akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20110722101512.GA1576@oksana.dev.rtsoft.ru>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogbGludXgtbW1jLW93bmVy
QHZnZXIua2VybmVsLm9yZyBbbWFpbHRvOmxpbnV4LW1tYy1vd25lckB2Z2VyLmtlcm5lbC5vcmdd
DQo+IE9uIEJlaGFsZiBPZiBBbnRvbiBWb3JvbnRzb3YNCj4gU2VudDogRnJpZGF5LCBKdWx5IDIy
LCAyMDExIDE4OjE1IFBNDQo+IFRvOiBaYW5nIFJveS1SNjE5MTENCj4gQ2M6IGxpbnV4LW1tY0B2
Z2VyLmtlcm5lbC5vcmc7IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3JnOyBha3BtQGxpbnV4
LQ0KPiBmb3VuZGF0aW9uLm9yZzsgWHUgTGVpLUIzMzIyODsgS3VtYXIgR2FsYQ0KPiBTdWJqZWN0
OiBSZTogW1BBVENIIDIvMiB2Ml0gZVNESEM6IEZpeCBlcnJvcnMgd2hlbiBib290aW5nIGtlcm5l
bCB3aXRoIGZzbCBlc2RoYw0KPiANCj4gT24gRnJpLCBKdWwgMjIsIDIwMTEgYXQgMDY6MTU6MTdQ
TSArMDgwMCwgUm95IFphbmcgd3JvdGU6DQo+IFsuLi5dDQo+ID4gIAlpZiAoaG9zdC0+dmVyc2lv
biA+PSBTREhDSV9TUEVDXzIwMCkgew0KPiA+IC0JCWN0cmwgPSBzZGhjaV9yZWFkYihob3N0LCBT
REhDSV9IT1NUX0NPTlRST0wpOw0KPiA+IC0JCWN0cmwgJj0gflNESENJX0NUUkxfRE1BX01BU0s7
DQo+ID4gLQkJaWYgKChob3N0LT5mbGFncyAmIFNESENJX1JFUV9VU0VfRE1BKSAmJg0KPiA+IC0J
CQkoaG9zdC0+ZmxhZ3MgJiBTREhDSV9VU0VfQURNQSkpDQo+ID4gLQkJCWN0cmwgfD0gU0RIQ0lf
Q1RSTF9BRE1BMzI7DQo+ID4gLQkJZWxzZQ0KPiA+IC0JCQljdHJsIHw9IFNESENJX0NUUkxfU0RN
QTsNCj4gPiAtCQlzZGhjaV93cml0ZWIoaG9zdCwgY3RybCwgU0RIQ0lfSE9TVF9DT05UUk9MKTsN
Cj4gPiArCQlpZiAoaG9zdC0+cXVpcmtzICYgU0RIQ0lfUVVJUktfUU9SSVFfUFJPQ1RMX1dFSVJE
KSB7DQo+ID4gKyNkZWZpbmUgRVNESENJX1BST0NUTF9ETUFTX01BU0sJCTB4MDAwMDAzMDANCj4g
PiArI2RlZmluZSBFU0RIQ0lfUFJPQ1RMX0FETUEzMgkJMHgwMDAwMDIwMA0KPiA+ICsjZGVmaW5l
IEVTREhDSV9QUk9DVExfU0RNQQkJMHgwMDAwMDAwMA0KPiA+ICsJCQljdHJsID0gc2RoY2lfcmVh
ZGwoaG9zdCwgU0RIQ0lfSE9TVF9DT05UUk9MKTsNCj4gPiArCQkJY3RybCAmPSB+RVNESENJX1BS
T0NUTF9ETUFTX01BU0s7DQo+ID4gKwkJCWlmICgoaG9zdC0+ZmxhZ3MgJiBTREhDSV9SRVFfVVNF
X0RNQSkgJiYNCj4gPiArCQkJCShob3N0LT5mbGFncyAmIFNESENJX1VTRV9BRE1BKSkNCj4gPiAr
CQkJCWN0cmwgfD0gRVNESENJX1BST0NUTF9BRE1BMzI7DQo+ID4gKwkJCWVsc2UNCj4gPiArCQkJ
CWN0cmwgfD0gRVNESENJX1BST0NUTF9TRE1BOw0KPiA+ICsJCQlzZGhjaV93cml0ZWwoaG9zdCwg
Y3RybCwgU0RIQ0lfSE9TVF9DT05UUk9MKTsNCj4gPiArCQl9IGVsc2Ugew0KPiA+ICsJCQljdHJs
ID0gc2RoY2lfcmVhZGIoaG9zdCwgU0RIQ0lfSE9TVF9DT05UUk9MKTsNCj4gPiArCQkJY3RybCAm
PSB+U0RIQ0lfQ1RSTF9ETUFfTUFTSzsNCj4gPiArCQkJaWYgKChob3N0LT5mbGFncyAmIFNESENJ
X1JFUV9VU0VfRE1BKSAmJg0KPiA+ICsJCQkJKGhvc3QtPmZsYWdzICYgU0RIQ0lfVVNFX0FETUEp
KQ0KPiA+ICsJCQkJY3RybCB8PSBTREhDSV9DVFJMX0FETUEzMjsNCj4gPiArCQkJZWxzZQ0KPiA+
ICsJCQkJY3RybCB8PSBTREhDSV9DVFJMX1NETUE7DQo+ID4gKwkJCXNkaGNpX3dyaXRlYihob3N0
LCBjdHJsLCBTREhDSV9IT1NUX0NPTlRST0wpOw0KPiANCj4gV2UgdHJ5IHRvIG5vdCBwb2xsdXRl
IGdlbmVyaWMgc2RoY2kuYyBkcml2ZXIgd2l0aCBjaGlwLXNwZWNpZmljDQo+IHF1aXJrcy4NCj4g
DQo+IE1heWJlIHlvdSBjYW4gZG8gdGhlIGZpeHVwcyB2aWEgSU8gYWNjZXNzb3JzPyBPciBieSBp
bnRyb2R1Y2luZw0KPiBzb21lIGFkZGl0aW9uYWwgc2RoY2kgb3A/DQo+IA0KPiBbLi4uXQ0KPiA+
ICAJaWYgKHBvd2VyICE9ICh1bnNpZ25lZCBzaG9ydCktMSkgew0KPiA+ICAJCXN3aXRjaCAoMSA8
PCBwb3dlcikgew0KPiA+ICsjZGVmaW5lCUVTREhDSV9GU0xfUE9XRVJfTUFTSwkweDQwDQo+ID4g
KyNkZWZpbmUJRVNESENJX0ZTTF9QT1dFUl8xODAJMHgwMA0KPiA+ICsjZGVmaW5lCUVTREhDSV9G
U0xfUE9XRVJfMzAwCTB4NDANCj4gDQo+IFNhbWUgaGVyZS4gVGhlIGRyaXZlciB3aWxsIHJvdCBx
dWlja2x5IGlmIGV2ZXJ5b25lIHdvdWxkIHN0YXJ0DQo+IHB1dHRpbmcgY2hpcC1zcGVjaWZpYyBx
dWlya3MgaW50byBzZGhjaS5jLiBQbGVhc2UgZG9uJ3QuDQpJTyBhY2Nlc3NvcnMgb3Igc2RoY2kg
b3AgbWlnaHQgd29yaywgYnV0IGl0IHdpbGwgbG9vayB1Z2x5IA0KYW5kIGxlc3MgcGVyZm9ybWFu
Y2UgZWZmaWNpZW50IGZvciBpbyBhY2Nlc3MuDQoNCklmIHlvdSBzZWFyY2ggc2RoY2kuYywgeW91
IHdpbGwgc2VlIG90aGVyIGJvYXJkIHNwZWNpZmljIHF1aXJrcy4NClRoYW5rcy4NClJveQ0K
^ permalink raw reply
* [PATCH] mtd: eLBC NAND: update ecc_stats.corrected when lteccr available
From: Michael Hench @ 2011-07-26 13:45 UTC (permalink / raw)
To: scottwood, linux-mtd, linuxppc-dev, mhench, mlcreech
update ecc_stats.corrected if LTECCR register is available.
Signed-off-by: Michael Hench <MichaelHench@gmail.com>
---
diff -purN orig/drivers/mtd/nand/fsl_elbc_nand.c
linux-3.0/drivers/mtd/nand/fsl_elbc_nand.c
--- orig/drivers/mtd/nand/fsl_elbc_nand.c 2011-07-25 14:50:56.838326055 -0500
+++ linux-3.0/drivers/mtd/nand/fsl_elbc_nand.c 2011-07-25
14:48:35.680940052 -0500
@@ -256,6 +256,25 @@ static int fsl_elbc_run_command(struct m
return -EIO;
}
+ if(chip->ecc.mode != NAND_ECC_HW)
+ return(0);
+
+ if(elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) {
+ uint32_t lteccr = in_be32(&lbc->lteccr);
+ /*
+ * if command was a full page read and the ELBC
+ * has the LTECCR register, then bits 12-15 (ppc order) of
+ * LTECCR indicate which 512 byte sub-pages had corrected errors.
+ * bits 28-31 are uncorrectable errors, marked elsewhere.
+ * for small page nand only 1 bit is used.
+ * if the ELBC doesn't have the lteccr register it reads 0
+ */
+ if(lteccr & 0x000F000F)
+ out_be32(&lbc->lteccr, 0x000F000F); /* clear lteccr */
+ if(lteccr & 0x000F0000)
+ mtd->ecc_stats.corrected++;
+ }
+
return 0;
}
--
^ 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