Skip to content

Commit

Permalink
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Clean up duplicate includes in drivers/macintosh/
  [POWERPC] Quiet section mismatch warning on pcibios_setup
  [POWERPC] init and exit markings for hvc_iseries
  [POWERPC] Quiet section mismatch in hvc_rtas.c
  [POWERPC] Constify of_platform_driver match_table
  [POWERPC] hvcs: Make some things static and const
  [POWERPC] Constify of_platform_driver name
  [POWERPC] MPIC protected sources
  [POWERPC] of_detach_node()'s device node argument cannot be const
  [POWERPC] Fix ARCH=ppc builds
  [POWERPC] mv64x60: Use mutex instead of semaphore
  [POWERPC] Allow smp_call_function_single() to current cpu
  [POWERPC] Allow exec faults on readable areas on classic 32-bit PowerPC
  [POWERPC] Fix future firmware feature fixups function failure
  [POWERPC] fix showing xmon help
  [POWERPC] Make xmon_write accept a const buffer
  [POWERPC] Fix misspelled "CONFIG_CHECK_CACHE_COHERENCY" Kconfig option.
  [POWERPC] cell: CONFIG_SPE_BASE is a typo
  • Loading branch information
Linus Torvalds committed Jul 22, 2007
2 parents 0f760f1 + 7bd02a2 commit dc79747
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 56 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/configs/prpmc2800_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CONFIG_PPC_STD_MMU_32=y
# CONFIG_PPC_MM_SLICES is not set
# CONFIG_SMP is not set
CONFIG_NOT_COHERENT_CACHE=y
CONFIG_CONFIG_CHECK_CACHE_COHERENCY=y
CONFIG_CHECK_CACHE_COHERENCY=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int pcibios_add_platform_entries(struct pci_dev *pdev)

}

char __init *pcibios_setup(char *str)
char __devinit *pcibios_setup(char *str)
{
return str;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ void of_attach_node(struct device_node *np)
* a reference to the node. The memory associated with the node
* is not freed until its refcount goes to zero.
*/
void of_detach_node(const struct device_node *np)
void of_detach_node(struct device_node *np)
{
struct device_node *parent;

Expand Down
7 changes: 6 additions & 1 deletion arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,19 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
int wait)
{
cpumask_t map = CPU_MASK_NONE;
int ret = -EBUSY;
int ret = 0;

if (!cpu_online(cpu))
return -EINVAL;

cpu_set(cpu, map);
if (cpu != get_cpu())
ret = smp_call_function_map(func,info,nonatomic,wait,map);
else {
local_irq_disable();
func(info);
local_irq_enable();
}
put_cpu();
return ret;
}
Expand Down
8 changes: 7 additions & 1 deletion arch/powerpc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,13 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
/* protection fault */
if (error_code & DSISR_PROTFAULT)
goto bad_area;
if (!(vma->vm_flags & VM_EXEC))
/*
* Allow execution from readable areas if the MMU does not
* provide separate controls over reading and executing.
*/
if (!(vma->vm_flags & VM_EXEC) &&
(cpu_has_feature(CPU_FTR_NOEXECUTE) ||
!(vma->vm_flags & (VM_READ | VM_WRITE))))
goto bad_area;
#else
pte_t *ptep;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/mm/hash_utils_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp;
#endif /* CONFIG_PPC_MM_SLICES */

#ifdef CONFIG_SPE_BASE
#ifdef CONFIG_SPU_BASE
spu_flush_all_slbs(mm);
#endif
}
Expand Down Expand Up @@ -744,7 +744,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
"to 4kB pages because of "
"non-cacheable mapping\n");
psize = mmu_vmalloc_psize = MMU_PAGE_4K;
#ifdef CONFIG_SPE_BASE
#ifdef CONFIG_SPU_BASE
spu_flush_all_slbs(mm);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/Kconfig.cputype
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ config NOT_COHERENT_CACHE
depends on 4xx || 8xx || E200
default y

config CONFIG_CHECK_CACHE_COHERENCY
config CHECK_CACHE_COHERENCY
bool

endmenu
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/embedded6xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ config MPC10X_BRIDGE
config MV64X60
bool
select PPC_INDIRECT_PCI
select CONFIG_CHECK_CACHE_COHERENCY
select CHECK_CACHE_COHERENCY

