Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d98550e3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [PATCH] powerpc: Use the ibm,pa-features property if available
  powerpc: Fix incorrect might_sleep in __get_user/__put_user on kernel addresses
  [PATCH] ppc32 CPM_UART: fixes and improvements
  [PATCH] ppc32 CPM_UART: Fixed break send on SCC
  [PATCH] powerpc/kprobes: fix singlestep out-of-line
  [PATCH] powerpc/pseries: avoid crash in PCI code if mem system not up
parents f9cc8475 d205819e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -90,14 +90,14 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)

static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
{
	kprobe_opcode_t insn = *p->ainsn.insn;

	regs->msr |= MSR_SE;

	/* single step inline if it is a trap variant */
	if (is_trap(insn))
		regs->nip = (unsigned long)p->addr;
	else
	/*
	 * On powerpc we should single step on the original
	 * instruction even if the probed insn is a trap
	 * variant as values in regs could play a part in
	 * if the trap is taken or not
	 */
	regs->nip = (unsigned long)p->ainsn.insn;
}

+70 −0
Original line number Diff line number Diff line
@@ -885,6 +885,74 @@ void __init unflatten_device_tree(void)
	DBG(" <- unflatten_device_tree()\n");
}

/*
 * ibm,pa-features is a per-cpu property that contains a string of
 * attribute descriptors, each of which has a 2 byte header plus up
 * to 254 bytes worth of processor attribute bits.  First header
 * byte specifies the number of bytes following the header.
 * Second header byte is an "attribute-specifier" type, of which
 * zero is the only currently-defined value.
 * Implementation:  Pass in the byte and bit offset for the feature
 * that we are interested in.  The function will return -1 if the
 * pa-features property is missing, or a 1/0 to indicate if the feature
 * is supported/not supported.  Note that the bit numbers are
 * big-endian to match the definition in PAPR.
 */
static struct ibm_pa_feature {
	unsigned long	cpu_features;	/* CPU_FTR_xxx bit */
	unsigned int	cpu_user_ftrs;	/* PPC_FEATURE_xxx bit */
	unsigned char	pabyte;		/* byte number in ibm,pa-features */
	unsigned char	pabit;		/* bit number (big-endian) */
	unsigned char	invert;		/* if 1, pa bit set => clear feature */
} ibm_pa_features[] __initdata = {
	{0, PPC_FEATURE_HAS_MMU,	0, 0, 0},
	{0, PPC_FEATURE_HAS_FPU,	0, 1, 0},
	{CPU_FTR_SLB, 0,		0, 2, 0},
	{CPU_FTR_CTRL, 0,		0, 3, 0},
	{CPU_FTR_NOEXECUTE, 0,		0, 6, 0},
	{CPU_FTR_NODSISRALIGN, 0,	1, 1, 1},
	{CPU_FTR_CI_LARGE_PAGE, 0,	1, 2, 0},
};

static void __init check_cpu_pa_features(unsigned long node)
{
	unsigned char *pa_ftrs;
	unsigned long len, tablelen, i, bit;

	pa_ftrs = of_get_flat_dt_prop(node, "ibm,pa-features", &tablelen);
	if (pa_ftrs == NULL)
		return;

	/* find descriptor with type == 0 */
	for (;;) {
		if (tablelen < 3)
			return;
		len = 2 + pa_ftrs[0];
		if (tablelen < len)
			return;		/* descriptor 0 not found */
		if (pa_ftrs[1] == 0)
			break;
		tablelen -= len;
		pa_ftrs += len;
	}

	/* loop over bits we know about */
	for (i = 0; i < ARRAY_SIZE(ibm_pa_features); ++i) {
		struct ibm_pa_feature *fp = &ibm_pa_features[i];

		if (fp->pabyte >= pa_ftrs[0])
			continue;
		bit = (pa_ftrs[2 + fp->pabyte] >> (7 - fp->pabit)) & 1;
		if (bit ^ fp->invert) {
			cur_cpu_spec->cpu_features |= fp->cpu_features;
			cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
		} else {
			cur_cpu_spec->cpu_features &= ~fp->cpu_features;
			cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
		}
	}
}

static int __init early_init_dt_scan_cpus(unsigned long node,
					  const char *uname, int depth,
					  void *data)
@@ -969,6 +1037,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
	}
#endif /* CONFIG_ALTIVEC */

	check_cpu_pa_features(node);

#ifdef CONFIG_PPC_PSERIES
	if (nthreads > 1)
		cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
+8 −0
Original line number Diff line number Diff line
@@ -118,7 +118,15 @@ int eeh_send_failure_event (struct device_node *dn,
{
	unsigned long flags;
	struct eeh_event *event;
	char *location;

	if (!mem_init_done) {
		printk(KERN_ERR "EEH: event during early boot not handled\n");
		location = (char *) get_property(dn, "ibm,loc-code", NULL);
		printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
		printk(KERN_ERR "EEH: PCI location = %s\n", location);
		return 1;
	}
	event = kmalloc(sizeof(*event), GFP_ATOMIC);
	if (event == NULL) {
		printk (KERN_ERR "EEH: out of memory, event not handled\n");
+1 −1
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ int __init mpc866ads_init(void)
	ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART);
#endif

#ifdef CONFIG_SERIAL_CPM_SMCer
#ifdef CONFIG_SERIAL_CPM_SMC
	ppc_sys_device_enable(MPC8xx_CPM_SMC2);
	ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART);
#endif
+14 −5
Original line number Diff line number Diff line
@@ -5,6 +5,13 @@
 *
 *  Copyright (C) 2004 Freescale Semiconductor, Inc.
 *
 *  2006 (c) MontaVista Software, Inc.
 * 	Vitaly Bordug <vbordug@ru.mvista.com>
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2. This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 *
 */
#ifndef CPM_UART_H
#define CPM_UART_H
@@ -101,12 +108,13 @@ static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo
	int offset;
	u32 val = (u32)addr;
	/* sane check */
	if ((val >= (u32)pinfo->mem_addr) &&
	if (likely((val >= (u32)pinfo->mem_addr)) &&
			(val<((u32)pinfo->mem_addr + pinfo->mem_size))) {
		offset = val - (u32)pinfo->mem_addr;
		return pinfo->dma_addr+offset;
	}
	printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val);
	/* something nasty happened */
	BUG();
	return 0;
}

@@ -115,12 +123,13 @@ static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo
	int offset;
	u32 val = addr;
	/* sane check */
	if ((val >= pinfo->dma_addr) &&
			(val<(pinfo->dma_addr + pinfo->mem_size))) {
	if (likely((val >= pinfo->dma_addr) &&
			(val<(pinfo->dma_addr + pinfo->mem_size)))) {
		offset = val - (u32)pinfo->dma_addr;
		return (void*)(pinfo->mem_addr+offset);
	}
	printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val);
	/* something nasty happened */
	BUG();
	return 0;
}

Loading