diff options
Diffstat (limited to 'arch/powerpc/sysdev')
| -rw-r--r-- | arch/powerpc/sysdev/Kconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/Makefile | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/cpm1.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/cpm2_pic.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_rio.c | 17 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_rmu.c | 8 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/fsl_soc.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/ge/ge_pic.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/micropatch.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mpc5xxx_clocks.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/mv64x60.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/simple_gpio.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xics/Kconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xics/Makefile | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xics/ics-rtas.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xive/Kconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xive/common.c | 8 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/xive/spapr.c | 4 | 
18 files changed, 49 insertions, 2 deletions
| diff --git a/arch/powerpc/sysdev/Kconfig b/arch/powerpc/sysdev/Kconfig index caf882e749dc..bcef2ac56479 100644 --- a/arch/powerpc/sysdev/Kconfig +++ b/arch/powerpc/sysdev/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  # For a description of the syntax of this configuration file,  # see Documentation/kbuild/kconfig-language.txt.  # diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 79416fa2e3ba..0baba21404dc 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror  ccflags-$(CONFIG_PPC64)		:= $(NO_MINIMAL_TOC) diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c index c651e668996b..c6f154b602fb 100644 --- a/arch/powerpc/sysdev/cpm1.c +++ b/arch/powerpc/sysdev/cpm1.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * General Purpose functions for the global management of the   * Communication Processor Module. diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/cpm2_pic.h index 2c5f70c24485..a8a26951f311 100644 --- a/arch/powerpc/sysdev/cpm2_pic.h +++ b/arch/powerpc/sysdev/cpm2_pic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef _PPC_KERNEL_CPM2_H  #define _PPC_KERNEL_CPM2_H diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 9234be1e66f5..5011ffea4e4b 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -71,6 +71,8 @@  #define RIWAR_WRTYP_ALLOC	0x00006000  #define RIWAR_SIZE_MASK		0x0000003F +static DEFINE_SPINLOCK(fsl_rio_config_lock); +  #define __fsl_read_rio_config(x, addr, err, op)		\  	__asm__ __volatile__(				\  		"1:	"op" %1,0(%2)\n"		\ @@ -184,6 +186,7 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,  			u8 hopcount, u32 offset, int len, u32 *val)  {  	struct rio_priv *priv = mport->priv; +	unsigned long flags;  	u8 *data;  	u32 rval, err = 0; @@ -197,6 +200,8 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,  	if (offset > (0x1000000 - len) || !IS_ALIGNED(offset, len))  		return -EINVAL; +	spin_lock_irqsave(&fsl_rio_config_lock, flags); +  	out_be32(&priv->maint_atmu_regs->rowtar,  		 (destid << 22) | (hopcount << 12) | (offset >> 12));  	out_be32(&priv->maint_atmu_regs->rowtear, (destid >> 10)); @@ -213,6 +218,7 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,  		__fsl_read_rio_config(rval, data, err, "lwz");  		break;  	default: +		spin_unlock_irqrestore(&fsl_rio_config_lock, flags);  		return -EINVAL;  	} @@ -221,6 +227,7 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,  			 err, destid, hopcount, offset);  	} +	spin_unlock_irqrestore(&fsl_rio_config_lock, flags);  	*val = rval;  	return err; @@ -244,7 +251,10 @@ fsl_rio_config_write(struct rio_mport *mport, int index, u16 destid,  			u8 hopcount, u32 offset, int len, u32 val)  {  	struct rio_priv *priv = mport->priv; +	unsigned long flags;  	u8 *data; +	int ret = 0; +  	pr_debug  		("fsl_rio_config_write:"  		" index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n", @@ -255,6 +265,8 @@ fsl_rio_config_write(struct rio_mport *mport, int index, u16 destid,  	if (offset > (0x1000000 - len) || !IS_ALIGNED(offset, len))  		return -EINVAL; +	spin_lock_irqsave(&fsl_rio_config_lock, flags); +  	out_be32(&priv->maint_atmu_regs->rowtar,  		 (destid << 22) | (hopcount << 12) | (offset >> 12));  	out_be32(&priv->maint_atmu_regs->rowtear, (destid >> 10)); @@ -271,10 +283,11 @@ fsl_rio_config_write(struct rio_mport *mport, int index, u16 destid,  		out_be32((u32 *) data, val);  		break;  	default: -		return -EINVAL; +		ret = -EINVAL;  	} +	spin_unlock_irqrestore(&fsl_rio_config_lock, flags); -	return 0; +	return ret;  }  static void fsl_rio_inbound_mem_init(struct rio_priv *priv) diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index ab7a74c75be8..88b35a3dcdc5 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -104,6 +104,8 @@  #define DOORBELL_MESSAGE_SIZE	0x08 +static DEFINE_SPINLOCK(fsl_rio_doorbell_lock); +  struct rio_msg_regs {  	u32 omr;  	u32 osr; @@ -626,9 +628,13 @@ err_out:  int fsl_rio_doorbell_send(struct rio_mport *mport,  				int index, u16 destid, u16 data)  { +	unsigned long flags; +  	pr_debug("fsl_doorbell_send: index %d destid %4.4x data %4.4x\n",  		 index, destid, data); +	spin_lock_irqsave(&fsl_rio_doorbell_lock, flags); +  	/* In the serial version silicons, such as MPC8548, MPC8641,  	 * below operations is must be.  	 */ @@ -638,6 +644,8 @@ int fsl_rio_doorbell_send(struct rio_mport *mport,  	out_be32(&dbell->dbell_regs->oddatr, (index << 20) | data);  	out_be32(&dbell->dbell_regs->odmr, 0x00000001); +	spin_unlock_irqrestore(&fsl_rio_doorbell_lock, flags); +  	return 0;  } diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h index 2640446f8bc4..db11b06eb38f 100644 --- a/arch/powerpc/sysdev/fsl_soc.h +++ b/arch/powerpc/sysdev/fsl_soc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef __PPC_FSL_SOC_H  #define __PPC_FSL_SOC_H  #ifdef __KERNEL__ diff --git a/arch/powerpc/sysdev/ge/ge_pic.h b/arch/powerpc/sysdev/ge/ge_pic.h index 5bf7e4b81e36..923dedba3c9c 100644 --- a/arch/powerpc/sysdev/ge/ge_pic.h +++ b/arch/powerpc/sysdev/ge/ge_pic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef __GEF_PIC_H__  #define __GEF_PIC_H__ diff --git a/arch/powerpc/sysdev/micropatch.c b/arch/powerpc/sysdev/micropatch.c index 6727dc54d549..33a9042fca80 100644 --- a/arch/powerpc/sysdev/micropatch.c +++ b/arch/powerpc/sysdev/micropatch.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /* Microcode patches for the CPM as supplied by Motorola.   * This is the one for IIC/SPI.  There is a newer one that diff --git a/arch/powerpc/sysdev/mpc5xxx_clocks.c b/arch/powerpc/sysdev/mpc5xxx_clocks.c index 573292663cf2..834a6d7fbd88 100644 --- a/arch/powerpc/sysdev/mpc5xxx_clocks.c +++ b/arch/powerpc/sysdev/mpc5xxx_clocks.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /**   * 	mpc5xxx_get_bus_frequency - Find the bus frequency for a device   * 	@node:	device node diff --git a/arch/powerpc/sysdev/mv64x60.h b/arch/powerpc/sysdev/mv64x60.h index 4f618fa465c0..60cfcb90d1fa 100644 --- a/arch/powerpc/sysdev/mv64x60.h +++ b/arch/powerpc/sysdev/mv64x60.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef __MV64X60_H__  #define __MV64X60_H__ diff --git a/arch/powerpc/sysdev/simple_gpio.h b/arch/powerpc/sysdev/simple_gpio.h index 3a7b0c513c76..f3f3a20d39e2 100644 --- a/arch/powerpc/sysdev/simple_gpio.h +++ b/arch/powerpc/sysdev/simple_gpio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef __SYSDEV_SIMPLE_GPIO_H  #define __SYSDEV_SIMPLE_GPIO_H diff --git a/arch/powerpc/sysdev/xics/Kconfig b/arch/powerpc/sysdev/xics/Kconfig index 385e7aa9e273..86fee428f5f1 100644 --- a/arch/powerpc/sysdev/xics/Kconfig +++ b/arch/powerpc/sysdev/xics/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  config PPC_XICS         def_bool n         select PPC_SMP_MUXED_IPI diff --git a/arch/powerpc/sysdev/xics/Makefile b/arch/powerpc/sysdev/xics/Makefile index 5d7f5a6564de..5d438d92472b 100644 --- a/arch/powerpc/sysdev/xics/Makefile +++ b/arch/powerpc/sysdev/xics/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror  obj-y				+= xics-common.o diff --git a/arch/powerpc/sysdev/xics/ics-rtas.c b/arch/powerpc/sysdev/xics/ics-rtas.c index 78ee5c778ef8..42e0c56ff81c 100644 --- a/arch/powerpc/sysdev/xics/ics-rtas.c +++ b/arch/powerpc/sysdev/xics/ics-rtas.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #include <linux/types.h>  #include <linux/kernel.h>  #include <linux/irq.h> diff --git a/arch/powerpc/sysdev/xive/Kconfig b/arch/powerpc/sysdev/xive/Kconfig index 3e3e25b5e30d..70ee976e1de0 100644 --- a/arch/powerpc/sysdev/xive/Kconfig +++ b/arch/powerpc/sysdev/xive/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  config PPC_XIVE  	bool  	default n diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index f387318678b9..a3b8d7d1316e 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -1402,6 +1402,14 @@ void xive_teardown_cpu(void)  	if (xive_ops->teardown_cpu)  		xive_ops->teardown_cpu(cpu, xc); + +#ifdef CONFIG_SMP +	/* Get rid of IPI */ +	xive_cleanup_cpu_ipi(cpu, xc); +#endif + +	/* Disable and free the queues */ +	xive_cleanup_cpu_queues(cpu, xc);  }  void xive_kexec_teardown_cpu(int secondary) diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index f24a70bc6855..d9c4c9366049 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -431,7 +431,11 @@ static int xive_spapr_get_ipi(unsigned int cpu, struct xive_cpu *xc)  static void xive_spapr_put_ipi(unsigned int cpu, struct xive_cpu *xc)  { +	if (!xc->hw_ipi) +		return; +  	xive_irq_bitmap_free(xc->hw_ipi); +	xc->hw_ipi = 0;  }  #endif /* CONFIG_SMP */ |