* [PATCH 06/35] KVM: PPC: Add tracepoints for generic spte flushes
From: Alexander Graf @ 2010-08-31 2:31 UTC (permalink / raw)
To: kvm-ppc; +Cc: Linuxppc-dev, KVM list
In-Reply-To: <1283221937-21006-1-git-send-email-agraf@suse.de>
The different ways of flusing shadow ptes have their own debug prints which use
stupid old printk.
Let's move them to tracepoints, making them easier available, faster and
possible to activate on demand
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kvm/book3s_mmu_hpte.c | 18 +++---------------
arch/powerpc/kvm/trace.h | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c
index 3397152..bd6a767 100644
--- a/arch/powerpc/kvm/book3s_mmu_hpte.c
+++ b/arch/powerpc/kvm/book3s_mmu_hpte.c
@@ -31,14 +31,6 @@
#define PTE_SIZE 12
-/* #define DEBUG_MMU */
-
-#ifdef DEBUG_MMU
-#define dprintk_mmu(a, ...) printk(KERN_INFO a, __VA_ARGS__)
-#else
-#define dprintk_mmu(a, ...) do { } while(0)
-#endif
-
static struct kmem_cache *hpte_cache;
static inline u64 kvmppc_mmu_hash_pte(u64 eaddr)
@@ -186,9 +178,7 @@ static void kvmppc_mmu_pte_flush_long(struct kvm_vcpu *vcpu, ulong guest_ea)
void kvmppc_mmu_pte_flush(struct kvm_vcpu *vcpu, ulong guest_ea, ulong ea_mask)
{
- dprintk_mmu("KVM: Flushing %d Shadow PTEs: 0x%lx & 0x%lx\n",
- vcpu->arch.hpte_cache_count, guest_ea, ea_mask);
-
+ trace_kvm_book3s_mmu_flush("", vcpu, guest_ea, ea_mask);
guest_ea &= ea_mask;
switch (ea_mask) {
@@ -251,8 +241,7 @@ static void kvmppc_mmu_pte_vflush_long(struct kvm_vcpu *vcpu, u64 guest_vp)
void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 guest_vp, u64 vp_mask)
{
- dprintk_mmu("KVM: Flushing %d Shadow vPTEs: 0x%llx & 0x%llx\n",
- vcpu->arch.hpte_cache_count, guest_vp, vp_mask);
+ trace_kvm_book3s_mmu_flush("v", vcpu, guest_vp, vp_mask);
guest_vp &= vp_mask;
switch(vp_mask) {
@@ -274,8 +263,7 @@ void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end)
struct hpte_cache *pte;
int i;
- dprintk_mmu("KVM: Flushing %d Shadow pPTEs: 0x%lx - 0x%lx\n",
- vcpu->arch.hpte_cache_count, pa_start, pa_end);
+ trace_kvm_book3s_mmu_flush("p", vcpu, pa_start, pa_end);
rcu_read_lock();
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h
index 06ad93e..23f757a 100644
--- a/arch/powerpc/kvm/trace.h
+++ b/arch/powerpc/kvm/trace.h
@@ -239,6 +239,29 @@ TRACE_EVENT(kvm_book3s_mmu_invalidate,
__entry->vpage, __entry->raddr, __entry->flags)
);
+TRACE_EVENT(kvm_book3s_mmu_flush,
+ TP_PROTO(const char *type, struct kvm_vcpu *vcpu, unsigned long long p1,
+ unsigned long long p2),
+ TP_ARGS(type, vcpu, p1, p2),
+
+ TP_STRUCT__entry(
+ __field( int, count )
+ __field( unsigned long long, p1 )
+ __field( unsigned long long, p2 )
+ __field( const char *, type )
+ ),
+
+ TP_fast_assign(
+ __entry->count = vcpu->arch.hpte_cache_count;
+ __entry->p1 = p1;
+ __entry->p2 = p2;
+ __entry->type = type;
+ ),
+
+ TP_printk("Flush %d %sPTEs: %llx - %llx",
+ __entry->count, __entry->type, __entry->p1, __entry->p2)
+);
+
#endif /* CONFIG_PPC_BOOK3S */
#endif /* _TRACE_KVM_H */
--
1.6.0.2
^ permalink raw reply related
* [PATCH 02/35] KVM: PPC: Move book3s_64 mmu map debug print to trace point
From: Alexander Graf @ 2010-08-31 2:31 UTC (permalink / raw)
To: kvm-ppc; +Cc: Linuxppc-dev, KVM list
In-Reply-To: <1283221937-21006-1-git-send-email-agraf@suse.de>
This patch moves Book3s MMU debugging over to tracepoints.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kvm/book3s_64_mmu_host.c | 13 +----------
arch/powerpc/kvm/trace.h | 34 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index 672b149..aa516ad 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -28,19 +28,13 @@
#include <asm/machdep.h>
#include <asm/mmu_context.h>
#include <asm/hw_irq.h>
+#include "trace.h"
#define PTE_SIZE 12
#define VSID_ALL 0
-/* #define DEBUG_MMU */
/* #define DEBUG_SLB */
-#ifdef DEBUG_MMU
-#define dprintk_mmu(a, ...) printk(KERN_INFO a, __VA_ARGS__)
-#else
-#define dprintk_mmu(a, ...) do { } while(0)
-#endif
-
#ifdef DEBUG_SLB
#define dprintk_slb(a, ...) printk(KERN_INFO a, __VA_ARGS__)
#else
@@ -156,10 +150,7 @@ map_again:
} else {
struct hpte_cache *pte = kvmppc_mmu_hpte_cache_next(vcpu);
- dprintk_mmu("KVM: %c%c Map 0x%lx: [%lx] 0x%lx (0x%llx) -> %lx\n",
- ((rflags & HPTE_R_PP) == 3) ? '-' : 'w',
- (rflags & HPTE_R_N) ? '-' : 'x',
- orig_pte->eaddr, hpteg, va, orig_pte->vpage, hpaddr);
+ trace_kvm_book3s_64_mmu_map(rflags, hpteg, va, hpaddr, orig_pte);
/* The ppc_md code may give us a secondary entry even though we
asked for a primary. Fix up. */
diff --git a/arch/powerpc/kvm/trace.h b/arch/powerpc/kvm/trace.h
index b5e9d81..8ed6f1c 100644
--- a/arch/powerpc/kvm/trace.h
+++ b/arch/powerpc/kvm/trace.h
@@ -147,6 +147,40 @@ TRACE_EVENT(kvm_book3s_reenter,
TP_printk("reentry r=%d | pc=0x%lx", __entry->r, __entry->pc)
);
+#ifdef CONFIG_PPC_BOOK3S_64
+
+TRACE_EVENT(kvm_book3s_64_mmu_map,
+ TP_PROTO(int rflags, ulong hpteg, ulong va, pfn_t hpaddr,
+ struct kvmppc_pte *orig_pte),
+ TP_ARGS(rflags, hpteg, va, hpaddr, orig_pte),
+
+ TP_STRUCT__entry(
+ __field( unsigned char, flag_w )
+ __field( unsigned char, flag_x )
+ __field( unsigned long, eaddr )
+ __field( unsigned long, hpteg )
+ __field( unsigned long, va )
+ __field( unsigned long long, vpage )
+ __field( unsigned long, hpaddr )
+ ),
+
+ TP_fast_assign(
+ __entry->flag_w = ((rflags & HPTE_R_PP) == 3) ? '-' : 'w';
+ __entry->flag_x = (rflags & HPTE_R_N) ? '-' : 'x';
+ __entry->eaddr = orig_pte->eaddr;
+ __entry->hpteg = hpteg;
+ __entry->va = va;
+ __entry->vpage = orig_pte->vpage;
+ __entry->hpaddr = hpaddr;
+ ),
+
+ TP_printk("KVM: %c%c Map 0x%lx: [%lx] 0x%lx (0x%llx) -> %lx",
+ __entry->flag_w, __entry->flag_x, __entry->eaddr,
+ __entry->hpteg, __entry->va, __entry->vpage, __entry->hpaddr)
+);
+
+#endif /* CONFIG_PPC_BOOK3S_64 */
+
#endif /* CONFIG_PPC_BOOK3S */
#endif /* _TRACE_KVM_H */
--
1.6.0.2
^ permalink raw reply related
* [PULL 00/35] KVM: PPC: End-August patch queue
From: Alexander Graf @ 2010-08-31 2:31 UTC (permalink / raw)
To: kvm-ppc; +Cc: Linuxppc-dev, KVM list
Howdy,
This is my local patch queue with stuff that has accumulated over the last
weeks on KVM for PPC with some last minute fixes, speedups and debugging help
that I needed for the KVM Forum ;-).
The highlights of this set are:
- Converted most important debug points to tracepoints
- Flush less PTEs (speedup)
- Go back to our own hash (less duplicates)
- Make SRs guest settable (speedup for 32 bit guests)
- Remove r30/r31 restrictions from PV hooks (speedup!)
- Fix random breakages
- Fix random guest stalls
- 440GP host support (Thanks Hollis!)
- Reliable interrupt injection
Keep in mind that this is the first version that is stable on PPC32 hosts.
All versions prior to this could occupy otherwise used segment entries and
thus crash your machine :-).
It is also the first version that is stable with PPC64 guests, because they
require more sophisticated interrupt injection logic for which qemu patches
are also required.
Please pull this tree from:
git://github.com/agraf/linux-2.6.git kvm-ppc-next
Have fun with more accurate, faster and less buggy KVM on PowerPC!
Alexander Graf (31):
KVM: PPC: Move EXIT_DEBUG partially to tracepoints
KVM: PPC: Move book3s_64 mmu map debug print to trace point
KVM: PPC: Add tracepoint for generic mmu map
KVM: PPC: Move pte invalidate debug code to tracepoint
KVM: PPC: Fix sid map search after flush
KVM: PPC: Add tracepoints for generic spte flushes
KVM: PPC: Preload magic page when in kernel mode
KVM: PPC: Don't flush PTEs on NX/RO hit
KVM: PPC: Make invalidation code more reliable
KVM: PPC: Move slb debugging to tracepoints
KVM: PPC: Revert "KVM: PPC: Use kernel hash function"
KVM: PPC: Remove unused define
KVM: PPC: Add feature bitmap for magic page
KVM: PPC: Move BAT handling code into spr handler
KVM: PPC: Interpret SR registers on demand
KVM: PPC: Put segment registers in shared page
KVM: PPC: Add mtsrin PV code
KVM: PPC: Make PV mtmsr work with r30 and r31
KVM: PPC: Update int_pending also on dequeue
KVM: PPC: Make PV mtmsrd L=1 work with r30 and r31
KVM: PPC: Force enable nap on KVM
KVM: PPC: Implement correct SID mapping on Book3s_32
KVM: PPC: Don't put MSR_POW in MSR
KVM: PPC: Enable napping only for Book3s_64
KVM: PPC: Implement Level interrupts on Book3S
KVM: PPC: Fix CONFIG_KVM_GUEST && !CONFIG_KVM case
KVM: PPC: Expose level based interrupt cap
KVM: PPC: Implement level interrupts for BookE
KVM: PPC: Document KVM_INTERRUPT ioctl
KVM: PPC: Fix compile error in e500_tlb.c
KVM: PPC: Add documentation for magic page enhancements
Hollis Blanchard (3):
KVM: PPC: initialize IVORs in addition to IVPR
KVM: PPC: fix compilation of "dump tlbs" debug function
KVM: PPC: allow ppc440gp to pass the compatibility check
Kyle Moffett (1):
KVM: PPC: e500_tlb: Fix a minor copy-paste tracing bug
Documentation/kvm/api.txt | 33 +++++-
Documentation/kvm/ppc-pv.txt | 17 +++
arch/powerpc/include/asm/kvm.h | 1 +
arch/powerpc/include/asm/kvm_asm.h | 4 +-
arch/powerpc/include/asm/kvm_book3s.h | 25 ++--
arch/powerpc/include/asm/kvm_para.h | 3 +
arch/powerpc/kernel/asm-offsets.c | 7 +-
arch/powerpc/kernel/kvm.c | 147 ++++++++++++++++++---
arch/powerpc/kernel/kvm_emul.S | 75 +++++++++--
arch/powerpc/kvm/44x.c | 3 +-
arch/powerpc/kvm/44x_tlb.c | 1 +
arch/powerpc/kvm/book3s.c | 84 +++++++-----
arch/powerpc/kvm/book3s_32_mmu.c | 83 ++++++-----
arch/powerpc/kvm/book3s_32_mmu_host.c | 67 ++++++----
arch/powerpc/kvm/book3s_64_mmu_host.c | 59 +++-----
arch/powerpc/kvm/book3s_emulate.c | 48 +++-----
arch/powerpc/kvm/book3s_mmu_hpte.c | 38 ++---
arch/powerpc/kvm/booke.c | 25 +++-
arch/powerpc/kvm/booke.h | 4 +-
arch/powerpc/kvm/e500_tlb.c | 9 +-
arch/powerpc/kvm/powerpc.c | 6 +-
arch/powerpc/kvm/trace.h | 239 +++++++++++++++++++++++++++++++++
include/linux/kvm.h | 1 +
23 files changed, 730 insertions(+), 249 deletions(-)
^ permalink raw reply
* [PATCH 08/35] KVM: PPC: Don't flush PTEs on NX/RO hit
From: Alexander Graf @ 2010-08-31 2:31 UTC (permalink / raw)
To: kvm-ppc; +Cc: Linuxppc-dev, KVM list
In-Reply-To: <1283221937-21006-1-git-send-email-agraf@suse.de>
When hitting a no-execute or read-only data/inst storage interrupt we were
flushing the respective PTE so we're sure it gets properly overwritten next.
According to the spec, this is unnecessary though. The guest issues a tlbie
anyways, so we're safe to just keep the PTE around and have it manually removed
from the guest, saving us a flush.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kvm/book3s.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 54ca578..2fb528f 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -887,7 +887,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
vcpu->arch.shared->msr |=
to_svcpu(vcpu)->shadow_srr1 & 0x58000000;
kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
- kvmppc_mmu_pte_flush(vcpu, kvmppc_get_pc(vcpu), ~0xFFFUL);
r = RESUME_GUEST;
}
break;
@@ -913,7 +912,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
vcpu->arch.shared->dar = dar;
vcpu->arch.shared->dsisr = to_svcpu(vcpu)->fault_dsisr;
kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
- kvmppc_mmu_pte_flush(vcpu, dar, ~0xFFFUL);
r = RESUME_GUEST;
}
break;
--
1.6.0.2
^ permalink raw reply related
* [PATCH 05/35] KVM: PPC: Fix sid map search after flush
From: Alexander Graf @ 2010-08-31 2:31 UTC (permalink / raw)
To: kvm-ppc; +Cc: Linuxppc-dev, KVM list
In-Reply-To: <1283221937-21006-1-git-send-email-agraf@suse.de>
After a flush the sid map contained lots of entries with 0 for their gvsid and
hvsid value. Unfortunately, 0 can be a real value the guest searches for when
looking up a vsid so it would incorrectly find the host's 0 hvsid mapping which
doesn't belong to our sid space.
So let's also check for the valid bit that indicated that the sid we're
looking at actually contains useful data.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kvm/book3s_64_mmu_host.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index aa516ad..ebb1b5d 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -65,14 +65,14 @@ static struct kvmppc_sid_map *find_sid_vsid(struct kvm_vcpu *vcpu, u64 gvsid)
sid_map_mask = kvmppc_sid_hash(vcpu, gvsid);
map = &to_book3s(vcpu)->sid_map[sid_map_mask];
- if (map->guest_vsid == gvsid) {
+ if (map->valid && (map->guest_vsid == gvsid)) {
dprintk_slb("SLB: Searching: 0x%llx -> 0x%llx\n",
gvsid, map->host_vsid);
return map;
}
map = &to_book3s(vcpu)->sid_map[SID_MAP_MASK - sid_map_mask];
- if (map->guest_vsid == gvsid) {
+ if (map->valid && (map->guest_vsid == gvsid)) {
dprintk_slb("SLB: Searching 0x%llx -> 0x%llx\n",
gvsid, map->host_vsid);
return map;
--
1.6.0.2
^ permalink raw reply related
* [PATCH 1/3] PPC: s/mtmsrd/MTMSR in ldstfp.S
From: Alexander Graf @ 2010-08-31 2:15 UTC (permalink / raw)
To: Linuxppc-dev
In-Reply-To: <1283220922-20369-1-git-send-email-agraf@suse.de>
Commit 0016a4cf introduced a lot of mtmsrd's that were plainly written out.
These failed to compile on my e500v2 system, so let's better use the macro
that is around just for that purpose.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/lib/ldstfp.S | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index f644863..ce818a5 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/powerpc/lib/ldstfp.S
@@ -81,7 +81,7 @@ _GLOBAL(do_lfs)
mfmsr r6
ori r7,r6,MSR_FP
cmpwi cr7,r3,0
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
stfd fr0,STKFRM-16(r1)
@@ -93,7 +93,7 @@ _GLOBAL(do_lfs)
lfd fr0,STKFRM-16(r1)
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -108,7 +108,7 @@ _GLOBAL(do_lfd)
mfmsr r6
ori r7,r6,MSR_FP
cmpwi cr7,r3,0
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
stfd fr0,STKFRM-16(r1)
@@ -120,7 +120,7 @@ _GLOBAL(do_lfd)
lfd fr0,STKFRM-16(r1)
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -135,7 +135,7 @@ _GLOBAL(do_stfs)
mfmsr r6
ori r7,r6,MSR_FP
cmpwi cr7,r3,0
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
stfd fr0,STKFRM-16(r1)
@@ -147,7 +147,7 @@ _GLOBAL(do_stfs)
lfd fr0,STKFRM-16(r1)
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -162,7 +162,7 @@ _GLOBAL(do_stfd)
mfmsr r6
ori r7,r6,MSR_FP
cmpwi cr7,r3,0
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
stfd fr0,STKFRM-16(r1)
@@ -174,7 +174,7 @@ _GLOBAL(do_stfd)
lfd fr0,STKFRM-16(r1)
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -229,7 +229,7 @@ _GLOBAL(do_lvx)
oris r7,r6,MSR_VEC@h
cmpwi cr7,r3,0
li r8,STKFRM-16
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
stvx vr0,r1,r8
@@ -241,7 +241,7 @@ _GLOBAL(do_lvx)
lvx vr0,r1,r8
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -257,7 +257,7 @@ _GLOBAL(do_stvx)
oris r7,r6,MSR_VEC@h
cmpwi cr7,r3,0
li r8,STKFRM-16
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
stvx vr0,r1,r8
@@ -269,7 +269,7 @@ _GLOBAL(do_stvx)
lvx vr0,r1,r8
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -325,7 +325,7 @@ _GLOBAL(do_lxvd2x)
oris r7,r6,MSR_VSX@h
cmpwi cr7,r3,0
li r8,STKFRM-16
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
STXVD2X(0,r1,r8)
@@ -337,7 +337,7 @@ _GLOBAL(do_lxvd2x)
LXVD2X(0,r1,r8)
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
@@ -353,7 +353,7 @@ _GLOBAL(do_stxvd2x)
oris r7,r6,MSR_VSX@h
cmpwi cr7,r3,0
li r8,STKFRM-16
- mtmsrd r7
+ MTMSRD(r7)
isync
beq cr7,1f
STXVD2X(0,r1,r8)
@@ -365,7 +365,7 @@ _GLOBAL(do_stxvd2x)
LXVD2X(0,r1,r8)
4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
mtlr r0
- mtmsrd r6
+ MTMSRD(r6)
isync
mr r3,r9
addi r1,r1,STKFRM
--
1.6.0.2
^ permalink raw reply related
* [PATCH 0/3] MPC85xx compile fixes
From: Alexander Graf @ 2010-08-31 2:15 UTC (permalink / raw)
To: Linuxppc-dev
While trying to compile a recent git kernel on my e500v2 box, I came
across some pretty simple compilation bugs.
Since I have no idea which tree those go through, I'm sending them to
you, but please coordinate who takes them in.
Also, it might be useful to set up a make defconfig machine that does
regression testing for booke builds. These really shouldn't be caught
by me in the kvm.git tree :).
Alexander Graf (3):
PPC: s/mtmsrd/MTMSR in ldstfp.S
PPC: Fix compilation of fsl_rio.c
PPC: Fix compilation of mpc85xx_mds.c
arch/powerpc/lib/ldstfp.S | 32 ++++++++++++++--------------
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 1 +
arch/powerpc/sysdev/fsl_rio.c | 2 +-
3 files changed, 18 insertions(+), 17 deletions(-)
^ permalink raw reply
* [PATCH 2/3] PPC: Fix compilation of fsl_rio.c
From: Alexander Graf @ 2010-08-31 2:15 UTC (permalink / raw)
To: Linuxppc-dev; +Cc: Alexandre Bounine, Thomas Moll
In-Reply-To: <1283220922-20369-1-git-send-email-agraf@suse.de>
Commit a52c8f52 introduced machine check magic for the RapidIO chip.
Unfortunately it was so magical that it used constants that aren't even
defined!
This patch bluntly comments out the broken constant's usage. This
probably means that said functionality thus doesn't work, but at
least it makes it compile for me.
CC: Alexandre Bounine <alexandre.bounine@idt.com>
CC: Thomas Moll <thomas.moll@sysgo.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/sysdev/fsl_rio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 6425abe..dba2969 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -245,7 +245,7 @@ static int (*saved_mcheck_exception)(struct pt_regs *regs);
static int fsl_rio_mcheck_exception(struct pt_regs *regs)
{
const struct exception_table_entry *entry = NULL;
- unsigned long reason = (mfspr(SPRN_MCSR) & MCSR_MASK);
+ unsigned long reason = (mfspr(SPRN_MCSR) /* & MCSR_MASK */);
if (reason & MCSR_BUS_RBERR) {
reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
--
1.6.0.2
^ permalink raw reply related
* [PATCH 3/3] PPC: Fix compilation of mpc85xx_mds.c
From: Alexander Graf @ 2010-08-31 2:15 UTC (permalink / raw)
To: Linuxppc-dev; +Cc: Anton Vorontsov
In-Reply-To: <1283220922-20369-1-git-send-email-agraf@suse.de>
Commit 99d8238f berobbed the for_each loop of its iterator! Let's be
nice and give it back, so it compiles for us.
CC: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/platforms/85xx/mpc85xx_mds.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index da64be1..aa34cac 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -357,6 +357,7 @@ static void __init mpc85xx_mds_setup_arch(void)
{
#ifdef CONFIG_PCI
struct pci_controller *hose;
+ struct device_node *np;
#endif
dma_addr_t max = 0xffffffff;
--
1.6.0.2
^ permalink raw reply related
* Re: [PATCH] powerpc/kvm/e500_tlb: Fix a minor copy-paste tracing bug
From: Alexander Graf @ 2010-08-31 1:07 UTC (permalink / raw)
To: Kyle Moffett; +Cc: linuxppc-dev, Kyle Moffett, Liu Yu, linux-kernel, kvm-ppc
In-Reply-To: <1283182719-4621-1-git-send-email-Kyle.D.Moffett@boeing.com>
On 30.08.2010, at 17:38, Kyle Moffett wrote:
> The kvmppc_e500_stlbe_invalidate() function was trying to pass too many
> parameters to trace_kvm_stlb_inval(). This appears to be a bad
> copy-paste from a call to trace_kvm_stlb_write().
>
> Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Thanks, applied.
Alex
^ permalink raw reply
* Re: [PATCH 13/26] KVM: PPC: Add feature bitmap for magic page
From: Alexander Graf @ 2010-08-31 0:56 UTC (permalink / raw)
To: Avi Kivity; +Cc: linuxppc-dev, KVM list, kvm-ppc
In-Reply-To: <4C715382.6050809@redhat.com>
On 22.08.2010, at 18:42, Avi Kivity wrote:
> On 08/17/2010 04:57 PM, Alexander Graf wrote:
>> We will soon add SR PV support to the shared page, so we need some
>> infrastructure that allows the guest to query for features KVM =
exports.
>>=20
>> This patch adds a second return value to the magic mapping that
>> indicated to the guest which features are available.
>>=20
>=20
> You need to make that feature controllable from userspace, to allow =
new->old save/restore.
Good one :). We're still missing too much stuff to even run without =
losing interrupts yet and you're thinking about new->old save/restore. =
Who'd want to migrate onto a system that's broken anyways? Besides - =
we're missing too many register values from the kernel side to even be =
able to perform a migration.
I'm planning to add migration, probably after SMP. But that will be =
another CAP and anything before that won't be able to save/restore.
Alex
^ permalink raw reply
* Re: [PATCH 5/7] arch/powerpc/sysdev/qe_lib/qe.c: Add of_node_put to avoid memory leak
From: Timur Tabi @ 2010-08-30 20:39 UTC (permalink / raw)
To: Julia Lawall
Cc: devicetree-discuss, kernel-janitors, linux-kernel, Paul Mackerras,
linuxppc-dev
In-Reply-To: <1283075566-27441-6-git-send-email-julia@diku.dk>
Julia Lawall wrote:
> Add a call to of_node_put in the error handling code following a call to
> of_find_compatible_node.
Acked-by: Timur Tabi <timur@freescale.com>
Thanks, Julia. Your work in finding these kinds of bugs is very much
appreciated.
^ permalink raw reply
* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Grant Likely @ 2010-08-30 17:49 UTC (permalink / raw)
To: David Brownell
Cc: David Brownell, Esben Haabendal, linux-mmc, Andrew Morton,
linuxppc-dev
In-Reply-To: <172136.90988.qm@web180315.mail.gq1.yahoo.com>
On Mon, Aug 30, 2010 at 10:38 AM, David Brownell <david-b@pacbell.net> wrote:
> Since I don't do OpenFirmware, let's hear from
> Grant on this one.
Looks good to me.
Acked-by: Grant Likely <grant.likely@secretlab.ca>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Grant Likely @ 2010-08-30 17:46 UTC (permalink / raw)
To: Esben Haabendal; +Cc: linuxppc-dev, Andrew Morton, David Brownell, linux-mmc
In-Reply-To: <AANLkTik3rNpFCYDR7dxiFN_3dvxZmsSjt8PsoC415JM-@mail.gmail.com>
On Mon, Aug 30, 2010 at 10:04 AM, Esben Haabendal
<esbenhaabendal@gmail.com> wrote:
> On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov <cbouatmailru@gmail.com>=
wrote:
>>> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
>>> *mmc_spi_get_pdata(struct spi_device *spi)
>>> =A0 =A0 =A0 =A0 if (gpio_is_valid(oms->gpios[WP_GPIO]))
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 oms->pdata.get_ro =3D of_mmc_spi_get_ro=
;
>>>
>>> - =A0 =A0 =A0 /* We don't support interrupts yet, let's poll. */
>>> - =A0 =A0 =A0 oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
>>> + =A0 =A0 =A0 oms->detect_irq =3D irq_of_parse_and_map(np, 0);
>>> + =A0 =A0 =A0 if (oms->detect_irq !=3D NO_IRQ) {
>>
>> I'd write "if (oms->detect_irq)", which is a bit more natural
>> (and still correct, 0 is the only invalid VIRQ number).
>
> Most other architectures has NO_IRQ defined to -1, so I will stick
> with the NO_IRQ comparsion.
Not true. NO_IRQ is only defined as -1 on ARM, microblaze, mn10300
and parisc, and I've got a patch pending to remove microblaze from
that list. ARM just happens to be a really big user.
$ git grep NO_IRQ arch/*/include (I've trimmed the irrelevant matches)
arch/arm/include/asm/irq.h:#ifndef NO_IRQ
arch/arm/include/asm/irq.h:#define NO_IRQ ((unsigned int)(-1))
arch/microblaze/include/asm/irq.h:#define NO_IRQ (-1)
arch/mn10300/include/asm/irq.h:#define NO_IRQ INT_MAX
arch/parisc/include/asm/irq.h:#define NO_IRQ (-1)
arch/powerpc/include/asm/irq.h:#define NO_IRQ (0)
> Hopefully, arm users will soon enjoy this driver/wrapper soon also.
My hope is that even on ARM when the device tree is used I'll be able
eliminate IRQs mapped to 0 (but I need to do a lot more research on
how best to do that though). Are you actually using this on ARM?
I'm okay with you keeping the NO_IRQ test for the short term though.
g.
^ permalink raw reply
* Re: [PATCH] of_mmc_spi: add card detect irq support
From: David Brownell @ 2010-08-30 16:38 UTC (permalink / raw)
To: Esben Haabendal, Anton Vorontsov
Cc: linux-mmc, Andrew Morton, David Brownell, linuxppc-dev
In-Reply-To: <20100830161102.GA20413@oksana.dev.rtsoft.ru>
Since I don't do OpenFirmware, let's hear from
Grant on this one.
^ permalink raw reply
* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Anton Vorontsov @ 2010-08-30 16:11 UTC (permalink / raw)
To: Esben Haabendal; +Cc: linux-mmc, Andrew Morton, David Brownell, linuxppc-dev
In-Reply-To: <AANLkTik3rNpFCYDR7dxiFN_3dvxZmsSjt8PsoC415JM-@mail.gmail.com>
> of_mmc_spi: add card detect irq support
>
> Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Thanks!
> ---
> .../powerpc/dts-bindings/mmc-spi-slot.txt | 9 ++++++-
> drivers/mmc/host/of_mmc_spi.c | 26 ++++++++++++++++++-
> 2 files changed, 32 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
> index c39ac28..89a0084 100644
> --- a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
> +++ b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
> @@ -7,8 +7,13 @@ Required properties:
> - voltage-ranges : two cells are required, first cell specifies minimum
> slot voltage (mV), second cell specifies maximum slot voltage (mV).
> Several ranges could be specified.
> -- gpios : (optional) may specify GPIOs in this order: Card-Detect GPIO,
> +
> +Optional properties:
> +- gpios : may specify GPIOs in this order: Card-Detect GPIO,
> Write-Protect GPIO.
> +- interrupts : the interrupt of a card detect interrupt.
> +- interrupt-parent : the phandle for the interrupt controller that
> + services interrupts for this device.
>
> Example:
>
> @@ -20,4 +25,6 @@ Example:
> &qe_pio_d 15 0>;
> voltage-ranges = <3300 3300>;
> spi-max-frequency = <50000000>;
> + interrupts = <42>;
> + interrupt-parent = <&PIC>;
> };
> diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
> index 1247e5d..5530def 100644
> --- a/drivers/mmc/host/of_mmc_spi.c
> +++ b/drivers/mmc/host/of_mmc_spi.c
> @@ -34,6 +34,7 @@ enum {
> struct of_mmc_spi {
> int gpios[NUM_GPIOS];
> bool alow_gpios[NUM_GPIOS];
> + int detect_irq;
> struct mmc_spi_platform_data pdata;
> };
>
> @@ -61,6 +62,22 @@ static int of_mmc_spi_get_ro(struct device *dev)
> return of_mmc_spi_read_gpio(dev, WP_GPIO);
> }
>
> +static int of_mmc_spi_init(struct device *dev,
> + irqreturn_t (*irqhandler)(int, void *), void *mmc)
> +{
> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
> +
> + return request_threaded_irq(oms->detect_irq, NULL, irqhandler, 0,
> + dev_name(dev), mmc);
> +}
> +
> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
> +{
> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
> +
> + free_irq(oms->detect_irq, mmc);
> +}
> +
> struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
> {
> struct device *dev = &spi->dev;
> @@ -121,8 +138,13 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
> if (gpio_is_valid(oms->gpios[WP_GPIO]))
> oms->pdata.get_ro = of_mmc_spi_get_ro;
>
> - /* We don't support interrupts yet, let's poll. */
> - oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
> + oms->detect_irq = irq_of_parse_and_map(np, 0);
> + if (oms->detect_irq != NO_IRQ) {
> + oms->pdata.init = of_mmc_spi_init;
> + oms->pdata.exit = of_mmc_spi_exit;
> + } else {
> + oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
> + }
>
> dev->platform_data = &oms->pdata;
> return dev->platform_data;
> --
> 1.7.1.1
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] ucc_geth: fix ethtool set ring param bug
From: Liang Li @ 2010-08-30 14:47 UTC (permalink / raw)
To: leoli, davem, avorontsov, netdev, linuxppc-dev
It's common sense that when we should do change to driver ring
desc/buffer etc only after 'stop/shutdown' the device. When we
do change while devices/driver is running, kernel oops occur:
[
root@fsl_8569mds:/root> ethtool -G eth0 tx 256
root@fsl_8569mds:/root> Oops: Kernel access of bad area, sig: 11 [#1]
MPC8569 MDS
last sysfs file: /sys/kernel/uevent_seqnum
Modules linked in:
NIP: 00000000 LR: c0072fbc CTR: 00000000
REGS: effefef0 TRAP: 0400 Not tainted (2.6.36-rc3-00002-g6c3b118-dirty)
MSR: 00021000 <ME,CE> CR: 24442048 XER: 00000000
TASK = c0518350[0] 'swapper' THREAD: c0544000
GPR00: 00000000 effeffa0 c0518350 00000020 ef0be000 ef005000 80000000 00000200
GPR08: c03b5d00 00000000 f1010080 ef08d458 000dda96 00000000 3ffb2900 00000000
GPR16: 00000000 3ffa8948 3fff1314 3ffac3f8 00000000 00000000 00000000 00000000
GPR24: 00000000 00000000 00000000 c0530000 00000000 00000000 00000020 ef3709c0
NIP [00000000] (null)
LR [c0072fbc] handle_IRQ_event+0x4c/0x12c
Call Trace:
[effeffa0] [c0019414] qe_ic_mask_irq+0x1c/0x90 (unreliable)
[effeffc0] [c0075b74] handle_level_irq+0x88/0x128
[effeffd0] [c001ca44] qe_ic_cascade_muxed_mpic+0x50/0x88
[effefff0] [c000d5fc] call_handle_irq+0x18/0x28
[c0545ea0] [c0004f3c] do_IRQ+0xa8/0x140
[c0545ed0] [c000e2bc] ret_from_except+0x0/0x18
-- Exception: 501 at cpu_idle+0x9c/0xdc
LR = cpu_idle+0x9c/0xdc
[c0545f90] [c0008318] cpu_idle+0x54/0xdc (unreliable)
[c0545fb0] [c000231c] rest_init+0x68/0x7c
[c0545fc0] [c04e686c] start_kernel+0x230/0x2b0
[c0545ff0] [c000039c] skpinv+0x2b4/0x2f0
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
Kernel panic - not syncing: Fatal exception in interrupt
Rebooting in 180 seconds..
]
Then the natural solution would be 'stop driver/device then adjust
ring buffer parameter then reactivate driver/device'.
Signed-off-by: Liang Li <liang.li@windriver.com>
---
drivers/net/ucc_geth.c | 4 ++--
drivers/net/ucc_geth.h | 2 ++
drivers/net/ucc_geth_ethtool.c | 17 +++++++++++------
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 1b0aef3..9779185 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3485,7 +3485,7 @@ err:
/* Called when something needs to use the ethernet device */
/* Returns 0 for success. */
-static int ucc_geth_open(struct net_device *dev)
+int ucc_geth_open(struct net_device *dev)
{
struct ucc_geth_private *ugeth = netdev_priv(dev);
int err;
@@ -3542,7 +3542,7 @@ err:
}
/* Stops the kernel queue, and halts the controller */
-static int ucc_geth_close(struct net_device *dev)
+int ucc_geth_close(struct net_device *dev)
{
struct ucc_geth_private *ugeth = netdev_priv(dev);
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index ef1fbeb..f5cb874 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -1235,5 +1235,7 @@ int init_flow_control_params(u32 automatic_flow_control_mode,
u32 __iomem *upsmr_register, u32 __iomem *uempr_register,
u32 __iomem *maccfg1_register);
+extern int ucc_geth_open(struct net_device *);
+extern int ucc_geth_close(struct net_device *);
#endif /* __UCC_GETH_H__ */
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index 6f92e48..1b37aaa 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -255,13 +255,18 @@ uec_set_ringparam(struct net_device *netdev,
return -EINVAL;
}
- ug_info->bdRingLenRx[queue] = ring->rx_pending;
- ug_info->bdRingLenTx[queue] = ring->tx_pending;
-
if (netif_running(netdev)) {
- /* FIXME: restart automatically */
- printk(KERN_INFO
- "Please re-open the interface.\n");
+ printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
+ ucc_geth_close(netdev);
+
+ ug_info->bdRingLenRx[queue] = ring->rx_pending;
+ ug_info->bdRingLenTx[queue] = ring->tx_pending;
+
+ printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);
+ ucc_geth_open(netdev);
+ } else {
+ ug_info->bdRingLenRx[queue] = ring->rx_pending;
+ ug_info->bdRingLenTx[queue] = ring->tx_pending;
}
return ret;
--
1.7.2
^ permalink raw reply related
* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Esben Haabendal @ 2010-08-30 16:04 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linux-mmc, Andrew Morton, David Brownell, linuxppc-dev
In-Reply-To: <20100830132914.GA32266@oksana.dev.rtsoft.ru>
[-- Attachment #1: Type: text/plain, Size: 2232 bytes --]
Hi
Comments below, and updated patch attached.
On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov <cbouatmailru@gmail.com> wrote:
>>> +static int of_mmc_spi_init(struct device *dev,
>> + irqreturn_t (*irqhandler)(int, void *), void *mmc)
>> +{
>> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
>
> Please add an empty line here.
Ok.
>> + return request_threaded_irq(
>> + oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);
>
> I'd write it this way:
>
> return request_threaded_irq(oms->detect_irq, NULL, irqhandler,
> 0, dev_name(dev), mmc);
>
> But that's a matter of taste.
Fine with me.
>> +}
>> +
>> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
>> +{
>> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
>
> Empty line.
Ok.
>> + free_irq(oms->detect_irq, mmc);
>> +}
>> +
>> struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>> {
>> struct device *dev = &spi->dev;
>> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
>> *mmc_spi_get_pdata(struct spi_device *spi)
>> if (gpio_is_valid(oms->gpios[WP_GPIO]))
>> oms->pdata.get_ro = of_mmc_spi_get_ro;
>>
>> - /* We don't support interrupts yet, let's poll. */
>> - oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
>> + oms->detect_irq = irq_of_parse_and_map(np, 0);
>> + if (oms->detect_irq != NO_IRQ) {
>
> I'd write "if (oms->detect_irq)", which is a bit more natural
> (and still correct, 0 is the only invalid VIRQ number).
Most other architectures has NO_IRQ defined to -1, so I will stick
with the NO_IRQ comparsion.
Hopefully, arm users will soon enjoy this driver/wrapper soon also.
>> + oms->pdata.init = of_mmc_spi_init;
>> + oms->pdata.exit = of_mmc_spi_exit;
>> + }
>> + else {
>
> } else {
Done.
> Plus, please add an appropriate interrupts = <> bindings into
> Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.
Done.
> And on the next resend, be sure to add Andrew Morton
> <akpm@linux-foundation.org>, David Brownell
> <dbrownell@users.sourceforge.net>, and linux-mmc@vger.kernel.org
> the Cc list.
Should be there now.
/Esben
[-- Attachment #2: 0001-of_mmc_spi-add-card-detect-irq-support.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]
of_mmc_spi: add card detect irq support
Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
.../powerpc/dts-bindings/mmc-spi-slot.txt | 9 ++++++-
drivers/mmc/host/of_mmc_spi.c | 26 ++++++++++++++++++-
2 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
index c39ac28..89a0084 100644
--- a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
+++ b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
@@ -7,8 +7,13 @@ Required properties:
- voltage-ranges : two cells are required, first cell specifies minimum
slot voltage (mV), second cell specifies maximum slot voltage (mV).
Several ranges could be specified.
-- gpios : (optional) may specify GPIOs in this order: Card-Detect GPIO,
+
+Optional properties:
+- gpios : may specify GPIOs in this order: Card-Detect GPIO,
Write-Protect GPIO.
+- interrupts : the interrupt of a card detect interrupt.
+- interrupt-parent : the phandle for the interrupt controller that
+ services interrupts for this device.
Example:
@@ -20,4 +25,6 @@ Example:
&qe_pio_d 15 0>;
voltage-ranges = <3300 3300>;
spi-max-frequency = <50000000>;
+ interrupts = <42>;
+ interrupt-parent = <&PIC>;
};
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index 1247e5d..5530def 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -34,6 +34,7 @@ enum {
struct of_mmc_spi {
int gpios[NUM_GPIOS];
bool alow_gpios[NUM_GPIOS];
+ int detect_irq;
struct mmc_spi_platform_data pdata;
};
@@ -61,6 +62,22 @@ static int of_mmc_spi_get_ro(struct device *dev)
return of_mmc_spi_read_gpio(dev, WP_GPIO);
}
+static int of_mmc_spi_init(struct device *dev,
+ irqreturn_t (*irqhandler)(int, void *), void *mmc)
+{
+ struct of_mmc_spi *oms = to_of_mmc_spi(dev);
+
+ return request_threaded_irq(oms->detect_irq, NULL, irqhandler, 0,
+ dev_name(dev), mmc);
+}
+
+static void of_mmc_spi_exit(struct device *dev, void *mmc)
+{
+ struct of_mmc_spi *oms = to_of_mmc_spi(dev);
+
+ free_irq(oms->detect_irq, mmc);
+}
+
struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
{
struct device *dev = &spi->dev;
@@ -121,8 +138,13 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
if (gpio_is_valid(oms->gpios[WP_GPIO]))
oms->pdata.get_ro = of_mmc_spi_get_ro;
- /* We don't support interrupts yet, let's poll. */
- oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
+ oms->detect_irq = irq_of_parse_and_map(np, 0);
+ if (oms->detect_irq != NO_IRQ) {
+ oms->pdata.init = of_mmc_spi_init;
+ oms->pdata.exit = of_mmc_spi_exit;
+ } else {
+ oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
+ }
dev->platform_data = &oms->pdata;
return dev->platform_data;
--
1.7.1.1
^ permalink raw reply related
* [PATCH] powerpc/kvm/e500_tlb: Fix a minor copy-paste tracing bug
From: Kyle Moffett @ 2010-08-30 15:38 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev, Kyle Moffett, Liu Yu, Kyle Moffett, kvm-ppc
In-Reply-To: <1282936005-17078-1-git-send-email-Kyle.D.Moffett@boeing.com>
The kvmppc_e500_stlbe_invalidate() function was trying to pass too many
parameters to trace_kvm_stlb_inval(). This appears to be a bad
copy-paste from a call to trace_kvm_stlb_write().
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
Alex,
This is the rebased patch to re-enable the tracepoint.
I also pushed a tree with this patch on top of kvm-ppc-next out to:
git://opensource.exmeritus.com/hww-1u-1a/linux.git kvm-ppc-patches
http://opensource.exmeritus.com/git/hww-1u-1a/linux.git/kvm-ppc-patches
Thanks again!
Cheers,
Kyle Moffett
---
arch/powerpc/kvm/e500_tlb.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index 66845a5..a413883 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -226,11 +226,7 @@ static void kvmppc_e500_stlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
kvmppc_e500_shadow_release(vcpu_e500, tlbsel, esel);
stlbe->mas1 = 0;
- /* XXX doesn't compile */
-#if 0
- trace_kvm_stlb_inval(index_of(tlbsel, esel), stlbe->mas1, stlbe->mas2,
- stlbe->mas3, stlbe->mas7);
-#endif
+ trace_kvm_stlb_inval(index_of(tlbsel, esel));
}
static void kvmppc_e500_tlb1_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Anton Vorontsov @ 2010-08-30 13:29 UTC (permalink / raw)
To: Esben Haabendal; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikH+H6+sXN_hcfm_guvUwgM-NKQ83nCwgAk-23G@mail.gmail.com>
Hello,
The patch looks mostly good. A few cosmetic issues down below.
On Mon, Aug 30, 2010 at 02:04:59PM +0200, Esben Haabendal wrote:
Please add some change log, a couple of sentences would work.
> Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
> ---
> drivers/mmc/host/of_mmc_spi.c | 25 +++++++++++++++++++++++--
> 1 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
> index 1247e5d..e872b61 100644
> --- a/drivers/mmc/host/of_mmc_spi.c
> +++ b/drivers/mmc/host/of_mmc_spi.c
> @@ -34,6 +34,7 @@ enum {
> struct of_mmc_spi {
> int gpios[NUM_GPIOS];
> bool alow_gpios[NUM_GPIOS];
> + int detect_irq;
> struct mmc_spi_platform_data pdata;
> };
>
> @@ -61,6 +62,20 @@ static int of_mmc_spi_get_ro(struct device *dev)
> return of_mmc_spi_read_gpio(dev, WP_GPIO);
> }
>
> +static int of_mmc_spi_init(struct device *dev,
> + irqreturn_t (*irqhandler)(int, void *), void *mmc)
> +{
> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
Please add an empty line here.
> + return request_threaded_irq(
> + oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);
I'd write it this way:
return request_threaded_irq(oms->detect_irq, NULL, irqhandler,
0, dev_name(dev), mmc);
But that's a matter of taste.
> +}
> +
> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
> +{
> + struct of_mmc_spi *oms = to_of_mmc_spi(dev);
Empty line.
> + free_irq(oms->detect_irq, mmc);
> +}
> +
> struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
> {
> struct device *dev = &spi->dev;
> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
> *mmc_spi_get_pdata(struct spi_device *spi)
> if (gpio_is_valid(oms->gpios[WP_GPIO]))
> oms->pdata.get_ro = of_mmc_spi_get_ro;
>
> - /* We don't support interrupts yet, let's poll. */
> - oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
> + oms->detect_irq = irq_of_parse_and_map(np, 0);
> + if (oms->detect_irq != NO_IRQ) {
I'd write "if (oms->detect_irq)", which is a bit more natural
(and still correct, 0 is the only invalid VIRQ number).
> + oms->pdata.init = of_mmc_spi_init;
> + oms->pdata.exit = of_mmc_spi_exit;
> + }
> + else {
} else {
Plus, please add an appropriate interrupts = <> bindings into
Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.
And on the next resend, be sure to add Andrew Morton
<akpm@linux-foundation.org>, David Brownell
<dbrownell@users.sourceforge.net>, and linux-mmc@vger.kernel.org
the Cc list.
Thanks!
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* [PATCH] of_mmc_spi: add card detect irq support
From: Esben Haabendal @ 2010-08-30 12:04 UTC (permalink / raw)
To: linuxppc-dev
Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
drivers/mmc/host/of_mmc_spi.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index 1247e5d..e872b61 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -34,6 +34,7 @@ enum {
struct of_mmc_spi {
int gpios[NUM_GPIOS];
bool alow_gpios[NUM_GPIOS];
+ int detect_irq;
struct mmc_spi_platform_data pdata;
};
@@ -61,6 +62,20 @@ static int of_mmc_spi_get_ro(struct device *dev)
return of_mmc_spi_read_gpio(dev, WP_GPIO);
}
+static int of_mmc_spi_init(struct device *dev,
+ irqreturn_t (*irqhandler)(int, void *), void *mm=
c)
+{
+ struct of_mmc_spi *oms =3D to_of_mmc_spi(dev);
+ return request_threaded_irq(
+ oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);
+}
+
+static void of_mmc_spi_exit(struct device *dev, void *mmc)
+{
+ struct of_mmc_spi *oms =3D to_of_mmc_spi(dev);
+ free_irq(oms->detect_irq, mmc);
+}
+
struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
{
struct device *dev =3D &spi->dev;
@@ -121,8 +136,14 @@ struct mmc_spi_platform_data
*mmc_spi_get_pdata(struct spi_device *spi)
if (gpio_is_valid(oms->gpios[WP_GPIO]))
oms->pdata.get_ro =3D of_mmc_spi_get_ro;
- /* We don't support interrupts yet, let's poll. */
- oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
+ oms->detect_irq =3D irq_of_parse_and_map(np, 0);
+ if (oms->detect_irq !=3D NO_IRQ) {
+ oms->pdata.init =3D of_mmc_spi_init;
+ oms->pdata.exit =3D of_mmc_spi_exit;
+ }
+ else {
+ oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
+ }
dev->platform_data =3D &oms->pdata;
return dev->platform_data;
--=20
1.7.1.1
--=20
Esben Haabendal, Senior Software Consultant
Dor=E9Development ApS, Ved Stranden 1, 9560 Hadsund, DK-Denmark
Phone: +45 51 92 53 93, E-mail: eha@doredevelopment.dk
WWW: http://www.doredevelopment.dk
^ permalink raw reply related
* Re: MPC85xx - accessing external interrupt
From: tiejun.chen @ 2010-08-30 7:36 UTC (permalink / raw)
To: deebul nair; +Cc: linuxppc-dev
In-Reply-To: <AANLkTim5FXeRvx2TiPMGSkwqdbOeei6bL5PebK7+toLZ@mail.gmail.com>
deebul nair wrote:
> Hi all
>
> I am trying to use the external interrupts on the Powerpc architecture
> MPC8542 .
>
> My problem is that my driver is trying to request the external
> interrupt IRQ1, and I dont know what number use in INTR_NUM:
>
> request_irq(INTR_NUM, , , , )
>
> As per the MPC85xx documentation
> Documentation/powerpc/dts-bindings/fsl/mpic.txt
> about the implementation of interrupts virtual numbers
> the external interrupt virtual irq number for IRQ1 should be 1
>
> but when i try to give INTR_NUM ins request_irq as 1 it gives error .
>
> When i use irq_create_mapping() it gives me output as 16.. and it registers
> .. but the problem is it is not fixed
> neither it gives interrupts .
> when i remove and add it registers to some other addresses
>
> i even tried irq_of_parse_map()
>
> for_each_node_by_type(np,"interrupt-controller"){
> if(of_device_is_compatible(np,"chrp,open-pic")){
> found=np;
> break;
> }
> }
>
> virq = irq_of_parse_and_map(found, irq);
>
> this always returns 0
> whatever may be the irq value..
> as a result the driver gives error for irq 0
Anyway the following path should be the correct path:
request_irq(virq)
|
+ virq = irq_of_parse_and_map(hw_irq)
|
+ We get this from the dts file.
So you should define the appropriate node for your device. Then convert your
hw_irq to vir_irq via irq_of_parse_and_map() to pass that to reuest_irq() on
your device driver. Sometime this process is wrapped by some functions so I
recommend you refer to the files on the directory, arch/powerpc/sysdev/.
But I think the root cause to your problem is that you cannot pass the proper
arguments to irq_of_parse_and_map().
------
unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
You should do this like the following:
------
struct device_node *np;
unsigned int virq;
np = of_find_compatible_node(NULL, NULL, "<the compatible property of your
device node on dts>");
if (np) {
irq_of_parse_and_map(np, 0);
}
request_irq(virq,......);
Here I assume you have only one irq property so set 'index' as '0' on the
function, irq_of_parse_and_map().
Cheers
Tiejun
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] KVM: PPC: Fix CONFIG_KVM_GUEST && !CONFIG_KVM case
From: Avi Kivity @ 2010-08-30 10:55 UTC (permalink / raw)
To: Alexander Graf; +Cc: linuxppc-dev, KVM list, kvm-ppc
In-Reply-To: <1283162516-29879-1-git-send-email-agraf@suse.de>
On 08/30/2010 01:01 PM, Alexander Graf wrote:
> When CONFIG_KVM_GUEST is selected, but CONFIG_KVM is not, we were missing
> some defines in asm-offsets.c and included too many headers at other places.
>
> This patch makes above configuration work.
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply
* [PATCH] KVM: PPC: Fix CONFIG_KVM_GUEST && !CONFIG_KVM case
From: Alexander Graf @ 2010-08-30 10:01 UTC (permalink / raw)
To: kvm-ppc; +Cc: linuxppc-dev, KVM list
When CONFIG_KVM_GUEST is selected, but CONFIG_KVM is not, we were missing
some defines in asm-offsets.c and included too many headers at other places.
This patch makes above configuration work.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/kernel/asm-offsets.c | 6 +++---
arch/powerpc/kernel/kvm.c | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 5e54d0f..893ba35 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -48,11 +48,11 @@
#ifdef CONFIG_PPC_ISERIES
#include <asm/iseries/alpaca.h>
#endif
-#ifdef CONFIG_KVM
+#if defined(CONFIG_KVM) || defined(CONFIG_KVM_GUEST)
#include <linux/kvm_host.h>
-#ifndef CONFIG_BOOKE
-#include <asm/kvm_book3s.h>
#endif
+#if defined(CONFIG_KVM) && defined(CONFIG_PPC_BOOK3S)
+#include <asm/kvm_book3s.h>
#endif
#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 293765a..428d0e5 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -25,7 +25,6 @@
#include <linux/of.h>
#include <asm/reg.h>
-#include <asm/kvm_ppc.h>
#include <asm/sections.h>
#include <asm/cacheflush.h>
#include <asm/disassemble.h>
--
1.6.0.2
^ permalink raw reply related
* Re: Power machines fail to boot after build being successful
From: divya @ 2010-08-30 7:35 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, linux-next, LKML
In-Reply-To: <21473.1283150987@neuling.org>
On Monday 30 August 2010 12:19 PM, Michael Neuling wrote:
> In message<4C7B4C1F.7010003@linux.vnet.ibm.com> you wrote:
>
>> On Friday 27 August 2010 07:31 AM, Stephen Rothwell wrote:
>>
>>> Hi Mikey,
>>>
>>> On Fri, 27 Aug 2010 11:15:46 +1000 Michael Neuling<mikey@neuling.org> wrot
>>>
> e:
>
>>>
>>>
>>>>
>>>>
>>>>> After successfully building the kernel version
>>>>> 2.6.36-rc2-git4(commitid d4348c678977c) with the config file
>>>>> attached(used make oldconfig), P5 and P6 power machines fails to
>>>>> reboot with the following logs
>>>>>
>>>>> Logs collected while rebooting into today next, same occurs with the
>>>>> upstream kernel too.
>>>>>
>>>>>
>>>> This will fix your problem:
>>>> http://patchwork.ozlabs.org/patch/62757/
>>>>
>>>>
>>> I have seen something similar in my linux-next boot tests, so I will add
>>> this patch to linux-next for today.
>>>
>>>
>> Hi,
>>
>> The same problem occurs on the linux-tree , now that since the patch
>> is integrated into linux-next, im not able to find the problem with
>> linux-next-20100827.
>>
>> When will the patch be integrated with the linux-tree.
>>
> By "the linux-tree" do you mean Linus' tree?
>
> If so, benh is likely to ask Linus to pull the fix in the next few days.
>
> Mikey
>
Yes i mean to say Linus' tree.ccing benh.
Divya
^ 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