config MPC10X_OPENPIC
bool
Expand Down
19 changes: 3 additions & 16 deletions arch/powerpc/platforms/pseries/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,13 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
* device-tree/ibm,hypertas-functions. Ultimately this functionality may
* be moved into prom.c prom_init().
*/
void __init fw_feature_init(void)
void __init fw_feature_init(const char *hypertas, unsigned long len)
{
struct device_node *dn;
const char *hypertas, *s;
int len, i;
const char *s;
int i;

DBG(" -> fw_feature_init()\n");

dn = of_find_node_by_path("/rtas");
if (dn == NULL) {
printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n");
goto out;
}

hypertas = of_get_property(dn, "ibm,hypertas-functions", &len);
if (hypertas == NULL)
goto out;

for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
/* check value against table of strings */
Expand All @@ -98,7 +87,5 @@ void __init fw_feature_init(void)
}
}

out:
of_node_put(dn);
DBG(" <- fw_feature_init()\n");
}
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/pseries.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef _PSERIES_PSERIES_H
#define _PSERIES_PSERIES_H

extern void __init fw_feature_init(void);
extern void __init fw_feature_init(const char *hypertas, unsigned long len);

struct pt_regs;

Expand Down
17 changes: 11 additions & 6 deletions arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ static void __init pSeries_init_early(void)
{
DBG(" -> pSeries_init_early()\n");

fw_feature_init();

if (firmware_has_feature(FW_FEATURE_LPAR))
find_udbg_vterm();

Expand All @@ -343,14 +341,21 @@ static int __init pSeries_probe_hypertas(unsigned long node,
const char *uname, int depth,
void *data)
{
const char *hypertas;
unsigned long len;

if (depth != 1 ||
(strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
return 0;
return 0;

hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
if (!hypertas)
return 1;

if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL)
powerpc_firmware_features |= FW_FEATURE_LPAR;
powerpc_firmware_features |= FW_FEATURE_LPAR;
fw_feature_init(hypertas, len);

return 1;
return 1;
}

static int __init pSeries_probe(void)
Expand Down
32 changes: 32 additions & 0 deletions arch/powerpc/sysdev/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,8 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq,

if (hw == mpic->spurious_vec)
return -EINVAL;
if (mpic->protected && test_bit(hw, mpic->protected))
return -EINVAL;

#ifdef CONFIG_SMP
else if (hw >= mpic->ipi_vecs[0]) {
Expand Down Expand Up @@ -1034,6 +1036,25 @@ struct mpic * __init mpic_alloc(struct device_node *node,
if (node && of_get_property(node, "big-endian", NULL) != NULL)
mpic->flags |= MPIC_BIG_ENDIAN;

/* Look for protected sources */
if (node) {
unsigned int psize, bits, mapsize;
const u32 *psrc =
of_get_property(node, "protected-sources", &psize);
if (psrc) {
psize /= 4;
bits = intvec_top + 1;
mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long);
mpic->protected = alloc_bootmem(mapsize);
BUG_ON(mpic->protected == NULL);
memset(mpic->protected, 0, mapsize);
for (i = 0; i < psize; i++) {
if (psrc[i] > intvec_top)
continue;
__set_bit(psrc[i], mpic->protected);
}
}
}

#ifdef CONFIG_MPIC_WEIRD
mpic->hw_set = mpic_infos[MPIC_GET_REGSET(flags)];
Expand Down Expand Up @@ -1213,6 +1234,9 @@ void __init mpic_init(struct mpic *mpic)
u32 vecpri = MPIC_VECPRI_MASK | i |
(8 << MPIC_VECPRI_PRIORITY_SHIFT);

/* check if protected */
if (mpic->protected && test_bit(i, mpic->protected))
continue;
/* init hw */
mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI), vecpri);
mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION),
Expand Down Expand Up @@ -1407,6 +1431,14 @@ unsigned int mpic_get_one_irq(struct mpic *mpic)
mpic_eoi(mpic);
return NO_IRQ;
}
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
if (printk_ratelimit())
printk(KERN_WARNING "%s: Got protected source %d !\n",
mpic->name, (int)src);
mpic_eoi(mpic);
return NO_IRQ;
}

return irq_linear_revmap(mpic->irqhost, src);
}

Expand Down
5 changes: 5 additions & 0 deletions arch/powerpc/xmon/nonstdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ void xmon_printf(const char *format, ...)
va_end(args);
xmon_write(xmon_outbuf, n);
}

void xmon_puts(const char *str)
{
xmon_write(str, strlen(str));
}
3 changes: 2 additions & 1 deletion arch/powerpc/xmon/nonstdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

extern int xmon_putchar(int c);
extern int xmon_getchar(void);
extern void xmon_puts(const char *);
extern char *xmon_gets(char *, int);
extern void xmon_printf(const char *, ...);
extern void xmon_map_scc(void);
extern int xmon_expect(const char *str, unsigned long timeout);
extern int xmon_write(void *ptr, int nb);
extern int xmon_write(const void *ptr, int nb);
extern int xmon_readchar(void);
extern int xmon_read_poll(void);
2 changes: 1 addition & 1 deletion arch/powerpc/xmon/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void xmon_map_scc(void)
{
}

