···1+/*2+ * ATSTK1000 setup code: Daughterboard interface3+ *4+ * Copyright (C) 2007 Atmel Corporation5+ *6+ * This program is free software; you can redistribute it and/or modify7+ * it under the terms of the GNU General Public License version 2 as8+ * published by the Free Software Foundation.9+ */10+#ifndef __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H11+#define __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H12+13+extern struct atmel_lcdfb_info atstk1000_lcdc_data;14+15+#endif /* __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H */
···8 * published by the Free Software Foundation.9 */10#include <linux/bootmem.h>011#include <linux/init.h>12#include <linux/types.h>13#include <linux/linkage.h>1415-#include <asm/setup.h>16017#include <asm/arch/board.h>001819/* Initialized by bootloader-specific startup code. */20struct tag *bootloader_tags __initdata;000000000000000000000000000000000000000
···7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License version 2 as9 * published by the Free Software Foundation.10- *11- * This file contains the code used by various IRQ handling routines:12- * asking for different IRQ's should be done through these routines13- * instead of just grabbing them. Thus setups with different IRQ numbers14- * shouldn't result in any weird surprises, and installing new handlers15- * should be easier.16- *17- * IRQ's are in fact implemented a bit like signal handlers for the kernel.18- * Naturally it's not a 1:1 relation, but there are similarities.19 */2021#include <linux/interrupt.h>
···7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License version 2 as9 * published by the Free Software Foundation.00000000010 */1112#include <linux/interrupt.h>
+1-6
arch/avr32/kernel/kprobes.c
···179 return 1;180}181182-static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)183{184 struct kprobe *cur = kprobe_running();185···214 break;215 case DIE_SSTEP:216 if (post_kprobe_handler(args->regs))217- ret = NOTIFY_STOP;218- break;219- case DIE_FAULT:220- if (kprobe_running()221- && kprobe_fault_handler(args->regs, args->trapnr))222 ret = NOTIFY_STOP;223 break;224 default:
···179 return 1;180}181182+int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)183{184 struct kprobe *cur = kprobe_running();185···214 break;215 case DIE_SSTEP:216 if (post_kprobe_handler(args->regs))00000217 ret = NOTIFY_STOP;218 break;219 default:
+3
arch/avr32/kernel/syscall_table.S
···292 .long sys_shmdt293 .long sys_shmctl294 .long sys_utimensat000295 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */
···6 * published by the Free Software Foundation.7 */8#include <linux/clk.h>9+#include <linux/fb.h>10#include <linux/init.h>11#include <linux/platform_device.h>12#include <linux/spi/spi.h>···16#include <asm/arch/board.h>17#include <asm/arch/portmux.h>18#include <asm/arch/sm.h>19+20+#include <video/atmel_lcdc.h>2122#include "clock.h"23#include "hmatrix.h"···881/* --------------------------------------------------------------------882 * LCDC883 * -------------------------------------------------------------------- */884+static struct atmel_lcdfb_info atmel_lcdfb0_data;885+static struct resource atmel_lcdfb0_resource[] = {886 {887 .start = 0xff000000,888 .end = 0xff000fff,889 .flags = IORESOURCE_MEM,890 },891 IRQ(1),892+ {893+ /* Placeholder for pre-allocated fb memory */894+ .start = 0x00000000,895+ .end = 0x00000000,896+ .flags = 0,897+ },898};899+DEFINE_DEV_DATA(atmel_lcdfb, 0);900+DEV_CLK(hck1, atmel_lcdfb0, hsb, 7);901+static struct clk atmel_lcdfb0_pixclk = {902+ .name = "lcdc_clk",903+ .dev = &atmel_lcdfb0_device.dev,904 .mode = genclk_mode,905 .get_rate = genclk_get_rate,906 .set_rate = genclk_set_rate,···903};904905struct platform_device *__init906+at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,907+ unsigned long fbmem_start, unsigned long fbmem_len)908{909 struct platform_device *pdev;910+ struct atmel_lcdfb_info *info;911+ struct fb_monspecs *monspecs;912+ struct fb_videomode *modedb;913+ unsigned int modedb_size;914+915+ /*916+ * Do a deep copy of the fb data, monspecs and modedb. Make917+ * sure all allocations are done before setting up the918+ * portmux.919+ */920+ monspecs = kmemdup(data->default_monspecs,921+ sizeof(struct fb_monspecs), GFP_KERNEL);922+ if (!monspecs)923+ return NULL;924+925+ modedb_size = sizeof(struct fb_videomode) * monspecs->modedb_len;926+ modedb = kmemdup(monspecs->modedb, modedb_size, GFP_KERNEL);927+ if (!modedb)928+ goto err_dup_modedb;929+ monspecs->modedb = modedb;930931 switch (id) {932 case 0:933+ pdev = &atmel_lcdfb0_device;934 select_peripheral(PC(19), PERIPH_A, 0); /* CC */935 select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */936 select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */···942 select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */943 select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */944945+ clk_set_parent(&atmel_lcdfb0_pixclk, &pll0);946+ clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0));947 break;948949 default:950+ goto err_invalid_id;951 }952953+ if (fbmem_len) {954+ pdev->resource[2].start = fbmem_start;955+ pdev->resource[2].end = fbmem_start + fbmem_len - 1;956+ pdev->resource[2].flags = IORESOURCE_MEM;957+ }958+959+ info = pdev->dev.platform_data;960+ memcpy(info, data, sizeof(struct atmel_lcdfb_info));961+ info->default_monspecs = monspecs;962963 platform_device_register(pdev);964 return pdev;965+966+err_invalid_id:967+ kfree(modedb);968+err_dup_modedb:969+ kfree(monspecs);970+ return NULL;971}972973/* --------------------------------------------------------------------···1037 &macb1_pclk,1038 &atmel_spi0_spi_clk,1039 &atmel_spi1_spi_clk,1040+ &atmel_lcdfb0_hck1,1041+ &atmel_lcdfb0_pixclk,1042 &gclk0,1043 &gclk1,1044 &gclk2,···1077 genclk_init_parent(&gclk2);1078 genclk_init_parent(&gclk3);1079 genclk_init_parent(&gclk4);1080+ genclk_init_parent(&atmel_lcdfb0_pixclk);10811082 /*1083 * Turn on all clocks that have at least one user already, and
+12-24
arch/avr32/mm/fault.c
···12#include <linux/mm.h>13#include <linux/module.h>14#include <linux/pagemap.h>15-16#include <linux/kdebug.h>0017#include <asm/mmu_context.h>18#include <asm/sysreg.h>19#include <asm/tlb.h>20#include <asm/uaccess.h>2122#ifdef CONFIG_KPROBES23-ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);24-25-/* Hook to register for page fault notifications */26-int register_page_fault_notifier(struct notifier_block *nb)27{28- return atomic_notifier_chain_register(¬ify_page_fault_chain, nb);29-}3031-int unregister_page_fault_notifier(struct notifier_block *nb)32-{33- return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb);34-}3536-static inline int notify_page_fault(enum die_val val, struct pt_regs *regs,37- int trap, int sig)38-{39- struct die_args args = {40- .regs = regs,41- .trapnr = trap,42- };43- return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);44}45#else46-static inline int notify_page_fault(enum die_val val, struct pt_regs *regs,47- int trap, int sig)48{49- return NOTIFY_DONE;50}51#endif52···65 long signr;66 int code;6768- if (notify_page_fault(DIE_PAGE_FAULT, regs,69- ecr, SIGSEGV) == NOTIFY_STOP)70 return;7172 address = sysreg_read(TLBEAR);
···12#include <linux/mm.h>13#include <linux/module.h>14#include <linux/pagemap.h>015#include <linux/kdebug.h>16+#include <linux/kprobes.h>17+18#include <asm/mmu_context.h>19#include <asm/sysreg.h>20#include <asm/tlb.h>21#include <asm/uaccess.h>2223#ifdef CONFIG_KPROBES24+static inline int notify_page_fault(struct pt_regs *regs, int trap)00025{26+ int ret = 0;02728+ if (!user_mode(regs)) {29+ if (kprobe_running() && kprobe_fault_handler(regs, trap))30+ ret = 1;31+ }3233+ return ret;000000034}35#else36+static inline int notify_page_fault(struct pt_regs *regs, int trap)037{38+ return 0;39}40#endif41···76 long signr;77 int code;7879+ if (notify_page_fault(regs, ecr))080 return;8182 address = sysreg_read(TLBEAR);
+1-1
arch/ia64/kernel/acpi.c
···791early_param("additional_cpus", setup_additional_cpus);792793/*794- * cpu_possible_map should be static, it cannot change as cpu's795 * are onlined, or offlined. The reason is per-cpu data-structures796 * are allocated by some modules at init time, and dont expect to797 * do this dynamically on cpu arrival/departure.
···791early_param("additional_cpus", setup_additional_cpus);792793/*794+ * cpu_possible_map should be static, it cannot change as CPUs795 * are onlined, or offlined. The reason is per-cpu data-structures796 * are allocated by some modules at init time, and dont expect to797 * do this dynamically on cpu arrival/departure.
+16-8
arch/ia64/kernel/crash.c
···156 if (!kdump_on_init)157 return NOTIFY_DONE;158159- if (val != DIE_INIT_MONARCH_ENTER &&160- val != DIE_INIT_SLAVE_ENTER &&0161 val != DIE_MCA_RENDZVOUS_LEAVE &&162 val != DIE_MCA_MONARCH_LEAVE)163 return NOTIFY_DONE;164165 nd = (struct ia64_mca_notify_die *)args->err;166- /* Reason code 1 means machine check rendezous*/167- if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) &&168- nd->sos->rv_rc == 1)169 return NOTIFY_DONE;170171 switch (val) {172- case DIE_INIT_MONARCH_ENTER:0000173 machine_kdump_on_init();174 break;175- case DIE_INIT_SLAVE_ENTER:176- unw_init_running(kdump_cpu_freeze, NULL);0177 break;178 case DIE_MCA_RENDZVOUS_LEAVE:179 if (atomic_read(&kdump_in_progress))···221static int222machine_crash_setup(void)223{0224 static struct notifier_block kdump_init_notifier_nb = {225 .notifier_call = kdump_init_notifier,0226 };227 int ret;228 if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0)
···156 if (!kdump_on_init)157 return NOTIFY_DONE;158159+ if (val != DIE_INIT_MONARCH_LEAVE &&160+ val != DIE_INIT_SLAVE_LEAVE &&161+ val != DIE_INIT_MONARCH_PROCESS &&162 val != DIE_MCA_RENDZVOUS_LEAVE &&163 val != DIE_MCA_MONARCH_LEAVE)164 return NOTIFY_DONE;165166 nd = (struct ia64_mca_notify_die *)args->err;167+ /* Reason code 1 means machine check rendezvous*/168+ if ((val == DIE_INIT_MONARCH_LEAVE || val == DIE_INIT_SLAVE_LEAVE169+ || val == DIE_INIT_MONARCH_PROCESS) && nd->sos->rv_rc == 1)170 return NOTIFY_DONE;171172 switch (val) {173+ case DIE_INIT_MONARCH_PROCESS:174+ atomic_set(&kdump_in_progress, 1);175+ *(nd->monarch_cpu) = -1;176+ break;177+ case DIE_INIT_MONARCH_LEAVE:178 machine_kdump_on_init();179 break;180+ case DIE_INIT_SLAVE_LEAVE:181+ if (atomic_read(&kdump_in_progress))182+ unw_init_running(kdump_cpu_freeze, NULL);183 break;184 case DIE_MCA_RENDZVOUS_LEAVE:185 if (atomic_read(&kdump_in_progress))···215static int216machine_crash_setup(void)217{218+ /* be notified before default_monarch_init_process */219 static struct notifier_block kdump_init_notifier_nb = {220 .notifier_call = kdump_init_notifier,221+ .priority = 1,222 };223 int ret;224 if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0)
+3
arch/ia64/kernel/entry.S
···1585 data8 sys_getcpu1586 data8 sys_epoll_pwait // 13051587 data8 sys_utimensat00015881589 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
···4 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar5 *6 * This file contains the code used by various IRQ handling routines:7- * asking for different IRQ's should be done through these routines8 * instead of just grabbing them. Thus setups with different IRQ numbers9 * shouldn't result in any weird surprises, and installing new handlers10 * should be easier.···12 * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 200413 *14 * 4/14/2004: Added code to handle cpu migration and do safe irq15- * migration without lossing interrupts for iosapic16 * architecture.17 */18···190 }191192 /*193- * Phase 1: Locate irq's bound to this cpu and194 * relocate them for cpu removal.195 */196 migrate_irqs();
···4 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar5 *6 * This file contains the code used by various IRQ handling routines:7+ * asking for different IRQs should be done through these routines8 * instead of just grabbing them. Thus setups with different IRQ numbers9 * shouldn't result in any weird surprises, and installing new handlers10 * should be easier.···12 * Copyright (C) Ashok Raj<ashok.raj@intel.com>, Intel Corporation 200413 *14 * 4/14/2004: Added code to handle cpu migration and do safe irq15+ * migration without losing interrupts for iosapic16 * architecture.17 */18···190 }191192 /*193+ * Phase 1: Locate IRQs bound to this cpu and194 * relocate them for cpu removal.195 */196 migrate_irqs();
+1-1
arch/ia64/kernel/irq_lsapic.c
···23static void24lsapic_noop (unsigned int irq)25{26- /* nuthing to do... */27}2829static int lsapic_retrigger(unsigned int irq)
···23static void24lsapic_noop (unsigned int irq)25{26+ /* nothing to do... */27}2829static int lsapic_retrigger(unsigned int irq)
+4-11
arch/ia64/kernel/kprobes.c
···151152 cmp_inst.l = kprobe_inst;153 if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) {154- /* Integere compare - Register Register (A6 type)*/155 if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0)156 &&(cmp_inst.f.c == 1))157 ctype_unc = 1;158 } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) {159- /* Integere compare - Immediate Register (A8 type)*/160 if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1))161 ctype_unc = 1;162 }···820 return 1;821}822823-static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)824{825 struct kprobe *cur = kprobe_running();826 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();···904 if (post_kprobes_handler(args->regs))905 ret = NOTIFY_STOP;906 break;907- case DIE_PAGE_FAULT:908- /* kprobe_running() needs smp_processor_id() */909- preempt_disable();910- if (kprobe_running() &&911- kprobes_fault_handler(args->regs, args->trapnr))912- ret = NOTIFY_STOP;913- preempt_enable();914 default:915 break;916 }···947 /*948 * Callee owns the argument space and could overwrite it, eg949 * tail call optimization. So to be absolutely safe950- * we save the argument space before transfering the control951 * to instrumented jprobe function which runs in952 * the process context953 */
···151152 cmp_inst.l = kprobe_inst;153 if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) {154+ /* Integer compare - Register Register (A6 type)*/155 if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0)156 &&(cmp_inst.f.c == 1))157 ctype_unc = 1;158 } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) {159+ /* Integer compare - Immediate Register (A8 type)*/160 if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1))161 ctype_unc = 1;162 }···820 return 1;821}822823+int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)824{825 struct kprobe *cur = kprobe_running();826 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();···904 if (post_kprobes_handler(args->regs))905 ret = NOTIFY_STOP;906 break;0000000907 default:908 break;909 }···954 /*955 * Callee owns the argument space and could overwrite it, eg956 * tail call optimization. So to be absolutely safe957+ * we save the argument space before transferring the control958 * to instrumented jprobe function which runs in959 * the process context960 */
+4-1
arch/ia64/kernel/mca.c
···273274 mlogbuf_finished = 1;275}276-EXPORT_SYMBOL(ia64_mlogbuf_finish);277278/*279 * Print buffered messages from INIT context.···1476 struct task_struct *g, *t;1477 if (val != DIE_INIT_MONARCH_PROCESS)1478 return NOTIFY_DONE;000014791480 /*1481 * FIXME: mlogbuf will brim over with INIT stack dumps.
···273274 mlogbuf_finished = 1;275}0276277/*278 * Print buffered messages from INIT context.···1477 struct task_struct *g, *t;1478 if (val != DIE_INIT_MONARCH_PROCESS)1479 return NOTIFY_DONE;1480+#ifdef CONFIG_KEXEC1481+ if (atomic_read(&kdump_in_progress))1482+ return NOTIFY_DONE;1483+#endif14841485 /*1486 * FIXME: mlogbuf will brim over with INIT stack dumps.
+2-2
arch/ia64/kernel/mca_drv.c
···438 * @peidx: pointer of index of processor error section439 *440 * Return value:441- * target address on Success / 0 on Failue442 */443static u64444get_target_identifier(peidx_table_t *peidx)···701 return fatal_mca("External bus check fatal status");702703 /*704- * This is a local MCA and estimated as a recoverble error.705 */706 if (platform)707 return recover_from_platform_error(slidx, peidx, pbci, sos);
···438 * @peidx: pointer of index of processor error section439 *440 * Return value:441+ * target address on Success / 0 on Failure442 */443static u64444get_target_identifier(peidx_table_t *peidx)···701 return fatal_mca("External bus check fatal status");702703 /*704+ * This is a local MCA and estimated as a recoverable error.705 */706 if (platform)707 return recover_from_platform_error(slidx, peidx, pbci, sos);
+1-1
arch/ia64/kernel/module.c
···861/*862 * Modules contain a single unwind table which covers both the core and the init text863 * sections but since the two are not contiguous, we need to split this table up such that864- * we can register (and unregister) each "segment" seperately. Fortunately, this sounds865 * more complicated than it really is.866 */867static void
···861/*862 * Modules contain a single unwind table which covers both the core and the init text863 * sections but since the two are not contiguous, we need to split this table up such that864+ * we can register (and unregister) each "segment" separately. Fortunately, this sounds865 * more complicated than it really is.866 */867static void
+9-9
arch/ia64/kernel/perfmon.c
···1318{1319 unsigned long flags;1320 /*1321- * validy checks on cpu_mask have been done upstream1322 */1323 LOCK_PFS(flags);1324···1384{1385 unsigned long flags;1386 /*1387- * validy checks on cpu_mask have been done upstream1388 */1389 LOCK_PFS(flags);1390···1835 /*1836 * remove our file from the async queue, if we use this mode.1837 * This can be done without the context being protected. We come1838- * here when the context has become unreacheable by other tasks.1839 *1840 * We may still have active monitoring at this point and we may1841 * end up in pfm_overflow_handler(). However, fasync_helper()···2132 filp->private_data = NULL;21332134 /*2135- * if we free on the spot, the context is now completely unreacheable2136 * from the callers side. The monitored task side is also cut, so we2137 * can freely cut.2138 *···2562 ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1;25632564 /*2565- * bitmask of all PMDs that are accesible to this context2566 */2567 ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0];2568···3395 if (unlikely(!PMD_IS_IMPL(cnum))) goto error;3396 /*3397 * we can only read the register that we use. That includes3398- * the one we explicitely initialize AND the one we want included3399 * in the sampling buffer (smpl_regs).3400 *3401 * Having this restriction allows optimization in the ctxsw routine···3715 * if non-blocking, then we ensure that the task will go into3716 * pfm_handle_work() before returning to user mode.3717 *3718- * We cannot explicitely reset another task, it MUST always3719 * be done by the task itself. This works for system wide because3720 * the tool that is controlling the session is logically doing 3721 * "self-monitoring".···4644 switch(state) {4645 case PFM_CTX_UNLOADED:4646 /*4647- * only comes to thios function if pfm_context is not NULL, i.e., cannot4648 * be in unloaded state4649 */4650 printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid);···52475248/*5249 * main overflow processing routine.5250- * it can be called from the interrupt path or explicitely during the context switch code5251 */5252static void5253pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs)
···1318{1319 unsigned long flags;1320 /*1321+ * validity checks on cpu_mask have been done upstream1322 */1323 LOCK_PFS(flags);1324···1384{1385 unsigned long flags;1386 /*1387+ * validity checks on cpu_mask have been done upstream1388 */1389 LOCK_PFS(flags);1390···1835 /*1836 * remove our file from the async queue, if we use this mode.1837 * This can be done without the context being protected. We come1838+ * here when the context has become unreachable by other tasks.1839 *1840 * We may still have active monitoring at this point and we may1841 * end up in pfm_overflow_handler(). However, fasync_helper()···2132 filp->private_data = NULL;21332134 /*2135+ * if we free on the spot, the context is now completely unreachable2136 * from the callers side. The monitored task side is also cut, so we2137 * can freely cut.2138 *···2562 ctx->ctx_all_pmcs[0] = pmu_conf->impl_pmcs[0] & ~0x1;25632564 /*2565+ * bitmask of all PMDs that are accessible to this context2566 */2567 ctx->ctx_all_pmds[0] = pmu_conf->impl_pmds[0];2568···3395 if (unlikely(!PMD_IS_IMPL(cnum))) goto error;3396 /*3397 * we can only read the register that we use. That includes3398+ * the one we explicitly initialize AND the one we want included3399 * in the sampling buffer (smpl_regs).3400 *3401 * Having this restriction allows optimization in the ctxsw routine···3715 * if non-blocking, then we ensure that the task will go into3716 * pfm_handle_work() before returning to user mode.3717 *3718+ * We cannot explicitly reset another task, it MUST always3719 * be done by the task itself. This works for system wide because3720 * the tool that is controlling the session is logically doing 3721 * "self-monitoring".···4644 switch(state) {4645 case PFM_CTX_UNLOADED:4646 /*4647+ * only comes to this function if pfm_context is not NULL, i.e., cannot4648 * be in unloaded state4649 */4650 printk(KERN_ERR "perfmon: pfm_exit_thread [%d] ctx unloaded\n", task->pid);···52475248/*5249 * main overflow processing routine.5250+ * it can be called from the interrupt path or explicitly during the context switch code5251 */5252static void5253pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs)
+1-1
arch/ia64/kernel/perfmon_mckinley.h
···181 .pmc_desc = pfm_mck_pmc_desc,182 .num_ibrs = 8,183 .num_dbrs = 8,184- .use_rr_dbregs = 1 /* debug register are use for range retrictions */185};186187
···181 .pmc_desc = pfm_mck_pmc_desc,182 .num_ibrs = 8,183 .num_dbrs = 8,184+ .use_rr_dbregs = 1 /* debug register are use for range restrictions */185};186187
+1-1
arch/ia64/kernel/sal.c
···134 * interrupt redirection. The reason is this would require that135 * All interrupts be stopped and hard bind the irq to a cpu.136 * Later when the interrupt is fired we need to set the redir hint137- * on again in the vector. This is combersome for something that the138 * user mode irq balancer will solve anyways.139 */140 no_int_routing=1;
···134 * interrupt redirection. The reason is this would require that135 * All interrupts be stopped and hard bind the irq to a cpu.136 * Later when the interrupt is fired we need to set the redir hint137+ * on again in the vector. This is cumbersome for something that the138 * user mode irq balancer will solve anyways.139 */140 no_int_routing=1;
+1-1
arch/ia64/kernel/salinfo.c
···162/** salinfo_platform_oemdata - optional callback to decode oemdata from an error163 * record.164 * @sect_header: pointer to the start of the section to decode.165- * @oemdata: returns vmalloc area containing the decded output.166 * @oemdata_size: returns length of decoded output (strlen).167 *168 * Description: If user space asks for oem data to be decoded by the kernel
···162/** salinfo_platform_oemdata - optional callback to decode oemdata from an error163 * record.164 * @sect_header: pointer to the start of the section to decode.165+ * @oemdata: returns vmalloc area containing the decoded output.166 * @oemdata_size: returns length of decoded output (strlen).167 *168 * Description: If user space asks for oem data to be decoded by the kernel
+3-3
arch/ia64/kernel/setup.c
···576}577578/*579- * Display cpu info for all cpu's.580 */581static int582show_cpuinfo (struct seq_file *m, void *v)···761 c->cpu = smp_processor_id();762763 /* below default values will be overwritten by identify_siblings() 764- * for Multi-Threading/Multi-Core capable cpu's765 */766 c->threads_per_core = c->cores_per_socket = c->num_log = 1;767 c->socket_id = -1;···947 ia32_cpu_init();948#endif949950- /* Clear ITC to eliminiate sched_clock() overflows in human time. */951 ia64_set_itc(0);952953 /* disable all local interrupt sources: */
···576}577578/*579+ * Display cpu info for all CPUs.580 */581static int582show_cpuinfo (struct seq_file *m, void *v)···761 c->cpu = smp_processor_id();762763 /* below default values will be overwritten by identify_siblings() 764+ * for Multi-Threading/Multi-Core capable CPUs765 */766 c->threads_per_core = c->cores_per_socket = c->num_log = 1;767 c->socket_id = -1;···947 ia32_cpu_init();948#endif949950+ /* Clear ITC to eliminate sched_clock() overflows in human time. */951 ia64_set_itc(0);952953 /* disable all local interrupt sources: */
+6-6
arch/ia64/kernel/smp.c
···186}187188/*189- * Called with preeemption disabled.190 */191static inline void192send_IPI_single (int dest_cpu, int op)···196}197198/*199- * Called with preeemption disabled.200 */201static inline void202send_IPI_allbutself (int op)···210}211212/*213- * Called with preeemption disabled.214 */215static inline void216send_IPI_all (int op)···223}224225/*226- * Called with preeemption disabled.227 */228static inline void229send_IPI_self (int op)···252}253#endif254/*255- * Called with preeemption disabled.256 */257void258smp_send_reschedule (int cpu)···261}262263/*264- * Called with preeemption disabled.265 */266static void267smp_send_local_flush_tlb (int cpu)
···186}187188/*189+ * Called with preemption disabled.190 */191static inline void192send_IPI_single (int dest_cpu, int op)···196}197198/*199+ * Called with preemption disabled.200 */201static inline void202send_IPI_allbutself (int op)···210}211212/*213+ * Called with preemption disabled.214 */215static inline void216send_IPI_all (int op)···223}224225/*226+ * Called with preemption disabled.227 */228static inline void229send_IPI_self (int op)···252}253#endif254/*255+ * Called with preemption disabled.256 */257void258smp_send_reschedule (int cpu)···261}262263/*264+ * Called with preemption disabled.265 */266static void267smp_send_local_flush_tlb (int cpu)
+3-3
arch/ia64/kernel/smpboot.c
···694 set_cpei_target_cpu(new_cpei_cpu);695 desc = irq_desc + ia64_cpe_irq;696 /*697- * Switch for now, immediatly, we need to do fake intr698 * as other interrupts, but need to study CPEI behaviour with699 * polling before making changes.700 */···840}841842/*843- * Assume that CPU's have been discovered by some platform-dependent interface. For844 * SoftSDV/Lion, that would be ACPI.845 *846 * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP().···854 } *ap_startup;855 long sal_ret;856857- /* Tell SAL where to drop the AP's. */858 ap_startup = (struct fptr *) start_ap;859 sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ,860 ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0);
···694 set_cpei_target_cpu(new_cpei_cpu);695 desc = irq_desc + ia64_cpe_irq;696 /*697+ * Switch for now, immediately, we need to do fake intr698 * as other interrupts, but need to study CPEI behaviour with699 * polling before making changes.700 */···840}841842/*843+ * Assume that CPUs have been discovered by some platform-dependent interface. For844 * SoftSDV/Lion, that would be ACPI.845 *846 * Setup of the IPI irq handler is done in irq.c:init_IRQ_SMP().···854 } *ap_startup;855 long sal_ret;856857+ /* Tell SAL where to drop the APs. */858 ap_startup = (struct fptr *) start_ap;859 sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ,860 ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0);
+1-1
arch/ia64/kernel/traps.c
···304 * Lower 4 bits are used as a count. Upper bits are a sequence305 * number that is updated when count is reset. The cmpxchg will306 * fail is seqno has changed. This minimizes mutiple cpus307- * reseting the count.308 */309 if (current_jiffies > last.time)310 (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15));
···304 * Lower 4 bits are used as a count. Upper bits are a sequence305 * number that is updated when count is reset. The cmpxchg will306 * fail is seqno has changed. This minimizes mutiple cpus307+ * resetting the count.308 */309 if (current_jiffies > last.time)310 (void) cmpxchg_acq(&last.count, count, 16 + (count & ~15));
+1-1
arch/ia64/kernel/unwind.c
···2 * Copyright (C) 1999-2004 Hewlett-Packard Co3 * David Mosberger-Tang <davidm@hpl.hp.com>4 * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com>5- * - Change pt_regs_off() to make it less dependant on pt_regs structure.6 */7/*8 * This file implements call frame unwind support for the Linux
···2 * Copyright (C) 1999-2004 Hewlett-Packard Co3 * David Mosberger-Tang <davidm@hpl.hp.com>4 * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com>5+ * - Change pt_regs_off() to make it less dependent on pt_regs structure.6 */7/*8 * This file implements call frame unwind support for the Linux
+1-1
arch/ia64/mm/discontig.c
···317 * node_online_map is not set for hot-added nodes at this time,318 * because we are halfway through initialization of the new node's319 * structures. If for_each_online_node() is used, a new node's320- * pg_data_ptrs will be not initialized. Insted of using it,321 * pgdat_list[] is checked.322 */323 for_each_node(node) {
···317 * node_online_map is not set for hot-added nodes at this time,318 * because we are halfway through initialization of the new node's319 * structures. If for_each_online_node() is used, a new node's320+ * pg_data_ptrs will be not initialized. Instead of using it,321 * pgdat_list[] is checked.322 */323 for_each_node(node) {
+13-26
arch/ia64/mm/fault.c
···19extern void die (char *, struct pt_regs *, long);2021#ifdef CONFIG_KPROBES22-ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);23-24-/* Hook to register for page fault notifications */25-int register_page_fault_notifier(struct notifier_block *nb)26{27- return atomic_notifier_chain_register(¬ify_page_fault_chain, nb);28-}2930-int unregister_page_fault_notifier(struct notifier_block *nb)31-{32- return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb);33-}0003435-static inline int notify_page_fault(enum die_val val, const char *str,36- struct pt_regs *regs, long err, int trap, int sig)37-{38- struct die_args args = {39- .regs = regs,40- .str = str,41- .err = err,42- .trapnr = trap,43- .signr = sig44- };45- return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);46}47#else48-static inline int notify_page_fault(enum die_val val, const char *str,49- struct pt_regs *regs, long err, int trap, int sig)50{51- return NOTIFY_DONE;52}53#endif54···105 /*106 * This is to handle the kprobes on user space access instructions107 */108- if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT,109- SIGSEGV) == NOTIFY_STOP)110 return;111112 down_read(&mm->mmap_sem);
···19extern void die (char *, struct pt_regs *, long);2021#ifdef CONFIG_KPROBES22+static inline int notify_page_fault(struct pt_regs *regs, int trap)00023{24+ int ret = 0;02526+ if (!user_mode(regs)) {27+ /* kprobe_running() needs smp_processor_id() */28+ preempt_disable();29+ if (kprobe_running() && kprobes_fault_handler(regs, trap))30+ ret = 1;31+ preempt_enable();32+ }3334+ return ret;000000000035}36#else37+static inline int notify_page_fault(struct pt_regs *regs, int trap)038{39+ return 0;40}41#endif42···117 /*118 * This is to handle the kprobes on user space access instructions119 */120+ if (notify_page_fault(regs, TRAP_BRKPT))0121 return;122123 down_read(&mm->mmap_sem);
+6-6
arch/ia64/sn/kernel/bte.c
···63 * Use the block transfer engine to move kernel memory from src to dest64 * using the assigned mode.65 *66- * Paramaters:67 * src - physical address of the transfer source.68 * dest - physical address of the transfer destination.69 * len - number of bytes to transfer from source to dest.···247 * use the block transfer engine to move kernel248 * memory from src to dest using the assigned mode.249 *250- * Paramaters:251 * src - physical address of the transfer source.252 * dest - physical address of the transfer destination.253 * len - number of bytes to transfer from source to dest.···255 * for IBCT0/1 in the SGI documentation.256 *257 * NOTE: If the source, dest, and len are all cache line aligned,258- * then it would be _FAR_ preferrable to use bte_copy instead.259 */260bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)261{···300 * a standard bte copy.301 *302 * One nasty exception to the above rule is when the303- * source and destination are not symetrically304 * mis-aligned. If the source offset from the first305 * cache line is different from the destination offset,306 * we make the first section be the entire transfer···337338 if (footBcopyDest == (headBcopyDest + headBcopyLen)) {339 /*340- * We have two contigous bcopy341 * blocks. Merge them.342 */343 headBcopyLen += footBcopyLen;···375 } else {376377 /*378- * The transfer is not symetric, we will379 * allocate a buffer large enough for all the380 * data, bte_copy into that buffer and then381 * bcopy to the destination.
···63 * Use the block transfer engine to move kernel memory from src to dest64 * using the assigned mode.65 *66+ * Parameters:67 * src - physical address of the transfer source.68 * dest - physical address of the transfer destination.69 * len - number of bytes to transfer from source to dest.···247 * use the block transfer engine to move kernel248 * memory from src to dest using the assigned mode.249 *250+ * Parameters:251 * src - physical address of the transfer source.252 * dest - physical address of the transfer destination.253 * len - number of bytes to transfer from source to dest.···255 * for IBCT0/1 in the SGI documentation.256 *257 * NOTE: If the source, dest, and len are all cache line aligned,258+ * then it would be _FAR_ preferable to use bte_copy instead.259 */260bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)261{···300 * a standard bte copy.301 *302 * One nasty exception to the above rule is when the303+ * source and destination are not symmetrically304 * mis-aligned. If the source offset from the first305 * cache line is different from the destination offset,306 * we make the first section be the entire transfer···337338 if (footBcopyDest == (headBcopyDest + headBcopyLen)) {339 /*340+ * We have two contiguous bcopy341 * blocks. Merge them.342 */343 headBcopyLen += footBcopyLen;···375 } else {376377 /*378+ * The transfer is not symmetric, we will379 * allocate a buffer large enough for all the380 * data, bte_copy into that buffer and then381 * bcopy to the destination.
+2-2
arch/ia64/sn/kernel/bte_error.c
···105 }106107 BTE_PRINTK(("eh:%p:%d Cleaning up\n", err_nodepda, smp_processor_id()));108- /* Reenable both bte interfaces */109 imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM);110 imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1;111 REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval);···243244 /*245 * The caller has already figured out the error type, we save that246- * in the bte handle structure for the thread excercising the247 * interface to consume.248 */249 bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET;
···105 }106107 BTE_PRINTK(("eh:%p:%d Cleaning up\n", err_nodepda, smp_processor_id()));108+ /* Re-enable both bte interfaces */109 imem.ii_imem_regval = REMOTE_HUB_L(nasid, IIO_IMEM);110 imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1;111 REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval);···243244 /*245 * The caller has already figured out the error type, we save that246+ * in the bte handle structure for the thread exercising the247 * interface to consume.248 */249 bte->bh_error = ioe->ie_errortype + BTEFAIL_OFFSET;
+1-1
arch/ia64/sn/kernel/io_common.c
···479 }480481 /*482- * prime sn_pci_provider[]. Individial provider init routines will483 * override their respective default entries.484 */485
···479 }480481 /*482+ * prime sn_pci_provider[]. Individual provider init routines will483 * override their respective default entries.484 */485
+1-1
arch/ia64/sn/kernel/setup.c
···167 * IO on SN2 is done via SAL calls, early_printk won't work without this.168 *169 * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c.170- * Any changes to those file may have to be made hereas well.171 */172 efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab);173 config_tables = __va(efi_systab->tables);
···167 * IO on SN2 is done via SAL calls, early_printk won't work without this.168 *169 * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c.170+ * Any changes to those file may have to be made here as well.171 */172 efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab);173 config_tables = __va(efi_systab->tables);
+1-1
arch/ia64/sn/kernel/sn2/sn2_smp.c
···104 *105 * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order.106 * Context switching user threads which have memory-mapped MMIO may cause107- * PIOs to issue from seperate CPUs, thus the PIO writes must be drained108 * from the previous CPU's Shub before execution resumes on the new CPU.109 */110void sn_migrate(struct task_struct *task)
···104 *105 * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order.106 * Context switching user threads which have memory-mapped MMIO may cause107+ * PIOs to issue from separate CPUs, thus the PIO writes must be drained108 * from the previous CPU's Shub before execution resumes on the new CPU.109 */110void sn_migrate(struct task_struct *task)
+4-4
arch/ia64/sn/kernel/xpc_channel.c
···293294295/*296- * Pull the remote per partititon specific variables from the specified297 * partition.298 */299enum xpc_retval···461 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between462 // >>> iterations of the for-loop, bail if set?463464- // >>> should we impose a minumum #of entries? like 4 or 8?465 for (nentries = ch->local_nentries; nentries > 0; nentries--) {466467 nbytes = nentries * ch->msg_size;···514 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between515 // >>> iterations of the for-loop, bail if set?516517- // >>> should we impose a minumum #of entries? like 4 or 8?518 for (nentries = ch->remote_nentries; nentries > 0; nentries--) {519520 nbytes = nentries * ch->msg_size;···147814791480 /*1481- * Before proceding with the teardown we have to wait until all1482 * existing references cease.1483 */1484 wait_event(part->teardown_wq, (atomic_read(&part->references) == 0));
···293294295/*296+ * Pull the remote per partition specific variables from the specified297 * partition.298 */299enum xpc_retval···461 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between462 // >>> iterations of the for-loop, bail if set?463464+ // >>> should we impose a minimum #of entries? like 4 or 8?465 for (nentries = ch->local_nentries; nentries > 0; nentries--) {466467 nbytes = nentries * ch->msg_size;···514 // >>> may want to check for ch->flags & XPC_C_DISCONNECTING between515 // >>> iterations of the for-loop, bail if set?516517+ // >>> should we impose a minimum #of entries? like 4 or 8?518 for (nentries = ch->remote_nentries; nentries > 0; nentries--) {519520 nbytes = nentries * ch->msg_size;···147814791480 /*1481+ * Before proceeding with the teardown we have to wait until all1482 * existing references cease.1483 */1484 wait_event(part->teardown_wq, (atomic_read(&part->references) == 0));
+1-1
arch/ia64/sn/kernel/xpnet.c
···531 dev_dbg(xpnet, "destination Partitions mask (dp) = 0x%lx\n", dp);532533 /*534- * If we wanted to allow promiscous mode to work like an535 * unswitched network, this would be a good point to OR in a536 * mask of partitions which should be receiving all packets.537 */
···531 dev_dbg(xpnet, "destination Partitions mask (dp) = 0x%lx\n", dp);532533 /*534+ * If we wanted to allow promiscuous mode to work like an535 * unswitched network, this would be a good point to OR in a536 * mask of partitions which should be receiving all packets.537 */
+4-4
arch/ia64/sn/pci/pci_dma.c
···333 /*334 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work335 * around hw issues at the pci bus level. SGI proms older than336- * 4.10 don't implment this.337 */338339 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,···348 /*349 * If the above failed, retry using the SAL_PROBE call which should350 * be present in all proms (but which cannot work round PCI chipset351- * bugs). This code is retained for compatability with old352 * pre-4.10 proms, and should be removed at some point in the future.353 */354···379 /*380 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work381 * around hw issues at the pci bus level. SGI proms older than382- * 4.10 don't implment this.383 */384385 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,···394 /*395 * If the above failed, retry using the SAL_PROBE call which should396 * be present in all proms (but which cannot work round PCI chipset397- * bugs). This code is retained for compatability with old398 * pre-4.10 proms, and should be removed at some point in the future.399 */400
···333 /*334 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work335 * around hw issues at the pci bus level. SGI proms older than336+ * 4.10 don't implement this.337 */338339 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,···348 /*349 * If the above failed, retry using the SAL_PROBE call which should350 * be present in all proms (but which cannot work round PCI chipset351+ * bugs). This code is retained for compatibility with old352 * pre-4.10 proms, and should be removed at some point in the future.353 */354···379 /*380 * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work381 * around hw issues at the pci bus level. SGI proms older than382+ * 4.10 don't implement this.383 */384385 SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE,···394 /*395 * If the above failed, retry using the SAL_PROBE call which should396 * be present in all proms (but which cannot work round PCI chipset397+ * bugs). This code is retained for compatibility with old398 * pre-4.10 proms, and should be removed at some point in the future.399 */400
+3-3
arch/ia64/sn/pci/pcibr/pcibr_ate.c
···3031/*32 * find_free_ate: Find the first free ate index starting from the given33- * index for the desired consequtive count.34 */35static int find_free_ate(struct ate_resource *ate_resource, int start,36 int count)···88 return -1;8990 /*91- * Find the required number of free consequtive ates.92 */93 start_index =94 find_free_ate(ate_resource, ate_resource->lowest_free_index,···105/*106 * Allocate "count" contiguous Bridge Address Translation Entries107 * on the specified bridge to be used for PCI to XTALK mappings.108- * Indices in rm map range from 1..num_entries. Indicies returned109 * to caller range from 0..num_entries-1.110 *111 * Return the start index on success, -1 on failure.
···3031/*32 * find_free_ate: Find the first free ate index starting from the given33+ * index for the desired consecutive count.34 */35static int find_free_ate(struct ate_resource *ate_resource, int start,36 int count)···88 return -1;8990 /*91+ * Find the required number of free consecutive ates.92 */93 start_index =94 find_free_ate(ate_resource, ate_resource->lowest_free_index,···105/*106 * Allocate "count" contiguous Bridge Address Translation Entries107 * on the specified bridge to be used for PCI to XTALK mappings.108+ * Indices in rm map range from 1..num_entries. Indices returned109 * to caller range from 0..num_entries-1.110 *111 * Return the start index on success, -1 on failure.
+1-1
arch/ia64/sn/pci/pcibr/pcibr_dma.c
···201}202203/*204- * Wrapper routine for free'ing DMA maps205 * DMA mappings for Direct 64 and 32 do not have any DMA maps.206 */207void
···201}202203/*204+ * Wrapper routine for freeing DMA maps205 * DMA mappings for Direct 64 and 32 do not have any DMA maps.206 */207void
+3-3
arch/ia64/sn/pci/tioca_provider.c
···223224 /*225 * Scan all vga controllers on this bus making sure they all226- * suport FW. If not, return.227 */228229 list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) {···364 * @req_size: len (bytes) to map365 *366 * Map @paddr into CA address space using the GART mechanism. The mapped367- * dma_addr_t is guarenteed to be contiguous in CA bus space.368 */369static dma_addr_t370tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size)···526 return 0;527528 /*529- * If card is 64 or 48 bit addresable, use a direct mapping. 32530 * bit direct is so restrictive w.r.t. where the memory resides that531 * we don't use it even though CA has some support.532 */
···223224 /*225 * Scan all vga controllers on this bus making sure they all226+ * support FW. If not, return.227 */228229 list_for_each_entry(pdev, tioca_kern->ca_devices, bus_list) {···364 * @req_size: len (bytes) to map365 *366 * Map @paddr into CA address space using the GART mechanism. The mapped367+ * dma_addr_t is guaranteed to be contiguous in CA bus space.368 */369static dma_addr_t370tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size)···526 return 0;527528 /*529+ * If card is 64 or 48 bit addressable, use a direct mapping. 32530 * bit direct is so restrictive w.r.t. where the memory resides that531 * we don't use it even though CA has some support.532 */
+8-8
arch/ia64/sn/pci/tioce_provider.c
···256 * @ct_addr: the coretalk address to map257 * @len: number of bytes to map258 *259- * Given the addressing type, set up various paramaters that define the260 * ATE pool to use. Search for a contiguous block of entries to cover the261- * length, and if enough resources exist, fill in the ATE's and construct a262 * tioce_dmamap struct to track the mapping.263 */264static u64···581 */582 if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) {583 /*584- * We have two options for 40-bit mappings: 16GB "super" ATE's585- * and 64MB "regular" ATE's. We'll try both if needed for a586 * given mapping but which one we try first depends on the587 * size. For requests >64MB, prefer to use a super page with588 * regular as the fallback. Otherwise, try in the reverse order.···687}688689/**690- * tioce_reserve_m32 - reserve M32 ate's for the indicated address range691- * @tioce_kernel: TIOCE context to reserve ate's for692 * @base: starting bus address to reserve693 * @limit: last bus address to reserve694 *···763764 /*765 * Set PMU pagesize to the largest size available, and zero out766- * the ate's.767 */768769 tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base;···784 }785786 /*787- * Reserve ATE's corresponding to reserved address ranges. These788 * include:789 *790 * Memory space covered by each PPB mem base/limit register
···256 * @ct_addr: the coretalk address to map257 * @len: number of bytes to map258 *259+ * Given the addressing type, set up various parameters that define the260 * ATE pool to use. Search for a contiguous block of entries to cover the261+ * length, and if enough resources exist, fill in the ATEs and construct a262 * tioce_dmamap struct to track the mapping.263 */264static u64···581 */582 if (!mapaddr && !barrier && dma_mask >= 0xffffffffffUL) {583 /*584+ * We have two options for 40-bit mappings: 16GB "super" ATEs585+ * and 64MB "regular" ATEs. We'll try both if needed for a586 * given mapping but which one we try first depends on the587 * size. For requests >64MB, prefer to use a super page with588 * regular as the fallback. Otherwise, try in the reverse order.···687}688689/**690+ * tioce_reserve_m32 - reserve M32 ATEs for the indicated address range691+ * @tioce_kernel: TIOCE context to reserve ATEs for692 * @base: starting bus address to reserve693 * @limit: last bus address to reserve694 *···763764 /*765 * Set PMU pagesize to the largest size available, and zero out766+ * the ATEs.767 */768769 tioce_mmr = (struct tioce __iomem *)tioce_common->ce_pcibus.bs_base;···784 }785786 /*787+ * Reserve ATEs corresponding to reserved address ranges. These788 * include:789 *790 * Memory space covered by each PPB mem base/limit register
···1+/* hvapi.c: Hypervisor API management.2+ *3+ * Copyright (C) 2007 David S. Miller <davem@davemloft.net>4+ */5+#include <linux/kernel.h>6+#include <linux/module.h>7+#include <linux/init.h>8+#include <linux/slab.h>9+10+#include <asm/hypervisor.h>11+#include <asm/oplib.h>12+13+/* If the hypervisor indicates that the API setting14+ * calls are unsupported, by returning HV_EBADTRAP or15+ * HV_ENOTSUPPORTED, we assume that API groups with the16+ * PRE_API flag set are major 1 minor 0.17+ */18+struct api_info {19+ unsigned long group;20+ unsigned long major;21+ unsigned long minor;22+ unsigned int refcnt;23+ unsigned int flags;24+#define FLAG_PRE_API 0x0000000125+};26+27+static struct api_info api_table[] = {28+ { .group = HV_GRP_SUN4V, .flags = FLAG_PRE_API },29+ { .group = HV_GRP_CORE, .flags = FLAG_PRE_API },30+ { .group = HV_GRP_INTR, },31+ { .group = HV_GRP_SOFT_STATE, },32+ { .group = HV_GRP_PCI, .flags = FLAG_PRE_API },33+ { .group = HV_GRP_LDOM, },34+ { .group = HV_GRP_SVC_CHAN, .flags = FLAG_PRE_API },35+ { .group = HV_GRP_NCS, .flags = FLAG_PRE_API },36+ { .group = HV_GRP_NIAG_PERF, .flags = FLAG_PRE_API },37+ { .group = HV_GRP_FIRE_PERF, },38+ { .group = HV_GRP_DIAG, .flags = FLAG_PRE_API },39+};40+41+static DEFINE_SPINLOCK(hvapi_lock);42+43+static struct api_info *__get_info(unsigned long group)44+{45+ int i;46+47+ for (i = 0; i < ARRAY_SIZE(api_table); i++) {48+ if (api_table[i].group == group)49+ return &api_table[i];50+ }51+ return NULL;52+}53+54+static void __get_ref(struct api_info *p)55+{56+ p->refcnt++;57+}58+59+static void __put_ref(struct api_info *p)60+{61+ if (--p->refcnt == 0) {62+ unsigned long ignore;63+64+ sun4v_set_version(p->group, 0, 0, &ignore);65+ p->major = p->minor = 0;66+ }67+}68+69+/* Register a hypervisor API specification. It indicates the70+ * API group and desired major+minor.71+ *72+ * If an existing API registration exists '0' (success) will73+ * be returned if it is compatible with the one being registered.74+ * Otherwise a negative error code will be returned.75+ *76+ * Otherwise an attempt will be made to negotiate the requested77+ * API group/major/minor with the hypervisor, and errors returned78+ * if that does not succeed.79+ */80+int sun4v_hvapi_register(unsigned long group, unsigned long major,81+ unsigned long *minor)82+{83+ struct api_info *p;84+ unsigned long flags;85+ int ret;86+87+ spin_lock_irqsave(&hvapi_lock, flags);88+ p = __get_info(group);89+ ret = -EINVAL;90+ if (p) {91+ if (p->refcnt) {92+ ret = -EINVAL;93+ if (p->major == major) {94+ *minor = p->minor;95+ ret = 0;96+ }97+ } else {98+ unsigned long actual_minor;99+ unsigned long hv_ret;100+101+ hv_ret = sun4v_set_version(group, major, *minor,102+ &actual_minor);103+ ret = -EINVAL;104+ if (hv_ret == HV_EOK) {105+ *minor = actual_minor;106+ p->major = major;107+ p->minor = actual_minor;108+ ret = 0;109+ } else if (hv_ret == HV_EBADTRAP ||110+ HV_ENOTSUPPORTED) {111+ if (p->flags & FLAG_PRE_API) {112+ if (major == 1) {113+ p->major = 1;114+ p->minor = 0;115+ *minor = 0;116+ ret = 0;117+ }118+ }119+ }120+ }121+122+ if (ret == 0)123+ __get_ref(p);124+ }125+ spin_unlock_irqrestore(&hvapi_lock, flags);126+127+ return ret;128+}129+EXPORT_SYMBOL(sun4v_hvapi_register);130+131+void sun4v_hvapi_unregister(unsigned long group)132+{133+ struct api_info *p;134+ unsigned long flags;135+136+ spin_lock_irqsave(&hvapi_lock, flags);137+ p = __get_info(group);138+ if (p)139+ __put_ref(p);140+ spin_unlock_irqrestore(&hvapi_lock, flags);141+}142+EXPORT_SYMBOL(sun4v_hvapi_unregister);143+144+int sun4v_hvapi_get(unsigned long group,145+ unsigned long *major,146+ unsigned long *minor)147+{148+ struct api_info *p;149+ unsigned long flags;150+ int ret;151+152+ spin_lock_irqsave(&hvapi_lock, flags);153+ ret = -EINVAL;154+ p = __get_info(group);155+ if (p && p->refcnt) {156+ *major = p->major;157+ *minor = p->minor;158+ ret = 0;159+ }160+ spin_unlock_irqrestore(&hvapi_lock, flags);161+162+ return ret;163+}164+EXPORT_SYMBOL(sun4v_hvapi_get);165+166+void __init sun4v_hvapi_init(void)167+{168+ unsigned long group, major, minor;169+170+ group = HV_GRP_SUN4V;171+ major = 1;172+ minor = 0;173+ if (sun4v_hvapi_register(group, major, &minor))174+ goto bad;175+176+ group = HV_GRP_CORE;177+ major = 1;178+ minor = 1;179+ if (sun4v_hvapi_register(group, major, &minor))180+ goto bad;181+182+ return;183+184+bad:185+ prom_printf("HVAPI: Cannot register API group "186+ "%lx with major(%u) minor(%u)\n",187+ group, major, minor);188+ prom_halt();189+}
···321322 /* Don't continue if device has no _ADR method.323 * _GTF is intended for known motherboard devices. */324- if (!(ap->cbl == ATA_CBL_SATA)) {325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn);326 if (err < 0) {327 if (ata_msg_probe(ap))···343344 /* Get this drive's _ADR info. if not already known. */345 if (!dev->obj_handle) {346- if (!(ap->cbl == ATA_CBL_SATA)) {347 /* get child objects of dev_handle == channel objects,348 * + _their_ children == drive objects */349 /* channel is ap->port_no */···528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n",529 __FUNCTION__, ap->port_no);530531- if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA))532 return 0;533534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED))···578 * we should not run GTF on PATA devices since some579 * PATA require execution of GTM/STM before GTF.580 */581- if (!(ap->cbl == ATA_CBL_SATA))582 return 0;583584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {···641 __FUNCTION__, dev->devno, ap->port_no);642643 /* Don't continue if not a SATA device. */644- if (!(ap->cbl == ATA_CBL_SATA)) {645 if (ata_msg_probe(ap))646 ata_dev_printk(dev, KERN_DEBUG,647 "%s: Not a SATA device\n", __FUNCTION__);
···321322 /* Don't continue if device has no _ADR method.323 * _GTF is intended for known motherboard devices. */324+ if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn);326 if (err < 0) {327 if (ata_msg_probe(ap))···343344 /* Get this drive's _ADR info. if not already known. */345 if (!dev->obj_handle) {346+ if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {347 /* get child objects of dev_handle == channel objects,348 * + _their_ children == drive objects */349 /* channel is ap->port_no */···528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n",529 __FUNCTION__, ap->port_no);530531+ if (libata_noacpi || !(ap->flags & ATA_FLAG_ACPI_SATA))532 return 0;533534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED))···578 * we should not run GTF on PATA devices since some579 * PATA require execution of GTM/STM before GTF.580 */581+ if (!(ap->flags & ATA_FLAG_ACPI_SATA))582 return 0;583584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {···641 __FUNCTION__, dev->devno, ap->port_no);642643 /* Don't continue if not a SATA device. */644+ if (!(ap->flags & ATA_FLAG_ACPI_SATA)) {645 if (ata_msg_probe(ap))646 ata_dev_printk(dev, KERN_DEBUG,647 "%s: Not a SATA device\n", __FUNCTION__);
+50-32
drivers/ata/libata-core.c
···1919 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id));19201921 dev->n_sectors = ata_id_n_sectors(id);1922- dev->n_sectors_boot = dev->n_sectors;19231924 /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */1925 ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,···3631 const u16 *old_id = dev->id;3632 unsigned char model[2][ATA_ID_PROD_LEN + 1];3633 unsigned char serial[2][ATA_ID_SERNO_LEN + 1];3634- u64 new_n_sectors;36353636 if (dev->class != new_class) {3637 ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n",···3642 ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1]));3643 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0]));3644 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1]));3645- new_n_sectors = ata_id_n_sectors(new_id);36463647 if (strcmp(model[0], model[1])) {3648 ata_dev_printk(dev, KERN_INFO, "model number mismatch "···3655 return 0;3656 }36573658- if (dev->class == ATA_DEV_ATA && dev->n_sectors != new_n_sectors) {3659- ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch "3660- "%llu != %llu\n",3661- (unsigned long long)dev->n_sectors,3662- (unsigned long long)new_n_sectors);3663- /* Are we the boot time size - if so we appear to be the3664- same disk at this point and our HPA got reapplied */3665- if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors 3666- && ata_id_hpa_enabled(new_id))3667- return 1;3668- return 0;3669- }3670-3671 return 1;3672}36733674/**3675- * ata_dev_revalidate - Revalidate ATA device3676- * @dev: device to revalidate3677 * @readid_flags: read ID flags3678 *3679 * Re-read IDENTIFY page and make sure @dev is still attached to···3672 * RETURNS:3673 * 0 on success, negative errno otherwise3674 */3675-int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags)3676{3677 unsigned int class = dev->class;3678 u16 *id = (void *)dev->ap->sector_buf;3679 int rc;36803681- if (!ata_dev_enabled(dev)) {3682- rc = -ENODEV;3683- goto fail;3684- }3685-3686 /* read ID data */3687 rc = ata_dev_read_id(dev, &class, readid_flags, id);3688 if (rc)3689- goto fail;36903691 /* is the device still there? */3692- if (!ata_dev_same_device(dev, class, id)) {000000000000000000000000000000000000000000003693 rc = -ENODEV;3694 goto fail;3695 }36963697- memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS);3698-3699- /* configure device according to the new ID */3700- rc = ata_dev_configure(dev);3701- if (rc == 0)3702- return 0;37033704 fail:3705 ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc);
···1919 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id));19201921 dev->n_sectors = ata_id_n_sectors(id);019221923 /* SCSI only uses 4-char revisions, dump full 8 chars from ATA */1924 ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,···3632 const u16 *old_id = dev->id;3633 unsigned char model[2][ATA_ID_PROD_LEN + 1];3634 unsigned char serial[2][ATA_ID_SERNO_LEN + 1];036353636 if (dev->class != new_class) {3637 ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n",···3644 ata_id_c_string(new_id, model[1], ATA_ID_PROD, sizeof(model[1]));3645 ata_id_c_string(old_id, serial[0], ATA_ID_SERNO, sizeof(serial[0]));3646 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1]));036473648 if (strcmp(model[0], model[1])) {3649 ata_dev_printk(dev, KERN_INFO, "model number mismatch "···3658 return 0;3659 }366000000000000003661 return 1;3662}36633664/**3665+ * ata_dev_reread_id - Re-read IDENTIFY data3666+ * @adev: target ATA device3667 * @readid_flags: read ID flags3668 *3669 * Re-read IDENTIFY page and make sure @dev is still attached to···3688 * RETURNS:3689 * 0 on success, negative errno otherwise3690 */3691+int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags)3692{3693 unsigned int class = dev->class;3694 u16 *id = (void *)dev->ap->sector_buf;3695 int rc;3696000003697 /* read ID data */3698 rc = ata_dev_read_id(dev, &class, readid_flags, id);3699 if (rc)3700+ return rc;37013702 /* is the device still there? */3703+ if (!ata_dev_same_device(dev, class, id))3704+ return -ENODEV;3705+3706+ memcpy(dev->id, id, sizeof(id[0]) * ATA_ID_WORDS);3707+ return 0;3708+}3709+3710+/**3711+ * ata_dev_revalidate - Revalidate ATA device3712+ * @dev: device to revalidate3713+ * @readid_flags: read ID flags3714+ *3715+ * Re-read IDENTIFY page, make sure @dev is still attached to the3716+ * port and reconfigure it according to the new IDENTIFY page.3717+ *3718+ * LOCKING:3719+ * Kernel thread context (may sleep)3720+ *3721+ * RETURNS:3722+ * 0 on success, negative errno otherwise3723+ */3724+int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags)3725+{3726+ u64 n_sectors = dev->n_sectors;3727+ int rc;3728+3729+ if (!ata_dev_enabled(dev))3730+ return -ENODEV;3731+3732+ /* re-read ID */3733+ rc = ata_dev_reread_id(dev, readid_flags);3734+ if (rc)3735+ goto fail;3736+3737+ /* configure device according to the new ID */3738+ rc = ata_dev_configure(dev);3739+ if (rc)3740+ goto fail;3741+3742+ /* verify n_sectors hasn't changed */3743+ if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) {3744+ ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch "3745+ "%llu != %llu\n",3746+ (unsigned long long)n_sectors,3747+ (unsigned long long)dev->n_sectors);3748 rc = -ENODEV;3749 goto fail;3750 }37513752+ return 0;0000037533754 fail:3755 ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc);
+36-8
drivers/ata/libata-scsi.c
···893 return queue_depth;894}89500000000000000000896/**897 * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command898 * @qc: Storage for translated ATA taskfile···967 * for more info.968 */969 if (ata_spindown_compat &&0970 (system_state == SYSTEM_HALT ||971 system_state == SYSTEM_POWER_OFF)) {972- static int warned = 0;973974- if (!warned) {975- spin_unlock_irq(qc->ap->lock);976 ata_dev_printk(qc->dev, KERN_WARNING,977 "DISK MIGHT NOT BE SPUN DOWN PROPERLY. "978 "UPDATE SHUTDOWN UTILITY\n");979 ata_dev_printk(qc->dev, KERN_WARNING,980 "For more info, visit "981 "http://linux-ata.org/shutdown.html\n");982- warned = 1;983- ssleep(5);984- spin_lock_irq(qc->ap->lock);000985 }986 scmd->result = SAM_STAT_GOOD;987 return 1;···1395 }1396 }1397000000001398 if (need_sense && !ap->ops->error_handler)1399 ata_dump_status(ap->print_id, &qc->result_tf);1400···15161517early_finish:1518 ata_qc_free(qc);1519- done(cmd);1520 DPRINTK("EXIT - early finish (good or error)\n");1521 return 0;15221523err_did:1524 ata_qc_free(qc);1525 cmd->result = (DID_ERROR << 16);1526- done(cmd);1527err_mem:1528 DPRINTK("EXIT - internal\n");1529 return 0;
···893 return queue_depth;894}895896+/* XXX: for ata_spindown_compat */897+static void ata_delayed_done_timerfn(unsigned long arg)898+{899+ struct scsi_cmnd *scmd = (void *)arg;900+901+ scmd->scsi_done(scmd);902+}903+904+/* XXX: for ata_spindown_compat */905+static void ata_delayed_done(struct scsi_cmnd *scmd)906+{907+ static struct timer_list timer;908+909+ setup_timer(&timer, ata_delayed_done_timerfn, (unsigned long)scmd);910+ mod_timer(&timer, jiffies + 5 * HZ);911+}912+913/**914 * ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command915 * @qc: Storage for translated ATA taskfile···950 * for more info.951 */952 if (ata_spindown_compat &&953+ (qc->dev->flags & ATA_DFLAG_SPUNDOWN) &&954 (system_state == SYSTEM_HALT ||955 system_state == SYSTEM_POWER_OFF)) {956+ static unsigned long warned = 0;957958+ if (!test_and_set_bit(0, &warned)) {0959 ata_dev_printk(qc->dev, KERN_WARNING,960 "DISK MIGHT NOT BE SPUN DOWN PROPERLY. "961 "UPDATE SHUTDOWN UTILITY\n");962 ata_dev_printk(qc->dev, KERN_WARNING,963 "For more info, visit "964 "http://linux-ata.org/shutdown.html\n");965+966+ /* ->scsi_done is not used, use it for967+ * delayed completion.968+ */969+ scmd->scsi_done = qc->scsidone;970+ qc->scsidone = ata_delayed_done;971 }972 scmd->result = SAM_STAT_GOOD;973 return 1;···1375 }1376 }13771378+ /* XXX: track spindown state for spindown_compat */1379+ if (unlikely(qc->tf.command == ATA_CMD_STANDBY ||1380+ qc->tf.command == ATA_CMD_STANDBYNOW1))1381+ qc->dev->flags |= ATA_DFLAG_SPUNDOWN;1382+ else if (likely(system_state != SYSTEM_HALT &&1383+ system_state != SYSTEM_POWER_OFF))1384+ qc->dev->flags &= ~ATA_DFLAG_SPUNDOWN;1385+1386 if (need_sense && !ap->ops->error_handler)1387 ata_dump_status(ap->print_id, &qc->result_tf);1388···14881489early_finish:1490 ata_qc_free(qc);1491+ qc->scsidone(cmd);1492 DPRINTK("EXIT - early finish (good or error)\n");1493 return 0;14941495err_did:1496 ata_qc_free(qc);1497 cmd->result = (DID_ERROR << 16);1498+ qc->scsidone(cmd);1499err_mem:1500 DPRINTK("EXIT - internal\n");1501 return 0;
+2-1
drivers/ata/libata.h
···76extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);77extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,78 unsigned int flags, u16 *id);79-extern int ata_dev_revalidate(struct ata_device *dev, unsigned int flags);080extern int ata_dev_configure(struct ata_device *dev);81extern int sata_down_spd_limit(struct ata_port *ap);82extern int sata_set_spd_needed(struct ata_port *ap);
···76extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);77extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,78 unsigned int flags, u16 *id);79+extern int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags);80+extern int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags);81extern int ata_dev_configure(struct ata_device *dev);82extern int sata_down_spd_limit(struct ata_port *ap);83extern int sata_set_spd_needed(struct ata_port *ap);
+2-2
drivers/ata/pata_scc.c
···864 * @ap: ATA port to be reset865 */866867-static int scc_pata_prereset (struct ata_port *ap)868{869 ap->cbl = ATA_CBL_PATA80;870- return ata_std_prereset(ap);871}872873/**
···864 * @ap: ATA port to be reset865 */866867+static int scc_pata_prereset (struct ata_port *ap, unsigned long deadline)868{869 ap->cbl = ATA_CBL_PATA80;870+ return ata_std_prereset(ap, deadline);871}872873/**
···1/* sunhv.c: Serial driver for SUN4V hypervisor console.2 *3- * Copyright (C) 2006 David S. Miller (davem@davemloft.net)4 */56#include <linux/module.h>···35#define CON_BREAK ((long)-1)36#define CON_HUP ((long)-2)3738-static inline long hypervisor_con_getchar(long *status)39-{40- register unsigned long func asm("%o5");41- register unsigned long arg0 asm("%o0");42- register unsigned long arg1 asm("%o1");43-44- func = HV_FAST_CONS_GETCHAR;45- arg0 = 0;46- arg1 = 0;47- __asm__ __volatile__("ta %6"48- : "=&r" (func), "=&r" (arg0), "=&r" (arg1)49- : "0" (func), "1" (arg0), "2" (arg1),50- "i" (HV_FAST_TRAP));51-52- *status = arg0;53-54- return (long) arg1;55-}56-57-static inline long hypervisor_con_putchar(long ch)58-{59- register unsigned long func asm("%o5");60- register unsigned long arg0 asm("%o0");61-62- func = HV_FAST_CONS_PUTCHAR;63- arg0 = ch;64- __asm__ __volatile__("ta %4"65- : "=&r" (func), "=&r" (arg0)66- : "0" (func), "1" (arg0), "i" (HV_FAST_TRAP));67-68- return (long) arg0;69-}70-71#define IGNORE_BREAK 0x172#define IGNORE_ALL 0x27300074static int hung_up = 0;7576-static struct tty_struct *receive_chars(struct uart_port *port)77{78- struct tty_struct *tty = NULL;000000000000000000000000000079 int saw_console_brk = 0;80 int limit = 10000;8182- if (port->info != NULL) /* Unopened serial console */83- tty = port->info->tty;84-85 while (limit-- > 0) {86 long status;87- long c = hypervisor_con_getchar(&status);88- unsigned char flag;8990 if (status == HV_EWOULDBLOCK)91 break;···104 continue;105 }106107- flag = TTY_NORMAL;108 port->icount.rx++;109- if (c == CON_BREAK) {110- port->icount.brk++;111- if (uart_handle_break(port))112- continue;113- flag = TTY_BREAK;114- }115116 if (uart_handle_sysrq_char(port, c))117 continue;118119- if ((port->ignore_status_mask & IGNORE_ALL) ||120- ((port->ignore_status_mask & IGNORE_BREAK) &&121- (c == CON_BREAK)))122- continue;123-124- tty_insert_flip_char(tty, c, flag);125 }126127- if (saw_console_brk)000000000000000000000000000000000000000000000000000000000000000000000000000128 sun_do_break();129130 return tty;···204 if (uart_circ_empty(xmit) || uart_tx_stopped(port))205 return;206207- while (!uart_circ_empty(xmit)) {208- long status = hypervisor_con_putchar(xmit->buf[xmit->tail]);209-210- if (status != HV_EOK)211- break;212-213- xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);214- port->icount.tx++;215- }216217 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)218 uart_write_wakeup(port);···261 struct circ_buf *xmit = &port->info->xmit;262263 while (!uart_circ_empty(xmit)) {264- long status = hypervisor_con_putchar(xmit->buf[xmit->tail]);265266 if (status != HV_EOK)267 break;···280 spin_lock_irqsave(&port->lock, flags);281282 while (limit-- > 0) {283- long status = hypervisor_con_putchar(ch);284 if (status == HV_EOK)285 break;0286 }287288 spin_unlock_irqrestore(&port->lock, flags);···304{305 if (break_state) {306 unsigned long flags;307- int limit = 1000000;308309 spin_lock_irqsave(&port->lock, flags);310311 while (limit-- > 0) {312- long status = hypervisor_con_putchar(CON_BREAK);313 if (status == HV_EOK)314 break;315- udelay(2);316 }317318 spin_unlock_irqrestore(&port->lock, flags);···409410static struct uart_port *sunhv_port;411412-static inline void sunhv_console_putchar(struct uart_port *port, char c)000000413{0000000000000000000000414 unsigned long flags;415- int limit = 1000000;416417 spin_lock_irqsave(&port->lock, flags);00000418419- while (limit-- > 0) {420- long status = hypervisor_con_putchar(c);421- if (status == HV_EOK)422- break;423- udelay(2);000000000000000424 }425-426 spin_unlock_irqrestore(&port->lock, flags);427}428429-static void sunhv_console_write(struct console *con, const char *s, unsigned n)000000000000430{431 struct uart_port *port = sunhv_port;0432 int i;4330434 for (i = 0; i < n; i++) {435 if (*s == '\n')436 sunhv_console_putchar(port, '\r');437 sunhv_console_putchar(port, *s++);438 }0439}440441static struct console sunhv_console = {442 .name = "ttyHV",443- .write = sunhv_console_write,444 .device = uart_console_device,445 .flags = CON_PRINTBUFFER,446 .index = -1,···521static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match)522{523 struct uart_port *port;0524 int err;525526 if (op->irqs[0] == 0xffffffff)···530 port = kzalloc(sizeof(struct uart_port), GFP_KERNEL);531 if (unlikely(!port))532 return -ENOMEM;0000000000000000533534 sunhv_port = port;535···565566 err = uart_register_driver(&sunhv_reg);567 if (err)568- goto out_free_port;569570 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;571 sunserial_current_minor += 1;···590out_unregister_driver:591 sunserial_current_minor -= 1;592 uart_unregister_driver(&sunhv_reg);000000593594out_free_port:595 kfree(port);
···1/* sunhv.c: Serial driver for SUN4V hypervisor console.2 *3+ * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net)4 */56#include <linux/module.h>···35#define CON_BREAK ((long)-1)36#define CON_HUP ((long)-2)3700000000000000000000000000000000038#define IGNORE_BREAK 0x139#define IGNORE_ALL 0x24041+static char *con_write_page;42+static char *con_read_page;43+44static int hung_up = 0;4546+static void transmit_chars_putchar(struct uart_port *port, struct circ_buf *xmit)47{48+ while (!uart_circ_empty(xmit)) {49+ long status = sun4v_con_putchar(xmit->buf[xmit->tail]);50+51+ if (status != HV_EOK)52+ break;53+54+ xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);55+ port->icount.tx++;56+ }57+}58+59+static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit)60+{61+ while (!uart_circ_empty(xmit)) {62+ unsigned long ra = __pa(xmit->buf + xmit->tail);63+ unsigned long len, status, sent;64+65+ len = CIRC_CNT_TO_END(xmit->head, xmit->tail,66+ UART_XMIT_SIZE);67+ status = sun4v_con_write(ra, len, &sent);68+ if (status != HV_EOK)69+ break;70+ xmit->tail = (xmit->tail + sent) & (UART_XMIT_SIZE - 1);71+ port->icount.tx += sent;72+ }73+}74+75+static int receive_chars_getchar(struct uart_port *port, struct tty_struct *tty)76+{77 int saw_console_brk = 0;78 int limit = 10000;7900080 while (limit-- > 0) {81 long status;82+ long c = sun4v_con_getchar(&status);08384 if (status == HV_EWOULDBLOCK)85 break;···110 continue;111 }1120113 port->icount.rx++;000000114115 if (uart_handle_sysrq_char(port, c))116 continue;117118+ tty_insert_flip_char(tty, c, TTY_NORMAL);00000119 }120121+ return saw_console_brk;122+}123+124+static int receive_chars_read(struct uart_port *port, struct tty_struct *tty)125+{126+ int saw_console_brk = 0;127+ int limit = 10000;128+129+ while (limit-- > 0) {130+ unsigned long ra = __pa(con_read_page);131+ unsigned long bytes_read, i;132+ long stat = sun4v_con_read(ra, PAGE_SIZE, &bytes_read);133+134+ if (stat != HV_EOK) {135+ bytes_read = 0;136+137+ if (stat == CON_BREAK) {138+ if (uart_handle_break(port))139+ continue;140+ saw_console_brk = 1;141+ *con_read_page = 0;142+ bytes_read = 1;143+ } else if (stat == CON_HUP) {144+ hung_up = 1;145+ uart_handle_dcd_change(port, 0);146+ continue;147+ } else {148+ /* HV_EWOULDBLOCK, etc. */149+ break;150+ }151+ }152+153+ if (hung_up) {154+ hung_up = 0;155+ uart_handle_dcd_change(port, 1);156+ }157+158+ for (i = 0; i < bytes_read; i++)159+ uart_handle_sysrq_char(port, con_read_page[i]);160+161+ if (tty == NULL)162+ continue;163+164+ port->icount.rx += bytes_read;165+166+ tty_insert_flip_string(tty, con_read_page, bytes_read);167+ }168+169+ return saw_console_brk;170+}171+172+struct sunhv_ops {173+ void (*transmit_chars)(struct uart_port *port, struct circ_buf *xmit);174+ int (*receive_chars)(struct uart_port *port, struct tty_struct *tty);175+};176+177+static struct sunhv_ops bychar_ops = {178+ .transmit_chars = transmit_chars_putchar,179+ .receive_chars = receive_chars_getchar,180+};181+182+static struct sunhv_ops bywrite_ops = {183+ .transmit_chars = transmit_chars_write,184+ .receive_chars = receive_chars_read,185+};186+187+static struct sunhv_ops *sunhv_ops = &bychar_ops;188+189+static struct tty_struct *receive_chars(struct uart_port *port)190+{191+ struct tty_struct *tty = NULL;192+193+ if (port->info != NULL) /* Unopened serial console */194+ tty = port->info->tty;195+196+ if (sunhv_ops->receive_chars(port, tty))197 sun_do_break();198199 return tty;···147 if (uart_circ_empty(xmit) || uart_tx_stopped(port))148 return;149150+ sunhv_ops->transmit_chars(port, xmit);00000000151152 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)153 uart_write_wakeup(port);···212 struct circ_buf *xmit = &port->info->xmit;213214 while (!uart_circ_empty(xmit)) {215+ long status = sun4v_con_putchar(xmit->buf[xmit->tail]);216217 if (status != HV_EOK)218 break;···231 spin_lock_irqsave(&port->lock, flags);232233 while (limit-- > 0) {234+ long status = sun4v_con_putchar(ch);235 if (status == HV_EOK)236 break;237+ udelay(1);238 }239240 spin_unlock_irqrestore(&port->lock, flags);···254{255 if (break_state) {256 unsigned long flags;257+ int limit = 10000;258259 spin_lock_irqsave(&port->lock, flags);260261 while (limit-- > 0) {262+ long status = sun4v_con_putchar(CON_BREAK);263 if (status == HV_EOK)264 break;265+ udelay(1);266 }267268 spin_unlock_irqrestore(&port->lock, flags);···359360static struct uart_port *sunhv_port;361362+/* Copy 's' into the con_write_page, decoding "\n" into363+ * "\r\n" along the way. We have to return two lengths364+ * because the caller needs to know how much to advance365+ * 's' and also how many bytes to output via con_write_page.366+ */367+static int fill_con_write_page(const char *s, unsigned int n,368+ unsigned long *page_bytes)369{370+ const char *orig_s = s;371+ char *p = con_write_page;372+ int left = PAGE_SIZE;373+374+ while (n--) {375+ if (*s == '\n') {376+ if (left < 2)377+ break;378+ *p++ = '\r';379+ left--;380+ } else if (left < 1)381+ break;382+ *p++ = *s++;383+ left--;384+ }385+ *page_bytes = p - con_write_page;386+ return s - orig_s;387+}388+389+static void sunhv_console_write_paged(struct console *con, const char *s, unsigned n)390+{391+ struct uart_port *port = sunhv_port;392 unsigned long flags;0393394 spin_lock_irqsave(&port->lock, flags);395+ while (n > 0) {396+ unsigned long ra = __pa(con_write_page);397+ unsigned long page_bytes;398+ unsigned int cpy = fill_con_write_page(s, n,399+ &page_bytes);400401+ n -= cpy;402+ s += cpy;403+ while (page_bytes > 0) {404+ unsigned long written;405+ int limit = 1000000;406+407+ while (limit--) {408+ unsigned long stat;409+410+ stat = sun4v_con_write(ra, page_bytes,411+ &written);412+ if (stat == HV_EOK)413+ break;414+ udelay(1);415+ }416+ if (limit <= 0)417+ break;418+ page_bytes -= written;419+ ra += written;420+ }421 }0422 spin_unlock_irqrestore(&port->lock, flags);423}424425+static inline void sunhv_console_putchar(struct uart_port *port, char c)426+{427+ int limit = 1000000;428+429+ while (limit-- > 0) {430+ long status = sun4v_con_putchar(c);431+ if (status == HV_EOK)432+ break;433+ udelay(1);434+ }435+}436+437+static void sunhv_console_write_bychar(struct console *con, const char *s, unsigned n)438{439 struct uart_port *port = sunhv_port;440+ unsigned long flags;441 int i;442443+ spin_lock_irqsave(&port->lock, flags);444 for (i = 0; i < n; i++) {445 if (*s == '\n')446 sunhv_console_putchar(port, '\r');447 sunhv_console_putchar(port, *s++);448 }449+ spin_unlock_irqrestore(&port->lock, flags);450}451452static struct console sunhv_console = {453 .name = "ttyHV",454+ .write = sunhv_console_write_bychar,455 .device = uart_console_device,456 .flags = CON_PRINTBUFFER,457 .index = -1,···410static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match)411{412 struct uart_port *port;413+ unsigned long minor;414 int err;415416 if (op->irqs[0] == 0xffffffff)···418 port = kzalloc(sizeof(struct uart_port), GFP_KERNEL);419 if (unlikely(!port))420 return -ENOMEM;421+422+ minor = 1;423+ if (sun4v_hvapi_register(HV_GRP_CORE, 1, &minor) == 0 &&424+ minor >= 1) {425+ err = -ENOMEM;426+ con_write_page = kzalloc(PAGE_SIZE, GFP_KERNEL);427+ if (!con_write_page)428+ goto out_free_port;429+430+ con_read_page = kzalloc(PAGE_SIZE, GFP_KERNEL);431+ if (!con_read_page)432+ goto out_free_con_write_page;433+434+ sunhv_console.write = sunhv_console_write_paged;435+ sunhv_ops = &bywrite_ops;436+ }437438 sunhv_port = port;439···437438 err = uart_register_driver(&sunhv_reg);439 if (err)440+ goto out_free_con_read_page;441442 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;443 sunserial_current_minor += 1;···462out_unregister_driver:463 sunserial_current_minor -= 1;464 uart_unregister_driver(&sunhv_reg);465+466+out_free_con_read_page:467+ kfree(con_read_page);468+469+out_free_con_write_page:470+ kfree(con_write_page);471472out_free_port:473 kfree(port);
+1-1
drivers/spi/spidev.c
···484 * Reusing minors is fine so long as udev or mdev is working.485 */486 mutex_lock(&device_list_lock);487- minor = find_first_zero_bit(minors, ARRAY_SIZE(minors));488 if (minor < N_SPI_MINORS) {489 spidev->dev.parent = &spi->dev;490 spidev->dev.class = &spidev_class;
···484 * Reusing minors is fine so long as udev or mdev is working.485 */486 mutex_lock(&device_list_lock);487+ minor = find_first_zero_bit(minors, N_SPI_MINORS);488 if (minor < N_SPI_MINORS) {489 spidev->dev.parent = &spi->dev;490 spidev->dev.class = &spidev_class;
···56/* Grossly misnamed. */7enum die_val {08 DIE_BREAKPOINT,9 DIE_SSTEP,010};1112+/*13+ * These are only here because kprobes.c wants them to implement a14+ * blatant layering violation. Will hopefully go away soon once all15+ * architectures are updated.16+ */17+static inline int register_page_fault_notifier(struct notifier_block *nb)18+{19+ return 0;20+}21+static inline int unregister_page_fault_notifier(struct notifier_block *nb)22+{23+ return 0;24+}2526#endif /* __ASM_AVR32_KDEBUG_H */
+1
include/asm-avr32/kprobes.h
···26 kprobe_opcode_t insn[MAX_INSN_SIZE];27};28029extern int kprobe_exceptions_notify(struct notifier_block *self,30 unsigned long val, void *data);31
···26 kprobe_opcode_t insn[MAX_INSN_SIZE];27};2829+extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);30extern int kprobe_exceptions_notify(struct notifier_block *self,31 unsigned long val, void *data);32
···28 */29#include <linux/notifier.h>3031+/*32+ * These are only here because kprobes.c wants them to implement a33+ * blatant layering violation. Will hopefully go away soon once all34+ * architectures are updated.35+ */36+static inline int register_page_fault_notifier(struct notifier_block *nb)37+{38+ return 0;39+}40+static inline int unregister_page_fault_notifier(struct notifier_block *nb)41+{42+ return 0;43+}4445enum die_val {46 DIE_BREAK = 1,47 DIE_FAULT,48 DIE_OOPS,049 DIE_MACHINE_HALT,50 DIE_MACHINE_RESTART,51 DIE_MCA_MONARCH_ENTER,
+1
include/asm-ia64/kprobes.h
···120 unsigned short slot;121};1220123extern int kprobe_exceptions_notify(struct notifier_block *self,124 unsigned long val, void *data);125
···120 unsigned short slot;121};122123+extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr);124extern int kprobe_exceptions_notify(struct notifier_block *self,125 unsigned long val, void *data);126
···940 */941#define HV_FAST_CONS_PUTCHAR 0x61942000000000000000000000000000000000000000000000000943/* Trap trace services.944 *945 * The hypervisor provides a trap tracing capability for privileged···2169#define HV_FAST_MMUSTAT_INFO 0x10321702171/* Function numbers for HV_CORE_TRAP. */2172-#define HV_CORE_VER 0x002173#define HV_CORE_PUTCHAR 0x012174#define HV_CORE_EXIT 0x0200000000000000000000000000000000021752176#endif /* !(_SPARC64_HYPERVISOR_H) */
···940 */941#define HV_FAST_CONS_PUTCHAR 0x61942943+/* con_read()944+ * TRAP: HV_FAST_TRAP945+ * FUNCTION: HV_FAST_CONS_READ946+ * ARG0: buffer real address947+ * ARG1: buffer size in bytes948+ * RET0: status949+ * RET1: bytes read or BREAK or HUP950+ * ERRORS: EWOULDBLOCK No character available.951+ *952+ * Reads characters into a buffer from the console device. If no953+ * character is available then an EWOULDBLOCK error is returned.954+ * If a character is available, then the returned status is EOK955+ * and the number of bytes read into the given buffer is provided956+ * in RET1.957+ *958+ * A virtual BREAK is represented by the 64-bit RET1 value -1.959+ *960+ * A virtual HUP signal is represented by the 64-bit RET1 value -2.961+ *962+ * If BREAK or HUP are indicated, no bytes were read into buffer.963+ */964+#define HV_FAST_CONS_READ 0x62965+966+/* con_write()967+ * TRAP: HV_FAST_TRAP968+ * FUNCTION: HV_FAST_CONS_WRITE969+ * ARG0: buffer real address970+ * ARG1: buffer size in bytes971+ * RET0: status972+ * RET1: bytes written973+ * ERRORS: EWOULDBLOCK Output buffer currently full, would block974+ *975+ * Send a characters in buffer to the console device. Breaks must be976+ * sent using con_putchar().977+ */978+#define HV_FAST_CONS_WRITE 0x63979+980+#ifndef __ASSEMBLY__981+extern long sun4v_con_getchar(long *status);982+extern long sun4v_con_putchar(long c);983+extern long sun4v_con_read(unsigned long buffer,984+ unsigned long size,985+ unsigned long *bytes_read);986+extern unsigned long sun4v_con_write(unsigned long buffer,987+ unsigned long size,988+ unsigned long *bytes_written);989+#endif990+991/* Trap trace services.992 *993 * The hypervisor provides a trap tracing capability for privileged···2121#define HV_FAST_MMUSTAT_INFO 0x10321222123/* Function numbers for HV_CORE_TRAP. */2124+#define HV_CORE_SET_VER 0x002125#define HV_CORE_PUTCHAR 0x012126#define HV_CORE_EXIT 0x022127+#define HV_CORE_GET_VER 0x032128+2129+/* Hypervisor API groups for use with HV_CORE_SET_VER and2130+ * HV_CORE_GET_VER.2131+ */2132+#define HV_GRP_SUN4V 0x00002133+#define HV_GRP_CORE 0x00012134+#define HV_GRP_INTR 0x00022135+#define HV_GRP_SOFT_STATE 0x00032136+#define HV_GRP_PCI 0x01002137+#define HV_GRP_LDOM 0x01012138+#define HV_GRP_SVC_CHAN 0x01022139+#define HV_GRP_NCS 0x01032140+#define HV_GRP_NIAG_PERF 0x02002141+#define HV_GRP_FIRE_PERF 0x02012142+#define HV_GRP_DIAG 0x03002143+2144+#ifndef __ASSEMBLY__2145+extern unsigned long sun4v_get_version(unsigned long group,2146+ unsigned long *major,2147+ unsigned long *minor);2148+extern unsigned long sun4v_set_version(unsigned long group,2149+ unsigned long major,2150+ unsigned long minor,2151+ unsigned long *actual_minor);2152+2153+extern int sun4v_hvapi_register(unsigned long group, unsigned long major,2154+ unsigned long *minor);2155+extern void sun4v_hvapi_unregister(unsigned long group);2156+extern int sun4v_hvapi_get(unsigned long group,2157+ unsigned long *major,2158+ unsigned long *minor);2159+#endif21602161#endif /* !(_SPARC64_HYPERVISOR_H) */
+2-1
include/linux/libata.h
···140141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */142 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */0143 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,144145 ATA_DFLAG_DETACH = (1 << 16),···174 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */175 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */176 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */0177178 /* The following flag belongs to ap->pflags but is kept in179 * ap->flags because it's referenced in many LLDs and will be···433 struct scsi_device *sdev; /* attached SCSI device */434 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */435 u64 n_sectors; /* size of device, if ATA */436- u64 n_sectors_boot; /* size of ATA device at startup */437 unsigned int class; /* ATA_DEV_xxx */438 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */439 u8 pio_mode;
···140141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */142 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */143+ ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */144 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,145146 ATA_DFLAG_DETACH = (1 << 16),···173 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */174 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */175 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */176+ ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */177178 /* The following flag belongs to ap->pflags but is kept in179 * ap->flags because it's referenced in many LLDs and will be···431 struct scsi_device *sdev; /* attached SCSI device */432 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */433 u64 n_sectors; /* size of device, if ATA */0434 unsigned int class; /* ATA_DEV_xxx */435 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */436 u8 pio_mode;
···22#include <sound/control.h>23#include <sound/ac97_codec.h>2425+#define SND_SOC_VERSION "0.13.1"2627/*28 * Convenience kcontrol builders···83#define SND_SOC_DAI_AC97 0x184#define SND_SOC_DAI_I2S 0x285#define SND_SOC_DAI_PCM 0x486+#define SND_SOC_DAI_AC97_BUS 0x8 /* for custom i.e. non ac97_codec.c */8788/*89 * DAI hardware audio formats···278struct snd_soc_codec_dai {279 char *name;280 int id;281+ unsigned char type;282283 /* DAI capabilities */284 struct snd_soc_pcm_stream playback;
+1-1
include/sound/version.h
···1/* include/version.h. Generated by alsa/ksync script. */2#define CONFIG_SND_VERSION "1.0.14rc4"3-#define CONFIG_SND_DATE " (Wed May 09 09:51:39 2007 UTC)"
···1/* include/version.h. Generated by alsa/ksync script. */2#define CONFIG_SND_VERSION "1.0.14rc4"3+#define CONFIG_SND_DATE " (Wed May 16 09:45:46 2007 UTC)"
+8-7
kernel/power/main.c
···97 }98 }99100- if (pm_ops->prepare) {101- if ((error = pm_ops->prepare(state)))102- goto Thaw;103- }104-105 suspend_console();106 error = device_suspend(PMSG_SUSPEND);107 if (error) {108 printk(KERN_ERR "Some devices failed to suspend\n");109- goto Resume_devices;110 }00000111 error = disable_nonboot_cpus();112 if (!error)113 return 0;114115 enable_nonboot_cpus();116- Resume_devices:117 pm_finish(state);0118 device_resume();0119 resume_console();120 Thaw:121 thaw_processes();
···97 }98 }9900000100 suspend_console();101 error = device_suspend(PMSG_SUSPEND);102 if (error) {103 printk(KERN_ERR "Some devices failed to suspend\n");104+ goto Resume_console;105 }106+ if (pm_ops->prepare) {107+ if ((error = pm_ops->prepare(state)))108+ goto Resume_devices;109+ }110+111 error = disable_nonboot_cpus();112 if (!error)113 return 0;114115 enable_nonboot_cpus();0116 pm_finish(state);117+ Resume_devices:118 device_resume();119+ Resume_console:120 resume_console();121 Thaw:122 thaw_processes();
+2-1
mm/filemap.c
···670 page = find_lock_page(mapping, index);671 if (!page) {672 if (!cached_page) {673- cached_page = alloc_page(gfp_mask);0674 if (!cached_page)675 return NULL;676 }
···670 page = find_lock_page(mapping, index);671 if (!page) {672 if (!cached_page) {673+ cached_page =674+ __page_cache_alloc(gfp_mask);675 if (!cached_page)676 return NULL;677 }
+1-1
mm/slub.c
···2522 struct kmem_cache *s;25232524 down_write(&slub_lock);2525- s = find_mergeable(size, align, flags, dtor, ctor);2526 if (s) {2527 s->refcount++;2528 /*
···2522 struct kmem_cache *s;25232524 down_write(&slub_lock);2525+ s = find_mergeable(size, align, flags, ctor, dtor);2526 if (s) {2527 s->refcount++;2528 /*
+11-4
sound/isa/cmi8330.c
···109MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");110111#ifdef CONFIG_PNP0112static int pnp_registered;113#endif114···687 int err;688689 err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS);690- if (err < 0)691- return err;692#ifdef CONFIG_PNP000693 err = pnp_register_card_driver(&cmi8330_pnpc_driver);694 if (!err)695 pnp_registered = 1;000696#endif697- return 0;698}699700static void __exit alsa_card_cmi8330_exit(void)···706#ifdef CONFIG_PNP707 if (pnp_registered)708 pnp_unregister_card_driver(&cmi8330_pnpc_driver);00709#endif710- isa_unregister_driver(&snd_cmi8330_driver);711}712713module_init(alsa_card_cmi8330_init)
···109MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");110111#ifdef CONFIG_PNP112+static int isa_registered;113static int pnp_registered;114#endif115···686 int err;687688 err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS);00689#ifdef CONFIG_PNP690+ if (!err)691+ isa_registered = 1;692+693 err = pnp_register_card_driver(&cmi8330_pnpc_driver);694 if (!err)695 pnp_registered = 1;696+697+ if (isa_registered)698+ err = 0;699#endif700+ return err;701}702703static void __exit alsa_card_cmi8330_exit(void)···701#ifdef CONFIG_PNP702 if (pnp_registered)703 pnp_unregister_card_driver(&cmi8330_pnpc_driver);704+705+ if (isa_registered)706#endif707+ isa_unregister_driver(&snd_cmi8330_driver);708}709710module_init(alsa_card_cmi8330_init)
+14-6
sound/isa/cs423x/cs4236.c
···127MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");128129#ifdef CONFIG_PNP0130static int pnpc_registered;131#ifdef CS4232132static int pnp_registered;···771 int err;772773 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS);774- if (err < 0)775- return err;776#ifdef CONFIG_PNP00777#ifdef CS4232778 err = pnp_register_driver(&cs4232_pnp_driver);779 if (!err)···782 err = pnp_register_card_driver(&cs423x_pnpc_driver);783 if (!err)784 pnpc_registered = 1;785-#endif /* CONFIG_PNP */786- return 0;000000787}788789static void __exit alsa_card_cs423x_exit(void)···801 if (pnp_registered)802 pnp_unregister_driver(&cs4232_pnp_driver);803#endif804-#endif /* CONFIG_PNP */805- isa_unregister_driver(&cs423x_isa_driver);0806}807808module_init(alsa_card_cs423x_init)
···127MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");128129#ifdef CONFIG_PNP130+static int isa_registered;131static int pnpc_registered;132#ifdef CS4232133static int pnp_registered;···770 int err;771772 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS);00773#ifdef CONFIG_PNP774+ if (!err)775+ isa_registered = 1;776#ifdef CS4232777 err = pnp_register_driver(&cs4232_pnp_driver);778 if (!err)···781 err = pnp_register_card_driver(&cs423x_pnpc_driver);782 if (!err)783 pnpc_registered = 1;784+#ifdef CS4232785+ if (pnp_registered)786+ err = 0;787+#endif788+ if (isa_registered)789+ err = 0;790+#endif791+ return err;792}793794static void __exit alsa_card_cs423x_exit(void)···794 if (pnp_registered)795 pnp_unregister_driver(&cs4232_pnp_driver);796#endif797+ if (isa_registered)798+#endif799+ isa_unregister_driver(&cs423x_isa_driver);800}801802module_init(alsa_card_cs423x_init)
+13-6
sound/isa/es18xx.c
···2036MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");20372038#ifdef CONFIG_PNP2039-static int pnp_registered, pnpc_registered;0020402041static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {2042 { .id = "ESS1869" },···2468 int err;24692470 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS);2471- if (err < 0)2472- return err;2473-2474#ifdef CONFIG_PNP0002475 err = pnp_register_driver(&es18xx_pnp_driver);2476 if (!err)2477 pnp_registered = 1;02478 err = pnp_register_card_driver(&es18xx_pnpc_driver);2479 if (!err)2480 pnpc_registered = 1;0002481#endif2482- return 0;2483}24842485static void __exit alsa_card_es18xx_exit(void)···2493 pnp_unregister_card_driver(&es18xx_pnpc_driver);2494 if (pnp_registered)2495 pnp_unregister_driver(&es18xx_pnp_driver);02496#endif2497- isa_unregister_driver(&snd_es18xx_isa_driver);2498}24992500module_init(alsa_card_es18xx_init)
···2036MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");20372038#ifdef CONFIG_PNP2039+static int isa_registered;2040+static int pnp_registered;2041+static int pnpc_registered;20422043static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {2044 { .id = "ESS1869" },···2466 int err;24672468 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS);0002469#ifdef CONFIG_PNP2470+ if (!err)2471+ isa_registered = 1;2472+2473 err = pnp_register_driver(&es18xx_pnp_driver);2474 if (!err)2475 pnp_registered = 1;2476+2477 err = pnp_register_card_driver(&es18xx_pnpc_driver);2478 if (!err)2479 pnpc_registered = 1;2480+2481+ if (isa_registered || pnp_registered)2482+ err = 0;2483#endif2484+ return err;2485}24862487static void __exit alsa_card_es18xx_exit(void)···2487 pnp_unregister_card_driver(&es18xx_pnpc_driver);2488 if (pnp_registered)2489 pnp_unregister_driver(&es18xx_pnp_driver);2490+ if (isa_registered)2491#endif2492+ isa_unregister_driver(&snd_es18xx_isa_driver);2493}24942495module_init(alsa_card_es18xx_init)
+10-5
sound/isa/gus/interwave.c
···135136137#ifdef CONFIG_PNP0138static int pnp_registered;139140static struct pnp_card_device_id snd_interwave_pnpids[] = {···935 int err;936937 err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS);938- if (err < 0)939- return err;940#ifdef CONFIG_PNP941- /* ISA PnP cards */00942 err = pnp_register_card_driver(&interwave_pnpc_driver);943 if (!err)944 pnp_registered = 1;000945#endif946- return 0;947}948949static void __exit alsa_card_interwave_exit(void)···954#ifdef CONFIG_PNP955 if (pnp_registered)956 pnp_unregister_card_driver(&interwave_pnpc_driver);0957#endif958- isa_unregister_driver(&snd_interwave_driver);959}960961module_init(alsa_card_interwave_init)
···135136137#ifdef CONFIG_PNP138+static int isa_registered;139static int pnp_registered;140141static struct pnp_card_device_id snd_interwave_pnpids[] = {···934 int err;935936 err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS);00937#ifdef CONFIG_PNP938+ if (!err)939+ isa_registered = 1;940+941 err = pnp_register_card_driver(&interwave_pnpc_driver);942 if (!err)943 pnp_registered = 1;944+945+ if (isa_registered)946+ err = 0;947#endif948+ return err;949}950951static void __exit alsa_card_interwave_exit(void)···950#ifdef CONFIG_PNP951 if (pnp_registered)952 pnp_unregister_card_driver(&interwave_pnpc_driver);953+ if (isa_registered)954#endif955+ isa_unregister_driver(&snd_interwave_driver);956}957958module_init(alsa_card_interwave_init)
+11-4
sound/isa/opl3sa2.c
···92MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");9394#ifdef CONFIG_PNP095static int pnp_registered;96static int pnpc_registered;97#endif···968 int err;969970 err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS);971- if (err < 0)972- return err;973#ifdef CONFIG_PNP000974 err = pnp_register_driver(&opl3sa2_pnp_driver);975 if (!err)976 pnp_registered = 1;0977 err = pnp_register_card_driver(&opl3sa2_pnpc_driver);978 if (!err)979 pnpc_registered = 1;000980#endif981- return 0;982}983984static void __exit alsa_card_opl3sa2_exit(void)···993 pnp_unregister_card_driver(&opl3sa2_pnpc_driver);994 if (pnp_registered)995 pnp_unregister_driver(&opl3sa2_pnp_driver);0996#endif997- isa_unregister_driver(&snd_opl3sa2_isa_driver);998}9991000module_init(alsa_card_opl3sa2_init)
···92MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");9394#ifdef CONFIG_PNP95+static int isa_registered;96static int pnp_registered;97static int pnpc_registered;98#endif···967 int err;968969 err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS);00970#ifdef CONFIG_PNP971+ if (!err)972+ isa_registered = 1;973+974 err = pnp_register_driver(&opl3sa2_pnp_driver);975 if (!err)976 pnp_registered = 1;977+978 err = pnp_register_card_driver(&opl3sa2_pnpc_driver);979 if (!err)980 pnpc_registered = 1;981+982+ if (isa_registered || pnp_registered)983+ err = 0;984#endif985+ return err;986}987988static void __exit alsa_card_opl3sa2_exit(void)···987 pnp_unregister_card_driver(&opl3sa2_pnpc_driver);988 if (pnp_registered)989 pnp_unregister_driver(&opl3sa2_pnp_driver);990+ if (isa_registered)991#endif992+ isa_unregister_driver(&snd_opl3sa2_isa_driver);993}994995module_init(alsa_card_opl3sa2_init)
+10-5
sound/isa/sb/sb16.c
···129#endif130131#ifdef CONFIG_PNP0132static int pnp_registered;133#endif134···703 int err;704705 err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS);706- if (err < 0)707- return err;708#ifdef CONFIG_PNP709- /* PnP cards at last */00710 err = pnp_register_card_driver(&sb16_pnpc_driver);711 if (!err)712 pnp_registered = 1;000713#endif714- return 0;715}716717static void __exit alsa_card_sb16_exit(void)···722#ifdef CONFIG_PNP723 if (pnp_registered)724 pnp_unregister_card_driver(&sb16_pnpc_driver);0725#endif726- isa_unregister_driver(&snd_sb16_isa_driver);727}728729module_init(alsa_card_sb16_init)
···129#endif130131#ifdef CONFIG_PNP132+static int isa_registered;133static int pnp_registered;134#endif135···702 int err;703704 err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS);00705#ifdef CONFIG_PNP706+ if (!err)707+ isa_registered = 1;708+709 err = pnp_register_card_driver(&sb16_pnpc_driver);710 if (!err)711 pnp_registered = 1;712+713+ if (isa_registered)714+ err = 0;715#endif716+ return err;717}718719static void __exit alsa_card_sb16_exit(void)···718#ifdef CONFIG_PNP719 if (pnp_registered)720 pnp_unregister_card_driver(&sb16_pnpc_driver);721+ if (isa_registered)722#endif723+ isa_unregister_driver(&snd_sb16_isa_driver);724}725726module_init(alsa_card_sb16_init)
+15-13
sound/isa/sscape.c
···69MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");7071#ifdef CONFIG_PNP072static int pnp_registered;073static struct pnp_card_device_id sscape_pnpids[] = {74 { .id = "ENS3081", .devs = { { "ENS0000" } } },75 { .id = "" } /* end */···14071408static int __init sscape_init(void)1409{1410- int ret;14111412- /*1413- * First check whether we were passed any parameters.1414- * These MUST take precedence over ANY automatic way1415- * of allocating cards, because the operator is1416- * S-P-E-L-L-I-N-G it out for us...1417- */1418- ret = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);1419- if (ret < 0)1420- return ret;1421#ifdef CONFIG_PNP1422- if (pnp_register_card_driver(&sscape_pnpc_driver) == 0)00001423 pnp_registered = 1;0001424#endif1425- return 0;1426}14271428static void __exit sscape_exit(void)···1429#ifdef CONFIG_PNP1430 if (pnp_registered)1431 pnp_unregister_card_driver(&sscape_pnpc_driver);01432#endif1433- isa_unregister_driver(&snd_sscape_driver);1434}14351436module_init(sscape_init);
···69MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");7071#ifdef CONFIG_PNP72+static int isa_registered;73static int pnp_registered;74+75static struct pnp_card_device_id sscape_pnpids[] = {76 { .id = "ENS3081", .devs = { { "ENS0000" } } },77 { .id = "" } /* end */···14051406static int __init sscape_init(void)1407{1408+ int err;14091410+ err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);000000001411#ifdef CONFIG_PNP1412+ if (!err)1413+ isa_registered = 1;1414+1415+ err = pnp_register_card_driver(&sscape_pnpc_driver);1416+ if (!err)1417 pnp_registered = 1;1418+1419+ if (isa_registered)1420+ err = 0;1421#endif1422+ return err;1423}14241425static void __exit sscape_exit(void)···1428#ifdef CONFIG_PNP1429 if (pnp_registered)1430 pnp_unregister_card_driver(&sscape_pnpc_driver);1431+ if (isa_registered)1432#endif1433+ isa_unregister_driver(&snd_sscape_driver);1434}14351436module_init(sscape_init);
+10-4
sound/isa/wavefront/wavefront.c
···86MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");8788#ifdef CONFIG_PNP089static int pnp_registered;9091static struct pnp_card_device_id snd_wavefront_pnpids[] = {···707 int err;708709 err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS);710- if (err < 0)711- return err;712#ifdef CONFIG_PNP000713 err = pnp_register_card_driver(&wavefront_pnpc_driver);714 if (!err)715 pnp_registered = 1;000716#endif717- return 0;718}719720static void __exit alsa_card_wavefront_exit(void)···726#ifdef CONFIG_PNP727 if (pnp_registered)728 pnp_unregister_card_driver(&wavefront_pnpc_driver);0729#endif730- isa_unregister_driver(&snd_wavefront_driver);731}732733module_init(alsa_card_wavefront_init)
···86MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");8788#ifdef CONFIG_PNP89+static int isa_registered;90static int pnp_registered;9192static struct pnp_card_device_id snd_wavefront_pnpids[] = {···706 int err;707708 err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS);00709#ifdef CONFIG_PNP710+ if (!err)711+ isa_registered = 1;712+713 err = pnp_register_card_driver(&wavefront_pnpc_driver);714 if (!err)715 pnp_registered = 1;716+717+ if (isa_registered)718+ err = 0;719#endif720+ return err;721}722723static void __exit alsa_card_wavefront_exit(void)···721#ifdef CONFIG_PNP722 if (pnp_registered)723 pnp_unregister_card_driver(&wavefront_pnpc_driver);724+ if (isa_registered)725#endif726+ isa_unregister_driver(&snd_wavefront_driver);727}728729module_init(alsa_card_wavefront_init)