From 01da41b86f6e5f9a724e20a63f093d77e37d8056 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Sat, 3 Mar 2007 01:13:35 +0000 Subject: parisc: make command_line[] static Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Kyle McMartin --- arch/parisc/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index 9818919571f..b5703485088 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -45,7 +45,7 @@ #include #include -char __initdata command_line[COMMAND_LINE_SIZE]; +static char __initdata command_line[COMMAND_LINE_SIZE]; /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */ struct proc_dir_entry * proc_runway_root __read_mostly = NULL; -- cgit v1.2.3 From 2c8307f63dd5caaf7ff8ad5118951e559a9ed5c8 Mon Sep 17 00:00:00 2001 From: Alexandr Andreev Date: Tue, 6 Mar 2007 02:44:13 -0800 Subject: parisc: sync compat getdents Add VERIFY_WRITE check in the beginning like compat_sys_getdents() EFAULT on parisc if put_user() fails. Signed-off-by: Alexandr Andreev Signed-off-by: Alexey Dobriyan Cc: Kyle McMartin Cc: Matthew Wilcox Cc: Grant Grundler Signed-off-by: Andrew Morton Signed-off-by: Kyle McMartin --- arch/parisc/kernel/sys_parisc32.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index ce3245f87fd..a8ebac4fade 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c @@ -350,6 +350,10 @@ sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count) struct getdents32_callback buf; int error; + error = -EFAULT; + if (!access_ok(VERIFY_WRITE, dirent, count)) + goto out; + error = -EBADF; file = fget(fd); if (!file) @@ -366,8 +370,10 @@ sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count) error = buf.error; lastdirent = buf.previous; if (lastdirent) { - put_user(file->f_pos, &lastdirent->d_off); - error = count - buf.count; + if (put_user(file->f_pos, &lastdirent->d_off)) + error = -EFAULT; + else + error = count - buf.count; } out_putf: -- cgit v1.2.3 From 034a15bfef7f52b4f1ff928b9a06d993969857db Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sat, 17 Mar 2007 11:15:01 -0400 Subject: [PARISC] Move #undef to end of syscall table Signed-off-by: Kyle McMartin --- arch/parisc/kernel/syscall_table.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 8bf87e5d9c3..9323f4d64e1 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -30,11 +30,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#undef ENTRY_SAME -#undef ENTRY_DIFF -#undef ENTRY_UHOH -#undef ENTRY_COMP -#undef ENTRY_OURS #if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT) /* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific @@ -407,3 +402,8 @@ ENTRY_COMP(fstatfs64) /* Nothing yet */ +#undef ENTRY_SAME +#undef ENTRY_DIFF +#undef ENTRY_UHOH +#undef ENTRY_COMP +#undef ENTRY_OURS -- cgit v1.2.3 From fd3eef10f5a55acdefbd3f53ca7618a35cb6231f Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sat, 17 Mar 2007 11:17:31 -0400 Subject: [PARISC] Wire up kexec_load syscall Definitely unimplemented at this point and will just trap to sys_ni_syscall... Signed-off-by: Kyle McMartin --- arch/parisc/kernel/syscall_table.S | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 9323f4d64e1..7e04db6b725 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -400,6 +400,7 @@ ENTRY_SAME(epoll_pwait) ENTRY_COMP(statfs64) ENTRY_COMP(fstatfs64) + ENTRY_COMP(kexec_load) /* 300 */ /* Nothing yet */ #undef ENTRY_SAME -- cgit v1.2.3 From 27f282b9c6ec0c2ed64778ca154674929eefb195 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Sat, 17 Mar 2007 19:28:27 +0300 Subject: parisc: convert /proc/gsc/pcxl_dma to seq_file As side effect, remove one more ->get_info user and a novel approach of content generation: sprintf(buf, "%sfoo", buf, ...); sprintf(buf, "%sbar", buf, ...); ... Compile-tested. Signed-off-by: Alexey Dobriyan Signed-off-by: Kyle McMartin --- arch/parisc/kernel/pci-dma.c | 94 +++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 41 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index 0c3aecb85a5..23c1388df1f 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include /* for purge_tlb_*() macros */ static struct proc_dir_entry * proc_gsc_root __read_mostly = NULL; -static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length); static unsigned long pcxl_used_bytes __read_mostly = 0; static unsigned long pcxl_used_pages __read_mostly = 0; @@ -330,6 +330,54 @@ pcxl_free_range(unsigned long vaddr, size_t size) dump_resmap(); } +static int proc_pcxl_dma_show(struct seq_file *m, void *v) +{ +#if 0 + u_long i = 0; + unsigned long *res_ptr = (u_long *)pcxl_res_map; +#endif + unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ + + seq_printf(m, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", + PCXL_DMA_MAP_SIZE, total_pages); + + seq_printf(m, "Resource bitmap : %d bytes\n", pcxl_res_size); + + seq_puts(m, " total: free: used: % used:\n"); + seq_printf(m, "blocks %8d %8ld %8ld %8ld%%\n", pcxl_res_size, + pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes, + (pcxl_used_bytes * 100) / pcxl_res_size); + + seq_printf(m, "pages %8ld %8ld %8ld %8ld%%\n", total_pages, + total_pages - pcxl_used_pages, pcxl_used_pages, + (pcxl_used_pages * 100 / total_pages)); + +#if 0 + seq_puts(m, "\nResource bitmap:"); + + for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { + if ((i & 7) == 0) + seq_puts(m,"\n "); + seq_printf(m, "%s %08lx", buf, *res_ptr); + } +#endif + seq_putc(m, '\n'); + return 0; +} + +static int proc_pcxl_dma_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_pcxl_dma_show, NULL); +} + +static const struct file_operations proc_pcxl_dma_ops = { + .owner = THIS_MODULE, + .open = proc_pcxl_dma_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static int __init pcxl_dma_init(void) { @@ -348,9 +396,10 @@ pcxl_dma_init(void) "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); else { struct proc_dir_entry* ent; - ent = create_proc_info_entry("pcxl_dma", 0, - proc_gsc_root, pcxl_proc_info); - if (!ent) + ent = create_proc_entry("pcxl_dma", 0, proc_gsc_root); + if (ent) + ent->proc_fops = &proc_pcxl_dma_ops; + else printk(KERN_WARNING "pci-dma.c: Unable to create pcxl_dma /proc entry.\n"); } @@ -551,40 +600,3 @@ struct hppa_dma_ops pcx_dma_ops = { .dma_sync_sg_for_cpu = pa11_dma_sync_sg_for_cpu, .dma_sync_sg_for_device = pa11_dma_sync_sg_for_device, }; - - -static int pcxl_proc_info(char *buf, char **start, off_t offset, int len) -{ -#if 0 - u_long i = 0; - unsigned long *res_ptr = (u_long *)pcxl_res_map; -#endif - unsigned long total_pages = pcxl_res_size << 3; /* 8 bits per byte */ - - sprintf(buf, "\nDMA Mapping Area size : %d bytes (%ld pages)\n", - PCXL_DMA_MAP_SIZE, total_pages); - - sprintf(buf, "%sResource bitmap : %d bytes\n", buf, pcxl_res_size); - - strcat(buf, " total: free: used: % used:\n"); - sprintf(buf, "%sblocks %8d %8ld %8ld %8ld%%\n", buf, pcxl_res_size, - pcxl_res_size - pcxl_used_bytes, pcxl_used_bytes, - (pcxl_used_bytes * 100) / pcxl_res_size); - - sprintf(buf, "%spages %8ld %8ld %8ld %8ld%%\n", buf, total_pages, - total_pages - pcxl_used_pages, pcxl_used_pages, - (pcxl_used_pages * 100 / total_pages)); - -#if 0 - strcat(buf, "\nResource bitmap:"); - - for(; i < (pcxl_res_size / sizeof(u_long)); ++i, ++res_ptr) { - if ((i & 7) == 0) - strcat(buf,"\n "); - sprintf(buf, "%s %08lx", buf, *res_ptr); - } -#endif - strcat(buf, "\n"); - return strlen(buf); -} - -- cgit v1.2.3 From 2cbd42dbf8887c8742f8e6a286c7e5f4f5ddb56b Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 27 Mar 2007 16:47:49 -0400 Subject: [PARISC] Let PA-8900 processors boot Signed-off-by: Kyle McMartin --- arch/parisc/kernel/hardware.c | 4 +++- arch/parisc/kernel/perf.c | 6 ++++-- arch/parisc/kernel/setup.c | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index 18ba4cb9159..e365f031188 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c @@ -1296,6 +1296,7 @@ static struct hp_cpu_type_mask { { 0x05f0, 0x0ff0, pcxw2 }, /* 0x05f0 - 0x05ff */ { 0x0600, 0x0fe0, pcxl }, /* 0x0600 - 0x061f */ { 0x0880, 0x0ff0, mako }, /* 0x0880 - 0x088f */ + { 0x0890, 0x0ff0, mako2 }, /* 0x0890 - 0x089f */ { 0x0000, 0x0000, pcx } /* terminate table */ }; @@ -1311,7 +1312,8 @@ char *cpu_name_version[][2] = { [pcxw] = { "PA8500 (PCX-W)", "2.0" }, [pcxw_] = { "PA8600 (PCX-W+)", "2.0" }, [pcxw2] = { "PA8700 (PCX-W2)", "2.0" }, - [mako] = { "PA8800 (Mako)", "2.0" } + [mako] = { "PA8800 (Mako)", "2.0" }, + [mako2] = { "PA8900 (Shortfin)", "2.0" } }; const char * __init diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index a46bc62b643..08717380e02 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -511,10 +511,12 @@ static int __init perf_init(void) } else if (boot_cpu_data.cpu_type == pcxw || boot_cpu_data.cpu_type == pcxw_ || boot_cpu_data.cpu_type == pcxw2 || - boot_cpu_data.cpu_type == mako) { + boot_cpu_data.cpu_type == mako || + boot_cpu_data.cpu_type == mako2) { perf_processor_interface = CUDA_INTF; if (boot_cpu_data.cpu_type == pcxw2 || - boot_cpu_data.cpu_type == mako) + boot_cpu_data.cpu_type == mako || + boot_cpu_data.cpu_type == mako2) bitmask_array = perf_bitmasks_piranha; } else { perf_processor_interface = UNKNOWN_INTF; diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index b5703485088..b34882cd71f 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -225,6 +225,7 @@ static void __init parisc_proc_mkdir(void) } break; case mako: + case mako2: if (NULL == proc_mckinley_root) { proc_mckinley_root = proc_mkdir("bus/mckinley", NULL); -- cgit v1.2.3 From b5e8b733a18a1192666005f95f44e02440b057d4 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Tue, 22 May 2007 17:38:26 +0200 Subject: [PARISC] Disable LWS debugging The LWS debugging code on parisc is wrongly enabled due to a bug in the use of the preprocessor directives. This debugging code is not thread safe and causes problems with a recent glibc on SMP kernels. Signed-off-by: Aurelien Jarno Signed-off-by: Kyle McMartin --- arch/parisc/kernel/syscall.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 10859f53e94..4603032d56e 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -501,7 +501,7 @@ lws_compare_and_swap: shlw %r20, 4, %r20 add %r20, %r28, %r20 -# ifdef ENABLE_LWS_DEBUG +# if ENABLE_LWS_DEBUG /* DEBUG, check for deadlock! If the thread register values are the same @@ -550,7 +550,7 @@ cas_wouldblock: perspective */ cas_action: -#if defined CONFIG_SMP && defined ENABLE_LWS_DEBUG +#if defined CONFIG_SMP && ENABLE_LWS_DEBUG /* DEBUG */ mfctl %cr27, %r1 stw %r1, 4(%sr2,%r20) @@ -562,7 +562,7 @@ cas_action: #ifdef CONFIG_SMP /* Free lock */ stw %r20, 0(%sr2,%r20) -# ifdef ENABLE_LWS_DEBUG +# if ENABLE_LWS_DEBUG /* Clear thread register indicator */ stw %r0, 4(%sr2,%r20) # endif @@ -576,7 +576,7 @@ cas_action: #ifdef CONFIG_SMP /* Free lock */ stw %r20, 0(%sr2,%r20) -# ifdef ENABLE_LWS_DEBUG +# if ENABLE_LWS_DEBUG stw %r0, 4(%sr2,%r20) # endif #endif -- cgit v1.2.3 From 7022672e4046fac4699aa5f8ff2a5213b7ec4ff9 Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Fri, 11 May 2007 20:42:34 +0100 Subject: [PARISC] spelling fixes: arch/parisc/ Spelling fixes in arch/parisc/. Signed-off-by: Simon Arlott Acked-by: Grant Grundler Signed-off-by: Kyle McMartin --- arch/parisc/kernel/firmware.c | 4 ++-- arch/parisc/kernel/perf.c | 12 ++++++------ arch/parisc/kernel/processor.c | 8 ++++---- arch/parisc/kernel/setup.c | 2 +- arch/parisc/kernel/signal32.h | 2 +- arch/parisc/kernel/smp.c | 6 +++--- arch/parisc/kernel/time.c | 2 +- arch/parisc/kernel/traps.c | 2 +- arch/parisc/math-emu/dbl_float.h | 4 ++-- arch/parisc/math-emu/dfsqrt.c | 2 +- arch/parisc/math-emu/sfsqrt.c | 2 +- arch/parisc/math-emu/sgl_float.h | 4 ++-- arch/parisc/mm/init.c | 10 +++++----- 13 files changed, 30 insertions(+), 30 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index 39dc835bf89..fd6552c4c08 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -634,7 +634,7 @@ EXPORT_SYMBOL(pdc_lan_station_id); * pdc_stable_read - Read data from Stable Storage. * @staddr: Stable Storage address to access. * @memaddr: The memory address where Stable Storage data shall be copied. - * @count: number of bytes to transfert. count is multiple of 4. + * @count: number of bytes to transfer. count is multiple of 4. * * This PDC call reads from the Stable Storage address supplied in staddr * and copies count bytes to the memory address memaddr. @@ -660,7 +660,7 @@ EXPORT_SYMBOL(pdc_stable_read); * pdc_stable_write - Write data to Stable Storage. * @staddr: Stable Storage address to access. * @memaddr: The memory address where Stable Storage data shall be read from. - * @count: number of bytes to transfert. count is multiple of 4. + * @count: number of bytes to transfer. count is multiple of 4. * * This PDC call reads count bytes from the supplied memaddr address, * and copies count bytes to the Stable Storage address staddr. diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index 08717380e02..89d6d5ad44b 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -171,7 +171,7 @@ static const uint64_t perf_bitmasks[] = { /* * Write control bitmasks for Pa-8700 processor given - * somethings have changed slightly. + * some things have changed slightly. */ static const uint64_t perf_bitmasks_piranha[] = { 0x0000000000000000ul, /* first dbl word must be zero */ @@ -576,27 +576,27 @@ static int perf_stop_counters(uint32_t *raddr) if (!perf_rdr_read_ubuf(16, userbuf)) return -13; - /* Counter0 is bits 1398 thru 1429 */ + /* Counter0 is bits 1398 to 1429 */ tmp64 = (userbuf[21] << 22) & 0x00000000ffc00000; tmp64 |= (userbuf[22] >> 42) & 0x00000000003fffff; /* OR sticky0 (bit 1430) to counter0 bit 32 */ tmp64 |= (userbuf[22] >> 10) & 0x0000000080000000; raddr[0] = (uint32_t)tmp64; - /* Counter1 is bits 1431 thru 1462 */ + /* Counter1 is bits 1431 to 1462 */ tmp64 = (userbuf[22] >> 9) & 0x00000000ffffffff; /* OR sticky1 (bit 1463) to counter1 bit 32 */ tmp64 |= (userbuf[22] << 23) & 0x0000000080000000; raddr[1] = (uint32_t)tmp64; - /* Counter2 is bits 1464 thru 1495 */ + /* Counter2 is bits 1464 to 1495 */ tmp64 = (userbuf[22] << 24) & 0x00000000ff000000; tmp64 |= (userbuf[23] >> 40) & 0x0000000000ffffff; /* OR sticky2 (bit 1496) to counter2 bit 32 */ tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000; raddr[2] = (uint32_t)tmp64; - /* Counter3 is bits 1497 thru 1528 */ + /* Counter3 is bits 1497 to 1528 */ tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff; /* OR sticky3 (bit 1529) to counter3 bit 32 */ tmp64 |= (userbuf[23] << 25) & 0x0000000080000000; @@ -618,7 +618,7 @@ static int perf_stop_counters(uint32_t *raddr) userbuf[23] = 0; /* - * Write back the zero'ed bytes + the image given + * Write back the zeroed bytes + the image given * the read was destructive. */ perf_rdr_write(16, userbuf); diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 566226d78bc..27f955378a4 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -63,7 +63,7 @@ extern int update_cr16_clocksource(void); /* from time.c */ ** will call register_parisc_driver(&cpu_driver) before calling do_inventory(). ** ** The goal of consolidating CPU initialization into one place is -** to make sure all CPU's get initialized the same way. +** to make sure all CPUs get initialized the same way. ** The code path not shared is how PDC hands control of the CPU to the OS. ** The initialization of OS data structures is the same (done below). */ @@ -166,7 +166,7 @@ static int __init processor_probe(struct parisc_device *dev) #endif /* - ** CONFIG_SMP: init_smp_config() will attempt to get CPU's into + ** CONFIG_SMP: init_smp_config() will attempt to get CPUs into ** OS control. RENDEZVOUS is the default state - see mem_set above. ** p->state = STATE_RENDEZVOUS; */ @@ -334,7 +334,7 @@ int __init init_per_cpu(int cpunum) } /* - * Display cpu info for all cpu's. + * Display CPU info for all CPUs. */ int show_cpuinfo (struct seq_file *m, void *v) @@ -393,7 +393,7 @@ static struct parisc_driver cpu_driver __read_mostly = { }; /** - * processor_init - Processor initalization procedure. + * processor_init - Processor initialization procedure. * * Register this driver. */ diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index b34882cd71f..c44b8c51f5d 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -162,7 +162,7 @@ void __init setup_arch(char **cmdline_p) } /* - * Display cpu info for all cpu's. + * Display CPU info for all CPUs. * for parisc this is in processor.c */ extern int show_cpuinfo (struct seq_file *m, void *v); diff --git a/arch/parisc/kernel/signal32.h b/arch/parisc/kernel/signal32.h index e39b38a67a8..c7800846422 100644 --- a/arch/parisc/kernel/signal32.h +++ b/arch/parisc/kernel/signal32.h @@ -113,7 +113,7 @@ int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); /* In a deft move of uber-hackery, we decide to carry the top half of all * 64-bit registers in a non-portable, non-ABI, hidden structure. * Userspace can read the hidden structure if it *wants* but is never - * guaranteed to be in the same place. Infact the uc_sigmask from the + * guaranteed to be in the same place. In fact the uc_sigmask from the * ucontext_t structure may push the hidden register file downards */ struct compat_regfile { diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 6ba9257fdb7..4bf7cd19cc4 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -8,7 +8,7 @@ ** Lots of stuff stolen from arch/alpha/kernel/smp.c ** ...and then parisc stole from arch/ia64/kernel/smp.c. Thanks David! :^) ** -** Thanks to John Curry and Ullas Ponnadi. I learned alot from their work. +** Thanks to John Curry and Ullas Ponnadi. I learned a lot from their work. ** -grant (1/12/2001) ** ** This program is free software; you can redistribute it and/or modify @@ -419,7 +419,7 @@ smp_cpu_init(int cpunum) BUG(); enter_lazy_tlb(&init_mm, current); - init_IRQ(); /* make sure no IRQ's are enabled or pending */ + init_IRQ(); /* make sure no IRQs are enabled or pending */ start_cpu_itimer(); } @@ -552,7 +552,7 @@ void __devinit smp_prepare_boot_cpu(void) /* ** inventory.c:do_inventory() hasn't yet been run and thus we -** don't 'discover' the additional CPU's until later. +** don't 'discover' the additional CPUs until later. */ void __init smp_prepare_cpus(unsigned int max_cpus) { diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 07a991aa9b0..8b3062a5c81 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -191,7 +191,7 @@ int update_cr16_clocksource(void) { int change = 0; - /* since the cr16 cycle counters are not syncronized across CPUs, + /* since the cr16 cycle counters are not synchronized across CPUs, we'll check if we should switch to a safe clocksource: */ if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { clocksource_change_rating(&clocksource_cr16, 0); diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 745ff741490..0ba1d3dbca2 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -615,7 +615,7 @@ void handle_interruption(int code, struct pt_regs *regs) case 13: /* Conditional Trap - The condition succees in an instruction which traps + The condition succeeds in an instruction which traps on condition */ if(user_mode(regs)){ si.si_signo = SIGFPE; diff --git a/arch/parisc/math-emu/dbl_float.h b/arch/parisc/math-emu/dbl_float.h index 1570e2e0a32..0c2fa9a951b 100644 --- a/arch/parisc/math-emu/dbl_float.h +++ b/arch/parisc/math-emu/dbl_float.h @@ -22,7 +22,7 @@ PA header file -- do not include this header file for non-PA builds. #endif -/* 32-bit word grabing functions */ +/* 32-bit word grabbing functions */ #define Dbl_firstword(value) Dallp1(value) #define Dbl_secondword(value) Dallp2(value) #define Dbl_thirdword(value) dummy_location @@ -37,7 +37,7 @@ #define Dbl_allp1(object) Dallp1(object) #define Dbl_allp2(object) Dallp2(object) -/* dbl_and_signs ands the sign bits of each argument and puts the result +/* dbl_and_signs ANDs the sign bits of each argument and puts the result * into the first argument. dbl_or_signs ors those same sign bits */ #define Dbl_and_signs( src1dst, src2) \ Dallp1(src1dst) = (Dallp1(src2)|~((unsigned int)1<<31)) & Dallp1(src1dst) diff --git a/arch/parisc/math-emu/dfsqrt.c b/arch/parisc/math-emu/dfsqrt.c index b6ed1066f1e..9542c6d281a 100644 --- a/arch/parisc/math-emu/dfsqrt.c +++ b/arch/parisc/math-emu/dfsqrt.c @@ -76,7 +76,7 @@ dbl_fsqrt( } /* * Return quiet NaN or positive infinity. - * Fall thru to negative test if negative infinity. + * Fall through to negative test if negative infinity. */ if (Dbl_iszero_sign(srcp1) || Dbl_isnotzero_mantissa(srcp1,srcp2)) { diff --git a/arch/parisc/math-emu/sfsqrt.c b/arch/parisc/math-emu/sfsqrt.c index cd3f6db1f6f..4657a12c910 100644 --- a/arch/parisc/math-emu/sfsqrt.c +++ b/arch/parisc/math-emu/sfsqrt.c @@ -76,7 +76,7 @@ sgl_fsqrt( } /* * Return quiet NaN or positive infinity. - * Fall thru to negative test if negative infinity. + * Fall through to negative test if negative infinity. */ if (Sgl_iszero_sign(src) || Sgl_isnotzero_mantissa(src)) { *dstptr = src; diff --git a/arch/parisc/math-emu/sgl_float.h b/arch/parisc/math-emu/sgl_float.h index 82519a5c2ba..4ee4cc95e4b 100644 --- a/arch/parisc/math-emu/sgl_float.h +++ b/arch/parisc/math-emu/sgl_float.h @@ -23,7 +23,7 @@ PA header file -- do not include this header file for non-PA builds. #endif -/* 32-bit word grabing functions */ +/* 32-bit word grabbing functions */ #define Sgl_firstword(value) Sall(value) #define Sgl_secondword(value) dummy_location #define Sgl_thirdword(value) dummy_location @@ -36,7 +36,7 @@ #define Sgl_exponentmantissa(object) Sexponentmantissa(object) #define Sgl_all(object) Sall(object) -/* sgl_and_signs ands the sign bits of each argument and puts the result +/* sgl_and_signs ANDs the sign bits of each argument and puts the result * into the first argument. sgl_or_signs ors those same sign bits */ #define Sgl_and_signs( src1dst, src2) \ Sall(src1dst) = (Sall(src2)|~((unsigned int)1<<31)) & Sall(src1dst) diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 75ea9f2a8a4..e724b362c49 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -890,7 +890,7 @@ void __init paging_init(void) #ifdef CONFIG_PA20 /* - * Currently, all PA20 chips have 18 bit protection id's, which is the + * Currently, all PA20 chips have 18 bit protection IDs, which is the * limiting factor (space ids are 32 bits). */ @@ -899,10 +899,10 @@ void __init paging_init(void) #else /* - * Currently we have a one-to-one relationship between space id's and - * protection id's. Older parisc chips (PCXS, PCXT, PCXL, PCXL2) only - * support 15 bit protection id's, so that is the limiting factor. - * PCXT' has 18 bit protection id's, but only 16 bit spaceids, so it's + * Currently we have a one-to-one relationship between space IDs and + * protection IDs. Older parisc chips (PCXS, PCXT, PCXL, PCXL2) only + * support 15 bit protection IDs, so that is the limiting factor. + * PCXT' has 18 bit protection IDs, but only 16 bit spaceids, so it's * probably not worth the effort for a special case here. */ -- cgit v1.2.3 From ea74342900dbe79f2a31ed3609b9e2bdb5c7198c Mon Sep 17 00:00:00 2001 From: Milind Arun Choudhary Date: Sun, 1 Apr 2007 13:06:46 +0530 Subject: [PARISC] ROUND_UP macro cleanup in arch/parisc ROUND_UP macro cleanup, use ALIGN where ever appropriate Signed-off-by: Milind Arun Choudhary Signed-off-by: Kyle McMartin --- arch/parisc/hpux/fs.c | 5 ++--- arch/parisc/kernel/sys_parisc32.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index d86e1577677..f2042e6466a 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c @@ -21,6 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -69,7 +70,6 @@ struct getdents_callback { }; #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) -#define ROUND_UP(x) (((x)+sizeof(long)-1) & ~(sizeof(long)-1)) static int filldir(void * __buf, const char * name, int namlen, loff_t offset, u64 ino, unsigned d_type) @@ -77,7 +77,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, struct hpux_dirent __user * dirent; struct getdents_callback * buf = (struct getdents_callback *) __buf; ino_t d_ino; - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, sizeof(long)); buf->error = -EINVAL; /* only used if we fail.. */ if (reclen > buf->count) @@ -102,7 +102,6 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, } #undef NAME_OFFSET -#undef ROUND_UP int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned int count) { diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index a8ebac4fade..bb23ff71c28 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c @@ -311,14 +311,13 @@ struct readdir32_callback { int count; }; -#define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) static int filldir32 (void *__buf, const char *name, int namlen, loff_t offset, u64 ino, unsigned int d_type) { struct linux32_dirent __user * dirent; struct getdents32_callback * buf = (struct getdents32_callback *) __buf; - int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1, 4); + int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4); u32 d_ino; buf->error = -EINVAL; /* only used if we fail.. */ -- cgit v1.2.3 From e9541d0ca2a5d713c5d8dcb635d3f41e75c90bfb Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 19:30:36 +0200 Subject: [PARISC] fix section mismatches in arch/parisc/kernel Hi Kyle, this patch fixes two section mismatches in arch/parisc/kernel: WARNING: arch/parisc/kernel/built-in.o(.data.read_mostly+0xd8): Section mismatch: reference to .init.text:processor_probe (between 'cpu_driver' and 'boot_cpu_data') WARNING: arch/parisc/kernel/built-in.o(.text.alloc_pa_dev+0x140): Section mismatch: reference to .init.text:parisc_hardware_description (after 'alloc_pa_dev') Additionally, mark some tables as constants. Please apply, Helge Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/kernel/hardware.c | 10 +++++----- arch/parisc/kernel/processor.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index e365f031188..04848b2b381 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c @@ -38,7 +38,7 @@ * so don't reference this table after starting the init process */ -static struct hp_hardware hp_hardware_list[] __initdata = { +static struct hp_hardware hp_hardware_list[] __devinitdata = { {HPHW_NPROC,0x01,0x4,0x0,"Indigo (840, 930)"}, {HPHW_NPROC,0x8,0x4,0x01,"Firefox(825,925)"}, {HPHW_NPROC,0xA,0x4,0x01,"Top Gun (835,834,935,635)"}, @@ -1219,7 +1219,7 @@ static struct hp_cpu_type_mask { unsigned short model; unsigned short mask; enum cpu_type cpu; -} hp_cpu_type_mask_list[] __initdata = { +} hp_cpu_type_mask_list[] __devinitdata = { { 0x0000, 0x0ff0, pcx }, /* 0x0000 - 0x000f */ { 0x0048, 0x0ff0, pcxl }, /* 0x0040 - 0x004f */ @@ -1300,7 +1300,7 @@ static struct hp_cpu_type_mask { { 0x0000, 0x0000, pcx } /* terminate table */ }; -char *cpu_name_version[][2] = { +const char * const cpu_name_version[][2] = { [pcx] = { "PA7000 (PCX)", "1.0" }, [pcxs] = { "PA7000 (PCX-S)", "1.1a" }, [pcxt] = { "PA7100 (PCX-T)", "1.1b" }, @@ -1316,7 +1316,7 @@ char *cpu_name_version[][2] = { [mako2] = { "PA8900 (Shortfin)", "2.0" } }; -const char * __init +const char * __devinit parisc_hardware_description(struct parisc_device_id *id) { struct hp_hardware *listptr; @@ -1355,7 +1355,7 @@ parisc_hardware_description(struct parisc_device_id *id) /* Interpret hversion (ret[0]) from PDC_MODEL(4)/PDC_MODEL_INFO(0) */ -enum cpu_type __init +enum cpu_type __cpuinit parisc_get_cpu_type(unsigned long hversion) { struct hp_cpu_type_mask *ptr; diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 27f955378a4..549f5484342 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -76,7 +76,7 @@ extern int update_cr16_clocksource(void); /* from time.c */ * (return 1). If so, initialize the chip and tell other partners in crime * they have work to do. */ -static int __init processor_probe(struct parisc_device *dev) +static int __cpuinit processor_probe(struct parisc_device *dev) { unsigned long txn_addr; unsigned long cpuid; @@ -381,12 +381,12 @@ show_cpuinfo (struct seq_file *m, void *v) return 0; } -static struct parisc_device_id processor_tbl[] __read_mostly = { +static const struct parisc_device_id processor_tbl[] = { { HPHW_NPROC, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, SVERSION_ANY_ID }, { 0, } }; -static struct parisc_driver cpu_driver __read_mostly = { +static struct parisc_driver cpu_driver = { .name = "CPU", .id_table = processor_tbl, .probe = processor_probe -- cgit v1.2.3 From 593af52aa63193ac331cc13bca2b5611b74ddf77 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 21:15:49 +0200 Subject: [PARISC] Wire up utimensat/signalfd/timerfd/eventfd syscalls Wire up utimensat/signalfd/timerfd/eventfd syscalls and mark select/fadvise64/utimes to be ignored by checksyscalls.sh Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/kernel/syscall_table.S | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch') diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 7e04db6b725..627f3c28ad8 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -401,6 +401,11 @@ ENTRY_COMP(statfs64) ENTRY_COMP(fstatfs64) ENTRY_COMP(kexec_load) /* 300 */ + ENTRY_COMP(utimensat) + ENTRY_COMP(signalfd) + ENTRY_COMP(timerfd) + ENTRY_SAME(eventfd) + /* Nothing yet */ #undef ENTRY_SAME -- cgit v1.2.3 From 8dff980f1d1392990c6813c86f4bce108d3054fe Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Mon, 28 May 2007 00:26:02 +0200 Subject: [PARISC] fix section mismatch in smp.c WARNING: arch/parisc/kernel/built-in.o(.text.__cpu_up+0x20): Section mismatch: reference to .init.text:smp_boot_one_cpu (after '__cpu_up') Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 4bf7cd19cc4..04c7e1d36ce 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -461,7 +461,7 @@ void __init smp_callin(void) /* * Bring one cpu online. */ -int __init smp_boot_one_cpu(int cpuid) +int __cpuinit smp_boot_one_cpu(int cpuid) { struct task_struct *idle; long timeout; -- cgit v1.2.3 From 72738a96d196a4ffa97712bfa35fa28a05cf0a3a Mon Sep 17 00:00:00 2001 From: Grant Grundler Date: Mon, 28 May 2007 16:31:59 -0600 Subject: [PARISC] remove remnants of parisc-specific softirq code Kyle, This patch removes remnants of softirq support that we no longer need. I suspect this was just overlooked when willy convert parisc to generic IRQ support. Tested on c3600 32-bit UP. Signed-off-by: Grant Grundler [and tested on a c8000 64-bit SMP --kyle] Signed-off-by: Kyle McMartin --- arch/parisc/kernel/entry.S | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 8474f9e5ca1..98ae563a090 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -954,21 +954,6 @@ intr_return: /* NOTE: Need to enable interrupts incase we schedule. */ ssm PSW_SM_I, %r0 - /* Check for software interrupts */ - - .import irq_stat,data - - load32 irq_stat,%r19 -#ifdef CONFIG_SMP - mfctl %cr30,%r1 - ldw TI_CPU(%r1),%r1 /* get cpu # - int */ - /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) amount - ** irq_stat[] is defined using ____cacheline_aligned. - */ - SHLREG %r1,L1_CACHE_SHIFT,%r20 - add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */ -#endif /* CONFIG_SMP */ - intr_check_resched: /* check for reschedule */ @@ -2055,24 +2040,6 @@ ENTRY(syscall_exit) */ loadgp -syscall_check_bh: - - /* Check for software interrupts */ - - .import irq_stat,data - - load32 irq_stat,%r19 - -#ifdef CONFIG_SMP - /* sched.h: int processor */ - /* %r26 is used as scratch register to index into irq_stat[] */ - ldw TI_CPU-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 /* cpu # */ - - /* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) bits */ - SHLREG %r26,L1_CACHE_SHIFT,%r20 - add %r19,%r20,%r19 /* now have &irq_stat[smp_processor_id()] */ -#endif /* CONFIG_SMP */ - syscall_check_resched: /* check for reschedule */ @@ -2244,7 +2211,7 @@ syscall_do_resched: #else nop #endif - b syscall_check_bh /* if resched, we start over again */ + b syscall_check_resched /* if resched, we start over again */ nop ENDPROC(syscall_exit) -- cgit v1.2.3 From cb9577958d85896303561d9cc8544885deb272be Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 30 May 2007 02:24:28 -0400 Subject: [PARISC] fix null ptr deref in unwind.c commit ffb45122766db220d0bf3d01848d575fbbcb6430 removed one too many args. kallsyms_lookup is not safe to call with a NULL *modname. Paper bag over the problem for the time being. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/unwind.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 89c03707ecc..e70f57e2764 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -216,8 +216,10 @@ static void unwind_frame_regs(struct unwind_frame_info *info) /* Handle some frequent special cases.... */ { char symname[KSYM_NAME_LEN+1]; + char *modname; - kallsyms_lookup(info->ip, NULL, NULL, NULL, symname); + kallsyms_lookup(info->ip, NULL, NULL, &modname, + symname); dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname); -- cgit v1.2.3 From 376e210b71d7736775f43f32c5c7712f90aaf59a Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 30 May 2007 02:27:46 -0400 Subject: [PARISC] fix "reduce size of task_struct on 64-bit machines" fallout Amazingly, parisc was the only arch effected by this... Convert register-sized loads/stores to always be 32-bit for these fields. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/entry.S | 5 ++--- arch/parisc/kernel/syscall.S | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 98ae563a090..42598abf457 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -2019,10 +2019,9 @@ ENTRY(syscall_exit) STREG %r28,TASK_PT_GR28(%r1) #ifdef CONFIG_HPUX - /* cannot be easily included */ #define PER_HPUX 0x10 - LDREG TASK_PERSONALITY(%r1),%r19 + ldw TASK_PERSONALITY(%r1),%r19 /* We can't use "CMPIB<> PER_HPUX" since "im5" field is sign extended */ ldo -PER_HPUX(%r19), %r19 @@ -2081,7 +2080,7 @@ syscall_restore: /* Are we being ptraced? */ LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 - LDREG TASK_PTRACE(%r1), %r19 + ldw TASK_PTRACE(%r1), %r19 bb,< %r19,31,syscall_restore_rfi nop diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 4603032d56e..91b2a48b192 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -181,7 +181,7 @@ linux_gateway_entry: /* Are we being ptraced? */ mfctl %cr30, %r1 LDREG TI_TASK(%r1),%r1 - LDREG TASK_PTRACE(%r1), %r1 + ldw TASK_PTRACE(%r1), %r1 bb,<,n %r1,31,.Ltracesys /* Note! We cannot use the syscall table that is mapped -- cgit v1.2.3 From cc650a7a9f5ebc3f9290a8e20e3f55b4f52f849e Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 30 May 2007 02:36:00 -0400 Subject: [PARISC] be more defensive in process.c::get_wchan While debugging, I noticed we don't check the task_struct arg passed to get_wchan, whereas everyone else does. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/process.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch') diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 0dd3847f494..355664812b8 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -381,6 +381,10 @@ get_wchan(struct task_struct *p) struct unwind_frame_info info; unsigned long ip; int count = 0; + + if (!p || p == current || p->state == TASK_RUNNING) + return 0; + /* * These bracket the sleeping functions.. */ -- cgit v1.2.3 From 3bb457af4fa86dceef57d7c3e959aff162457fdc Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sun, 3 Jun 2007 17:47:00 -0400 Subject: [PARISC] Fix bug when syscall nr is __NR_Linux_syscalls The bug was that we were comparing __NR_syscalls to be greater or equal to the syscall number stored in %r20. __NR_syscalls is one greater than the last syscall though, so we're loading one entry beyond the end of the syscall table, and trying to jump to it. Fix this by only checking that we're greater, alternatively, we could have compared to (__NR_Linux_syscalls - 1) Signed-off-by: Kyle McMartin --- arch/parisc/kernel/syscall.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 91b2a48b192..56f6231cb86 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -198,7 +198,7 @@ linux_gateway_entry: ldil L%sys_call_table, %r1 ldo R%sys_call_table(%r1), %r19 #endif - comiclr,>>= __NR_Linux_syscalls, %r20, %r0 + comiclr,>> __NR_Linux_syscalls, %r20, %r0 b,n .Lsyscall_nosys LDREGX %r20(%r19), %r19 -- cgit v1.2.3 From c3d4ed4e3e5aa8d9e6b4b795f004a7028ce780e9 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 4 Jun 2007 02:26:52 -0400 Subject: [PARISC] Fix kernel panic in check_ivt check_ivt had some seriously broken code wrt function pointers on parisc64. Instead of referencing the hpmc code via a function pointer, export symbols and reference it as a const array. Thanks to jda for pointing out the broken 64-bit func ptr handling. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/hpmc.S | 5 +---- arch/parisc/kernel/traps.c | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/hpmc.S b/arch/parisc/kernel/hpmc.S index d8baa158d8a..43b41df0b54 100644 --- a/arch/parisc/kernel/hpmc.S +++ b/arch/parisc/kernel/hpmc.S @@ -295,8 +295,5 @@ os_hpmc_6: b . nop ENDPROC(os_hpmc) - - /* this label used to compute os_hpmc checksum */ -ENTRY(os_hpmc_end) - +ENTRY(os_hpmc_end) /* this label used to compute os_hpmc checksum */ nop diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 0ba1d3dbca2..c3ec9f1ec0f 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -802,13 +802,14 @@ void handle_interruption(int code, struct pt_regs *regs) int __init check_ivt(void *iva) { + extern const u32 os_hpmc[]; + extern const u32 os_hpmc_end[]; + int i; u32 check = 0; u32 *ivap; u32 *hpmcp; u32 length; - extern void os_hpmc(void); - extern void os_hpmc_end(void); if (strcmp((char *)iva, "cows can fly")) return -1; @@ -820,7 +821,7 @@ int __init check_ivt(void *iva) /* Compute Checksum for HPMC handler */ - length = (u32)((unsigned long)os_hpmc_end - (unsigned long)os_hpmc); + length = os_hpmc_end - os_hpmc; ivap[7] = length; hpmcp = (u32 *)os_hpmc; -- cgit v1.2.3 From 462b529f91b618f4bd144bbc6184f616dfb58a1e Mon Sep 17 00:00:00 2001 From: Grant Grundler Date: Sun, 10 Jun 2007 16:31:41 -0600 Subject: [PARISC] remove global_ack_eiem Kudos to Thibaut Varene for spotting the (mis)use of appropriately named global_ack_eiem. This took a long time to figure out and both insight from myself, Kyle McMartin, and James Bottomley were required to narrow down which bit of code could have this race condition. The symptom was interrupts stopped getting delivered while some workload was generating IO interrupts on two different CPUs. One of the interrupt sources would get masked off and stay unmasked. Problem was global_ack_eiem was accessed with read/modified/write sequence and not protected by a spinlock. PA-RISC doesn't need a global ack flag though. External Interrupts are _always_ delivered to a single CPU (except for "global broadcast interrupt" which AFAIK currently is not used.) So we don't have to worry about any given IRQ vector getting delivered to more than one CPU. Tested on a500 and rp34xx boxen. rsync to/from gsyprf11 (a500) would lock up the box since NIC (tg3) interrupt and SCSI (sym2) were on "opposite" CPUs (2 CPU system). Put them on the same CPU or apply this patch and 10GB of data would rsync completely. Please apply the following critical patch. thanks, grant Signed-off-by: Grant Grundler Acked-by: Thibaut VARENE Signed-off-by: Kyle McMartin --- arch/parisc/kernel/irq.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'arch') diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index c5c9125dace..76ce5e3b005 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -46,14 +46,10 @@ extern irqreturn_t ipi_interrupt(int, void *); static volatile unsigned long cpu_eiem = 0; /* -** ack bitmap ... habitually set to 1, but reset to zero +** local ACK bitmap ... habitually set to 1, but reset to zero ** between ->ack() and ->end() of the interrupt to prevent ** re-interruption of a processing interrupt. */ -static volatile unsigned long global_ack_eiem = ~0UL; -/* -** Local bitmap, same as above but for per-cpu interrupts -*/ static DEFINE_PER_CPU(unsigned long, local_ack_eiem) = ~0UL; static void cpu_disable_irq(unsigned int irq) @@ -94,13 +90,11 @@ void cpu_ack_irq(unsigned int irq) int cpu = smp_processor_id(); /* Clear in EIEM so we can no longer process */ - if (CHECK_IRQ_PER_CPU(irq_desc[irq].status)) - per_cpu(local_ack_eiem, cpu) &= ~mask; - else - global_ack_eiem &= ~mask; + per_cpu(local_ack_eiem, cpu) &= ~mask; /* disable the interrupt */ - set_eiem(cpu_eiem & global_ack_eiem & per_cpu(local_ack_eiem, cpu)); + set_eiem(cpu_eiem & per_cpu(local_ack_eiem, cpu)); + /* and now ack it */ mtctl(mask, 23); } @@ -111,13 +105,10 @@ void cpu_end_irq(unsigned int irq) int cpu = smp_processor_id(); /* set it in the eiems---it's no longer in process */ - if (CHECK_IRQ_PER_CPU(irq_desc[irq].status)) - per_cpu(local_ack_eiem, cpu) |= mask; - else - global_ack_eiem |= mask; + per_cpu(local_ack_eiem, cpu) |= mask; /* enable the interrupt */ - set_eiem(cpu_eiem & global_ack_eiem & per_cpu(local_ack_eiem, cpu)); + set_eiem(cpu_eiem & per_cpu(local_ack_eiem, cpu)); } #ifdef CONFIG_SMP @@ -354,8 +345,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) local_irq_disable(); irq_enter(); - eirr_val = mfctl(23) & cpu_eiem & global_ack_eiem & - per_cpu(local_ack_eiem, cpu); + eirr_val = mfctl(23) & cpu_eiem & per_cpu(local_ack_eiem, cpu); if (!eirr_val) goto set_out; irq = eirr_to_irq(eirr_val); @@ -381,7 +371,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) return; set_out: - set_eiem(cpu_eiem & global_ack_eiem & per_cpu(local_ack_eiem, cpu)); + set_eiem(cpu_eiem & per_cpu(local_ack_eiem, cpu)); goto out; } -- cgit v1.2.3