int xmon_write(void *ptr, int nb)
int xmon_write(const void *ptr, int nb)
{
return udbg_write(ptr, nb);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ cmds(struct pt_regs *excp)
mdelay(2000);
return cmd;
case '?':
printf(help_string);
xmon_puts(help_string);
break;
case 'b':
bpt_cmds();
Expand Down
15 changes: 8 additions & 7 deletions arch/ppc/syslib/mv64x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/mv643xx.h>
Expand Down Expand Up @@ -2359,7 +2360,7 @@ mv64460_chip_specific_init(struct mv64x60_handle *bh,
/* Export the hotswap register via sysfs for enum event monitoring */
#define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */

DECLARE_MUTEX(mv64xxx_hs_lock);
static DEFINE_MUTEX(mv64xxx_hs_lock);

static ssize_t
mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
Expand All @@ -2372,14 +2373,14 @@ mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
if (count < VAL_LEN_MAX)
return -EINVAL;

if (down_interruptible(&mv64xxx_hs_lock))
if (mutex_lock_interruptible(&mv64xxx_hs_lock))
return -ERESTARTSYS;
save_exclude = mv64x60_pci_exclude_bridge;
mv64x60_pci_exclude_bridge = 0;
early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
MV64360_PCICFG_CPCI_HOTSWAP, &v);
mv64x60_pci_exclude_bridge = save_exclude;
up(&mv64xxx_hs_lock);
mutex_unlock(&mv64xxx_hs_lock);

return sprintf(buf, "0x%08x\n", v);
}
Expand All @@ -2396,14 +2397,14 @@ mv64xxx_hs_reg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
return -EINVAL;

if (sscanf(buf, "%i", &v) == 1) {
if (down_interruptible(&mv64xxx_hs_lock))
if (mutex_lock_interruptible(&mv64xxx_hs_lock))
return -ERESTARTSYS;
save_exclude = mv64x60_pci_exclude_bridge;
mv64x60_pci_exclude_bridge = 0;
early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
MV64360_PCICFG_CPCI_HOTSWAP, v);
mv64x60_pci_exclude_bridge = save_exclude;
up(&mv64xxx_hs_lock);
mutex_unlock(&mv64xxx_hs_lock);
}
else
count = -EINVAL;
Expand Down Expand Up @@ -2433,10 +2434,10 @@ mv64xxx_hs_reg_valid_show(struct device *dev, struct device_attribute *attr,
pdev = container_of(dev, struct platform_device, dev);
pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data;

if (down_interruptible(&mv64xxx_hs_lock))
if (mutex_lock_interruptible(&mv64xxx_hs_lock))
return -ERESTARTSYS;
v = pdp->hs_reg_valid;
up(&mv64xxx_hs_lock);
mutex_unlock(&mv64xxx_hs_lock);

return sprintf(buf, "%i\n", v);
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/hvc_iseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static void hvc_handle_event(struct HvLpEvent *event)
}
}

static int send_open(HvLpIndex remoteLp, void *sem)
static int __init send_open(HvLpIndex remoteLp, void *sem)
{
return HvCallEvent_signalLpEventFast(remoteLp,
HvLpEvent_Type_VirtualIo,
Expand All @@ -484,7 +484,7 @@ static int send_open(HvLpIndex remoteLp, void *sem)
0, 0, 0, 0);
}

static int hvc_vio_init(void)
static int __init hvc_vio_init(void)
{
atomic_t wait_flag;
int rc;
Expand Down Expand Up @@ -552,14 +552,14 @@ static int hvc_vio_init(void)
}
module_init(hvc_vio_init); /* after drivers/char/hvc_console.c */

static void hvc_vio_exit(void)
static void __exit hvc_vio_exit(void)
{
vio_unregister_driver(&hvc_vio_driver);
}
module_exit(hvc_vio_exit);

/* the device tree order defines our numbering */
static int hvc_find_vtys(void)
static int __init hvc_find_vtys(void)
{
struct device_node *vty;
int num_found = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hvc_rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void __exit hvc_rtas_exit(void)
module_exit(hvc_rtas_exit);

/* This will happen prior to module init. There is no tty at this time? */
static int hvc_rtas_console_init(void)
static int __init hvc_rtas_console_init(void)
{
rtascons_put_char_token = rtas_token("put-term-char");
if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE)
Expand Down
Loading

0 comments on commit dc79747

Please sign in to comment.