Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/kyle/parisc-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: (27 commits)
  parisc: use generic atomic64 on 32-bit
  parisc: superio: fix build breakage
  parisc: Fix PCI resource allocation on non-PAT SBA machines
  parisc: perf: wire up sys_perf_counter_open
  parisc: add task_pt_regs macro
  parisc: wire sys_perf_counter_open to sys_ni_syscall
  parisc: inventory.c, fix bloated stack frame
  parisc: processor.c, fix bloated stack frame
  parisc: fix compile warning in mm/init.c
  parisc: remove dead code from sys_parisc32.c
  parisc: wire up rt_tgsigqueueinfo
  parisc: ensure broadcast tlb purge runs single threaded
  parisc: fix "delay!" timer handling
  parisc: fix mismatched parenthesis in memcpy.c
  parisc: Fix gcc 4.4 warning in lba_pci.c
  parisc: add parameter to read_cr16()
  parisc: decode_exc.c should include kernel.h
  parisc: remove obsolete hw_interrupt_type
  parisc: fix irq compile bugs in arch/parisc/kernel/irq.c
  parisc: advertise PCI devs after "assign_resources"
  ...

Manually fixed up trivial conflicts in tools/perf/perf.h due to addition
of SH vs HPPA perf-counter support.
  • Loading branch information
Linus Torvalds committed Jul 4, 2009
2 parents dd0888c + 64daa44 commit de481ba
Show file tree
Hide file tree
Showing 34 changed files with 228 additions and 219 deletions.
2 changes: 2 additions & 0 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ config PARISC
select RTC_DRV_GENERIC
select INIT_ALL_POSSIBLE
select BUG
select HAVE_PERF_COUNTERS
select GENERIC_ATOMIC64 if !64BIT
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
in many of their workstations & servers (HP9000 700 and 800 series,
Expand Down
14 changes: 9 additions & 5 deletions arch/parisc/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)

#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)

#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v))))
#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v))))
#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v))))
#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v))))
#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v))))
#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v))))

#define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v)))
#define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v)))
#define atomic_add_return(i,v) (__atomic_add_return( (i),(v)))
#define atomic_sub_return(i,v) (__atomic_add_return(-(i),(v)))
#define atomic_inc_return(v) (__atomic_add_return( 1,(v)))
#define atomic_dec_return(v) (__atomic_add_return( -1,(v)))

Expand Down Expand Up @@ -336,7 +336,11 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)

#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)

#endif /* CONFIG_64BIT */
#else /* CONFIG_64BIT */

#include <asm-generic/atomic64.h>

#endif /* !CONFIG_64BIT */

#include <asm-generic/atomic-long.h>

Expand Down
3 changes: 1 addition & 2 deletions arch/parisc/include/asm/dma.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* $Id: dma.h,v 1.2 1999/04/27 00:46:18 deller Exp $
* linux/include/asm/dma.h: Defines for using and allocating dma channels.
/* asm/dma.h: Defines for using and allocating dma channels.
* Written by Hennus Bergman, 1992.
* High DMA channel support & info by Hannu Savolainen
* and John Boyd, Nov. 1992.
Expand Down
7 changes: 7 additions & 0 deletions arch/parisc/include/asm/perf_counter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef __ASM_PARISC_PERF_COUNTER_H
#define __ASM_PARISC_PERF_COUNTER_H

/* parisc only supports software counters through this interface. */
static inline void set_perf_counter_pending(void) { }

#endif /* __ASM_PARISC_PERF_COUNTER_H */
3 changes: 3 additions & 0 deletions arch/parisc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <asm/types.h>
#include <asm/system.h>
#include <asm/percpu.h>

#endif /* __ASSEMBLY__ */

#define KERNEL_STACK_SIZE (4*PAGE_SIZE)
Expand Down Expand Up @@ -127,6 +128,8 @@ struct thread_struct {
unsigned long flags;
};

#define task_pt_regs(tsk) ((struct pt_regs *)&((tsk)->thread.regs))

/* Thread struct flags. */
#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */
#define PARISC_UAC_SIGBUS (1UL << 1)
Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ static inline void set_eiem(unsigned long val)
/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
#define __ldcw(a) ({ \
unsigned __ret; \
__asm__ __volatile__(__LDCW " 0(%1),%0" \
: "=r" (__ret) : "r" (a)); \
__asm__ __volatile__(__LDCW " 0(%2),%0" \
: "=r" (__ret), "+m" (*(a)) : "r" (a)); \
__ret; \
})

Expand Down
14 changes: 7 additions & 7 deletions arch/parisc/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
* N class systems, only one PxTLB inter processor broadcast can be
* active at any one time on the Merced bus. This tlb purge
* synchronisation is fairly lightweight and harmless so we activate
* it on all SMP systems not just the N class. We also need to have
* preemption disabled on uniprocessor machines, and spin_lock does that
* nicely.
* it on all systems not just the N class.
*/
extern spinlock_t pa_tlb_lock;

