powerpc/mpic_msgr: fix compile error when SMP disabled
Subsystems (2)
PATCH 1/4 powerpc/mpic_msgr: fix compile error when SMP disabled
In file included from arch/powerpc/sysdev/mpic_msgr.c:20:0:~/arch/powerpc/include/asm/mpic_msgr.h: In function 'mpic_msgr_set_destination':~/arch/powerpc/include/asm/mpic_msgr.h:117:2:
error: implicit declaration of function 'get_hard_smp_processor_id' make[1]: *** [arch/powerpc/sysdev/mpic_msgr.o] Error 1
--- arch/powerpc/include/asm/mpic_msgr.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/mpic_msgr.h +1 -0
@@ -13,6 +13,7 @@#include <linux/types.h> #include <linux/spinlock.h> +#include <asm/smp.h> struct mpic_msgr {u32 __iomem *base;
Signature · 1 line
1.7.5.1
PATCH 2/4 powerpc/mpic_msgr: add lock for MPIC message global variable
Also fix issue of accessing invalid msgr pointer issue. The local msgr pointer in fucntion mpic_msgr_get will be accessed before getting a valid address which will cause kernel crash.
--- arch/powerpc/sysdev/mpic_msgr.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/sysdev/mpic_msgr.c +5 -5
@@ -27,6 +27,7 @@static struct mpic_msgr **mpic_msgrs;static unsigned int mpic_msgr_count; +static DEFINE_RAW_SPINLOCK (msgrs_lock);static inline void _mpic_msgr_mer_write (struct mpic_msgr *msgr,u32 value) {
@@ -56,12 +57,11 @@ struct mpic_msgr *mpic_msgr_get(unsigned int reg_num)if (reg_num >= mpic_msgr_count)return ERR_PTR (-ENODEV ); -raw_spin_lock_irqsave (&msgr->lock, flags); -if (mpic_msgrs[reg_num]->in_use ==MSGR_FREE ) { - msgr = mpic_msgrs[reg_num]; +raw_spin_lock_irqsave (&msgrs_lock, flags); + msgr = mpic_msgrs[reg_num]; +if (msgr->in_use ==MSGR_FREE ) msgr->in_use =MSGR_INUSE ; - } -raw_spin_unlock_irqrestore (&msgr->lock, flags); +raw_spin_unlock_irqrestore (&msgrs_lock, flags);return msgr; }
Signature · 1 line
1.7.5.1
PATCH 3/4 powerpc/mpic_msgr: fix offset error when setting mer register
--- arch/powerpc/sysdev/mpic_msgr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/mpic_msgr.c +1 -1
@@ -228,7 +228,7 @@ static __devinit int mpic_msgr_probe(struct platform_device *dev) reg_number = block_number *MPIC_MSGR_REGISTERS_PER_BLOCK + i; msgr->base = msgr_block_addr + i *MPIC_MSGR_STRIDE ; - msgr->mer = msgr->base +MPIC_MSGR_MER_OFFSET ; + msgr->mer = (u32 *)((u8 *)msgr->base +MPIC_MSGR_MER_OFFSET ); msgr->in_use =MSGR_FREE ; msgr->num = i;raw_spin_lock_init (&msgr->lock);
Signature · 1 line
1.7.5.1
PATCH 4/4 powerpc/mpc85xx: add MPIC message dts node
--- arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi | 43 +++++++++++++++++++++ arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi | 10 +++++ 2 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi
arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi new file +43 -0
@@ -0,0 +1,43 @@ +/* + * PQ3 MPIC Message (Group B) device tree stub [ controller @ offset 0x42400 ] + * + * Copyright 2012 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +message@42400 { + compatible = "fsl,mpic-v3.1-msgr"; + reg = <0x42400 0x200>; + interrupts = < + 0xb4 2 0 0 + 0xb5 2 0 0 + 0xb6 2 0 0 + 0xb7 2 0 0>; +};
arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi +10 -0
@@ -53,6 +53,16 @@ timer@41100 { 3 0 3 0>; }; +message@41400 { + compatible = "fsl,mpic-v3.1-msgr"; + reg = <0x41400 0x200>; + interrupts = < + 0xb0 2 0 0 + 0xb1 2 0 0 + 0xb2 2 0 0 + 0xb3 2 0 0>; +}; + msi@41600 { compatible = "fsl,mpic-msi"; reg = <0x41600 0x80>;
Signature · 1 line
1.7.5.1
Kumar Gala
AppliedRe: [PATCH 4/4] powerpc/mpc85xx: add MPIC message dts node
Quoted 3 lines · Mingkai Hu
Signed-off-by Mingkai Hu <[email protected]>---
arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi| 43 =
+++++++++++++++++++++
Quoted 3 lines
arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi| 10 +++++2 files changed, 53 insertions(+), 0 deletions(-)create mode 100644
arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi
applied to merge
- k=
Kumar Gala
AppliedRe: [PATCH 3/4] powerpc/mpic_msgr: fix offset error when setting mer register
In reply to Mingkai HuQuoted 4 lines · Mingkai Hu
Signed-off-by Mingkai Hu <[email protected]>---
arch/powerpc/sysdev/mpic_msgr.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)
applied to merge
- k
Kumar Gala
AppliedRe: [PATCH 2/4] powerpc/mpic_msgr: add lock for MPIC message global variable
In reply to Mingkai HuQuoted 8 lines · Mingkai Hu
Also fix issue of accessing invalid msgr pointer issue. The local msgr pointer in fucntion
mpic_msgr_getwill be accessed before getting a valid address which will cause kernel crash.Signed-off-by Mingkai Hu <[email protected]>---
arch/powerpc/sysdev/mpic_msgr.c| 10 +++++-----1 files changed, 5 insertions(+), 5 deletions(-)
applied to merge
- k
Kumar Gala
AppliedQuoted 2 lines · Mingkai Hu
In file included from
arch/powerpc/sysdev/mpic_msgr.c:20:0:~/arch/powerpc/include/asm/mpic_msgr.h: In function =
'mpic_msgr_set_destination':
Quoted 8 lines
~/arch/powerpc/include/asm/mpic_msgr.h:117:2:
error: implicit declaration of function 'get_hard_smp_processor_id' make[1]: *** [arch/powerpc/sysdev/mpic_msgr.o] Error 1 =20Signed-off-by Mingkai Hu <[email protected]>---
arch/powerpc/include/asm/mpic_msgr.h| 1 +1 files changed, 1 insertions(+), 0 deletions(-)
applied to merge
- k=