Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'upstream'

+2323 -2360
+5 -5
MAINTAINERS
··· 536 536 M: mchehab@brturbo.com.br 537 537 L: video4linux-list@redhat.com 538 538 W: http://linuxtv.org 539 - T: quilt http://www.linuxtv.org/download/quilt/ 539 + T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 540 540 S: Maintained 541 541 542 542 BUSLOGIC SCSI DRIVER ··· 834 834 M: linux-dvb-maintainer@linuxtv.org 835 835 L: linux-dvb@linuxtv.org (subscription required) 836 836 W: http://linuxtv.org/ 837 - T: quilt http://www.linuxtv.org/download/quilt/ 837 + T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 838 838 S: Supported 839 839 840 840 EATA-DMA SCSI DRIVER ··· 1284 1284 S: Supported 1285 1285 1286 1286 INPUT (KEYBOARD, MOUSE, JOYSTICK) DRIVERS 1287 - P: Vojtech Pavlik 1288 - M: vojtech@suse.cz 1287 + P: Dmitry Torokhov 1288 + M: dtor_core@ameritech.net 1289 1289 L: linux-input@atrey.karlin.mff.cuni.cz 1290 1290 L: linux-joystick@atrey.karlin.mff.cuni.cz 1291 1291 T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git ··· 2896 2896 M: mchehab@brturbo.com.br 2897 2897 L: video4linux-list@redhat.com 2898 2898 W: http://linuxtv.org 2899 - T: quilt http://www.linuxtv.org/download/quilt/ 2899 + T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git 2900 2900 S: Maintained 2901 2901 2902 2902 W1 DALLAS'S 1-WIRE BUS
+2 -2
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 15 4 - EXTRAVERSION =-rc5 5 - NAME=Affluent Albatross 4 + EXTRAVERSION = 5 + NAME=Sliding Snow Leopard 6 6 7 7 # *DOCUMENTATION* 8 8 # To see a list of typical targets execute "make help"
+1 -1
arch/alpha/kernel/machvec_impl.h
··· 41 41 #define CAT1(x,y) x##y 42 42 #define CAT(x,y) CAT1(x,y) 43 43 44 - #define DO_DEFAULT_RTC rtc_port: 0x70 44 + #define DO_DEFAULT_RTC .rtc_port = 0x70 45 45 46 46 #define DO_EV4_MMU \ 47 47 .max_asn = EV4_MAX_ASN, \
+4 -4
arch/arm/kernel/calls.S
··· 131 131 .long sys_wait4 132 132 /* 115 */ .long sys_swapoff 133 133 .long sys_sysinfo 134 - .long sys_ipc_wrapper 134 + .long sys_ipc 135 135 .long sys_fsync 136 136 .long sys_sigreturn_wrapper 137 137 /* 120 */ .long sys_clone_wrapper ··· 254 254 .long sys_fremovexattr 255 255 .long sys_tkill 256 256 .long sys_sendfile64 257 - /* 240 */ .long sys_futex_wrapper 257 + /* 240 */ .long sys_futex 258 258 .long sys_sched_setaffinity 259 259 .long sys_sched_getaffinity 260 260 .long sys_io_setup ··· 284 284 .long sys_fstatfs64 285 285 .long sys_tgkill 286 286 .long sys_utimes 287 - /* 270 */ .long sys_arm_fadvise64_64_wrapper 287 + /* 270 */ .long sys_arm_fadvise64_64 288 288 .long sys_pciconfig_iobase 289 289 .long sys_pciconfig_read 290 290 .long sys_pciconfig_write ··· 333 333 .long sys_inotify_init 334 334 .long sys_inotify_add_watch 335 335 .long sys_inotify_rm_watch 336 - .long sys_mbind_wrapper 336 + .long sys_mbind 337 337 /* 320 */ .long sys_get_mempolicy 338 338 .long sys_set_mempolicy 339 339 __syscall_end:
+49
arch/arm/kernel/entry-armv.S
··· 614 614 /* 615 615 * Reference prototype: 616 616 * 617 + * void __kernel_memory_barrier(void) 618 + * 619 + * Input: 620 + * 621 + * lr = return address 622 + * 623 + * Output: 624 + * 625 + * none 626 + * 627 + * Clobbered: 628 + * 629 + * the Z flag might be lost 630 + * 631 + * Definition and user space usage example: 632 + * 633 + * typedef void (__kernel_dmb_t)(void); 634 + * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0) 635 + * 636 + * Apply any needed memory barrier to preserve consistency with data modified 637 + * manually and __kuser_cmpxchg usage. 638 + * 639 + * This could be used as follows: 640 + * 641 + * #define __kernel_dmb() \ 642 + * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \ 643 + * : : : "lr","cc" ) 644 + */ 645 + 646 + __kuser_memory_barrier: @ 0xffff0fa0 647 + 648 + #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP) 649 + mcr p15, 0, r0, c7, c10, 5 @ dmb 650 + #endif 651 + mov pc, lr 652 + 653 + .align 5 654 + 655 + /* 656 + * Reference prototype: 657 + * 617 658 * int __kernel_cmpxchg(int oldval, int newval, int *ptr) 618 659 * 619 660 * Input: ··· 682 641 * Return zero if *ptr was changed or non-zero if no exchange happened. 683 642 * The C flag is also set if *ptr was changed to allow for assembly 684 643 * optimization in the calling code. 644 + * 645 + * Note: this routine already includes memory barriers as needed. 685 646 * 686 647 * For example, a user space atomic_add implementation could look like this: 687 648 * ··· 741 698 742 699 #else 743 700 701 + #ifdef CONFIG_SMP 702 + mcr p15, 0, r0, c7, c10, 5 @ dmb 703 + #endif 744 704 ldrex r3, [r2] 745 705 subs r3, r3, r0 746 706 strexeq r3, r1, [r2] 747 707 rsbs r0, r3, #0 708 + #ifdef CONFIG_SMP 709 + mcr p15, 0, r0, c7, c10, 5 @ dmb 710 + #endif 748 711 mov pc, lr 749 712 750 713 #endif
+2 -18
arch/arm/kernel/entry-common.S
··· 145 145 #endif 146 146 enable_irq 147 147 148 - str r4, [sp, #-S_OFF]! @ push fifth arg 148 + stmdb sp!, {r4, r5} @ push fifth and sixth args 149 149 150 150 get_thread_info tsk 151 151 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing ··· 204 204 * Special system call wrappers 205 205 */ 206 206 @ r0 = syscall number 207 - @ r5 = syscall table 207 + @ r8 = syscall table 208 208 .type sys_syscall, #function 209 209 sys_syscall: 210 210 eor scno, r0, #__NR_SYSCALL_BASE ··· 254 254 sys_sigaltstack_wrapper: 255 255 ldr r2, [sp, #S_OFF + S_SP] 256 256 b do_sigaltstack 257 - 258 - sys_futex_wrapper: 259 - str r5, [sp, #4] @ push sixth arg 260 - b sys_futex 261 - 262 - sys_arm_fadvise64_64_wrapper: 263 - str r5, [sp, #4] @ push r5 to stack 264 - b sys_arm_fadvise64_64 265 - 266 - sys_mbind_wrapper: 267 - str r5, [sp, #4] 268 - b sys_mbind 269 - 270 - sys_ipc_wrapper: 271 - str r5, [sp, #4] @ push sixth arg 272 - b sys_ipc 273 257 274 258 /* 275 259 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
+2
arch/arm/kernel/module.c
··· 101 101 break; 102 102 103 103 case R_ARM_PC24: 104 + case R_ARM_CALL: 105 + case R_ARM_JUMP24: 104 106 offset = (*(u32 *)loc & 0x00ffffff) << 2; 105 107 if (offset & 0x02000000) 106 108 offset -= 0x04000000;
+5 -4
arch/arm/mach-pxa/pm.c
··· 155 155 PSPR = 0; 156 156 157 157 /* restore registers */ 158 + RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2); 159 + RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2); 158 160 RESTORE(GAFR0_L); RESTORE(GAFR0_U); 159 161 RESTORE(GAFR1_L); RESTORE(GAFR1_U); 160 162 RESTORE(GAFR2_L); RESTORE(GAFR2_U); 161 - RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2); 162 - RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2); 163 163 RESTORE(GRER0); RESTORE(GRER1); RESTORE(GRER2); 164 164 RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2); 165 165 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); 166 166 167 167 #ifdef CONFIG_PXA27x 168 168 RESTORE(MDREFR); 169 - RESTORE(GAFR3_L); RESTORE(GAFR3_U); RESTORE_GPLEVEL(3); 170 - RESTORE(GPDR3); RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); 169 + RESTORE_GPLEVEL(3); RESTORE(GPDR3); 170 + RESTORE(GAFR3_L); RESTORE(GAFR3_U); 171 + RESTORE(GRER3); RESTORE(GFER3); RESTORE(PGSR3); 171 172 RESTORE(PWER); RESTORE(PCFR); RESTORE(PRER); 172 173 RESTORE(PFER); RESTORE(PKWR); 173 174 #endif
+3 -1
arch/i386/kernel/process.c
··· 554 554 struct pt_regs ptregs; 555 555 556 556 ptregs = *(struct pt_regs *) 557 - ((unsigned long)tsk->thread_info+THREAD_SIZE - sizeof(ptregs)); 557 + ((unsigned long)tsk->thread_info + 558 + /* see comments in copy_thread() about -8 */ 559 + THREAD_SIZE - sizeof(ptregs) - 8); 558 560 ptregs.xcs &= 0xffff; 559 561 ptregs.xds &= 0xffff; 560 562 ptregs.xes &= 0xffff;
+1 -1
arch/i386/mm/ioremap.c
··· 245 245 addr < phys_to_virt(ISA_END_ADDRESS)) 246 246 return; 247 247 248 - addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr); 248 + addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr); 249 249 250 250 /* Use the vm area unlocked, assuming the caller 251 251 ensures there isn't another iounmap for the same address
+1 -1
arch/i386/pci/Makefile
··· 1 1 obj-y := i386.o 2 2 3 3 obj-$(CONFIG_PCI_BIOS) += pcbios.o 4 - obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o 4 + obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o 5 5 obj-$(CONFIG_PCI_DIRECT) += direct.o 6 6 7 7 pci-y := fixup.o
+1 -1
arch/i386/pci/mmconfig.c
··· 155 155 addr = get_base_addr(0, 0, PCI_DEVFN(i, 0)); 156 156 if (addr != 0) 157 157 pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0)); 158 - if (addr == 0 || readl((u32 *)addr) != val1) 158 + if (addr == 0 || readl((u32 __iomem *)mmcfg_virt_addr) != val1) 159 159 set_bit(i, fallback_slots); 160 160 spin_unlock_irqrestore(&pci_config_lock, flags); 161 161 }
+1 -1
arch/ia64/configs/sn2_defconfig
··· 113 113 CONFIG_IA64_SGI_SN_XP=m 114 114 CONFIG_FORCE_MAX_ZONEORDER=17 115 115 CONFIG_SMP=y 116 - CONFIG_NR_CPUS=512 116 + CONFIG_NR_CPUS=1024 117 117 # CONFIG_HOTPLUG_CPU is not set 118 118 CONFIG_SCHED_SMT=y 119 119 CONFIG_PREEMPT=y
+2
arch/ia64/kernel/process.c
··· 721 721 /* drop floating-point and debug-register state if it exists: */ 722 722 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); 723 723 ia64_drop_fpu(current); 724 + #ifdef CONFIG_IA32_SUPPORT 724 725 if (IS_IA32_PROCESS(ia64_task_regs(current))) { 725 726 ia32_drop_partial_page_list(current); 726 727 current->thread.task_size = IA32_PAGE_OFFSET; 727 728 set_fs(USER_DS); 728 729 } 730 + #endif 729 731 } 730 732 731 733 /*
+29
arch/ia64/kernel/time.c
··· 249 249 */ 250 250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); 251 251 } 252 + 253 + #define SMALLUSECS 100 254 + 255 + void 256 + udelay (unsigned long usecs) 257 + { 258 + unsigned long start; 259 + unsigned long cycles; 260 + unsigned long smallusecs; 261 + 262 + /* 263 + * Execute the non-preemptible delay loop (because the ITC might 264 + * not be synchronized between CPUS) in relatively short time 265 + * chunks, allowing preemption between the chunks. 266 + */ 267 + while (usecs > 0) { 268 + smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs; 269 + preempt_disable(); 270 + cycles = smallusecs*local_cpu_data->cyc_per_usec; 271 + start = ia64_get_itc(); 272 + 273 + while (ia64_get_itc() - start < cycles) 274 + cpu_relax(); 275 + 276 + preempt_enable(); 277 + usecs -= smallusecs; 278 + } 279 + } 280 + EXPORT_SYMBOL(udelay);
+3 -3
arch/ia64/kernel/uncached.c
··· 53 53 if ((status != PAL_VISIBILITY_OK) && 54 54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED)) 55 55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on " 56 - "CPU %i\n", status, get_cpu()); 56 + "CPU %i\n", status, raw_smp_processor_id()); 57 57 } 58 58 59 59 ··· 63 63 status = ia64_pal_mc_drain(); 64 64 if (status) 65 65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on " 66 - "CPU %i\n", status, get_cpu()); 66 + "CPU %i\n", status, raw_smp_processor_id()); 67 67 } 68 68 69 69 ··· 105 105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); 106 106 107 107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n", 108 - status, get_cpu()); 108 + status, raw_smp_processor_id()); 109 109 110 110 if (!status) { 111 111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
+3
arch/ia64/kernel/vmlinux.lds.S
··· 177 177 } 178 178 . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */ 179 179 180 + .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) 181 + { *(.data.read_mostly) } 182 + 180 183 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) 181 184 { *(.data.cacheline_aligned) } 182 185
+1 -1
arch/ia64/sn/kernel/sn2/sn2_smp.c
··· 202 202 unsigned long end, unsigned long nbits) 203 203 { 204 204 int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; 205 - int mymm = (mm == current->active_mm); 205 + int mymm = (mm == current->active_mm && current->mm); 206 206 volatile unsigned long *ptc0, *ptc1; 207 207 unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value; 208 208 short nasids[MAX_NUMNODES], nix;
+24 -24
arch/ia64/sn/pci/pcibr/pcibr_reg.c
··· 25 25 */ 26 26 void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) 27 27 { 28 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 28 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 29 29 30 30 if (pcibus_info) { 31 31 switch (pcibus_info->pbi_bridge_type) { ··· 38 38 default: 39 39 panic 40 40 ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p", 41 - (void *)ptr); 41 + ptr); 42 42 } 43 43 } 44 44 } 45 45 46 46 void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) 47 47 { 48 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 48 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 49 49 50 50 if (pcibus_info) { 51 51 switch (pcibus_info->pbi_bridge_type) { ··· 58 58 default: 59 59 panic 60 60 ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p", 61 - (void *)ptr); 61 + ptr); 62 62 } 63 63 } 64 64 } ··· 68 68 */ 69 69 uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info) 70 70 { 71 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 71 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 72 72 uint64_t ret = 0; 73 73 74 74 if (pcibus_info) { ··· 82 82 default: 83 83 panic 84 84 ("pcireg_tflush_get: unknown bridgetype bridge 0x%p", 85 - (void *)ptr); 85 + ptr); 86 86 } 87 87 } 88 88 ··· 98 98 */ 99 99 uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info) 100 100 { 101 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 101 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 102 102 uint64_t ret = 0; 103 103 104 104 if (pcibus_info) { ··· 112 112 default: 113 113 panic 114 114 ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p", 115 - (void *)ptr); 115 + ptr); 116 116 } 117 117 } 118 118 return ret; ··· 123 123 */ 124 124 void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) 125 125 { 126 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 126 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 127 127 128 128 if (pcibus_info) { 129 129 switch (pcibus_info->pbi_bridge_type) { ··· 136 136 default: 137 137 panic 138 138 ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p", 139 - (void *)ptr); 139 + ptr); 140 140 } 141 141 } 142 142 } 143 143 144 144 void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) 145 145 { 146 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 146 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 147 147 148 148 if (pcibus_info) { 149 149 switch (pcibus_info->pbi_bridge_type) { ··· 156 156 default: 157 157 panic 158 158 ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p", 159 - (void *)ptr); 159 + ptr); 160 160 } 161 161 } 162 162 } ··· 167 167 void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, 168 168 uint64_t addr) 169 169 { 170 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 170 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 171 171 172 172 if (pcibus_info) { 173 173 switch (pcibus_info->pbi_bridge_type) { ··· 186 186 default: 187 187 panic 188 188 ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p", 189 - (void *)ptr); 189 + ptr); 190 190 } 191 191 } 192 192 } ··· 196 196 */ 197 197 void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) 198 198 { 199 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 199 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 200 200 201 201 if (pcibus_info) { 202 202 switch (pcibus_info->pbi_bridge_type) { ··· 209 209 default: 210 210 panic 211 211 ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p", 212 - (void *)ptr); 212 + ptr); 213 213 } 214 214 } 215 215 } ··· 219 219 */ 220 220 uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) 221 221 { 222 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 222 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 223 223 uint64_t ret = 0; 224 224 225 225 if (pcibus_info) { ··· 233 233 __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]); 234 234 break; 235 235 default: 236 - panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", (void *)ptr); 236 + panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", ptr); 237 237 } 238 238 239 239 } ··· 244 244 void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index, 245 245 uint64_t val) 246 246 { 247 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 247 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 248 248 249 249 if (pcibus_info) { 250 250 switch (pcibus_info->pbi_bridge_type) { ··· 257 257 default: 258 258 panic 259 259 ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p", 260 - (void *)ptr); 260 + ptr); 261 261 } 262 262 } 263 263 } 264 264 265 - uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) 265 + uint64_t __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) 266 266 { 267 - union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 268 - uint64_t *ret = (uint64_t *) 0; 267 + union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; 268 + uint64_t __iomem *ret = NULL; 269 269 270 270 if (pcibus_info) { 271 271 switch (pcibus_info->pbi_bridge_type) { ··· 278 278 default: 279 279 panic 280 280 ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p", 281 - (void *)ptr); 281 + ptr); 282 282 } 283 283 } 284 284 return ret;
+6 -6
arch/ia64/sn/pci/tioca_provider.c
··· 38 38 uint64_t offset; 39 39 struct page *tmp; 40 40 struct tioca_common *tioca_common; 41 - struct tioca *ca_base; 41 + struct tioca __iomem *ca_base; 42 42 43 43 tioca_common = tioca_kern->ca_common; 44 - ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 44 + ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base; 45 45 46 46 if (list_empty(tioca_kern->ca_devices)) 47 47 return 0; ··· 215 215 { 216 216 int cap_ptr; 217 217 uint32_t reg; 218 - struct tioca *tioca_base; 218 + struct tioca __iomem *tioca_base; 219 219 struct pci_dev *pdev; 220 220 struct tioca_common *common; 221 221 ··· 257 257 * Set ca's fw to match 258 258 */ 259 259 260 - tioca_base = (struct tioca *)common->ca_common.bs_base; 260 + tioca_base = (struct tioca __iomem*)common->ca_common.bs_base; 261 261 __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE); 262 262 } 263 263 ··· 322 322 tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr) 323 323 { 324 324 struct tioca_common *tioca_common; 325 - struct tioca *ca_base; 325 + struct tioca __iomem *ca_base; 326 326 uint64_t ct_addr; 327 327 dma_addr_t bus_addr; 328 328 uint32_t node_upper; ··· 330 330 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev); 331 331 332 332 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info; 333 - ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 333 + ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base; 334 334 335 335 ct_addr = PHYS_TO_TIODMA(paddr); 336 336 if (!ct_addr)
+4 -3
arch/powerpc/configs/cell_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.15-rc1 4 - # Tue Nov 15 14:36:20 2005 3 + # Linux kernel version: 2.6.15-rc5 4 + # Tue Dec 20 15:59:26 2005 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 53 53 # CONFIG_IKCONFIG is not set 54 54 # CONFIG_CPUSETS is not set 55 55 CONFIG_INITRAMFS_SOURCE="" 56 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 56 57 # CONFIG_EMBEDDED is not set 57 58 CONFIG_KALLSYMS=y 58 59 # CONFIG_KALLSYMS_ALL is not set ··· 152 151 CONFIG_FLATMEM=y 153 152 CONFIG_FLAT_NODE_MEM_MAP=y 154 153 # CONFIG_SPARSEMEM_STATIC is not set 155 - CONFIG_SPLIT_PTLOCK_CPUS=4096 154 + CONFIG_SPLIT_PTLOCK_CPUS=4 156 155 # CONFIG_PPC_64K_PAGES is not set 157 156 CONFIG_SCHED_SMT=y 158 157 CONFIG_PROC_DEVICETREE=y
+5 -4
arch/powerpc/configs/g5_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.15-rc1 4 - # Tue Nov 15 14:39:20 2005 3 + # Linux kernel version: 2.6.15-rc5 4 + # Tue Dec 20 15:59:30 2005 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 53 53 CONFIG_IKCONFIG_PROC=y 54 54 # CONFIG_CPUSETS is not set 55 55 CONFIG_INITRAMFS_SOURCE="" 56 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 56 57 # CONFIG_EMBEDDED is not set 57 58 CONFIG_KALLSYMS=y 58 59 # CONFIG_KALLSYMS_ALL is not set ··· 163 162 CONFIG_FLATMEM=y 164 163 CONFIG_FLAT_NODE_MEM_MAP=y 165 164 # CONFIG_SPARSEMEM_STATIC is not set 166 - CONFIG_SPLIT_PTLOCK_CPUS=4096 165 + CONFIG_SPLIT_PTLOCK_CPUS=4 167 166 # CONFIG_PPC_64K_PAGES is not set 168 167 # CONFIG_SCHED_SMT is not set 169 168 CONFIG_PROC_DEVICETREE=y ··· 1204 1203 CONFIG_USB_SERIAL=m 1205 1204 CONFIG_USB_SERIAL_GENERIC=y 1206 1205 # CONFIG_USB_SERIAL_AIRPRIME is not set 1206 + # CONFIG_USB_SERIAL_ANYDATA is not set 1207 1207 CONFIG_USB_SERIAL_BELKIN=m 1208 1208 CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m 1209 1209 # CONFIG_USB_SERIAL_CP2101 is not set ··· 1235 1233 CONFIG_USB_SERIAL_KLSI=m 1236 1234 CONFIG_USB_SERIAL_KOBIL_SCT=m 1237 1235 CONFIG_USB_SERIAL_MCT_U232=m 1238 - # CONFIG_USB_SERIAL_NOKIA_DKU2 is not set 1239 1236 CONFIG_USB_SERIAL_PL2303=m 1240 1237 # CONFIG_USB_SERIAL_HP4X is not set 1241 1238 CONFIG_USB_SERIAL_SAFE=m
+4 -3
arch/powerpc/configs/iseries_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.15-rc1 4 - # Tue Nov 15 14:38:09 2005 3 + # Linux kernel version: 2.6.15-rc5 4 + # Tue Dec 20 15:59:32 2005 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 55 55 CONFIG_IKCONFIG_PROC=y 56 56 # CONFIG_CPUSETS is not set 57 57 CONFIG_INITRAMFS_SOURCE="" 58 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 58 59 # CONFIG_EMBEDDED is not set 59 60 CONFIG_KALLSYMS=y 60 61 # CONFIG_KALLSYMS_ALL is not set ··· 145 144 CONFIG_FLATMEM=y 146 145 CONFIG_FLAT_NODE_MEM_MAP=y 147 146 # CONFIG_SPARSEMEM_STATIC is not set 148 - CONFIG_SPLIT_PTLOCK_CPUS=4096 147 + CONFIG_SPLIT_PTLOCK_CPUS=4 149 148 # CONFIG_PPC_64K_PAGES is not set 150 149 # CONFIG_SCHED_SMT is not set 151 150 CONFIG_PROC_DEVICETREE=y
+5 -5
arch/powerpc/configs/maple_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.15-rc1 4 - # Tue Nov 15 14:38:58 2005 3 + # Linux kernel version: 2.6.15-rc5 4 + # Tue Dec 20 15:59:36 2005 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 53 53 CONFIG_IKCONFIG_PROC=y 54 54 # CONFIG_CPUSETS is not set 55 55 CONFIG_INITRAMFS_SOURCE="" 56 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 56 57 # CONFIG_EMBEDDED is not set 57 58 CONFIG_KALLSYMS=y 58 59 CONFIG_KALLSYMS_ALL=y ··· 150 149 CONFIG_FLATMEM=y 151 150 CONFIG_FLAT_NODE_MEM_MAP=y 152 151 # CONFIG_SPARSEMEM_STATIC is not set 153 - CONFIG_SPLIT_PTLOCK_CPUS=4096 152 + CONFIG_SPLIT_PTLOCK_CPUS=4 154 153 # CONFIG_PPC_64K_PAGES is not set 155 154 # CONFIG_SCHED_SMT is not set 156 155 CONFIG_PROC_DEVICETREE=y ··· 243 242 # QoS and/or fair queueing 244 243 # 245 244 # CONFIG_NET_SCHED is not set 246 - # CONFIG_NET_CLS_ROUTE is not set 247 245 248 246 # 249 247 # Network testing ··· 794 794 # CONFIG_USB_SERIAL_CONSOLE is not set 795 795 CONFIG_USB_SERIAL_GENERIC=y 796 796 # CONFIG_USB_SERIAL_AIRPRIME is not set 797 + # CONFIG_USB_SERIAL_ANYDATA is not set 797 798 # CONFIG_USB_SERIAL_BELKIN is not set 798 799 # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 799 800 # CONFIG_USB_SERIAL_CP2101 is not set ··· 825 824 # CONFIG_USB_SERIAL_KLSI is not set 826 825 # CONFIG_USB_SERIAL_KOBIL_SCT is not set 827 826 # CONFIG_USB_SERIAL_MCT_U232 is not set 828 - # CONFIG_USB_SERIAL_NOKIA_DKU2 is not set 829 827 # CONFIG_USB_SERIAL_PL2303 is not set 830 828 # CONFIG_USB_SERIAL_HP4X is not set 831 829 # CONFIG_USB_SERIAL_SAFE is not set
+4 -3
arch/powerpc/configs/ppc64_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.15-rc1 4 - # Fri Nov 18 16:23:24 2005 3 + # Linux kernel version: 2.6.15-rc5 4 + # Tue Dec 20 15:59:38 2005 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 54 54 CONFIG_IKCONFIG_PROC=y 55 55 CONFIG_CPUSETS=y 56 56 CONFIG_INITRAMFS_SOURCE="" 57 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 57 58 # CONFIG_EMBEDDED is not set 58 59 CONFIG_KALLSYMS=y 59 60 CONFIG_KALLSYMS_ALL=y ··· 177 176 # CONFIG_SPARSEMEM_STATIC is not set 178 177 CONFIG_SPARSEMEM_EXTREME=y 179 178 # CONFIG_MEMORY_HOTPLUG is not set 180 - CONFIG_SPLIT_PTLOCK_CPUS=4096 179 + CONFIG_SPLIT_PTLOCK_CPUS=4 181 180 # CONFIG_PPC_64K_PAGES is not set 182 181 # CONFIG_SCHED_SMT is not set 183 182 CONFIG_PROC_DEVICETREE=y
+4 -3
arch/powerpc/configs/pseries_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.15-rc1 4 - # Tue Nov 15 14:36:55 2005 3 + # Linux kernel version: 2.6.15-rc5 4 + # Tue Dec 20 15:59:40 2005 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 55 55 CONFIG_IKCONFIG_PROC=y 56 56 CONFIG_CPUSETS=y 57 57 CONFIG_INITRAMFS_SOURCE="" 58 + CONFIG_CC_OPTIMIZE_FOR_SIZE=y 58 59 # CONFIG_EMBEDDED is not set 59 60 CONFIG_KALLSYMS=y 60 61 CONFIG_KALLSYMS_ALL=y ··· 164 163 # CONFIG_SPARSEMEM_STATIC is not set 165 164 CONFIG_SPARSEMEM_EXTREME=y 166 165 # CONFIG_MEMORY_HOTPLUG is not set 167 - CONFIG_SPLIT_PTLOCK_CPUS=4096 166 + CONFIG_SPLIT_PTLOCK_CPUS=4 168 167 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 169 168 # CONFIG_PPC_64K_PAGES is not set 170 169 CONFIG_SCHED_SMT=y
+2 -2
arch/powerpc/kernel/entry_64.S
··· 183 183 ld r13,GPR13(r1) /* returning to usermode */ 184 184 1: ld r2,GPR2(r1) 185 185 li r12,MSR_RI 186 - andc r10,r10,r12 187 - mtmsrd r10,1 /* clear MSR.RI */ 186 + andc r11,r10,r12 187 + mtmsrd r11,1 /* clear MSR.RI */ 188 188 ld r1,GPR1(r1) 189 189 mtlr r4 190 190 mtcr r5
+1 -1
arch/powerpc/kernel/syscalls.c
··· 247 247 #define OVERRIDE_MACHINE 0 248 248 #endif 249 249 250 - static inline int override_machine(char *mach) 250 + static inline int override_machine(char __user *mach) 251 251 { 252 252 if (OVERRIDE_MACHINE) { 253 253 /* change ppc64 to ppc */
+1 -1
arch/powerpc/mm/hash_utils_64.c
··· 514 514 #undef KB 515 515 #undef MB 516 516 517 - void __init htab_initialize_secondary(void) 517 + void htab_initialize_secondary(void) 518 518 { 519 519 if (!platform_is_lpar()) 520 520 mtspr(SPRN_SDR1, _SDR1);
+3 -18
arch/powerpc/platforms/pseries/xics.c
··· 48 48 .set_affinity = xics_set_affinity 49 49 }; 50 50 51 - static struct hw_interrupt_type xics_8259_pic = { 52 - .typename = " XICS/8259", 53 - .ack = xics_mask_and_ack_irq, 54 - }; 55 - 56 51 /* This is used to map real irq numbers to virtual */ 57 52 static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC); 58 53 ··· 362 367 /* for sanity, this had better be < NR_IRQS - 16 */ 363 368 if (vec == xics_irq_8259_cascade_real) { 364 369 irq = i8259_irq(regs); 365 - if (irq == -1) { 366 - /* Spurious cascaded interrupt. Still must ack xics */ 367 - xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); 368 - 369 - irq = -1; 370 - } 370 + xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); 371 371 } else if (vec == XICS_IRQ_SPURIOUS) { 372 372 irq = -1; 373 373 } else { ··· 532 542 xics_irq_8259_cascade_real = *ireg; 533 543 xics_irq_8259_cascade 534 544 = virt_irq_create_mapping(xics_irq_8259_cascade_real); 545 + i8259_init(0, 0); 535 546 of_node_put(np); 536 547 } 537 548 ··· 556 565 #endif /* CONFIG_SMP */ 557 566 } 558 567 559 - xics_8259_pic.enable = i8259_pic.enable; 560 - xics_8259_pic.disable = i8259_pic.disable; 561 - xics_8259_pic.end = i8259_pic.end; 562 - for (i = 0; i < 16; ++i) 563 - get_irq_desc(i)->handler = &xics_8259_pic; 564 - for (; i < NR_IRQS; ++i) 568 + for (i = irq_offset_value(); i < NR_IRQS; ++i) 565 569 get_irq_desc(i)->handler = &xics_pic; 566 570 567 571 xics_setup_cpu(); ··· 576 590 no_action, 0, "8259 cascade", NULL)) 577 591 printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " 578 592 "cascade\n"); 579 - i8259_init(0, 0); 580 593 } 581 594 return 0; 582 595 }
+2 -1
arch/ppc/platforms/85xx/mpc85xx_cds_common.c
··· 130 130 } 131 131 132 132 #ifdef CONFIG_CPM2 133 - static void cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) 133 + static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) 134 134 { 135 135 while((irq = cpm2_get_irq(regs)) >= 0) 136 136 __do_IRQ(irq, regs); 137 + return IRQ_HANDLED; 137 138 } 138 139 139 140 static struct irqaction cpm2_irqaction = {
+1
arch/ppc/syslib/ppc4xx_dma.c
··· 30 30 31 31 #include <asm/system.h> 32 32 #include <asm/io.h> 33 + #include <asm/dma.h> 33 34 #include <asm/ppc4xx_dma.h> 34 35 35 36 ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS];
+4
arch/sparc/Kconfig
··· 55 55 depends on SMP 56 56 default "32" 57 57 58 + config SPARC 59 + bool 60 + default y 61 + 58 62 # Identify this as a Sparc32 build 59 63 config SPARC32 60 64 bool
+12 -12
arch/sparc/kernel/ebus.c
··· 22 22 #include <asm/oplib.h> 23 23 #include <asm/bpp.h> 24 24 25 - struct linux_ebus *ebus_chain = 0; 25 + struct linux_ebus *ebus_chain = NULL; 26 26 27 27 /* We are together with pcic.c under CONFIG_PCI. */ 28 28 extern unsigned int pcic_pin_to_irq(unsigned int, char *name); ··· 46 46 { "SUNW,CS4231", 0 }, 47 47 { "parallel", 0 }, 48 48 { "se", 2 }, 49 - { 0, 0 } 49 + { NULL, 0 } 50 50 }; 51 51 52 52 /* ··· 55 55 */ 56 56 static struct ebus_system_entry ebus_blacklist[] = { 57 57 { "SUNW,JavaEngine1", je1_1 }, 58 - { 0, 0 } 58 + { NULL, NULL } 59 59 }; 60 60 61 61 static struct ebus_device_irq *ebus_blackp = NULL; ··· 233 233 ebus_alloc(sizeof(struct linux_ebus_child)); 234 234 235 235 child = dev->children; 236 - child->next = 0; 236 + child->next = NULL; 237 237 child->parent = dev; 238 238 child->bus = dev->bus; 239 239 fill_ebus_child(node, &regs[0], child); ··· 243 243 ebus_alloc(sizeof(struct linux_ebus_child)); 244 244 245 245 child = child->next; 246 - child->next = 0; 246 + child->next = NULL; 247 247 child->parent = dev; 248 248 child->bus = dev->bus; 249 249 fill_ebus_child(node, &regs[0], child); ··· 275 275 } 276 276 } 277 277 278 - pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, 0); 278 + pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, NULL); 279 279 if (!pdev) { 280 280 return; 281 281 } ··· 284 284 285 285 ebus_chain = ebus = (struct linux_ebus *) 286 286 ebus_alloc(sizeof(struct linux_ebus)); 287 - ebus->next = 0; 287 + ebus->next = NULL; 288 288 289 289 while (ebusnd) { 290 290 ··· 325 325 ebus_alloc(sizeof(struct linux_ebus_device)); 326 326 327 327 dev = ebus->devices; 328 - dev->next = 0; 329 - dev->children = 0; 328 + dev->next = NULL; 329 + dev->children = NULL; 330 330 dev->bus = ebus; 331 331 fill_ebus_device(nd, dev); 332 332 ··· 335 335 ebus_alloc(sizeof(struct linux_ebus_device)); 336 336 337 337 dev = dev->next; 338 - dev->next = 0; 339 - dev->children = 0; 338 + dev->next = NULL; 339 + dev->children = NULL; 340 340 dev->bus = ebus; 341 341 fill_ebus_device(nd, dev); 342 342 } ··· 353 353 ebus->next = (struct linux_ebus *) 354 354 ebus_alloc(sizeof(struct linux_ebus)); 355 355 ebus = ebus->next; 356 - ebus->next = 0; 356 + ebus->next = NULL; 357 357 ++num_ebus; 358 358 } 359 359 if (pdev)
+1 -1
arch/sparc/kernel/led.c
··· 55 55 return len; 56 56 } 57 57 58 - static int led_write_proc(struct file *file, const char *buffer, 58 + static int led_write_proc(struct file *file, const char __user *buffer, 59 59 unsigned long count, void *data) 60 60 { 61 61 char *buf = NULL;
+1 -1
arch/sparc/kernel/pcic.c
··· 161 161 static int pcic0_up; 162 162 static struct linux_pcic pcic0; 163 163 164 - void * __iomem pcic_regs; 164 + void __iomem *pcic_regs; 165 165 volatile int pcic_speculative; 166 166 volatile int pcic_trapped; 167 167
+1 -1
arch/sparc/kernel/sys_sunos.c
··· 894 894 ret = ARG_MAX; 895 895 break; 896 896 case _SC_CHILD_MAX: 897 - ret = CHILD_MAX; 897 + ret = -1; /* no limit */ 898 898 break; 899 899 case _SC_CLK_TCK: 900 900 ret = HZ;
+2 -2
arch/sparc/kernel/time.c
··· 49 49 enum sparc_clock_type sp_clock_typ; 50 50 DEFINE_SPINLOCK(mostek_lock); 51 51 void __iomem *mstk48t02_regs = NULL; 52 - static struct mostek48t08 *mstk48t08_regs = NULL; 52 + static struct mostek48t08 __iomem *mstk48t08_regs = NULL; 53 53 static int set_rtc_mmss(unsigned long); 54 54 static int sbus_do_settimeofday(struct timespec *tv); 55 55 ··· 342 342 /* XXX r/o attribute is somewhere in r.flags */ 343 343 r.flags = clk_reg[0].which_io; 344 344 r.start = clk_reg[0].phys_addr; 345 - mstk48t08_regs = (struct mostek48t08 *) sbus_ioremap(&r, 0, 345 + mstk48t08_regs = sbus_ioremap(&r, 0, 346 346 sizeof(struct mostek48t08), "mk48t08"); 347 347 348 348 mstk48t02_regs = &mstk48t08_regs->regs;
+4 -14
arch/sparc/kernel/vmlinux.lds.S
··· 85 85 } 86 86 _end = . ; 87 87 PROVIDE (end = .); 88 - /* Stabs debugging sections. */ 89 - .stab 0 : { *(.stab) } 90 - .stabstr 0 : { *(.stabstr) } 91 - .stab.excl 0 : { *(.stab.excl) } 92 - .stab.exclstr 0 : { *(.stab.exclstr) } 93 - .stab.index 0 : { *(.stab.index) } 94 - .stab.indexstr 0 : { *(.stab.indexstr) } 95 - .comment 0 : { *(.comment) } 96 - .debug 0 : { *(.debug) } 97 - .debug_srcinfo 0 : { *(.debug_srcinfo) } 98 - .debug_aranges 0 : { *(.debug_aranges) } 99 - .debug_pubnames 0 : { *(.debug_pubnames) } 100 - .debug_sfnames 0 : { *(.debug_sfnames) } 101 - .line 0 : { *(.line) } 102 88 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } 89 + 90 + STABS_DEBUG 91 + 92 + DWARF_DEBUG 103 93 }
+1 -1
arch/sparc/mm/sun4c.c
··· 497 497 patch_kernel_fault_handler(); 498 498 } 499 499 500 - volatile unsigned long *sun4c_memerr_reg = NULL; 500 + volatile unsigned long __iomem *sun4c_memerr_reg = NULL; 501 501 502 502 void __init sun4c_probe_memerr_reg(void) 503 503 {
+4
arch/sparc64/Kconfig
··· 5 5 6 6 mainmenu "Linux/UltraSPARC Kernel Configuration" 7 7 8 + config SPARC 9 + bool 10 + default y 11 + 8 12 config SPARC64 9 13 bool 10 14 default y
-5
arch/sparc64/Makefile
··· 17 17 NEW_GCC := $(call cc-option-yn, -m64 -mcmodel=medlow) 18 18 NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) 19 19 UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; ) 20 - INLINE_LIMIT := $(call cc-option-yn, -m64 -finline-limit=100000) 21 20 22 21 export NEW_GCC 23 22 ··· 46 47 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \ 47 48 $(CC_UNDECL) 48 49 AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL) 49 - endif 50 - 51 - ifeq ($(INLINE_LIMIT),y) 52 - CFLAGS := $(CFLAGS) -finline-limit=100000 53 50 endif 54 51 55 52 ifeq ($(CONFIG_MCOUNT),y)
+1 -1
arch/sparc64/kernel/sys_sunos32.c
··· 854 854 ret = ARG_MAX; 855 855 break; 856 856 case _SC_CHILD_MAX: 857 - ret = CHILD_MAX; 857 + ret = -1; /* no limit */ 858 858 break; 859 859 case _SC_CLK_TCK: 860 860 ret = HZ;
+4 -14
arch/sparc64/kernel/vmlinux.lds.S
··· 90 90 } 91 91 _end = . ; 92 92 PROVIDE (end = .); 93 - /* Stabs debugging sections. */ 94 - .stab 0 : { *(.stab) } 95 - .stabstr 0 : { *(.stabstr) } 96 - .stab.excl 0 : { *(.stab.excl) } 97 - .stab.exclstr 0 : { *(.stab.exclstr) } 98 - .stab.index 0 : { *(.stab.index) } 99 - .stab.indexstr 0 : { *(.stab.indexstr) } 100 - .comment 0 : { *(.comment) } 101 - .debug 0 : { *(.debug) } 102 - .debug_srcinfo 0 : { *(.debug_srcinfo) } 103 - .debug_aranges 0 : { *(.debug_aranges) } 104 - .debug_pubnames 0 : { *(.debug_pubnames) } 105 - .debug_sfnames 0 : { *(.debug_sfnames) } 106 - .line 0 : { *(.line) } 107 93 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } 94 + 95 + STABS_DEBUG 96 + 97 + DWARF_DEBUG 108 98 }
+1 -1
arch/sparc64/solaris/misc.c
··· 353 353 { 354 354 switch (id) { 355 355 case SOLARIS_CONFIG_NGROUPS: return NGROUPS_MAX; 356 - case SOLARIS_CONFIG_CHILD_MAX: return CHILD_MAX; 356 + case SOLARIS_CONFIG_CHILD_MAX: return -1; /* no limit */ 357 357 case SOLARIS_CONFIG_OPEN_FILES: return OPEN_MAX; 358 358 case SOLARIS_CONFIG_POSIX_VER: return 199309; 359 359 case SOLARIS_CONFIG_PAGESIZE: return PAGE_SIZE;
+2
arch/um/Kconfig
··· 289 289 290 290 source "drivers/net/Kconfig" 291 291 292 + source "drivers/connector/Kconfig" 293 + 292 294 source "fs/Kconfig" 293 295 294 296 source "security/Kconfig"
+4
arch/um/Makefile-x86_64
··· 12 12 13 13 ELF_ARCH := i386:x86-64 14 14 ELF_FORMAT := elf64-x86-64 15 + 16 + # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example. 17 + 18 + LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
+17 -14
arch/um/include/sysdep-i386/stub.h
··· 6 6 #ifndef __SYSDEP_STUB_H 7 7 #define __SYSDEP_STUB_H 8 8 9 + #include <sys/mman.h> 9 10 #include <asm/ptrace.h> 10 11 #include <asm/unistd.h> 12 + #include "stub-data.h" 13 + #include "kern_constants.h" 14 + #include "uml-config.h" 11 15 12 16 extern void stub_segv_handler(int sig); 13 17 extern void stub_clone_handler(void); ··· 80 76 return ret; 81 77 } 82 78 83 - static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 84 - long arg4, long arg5, long arg6) 85 - { 86 - long ret; 87 - 88 - __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; " 89 - "int $0x80 ; pop %%ebp" 90 - : "=a" (ret) 91 - : "g" (syscall), "b" (arg1), "c" (arg2), "d" (arg3), 92 - "S" (arg4), "D" (arg5), "0" (arg6)); 93 - 94 - return ret; 95 - } 96 - 97 79 static inline void trap_myself(void) 98 80 { 99 81 __asm("int3"); 82 + } 83 + 84 + static inline void remap_stack(int fd, unsigned long offset) 85 + { 86 + __asm__ volatile ("movl %%eax,%%ebp ; movl %0,%%eax ; int $0x80 ;" 87 + "movl %7, %%ebx ; movl %%eax, (%%ebx)" 88 + : : "g" (STUB_MMAP_NR), "b" (UML_CONFIG_STUB_DATA), 89 + "c" (UM_KERN_PAGE_SIZE), 90 + "d" (PROT_READ | PROT_WRITE), 91 + "S" (MAP_FIXED | MAP_SHARED), "D" (fd), 92 + "a" (offset), 93 + "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err) 94 + : "memory"); 100 95 } 101 96 102 97 #endif
+18 -14
arch/um/include/sysdep-x86_64/stub.h
··· 6 6 #ifndef __SYSDEP_STUB_H 7 7 #define __SYSDEP_STUB_H 8 8 9 + #include <sys/mman.h> 9 10 #include <asm/unistd.h> 10 11 #include <sysdep/ptrace_user.h> 12 + #include "stub-data.h" 13 + #include "kern_constants.h" 14 + #include "uml-config.h" 11 15 12 16 extern void stub_segv_handler(int sig); 13 17 extern void stub_clone_handler(void); ··· 85 81 return ret; 86 82 } 87 83 88 - static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 89 - long arg4, long arg5, long arg6) 90 - { 91 - long ret; 92 - 93 - __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " 94 - "movq %7, %%r9; " __syscall : "=a" (ret) 95 - : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3), 96 - "g" (arg4), "g" (arg5), "g" (arg6) 97 - : __syscall_clobber, "r10", "r8", "r9" ); 98 - 99 - return ret; 100 - } 101 - 102 84 static inline void trap_myself(void) 103 85 { 104 86 __asm("int3"); 87 + } 88 + 89 + static inline void remap_stack(long fd, unsigned long offset) 90 + { 91 + __asm__ volatile ("movq %4,%%r10 ; movq %5,%%r8 ; " 92 + "movq %6, %%r9; " __syscall "; movq %7, %%rbx ; " 93 + "movq %%rax, (%%rbx)": 94 + : "a" (STUB_MMAP_NR), "D" (UML_CONFIG_STUB_DATA), 95 + "S" (UM_KERN_PAGE_SIZE), 96 + "d" (PROT_READ | PROT_WRITE), 97 + "g" (MAP_FIXED | MAP_SHARED), "g" (fd), 98 + "g" (offset), 99 + "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err) 100 + : __syscall_clobber, "r10", "r8", "r9" ); 105 101 } 106 102 107 103 #endif
+13 -10
arch/um/kernel/skas/clone.c
··· 18 18 * on some systems. 19 19 */ 20 20 21 - #define STUB_DATA(field) (((struct stub_data *) UML_CONFIG_STUB_DATA)->field) 22 - 23 21 void __attribute__ ((__section__ (".__syscall_stub"))) 24 22 stub_clone_handler(void) 25 23 { 24 + struct stub_data *data = (struct stub_data *) UML_CONFIG_STUB_DATA; 26 25 long err; 27 26 28 27 err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD, ··· 34 35 if(err) 35 36 goto out; 36 37 37 - err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL, 38 - (long) &STUB_DATA(timer), 0); 38 + err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL, 39 + (long) &data->timer, 0); 39 40 if(err) 40 41 goto out; 41 42 42 - err = stub_syscall6(STUB_MMAP_NR, UML_CONFIG_STUB_DATA, 43 - UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, 44 - MAP_FIXED | MAP_SHARED, STUB_DATA(fd), 45 - STUB_DATA(offset)); 43 + remap_stack(data->fd, data->offset); 44 + goto done; 45 + 46 46 out: 47 - /* save current result. Parent: pid; child: retcode of mmap */ 48 - STUB_DATA(err) = err; 47 + /* save current result. 48 + * Parent: pid; 49 + * child: retcode of mmap already saved and it jumps around this 50 + * assignment 51 + */ 52 + data->err = err; 53 + done: 49 54 trap_myself(); 50 55 }
+12 -10
arch/um/os-Linux/start_up.c
··· 116 116 if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) { 117 117 int exit_with = WEXITSTATUS(status); 118 118 if (exit_with == 2) 119 - printk("check_ptrace : child exited with status 2. " 119 + printf("check_ptrace : child exited with status 2. " 120 120 "Serious trouble happening! Try updating your " 121 121 "host skas patch!\nDisabling SYSEMU support."); 122 - printk("check_ptrace : child exited with exitcode %d, while " 122 + printf("check_ptrace : child exited with exitcode %d, while " 123 123 "expecting %d; status 0x%x", exit_with, 124 124 exitcode, status); 125 125 if (mustpanic) 126 126 panic("\n"); 127 127 else 128 - printk("\n"); 128 + printf("\n"); 129 129 ret = -1; 130 130 } 131 131 ··· 183 183 void *stack; 184 184 int pid, n, status, count=0; 185 185 186 - printk("Checking syscall emulation patch for ptrace..."); 186 + printf("Checking syscall emulation patch for ptrace..."); 187 187 sysemu_supported = 0; 188 188 pid = start_ptraced_child(&stack); 189 189 ··· 207 207 goto fail_stopped; 208 208 209 209 sysemu_supported = 1; 210 - printk("OK\n"); 210 + printf("OK\n"); 211 211 set_using_sysemu(!force_sysemu_disabled); 212 212 213 - printk("Checking advanced syscall emulation patch for ptrace..."); 213 + printf("Checking advanced syscall emulation patch for ptrace..."); 214 214 pid = start_ptraced_child(&stack); 215 215 216 216 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, ··· 246 246 goto fail_stopped; 247 247 248 248 sysemu_supported = 2; 249 - printk("OK\n"); 249 + printf("OK\n"); 250 250 251 251 if ( !force_sysemu_disabled ) 252 252 set_using_sysemu(sysemu_supported); ··· 255 255 fail: 256 256 stop_ptraced_child(pid, stack, 1, 0); 257 257 fail_stopped: 258 - printk("missing\n"); 258 + printf("missing\n"); 259 259 } 260 260 261 261 static void __init check_ptrace(void) ··· 263 263 void *stack; 264 264 int pid, syscall, n, status; 265 265 266 - printk("Checking that ptrace can change system call numbers..."); 266 + printf("Checking that ptrace can change system call numbers..."); 267 267 pid = start_ptraced_child(&stack); 268 268 269 269 if(ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0) ··· 292 292 } 293 293 } 294 294 stop_ptraced_child(pid, stack, 0, 1); 295 - printk("OK\n"); 295 + printf("OK\n"); 296 296 check_sysemu(); 297 297 } 298 298 ··· 471 471 #endif 472 472 473 473 int have_devanon = 0; 474 + 475 + /* Runs on boot kernel stack - already safe to use printk. */ 474 476 475 477 void check_devanon(void) 476 478 {
+5
arch/um/os-Linux/user_syms.c
··· 34 34 int sym(void); \ 35 35 EXPORT_SYMBOL(sym); 36 36 37 + extern void readdir64(void) __attribute__((weak)); 38 + EXPORT_SYMBOL(readdir64); 39 + extern void truncate64(void) __attribute__((weak)); 40 + EXPORT_SYMBOL(truncate64); 41 + 37 42 #ifdef SUBARCH_i386 38 43 EXPORT_SYMBOL(vsyscall_ehdr); 39 44 EXPORT_SYMBOL(vsyscall_end);
-5
arch/um/scripts/Makefile.rules
··· 21 21 endef 22 22 23 23 24 - # The stubs and unmap.o can't try to call mcount or update basic block data 25 - define unprofile 26 - $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1))) 27 - endef 28 - 29 24 # cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If 30 25 # so, it's considered to be a path relative to $(srcdir) rather than 31 26 # $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from
+5 -3
arch/um/sys-i386/Makefile
··· 1 - obj-y = bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ 2 - ptrace_user.o semaphore.o signal.o sigcontext.o stub.o stub_segv.o \ 3 - syscalls.o sysrq.o sys_call_table.o 1 + obj-y := bitops.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ 2 + ptrace_user.o semaphore.o signal.o sigcontext.o syscalls.o sysrq.o \ 3 + sys_call_table.o 4 + 5 + obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o 4 6 5 7 obj-$(CONFIG_HIGHMEM) += highmem.o 6 8 obj-$(CONFIG_MODULES) += module.o
+3 -2
arch/um/sys-x86_64/Makefile
··· 6 6 7 7 #XXX: why into lib-y? 8 8 lib-y = bitops.o bugs.o csum-partial.o delay.o fault.o ldt.o mem.o memcpy.o \ 9 - ptrace.o ptrace_user.o sigcontext.o signal.o stub.o \ 10 - stub_segv.o syscalls.o syscall_table.o sysrq.o thunk.o 9 + ptrace.o ptrace_user.o sigcontext.o signal.o syscalls.o \ 10 + syscall_table.o sysrq.o thunk.o 11 + lib-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o 11 12 12 13 obj-y := ksyms.o 13 14 obj-$(CONFIG_MODULES) += module.o um_module.o
+1 -1
arch/x86_64/mm/init.c
··· 348 348 } 349 349 350 350 /* Compute holes */ 351 - w = 0; 351 + w = start_pfn; 352 352 for (i = 0; i < MAX_NR_ZONES; i++) { 353 353 unsigned long s = w; 354 354 w += z[i];
+1 -1
arch/x86_64/mm/ioremap.c
··· 263 263 addr < phys_to_virt(ISA_END_ADDRESS)) 264 264 return; 265 265 266 - addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr); 266 + addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr); 267 267 /* Use the vm area unlocked, assuming the caller 268 268 ensures there isn't another iounmap for the same address 269 269 in parallel. Reuse of the virtual address is prevented by
+1 -1
arch/x86_64/pci/Makefile
··· 11 11 obj-$(CONFIG_ACPI) += acpi.o 12 12 obj-y += legacy.o irq.o common.o 13 13 # mmconfig has a 64bit special 14 - obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o 14 + obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o 15 15 16 16 obj-$(CONFIG_NUMA) += k8-bus.o 17 17
+7 -7
arch/x86_64/pci/mmconfig.c
··· 18 18 /* Static virtual mapping of the MMCONFIG aperture */ 19 19 struct mmcfg_virt { 20 20 struct acpi_table_mcfg_config *cfg; 21 - char *virt; 21 + char __iomem *virt; 22 22 }; 23 23 static struct mmcfg_virt *pci_mmcfg_virt; 24 24 25 - static char *get_virt(unsigned int seg, unsigned bus) 25 + static char __iomem *get_virt(unsigned int seg, unsigned bus) 26 26 { 27 27 int cfg_num = -1; 28 28 struct acpi_table_mcfg_config *cfg; ··· 43 43 } 44 44 } 45 45 46 - static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) 46 + static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) 47 47 { 48 - char *addr; 48 + char __iomem *addr; 49 49 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots)) 50 50 return NULL; 51 51 addr = get_virt(seg, bus); ··· 57 57 static int pci_mmcfg_read(unsigned int seg, unsigned int bus, 58 58 unsigned int devfn, int reg, int len, u32 *value) 59 59 { 60 - char *addr; 60 + char __iomem *addr; 61 61 62 62 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 63 63 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095))) ··· 85 85 static int pci_mmcfg_write(unsigned int seg, unsigned int bus, 86 86 unsigned int devfn, int reg, int len, u32 value) 87 87 { 88 - char *addr; 88 + char __iomem *addr; 89 89 90 90 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 91 91 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) ··· 127 127 int i; 128 128 for (i = 0; i < 32; i++) { 129 129 u32 val1; 130 - char *addr; 130 + char __iomem *addr; 131 131 132 132 pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1); 133 133 if (val1 == 0xffffffff)
+31 -14
block/scsi_ioctl.c
··· 442 442 return err; 443 443 } 444 444 445 + 446 + /* Send basic block requests */ 447 + static int __blk_send_generic(request_queue_t *q, struct gendisk *bd_disk, int cmd, int data) 448 + { 449 + struct request *rq; 450 + int err; 451 + 452 + rq = blk_get_request(q, WRITE, __GFP_WAIT); 453 + rq->flags |= REQ_BLOCK_PC; 454 + rq->data = NULL; 455 + rq->data_len = 0; 456 + rq->timeout = BLK_DEFAULT_TIMEOUT; 457 + memset(rq->cmd, 0, sizeof(rq->cmd)); 458 + rq->cmd[0] = cmd; 459 + rq->cmd[4] = data; 460 + rq->cmd_len = 6; 461 + err = blk_execute_rq(q, bd_disk, rq, 0); 462 + blk_put_request(rq); 463 + 464 + return err; 465 + } 466 + 467 + static inline int blk_send_start_stop(request_queue_t *q, struct gendisk *bd_disk, int data) 468 + { 469 + return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data); 470 + } 471 + 445 472 int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg) 446 473 { 447 474 request_queue_t *q; 448 - struct request *rq; 449 - int close = 0, err; 475 + int err; 450 476 451 477 q = bd_disk->queue; 452 478 if (!q) ··· 590 564 err = sg_scsi_ioctl(file, q, bd_disk, arg); 591 565 break; 592 566 case CDROMCLOSETRAY: 593 - close = 1; 567 + err = blk_send_start_stop(q, bd_disk, 0x03); 568 + break; 594 569 case CDROMEJECT: 595 - rq = blk_get_request(q, WRITE, __GFP_WAIT); 596 - rq->flags |= REQ_BLOCK_PC; 597 - rq->data = NULL; 598 - rq->data_len = 0; 599 - rq->timeout = BLK_DEFAULT_TIMEOUT; 600 - memset(rq->cmd, 0, sizeof(rq->cmd)); 601 - rq->cmd[0] = GPCMD_START_STOP_UNIT; 602 - rq->cmd[4] = 0x02 + (close != 0); 603 - rq->cmd_len = 6; 604 - err = blk_execute_rq(q, bd_disk, rq, 0); 605 - blk_put_request(rq); 570 + err = blk_send_start_stop(q, bd_disk, 0x02); 606 571 break; 607 572 default: 608 573 err = -ENOTTY;
+15 -5
drivers/acpi/processor_idle.c
··· 274 274 } 275 275 } 276 276 277 - cx->usage++; 278 - 279 277 #ifdef CONFIG_HOTPLUG_CPU 280 278 /* 281 279 * Check for P_LVL2_UP flag before entering C2 and above on ··· 281 283 * detection phase, to work cleanly with logical CPU hotplug. 282 284 */ 283 285 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && 284 - !pr->flags.has_cst && acpi_fadt.plvl2_up) 285 - cx->type = ACPI_STATE_C1; 286 + !pr->flags.has_cst && !acpi_fadt.plvl2_up) 287 + cx = &pr->power.states[ACPI_STATE_C1]; 286 288 #endif 289 + 290 + cx->usage++; 291 + 287 292 /* 288 293 * Sleep: 289 294 * ------ ··· 386 385 } 387 386 388 387 next_state = pr->power.state; 388 + 389 + #ifdef CONFIG_HOTPLUG_CPU 390 + /* Don't do promotion/demotion */ 391 + if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) && 392 + !pr->flags.has_cst && !acpi_fadt.plvl2_up) { 393 + next_state = cx; 394 + goto end; 395 + } 396 + #endif 389 397 390 398 /* 391 399 * Promotion? ··· 567 557 * Check for P_LVL2_UP flag before entering C2 and above on 568 558 * an SMP system. 569 559 */ 570 - if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up) 560 + if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) 571 561 return_VALUE(-ENODEV); 572 562 #endif 573 563
+2 -2
drivers/acpi/processor_thermal.c
··· 102 102 { 103 103 struct cpufreq_policy policy; 104 104 if (!acpi_thermal_cpufreq_is_init || cpufreq_get_policy(&policy, cpu)) 105 - return -ENODEV; 106 - return 0; 105 + return 0; 106 + return 1; 107 107 } 108 108 109 109 static int acpi_thermal_cpufreq_increase(unsigned int cpu)
+9 -9
drivers/acpi/utilities/utmisc.c
··· 84 84 85 85 /* Find a free owner ID */ 86 86 87 - for (i = 0; i < 32; i++) { 88 - if (!(acpi_gbl_owner_id_mask & (1 << i))) { 87 + for (i = 0; i < 64; i++) { 88 + if (!(acpi_gbl_owner_id_mask & (1ULL << i))) { 89 89 ACPI_DEBUG_PRINT((ACPI_DB_VALUES, 90 - "Current owner_id mask: %8.8X New ID: %2.2X\n", 90 + "Current owner_id mask: %16.16LX New ID: %2.2X\n", 91 91 acpi_gbl_owner_id_mask, 92 92 (unsigned int)(i + 1))); 93 93 94 - acpi_gbl_owner_id_mask |= (1 << i); 94 + acpi_gbl_owner_id_mask |= (1ULL << i); 95 95 *owner_id = (acpi_owner_id) (i + 1); 96 96 goto exit; 97 97 } ··· 106 106 */ 107 107 *owner_id = 0; 108 108 status = AE_OWNER_ID_LIMIT; 109 - ACPI_REPORT_ERROR(("Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT\n")); 109 + ACPI_REPORT_ERROR(("Could not allocate new owner_id (64 max), AE_OWNER_ID_LIMIT\n")); 110 110 111 111 exit: 112 112 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); ··· 123 123 * control method or unloading a table. Either way, we would 124 124 * ignore any error anyway. 125 125 * 126 - * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 32 126 + * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 64 127 127 * 128 128 ******************************************************************************/ 129 129 ··· 140 140 141 141 /* Zero is not a valid owner_iD */ 142 142 143 - if ((owner_id == 0) || (owner_id > 32)) { 143 + if ((owner_id == 0) || (owner_id > 64)) { 144 144 ACPI_REPORT_ERROR(("Invalid owner_id: %2.2X\n", owner_id)); 145 145 return_VOID; 146 146 } ··· 158 158 159 159 /* Free the owner ID only if it is valid */ 160 160 161 - if (acpi_gbl_owner_id_mask & (1 << owner_id)) { 162 - acpi_gbl_owner_id_mask ^= (1 << owner_id); 161 + if (acpi_gbl_owner_id_mask & (1ULL << owner_id)) { 162 + acpi_gbl_owner_id_mask ^= (1ULL << owner_id); 163 163 } 164 164 165 165 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
+1 -1
drivers/atm/adummy.c
··· 123 123 } 124 124 memset(adummy_dev, 0, sizeof(struct adummy_dev)); 125 125 126 - atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, 0); 126 + atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, NULL); 127 127 if (!atm_dev) { 128 128 printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); 129 129 err = -ENODEV;
-1
drivers/base/memory.c
··· 28 28 static struct sysdev_class memory_sysdev_class = { 29 29 set_kset_name(MEMORY_CLASS_NAME), 30 30 }; 31 - EXPORT_SYMBOL(memory_sysdev_class); 32 31 33 32 static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj) 34 33 {
+2 -2
drivers/char/Kconfig
··· 687 687 688 688 config RTC 689 689 tristate "Enhanced Real Time Clock Support" 690 - depends on !PPC32 && !PARISC && !IA64 && !M68K 690 + depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI) 691 691 ---help--- 692 692 If you say Y here and create a character special file /dev/rtc with 693 693 major number 10 and minor number 135 using mknod ("man mknod"), you ··· 735 735 736 736 config GEN_RTC 737 737 tristate "Generic /dev/rtc emulation" 738 - depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC32 && !SPARC64 738 + depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC 739 739 ---help--- 740 740 If you say Y here and create a character special file /dev/rtc with 741 741 major number 10 and minor number 135 using mknod ("man mknod"), you
+2 -2
drivers/char/drm/radeon_cp.c
··· 1311 1311 1312 1312 static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init) 1313 1313 { 1314 - drm_radeon_private_t *dev_priv = dev->dev_private;; 1314 + drm_radeon_private_t *dev_priv = dev->dev_private; 1315 1315 DRM_DEBUG("\n"); 1316 1316 1317 1317 dev_priv->is_pci = init->is_pci; ··· 1522 1522 1523 1523 dev_priv->gart_size = init->gart_size; 1524 1524 dev_priv->gart_vm_start = dev_priv->fb_location 1525 - + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2; 1525 + + RADEON_READ(RADEON_CONFIG_APER_SIZE); 1526 1526 1527 1527 #if __OS_HAS_AGP 1528 1528 if (!dev_priv->is_pci)
+1
drivers/char/drm/radeon_drv.h
··· 379 379 # define RADEON_PLL_WR_EN (1 << 7) 380 380 #define RADEON_CLOCK_CNTL_INDEX 0x0008 381 381 #define RADEON_CONFIG_APER_SIZE 0x0108 382 + #define RADEON_CONFIG_MEMSIZE 0x00f8 382 383 #define RADEON_CRTC_OFFSET 0x0224 383 384 #define RADEON_CRTC_OFFSET_CNTL 0x0228 384 385 # define RADEON_CRTC_TILE_EN (1 << 15)
+4 -2
drivers/char/ipmi/ipmi_si_intf.c
··· 2399 2399 new_smi->handlers->cleanup(new_smi->si_sm); 2400 2400 kfree(new_smi->si_sm); 2401 2401 } 2402 - new_smi->io_cleanup(new_smi); 2402 + if (new_smi->io_cleanup) 2403 + new_smi->io_cleanup(new_smi); 2403 2404 2404 2405 return rv; 2405 2406 } ··· 2519 2518 2520 2519 kfree(to_clean->si_sm); 2521 2520 2522 - to_clean->io_cleanup(to_clean); 2521 + if (to_clean->io_cleanup) 2522 + to_clean->io_cleanup(to_clean); 2523 2523 } 2524 2524 2525 2525 static __exit void cleanup_ipmi_si(void)
+5 -5
drivers/char/keyboard.c
··· 930 930 } 931 931 932 932 #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\ 933 - defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) ||\ 934 - defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ 933 + defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\ 934 + defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\ 935 935 (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) 936 936 937 937 #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\ ··· 958 958 extern int mac_hid_mouse_emulate_buttons(int, int, int); 959 959 #endif /* CONFIG_MAC_EMUMOUSEBTN */ 960 960 961 - #if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) 961 + #ifdef CONFIG_SPARC 962 962 static int sparc_l1_a_state = 0; 963 963 extern void sun_do_break(void); 964 964 #endif ··· 1045 1045 1046 1046 if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT) 1047 1047 sysrq_alt = down; 1048 - #if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) 1048 + #ifdef CONFIG_SPARC 1049 1049 if (keycode == KEY_STOP) 1050 1050 sparc_l1_a_state = down; 1051 1051 #endif ··· 1072 1072 return; 1073 1073 } 1074 1074 #endif 1075 - #if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) 1075 + #ifdef CONFIG_SPARC 1076 1076 if (keycode == KEY_A && sparc_l1_a_state) { 1077 1077 sparc_l1_a_state = 0; 1078 1078 sun_do_break();
+1 -1
drivers/char/mwave/mwavepub.h
··· 69 69 typedef struct _MW_READWRITE { 70 70 unsigned short usDspAddress; /* The dsp address */ 71 71 unsigned long ulDataLength; /* The size in bytes of the data or user buffer */ 72 - void *pBuf; /* Input:variable sized buffer */ 72 + void __user *pBuf; /* Input:variable sized buffer */ 73 73 } MW_READWRITE, *pMW_READWRITE; 74 74 75 75 #define IOCTL_MW_RESET _IO(MWAVE_MINOR,1)
+7 -6
drivers/char/pcmcia/cm4000_cs.c
··· 1444 1444 dev_link_t *link; 1445 1445 int size; 1446 1446 int rc; 1447 + void __user *argp = (void __user *)arg; 1447 1448 #ifdef PCMCIA_DEBUG 1448 1449 char *ioctl_names[CM_IOC_MAXNR + 1] = { 1449 1450 [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS", ··· 1482 1481 _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd); 1483 1482 1484 1483 if (_IOC_DIR(cmd) & _IOC_READ) { 1485 - if (!access_ok(VERIFY_WRITE, (void *)arg, size)) 1484 + if (!access_ok(VERIFY_WRITE, argp, size)) 1486 1485 return -EFAULT; 1487 1486 } 1488 1487 if (_IOC_DIR(cmd) & _IOC_WRITE) { 1489 - if (!access_ok(VERIFY_READ, (void *)arg, size)) 1488 + if (!access_ok(VERIFY_READ, argp, size)) 1490 1489 return -EFAULT; 1491 1490 } 1492 1491 ··· 1507 1506 status |= CM_NO_READER; 1508 1507 if (test_bit(IS_BAD_CARD, &dev->flags)) 1509 1508 status |= CM_BAD_CARD; 1510 - if (copy_to_user((int *)arg, &status, sizeof(int))) 1509 + if (copy_to_user(argp, &status, sizeof(int))) 1511 1510 return -EFAULT; 1512 1511 } 1513 1512 return 0; 1514 1513 case CM_IOCGATR: 1515 1514 DEBUGP(4, dev, "... in CM_IOCGATR\n"); 1516 1515 { 1517 - struct atreq *atreq = (struct atreq *) arg; 1516 + struct atreq __user *atreq = argp; 1518 1517 int tmp; 1519 1518 /* allow nonblocking io and being interrupted */ 1520 1519 if (wait_event_interruptible ··· 1598 1597 { 1599 1598 struct ptsreq krnptsreq; 1600 1599 1601 - if (copy_from_user(&krnptsreq, (struct ptsreq *) arg, 1600 + if (copy_from_user(&krnptsreq, argp, 1602 1601 sizeof(struct ptsreq))) 1603 1602 return -EFAULT; 1604 1603 ··· 1642 1641 int old_pc_debug = 0; 1643 1642 1644 1643 old_pc_debug = pc_debug; 1645 - if (copy_from_user(&pc_debug, (int *)arg, sizeof(int))) 1644 + if (copy_from_user(&pc_debug, argp, sizeof(int))) 1646 1645 return -EFAULT; 1647 1646 1648 1647 if (old_pc_debug != pc_debug)
+1 -1
drivers/char/vc_screen.c
··· 419 419 while (this_round > 1) { 420 420 unsigned short w; 421 421 422 - w = get_unaligned(((const unsigned short *)con_buf0)); 422 + w = get_unaligned(((unsigned short *)con_buf0)); 423 423 vcs_scr_writew(vc, w, org++); 424 424 con_buf0 += 2; 425 425 this_round -= 2;
+8 -7
drivers/char/watchdog/booke_wdt.c
··· 72 72 /* 73 73 * booke_wdt_write: 74 74 */ 75 - static ssize_t booke_wdt_write (struct file *file, const char *buf, 75 + static ssize_t booke_wdt_write (struct file *file, const char __user *buf, 76 76 size_t count, loff_t *ppos) 77 77 { 78 78 booke_wdt_ping(); ··· 92 92 unsigned int cmd, unsigned long arg) 93 93 { 94 94 u32 tmp = 0; 95 + u32 __user *p = (u32 __user *)arg; 95 96 96 97 switch (cmd) { 97 98 case WDIOC_GETSUPPORT: 98 - if (copy_to_user ((struct watchdog_info *) arg, &ident, 99 + if (copy_to_user ((struct watchdog_info __user *) arg, &ident, 99 100 sizeof(struct watchdog_info))) 100 101 return -EFAULT; 101 102 case WDIOC_GETSTATUS: 102 - return put_user(ident.options, (u32 *) arg); 103 + return put_user(ident.options, p); 103 104 case WDIOC_GETBOOTSTATUS: 104 105 /* XXX: something is clearing TSR */ 105 106 tmp = mfspr(SPRN_TSR) & TSR_WRS(3); ··· 110 109 booke_wdt_ping(); 111 110 return 0; 112 111 case WDIOC_SETTIMEOUT: 113 - if (get_user(booke_wdt_period, (u32 *) arg)) 112 + if (get_user(booke_wdt_period, p)) 114 113 return -EFAULT; 115 114 mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period)); 116 115 return 0; 117 116 case WDIOC_GETTIMEOUT: 118 - return put_user(booke_wdt_period, (u32 *) arg); 117 + return put_user(booke_wdt_period, p); 119 118 case WDIOC_SETOPTIONS: 120 - if (get_user(tmp, (u32 *) arg)) 119 + if (get_user(tmp, p)) 121 120 return -EINVAL; 122 121 if (tmp == WDIOS_ENABLECARD) { 123 122 booke_wdt_ping(); ··· 173 172 int ret = 0; 174 173 175 174 printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n"); 176 - ident.firmware_version = cpu_specs[0].pvr_value; 175 + ident.firmware_version = cur_cpu_spec->pvr_value; 177 176 178 177 ret = misc_register(&booke_wdt_miscdev); 179 178 if (ret) {
+1 -1
drivers/char/watchdog/wdrtas.c
··· 320 320 wdrtas_ioctl(struct inode *inode, struct file *file, 321 321 unsigned int cmd, unsigned long arg) 322 322 { 323 - int __user *argp = (void *)arg; 323 + int __user *argp = (void __user *)arg; 324 324 int i; 325 325 static struct watchdog_info wdinfo = { 326 326 .options = WDRTAS_SUPPORTED_MASK,
+4 -4
drivers/fc4/Kconfig
··· 26 26 27 27 config FC4_SOC 28 28 tristate "Sun SOC/Sbus" 29 - depends on FC4!=n && (SPARC32 || SPARC64) 29 + depends on FC4!=n && SPARC 30 30 help 31 31 Serial Optical Channel is an interface card with one or two Fibre 32 32 Optic ports, each of which can be connected to a disk array. Note ··· 38 38 39 39 config FC4_SOCAL 40 40 tristate "Sun SOC+ (aka SOCAL)" 41 - depends on FC4!=n && (SPARC32 || SPARC64) 41 + depends on FC4!=n && SPARC 42 42 ---help--- 43 43 Serial Optical Channel Plus is an interface card with up to two 44 44 Fibre Optic ports. This card supports FC Arbitrated Loop (usually ··· 62 62 be called pluto. 63 63 64 64 config SCSI_FCAL 65 - tristate "Sun Enterprise Network Array (A5000 and EX500)" if SPARC32 || SPARC64 65 + tristate "Sun Enterprise Network Array (A5000 and EX500)" if SPARC 66 66 depends on FC4!=n && SCSI 67 67 help 68 68 This driver drives FC-AL disks connected through a Fibre Channel ··· 75 75 76 76 config SCSI_FCAL 77 77 prompt "Generic FC-AL disk driver" 78 - depends on FC4!=n && SCSI && !SPARC32 && !SPARC64 78 + depends on FC4!=n && SCSI && !SPARC 79 79 80 80 endmenu 81 81
+3 -3
drivers/firmware/dell_rbu.c
··· 105 105 int ordernum = 0; 106 106 int retval = 0; 107 107 unsigned int packet_array_size = 0; 108 - void **invalid_addr_packet_array = 0; 109 - void *packet_data_temp_buf = 0; 108 + void **invalid_addr_packet_array = NULL; 109 + void *packet_data_temp_buf = NULL; 110 110 unsigned int idx = 0; 111 111 112 112 pr_debug("create_packet: entry \n"); ··· 178 178 packet_data_temp_buf), 179 179 allocation_floor); 180 180 invalid_addr_packet_array[idx++] = packet_data_temp_buf; 181 - packet_data_temp_buf = 0; 181 + packet_data_temp_buf = NULL; 182 182 } 183 183 } 184 184 spin_lock(&rbu_data.lock);
+6 -5
drivers/i2c/busses/i2c-mv64xxx.c
··· 529 529 i2c_set_adapdata(&drv_data->adapter, drv_data); 530 530 531 531 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, 532 - MV64XXX_I2C_CTLR_NAME, drv_data)) { 533 - 534 - dev_err(dev, "mv64xxx: Can't register intr handler " 535 - "irq: %d\n", drv_data->irq); 532 + MV64XXX_I2C_CTLR_NAME, drv_data)) { 533 + dev_err(&drv_data->adapter.dev, 534 + "mv64xxx: Can't register intr handler irq: %d\n", 535 + drv_data->irq); 536 536 rc = -EINVAL; 537 537 goto exit_unmap_regs; 538 538 } else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) { 539 - dev_err(dev, "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc); 539 + dev_err(&drv_data->adapter.dev, 540 + "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc); 540 541 goto exit_free_irq; 541 542 } 542 543
+1 -9
drivers/ide/Kconfig
··· 807 807 depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX 808 808 endchoice 809 809 810 - config BLK_DEV_IDE_AU1XXX_BURSTABLE_ON 811 - bool "Enable burstable Mode on DbDMA" 812 - default false 813 - depends BLK_DEV_IDE_AU1XXX 814 - help 815 - This option enable the burstable Flag on DbDMA controller 816 - (cf. "AMD Alchemy 'Au1200' Processor Data Book - PRELIMINARY"). 817 - 818 810 config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ 819 811 int "Maximum transfer size (KB) per request (up to 128)" 820 812 default "128" ··· 932 940 933 941 config BLK_DEV_MPC8xx_IDE 934 942 bool "MPC8xx IDE support" 935 - depends on 8xx 943 + depends on 8xx && IDE=y && BLK_DEV_IDE=y 936 944 help 937 945 This option provides support for IDE on Motorola MPC8xx Systems. 938 946 Please see 'Type of MPC8xx IDE interface' for details.
-7
drivers/ide/ide-cd.c
··· 1292 1292 struct cdrom_info *info = drive->driver_data; 1293 1293 1294 1294 info->dma = 0; 1295 - info->cmd = 0; 1296 1295 info->start_seek = jiffies; 1297 1296 return cdrom_start_packet_command(drive, 0, cdrom_start_seek_continuation); 1298 1297 } ··· 1342 1343 if ((rq->sector & (sectors_per_frame - 1)) || 1343 1344 (rq->nr_sectors & (sectors_per_frame - 1))) 1344 1345 info->dma = 0; 1345 - 1346 - info->cmd = READ; 1347 1346 1348 1347 /* Start sending the read request to the drive. */ 1349 1348 return cdrom_start_packet_command(drive, 32768, cdrom_start_read_continuation); ··· 1481 1484 struct cdrom_info *info = drive->driver_data; 1482 1485 1483 1486 info->dma = 0; 1484 - info->cmd = 0; 1485 1487 rq->flags &= ~REQ_FAILED; 1486 1488 len = rq->data_len; 1487 1489 ··· 1887 1891 /* use dma, if possible. we don't need to check more, since we 1888 1892 * know that the transfer is always (at least!) frame aligned */ 1889 1893 info->dma = drive->using_dma ? 1 : 0; 1890 - info->cmd = WRITE; 1891 1894 1892 1895 info->devinfo.media_written = 1; 1893 1896 ··· 1911 1916 rq->flags |= REQ_QUIET; 1912 1917 1913 1918 info->dma = 0; 1914 - info->cmd = 0; 1915 1919 1916 1920 /* 1917 1921 * sg request ··· 1919 1925 int mask = drive->queue->dma_alignment; 1920 1926 unsigned long addr = (unsigned long) page_address(bio_page(rq->bio)); 1921 1927 1922 - info->cmd = rq_data_dir(rq); 1923 1928 info->dma = drive->using_dma; 1924 1929 1925 1930 /*
-1
drivers/ide/ide-cd.h
··· 480 480 481 481 struct request request_sense_request; 482 482 int dma; 483 - int cmd; 484 483 unsigned long last_block; 485 484 unsigned long start_seek; 486 485 /* Buffer to hold mechanism status and changer slot table. */
+2 -2
drivers/ide/ide-disk.c
··· 1034 1034 struct ide_disk_obj *idkp = drive->driver_data; 1035 1035 struct gendisk *g = idkp->disk; 1036 1036 1037 - ide_cacheflush_p(drive); 1038 - 1039 1037 ide_unregister_subdriver(drive, idkp->driver); 1040 1038 1041 1039 del_gendisk(g); 1040 + 1041 + ide_cacheflush_p(drive); 1042 1042 1043 1043 ide_disk_put(idkp); 1044 1044
+6 -9
drivers/ide/ide-dma.c
··· 90 90 #include <asm/io.h> 91 91 #include <asm/irq.h> 92 92 93 - struct drive_list_entry { 94 - const char *id_model; 95 - const char *id_firmware; 96 - }; 97 - 98 93 static const struct drive_list_entry drive_whitelist [] = { 99 94 100 95 { "Micropolis 2112A" , "ALL" }, ··· 134 139 }; 135 140 136 141 /** 137 - * in_drive_list - look for drive in black/white list 142 + * ide_in_drive_list - look for drive in black/white list 138 143 * @id: drive identifier 139 144 * @drive_table: list to inspect 140 145 * ··· 142 147 * Returns 1 if the drive is found in the table. 143 148 */ 144 149 145 - static int in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) 150 + int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) 146 151 { 147 152 for ( ; drive_table->id_model ; drive_table++) 148 153 if ((!strcmp(drive_table->id_model, id->model)) && ··· 151 156 return 1; 152 157 return 0; 153 158 } 159 + 160 + EXPORT_SYMBOL_GPL(ide_in_drive_list); 154 161 155 162 /** 156 163 * ide_dma_intr - IDE DMA interrupt handler ··· 660 663 { 661 664 struct hd_driveid *id = drive->id; 662 665 663 - int blacklist = in_drive_list(id, drive_blacklist); 666 + int blacklist = ide_in_drive_list(id, drive_blacklist); 664 667 if (blacklist) { 665 668 printk(KERN_WARNING "%s: Disabling (U)DMA for %s (blacklisted)\n", 666 669 drive->name, id->model); ··· 674 677 int __ide_dma_good_drive (ide_drive_t *drive) 675 678 { 676 679 struct hd_driveid *id = drive->id; 677 - return in_drive_list(id, drive_whitelist); 680 + return ide_in_drive_list(id, drive_whitelist); 678 681 } 679 682 680 683 EXPORT_SYMBOL(__ide_dma_good_drive);
+3
drivers/ide/mips/Makefile
··· 1 1 obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o 2 + obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o 3 + 4 + EXTRA_CFLAGS := -Idrivers/ide
+501 -935
drivers/ide/mips/au1xxx-ide.c
··· 31 31 */ 32 32 #undef REALLY_SLOW_IO /* most systems can safely undef this */ 33 33 34 - #include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */ 35 34 #include <linux/types.h> 36 35 #include <linux/module.h> 37 36 #include <linux/kernel.h> 38 37 #include <linux/delay.h> 39 - #include <linux/timer.h> 40 - #include <linux/mm.h> 41 - #include <linux/ioport.h> 42 - #include <linux/hdreg.h> 38 + #include <linux/platform_device.h> 39 + 43 40 #include <linux/init.h> 44 41 #include <linux/ide.h> 45 42 #include <linux/sysdev.h> 46 43 47 44 #include <linux/dma-mapping.h> 48 45 46 + #include "ide-timing.h" 47 + 49 48 #include <asm/io.h> 50 49 #include <asm/mach-au1x00/au1xxx.h> 51 50 #include <asm/mach-au1x00/au1xxx_dbdma.h> 52 - 53 - #if CONFIG_PM 54 - #include <asm/mach-au1x00/au1xxx_pm.h> 55 - #endif 56 51 57 52 #include <asm/mach-au1x00/au1xxx_ide.h> 58 53 59 54 #define DRV_NAME "au1200-ide" 60 55 #define DRV_VERSION "1.0" 61 - #define DRV_AUTHOR "AMD PCS / Pete Popov <ppopov@embeddedalley.com>" 62 - #define DRV_DESC "Au1200 IDE" 56 + #define DRV_AUTHOR "Enrico Walther <enrico.walther@amd.com> / Pete Popov <ppopov@embeddedalley.com>" 57 + 58 + /* enable the burstmode in the dbdma */ 59 + #define IDE_AU1XXX_BURSTMODE 1 63 60 64 61 static _auide_hwif auide_hwif; 65 - static spinlock_t ide_tune_drive_spin_lock = SPIN_LOCK_UNLOCKED; 66 - static spinlock_t ide_tune_chipset_spin_lock = SPIN_LOCK_UNLOCKED; 67 - static int dbdma_init_done = 0; 62 + static int dbdma_init_done; 68 63 69 - /* 70 - * local I/O functions 71 - */ 72 - u8 auide_inb(unsigned long port) 73 - { 74 - return (au_readb(port)); 75 - } 76 - 77 - u16 auide_inw(unsigned long port) 78 - { 79 - return (au_readw(port)); 80 - } 81 - 82 - u32 auide_inl(unsigned long port) 83 - { 84 - return (au_readl(port)); 85 - } 64 + #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) 86 65 87 66 void auide_insw(unsigned long port, void *addr, u32 count) 88 67 { 89 - #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) 68 + _auide_hwif *ahwif = &auide_hwif; 69 + chan_tab_t *ctp; 70 + au1x_ddma_desc_t *dp; 90 71 91 - _auide_hwif *ahwif = &auide_hwif; 92 - chan_tab_t *ctp; 93 - au1x_ddma_desc_t *dp; 94 - 95 - if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, 96 - DDMA_FLAGS_NOIE)) { 97 - printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); 98 - return; 99 - } 100 - ctp = *((chan_tab_t **)ahwif->rx_chan); 101 - dp = ctp->cur_ptr; 102 - while (dp->dscr_cmd0 & DSCR_CMD0_V) 103 - ; 104 - ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); 105 - #else 106 - while (count--) 107 - { 108 - *(u16 *)addr = au_readw(port); 109 - addr +=2 ; 110 - } 111 - #endif 112 - } 113 - 114 - void auide_insl(unsigned long port, void *addr, u32 count) 115 - { 116 - while (count--) 117 - { 118 - *(u32 *)addr = au_readl(port); 119 - /* NOTE: For IDE interfaces over PCMCIA, 120 - * 32-bit access does not work 121 - */ 122 - addr += 4; 123 - } 124 - } 125 - 126 - void auide_outb(u8 addr, unsigned long port) 127 - { 128 - return (au_writeb(addr, port)); 129 - } 130 - 131 - void auide_outbsync(ide_drive_t *drive, u8 addr, unsigned long port) 132 - { 133 - return (au_writeb(addr, port)); 134 - } 135 - 136 - void auide_outw(u16 addr, unsigned long port) 137 - { 138 - return (au_writew(addr, port)); 139 - } 140 - 141 - void auide_outl(u32 addr, unsigned long port) 142 - { 143 - return (au_writel(addr, port)); 72 + if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, 73 + DDMA_FLAGS_NOIE)) { 74 + printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); 75 + return; 76 + } 77 + ctp = *((chan_tab_t **)ahwif->rx_chan); 78 + dp = ctp->cur_ptr; 79 + while (dp->dscr_cmd0 & DSCR_CMD0_V) 80 + ; 81 + ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); 144 82 } 145 83 146 84 void auide_outsw(unsigned long port, void *addr, u32 count) 147 85 { 148 - #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) 149 - _auide_hwif *ahwif = &auide_hwif; 150 - chan_tab_t *ctp; 151 - au1x_ddma_desc_t *dp; 86 + _auide_hwif *ahwif = &auide_hwif; 87 + chan_tab_t *ctp; 88 + au1x_ddma_desc_t *dp; 152 89 153 - if(!put_source_flags(ahwif->tx_chan, (void*)addr, 154 - count << 1, DDMA_FLAGS_NOIE)) { 155 - printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); 156 - return; 157 - } 158 - ctp = *((chan_tab_t **)ahwif->tx_chan); 159 - dp = ctp->cur_ptr; 160 - while (dp->dscr_cmd0 & DSCR_CMD0_V) 161 - ; 162 - ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); 163 - #else 164 - while (count--) 165 - { 166 - au_writew(*(u16 *)addr, port); 167 - addr += 2; 168 - } 90 + if(!put_source_flags(ahwif->tx_chan, (void*)addr, 91 + count << 1, DDMA_FLAGS_NOIE)) { 92 + printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__); 93 + return; 94 + } 95 + ctp = *((chan_tab_t **)ahwif->tx_chan); 96 + dp = ctp->cur_ptr; 97 + while (dp->dscr_cmd0 & DSCR_CMD0_V) 98 + ; 99 + ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp); 100 + } 101 + 169 102 #endif 170 - } 171 - 172 - void auide_outsl(unsigned long port, void *addr, u32 count) 173 - { 174 - while (count--) 175 - { 176 - au_writel(*(u32 *)addr, port); 177 - /* NOTE: For IDE interfaces over PCMCIA, 178 - * 32-bit access does not work 179 - */ 180 - addr += 4; 181 - } 182 - } 183 103 184 104 static void auide_tune_drive(ide_drive_t *drive, byte pio) 185 105 { 186 - int mem_sttime; 187 - int mem_stcfg; 188 - unsigned long flags; 189 - u8 speed; 106 + int mem_sttime; 107 + int mem_stcfg; 108 + u8 speed; 190 109 191 - /* get the best pio mode for the drive */ 192 - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 110 + /* get the best pio mode for the drive */ 111 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 193 112 194 - printk("%s: setting Au1XXX IDE to PIO mode%d\n", 195 - drive->name, pio); 113 + printk(KERN_INFO "%s: setting Au1XXX IDE to PIO mode%d\n", 114 + drive->name, pio); 196 115 197 - spin_lock_irqsave(&ide_tune_drive_spin_lock, flags); 116 + mem_sttime = 0; 117 + mem_stcfg = au_readl(MEM_STCFG2); 198 118 199 - mem_sttime = 0; 200 - mem_stcfg = au_readl(MEM_STCFG2); 119 + /* set pio mode! */ 120 + switch(pio) { 121 + case 0: 122 + mem_sttime = SBC_IDE_TIMING(PIO0); 201 123 202 - /* set pio mode! */ 203 - switch(pio) { 204 - case 0: 205 - /* set timing parameters for RCS2# */ 206 - mem_sttime = SBC_IDE_PIO0_TWCS 207 - | SBC_IDE_PIO0_TCSH 208 - | SBC_IDE_PIO0_TCSOFF 209 - | SBC_IDE_PIO0_TWP 210 - | SBC_IDE_PIO0_TCSW 211 - | SBC_IDE_PIO0_TPM 212 - | SBC_IDE_PIO0_TA; 213 - /* set configuration for RCS2# */ 214 - mem_stcfg |= TS_MASK; 215 - mem_stcfg &= ~TCSOE_MASK; 216 - mem_stcfg &= ~TOECS_MASK; 217 - mem_stcfg |= SBC_IDE_PIO0_TCSOE | SBC_IDE_PIO0_TOECS; 124 + /* set configuration for RCS2# */ 125 + mem_stcfg |= TS_MASK; 126 + mem_stcfg &= ~TCSOE_MASK; 127 + mem_stcfg &= ~TOECS_MASK; 128 + mem_stcfg |= SBC_IDE_PIO0_TCSOE | SBC_IDE_PIO0_TOECS; 129 + break; 218 130 219 - au_writel(mem_sttime,MEM_STTIME2); 220 - au_writel(mem_stcfg,MEM_STCFG2); 221 - break; 131 + case 1: 132 + mem_sttime = SBC_IDE_TIMING(PIO1); 222 133 223 - case 1: 224 - /* set timing parameters for RCS2# */ 225 - mem_sttime = SBC_IDE_PIO1_TWCS 226 - | SBC_IDE_PIO1_TCSH 227 - | SBC_IDE_PIO1_TCSOFF 228 - | SBC_IDE_PIO1_TWP 229 - | SBC_IDE_PIO1_TCSW 230 - | SBC_IDE_PIO1_TPM 231 - | SBC_IDE_PIO1_TA; 232 - /* set configuration for RCS2# */ 233 - mem_stcfg |= TS_MASK; 234 - mem_stcfg &= ~TCSOE_MASK; 235 - mem_stcfg &= ~TOECS_MASK; 236 - mem_stcfg |= SBC_IDE_PIO1_TCSOE | SBC_IDE_PIO1_TOECS; 237 - break; 134 + /* set configuration for RCS2# */ 135 + mem_stcfg |= TS_MASK; 136 + mem_stcfg &= ~TCSOE_MASK; 137 + mem_stcfg &= ~TOECS_MASK; 138 + mem_stcfg |= SBC_IDE_PIO1_TCSOE | SBC_IDE_PIO1_TOECS; 139 + break; 238 140 239 - case 2: 240 - /* set timing parameters for RCS2# */ 241 - mem_sttime = SBC_IDE_PIO2_TWCS 242 - | SBC_IDE_PIO2_TCSH 243 - | SBC_IDE_PIO2_TCSOFF 244 - | SBC_IDE_PIO2_TWP 245 - | SBC_IDE_PIO2_TCSW 246 - | SBC_IDE_PIO2_TPM 247 - | SBC_IDE_PIO2_TA; 248 - /* set configuration for RCS2# */ 249 - mem_stcfg &= ~TS_MASK; 250 - mem_stcfg &= ~TCSOE_MASK; 251 - mem_stcfg &= ~TOECS_MASK; 252 - mem_stcfg |= SBC_IDE_PIO2_TCSOE | SBC_IDE_PIO2_TOECS; 253 - break; 141 + case 2: 142 + mem_sttime = SBC_IDE_TIMING(PIO2); 254 143 255 - case 3: 256 - /* set timing parameters for RCS2# */ 257 - mem_sttime = SBC_IDE_PIO3_TWCS 258 - | SBC_IDE_PIO3_TCSH 259 - | SBC_IDE_PIO3_TCSOFF 260 - | SBC_IDE_PIO3_TWP 261 - | SBC_IDE_PIO3_TCSW 262 - | SBC_IDE_PIO3_TPM 263 - | SBC_IDE_PIO3_TA; 264 - /* set configuration for RCS2# */ 265 - mem_stcfg |= TS_MASK; 266 - mem_stcfg &= ~TS_MASK; 267 - mem_stcfg &= ~TCSOE_MASK; 268 - mem_stcfg &= ~TOECS_MASK; 269 - mem_stcfg |= SBC_IDE_PIO3_TCSOE | SBC_IDE_PIO3_TOECS; 144 + /* set configuration for RCS2# */ 145 + mem_stcfg &= ~TS_MASK; 146 + mem_stcfg &= ~TCSOE_MASK; 147 + mem_stcfg &= ~TOECS_MASK; 148 + mem_stcfg |= SBC_IDE_PIO2_TCSOE | SBC_IDE_PIO2_TOECS; 149 + break; 270 150 271 - break; 151 + case 3: 152 + mem_sttime = SBC_IDE_TIMING(PIO3); 272 153 273 - case 4: 274 - /* set timing parameters for RCS2# */ 275 - mem_sttime = SBC_IDE_PIO4_TWCS 276 - | SBC_IDE_PIO4_TCSH 277 - | SBC_IDE_PIO4_TCSOFF 278 - | SBC_IDE_PIO4_TWP 279 - | SBC_IDE_PIO4_TCSW 280 - | SBC_IDE_PIO4_TPM 281 - | SBC_IDE_PIO4_TA; 282 - /* set configuration for RCS2# */ 283 - mem_stcfg &= ~TS_MASK; 284 - mem_stcfg &= ~TCSOE_MASK; 285 - mem_stcfg &= ~TOECS_MASK; 286 - mem_stcfg |= SBC_IDE_PIO4_TCSOE | SBC_IDE_PIO4_TOECS; 287 - break; 288 - } 154 + /* set configuration for RCS2# */ 155 + mem_stcfg &= ~TS_MASK; 156 + mem_stcfg &= ~TCSOE_MASK; 157 + mem_stcfg &= ~TOECS_MASK; 158 + mem_stcfg |= SBC_IDE_PIO3_TCSOE | SBC_IDE_PIO3_TOECS; 289 159 290 - au_writel(mem_sttime,MEM_STTIME2); 291 - au_writel(mem_stcfg,MEM_STCFG2); 160 + break; 292 161 293 - spin_unlock_irqrestore(&ide_tune_drive_spin_lock, flags); 162 + case 4: 163 + mem_sttime = SBC_IDE_TIMING(PIO4); 294 164 295 - speed = pio + XFER_PIO_0; 296 - ide_config_drive_speed(drive, speed); 165 + /* set configuration for RCS2# */ 166 + mem_stcfg &= ~TS_MASK; 167 + mem_stcfg &= ~TCSOE_MASK; 168 + mem_stcfg &= ~TOECS_MASK; 169 + mem_stcfg |= SBC_IDE_PIO4_TCSOE | SBC_IDE_PIO4_TOECS; 170 + break; 171 + } 172 + 173 + au_writel(mem_sttime,MEM_STTIME2); 174 + au_writel(mem_stcfg,MEM_STCFG2); 175 + 176 + speed = pio + XFER_PIO_0; 177 + ide_config_drive_speed(drive, speed); 297 178 } 298 179 299 180 static int auide_tune_chipset (ide_drive_t *drive, u8 speed) 300 181 { 301 - u8 mode = 0; 302 - int mem_sttime; 303 - int mem_stcfg; 304 - unsigned long flags; 305 - #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 306 - struct hd_driveid *id = drive->id; 182 + int mem_sttime; 183 + int mem_stcfg; 184 + unsigned long mode; 307 185 308 - /* 309 - * Now see what the current drive is capable of, 310 - * selecting UDMA only if the mate said it was ok. 311 - */ 312 - if (id && (id->capability & 1) && drive->autodma && 313 - !__ide_dma_bad_drive(drive)) { 314 - if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) { 315 - if (id->dma_mword & 4) 316 - mode = XFER_MW_DMA_2; 317 - else if (id->dma_mword & 2) 318 - mode = XFER_MW_DMA_1; 319 - else if (id->dma_mword & 1) 320 - mode = XFER_MW_DMA_0; 321 - } 322 - } 186 + #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 187 + if (ide_use_dma(drive)) 188 + mode = ide_dma_speed(drive, 0); 323 189 #endif 324 190 325 - spin_lock_irqsave(&ide_tune_chipset_spin_lock, flags); 191 + mem_sttime = 0; 192 + mem_stcfg = au_readl(MEM_STCFG2); 326 193 327 - mem_sttime = 0; 328 - mem_stcfg = au_readl(MEM_STCFG2); 329 - 330 - switch(speed) { 331 - case XFER_PIO_4: 332 - case XFER_PIO_3: 333 - case XFER_PIO_2: 334 - case XFER_PIO_1: 335 - case XFER_PIO_0: 336 - auide_tune_drive(drive, (speed - XFER_PIO_0)); 337 - break; 194 + if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { 195 + auide_tune_drive(drive, speed - XFER_PIO_0); 196 + return 0; 197 + } 198 + 199 + switch(speed) { 338 200 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 339 - case XFER_MW_DMA_2: 340 - /* set timing parameters for RCS2# */ 341 - mem_sttime = SBC_IDE_MDMA2_TWCS 342 - | SBC_IDE_MDMA2_TCSH 343 - | SBC_IDE_MDMA2_TCSOFF 344 - | SBC_IDE_MDMA2_TWP 345 - | SBC_IDE_MDMA2_TCSW 346 - | SBC_IDE_MDMA2_TPM 347 - | SBC_IDE_MDMA2_TA; 348 - /* set configuration for RCS2# */ 349 - mem_stcfg &= ~TS_MASK; 350 - mem_stcfg &= ~TCSOE_MASK; 351 - mem_stcfg &= ~TOECS_MASK; 352 - mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS; 201 + case XFER_MW_DMA_2: 202 + mem_sttime = SBC_IDE_TIMING(MDMA2); 353 203 354 - mode = XFER_MW_DMA_2; 355 - break; 356 - case XFER_MW_DMA_1: 357 - /* set timing parameters for RCS2# */ 358 - mem_sttime = SBC_IDE_MDMA1_TWCS 359 - | SBC_IDE_MDMA1_TCSH 360 - | SBC_IDE_MDMA1_TCSOFF 361 - | SBC_IDE_MDMA1_TWP 362 - | SBC_IDE_MDMA1_TCSW 363 - | SBC_IDE_MDMA1_TPM 364 - | SBC_IDE_MDMA1_TA; 365 - /* set configuration for RCS2# */ 366 - mem_stcfg &= ~TS_MASK; 367 - mem_stcfg &= ~TCSOE_MASK; 368 - mem_stcfg &= ~TOECS_MASK; 369 - mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS; 204 + /* set configuration for RCS2# */ 205 + mem_stcfg &= ~TS_MASK; 206 + mem_stcfg &= ~TCSOE_MASK; 207 + mem_stcfg &= ~TOECS_MASK; 208 + mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS; 370 209 371 - mode = XFER_MW_DMA_1; 372 - break; 373 - case XFER_MW_DMA_0: 374 - /* set timing parameters for RCS2# */ 375 - mem_sttime = SBC_IDE_MDMA0_TWCS 376 - | SBC_IDE_MDMA0_TCSH 377 - | SBC_IDE_MDMA0_TCSOFF 378 - | SBC_IDE_MDMA0_TWP 379 - | SBC_IDE_MDMA0_TCSW 380 - | SBC_IDE_MDMA0_TPM 381 - | SBC_IDE_MDMA0_TA; 382 - /* set configuration for RCS2# */ 383 - mem_stcfg |= TS_MASK; 384 - mem_stcfg &= ~TCSOE_MASK; 385 - mem_stcfg &= ~TOECS_MASK; 386 - mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS; 210 + mode = XFER_MW_DMA_2; 211 + break; 212 + case XFER_MW_DMA_1: 213 + mem_sttime = SBC_IDE_TIMING(MDMA1); 387 214 388 - mode = XFER_MW_DMA_0; 389 - break; 215 + /* set configuration for RCS2# */ 216 + mem_stcfg &= ~TS_MASK; 217 + mem_stcfg &= ~TCSOE_MASK; 218 + mem_stcfg &= ~TOECS_MASK; 219 + mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS; 220 + 221 + mode = XFER_MW_DMA_1; 222 + break; 223 + case XFER_MW_DMA_0: 224 + mem_sttime = SBC_IDE_TIMING(MDMA0); 225 + 226 + /* set configuration for RCS2# */ 227 + mem_stcfg |= TS_MASK; 228 + mem_stcfg &= ~TCSOE_MASK; 229 + mem_stcfg &= ~TOECS_MASK; 230 + mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS; 231 + 232 + mode = XFER_MW_DMA_0; 233 + break; 390 234 #endif 391 - default: 392 - return 1; 393 - } 235 + default: 236 + return 1; 237 + } 238 + 239 + if (ide_config_drive_speed(drive, mode)) 240 + return 1; 394 241 395 - /* 396 - * Tell the drive to switch to the new mode; abort on failure. 397 - */ 398 - if (!mode || ide_config_drive_speed(drive, mode)) 399 - { 400 - return 1; /* failure */ 401 - } 242 + au_writel(mem_sttime,MEM_STTIME2); 243 + au_writel(mem_stcfg,MEM_STCFG2); 402 244 403 - 404 - au_writel(mem_sttime,MEM_STTIME2); 405 - au_writel(mem_stcfg,MEM_STCFG2); 406 - 407 - spin_unlock_irqrestore(&ide_tune_chipset_spin_lock, flags); 408 - 409 - return 0; 245 + return 0; 410 246 } 411 247 412 248 /* 413 249 * Multi-Word DMA + DbDMA functions 414 250 */ 415 - #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 416 251 417 - static int in_drive_list(struct hd_driveid *id, 418 - const struct drive_list_entry *drive_table) 419 - { 420 - for ( ; drive_table->id_model ; drive_table++){ 421 - if ((!strcmp(drive_table->id_model, id->model)) && 422 - ((strstr(drive_table->id_firmware, id->fw_rev)) || 423 - (!strcmp(drive_table->id_firmware, "ALL"))) 424 - ) 425 - return 1; 426 - } 427 - return 0; 428 - } 252 + #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 429 253 430 254 static int auide_build_sglist(ide_drive_t *drive, struct request *rq) 431 255 { 432 - ide_hwif_t *hwif = drive->hwif; 433 - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 434 - struct scatterlist *sg = hwif->sg_table; 256 + ide_hwif_t *hwif = drive->hwif; 257 + _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 258 + struct scatterlist *sg = hwif->sg_table; 435 259 436 - ide_map_sg(drive, rq); 260 + ide_map_sg(drive, rq); 437 261 438 - if (rq_data_dir(rq) == READ) 439 - hwif->sg_dma_direction = DMA_FROM_DEVICE; 440 - else 441 - hwif->sg_dma_direction = DMA_TO_DEVICE; 262 + if (rq_data_dir(rq) == READ) 263 + hwif->sg_dma_direction = DMA_FROM_DEVICE; 264 + else 265 + hwif->sg_dma_direction = DMA_TO_DEVICE; 442 266 443 - return dma_map_sg(ahwif->dev, sg, hwif->sg_nents, 444 - hwif->sg_dma_direction); 267 + return dma_map_sg(ahwif->dev, sg, hwif->sg_nents, 268 + hwif->sg_dma_direction); 445 269 } 446 270 447 271 static int auide_build_dmatable(ide_drive_t *drive) 448 272 { 449 - int i, iswrite, count = 0; 450 - ide_hwif_t *hwif = HWIF(drive); 273 + int i, iswrite, count = 0; 274 + ide_hwif_t *hwif = HWIF(drive); 451 275 452 - struct request *rq = HWGROUP(drive)->rq; 276 + struct request *rq = HWGROUP(drive)->rq; 453 277 454 - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 455 - struct scatterlist *sg; 278 + _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 279 + struct scatterlist *sg; 456 280 457 - iswrite = (rq_data_dir(rq) == WRITE); 458 - /* Save for interrupt context */ 459 - ahwif->drive = drive; 281 + iswrite = (rq_data_dir(rq) == WRITE); 282 + /* Save for interrupt context */ 283 + ahwif->drive = drive; 460 284 461 - /* Build sglist */ 462 - hwif->sg_nents = i = auide_build_sglist(drive, rq); 285 + /* Build sglist */ 286 + hwif->sg_nents = i = auide_build_sglist(drive, rq); 463 287 464 - if (!i) 465 - return 0; 288 + if (!i) 289 + return 0; 466 290 467 - /* fill the descriptors */ 468 - sg = hwif->sg_table; 469 - while (i && sg_dma_len(sg)) { 470 - u32 cur_addr; 471 - u32 cur_len; 291 + /* fill the descriptors */ 292 + sg = hwif->sg_table; 293 + while (i && sg_dma_len(sg)) { 294 + u32 cur_addr; 295 + u32 cur_len; 472 296 473 - cur_addr = sg_dma_address(sg); 474 - cur_len = sg_dma_len(sg); 297 + cur_addr = sg_dma_address(sg); 298 + cur_len = sg_dma_len(sg); 475 299 476 - while (cur_len) { 477 - u32 flags = DDMA_FLAGS_NOIE; 478 - unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; 300 + while (cur_len) { 301 + u32 flags = DDMA_FLAGS_NOIE; 302 + unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; 479 303 480 - if (++count >= PRD_ENTRIES) { 481 - printk(KERN_WARNING "%s: DMA table too small\n", 482 - drive->name); 483 - goto use_pio_instead; 484 - } 304 + if (++count >= PRD_ENTRIES) { 305 + printk(KERN_WARNING "%s: DMA table too small\n", 306 + drive->name); 307 + goto use_pio_instead; 308 + } 485 309 486 - /* Lets enable intr for the last descriptor only */ 487 - if (1==i) 488 - flags = DDMA_FLAGS_IE; 489 - else 490 - flags = DDMA_FLAGS_NOIE; 310 + /* Lets enable intr for the last descriptor only */ 311 + if (1==i) 312 + flags = DDMA_FLAGS_IE; 313 + else 314 + flags = DDMA_FLAGS_NOIE; 491 315 492 - if (iswrite) { 493 - if(!put_source_flags(ahwif->tx_chan, 494 - (void*)(page_address(sg->page) 495 - + sg->offset), 496 - tc, flags)) { 497 - printk(KERN_ERR "%s failed %d\n", 498 - __FUNCTION__, __LINE__); 316 + if (iswrite) { 317 + if(!put_source_flags(ahwif->tx_chan, 318 + (void*)(page_address(sg->page) 319 + + sg->offset), 320 + tc, flags)) { 321 + printk(KERN_ERR "%s failed %d\n", 322 + __FUNCTION__, __LINE__); 499 323 } 500 - } else 324 + } else 501 325 { 502 - if(!put_dest_flags(ahwif->rx_chan, 503 - (void*)(page_address(sg->page) 504 - + sg->offset), 505 - tc, flags)) { 506 - printk(KERN_ERR "%s failed %d\n", 507 - __FUNCTION__, __LINE__); 326 + if(!put_dest_flags(ahwif->rx_chan, 327 + (void*)(page_address(sg->page) 328 + + sg->offset), 329 + tc, flags)) { 330 + printk(KERN_ERR "%s failed %d\n", 331 + __FUNCTION__, __LINE__); 508 332 } 509 - } 333 + } 510 334 511 - cur_addr += tc; 512 - cur_len -= tc; 513 - } 514 - sg++; 515 - i--; 516 - } 335 + cur_addr += tc; 336 + cur_len -= tc; 337 + } 338 + sg++; 339 + i--; 340 + } 517 341 518 - if (count) 519 - return 1; 342 + if (count) 343 + return 1; 520 344 521 - use_pio_instead: 522 - dma_unmap_sg(ahwif->dev, 523 - hwif->sg_table, 524 - hwif->sg_nents, 525 - hwif->sg_dma_direction); 345 + use_pio_instead: 346 + dma_unmap_sg(ahwif->dev, 347 + hwif->sg_table, 348 + hwif->sg_nents, 349 + hwif->sg_dma_direction); 526 350 527 - return 0; /* revert to PIO for this request */ 351 + return 0; /* revert to PIO for this request */ 528 352 } 529 353 530 354 static int auide_dma_end(ide_drive_t *drive) 531 355 { 532 - ide_hwif_t *hwif = HWIF(drive); 533 - _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 356 + ide_hwif_t *hwif = HWIF(drive); 357 + _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data; 534 358 535 - if (hwif->sg_nents) { 536 - dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents, 537 - hwif->sg_dma_direction); 538 - hwif->sg_nents = 0; 539 - } 359 + if (hwif->sg_nents) { 360 + dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents, 361 + hwif->sg_dma_direction); 362 + hwif->sg_nents = 0; 363 + } 540 364 541 - return 0; 365 + return 0; 542 366 } 543 367 544 368 static void auide_dma_start(ide_drive_t *drive ) 545 369 { 546 - // printk("%s\n", __FUNCTION__); 547 370 } 548 371 549 - ide_startstop_t auide_dma_intr(ide_drive_t *drive) 550 - { 551 - //printk("%s\n", __FUNCTION__); 552 - 553 - u8 stat = 0, dma_stat = 0; 554 - 555 - dma_stat = HWIF(drive)->ide_dma_end(drive); 556 - stat = HWIF(drive)->INB(IDE_STATUS_REG); /* get drive status */ 557 - if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { 558 - if (!dma_stat) { 559 - struct request *rq = HWGROUP(drive)->rq; 560 - 561 - ide_end_request(drive, 1, rq->nr_sectors); 562 - return ide_stopped; 563 - } 564 - printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", 565 - drive->name, dma_stat); 566 - } 567 - return ide_error(drive, "dma_intr", stat); 568 - } 569 372 570 373 static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command) 571 374 { 572 - //printk("%s\n", __FUNCTION__); 573 - 574 - /* issue cmd to drive */ 575 - ide_execute_command(drive, command, &auide_dma_intr, 576 - (2*WAIT_CMD), NULL); 375 + /* issue cmd to drive */ 376 + ide_execute_command(drive, command, &ide_dma_intr, 377 + (2*WAIT_CMD), NULL); 577 378 } 578 379 579 380 static int auide_dma_setup(ide_drive_t *drive) 580 - { 581 - // printk("%s\n", __FUNCTION__); 381 + { 382 + struct request *rq = HWGROUP(drive)->rq; 582 383 583 - if (drive->media != ide_disk) 584 - return 1; 384 + if (!auide_build_dmatable(drive)) { 385 + ide_map_sg(drive, rq); 386 + return 1; 387 + } 585 388 586 - if (!auide_build_dmatable(drive)) 587 - /* try PIO instead of DMA */ 588 - return 1; 589 - 590 - drive->waiting_for_dma = 1; 591 - 592 - return 0; 389 + drive->waiting_for_dma = 1; 390 + return 0; 593 391 } 594 392 595 393 static int auide_dma_check(ide_drive_t *drive) 596 394 { 597 - // printk("%s\n", __FUNCTION__); 395 + u8 speed; 598 396 599 397 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 600 - if( !dbdma_init_done ){ 601 - auide_hwif.white_list = in_drive_list(drive->id, 602 - dma_white_list); 603 - auide_hwif.black_list = in_drive_list(drive->id, 604 - dma_black_list); 605 - auide_hwif.drive = drive; 606 - auide_ddma_init(&auide_hwif); 607 - dbdma_init_done = 1; 608 - } 398 + 399 + if( dbdma_init_done == 0 ){ 400 + auide_hwif.white_list = ide_in_drive_list(drive->id, 401 + dma_white_list); 402 + auide_hwif.black_list = ide_in_drive_list(drive->id, 403 + dma_black_list); 404 + auide_hwif.drive = drive; 405 + auide_ddma_init(&auide_hwif); 406 + dbdma_init_done = 1; 407 + } 609 408 #endif 610 409 611 - /* Is the drive in our DMA black list? */ 612 - if ( auide_hwif.black_list ) { 613 - drive->using_dma = 0; 614 - printk("%s found in dma_blacklist[]! Disabling DMA.\n", 615 - drive->id->model); 616 - } 617 - else 618 - drive->using_dma = 1; 410 + /* Is the drive in our DMA black list? */ 619 411 620 - return HWIF(drive)->ide_dma_host_on(drive); 412 + if ( auide_hwif.black_list ) { 413 + drive->using_dma = 0; 414 + 415 + /* Borrowed the warning message from ide-dma.c */ 416 + 417 + printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n", 418 + drive->name, drive->id->model); 419 + } 420 + else 421 + drive->using_dma = 1; 422 + 423 + speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA); 424 + 425 + if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) 426 + return HWIF(drive)->ide_dma_on(drive); 427 + 428 + return HWIF(drive)->ide_dma_off_quietly(drive); 621 429 } 622 430 623 431 static int auide_dma_test_irq(ide_drive_t *drive) 624 - { 625 - // printk("%s\n", __FUNCTION__); 626 - 627 - if (!drive->waiting_for_dma) 628 - printk(KERN_WARNING "%s: ide_dma_test_irq \ 432 + { 433 + if (drive->waiting_for_dma == 0) 434 + printk(KERN_WARNING "%s: ide_dma_test_irq \ 629 435 called while not waiting\n", drive->name); 630 436 631 - /* If dbdma didn't execute the STOP command yet, the 632 - * active bit is still set 437 + /* If dbdma didn't execute the STOP command yet, the 438 + * active bit is still set 633 439 */ 634 - drive->waiting_for_dma++; 635 - if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { 636 - printk(KERN_WARNING "%s: timeout waiting for ddma to \ 440 + drive->waiting_for_dma++; 441 + if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { 442 + printk(KERN_WARNING "%s: timeout waiting for ddma to \ 637 443 complete\n", drive->name); 638 - return 1; 639 - } 640 - udelay(10); 641 - return 0; 444 + return 1; 445 + } 446 + udelay(10); 447 + return 0; 642 448 } 643 449 644 450 static int auide_dma_host_on(ide_drive_t *drive) 645 451 { 646 - // printk("%s\n", __FUNCTION__); 647 - return 0; 452 + return 0; 648 453 } 649 454 650 455 static int auide_dma_on(ide_drive_t *drive) 651 456 { 652 - // printk("%s\n", __FUNCTION__); 653 - drive->using_dma = 1; 654 - return auide_dma_host_on(drive); 457 + drive->using_dma = 1; 458 + return auide_dma_host_on(drive); 655 459 } 656 460 657 461 658 462 static int auide_dma_host_off(ide_drive_t *drive) 659 463 { 660 - // printk("%s\n", __FUNCTION__); 661 - return 0; 464 + return 0; 662 465 } 663 466 664 467 static int auide_dma_off_quietly(ide_drive_t *drive) 665 468 { 666 - // printk("%s\n", __FUNCTION__); 667 - drive->using_dma = 0; 668 - return auide_dma_host_off(drive); 469 + drive->using_dma = 0; 470 + return auide_dma_host_off(drive); 669 471 } 670 472 671 473 static int auide_dma_lostirq(ide_drive_t *drive) 672 474 { 673 - // printk("%s\n", __FUNCTION__); 674 - 675 - printk(KERN_ERR "%s: IRQ lost\n", drive->name); 676 - return 0; 475 + printk(KERN_ERR "%s: IRQ lost\n", drive->name); 476 + return 0; 677 477 } 678 478 679 479 static void auide_ddma_tx_callback(int irq, void *param, struct pt_regs *regs) 680 480 { 681 - // printk("%s\n", __FUNCTION__); 682 - 683 - _auide_hwif *ahwif = (_auide_hwif*)param; 684 - ahwif->drive->waiting_for_dma = 0; 685 - return; 481 + _auide_hwif *ahwif = (_auide_hwif*)param; 482 + ahwif->drive->waiting_for_dma = 0; 686 483 } 687 484 688 485 static void auide_ddma_rx_callback(int irq, void *param, struct pt_regs *regs) 689 486 { 690 - // printk("%s\n", __FUNCTION__); 691 - 692 - _auide_hwif *ahwif = (_auide_hwif*)param; 693 - ahwif->drive->waiting_for_dma = 0; 694 - return; 487 + _auide_hwif *ahwif = (_auide_hwif*)param; 488 + ahwif->drive->waiting_for_dma = 0; 695 489 } 490 + 491 + #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 492 + 493 + static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags) 494 + { 495 + dev->dev_id = dev_id; 496 + dev->dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; 497 + dev->dev_intlevel = 0; 498 + dev->dev_intpolarity = 0; 499 + dev->dev_tsize = tsize; 500 + dev->dev_devwidth = devwidth; 501 + dev->dev_flags = flags; 502 + } 503 + 504 + #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 696 505 697 506 static int auide_dma_timeout(ide_drive_t *drive) 698 507 { 699 508 // printk("%s\n", __FUNCTION__); 700 509 701 - printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); 510 + printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); 702 511 703 - if (HWIF(drive)->ide_dma_test_irq(drive)) 704 - return 0; 512 + if (HWIF(drive)->ide_dma_test_irq(drive)) 513 + return 0; 705 514 706 - return HWIF(drive)->ide_dma_end(drive); 515 + return HWIF(drive)->ide_dma_end(drive); 707 516 } 708 - #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 517 + 709 518 519 + static int auide_ddma_init(_auide_hwif *auide) { 520 + 521 + dbdev_tab_t source_dev_tab, target_dev_tab; 522 + u32 dev_id, tsize, devwidth, flags; 523 + ide_hwif_t *hwif = auide->hwif; 710 524 525 + dev_id = AU1XXX_ATA_DDMA_REQ; 526 + 527 + if (auide->white_list || auide->black_list) { 528 + tsize = 8; 529 + devwidth = 32; 530 + } 531 + else { 532 + tsize = 1; 533 + devwidth = 16; 534 + 535 + printk(KERN_ERR "au1xxx-ide: %s is not on ide driver whitelist.\n",auide_hwif.drive->id->model); 536 + printk(KERN_ERR " please read 'Documentation/mips/AU1xxx_IDE.README'"); 537 + } 538 + 539 + #ifdef IDE_AU1XXX_BURSTMODE 540 + flags = DEV_FLAGS_SYNC | DEV_FLAGS_BURSTABLE; 541 + #else 542 + flags = DEV_FLAGS_SYNC; 543 + #endif 544 + 545 + /* setup dev_tab for tx channel */ 546 + auide_init_dbdma_dev( &source_dev_tab, 547 + dev_id, 548 + tsize, devwidth, DEV_FLAGS_OUT | flags); 549 + auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 550 + 551 + auide_init_dbdma_dev( &source_dev_tab, 552 + dev_id, 553 + tsize, devwidth, DEV_FLAGS_IN | flags); 554 + auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 555 + 556 + /* We also need to add a target device for the DMA */ 557 + auide_init_dbdma_dev( &target_dev_tab, 558 + (u32)DSCR_CMD0_ALWAYS, 559 + tsize, devwidth, DEV_FLAGS_ANYUSE); 560 + auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); 561 + 562 + /* Get a channel for TX */ 563 + auide->tx_chan = au1xxx_dbdma_chan_alloc(auide->target_dev_id, 564 + auide->tx_dev_id, 565 + auide_ddma_tx_callback, 566 + (void*)auide); 567 + 568 + /* Get a channel for RX */ 569 + auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, 570 + auide->target_dev_id, 571 + auide_ddma_rx_callback, 572 + (void*)auide); 573 + 574 + auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan, 575 + NUM_DESCRIPTORS); 576 + auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, 577 + NUM_DESCRIPTORS); 578 + 579 + hwif->dmatable_cpu = dma_alloc_coherent(auide->dev, 580 + PRD_ENTRIES * PRD_BYTES, /* 1 Page */ 581 + &hwif->dmatable_dma, GFP_KERNEL); 582 + 583 + au1xxx_dbdma_start( auide->tx_chan ); 584 + au1xxx_dbdma_start( auide->rx_chan ); 585 + 586 + return 0; 587 + } 588 + #else 589 + 711 590 static int auide_ddma_init( _auide_hwif *auide ) 712 591 { 713 - // printk("%s\n", __FUNCTION__); 592 + dbdev_tab_t source_dev_tab; 593 + int flags; 714 594 715 - dbdev_tab_t source_dev_tab; 716 - #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 717 - dbdev_tab_t target_dev_tab; 718 - ide_hwif_t *hwif = auide->hwif; 719 - char warning_output [2][80]; 720 - int i; 721 - #endif 722 - 723 - /* Add our custom device to DDMA device table */ 724 - /* Create our new device entries in the table */ 725 - #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 726 - source_dev_tab.dev_id = AU1XXX_ATA_DDMA_REQ; 727 - 728 - if( auide->white_list || auide->black_list ){ 729 - source_dev_tab.dev_tsize = 8; 730 - source_dev_tab.dev_devwidth = 32; 731 - source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; 732 - source_dev_tab.dev_intlevel = 0; 733 - source_dev_tab.dev_intpolarity = 0; 734 - 735 - /* init device table for target - static bus controller - */ 736 - target_dev_tab.dev_id = DSCR_CMD0_ALWAYS; 737 - target_dev_tab.dev_tsize = 8; 738 - target_dev_tab.dev_devwidth = 32; 739 - target_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; 740 - target_dev_tab.dev_intlevel = 0; 741 - target_dev_tab.dev_intpolarity = 0; 742 - target_dev_tab.dev_flags = DEV_FLAGS_ANYUSE; 743 - } 744 - else{ 745 - source_dev_tab.dev_tsize = 1; 746 - source_dev_tab.dev_devwidth = 16; 747 - source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; 748 - source_dev_tab.dev_intlevel = 0; 749 - source_dev_tab.dev_intpolarity = 0; 750 - 751 - /* init device table for target - static bus controller - */ 752 - target_dev_tab.dev_id = DSCR_CMD0_ALWAYS; 753 - target_dev_tab.dev_tsize = 1; 754 - target_dev_tab.dev_devwidth = 16; 755 - target_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; 756 - target_dev_tab.dev_intlevel = 0; 757 - target_dev_tab.dev_intpolarity = 0; 758 - target_dev_tab.dev_flags = DEV_FLAGS_ANYUSE; 759 - 760 - sprintf(&warning_output[0][0], 761 - "%s is not on ide driver white list.", 762 - auide_hwif.drive->id->model); 763 - for ( i=strlen(&warning_output[0][0]) ; i<76; i++ ){ 764 - sprintf(&warning_output[0][i]," "); 765 - } 766 - 767 - sprintf(&warning_output[1][0], 768 - "To add %s please read 'Documentation/mips/AU1xxx_IDE.README'.", 769 - auide_hwif.drive->id->model); 770 - for ( i=strlen(&warning_output[1][0]) ; i<76; i++ ){ 771 - sprintf(&warning_output[1][i]," "); 772 - } 773 - 774 - printk("\n****************************************"); 775 - printk("****************************************\n"); 776 - printk("* %s *\n",&warning_output[0][0]); 777 - printk("* Switch to safe MWDMA Mode! "); 778 - printk(" *\n"); 779 - printk("* %s *\n",&warning_output[1][0]); 780 - printk("****************************************"); 781 - printk("****************************************\n\n"); 782 - } 595 + #ifdef IDE_AU1XXX_BURSTMODE 596 + flags = DEV_FLAGS_SYNC | DEV_FLAGS_BURSTABLE; 783 597 #else 784 - source_dev_tab.dev_id = DSCR_CMD0_ALWAYS; 785 - source_dev_tab.dev_tsize = 8; 786 - source_dev_tab.dev_devwidth = 32; 787 - source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR; 788 - source_dev_tab.dev_intlevel = 0; 789 - source_dev_tab.dev_intpolarity = 0; 598 + flags = DEV_FLAGS_SYNC; 790 599 #endif 791 600 792 - #if CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON 793 - /* set flags for tx channel */ 794 - source_dev_tab.dev_flags = DEV_FLAGS_OUT 795 - | DEV_FLAGS_SYNC 796 - | DEV_FLAGS_BURSTABLE; 797 - auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 798 - /* set flags for rx channel */ 799 - source_dev_tab.dev_flags = DEV_FLAGS_IN 800 - | DEV_FLAGS_SYNC 801 - | DEV_FLAGS_BURSTABLE; 802 - auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 803 - #else 804 - /* set flags for tx channel */ 805 - source_dev_tab.dev_flags = DEV_FLAGS_OUT | DEV_FLAGS_SYNC; 806 - auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 807 - /* set flags for rx channel */ 808 - source_dev_tab.dev_flags = DEV_FLAGS_IN | DEV_FLAGS_SYNC; 809 - auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 810 - #endif 601 + /* setup dev_tab for tx channel */ 602 + auide_init_dbdma_dev( &source_dev_tab, 603 + (u32)DSCR_CMD0_ALWAYS, 604 + 8, 32, DEV_FLAGS_OUT | flags); 605 + auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 811 606 812 - #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 813 - 814 - auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); 815 - 816 - /* Get a channel for TX */ 817 - auide->tx_chan = au1xxx_dbdma_chan_alloc(auide->target_dev_id, 818 - auide->tx_dev_id, 819 - auide_ddma_tx_callback, 820 - (void*)auide); 821 - /* Get a channel for RX */ 822 - auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, 823 - auide->target_dev_id, 824 - auide_ddma_rx_callback, 825 - (void*)auide); 826 - #else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */ 827 - /* 828 - * Note: if call back is not enabled, update ctp->cur_ptr manually 829 - */ 830 - auide->tx_chan = au1xxx_dbdma_chan_alloc(DSCR_CMD0_ALWAYS, 831 - auide->tx_dev_id, 832 - NULL, 833 - (void*)auide); 834 - auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, 835 - DSCR_CMD0_ALWAYS, 836 - NULL, 837 - (void*)auide); 838 - #endif 839 - auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan, 840 - NUM_DESCRIPTORS); 841 - auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, 842 - NUM_DESCRIPTORS); 843 - 844 - #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 845 - hwif->dmatable_cpu = dma_alloc_coherent(auide->dev, 846 - PRD_ENTRIES * PRD_BYTES, /* 1 Page */ 847 - &hwif->dmatable_dma, GFP_KERNEL); 848 - 849 - auide->sg_table = kmalloc(sizeof(struct scatterlist) * PRD_ENTRIES, 850 - GFP_KERNEL|GFP_DMA); 851 - if (auide->sg_table == NULL) { 852 - return -ENOMEM; 853 - } 854 - #endif 855 - au1xxx_dbdma_start( auide->tx_chan ); 856 - au1xxx_dbdma_start( auide->rx_chan ); 857 - return 0; 607 + auide_init_dbdma_dev( &source_dev_tab, 608 + (u32)DSCR_CMD0_ALWAYS, 609 + 8, 32, DEV_FLAGS_IN | flags); 610 + auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab ); 611 + 612 + /* Get a channel for TX */ 613 + auide->tx_chan = au1xxx_dbdma_chan_alloc(DSCR_CMD0_ALWAYS, 614 + auide->tx_dev_id, 615 + NULL, 616 + (void*)auide); 617 + 618 + /* Get a channel for RX */ 619 + auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id, 620 + DSCR_CMD0_ALWAYS, 621 + NULL, 622 + (void*)auide); 623 + 624 + auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan, 625 + NUM_DESCRIPTORS); 626 + auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan, 627 + NUM_DESCRIPTORS); 628 + 629 + au1xxx_dbdma_start( auide->tx_chan ); 630 + au1xxx_dbdma_start( auide->rx_chan ); 631 + 632 + return 0; 858 633 } 634 + #endif 859 635 860 636 static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif) 861 637 { 862 - int i; 863 - #define ide_ioreg_t unsigned long 864 - ide_ioreg_t *ata_regs = hw->io_ports; 638 + int i; 639 + unsigned long *ata_regs = hw->io_ports; 865 640 866 - /* fixme */ 867 - for (i = 0; i < IDE_CONTROL_OFFSET; i++) { 868 - *ata_regs++ = (ide_ioreg_t) ahwif->regbase 869 - + (ide_ioreg_t)(i << AU1XXX_ATA_REG_OFFSET); 870 - } 641 + /* FIXME? */ 642 + for (i = 0; i < IDE_CONTROL_OFFSET; i++) { 643 + *ata_regs++ = ahwif->regbase + (i << AU1XXX_ATA_REG_OFFSET); 644 + } 871 645 872 - /* set the Alternative Status register */ 873 - *ata_regs = (ide_ioreg_t) ahwif->regbase 874 - + (ide_ioreg_t)(14 << AU1XXX_ATA_REG_OFFSET); 646 + /* set the Alternative Status register */ 647 + *ata_regs = ahwif->regbase + (14 << AU1XXX_ATA_REG_OFFSET); 875 648 } 876 649 877 650 static int au_ide_probe(struct device *dev) 878 651 { 879 652 struct platform_device *pdev = to_platform_device(dev); 880 - _auide_hwif *ahwif = &auide_hwif; 881 - ide_hwif_t *hwif; 653 + _auide_hwif *ahwif = &auide_hwif; 654 + ide_hwif_t *hwif; 882 655 struct resource *res; 883 656 int ret = 0; 884 657 885 658 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 886 - char *mode = "MWDMA2"; 659 + char *mode = "MWDMA2"; 887 660 #elif defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA) 888 - char *mode = "PIO+DDMA(offload)"; 661 + char *mode = "PIO+DDMA(offload)"; 889 662 #endif 890 663 891 - memset(&auide_hwif, 0, sizeof(_auide_hwif)); 892 - auide_hwif.dev = 0; 664 + memset(&auide_hwif, 0, sizeof(_auide_hwif)); 665 + auide_hwif.dev = 0; 893 666 894 667 ahwif->dev = dev; 895 668 ahwif->irq = platform_get_irq(pdev, 0); ··· 675 902 goto out; 676 903 } 677 904 678 - if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { 905 + if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { 679 906 pr_debug("%s: request_mem_region failed\n", DRV_NAME); 680 - ret = -EBUSY; 907 + ret = -EBUSY; 681 908 goto out; 682 - } 909 + } 683 910 684 911 ahwif->regbase = (u32)ioremap(res->start, res->end-res->start); 685 912 if (ahwif->regbase == 0) { ··· 687 914 goto out; 688 915 } 689 916 690 - hwif = &ide_hwifs[pdev->id]; 691 - hw_regs_t *hw = &hwif->hw; 692 - hwif->irq = hw->irq = ahwif->irq; 693 - hwif->chipset = ide_au1xxx; 917 + /* FIXME: This might possibly break PCMCIA IDE devices */ 694 918 695 - auide_setup_ports(hw, ahwif); 919 + hwif = &ide_hwifs[pdev->id]; 920 + hw_regs_t *hw = &hwif->hw; 921 + hwif->irq = hw->irq = ahwif->irq; 922 + hwif->chipset = ide_au1xxx; 923 + 924 + auide_setup_ports(hw, ahwif); 696 925 memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); 697 926 698 - #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ 699 - hwif->rqsize = CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ; 700 - hwif->rqsize = ((hwif->rqsize > AU1XXX_ATA_RQSIZE) 701 - || (hwif->rqsize < 32)) ? AU1XXX_ATA_RQSIZE : hwif->rqsize; 702 - #else /* if kernel config is not set */ 703 - hwif->rqsize = AU1XXX_ATA_RQSIZE; 704 - #endif 705 - 706 - hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ 927 + hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ 707 928 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 708 - hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ 709 - hwif->swdma_mask = 0x07; 929 + hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ 930 + hwif->swdma_mask = 0x00; 710 931 #else 711 - hwif->mwdma_mask = 0x0; 712 - hwif->swdma_mask = 0x0; 932 + hwif->mwdma_mask = 0x0; 933 + hwif->swdma_mask = 0x0; 713 934 #endif 714 - //hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 715 - hwif->noprobe = 0; 716 - hwif->drives[0].unmask = 1; 717 - hwif->drives[1].unmask = 1; 718 935 719 - /* hold should be on in all cases */ 720 - hwif->hold = 1; 721 - hwif->mmio = 2; 936 + hwif->noprobe = 0; 937 + hwif->drives[0].unmask = 1; 938 + hwif->drives[1].unmask = 1; 722 939 723 - /* set up local I/O function entry points */ 724 - hwif->INB = auide_inb; 725 - hwif->INW = auide_inw; 726 - hwif->INL = auide_inl; 727 - hwif->INSW = auide_insw; 728 - hwif->INSL = auide_insl; 729 - hwif->OUTB = auide_outb; 730 - hwif->OUTBSYNC = auide_outbsync; 731 - hwif->OUTW = auide_outw; 732 - hwif->OUTL = auide_outl; 733 - hwif->OUTSW = auide_outsw; 734 - hwif->OUTSL = auide_outsl; 940 + /* hold should be on in all cases */ 941 + hwif->hold = 1; 942 + hwif->mmio = 2; 735 943 736 - hwif->tuneproc = &auide_tune_drive; 737 - hwif->speedproc = &auide_tune_chipset; 944 + /* If the user has selected DDMA assisted copies, 945 + then set up a few local I/O function entry points 946 + */ 947 + 948 + #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA 949 + hwif->INSW = auide_insw; 950 + hwif->OUTSW = auide_outsw; 951 + #endif 952 + 953 + hwif->tuneproc = &auide_tune_drive; 954 + hwif->speedproc = &auide_tune_chipset; 738 955 739 956 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 740 - hwif->ide_dma_off_quietly = &auide_dma_off_quietly; 741 - hwif->ide_dma_timeout = &auide_dma_timeout; 957 + hwif->ide_dma_off_quietly = &auide_dma_off_quietly; 958 + hwif->ide_dma_timeout = &auide_dma_timeout; 742 959 743 - hwif->ide_dma_check = &auide_dma_check; 744 - hwif->dma_exec_cmd = &auide_dma_exec_cmd; 745 - hwif->dma_start = &auide_dma_start; 746 - hwif->ide_dma_end = &auide_dma_end; 747 - hwif->dma_setup = &auide_dma_setup; 748 - hwif->ide_dma_test_irq = &auide_dma_test_irq; 749 - hwif->ide_dma_host_off = &auide_dma_host_off; 750 - hwif->ide_dma_host_on = &auide_dma_host_on; 751 - hwif->ide_dma_lostirq = &auide_dma_lostirq; 752 - hwif->ide_dma_on = &auide_dma_on; 960 + hwif->ide_dma_check = &auide_dma_check; 961 + hwif->dma_exec_cmd = &auide_dma_exec_cmd; 962 + hwif->dma_start = &auide_dma_start; 963 + hwif->ide_dma_end = &auide_dma_end; 964 + hwif->dma_setup = &auide_dma_setup; 965 + hwif->ide_dma_test_irq = &auide_dma_test_irq; 966 + hwif->ide_dma_host_off = &auide_dma_host_off; 967 + hwif->ide_dma_host_on = &auide_dma_host_on; 968 + hwif->ide_dma_lostirq = &auide_dma_lostirq; 969 + hwif->ide_dma_on = &auide_dma_on; 753 970 754 - hwif->autodma = 1; 755 - hwif->drives[0].autodma = hwif->autodma; 756 - hwif->drives[1].autodma = hwif->autodma; 757 - hwif->atapi_dma = 1; 758 - hwif->drives[0].using_dma = 1; 759 - hwif->drives[1].using_dma = 1; 971 + hwif->autodma = 1; 972 + hwif->drives[0].autodma = hwif->autodma; 973 + hwif->drives[1].autodma = hwif->autodma; 974 + hwif->atapi_dma = 1; 975 + 760 976 #else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 761 - hwif->autodma = 0; 762 - hwif->channel = 0; 763 - hwif->hold = 1; 764 - hwif->select_data = 0; /* no chipset-specific code */ 765 - hwif->config_data = 0; /* no chipset-specific code */ 977 + hwif->autodma = 0; 978 + hwif->channel = 0; 979 + hwif->hold = 1; 980 + hwif->select_data = 0; /* no chipset-specific code */ 981 + hwif->config_data = 0; /* no chipset-specific code */ 766 982 767 - hwif->drives[0].autodma = 0; 768 - hwif->drives[0].drive_data = 0; /* no drive data */ 769 - hwif->drives[0].using_dma = 0; 770 - hwif->drives[0].waiting_for_dma = 0; 771 - hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ 772 - /* secondary hdd not supported */ 773 - hwif->drives[1].autodma = 0; 774 - 775 - hwif->drives[1].drive_data = 0; 776 - hwif->drives[1].using_dma = 0; 777 - hwif->drives[1].waiting_for_dma = 0; 778 - hwif->drives[1].autotune = 2; /* 1=autotune, 2=noautotune, 0=default */ 983 + hwif->drives[0].autodma = 0; 984 + hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ 779 985 #endif 780 - hwif->drives[0].io_32bit = 0; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ 781 - hwif->drives[1].io_32bit = 0; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ 986 + hwif->drives[0].no_io_32bit = 1; 782 987 783 - /*Register Driver with PM Framework*/ 784 - #ifdef CONFIG_PM 785 - auide_hwif.pm.lock = SPIN_LOCK_UNLOCKED; 786 - auide_hwif.pm.stopped = 0; 988 + auide_hwif.hwif = hwif; 989 + hwif->hwif_data = &auide_hwif; 787 990 788 - auide_hwif.pm.dev = new_au1xxx_power_device( "ide", 789 - &au1200ide_pm_callback, 790 - NULL); 791 - if ( auide_hwif.pm.dev == NULL ) 792 - printk(KERN_INFO "Unable to create a power management \ 793 - device entry for the au1200-IDE.\n"); 794 - else 795 - printk(KERN_INFO "Power management device entry for the \ 796 - au1200-IDE loaded.\n"); 797 - #endif 798 - 799 - auide_hwif.hwif = hwif; 800 - hwif->hwif_data = &auide_hwif; 801 - 802 - #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA 803 - auide_ddma_init(&auide_hwif); 804 - dbdma_init_done = 1; 991 + #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA 992 + auide_ddma_init(&auide_hwif); 993 + dbdma_init_done = 1; 805 994 #endif 806 995 807 996 probe_hwif_init(hwif); 808 997 dev_set_drvdata(dev, hwif); 809 998 810 - printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode ); 999 + printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode ); 811 1000 812 - out: 813 - return ret; 1001 + out: 1002 + return ret; 814 1003 } 815 1004 816 1005 static int au_ide_remove(struct device *dev) ··· 780 1045 struct platform_device *pdev = to_platform_device(dev); 781 1046 struct resource *res; 782 1047 ide_hwif_t *hwif = dev_get_drvdata(dev); 783 - _auide_hwif *ahwif = &auide_hwif; 1048 + _auide_hwif *ahwif = &auide_hwif; 784 1049 785 1050 ide_unregister(hwif - ide_hwifs); 786 1051 ··· 804 1069 return driver_register(&au1200_ide_driver); 805 1070 } 806 1071 807 - static void __init au_ide_exit(void) 1072 + static void __exit au_ide_exit(void) 808 1073 { 809 1074 driver_unregister(&au1200_ide_driver); 810 1075 } 811 - 812 - #ifdef CONFIG_PM 813 - int au1200ide_pm_callback( au1xxx_power_dev_t *dev,\ 814 - au1xxx_request_t request, void *data) { 815 - 816 - unsigned int d, err = 0; 817 - unsigned long flags; 818 - 819 - spin_lock_irqsave(auide_hwif.pm.lock, flags); 820 - 821 - switch (request){ 822 - case AU1XXX_PM_SLEEP: 823 - err = au1xxxide_pm_sleep(dev); 824 - break; 825 - case AU1XXX_PM_WAKEUP: 826 - d = *((unsigned int*)data); 827 - if ( d > 0 && d <= 99) { 828 - err = au1xxxide_pm_standby(dev); 829 - } 830 - else { 831 - err = au1xxxide_pm_resume(dev); 832 - } 833 - break; 834 - case AU1XXX_PM_GETSTATUS: 835 - err = au1xxxide_pm_getstatus(dev); 836 - break; 837 - case AU1XXX_PM_ACCESS: 838 - err = au1xxxide_pm_access(dev); 839 - break; 840 - case AU1XXX_PM_IDLE: 841 - err = au1xxxide_pm_idle(dev); 842 - break; 843 - case AU1XXX_PM_CLEANUP: 844 - err = au1xxxide_pm_cleanup(dev); 845 - break; 846 - default: 847 - err = -1; 848 - break; 849 - } 850 - 851 - spin_unlock_irqrestore(auide_hwif.pm.lock, flags); 852 - 853 - return err; 854 - } 855 - 856 - static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev ) { 857 - return 0; 858 - } 859 - 860 - static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev ) { 861 - 862 - int retval; 863 - ide_hwif_t *hwif = auide_hwif.hwif; 864 - struct request rq; 865 - struct request_pm_state rqpm; 866 - ide_task_t args; 867 - 868 - if(auide_hwif.pm.stopped) 869 - return -1; 870 - 871 - /* 872 - * wait until hard disc is ready 873 - */ 874 - if ( wait_for_ready(&hwif->drives[0], 35000) ) { 875 - printk("Wait for drive sleep timeout!\n"); 876 - retval = -1; 877 - } 878 - 879 - /* 880 - * sequenz to tell the high level ide driver that pm is resuming 881 - */ 882 - memset(&rq, 0, sizeof(rq)); 883 - memset(&rqpm, 0, sizeof(rqpm)); 884 - memset(&args, 0, sizeof(args)); 885 - rq.flags = REQ_PM_SUSPEND; 886 - rq.special = &args; 887 - rq.pm = &rqpm; 888 - rqpm.pm_step = ide_pm_state_start_suspend; 889 - rqpm.pm_state = PMSG_SUSPEND; 890 - 891 - retval = ide_do_drive_cmd(&hwif->drives[0], &rq, ide_wait); 892 - 893 - if (wait_for_ready (&hwif->drives[0], 35000)) { 894 - printk("Wait for drive sleep timeout!\n"); 895 - retval = -1; 896 - } 897 - 898 - /* 899 - * stop dbdma channels 900 - */ 901 - au1xxx_dbdma_reset(auide_hwif.tx_chan); 902 - au1xxx_dbdma_reset(auide_hwif.rx_chan); 903 - 904 - auide_hwif.pm.stopped = 1; 905 - 906 - return retval; 907 - } 908 - 909 - static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev ) { 910 - 911 - int retval; 912 - ide_hwif_t *hwif = auide_hwif.hwif; 913 - struct request rq; 914 - struct request_pm_state rqpm; 915 - ide_task_t args; 916 - 917 - if(!auide_hwif.pm.stopped) 918 - return -1; 919 - 920 - /* 921 - * start dbdma channels 922 - */ 923 - au1xxx_dbdma_start(auide_hwif.tx_chan); 924 - au1xxx_dbdma_start(auide_hwif.rx_chan); 925 - 926 - /* 927 - * wait until hard disc is ready 928 - */ 929 - if (wait_for_ready ( &hwif->drives[0], 35000)) { 930 - printk("Wait for drive wake up timeout!\n"); 931 - retval = -1; 932 - } 933 - 934 - /* 935 - * sequenz to tell the high level ide driver that pm is resuming 936 - */ 937 - memset(&rq, 0, sizeof(rq)); 938 - memset(&rqpm, 0, sizeof(rqpm)); 939 - memset(&args, 0, sizeof(args)); 940 - rq.flags = REQ_PM_RESUME; 941 - rq.special = &args; 942 - rq.pm = &rqpm; 943 - rqpm.pm_step = ide_pm_state_start_resume; 944 - rqpm.pm_state = PMSG_ON; 945 - 946 - retval = ide_do_drive_cmd(&hwif->drives[0], &rq, ide_head_wait); 947 - 948 - /* 949 - * wait for hard disc 950 - */ 951 - if ( wait_for_ready(&hwif->drives[0], 35000) ) { 952 - printk("Wait for drive wake up timeout!\n"); 953 - retval = -1; 954 - } 955 - 956 - auide_hwif.pm.stopped = 0; 957 - 958 - return retval; 959 - } 960 - 961 - static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev ) { 962 - return dev->cur_state; 963 - } 964 - 965 - static int au1xxxide_pm_access( au1xxx_power_dev_t *dev ) { 966 - if (dev->cur_state != AWAKE_STATE) 967 - return 0; 968 - else 969 - return -1; 970 - } 971 - 972 - static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev ) { 973 - return 0; 974 - } 975 - 976 - static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev ) { 977 - return 0; 978 - } 979 - #endif /* CONFIG_PM */ 980 1076 981 1077 MODULE_LICENSE("GPL"); 982 1078 MODULE_DESCRIPTION("AU1200 IDE driver");
+7 -1
drivers/ide/pci/sgiioc4.c
··· 622 622 ide_hwif_t *hwif; 623 623 int h; 624 624 625 + /* 626 + * Find an empty HWIF; if none available, return -ENOMEM. 627 + */ 625 628 for (h = 0; h < MAX_HWIFS; ++h) { 626 629 hwif = &ide_hwifs[h]; 627 - /* Find an empty HWIF */ 628 630 if (hwif->chipset == ide_unknown) 629 631 break; 632 + } 633 + if (h == MAX_HWIFS) { 634 + printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", d->name); 635 + return -ENOMEM; 630 636 } 631 637 632 638 /* Get the CmdBlk and CtrlBlk Base Registers */
+1
drivers/ide/pci/via82cxxx.c
··· 80 80 u16 flags; 81 81 } via_isa_bridges[] = { 82 82 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 83 + { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 83 84 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 84 85 { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 85 86 { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
+1
drivers/ieee1394/hosts.h
··· 41 41 /* this nodes state */ 42 42 unsigned in_bus_reset:1; 43 43 unsigned is_shutdown:1; 44 + unsigned resume_packet_sent:1; 44 45 45 46 /* this nodes' duties on the bus */ 46 47 unsigned is_root:1;
+57 -10
drivers/ieee1394/nodemgr.c
··· 1349 1349 } 1350 1350 1351 1351 1352 + /* Write the BROADCAST_CHANNEL as per IEEE1394a 8.3.2.3.11 and 8.4.2.3. This 1353 + * seems like an optional service but in the end it is practically mandatory 1354 + * as a consequence of these clauses. 1355 + * 1356 + * Note that we cannot do a broadcast write to all nodes at once because some 1357 + * pre-1394a devices would hang. */ 1358 + static void nodemgr_irm_write_bc(struct node_entry *ne, int generation) 1359 + { 1360 + const u64 bc_addr = (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL); 1361 + quadlet_t bc_remote, bc_local; 1362 + int ret; 1363 + 1364 + if (!ne->host->is_irm || ne->generation != generation || 1365 + ne->nodeid == ne->host->node_id) 1366 + return; 1367 + 1368 + bc_local = cpu_to_be32(ne->host->csr.broadcast_channel); 1369 + 1370 + /* Check if the register is implemented and 1394a compliant. */ 1371 + ret = hpsb_read(ne->host, ne->nodeid, generation, bc_addr, &bc_remote, 1372 + sizeof(bc_remote)); 1373 + if (!ret && bc_remote & cpu_to_be32(0x80000000) && 1374 + bc_remote != bc_local) 1375 + hpsb_node_write(ne, bc_addr, &bc_local, sizeof(bc_local)); 1376 + } 1377 + 1378 + 1352 1379 static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation) 1353 1380 { 1354 1381 struct device *dev; ··· 1386 1359 dev = get_device(&ne->device); 1387 1360 if (!dev) 1388 1361 return; 1362 + 1363 + nodemgr_irm_write_bc(ne, generation); 1389 1364 1390 1365 /* If "needs_probe", then this is either a new or changed node we 1391 1366 * rescan totally. If the generation matches for an existing node ··· 1442 1413 return; 1443 1414 } 1444 1415 1445 - /* Because we are a 1394a-2000 compliant IRM, we need to inform all the other 1446 - * nodes of the broadcast channel. (Really we're only setting the validity 1447 - * bit). Other IRM responsibilities go in here as well. */ 1416 + static int nodemgr_send_resume_packet(struct hpsb_host *host) 1417 + { 1418 + struct hpsb_packet *packet; 1419 + int ret = 1; 1420 + 1421 + packet = hpsb_make_phypacket(host, 1422 + 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24); 1423 + if (packet) { 1424 + packet->no_waiter = 1; 1425 + packet->generation = get_hpsb_generation(host); 1426 + ret = hpsb_send_packet(packet); 1427 + } 1428 + if (ret) 1429 + HPSB_WARN("fw-host%d: Failed to broadcast resume packet", 1430 + host->id); 1431 + return ret; 1432 + } 1433 + 1434 + /* Perform a few high-level IRM responsibilities. */ 1448 1435 static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) 1449 1436 { 1450 1437 quadlet_t bc; ··· 1469 1424 if (!host->is_irm || host->irm_id == (nodeid_t)-1) 1470 1425 return 1; 1471 1426 1472 - host->csr.broadcast_channel |= 0x40000000; /* set validity bit */ 1473 - 1474 - bc = cpu_to_be32(host->csr.broadcast_channel); 1475 - 1476 - hpsb_write(host, LOCAL_BUS | ALL_NODES, get_hpsb_generation(host), 1477 - (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL), 1478 - &bc, sizeof(quadlet_t)); 1427 + /* We are a 1394a-2000 compliant IRM. Set the validity bit. */ 1428 + host->csr.broadcast_channel |= 0x40000000; 1479 1429 1480 1430 /* If there is no bus manager then we should set the root node's 1481 1431 * force_root bit to promote bus stability per the 1394 ··· 1502 1462 return 0; 1503 1463 } 1504 1464 } 1465 + 1466 + /* Some devices suspend their ports while being connected to an inactive 1467 + * host adapter, i.e. if connected before the low-level driver is 1468 + * loaded. They become visible either when physically unplugged and 1469 + * replugged, or when receiving a resume packet. Send one once. */ 1470 + if (!host->resume_packet_sent && !nodemgr_send_resume_packet(host)) 1471 + host->resume_packet_sent = 1; 1505 1472 1506 1473 return 1; 1507 1474 }
+1 -1
drivers/input/joystick/warrior.c
··· 172 172 input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8); 173 173 input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0); 174 174 input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); 175 - input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); 175 + input_set_abs_params(input_dev, ABS_HAT0Y, -1, 1, 0, 0); 176 176 177 177 serio_set_drvdata(serio, warrior); 178 178
+1 -1
drivers/input/misc/Kconfig
··· 26 26 27 27 config INPUT_SPARCSPKR 28 28 tristate "SPARC Speaker support" 29 - depends on PCI && (SPARC32 || SPARC64) 29 + depends on PCI && SPARC 30 30 help 31 31 Say Y here if you want the standard Speaker on Sparc PCI systems 32 32 to be used for bells and whistles.
+1 -1
drivers/input/misc/wistron_btns.c
··· 320 320 }, 321 321 .driver_data = keymap_acer_aspire_1500 322 322 }, 323 - { 0, } 323 + { NULL, } 324 324 }; 325 325 326 326 static int __init select_keymap(void)
+1 -1
drivers/input/mouse/alps.c
··· 42 42 { { 0x53, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, 43 43 { { 0x63, 0x02, 0x0a }, 0xf8, 0xf8, 0 }, 44 44 { { 0x63, 0x02, 0x14 }, 0xf8, 0xf8, 0 }, 45 - { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, 0 }, 45 + { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Fujitsu Siemens S6010 */ 46 46 { { 0x63, 0x02, 0x3c }, 0x8f, 0x8f, ALPS_WHEEL }, /* Toshiba Satellite S2400-103 */ 47 47 { { 0x63, 0x02, 0x50 }, 0xef, 0xef, ALPS_FW_BK_1 }, /* NEC Versa L320 */ 48 48 { { 0x63, 0x02, 0x64 }, 0xf8, 0xf8, 0 },
+1 -1
drivers/input/mouse/sermouse.c
··· 95 95 96 96 input_sync(dev); 97 97 98 - if (++sermouse->count == (5 - ((sermouse->type == SERIO_SUN) << 1))) 98 + if (++sermouse->count == 5) 99 99 sermouse->count = 0; 100 100 } 101 101
+1 -1
drivers/input/serio/i8042.h
··· 21 21 #include "i8042-ip22io.h" 22 22 #elif defined(CONFIG_PPC) 23 23 #include "i8042-ppcio.h" 24 - #elif defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) 24 + #elif defined(CONFIG_SPARC) 25 25 #include "i8042-sparcio.h" 26 26 #elif defined(CONFIG_X86) || defined(CONFIG_IA64) 27 27 #include "i8042-x86ia64io.h"
+4 -4
drivers/macintosh/therm_pm72.c
··· 923 923 if (temp_combi >= ((state0->mpu.tmax + 8) << 16)) { 924 924 printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n", 925 925 temp_combi >> 16); 926 - state0->overtemp = CPU_MAX_OVERTEMP; 926 + state0->overtemp += CPU_MAX_OVERTEMP / 4; 927 927 } else if (temp_combi > (state0->mpu.tmax << 16)) 928 928 state0->overtemp++; 929 929 else ··· 933 933 if (state0->overtemp > 0) { 934 934 state0->rpm = state0->mpu.rmaxn_exhaust_fan; 935 935 state0->intake_rpm = intake = state0->mpu.rmaxn_intake_fan; 936 - pump = state0->pump_min; 936 + pump = state0->pump_max; 937 937 goto do_set_fans; 938 938 } 939 939 ··· 998 998 printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum" 999 999 " (%d) !\n", 1000 1000 state->index, temp >> 16); 1001 - state->overtemp = CPU_MAX_OVERTEMP; 1001 + state->overtemp += CPU_MAX_OVERTEMP / 4; 1002 1002 } else if (temp > (state->mpu.tmax << 16)) 1003 1003 state->overtemp++; 1004 1004 else ··· 1060 1060 printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum" 1061 1061 " (%d) !\n", 1062 1062 state->index, temp >> 16); 1063 - state->overtemp = CPU_MAX_OVERTEMP; 1063 + state->overtemp = CPU_MAX_OVERTEMP / 4; 1064 1064 } else if (temp > (state->mpu.tmax << 16)) 1065 1065 state->overtemp++; 1066 1066 else
+1 -1
drivers/md/md.c
··· 1729 1729 if (p == NULL && mddev->raid_disks == 0) 1730 1730 return 0; 1731 1731 if (mddev->level >= 0) 1732 - return sprintf(page, "RAID-%d\n", mddev->level); 1732 + return sprintf(page, "raid%d\n", mddev->level); 1733 1733 else 1734 1734 return sprintf(page, "%s\n", p->name); 1735 1735 }
+3 -3
drivers/media/dvb/bt8xx/dst_ca.c
··· 406 406 } 407 407 dprintk(verbose, DST_CA_DEBUG, 1, " "); 408 408 409 - if (copy_from_user(p_ca_message, (void *)arg, sizeof (struct ca_msg))) { 409 + if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) { 410 410 result = -EFAULT; 411 411 goto free_mem_and_exit; 412 412 } ··· 579 579 return 0; 580 580 } 581 581 582 - static int dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) 582 + static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) 583 583 { 584 584 int bytes_read = 0; 585 585 ··· 588 588 return bytes_read; 589 589 } 590 590 591 - static int dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) 591 + static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) 592 592 { 593 593 dprintk(verbose, DST_CA_DEBUG, 1, " Device write."); 594 594
+3
drivers/media/dvb/ttpci/av7110.c
··· 176 176 } 177 177 } 178 178 179 + if (dev->pci->subsystem_vendor == 0x13c2 && dev->pci->subsystem_device == 0x000e) 180 + av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, SpdifSwitch, 1, 0); // SPDIF on 181 + 179 182 ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right); 180 183 if (ret < 0) 181 184 printk("dvb-ttpci:cannot set volume :%d\n",ret);
+2 -1
drivers/media/dvb/ttpci/av7110_hw.h
··· 143 143 MainSwitch, 144 144 ADSwitch, 145 145 SendDiSEqC, 146 - SetRegister 146 + SetRegister, 147 + SpdifSwitch 147 148 }; 148 149 149 150 enum av7110_request_command {
+23 -17
drivers/media/video/cx25840/cx25840-core.c
··· 333 333 334 334 static int set_v4lstd(struct i2c_client *client, v4l2_std_id std) 335 335 { 336 - u8 fmt; 336 + u8 fmt=0; /* zero is autodetect */ 337 337 338 - switch (std) { 339 - /* zero is autodetect */ 340 - case 0: fmt = 0x0; break; 341 - /* default ntsc to ntsc-m */ 342 - case V4L2_STD_NTSC: 343 - case V4L2_STD_NTSC_M: fmt = 0x1; break; 344 - case V4L2_STD_NTSC_M_JP: fmt = 0x2; break; 345 - case V4L2_STD_NTSC_443: fmt = 0x3; break; 346 - case V4L2_STD_PAL: fmt = 0x4; break; 347 - case V4L2_STD_PAL_M: fmt = 0x5; break; 348 - case V4L2_STD_PAL_N: fmt = 0x6; break; 349 - case V4L2_STD_PAL_Nc: fmt = 0x7; break; 350 - case V4L2_STD_PAL_60: fmt = 0x8; break; 351 - case V4L2_STD_SECAM: fmt = 0xc; break; 352 - default: 353 - return -ERANGE; 338 + /* First tests should be against specific std */ 339 + if (std & V4L2_STD_NTSC_M_JP) { 340 + fmt=0x2; 341 + } else if (std & V4L2_STD_NTSC_443) { 342 + fmt=0x3; 343 + } else if (std & V4L2_STD_PAL_M) { 344 + fmt=0x5; 345 + } else if (std & V4L2_STD_PAL_N) { 346 + fmt=0x6; 347 + } else if (std & V4L2_STD_PAL_Nc) { 348 + fmt=0x7; 349 + } else if (std & V4L2_STD_PAL_60) { 350 + fmt=0x8; 351 + } else { 352 + /* Then, test against generic ones */ 353 + if (std & V4L2_STD_NTSC) { 354 + fmt=0x1; 355 + } else if (std & V4L2_STD_PAL) { 356 + fmt=0x4; 357 + } else if (std & V4L2_STD_SECAM) { 358 + fmt=0xc; 359 + } 354 360 } 355 361 356 362 cx25840_and_or(client, 0x400, ~0xf, fmt);
+4 -4
drivers/media/video/em28xx/em28xx-core.c
··· 39 39 #define em28xx_coredbg(fmt, arg...) do {\ 40 40 if (core_debug) \ 41 41 printk(KERN_INFO "%s %s :"fmt, \ 42 - dev->name, __FUNCTION__, ##arg); } while (0) 42 + dev->name, __FUNCTION__ , ##arg); } while (0) 43 43 44 44 static unsigned int reg_debug; 45 45 module_param(reg_debug,int,0644); ··· 48 48 #define em28xx_regdbg(fmt, arg...) do {\ 49 49 if (reg_debug) \ 50 50 printk(KERN_INFO "%s %s :"fmt, \ 51 - dev->name, __FUNCTION__, ##arg); } while (0) 51 + dev->name, __FUNCTION__ , ##arg); } while (0) 52 52 53 53 static unsigned int isoc_debug; 54 54 module_param(isoc_debug,int,0644); ··· 57 57 #define em28xx_isocdbg(fmt, arg...) do {\ 58 58 if (isoc_debug) \ 59 59 printk(KERN_INFO "%s %s :"fmt, \ 60 - dev->name, __FUNCTION__, ##arg); } while (0) 60 + dev->name, __FUNCTION__ , ##arg); } while (0) 61 61 62 62 static int alt = EM28XX_PINOUT; 63 63 module_param(alt, int, 0644); ··· 126 126 const size_t imagesize = PAGE_ALIGN(dev->frame_size); /*needs to be page aligned cause the buffers can be mapped individually! */ 127 127 void *buff = NULL; 128 128 u32 i; 129 - em28xx_coredbg("requested %i buffers with size %i", count, imagesize); 129 + em28xx_coredbg("requested %i buffers with size %zd", count, imagesize); 130 130 if (count > EM28XX_NUM_FRAMES) 131 131 count = EM28XX_NUM_FRAMES; 132 132
+1 -1
drivers/media/video/em28xx/em28xx-i2c.c
··· 44 44 printk(fmt, ##args); } while (0) 45 45 #define dprintk2(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \ 46 46 printk(KERN_DEBUG "%s at %s: " fmt, \ 47 - dev->name, __FUNCTION__, ##args); } while (0) 47 + dev->name, __FUNCTION__ , ##args); } while (0) 48 48 49 49 /* 50 50 * em2800_i2c_send_max4()
+1 -1
drivers/media/video/em28xx/em28xx-video.c
··· 45 45 #define em28xx_videodbg(fmt, arg...) do {\ 46 46 if (video_debug) \ 47 47 printk(KERN_INFO "%s %s :"fmt, \ 48 - dev->name, __FUNCTION__, ##arg); } while (0) 48 + dev->name, __FUNCTION__ , ##arg); } while (0) 49 49 50 50 MODULE_AUTHOR(DRIVER_AUTHOR); 51 51 MODULE_DESCRIPTION(DRIVER_DESC);
+4 -4
drivers/media/video/em28xx/em28xx.h
··· 392 392 /* printk macros */ 393 393 394 394 #define em28xx_err(fmt, arg...) do {\ 395 - printk(KERN_ERR fmt, ##arg); } while (0) 395 + printk(KERN_ERR fmt , ##arg); } while (0) 396 396 397 397 #define em28xx_errdev(fmt, arg...) do {\ 398 398 printk(KERN_ERR "%s: "fmt,\ 399 - dev->name, ##arg); } while (0) 399 + dev->name , ##arg); } while (0) 400 400 401 401 #define em28xx_info(fmt, arg...) do {\ 402 402 printk(KERN_INFO "%s: "fmt,\ 403 - dev->name, ##arg); } while (0) 403 + dev->name , ##arg); } while (0) 404 404 #define em28xx_warn(fmt, arg...) do {\ 405 405 printk(KERN_WARNING "%s: "fmt,\ 406 - dev->name, ##arg); } while (0) 406 + dev->name , ##arg); } while (0) 407 407 408 408 inline static int em28xx_audio_source(struct em28xx *dev, int input) 409 409 {
+3 -3
drivers/media/video/saa7127.c
··· 389 389 static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) 390 390 { 391 391 struct saa7127_state *state = i2c_get_clientdata(client); 392 - u16 cc = data->data[0] << 8 | data->data[1]; 392 + u16 cc = data->data[1] << 8 | data->data[0]; 393 393 int enable = (data->line != 0); 394 394 395 395 if (enable && (data->field != 0 || data->line != 21)) ··· 397 397 if (state->cc_enable != enable) { 398 398 saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); 399 399 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, 400 - (enable << 6) | 0x11); 400 + (state->xds_enable << 7) | (enable << 6) | 0x11); 401 401 state->cc_enable = enable; 402 402 } 403 403 if (!enable) ··· 423 423 if (state->xds_enable != enable) { 424 424 saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); 425 425 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, 426 - (enable << 7) | 0x11); 426 + (enable << 7) | (state->cc_enable << 6) | 0x11); 427 427 state->xds_enable = enable; 428 428 } 429 429 if (!enable)
+24 -2
drivers/media/video/saa7134/Kconfig
··· 1 1 config VIDEO_SAA7134 2 2 tristate "Philips SAA7134 support" 3 - depends on VIDEO_DEV && PCI && I2C && SOUND && SND 3 + depends on VIDEO_DEV && PCI && I2C 4 4 select VIDEO_BUF 5 5 select VIDEO_IR 6 6 select VIDEO_TUNER 7 7 select CRC32 8 - select SND_PCM_OSS 9 8 ---help--- 10 9 This is a video4linux driver for Philips SAA713x based 11 10 TV cards. 12 11 13 12 To compile this driver as a module, choose M here: the 14 13 module will be called saa7134. 14 + 15 + config VIDEO_SAA7134_ALSA 16 + tristate "Philips SAA7134 DMA audio support" 17 + depends on VIDEO_SAA7134 && SND 18 + select SND_PCM_OSS 19 + ---help--- 20 + This is a video4linux driver for direct (DMA) audio in 21 + Philips SAA713x based TV cards using ALSA 22 + 23 + To compile this driver as a module, choose M here: the 24 + module will be called saa7134-alsa. 25 + 26 + config VIDEO_SAA7134_OSS 27 + tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)" 28 + depends on VIDEO_SAA7134 && SOUND_PRIME && !VIDEO_SAA7134_ALSA 29 + ---help--- 30 + This is a video4linux driver for direct (DMA) audio in 31 + Philips SAA713x based TV cards using OSS 32 + 33 + This is deprecated in favor of the ALSA module 34 + 35 + To compile this driver as a module, choose M here: the 36 + module will be called saa7134-oss. 15 37 16 38 config VIDEO_SAA7134_DVB 17 39 tristate "DVB/ATSC Support for saa7134 based TV cards"
+5 -2
drivers/media/video/saa7134/Makefile
··· 4 4 saa7134-video.o saa7134-input.o 5 5 6 6 obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ 7 - saa6752hs.o saa7134-alsa.o \ 8 - saa7134-oss.o 7 + saa6752hs.o 8 + 9 + obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o 10 + obj-$(CONFIG_VIDEO_SAA7134_OSS) += saa7134-oss.o 11 + 9 12 obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o 10 13 11 14 EXTRA_CFLAGS += -I$(src)/..
+13 -5
drivers/media/video/saa7134/saa7134-alsa.c
··· 60 60 MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); 61 61 62 62 #define dprintk(fmt, arg...) if (debug) \ 63 - printk(KERN_DEBUG "%s/alsa: " fmt, dev->name, ## arg) 63 + printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) 64 64 65 65 66 66 ··· 989 989 struct saa7134_dev *dev = NULL; 990 990 struct list_head *list; 991 991 992 + if (!dmasound_init && !dmasound_exit) { 993 + dmasound_init = alsa_device_init; 994 + dmasound_exit = alsa_device_exit; 995 + } else { 996 + printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); 997 + return -EBUSY; 998 + } 999 + 992 1000 printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); 993 1001 994 1002 list_for_each(list,&saa7134_devlist) { ··· 1008 1000 return -EBUSY; 1009 1001 } 1010 1002 } 1011 - 1012 - dmasound_init = alsa_device_init; 1013 - dmasound_exit = alsa_device_exit; 1014 1003 1015 1004 if (dev == NULL) 1016 1005 printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); ··· 1028 1023 snd_card_free(snd_saa7134_cards[idx]); 1029 1024 } 1030 1025 1026 + dmasound_init = NULL; 1027 + dmasound_exit = NULL; 1031 1028 printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); 1032 1029 1033 1030 return; 1034 1031 } 1035 1032 1036 - module_init(saa7134_alsa_init); 1033 + /* We initialize this late, to make sure the sound system is up and running */ 1034 + late_initcall(saa7134_alsa_init); 1037 1035 module_exit(saa7134_alsa_exit); 1038 1036 MODULE_LICENSE("GPL"); 1039 1037 MODULE_AUTHOR("Ricardo Cerqueira");
+14 -4
drivers/media/video/saa7134/saa7134-oss.c
··· 959 959 struct saa7134_dev *dev = NULL; 960 960 struct list_head *list; 961 961 962 + if (!dmasound_init && !dmasound_exit) { 963 + dmasound_init = oss_device_init; 964 + dmasound_exit = oss_device_exit; 965 + } else { 966 + printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); 967 + return -EBUSY; 968 + } 969 + 962 970 printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); 971 + 963 972 964 973 list_for_each(list,&saa7134_devlist) { 965 974 dev = list_entry(list, struct saa7134_dev, devlist); ··· 982 973 983 974 if (dev == NULL) 984 975 printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); 985 - 986 - dmasound_init = oss_device_init; 987 - dmasound_exit = oss_device_exit; 988 976 989 977 return 0; 990 978 ··· 1003 997 1004 998 } 1005 999 1000 + dmasound_init = NULL; 1001 + dmasound_exit = NULL; 1002 + 1006 1003 printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); 1007 1004 1008 1005 return; 1009 1006 } 1010 1007 1011 - module_init(saa7134_oss_init); 1008 + /* We initialize this late, to make sure the sound system is up and running */ 1009 + late_initcall(saa7134_oss_init); 1012 1010 module_exit(saa7134_oss_exit); 1013 1011 MODULE_LICENSE("GPL"); 1014 1012 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
+1 -1
drivers/media/video/tveeprom.c
··· 206 206 { TUNER_ABSENT, "TCL 2002MI_3H"}, 207 207 { TUNER_TCL_2002N, "TCL 2002N 5H"}, 208 208 /* 100-109 */ 209 - { TUNER_ABSENT, "Philips FMD1216ME"}, 209 + { TUNER_PHILIPS_FMD1216ME_MK3, "Philips FMD1216ME"}, 210 210 { TUNER_TEA5767, "Philips TEA5768HL FM Radio"}, 211 211 { TUNER_ABSENT, "Panasonic ENV57H12D5"}, 212 212 { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"},
+5 -1
drivers/message/i2o/pci.c
··· 303 303 struct i2o_controller *c; 304 304 int rc; 305 305 struct pci_dev *i960 = NULL; 306 + int pci_dev_busy = 0; 306 307 307 308 printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); 308 309 ··· 396 395 if ((rc = i2o_pci_alloc(c))) { 397 396 printk(KERN_ERR "%s: DMA / IO allocation for I2O controller " 398 397 " failed\n", c->name); 398 + if (rc == -ENODEV) 399 + pci_dev_busy = 1; 399 400 goto free_controller; 400 401 } 401 402 ··· 428 425 i2o_iop_free(c); 429 426 430 427 disable: 431 - pci_disable_device(pdev); 428 + if (!pci_dev_busy) 429 + pci_disable_device(pdev); 432 430 433 431 return rc; 434 432 }
+9 -1
drivers/mmc/mmc.c
··· 679 679 } 680 680 681 681 /* 682 - * Apply power to the MMC stack. 682 + * Apply power to the MMC stack. This is a two-stage process. 683 + * First, we enable power to the card without the clock running. 684 + * We then wait a bit for the power to stabilise. Finally, 685 + * enable the bus drivers and clock to the card. 686 + * 687 + * We must _NOT_ enable the clock prior to power stablising. 688 + * 689 + * If a host does all the power sequencing itself, ignore the 690 + * initial MMC_POWER_UP stage. 683 691 */ 684 692 static void mmc_power_up(struct mmc_host *host) 685 693 {
+9 -5
drivers/mmc/mmc_block.c
··· 359 359 md->block_bits = card->csd.read_blkbits; 360 360 361 361 blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); 362 - set_capacity(md->disk, card->csd.capacity); 362 + 363 + /* 364 + * The CSD capacity field is in units of read_blkbits. 365 + * set_capacity takes units of 512 bytes. 366 + */ 367 + set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9)); 363 368 } 364 369 out: 365 370 return md; ··· 378 373 379 374 mmc_card_claim_host(card); 380 375 cmd.opcode = MMC_SET_BLOCKLEN; 381 - cmd.arg = 1 << card->csd.read_blkbits; 376 + cmd.arg = 1 << md->block_bits; 382 377 cmd.flags = MMC_RSP_R1; 383 378 err = mmc_wait_for_cmd(card->host, &cmd, 5); 384 379 mmc_card_release_host(card); ··· 417 412 if (err) 418 413 goto out; 419 414 420 - printk(KERN_INFO "%s: %s %s %dKiB %s\n", 415 + printk(KERN_INFO "%s: %s %s %luKiB %s\n", 421 416 md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), 422 - (card->csd.capacity << card->csd.read_blkbits) / 1024, 423 - mmc_blk_readonly(card)?"(ro)":""); 417 + get_capacity(md->disk) >> 1, mmc_blk_readonly(card)?"(ro)":""); 424 418 425 419 mmc_set_drvdata(card, md); 426 420 add_disk(md->disk);
+1 -1
drivers/mtd/maps/Kconfig
··· 62 62 63 63 config MTD_SUN_UFLASH 64 64 tristate "Sun Microsystems userflash support" 65 - depends on (SPARC32 || SPARC64) && MTD_CFI 65 + depends on SPARC && MTD_CFI 66 66 help 67 67 This provides a 'mapping' driver which supports the way in 68 68 which user-programmable flash chips are connected on various
+2 -2
drivers/mtd/onenand/generic.c
··· 12 12 * This is a device driver for the OneNAND flash for generic boards. 13 13 */ 14 14 15 - #include <linux/device.h> 16 15 #include <linux/module.h> 17 16 #include <linux/init.h> 17 + #include <linux/platform_device.h> 18 18 #include <linux/mtd/mtd.h> 19 19 #include <linux/mtd/onenand.h> 20 20 #include <linux/mtd/partitions.h> ··· 39 39 { 40 40 struct onenand_info *info; 41 41 struct platform_device *pdev = to_platform_device(dev); 42 - struct onenand_platform_data *pdata = pdev->dev.platform_data; 42 + struct flash_platform_data *pdata = pdev->dev.platform_data; 43 43 struct resource *res = pdev->resource; 44 44 unsigned long size = res->end - res->start + 1; 45 45 int err;
+40 -13
drivers/mtd/onenand/onenand_base.c
··· 940 940 u_char *eccbuf, struct nand_oobinfo *oobsel) 941 941 { 942 942 struct onenand_chip *this = mtd->priv; 943 - unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf; 943 + unsigned char *pbuf; 944 944 size_t total_len, len; 945 945 int i, written = 0; 946 946 int ret = 0; ··· 975 975 /* Loop until all keve's data has been written */ 976 976 len = 0; 977 977 while (count) { 978 - pbuf = buffer; 978 + pbuf = this->page_buf; 979 979 /* 980 980 * If the given tuple is >= pagesize then 981 981 * write it out from the iov ··· 995 995 int cnt = 0, thislen; 996 996 while (cnt < mtd->oobblock) { 997 997 thislen = min_t(int, mtd->oobblock - cnt, vecs->iov_len - len); 998 - memcpy(buffer + cnt, vecs->iov_base + len, thislen); 998 + memcpy(this->page_buf + cnt, vecs->iov_base + len, thislen); 999 999 cnt += thislen; 1000 1000 len += thislen; 1001 1001 ··· 1296 1296 1297 1297 /* Block lock scheme */ 1298 1298 for (block = start; block < end; block++) { 1299 + /* Set block address */ 1300 + value = onenand_block_address(this, block); 1301 + this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1); 1302 + /* Select DataRAM for DDP */ 1303 + value = onenand_bufferram_address(this, block); 1304 + this->write_word(value, this->base + ONENAND_REG_START_ADDRESS2); 1299 1305 /* Set start block address */ 1300 1306 this->write_word(block, this->base + ONENAND_REG_START_BLOCK_ADDRESS); 1301 1307 /* Write unlock command */ ··· 1314 1308 while (this->read_word(this->base + ONENAND_REG_CTRL_STATUS) 1315 1309 & ONENAND_CTRL_ONGO) 1316 1310 continue; 1317 - 1318 - /* Set block address for read block status */ 1319 - value = onenand_block_address(this, block); 1320 - this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1); 1321 1311 1322 1312 /* Check lock status */ 1323 1313 status = this->read_word(this->base + ONENAND_REG_WP_STATUS); ··· 1348 1346 1349 1347 static const struct onenand_manufacturers onenand_manuf_ids[] = { 1350 1348 {ONENAND_MFR_SAMSUNG, "Samsung"}, 1351 - {ONENAND_MFR_UNKNOWN, "Unknown"} 1352 1349 }; 1353 1350 1354 1351 /** ··· 1358 1357 */ 1359 1358 static int onenand_check_maf(int manuf) 1360 1359 { 1360 + int size = ARRAY_SIZE(onenand_manuf_ids); 1361 + char *name; 1361 1362 int i; 1362 1363 1363 - for (i = 0; onenand_manuf_ids[i].id; i++) { 1364 + for (i = 0; i < size; i++) 1364 1365 if (manuf == onenand_manuf_ids[i].id) 1365 1366 break; 1366 - } 1367 1367 1368 - printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", 1369 - onenand_manuf_ids[i].name, manuf); 1368 + if (i < size) 1369 + name = onenand_manuf_ids[i].name; 1370 + else 1371 + name = "Unknown"; 1370 1372 1371 - return (i != ONENAND_MFR_UNKNOWN); 1373 + printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf); 1374 + 1375 + return (i == size); 1372 1376 } 1373 1377 1374 1378 /** ··· 1519 1513 this->read_bufferram = onenand_sync_read_bufferram; 1520 1514 } 1521 1515 1516 + /* Allocate buffers, if necessary */ 1517 + if (!this->page_buf) { 1518 + size_t len; 1519 + len = mtd->oobblock + mtd->oobsize; 1520 + this->page_buf = kmalloc(len, GFP_KERNEL); 1521 + if (!this->page_buf) { 1522 + printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n"); 1523 + return -ENOMEM; 1524 + } 1525 + this->options |= ONENAND_PAGEBUF_ALLOC; 1526 + } 1527 + 1522 1528 this->state = FL_READY; 1523 1529 init_waitqueue_head(&this->wq); 1524 1530 spin_lock_init(&this->chip_lock); ··· 1592 1574 */ 1593 1575 void onenand_release(struct mtd_info *mtd) 1594 1576 { 1577 + struct onenand_chip *this = mtd->priv; 1578 + 1595 1579 #ifdef CONFIG_MTD_PARTITIONS 1596 1580 /* Deregister partitions */ 1597 1581 del_mtd_partitions (mtd); 1598 1582 #endif 1599 1583 /* Deregister the device */ 1600 1584 del_mtd_device (mtd); 1585 + 1586 + /* Free bad block table memory, if allocated */ 1587 + if (this->bbm) 1588 + kfree(this->bbm); 1589 + /* Buffer allocated by onenand_scan */ 1590 + if (this->options & ONENAND_PAGEBUF_ALLOC) 1591 + kfree(this->page_buf); 1601 1592 } 1602 1593 1603 1594 EXPORT_SYMBOL_GPL(onenand_scan);
+2 -2
drivers/mtd/onenand/onenand_bbt.c
··· 118 118 */ 119 119 static inline int onenand_memory_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd) 120 120 { 121 - unsigned char data_buf[MAX_ONENAND_PAGESIZE]; 121 + struct onenand_chip *this = mtd->priv; 122 122 123 123 bd->options &= ~NAND_BBT_SCANEMPTY; 124 - return create_bbt(mtd, data_buf, bd, -1); 124 + return create_bbt(mtd, this->page_buf, bd, -1); 125 125 } 126 126 127 127 /**
+8 -7
drivers/net/forcedeth.c
··· 10 10 * trademarks of NVIDIA Corporation in the United States and other 11 11 * countries. 12 12 * 13 - * Copyright (C) 2003,4 Manfred Spraul 13 + * Copyright (C) 2003,4,5 Manfred Spraul 14 14 * Copyright (C) 2004 Andrew de Quincey (wol support) 15 15 * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane 16 16 * IRQ rate fixes, bigendian fixes, cleanups, verification) ··· 100 100 * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check 101 101 * 0.46: 20 Oct 2005: Add irq optimization modes. 102 102 * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan. 103 + * 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single 103 104 * 104 105 * Known bugs: 105 106 * We suspect that on some hardware no TX done interrupts are generated. ··· 112 111 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 113 112 * superfluous timer interrupts from the nic. 114 113 */ 115 - #define FORCEDETH_VERSION "0.47" 114 + #define FORCEDETH_VERSION "0.48" 116 115 #define DRV_NAME "forcedeth" 117 116 118 117 #include <linux/module.h> ··· 872 871 } else { 873 872 skb = np->rx_skbuff[nr]; 874 873 } 875 - np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len, 876 - PCI_DMA_FROMDEVICE); 874 + np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, 875 + skb->end-skb->data, PCI_DMA_FROMDEVICE); 877 876 if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { 878 877 np->rx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]); 879 878 wmb(); ··· 1000 999 wmb(); 1001 1000 if (np->rx_skbuff[i]) { 1002 1001 pci_unmap_single(np->pci_dev, np->rx_dma[i], 1003 - np->rx_skbuff[i]->len, 1002 + np->rx_skbuff[i]->end-np->rx_skbuff[i]->data, 1004 1003 PCI_DMA_FROMDEVICE); 1005 1004 dev_kfree_skb(np->rx_skbuff[i]); 1006 1005 np->rx_skbuff[i] = NULL; ··· 1335 1334 * the performance. 1336 1335 */ 1337 1336 pci_unmap_single(np->pci_dev, np->rx_dma[i], 1338 - np->rx_skbuff[i]->len, 1337 + np->rx_skbuff[i]->end-np->rx_skbuff[i]->data, 1339 1338 PCI_DMA_FROMDEVICE); 1340 1339 1341 1340 { ··· 2456 2455 np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; 2457 2456 dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG; 2458 2457 #ifdef NETIF_F_TSO 2459 - dev->features |= NETIF_F_TSO; 2458 + /* disabled dev->features |= NETIF_F_TSO; */ 2460 2459 #endif 2461 2460 } 2462 2461
+4
drivers/net/phy/phy_device.c
··· 38 38 #include <asm/irq.h> 39 39 #include <asm/uaccess.h> 40 40 41 + MODULE_DESCRIPTION("PHY library"); 42 + MODULE_AUTHOR("Andy Fleming"); 43 + MODULE_LICENSE("GPL"); 44 + 41 45 static struct phy_driver genphy_driver; 42 46 extern int mdio_bus_init(void); 43 47 extern void mdio_bus_exit(void);
-3
drivers/net/ppp_generic.c
··· 524 524 if (copy_from_user(&uprog, arg, sizeof(uprog))) 525 525 return -EFAULT; 526 526 527 - if (uprog.len > BPF_MAXINSNS) 528 - return -EINVAL; 529 - 530 527 if (!uprog.len) { 531 528 *p = NULL; 532 529 return 0;
+5 -5
drivers/net/s2io.c
··· 3078 3078 3079 3079 static int wait_for_msix_trans(nic_t *nic, int i) 3080 3080 { 3081 - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3081 + XENA_dev_config_t __iomem *bar0 = nic->bar0; 3082 3082 u64 val64; 3083 3083 int ret = 0, cnt = 0; 3084 3084 ··· 3099 3099 3100 3100 void restore_xmsi_data(nic_t *nic) 3101 3101 { 3102 - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3102 + XENA_dev_config_t __iomem *bar0 = nic->bar0; 3103 3103 u64 val64; 3104 3104 int i; 3105 3105 ··· 3117 3117 3118 3118 static void store_xmsi_data(nic_t *nic) 3119 3119 { 3120 - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3120 + XENA_dev_config_t __iomem *bar0 = nic->bar0; 3121 3121 u64 val64, addr, data; 3122 3122 int i; 3123 3123 ··· 3140 3140 3141 3141 int s2io_enable_msi(nic_t *nic) 3142 3142 { 3143 - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3143 + XENA_dev_config_t __iomem *bar0 = nic->bar0; 3144 3144 u16 msi_ctrl, msg_val; 3145 3145 struct config_param *config = &nic->config; 3146 3146 struct net_device *dev = nic->dev; ··· 3190 3190 3191 3191 int s2io_enable_msi_x(nic_t *nic) 3192 3192 { 3193 - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3193 + XENA_dev_config_t __iomem *bar0 = nic->bar0; 3194 3194 u64 tx_mat, rx_mat; 3195 3195 u16 msi_control; /* Temp variable */ 3196 3196 int ret, i, j, msix_indx = 1;
+2 -2
drivers/net/sungem.c
··· 2907 2907 return 0; 2908 2908 } 2909 2909 2910 - static void __devexit gem_remove_one(struct pci_dev *pdev) 2910 + static void gem_remove_one(struct pci_dev *pdev) 2911 2911 { 2912 2912 struct net_device *dev = pci_get_drvdata(pdev); 2913 2913 ··· 3181 3181 .name = GEM_MODULE_NAME, 3182 3182 .id_table = gem_pci_tbl, 3183 3183 .probe = gem_init_one, 3184 - .remove = __devexit_p(gem_remove_one), 3184 + .remove = gem_remove_one, 3185 3185 #ifdef CONFIG_PM 3186 3186 .suspend = gem_suspend, 3187 3187 .resume = gem_resume,
+162 -93
drivers/net/tg3.c
··· 68 68 69 69 #define DRV_MODULE_NAME "tg3" 70 70 #define PFX DRV_MODULE_NAME ": " 71 - #define DRV_MODULE_VERSION "3.44" 72 - #define DRV_MODULE_RELDATE "Dec 6, 2005" 71 + #define DRV_MODULE_VERSION "3.47" 72 + #define DRV_MODULE_RELDATE "Dec 28, 2005" 73 73 74 74 #define TG3_DEF_MAC_MODE 0 75 75 #define TG3_DEF_RX_MODE 0 ··· 341 341 { "interrupt test (offline)" }, 342 342 }; 343 343 344 + static void tg3_write32(struct tg3 *tp, u32 off, u32 val) 345 + { 346 + writel(val, tp->regs + off); 347 + } 348 + 349 + static u32 tg3_read32(struct tg3 *tp, u32 off) 350 + { 351 + return (readl(tp->regs + off)); 352 + } 353 + 344 354 static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) 345 355 { 346 356 unsigned long flags; ··· 421 411 return val; 422 412 } 423 413 424 - static void _tw32_flush(struct tg3 *tp, u32 off, u32 val) 414 + /* usec_wait specifies the wait time in usec when writing to certain registers 415 + * where it is unsafe to read back the register without some delay. 416 + * GRC_LOCAL_CTRL is one example if the GPIOs are toggled to switch power. 417 + * TG3PCI_CLOCK_CTRL is another example if the clock frequencies are changed. 418 + */ 419 + static void _tw32_flush(struct tg3 *tp, u32 off, u32 val, u32 usec_wait) 425 420 { 426 - tp->write32(tp, off, val); 427 - if (!(tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) && 428 - !(tp->tg3_flags & TG3_FLAG_5701_REG_WRITE_BUG) && 429 - !(tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND)) 430 - tp->read32(tp, off); /* flush */ 421 + if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) || 422 + (tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND)) 423 + /* Non-posted methods */ 424 + tp->write32(tp, off, val); 425 + else { 426 + /* Posted method */ 427 + tg3_write32(tp, off, val); 428 + if (usec_wait) 429 + udelay(usec_wait); 430 + tp->read32(tp, off); 431 + } 432 + /* Wait again after the read for the posted method to guarantee that 433 + * the wait time is met. 434 + */ 435 + if (usec_wait) 436 + udelay(usec_wait); 431 437 } 432 438 433 439 static inline void tw32_mailbox_flush(struct tg3 *tp, u32 off, u32 val) ··· 464 438 readl(mbox); 465 439 } 466 440 467 - static void tg3_write32(struct tg3 *tp, u32 off, u32 val) 468 - { 469 - writel(val, tp->regs + off); 470 - } 471 - 472 - static u32 tg3_read32(struct tg3 *tp, u32 off) 473 - { 474 - return (readl(tp->regs + off)); 475 - } 476 - 477 441 #define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val) 478 442 #define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val)) 479 443 #define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val) ··· 471 455 #define tr32_mailbox(reg) tp->read32_mbox(tp, reg) 472 456 473 457 #define tw32(reg,val) tp->write32(tp, reg, val) 474 - #define tw32_f(reg,val) _tw32_flush(tp,(reg),(val)) 458 + #define tw32_f(reg,val) _tw32_flush(tp,(reg),(val), 0) 459 + #define tw32_wait_f(reg,val,us) _tw32_flush(tp,(reg),(val), (us)) 475 460 #define tr32(reg) tp->read32(tp, reg) 476 461 477 462 static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val) ··· 612 595 613 596 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { 614 597 if (orig_clock_ctrl & CLOCK_CTRL_625_CORE) { 615 - tw32_f(TG3PCI_CLOCK_CTRL, 616 - clock_ctrl | CLOCK_CTRL_625_CORE); 617 - udelay(40); 598 + tw32_wait_f(TG3PCI_CLOCK_CTRL, 599 + clock_ctrl | CLOCK_CTRL_625_CORE, 40); 618 600 } 619 601 } else if ((orig_clock_ctrl & CLOCK_CTRL_44MHZ_CORE) != 0) { 620 - tw32_f(TG3PCI_CLOCK_CTRL, 621 - clock_ctrl | 622 - (CLOCK_CTRL_44MHZ_CORE | CLOCK_CTRL_ALTCLK)); 623 - udelay(40); 624 - tw32_f(TG3PCI_CLOCK_CTRL, 625 - clock_ctrl | (CLOCK_CTRL_ALTCLK)); 626 - udelay(40); 602 + tw32_wait_f(TG3PCI_CLOCK_CTRL, 603 + clock_ctrl | 604 + (CLOCK_CTRL_44MHZ_CORE | CLOCK_CTRL_ALTCLK), 605 + 40); 606 + tw32_wait_f(TG3PCI_CLOCK_CTRL, 607 + clock_ctrl | (CLOCK_CTRL_ALTCLK), 608 + 40); 627 609 } 628 - tw32_f(TG3PCI_CLOCK_CTRL, clock_ctrl); 629 - udelay(40); 610 + tw32_wait_f(TG3PCI_CLOCK_CTRL, clock_ctrl, 40); 630 611 } 631 612 632 613 #define PHY_BUSY_LOOPS 5000 ··· 1032 1017 if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0) 1033 1018 return; 1034 1019 1035 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { 1036 - tp_peer = pci_get_drvdata(tp->pdev_peer); 1037 - if (!tp_peer) 1020 + if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || 1021 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) { 1022 + struct net_device *dev_peer; 1023 + 1024 + dev_peer = pci_get_drvdata(tp->pdev_peer); 1025 + if (!dev_peer) 1038 1026 BUG(); 1027 + tp_peer = netdev_priv(dev_peer); 1039 1028 } 1040 1029 1041 - 1042 1030 if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || 1043 - (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0) { 1031 + (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 || 1032 + (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || 1033 + (tp_peer->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) { 1044 1034 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || 1045 1035 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) { 1046 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1047 - (GRC_LCLCTRL_GPIO_OE0 | 1048 - GRC_LCLCTRL_GPIO_OE1 | 1049 - GRC_LCLCTRL_GPIO_OE2 | 1050 - GRC_LCLCTRL_GPIO_OUTPUT0 | 1051 - GRC_LCLCTRL_GPIO_OUTPUT1)); 1052 - udelay(100); 1036 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1037 + (GRC_LCLCTRL_GPIO_OE0 | 1038 + GRC_LCLCTRL_GPIO_OE1 | 1039 + GRC_LCLCTRL_GPIO_OE2 | 1040 + GRC_LCLCTRL_GPIO_OUTPUT0 | 1041 + GRC_LCLCTRL_GPIO_OUTPUT1), 1042 + 100); 1053 1043 } else { 1054 1044 u32 no_gpio2; 1055 - u32 grc_local_ctrl; 1045 + u32 grc_local_ctrl = 0; 1056 1046 1057 1047 if (tp_peer != tp && 1058 1048 (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0) 1059 1049 return; 1060 1050 1051 + /* Workaround to prevent overdrawing Amps. */ 1052 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == 1053 + ASIC_REV_5714) { 1054 + grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE3; 1055 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1056 + grc_local_ctrl, 100); 1057 + } 1058 + 1061 1059 /* On 5753 and variants, GPIO2 cannot be used. */ 1062 1060 no_gpio2 = tp->nic_sram_data_cfg & 1063 1061 NIC_SRAM_DATA_CFG_NO_GPIO2; 1064 1062 1065 - grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | 1063 + grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE0 | 1066 1064 GRC_LCLCTRL_GPIO_OE1 | 1067 1065 GRC_LCLCTRL_GPIO_OE2 | 1068 1066 GRC_LCLCTRL_GPIO_OUTPUT1 | ··· 1084 1056 grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 | 1085 1057 GRC_LCLCTRL_GPIO_OUTPUT2); 1086 1058 } 1087 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1088 - grc_local_ctrl); 1089 - udelay(100); 1059 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1060 + grc_local_ctrl, 100); 1090 1061 1091 1062 grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0; 1092 1063 1093 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1094 - grc_local_ctrl); 1095 - udelay(100); 1064 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1065 + grc_local_ctrl, 100); 1096 1066 1097 1067 if (!no_gpio2) { 1098 1068 grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2; 1099 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1100 - grc_local_ctrl); 1101 - udelay(100); 1069 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1070 + grc_local_ctrl, 100); 1102 1071 } 1103 1072 } 1104 1073 } else { ··· 1105 1080 (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0) 1106 1081 return; 1107 1082 1108 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1109 - (GRC_LCLCTRL_GPIO_OE1 | 1110 - GRC_LCLCTRL_GPIO_OUTPUT1)); 1111 - udelay(100); 1083 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1084 + (GRC_LCLCTRL_GPIO_OE1 | 1085 + GRC_LCLCTRL_GPIO_OUTPUT1), 100); 1112 1086 1113 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1114 - (GRC_LCLCTRL_GPIO_OE1)); 1115 - udelay(100); 1087 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1088 + GRC_LCLCTRL_GPIO_OE1, 100); 1116 1089 1117 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1118 - (GRC_LCLCTRL_GPIO_OE1 | 1119 - GRC_LCLCTRL_GPIO_OUTPUT1)); 1120 - udelay(100); 1090 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1091 + (GRC_LCLCTRL_GPIO_OE1 | 1092 + GRC_LCLCTRL_GPIO_OUTPUT1), 100); 1121 1093 } 1122 1094 } 1123 1095 } ··· 1127 1105 1128 1106 static void tg3_write_sig_post_reset(struct tg3 *, int); 1129 1107 static int tg3_halt_cpu(struct tg3 *, u32); 1108 + static int tg3_nvram_lock(struct tg3 *); 1109 + static void tg3_nvram_unlock(struct tg3 *); 1130 1110 1131 1111 static int tg3_set_power_state(struct tg3 *tp, int state) 1132 1112 { ··· 1157 1133 udelay(100); /* Delay after power state change */ 1158 1134 1159 1135 /* Switch out of Vaux if it is not a LOM */ 1160 - if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT)) { 1161 - tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); 1162 - udelay(100); 1163 - } 1136 + if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT)) 1137 + tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl, 100); 1164 1138 1165 1139 return 0; 1166 1140 ··· 1201 1179 tg3_setup_phy(tp, 0); 1202 1180 } 1203 1181 1182 + if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { 1183 + int i; 1184 + u32 val; 1185 + 1186 + for (i = 0; i < 200; i++) { 1187 + tg3_read_mem(tp, NIC_SRAM_FW_ASF_STATUS_MBOX, &val); 1188 + if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1) 1189 + break; 1190 + msleep(1); 1191 + } 1192 + } 1193 + tg3_write_mem(tp, NIC_SRAM_WOL_MBOX, WOL_SIGNATURE | 1194 + WOL_DRV_STATE_SHUTDOWN | 1195 + WOL_DRV_WOL | WOL_SET_MAGIC_PKT); 1196 + 1204 1197 pci_read_config_word(tp->pdev, pm + PCI_PM_PMC, &power_caps); 1205 1198 1206 1199 if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) { ··· 1257 1220 base_val |= (CLOCK_CTRL_RXCLK_DISABLE | 1258 1221 CLOCK_CTRL_TXCLK_DISABLE); 1259 1222 1260 - tw32_f(TG3PCI_CLOCK_CTRL, base_val | 1261 - CLOCK_CTRL_ALTCLK | 1262 - CLOCK_CTRL_PWRDOWN_PLL133); 1263 - udelay(40); 1223 + tw32_wait_f(TG3PCI_CLOCK_CTRL, base_val | CLOCK_CTRL_ALTCLK | 1224 + CLOCK_CTRL_PWRDOWN_PLL133, 40); 1264 1225 } else if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { 1265 1226 /* do nothing */ 1266 1227 } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) && ··· 1279 1244 newbits2 = newbits1 | CLOCK_CTRL_44MHZ_CORE; 1280 1245 } 1281 1246 1282 - tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits1); 1283 - udelay(40); 1247 + tw32_wait_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits1, 1248 + 40); 1284 1249 1285 - tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2); 1286 - udelay(40); 1250 + tw32_wait_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2, 1251 + 40); 1287 1252 1288 1253 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { 1289 1254 u32 newbits3; ··· 1297 1262 newbits3 = CLOCK_CTRL_44MHZ_CORE; 1298 1263 } 1299 1264 1300 - tw32_f(TG3PCI_CLOCK_CTRL, 1301 - tp->pci_clock_ctrl | newbits3); 1302 - udelay(40); 1265 + tw32_wait_f(TG3PCI_CLOCK_CTRL, 1266 + tp->pci_clock_ctrl | newbits3, 40); 1267 + } 1268 + } 1269 + 1270 + if (!(tp->tg3_flags & TG3_FLAG_WOL_ENABLE) && 1271 + !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { 1272 + /* Turn off the PHY */ 1273 + if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { 1274 + tg3_writephy(tp, MII_TG3_EXT_CTRL, 1275 + MII_TG3_EXT_CTRL_FORCE_LED_OFF); 1276 + tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2); 1277 + if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700) 1278 + tg3_writephy(tp, MII_BMCR, BMCR_PDOWN); 1303 1279 } 1304 1280 } 1305 1281 ··· 1323 1277 1324 1278 val &= ~((1 << 16) | (1 << 4) | (1 << 2) | (1 << 1) | 1); 1325 1279 tw32(0x7d00, val); 1326 - if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) 1280 + if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { 1281 + tg3_nvram_lock(tp); 1327 1282 tg3_halt_cpu(tp, RX_CPU_BASE); 1283 + tw32_f(NVRAM_SWARB, SWARB_REQ_CLR0); 1284 + tg3_nvram_unlock(tp); 1285 + } 1328 1286 } 1329 1287 1330 1288 /* Finally, set the new power state. */ ··· 1862 1812 } 1863 1813 } 1864 1814 relink: 1865 - if (current_link_up == 0) { 1815 + if (current_link_up == 0 || tp->link_config.phy_is_low_power) { 1866 1816 u32 tmp; 1867 1817 1868 1818 tg3_phy_copper_begin(tp); ··· 7151 7101 GET_REG32_LOOP(BUFMGR_MODE, 0x58); 7152 7102 GET_REG32_LOOP(RDMAC_MODE, 0x08); 7153 7103 GET_REG32_LOOP(WDMAC_MODE, 0x08); 7154 - GET_REG32_LOOP(RX_CPU_BASE, 0x280); 7155 - GET_REG32_LOOP(TX_CPU_BASE, 0x280); 7104 + GET_REG32_1(RX_CPU_MODE); 7105 + GET_REG32_1(RX_CPU_STATE); 7106 + GET_REG32_1(RX_CPU_PGMCTR); 7107 + GET_REG32_1(RX_CPU_HWBKPT); 7108 + GET_REG32_1(TX_CPU_MODE); 7109 + GET_REG32_1(TX_CPU_STATE); 7110 + GET_REG32_1(TX_CPU_PGMCTR); 7156 7111 GET_REG32_LOOP(GRCMBOX_INTERRUPT_0, 0x110); 7157 7112 GET_REG32_LOOP(FTQ_RESET, 0x120); 7158 7113 GET_REG32_LOOP(MSGINT_MODE, 0x0c); ··· 7980 7925 u32 offset; 7981 7926 u32 len; 7982 7927 } mem_tbl_570x[] = { 7983 - { 0x00000000, 0x01000}, 7928 + { 0x00000000, 0x00b50}, 7984 7929 { 0x00002000, 0x1c000}, 7985 7930 { 0xffffffff, 0x00000} 7986 7931 }, mem_tbl_5705[] = { 7987 7932 { 0x00000100, 0x0000c}, 7988 7933 { 0x00000200, 0x00008}, 7989 - { 0x00000b50, 0x00400}, 7990 7934 { 0x00004000, 0x00800}, 7991 7935 { 0x00006000, 0x01000}, 7992 7936 { 0x00008000, 0x02000}, ··· 8587 8533 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) { 8588 8534 tp->tg3_flags |= TG3_FLAG_NVRAM; 8589 8535 8536 + tg3_nvram_lock(tp); 8590 8537 tg3_enable_nvram_access(tp); 8591 8538 8592 8539 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752) ··· 8598 8543 tg3_get_nvram_size(tp); 8599 8544 8600 8545 tg3_disable_nvram_access(tp); 8546 + tg3_nvram_unlock(tp); 8601 8547 8602 8548 } else { 8603 8549 tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED); ··· 8696 8640 if (ret == 0) 8697 8641 *val = swab32(tr32(NVRAM_RDDATA)); 8698 8642 8699 - tg3_nvram_unlock(tp); 8700 - 8701 8643 tg3_disable_nvram_access(tp); 8644 + 8645 + tg3_nvram_unlock(tp); 8702 8646 8703 8647 return ret; 8704 8648 } ··· 8784 8728 8785 8729 offset = offset + (pagesize - page_off); 8786 8730 8731 + /* Nvram lock released by tg3_nvram_read() above, 8732 + * so need to get it again. 8733 + */ 8734 + tg3_nvram_lock(tp); 8787 8735 tg3_enable_nvram_access(tp); 8788 8736 8789 8737 /* ··· 10486 10426 return str; 10487 10427 } 10488 10428 10489 - static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) 10429 + static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp) 10490 10430 { 10491 10431 struct pci_dev *peer; 10492 10432 unsigned int func, devnr = tp->pdev->devfn & ~7; ··· 10497 10437 break; 10498 10438 pci_dev_put(peer); 10499 10439 } 10500 - if (!peer || peer == tp->pdev) 10501 - BUG(); 10440 + /* 5704 can be configured in single-port mode, set peer to 10441 + * tp->pdev in that case. 10442 + */ 10443 + if (!peer) { 10444 + peer = tp->pdev; 10445 + return peer; 10446 + } 10502 10447 10503 10448 /* 10504 10449 * We don't need to keep the refcount elevated; there's no way ··· 10739 10674 tp->rx_pending = 63; 10740 10675 } 10741 10676 10742 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) 10743 - tp->pdev_peer = tg3_find_5704_peer(tp); 10677 + if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || 10678 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) 10679 + tp->pdev_peer = tg3_find_peer(tp); 10744 10680 10745 10681 err = tg3_get_device_address(tp); 10746 10682 if (err) { ··· 10886 10820 10887 10821 tg3_full_lock(tp, 0); 10888 10822 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); 10823 + tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; 10889 10824 tg3_full_unlock(tp); 10890 10825 10891 10826 err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); 10892 10827 if (err) { 10893 10828 tg3_full_lock(tp, 0); 10894 10829 10830 + tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 10895 10831 tg3_init_hw(tp); 10896 10832 10897 10833 tp->timer.expires = jiffies + tp->timer_offset; ··· 10927 10859 10928 10860 tg3_full_lock(tp, 0); 10929 10861 10862 + tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; 10930 10863 tg3_init_hw(tp); 10931 10864 10932 10865 tp->timer.expires = jiffies + tp->timer_offset;
+14
drivers/net/tg3.h
··· 1124 1124 /* 0x280 --> 0x400 unused */ 1125 1125 1126 1126 #define RX_CPU_BASE 0x00005000 1127 + #define RX_CPU_MODE 0x00005000 1128 + #define RX_CPU_STATE 0x00005004 1129 + #define RX_CPU_PGMCTR 0x0000501c 1130 + #define RX_CPU_HWBKPT 0x00005034 1127 1131 #define TX_CPU_BASE 0x00005400 1132 + #define TX_CPU_MODE 0x00005400 1133 + #define TX_CPU_STATE 0x00005404 1134 + #define TX_CPU_PGMCTR 0x0000541c 1128 1135 1129 1136 /* Mailboxes */ 1130 1137 #define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */ ··· 1536 1529 #define NIC_SRAM_MAC_ADDR_HIGH_MBOX 0x00000c14 1537 1530 #define NIC_SRAM_MAC_ADDR_LOW_MBOX 0x00000c18 1538 1531 1532 + #define NIC_SRAM_WOL_MBOX 0x00000d30 1533 + #define WOL_SIGNATURE 0x474c0000 1534 + #define WOL_DRV_STATE_SHUTDOWN 0x00000001 1535 + #define WOL_DRV_WOL 0x00000002 1536 + #define WOL_SET_MAGIC_PKT 0x00000004 1537 + 1539 1538 #define NIC_SRAM_DATA_CFG_2 0x00000d38 1540 1539 1541 1540 #define SHASTA_EXT_LED_MODE_MASK 0x00018000 ··· 1578 1565 #define MII_TG3_EXT_CTRL 0x10 /* Extended control register */ 1579 1566 #define MII_TG3_EXT_CTRL_FIFO_ELASTIC 0x0001 1580 1567 #define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002 1568 + #define MII_TG3_EXT_CTRL_FORCE_LED_OFF 0x0008 1581 1569 #define MII_TG3_EXT_CTRL_TBI 0x8000 1582 1570 1583 1571 #define MII_TG3_EXT_STAT 0x11 /* Extended status register */
+5 -1
drivers/net/wireless/orinoco_nortel.c
··· 1 1 /* orinoco_nortel.c 2 2 * 3 3 * Driver for Prism II devices which would usually be driven by orinoco_cs, 4 + * but are connected to the PCI bus by a PCI-to-PCMCIA adapter used in 5 + * Nortel emobility, Symbol LA-4113 and Symbol LA-4123. 4 6 * but are connected to the PCI bus by a Nortel PCI-PCMCIA-Adapter. 5 7 * 6 8 * Copyright (C) 2002 Tobias Hoffmann ··· 167 165 goto fail_resources; 168 166 } 169 167 170 - iomem = pci_iomap(pdev, 3, 0); 168 + iomem = pci_iomap(pdev, 2, 0); 171 169 if (!iomem) { 172 170 err = -ENOMEM; 173 171 goto fail_map_io; ··· 267 265 static struct pci_device_id nortel_pci_id_table[] = { 268 266 /* Nortel emobility PCI */ 269 267 {0x126c, 0x8030, PCI_ANY_ID, PCI_ANY_ID,}, 268 + /* Symbol LA-4123 PCI */ 269 + {0x1562, 0x0001, PCI_ANY_ID, PCI_ANY_ID,}, 270 270 {0,}, 271 271 }; 272 272
+3 -4
drivers/pci/Makefile
··· 6 6 pci-driver.o search.o pci-sysfs.o rom.o setup-res.o 7 7 obj-$(CONFIG_PROC_FS) += proc.o 8 8 9 + # Build PCI Express stuff if needed 10 + obj-$(CONFIG_PCIEPORTBUS) += pcie/ 11 + 9 12 obj-$(CONFIG_HOTPLUG) += hotplug.o 10 13 11 14 # Build the PCI Hotplug drivers if we were asked to ··· 43 40 ifeq ($(CONFIG_PCI_DEBUG),y) 44 41 EXTRA_CFLAGS += -DDEBUG 45 42 endif 46 - 47 - # Build PCI Express stuff if needed 48 - obj-$(CONFIG_PCIEPORTBUS) += pcie/ 49 -
+2 -1
drivers/s390/net/qeth_eddp.c
··· 62 62 for (i = 0; i < ctx->num_pages; ++i) 63 63 free_page((unsigned long)ctx->pages[i]); 64 64 kfree(ctx->pages); 65 - kfree(ctx->elements); 65 + if (ctx->elements != NULL) 66 + kfree(ctx->elements); 66 67 kfree(ctx); 67 68 } 68 69
+29 -32
drivers/s390/net/qeth_main.c
··· 1 1 /* 2 2 * 3 - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) 3 + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $) 4 4 * 5 5 * Linux on zSeries OSA Express and HiperSockets support 6 6 * ··· 12 12 * Frank Pavlic (fpavlic@de.ibm.com) and 13 13 * Thomas Spatzier <tspat@de.ibm.com> 14 14 * 15 - * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $ 15 + * $Revision: 1.251 $ $Date: 2005/05/04 20:19:18 $ 16 16 * 17 17 * This program is free software; you can redistribute it and/or modify 18 18 * it under the terms of the GNU General Public License as published by ··· 72 72 #include "qeth_eddp.h" 73 73 #include "qeth_tso.h" 74 74 75 - #define VERSION_QETH_C "$Revision: 1.242 $" 75 + #define VERSION_QETH_C "$Revision: 1.251 $" 76 76 static const char *version = "qeth S/390 OSA-Express driver"; 77 77 78 78 /** ··· 518 518 519 519 QETH_DBF_TEXT(setup, 3, "setoffl"); 520 520 QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); 521 - 521 + 522 + netif_carrier_off(card->dev); 522 523 recover_flag = card->state; 523 524 if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ 524 525 PRINT_WARN("Stopping card %s interrupted by user!\n", ··· 1021 1020 qeth_schedule_recovery(struct qeth_card *card) 1022 1021 { 1023 1022 QETH_DBF_TEXT(trace,2,"startrec"); 1024 - 1025 1023 if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) 1026 1024 schedule_work(&card->kernel_thread_starter); 1027 1025 } ··· 1710 1710 "IP address reset.\n", 1711 1711 QETH_CARD_IFNAME(card), 1712 1712 card->info.chpid); 1713 - netif_carrier_on(card->dev); 1714 1713 qeth_schedule_recovery(card); 1715 1714 return NULL; 1716 1715 case IPA_CMD_MODCCID: ··· 1958 1959 { 1959 1960 u16 s1, s2; 1960 1961 1961 - QETH_DBF_TEXT(trace,4,"osndipa"); 1962 + QETH_DBF_TEXT(trace,4,"osndipa"); 1962 1963 1963 1964 qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); 1964 1965 s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); ··· 2202 2203 } 2203 2204 2204 2205 static inline int 2205 - qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, 2206 - unsigned int qdio_error, 2207 - unsigned int siga_error) 2206 + qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, 2207 + unsigned int siga_error, const char *dbftext) 2208 2208 { 2209 - int rc = 0; 2210 - 2211 2209 if (qdio_error || siga_error) { 2212 - QETH_DBF_TEXT(trace, 2, "qdinerr"); 2213 - QETH_DBF_TEXT(qerr, 2, "qdinerr"); 2210 + QETH_DBF_TEXT(trace, 2, dbftext); 2211 + QETH_DBF_TEXT(qerr, 2, dbftext); 2214 2212 QETH_DBF_TEXT_(qerr, 2, " F15=%02X", 2215 - buf->buffer->element[15].flags & 0xff); 2213 + buf->element[15].flags & 0xff); 2216 2214 QETH_DBF_TEXT_(qerr, 2, " F14=%02X", 2217 - buf->buffer->element[14].flags & 0xff); 2215 + buf->element[14].flags & 0xff); 2218 2216 QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); 2219 2217 QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); 2220 - rc = 1; 2218 + return 1; 2221 2219 } 2222 - return rc; 2220 + return 0; 2223 2221 } 2224 2222 2225 2223 static inline struct sk_buff * ··· 2765 2769 for (i = first_element; i < (first_element + count); ++i) { 2766 2770 index = i % QDIO_MAX_BUFFERS_PER_Q; 2767 2771 buffer = &card->qdio.in_q->bufs[index]; 2768 - if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) && 2769 - qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) 2772 + if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && 2773 + qeth_check_qdio_errors(buffer->buffer, 2774 + qdio_err, siga_err,"qinerr"))) 2770 2775 qeth_process_inbound_buffer(card, buffer, index); 2771 2776 /* clear buffer and give back to hardware */ 2772 2777 qeth_put_buffer_pool_entry(card, buffer->pool_entry); ··· 2782 2785 static inline int 2783 2786 qeth_handle_send_error(struct qeth_card *card, 2784 2787 struct qeth_qdio_out_buffer *buffer, 2785 - int qdio_err, int siga_err) 2788 + unsigned int qdio_err, unsigned int siga_err) 2786 2789 { 2787 2790 int sbalf15 = buffer->buffer->element[15].flags & 0xff; 2788 2791 int cc = siga_err & 3; 2789 2792 2790 2793 QETH_DBF_TEXT(trace, 6, "hdsnderr"); 2794 + qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err, "qouterr"); 2791 2795 switch (cc) { 2792 2796 case 0: 2793 2797 if (qdio_err){ ··· 3045 3047 for(i = first_element; i < (first_element + count); ++i){ 3046 3048 buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; 3047 3049 /*we only handle the KICK_IT error by doing a recovery */ 3048 - if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) 3050 + if (qeth_handle_send_error(card, buffer, 3051 + qdio_error, siga_error) 3049 3052 == QETH_SEND_ERROR_KICK_IT){ 3050 3053 netif_stop_queue(card->dev); 3051 3054 qeth_schedule_recovery(card); ··· 3288 3289 card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; 3289 3290 INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); 3290 3291 INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); 3291 - /* outbound */ 3292 3292 } 3293 3293 3294 3294 static int ··· 3729 3731 break; 3730 3732 } 3731 3733 } 3734 + if (rc && !(VLAN_DEV_INFO(dev)->real_dev->priv == (void *)card)) 3735 + return 0; 3736 + 3732 3737 #endif 3733 3738 return rc; 3734 3739 } ··· 3808 3807 card->data.state = CH_STATE_UP; 3809 3808 card->state = CARD_STATE_UP; 3810 3809 3811 - if (!card->lan_online){ 3812 - if (netif_carrier_ok(dev)) 3813 - netif_carrier_off(dev); 3814 - } 3810 + if (!card->lan_online && netif_carrier_ok(dev)) 3811 + netif_carrier_off(dev); 3815 3812 return 0; 3816 3813 } 3817 3814 ··· 5869 5870 struct inet6_dev *in6_dev; 5870 5871 5871 5872 QETH_DBF_TEXT(trace,4,"chkmcv6"); 5872 - if ((card->options.layer2 == 0) && 5873 - (!qeth_is_supported(card, IPA_IPV6)) ) 5873 + if (!qeth_is_supported(card, IPA_IPV6)) 5874 5874 return ; 5875 - 5876 5875 in6_dev = in6_dev_get(card->dev); 5877 5876 if (in6_dev == NULL) 5878 5877 return; ··· 7933 7936 QETH_DBF_TEXT_(setup, 2, "6err%d", rc); 7934 7937 goto out_remove; 7935 7938 } 7936 - /*maybe it was set offline without ifconfig down 7937 - * we can also use this state for recovery purposes*/ 7939 + netif_carrier_on(card->dev); 7940 + 7938 7941 qeth_set_allowed_threads(card, 0xffffffff, 0); 7939 7942 if (recover_flag == CARD_STATE_RECOVER) 7940 7943 qeth_start_again(card, recovery_mode);
+1 -1
drivers/s390/net/qeth_mpc.c
··· 11 11 #include <asm/cio.h> 12 12 #include "qeth_mpc.h" 13 13 14 - const char *VERSION_QETH_MPC_C = "$Revision: 1.12 $"; 14 + const char *VERSION_QETH_MPC_C = "$Revision: 1.13 $"; 15 15 16 16 unsigned char IDX_ACTIVATE_READ[]={ 17 17 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,
+2 -2
drivers/s390/net/qeth_mpc.h
··· 14 14 15 15 #include <asm/qeth.h> 16 16 17 - #define VERSION_QETH_MPC_H "$Revision: 1.44 $" 17 + #define VERSION_QETH_MPC_H "$Revision: 1.46 $" 18 18 19 19 extern const char *VERSION_QETH_MPC_C; 20 20 21 21 #define IPA_PDU_HEADER_SIZE 0x40 22 22 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e) 23 23 #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26) 24 - #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x2a) 24 + #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x29) 25 25 #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a) 26 26 27 27 extern unsigned char IPA_PDU_HEADER[];
+29 -221
drivers/s390/net/qeth_proc.c
··· 1 1 /* 2 2 * 3 - * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $) 3 + * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $) 4 4 * 5 5 * Linux on zSeries OSA Express and HiperSockets support 6 6 * This file contains code related to procfs. ··· 21 21 #include "qeth_mpc.h" 22 22 #include "qeth_fs.h" 23 23 24 - const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; 24 + const char *VERSION_QETH_PROC_C = "$Revision: 1.16 $"; 25 25 26 26 /***** /proc/qeth *****/ 27 27 #define QETH_PROCFILE_NAME "qeth" ··· 30 30 static int 31 31 qeth_procfile_seq_match(struct device *dev, void *data) 32 32 { 33 - return 1; 33 + return(dev ? 1 : 0); 34 34 } 35 35 36 36 static void * 37 37 qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) 38 38 { 39 - struct device *dev; 40 - loff_t nr; 41 - 39 + struct device *dev = NULL; 40 + loff_t nr = 0; 41 + 42 42 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 43 - 44 - nr = *offset; 45 - if (nr == 0) 43 + if (*offset == 0) 46 44 return SEQ_START_TOKEN; 47 - 48 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, 49 - NULL, qeth_procfile_seq_match); 50 - 51 - /* get card at pos *offset */ 52 - nr = *offset; 53 - while (nr-- > 1 && dev) 45 + while (1) { 54 46 dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 55 47 NULL, qeth_procfile_seq_match); 56 - return (void *) dev; 48 + if (++nr == *offset) 49 + break; 50 + put_device(dev); 51 + } 52 + return dev; 57 53 } 58 54 59 55 static void ··· 62 66 qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 63 67 { 64 68 struct device *prev, *next; 65 - 66 - if (it == SEQ_START_TOKEN) { 67 - next = driver_find_device(&qeth_ccwgroup_driver.driver, 68 - NULL, NULL, qeth_procfile_seq_match); 69 - if (next) 70 - (*offset)++; 71 - return (void *) next; 72 - } 73 - prev = (struct device *) it; 69 + 70 + if (it == SEQ_START_TOKEN) 71 + prev = NULL; 72 + else 73 + prev = (struct device *) it; 74 74 next = driver_find_device(&qeth_ccwgroup_driver.driver, 75 75 prev, NULL, qeth_procfile_seq_match); 76 - if (next) 77 - (*offset)++; 76 + (*offset)++; 78 77 return (void *) next; 79 78 } 80 79 ··· 78 87 { 79 88 int routing_type = 0; 80 89 81 - if (ipv == 4){ 90 + if (ipv == 4) { 82 91 routing_type = card->options.route4.type; 83 92 } else { 84 93 #ifdef CONFIG_QETH_IPV6 ··· 145 154 card->qdio.in_buf_pool.buf_count); 146 155 else 147 156 seq_printf(s, " +++ LAN OFFLINE +++\n"); 157 + put_device(device); 148 158 } 149 159 return 0; 150 160 } ··· 176 184 static struct proc_dir_entry *qeth_perf_procfile; 177 185 178 186 #ifdef CONFIG_QETH_PERF_STATS 179 - 180 - static void * 181 - qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) 182 - { 183 - struct device *dev = NULL; 184 - int nr; 185 - 186 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 187 - /* get card at pos *offset */ 188 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, 189 - qeth_procfile_seq_match); 190 - 191 - /* get card at pos *offset */ 192 - nr = *offset; 193 - while (nr-- > 1 && dev) 194 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 195 - NULL, qeth_procfile_seq_match); 196 - return (void *) dev; 197 - } 198 - 199 - static void 200 - qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) 201 - { 202 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 203 - } 204 - 205 - static void * 206 - qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 207 - { 208 - struct device *prev, *next; 209 - 210 - prev = (struct device *) it; 211 - next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, 212 - NULL, qeth_procfile_seq_match); 213 - if (next) 214 - (*offset)++; 215 - return (void *) next; 216 - } 217 - 218 187 static int 219 188 qeth_perf_procfile_seq_show(struct seq_file *s, void *it) 220 189 { 221 190 struct device *device; 222 191 struct qeth_card *card; 192 + 193 + 194 + if (it == SEQ_START_TOKEN) 195 + return 0; 223 196 224 197 device = (struct device *) it; 225 198 card = device->driver_data; ··· 252 295 card->perf_stats.outbound_do_qdio_time, 253 296 card->perf_stats.outbound_do_qdio_cnt 254 297 ); 298 + put_device(device); 255 299 return 0; 256 300 } 257 301 258 302 static struct seq_operations qeth_perf_procfile_seq_ops = { 259 - .start = qeth_perf_procfile_seq_start, 260 - .stop = qeth_perf_procfile_seq_stop, 261 - .next = qeth_perf_procfile_seq_next, 303 + .start = qeth_procfile_seq_start, 304 + .stop = qeth_procfile_seq_stop, 305 + .next = qeth_procfile_seq_next, 262 306 .show = qeth_perf_procfile_seq_show, 263 307 }; 264 308 ··· 282 324 #define qeth_perf_procfile_created 1 283 325 #endif /* CONFIG_QETH_PERF_STATS */ 284 326 285 - /***** /proc/qeth_ipa_takeover *****/ 286 - #define QETH_IPATO_PROCFILE_NAME "qeth_ipa_takeover" 287 - static struct proc_dir_entry *qeth_ipato_procfile; 288 - 289 - static void * 290 - qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) 291 - { 292 - struct device *dev; 293 - loff_t nr; 294 - 295 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 296 - /* TODO: finish this */ 297 - /* 298 - * maybe SEQ_SATRT_TOKEN can be returned for offset 0 299 - * output driver settings then; 300 - * else output setting for respective card 301 - */ 302 - 303 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, 304 - qeth_procfile_seq_match); 305 - 306 - /* get card at pos *offset */ 307 - nr = *offset; 308 - while (nr-- > 1 && dev) 309 - dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, 310 - NULL, qeth_procfile_seq_match); 311 - return (void *) dev; 312 - } 313 - 314 - static void 315 - qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) 316 - { 317 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 318 - } 319 - 320 - static void * 321 - qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 322 - { 323 - struct device *prev, *next; 324 - 325 - prev = (struct device *) it; 326 - next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, 327 - NULL, qeth_procfile_seq_match); 328 - if (next) 329 - (*offset)++; 330 - return (void *) next; 331 - } 332 - 333 - static int 334 - qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) 335 - { 336 - struct device *device; 337 - struct qeth_card *card; 338 - 339 - /* TODO: finish this */ 340 - /* 341 - * maybe SEQ_SATRT_TOKEN can be returned for offset 0 342 - * output driver settings then; 343 - * else output setting for respective card 344 - */ 345 - device = (struct device *) it; 346 - card = device->driver_data; 347 - 348 - return 0; 349 - } 350 - 351 - static struct seq_operations qeth_ipato_procfile_seq_ops = { 352 - .start = qeth_ipato_procfile_seq_start, 353 - .stop = qeth_ipato_procfile_seq_stop, 354 - .next = qeth_ipato_procfile_seq_next, 355 - .show = qeth_ipato_procfile_seq_show, 356 - }; 357 - 358 - static int 359 - qeth_ipato_procfile_open(struct inode *inode, struct file *file) 360 - { 361 - return seq_open(file, &qeth_ipato_procfile_seq_ops); 362 - } 363 - 364 - static struct file_operations qeth_ipato_procfile_fops = { 365 - .owner = THIS_MODULE, 366 - .open = qeth_ipato_procfile_open, 367 - .read = seq_read, 368 - .llseek = seq_lseek, 369 - .release = seq_release, 370 - }; 371 - 372 327 int __init 373 328 qeth_create_procfs_entries(void) 374 329 { ··· 297 426 qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops; 298 427 #endif /* CONFIG_QETH_PERF_STATS */ 299 428 300 - qeth_ipato_procfile = create_proc_entry(QETH_IPATO_PROCFILE_NAME, 301 - S_IFREG | 0444, NULL); 302 - if (qeth_ipato_procfile) 303 - qeth_ipato_procfile->proc_fops = &qeth_ipato_procfile_fops; 304 - 305 429 if (qeth_procfile && 306 - qeth_ipato_procfile && 307 430 qeth_perf_procfile_created) 308 431 return 0; 309 432 else ··· 311 446 remove_proc_entry(QETH_PROCFILE_NAME, NULL); 312 447 if (qeth_perf_procfile) 313 448 remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL); 314 - if (qeth_ipato_procfile) 315 - remove_proc_entry(QETH_IPATO_PROCFILE_NAME, NULL); 316 449 } 317 450 318 - 319 - /* ONLY FOR DEVELOPMENT! -> make it as module */ 320 - /* 321 - static void 322 - qeth_create_sysfs_entries(void) 323 - { 324 - struct device *dev; 325 - 326 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 327 - 328 - list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, 329 - driver_list) 330 - qeth_create_device_attributes(dev); 331 - 332 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 333 - } 334 - 335 - static void 336 - qeth_remove_sysfs_entries(void) 337 - { 338 - struct device *dev; 339 - 340 - down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 341 - 342 - list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, 343 - driver_list) 344 - qeth_remove_device_attributes(dev); 345 - 346 - up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 347 - } 348 - 349 - static int __init 350 - qeth_fs_init(void) 351 - { 352 - printk(KERN_INFO "qeth_fs_init\n"); 353 - qeth_create_procfs_entries(); 354 - qeth_create_sysfs_entries(); 355 - 356 - return 0; 357 - } 358 - 359 - static void __exit 360 - qeth_fs_exit(void) 361 - { 362 - printk(KERN_INFO "qeth_fs_exit\n"); 363 - qeth_remove_procfs_entries(); 364 - qeth_remove_sysfs_entries(); 365 - } 366 - 367 - 368 - module_init(qeth_fs_init); 369 - module_exit(qeth_fs_exit); 370 - 371 - MODULE_LICENSE("GPL"); 372 - */
+3 -3
drivers/s390/net/qeth_sys.c
··· 1 1 /* 2 2 * 3 - * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $) 3 + * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.60 $) 4 4 * 5 5 * Linux on zSeries OSA Express and HiperSockets support 6 6 * This file contains code related to sysfs. ··· 20 20 #include "qeth_mpc.h" 21 21 #include "qeth_fs.h" 22 22 23 - const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $"; 23 + const char *VERSION_QETH_SYS_C = "$Revision: 1.60 $"; 24 24 25 25 /*****************************************************************************/ 26 26 /* */ ··· 160 160 return -EPERM; 161 161 162 162 tmp = strsep((char **) &buf, "\n"); 163 - if ((strlen(tmp) > 8) || (strlen(tmp) < 2)) 163 + if ((strlen(tmp) > 8) || (strlen(tmp) == 0)) 164 164 return -EINVAL; 165 165 166 166 card->info.portname[0] = strlen(tmp);
+2 -2
drivers/s390/net/qeth_tso.h
··· 1 1 /* 2 - * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.7 $) 2 + * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.8 $) 3 3 * 4 4 * Header file for qeth TCP Segmentation Offload support. 5 5 * ··· 7 7 * 8 8 * Author(s): Frank Pavlic <fpavlic@de.ibm.com> 9 9 * 10 - * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ 10 + * $Revision: 1.8 $ $Date: 2005/05/04 20:19:18 $ 11 11 * 12 12 */ 13 13 #ifndef __QETH_TSO_H__
+10 -9
drivers/sbus/char/jsflash.c
··· 249 249 /* 250 250 * OS SIMM Cannot be read in other size but a 32bits word. 251 251 */ 252 - static ssize_t jsf_read(struct file * file, char * buf, 252 + static ssize_t jsf_read(struct file * file, char __user * buf, 253 253 size_t togo, loff_t *ppos) 254 254 { 255 255 unsigned long p = *ppos; 256 - char *tmp = buf; 256 + char __user *tmp = buf; 257 257 258 258 union byte4 { 259 259 char s[4]; ··· 305 305 return tmp-buf; 306 306 } 307 307 308 - static ssize_t jsf_write(struct file * file, const char * buf, 308 + static ssize_t jsf_write(struct file * file, const char __user * buf, 309 309 size_t count, loff_t *ppos) 310 310 { 311 311 return -ENOSPC; ··· 356 356 * Program a block of flash. 357 357 * Very simple because we can do it byte by byte anyway. 358 358 */ 359 - static int jsf_ioctl_program(unsigned long arg) 359 + static int jsf_ioctl_program(void __user *arg) 360 360 { 361 361 struct jsflash_program_arg abuf; 362 - char *uptr; 362 + char __user *uptr; 363 363 unsigned long p; 364 364 unsigned int togo; 365 365 union { ··· 367 367 char s[4]; 368 368 } b; 369 369 370 - if (copy_from_user(&abuf, (char *)arg, JSFPRGSZ)) 370 + if (copy_from_user(&abuf, arg, JSFPRGSZ)) 371 371 return -EFAULT; 372 372 p = abuf.off; 373 373 togo = abuf.size; 374 374 if ((togo & 3) || (p & 3)) return -EINVAL; 375 375 376 - uptr = (char *) (unsigned long) abuf.data; 376 + uptr = (char __user *) (unsigned long) abuf.data; 377 377 while (togo != 0) { 378 378 togo -= 4; 379 379 if (copy_from_user(&b.s[0], uptr, 4)) ··· 390 390 unsigned long arg) 391 391 { 392 392 int error = -ENOTTY; 393 + void __user *argp = (void __user *)arg; 393 394 394 395 if (!capable(CAP_SYS_ADMIN)) 395 396 return -EPERM; 396 397 switch (cmd) { 397 398 case JSFLASH_IDENT: 398 - if (copy_to_user((void *)arg, &jsf0.id, JSFIDSZ)) 399 + if (copy_to_user(argp, &jsf0.id, JSFIDSZ)) 399 400 return -EFAULT; 400 401 break; 401 402 case JSFLASH_ERASE: 402 403 error = jsf_ioctl_erase(arg); 403 404 break; 404 405 case JSFLASH_PROGRAM: 405 - error = jsf_ioctl_program(arg); 406 + error = jsf_ioctl_program(argp); 406 407 break; 407 408 } 408 409
+5 -5
drivers/sbus/char/uctrl.c
··· 309 309 } 310 310 } 311 311 312 - void uctrl_get_event_status() 312 + void uctrl_get_event_status(void) 313 313 { 314 314 struct uctrl_driver *driver = &drv; 315 315 struct uctrl_txn txn; ··· 318 318 txn.opcode = READ_EVENT_STATUS; 319 319 txn.inbits = 0; 320 320 txn.outbits = 2; 321 - txn.inbuf = 0; 321 + txn.inbuf = NULL; 322 322 txn.outbuf = outbits; 323 323 324 324 uctrl_do_txn(&txn); ··· 329 329 dprintk(("ev is %x\n", driver->status.event_status)); 330 330 } 331 331 332 - void uctrl_get_external_status() 332 + void uctrl_get_external_status(void) 333 333 { 334 334 struct uctrl_driver *driver = &drv; 335 335 struct uctrl_txn txn; ··· 339 339 txn.opcode = READ_EXTERNAL_STATUS; 340 340 txn.inbits = 0; 341 341 txn.outbits = 2; 342 - txn.inbuf = 0; 342 + txn.inbuf = NULL; 343 343 txn.outbuf = outbits; 344 344 345 345 uctrl_do_txn(&txn); ··· 414 414 if (driver->irq) 415 415 free_irq(driver->irq, driver); 416 416 if (driver->regs) 417 - driver->regs = 0; 417 + driver->regs = NULL; 418 418 } 419 419 420 420 module_init(ts102_uctrl_init);
+1 -1
drivers/sbus/char/vfc.h
··· 125 125 126 126 127 127 struct vfc_dev { 128 - volatile struct vfc_regs *regs; 128 + volatile struct vfc_regs __iomem *regs; 129 129 struct vfc_regs *phys_regs; 130 130 unsigned int control_reg; 131 131 struct semaphore device_lock_sem;
+3 -3
drivers/sbus/char/vfc_dev.c
··· 149 149 } 150 150 printk("Initializing vfc%d\n",instance); 151 151 dev->regs = NULL; 152 - dev->regs = (volatile struct vfc_regs *) 152 + dev->regs = (volatile struct vfc_regs __iomem *) 153 153 sbus_ioremap(&sdev->resource[0], 0, 154 154 sizeof(struct vfc_regs), vfcstr); 155 155 dev->which_io = sdev->reg_addrs[0].which_io; ··· 319 319 int timeout = 1000; 320 320 321 321 while (!timeout--) { 322 - if (dev->regs->control & VFC_STATUS_CAPTURE) 322 + if (sbus_readl(&dev->regs->control) & VFC_STATUS_CAPTURE) 323 323 break; 324 324 vfc_i2c_delay_no_busy(dev, 100); 325 325 } ··· 718 718 if(dev == NULL) 719 719 return; 720 720 devfs_remove("vfc/%d", dev->instance); 721 - sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs)); 721 + sbus_iounmap(dev->regs, sizeof(struct vfc_regs)); 722 722 kfree(dev); 723 723 } 724 724
+20 -5
drivers/scsi/dpt_i2o.c
··· 660 660 msg[2] = 0; 661 661 msg[3]= 0; 662 662 msg[4] = (u32)cmd; 663 - if( (rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER)) != 0){ 663 + if (pHba->host) 664 + spin_lock_irq(pHba->host->host_lock); 665 + rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER); 666 + if (pHba->host) 667 + spin_unlock_irq(pHba->host->host_lock); 668 + if (rcode != 0) { 664 669 if(rcode == -EOPNOTSUPP ){ 665 670 printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name); 666 671 return FAILED; ··· 702 697 msg[2] = 0; 703 698 msg[3] = 0; 704 699 700 + if (pHba->host) 701 + spin_lock_irq(pHba->host->host_lock); 705 702 old_state = d->state; 706 703 d->state |= DPTI_DEV_RESET; 707 - if( (rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER)) ){ 708 - d->state = old_state; 704 + rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER); 705 + d->state = old_state; 706 + if (pHba->host) 707 + spin_unlock_irq(pHba->host->host_lock); 708 + if (rcode != 0) { 709 709 if(rcode == -EOPNOTSUPP ){ 710 710 printk(KERN_INFO"%s: Device reset not supported\n",pHba->name); 711 711 return FAILED; ··· 718 708 printk(KERN_INFO"%s: Device reset failed\n",pHba->name); 719 709 return FAILED; 720 710 } else { 721 - d->state = old_state; 722 711 printk(KERN_INFO"%s: Device reset successful\n",pHba->name); 723 712 return SUCCESS; 724 713 } ··· 730 721 { 731 722 adpt_hba* pHba; 732 723 u32 msg[4]; 724 + u32 rcode; 733 725 734 726 pHba = (adpt_hba*)cmd->device->host->hostdata[0]; 735 727 memset(msg, 0, sizeof(msg)); ··· 739 729 msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid); 740 730 msg[2] = 0; 741 731 msg[3] = 0; 742 - if(adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER) ){ 732 + if (pHba->host) 733 + spin_lock_irq(pHba->host->host_lock); 734 + rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER); 735 + if (pHba->host) 736 + spin_unlock_irq(pHba->host->host_lock); 737 + if (rcode != 0) { 743 738 printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name); 744 739 return FAILED; 745 740 } else {
+1 -1
drivers/scsi/ibmvscsi/ibmvscsi.h
··· 100 100 void ibmvscsi_release_crq_queue(struct crq_queue *queue, 101 101 struct ibmvscsi_host_data *hostdata, 102 102 int max_requests); 103 - void ibmvscsi_reset_crq_queue(struct crq_queue *queue, 103 + int ibmvscsi_reset_crq_queue(struct crq_queue *queue, 104 104 struct ibmvscsi_host_data *hostdata); 105 105 106 106 void ibmvscsi_handle_crq(struct viosrp_crq *crq,
+2 -1
drivers/scsi/ibmvscsi/iseries_vscsi.c
··· 117 117 * 118 118 * no-op for iSeries 119 119 */ 120 - void ibmvscsi_reset_crq_queue(struct crq_queue *queue, 120 + int ibmvscsi_reset_crq_queue(struct crq_queue *queue, 121 121 struct ibmvscsi_host_data *hostdata) 122 122 { 123 + return 0; 123 124 } 124 125 125 126 /**
+7 -1
drivers/scsi/ibmvscsi/rpa_vscsi.c
··· 230 230 rc = plpar_hcall_norets(H_REG_CRQ, 231 231 vdev->unit_address, 232 232 queue->msg_token, PAGE_SIZE); 233 + if (rc == H_Resource) 234 + /* maybe kexecing and resource is busy. try a reset */ 235 + rc = ibmvscsi_reset_crq_queue(queue, 236 + hostdata); 237 + 233 238 if (rc == 2) { 234 239 /* Adapter is good, but other end is not ready */ 235 240 printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); ··· 286 281 * @hostdata: ibmvscsi_host_data of host 287 282 * 288 283 */ 289 - void ibmvscsi_reset_crq_queue(struct crq_queue *queue, 284 + int ibmvscsi_reset_crq_queue(struct crq_queue *queue, 290 285 struct ibmvscsi_host_data *hostdata) 291 286 { 292 287 int rc; ··· 314 309 printk(KERN_WARNING 315 310 "ibmvscsi: couldn't register crq--rc 0x%x\n", rc); 316 311 } 312 + return rc; 317 313 }
+1 -1
drivers/scsi/iscsi_tcp.c
··· 3368 3368 switch(param) { 3369 3369 case ISCSI_PARAM_MAX_RECV_DLENGTH: { 3370 3370 char *saveptr = conn->data; 3371 - int flags = GFP_KERNEL; 3371 + gfp_t flags = GFP_KERNEL; 3372 3372 3373 3373 if (conn->data_size >= value) { 3374 3374 conn->max_recv_dlength = value;
+1 -4
drivers/scsi/libata-scsi.c
··· 2046 2046 else { 2047 2047 u8 *scsicmd = cmd->cmnd; 2048 2048 2049 - if (scsicmd[0] == INQUIRY) { 2049 + if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) { 2050 2050 u8 *buf = NULL; 2051 2051 unsigned int buflen; 2052 2052 ··· 2059 2059 * to indicate to the Linux scsi midlayer this is a modern 2060 2060 * device. 2) Ensure response data format / ATAPI information 2061 2061 * are always correct. 2062 - */ 2063 - /* FIXME: do we ever override EVPD pages and the like, with 2064 - * this code? 2065 2062 */ 2066 2063 if (buf[2] == 0) { 2067 2064 buf[2] = 0x5;
+1 -1
drivers/scsi/megaraid.c
··· 664 664 sg->offset; 665 665 } else 666 666 buf = cmd->request_buffer; 667 - memset(cmd->request_buffer, 0, cmd->cmnd[4]); 667 + memset(buf, 0, cmd->cmnd[4]); 668 668 if (cmd->use_sg) { 669 669 struct scatterlist *sg; 670 670
+1 -9
drivers/scsi/qla2xxx/qla_def.h
··· 2476 2476 */ 2477 2477 #define LOOP_TRANSITION(ha) \ 2478 2478 (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ 2479 - test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) 2480 - 2481 - #define LOOP_NOT_READY(ha) \ 2482 - ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) || \ 2483 - test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) || \ 2484 - test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ 2485 - test_bit(LOOP_RESYNC_ACTIVE, &ha->dpc_flags)) || \ 2479 + test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ 2486 2480 atomic_read(&ha->loop_state) == LOOP_DOWN) 2487 - 2488 - #define LOOP_RDY(ha) (!LOOP_NOT_READY(ha)) 2489 2481 2490 2482 #define TGT_Q(ha, t) (ha->otgt[t]) 2491 2483
+3 -3
drivers/scsi/qla2xxx/qla_init.c
··· 1259 1259 rval = qla2x00_get_adapter_id(ha, 1260 1260 &loop_id, &al_pa, &area, &domain, &topo); 1261 1261 if (rval != QLA_SUCCESS) { 1262 - if (LOOP_NOT_READY(ha) || atomic_read(&ha->loop_down_timer) || 1262 + if (LOOP_TRANSITION(ha) || atomic_read(&ha->loop_down_timer) || 1263 1263 (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) { 1264 1264 DEBUG2(printk("%s(%ld) Loop is in a transition state\n", 1265 1265 __func__, ha->host_no)); ··· 1796 1796 } 1797 1797 1798 1798 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { 1799 - if (LOOP_NOT_READY(ha)) { 1799 + if (LOOP_TRANSITION(ha)) { 1800 1800 rval = QLA_FUNCTION_FAILED; 1801 1801 } else { 1802 1802 rval = qla2x00_configure_fabric(ha); ··· 2369 2369 if (qla2x00_is_reserved_id(ha, loop_id)) 2370 2370 continue; 2371 2371 2372 - if (atomic_read(&ha->loop_down_timer) || LOOP_NOT_READY(ha)) 2372 + if (atomic_read(&ha->loop_down_timer) || LOOP_TRANSITION(ha)) 2373 2373 break; 2374 2374 2375 2375 if (swl != NULL) {
+15
drivers/scsi/qla2xxx/qla_isr.c
··· 909 909 resid = resid_len; 910 910 cp->resid = resid; 911 911 CMD_RESID_LEN(cp) = resid; 912 + 913 + if (!lscsi_status && 914 + ((unsigned)(cp->request_bufflen - resid) < 915 + cp->underflow)) { 916 + qla_printk(KERN_INFO, ha, 917 + "scsi(%ld:%d:%d:%d): Mid-layer underflow " 918 + "detected (%x of %x bytes)...returning " 919 + "error status.\n", ha->host_no, 920 + cp->device->channel, cp->device->id, 921 + cp->device->lun, resid, 922 + cp->request_bufflen); 923 + 924 + cp->result = DID_ERROR << 16; 925 + break; 926 + } 912 927 } 913 928 cp->result = DID_OK << 16 | lscsi_status; 914 929
+6 -1
drivers/scsi/scsi_error.c
··· 422 422 **/ 423 423 static void scsi_eh_done(struct scsi_cmnd *scmd) 424 424 { 425 + struct completion *eh_action; 426 + 425 427 SCSI_LOG_ERROR_RECOVERY(3, 426 428 printk("%s scmd: %p result: %x\n", 427 429 __FUNCTION__, scmd, scmd->result)); 428 - complete(scmd->device->host->eh_action); 430 + 431 + eh_action = scmd->device->host->eh_action; 432 + if (eh_action) 433 + complete(eh_action); 429 434 } 430 435 431 436 /**
+21 -12
drivers/scsi/scsi_lib.c
··· 1085 1085 scsi_io_completion(cmd, cmd->result == 0 ? cmd->bufflen : 0, 0); 1086 1086 } 1087 1087 1088 + void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd, int retries) 1089 + { 1090 + struct request *req = cmd->request; 1091 + 1092 + BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd)); 1093 + memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); 1094 + cmd->cmd_len = req->cmd_len; 1095 + if (!req->data_len) 1096 + cmd->sc_data_direction = DMA_NONE; 1097 + else if (rq_data_dir(req) == WRITE) 1098 + cmd->sc_data_direction = DMA_TO_DEVICE; 1099 + else 1100 + cmd->sc_data_direction = DMA_FROM_DEVICE; 1101 + 1102 + cmd->transfersize = req->data_len; 1103 + cmd->allowed = retries; 1104 + cmd->timeout_per_command = req->timeout; 1105 + } 1106 + EXPORT_SYMBOL_GPL(scsi_setup_blk_pc_cmnd); 1107 + 1088 1108 static int scsi_prep_fn(struct request_queue *q, struct request *req) 1089 1109 { 1090 1110 struct scsi_device *sdev = q->queuedata; ··· 1240 1220 goto kill; 1241 1221 } 1242 1222 } else { 1243 - memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); 1244 - cmd->cmd_len = req->cmd_len; 1245 - if (rq_data_dir(req) == WRITE) 1246 - cmd->sc_data_direction = DMA_TO_DEVICE; 1247 - else if (req->data_len) 1248 - cmd->sc_data_direction = DMA_FROM_DEVICE; 1249 - else 1250 - cmd->sc_data_direction = DMA_NONE; 1251 - 1252 - cmd->transfersize = req->data_len; 1253 - cmd->allowed = 3; 1254 - cmd->timeout_per_command = req->timeout; 1223 + scsi_setup_blk_pc_cmnd(cmd, 3); 1255 1224 cmd->done = scsi_generic_done; 1256 1225 } 1257 1226 }
+39 -10
drivers/scsi/scsi_scan.c
··· 400 400 return found_target; 401 401 } 402 402 403 + struct work_queue_wrapper { 404 + struct work_struct work; 405 + struct scsi_target *starget; 406 + }; 407 + 408 + static void scsi_target_reap_work(void *data) { 409 + struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; 410 + struct scsi_target *starget = wqw->starget; 411 + struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 412 + unsigned long flags; 413 + 414 + kfree(wqw); 415 + 416 + spin_lock_irqsave(shost->host_lock, flags); 417 + 418 + if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { 419 + list_del_init(&starget->siblings); 420 + spin_unlock_irqrestore(shost->host_lock, flags); 421 + transport_remove_device(&starget->dev); 422 + device_del(&starget->dev); 423 + transport_destroy_device(&starget->dev); 424 + put_device(&starget->dev); 425 + return; 426 + 427 + } 428 + spin_unlock_irqrestore(shost->host_lock, flags); 429 + 430 + return; 431 + } 432 + 403 433 /** 404 434 * scsi_target_reap - check to see if target is in use and destroy if not 405 435 * ··· 441 411 */ 442 412 void scsi_target_reap(struct scsi_target *starget) 443 413 { 444 - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 445 - unsigned long flags; 446 - spin_lock_irqsave(shost->host_lock, flags); 414 + struct work_queue_wrapper *wqw = 415 + kzalloc(sizeof(struct work_queue_wrapper), GFP_ATOMIC); 447 416 448 - if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { 449 - list_del_init(&starget->siblings); 450 - spin_unlock_irqrestore(shost->host_lock, flags); 451 - device_del(&starget->dev); 452 - transport_unregister_device(&starget->dev); 453 - put_device(&starget->dev); 417 + if (!wqw) { 418 + starget_printk(KERN_ERR, starget, 419 + "Failed to allocate memory in scsi_reap_target()\n"); 454 420 return; 455 421 } 456 - spin_unlock_irqrestore(shost->host_lock, flags); 422 + 423 + INIT_WORK(&wqw->work, scsi_target_reap_work, wqw); 424 + wqw->starget = starget; 425 + schedule_work(&wqw->work); 457 426 } 458 427 459 428 /**
+55 -4
drivers/scsi/scsi_transport_fc.c
··· 105 105 { FC_PORTSTATE_LINKDOWN, "Linkdown" }, 106 106 { FC_PORTSTATE_ERROR, "Error" }, 107 107 { FC_PORTSTATE_LOOPBACK, "Loopback" }, 108 + { FC_PORTSTATE_DELETED, "Deleted" }, 108 109 }; 109 110 fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) 110 111 #define FC_PORTSTATE_MAX_NAMELEN 20 ··· 212 211 #define FC_MGMTSRVR_PORTID 0x00000a 213 212 214 213 214 + static void fc_shost_remove_rports(void *data); 215 215 static void fc_timeout_deleted_rport(void *data); 216 216 static void fc_scsi_scan_rport(void *data); 217 217 static void fc_rport_terminate(struct fc_rport *rport); ··· 320 318 fc_host_next_rport_number(shost) = 0; 321 319 fc_host_next_target_id(shost) = 0; 322 320 321 + fc_host_flags(shost) = 0; 322 + INIT_WORK(&fc_host_rport_del_work(shost), fc_shost_remove_rports, shost); 323 323 return 0; 324 324 } 325 325 ··· 391 387 struct fc_internal *i = to_fc_internal(shost->transportt); \ 392 388 if ((i->f->get_rport_##field) && \ 393 389 !((rport->port_state == FC_PORTSTATE_BLOCKED) || \ 390 + (rport->port_state == FC_PORTSTATE_DELETED) || \ 394 391 (rport->port_state == FC_PORTSTATE_NOTPRESENT))) \ 395 392 i->f->get_rport_##field(rport); \ 396 393 return snprintf(buf, sz, format_string, cast rport->field); \ ··· 407 402 struct Scsi_Host *shost = rport_to_shost(rport); \ 408 403 struct fc_internal *i = to_fc_internal(shost->transportt); \ 409 404 if ((rport->port_state == FC_PORTSTATE_BLOCKED) || \ 405 + (rport->port_state == FC_PORTSTATE_DELETED) || \ 410 406 (rport->port_state == FC_PORTSTATE_NOTPRESENT)) \ 411 407 return -EBUSY; \ 412 408 val = simple_strtoul(buf, NULL, 0); \ ··· 525 519 struct Scsi_Host *shost = rport_to_shost(rport); 526 520 struct fc_internal *i = to_fc_internal(shost->transportt); 527 521 if ((rport->port_state == FC_PORTSTATE_BLOCKED) || 522 + (rport->port_state == FC_PORTSTATE_DELETED) || 528 523 (rport->port_state == FC_PORTSTATE_NOTPRESENT)) 529 524 return -EBUSY; 530 525 val = simple_strtoul(buf, NULL, 0); ··· 1776 1769 rport->maxframe_size = -1; 1777 1770 rport->supported_classes = FC_COS_UNSPECIFIED; 1778 1771 rport->roles = FC_RPORT_ROLE_UNKNOWN; 1779 - rport->port_state = FC_PORTSTATE_NOTPRESENT; 1772 + rport->port_state = FC_PORTSTATE_DELETED; 1780 1773 1781 1774 /* remove the identifiers that aren't used in the consisting binding */ 1782 1775 switch (fc_host_tgtid_bind_type(shost)) { ··· 1796 1789 break; 1797 1790 } 1798 1791 1799 - spin_unlock_irqrestore(shost->host_lock, flags); 1800 - 1801 1792 /* 1802 1793 * As this only occurs if the remote port (scsi target) 1803 1794 * went away and didn't come back - we'll remove 1804 1795 * all attached scsi devices. 1796 + * 1797 + * We'll schedule the shost work item to perform the actual removal 1798 + * to avoid recursion in the different flush calls if we perform 1799 + * the removal in each target - and there are lots of targets 1800 + * whose timeouts fire at the same time. 1805 1801 */ 1806 - fc_rport_tgt_remove(rport); 1802 + 1803 + if ( !(fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED)) { 1804 + fc_host_flags(shost) |= FC_SHOST_RPORT_DEL_SCHEDULED; 1805 + scsi_queue_work(shost, &fc_host_rport_del_work(shost)); 1806 + } 1807 + 1808 + spin_unlock_irqrestore(shost->host_lock, flags); 1807 1809 } 1808 1810 1809 1811 /** ··· 1831 1815 scsi_target_unblock(&rport->dev); 1832 1816 scsi_scan_target(&rport->dev, rport->channel, rport->scsi_target_id, 1833 1817 SCAN_WILD_CARD, 1); 1818 + } 1819 + 1820 + 1821 + /** 1822 + * fc_shost_remove_rports - called to remove all rports that are marked 1823 + * as in a deleted (not connected) state. 1824 + * 1825 + * @data: shost whose rports are to be looked at 1826 + **/ 1827 + static void 1828 + fc_shost_remove_rports(void *data) 1829 + { 1830 + struct Scsi_Host *shost = (struct Scsi_Host *)data; 1831 + struct fc_rport *rport, *next_rport; 1832 + unsigned long flags; 1833 + 1834 + spin_lock_irqsave(shost->host_lock, flags); 1835 + while (fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED) { 1836 + 1837 + fc_host_flags(shost) &= ~FC_SHOST_RPORT_DEL_SCHEDULED; 1838 + 1839 + restart_search: 1840 + list_for_each_entry_safe(rport, next_rport, 1841 + &fc_host_rport_bindings(shost), peers) { 1842 + if (rport->port_state == FC_PORTSTATE_DELETED) { 1843 + rport->port_state = FC_PORTSTATE_NOTPRESENT; 1844 + spin_unlock_irqrestore(shost->host_lock, flags); 1845 + fc_rport_tgt_remove(rport); 1846 + spin_lock_irqsave(shost->host_lock, flags); 1847 + goto restart_search; 1848 + } 1849 + } 1850 + 1851 + } 1852 + spin_unlock_irqrestore(shost->host_lock, flags); 1834 1853 } 1835 1854 1836 1855
+1 -1
drivers/scsi/scsi_transport_iscsi.c
··· 249 249 } 250 250 251 251 static void* 252 - mempool_zone_alloc_skb(unsigned int gfp_mask, void *pool_data) 252 + mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data) 253 253 { 254 254 struct mempool_zone *zone = pool_data; 255 255
+1 -15
drivers/scsi/sd.c
··· 245 245 * SG_IO from block layer already setup, just copy cdb basically 246 246 */ 247 247 if (blk_pc_request(rq)) { 248 - if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) 249 - return 0; 250 - 251 - memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); 252 - SCpnt->cmd_len = rq->cmd_len; 253 - if (rq_data_dir(rq) == WRITE) 254 - SCpnt->sc_data_direction = DMA_TO_DEVICE; 255 - else if (rq->data_len) 256 - SCpnt->sc_data_direction = DMA_FROM_DEVICE; 257 - else 258 - SCpnt->sc_data_direction = DMA_NONE; 259 - 260 - this_count = rq->data_len; 248 + scsi_setup_blk_pc_cmnd(SCpnt, SD_PASSTHROUGH_RETRIES); 261 249 if (rq->timeout) 262 250 timeout = rq->timeout; 263 251 264 - SCpnt->transfersize = rq->data_len; 265 - SCpnt->allowed = SD_PASSTHROUGH_RETRIES; 266 252 goto queue; 267 253 } 268 254
+3 -17
drivers/scsi/sr.c
··· 320 320 * these are already setup, just copy cdb basically 321 321 */ 322 322 if (SCpnt->request->flags & REQ_BLOCK_PC) { 323 - struct request *rq = SCpnt->request; 323 + scsi_setup_blk_pc_cmnd(SCpnt, MAX_RETRIES); 324 324 325 - if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) 326 - return 0; 325 + if (SCpnt->timeout_per_command) 326 + timeout = SCpnt->timeout_per_command; 327 327 328 - memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); 329 - SCpnt->cmd_len = rq->cmd_len; 330 - if (!rq->data_len) 331 - SCpnt->sc_data_direction = DMA_NONE; 332 - else if (rq_data_dir(rq) == WRITE) 333 - SCpnt->sc_data_direction = DMA_TO_DEVICE; 334 - else 335 - SCpnt->sc_data_direction = DMA_FROM_DEVICE; 336 - 337 - this_count = rq->data_len; 338 - if (rq->timeout) 339 - timeout = rq->timeout; 340 - 341 - SCpnt->transfersize = rq->data_len; 342 328 goto queue; 343 329 } 344 330
+1 -18
drivers/scsi/st.c
··· 4194 4194 */ 4195 4195 static int st_init_command(struct scsi_cmnd *SCpnt) 4196 4196 { 4197 - struct request *rq; 4198 - 4199 4197 if (!(SCpnt->request->flags & REQ_BLOCK_PC)) 4200 4198 return 0; 4201 4199 4202 - rq = SCpnt->request; 4203 - if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) 4204 - return 0; 4205 - 4206 - memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); 4207 - SCpnt->cmd_len = rq->cmd_len; 4208 - 4209 - if (rq_data_dir(rq) == WRITE) 4210 - SCpnt->sc_data_direction = DMA_TO_DEVICE; 4211 - else if (rq->data_len) 4212 - SCpnt->sc_data_direction = DMA_FROM_DEVICE; 4213 - else 4214 - SCpnt->sc_data_direction = DMA_NONE; 4215 - 4216 - SCpnt->timeout_per_command = rq->timeout; 4217 - SCpnt->transfersize = rq->data_len; 4200 + scsi_setup_blk_pc_cmnd(SCpnt, 0); 4218 4201 SCpnt->done = st_intr; 4219 4202 return 1; 4220 4203 }
+2 -2
drivers/scsi/sym53c8xx_2/sym_hipd.c
··· 1405 1405 goal->iu = 0; 1406 1406 goal->dt = 0; 1407 1407 goal->qas = 0; 1408 - goal->period = 0; 1409 1408 goal->offset = 0; 1410 1409 return; 1411 1410 } ··· 1464 1465 * Many devices implement PPR in a buggy way, so only use it if we 1465 1466 * really want to. 1466 1467 */ 1467 - if (goal->iu || goal->dt || goal->qas || (goal->period < 0xa)) { 1468 + if (goal->offset && 1469 + (goal->iu || goal->dt || goal->qas || (goal->period < 0xa))) { 1468 1470 nego = NS_PPR; 1469 1471 } else if (spi_width(starget) != goal->width) { 1470 1472 nego = NS_WIDE;
+5 -5
drivers/serial/Kconfig
··· 10 10 # The new 8250/16550 serial drivers 11 11 config SERIAL_8250 12 12 tristate "8250/16550 and compatible serial support" 13 - depends on (BROKEN || !(SPARC64 || SPARC32)) 13 + depends on (BROKEN || !SPARC) 14 14 select SERIAL_CORE 15 15 ---help--- 16 16 This selects whether you want to include the driver for the standard ··· 469 469 470 470 config SERIAL_SUNCORE 471 471 bool 472 - depends on SPARC32 || SPARC64 472 + depends on SPARC 473 473 select SERIAL_CORE 474 474 select SERIAL_CORE_CONSOLE 475 475 default y 476 476 477 477 config SERIAL_SUNZILOG 478 478 tristate "Sun Zilog8530 serial support" 479 - depends on SPARC32 || SPARC64 479 + depends on SPARC 480 480 help 481 481 This driver supports the Zilog8530 serial ports found on many Sparc 482 482 systems. Say Y or M if you want to be able to these serial ports. ··· 491 491 492 492 config SERIAL_SUNSU 493 493 tristate "Sun SU serial support" 494 - depends on (SPARC32 || SPARC64) && PCI 494 + depends on SPARC && PCI 495 495 help 496 496 This driver supports the 8250 serial ports that run the keyboard and 497 497 mouse on (PCI) UltraSPARC systems. Say Y or M if you want to be able ··· 547 547 548 548 config SERIAL_SUNSAB 549 549 tristate "Sun Siemens SAB82532 serial support" 550 - depends on (SPARC32 || SPARC64) && PCI 550 + depends on SPARC && PCI 551 551 help 552 552 This driver supports the Siemens SAB82532 DUSCC serial ports on newer 553 553 (PCI) UltraSPARC systems. Say Y or M if you want to be able to these
+1 -1
drivers/serial/amba-pl011.c
··· 160 160 flag = TTY_FRAME; 161 161 } 162 162 163 - if (uart_handle_sysrq_char(&uap->port, ch, regs)) 163 + if (uart_handle_sysrq_char(&uap->port, ch & 255, regs)) 164 164 goto ignore_char; 165 165 166 166 uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag);
+2 -2
drivers/serial/pxa.c
··· 361 361 if (port->line == 3) /* HWUART */ 362 362 up->mcr |= UART_MCR_AFE; 363 363 else 364 - up->mcr = 0; 364 + up->mcr = 0; 365 365 366 366 /* 367 367 * Allocate the IRQ ··· 641 641 int i; 642 642 643 643 /* 644 - * First save the UER then disable the interrupts 644 + * First save the IER then disable the interrupts 645 645 */ 646 646 ier = serial_in(up, UART_IER); 647 647 serial_out(up, UART_IER, UART_IER_UUE);
+6 -3
drivers/usb/core/usb.c
··· 1432 1432 mark_quiesced(intf); 1433 1433 } else { 1434 1434 // FIXME else if there's no suspend method, disconnect... 1435 - dev_warn(dev, "no %s?\n", "suspend"); 1435 + dev_warn(dev, "no suspend for driver %s?\n", driver->name); 1436 + mark_quiesced(intf); 1436 1437 status = 0; 1437 1438 } 1438 1439 return status; ··· 1461 1460 } 1462 1461 1463 1462 if ((dev->driver == NULL) || 1464 - (dev->driver_data == &usb_generic_driver_data)) 1463 + (dev->driver_data == &usb_generic_driver_data)) { 1464 + dev->power.power_state.event = PM_EVENT_FREEZE; 1465 1465 return 0; 1466 + } 1466 1467 1467 1468 intf = to_usb_interface(dev); 1468 1469 driver = to_usb_driver(dev->driver); ··· 1484 1481 mark_quiesced(intf); 1485 1482 } 1486 1483 } else 1487 - dev_warn(dev, "no %s?\n", "resume"); 1484 + dev_warn(dev, "no resume for driver %s?\n", driver->name); 1488 1485 return 0; 1489 1486 } 1490 1487
+2
drivers/usb/host/uhci-hcd.c
··· 717 717 * at the source, so we must turn off PIRQ. 718 718 */ 719 719 pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0); 720 + mb(); 720 721 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 721 722 uhci->hc_inaccessible = 1; 722 723 hcd->poll_rh = 0; ··· 739 738 * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0 740 739 */ 741 740 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 741 + mb(); 742 742 743 743 if (uhci->rh_state == UHCI_RH_RESET) /* Dead */ 744 744 return 0;
+1 -1
drivers/usb/input/aiptek.c
··· 2103 2103 * values. 2104 2104 */ 2105 2105 input_set_abs_params(inputdev, ABS_X, 0, 2999, 0, 0); 2106 - input_set_abs_params(inputdev, ABS_X, 0, 2249, 0, 0); 2106 + input_set_abs_params(inputdev, ABS_Y, 0, 2249, 0, 0); 2107 2107 input_set_abs_params(inputdev, ABS_PRESSURE, 0, 511, 0, 0); 2108 2108 input_set_abs_params(inputdev, ABS_TILT_X, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); 2109 2109 input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
+3 -1
drivers/usb/input/hid-core.c
··· 893 893 894 894 size = ((report->size - 1) >> 3) + 1; 895 895 896 - if (len < size) 896 + if (len < size) { 897 897 dbg("report %d is too short, (%d < %d)", report->id, len, size); 898 + memset(data + len, 0, size - len); 899 + } 898 900 899 901 if (hid->claimed & HID_CLAIMED_HIDDEV) 900 902 hiddev_report_event(hid, report);
+1
drivers/usb/input/hid-input.c
··· 137 137 switch (usage->hid & 0xffff) { 138 138 case 0xba: map_abs(ABS_RUDDER); break; 139 139 case 0xbb: map_abs(ABS_THROTTLE); break; 140 + default: goto ignore; 140 141 } 141 142 break; 142 143
+1 -1
drivers/usb/input/kbtab.c
··· 159 159 input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH); 160 160 input_dev->mscbit[0] |= BIT(MSC_SERIAL); 161 161 input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); 162 - input_set_abs_params(input_dev, ABS_X, 0, 0x1750, 4, 0); 162 + input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); 163 163 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); 164 164 165 165 endpoint = &intf->cur_altsetting->endpoint[0].desc;
+1 -1
drivers/usb/input/wacom.c
··· 854 854 855 855 input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS); 856 856 input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); 857 - input_set_abs_params(input_dev, ABS_X, 0, wacom->features->y_max, 4, 0); 857 + input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); 858 858 input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); 859 859 input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); 860 860
+1 -1
drivers/usb/misc/auerswald.c
··· 1696 1696 int ret; 1697 1697 wait_queue_t wait; 1698 1698 1699 - dbg ("auerchar_write %d bytes", len); 1699 + dbg ("auerchar_write %zd bytes", len); 1700 1700 1701 1701 /* Error checking */ 1702 1702 if (!ccp)
+2 -2
drivers/usb/storage/scsiglue.c
··· 109 109 * data comes from. 110 110 */ 111 111 if (sdev->scsi_level < SCSI_2) 112 - sdev->scsi_level = SCSI_2; 112 + sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 113 113 114 114 /* According to the technical support people at Genesys Logic, 115 115 * devices using their chips have problems transferring more than ··· 162 162 * a Get-Max-LUN request, we won't lose much by setting the 163 163 * revision level down to 2. The only devices that would be 164 164 * affected are those with sparse LUNs. */ 165 - sdev->scsi_level = SCSI_2; 165 + sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 166 166 167 167 /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable 168 168 * Hardware Error) when any low-level error occurs,
+5 -5
drivers/video/Kconfig
··· 536 536 537 537 config FB_SBUS 538 538 bool "SBUS and UPA framebuffers" 539 - depends on (FB = y) && (SPARC32 || SPARC64) 539 + depends on (FB = y) && SPARC 540 540 help 541 541 Say Y if you want support for SBUS or UPA based frame buffer device. 542 542 543 543 config FB_BW2 544 544 bool "BWtwo support" 545 - depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) 545 + depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) 546 546 select FB_CFB_FILLRECT 547 547 select FB_CFB_COPYAREA 548 548 select FB_CFB_IMAGEBLIT ··· 551 551 552 552 config FB_CG3 553 553 bool "CGthree support" 554 - depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) 554 + depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) 555 555 select FB_CFB_FILLRECT 556 556 select FB_CFB_COPYAREA 557 557 select FB_CFB_IMAGEBLIT ··· 560 560 561 561 config FB_CG6 562 562 bool "CGsix (GX,TurboGX) support" 563 - depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) 563 + depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) 564 564 select FB_CFB_COPYAREA 565 565 select FB_CFB_IMAGEBLIT 566 566 help ··· 1268 1268 1269 1269 config FB_PCI 1270 1270 bool "PCI framebuffers" 1271 - depends on (FB = y) && PCI && (SPARC64 || SPARC32) 1271 + depends on (FB = y) && PCI && SPARC 1272 1272 1273 1273 config FB_IGA 1274 1274 bool "IGA 168x display support"
+1 -1
drivers/video/arcfb.c
··· 441 441 * the fb. it's inefficient for them to do anything less than 64*8 442 442 * writes since we update the lcd in each write() anyway. 443 443 */ 444 - static ssize_t arcfb_write(struct file *file, const char *buf, size_t count, 444 + static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count, 445 445 loff_t *ppos) 446 446 { 447 447 /* modded from epson 1355 */
+10 -10
drivers/video/console/Kconfig
··· 6 6 7 7 config VGA_CONSOLE 8 8 bool "VGA text console" if EMBEDDED || !X86 9 - depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE 9 + depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !ARCH_VERSATILE 10 10 default y 11 11 help 12 12 Saying Y here will allow you to use Linux in text mode through a ··· 68 68 69 69 config PROM_CONSOLE 70 70 bool "PROM console" 71 - depends on SPARC32 || SPARC64 71 + depends on SPARC 72 72 help 73 73 Say Y to build a console driver for Sun machines that uses the 74 74 terminal emulation built into their console PROMS. ··· 136 136 config FONT_8x8 137 137 bool "VGA 8x8 font" if FONTS 138 138 depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE 139 - default y if !SPARC32 && !SPARC64 && !FONTS 139 + default y if !SPARC && !FONTS 140 140 help 141 141 This is the "high resolution" font for the VGA frame buffer (the one 142 142 provided by the text console 80x50 (and higher) modes). ··· 150 150 config FONT_8x16 151 151 bool "VGA 8x16 font" if FONTS 152 152 depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y || STI_CONSOLE || USB_SISUSBVGA_CON 153 - default y if !SPARC32 && !SPARC64 && !FONTS 153 + default y if !SPARC && !FONTS 154 154 help 155 155 This is the "high resolution" font for the VGA frame buffer (the one 156 156 provided by the VGA text console 80x25 mode. ··· 160 160 config FONT_6x11 161 161 bool "Mac console 6x11 font (not supported by all drivers)" if FONTS 162 162 depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE 163 - default y if !SPARC32 && !SPARC64 && !FONTS && MAC 163 + default y if !SPARC && !FONTS && MAC 164 164 help 165 165 Small console font with Macintosh-style high-half glyphs. Some Mac 166 166 framebuffer drivers don't support this one at all. ··· 176 176 config FONT_PEARL_8x8 177 177 bool "Pearl (old m68k) console 8x8 font" if FONTS 178 178 depends on FRAMEBUFFER_CONSOLE 179 - default y if !SPARC32 && !SPARC64 && !FONTS && AMIGA 179 + default y if !SPARC && !FONTS && AMIGA 180 180 help 181 181 Small console font with PC-style control-character and high-half 182 182 glyphs. ··· 184 184 config FONT_ACORN_8x8 185 185 bool "Acorn console 8x8 font" if FONTS 186 186 depends on FRAMEBUFFER_CONSOLE 187 - default y if !SPARC32 && !SPARC64 && !FONTS && ARM && ARCH_ACORN 187 + default y if !SPARC && !FONTS && ARM && ARCH_ACORN 188 188 help 189 189 Small console font with PC-style control characters and high-half 190 190 glyphs. 191 191 192 192 config FONT_MINI_4x6 193 193 bool "Mini 4x6 font" 194 - depends on !SPARC32 && !SPARC64 && FONTS 194 + depends on !SPARC && FONTS 195 195 196 196 config FONT_SUN8x16 197 197 bool "Sparc console 8x16 font" 198 - depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64) 198 + depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC) 199 199 help 200 200 This is the high resolution console font for Sun machines. Say Y. 201 201 202 202 config FONT_SUN12x22 203 203 bool "Sparc console 12x22 font (not supported by all drivers)" 204 - depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64) 204 + depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC) 205 205 help 206 206 This is the high resolution console font for Sun machines with very 207 207 big letters (like the letters used in the SPARC PROM). If the
+5 -3
drivers/video/console/fbcon_ud.c
··· 420 420 int ud_update_start(struct fb_info *info) 421 421 { 422 422 struct fbcon_ops *ops = info->fbcon_par; 423 - u32 xoffset, yoffset; 423 + int xoffset, yoffset; 424 424 u32 vyres = GETVYRES(ops->p->scrollmode, info); 425 425 u32 vxres = GETVXRES(ops->p->scrollmode, info); 426 426 int err; 427 427 428 - xoffset = (vxres - info->var.xres) - ops->var.xoffset; 429 - yoffset = (vyres - info->var.yres) - ops->var.yoffset; 428 + xoffset = vxres - info->var.xres - ops->var.xoffset; 429 + yoffset = vyres - info->var.yres - ops->var.yoffset; 430 + if (yoffset < 0) 431 + yoffset += vyres; 430 432 ops->var.xoffset = xoffset; 431 433 ops->var.yoffset = yoffset; 432 434 err = fb_pan_display(info, &ops->var);
+2 -2
drivers/video/cyber2000fb.c
··· 1512 1512 * I/O cycles storing into a reserved memory space at 1513 1513 * physical address 0x3000000 1514 1514 */ 1515 - unsigned char *iop; 1515 + unsigned char __iomem *iop; 1516 1516 1517 1517 iop = ioremap(0x3000000, 0x5000); 1518 1518 if (iop == NULL) { ··· 1526 1526 writeb(EXT_BIU_MISC, iop + 0x3ce); 1527 1527 writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf); 1528 1528 1529 - iounmap((void *)iop); 1529 + iounmap(iop); 1530 1530 #else 1531 1531 /* 1532 1532 * Most other machine types are "normal", so
+5
drivers/video/intelfb/intelfb.h
··· 41 41 42 42 /*** hw-related values ***/ 43 43 44 + /* Resource Allocation */ 45 + #define INTELFB_FB_ACQUIRED 1 46 + #define INTELFB_MMIO_ACQUIRED 2 47 + 44 48 /* PCI ids for supported devices */ 45 49 #define PCI_DEVICE_ID_INTEL_830M 0x3577 46 50 #define PCI_DEVICE_ID_INTEL_845G 0x2562 ··· 261 257 int hwcursor; 262 258 int fixed_mode; 263 259 int ring_active; 260 + int flag; 264 261 265 262 /* hw cursor */ 266 263 int cursor_on;
+20 -31
drivers/video/intelfb/intelfbdrv.c
··· 135 135 static void __devinit get_initial_mode(struct intelfb_info *dinfo); 136 136 static void update_dinfo(struct intelfb_info *dinfo, 137 137 struct fb_var_screeninfo *var); 138 - static int intelfb_get_fix(struct fb_fix_screeninfo *fix, 139 - struct fb_info *info); 140 - 141 138 static int intelfb_check_var(struct fb_var_screeninfo *var, 142 139 struct fb_info *info); 143 140 static int intelfb_set_par(struct fb_info *info); ··· 470 473 if (dinfo->aperture.virtual) 471 474 iounmap((void __iomem *)dinfo->aperture.virtual); 472 475 473 - if (dinfo->mmio_base_phys) 476 + if (dinfo->flag & INTELFB_MMIO_ACQUIRED) 474 477 release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); 475 - if (dinfo->aperture.physical) 478 + if (dinfo->flag & INTELFB_FB_ACQUIRED) 476 479 release_mem_region(dinfo->aperture.physical, 477 480 dinfo->aperture.size); 478 481 framebuffer_release(dinfo->info); ··· 569 572 cleanup(dinfo); 570 573 return -ENODEV; 571 574 } 575 + 576 + dinfo->flag |= INTELFB_FB_ACQUIRED; 577 + 572 578 if (!request_mem_region(dinfo->mmio_base_phys, 573 579 INTEL_REG_SIZE, 574 580 INTELFB_MODULE_NAME)) { ··· 579 579 cleanup(dinfo); 580 580 return -ENODEV; 581 581 } 582 + 583 + dinfo->flag |= INTELFB_MMIO_ACQUIRED; 582 584 583 585 /* Get the chipset info. */ 584 586 dinfo->pci_chipset = pdev->device; ··· 1093 1091 return 1; 1094 1092 1095 1093 info->pixmap.scan_align = 1; 1096 - 1094 + strcpy(info->fix.id, dinfo->name); 1095 + info->fix.smem_start = dinfo->fb.physical; 1096 + info->fix.smem_len = dinfo->fb.size; 1097 + info->fix.type = FB_TYPE_PACKED_PIXELS; 1098 + info->fix.type_aux = 0; 1099 + info->fix.xpanstep = 8; 1100 + info->fix.ypanstep = 1; 1101 + info->fix.ywrapstep = 0; 1102 + info->fix.mmio_start = dinfo->mmio_base_phys; 1103 + info->fix.mmio_len = INTEL_REG_SIZE; 1104 + info->fix.accel = FB_ACCEL_I830; 1097 1105 update_dinfo(dinfo, &info->var); 1098 1106 1099 1107 return 0; ··· 1121 1109 dinfo->yres = var->xres; 1122 1110 dinfo->pixclock = var->pixclock; 1123 1111 1124 - intelfb_get_fix(&dinfo->info->fix, dinfo->info); 1112 + dinfo->info->fix.visual = dinfo->visual; 1113 + dinfo->info->fix.line_length = dinfo->pitch; 1125 1114 1126 1115 switch (dinfo->bpp) { 1127 1116 case 8: ··· 1151 1138 } 1152 1139 1153 1140 /* fbops functions */ 1154 - 1155 - static int 1156 - intelfb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) 1157 - { 1158 - struct intelfb_info *dinfo = GET_DINFO(info); 1159 - 1160 - DBG_MSG("intelfb_get_fix\n"); 1161 - 1162 - memset(fix, 0, sizeof(*fix)); 1163 - strcpy(fix->id, dinfo->name); 1164 - fix->smem_start = dinfo->fb.physical; 1165 - fix->smem_len = dinfo->fb.size; 1166 - fix->type = FB_TYPE_PACKED_PIXELS; 1167 - fix->type_aux = 0; 1168 - fix->visual = dinfo->visual; 1169 - fix->xpanstep = 8; 1170 - fix->ypanstep = 1; 1171 - fix->ywrapstep = 0; 1172 - fix->line_length = dinfo->pitch; 1173 - fix->mmio_start = dinfo->mmio_base_phys; 1174 - fix->mmio_len = INTEL_REG_SIZE; 1175 - fix->accel = FB_ACCEL_I830; 1176 - return 0; 1177 - } 1178 1141 1179 1142 /*************************************************************** 1180 1143 * fbdev interface *
+1 -1
drivers/video/logo/Kconfig
··· 47 47 48 48 config LOGO_SUN_CLUT224 49 49 bool "224-color Sun Linux logo" 50 - depends on LOGO && (SPARC32 || SPARC64) 50 + depends on LOGO && SPARC 51 51 default y 52 52 53 53 config LOGO_SUPERH_MONO
+2 -1
drivers/video/pxafb.c
··· 1396 1396 int __devinit pxafb_setup(char *options) 1397 1397 { 1398 1398 # ifdef CONFIG_FB_PXA_PARAMETERS 1399 - strlcpy(g_options, options, sizeof(g_options)); 1399 + if (options) 1400 + strlcpy(g_options, options, sizeof(g_options)); 1400 1401 # endif 1401 1402 return 0; 1402 1403 }
+3
drivers/video/sbuslib.c
··· 46 46 unsigned long off; 47 47 int i; 48 48 49 + if (!(vma->vm_flags & (VM_SHARED | VM_MAYSHARE))) 50 + return -EINVAL; 51 + 49 52 size = vma->vm_end - vma->vm_start; 50 53 if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) 51 54 return -EINVAL;
+6 -3
fs/hostfs/hostfs_kern.c
··· 501 501 long long start; 502 502 int err = 0; 503 503 504 - start = (long long) (page->index << PAGE_CACHE_SHIFT) + from; 504 + start = (((long long) page->index) << PAGE_CACHE_SHIFT) + from; 505 505 buffer = kmap(page); 506 506 err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from, 507 507 to - from); 508 508 if(err > 0) err = 0; 509 + 510 + /* Actually, if !err, write_file has added to-from to start, so, despite 511 + * the appearance, we are comparing i_size against the _last_ written 512 + * location, as we should. */ 513 + 509 514 if(!err && (start > inode->i_size)) 510 515 inode->i_size = start; 511 516 ··· 915 910 int hostfs_link_readpage(struct file *file, struct page *page) 916 911 { 917 912 char *buffer, *name; 918 - long long start; 919 913 int err; 920 914 921 - start = page->index << PAGE_CACHE_SHIFT; 922 915 buffer = kmap(page); 923 916 name = inode_name(page->mapping->host, 0); 924 917 if(name == NULL) return(-ENOMEM);
+4
fs/lockd/clntlock.c
··· 157 157 inode = fl->fl_file->f_dentry->d_inode; 158 158 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) 159 159 continue; 160 + if (fl->fl_u.nfs_fl.owner == NULL) 161 + continue; 160 162 if (fl->fl_u.nfs_fl.owner->host != host) 161 163 continue; 162 164 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED)) ··· 227 225 228 226 inode = fl->fl_file->f_dentry->d_inode; 229 227 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) 228 + continue; 229 + if (fl->fl_u.nfs_fl.owner == NULL) 230 230 continue; 231 231 if (fl->fl_u.nfs_fl.owner->host != host) 232 232 continue;
+6 -18
fs/nfs/direct.c
··· 678 678 if (!count) 679 679 goto out; 680 680 681 - if (mapping->nrpages) { 682 - retval = filemap_fdatawrite(mapping); 683 - if (retval == 0) 684 - retval = nfs_wb_all(inode); 685 - if (retval == 0) 686 - retval = filemap_fdatawait(mapping); 687 - if (retval) 688 - goto out; 689 - } 681 + retval = nfs_sync_mapping(mapping); 682 + if (retval) 683 + goto out; 690 684 691 685 retval = nfs_direct_read(inode, ctx, &iov, pos, 1); 692 686 if (retval > 0) ··· 758 764 if (!count) 759 765 goto out; 760 766 761 - if (mapping->nrpages) { 762 - retval = filemap_fdatawrite(mapping); 763 - if (retval == 0) 764 - retval = nfs_wb_all(inode); 765 - if (retval == 0) 766 - retval = filemap_fdatawait(mapping); 767 - if (retval) 768 - goto out; 769 - } 767 + retval = nfs_sync_mapping(mapping); 768 + if (retval) 769 + goto out; 770 770 771 771 retval = nfs_direct_write(inode, ctx, &iov, pos, 1); 772 772 if (mapping->nrpages)
+6 -20
fs/nfs/file.c
··· 433 433 * Flush all pending writes before doing anything 434 434 * with locks.. 435 435 */ 436 - filemap_fdatawrite(filp->f_mapping); 437 - down(&inode->i_sem); 438 - nfs_wb_all(inode); 439 - up(&inode->i_sem); 440 - filemap_fdatawait(filp->f_mapping); 436 + nfs_sync_mapping(filp->f_mapping); 441 437 442 438 /* NOTE: special case 443 439 * If we're signalled while cleaning up locks on process exit, we ··· 461 465 * Flush all pending writes before doing anything 462 466 * with locks.. 463 467 */ 464 - status = filemap_fdatawrite(filp->f_mapping); 465 - if (status == 0) { 466 - down(&inode->i_sem); 467 - status = nfs_wb_all(inode); 468 - up(&inode->i_sem); 469 - if (status == 0) 470 - status = filemap_fdatawait(filp->f_mapping); 471 - } 472 - if (status < 0) 468 + status = nfs_sync_mapping(filp->f_mapping); 469 + if (status != 0) 473 470 goto out; 474 471 475 472 lock_kernel(); ··· 486 497 * Make sure we clear the cache whenever we try to get the lock. 487 498 * This makes locking act as a cache coherency point. 488 499 */ 489 - filemap_fdatawrite(filp->f_mapping); 490 - down(&inode->i_sem); 491 - nfs_wb_all(inode); /* we may have slept */ 492 - up(&inode->i_sem); 493 - filemap_fdatawait(filp->f_mapping); 500 + nfs_sync_mapping(filp->f_mapping); 494 501 nfs_zap_caches(inode); 495 502 out: 496 503 rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset); ··· 509 524 return -EINVAL; 510 525 511 526 /* No mandatory locks over NFS */ 512 - if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) 527 + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID && 528 + fl->fl_type != F_UNLCK) 513 529 return -ENOLCK; 514 530 515 531 if (IS_GETLK(cmd))
+23 -5
fs/nfs/inode.c
··· 640 640 return 0; 641 641 } 642 642 643 + /** 644 + * nfs_sync_mapping - helper to flush all mmapped dirty data to disk 645 + */ 646 + int nfs_sync_mapping(struct address_space *mapping) 647 + { 648 + int ret; 649 + 650 + if (mapping->nrpages == 0) 651 + return 0; 652 + unmap_mapping_range(mapping, 0, 0, 0); 653 + ret = filemap_fdatawrite(mapping); 654 + if (ret != 0) 655 + goto out; 656 + ret = filemap_fdatawait(mapping); 657 + if (ret != 0) 658 + goto out; 659 + ret = nfs_wb_all(mapping->host); 660 + out: 661 + return ret; 662 + } 663 + 643 664 /* 644 665 * Invalidate the local caches 645 666 */ ··· 1200 1179 struct nfs_inode *nfsi = NFS_I(inode); 1201 1180 1202 1181 if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { 1203 - if (S_ISREG(inode->i_mode)) { 1204 - if (filemap_fdatawrite(mapping) == 0) 1205 - filemap_fdatawait(mapping); 1206 - nfs_wb_all(inode); 1207 - } 1182 + if (S_ISREG(inode->i_mode)) 1183 + nfs_sync_mapping(mapping); 1208 1184 invalidate_inode_pages2(mapping); 1209 1185 1210 1186 spin_lock(&inode->i_lock);
+1 -1
fs/nfsd/nfs2acl.c
··· 107 107 dprintk("nfsd: SETACL(2acl) %s\n", SVCFH_fmt(&argp->fh)); 108 108 109 109 fh = fh_copy(&resp->fh, &argp->fh); 110 - nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP); 110 + nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR); 111 111 112 112 if (!nfserr) { 113 113 nfserr = nfserrno( nfsd_set_posix_acl(
+1 -1
fs/nfsd/nfs3acl.c
··· 101 101 int nfserr = 0; 102 102 103 103 fh = fh_copy(&resp->fh, &argp->fh); 104 - nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP); 104 + nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR); 105 105 106 106 if (!nfserr) { 107 107 nfserr = nfserrno( nfsd_set_posix_acl(
+1 -1
fs/partitions/Kconfig
··· 203 203 204 204 config SUN_PARTITION 205 205 bool "Sun partition tables support" if PARTITION_ADVANCED 206 - default y if (SPARC32 || SPARC64 || SUN3 || SUN3X) 206 + default y if (SPARC || SUN3 || SUN3X) 207 207 ---help--- 208 208 Like most systems, SunOS uses its own hard disk partition table 209 209 format, incompatible with all others. Saying Y here allows you to
+23 -24
fs/proc/generic.c
··· 54 54 ssize_t n, count; 55 55 char *start; 56 56 struct proc_dir_entry * dp; 57 + unsigned long long pos; 58 + 59 + /* 60 + * Gaah, please just use "seq_file" instead. The legacy /proc 61 + * interfaces cut loff_t down to off_t for reads, and ignore 62 + * the offset entirely for writes.. 63 + */ 64 + pos = *ppos; 65 + if (pos > MAX_NON_LFS) 66 + return 0; 67 + if (nbytes > MAX_NON_LFS - pos) 68 + nbytes = MAX_NON_LFS - pos; 57 69 58 70 dp = PDE(inode); 59 71 if (!(page = (char*) __get_free_page(GFP_KERNEL))) ··· 214 202 static loff_t 215 203 proc_file_lseek(struct file *file, loff_t offset, int orig) 216 204 { 217 - lock_kernel(); 218 - 219 - switch (orig) { 220 - case 0: 221 - if (offset < 0) 222 - goto out; 223 - file->f_pos = offset; 224 - unlock_kernel(); 225 - return(file->f_pos); 226 - case 1: 227 - if (offset + file->f_pos < 0) 228 - goto out; 229 - file->f_pos += offset; 230 - unlock_kernel(); 231 - return(file->f_pos); 232 - case 2: 233 - goto out; 234 - default: 235 - goto out; 236 - } 237 - 238 - out: 239 - unlock_kernel(); 240 - return -EINVAL; 205 + loff_t retval = -EINVAL; 206 + switch (orig) { 207 + case 1: 208 + offset += file->f_pos; 209 + /* fallthrough */ 210 + case 0: 211 + if (offset < 0 || offset > MAX_NON_LFS) 212 + break; 213 + file->f_pos = retval = offset; 214 + } 215 + return retval; 241 216 } 242 217 243 218 static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
+18 -8
fs/reiserfs/inode.c
··· 32 32 JOURNAL_PER_BALANCE_CNT * 2 + 33 33 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb); 34 34 struct reiserfs_transaction_handle th; 35 + int err; 35 36 36 37 truncate_inode_pages(&inode->i_data, 0); 37 38 ··· 50 49 } 51 50 reiserfs_update_inode_transaction(inode); 52 51 53 - if (reiserfs_delete_object(&th, inode)) { 54 - up(&inode->i_sem); 55 - goto out; 56 - } 52 + err = reiserfs_delete_object(&th, inode); 57 53 58 54 /* Do quota update inside a transaction for journaled quotas. We must do that 59 55 * after delete_object so that quota updates go into the same transaction as 60 56 * stat data deletion */ 61 - DQUOT_FREE_INODE(inode); 57 + if (!err) 58 + DQUOT_FREE_INODE(inode); 62 59 63 60 if (journal_end(&th, inode->i_sb, jbegin_count)) { 64 61 up(&inode->i_sem); ··· 64 65 } 65 66 66 67 up(&inode->i_sem); 68 + 69 + /* check return value from reiserfs_delete_object after 70 + * ending the transaction 71 + */ 72 + if (err) 73 + goto out; 67 74 68 75 /* all items of file are deleted, so we can remove "save" link */ 69 76 remove_save_link(inode, 0 /* not truncate */ ); /* we can't do anything ··· 2104 2099 struct page *page = NULL; 2105 2100 int error; 2106 2101 struct buffer_head *bh = NULL; 2102 + int err2; 2107 2103 2108 2104 reiserfs_write_lock(p_s_inode->i_sb); 2109 2105 ··· 2142 2136 transaction of truncating gets committed - on reboot the file 2143 2137 either appears truncated properly or not truncated at all */ 2144 2138 add_save_link(&th, p_s_inode, 1); 2145 - error = reiserfs_do_truncate(&th, p_s_inode, page, update_timestamps); 2146 - if (error) 2147 - goto out; 2139 + err2 = reiserfs_do_truncate(&th, p_s_inode, page, update_timestamps); 2148 2140 error = 2149 2141 journal_end(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 + 1); 2150 2142 if (error) 2151 2143 goto out; 2152 2144 2145 + /* check reiserfs_do_truncate after ending the transaction */ 2146 + if (err2) { 2147 + error = err2; 2148 + goto out; 2149 + } 2150 + 2153 2151 if (update_timestamps) { 2154 2152 error = remove_save_link(p_s_inode, 1 /* truncate */ ); 2155 2153 if (error)
+14 -4
fs/reiserfs/journal.c
··· 1039 1039 } 1040 1040 atomic_dec(&journal->j_async_throttle); 1041 1041 1042 + /* We're skipping the commit if there's an error */ 1043 + if (retval || reiserfs_is_journal_aborted(journal)) 1044 + barrier = 0; 1045 + 1042 1046 /* wait on everything written so far before writing the commit 1043 1047 * if we are in barrier mode, send the commit down now 1044 1048 */ ··· 1081 1077 BUG_ON(atomic_read(&(jl->j_commit_left)) != 1); 1082 1078 1083 1079 if (!barrier) { 1084 - if (buffer_dirty(jl->j_commit_bh)) 1085 - BUG(); 1086 - mark_buffer_dirty(jl->j_commit_bh); 1087 - sync_dirty_buffer(jl->j_commit_bh); 1080 + /* If there was a write error in the journal - we can't commit 1081 + * this transaction - it will be invalid and, if successful, 1082 + * will just end up propogating the write error out to 1083 + * the file system. */ 1084 + if (likely(!retval && !reiserfs_is_journal_aborted (journal))) { 1085 + if (buffer_dirty(jl->j_commit_bh)) 1086 + BUG(); 1087 + mark_buffer_dirty(jl->j_commit_bh) ; 1088 + sync_dirty_buffer(jl->j_commit_bh) ; 1089 + } 1088 1090 } else 1089 1091 wait_on_buffer(jl->j_commit_bh); 1090 1092
+6 -2
fs/relayfs/relay.c
··· 333 333 return length; 334 334 335 335 toobig: 336 - printk(KERN_WARNING "relayfs: event too large (%Zd)\n", length); 337 - WARN_ON(1); 336 + buf->chan->last_toobig = length; 338 337 return 0; 339 338 } 340 339 ··· 397 398 continue; 398 399 relay_close_buf(chan->buf[i]); 399 400 } 401 + 402 + if (chan->last_toobig) 403 + printk(KERN_WARNING "relayfs: one or more items not logged " 404 + "[item size (%Zd) > sub-buffer size (%Zd)]\n", 405 + chan->last_toobig, chan->subbuf_size); 400 406 401 407 kref_put(&chan->kref, relay_destroy_channel); 402 408 }
+2 -2
fs/xfs/quota/xfs_qm.c
··· 78 78 79 79 STATIC int xfs_qm_init_quotainos(xfs_mount_t *); 80 80 STATIC int xfs_qm_init_quotainfo(xfs_mount_t *); 81 - STATIC int xfs_qm_shake(int, unsigned int); 81 + STATIC int xfs_qm_shake(int, gfp_t); 82 82 83 83 #ifdef DEBUG 84 84 extern mutex_t qcheck_lock; ··· 2197 2197 */ 2198 2198 /* ARGSUSED */ 2199 2199 STATIC int 2200 - xfs_qm_shake(int nr_to_scan, unsigned int gfp_mask) 2200 + xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask) 2201 2201 { 2202 2202 int ndqused, nfree, n; 2203 2203
+1 -1
include/acpi/acglobal.h
··· 211 211 ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 212 212 ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 213 213 ACPI_EXTERN u32 acpi_gbl_ps_find_count; 214 - ACPI_EXTERN u32 acpi_gbl_owner_id_mask; 214 + ACPI_EXTERN u64 acpi_gbl_owner_id_mask; 215 215 ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 216 216 ACPI_EXTERN u16 acpi_gbl_global_lock_handle; 217 217 ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
+2
include/asm-arm/elf.h
··· 22 22 #define R_ARM_NONE 0 23 23 #define R_ARM_PC24 1 24 24 #define R_ARM_ABS32 2 25 + #define R_ARM_CALL 28 26 + #define R_ARM_JUMP24 29 25 27 26 28 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) 27 29 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+1 -2
include/asm-i386/param.h
··· 1 - #include <linux/config.h> 2 - 3 1 #ifndef _ASMi386_PARAM_H 4 2 #define _ASMi386_PARAM_H 5 3 6 4 #ifdef __KERNEL__ 5 + # include <linux/config.h> 7 6 # define HZ CONFIG_HZ /* Internal kernel timer frequency */ 8 7 # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 9 8 # define CLOCKS_PER_SEC (USER_HZ) /* like times() */
+1 -9
include/asm-ia64/delay.h
··· 84 84 ia64_delay_loop (loops - 1); 85 85 } 86 86 87 - static __inline__ void 88 - udelay (unsigned long usecs) 89 - { 90 - unsigned long start = ia64_get_itc(); 91 - unsigned long cycles = usecs*local_cpu_data->cyc_per_usec; 92 - 93 - while (ia64_get_itc() - start < cycles) 94 - cpu_relax(); 95 - } 87 + extern void udelay (unsigned long usecs); 96 88 97 89 #endif /* _ASM_IA64_DELAY_H */
+1 -1
include/asm-ia64/topology.h
··· 38 38 /* 39 39 * Returns the number of the first CPU on Node 'node'. 40 40 */ 41 - #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) 41 + #define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) 42 42 43 43 /* 44 44 * Determines the node for a given pci bus
+8 -14
include/asm-mips/mach-au1x00/au1xxx_ide.h
··· 74 74 u8 white_list, black_list; 75 75 struct dbdma_cmd *dma_table_cpu; 76 76 dma_addr_t dma_table_dma; 77 - struct scatterlist *sg_table; 78 - int sg_nents; 79 - int sg_dma_direction; 80 77 #endif 81 78 struct device *dev; 82 79 int irq; ··· 84 87 } _auide_hwif; 85 88 86 89 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 87 - struct drive_list_entry { 88 - const char * id_model; 89 - const char * id_firmware; 90 - }; 91 - 92 90 /* HD white list */ 93 91 static const struct drive_list_entry dma_white_list [] = { 94 92 /* ··· 159 167 * Multi-Word DMA + DbDMA functions 160 168 */ 161 169 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 162 - 163 - static int in_drive_list(struct hd_driveid *id, 164 - const struct drive_list_entry *drive_table); 165 170 static int auide_build_sglist(ide_drive_t *drive, struct request *rq); 166 171 static int auide_build_dmatable(ide_drive_t *drive); 167 172 static int auide_dma_end(ide_drive_t *drive); 168 - static void auide_dma_start(ide_drive_t *drive ); 169 173 ide_startstop_t auide_dma_intr (ide_drive_t *drive); 170 174 static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command); 171 175 static int auide_dma_setup(ide_drive_t *drive); ··· 176 188 static void auide_ddma_rx_callback(int irq, void *param, 177 189 struct pt_regs *regs); 178 190 static int auide_dma_off_quietly(ide_drive_t *drive); 179 - static int auide_dma_timeout(ide_drive_t *drive); 180 - 181 191 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 182 192 183 193 /******************************************************************************* ··· 285 299 #define SBC_IDE_MDMA2_TPM (0x00<<6) 286 300 #define SBC_IDE_MDMA2_TA (0x12<<0) 287 301 302 + #define SBC_IDE_TIMING(mode) \ 303 + SBC_IDE_##mode##_TWCS | \ 304 + SBC_IDE_##mode##_TCSH | \ 305 + SBC_IDE_##mode##_TCSOFF | \ 306 + SBC_IDE_##mode##_TWP | \ 307 + SBC_IDE_##mode##_TCSW | \ 308 + SBC_IDE_##mode##_TPM | \ 309 + SBC_IDE_##mode##_TA
-3
include/asm-ppc/ppc4xx_dma.h
··· 33 33 34 34 #define MAX_PPC4xx_DMA_CHANNELS 4 35 35 36 - /* in arch/ppc/kernel/setup.c -- Cort */ 37 - extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ; 38 - 39 36 /* 40 37 * Function return status codes 41 38 * These values are used to indicate whether or not the function
+1 -1
include/asm-sparc/memreg.h
··· 36 36 37 37 /* Memory parity error register with associated bit constants. */ 38 38 #ifndef __ASSEMBLY__ 39 - extern __volatile__ unsigned long *sun4c_memerr_reg; 39 + extern __volatile__ unsigned long __iomem *sun4c_memerr_reg; 40 40 #endif 41 41 42 42 #define SUN4C_MPE_ERROR 0x80 /* Parity error detected. (ro) */
+3 -3
include/asm-sparc/pcic.h
··· 16 16 #include <asm/pbm.h> 17 17 18 18 struct linux_pcic { 19 - void * __iomem pcic_regs; 19 + void __iomem *pcic_regs; 20 20 unsigned long pcic_io; 21 - void * __iomem pcic_config_space_addr; 22 - void * __iomem pcic_config_space_data; 21 + void __iomem *pcic_config_space_addr; 22 + void __iomem *pcic_config_space_data; 23 23 struct resource pcic_res_regs; 24 24 struct resource pcic_res_io; 25 25 struct resource pcic_res_cfg_addr;
+1 -2
include/asm-x86_64/param.h
··· 1 - #include <linux/config.h> 2 - 3 1 #ifndef _ASMx86_64_PARAM_H 4 2 #define _ASMx86_64_PARAM_H 5 3 6 4 #ifdef __KERNEL__ 5 + # include <linux/config.h> 7 6 # define HZ CONFIG_HZ /* Internal kernel timer frequency */ 8 7 # define USER_HZ 100 /* .. some user interfaces are in "ticks */ 9 8 #define CLOCKS_PER_SEC (USER_HZ) /* like times() */
+1 -1
include/asm-x86_64/rwlock.h
··· 64 64 ::"a" (rw) : "memory") 65 65 66 66 #define __build_write_lock_const(rw, helper) \ 67 - asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ 67 + asm volatile(LOCK "subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ 68 68 "jnz 2f\n" \ 69 69 "1:\n" \ 70 70 LOCK_SECTION_START("") \
+1 -1
include/asm-x86_64/topology.h
··· 23 23 24 24 #define cpu_to_node(cpu) (cpu_to_node[cpu]) 25 25 #define parent_node(node) (node) 26 - #define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) 26 + #define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node])) 27 27 #define node_to_cpumask(node) (node_to_cpumask[node]) 28 28 #define pcibus_to_node(bus) ((long)(bus->sysdata)) 29 29 #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
+1 -1
include/linux/cache.h
··· 13 13 #define SMP_CACHE_BYTES L1_CACHE_BYTES 14 14 #endif 15 15 16 - #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) 16 + #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) 17 17 #define __read_mostly __attribute__((__section__(".data.read_mostly"))) 18 18 #else 19 19 #define __read_mostly
+6 -125
include/linux/ide.h
··· 23 23 #include <asm/io.h> 24 24 #include <asm/semaphore.h> 25 25 26 - /* 27 - * This is the multiple IDE interface driver, as evolved from hd.c. 28 - * It supports up to four IDE interfaces, on one or more IRQs (usually 14 & 15). 29 - * There can be up to two drives per interface, as per the ATA-2 spec. 30 - * 31 - * Primary i/f: ide0: major=3; (hda) minor=0; (hdb) minor=64 32 - * Secondary i/f: ide1: major=22; (hdc or hd1a) minor=0; (hdd or hd1b) minor=64 33 - * Tertiary i/f: ide2: major=33; (hde) minor=0; (hdf) minor=64 34 - * Quaternary i/f: ide3: major=34; (hdg) minor=0; (hdh) minor=64 35 - */ 36 - 37 26 /****************************************************************************** 38 27 * IDE driver configuration options (play with these as desired): 39 28 * ··· 181 192 #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ 182 193 #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ 183 194 #define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ 184 - 185 - #define HOST(hwif,chipset) \ 186 - { \ 187 - return ((hwif)->chipset == chipset) ? 1 : 0; \ 188 - } 189 195 190 196 /* 191 197 * Check for an interrupt and acknowledge the interrupt status ··· 375 391 } ata_nsector_t, ata_data_t, atapi_bcount_t, ata_index_t; 376 392 377 393 /* 378 - * ATA-IDE Error Register 379 - * 380 - * mark : Bad address mark 381 - * tzero : Couldn't find track 0 382 - * abrt : Aborted Command 383 - * mcr : Media Change Request 384 - * id : ID field not found 385 - * mce : Media Change Event 386 - * ecc : Uncorrectable ECC error 387 - * bdd : dual meaing 388 - */ 389 - typedef union { 390 - unsigned all :8; 391 - struct { 392 - #if defined(__LITTLE_ENDIAN_BITFIELD) 393 - unsigned mark :1; 394 - unsigned tzero :1; 395 - unsigned abrt :1; 396 - unsigned mcr :1; 397 - unsigned id :1; 398 - unsigned mce :1; 399 - unsigned ecc :1; 400 - unsigned bdd :1; 401 - #elif defined(__BIG_ENDIAN_BITFIELD) 402 - unsigned bdd :1; 403 - unsigned ecc :1; 404 - unsigned mce :1; 405 - unsigned id :1; 406 - unsigned mcr :1; 407 - unsigned abrt :1; 408 - unsigned tzero :1; 409 - unsigned mark :1; 410 - #else 411 - #error "Please fix <asm/byteorder.h>" 412 - #endif 413 - } b; 414 - } ata_error_t; 415 - 416 - /* 417 394 * ATA-IDE Select Register, aka Device-Head 418 395 * 419 396 * head : always zeros here ··· 447 502 #endif 448 503 } b; 449 504 } ata_status_t, atapi_status_t; 450 - 451 - /* 452 - * ATA-IDE Control Register 453 - * 454 - * bit0 : Should be set to zero 455 - * nIEN : device INTRQ to host 456 - * SRST : host soft reset bit 457 - * bit3 : ATA-2 thingy, Should be set to 1 458 - * reserved456 : Reserved 459 - * HOB : 48-bit address ordering, High Ordered Bit 460 - */ 461 - typedef union { 462 - unsigned all : 8; 463 - struct { 464 - #if defined(__LITTLE_ENDIAN_BITFIELD) 465 - unsigned bit0 : 1; 466 - unsigned nIEN : 1; 467 - unsigned SRST : 1; 468 - unsigned bit3 : 1; 469 - unsigned reserved456 : 3; 470 - unsigned HOB : 1; 471 - #elif defined(__BIG_ENDIAN_BITFIELD) 472 - unsigned HOB : 1; 473 - unsigned reserved456 : 3; 474 - unsigned bit3 : 1; 475 - unsigned SRST : 1; 476 - unsigned nIEN : 1; 477 - unsigned bit0 : 1; 478 - #else 479 - #error "Please fix <asm/byteorder.h>" 480 - #endif 481 - } b; 482 - } ata_control_t; 483 505 484 506 /* 485 507 * ATAPI Feature Register ··· 528 616 #endif 529 617 } b; 530 618 } atapi_error_t; 531 - 532 - /* 533 - * ATAPI floppy Drive Select Register 534 - * 535 - * sam_lun : Logical unit number 536 - * reserved3 : Reserved 537 - * drv : The responding drive will be drive 0 (0) or drive 1 (1) 538 - * one5 : Should be set to 1 539 - * reserved6 : Reserved 540 - * one7 : Should be set to 1 541 - */ 542 - typedef union { 543 - unsigned all :8; 544 - struct { 545 - #if defined(__LITTLE_ENDIAN_BITFIELD) 546 - unsigned sam_lun :3; 547 - unsigned reserved3 :1; 548 - unsigned drv :1; 549 - unsigned one5 :1; 550 - unsigned reserved6 :1; 551 - unsigned one7 :1; 552 - #elif defined(__BIG_ENDIAN_BITFIELD) 553 - unsigned one7 :1; 554 - unsigned reserved6 :1; 555 - unsigned one5 :1; 556 - unsigned drv :1; 557 - unsigned reserved3 :1; 558 - unsigned sam_lun :3; 559 - #else 560 - #error "Please fix <asm/byteorder.h>" 561 - #endif 562 - } b; 563 - } atapi_select_t; 564 619 565 620 /* 566 621 * Status returned from various ide_ functions ··· 980 1101 int (*end_request)(ide_drive_t *, int, int); 981 1102 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); 982 1103 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); 983 - int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); 984 1104 ide_proc_entry_t *proc; 985 - void (*ata_prebuilder)(ide_drive_t *); 986 - void (*atapi_prebuilder)(ide_drive_t *); 987 1105 struct device_driver gen_driver; 988 1106 } ide_driver_t; 989 1107 ··· 1174 1298 extern void ide_timer_expiry(unsigned long); 1175 1299 extern irqreturn_t ide_intr(int irq, void *dev_id, struct pt_regs *regs); 1176 1300 extern void do_ide_request(request_queue_t *); 1177 - extern void ide_init_subdrivers(void); 1178 1301 1179 1302 void ide_init_disk(struct gendisk *, ide_drive_t *); 1180 1303 ··· 1246 1371 #define GOOD_DMA_DRIVE 1 1247 1372 1248 1373 #ifdef CONFIG_BLK_DEV_IDEDMA 1374 + struct drive_list_entry { 1375 + const char *id_model; 1376 + const char *id_firmware; 1377 + }; 1378 + 1379 + int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); 1249 1380 int __ide_dma_bad_drive(ide_drive_t *); 1250 1381 int __ide_dma_good_drive(ide_drive_t *); 1251 1382 int ide_use_dma(ide_drive_t *);
+1
include/linux/ipv6_route.h
··· 18 18 fallback, no routers on link */ 19 19 #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ 20 20 #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ 21 + #define RTF_ANYCAST 0x00100000 /* Anycast */ 21 22 22 23 #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ 23 24 #define RTF_EXPIRES 0x00400000
+1 -1
include/linux/irq.h
··· 10 10 */ 11 11 12 12 #include <linux/config.h> 13 - #include <asm/smp.h> /* cpu_online_map */ 13 + #include <linux/smp.h> 14 14 15 15 #if !defined(CONFIG_ARCH_S390) 16 16
+1
include/linux/mm.h
··· 163 163 #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 164 164 #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 165 165 #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 166 + #define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ 166 167 167 168 #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 168 169 #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
+2 -3
include/linux/mtd/onenand.h
··· 17 17 #include <linux/mtd/bbm.h> 18 18 19 19 #define MAX_BUFFERRAM 2 20 - #define MAX_ONENAND_PAGESIZE (2048 + 64) 21 20 22 21 /* Scan and identify a OneNAND device */ 23 22 extern int onenand_scan(struct mtd_info *mtd, int max_chips); ··· 109 110 spinlock_t chip_lock; 110 111 wait_queue_head_t wq; 111 112 onenand_state_t state; 113 + unsigned char *page_buf; 112 114 113 115 struct nand_oobinfo *autooob; 114 116 ··· 134 134 * Options bits 135 135 */ 136 136 #define ONENAND_CONT_LOCK (0x0001) 137 - 137 + #define ONENAND_PAGEBUF_ALLOC (0x1000) 138 138 139 139 /* 140 140 * OneNAND Flash Manufacturer ID Codes 141 141 */ 142 142 #define ONENAND_MFR_SAMSUNG 0xec 143 - #define ONENAND_MFR_UNKNOWN 0x00 144 143 145 144 /** 146 145 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
+13 -7
include/linux/n_r3964.h
··· 13 13 * L. Haag 14 14 * 15 15 * $Log: r3964.h,v $ 16 + * Revision 1.4 2005/12/21 19:54:24 Kurt Huwig <kurt huwig de> 17 + * Fixed HZ usage on 2.6 kernels 18 + * Removed unnecessary include 19 + * 16 20 * Revision 1.3 2001/03/18 13:02:24 dwmw2 17 21 * Fix timer usage, use spinlocks properly. 18 22 * ··· 49 45 #define __LINUX_N_R3964_H__ 50 46 51 47 /* line disciplines for r3964 protocol */ 52 - #include <asm/termios.h> 53 48 54 49 #ifdef __KERNEL__ 50 + 51 + #include <linux/param.h> 52 + 55 53 /* 56 54 * Common ascii handshake characters: 57 55 */ ··· 64 58 #define NAK 0x15 65 59 66 60 /* 67 - * Timeouts (msecs/10 msecs per timer interrupt): 61 + * Timeouts (from milliseconds to jiffies) 68 62 */ 69 63 70 - #define R3964_TO_QVZ 550/10 71 - #define R3964_TO_ZVZ 220/10 72 - #define R3964_TO_NO_BUF 400/10 73 - #define R3964_NO_TX_ROOM 100/10 74 - #define R3964_TO_RX_PANIC 4000/10 64 + #define R3964_TO_QVZ ((550)*HZ/1000) 65 + #define R3964_TO_ZVZ ((220)*HZ/1000) 66 + #define R3964_TO_NO_BUF ((400)*HZ/1000) 67 + #define R3964_NO_TX_ROOM ((100)*HZ/1000) 68 + #define R3964_TO_RX_PANIC ((4000)*HZ/1000) 75 69 #define R3964_MAX_RETRIES 5 76 70 77 71 #endif
+1
include/linux/nfs_fs.h
··· 291 291 /* 292 292 * linux/fs/nfs/inode.c 293 293 */ 294 + extern int nfs_sync_mapping(struct address_space *mapping); 294 295 extern void nfs_zap_caches(struct inode *); 295 296 extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 296 297 struct nfs_fattr *);
+1
include/linux/pci_ids.h
··· 1244 1244 #define PCI_DEVICE_ID_VIA_8378_0 0x3205 1245 1245 #define PCI_DEVICE_ID_VIA_8783_0 0x3208 1246 1246 #define PCI_DEVICE_ID_VIA_8237 0x3227 1247 + #define PCI_DEVICE_ID_VIA_8251 0x3287 1247 1248 #define PCI_DEVICE_ID_VIA_3296_0 0x0296 1248 1249 #define PCI_DEVICE_ID_VIA_8231 0x8231 1249 1250 #define PCI_DEVICE_ID_VIA_8231_4 0x8235
+1
include/linux/preempt.h
··· 48 48 #define preempt_enable() \ 49 49 do { \ 50 50 preempt_enable_no_resched(); \ 51 + barrier(); \ 51 52 preempt_check_resched(); \ 52 53 } while (0) 53 54
+3 -2
include/linux/relayfs_fs.h
··· 20 20 #include <linux/kref.h> 21 21 22 22 /* 23 - * Tracks changes to rchan_buf struct 23 + * Tracks changes to rchan/rchan_buf structs 24 24 */ 25 - #define RELAYFS_CHANNEL_VERSION 5 25 + #define RELAYFS_CHANNEL_VERSION 6 26 26 27 27 /* 28 28 * Per-cpu relay channel buffer ··· 60 60 struct rchan_callbacks *cb; /* client callbacks */ 61 61 struct kref kref; /* channel refcount */ 62 62 void *private_data; /* for user-defined data */ 63 + size_t last_toobig; /* tried to log event > subbuf size */ 63 64 struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ 64 65 }; 65 66
+4
include/linux/rtnetlink.h
··· 866 866 #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE 867 867 RTNLGRP_IPV4_ROUTE, 868 868 #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE 869 + RTNLGRP_NOP1, 869 870 RTNLGRP_IPV6_IFADDR, 870 871 #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR 871 872 RTNLGRP_IPV6_MROUTE, ··· 877 876 #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO 878 877 RTNLGRP_DECnet_IFADDR, 879 878 #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR 879 + RTNLGRP_NOP2, 880 880 RTNLGRP_DECnet_ROUTE, 881 881 #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE 882 + RTNLGRP_NOP3, 883 + RTNLGRP_NOP4, 882 884 RTNLGRP_IPV6_PREFIX, 883 885 #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX 884 886 __RTNLGRP_MAX
+2
include/net/if_inet6.h
··· 24 24 #define IF_RA_MANAGED 0x40 25 25 #define IF_RA_RCVD 0x20 26 26 #define IF_RS_SENT 0x10 27 + #define IF_READY 0x80000000 27 28 28 29 /* prefix flags */ 29 30 #define IF_PREFIX_ONLINK 0x01 ··· 83 82 struct in6_addr addr; 84 83 int ifindex; 85 84 struct ipv6_mc_socklist *next; 85 + rwlock_t sflock; 86 86 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 87 87 struct ip6_sf_socklist *sflist; 88 88 };
+1
include/net/xfrm.h
··· 890 890 extern void xfrm_policy_flush(void); 891 891 extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); 892 892 extern int xfrm_flush_bundles(void); 893 + extern void xfrm_flush_all_bundles(void); 893 894 extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family); 894 895 extern void xfrm_init_pmtu(struct dst_entry *dst); 895 896
+1
include/scsi/scsi_cmnd.h
··· 151 151 extern void scsi_put_command(struct scsi_cmnd *); 152 152 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 153 153 extern void scsi_finish_command(struct scsi_cmnd *cmd); 154 + extern void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd, int retries); 154 155 155 156 #endif /* _SCSI_SCSI_CMND_H */
+11
include/scsi/scsi_transport_fc.h
··· 79 79 FC_PORTSTATE_LINKDOWN, 80 80 FC_PORTSTATE_ERROR, 81 81 FC_PORTSTATE_LOOPBACK, 82 + FC_PORTSTATE_DELETED, 82 83 }; 83 84 84 85 ··· 326 325 struct list_head rport_bindings; 327 326 u32 next_rport_number; 328 327 u32 next_target_id; 328 + u8 flags; 329 + struct work_struct rport_del_work; 329 330 }; 331 + 332 + /* values for struct fc_host_attrs "flags" field: */ 333 + #define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 334 + 330 335 331 336 #define fc_host_node_name(x) \ 332 337 (((struct fc_host_attrs *)(x)->shost_data)->node_name) ··· 372 365 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) 373 366 #define fc_host_next_target_id(x) \ 374 367 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) 368 + #define fc_host_flags(x) \ 369 + (((struct fc_host_attrs *)(x)->shost_data)->flags) 370 + #define fc_host_rport_del_work(x) \ 371 + (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) 375 372 376 373 377 374 /* The functions by which the transport class and the driver communicate */
+13 -12
init/Kconfig
··· 256 256 257 257 source "usr/Kconfig" 258 258 259 + config CC_OPTIMIZE_FOR_SIZE 260 + bool "Optimize for size (Look out for broken compilers!)" 261 + default y 262 + depends on ARM || H8300 || EXPERIMENTAL 263 + help 264 + Enabling this option will pass "-Os" instead of "-O2" to gcc 265 + resulting in a smaller kernel. 266 + 267 + WARNING: some versions of gcc may generate incorrect code with this 268 + option. If problems are observed, a gcc upgrade may be needed. 269 + 270 + If unsure, say N. 271 + 259 272 menuconfig EMBEDDED 260 273 bool "Configure standard kernel features (for small systems)" 261 274 help ··· 350 337 help 351 338 Disabling this option will cause the kernel to be built without 352 339 support for epoll family of system calls. 353 - 354 - config CC_OPTIMIZE_FOR_SIZE 355 - bool "Optimize for size" 356 - default y if ARM || H8300 357 - help 358 - Enabling this option will pass "-Os" instead of "-O2" to gcc 359 - resulting in a smaller kernel. 360 - 361 - WARNING: some versions of gcc may generate incorrect code with this 362 - option. If problems are observed, a gcc upgrade may be needed. 363 - 364 - If unsure, say N. 365 340 366 341 config SHMEM 367 342 bool "Use full shmem filesystem" if EMBEDDED
+2
ipc/sem.c
··· 381 381 /* hands-off: q will disappear immediately after 382 382 * writing q->status. 383 383 */ 384 + smp_wmb(); 384 385 q->status = error; 385 386 q = n; 386 387 } else { ··· 462 461 n = q->next; 463 462 q->status = IN_WAKEUP; 464 463 wake_up_process(q->sleeper); /* doesn't sleep */ 464 + smp_wmb(); 465 465 q->status = -EIDRM; /* hands-off q */ 466 466 q = n; 467 467 }
+6
kernel/futex.c
··· 270 270 /* 271 271 * The waiting task can free the futex_q as soon as this is written, 272 272 * without taking any locks. This must come last. 273 + * 274 + * A memory barrier is required here to prevent the following store 275 + * to lock_ptr from getting ahead of the wakeup. Clearing the lock 276 + * at the end of wake_up_all() does not prevent this store from 277 + * moving. 273 278 */ 279 + wmb(); 274 280 q->lock_ptr = NULL; 275 281 } 276 282
+1 -1
kernel/params.c
··· 619 619 620 620 621 621 /* module-related sysfs stuff */ 622 - #ifdef CONFIG_MODULES 622 + #ifdef CONFIG_SYSFS 623 623 624 624 #define to_module_attr(n) container_of(n, struct module_attribute, attr); 625 625 #define to_module_kobject(n) container_of(n, struct module_kobject, kobj);
+16 -13
kernel/sysctl.c
··· 2192 2192 void __user *oldval, size_t __user *oldlenp, 2193 2193 void __user *newval, size_t newlen, void **context) 2194 2194 { 2195 - size_t l, len; 2196 - 2197 2195 if (!table->data || !table->maxlen) 2198 2196 return -ENOTDIR; 2199 2197 2200 2198 if (oldval && oldlenp) { 2201 - if (get_user(len, oldlenp)) 2199 + size_t bufsize; 2200 + if (get_user(bufsize, oldlenp)) 2202 2201 return -EFAULT; 2203 - if (len) { 2204 - l = strlen(table->data); 2205 - if (len > l) len = l; 2206 - if (len >= table->maxlen) 2202 + if (bufsize) { 2203 + size_t len = strlen(table->data), copied; 2204 + 2205 + /* This shouldn't trigger for a well-formed sysctl */ 2206 + if (len > table->maxlen) 2207 2207 len = table->maxlen; 2208 - if(copy_to_user(oldval, table->data, len)) 2208 + 2209 + /* Copy up to a max of bufsize-1 bytes of the string */ 2210 + copied = (len >= bufsize) ? bufsize - 1 : len; 2211 + 2212 + if (copy_to_user(oldval, table->data, copied) || 2213 + put_user(0, (char __user *)(oldval + copied))) 2209 2214 return -EFAULT; 2210 - if(put_user(0, ((char __user *) oldval) + len)) 2211 - return -EFAULT; 2212 - if(put_user(len, oldlenp)) 2215 + if (put_user(len, oldlenp)) 2213 2216 return -EFAULT; 2214 2217 } 2215 2218 } 2216 2219 if (newval && newlen) { 2217 - len = newlen; 2220 + size_t len = newlen; 2218 2221 if (len > table->maxlen) 2219 2222 len = table->maxlen; 2220 2223 if(copy_from_user(table->data, newval, len)) ··· 2226 2223 len--; 2227 2224 ((char *) table->data)[len] = 0; 2228 2225 } 2229 - return 0; 2226 + return 1; 2230 2227 } 2231 2228 2232 2229 /*
+10 -8
lib/spinlock_debug.c
··· 20 20 if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT) 21 21 owner = lock->owner; 22 22 printk("BUG: spinlock %s on CPU#%d, %s/%d\n", 23 - msg, smp_processor_id(), current->comm, current->pid); 23 + msg, raw_smp_processor_id(), 24 + current->comm, current->pid); 24 25 printk(" lock: %p, .magic: %08x, .owner: %s/%d, .owner_cpu: %d\n", 25 26 lock, lock->magic, 26 27 owner ? owner->comm : "<none>", ··· 79 78 if (print_once) { 80 79 print_once = 0; 81 80 printk("BUG: spinlock lockup on CPU#%d, %s/%d, %p\n", 82 - smp_processor_id(), current->comm, current->pid, 83 - lock); 81 + raw_smp_processor_id(), current->comm, 82 + current->pid, lock); 84 83 dump_stack(); 85 84 } 86 85 } ··· 121 120 122 121 if (xchg(&print_once, 0)) { 123 122 printk("BUG: rwlock %s on CPU#%d, %s/%d, %p\n", msg, 124 - smp_processor_id(), current->comm, current->pid, lock); 123 + raw_smp_processor_id(), current->comm, 124 + current->pid, lock); 125 125 dump_stack(); 126 126 #ifdef CONFIG_SMP 127 127 /* ··· 150 148 if (print_once) { 151 149 print_once = 0; 152 150 printk("BUG: read-lock lockup on CPU#%d, %s/%d, %p\n", 153 - smp_processor_id(), current->comm, current->pid, 154 - lock); 151 + raw_smp_processor_id(), current->comm, 152 + current->pid, lock); 155 153 dump_stack(); 156 154 } 157 155 } ··· 222 220 if (print_once) { 223 221 print_once = 0; 224 222 printk("BUG: write-lock lockup on CPU#%d, %s/%d, %p\n", 225 - smp_processor_id(), current->comm, current->pid, 226 - lock); 223 + raw_smp_processor_id(), current->comm, 224 + current->pid, lock); 227 225 dump_stack(); 228 226 } 229 227 }
+3 -2
lib/swiotlb.c
··· 704 704 addr = SG_ENT_VIRT_ADDRESS(sg); 705 705 dev_addr = virt_to_phys(addr); 706 706 if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) { 707 - sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir)); 708 - if (!sg->dma_address) { 707 + void *map = map_single(hwdev, addr, sg->length, dir); 708 + sg->dma_address = virt_to_bus(map); 709 + if (!map) { 709 710 /* Don't panic here, we expect map_sg users 710 711 to do proper error handling. */ 711 712 swiotlb_full(hwdev, sg->length, dir, 0);
+2 -1
mm/memory.c
··· 574 574 * readonly mappings. The tradeoff is that copy_page_range is more 575 575 * efficient than faulting. 576 576 */ 577 - if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP))) { 577 + if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP|VM_INSERTPAGE))) { 578 578 if (!vma->anon_vma) 579 579 return 0; 580 580 } ··· 1228 1228 return -EFAULT; 1229 1229 if (!page_count(page)) 1230 1230 return -EINVAL; 1231 + vma->vm_flags |= VM_INSERTPAGE; 1231 1232 return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot); 1232 1233 } 1233 1234 EXPORT_SYMBOL(vm_insert_page);
+1 -1
mm/memory_hotplug.c
··· 104 104 pgdat->node_start_pfn = start_pfn; 105 105 106 106 if (end_pfn > old_pgdat_end_pfn) 107 - pgdat->node_spanned_pages = end_pfn - pgdat->node_spanned_pages; 107 + pgdat->node_spanned_pages = end_pfn - pgdat->node_start_pfn; 108 108 } 109 109 110 110 int online_pages(unsigned long pfn, unsigned long nr_pages)
+4
mm/mempolicy.c
··· 161 161 switch (mode) { 162 162 case MPOL_INTERLEAVE: 163 163 policy->v.nodes = *nodes; 164 + if (nodes_weight(*nodes) == 0) { 165 + kmem_cache_free(policy_cache, policy); 166 + return ERR_PTR(-EINVAL); 167 + } 164 168 break; 165 169 case MPOL_PREFERRED: 166 170 policy->v.preferred_node = first_node(*nodes);
+1 -1
mm/mmap.c
··· 611 611 * If the vma has a ->close operation then the driver probably needs to release 612 612 * per-vma resources, so we don't attempt to merge those. 613 613 */ 614 - #define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED) 614 + #define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP) 615 615 616 616 static inline int is_mergeable_vma(struct vm_area_struct *vma, 617 617 struct file *file, unsigned long vm_flags)
+1 -1
mm/mremap.c
··· 323 323 /* We can't remap across vm area boundaries */ 324 324 if (old_len > vma->vm_end - addr) 325 325 goto out; 326 - if (vma->vm_flags & VM_DONTEXPAND) { 326 + if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) { 327 327 if (new_len > old_len) 328 328 goto out; 329 329 }
+1 -1
mm/page_alloc.c
··· 1896 1896 static struct notifier_block pageset_notifier = 1897 1897 { &pageset_cpuup_callback, NULL, 0 }; 1898 1898 1899 - void __init setup_per_cpu_pageset() 1899 + void __init setup_per_cpu_pageset(void) 1900 1900 { 1901 1901 int err; 1902 1902
+5 -1
net/8021q/vlan.c
··· 753 753 break; 754 754 case GET_VLAN_REALDEV_NAME_CMD: 755 755 err = vlan_dev_get_realdev_name(args.device1, args.u.device2); 756 + if (err) 757 + goto out; 756 758 if (copy_to_user(arg, &args, 757 759 sizeof(struct vlan_ioctl_args))) { 758 760 err = -EFAULT; ··· 763 761 764 762 case GET_VLAN_VID_CMD: 765 763 err = vlan_dev_get_vid(args.device1, &vid); 764 + if (err) 765 + goto out; 766 766 args.u.VID = vid; 767 767 if (copy_to_user(arg, &args, 768 768 sizeof(struct vlan_ioctl_args))) { ··· 778 774 __FUNCTION__, args.cmd); 779 775 return -EINVAL; 780 776 }; 781 - 777 + out: 782 778 return err; 783 779 } 784 780
+3
net/8021q/vlan_dev.c
··· 165 165 166 166 skb_pull(skb, VLAN_HLEN); /* take off the VLAN header (4 bytes currently) */ 167 167 168 + /* Need to correct hardware checksum */ 169 + skb_postpull_rcsum(skb, vhdr, VLAN_HLEN); 170 + 168 171 /* Ok, lets check to make sure the device (dev) we 169 172 * came in on is what this VLAN is attached to. 170 173 */
+9 -10
net/bridge/br_netfilter.c
··· 295 295 len -= 2; 296 296 297 297 while (len > 0) { 298 - int optlen = raw[off+1]+2; 298 + int optlen = skb->nh.raw[off+1]+2; 299 299 300 300 switch (skb->nh.raw[off]) { 301 301 case IPV6_TLV_PAD0: ··· 308 308 case IPV6_TLV_JUMBO: 309 309 if (skb->nh.raw[off+1] != 4 || (off&3) != 2) 310 310 goto bad; 311 - 312 311 pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2)); 313 - 312 + if (pkt_len <= IPV6_MAXPLEN || 313 + skb->nh.ipv6h->payload_len) 314 + goto bad; 314 315 if (pkt_len > skb->len - sizeof(struct ipv6hdr)) 315 316 goto bad; 316 - if (pkt_len + sizeof(struct ipv6hdr) < skb->len) { 317 - if (__pskb_trim(skb, 318 - pkt_len + sizeof(struct ipv6hdr))) 319 - goto bad; 320 - if (skb->ip_summed == CHECKSUM_HW) 321 - skb->ip_summed = CHECKSUM_NONE; 322 - } 317 + if (pskb_trim_rcsum(skb, 318 + pkt_len+sizeof(struct ipv6hdr))) 319 + goto bad; 323 320 break; 324 321 default: 325 322 if (optlen > len) ··· 369 372 if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb)) 370 373 goto inhdr_error; 371 374 375 + nf_bridge_put(skb->nf_bridge); 372 376 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) 373 377 return NF_DROP; 374 378 setup_pre_routing(skb); ··· 453 455 skb->ip_summed = CHECKSUM_NONE; 454 456 } 455 457 458 + nf_bridge_put(skb->nf_bridge); 456 459 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) 457 460 return NF_DROP; 458 461 setup_pre_routing(skb);
+2 -2
net/core/filter.c
··· 293 293 struct sock_filter *ftest; 294 294 int pc; 295 295 296 - if (((unsigned int)flen >= (~0U / sizeof(struct sock_filter))) || flen == 0) 296 + if (flen == 0 || flen > BPF_MAXINSNS) 297 297 return -EINVAL; 298 298 299 299 /* check the filter code now */ ··· 360 360 int err; 361 361 362 362 /* Make sure new filter is there and in the right amounts. */ 363 - if (fprog->filter == NULL || fprog->len > BPF_MAXINSNS) 363 + if (fprog->filter == NULL) 364 364 return -EINVAL; 365 365 366 366 fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL);
+1 -1
net/dccp/ipv4.c
··· 1251 1251 struct dccp_sock *dp = dccp_sk(sk); 1252 1252 1253 1253 /* 1254 - * DCCP doesn't use sk_qrite_queue, just sk_send_head 1254 + * DCCP doesn't use sk_write_queue, just sk_send_head 1255 1255 * for retransmissions 1256 1256 */ 1257 1257 if (sk->sk_send_head != NULL) {
+1 -1
net/ipv4/ip_gre.c
··· 618 618 619 619 skb->mac.raw = skb->nh.raw; 620 620 skb->nh.raw = __pskb_pull(skb, offset); 621 - skb_postpull_rcsum(skb, skb->mac.raw, offset); 621 + skb_postpull_rcsum(skb, skb->h.raw, offset); 622 622 memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); 623 623 skb->pkt_type = PACKET_HOST; 624 624 #ifdef CONFIG_NET_IPGRE_BROADCAST
+2 -1
net/ipv4/netfilter/Makefile
··· 12 12 13 13 # connection tracking 14 14 obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o 15 + obj-$(CONFIG_IP_NF_NAT) += ip_nat.o 15 16 16 17 # conntrack netlink interface 17 18 obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o ··· 42 41 # the three instances of ip_tables 43 42 obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o 44 43 obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o 45 - obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o ip_nat.o 44 + obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o 46 45 obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o 47 46 48 47 # matches
+1
net/ipv4/xfrm4_policy.c
··· 182 182 case IPPROTO_UDP: 183 183 case IPPROTO_TCP: 184 184 case IPPROTO_SCTP: 185 + case IPPROTO_DCCP: 185 186 if (pskb_may_pull(skb, xprth + 4 - skb->data)) { 186 187 u16 *ports = (u16 *)xprth; 187 188
+117 -20
net/ipv6/addrconf.c
··· 137 137 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); 138 138 static void addrconf_dad_timer(unsigned long data); 139 139 static void addrconf_dad_completed(struct inet6_ifaddr *ifp); 140 + static void addrconf_dad_run(struct inet6_dev *idev); 140 141 static void addrconf_rs_timer(unsigned long data); 141 142 static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); 142 143 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); ··· 380 379 dev->type == ARPHRD_NONE || 381 380 dev->type == ARPHRD_SIT) { 382 381 printk(KERN_INFO 383 - "Disabled Privacy Extensions on device %p(%s)\n", 384 - dev, dev->name); 382 + "%s: Disabled Privacy Extensions\n", 383 + dev->name); 385 384 ndev->cnf.use_tempaddr = -1; 386 385 } else { 387 386 in6_dev_hold(ndev); 388 387 ipv6_regen_rndid((unsigned long) ndev); 389 388 } 390 389 #endif 390 + 391 + if (netif_carrier_ok(dev)) 392 + ndev->if_flags |= IF_READY; 391 393 392 394 write_lock_bh(&addrconf_lock); 393 395 dev->ip6_ptr = ndev; ··· 419 415 if ((idev = ipv6_add_dev(dev)) == NULL) 420 416 return NULL; 421 417 } 418 + 422 419 if (dev->flags&IFF_UP) 423 420 ipv6_mc_up(idev); 424 421 return idev; ··· 639 634 } 640 635 #endif 641 636 642 - for (ifap = &idev->addr_list; (ifa=*ifap) != NULL; 643 - ifap = &ifa->if_next) { 637 + for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;) { 644 638 if (ifa == ifp) { 645 639 *ifap = ifa->if_next; 646 640 __in6_ifa_put(ifp); ··· 647 643 if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) 648 644 break; 649 645 deleted = 1; 646 + continue; 650 647 } else if (ifp->flags & IFA_F_PERMANENT) { 651 648 if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, 652 649 ifp->prefix_len)) { ··· 671 666 } 672 667 } 673 668 } 669 + ifap = &ifa->if_next; 674 670 } 675 671 write_unlock_bh(&idev->lock); 676 672 ··· 909 903 910 904 score.addr_type = __ipv6_addr_type(&ifa->addr); 911 905 912 - /* Rule 0: Candidate Source Address (section 4) 906 + /* Rule 0: 907 + * - Tentative Address (RFC2462 section 5.4) 908 + * - A tentative address is not considered 909 + * "assigned to an interface" in the traditional 910 + * sense. 911 + * - Candidate Source Address (section 4) 913 912 * - In any case, anycast addresses, multicast 914 913 * addresses, and the unspecified address MUST 915 914 * NOT be included in a candidate set. 916 915 */ 916 + if (ifa->flags & IFA_F_TENTATIVE) 917 + continue; 917 918 if (unlikely(score.addr_type == IPV6_ADDR_ANY || 918 919 score.addr_type & IPV6_ADDR_MULTICAST)) { 919 920 LIMIT_NETDEBUG(KERN_DEBUG ··· 1228 1215 1229 1216 /* Gets referenced address, destroys ifaddr */ 1230 1217 1231 - void addrconf_dad_failure(struct inet6_ifaddr *ifp) 1218 + void addrconf_dad_stop(struct inet6_ifaddr *ifp) 1232 1219 { 1233 - if (net_ratelimit()) 1234 - printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); 1235 1220 if (ifp->flags&IFA_F_PERMANENT) { 1236 1221 spin_lock_bh(&ifp->lock); 1237 1222 addrconf_del_timer(ifp); ··· 1255 1244 ipv6_del_addr(ifp); 1256 1245 } 1257 1246 1247 + void addrconf_dad_failure(struct inet6_ifaddr *ifp) 1248 + { 1249 + if (net_ratelimit()) 1250 + printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); 1251 + addrconf_dad_stop(ifp); 1252 + } 1258 1253 1259 1254 /* Join to solicited addr multicast group. */ 1260 1255 ··· 1613 1596 not good. 1614 1597 */ 1615 1598 if (valid_lft >= 0x7FFFFFFF/HZ) 1616 - rt_expires = 0; 1599 + rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ); 1617 1600 else 1618 - rt_expires = jiffies + valid_lft * HZ; 1601 + rt_expires = valid_lft * HZ; 1602 + 1603 + /* 1604 + * We convert this (in jiffies) to clock_t later. 1605 + * Avoid arithmetic overflow there as well. 1606 + * Overflow can happen only if HZ < USER_HZ. 1607 + */ 1608 + if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ) 1609 + rt_expires = 0x7FFFFFFF / USER_HZ; 1619 1610 1620 1611 if (pinfo->onlink) { 1621 1612 struct rt6_info *rt; ··· 1635 1610 ip6_del_rt(rt, NULL, NULL, NULL); 1636 1611 rt = NULL; 1637 1612 } else { 1638 - rt->rt6i_expires = rt_expires; 1613 + rt->rt6i_expires = jiffies + rt_expires; 1639 1614 } 1640 1615 } 1641 1616 } else if (valid_lft) { 1642 1617 addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len, 1643 - dev, rt_expires, RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT); 1618 + dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT); 1644 1619 } 1645 1620 if (rt) 1646 1621 dst_release(&rt->u.dst); ··· 2150 2125 { 2151 2126 struct net_device *dev = (struct net_device *) data; 2152 2127 struct inet6_dev *idev = __in6_dev_get(dev); 2128 + int run_pending = 0; 2153 2129 2154 2130 switch(event) { 2155 2131 case NETDEV_UP: 2132 + case NETDEV_CHANGE: 2133 + if (event == NETDEV_UP) { 2134 + if (!netif_carrier_ok(dev)) { 2135 + /* device is not ready yet. */ 2136 + printk(KERN_INFO 2137 + "ADDRCONF(NETDEV_UP): %s: " 2138 + "link is not ready\n", 2139 + dev->name); 2140 + break; 2141 + } 2142 + } else { 2143 + if (!netif_carrier_ok(dev)) { 2144 + /* device is still not ready. */ 2145 + break; 2146 + } 2147 + 2148 + if (idev) { 2149 + if (idev->if_flags & IF_READY) { 2150 + /* device is already configured. */ 2151 + break; 2152 + } 2153 + idev->if_flags |= IF_READY; 2154 + } 2155 + 2156 + printk(KERN_INFO 2157 + "ADDRCONF(NETDEV_CHANGE): %s: " 2158 + "link becomes ready\n", 2159 + dev->name); 2160 + 2161 + run_pending = 1; 2162 + } 2163 + 2156 2164 switch(dev->type) { 2157 2165 case ARPHRD_SIT: 2158 2166 addrconf_sit_config(dev); ··· 2202 2144 break; 2203 2145 }; 2204 2146 if (idev) { 2147 + if (run_pending) 2148 + addrconf_dad_run(idev); 2149 + 2205 2150 /* If the MTU changed during the interface down, when the 2206 2151 interface up, the changed MTU must be reflected in the 2207 2152 idev as well as routers. ··· 2239 2178 */ 2240 2179 addrconf_ifdown(dev, event != NETDEV_DOWN); 2241 2180 break; 2242 - case NETDEV_CHANGE: 2243 - break; 2181 + 2244 2182 case NETDEV_CHANGENAME: 2245 2183 #ifdef CONFIG_SYSCTL 2246 2184 if (idev) { ··· 2320 2260 2321 2261 /* Step 3: clear flags for stateless addrconf */ 2322 2262 if (how != 1) 2323 - idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD); 2263 + idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); 2324 2264 2325 2265 /* Step 4: clear address list */ 2326 2266 #ifdef CONFIG_IPV6_PRIVACY ··· 2429 2369 /* 2430 2370 * Duplicate Address Detection 2431 2371 */ 2372 + static void addrconf_dad_kick(struct inet6_ifaddr *ifp) 2373 + { 2374 + unsigned long rand_num; 2375 + struct inet6_dev *idev = ifp->idev; 2376 + 2377 + rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); 2378 + ifp->probes = idev->cnf.dad_transmits; 2379 + addrconf_mod_timer(ifp, AC_DAD, rand_num); 2380 + } 2381 + 2432 2382 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) 2433 2383 { 2434 2384 struct inet6_dev *idev = ifp->idev; 2435 2385 struct net_device *dev = idev->dev; 2436 - unsigned long rand_num; 2437 2386 2438 2387 addrconf_join_solict(dev, &ifp->addr); 2439 2388 ··· 2451 2382 flags); 2452 2383 2453 2384 net_srandom(ifp->addr.s6_addr32[3]); 2454 - rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); 2455 2385 2456 2386 read_lock_bh(&idev->lock); 2457 2387 if (ifp->dead) ··· 2467 2399 return; 2468 2400 } 2469 2401 2470 - ifp->probes = idev->cnf.dad_transmits; 2471 - addrconf_mod_timer(ifp, AC_DAD, rand_num); 2472 - 2402 + if (!(idev->if_flags & IF_READY)) { 2403 + spin_unlock_bh(&ifp->lock); 2404 + read_unlock_bh(&idev->lock); 2405 + /* 2406 + * If the defice is not ready: 2407 + * - keep it tentative if it is a permanent address. 2408 + * - otherwise, kill it. 2409 + */ 2410 + in6_ifa_hold(ifp); 2411 + addrconf_dad_stop(ifp); 2412 + return; 2413 + } 2414 + addrconf_dad_kick(ifp); 2473 2415 spin_unlock_bh(&ifp->lock); 2474 2416 out: 2475 2417 read_unlock_bh(&idev->lock); ··· 2560 2482 addrconf_mod_timer(ifp, AC_RS, ifp->idev->cnf.rtr_solicit_interval); 2561 2483 spin_unlock_bh(&ifp->lock); 2562 2484 } 2485 + } 2486 + 2487 + static void addrconf_dad_run(struct inet6_dev *idev) { 2488 + struct inet6_ifaddr *ifp; 2489 + 2490 + read_lock_bh(&idev->lock); 2491 + for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) { 2492 + spin_lock_bh(&ifp->lock); 2493 + if (!(ifp->flags & IFA_F_TENTATIVE)) { 2494 + spin_unlock_bh(&ifp->lock); 2495 + continue; 2496 + } 2497 + spin_unlock_bh(&ifp->lock); 2498 + addrconf_dad_kick(ifp); 2499 + } 2500 + read_unlock_bh(&idev->lock); 2563 2501 } 2564 2502 2565 2503 #ifdef CONFIG_PROC_FS ··· 2783 2689 in6_ifa_hold(ifpub); 2784 2690 spin_unlock(&ifp->lock); 2785 2691 read_unlock(&addrconf_hash_lock); 2692 + spin_lock(&ifpub->lock); 2693 + ifpub->regen_count = 0; 2694 + spin_unlock(&ifpub->lock); 2786 2695 ipv6_create_tempaddr(ifpub, ifp); 2787 2696 in6_ifa_put(ifpub); 2788 2697 in6_ifa_put(ifp);
+14 -2
net/ipv6/icmp.c
··· 328 328 iif = skb->dev->ifindex; 329 329 330 330 /* 331 - * Must not send if we know that source is Anycast also. 332 - * for now we don't know that. 331 + * Must not send error if the source does not uniquely 332 + * identify a single node (RFC2463 Section 2.4). 333 + * We check unspecified / multicast addresses here, 334 + * and anycast addresses will be checked later. 333 335 */ 334 336 if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) { 335 337 LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: addr_any/mcast source\n"); ··· 375 373 err = ip6_dst_lookup(sk, &dst, &fl); 376 374 if (err) 377 375 goto out; 376 + 377 + /* 378 + * We won't send icmp if the destination is known 379 + * anycast. 380 + */ 381 + if (((struct rt6_info *)dst)->rt6i_flags & RTF_ANYCAST) { 382 + LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: acast source\n"); 383 + goto out_dst_release; 384 + } 385 + 378 386 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 379 387 goto out; 380 388
+111 -31
net/ipv6/mcast.c
··· 170 170 #define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value) 171 171 #define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) 172 172 173 - #define IPV6_MLD_MAX_MSF 10 173 + #define IPV6_MLD_MAX_MSF 64 174 174 175 175 int sysctl_mld_max_msf = IPV6_MLD_MAX_MSF; 176 176 ··· 224 224 225 225 mc_lst->ifindex = dev->ifindex; 226 226 mc_lst->sfmode = MCAST_EXCLUDE; 227 + mc_lst->sflock = RW_LOCK_UNLOCKED; 227 228 mc_lst->sflist = NULL; 228 229 229 230 /* ··· 361 360 struct ip6_sf_socklist *psl; 362 361 int i, j, rv; 363 362 int leavegroup = 0; 363 + int pmclocked = 0; 364 364 int err; 365 365 366 366 if (pgsr->gsr_group.ss_family != AF_INET6 || ··· 404 402 ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); 405 403 pmc->sfmode = omode; 406 404 } 405 + 406 + write_lock_bh(&pmc->sflock); 407 + pmclocked = 1; 407 408 408 409 psl = pmc->sflist; 409 410 if (!add) { ··· 480 475 /* update the interface list */ 481 476 ip6_mc_add_src(idev, group, omode, 1, source, 1); 482 477 done: 478 + if (pmclocked) 479 + write_unlock_bh(&pmc->sflock); 483 480 read_unlock_bh(&ipv6_sk_mc_lock); 484 481 read_unlock_bh(&idev->lock); 485 482 in6_dev_put(idev); ··· 517 510 dev = idev->dev; 518 511 519 512 err = 0; 513 + read_lock_bh(&ipv6_sk_mc_lock); 514 + 520 515 if (gsf->gf_fmode == MCAST_INCLUDE && gsf->gf_numsrc == 0) { 521 516 leavegroup = 1; 522 517 goto done; ··· 558 549 newpsl = NULL; 559 550 (void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0); 560 551 } 552 + 553 + write_lock_bh(&pmc->sflock); 561 554 psl = pmc->sflist; 562 555 if (psl) { 563 556 (void) ip6_mc_del_src(idev, group, pmc->sfmode, ··· 569 558 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); 570 559 pmc->sflist = newpsl; 571 560 pmc->sfmode = gsf->gf_fmode; 561 + write_unlock_bh(&pmc->sflock); 572 562 err = 0; 573 563 done: 564 + read_unlock_bh(&ipv6_sk_mc_lock); 574 565 read_unlock_bh(&idev->lock); 575 566 in6_dev_put(idev); 576 567 dev_put(dev); ··· 605 592 dev = idev->dev; 606 593 607 594 err = -EADDRNOTAVAIL; 595 + /* 596 + * changes to the ipv6_mc_list require the socket lock and 597 + * a read lock on ip6_sk_mc_lock. We have the socket lock, 598 + * so reading the list is safe. 599 + */ 608 600 609 601 for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) { 610 602 if (pmc->ifindex != gsf->gf_interface) ··· 632 614 copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) { 633 615 return -EFAULT; 634 616 } 617 + /* changes to psl require the socket lock, a read lock on 618 + * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We 619 + * have the socket lock, so reading here is safe. 620 + */ 635 621 for (i=0; i<copycount; i++) { 636 622 struct sockaddr_in6 *psin6; 637 623 struct sockaddr_storage ss; ··· 672 650 read_unlock(&ipv6_sk_mc_lock); 673 651 return 1; 674 652 } 653 + read_lock(&mc->sflock); 675 654 psl = mc->sflist; 676 655 if (!psl) { 677 656 rv = mc->sfmode == MCAST_EXCLUDE; ··· 688 665 if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count) 689 666 rv = 0; 690 667 } 668 + read_unlock(&mc->sflock); 691 669 read_unlock(&ipv6_sk_mc_lock); 692 670 693 671 return rv; ··· 1092 1068 ma->mca_flags |= MAF_TIMER_RUNNING; 1093 1069 } 1094 1070 1095 - static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, 1071 + /* mark EXCLUDE-mode sources */ 1072 + static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs, 1096 1073 struct in6_addr *srcs) 1097 1074 { 1098 1075 struct ip6_sf_list *psf; ··· 1103 1078 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1104 1079 if (scount == nsrcs) 1105 1080 break; 1106 - for (i=0; i<nsrcs; i++) 1081 + for (i=0; i<nsrcs; i++) { 1082 + /* skip inactive filters */ 1083 + if (pmc->mca_sfcount[MCAST_INCLUDE] || 1084 + pmc->mca_sfcount[MCAST_EXCLUDE] != 1085 + psf->sf_count[MCAST_EXCLUDE]) 1086 + continue; 1087 + if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { 1088 + scount++; 1089 + break; 1090 + } 1091 + } 1092 + } 1093 + pmc->mca_flags &= ~MAF_GSQUERY; 1094 + if (scount == nsrcs) /* all sources excluded */ 1095 + return 0; 1096 + return 1; 1097 + } 1098 + 1099 + static int mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, 1100 + struct in6_addr *srcs) 1101 + { 1102 + struct ip6_sf_list *psf; 1103 + int i, scount; 1104 + 1105 + if (pmc->mca_sfmode == MCAST_EXCLUDE) 1106 + return mld_xmarksources(pmc, nsrcs, srcs); 1107 + 1108 + /* mark INCLUDE-mode sources */ 1109 + 1110 + scount = 0; 1111 + for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1112 + if (scount == nsrcs) 1113 + break; 1114 + for (i=0; i<nsrcs; i++) { 1107 1115 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { 1108 1116 psf->sf_gsresp = 1; 1109 1117 scount++; 1110 1118 break; 1111 1119 } 1120 + } 1112 1121 } 1122 + if (!scount) { 1123 + pmc->mca_flags &= ~MAF_GSQUERY; 1124 + return 0; 1125 + } 1126 + pmc->mca_flags |= MAF_GSQUERY; 1127 + return 1; 1113 1128 } 1114 1129 1115 1130 int igmp6_event_query(struct sk_buff *skb) ··· 1232 1167 /* mark sources to include, if group & source-specific */ 1233 1168 if (mlh2->nsrcs != 0) { 1234 1169 if (!pskb_may_pull(skb, srcs_offset + 1235 - mlh2->nsrcs * sizeof(struct in6_addr))) { 1170 + ntohs(mlh2->nsrcs) * sizeof(struct in6_addr))) { 1236 1171 in6_dev_put(idev); 1237 1172 return -EINVAL; 1238 1173 } ··· 1268 1203 else 1269 1204 ma->mca_flags &= ~MAF_GSQUERY; 1270 1205 } 1271 - if (ma->mca_flags & MAF_GSQUERY) 1272 - mld_marksources(ma, ntohs(mlh2->nsrcs), 1273 - mlh2->srcs); 1274 - igmp6_group_queried(ma, max_delay); 1206 + if (!(ma->mca_flags & MAF_GSQUERY) || 1207 + mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs)) 1208 + igmp6_group_queried(ma, max_delay); 1275 1209 spin_unlock_bh(&ma->mca_lock); 1276 1210 if (group_type != IPV6_ADDR_ANY) 1277 1211 break; ··· 1345 1281 case MLD2_MODE_IS_EXCLUDE: 1346 1282 if (gdeleted || sdeleted) 1347 1283 return 0; 1348 - return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp); 1284 + if (!((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp)) { 1285 + if (pmc->mca_sfmode == MCAST_INCLUDE) 1286 + return 1; 1287 + /* don't include if this source is excluded 1288 + * in all filters 1289 + */ 1290 + if (psf->sf_count[MCAST_INCLUDE]) 1291 + return 0; 1292 + return pmc->mca_sfcount[MCAST_EXCLUDE] == 1293 + psf->sf_count[MCAST_EXCLUDE]; 1294 + } 1295 + return 0; 1349 1296 case MLD2_CHANGE_TO_INCLUDE: 1350 1297 if (gdeleted || sdeleted) 1351 1298 return 0; ··· 1525 1450 struct mld2_report *pmr; 1526 1451 struct mld2_grec *pgr = NULL; 1527 1452 struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list; 1528 - int scount, first, isquery, truncate; 1453 + int scount, stotal, first, isquery, truncate; 1529 1454 1530 1455 if (pmc->mca_flags & MAF_NOREPORT) 1531 1456 return skb; ··· 1535 1460 truncate = type == MLD2_MODE_IS_EXCLUDE || 1536 1461 type == MLD2_CHANGE_TO_EXCLUDE; 1537 1462 1463 + stotal = scount = 0; 1464 + 1538 1465 psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources; 1539 1466 1540 - if (!*psf_list) { 1541 - if (type == MLD2_ALLOW_NEW_SOURCES || 1542 - type == MLD2_BLOCK_OLD_SOURCES) 1543 - return skb; 1544 - if (pmc->mca_crcount || isquery) { 1545 - /* make sure we have room for group header and at 1546 - * least one source. 1547 - */ 1548 - if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+ 1549 - sizeof(struct in6_addr)) { 1550 - mld_sendpack(skb); 1551 - skb = NULL; /* add_grhead will get a new one */ 1552 - } 1553 - skb = add_grhead(skb, pmc, type, &pgr); 1554 - } 1555 - return skb; 1556 - } 1467 + if (!*psf_list) 1468 + goto empty_source; 1469 + 1557 1470 pmr = skb ? (struct mld2_report *)skb->h.raw : NULL; 1558 1471 1559 1472 /* EX and TO_EX get a fresh packet, if needed */ ··· 1554 1491 } 1555 1492 } 1556 1493 first = 1; 1557 - scount = 0; 1558 1494 psf_prev = NULL; 1559 1495 for (psf=*psf_list; psf; psf=psf_next) { 1560 1496 struct in6_addr *psrc; ··· 1587 1525 } 1588 1526 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); 1589 1527 *psrc = psf->sf_addr; 1590 - scount++; 1528 + scount++; stotal++; 1591 1529 if ((type == MLD2_ALLOW_NEW_SOURCES || 1592 1530 type == MLD2_BLOCK_OLD_SOURCES) && psf->sf_crcount) { 1593 1531 psf->sf_crcount--; ··· 1601 1539 } 1602 1540 } 1603 1541 psf_prev = psf; 1542 + } 1543 + 1544 + empty_source: 1545 + if (!stotal) { 1546 + if (type == MLD2_ALLOW_NEW_SOURCES || 1547 + type == MLD2_BLOCK_OLD_SOURCES) 1548 + return skb; 1549 + if (pmc->mca_crcount || isquery) { 1550 + /* make sure we have room for group header */ 1551 + if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)) { 1552 + mld_sendpack(skb); 1553 + skb = NULL; /* add_grhead will get a new one */ 1554 + } 1555 + skb = add_grhead(skb, pmc, type, &pgr); 1556 + } 1604 1557 } 1605 1558 if (pgr) 1606 1559 pgr->grec_nsrcs = htons(scount); ··· 1698 1621 skb = add_grec(skb, pmc, dtype, 1, 1); 1699 1622 } 1700 1623 if (pmc->mca_crcount) { 1701 - pmc->mca_crcount--; 1702 1624 if (pmc->mca_sfmode == MCAST_EXCLUDE) { 1703 1625 type = MLD2_CHANGE_TO_INCLUDE; 1704 1626 skb = add_grec(skb, pmc, type, 1, 0); 1705 1627 } 1628 + pmc->mca_crcount--; 1706 1629 if (pmc->mca_crcount == 0) { 1707 1630 mld_clear_zeros(&pmc->mca_tomb); 1708 1631 mld_clear_zeros(&pmc->mca_sources); ··· 1736 1659 1737 1660 /* filter mode changes */ 1738 1661 if (pmc->mca_crcount) { 1739 - pmc->mca_crcount--; 1740 1662 if (pmc->mca_sfmode == MCAST_EXCLUDE) 1741 1663 type = MLD2_CHANGE_TO_EXCLUDE; 1742 1664 else 1743 1665 type = MLD2_CHANGE_TO_INCLUDE; 1744 1666 skb = add_grec(skb, pmc, type, 0, 0); 1667 + pmc->mca_crcount--; 1745 1668 } 1746 1669 spin_unlock_bh(&pmc->mca_lock); 1747 1670 } ··· 2100 2023 { 2101 2024 int err; 2102 2025 2026 + /* callers have the socket lock and a write lock on ipv6_sk_mc_lock, 2027 + * so no other readers or writers of iml or its sflist 2028 + */ 2103 2029 if (iml->sflist == 0) { 2104 2030 /* any-source empty exclude case */ 2105 2031 return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0);
+1 -1
net/ipv6/netfilter/Kconfig
··· 211 211 212 212 config IP6_NF_TARGET_NFQUEUE 213 213 tristate "NFQUEUE Target Support" 214 - depends on IP_NF_IPTABLES 214 + depends on IP6_NF_IPTABLES 215 215 help 216 216 This Target replaced the old obsolete QUEUE target. 217 217
+10 -5
net/ipv6/route.c
··· 413 413 rt = ip6_rt_copy(ort); 414 414 415 415 if (rt) { 416 - ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); 417 - 418 - if (!(rt->rt6i_flags&RTF_GATEWAY)) 416 + if (!(rt->rt6i_flags&RTF_GATEWAY)) { 417 + if (rt->rt6i_dst.plen != 128 && 418 + ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)) 419 + rt->rt6i_flags |= RTF_ANYCAST; 419 420 ipv6_addr_copy(&rt->rt6i_gateway, daddr); 421 + } 420 422 423 + ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); 421 424 rt->rt6i_dst.plen = 128; 422 425 rt->rt6i_flags |= RTF_CACHE; 423 426 rt->u.dst.flags |= DST_HOST; ··· 832 829 } 833 830 834 831 rt->u.dst.obsolete = -1; 835 - rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info); 832 + rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); 836 833 if (nlh && (r = NLMSG_DATA(nlh))) { 837 834 rt->rt6i_protocol = r->rtm_protocol; 838 835 } else { ··· 1416 1413 rt->u.dst.obsolete = -1; 1417 1414 1418 1415 rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; 1419 - if (!anycast) 1416 + if (anycast) 1417 + rt->rt6i_flags |= RTF_ANYCAST; 1418 + else 1420 1419 rt->rt6i_flags |= RTF_LOCAL; 1421 1420 rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); 1422 1421 if (rt->rt6i_nexthop == NULL) {
+1
net/ipv6/xfrm6_policy.c
··· 214 214 case IPPROTO_UDP: 215 215 case IPPROTO_TCP: 216 216 case IPPROTO_SCTP: 217 + case IPPROTO_DCCP: 217 218 if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) { 218 219 u16 *ports = (u16 *)exthdr; 219 220
+3 -3
net/netrom/nr_in.c
··· 99 99 break; 100 100 101 101 case NR_RESET: 102 - if (sysctl_netrom_reset_circuit); 102 + if (sysctl_netrom_reset_circuit) 103 103 nr_disconnect(sk, ECONNRESET); 104 104 break; 105 105 ··· 130 130 break; 131 131 132 132 case NR_RESET: 133 - if (sysctl_netrom_reset_circuit); 133 + if (sysctl_netrom_reset_circuit) 134 134 nr_disconnect(sk, ECONNRESET); 135 135 break; 136 136 ··· 265 265 break; 266 266 267 267 case NR_RESET: 268 - if (sysctl_netrom_reset_circuit); 268 + if (sysctl_netrom_reset_circuit) 269 269 nr_disconnect(sk, ECONNRESET); 270 270 break; 271 271
+1 -1
net/sched/act_api.c
··· 34 34 #include <net/sch_generic.h> 35 35 #include <net/act_api.h> 36 36 37 - #if 1 /* control */ 37 + #if 0 /* control */ 38 38 #define DPRINTK(format, args...) printk(KERN_DEBUG format, ##args) 39 39 #else 40 40 #define DPRINTK(format, args...)
+4 -12
net/sctp/socket.c
··· 156 156 sizeof(struct sk_buff) + 157 157 sizeof(struct sctp_chunk); 158 158 159 - sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk) + 160 - sizeof(struct sk_buff) + 161 - sizeof(struct sctp_chunk); 162 - 163 159 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 164 160 } 165 161 ··· 3421 3425 } 3422 3426 3423 3427 static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port, 3424 - void * __user *to, size_t space_left) 3428 + void __user **to, size_t space_left) 3425 3429 { 3426 3430 struct list_head *pos; 3427 3431 struct sctp_sockaddr_entry *addr; ··· 4422 4426 * tcp_poll(). Note that, based on these implementations, we don't 4423 4427 * lock the socket in this function, even though it seems that, 4424 4428 * ideally, locking or some other mechanisms can be used to ensure 4425 - * the integrity of the counters (sndbuf and wmem_queued) used 4429 + * the integrity of the counters (sndbuf and wmem_alloc) used 4426 4430 * in this place. We assume that we don't need locks either until proven 4427 4431 * otherwise. 4428 4432 * ··· 4829 4833 sizeof(struct sk_buff) + 4830 4834 sizeof(struct sctp_chunk); 4831 4835 4832 - sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk) + 4833 - sizeof(struct sk_buff) + 4834 - sizeof(struct sctp_chunk); 4835 - 4836 4836 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 4837 4837 4838 4838 sock_wfree(skb); ··· 4912 4920 4913 4921 /* Is there any sndbuf space available on the socket? 4914 4922 * 4915 - * Note that wmem_queued is the sum of the send buffers on all of the 4923 + * Note that sk_wmem_alloc is the sum of the send buffers on all of the 4916 4924 * associations on the same socket. For a UDP-style socket with 4917 4925 * multiple associations, it is possible for it to be "unwriteable" 4918 4926 * prematurely. I assume that this is acceptable because ··· 4925 4933 { 4926 4934 int amt = 0; 4927 4935 4928 - amt = sk->sk_sndbuf - sk->sk_wmem_queued; 4936 + amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); 4929 4937 if (amt < 0) 4930 4938 amt = 0; 4931 4939 return amt;
+4 -2
net/sunrpc/auth_gss/auth_gss.c
··· 638 638 gss_msg); 639 639 atomic_inc(&gss_msg->count); 640 640 gss_unhash_msg(gss_msg); 641 - if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) { 641 + if (msg->errno == -ETIMEDOUT) { 642 642 unsigned long now = jiffies; 643 643 if (time_after(now, ratelimit)) { 644 644 printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n" ··· 786 786 cred->gc_flags = 0; 787 787 cred->gc_base.cr_ops = &gss_credops; 788 788 cred->gc_service = gss_auth->service; 789 - err = gss_create_upcall(gss_auth, cred); 789 + do { 790 + err = gss_create_upcall(gss_auth, cred); 791 + } while (err == -EAGAIN); 790 792 if (err < 0) 791 793 goto out_err; 792 794
+2 -2
net/sunrpc/rpc_pipe.c
··· 174 174 goto out; 175 175 msg = (struct rpc_pipe_msg *)filp->private_data; 176 176 if (msg != NULL) { 177 - msg->errno = -EPIPE; 177 + msg->errno = -EAGAIN; 178 178 list_del_init(&msg->list); 179 179 rpci->ops->destroy_msg(msg); 180 180 } ··· 183 183 if (filp->f_mode & FMODE_READ) 184 184 rpci->nreaders --; 185 185 if (!rpci->nreaders) 186 - __rpc_purge_upcall(inode, -EPIPE); 186 + __rpc_purge_upcall(inode, -EAGAIN); 187 187 if (rpci->ops->release_pipe) 188 188 rpci->ops->release_pipe(inode); 189 189 out:
+2
net/sunrpc/xprtsock.c
··· 990 990 sk->sk_data_ready = xs_udp_data_ready; 991 991 sk->sk_write_space = xs_udp_write_space; 992 992 sk->sk_no_check = UDP_CSUM_NORCV; 993 + sk->sk_allocation = GFP_ATOMIC; 993 994 994 995 xprt_set_connected(xprt); 995 996 ··· 1075 1074 sk->sk_data_ready = xs_tcp_data_ready; 1076 1075 sk->sk_state_change = xs_tcp_state_change; 1077 1076 sk->sk_write_space = xs_tcp_write_space; 1077 + sk->sk_allocation = GFP_ATOMIC; 1078 1078 1079 1079 /* socket options */ 1080 1080 sk->sk_userlocks |= SOCK_BINDPORT_LOCK;
+43 -6
net/xfrm/xfrm_policy.c
··· 346 346 struct xfrm_policy *pol, **p; 347 347 struct xfrm_policy *delpol = NULL; 348 348 struct xfrm_policy **newpos = NULL; 349 + struct dst_entry *gc_list; 349 350 350 351 write_lock_bh(&xfrm_policy_lock); 351 352 for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL;) { ··· 382 381 xfrm_pol_hold(policy); 383 382 write_unlock_bh(&xfrm_policy_lock); 384 383 385 - if (delpol) { 384 + if (delpol) 386 385 xfrm_policy_kill(delpol); 386 + 387 + read_lock_bh(&xfrm_policy_lock); 388 + gc_list = NULL; 389 + for (policy = policy->next; policy; policy = policy->next) { 390 + struct dst_entry *dst; 391 + 392 + write_lock(&policy->lock); 393 + dst = policy->bundles; 394 + if (dst) { 395 + struct dst_entry *tail = dst; 396 + while (tail->next) 397 + tail = tail->next; 398 + tail->next = gc_list; 399 + gc_list = dst; 400 + 401 + policy->bundles = NULL; 402 + } 403 + write_unlock(&policy->lock); 387 404 } 405 + read_unlock_bh(&xfrm_policy_lock); 406 + 407 + while (gc_list) { 408 + struct dst_entry *dst = gc_list; 409 + 410 + gc_list = dst->next; 411 + dst_free(dst); 412 + } 413 + 388 414 return 0; 389 415 } 390 416 EXPORT_SYMBOL(xfrm_policy_insert); ··· 1042 1014 } 1043 1015 EXPORT_SYMBOL(__xfrm_route_forward); 1044 1016 1045 - /* Optimize later using cookies and generation ids. */ 1046 - 1047 1017 static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie) 1048 1018 { 1049 - if (!stale_bundle(dst)) 1050 - return dst; 1051 - 1019 + /* If it is marked obsolete, which is how we even get here, 1020 + * then we have purged it from the policy bundle list and we 1021 + * did that for a good reason. 1022 + */ 1052 1023 return NULL; 1053 1024 } 1054 1025 ··· 1129 1102 { 1130 1103 xfrm_prune_bundles(stale_bundle); 1131 1104 return 0; 1105 + } 1106 + 1107 + static int always_true(struct dst_entry *dst) 1108 + { 1109 + return 1; 1110 + } 1111 + 1112 + void xfrm_flush_all_bundles(void) 1113 + { 1114 + xfrm_prune_bundles(always_true); 1132 1115 } 1133 1116 1134 1117 void xfrm_init_pmtu(struct dst_entry *dst)
+5
net/xfrm/xfrm_state.c
··· 431 431 spin_lock_bh(&xfrm_state_lock); 432 432 __xfrm_state_insert(x); 433 433 spin_unlock_bh(&xfrm_state_lock); 434 + 435 + xfrm_flush_all_bundles(); 434 436 } 435 437 EXPORT_SYMBOL(xfrm_state_insert); 436 438 ··· 479 477 out: 480 478 spin_unlock_bh(&xfrm_state_lock); 481 479 xfrm_state_put_afinfo(afinfo); 480 + 481 + if (!err) 482 + xfrm_flush_all_bundles(); 482 483 483 484 if (x1) { 484 485 xfrm_state_delete(x1);
+18 -11
sound/oss/au1550_ac97.c
··· 578 578 } while ((stat & PSC_AC97STAT_DR) == 0); 579 579 } 580 580 581 + /* Hold spinlock for both start_dac() and start_adc() calls */ 581 582 static void 582 583 start_dac(struct au1550_state *s) 583 584 { 584 585 struct dmabuf *db = &s->dma_dac; 585 - unsigned long flags; 586 586 587 587 if (!db->stopped) 588 588 return; 589 - 590 - spin_lock_irqsave(&s->lock, flags); 591 589 592 590 set_xmit_slots(db->num_channels); 593 591 au_writel(PSC_AC97PCR_TC, PSC_AC97PCR); ··· 596 598 au1xxx_dbdma_start(db->dmanr); 597 599 598 600 db->stopped = 0; 599 - 600 - spin_unlock_irqrestore(&s->lock, flags); 601 601 } 602 602 603 603 static void ··· 714 718 } 715 719 716 720 717 - /* hold spinlock for the following */ 718 721 static void 719 722 dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 720 723 { 721 724 struct au1550_state *s = (struct au1550_state *) dev_id; 722 725 struct dmabuf *db = &s->dma_dac; 723 726 u32 ac97c_stat; 727 + 728 + spin_lock(&s->lock); 724 729 725 730 ac97c_stat = au_readl(PSC_AC97STAT); 726 731 if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE)) ··· 744 747 /* wake up anybody listening */ 745 748 if (waitqueue_active(&db->wait)) 746 749 wake_up(&db->wait); 750 + 751 + spin_unlock(&s->lock); 747 752 } 748 753 749 754 ··· 757 758 u32 obytes; 758 759 char *obuf; 759 760 761 + spin_lock(&s->lock); 762 + 760 763 /* Pull the buffer from the dma queue. 761 764 */ 762 765 au1xxx_dbdma_get_dest(dp->dmanr, (void *)(&obuf), &obytes); ··· 766 765 if ((dp->count + obytes) > dp->dmasize) { 767 766 /* Overrun. Stop ADC and log the error 768 767 */ 768 + spin_unlock(&s->lock); 769 769 stop_adc(s); 770 770 dp->error++; 771 771 err("adc overrun"); ··· 789 787 if (waitqueue_active(&dp->wait)) 790 788 wake_up(&dp->wait); 791 789 790 + spin_unlock(&s->lock); 792 791 } 793 792 794 793 static loff_t ··· 1051 1048 /* wait for samples in ADC dma buffer 1052 1049 */ 1053 1050 do { 1051 + spin_lock_irqsave(&s->lock, flags); 1054 1052 if (db->stopped) 1055 1053 start_adc(s); 1056 - spin_lock_irqsave(&s->lock, flags); 1057 1054 avail = db->count; 1058 1055 if (avail <= 0) 1059 1056 __set_current_state(TASK_INTERRUPTIBLE); ··· 1573 1570 if (get_user(val, (int *) arg)) 1574 1571 return -EFAULT; 1575 1572 if (file->f_mode & FMODE_READ) { 1576 - if (val & PCM_ENABLE_INPUT) 1573 + if (val & PCM_ENABLE_INPUT) { 1574 + spin_lock_irqsave(&s->lock, flags); 1577 1575 start_adc(s); 1578 - else 1576 + spin_unlock_irqrestore(&s->lock, flags); 1577 + } else 1579 1578 stop_adc(s); 1580 1579 } 1581 1580 if (file->f_mode & FMODE_WRITE) { 1582 - if (val & PCM_ENABLE_OUTPUT) 1581 + if (val & PCM_ENABLE_OUTPUT) { 1582 + spin_lock_irqsave(&s->lock, flags); 1583 1583 start_dac(s); 1584 - else 1584 + spin_unlock_irqrestore(&s->lock, flags); 1585 + } else 1585 1586 stop_dac(s); 1586 1587 } 1587 1588 return 0;
+1 -1
sound/sparc/Kconfig
··· 1 1 # ALSA Sparc drivers 2 2 3 3 menu "ALSA Sparc devices" 4 - depends on SND!=n && (SPARC32 || SPARC64) 4 + depends on SND!=n && SPARC 5 5 6 6 config SND_SUN_AMD7930 7 7 tristate "Sun AMD7930"