#define purge_tlb_start(x) spin_lock(&pa_tlb_lock)
#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock)
#define purge_tlb_start(flags) spin_lock_irqsave(&pa_tlb_lock, flags)
#define purge_tlb_end(flags) spin_unlock_irqrestore(&pa_tlb_lock, flags)

extern void flush_tlb_all(void);
extern void flush_tlb_all_local(void *);
Expand Down Expand Up @@ -63,14 +61,16 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
static inline void flush_tlb_page(struct vm_area_struct *vma,
unsigned long addr)
{
unsigned long flags;

/* For one page, it's not worth testing the split_tlb variable */

mb();
mtsp(vma->vm_mm->context,1);
purge_tlb_start();
purge_tlb_start(flags);
pdtlb(addr);
pitlb(addr);
purge_tlb_end();
purge_tlb_end(flags);
}

void __flush_tlb_range(unsigned long sid,
Expand Down
6 changes: 5 additions & 1 deletion arch/parisc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,12 @@
#define __NR_dup3 (__NR_Linux + 312)
#define __NR_pipe2 (__NR_Linux + 313)
#define __NR_inotify_init1 (__NR_Linux + 314)
#define __NR_preadv (__NR_Linux + 315)
#define __NR_pwritev (__NR_Linux + 316)
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
#define __NR_perf_counter_open (__NR_Linux + 318)

#define __NR_Linux_syscalls (__NR_inotify_init1 + 1)
#define __NR_Linux_syscalls (__NR_perf_counter_open + 1)


#define __IGNORE_select /* newselect */
Expand Down
26 changes: 16 additions & 10 deletions arch/parisc/kernel/cache.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* $Id: cache.c,v 1.4 2000/01/25 00:11:38 prumpf Exp $
*
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
Expand Down Expand Up @@ -398,12 +397,13 @@ EXPORT_SYMBOL(flush_kernel_icache_range_asm);

void clear_user_page_asm(void *page, unsigned long vaddr)
{
unsigned long flags;
/* This function is implemented in assembly in pacache.S */
extern void __clear_user_page_asm(void *page, unsigned long vaddr);

purge_tlb_start();
purge_tlb_start(flags);
__clear_user_page_asm(page, vaddr);
purge_tlb_end();
purge_tlb_end(flags);
}

#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */
Expand Down Expand Up @@ -444,20 +444,24 @@ extern void clear_user_page_asm(void *page, unsigned long vaddr);

void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
{
unsigned long flags;

purge_kernel_dcache_page((unsigned long)page);
purge_tlb_start();
purge_tlb_start(flags);
pdtlb_kernel(page);
purge_tlb_end();
purge_tlb_end(flags);
clear_user_page_asm(page, vaddr);
}
EXPORT_SYMBOL(clear_user_page);

void flush_kernel_dcache_page_addr(void *addr)
{
unsigned long flags;

flush_kernel_dcache_page_asm(addr);
purge_tlb_start();
purge_tlb_start(flags);
pdtlb_kernel(addr);
purge_tlb_end();
purge_tlb_end(flags);
}
EXPORT_SYMBOL(flush_kernel_dcache_page_addr);

Expand Down Expand Up @@ -490,8 +494,10 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */
flush_tlb_all();
else {
unsigned long flags;

mtsp(sid, 1);
purge_tlb_start();
purge_tlb_start(flags);
if (split_tlb) {
while (npages--) {
pdtlb(start);
Expand All @@ -504,7 +510,7 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
start += PAGE_SIZE;
}
}
purge_tlb_end();
purge_tlb_end(flags);
}
}

Expand Down
41 changes: 24 additions & 17 deletions arch/parisc/kernel/inventory.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,27 @@ static void __init pagezero_memconfig(void)
static int __init
pat_query_module(ulong pcell_loc, ulong mod_index)
{
pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;
pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
unsigned long bytecnt;
unsigned long temp; /* 64-bit scratch value */
long status; /* PDC return value status */
struct parisc_device *dev;

pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);
if (!pa_pdc_cell)
panic("couldn't allocate memory for PDC_PAT_CELL!");

/* return cell module (PA or Processor view) */
status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
PA_VIEW, &pa_pdc_cell);
PA_VIEW, pa_pdc_cell);

if (status != PDC_OK) {
/* no more cell modules or error */
return status;
}

temp = pa_pdc_cell.cba;
dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path);
temp = pa_pdc_cell->cba;
dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path));
if (!dev) {
return PDC_OK;
}
Expand All @@ -203,8 +207,8 @@ pat_query_module(ulong pcell_loc, ulong mod_index)

/* save generic info returned from the call */
/* REVISIT: who is the consumer of this? not sure yet... */
dev->mod_info = pa_pdc_cell.mod_info; /* pass to PAT_GET_ENTITY() */
dev->pmod_loc = pa_pdc_cell.mod_location;
dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */
dev->pmod_loc = pa_pdc_cell->mod_location;

register_parisc_device(dev); /* advertise device */

Expand All @@ -216,14 +220,14 @@ pat_query_module(ulong pcell_loc, ulong mod_index)

case PAT_ENTITY_PROC:
printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n",
pa_pdc_cell.mod[0]);
pa_pdc_cell->mod[0]);
break;

case PAT_ENTITY_MEM:
printk(KERN_DEBUG
"PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n",
pa_pdc_cell.mod[0], pa_pdc_cell.mod[1],
pa_pdc_cell.mod[2]);
pa_pdc_cell->mod[0], pa_pdc_cell->mod[1],
pa_pdc_cell->mod[2]);
break;
case PAT_ENTITY_CA:
printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc);
Expand All @@ -243,23 +247,26 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
print_ranges:
pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
IO_VIEW, &io_pdc_cell);
printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell.mod[1]);
for (i = 0; i < pa_pdc_cell.mod[1]; i++) {
printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]);
for (i = 0; i < pa_pdc_cell->mod[1]; i++) {
printk(KERN_DEBUG
" PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n",
i, pa_pdc_cell.mod[2 + i * 3], /* type */
pa_pdc_cell.mod[3 + i * 3], /* start */
pa_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */
i, pa_pdc_cell->mod[2 + i * 3], /* type */
pa_pdc_cell->mod[3 + i * 3], /* start */
pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */
printk(KERN_DEBUG
" IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n",
i, io_pdc_cell.mod[2 + i * 3], /* type */
io_pdc_cell.mod[3 + i * 3], /* start */
io_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */
i, io_pdc_cell->mod[2 + i * 3], /* type */
io_pdc_cell->mod[3 + i * 3], /* start */
io_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */
}
printk(KERN_DEBUG "\n");
break;
}
#endif /* DEBUG_PAT */

kfree(pa_pdc_cell);

return PDC_OK;
}

Expand Down
10 changes: 5 additions & 5 deletions arch/parisc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int cpu_check_affinity(unsigned int irq, const struct cpumask *dest)
if (CHECK_IRQ_PER_CPU(irq)) {
/* Bad linux design decision. The mask has already
* been set; we must reset it */
cpumask_setall(&irq_desc[irq].affinity);
cpumask_setall(irq_desc[irq].affinity);
return -EINVAL;
}

Expand All @@ -138,13 +138,13 @@ static int cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
if (cpu_dest < 0)
return -1;

cpumask_copy(&irq_desc[irq].affinity, dest);
cpumask_copy(irq_desc[irq].affinity, dest);

return 0;
}
#endif

static struct hw_interrupt_type cpu_interrupt_type = {
static struct irq_chip cpu_interrupt_type = {
.typename = "CPU",
.startup = cpu_startup_irq,
.shutdown = cpu_disable_irq,
Expand Down Expand Up @@ -299,7 +299,7 @@ int txn_alloc_irq(unsigned int bits_wide)
unsigned long txn_affinity_addr(unsigned int irq, int cpu)
{
#ifdef CONFIG_SMP
cpumask_copy(&irq_desc[irq].affinity, cpumask_of(cpu));
cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu));
#endif

return per_cpu(cpu_data, cpu).txn_addr;
Expand Down Expand Up @@ -356,7 +356,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
irq = eirr_to_irq(eirr_val);

#ifdef CONFIG_SMP
cpumask_copy(&dest, &irq_desc[irq].affinity);
cpumask_copy(&dest, irq_desc[irq].affinity);
if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) &&
!cpu_isset(smp_processor_id(), dest)) {
int cpu = first_cpu(dest);
Expand Down
12 changes: 8 additions & 4 deletions arch/parisc/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ static inline int map_pte_uncached(pte_t * pte,
if (end > PMD_SIZE)
end = PMD_SIZE;
do {
unsigned long flags;

if (!pte_none(*pte))
printk(KERN_ERR "map_pte_uncached: page already exists\n");
set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
purge_tlb_start();
purge_tlb_start(flags);
pdtlb_kernel(orig_vaddr);
purge_tlb_end();
purge_tlb_end(flags);
vaddr += PAGE_SIZE;
orig_vaddr += PAGE_SIZE;
(*paddr_ptr) += PAGE_SIZE;
Expand Down Expand Up @@ -168,11 +170,13 @@ static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr,
if (end > PMD_SIZE)
end = PMD_SIZE;
do {
unsigned long flags;
pte_t page = *pte;

pte_clear(&init_mm, vaddr, pte);
purge_tlb_start();
purge_tlb_start(flags);
pdtlb_kernel(orig_vaddr);
purge_tlb_end();
purge_tlb_end(flags);
vaddr += PAGE_SIZE;
orig_vaddr += PAGE_SIZE;
pte++;
Expand Down
3 changes: 1 addition & 2 deletions arch/parisc/kernel/pci.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* $Id: pci.c,v 1.6 2000/01/29 00:12:05 grundler Exp $
*
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
Expand Down
Loading

0 comments on commit de481ba

Please sign in to comment.