···11VERSION = 222PATCHLEVEL = 633SUBLEVEL = 1544-EXTRAVERSION =-rc555-NAME=Affluent Albatross44+EXTRAVERSION =55+NAME=Sliding Snow Leopard6677# *DOCUMENTATION*88# To see a list of typical targets execute "make help"
···614614/*615615 * Reference prototype:616616 *617617+ * void __kernel_memory_barrier(void)618618+ *619619+ * Input:620620+ *621621+ * lr = return address622622+ *623623+ * Output:624624+ *625625+ * none626626+ *627627+ * Clobbered:628628+ *629629+ * the Z flag might be lost630630+ *631631+ * Definition and user space usage example:632632+ *633633+ * typedef void (__kernel_dmb_t)(void);634634+ * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)635635+ *636636+ * Apply any needed memory barrier to preserve consistency with data modified637637+ * manually and __kuser_cmpxchg usage.638638+ *639639+ * This could be used as follows:640640+ *641641+ * #define __kernel_dmb() \642642+ * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \643643+ * : : : "lr","cc" )644644+ */645645+646646+__kuser_memory_barrier: @ 0xffff0fa0647647+648648+#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)649649+ mcr p15, 0, r0, c7, c10, 5 @ dmb650650+#endif651651+ mov pc, lr652652+653653+ .align 5654654+655655+/*656656+ * Reference prototype:657657+ *617658 * int __kernel_cmpxchg(int oldval, int newval, int *ptr)618659 *619660 * Input:···682641 * Return zero if *ptr was changed or non-zero if no exchange happened.683642 * The C flag is also set if *ptr was changed to allow for assembly684643 * optimization in the calling code.644644+ *645645+ * Note: this routine already includes memory barriers as needed.685646 *686647 * For example, a user space atomic_add implementation could look like this:687648 *···741698742699#else743700701701+#ifdef CONFIG_SMP702702+ mcr p15, 0, r0, c7, c10, 5 @ dmb703703+#endif744704 ldrex r3, [r2]745705 subs r3, r3, r0746706 strexeq r3, r1, [r2]747707 rsbs r0, r3, #0708708+#ifdef CONFIG_SMP709709+ mcr p15, 0, r0, c7, c10, 5 @ dmb710710+#endif748711 mov pc, lr749712750713#endif
+2-18
arch/arm/kernel/entry-common.S
···145145#endif146146 enable_irq147147148148- str r4, [sp, #-S_OFF]! @ push fifth arg148148+ stmdb sp!, {r4, r5} @ push fifth and sixth args149149150150 get_thread_info tsk151151 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing···204204 * Special system call wrappers205205 */206206@ r0 = syscall number207207-@ r5 = syscall table207207+@ r8 = syscall table208208 .type sys_syscall, #function209209sys_syscall:210210 eor scno, r0, #__NR_SYSCALL_BASE···254254sys_sigaltstack_wrapper:255255 ldr r2, [sp, #S_OFF + S_SP]256256 b do_sigaltstack257257-258258-sys_futex_wrapper:259259- str r5, [sp, #4] @ push sixth arg260260- b sys_futex261261-262262-sys_arm_fadvise64_64_wrapper:263263- str r5, [sp, #4] @ push r5 to stack264264- b sys_arm_fadvise64_64265265-266266-sys_mbind_wrapper:267267- str r5, [sp, #4]268268- b sys_mbind269269-270270-sys_ipc_wrapper:271271- str r5, [sp, #4] @ push sixth arg272272- b sys_ipc273257274258/*275259 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
+2
arch/arm/kernel/module.c
···101101 break;102102103103 case R_ARM_PC24:104104+ case R_ARM_CALL:105105+ case R_ARM_JUMP24:104106 offset = (*(u32 *)loc & 0x00ffffff) << 2;105107 if (offset & 0x02000000)106108 offset -= 0x04000000;
···245245 addr < phys_to_virt(ISA_END_ADDRESS))246246 return;247247248248- addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr);248248+ addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);249249250250 /* Use the vm area unlocked, assuming the caller251251 ensures there isn't another iounmap for the same address
···113113CONFIG_IA64_SGI_SN_XP=m114114CONFIG_FORCE_MAX_ZONEORDER=17115115CONFIG_SMP=y116116-CONFIG_NR_CPUS=512116116+CONFIG_NR_CPUS=1024117117# CONFIG_HOTPLUG_CPU is not set118118CONFIG_SCHED_SMT=y119119CONFIG_PREEMPT=y
+2
arch/ia64/kernel/process.c
···721721 /* drop floating-point and debug-register state if it exists: */722722 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);723723 ia64_drop_fpu(current);724724+#ifdef CONFIG_IA32_SUPPORT724725 if (IS_IA32_PROCESS(ia64_task_regs(current))) {725726 ia32_drop_partial_page_list(current);726727 current->thread.task_size = IA32_PAGE_OFFSET;727728 set_fs(USER_DS);728729 }730730+#endif729731}730732731733/*
+29
arch/ia64/kernel/time.c
···249249 */250250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);251251}252252+253253+#define SMALLUSECS 100254254+255255+void256256+udelay (unsigned long usecs)257257+{258258+ unsigned long start;259259+ unsigned long cycles;260260+ unsigned long smallusecs;261261+262262+ /*263263+ * Execute the non-preemptible delay loop (because the ITC might264264+ * not be synchronized between CPUS) in relatively short time265265+ * chunks, allowing preemption between the chunks.266266+ */267267+ while (usecs > 0) {268268+ smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs;269269+ preempt_disable();270270+ cycles = smallusecs*local_cpu_data->cyc_per_usec;271271+ start = ia64_get_itc();272272+273273+ while (ia64_get_itc() - start < cycles)274274+ cpu_relax();275275+276276+ preempt_enable();277277+ usecs -= smallusecs;278278+ }279279+}280280+EXPORT_SYMBOL(udelay);
+3-3
arch/ia64/kernel/uncached.c
···5353 if ((status != PAL_VISIBILITY_OK) &&5454 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))5555 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "5656- "CPU %i\n", status, get_cpu());5656+ "CPU %i\n", status, raw_smp_processor_id());5757}58585959···6363 status = ia64_pal_mc_drain();6464 if (status)6565 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "6666- "CPU %i\n", status, get_cpu());6666+ "CPU %i\n", status, raw_smp_processor_id());6767}68686969···105105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);106106107107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n",108108- status, get_cpu());108108+ status, raw_smp_processor_id());109109110110 if (!status) {111111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc144-# Tue Nov 15 14:36:20 200533+# Linux kernel version: 2.6.15-rc544+# Tue Dec 20 15:59:26 200555#66CONFIG_PPC64=y77CONFIG_64BIT=y···5353# CONFIG_IKCONFIG is not set5454# CONFIG_CPUSETS is not set5555CONFIG_INITRAMFS_SOURCE=""5656+CONFIG_CC_OPTIMIZE_FOR_SIZE=y5657# CONFIG_EMBEDDED is not set5758CONFIG_KALLSYMS=y5859# CONFIG_KALLSYMS_ALL is not set···152151CONFIG_FLATMEM=y153152CONFIG_FLAT_NODE_MEM_MAP=y154153# CONFIG_SPARSEMEM_STATIC is not set155155-CONFIG_SPLIT_PTLOCK_CPUS=4096154154+CONFIG_SPLIT_PTLOCK_CPUS=4156155# CONFIG_PPC_64K_PAGES is not set157156CONFIG_SCHED_SMT=y158157CONFIG_PROC_DEVICETREE=y
+5-4
arch/powerpc/configs/g5_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc144-# Tue Nov 15 14:39:20 200533+# Linux kernel version: 2.6.15-rc544+# Tue Dec 20 15:59:30 200555#66CONFIG_PPC64=y77CONFIG_64BIT=y···5353CONFIG_IKCONFIG_PROC=y5454# CONFIG_CPUSETS is not set5555CONFIG_INITRAMFS_SOURCE=""5656+CONFIG_CC_OPTIMIZE_FOR_SIZE=y5657# CONFIG_EMBEDDED is not set5758CONFIG_KALLSYMS=y5859# CONFIG_KALLSYMS_ALL is not set···163162CONFIG_FLATMEM=y164163CONFIG_FLAT_NODE_MEM_MAP=y165164# CONFIG_SPARSEMEM_STATIC is not set166166-CONFIG_SPLIT_PTLOCK_CPUS=4096165165+CONFIG_SPLIT_PTLOCK_CPUS=4167166# CONFIG_PPC_64K_PAGES is not set168167# CONFIG_SCHED_SMT is not set169168CONFIG_PROC_DEVICETREE=y···12041203CONFIG_USB_SERIAL=m12051204CONFIG_USB_SERIAL_GENERIC=y12061205# CONFIG_USB_SERIAL_AIRPRIME is not set12061206+# CONFIG_USB_SERIAL_ANYDATA is not set12071207CONFIG_USB_SERIAL_BELKIN=m12081208CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m12091209# CONFIG_USB_SERIAL_CP2101 is not set···12351233CONFIG_USB_SERIAL_KLSI=m12361234CONFIG_USB_SERIAL_KOBIL_SCT=m12371235CONFIG_USB_SERIAL_MCT_U232=m12381238-# CONFIG_USB_SERIAL_NOKIA_DKU2 is not set12391236CONFIG_USB_SERIAL_PL2303=m12401237# CONFIG_USB_SERIAL_HP4X is not set12411238CONFIG_USB_SERIAL_SAFE=m
+4-3
arch/powerpc/configs/iseries_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc144-# Tue Nov 15 14:38:09 200533+# Linux kernel version: 2.6.15-rc544+# Tue Dec 20 15:59:32 200555#66CONFIG_PPC64=y77CONFIG_64BIT=y···5555CONFIG_IKCONFIG_PROC=y5656# CONFIG_CPUSETS is not set5757CONFIG_INITRAMFS_SOURCE=""5858+CONFIG_CC_OPTIMIZE_FOR_SIZE=y5859# CONFIG_EMBEDDED is not set5960CONFIG_KALLSYMS=y6061# CONFIG_KALLSYMS_ALL is not set···145144CONFIG_FLATMEM=y146145CONFIG_FLAT_NODE_MEM_MAP=y147146# CONFIG_SPARSEMEM_STATIC is not set148148-CONFIG_SPLIT_PTLOCK_CPUS=4096147147+CONFIG_SPLIT_PTLOCK_CPUS=4149148# CONFIG_PPC_64K_PAGES is not set150149# CONFIG_SCHED_SMT is not set151150CONFIG_PROC_DEVICETREE=y
+5-5
arch/powerpc/configs/maple_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc144-# Tue Nov 15 14:38:58 200533+# Linux kernel version: 2.6.15-rc544+# Tue Dec 20 15:59:36 200555#66CONFIG_PPC64=y77CONFIG_64BIT=y···5353CONFIG_IKCONFIG_PROC=y5454# CONFIG_CPUSETS is not set5555CONFIG_INITRAMFS_SOURCE=""5656+CONFIG_CC_OPTIMIZE_FOR_SIZE=y5657# CONFIG_EMBEDDED is not set5758CONFIG_KALLSYMS=y5859CONFIG_KALLSYMS_ALL=y···150149CONFIG_FLATMEM=y151150CONFIG_FLAT_NODE_MEM_MAP=y152151# CONFIG_SPARSEMEM_STATIC is not set153153-CONFIG_SPLIT_PTLOCK_CPUS=4096152152+CONFIG_SPLIT_PTLOCK_CPUS=4154153# CONFIG_PPC_64K_PAGES is not set155154# CONFIG_SCHED_SMT is not set156155CONFIG_PROC_DEVICETREE=y···243242# QoS and/or fair queueing244243#245244# CONFIG_NET_SCHED is not set246246-# CONFIG_NET_CLS_ROUTE is not set247245248246#249247# Network testing···794794# CONFIG_USB_SERIAL_CONSOLE is not set795795CONFIG_USB_SERIAL_GENERIC=y796796# CONFIG_USB_SERIAL_AIRPRIME is not set797797+# CONFIG_USB_SERIAL_ANYDATA is not set797798# CONFIG_USB_SERIAL_BELKIN is not set798799# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set799800# CONFIG_USB_SERIAL_CP2101 is not set···825824# CONFIG_USB_SERIAL_KLSI is not set826825# CONFIG_USB_SERIAL_KOBIL_SCT is not set827826# CONFIG_USB_SERIAL_MCT_U232 is not set828828-# CONFIG_USB_SERIAL_NOKIA_DKU2 is not set829827# CONFIG_USB_SERIAL_PL2303 is not set830828# CONFIG_USB_SERIAL_HP4X is not set831829# CONFIG_USB_SERIAL_SAFE is not set
+4-3
arch/powerpc/configs/ppc64_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc144-# Fri Nov 18 16:23:24 200533+# Linux kernel version: 2.6.15-rc544+# Tue Dec 20 15:59:38 200555#66CONFIG_PPC64=y77CONFIG_64BIT=y···5454CONFIG_IKCONFIG_PROC=y5555CONFIG_CPUSETS=y5656CONFIG_INITRAMFS_SOURCE=""5757+CONFIG_CC_OPTIMIZE_FOR_SIZE=y5758# CONFIG_EMBEDDED is not set5859CONFIG_KALLSYMS=y5960CONFIG_KALLSYMS_ALL=y···177176# CONFIG_SPARSEMEM_STATIC is not set178177CONFIG_SPARSEMEM_EXTREME=y179178# CONFIG_MEMORY_HOTPLUG is not set180180-CONFIG_SPLIT_PTLOCK_CPUS=4096179179+CONFIG_SPLIT_PTLOCK_CPUS=4181180# CONFIG_PPC_64K_PAGES is not set182181# CONFIG_SCHED_SMT is not set183182CONFIG_PROC_DEVICETREE=y
+4-3
arch/powerpc/configs/pseries_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc144-# Tue Nov 15 14:36:55 200533+# Linux kernel version: 2.6.15-rc544+# Tue Dec 20 15:59:40 200555#66CONFIG_PPC64=y77CONFIG_64BIT=y···5555CONFIG_IKCONFIG_PROC=y5656CONFIG_CPUSETS=y5757CONFIG_INITRAMFS_SOURCE=""5858+CONFIG_CC_OPTIMIZE_FOR_SIZE=y5859# CONFIG_EMBEDDED is not set5960CONFIG_KALLSYMS=y6061CONFIG_KALLSYMS_ALL=y···164163# CONFIG_SPARSEMEM_STATIC is not set165164CONFIG_SPARSEMEM_EXTREME=y166165# CONFIG_MEMORY_HOTPLUG is not set167167-CONFIG_SPLIT_PTLOCK_CPUS=4096166166+CONFIG_SPLIT_PTLOCK_CPUS=4168167CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y169168# CONFIG_PPC_64K_PAGES is not set170169CONFIG_SCHED_SMT=y
···5555 depends on SMP5656 default "32"57575858+config SPARC5959+ bool6060+ default y6161+5862# Identify this as a Sparc32 build5963config SPARC326064 bool
···5555 return len;5656}57575858-static int led_write_proc(struct file *file, const char *buffer,5858+static int led_write_proc(struct file *file, const char __user *buffer,5959 unsigned long count, void *data)6060{6161 char *buf = NULL;
+1-1
arch/sparc/kernel/pcic.c
···161161static int pcic0_up;162162static struct linux_pcic pcic0;163163164164-void * __iomem pcic_regs;164164+void __iomem *pcic_regs;165165volatile int pcic_speculative;166166volatile int pcic_trapped;167167
+1-1
arch/sparc/kernel/sys_sunos.c
···894894 ret = ARG_MAX;895895 break;896896 case _SC_CHILD_MAX:897897- ret = CHILD_MAX;897897+ ret = -1; /* no limit */898898 break;899899 case _SC_CLK_TCK:900900 ret = HZ;
···854854 ret = ARG_MAX;855855 break;856856 case _SC_CHILD_MAX:857857- ret = CHILD_MAX;857857+ ret = -1; /* no limit */858858 break;859859 case _SC_CLK_TCK:860860 ret = HZ;
···353353{354354 switch (id) {355355 case SOLARIS_CONFIG_NGROUPS: return NGROUPS_MAX;356356- case SOLARIS_CONFIG_CHILD_MAX: return CHILD_MAX;356356+ case SOLARIS_CONFIG_CHILD_MAX: return -1; /* no limit */357357 case SOLARIS_CONFIG_OPEN_FILES: return OPEN_MAX;358358 case SOLARIS_CONFIG_POSIX_VER: return 199309;359359 case SOLARIS_CONFIG_PAGESIZE: return PAGE_SIZE;
···12121313ELF_ARCH := i386:x86-641414ELF_FORMAT := elf64-x86-641515+1616+# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.1717+1818+LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
···2121endef222223232424-# The stubs and unmap.o can't try to call mcount or update basic block data2525-define unprofile2626- $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))2727-endef2828-2924# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If3025# so, it's considered to be a path relative to $(srcdir) rather than3126# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from
···263263 addr < phys_to_virt(ISA_END_ADDRESS))264264 return;265265266266- addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr);266266+ addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);267267 /* Use the vm area unlocked, assuming the caller268268 ensures there isn't another iounmap for the same address269269 in parallel. Reuse of the virtual address is prevented by
+1-1
arch/x86_64/pci/Makefile
···1111obj-$(CONFIG_ACPI) += acpi.o1212obj-y += legacy.o irq.o common.o1313# mmconfig has a 64bit special1414-obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o1414+obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o15151616obj-$(CONFIG_NUMA) += k8-bus.o1717
+7-7
arch/x86_64/pci/mmconfig.c
···1818/* Static virtual mapping of the MMCONFIG aperture */1919struct mmcfg_virt {2020 struct acpi_table_mcfg_config *cfg;2121- char *virt;2121+ char __iomem *virt;2222};2323static struct mmcfg_virt *pci_mmcfg_virt;24242525-static char *get_virt(unsigned int seg, unsigned bus)2525+static char __iomem *get_virt(unsigned int seg, unsigned bus)2626{2727 int cfg_num = -1;2828 struct acpi_table_mcfg_config *cfg;···4343 }4444}45454646-static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)4646+static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)4747{4848- char *addr;4848+ char __iomem *addr;4949 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots))5050 return NULL;5151 addr = get_virt(seg, bus);···5757static int pci_mmcfg_read(unsigned int seg, unsigned int bus,5858 unsigned int devfn, int reg, int len, u32 *value)5959{6060- char *addr;6060+ char __iomem *addr;61616262 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */6363 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095)))···8585static int pci_mmcfg_write(unsigned int seg, unsigned int bus,8686 unsigned int devfn, int reg, int len, u32 value)8787{8888- char *addr;8888+ char __iomem *addr;89899090 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */9191 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))···127127 int i;128128 for (i = 0; i < 32; i++) {129129 u32 val1;130130- char *addr;130130+ char __iomem *addr;131131132132 pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1);133133 if (val1 == 0xffffffff)
···687687688688config RTC689689 tristate "Enhanced Real Time Clock Support"690690- depends on !PPC32 && !PARISC && !IA64 && !M68K690690+ depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI)691691 ---help---692692 If you say Y here and create a character special file /dev/rtc with693693 major number 10 and minor number 135 using mknod ("man mknod"), you···735735736736config GEN_RTC737737 tristate "Generic /dev/rtc emulation"738738- depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC32 && !SPARC64738738+ depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC739739 ---help---740740 If you say Y here and create a character special file /dev/rtc with741741 major number 10 and minor number 135 using mknod ("man mknod"), you
···6969typedef struct _MW_READWRITE {7070 unsigned short usDspAddress; /* The dsp address */7171 unsigned long ulDataLength; /* The size in bytes of the data or user buffer */7272- void *pBuf; /* Input:variable sized buffer */7272+ void __user *pBuf; /* Input:variable sized buffer */7373} MW_READWRITE, *pMW_READWRITE;74747575#define IOCTL_MW_RESET _IO(MWAVE_MINOR,1)
+7-6
drivers/char/pcmcia/cm4000_cs.c
···14441444 dev_link_t *link;14451445 int size;14461446 int rc;14471447+ void __user *argp = (void __user *)arg;14471448#ifdef PCMCIA_DEBUG14481449 char *ioctl_names[CM_IOC_MAXNR + 1] = {14491450 [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS",···14821481 _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd);1483148214841483 if (_IOC_DIR(cmd) & _IOC_READ) {14851485- if (!access_ok(VERIFY_WRITE, (void *)arg, size))14841484+ if (!access_ok(VERIFY_WRITE, argp, size))14861485 return -EFAULT;14871486 }14881487 if (_IOC_DIR(cmd) & _IOC_WRITE) {14891489- if (!access_ok(VERIFY_READ, (void *)arg, size))14881488+ if (!access_ok(VERIFY_READ, argp, size))14901489 return -EFAULT;14911490 }14921491···15071506 status |= CM_NO_READER;15081507 if (test_bit(IS_BAD_CARD, &dev->flags))15091508 status |= CM_BAD_CARD;15101510- if (copy_to_user((int *)arg, &status, sizeof(int)))15091509+ if (copy_to_user(argp, &status, sizeof(int)))15111510 return -EFAULT;15121511 }15131512 return 0;15141513 case CM_IOCGATR:15151514 DEBUGP(4, dev, "... in CM_IOCGATR\n");15161515 {15171517- struct atreq *atreq = (struct atreq *) arg;15161516+ struct atreq __user *atreq = argp;15181517 int tmp;15191518 /* allow nonblocking io and being interrupted */15201519 if (wait_event_interruptible···15981597 {15991598 struct ptsreq krnptsreq;1600159916011601- if (copy_from_user(&krnptsreq, (struct ptsreq *) arg,16001600+ if (copy_from_user(&krnptsreq, argp,16021601 sizeof(struct ptsreq)))16031602 return -EFAULT;16041603···16421641 int old_pc_debug = 0;1643164216441643 old_pc_debug = pc_debug;16451645- if (copy_from_user(&pc_debug, (int *)arg, sizeof(int)))16441644+ if (copy_from_user(&pc_debug, argp, sizeof(int)))16461645 return -EFAULT;1647164616481647 if (old_pc_debug != pc_debug)
+1-1
drivers/char/vc_screen.c
···419419 while (this_round > 1) {420420 unsigned short w;421421422422- w = get_unaligned(((const unsigned short *)con_buf0));422422+ w = get_unaligned(((unsigned short *)con_buf0));423423 vcs_scr_writew(vc, w, org++);424424 con_buf0 += 2;425425 this_round -= 2;
+8-7
drivers/char/watchdog/booke_wdt.c
···7272/*7373 * booke_wdt_write:7474 */7575-static ssize_t booke_wdt_write (struct file *file, const char *buf,7575+static ssize_t booke_wdt_write (struct file *file, const char __user *buf,7676 size_t count, loff_t *ppos)7777{7878 booke_wdt_ping();···9292 unsigned int cmd, unsigned long arg)9393{9494 u32 tmp = 0;9595+ u32 __user *p = (u32 __user *)arg;95969697 switch (cmd) {9798 case WDIOC_GETSUPPORT:9898- if (copy_to_user ((struct watchdog_info *) arg, &ident,9999+ if (copy_to_user ((struct watchdog_info __user *) arg, &ident,99100 sizeof(struct watchdog_info)))100101 return -EFAULT;101102 case WDIOC_GETSTATUS:102102- return put_user(ident.options, (u32 *) arg);103103+ return put_user(ident.options, p);103104 case WDIOC_GETBOOTSTATUS:104105 /* XXX: something is clearing TSR */105106 tmp = mfspr(SPRN_TSR) & TSR_WRS(3);···110109 booke_wdt_ping();111110 return 0;112111 case WDIOC_SETTIMEOUT:113113- if (get_user(booke_wdt_period, (u32 *) arg))112112+ if (get_user(booke_wdt_period, p))114113 return -EFAULT;115114 mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period));116115 return 0;117116 case WDIOC_GETTIMEOUT:118118- return put_user(booke_wdt_period, (u32 *) arg);117117+ return put_user(booke_wdt_period, p);119118 case WDIOC_SETOPTIONS:120120- if (get_user(tmp, (u32 *) arg))119119+ if (get_user(tmp, p))121120 return -EINVAL;122121 if (tmp == WDIOS_ENABLECARD) {123122 booke_wdt_ping();···173172 int ret = 0;174173175174 printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");176176- ident.firmware_version = cpu_specs[0].pvr_value;175175+ ident.firmware_version = cur_cpu_spec->pvr_value;177176178177 ret = misc_register(&booke_wdt_miscdev);179178 if (ret) {
+1-1
drivers/char/watchdog/wdrtas.c
···320320wdrtas_ioctl(struct inode *inode, struct file *file,321321 unsigned int cmd, unsigned long arg)322322{323323- int __user *argp = (void *)arg;323323+ int __user *argp = (void __user *)arg;324324 int i;325325 static struct watchdog_info wdinfo = {326326 .options = WDRTAS_SUPPORTED_MASK,
+4-4
drivers/fc4/Kconfig
···26262727config FC4_SOC2828 tristate "Sun SOC/Sbus"2929- depends on FC4!=n && (SPARC32 || SPARC64)2929+ depends on FC4!=n && SPARC3030 help3131 Serial Optical Channel is an interface card with one or two Fibre3232 Optic ports, each of which can be connected to a disk array. Note···38383939config FC4_SOCAL4040 tristate "Sun SOC+ (aka SOCAL)"4141- depends on FC4!=n && (SPARC32 || SPARC64)4141+ depends on FC4!=n && SPARC4242 ---help---4343 Serial Optical Channel Plus is an interface card with up to two4444 Fibre Optic ports. This card supports FC Arbitrated Loop (usually···6262 be called pluto.63636464config SCSI_FCAL6565- tristate "Sun Enterprise Network Array (A5000 and EX500)" if SPARC32 || SPARC646565+ tristate "Sun Enterprise Network Array (A5000 and EX500)" if SPARC6666 depends on FC4!=n && SCSI6767 help6868 This driver drives FC-AL disks connected through a Fibre Channel···75757676config SCSI_FCAL7777 prompt "Generic FC-AL disk driver"7878- depends on FC4!=n && SCSI && !SPARC32 && !SPARC647878+ depends on FC4!=n && SCSI && !SPARC79798080endmenu8181
···807807 depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX808808endchoice809809810810-config BLK_DEV_IDE_AU1XXX_BURSTABLE_ON811811- bool "Enable burstable Mode on DbDMA"812812- default false813813- depends BLK_DEV_IDE_AU1XXX814814- help815815- This option enable the burstable Flag on DbDMA controller816816- (cf. "AMD Alchemy 'Au1200' Processor Data Book - PRELIMINARY").817817-818810config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ819811 int "Maximum transfer size (KB) per request (up to 128)"820812 default "128"···932940933941config BLK_DEV_MPC8xx_IDE934942 bool "MPC8xx IDE support"935935- depends on 8xx943943+ depends on 8xx && IDE=y && BLK_DEV_IDE=y936944 help937945 This option provides support for IDE on Motorola MPC8xx Systems.938946 Please see 'Type of MPC8xx IDE interface' for details.
-7
drivers/ide/ide-cd.c
···12921292 struct cdrom_info *info = drive->driver_data;1293129312941294 info->dma = 0;12951295- info->cmd = 0;12961295 info->start_seek = jiffies;12971296 return cdrom_start_packet_command(drive, 0, cdrom_start_seek_continuation);12981297}···13421343 if ((rq->sector & (sectors_per_frame - 1)) ||13431344 (rq->nr_sectors & (sectors_per_frame - 1)))13441345 info->dma = 0;13451345-13461346- info->cmd = READ;1347134613481347 /* Start sending the read request to the drive. */13491348 return cdrom_start_packet_command(drive, 32768, cdrom_start_read_continuation);···14811484 struct cdrom_info *info = drive->driver_data;1482148514831486 info->dma = 0;14841484- info->cmd = 0;14851487 rq->flags &= ~REQ_FAILED;14861488 len = rq->data_len;14871489···18871891 /* use dma, if possible. we don't need to check more, since we18881892 * know that the transfer is always (at least!) frame aligned */18891893 info->dma = drive->using_dma ? 1 : 0;18901890- info->cmd = WRITE;1891189418921895 info->devinfo.media_written = 1;18931896···19111916 rq->flags |= REQ_QUIET;1912191719131918 info->dma = 0;19141914- info->cmd = 0;1915191919161920 /*19171921 * sg request···19191925 int mask = drive->queue->dma_alignment;19201926 unsigned long addr = (unsigned long) page_address(bio_page(rq->bio));1921192719221922- info->cmd = rq_data_dir(rq);19231928 info->dma = drive->using_dma;1924192919251930 /*
-1
drivers/ide/ide-cd.h
···480480481481 struct request request_sense_request;482482 int dma;483483- int cmd;484483 unsigned long last_block;485484 unsigned long start_seek;486485 /* Buffer to hold mechanism status and changer slot table. */
···3131 */3232#undef REALLY_SLOW_IO /* most systems can safely undef this */33333434-#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */3534#include <linux/types.h>3635#include <linux/module.h>3736#include <linux/kernel.h>3837#include <linux/delay.h>3939-#include <linux/timer.h>4040-#include <linux/mm.h>4141-#include <linux/ioport.h>4242-#include <linux/hdreg.h>3838+#include <linux/platform_device.h>3939+4340#include <linux/init.h>4441#include <linux/ide.h>4542#include <linux/sysdev.h>46434744#include <linux/dma-mapping.h>48454646+#include "ide-timing.h"4747+4948#include <asm/io.h>5049#include <asm/mach-au1x00/au1xxx.h>5150#include <asm/mach-au1x00/au1xxx_dbdma.h>5252-5353-#if CONFIG_PM5454-#include <asm/mach-au1x00/au1xxx_pm.h>5555-#endif56515752#include <asm/mach-au1x00/au1xxx_ide.h>58535954#define DRV_NAME "au1200-ide"6055#define DRV_VERSION "1.0"6161-#define DRV_AUTHOR "AMD PCS / Pete Popov <ppopov@embeddedalley.com>"6262-#define DRV_DESC "Au1200 IDE"5656+#define DRV_AUTHOR "Enrico Walther <enrico.walther@amd.com> / Pete Popov <ppopov@embeddedalley.com>"5757+5858+/* enable the burstmode in the dbdma */5959+#define IDE_AU1XXX_BURSTMODE 163606461static _auide_hwif auide_hwif;6565-static spinlock_t ide_tune_drive_spin_lock = SPIN_LOCK_UNLOCKED;6666-static spinlock_t ide_tune_chipset_spin_lock = SPIN_LOCK_UNLOCKED;6767-static int dbdma_init_done = 0;6262+static int dbdma_init_done;68636969-/*7070- * local I/O functions7171- */7272-u8 auide_inb(unsigned long port)7373-{7474- return (au_readb(port));7575-}7676-7777-u16 auide_inw(unsigned long port)7878-{7979- return (au_readw(port));8080-}8181-8282-u32 auide_inl(unsigned long port)8383-{8484- return (au_readl(port));8585-}6464+#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)86658766void auide_insw(unsigned long port, void *addr, u32 count)8867{8989-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)6868+ _auide_hwif *ahwif = &auide_hwif;6969+ chan_tab_t *ctp;7070+ au1x_ddma_desc_t *dp;90719191- _auide_hwif *ahwif = &auide_hwif;9292- chan_tab_t *ctp;9393- au1x_ddma_desc_t *dp;9494-9595- if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1,9696- DDMA_FLAGS_NOIE)) {9797- printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__);9898- return;9999- }100100- ctp = *((chan_tab_t **)ahwif->rx_chan);101101- dp = ctp->cur_ptr;102102- while (dp->dscr_cmd0 & DSCR_CMD0_V)103103- ;104104- ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp);105105-#else106106- while (count--)107107- {108108- *(u16 *)addr = au_readw(port);109109- addr +=2 ;110110- }111111-#endif112112-}113113-114114-void auide_insl(unsigned long port, void *addr, u32 count)115115-{116116- while (count--)117117- {118118- *(u32 *)addr = au_readl(port);119119- /* NOTE: For IDE interfaces over PCMCIA,120120- * 32-bit access does not work121121- */122122- addr += 4;123123- }124124-}125125-126126-void auide_outb(u8 addr, unsigned long port)127127-{128128- return (au_writeb(addr, port));129129-}130130-131131-void auide_outbsync(ide_drive_t *drive, u8 addr, unsigned long port)132132-{133133- return (au_writeb(addr, port));134134-}135135-136136-void auide_outw(u16 addr, unsigned long port)137137-{138138- return (au_writew(addr, port));139139-}140140-141141-void auide_outl(u32 addr, unsigned long port)142142-{143143- return (au_writel(addr, port));7272+ if(!put_dest_flags(ahwif->rx_chan, (void*)addr, count << 1, 7373+ DDMA_FLAGS_NOIE)) {7474+ printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__);7575+ return;7676+ }7777+ ctp = *((chan_tab_t **)ahwif->rx_chan);7878+ dp = ctp->cur_ptr;7979+ while (dp->dscr_cmd0 & DSCR_CMD0_V)8080+ ;8181+ ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp);14482}1458314684void auide_outsw(unsigned long port, void *addr, u32 count)14785{148148-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)149149- _auide_hwif *ahwif = &auide_hwif;150150- chan_tab_t *ctp;151151- au1x_ddma_desc_t *dp;8686+ _auide_hwif *ahwif = &auide_hwif;8787+ chan_tab_t *ctp;8888+ au1x_ddma_desc_t *dp;15289153153- if(!put_source_flags(ahwif->tx_chan, (void*)addr,154154- count << 1, DDMA_FLAGS_NOIE)) {155155- printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__);156156- return;157157- }158158- ctp = *((chan_tab_t **)ahwif->tx_chan);159159- dp = ctp->cur_ptr;160160- while (dp->dscr_cmd0 & DSCR_CMD0_V)161161- ;162162- ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp);163163-#else164164- while (count--)165165- {166166- au_writew(*(u16 *)addr, port);167167- addr += 2;168168- }9090+ if(!put_source_flags(ahwif->tx_chan, (void*)addr,9191+ count << 1, DDMA_FLAGS_NOIE)) {9292+ printk(KERN_ERR "%s failed %d\n", __FUNCTION__, __LINE__);9393+ return;9494+ }9595+ ctp = *((chan_tab_t **)ahwif->tx_chan);9696+ dp = ctp->cur_ptr;9797+ while (dp->dscr_cmd0 & DSCR_CMD0_V)9898+ ;9999+ ctp->cur_ptr = au1xxx_ddma_get_nextptr_virt(dp);100100+}101101+169102#endif170170-}171171-172172-void auide_outsl(unsigned long port, void *addr, u32 count)173173-{174174- while (count--)175175- {176176- au_writel(*(u32 *)addr, port);177177- /* NOTE: For IDE interfaces over PCMCIA,178178- * 32-bit access does not work179179- */180180- addr += 4;181181- }182182-}183103184104static void auide_tune_drive(ide_drive_t *drive, byte pio)185105{186186- int mem_sttime;187187- int mem_stcfg;188188- unsigned long flags;189189- u8 speed;106106+ int mem_sttime;107107+ int mem_stcfg;108108+ u8 speed;190109191191- /* get the best pio mode for the drive */192192- pio = ide_get_best_pio_mode(drive, pio, 4, NULL);110110+ /* get the best pio mode for the drive */111111+ pio = ide_get_best_pio_mode(drive, pio, 4, NULL);193112194194- printk("%s: setting Au1XXX IDE to PIO mode%d\n",195195- drive->name, pio);113113+ printk(KERN_INFO "%s: setting Au1XXX IDE to PIO mode%d\n",114114+ drive->name, pio);196115197197- spin_lock_irqsave(&ide_tune_drive_spin_lock, flags);116116+ mem_sttime = 0;117117+ mem_stcfg = au_readl(MEM_STCFG2);198118199199- mem_sttime = 0;200200- mem_stcfg = au_readl(MEM_STCFG2);119119+ /* set pio mode! */120120+ switch(pio) {121121+ case 0:122122+ mem_sttime = SBC_IDE_TIMING(PIO0);201123202202- /* set pio mode! */203203- switch(pio) {204204- case 0:205205- /* set timing parameters for RCS2# */206206- mem_sttime = SBC_IDE_PIO0_TWCS207207- | SBC_IDE_PIO0_TCSH208208- | SBC_IDE_PIO0_TCSOFF209209- | SBC_IDE_PIO0_TWP210210- | SBC_IDE_PIO0_TCSW211211- | SBC_IDE_PIO0_TPM212212- | SBC_IDE_PIO0_TA;213213- /* set configuration for RCS2# */214214- mem_stcfg |= TS_MASK;215215- mem_stcfg &= ~TCSOE_MASK;216216- mem_stcfg &= ~TOECS_MASK;217217- mem_stcfg |= SBC_IDE_PIO0_TCSOE | SBC_IDE_PIO0_TOECS;124124+ /* set configuration for RCS2# */125125+ mem_stcfg |= TS_MASK;126126+ mem_stcfg &= ~TCSOE_MASK;127127+ mem_stcfg &= ~TOECS_MASK;128128+ mem_stcfg |= SBC_IDE_PIO0_TCSOE | SBC_IDE_PIO0_TOECS;129129+ break;218130219219- au_writel(mem_sttime,MEM_STTIME2);220220- au_writel(mem_stcfg,MEM_STCFG2);221221- break;131131+ case 1:132132+ mem_sttime = SBC_IDE_TIMING(PIO1);222133223223- case 1:224224- /* set timing parameters for RCS2# */225225- mem_sttime = SBC_IDE_PIO1_TWCS226226- | SBC_IDE_PIO1_TCSH227227- | SBC_IDE_PIO1_TCSOFF228228- | SBC_IDE_PIO1_TWP229229- | SBC_IDE_PIO1_TCSW230230- | SBC_IDE_PIO1_TPM231231- | SBC_IDE_PIO1_TA;232232- /* set configuration for RCS2# */233233- mem_stcfg |= TS_MASK;234234- mem_stcfg &= ~TCSOE_MASK;235235- mem_stcfg &= ~TOECS_MASK;236236- mem_stcfg |= SBC_IDE_PIO1_TCSOE | SBC_IDE_PIO1_TOECS;237237- break;134134+ /* set configuration for RCS2# */135135+ mem_stcfg |= TS_MASK;136136+ mem_stcfg &= ~TCSOE_MASK;137137+ mem_stcfg &= ~TOECS_MASK;138138+ mem_stcfg |= SBC_IDE_PIO1_TCSOE | SBC_IDE_PIO1_TOECS;139139+ break;238140239239- case 2:240240- /* set timing parameters for RCS2# */241241- mem_sttime = SBC_IDE_PIO2_TWCS242242- | SBC_IDE_PIO2_TCSH243243- | SBC_IDE_PIO2_TCSOFF244244- | SBC_IDE_PIO2_TWP245245- | SBC_IDE_PIO2_TCSW246246- | SBC_IDE_PIO2_TPM247247- | SBC_IDE_PIO2_TA;248248- /* set configuration for RCS2# */249249- mem_stcfg &= ~TS_MASK;250250- mem_stcfg &= ~TCSOE_MASK;251251- mem_stcfg &= ~TOECS_MASK;252252- mem_stcfg |= SBC_IDE_PIO2_TCSOE | SBC_IDE_PIO2_TOECS;253253- break;141141+ case 2:142142+ mem_sttime = SBC_IDE_TIMING(PIO2);254143255255- case 3:256256- /* set timing parameters for RCS2# */257257- mem_sttime = SBC_IDE_PIO3_TWCS258258- | SBC_IDE_PIO3_TCSH259259- | SBC_IDE_PIO3_TCSOFF260260- | SBC_IDE_PIO3_TWP261261- | SBC_IDE_PIO3_TCSW262262- | SBC_IDE_PIO3_TPM263263- | SBC_IDE_PIO3_TA;264264- /* set configuration for RCS2# */265265- mem_stcfg |= TS_MASK;266266- mem_stcfg &= ~TS_MASK;267267- mem_stcfg &= ~TCSOE_MASK;268268- mem_stcfg &= ~TOECS_MASK;269269- mem_stcfg |= SBC_IDE_PIO3_TCSOE | SBC_IDE_PIO3_TOECS;144144+ /* set configuration for RCS2# */145145+ mem_stcfg &= ~TS_MASK;146146+ mem_stcfg &= ~TCSOE_MASK;147147+ mem_stcfg &= ~TOECS_MASK;148148+ mem_stcfg |= SBC_IDE_PIO2_TCSOE | SBC_IDE_PIO2_TOECS;149149+ break;270150271271- break;151151+ case 3:152152+ mem_sttime = SBC_IDE_TIMING(PIO3);272153273273- case 4:274274- /* set timing parameters for RCS2# */275275- mem_sttime = SBC_IDE_PIO4_TWCS276276- | SBC_IDE_PIO4_TCSH277277- | SBC_IDE_PIO4_TCSOFF278278- | SBC_IDE_PIO4_TWP279279- | SBC_IDE_PIO4_TCSW280280- | SBC_IDE_PIO4_TPM281281- | SBC_IDE_PIO4_TA;282282- /* set configuration for RCS2# */283283- mem_stcfg &= ~TS_MASK;284284- mem_stcfg &= ~TCSOE_MASK;285285- mem_stcfg &= ~TOECS_MASK;286286- mem_stcfg |= SBC_IDE_PIO4_TCSOE | SBC_IDE_PIO4_TOECS;287287- break;288288- }154154+ /* set configuration for RCS2# */155155+ mem_stcfg &= ~TS_MASK;156156+ mem_stcfg &= ~TCSOE_MASK;157157+ mem_stcfg &= ~TOECS_MASK;158158+ mem_stcfg |= SBC_IDE_PIO3_TCSOE | SBC_IDE_PIO3_TOECS;289159290290- au_writel(mem_sttime,MEM_STTIME2);291291- au_writel(mem_stcfg,MEM_STCFG2);160160+ break;292161293293- spin_unlock_irqrestore(&ide_tune_drive_spin_lock, flags);162162+ case 4:163163+ mem_sttime = SBC_IDE_TIMING(PIO4);294164295295- speed = pio + XFER_PIO_0;296296- ide_config_drive_speed(drive, speed);165165+ /* set configuration for RCS2# */166166+ mem_stcfg &= ~TS_MASK;167167+ mem_stcfg &= ~TCSOE_MASK;168168+ mem_stcfg &= ~TOECS_MASK;169169+ mem_stcfg |= SBC_IDE_PIO4_TCSOE | SBC_IDE_PIO4_TOECS;170170+ break;171171+ }172172+173173+ au_writel(mem_sttime,MEM_STTIME2);174174+ au_writel(mem_stcfg,MEM_STCFG2);175175+176176+ speed = pio + XFER_PIO_0;177177+ ide_config_drive_speed(drive, speed);297178}298179299180static int auide_tune_chipset (ide_drive_t *drive, u8 speed)300181{301301- u8 mode = 0;302302- int mem_sttime;303303- int mem_stcfg;304304- unsigned long flags;305305-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA306306- struct hd_driveid *id = drive->id;182182+ int mem_sttime;183183+ int mem_stcfg;184184+ unsigned long mode;307185308308- /*309309- * Now see what the current drive is capable of,310310- * selecting UDMA only if the mate said it was ok.311311- */312312- if (id && (id->capability & 1) && drive->autodma &&313313- !__ide_dma_bad_drive(drive)) {314314- if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) {315315- if (id->dma_mword & 4)316316- mode = XFER_MW_DMA_2;317317- else if (id->dma_mword & 2)318318- mode = XFER_MW_DMA_1;319319- else if (id->dma_mword & 1)320320- mode = XFER_MW_DMA_0;321321- }322322- }186186+#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA187187+ if (ide_use_dma(drive))188188+ mode = ide_dma_speed(drive, 0);323189#endif324190325325- spin_lock_irqsave(&ide_tune_chipset_spin_lock, flags);191191+ mem_sttime = 0;192192+ mem_stcfg = au_readl(MEM_STCFG2);326193327327- mem_sttime = 0;328328- mem_stcfg = au_readl(MEM_STCFG2);329329-330330- switch(speed) {331331- case XFER_PIO_4:332332- case XFER_PIO_3:333333- case XFER_PIO_2:334334- case XFER_PIO_1:335335- case XFER_PIO_0:336336- auide_tune_drive(drive, (speed - XFER_PIO_0));337337- break;194194+ if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {195195+ auide_tune_drive(drive, speed - XFER_PIO_0);196196+ return 0;197197+ }198198+199199+ switch(speed) {338200#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA339339- case XFER_MW_DMA_2:340340- /* set timing parameters for RCS2# */341341- mem_sttime = SBC_IDE_MDMA2_TWCS342342- | SBC_IDE_MDMA2_TCSH343343- | SBC_IDE_MDMA2_TCSOFF344344- | SBC_IDE_MDMA2_TWP345345- | SBC_IDE_MDMA2_TCSW346346- | SBC_IDE_MDMA2_TPM347347- | SBC_IDE_MDMA2_TA;348348- /* set configuration for RCS2# */349349- mem_stcfg &= ~TS_MASK;350350- mem_stcfg &= ~TCSOE_MASK;351351- mem_stcfg &= ~TOECS_MASK;352352- mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS;201201+ case XFER_MW_DMA_2:202202+ mem_sttime = SBC_IDE_TIMING(MDMA2);353203354354- mode = XFER_MW_DMA_2;355355- break;356356- case XFER_MW_DMA_1:357357- /* set timing parameters for RCS2# */358358- mem_sttime = SBC_IDE_MDMA1_TWCS359359- | SBC_IDE_MDMA1_TCSH360360- | SBC_IDE_MDMA1_TCSOFF361361- | SBC_IDE_MDMA1_TWP362362- | SBC_IDE_MDMA1_TCSW363363- | SBC_IDE_MDMA1_TPM364364- | SBC_IDE_MDMA1_TA;365365- /* set configuration for RCS2# */366366- mem_stcfg &= ~TS_MASK;367367- mem_stcfg &= ~TCSOE_MASK;368368- mem_stcfg &= ~TOECS_MASK;369369- mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS;204204+ /* set configuration for RCS2# */205205+ mem_stcfg &= ~TS_MASK;206206+ mem_stcfg &= ~TCSOE_MASK;207207+ mem_stcfg &= ~TOECS_MASK;208208+ mem_stcfg |= SBC_IDE_MDMA2_TCSOE | SBC_IDE_MDMA2_TOECS;370209371371- mode = XFER_MW_DMA_1;372372- break;373373- case XFER_MW_DMA_0:374374- /* set timing parameters for RCS2# */375375- mem_sttime = SBC_IDE_MDMA0_TWCS376376- | SBC_IDE_MDMA0_TCSH377377- | SBC_IDE_MDMA0_TCSOFF378378- | SBC_IDE_MDMA0_TWP379379- | SBC_IDE_MDMA0_TCSW380380- | SBC_IDE_MDMA0_TPM381381- | SBC_IDE_MDMA0_TA;382382- /* set configuration for RCS2# */383383- mem_stcfg |= TS_MASK;384384- mem_stcfg &= ~TCSOE_MASK;385385- mem_stcfg &= ~TOECS_MASK;386386- mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS;210210+ mode = XFER_MW_DMA_2;211211+ break;212212+ case XFER_MW_DMA_1:213213+ mem_sttime = SBC_IDE_TIMING(MDMA1);387214388388- mode = XFER_MW_DMA_0;389389- break;215215+ /* set configuration for RCS2# */216216+ mem_stcfg &= ~TS_MASK;217217+ mem_stcfg &= ~TCSOE_MASK;218218+ mem_stcfg &= ~TOECS_MASK;219219+ mem_stcfg |= SBC_IDE_MDMA1_TCSOE | SBC_IDE_MDMA1_TOECS;220220+221221+ mode = XFER_MW_DMA_1;222222+ break;223223+ case XFER_MW_DMA_0:224224+ mem_sttime = SBC_IDE_TIMING(MDMA0);225225+226226+ /* set configuration for RCS2# */227227+ mem_stcfg |= TS_MASK;228228+ mem_stcfg &= ~TCSOE_MASK;229229+ mem_stcfg &= ~TOECS_MASK;230230+ mem_stcfg |= SBC_IDE_MDMA0_TCSOE | SBC_IDE_MDMA0_TOECS;231231+232232+ mode = XFER_MW_DMA_0;233233+ break;390234#endif391391- default:392392- return 1;393393- }235235+ default:236236+ return 1;237237+ }238238+239239+ if (ide_config_drive_speed(drive, mode))240240+ return 1;394241395395- /*396396- * Tell the drive to switch to the new mode; abort on failure.397397- */398398- if (!mode || ide_config_drive_speed(drive, mode))399399- {400400- return 1; /* failure */401401- }242242+ au_writel(mem_sttime,MEM_STTIME2);243243+ au_writel(mem_stcfg,MEM_STCFG2);402244403403-404404- au_writel(mem_sttime,MEM_STTIME2);405405- au_writel(mem_stcfg,MEM_STCFG2);406406-407407- spin_unlock_irqrestore(&ide_tune_chipset_spin_lock, flags);408408-409409- return 0;245245+ return 0;410246}411247412248/*413249 * Multi-Word DMA + DbDMA functions414250 */415415-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA416251417417-static int in_drive_list(struct hd_driveid *id,418418- const struct drive_list_entry *drive_table)419419-{420420- for ( ; drive_table->id_model ; drive_table++){421421- if ((!strcmp(drive_table->id_model, id->model)) &&422422- ((strstr(drive_table->id_firmware, id->fw_rev)) ||423423- (!strcmp(drive_table->id_firmware, "ALL")))424424- )425425- return 1;426426- }427427- return 0;428428-}252252+#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA429253430254static int auide_build_sglist(ide_drive_t *drive, struct request *rq)431255{432432- ide_hwif_t *hwif = drive->hwif;433433- _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;434434- struct scatterlist *sg = hwif->sg_table;256256+ ide_hwif_t *hwif = drive->hwif;257257+ _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;258258+ struct scatterlist *sg = hwif->sg_table;435259436436- ide_map_sg(drive, rq);260260+ ide_map_sg(drive, rq);437261438438- if (rq_data_dir(rq) == READ)439439- hwif->sg_dma_direction = DMA_FROM_DEVICE;440440- else441441- hwif->sg_dma_direction = DMA_TO_DEVICE;262262+ if (rq_data_dir(rq) == READ)263263+ hwif->sg_dma_direction = DMA_FROM_DEVICE;264264+ else265265+ hwif->sg_dma_direction = DMA_TO_DEVICE;442266443443- return dma_map_sg(ahwif->dev, sg, hwif->sg_nents,444444- hwif->sg_dma_direction);267267+ return dma_map_sg(ahwif->dev, sg, hwif->sg_nents,268268+ hwif->sg_dma_direction);445269}446270447271static int auide_build_dmatable(ide_drive_t *drive)448272{449449- int i, iswrite, count = 0;450450- ide_hwif_t *hwif = HWIF(drive);273273+ int i, iswrite, count = 0;274274+ ide_hwif_t *hwif = HWIF(drive);451275452452- struct request *rq = HWGROUP(drive)->rq;276276+ struct request *rq = HWGROUP(drive)->rq;453277454454- _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;455455- struct scatterlist *sg;278278+ _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;279279+ struct scatterlist *sg;456280457457- iswrite = (rq_data_dir(rq) == WRITE);458458- /* Save for interrupt context */459459- ahwif->drive = drive;281281+ iswrite = (rq_data_dir(rq) == WRITE);282282+ /* Save for interrupt context */283283+ ahwif->drive = drive;460284461461- /* Build sglist */462462- hwif->sg_nents = i = auide_build_sglist(drive, rq);285285+ /* Build sglist */286286+ hwif->sg_nents = i = auide_build_sglist(drive, rq);463287464464- if (!i)465465- return 0;288288+ if (!i)289289+ return 0;466290467467- /* fill the descriptors */468468- sg = hwif->sg_table;469469- while (i && sg_dma_len(sg)) {470470- u32 cur_addr;471471- u32 cur_len;291291+ /* fill the descriptors */292292+ sg = hwif->sg_table;293293+ while (i && sg_dma_len(sg)) {294294+ u32 cur_addr;295295+ u32 cur_len;472296473473- cur_addr = sg_dma_address(sg);474474- cur_len = sg_dma_len(sg);297297+ cur_addr = sg_dma_address(sg);298298+ cur_len = sg_dma_len(sg);475299476476- while (cur_len) {477477- u32 flags = DDMA_FLAGS_NOIE;478478- unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00;300300+ while (cur_len) {301301+ u32 flags = DDMA_FLAGS_NOIE;302302+ unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00;479303480480- if (++count >= PRD_ENTRIES) {481481- printk(KERN_WARNING "%s: DMA table too small\n",482482- drive->name);483483- goto use_pio_instead;484484- }304304+ if (++count >= PRD_ENTRIES) {305305+ printk(KERN_WARNING "%s: DMA table too small\n",306306+ drive->name);307307+ goto use_pio_instead;308308+ }485309486486- /* Lets enable intr for the last descriptor only */487487- if (1==i)488488- flags = DDMA_FLAGS_IE;489489- else490490- flags = DDMA_FLAGS_NOIE;310310+ /* Lets enable intr for the last descriptor only */311311+ if (1==i)312312+ flags = DDMA_FLAGS_IE;313313+ else314314+ flags = DDMA_FLAGS_NOIE;491315492492- if (iswrite) {493493- if(!put_source_flags(ahwif->tx_chan,494494- (void*)(page_address(sg->page)495495- + sg->offset),496496- tc, flags)) {497497- printk(KERN_ERR "%s failed %d\n",498498- __FUNCTION__, __LINE__);316316+ if (iswrite) {317317+ if(!put_source_flags(ahwif->tx_chan, 318318+ (void*)(page_address(sg->page) 319319+ + sg->offset), 320320+ tc, flags)) { 321321+ printk(KERN_ERR "%s failed %d\n", 322322+ __FUNCTION__, __LINE__);499323 }500500- } else324324+ } else 501325 {502502- if(!put_dest_flags(ahwif->rx_chan,503503- (void*)(page_address(sg->page)504504- + sg->offset),505505- tc, flags)) {506506- printk(KERN_ERR "%s failed %d\n",507507- __FUNCTION__, __LINE__);326326+ if(!put_dest_flags(ahwif->rx_chan, 327327+ (void*)(page_address(sg->page) 328328+ + sg->offset), 329329+ tc, flags)) { 330330+ printk(KERN_ERR "%s failed %d\n", 331331+ __FUNCTION__, __LINE__);508332 }509509- }333333+ }510334511511- cur_addr += tc;512512- cur_len -= tc;513513- }514514- sg++;515515- i--;516516- }335335+ cur_addr += tc;336336+ cur_len -= tc;337337+ }338338+ sg++;339339+ i--;340340+ }517341518518- if (count)519519- return 1;342342+ if (count)343343+ return 1;520344521521-use_pio_instead:522522- dma_unmap_sg(ahwif->dev,523523- hwif->sg_table,524524- hwif->sg_nents,525525- hwif->sg_dma_direction);345345+ use_pio_instead:346346+ dma_unmap_sg(ahwif->dev,347347+ hwif->sg_table,348348+ hwif->sg_nents,349349+ hwif->sg_dma_direction);526350527527- return 0; /* revert to PIO for this request */351351+ return 0; /* revert to PIO for this request */528352}529353530354static int auide_dma_end(ide_drive_t *drive)531355{532532- ide_hwif_t *hwif = HWIF(drive);533533- _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;356356+ ide_hwif_t *hwif = HWIF(drive);357357+ _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;534358535535- if (hwif->sg_nents) {536536- dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents,537537- hwif->sg_dma_direction);538538- hwif->sg_nents = 0;539539- }359359+ if (hwif->sg_nents) {360360+ dma_unmap_sg(ahwif->dev, hwif->sg_table, hwif->sg_nents,361361+ hwif->sg_dma_direction);362362+ hwif->sg_nents = 0;363363+ }540364541541- return 0;365365+ return 0;542366}543367544368static void auide_dma_start(ide_drive_t *drive )545369{546546-// printk("%s\n", __FUNCTION__);547370}548371549549-ide_startstop_t auide_dma_intr(ide_drive_t *drive)550550-{551551- //printk("%s\n", __FUNCTION__);552552-553553- u8 stat = 0, dma_stat = 0;554554-555555- dma_stat = HWIF(drive)->ide_dma_end(drive);556556- stat = HWIF(drive)->INB(IDE_STATUS_REG); /* get drive status */557557- if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {558558- if (!dma_stat) {559559- struct request *rq = HWGROUP(drive)->rq;560560-561561- ide_end_request(drive, 1, rq->nr_sectors);562562- return ide_stopped;563563- }564564- printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n",565565- drive->name, dma_stat);566566- }567567- return ide_error(drive, "dma_intr", stat);568568-}569372570373static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command)571374{572572- //printk("%s\n", __FUNCTION__);573573-574574- /* issue cmd to drive */575575- ide_execute_command(drive, command, &auide_dma_intr,576576- (2*WAIT_CMD), NULL);375375+ /* issue cmd to drive */376376+ ide_execute_command(drive, command, &ide_dma_intr,377377+ (2*WAIT_CMD), NULL);577378}578379579380static int auide_dma_setup(ide_drive_t *drive)580580-{581581-// printk("%s\n", __FUNCTION__);381381+{ 382382+ struct request *rq = HWGROUP(drive)->rq;582383583583- if (drive->media != ide_disk)584584- return 1;384384+ if (!auide_build_dmatable(drive)) {385385+ ide_map_sg(drive, rq);386386+ return 1;387387+ }585388586586- if (!auide_build_dmatable(drive))587587- /* try PIO instead of DMA */588588- return 1;589589-590590- drive->waiting_for_dma = 1;591591-592592- return 0;389389+ drive->waiting_for_dma = 1;390390+ return 0;593391}594392595393static int auide_dma_check(ide_drive_t *drive)596394{597597-// printk("%s\n", __FUNCTION__);395395+ u8 speed;598396599397#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA600600- if( !dbdma_init_done ){601601- auide_hwif.white_list = in_drive_list(drive->id,602602- dma_white_list);603603- auide_hwif.black_list = in_drive_list(drive->id,604604- dma_black_list);605605- auide_hwif.drive = drive;606606- auide_ddma_init(&auide_hwif);607607- dbdma_init_done = 1;608608- }398398+399399+ if( dbdma_init_done == 0 ){400400+ auide_hwif.white_list = ide_in_drive_list(drive->id,401401+ dma_white_list);402402+ auide_hwif.black_list = ide_in_drive_list(drive->id,403403+ dma_black_list);404404+ auide_hwif.drive = drive;405405+ auide_ddma_init(&auide_hwif);406406+ dbdma_init_done = 1;407407+ }609408#endif610409611611- /* Is the drive in our DMA black list? */612612- if ( auide_hwif.black_list ) {613613- drive->using_dma = 0;614614- printk("%s found in dma_blacklist[]! Disabling DMA.\n",615615- drive->id->model);616616- }617617- else618618- drive->using_dma = 1;410410+ /* Is the drive in our DMA black list? */619411620620- return HWIF(drive)->ide_dma_host_on(drive);412412+ if ( auide_hwif.black_list ) {413413+ drive->using_dma = 0;414414+415415+ /* Borrowed the warning message from ide-dma.c */416416+417417+ printk(KERN_WARNING "%s: Disabling DMA for %s (blacklisted)\n",418418+ drive->name, drive->id->model); 419419+ }420420+ else421421+ drive->using_dma = 1;422422+423423+ speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA);424424+425425+ if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)426426+ return HWIF(drive)->ide_dma_on(drive);427427+428428+ return HWIF(drive)->ide_dma_off_quietly(drive);621429}622430623431static int auide_dma_test_irq(ide_drive_t *drive)624624-{625625-// printk("%s\n", __FUNCTION__);626626-627627- if (!drive->waiting_for_dma)628628- printk(KERN_WARNING "%s: ide_dma_test_irq \432432+{ 433433+ if (drive->waiting_for_dma == 0)434434+ printk(KERN_WARNING "%s: ide_dma_test_irq \629435 called while not waiting\n", drive->name);630436631631- /* If dbdma didn't execute the STOP command yet, the632632- * active bit is still set437437+ /* If dbdma didn't execute the STOP command yet, the438438+ * active bit is still set633439 */634634- drive->waiting_for_dma++;635635- if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) {636636- printk(KERN_WARNING "%s: timeout waiting for ddma to \440440+ drive->waiting_for_dma++;441441+ if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) {442442+ printk(KERN_WARNING "%s: timeout waiting for ddma to \637443 complete\n", drive->name);638638- return 1;639639- }640640- udelay(10);641641- return 0;444444+ return 1;445445+ }446446+ udelay(10);447447+ return 0;642448}643449644450static int auide_dma_host_on(ide_drive_t *drive)645451{646646-// printk("%s\n", __FUNCTION__);647647- return 0;452452+ return 0;648453}649454650455static int auide_dma_on(ide_drive_t *drive)651456{652652-// printk("%s\n", __FUNCTION__);653653- drive->using_dma = 1;654654- return auide_dma_host_on(drive);457457+ drive->using_dma = 1;458458+ return auide_dma_host_on(drive);655459}656460657461658462static int auide_dma_host_off(ide_drive_t *drive)659463{660660-// printk("%s\n", __FUNCTION__);661661- return 0;464464+ return 0;662465}663466664467static int auide_dma_off_quietly(ide_drive_t *drive)665468{666666-// printk("%s\n", __FUNCTION__);667667- drive->using_dma = 0;668668- return auide_dma_host_off(drive);469469+ drive->using_dma = 0;470470+ return auide_dma_host_off(drive);669471}670472671473static int auide_dma_lostirq(ide_drive_t *drive)672474{673673-// printk("%s\n", __FUNCTION__);674674-675675- printk(KERN_ERR "%s: IRQ lost\n", drive->name);676676- return 0;475475+ printk(KERN_ERR "%s: IRQ lost\n", drive->name);476476+ return 0;677477}678478679479static void auide_ddma_tx_callback(int irq, void *param, struct pt_regs *regs)680480{681681-// printk("%s\n", __FUNCTION__);682682-683683- _auide_hwif *ahwif = (_auide_hwif*)param;684684- ahwif->drive->waiting_for_dma = 0;685685- return;481481+ _auide_hwif *ahwif = (_auide_hwif*)param;482482+ ahwif->drive->waiting_for_dma = 0;686483}687484688485static void auide_ddma_rx_callback(int irq, void *param, struct pt_regs *regs)689486{690690-// printk("%s\n", __FUNCTION__);691691-692692- _auide_hwif *ahwif = (_auide_hwif*)param;693693- ahwif->drive->waiting_for_dma = 0;694694- return;487487+ _auide_hwif *ahwif = (_auide_hwif*)param;488488+ ahwif->drive->waiting_for_dma = 0;695489}490490+491491+#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */492492+493493+static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags)494494+{495495+ dev->dev_id = dev_id;496496+ dev->dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR;497497+ dev->dev_intlevel = 0;498498+ dev->dev_intpolarity = 0;499499+ dev->dev_tsize = tsize;500500+ dev->dev_devwidth = devwidth;501501+ dev->dev_flags = flags;502502+}503503+504504+#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)696505697506static int auide_dma_timeout(ide_drive_t *drive)698507{699508// printk("%s\n", __FUNCTION__);700509701701- printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);510510+ printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);702511703703- if (HWIF(drive)->ide_dma_test_irq(drive))704704- return 0;512512+ if (HWIF(drive)->ide_dma_test_irq(drive))513513+ return 0;705514706706- return HWIF(drive)->ide_dma_end(drive);515515+ return HWIF(drive)->ide_dma_end(drive);707516}708708-#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */517517+709518519519+static int auide_ddma_init(_auide_hwif *auide) {520520+521521+ dbdev_tab_t source_dev_tab, target_dev_tab;522522+ u32 dev_id, tsize, devwidth, flags;523523+ ide_hwif_t *hwif = auide->hwif;710524525525+ dev_id = AU1XXX_ATA_DDMA_REQ;526526+527527+ if (auide->white_list || auide->black_list) {528528+ tsize = 8;529529+ devwidth = 32;530530+ }531531+ else { 532532+ tsize = 1;533533+ devwidth = 16;534534+535535+ printk(KERN_ERR "au1xxx-ide: %s is not on ide driver whitelist.\n",auide_hwif.drive->id->model);536536+ printk(KERN_ERR " please read 'Documentation/mips/AU1xxx_IDE.README'");537537+ }538538+539539+#ifdef IDE_AU1XXX_BURSTMODE 540540+ flags = DEV_FLAGS_SYNC | DEV_FLAGS_BURSTABLE;541541+#else542542+ flags = DEV_FLAGS_SYNC;543543+#endif544544+545545+ /* setup dev_tab for tx channel */546546+ auide_init_dbdma_dev( &source_dev_tab,547547+ dev_id,548548+ tsize, devwidth, DEV_FLAGS_OUT | flags);549549+ auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );550550+551551+ auide_init_dbdma_dev( &source_dev_tab,552552+ dev_id,553553+ tsize, devwidth, DEV_FLAGS_IN | flags);554554+ auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );555555+556556+ /* We also need to add a target device for the DMA */557557+ auide_init_dbdma_dev( &target_dev_tab,558558+ (u32)DSCR_CMD0_ALWAYS,559559+ tsize, devwidth, DEV_FLAGS_ANYUSE);560560+ auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab); 561561+562562+ /* Get a channel for TX */563563+ auide->tx_chan = au1xxx_dbdma_chan_alloc(auide->target_dev_id,564564+ auide->tx_dev_id,565565+ auide_ddma_tx_callback,566566+ (void*)auide);567567+568568+ /* Get a channel for RX */569569+ auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id,570570+ auide->target_dev_id,571571+ auide_ddma_rx_callback,572572+ (void*)auide);573573+574574+ auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan,575575+ NUM_DESCRIPTORS);576576+ auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan,577577+ NUM_DESCRIPTORS);578578+579579+ hwif->dmatable_cpu = dma_alloc_coherent(auide->dev,580580+ PRD_ENTRIES * PRD_BYTES, /* 1 Page */581581+ &hwif->dmatable_dma, GFP_KERNEL);582582+583583+ au1xxx_dbdma_start( auide->tx_chan );584584+ au1xxx_dbdma_start( auide->rx_chan );585585+586586+ return 0;587587+} 588588+#else589589+711590static int auide_ddma_init( _auide_hwif *auide )712591{713713-// printk("%s\n", __FUNCTION__);592592+ dbdev_tab_t source_dev_tab;593593+ int flags;714594715715- dbdev_tab_t source_dev_tab;716716-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)717717- dbdev_tab_t target_dev_tab;718718- ide_hwif_t *hwif = auide->hwif;719719- char warning_output [2][80];720720- int i;721721-#endif722722-723723- /* Add our custom device to DDMA device table */724724- /* Create our new device entries in the table */725725-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)726726- source_dev_tab.dev_id = AU1XXX_ATA_DDMA_REQ;727727-728728- if( auide->white_list || auide->black_list ){729729- source_dev_tab.dev_tsize = 8;730730- source_dev_tab.dev_devwidth = 32;731731- source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR;732732- source_dev_tab.dev_intlevel = 0;733733- source_dev_tab.dev_intpolarity = 0;734734-735735- /* init device table for target - static bus controller - */736736- target_dev_tab.dev_id = DSCR_CMD0_ALWAYS;737737- target_dev_tab.dev_tsize = 8;738738- target_dev_tab.dev_devwidth = 32;739739- target_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR;740740- target_dev_tab.dev_intlevel = 0;741741- target_dev_tab.dev_intpolarity = 0;742742- target_dev_tab.dev_flags = DEV_FLAGS_ANYUSE;743743- }744744- else{745745- source_dev_tab.dev_tsize = 1;746746- source_dev_tab.dev_devwidth = 16;747747- source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR;748748- source_dev_tab.dev_intlevel = 0;749749- source_dev_tab.dev_intpolarity = 0;750750-751751- /* init device table for target - static bus controller - */752752- target_dev_tab.dev_id = DSCR_CMD0_ALWAYS;753753- target_dev_tab.dev_tsize = 1;754754- target_dev_tab.dev_devwidth = 16;755755- target_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR;756756- target_dev_tab.dev_intlevel = 0;757757- target_dev_tab.dev_intpolarity = 0;758758- target_dev_tab.dev_flags = DEV_FLAGS_ANYUSE;759759-760760- sprintf(&warning_output[0][0],761761- "%s is not on ide driver white list.",762762- auide_hwif.drive->id->model);763763- for ( i=strlen(&warning_output[0][0]) ; i<76; i++ ){764764- sprintf(&warning_output[0][i]," ");765765- }766766-767767- sprintf(&warning_output[1][0],768768- "To add %s please read 'Documentation/mips/AU1xxx_IDE.README'.",769769- auide_hwif.drive->id->model);770770- for ( i=strlen(&warning_output[1][0]) ; i<76; i++ ){771771- sprintf(&warning_output[1][i]," ");772772- }773773-774774- printk("\n****************************************");775775- printk("****************************************\n");776776- printk("* %s *\n",&warning_output[0][0]);777777- printk("* Switch to safe MWDMA Mode! ");778778- printk(" *\n");779779- printk("* %s *\n",&warning_output[1][0]);780780- printk("****************************************");781781- printk("****************************************\n\n");782782- }595595+#ifdef IDE_AU1XXX_BURSTMODE 596596+ flags = DEV_FLAGS_SYNC | DEV_FLAGS_BURSTABLE;783597#else784784- source_dev_tab.dev_id = DSCR_CMD0_ALWAYS;785785- source_dev_tab.dev_tsize = 8;786786- source_dev_tab.dev_devwidth = 32;787787- source_dev_tab.dev_physaddr = (u32)AU1XXX_ATA_PHYS_ADDR;788788- source_dev_tab.dev_intlevel = 0;789789- source_dev_tab.dev_intpolarity = 0;598598+ flags = DEV_FLAGS_SYNC;790599#endif791600792792-#if CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON793793- /* set flags for tx channel */794794- source_dev_tab.dev_flags = DEV_FLAGS_OUT795795- | DEV_FLAGS_SYNC796796- | DEV_FLAGS_BURSTABLE;797797- auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );798798- /* set flags for rx channel */799799- source_dev_tab.dev_flags = DEV_FLAGS_IN800800- | DEV_FLAGS_SYNC801801- | DEV_FLAGS_BURSTABLE;802802- auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );803803-#else804804- /* set flags for tx channel */805805- source_dev_tab.dev_flags = DEV_FLAGS_OUT | DEV_FLAGS_SYNC;806806- auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );807807- /* set flags for rx channel */808808- source_dev_tab.dev_flags = DEV_FLAGS_IN | DEV_FLAGS_SYNC;809809- auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );810810-#endif601601+ /* setup dev_tab for tx channel */602602+ auide_init_dbdma_dev( &source_dev_tab,603603+ (u32)DSCR_CMD0_ALWAYS,604604+ 8, 32, DEV_FLAGS_OUT | flags);605605+ auide->tx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );811606812812-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)813813-814814- auide->target_dev_id = au1xxx_ddma_add_device(&target_dev_tab);815815-816816- /* Get a channel for TX */817817- auide->tx_chan = au1xxx_dbdma_chan_alloc(auide->target_dev_id,818818- auide->tx_dev_id,819819- auide_ddma_tx_callback,820820- (void*)auide);821821- /* Get a channel for RX */822822- auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id,823823- auide->target_dev_id,824824- auide_ddma_rx_callback,825825- (void*)auide);826826-#else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */827827- /*828828- * Note: if call back is not enabled, update ctp->cur_ptr manually829829- */830830- auide->tx_chan = au1xxx_dbdma_chan_alloc(DSCR_CMD0_ALWAYS,831831- auide->tx_dev_id,832832- NULL,833833- (void*)auide);834834- auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id,835835- DSCR_CMD0_ALWAYS,836836- NULL,837837- (void*)auide);838838-#endif839839- auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan,840840- NUM_DESCRIPTORS);841841- auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan,842842- NUM_DESCRIPTORS);843843-844844-#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)845845- hwif->dmatable_cpu = dma_alloc_coherent(auide->dev,846846- PRD_ENTRIES * PRD_BYTES, /* 1 Page */847847- &hwif->dmatable_dma, GFP_KERNEL);848848-849849- auide->sg_table = kmalloc(sizeof(struct scatterlist) * PRD_ENTRIES,850850- GFP_KERNEL|GFP_DMA);851851- if (auide->sg_table == NULL) {852852- return -ENOMEM;853853- }854854-#endif855855- au1xxx_dbdma_start( auide->tx_chan );856856- au1xxx_dbdma_start( auide->rx_chan );857857- return 0;607607+ auide_init_dbdma_dev( &source_dev_tab,608608+ (u32)DSCR_CMD0_ALWAYS,609609+ 8, 32, DEV_FLAGS_IN | flags);610610+ auide->rx_dev_id = au1xxx_ddma_add_device( &source_dev_tab );611611+612612+ /* Get a channel for TX */613613+ auide->tx_chan = au1xxx_dbdma_chan_alloc(DSCR_CMD0_ALWAYS,614614+ auide->tx_dev_id,615615+ NULL,616616+ (void*)auide);617617+618618+ /* Get a channel for RX */619619+ auide->rx_chan = au1xxx_dbdma_chan_alloc(auide->rx_dev_id,620620+ DSCR_CMD0_ALWAYS,621621+ NULL,622622+ (void*)auide);623623+624624+ auide->tx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->tx_chan,625625+ NUM_DESCRIPTORS);626626+ auide->rx_desc_head = (void*)au1xxx_dbdma_ring_alloc(auide->rx_chan,627627+ NUM_DESCRIPTORS);628628+629629+ au1xxx_dbdma_start( auide->tx_chan );630630+ au1xxx_dbdma_start( auide->rx_chan );631631+632632+ return 0;858633}634634+#endif859635860636static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif)861637{862862- int i;863863-#define ide_ioreg_t unsigned long864864- ide_ioreg_t *ata_regs = hw->io_ports;638638+ int i;639639+ unsigned long *ata_regs = hw->io_ports;865640866866- /* fixme */867867- for (i = 0; i < IDE_CONTROL_OFFSET; i++) {868868- *ata_regs++ = (ide_ioreg_t) ahwif->regbase869869- + (ide_ioreg_t)(i << AU1XXX_ATA_REG_OFFSET);870870- }641641+ /* FIXME? */642642+ for (i = 0; i < IDE_CONTROL_OFFSET; i++) {643643+ *ata_regs++ = ahwif->regbase + (i << AU1XXX_ATA_REG_OFFSET);644644+ }871645872872- /* set the Alternative Status register */873873- *ata_regs = (ide_ioreg_t) ahwif->regbase874874- + (ide_ioreg_t)(14 << AU1XXX_ATA_REG_OFFSET);646646+ /* set the Alternative Status register */647647+ *ata_regs = ahwif->regbase + (14 << AU1XXX_ATA_REG_OFFSET);875648}876649877650static int au_ide_probe(struct device *dev)878651{879652 struct platform_device *pdev = to_platform_device(dev);880880- _auide_hwif *ahwif = &auide_hwif;881881- ide_hwif_t *hwif;653653+ _auide_hwif *ahwif = &auide_hwif;654654+ ide_hwif_t *hwif;882655 struct resource *res;883656 int ret = 0;884657885658#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)886886- char *mode = "MWDMA2";659659+ char *mode = "MWDMA2";887660#elif defined(CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA)888888- char *mode = "PIO+DDMA(offload)";661661+ char *mode = "PIO+DDMA(offload)";889662#endif890663891891- memset(&auide_hwif, 0, sizeof(_auide_hwif));892892- auide_hwif.dev = 0;664664+ memset(&auide_hwif, 0, sizeof(_auide_hwif));665665+ auide_hwif.dev = 0;893666894667 ahwif->dev = dev;895668 ahwif->irq = platform_get_irq(pdev, 0);···675902 goto out;676903 }677904678678- if (!request_mem_region (res->start, res->end-res->start, pdev->name)) {905905+ if (!request_mem_region (res->start, res->end-res->start, pdev->name)) {679906 pr_debug("%s: request_mem_region failed\n", DRV_NAME);680680- ret = -EBUSY;907907+ ret = -EBUSY;681908 goto out;682682- }909909+ }683910684911 ahwif->regbase = (u32)ioremap(res->start, res->end-res->start);685912 if (ahwif->regbase == 0) {···687914 goto out;688915 }689916690690- hwif = &ide_hwifs[pdev->id];691691- hw_regs_t *hw = &hwif->hw;692692- hwif->irq = hw->irq = ahwif->irq;693693- hwif->chipset = ide_au1xxx;917917+ /* FIXME: This might possibly break PCMCIA IDE devices */694918695695- auide_setup_ports(hw, ahwif);919919+ hwif = &ide_hwifs[pdev->id];920920+ hw_regs_t *hw = &hwif->hw;921921+ hwif->irq = hw->irq = ahwif->irq;922922+ hwif->chipset = ide_au1xxx;923923+924924+ auide_setup_ports(hw, ahwif);696925 memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));697926698698-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ699699- hwif->rqsize = CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ;700700- hwif->rqsize = ((hwif->rqsize > AU1XXX_ATA_RQSIZE)701701- || (hwif->rqsize < 32)) ? AU1XXX_ATA_RQSIZE : hwif->rqsize;702702-#else /* if kernel config is not set */703703- hwif->rqsize = AU1XXX_ATA_RQSIZE;704704-#endif705705-706706- hwif->ultra_mask = 0x0; /* Disable Ultra DMA */927927+ hwif->ultra_mask = 0x0; /* Disable Ultra DMA */707928#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA708708- hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */709709- hwif->swdma_mask = 0x07;929929+ hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */930930+ hwif->swdma_mask = 0x00;710931#else711711- hwif->mwdma_mask = 0x0;712712- hwif->swdma_mask = 0x0;932932+ hwif->mwdma_mask = 0x0;933933+ hwif->swdma_mask = 0x0;713934#endif714714- //hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];715715- hwif->noprobe = 0;716716- hwif->drives[0].unmask = 1;717717- hwif->drives[1].unmask = 1;718935719719- /* hold should be on in all cases */720720- hwif->hold = 1;721721- hwif->mmio = 2;936936+ hwif->noprobe = 0;937937+ hwif->drives[0].unmask = 1;938938+ hwif->drives[1].unmask = 1;722939723723- /* set up local I/O function entry points */724724- hwif->INB = auide_inb;725725- hwif->INW = auide_inw;726726- hwif->INL = auide_inl;727727- hwif->INSW = auide_insw;728728- hwif->INSL = auide_insl;729729- hwif->OUTB = auide_outb;730730- hwif->OUTBSYNC = auide_outbsync;731731- hwif->OUTW = auide_outw;732732- hwif->OUTL = auide_outl;733733- hwif->OUTSW = auide_outsw;734734- hwif->OUTSL = auide_outsl;940940+ /* hold should be on in all cases */941941+ hwif->hold = 1;942942+ hwif->mmio = 2;735943736736- hwif->tuneproc = &auide_tune_drive;737737- hwif->speedproc = &auide_tune_chipset;944944+ /* If the user has selected DDMA assisted copies,945945+ then set up a few local I/O function entry points 946946+ */947947+948948+#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA 949949+ hwif->INSW = auide_insw;950950+ hwif->OUTSW = auide_outsw;951951+#endif952952+953953+ hwif->tuneproc = &auide_tune_drive;954954+ hwif->speedproc = &auide_tune_chipset;738955739956#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA740740- hwif->ide_dma_off_quietly = &auide_dma_off_quietly;741741- hwif->ide_dma_timeout = &auide_dma_timeout;957957+ hwif->ide_dma_off_quietly = &auide_dma_off_quietly;958958+ hwif->ide_dma_timeout = &auide_dma_timeout;742959743743- hwif->ide_dma_check = &auide_dma_check;744744- hwif->dma_exec_cmd = &auide_dma_exec_cmd;745745- hwif->dma_start = &auide_dma_start;746746- hwif->ide_dma_end = &auide_dma_end;747747- hwif->dma_setup = &auide_dma_setup;748748- hwif->ide_dma_test_irq = &auide_dma_test_irq;749749- hwif->ide_dma_host_off = &auide_dma_host_off;750750- hwif->ide_dma_host_on = &auide_dma_host_on;751751- hwif->ide_dma_lostirq = &auide_dma_lostirq;752752- hwif->ide_dma_on = &auide_dma_on;960960+ hwif->ide_dma_check = &auide_dma_check;961961+ hwif->dma_exec_cmd = &auide_dma_exec_cmd;962962+ hwif->dma_start = &auide_dma_start;963963+ hwif->ide_dma_end = &auide_dma_end;964964+ hwif->dma_setup = &auide_dma_setup;965965+ hwif->ide_dma_test_irq = &auide_dma_test_irq;966966+ hwif->ide_dma_host_off = &auide_dma_host_off;967967+ hwif->ide_dma_host_on = &auide_dma_host_on;968968+ hwif->ide_dma_lostirq = &auide_dma_lostirq;969969+ hwif->ide_dma_on = &auide_dma_on;753970754754- hwif->autodma = 1;755755- hwif->drives[0].autodma = hwif->autodma;756756- hwif->drives[1].autodma = hwif->autodma;757757- hwif->atapi_dma = 1;758758- hwif->drives[0].using_dma = 1;759759- hwif->drives[1].using_dma = 1;971971+ hwif->autodma = 1;972972+ hwif->drives[0].autodma = hwif->autodma;973973+ hwif->drives[1].autodma = hwif->autodma;974974+ hwif->atapi_dma = 1;975975+760976#else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */761761- hwif->autodma = 0;762762- hwif->channel = 0;763763- hwif->hold = 1;764764- hwif->select_data = 0; /* no chipset-specific code */765765- hwif->config_data = 0; /* no chipset-specific code */977977+ hwif->autodma = 0;978978+ hwif->channel = 0;979979+ hwif->hold = 1;980980+ hwif->select_data = 0; /* no chipset-specific code */981981+ hwif->config_data = 0; /* no chipset-specific code */766982767767- hwif->drives[0].autodma = 0;768768- hwif->drives[0].drive_data = 0; /* no drive data */769769- hwif->drives[0].using_dma = 0;770770- hwif->drives[0].waiting_for_dma = 0;771771- hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */772772- /* secondary hdd not supported */773773- hwif->drives[1].autodma = 0;774774-775775- hwif->drives[1].drive_data = 0;776776- hwif->drives[1].using_dma = 0;777777- hwif->drives[1].waiting_for_dma = 0;778778- hwif->drives[1].autotune = 2; /* 1=autotune, 2=noautotune, 0=default */983983+ hwif->drives[0].autodma = 0;984984+ hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */779985#endif780780- hwif->drives[0].io_32bit = 0; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */781781- hwif->drives[1].io_32bit = 0; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */986986+ hwif->drives[0].no_io_32bit = 1; 782987783783- /*Register Driver with PM Framework*/784784-#ifdef CONFIG_PM785785- auide_hwif.pm.lock = SPIN_LOCK_UNLOCKED;786786- auide_hwif.pm.stopped = 0;988988+ auide_hwif.hwif = hwif;989989+ hwif->hwif_data = &auide_hwif;787990788788- auide_hwif.pm.dev = new_au1xxx_power_device( "ide",789789- &au1200ide_pm_callback,790790- NULL);791791- if ( auide_hwif.pm.dev == NULL )792792- printk(KERN_INFO "Unable to create a power management \793793- device entry for the au1200-IDE.\n");794794- else795795- printk(KERN_INFO "Power management device entry for the \796796- au1200-IDE loaded.\n");797797-#endif798798-799799- auide_hwif.hwif = hwif;800800- hwif->hwif_data = &auide_hwif;801801-802802-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA803803- auide_ddma_init(&auide_hwif);804804- dbdma_init_done = 1;991991+#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA 992992+ auide_ddma_init(&auide_hwif);993993+ dbdma_init_done = 1;805994#endif806995807996 probe_hwif_init(hwif);808997 dev_set_drvdata(dev, hwif);809998810810- printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode );999999+ printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode );8111000812812-out:813813- return ret;10011001+ out:10021002+ return ret;8141003}81510048161005static int au_ide_remove(struct device *dev)···7801045 struct platform_device *pdev = to_platform_device(dev);7811046 struct resource *res;7821047 ide_hwif_t *hwif = dev_get_drvdata(dev);783783- _auide_hwif *ahwif = &auide_hwif;10481048+ _auide_hwif *ahwif = &auide_hwif;78410497851050 ide_unregister(hwif - ide_hwifs);7861051···8041069 return driver_register(&au1200_ide_driver);8051070}8061071807807-static void __init au_ide_exit(void)10721072+static void __exit au_ide_exit(void)8081073{8091074 driver_unregister(&au1200_ide_driver);8101075}811811-812812-#ifdef CONFIG_PM813813-int au1200ide_pm_callback( au1xxx_power_dev_t *dev,\814814- au1xxx_request_t request, void *data) {815815-816816- unsigned int d, err = 0;817817- unsigned long flags;818818-819819- spin_lock_irqsave(auide_hwif.pm.lock, flags);820820-821821- switch (request){822822- case AU1XXX_PM_SLEEP:823823- err = au1xxxide_pm_sleep(dev);824824- break;825825- case AU1XXX_PM_WAKEUP:826826- d = *((unsigned int*)data);827827- if ( d > 0 && d <= 99) {828828- err = au1xxxide_pm_standby(dev);829829- }830830- else {831831- err = au1xxxide_pm_resume(dev);832832- }833833- break;834834- case AU1XXX_PM_GETSTATUS:835835- err = au1xxxide_pm_getstatus(dev);836836- break;837837- case AU1XXX_PM_ACCESS:838838- err = au1xxxide_pm_access(dev);839839- break;840840- case AU1XXX_PM_IDLE:841841- err = au1xxxide_pm_idle(dev);842842- break;843843- case AU1XXX_PM_CLEANUP:844844- err = au1xxxide_pm_cleanup(dev);845845- break;846846- default:847847- err = -1;848848- break;849849- }850850-851851- spin_unlock_irqrestore(auide_hwif.pm.lock, flags);852852-853853- return err;854854-}855855-856856-static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev ) {857857- return 0;858858-}859859-860860-static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev ) {861861-862862- int retval;863863- ide_hwif_t *hwif = auide_hwif.hwif;864864- struct request rq;865865- struct request_pm_state rqpm;866866- ide_task_t args;867867-868868- if(auide_hwif.pm.stopped)869869- return -1;870870-871871- /*872872- * wait until hard disc is ready873873- */874874- if ( wait_for_ready(&hwif->drives[0], 35000) ) {875875- printk("Wait for drive sleep timeout!\n");876876- retval = -1;877877- }878878-879879- /*880880- * sequenz to tell the high level ide driver that pm is resuming881881- */882882- memset(&rq, 0, sizeof(rq));883883- memset(&rqpm, 0, sizeof(rqpm));884884- memset(&args, 0, sizeof(args));885885- rq.flags = REQ_PM_SUSPEND;886886- rq.special = &args;887887- rq.pm = &rqpm;888888- rqpm.pm_step = ide_pm_state_start_suspend;889889- rqpm.pm_state = PMSG_SUSPEND;890890-891891- retval = ide_do_drive_cmd(&hwif->drives[0], &rq, ide_wait);892892-893893- if (wait_for_ready (&hwif->drives[0], 35000)) {894894- printk("Wait for drive sleep timeout!\n");895895- retval = -1;896896- }897897-898898- /*899899- * stop dbdma channels900900- */901901- au1xxx_dbdma_reset(auide_hwif.tx_chan);902902- au1xxx_dbdma_reset(auide_hwif.rx_chan);903903-904904- auide_hwif.pm.stopped = 1;905905-906906- return retval;907907-}908908-909909-static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev ) {910910-911911- int retval;912912- ide_hwif_t *hwif = auide_hwif.hwif;913913- struct request rq;914914- struct request_pm_state rqpm;915915- ide_task_t args;916916-917917- if(!auide_hwif.pm.stopped)918918- return -1;919919-920920- /*921921- * start dbdma channels922922- */923923- au1xxx_dbdma_start(auide_hwif.tx_chan);924924- au1xxx_dbdma_start(auide_hwif.rx_chan);925925-926926- /*927927- * wait until hard disc is ready928928- */929929- if (wait_for_ready ( &hwif->drives[0], 35000)) {930930- printk("Wait for drive wake up timeout!\n");931931- retval = -1;932932- }933933-934934- /*935935- * sequenz to tell the high level ide driver that pm is resuming936936- */937937- memset(&rq, 0, sizeof(rq));938938- memset(&rqpm, 0, sizeof(rqpm));939939- memset(&args, 0, sizeof(args));940940- rq.flags = REQ_PM_RESUME;941941- rq.special = &args;942942- rq.pm = &rqpm;943943- rqpm.pm_step = ide_pm_state_start_resume;944944- rqpm.pm_state = PMSG_ON;945945-946946- retval = ide_do_drive_cmd(&hwif->drives[0], &rq, ide_head_wait);947947-948948- /*949949- * wait for hard disc950950- */951951- if ( wait_for_ready(&hwif->drives[0], 35000) ) {952952- printk("Wait for drive wake up timeout!\n");953953- retval = -1;954954- }955955-956956- auide_hwif.pm.stopped = 0;957957-958958- return retval;959959-}960960-961961-static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev ) {962962- return dev->cur_state;963963-}964964-965965-static int au1xxxide_pm_access( au1xxx_power_dev_t *dev ) {966966- if (dev->cur_state != AWAKE_STATE)967967- return 0;968968- else969969- return -1;970970-}971971-972972-static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev ) {973973- return 0;974974-}975975-976976-static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev ) {977977- return 0;978978-}979979-#endif /* CONFIG_PM */98010769811077MODULE_LICENSE("GPL");9821078MODULE_DESCRIPTION("AU1200 IDE driver");
+7-1
drivers/ide/pci/sgiioc4.c
···622622 ide_hwif_t *hwif;623623 int h;624624625625+ /*626626+ * Find an empty HWIF; if none available, return -ENOMEM.627627+ */625628 for (h = 0; h < MAX_HWIFS; ++h) {626629 hwif = &ide_hwifs[h];627627- /* Find an empty HWIF */628630 if (hwif->chipset == ide_unknown)629631 break;632632+ }633633+ if (h == MAX_HWIFS) {634634+ printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", d->name);635635+ return -ENOMEM;630636 }631637632638 /* Get the CmdBlk and CtrlBlk Base Registers */
···4141 /* this nodes state */4242 unsigned in_bus_reset:1;4343 unsigned is_shutdown:1;4444+ unsigned resume_packet_sent:1;44454546 /* this nodes' duties on the bus */4647 unsigned is_root:1;
+57-10
drivers/ieee1394/nodemgr.c
···13491349}135013501351135113521352+/* Write the BROADCAST_CHANNEL as per IEEE1394a 8.3.2.3.11 and 8.4.2.3. This13531353+ * seems like an optional service but in the end it is practically mandatory13541354+ * as a consequence of these clauses.13551355+ *13561356+ * Note that we cannot do a broadcast write to all nodes at once because some13571357+ * pre-1394a devices would hang. */13581358+static void nodemgr_irm_write_bc(struct node_entry *ne, int generation)13591359+{13601360+ const u64 bc_addr = (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL);13611361+ quadlet_t bc_remote, bc_local;13621362+ int ret;13631363+13641364+ if (!ne->host->is_irm || ne->generation != generation ||13651365+ ne->nodeid == ne->host->node_id)13661366+ return;13671367+13681368+ bc_local = cpu_to_be32(ne->host->csr.broadcast_channel);13691369+13701370+ /* Check if the register is implemented and 1394a compliant. */13711371+ ret = hpsb_read(ne->host, ne->nodeid, generation, bc_addr, &bc_remote,13721372+ sizeof(bc_remote));13731373+ if (!ret && bc_remote & cpu_to_be32(0x80000000) &&13741374+ bc_remote != bc_local)13751375+ hpsb_node_write(ne, bc_addr, &bc_local, sizeof(bc_local));13761376+}13771377+13781378+13521379static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation)13531380{13541381 struct device *dev;···13861359 dev = get_device(&ne->device);13871360 if (!dev)13881361 return;13621362+13631363+ nodemgr_irm_write_bc(ne, generation);1389136413901365 /* If "needs_probe", then this is either a new or changed node we13911366 * rescan totally. If the generation matches for an existing node···14421413 return;14431414}1444141514451445-/* Because we are a 1394a-2000 compliant IRM, we need to inform all the other14461446- * nodes of the broadcast channel. (Really we're only setting the validity14471447- * bit). Other IRM responsibilities go in here as well. */14161416+static int nodemgr_send_resume_packet(struct hpsb_host *host)14171417+{14181418+ struct hpsb_packet *packet;14191419+ int ret = 1;14201420+14211421+ packet = hpsb_make_phypacket(host,14221422+ 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24);14231423+ if (packet) {14241424+ packet->no_waiter = 1;14251425+ packet->generation = get_hpsb_generation(host);14261426+ ret = hpsb_send_packet(packet);14271427+ }14281428+ if (ret)14291429+ HPSB_WARN("fw-host%d: Failed to broadcast resume packet",14301430+ host->id);14311431+ return ret;14321432+}14331433+14341434+/* Perform a few high-level IRM responsibilities. */14481435static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)14491436{14501437 quadlet_t bc;···14691424 if (!host->is_irm || host->irm_id == (nodeid_t)-1)14701425 return 1;1471142614721472- host->csr.broadcast_channel |= 0x40000000; /* set validity bit */14731473-14741474- bc = cpu_to_be32(host->csr.broadcast_channel);14751475-14761476- hpsb_write(host, LOCAL_BUS | ALL_NODES, get_hpsb_generation(host),14771477- (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL),14781478- &bc, sizeof(quadlet_t));14271427+ /* We are a 1394a-2000 compliant IRM. Set the validity bit. */14281428+ host->csr.broadcast_channel |= 0x40000000;1479142914801430 /* If there is no bus manager then we should set the root node's14811431 * force_root bit to promote bus stability per the 1394···15021462 return 0;15031463 }15041464 }14651465+14661466+ /* Some devices suspend their ports while being connected to an inactive14671467+ * host adapter, i.e. if connected before the low-level driver is14681468+ * loaded. They become visible either when physically unplugged and14691469+ * replugged, or when receiving a resume packet. Send one once. */14701470+ if (!host->resume_packet_sent && !nodemgr_send_resume_packet(host))14711471+ host->resume_packet_sent = 1;1505147215061473 return 1;15071474}
···26262727config INPUT_SPARCSPKR2828 tristate "SPARC Speaker support"2929- depends on PCI && (SPARC32 || SPARC64)2929+ depends on PCI && SPARC3030 help3131 Say Y here if you want the standard Speaker on Sparc PCI systems3232 to be used for bells and whistles.
···11config VIDEO_SAA713422 tristate "Philips SAA7134 support"33- depends on VIDEO_DEV && PCI && I2C && SOUND && SND33+ depends on VIDEO_DEV && PCI && I2C44 select VIDEO_BUF55 select VIDEO_IR66 select VIDEO_TUNER77 select CRC3288- select SND_PCM_OSS98 ---help---109 This is a video4linux driver for Philips SAA713x based1110 TV cards.12111312 To compile this driver as a module, choose M here: the1413 module will be called saa7134.1414+1515+config VIDEO_SAA7134_ALSA1616+ tristate "Philips SAA7134 DMA audio support"1717+ depends on VIDEO_SAA7134 && SND1818+ select SND_PCM_OSS1919+ ---help---2020+ This is a video4linux driver for direct (DMA) audio in2121+ Philips SAA713x based TV cards using ALSA2222+2323+ To compile this driver as a module, choose M here: the2424+ module will be called saa7134-alsa.2525+2626+config VIDEO_SAA7134_OSS2727+ tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)"2828+ depends on VIDEO_SAA7134 && SOUND_PRIME && !VIDEO_SAA7134_ALSA2929+ ---help---3030+ This is a video4linux driver for direct (DMA) audio in3131+ Philips SAA713x based TV cards using OSS3232+3333+ This is deprecated in favor of the ALSA module3434+3535+ To compile this driver as a module, choose M here: the3636+ module will be called saa7134-oss.15371638config VIDEO_SAA7134_DVB1739 tristate "DVB/ATSC Support for saa7134 based TV cards"
···303303 struct i2o_controller *c;304304 int rc;305305 struct pci_dev *i960 = NULL;306306+ int pci_dev_busy = 0;306307307308 printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");308309···396395 if ((rc = i2o_pci_alloc(c))) {397396 printk(KERN_ERR "%s: DMA / IO allocation for I2O controller "398397 " failed\n", c->name);398398+ if (rc == -ENODEV)399399+ pci_dev_busy = 1;399400 goto free_controller;400401 }401402···428425 i2o_iop_free(c);429426430427 disable:431431- pci_disable_device(pdev);428428+ if (!pci_dev_busy)429429+ pci_disable_device(pdev);432430433431 return rc;434432}
+9-1
drivers/mmc/mmc.c
···679679}680680681681/*682682- * Apply power to the MMC stack.682682+ * Apply power to the MMC stack. This is a two-stage process.683683+ * First, we enable power to the card without the clock running.684684+ * We then wait a bit for the power to stabilise. Finally,685685+ * enable the bus drivers and clock to the card.686686+ *687687+ * We must _NOT_ enable the clock prior to power stablising.688688+ *689689+ * If a host does all the power sequencing itself, ignore the690690+ * initial MMC_POWER_UP stage.683691 */684692static void mmc_power_up(struct mmc_host *host)685693{
···62626363config MTD_SUN_UFLASH6464 tristate "Sun Microsystems userflash support"6565- depends on (SPARC32 || SPARC64) && MTD_CFI6565+ depends on SPARC && MTD_CFI6666 help6767 This provides a 'mapping' driver which supports the way in6868 which user-programmable flash chips are connected on various
+2-2
drivers/mtd/onenand/generic.c
···1212 * This is a device driver for the OneNAND flash for generic boards.1313 */14141515-#include <linux/device.h>1615#include <linux/module.h>1716#include <linux/init.h>1717+#include <linux/platform_device.h>1818#include <linux/mtd/mtd.h>1919#include <linux/mtd/onenand.h>2020#include <linux/mtd/partitions.h>···3939{4040 struct onenand_info *info;4141 struct platform_device *pdev = to_platform_device(dev);4242- struct onenand_platform_data *pdata = pdev->dev.platform_data;4242+ struct flash_platform_data *pdata = pdev->dev.platform_data;4343 struct resource *res = pdev->resource;4444 unsigned long size = res->end - res->start + 1;4545 int err;
+40-13
drivers/mtd/onenand/onenand_base.c
···940940 u_char *eccbuf, struct nand_oobinfo *oobsel)941941{942942 struct onenand_chip *this = mtd->priv;943943- unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf;943943+ unsigned char *pbuf;944944 size_t total_len, len;945945 int i, written = 0;946946 int ret = 0;···975975 /* Loop until all keve's data has been written */976976 len = 0;977977 while (count) {978978- pbuf = buffer;978978+ pbuf = this->page_buf;979979 /*980980 * If the given tuple is >= pagesize then981981 * write it out from the iov···995995 int cnt = 0, thislen;996996 while (cnt < mtd->oobblock) {997997 thislen = min_t(int, mtd->oobblock - cnt, vecs->iov_len - len);998998- memcpy(buffer + cnt, vecs->iov_base + len, thislen);998998+ memcpy(this->page_buf + cnt, vecs->iov_base + len, thislen);999999 cnt += thislen;10001000 len += thislen;10011001···1296129612971297 /* Block lock scheme */12981298 for (block = start; block < end; block++) {12991299+ /* Set block address */13001300+ value = onenand_block_address(this, block);13011301+ this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1);13021302+ /* Select DataRAM for DDP */13031303+ value = onenand_bufferram_address(this, block);13041304+ this->write_word(value, this->base + ONENAND_REG_START_ADDRESS2);12991305 /* Set start block address */13001306 this->write_word(block, this->base + ONENAND_REG_START_BLOCK_ADDRESS);13011307 /* Write unlock command */···13141308 while (this->read_word(this->base + ONENAND_REG_CTRL_STATUS)13151309 & ONENAND_CTRL_ONGO)13161310 continue;13171317-13181318- /* Set block address for read block status */13191319- value = onenand_block_address(this, block);13201320- this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1);1321131113221312 /* Check lock status */13231313 status = this->read_word(this->base + ONENAND_REG_WP_STATUS);···1348134613491347static const struct onenand_manufacturers onenand_manuf_ids[] = {13501348 {ONENAND_MFR_SAMSUNG, "Samsung"},13511351- {ONENAND_MFR_UNKNOWN, "Unknown"}13521349};1353135013541351/**···13581357 */13591358static int onenand_check_maf(int manuf)13601359{13601360+ int size = ARRAY_SIZE(onenand_manuf_ids);13611361+ char *name;13611362 int i;1362136313631363- for (i = 0; onenand_manuf_ids[i].id; i++) {13641364+ for (i = 0; i < size; i++)13641365 if (manuf == onenand_manuf_ids[i].id)13651366 break;13661366- }1367136713681368- printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n",13691369- onenand_manuf_ids[i].name, manuf);13681368+ if (i < size)13691369+ name = onenand_manuf_ids[i].name;13701370+ else13711371+ name = "Unknown";1370137213711371- return (i != ONENAND_MFR_UNKNOWN);13731373+ printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf);13741374+13751375+ return (i == size);13721376}1373137713741378/**···15191513 this->read_bufferram = onenand_sync_read_bufferram;15201514 }1521151515161516+ /* Allocate buffers, if necessary */15171517+ if (!this->page_buf) {15181518+ size_t len;15191519+ len = mtd->oobblock + mtd->oobsize;15201520+ this->page_buf = kmalloc(len, GFP_KERNEL);15211521+ if (!this->page_buf) {15221522+ printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n");15231523+ return -ENOMEM;15241524+ }15251525+ this->options |= ONENAND_PAGEBUF_ALLOC;15261526+ }15271527+15221528 this->state = FL_READY;15231529 init_waitqueue_head(&this->wq);15241530 spin_lock_init(&this->chip_lock);···15921574 */15931575void onenand_release(struct mtd_info *mtd)15941576{15771577+ struct onenand_chip *this = mtd->priv;15781578+15951579#ifdef CONFIG_MTD_PARTITIONS15961580 /* Deregister partitions */15971581 del_mtd_partitions (mtd);15981582#endif15991583 /* Deregister the device */16001584 del_mtd_device (mtd);15851585+15861586+ /* Free bad block table memory, if allocated */15871587+ if (this->bbm)15881588+ kfree(this->bbm);15891589+ /* Buffer allocated by onenand_scan */15901590+ if (this->options & ONENAND_PAGEBUF_ALLOC)15911591+ kfree(this->page_buf);16011592}1602159316031594EXPORT_SYMBOL_GPL(onenand_scan);
···11/* orinoco_nortel.c22 * 33 * Driver for Prism II devices which would usually be driven by orinoco_cs,44+ * but are connected to the PCI bus by a PCI-to-PCMCIA adapter used in55+ * Nortel emobility, Symbol LA-4113 and Symbol LA-4123.46 * but are connected to the PCI bus by a Nortel PCI-PCMCIA-Adapter. 57 *68 * Copyright (C) 2002 Tobias Hoffmann···167165 goto fail_resources;168166 }169167170170- iomem = pci_iomap(pdev, 3, 0);168168+ iomem = pci_iomap(pdev, 2, 0);171169 if (!iomem) {172170 err = -ENOMEM;173171 goto fail_map_io;···267265static struct pci_device_id nortel_pci_id_table[] = {268266 /* Nortel emobility PCI */269267 {0x126c, 0x8030, PCI_ANY_ID, PCI_ANY_ID,},268268+ /* Symbol LA-4123 PCI */269269+ {0x1562, 0x0001, PCI_ANY_ID, PCI_ANY_ID,},270270 {0,},271271};272272
+3-4
drivers/pci/Makefile
···66 pci-driver.o search.o pci-sysfs.o rom.o setup-res.o77obj-$(CONFIG_PROC_FS) += proc.o8899+# Build PCI Express stuff if needed1010+obj-$(CONFIG_PCIEPORTBUS) += pcie/1111+912obj-$(CONFIG_HOTPLUG) += hotplug.o10131114# Build the PCI Hotplug drivers if we were asked to···4340ifeq ($(CONFIG_PCI_DEBUG),y)4441EXTRA_CFLAGS += -DDEBUG4542endif4646-4747-# Build PCI Express stuff if needed4848-obj-$(CONFIG_PCIEPORTBUS) += pcie/4949-
+2-1
drivers/s390/net/qeth_eddp.c
···6262 for (i = 0; i < ctx->num_pages; ++i)6363 free_page((unsigned long)ctx->pages[i]);6464 kfree(ctx->pages);6565- kfree(ctx->elements);6565+ if (ctx->elements != NULL)6666+ kfree(ctx->elements);6667 kfree(ctx);6768}6869
+29-32
drivers/s390/net/qeth_main.c
···11/*22 *33- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $)33+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $)44 *55 * Linux on zSeries OSA Express and HiperSockets support66 *···1212 * Frank Pavlic (fpavlic@de.ibm.com) and1313 * Thomas Spatzier <tspat@de.ibm.com>1414 *1515- * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $1515+ * $Revision: 1.251 $ $Date: 2005/05/04 20:19:18 $1616 *1717 * This program is free software; you can redistribute it and/or modify1818 * it under the terms of the GNU General Public License as published by···7272#include "qeth_eddp.h"7373#include "qeth_tso.h"74747575-#define VERSION_QETH_C "$Revision: 1.242 $"7575+#define VERSION_QETH_C "$Revision: 1.251 $"7676static const char *version = "qeth S/390 OSA-Express driver";77777878/**···518518519519 QETH_DBF_TEXT(setup, 3, "setoffl");520520 QETH_DBF_HEX(setup, 3, &card, sizeof(void *));521521-521521+522522+ netif_carrier_off(card->dev);522523 recover_flag = card->state;523524 if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){524525 PRINT_WARN("Stopping card %s interrupted by user!\n",···10211020qeth_schedule_recovery(struct qeth_card *card)10221021{10231022 QETH_DBF_TEXT(trace,2,"startrec");10241024-10251023 if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0)10261024 schedule_work(&card->kernel_thread_starter);10271025}···17101710 "IP address reset.\n",17111711 QETH_CARD_IFNAME(card),17121712 card->info.chpid);17131713- netif_carrier_on(card->dev);17141713 qeth_schedule_recovery(card);17151714 return NULL;17161715 case IPA_CMD_MODCCID:···19581959{19591960 u16 s1, s2;1960196119611961-QETH_DBF_TEXT(trace,4,"osndipa");19621962+ QETH_DBF_TEXT(trace,4,"osndipa");1962196319631964 qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2);19641965 s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len);···22022203}2203220422042205static inline int22052205-qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf,22062206- unsigned int qdio_error,22072207- unsigned int siga_error)22062206+qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error,22072207+ unsigned int siga_error, const char *dbftext)22082208{22092209- int rc = 0;22102210-22112209 if (qdio_error || siga_error) {22122212- QETH_DBF_TEXT(trace, 2, "qdinerr");22132213- QETH_DBF_TEXT(qerr, 2, "qdinerr");22102210+ QETH_DBF_TEXT(trace, 2, dbftext);22112211+ QETH_DBF_TEXT(qerr, 2, dbftext);22142212 QETH_DBF_TEXT_(qerr, 2, " F15=%02X",22152215- buf->buffer->element[15].flags & 0xff);22132213+ buf->element[15].flags & 0xff);22162214 QETH_DBF_TEXT_(qerr, 2, " F14=%02X",22172217- buf->buffer->element[14].flags & 0xff);22152215+ buf->element[14].flags & 0xff);22182216 QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error);22192217 QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error);22202220- rc = 1;22182218+ return 1;22212219 }22222222- return rc;22202220+ return 0;22232221}2224222222252223static inline struct sk_buff *···27652769 for (i = first_element; i < (first_element + count); ++i) {27662770 index = i % QDIO_MAX_BUFFERS_PER_Q;27672771 buffer = &card->qdio.in_q->bufs[index];27682768- if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) &&27692769- qeth_check_for_inbound_error(buffer, qdio_err, siga_err)))27722772+ if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) &&27732773+ qeth_check_qdio_errors(buffer->buffer, 27742774+ qdio_err, siga_err,"qinerr")))27702775 qeth_process_inbound_buffer(card, buffer, index);27712776 /* clear buffer and give back to hardware */27722777 qeth_put_buffer_pool_entry(card, buffer->pool_entry);···27822785static inline int27832786qeth_handle_send_error(struct qeth_card *card,27842787 struct qeth_qdio_out_buffer *buffer,27852785- int qdio_err, int siga_err)27882788+ unsigned int qdio_err, unsigned int siga_err)27862789{27872790 int sbalf15 = buffer->buffer->element[15].flags & 0xff;27882791 int cc = siga_err & 3;2789279227902793 QETH_DBF_TEXT(trace, 6, "hdsnderr");27942794+ qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err, "qouterr");27912795 switch (cc) {27922796 case 0:27932797 if (qdio_err){···30453047 for(i = first_element; i < (first_element + count); ++i){30463048 buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q];30473049 /*we only handle the KICK_IT error by doing a recovery */30483048- if (qeth_handle_send_error(card, buffer, qdio_error, siga_error)30503050+ if (qeth_handle_send_error(card, buffer,30513051+ qdio_error, siga_error)30493052 == QETH_SEND_ERROR_KICK_IT){30503053 netif_stop_queue(card->dev);30513054 qeth_schedule_recovery(card);···32883289 card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count;32893290 INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list);32903291 INIT_LIST_HEAD(&card->qdio.init_pool.entry_list);32913291- /* outbound */32923292}3293329332943294static int···37293731 break;37303732 }37313733 }37343734+ if (rc && !(VLAN_DEV_INFO(dev)->real_dev->priv == (void *)card))37353735+ return 0;37363736+37323737#endif37333738 return rc;37343739}···38083807 card->data.state = CH_STATE_UP;38093808 card->state = CARD_STATE_UP;3810380938113811- if (!card->lan_online){38123812- if (netif_carrier_ok(dev))38133813- netif_carrier_off(dev);38143814- }38103810+ if (!card->lan_online && netif_carrier_ok(dev))38113811+ netif_carrier_off(dev);38153812 return 0;38163813}38173814···58695870 struct inet6_dev *in6_dev;5870587158715872 QETH_DBF_TEXT(trace,4,"chkmcv6");58725872- if ((card->options.layer2 == 0) &&58735873- (!qeth_is_supported(card, IPA_IPV6)) )58735873+ if (!qeth_is_supported(card, IPA_IPV6)) 58745874 return ;58755875-58765875 in6_dev = in6_dev_get(card->dev);58775876 if (in6_dev == NULL)58785877 return;···79337936 QETH_DBF_TEXT_(setup, 2, "6err%d", rc);79347937 goto out_remove;79357938 }79367936-/*maybe it was set offline without ifconfig down79377937- * we can also use this state for recovery purposes*/79397939+ netif_carrier_on(card->dev);79407940+79387941 qeth_set_allowed_threads(card, 0xffffffff, 0);79397942 if (recover_flag == CARD_STATE_RECOVER)79407943 qeth_start_again(card, recovery_mode);
···230230 rc = plpar_hcall_norets(H_REG_CRQ,231231 vdev->unit_address,232232 queue->msg_token, PAGE_SIZE);233233+ if (rc == H_Resource) 234234+ /* maybe kexecing and resource is busy. try a reset */235235+ rc = ibmvscsi_reset_crq_queue(queue,236236+ hostdata);237237+233238 if (rc == 2) {234239 /* Adapter is good, but other end is not ready */235240 printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n");···286281 * @hostdata: ibmvscsi_host_data of host287282 *288283 */289289-void ibmvscsi_reset_crq_queue(struct crq_queue *queue,284284+int ibmvscsi_reset_crq_queue(struct crq_queue *queue,290285 struct ibmvscsi_host_data *hostdata)291286{292287 int rc;···314309 printk(KERN_WARNING315310 "ibmvscsi: couldn't register crq--rc 0x%x\n", rc);316311 }312312+ return rc;317313}
+1-1
drivers/scsi/iscsi_tcp.c
···33683368 switch(param) {33693369 case ISCSI_PARAM_MAX_RECV_DLENGTH: {33703370 char *saveptr = conn->data;33713371- int flags = GFP_KERNEL;33713371+ gfp_t flags = GFP_KERNEL;3372337233733373 if (conn->data_size >= value) {33743374 conn->max_recv_dlength = value;
+1-4
drivers/scsi/libata-scsi.c
···20462046 else {20472047 u8 *scsicmd = cmd->cmnd;2048204820492049- if (scsicmd[0] == INQUIRY) {20492049+ if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) {20502050 u8 *buf = NULL;20512051 unsigned int buflen;20522052···20592059 * to indicate to the Linux scsi midlayer this is a modern20602060 * device. 2) Ensure response data format / ATAPI information20612061 * are always correct.20622062- */20632063- /* FIXME: do we ever override EVPD pages and the like, with20642064- * this code?20652062 */20662063 if (buf[2] == 0) {20672064 buf[2] = 0x5;
···14051405 goal->iu = 0;14061406 goal->dt = 0;14071407 goal->qas = 0;14081408- goal->period = 0;14091408 goal->offset = 0;14101409 return;14111410 }···14641465 * Many devices implement PPR in a buggy way, so only use it if we14651466 * really want to.14661467 */14671467- if (goal->iu || goal->dt || goal->qas || (goal->period < 0xa)) {14681468+ if (goal->offset &&14691469+ (goal->iu || goal->dt || goal->qas || (goal->period < 0xa))) {14681470 nego = NS_PPR;14691471 } else if (spi_width(starget) != goal->width) {14701472 nego = NS_WIDE;
+5-5
drivers/serial/Kconfig
···1010# The new 8250/16550 serial drivers1111config SERIAL_82501212 tristate "8250/16550 and compatible serial support"1313- depends on (BROKEN || !(SPARC64 || SPARC32))1313+ depends on (BROKEN || !SPARC)1414 select SERIAL_CORE1515 ---help---1616 This selects whether you want to include the driver for the standard···469469470470config SERIAL_SUNCORE471471 bool472472- depends on SPARC32 || SPARC64472472+ depends on SPARC473473 select SERIAL_CORE474474 select SERIAL_CORE_CONSOLE475475 default y476476477477config SERIAL_SUNZILOG478478 tristate "Sun Zilog8530 serial support"479479- depends on SPARC32 || SPARC64479479+ depends on SPARC480480 help481481 This driver supports the Zilog8530 serial ports found on many Sparc482482 systems. Say Y or M if you want to be able to these serial ports.···491491492492config SERIAL_SUNSU493493 tristate "Sun SU serial support"494494- depends on (SPARC32 || SPARC64) && PCI494494+ depends on SPARC && PCI495495 help496496 This driver supports the 8250 serial ports that run the keyboard and497497 mouse on (PCI) UltraSPARC systems. Say Y or M if you want to be able···547547548548config SERIAL_SUNSAB549549 tristate "Sun Siemens SAB82532 serial support"550550- depends on (SPARC32 || SPARC64) && PCI550550+ depends on SPARC && PCI551551 help552552 This driver supports the Siemens SAB82532 DUSCC serial ports on newer553553 (PCI) UltraSPARC systems. Say Y or M if you want to be able to these
+1-1
drivers/serial/amba-pl011.c
···160160 flag = TTY_FRAME;161161 }162162163163- if (uart_handle_sysrq_char(&uap->port, ch, regs))163163+ if (uart_handle_sysrq_char(&uap->port, ch & 255, regs))164164 goto ignore_char;165165166166 uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag);
+2-2
drivers/serial/pxa.c
···361361 if (port->line == 3) /* HWUART */362362 up->mcr |= UART_MCR_AFE;363363 else364364- up->mcr = 0;364364+ up->mcr = 0;365365366366 /*367367 * Allocate the IRQ···641641 int i;642642643643 /*644644- * First save the UER then disable the interrupts644644+ * First save the IER then disable the interrupts645645 */646646 ier = serial_in(up, UART_IER);647647 serial_out(up, UART_IER, UART_IER_UUE);
+6-3
drivers/usb/core/usb.c
···14321432 mark_quiesced(intf);14331433 } else {14341434 // FIXME else if there's no suspend method, disconnect...14351435- dev_warn(dev, "no %s?\n", "suspend");14351435+ dev_warn(dev, "no suspend for driver %s?\n", driver->name);14361436+ mark_quiesced(intf);14361437 status = 0;14371438 }14381439 return status;···14611460 }1462146114631462 if ((dev->driver == NULL) ||14641464- (dev->driver_data == &usb_generic_driver_data))14631463+ (dev->driver_data == &usb_generic_driver_data)) {14641464+ dev->power.power_state.event = PM_EVENT_FREEZE;14651465 return 0;14661466+ }1466146714671468 intf = to_usb_interface(dev);14681469 driver = to_usb_driver(dev->driver);···14841481 mark_quiesced(intf);14851482 }14861483 } else14871487- dev_warn(dev, "no %s?\n", "resume");14841484+ dev_warn(dev, "no resume for driver %s?\n", driver->name);14881485 return 0;14891486}14901487
+2
drivers/usb/host/uhci-hcd.c
···717717 * at the source, so we must turn off PIRQ.718718 */719719 pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0);720720+ mb();720721 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);721722 uhci->hc_inaccessible = 1;722723 hcd->poll_rh = 0;···739738 * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0740739 */741740 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);741741+ mb();742742743743 if (uhci->rh_state == UHCI_RH_RESET) /* Dead */744744 return 0;
···109109 * data comes from.110110 */111111 if (sdev->scsi_level < SCSI_2)112112- sdev->scsi_level = SCSI_2;112112+ sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;113113114114 /* According to the technical support people at Genesys Logic,115115 * devices using their chips have problems transferring more than···162162 * a Get-Max-LUN request, we won't lose much by setting the163163 * revision level down to 2. The only devices that would be164164 * affected are those with sparse LUNs. */165165- sdev->scsi_level = SCSI_2;165165+ sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;166166167167 /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable168168 * Hardware Error) when any low-level error occurs,
···441441 * the fb. it's inefficient for them to do anything less than 64*8442442 * writes since we update the lcd in each write() anyway.443443 */444444-static ssize_t arcfb_write(struct file *file, const char *buf, size_t count,444444+static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count,445445 loff_t *ppos)446446{447447 /* modded from epson 1355 */
+10-10
drivers/video/console/Kconfig
···6677config VGA_CONSOLE88 bool "VGA text console" if EMBEDDED || !X8699- depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE99+ depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !ARCH_VERSATILE1010 default y1111 help1212 Saying Y here will allow you to use Linux in text mode through a···68686969config PROM_CONSOLE7070 bool "PROM console"7171- depends on SPARC32 || SPARC647171+ depends on SPARC7272 help7373 Say Y to build a console driver for Sun machines that uses the7474 terminal emulation built into their console PROMS.···136136config FONT_8x8137137 bool "VGA 8x8 font" if FONTS138138 depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE139139- default y if !SPARC32 && !SPARC64 && !FONTS139139+ default y if !SPARC && !FONTS140140 help141141 This is the "high resolution" font for the VGA frame buffer (the one142142 provided by the text console 80x50 (and higher) modes).···150150config FONT_8x16151151 bool "VGA 8x16 font" if FONTS152152 depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y || STI_CONSOLE || USB_SISUSBVGA_CON 153153- default y if !SPARC32 && !SPARC64 && !FONTS153153+ default y if !SPARC && !FONTS154154 help155155 This is the "high resolution" font for the VGA frame buffer (the one156156 provided by the VGA text console 80x25 mode.···160160config FONT_6x11161161 bool "Mac console 6x11 font (not supported by all drivers)" if FONTS162162 depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE163163- default y if !SPARC32 && !SPARC64 && !FONTS && MAC163163+ default y if !SPARC && !FONTS && MAC164164 help165165 Small console font with Macintosh-style high-half glyphs. Some Mac166166 framebuffer drivers don't support this one at all.···176176config FONT_PEARL_8x8177177 bool "Pearl (old m68k) console 8x8 font" if FONTS178178 depends on FRAMEBUFFER_CONSOLE179179- default y if !SPARC32 && !SPARC64 && !FONTS && AMIGA179179+ default y if !SPARC && !FONTS && AMIGA180180 help181181 Small console font with PC-style control-character and high-half182182 glyphs.···184184config FONT_ACORN_8x8185185 bool "Acorn console 8x8 font" if FONTS186186 depends on FRAMEBUFFER_CONSOLE187187- default y if !SPARC32 && !SPARC64 && !FONTS && ARM && ARCH_ACORN187187+ default y if !SPARC && !FONTS && ARM && ARCH_ACORN188188 help189189 Small console font with PC-style control characters and high-half190190 glyphs.191191192192config FONT_MINI_4x6193193 bool "Mini 4x6 font"194194- depends on !SPARC32 && !SPARC64 && FONTS194194+ depends on !SPARC && FONTS195195196196config FONT_SUN8x16197197 bool "Sparc console 8x16 font"198198- depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64)198198+ depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC)199199 help200200 This is the high resolution console font for Sun machines. Say Y.201201202202config FONT_SUN12x22203203 bool "Sparc console 12x22 font (not supported by all drivers)"204204- depends on FRAMEBUFFER_CONSOLE && (!SPARC32 && !SPARC64 && FONTS || SPARC32 || SPARC64)204204+ depends on FRAMEBUFFER_CONSOLE && (!SPARC && FONTS || SPARC)205205 help206206 This is the high resolution console font for Sun machines with very207207 big letters (like the letters used in the SPARC PROM). If the
···47474848config LOGO_SUN_CLUT2244949 bool "224-color Sun Linux logo"5050- depends on LOGO && (SPARC32 || SPARC64)5050+ depends on LOGO && SPARC5151 default y52525353config LOGO_SUPERH_MONO
···4646 unsigned long off;4747 int i;48484949+ if (!(vma->vm_flags & (VM_SHARED | VM_MAYSHARE)))5050+ return -EINVAL;5151+4952 size = vma->vm_end - vma->vm_start;5053 if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))5154 return -EINVAL;
+6-3
fs/hostfs/hostfs_kern.c
···501501 long long start;502502 int err = 0;503503504504- start = (long long) (page->index << PAGE_CACHE_SHIFT) + from;504504+ start = (((long long) page->index) << PAGE_CACHE_SHIFT) + from;505505 buffer = kmap(page);506506 err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from,507507 to - from);508508 if(err > 0) err = 0;509509+510510+ /* Actually, if !err, write_file has added to-from to start, so, despite511511+ * the appearance, we are comparing i_size against the _last_ written512512+ * location, as we should. */513513+509514 if(!err && (start > inode->i_size))510515 inode->i_size = start;511516···915910int hostfs_link_readpage(struct file *file, struct page *page)916911{917912 char *buffer, *name;918918- long long start;919913 int err;920914921921- start = page->index << PAGE_CACHE_SHIFT;922915 buffer = kmap(page);923916 name = inode_name(page->mapping->host, 0);924917 if(name == NULL) return(-ENOMEM);
+4
fs/lockd/clntlock.c
···157157 inode = fl->fl_file->f_dentry->d_inode;158158 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)159159 continue;160160+ if (fl->fl_u.nfs_fl.owner == NULL)161161+ continue;160162 if (fl->fl_u.nfs_fl.owner->host != host)161163 continue;162164 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED))···227225228226 inode = fl->fl_file->f_dentry->d_inode;229227 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)228228+ continue;229229+ if (fl->fl_u.nfs_fl.owner == NULL)230230 continue;231231 if (fl->fl_u.nfs_fl.owner->host != host)232232 continue;
+6-18
fs/nfs/direct.c
···678678 if (!count)679679 goto out;680680681681- if (mapping->nrpages) {682682- retval = filemap_fdatawrite(mapping);683683- if (retval == 0)684684- retval = nfs_wb_all(inode);685685- if (retval == 0)686686- retval = filemap_fdatawait(mapping);687687- if (retval)688688- goto out;689689- }681681+ retval = nfs_sync_mapping(mapping);682682+ if (retval)683683+ goto out;690684691685 retval = nfs_direct_read(inode, ctx, &iov, pos, 1);692686 if (retval > 0)···758764 if (!count)759765 goto out;760766761761- if (mapping->nrpages) {762762- retval = filemap_fdatawrite(mapping);763763- if (retval == 0)764764- retval = nfs_wb_all(inode);765765- if (retval == 0)766766- retval = filemap_fdatawait(mapping);767767- if (retval)768768- goto out;769769- }767767+ retval = nfs_sync_mapping(mapping);768768+ if (retval)769769+ goto out;770770771771 retval = nfs_direct_write(inode, ctx, &iov, pos, 1);772772 if (mapping->nrpages)
+6-20
fs/nfs/file.c
···433433 * Flush all pending writes before doing anything434434 * with locks..435435 */436436- filemap_fdatawrite(filp->f_mapping);437437- down(&inode->i_sem);438438- nfs_wb_all(inode);439439- up(&inode->i_sem);440440- filemap_fdatawait(filp->f_mapping);436436+ nfs_sync_mapping(filp->f_mapping);441437442438 /* NOTE: special case443439 * If we're signalled while cleaning up locks on process exit, we···461465 * Flush all pending writes before doing anything462466 * with locks..463467 */464464- status = filemap_fdatawrite(filp->f_mapping);465465- if (status == 0) {466466- down(&inode->i_sem);467467- status = nfs_wb_all(inode);468468- up(&inode->i_sem);469469- if (status == 0)470470- status = filemap_fdatawait(filp->f_mapping);471471- }472472- if (status < 0)468468+ status = nfs_sync_mapping(filp->f_mapping);469469+ if (status != 0)473470 goto out;474471475472 lock_kernel();···486497 * Make sure we clear the cache whenever we try to get the lock.487498 * This makes locking act as a cache coherency point.488499 */489489- filemap_fdatawrite(filp->f_mapping);490490- down(&inode->i_sem);491491- nfs_wb_all(inode); /* we may have slept */492492- up(&inode->i_sem);493493- filemap_fdatawait(filp->f_mapping);500500+ nfs_sync_mapping(filp->f_mapping);494501 nfs_zap_caches(inode);495502out:496503 rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset);···509524 return -EINVAL;510525511526 /* No mandatory locks over NFS */512512- if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)527527+ if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID &&528528+ fl->fl_type != F_UNLCK)513529 return -ENOLCK;514530515531 if (IS_GETLK(cmd))
+23-5
fs/nfs/inode.c
···640640 return 0;641641}642642643643+/**644644+ * nfs_sync_mapping - helper to flush all mmapped dirty data to disk645645+ */646646+int nfs_sync_mapping(struct address_space *mapping)647647+{648648+ int ret;649649+650650+ if (mapping->nrpages == 0)651651+ return 0;652652+ unmap_mapping_range(mapping, 0, 0, 0);653653+ ret = filemap_fdatawrite(mapping);654654+ if (ret != 0)655655+ goto out;656656+ ret = filemap_fdatawait(mapping);657657+ if (ret != 0)658658+ goto out;659659+ ret = nfs_wb_all(mapping->host);660660+out:661661+ return ret;662662+}663663+643664/*644665 * Invalidate the local caches645666 */···12001179 struct nfs_inode *nfsi = NFS_I(inode);1201118012021181 if (nfsi->cache_validity & NFS_INO_INVALID_DATA) {12031203- if (S_ISREG(inode->i_mode)) {12041204- if (filemap_fdatawrite(mapping) == 0)12051205- filemap_fdatawait(mapping);12061206- nfs_wb_all(inode);12071207- }11821182+ if (S_ISREG(inode->i_mode))11831183+ nfs_sync_mapping(mapping);12081184 invalidate_inode_pages2(mapping);1209118512101186 spin_lock(&inode->i_lock);
···203203204204config SUN_PARTITION205205 bool "Sun partition tables support" if PARTITION_ADVANCED206206- default y if (SPARC32 || SPARC64 || SUN3 || SUN3X)206206+ default y if (SPARC || SUN3 || SUN3X)207207 ---help---208208 Like most systems, SunOS uses its own hard disk partition table209209 format, incompatible with all others. Saying Y here allows you to
+23-24
fs/proc/generic.c
···5454 ssize_t n, count;5555 char *start;5656 struct proc_dir_entry * dp;5757+ unsigned long long pos;5858+5959+ /*6060+ * Gaah, please just use "seq_file" instead. The legacy /proc6161+ * interfaces cut loff_t down to off_t for reads, and ignore6262+ * the offset entirely for writes..6363+ */6464+ pos = *ppos;6565+ if (pos > MAX_NON_LFS)6666+ return 0;6767+ if (nbytes > MAX_NON_LFS - pos)6868+ nbytes = MAX_NON_LFS - pos;57695870 dp = PDE(inode);5971 if (!(page = (char*) __get_free_page(GFP_KERNEL)))···214202static loff_t215203proc_file_lseek(struct file *file, loff_t offset, int orig)216204{217217- lock_kernel();218218-219219- switch (orig) {220220- case 0:221221- if (offset < 0)222222- goto out;223223- file->f_pos = offset;224224- unlock_kernel();225225- return(file->f_pos);226226- case 1:227227- if (offset + file->f_pos < 0)228228- goto out;229229- file->f_pos += offset;230230- unlock_kernel();231231- return(file->f_pos);232232- case 2:233233- goto out;234234- default:235235- goto out;236236- }237237-238238-out:239239- unlock_kernel();240240- return -EINVAL;205205+ loff_t retval = -EINVAL;206206+ switch (orig) {207207+ case 1:208208+ offset += file->f_pos;209209+ /* fallthrough */210210+ case 0:211211+ if (offset < 0 || offset > MAX_NON_LFS)212212+ break;213213+ file->f_pos = retval = offset;214214+ }215215+ return retval;241216}242217243218static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
+18-8
fs/reiserfs/inode.c
···3232 JOURNAL_PER_BALANCE_CNT * 2 +3333 2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb);3434 struct reiserfs_transaction_handle th;3535+ int err;35363637 truncate_inode_pages(&inode->i_data, 0);3738···5049 }5150 reiserfs_update_inode_transaction(inode);52515353- if (reiserfs_delete_object(&th, inode)) {5454- up(&inode->i_sem);5555- goto out;5656- }5252+ err = reiserfs_delete_object(&th, inode);57535854 /* Do quota update inside a transaction for journaled quotas. We must do that5955 * after delete_object so that quota updates go into the same transaction as6056 * stat data deletion */6161- DQUOT_FREE_INODE(inode);5757+ if (!err) 5858+ DQUOT_FREE_INODE(inode);62596360 if (journal_end(&th, inode->i_sb, jbegin_count)) {6461 up(&inode->i_sem);···6465 }65666667 up(&inode->i_sem);6868+6969+ /* check return value from reiserfs_delete_object after7070+ * ending the transaction7171+ */7272+ if (err)7373+ goto out;67746875 /* all items of file are deleted, so we can remove "save" link */6976 remove_save_link(inode, 0 /* not truncate */ ); /* we can't do anything···21042099 struct page *page = NULL;21052100 int error;21062101 struct buffer_head *bh = NULL;21022102+ int err2;2107210321082104 reiserfs_write_lock(p_s_inode->i_sb);21092105···21422136 transaction of truncating gets committed - on reboot the file21432137 either appears truncated properly or not truncated at all */21442138 add_save_link(&th, p_s_inode, 1);21452145- error = reiserfs_do_truncate(&th, p_s_inode, page, update_timestamps);21462146- if (error)21472147- goto out;21392139+ err2 = reiserfs_do_truncate(&th, p_s_inode, page, update_timestamps);21482140 error =21492141 journal_end(&th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 2 + 1);21502142 if (error)21512143 goto out;2152214421452145+ /* check reiserfs_do_truncate after ending the transaction */21462146+ if (err2) {21472147+ error = err2;21482148+ goto out;21492149+ }21502150+21532151 if (update_timestamps) {21542152 error = remove_save_link(p_s_inode, 1 /* truncate */ );21552153 if (error)
+14-4
fs/reiserfs/journal.c
···10391039 }10401040 atomic_dec(&journal->j_async_throttle);1041104110421042+ /* We're skipping the commit if there's an error */10431043+ if (retval || reiserfs_is_journal_aborted(journal))10441044+ barrier = 0;10451045+10421046 /* wait on everything written so far before writing the commit10431047 * if we are in barrier mode, send the commit down now10441048 */···10811077 BUG_ON(atomic_read(&(jl->j_commit_left)) != 1);1082107810831079 if (!barrier) {10841084- if (buffer_dirty(jl->j_commit_bh))10851085- BUG();10861086- mark_buffer_dirty(jl->j_commit_bh);10871087- sync_dirty_buffer(jl->j_commit_bh);10801080+ /* If there was a write error in the journal - we can't commit10811081+ * this transaction - it will be invalid and, if successful,10821082+ * will just end up propogating the write error out to10831083+ * the file system. */10841084+ if (likely(!retval && !reiserfs_is_journal_aborted (journal))) {10851085+ if (buffer_dirty(jl->j_commit_bh))10861086+ BUG();10871087+ mark_buffer_dirty(jl->j_commit_bh) ;10881088+ sync_dirty_buffer(jl->j_commit_bh) ;10891089+ }10881090 } else10891091 wait_on_buffer(jl->j_commit_bh);10901092
+6-2
fs/relayfs/relay.c
···333333 return length;334334335335toobig:336336- printk(KERN_WARNING "relayfs: event too large (%Zd)\n", length);337337- WARN_ON(1);336336+ buf->chan->last_toobig = length;338337 return 0;339338}340339···397398 continue;398399 relay_close_buf(chan->buf[i]);399400 }401401+402402+ if (chan->last_toobig)403403+ printk(KERN_WARNING "relayfs: one or more items not logged "404404+ "[item size (%Zd) > sub-buffer size (%Zd)]\n",405405+ chan->last_toobig, chan->subbuf_size);400406401407 kref_put(&chan->kref, relay_destroy_channel);402408}
+2-2
fs/xfs/quota/xfs_qm.c
···78787979STATIC int xfs_qm_init_quotainos(xfs_mount_t *);8080STATIC int xfs_qm_init_quotainfo(xfs_mount_t *);8181-STATIC int xfs_qm_shake(int, unsigned int);8181+STATIC int xfs_qm_shake(int, gfp_t);82828383#ifdef DEBUG8484extern mutex_t qcheck_lock;···21972197 */21982198/* ARGSUSED */21992199STATIC int22002200-xfs_qm_shake(int nr_to_scan, unsigned int gfp_mask)22002200+xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask)22012201{22022202 int ndqused, nfree, n;22032203
···11-#include <linux/config.h>22-31#ifndef _ASMi386_PARAM_H42#define _ASMi386_PARAM_H5364#ifdef __KERNEL__55+# include <linux/config.h>76# define HZ CONFIG_HZ /* Internal kernel timer frequency */87# define USER_HZ 100 /* .. some user interfaces are in "ticks" */98# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
+1-9
include/asm-ia64/delay.h
···8484 ia64_delay_loop (loops - 1);8585}86868787-static __inline__ void8888-udelay (unsigned long usecs)8989-{9090- unsigned long start = ia64_get_itc();9191- unsigned long cycles = usecs*local_cpu_data->cyc_per_usec;9292-9393- while (ia64_get_itc() - start < cycles)9494- cpu_relax();9595-}8787+extern void udelay (unsigned long usecs);96889789#endif /* _ASM_IA64_DELAY_H */
+1-1
include/asm-ia64/topology.h
···3838/*3939 * Returns the number of the first CPU on Node 'node'.4040 */4141-#define node_to_first_cpu(node) (__ffs(node_to_cpumask(node)))4141+#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))42424343/*4444 * Determines the node for a given pci bus
···33333434#define MAX_PPC4xx_DMA_CHANNELS 435353636-/* in arch/ppc/kernel/setup.c -- Cort */3737-extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ;3838-3936/*4037 * Function return status codes4138 * These values are used to indicate whether or not the function
+1-1
include/asm-sparc/memreg.h
···36363737/* Memory parity error register with associated bit constants. */3838#ifndef __ASSEMBLY__3939-extern __volatile__ unsigned long *sun4c_memerr_reg;3939+extern __volatile__ unsigned long __iomem *sun4c_memerr_reg;4040#endif41414242#define SUN4C_MPE_ERROR 0x80 /* Parity error detected. (ro) */
···11-#include <linux/config.h>22-31#ifndef _ASMx86_64_PARAM_H42#define _ASMx86_64_PARAM_H5364#ifdef __KERNEL__55+# include <linux/config.h>76# define HZ CONFIG_HZ /* Internal kernel timer frequency */87# define USER_HZ 100 /* .. some user interfaces are in "ticks */98#define CLOCKS_PER_SEC (USER_HZ) /* like times() */
···2323#include <asm/io.h>2424#include <asm/semaphore.h>25252626-/*2727- * This is the multiple IDE interface driver, as evolved from hd.c.2828- * It supports up to four IDE interfaces, on one or more IRQs (usually 14 & 15).2929- * There can be up to two drives per interface, as per the ATA-2 spec.3030- *3131- * Primary i/f: ide0: major=3; (hda) minor=0; (hdb) minor=643232- * Secondary i/f: ide1: major=22; (hdc or hd1a) minor=0; (hdd or hd1b) minor=643333- * Tertiary i/f: ide2: major=33; (hde) minor=0; (hdf) minor=643434- * Quaternary i/f: ide3: major=34; (hdg) minor=0; (hdh) minor=643535- */3636-3726/******************************************************************************3827 * IDE driver configuration options (play with these as desired):3928 *···181192#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */182193#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */183194#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */184184-185185-#define HOST(hwif,chipset) \186186-{ \187187- return ((hwif)->chipset == chipset) ? 1 : 0; \188188-}189195190196/*191197 * Check for an interrupt and acknowledge the interrupt status···375391} ata_nsector_t, ata_data_t, atapi_bcount_t, ata_index_t;376392377393/*378378- * ATA-IDE Error Register379379- *380380- * mark : Bad address mark381381- * tzero : Couldn't find track 0382382- * abrt : Aborted Command383383- * mcr : Media Change Request384384- * id : ID field not found385385- * mce : Media Change Event386386- * ecc : Uncorrectable ECC error387387- * bdd : dual meaing388388- */389389-typedef union {390390- unsigned all :8;391391- struct {392392-#if defined(__LITTLE_ENDIAN_BITFIELD)393393- unsigned mark :1;394394- unsigned tzero :1;395395- unsigned abrt :1;396396- unsigned mcr :1;397397- unsigned id :1;398398- unsigned mce :1;399399- unsigned ecc :1;400400- unsigned bdd :1;401401-#elif defined(__BIG_ENDIAN_BITFIELD)402402- unsigned bdd :1;403403- unsigned ecc :1;404404- unsigned mce :1;405405- unsigned id :1;406406- unsigned mcr :1;407407- unsigned abrt :1;408408- unsigned tzero :1;409409- unsigned mark :1;410410-#else411411-#error "Please fix <asm/byteorder.h>"412412-#endif413413- } b;414414-} ata_error_t;415415-416416-/*417394 * ATA-IDE Select Register, aka Device-Head418395 *419396 * head : always zeros here···447502#endif448503 } b;449504} ata_status_t, atapi_status_t;450450-451451-/*452452- * ATA-IDE Control Register453453- *454454- * bit0 : Should be set to zero455455- * nIEN : device INTRQ to host456456- * SRST : host soft reset bit457457- * bit3 : ATA-2 thingy, Should be set to 1458458- * reserved456 : Reserved459459- * HOB : 48-bit address ordering, High Ordered Bit460460- */461461-typedef union {462462- unsigned all : 8;463463- struct {464464-#if defined(__LITTLE_ENDIAN_BITFIELD)465465- unsigned bit0 : 1;466466- unsigned nIEN : 1;467467- unsigned SRST : 1;468468- unsigned bit3 : 1;469469- unsigned reserved456 : 3;470470- unsigned HOB : 1;471471-#elif defined(__BIG_ENDIAN_BITFIELD)472472- unsigned HOB : 1;473473- unsigned reserved456 : 3;474474- unsigned bit3 : 1;475475- unsigned SRST : 1;476476- unsigned nIEN : 1;477477- unsigned bit0 : 1;478478-#else479479-#error "Please fix <asm/byteorder.h>"480480-#endif481481- } b;482482-} ata_control_t;483505484506/*485507 * ATAPI Feature Register···528616#endif529617 } b;530618} atapi_error_t;531531-532532-/*533533- * ATAPI floppy Drive Select Register534534- *535535- * sam_lun : Logical unit number536536- * reserved3 : Reserved537537- * drv : The responding drive will be drive 0 (0) or drive 1 (1)538538- * one5 : Should be set to 1539539- * reserved6 : Reserved540540- * one7 : Should be set to 1541541- */542542-typedef union {543543- unsigned all :8;544544- struct {545545-#if defined(__LITTLE_ENDIAN_BITFIELD)546546- unsigned sam_lun :3;547547- unsigned reserved3 :1;548548- unsigned drv :1;549549- unsigned one5 :1;550550- unsigned reserved6 :1;551551- unsigned one7 :1;552552-#elif defined(__BIG_ENDIAN_BITFIELD)553553- unsigned one7 :1;554554- unsigned reserved6 :1;555555- unsigned one5 :1;556556- unsigned drv :1;557557- unsigned reserved3 :1;558558- unsigned sam_lun :3;559559-#else560560-#error "Please fix <asm/byteorder.h>"561561-#endif562562- } b;563563-} atapi_select_t;564619565620/*566621 * Status returned from various ide_ functions···9801101 int (*end_request)(ide_drive_t *, int, int);9811102 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);9821103 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);983983- int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);9841104 ide_proc_entry_t *proc;985985- void (*ata_prebuilder)(ide_drive_t *);986986- void (*atapi_prebuilder)(ide_drive_t *);9871105 struct device_driver gen_driver;9881106} ide_driver_t;9891107···11741298extern void ide_timer_expiry(unsigned long);11751299extern irqreturn_t ide_intr(int irq, void *dev_id, struct pt_regs *regs);11761300extern void do_ide_request(request_queue_t *);11771177-extern void ide_init_subdrivers(void);1178130111791302void ide_init_disk(struct gendisk *, ide_drive_t *);11801303···12461371#define GOOD_DMA_DRIVE 11247137212481373#ifdef CONFIG_BLK_DEV_IDEDMA13741374+struct drive_list_entry {13751375+ const char *id_model;13761376+ const char *id_firmware;13771377+};13781378+13791379+int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);12491380int __ide_dma_bad_drive(ide_drive_t *);12501381int __ide_dma_good_drive(ide_drive_t *);12511382int ide_use_dma(ide_drive_t *);
+1
include/linux/ipv6_route.h
···1818 fallback, no routers on link */1919#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */2020#define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */2121+#define RTF_ANYCAST 0x00100000 /* Anycast */21222223#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */2324#define RTF_EXPIRES 0x00400000
···163163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */164164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */165165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */166166+#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */166167167168#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */168169#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
···7979 FC_PORTSTATE_LINKDOWN,8080 FC_PORTSTATE_ERROR,8181 FC_PORTSTATE_LOOPBACK,8282+ FC_PORTSTATE_DELETED,8283};83848485···326325 struct list_head rport_bindings;327326 u32 next_rport_number;328327 u32 next_target_id;328328+ u8 flags;329329+ struct work_struct rport_del_work;329330};331331+332332+/* values for struct fc_host_attrs "flags" field: */333333+#define FC_SHOST_RPORT_DEL_SCHEDULED 0x01334334+330335331336#define fc_host_node_name(x) \332337 (((struct fc_host_attrs *)(x)->shost_data)->node_name)···372365 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)373366#define fc_host_next_target_id(x) \374367 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)368368+#define fc_host_flags(x) \369369+ (((struct fc_host_attrs *)(x)->shost_data)->flags)370370+#define fc_host_rport_del_work(x) \371371+ (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work)375372376373377374/* The functions by which the transport class and the driver communicate */
+13-12
init/Kconfig
···256256257257source "usr/Kconfig"258258259259+config CC_OPTIMIZE_FOR_SIZE260260+ bool "Optimize for size (Look out for broken compilers!)"261261+ default y262262+ depends on ARM || H8300 || EXPERIMENTAL263263+ help264264+ Enabling this option will pass "-Os" instead of "-O2" to gcc265265+ resulting in a smaller kernel.266266+267267+ WARNING: some versions of gcc may generate incorrect code with this268268+ option. If problems are observed, a gcc upgrade may be needed.269269+270270+ If unsure, say N.271271+259272menuconfig EMBEDDED260273 bool "Configure standard kernel features (for small systems)"261274 help···350337 help351338 Disabling this option will cause the kernel to be built without352339 support for epoll family of system calls.353353-354354-config CC_OPTIMIZE_FOR_SIZE355355- bool "Optimize for size"356356- default y if ARM || H8300357357- help358358- Enabling this option will pass "-Os" instead of "-O2" to gcc359359- resulting in a smaller kernel.360360-361361- WARNING: some versions of gcc may generate incorrect code with this362362- option. If problems are observed, a gcc upgrade may be needed.363363-364364- If unsure, say N.365340366341config SHMEM367342 bool "Use full shmem filesystem" if EMBEDDED
···270270 /*271271 * The waiting task can free the futex_q as soon as this is written,272272 * without taking any locks. This must come last.273273+ *274274+ * A memory barrier is required here to prevent the following store275275+ * to lock_ptr from getting ahead of the wakeup. Clearing the lock276276+ * at the end of wake_up_all() does not prevent this store from277277+ * moving.273278 */279279+ wmb();274280 q->lock_ptr = NULL;275281}276282
···704704 addr = SG_ENT_VIRT_ADDRESS(sg);705705 dev_addr = virt_to_phys(addr);706706 if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) {707707- sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir));708708- if (!sg->dma_address) {707707+ void *map = map_single(hwdev, addr, sg->length, dir);708708+ sg->dma_address = virt_to_bus(map);709709+ if (!map) {709710 /* Don't panic here, we expect map_sg users710711 to do proper error handling. */711712 swiotlb_full(hwdev, sg->length, dir, 0);
+2-1
mm/memory.c
···574574 * readonly mappings. The tradeoff is that copy_page_range is more575575 * efficient than faulting.576576 */577577- if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP))) {577577+ if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP|VM_INSERTPAGE))) {578578 if (!vma->anon_vma)579579 return 0;580580 }···12281228 return -EFAULT;12291229 if (!page_count(page))12301230 return -EINVAL;12311231+ vma->vm_flags |= VM_INSERTPAGE;12311232 return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot);12321233}12331234EXPORT_SYMBOL(vm_insert_page);
+1-1
mm/memory_hotplug.c
···104104 pgdat->node_start_pfn = start_pfn;105105106106 if (end_pfn > old_pgdat_end_pfn)107107- pgdat->node_spanned_pages = end_pfn - pgdat->node_spanned_pages;107107+ pgdat->node_spanned_pages = end_pfn - pgdat->node_start_pfn;108108}109109110110int online_pages(unsigned long pfn, unsigned long nr_pages)
+4
mm/mempolicy.c
···161161 switch (mode) {162162 case MPOL_INTERLEAVE:163163 policy->v.nodes = *nodes;164164+ if (nodes_weight(*nodes) == 0) {165165+ kmem_cache_free(policy_cache, policy);166166+ return ERR_PTR(-EINVAL);167167+ }164168 break;165169 case MPOL_PREFERRED:166170 policy->v.preferred_node = first_node(*nodes);
+1-1
mm/mmap.c
···611611 * If the vma has a ->close operation then the driver probably needs to release612612 * per-vma resources, so we don't attempt to merge those.613613 */614614-#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED)614614+#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)615615616616static inline int is_mergeable_vma(struct vm_area_struct *vma,617617 struct file *file, unsigned long vm_flags)
+1-1
mm/mremap.c
···323323 /* We can't remap across vm area boundaries */324324 if (old_len > vma->vm_end - addr)325325 goto out;326326- if (vma->vm_flags & VM_DONTEXPAND) {326326+ if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) {327327 if (new_len > old_len)328328 goto out;329329 }
···753753 break;754754 case GET_VLAN_REALDEV_NAME_CMD:755755 err = vlan_dev_get_realdev_name(args.device1, args.u.device2);756756+ if (err)757757+ goto out;756758 if (copy_to_user(arg, &args,757759 sizeof(struct vlan_ioctl_args))) {758760 err = -EFAULT;···763761764762 case GET_VLAN_VID_CMD:765763 err = vlan_dev_get_vid(args.device1, &vid);764764+ if (err)765765+ goto out;766766 args.u.VID = vid;767767 if (copy_to_user(arg, &args,768768 sizeof(struct vlan_ioctl_args))) {···778774 __FUNCTION__, args.cmd);779775 return -EINVAL;780776 };781781-777777+out:782778 return err;783779}784780
+3
net/8021q/vlan_dev.c
···165165166166 skb_pull(skb, VLAN_HLEN); /* take off the VLAN header (4 bytes currently) */167167168168+ /* Need to correct hardware checksum */169169+ skb_postpull_rcsum(skb, vhdr, VLAN_HLEN);170170+168171 /* Ok, lets check to make sure the device (dev) we169172 * came in on is what this VLAN is attached to.170173 */
+9-10
net/bridge/br_netfilter.c
···295295 len -= 2;296296297297 while (len > 0) {298298- int optlen = raw[off+1]+2;298298+ int optlen = skb->nh.raw[off+1]+2;299299300300 switch (skb->nh.raw[off]) {301301 case IPV6_TLV_PAD0:···308308 case IPV6_TLV_JUMBO:309309 if (skb->nh.raw[off+1] != 4 || (off&3) != 2)310310 goto bad;311311-312311 pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2));313313-312312+ if (pkt_len <= IPV6_MAXPLEN ||313313+ skb->nh.ipv6h->payload_len)314314+ goto bad;314315 if (pkt_len > skb->len - sizeof(struct ipv6hdr))315316 goto bad;316316- if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {317317- if (__pskb_trim(skb,318318- pkt_len + sizeof(struct ipv6hdr)))319319- goto bad;320320- if (skb->ip_summed == CHECKSUM_HW)321321- skb->ip_summed = CHECKSUM_NONE;322322- }317317+ if (pskb_trim_rcsum(skb,318318+ pkt_len+sizeof(struct ipv6hdr)))319319+ goto bad;323320 break;324321 default:325322 if (optlen > len)···369372 if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb))370373 goto inhdr_error;371374375375+ nf_bridge_put(skb->nf_bridge);372376 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)373377 return NF_DROP;374378 setup_pre_routing(skb);···453455 skb->ip_summed = CHECKSUM_NONE;454456 }455457458458+ nf_bridge_put(skb->nf_bridge);456459 if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)457460 return NF_DROP;458461 setup_pre_routing(skb);
+2-2
net/core/filter.c
···293293 struct sock_filter *ftest;294294 int pc;295295296296- if (((unsigned int)flen >= (~0U / sizeof(struct sock_filter))) || flen == 0)296296+ if (flen == 0 || flen > BPF_MAXINSNS)297297 return -EINVAL;298298299299 /* check the filter code now */···360360 int err;361361362362 /* Make sure new filter is there and in the right amounts. */363363- if (fprog->filter == NULL || fprog->len > BPF_MAXINSNS)363363+ if (fprog->filter == NULL)364364 return -EINVAL;365365366366 fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL);
+1-1
net/dccp/ipv4.c
···12511251 struct dccp_sock *dp = dccp_sk(sk);1252125212531253 /*12541254- * DCCP doesn't use sk_qrite_queue, just sk_send_head12541254+ * DCCP doesn't use sk_write_queue, just sk_send_head12551255 * for retransmissions12561256 */12571257 if (sk->sk_send_head != NULL) {
···12121313# connection tracking1414obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o1515+obj-$(CONFIG_IP_NF_NAT) += ip_nat.o15161617# conntrack netlink interface1718obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o···4241# the three instances of ip_tables4342obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o4443obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o4545-obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o ip_nat.o4444+obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o4645obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o47464847# matches
+1
net/ipv4/xfrm4_policy.c
···182182 case IPPROTO_UDP:183183 case IPPROTO_TCP:184184 case IPPROTO_SCTP:185185+ case IPPROTO_DCCP:185186 if (pskb_may_pull(skb, xprth + 4 - skb->data)) {186187 u16 *ports = (u16 *)xprth;187188
+117-20
net/ipv6/addrconf.c
···137137static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags);138138static void addrconf_dad_timer(unsigned long data);139139static void addrconf_dad_completed(struct inet6_ifaddr *ifp);140140+static void addrconf_dad_run(struct inet6_dev *idev);140141static void addrconf_rs_timer(unsigned long data);141142static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);142143static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa);···380379 dev->type == ARPHRD_NONE ||381380 dev->type == ARPHRD_SIT) {382381 printk(KERN_INFO383383- "Disabled Privacy Extensions on device %p(%s)\n",384384- dev, dev->name);382382+ "%s: Disabled Privacy Extensions\n",383383+ dev->name);385384 ndev->cnf.use_tempaddr = -1;386385 } else {387386 in6_dev_hold(ndev);388387 ipv6_regen_rndid((unsigned long) ndev);389388 }390389#endif390390+391391+ if (netif_carrier_ok(dev))392392+ ndev->if_flags |= IF_READY;391393392394 write_lock_bh(&addrconf_lock);393395 dev->ip6_ptr = ndev;···419415 if ((idev = ipv6_add_dev(dev)) == NULL)420416 return NULL;421417 }418418+422419 if (dev->flags&IFF_UP)423420 ipv6_mc_up(idev);424421 return idev;···639634 }640635#endif641636642642- for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;643643- ifap = &ifa->if_next) {637637+ for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;) {644638 if (ifa == ifp) {645639 *ifap = ifa->if_next;646640 __in6_ifa_put(ifp);···647643 if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0)648644 break;649645 deleted = 1;646646+ continue;650647 } else if (ifp->flags & IFA_F_PERMANENT) {651648 if (ipv6_prefix_equal(&ifa->addr, &ifp->addr,652649 ifp->prefix_len)) {···671666 }672667 }673668 }669669+ ifap = &ifa->if_next;674670 }675671 write_unlock_bh(&idev->lock);676672···909903910904 score.addr_type = __ipv6_addr_type(&ifa->addr);911905912912- /* Rule 0: Candidate Source Address (section 4)906906+ /* Rule 0:907907+ * - Tentative Address (RFC2462 section 5.4)908908+ * - A tentative address is not considered909909+ * "assigned to an interface" in the traditional910910+ * sense.911911+ * - Candidate Source Address (section 4)913912 * - In any case, anycast addresses, multicast914913 * addresses, and the unspecified address MUST915914 * NOT be included in a candidate set.916915 */916916+ if (ifa->flags & IFA_F_TENTATIVE)917917+ continue;917918 if (unlikely(score.addr_type == IPV6_ADDR_ANY ||918919 score.addr_type & IPV6_ADDR_MULTICAST)) {919920 LIMIT_NETDEBUG(KERN_DEBUG···1228121512291216/* Gets referenced address, destroys ifaddr */1230121712311231-void addrconf_dad_failure(struct inet6_ifaddr *ifp)12181218+void addrconf_dad_stop(struct inet6_ifaddr *ifp)12321219{12331233- if (net_ratelimit())12341234- printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name);12351220 if (ifp->flags&IFA_F_PERMANENT) {12361221 spin_lock_bh(&ifp->lock);12371222 addrconf_del_timer(ifp);···12551244 ipv6_del_addr(ifp);12561245}1257124612471247+void addrconf_dad_failure(struct inet6_ifaddr *ifp)12481248+{12491249+ if (net_ratelimit())12501250+ printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name);12511251+ addrconf_dad_stop(ifp);12521252+}1258125312591254/* Join to solicited addr multicast group. */12601255···16131596 not good.16141597 */16151598 if (valid_lft >= 0x7FFFFFFF/HZ)16161616- rt_expires = 0;15991599+ rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ);16171600 else16181618- rt_expires = jiffies + valid_lft * HZ;16011601+ rt_expires = valid_lft * HZ;16021602+16031603+ /*16041604+ * We convert this (in jiffies) to clock_t later.16051605+ * Avoid arithmetic overflow there as well.16061606+ * Overflow can happen only if HZ < USER_HZ.16071607+ */16081608+ if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ)16091609+ rt_expires = 0x7FFFFFFF / USER_HZ;1619161016201611 if (pinfo->onlink) {16211612 struct rt6_info *rt;···16351610 ip6_del_rt(rt, NULL, NULL, NULL);16361611 rt = NULL;16371612 } else {16381638- rt->rt6i_expires = rt_expires;16131613+ rt->rt6i_expires = jiffies + rt_expires;16391614 }16401615 }16411616 } else if (valid_lft) {16421617 addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len,16431643- dev, rt_expires, RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);16181618+ dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);16441619 }16451620 if (rt)16461621 dst_release(&rt->u.dst);···21502125{21512126 struct net_device *dev = (struct net_device *) data;21522127 struct inet6_dev *idev = __in6_dev_get(dev);21282128+ int run_pending = 0;2153212921542130 switch(event) {21552131 case NETDEV_UP:21322132+ case NETDEV_CHANGE:21332133+ if (event == NETDEV_UP) {21342134+ if (!netif_carrier_ok(dev)) {21352135+ /* device is not ready yet. */21362136+ printk(KERN_INFO21372137+ "ADDRCONF(NETDEV_UP): %s: "21382138+ "link is not ready\n",21392139+ dev->name);21402140+ break;21412141+ }21422142+ } else {21432143+ if (!netif_carrier_ok(dev)) {21442144+ /* device is still not ready. */21452145+ break;21462146+ }21472147+21482148+ if (idev) {21492149+ if (idev->if_flags & IF_READY) {21502150+ /* device is already configured. */21512151+ break;21522152+ }21532153+ idev->if_flags |= IF_READY;21542154+ }21552155+21562156+ printk(KERN_INFO21572157+ "ADDRCONF(NETDEV_CHANGE): %s: "21582158+ "link becomes ready\n",21592159+ dev->name);21602160+21612161+ run_pending = 1;21622162+ }21632163+21562164 switch(dev->type) {21572165 case ARPHRD_SIT:21582166 addrconf_sit_config(dev);···22022144 break;22032145 };22042146 if (idev) {21472147+ if (run_pending)21482148+ addrconf_dad_run(idev);21492149+22052150 /* If the MTU changed during the interface down, when the22062151 interface up, the changed MTU must be reflected in the22072152 idev as well as routers.···22392178 */22402179 addrconf_ifdown(dev, event != NETDEV_DOWN);22412180 break;22422242- case NETDEV_CHANGE:22432243- break;21812181+22442182 case NETDEV_CHANGENAME:22452183#ifdef CONFIG_SYSCTL22462184 if (idev) {···2320226023212261 /* Step 3: clear flags for stateless addrconf */23222262 if (how != 1)23232323- idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD);22632263+ idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY);2324226423252265 /* Step 4: clear address list */23262266#ifdef CONFIG_IPV6_PRIVACY···24292369/*24302370 * Duplicate Address Detection24312371 */23722372+static void addrconf_dad_kick(struct inet6_ifaddr *ifp)23732373+{23742374+ unsigned long rand_num;23752375+ struct inet6_dev *idev = ifp->idev;23762376+23772377+ rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1);23782378+ ifp->probes = idev->cnf.dad_transmits;23792379+ addrconf_mod_timer(ifp, AC_DAD, rand_num);23802380+}23812381+24322382static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags)24332383{24342384 struct inet6_dev *idev = ifp->idev;24352385 struct net_device *dev = idev->dev;24362436- unsigned long rand_num;2437238624382387 addrconf_join_solict(dev, &ifp->addr);24392388···24512382 flags);2452238324532384 net_srandom(ifp->addr.s6_addr32[3]);24542454- rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1);2455238524562386 read_lock_bh(&idev->lock);24572387 if (ifp->dead)···24672399 return;24682400 }2469240124702470- ifp->probes = idev->cnf.dad_transmits;24712471- addrconf_mod_timer(ifp, AC_DAD, rand_num);24722472-24022402+ if (!(idev->if_flags & IF_READY)) {24032403+ spin_unlock_bh(&ifp->lock);24042404+ read_unlock_bh(&idev->lock);24052405+ /*24062406+ * If the defice is not ready:24072407+ * - keep it tentative if it is a permanent address.24082408+ * - otherwise, kill it.24092409+ */24102410+ in6_ifa_hold(ifp);24112411+ addrconf_dad_stop(ifp);24122412+ return;24132413+ }24142414+ addrconf_dad_kick(ifp);24732415 spin_unlock_bh(&ifp->lock);24742416out:24752417 read_unlock_bh(&idev->lock);···25602482 addrconf_mod_timer(ifp, AC_RS, ifp->idev->cnf.rtr_solicit_interval);25612483 spin_unlock_bh(&ifp->lock);25622484 }24852485+}24862486+24872487+static void addrconf_dad_run(struct inet6_dev *idev) {24882488+ struct inet6_ifaddr *ifp;24892489+24902490+ read_lock_bh(&idev->lock);24912491+ for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) {24922492+ spin_lock_bh(&ifp->lock);24932493+ if (!(ifp->flags & IFA_F_TENTATIVE)) {24942494+ spin_unlock_bh(&ifp->lock);24952495+ continue;24962496+ }24972497+ spin_unlock_bh(&ifp->lock);24982498+ addrconf_dad_kick(ifp);24992499+ }25002500+ read_unlock_bh(&idev->lock);25632501}2564250225652503#ifdef CONFIG_PROC_FS···27832689 in6_ifa_hold(ifpub);27842690 spin_unlock(&ifp->lock);27852691 read_unlock(&addrconf_hash_lock);26922692+ spin_lock(&ifpub->lock);26932693+ ifpub->regen_count = 0;26942694+ spin_unlock(&ifpub->lock);27862695 ipv6_create_tempaddr(ifpub, ifp);27872696 in6_ifa_put(ifpub);27882697 in6_ifa_put(ifp);
+14-2
net/ipv6/icmp.c
···328328 iif = skb->dev->ifindex;329329330330 /*331331- * Must not send if we know that source is Anycast also.332332- * for now we don't know that.331331+ * Must not send error if the source does not uniquely332332+ * identify a single node (RFC2463 Section 2.4).333333+ * We check unspecified / multicast addresses here,334334+ * and anycast addresses will be checked later.333335 */334336 if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) {335337 LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: addr_any/mcast source\n");···375373 err = ip6_dst_lookup(sk, &dst, &fl);376374 if (err)377375 goto out;376376+377377+ /*378378+ * We won't send icmp if the destination is known379379+ * anycast.380380+ */381381+ if (((struct rt6_info *)dst)->rt6i_flags & RTF_ANYCAST) {382382+ LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: acast source\n");383383+ goto out_dst_release;384384+ }385385+378386 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0)379387 goto out;380388
+111-31
net/ipv6/mcast.c
···170170#define MLDV2_QQIC(value) MLDV2_EXP(0x80, 4, 3, value)171171#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value)172172173173-#define IPV6_MLD_MAX_MSF 10173173+#define IPV6_MLD_MAX_MSF 64174174175175int sysctl_mld_max_msf = IPV6_MLD_MAX_MSF;176176···224224225225 mc_lst->ifindex = dev->ifindex;226226 mc_lst->sfmode = MCAST_EXCLUDE;227227+ mc_lst->sflock = RW_LOCK_UNLOCKED;227228 mc_lst->sflist = NULL;228229229230 /*···361360 struct ip6_sf_socklist *psl;362361 int i, j, rv;363362 int leavegroup = 0;363363+ int pmclocked = 0;364364 int err;365365366366 if (pgsr->gsr_group.ss_family != AF_INET6 ||···404402 ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);405403 pmc->sfmode = omode;406404 }405405+406406+ write_lock_bh(&pmc->sflock);407407+ pmclocked = 1;407408408409 psl = pmc->sflist;409410 if (!add) {···480475 /* update the interface list */481476 ip6_mc_add_src(idev, group, omode, 1, source, 1);482477done:478478+ if (pmclocked)479479+ write_unlock_bh(&pmc->sflock);483480 read_unlock_bh(&ipv6_sk_mc_lock);484481 read_unlock_bh(&idev->lock);485482 in6_dev_put(idev);···517510 dev = idev->dev;518511519512 err = 0;513513+ read_lock_bh(&ipv6_sk_mc_lock);514514+520515 if (gsf->gf_fmode == MCAST_INCLUDE && gsf->gf_numsrc == 0) {521516 leavegroup = 1;522517 goto done;···558549 newpsl = NULL;559550 (void) ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0);560551 }552552+553553+ write_lock_bh(&pmc->sflock);561554 psl = pmc->sflist;562555 if (psl) {563556 (void) ip6_mc_del_src(idev, group, pmc->sfmode,···569558 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);570559 pmc->sflist = newpsl;571560 pmc->sfmode = gsf->gf_fmode;561561+ write_unlock_bh(&pmc->sflock);572562 err = 0;573563done:564564+ read_unlock_bh(&ipv6_sk_mc_lock);574565 read_unlock_bh(&idev->lock);575566 in6_dev_put(idev);576567 dev_put(dev);···605592 dev = idev->dev;606593607594 err = -EADDRNOTAVAIL;595595+ /*596596+ * changes to the ipv6_mc_list require the socket lock and597597+ * a read lock on ip6_sk_mc_lock. We have the socket lock,598598+ * so reading the list is safe.599599+ */608600609601 for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {610602 if (pmc->ifindex != gsf->gf_interface)···632614 copy_to_user(optval, gsf, GROUP_FILTER_SIZE(0))) {633615 return -EFAULT;634616 }617617+ /* changes to psl require the socket lock, a read lock on618618+ * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We619619+ * have the socket lock, so reading here is safe.620620+ */635621 for (i=0; i<copycount; i++) {636622 struct sockaddr_in6 *psin6;637623 struct sockaddr_storage ss;···672650 read_unlock(&ipv6_sk_mc_lock);673651 return 1;674652 }653653+ read_lock(&mc->sflock);675654 psl = mc->sflist;676655 if (!psl) {677656 rv = mc->sfmode == MCAST_EXCLUDE;···688665 if (mc->sfmode == MCAST_EXCLUDE && i < psl->sl_count)689666 rv = 0;690667 }668668+ read_unlock(&mc->sflock);691669 read_unlock(&ipv6_sk_mc_lock);692670693671 return rv;···10921068 ma->mca_flags |= MAF_TIMER_RUNNING;10931069}1094107010951095-static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,10711071+/* mark EXCLUDE-mode sources */10721072+static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,10961073 struct in6_addr *srcs)10971074{10981075 struct ip6_sf_list *psf;···11031078 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {11041079 if (scount == nsrcs)11051080 break;11061106- for (i=0; i<nsrcs; i++)10811081+ for (i=0; i<nsrcs; i++) {10821082+ /* skip inactive filters */10831083+ if (pmc->mca_sfcount[MCAST_INCLUDE] ||10841084+ pmc->mca_sfcount[MCAST_EXCLUDE] !=10851085+ psf->sf_count[MCAST_EXCLUDE])10861086+ continue;10871087+ if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {10881088+ scount++;10891089+ break;10901090+ }10911091+ }10921092+ }10931093+ pmc->mca_flags &= ~MAF_GSQUERY;10941094+ if (scount == nsrcs) /* all sources excluded */10951095+ return 0;10961096+ return 1;10971097+}10981098+10991099+static int mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,11001100+ struct in6_addr *srcs)11011101+{11021102+ struct ip6_sf_list *psf;11031103+ int i, scount;11041104+11051105+ if (pmc->mca_sfmode == MCAST_EXCLUDE)11061106+ return mld_xmarksources(pmc, nsrcs, srcs);11071107+11081108+ /* mark INCLUDE-mode sources */11091109+11101110+ scount = 0;11111111+ for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {11121112+ if (scount == nsrcs)11131113+ break;11141114+ for (i=0; i<nsrcs; i++) {11071115 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {11081116 psf->sf_gsresp = 1;11091117 scount++;11101118 break;11111119 }11201120+ }11121121 }11221122+ if (!scount) {11231123+ pmc->mca_flags &= ~MAF_GSQUERY;11241124+ return 0;11251125+ }11261126+ pmc->mca_flags |= MAF_GSQUERY;11271127+ return 1;11131128}1114112911151130int igmp6_event_query(struct sk_buff *skb)···12321167 /* mark sources to include, if group & source-specific */12331168 if (mlh2->nsrcs != 0) {12341169 if (!pskb_may_pull(skb, srcs_offset + 12351235- mlh2->nsrcs * sizeof(struct in6_addr))) {11701170+ ntohs(mlh2->nsrcs) * sizeof(struct in6_addr))) {12361171 in6_dev_put(idev);12371172 return -EINVAL;12381173 }···12681203 else12691204 ma->mca_flags &= ~MAF_GSQUERY;12701205 }12711271- if (ma->mca_flags & MAF_GSQUERY)12721272- mld_marksources(ma, ntohs(mlh2->nsrcs),12731273- mlh2->srcs);12741274- igmp6_group_queried(ma, max_delay);12061206+ if (!(ma->mca_flags & MAF_GSQUERY) ||12071207+ mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs))12081208+ igmp6_group_queried(ma, max_delay);12751209 spin_unlock_bh(&ma->mca_lock);12761210 if (group_type != IPV6_ADDR_ANY)12771211 break;···13451281 case MLD2_MODE_IS_EXCLUDE:13461282 if (gdeleted || sdeleted)13471283 return 0;13481348- return !((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp);12841284+ if (!((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp)) {12851285+ if (pmc->mca_sfmode == MCAST_INCLUDE)12861286+ return 1;12871287+ /* don't include if this source is excluded12881288+ * in all filters12891289+ */12901290+ if (psf->sf_count[MCAST_INCLUDE])12911291+ return 0;12921292+ return pmc->mca_sfcount[MCAST_EXCLUDE] ==12931293+ psf->sf_count[MCAST_EXCLUDE];12941294+ }12951295+ return 0;13491296 case MLD2_CHANGE_TO_INCLUDE:13501297 if (gdeleted || sdeleted)13511298 return 0;···15251450 struct mld2_report *pmr;15261451 struct mld2_grec *pgr = NULL;15271452 struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;15281528- int scount, first, isquery, truncate;14531453+ int scount, stotal, first, isquery, truncate;1529145415301455 if (pmc->mca_flags & MAF_NOREPORT)15311456 return skb;···15351460 truncate = type == MLD2_MODE_IS_EXCLUDE ||15361461 type == MLD2_CHANGE_TO_EXCLUDE;1537146214631463+ stotal = scount = 0;14641464+15381465 psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources;1539146615401540- if (!*psf_list) {15411541- if (type == MLD2_ALLOW_NEW_SOURCES ||15421542- type == MLD2_BLOCK_OLD_SOURCES)15431543- return skb;15441544- if (pmc->mca_crcount || isquery) {15451545- /* make sure we have room for group header and at15461546- * least one source.15471547- */15481548- if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+15491549- sizeof(struct in6_addr)) {15501550- mld_sendpack(skb);15511551- skb = NULL; /* add_grhead will get a new one */15521552- }15531553- skb = add_grhead(skb, pmc, type, &pgr);15541554- }15551555- return skb;15561556- }14671467+ if (!*psf_list)14681468+ goto empty_source;14691469+15571470 pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;1558147115591472 /* EX and TO_EX get a fresh packet, if needed */···15541491 }15551492 }15561493 first = 1;15571557- scount = 0;15581494 psf_prev = NULL;15591495 for (psf=*psf_list; psf; psf=psf_next) {15601496 struct in6_addr *psrc;···15871525 }15881526 psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc));15891527 *psrc = psf->sf_addr;15901590- scount++;15281528+ scount++; stotal++;15911529 if ((type == MLD2_ALLOW_NEW_SOURCES ||15921530 type == MLD2_BLOCK_OLD_SOURCES) && psf->sf_crcount) {15931531 psf->sf_crcount--;···16011539 }16021540 }16031541 psf_prev = psf;15421542+ }15431543+15441544+empty_source:15451545+ if (!stotal) {15461546+ if (type == MLD2_ALLOW_NEW_SOURCES ||15471547+ type == MLD2_BLOCK_OLD_SOURCES)15481548+ return skb;15491549+ if (pmc->mca_crcount || isquery) {15501550+ /* make sure we have room for group header */15511551+ if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)) {15521552+ mld_sendpack(skb);15531553+ skb = NULL; /* add_grhead will get a new one */15541554+ }15551555+ skb = add_grhead(skb, pmc, type, &pgr);15561556+ }16041557 }16051558 if (pgr)16061559 pgr->grec_nsrcs = htons(scount);···16981621 skb = add_grec(skb, pmc, dtype, 1, 1);16991622 }17001623 if (pmc->mca_crcount) {17011701- pmc->mca_crcount--;17021624 if (pmc->mca_sfmode == MCAST_EXCLUDE) {17031625 type = MLD2_CHANGE_TO_INCLUDE;17041626 skb = add_grec(skb, pmc, type, 1, 0);17051627 }16281628+ pmc->mca_crcount--;17061629 if (pmc->mca_crcount == 0) {17071630 mld_clear_zeros(&pmc->mca_tomb);17081631 mld_clear_zeros(&pmc->mca_sources);···1736165917371660 /* filter mode changes */17381661 if (pmc->mca_crcount) {17391739- pmc->mca_crcount--;17401662 if (pmc->mca_sfmode == MCAST_EXCLUDE)17411663 type = MLD2_CHANGE_TO_EXCLUDE;17421664 else17431665 type = MLD2_CHANGE_TO_INCLUDE;17441666 skb = add_grec(skb, pmc, type, 0, 0);16671667+ pmc->mca_crcount--;17451668 }17461669 spin_unlock_bh(&pmc->mca_lock);17471670 }···21002023{21012024 int err;2102202520262026+ /* callers have the socket lock and a write lock on ipv6_sk_mc_lock,20272027+ * so no other readers or writers of iml or its sflist20282028+ */21032029 if (iml->sflist == 0) {21042030 /* any-source empty exclude case */21052031 return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0);
+1-1
net/ipv6/netfilter/Kconfig
···211211212212config IP6_NF_TARGET_NFQUEUE213213 tristate "NFQUEUE Target Support"214214- depends on IP_NF_IPTABLES214214+ depends on IP6_NF_IPTABLES215215 help216216 This Target replaced the old obsolete QUEUE target.217217
···214214 case IPPROTO_UDP:215215 case IPPROTO_TCP:216216 case IPPROTO_SCTP:217217+ case IPPROTO_DCCP:217218 if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) {218219 u16 *ports = (u16 *)exthdr;219220
+3-3
net/netrom/nr_in.c
···9999 break;100100101101 case NR_RESET:102102- if (sysctl_netrom_reset_circuit);102102+ if (sysctl_netrom_reset_circuit)103103 nr_disconnect(sk, ECONNRESET);104104 break;105105···130130 break;131131132132 case NR_RESET:133133- if (sysctl_netrom_reset_circuit);133133+ if (sysctl_netrom_reset_circuit)134134 nr_disconnect(sk, ECONNRESET);135135 break;136136···265265 break;266266267267 case NR_RESET:268268- if (sysctl_netrom_reset_circuit);268268+ if (sysctl_netrom_reset_circuit)269269 nr_disconnect(sk, ECONNRESET);270270 break;271271
+1-1
net/sched/act_api.c
···3434#include <net/sch_generic.h>3535#include <net/act_api.h>36363737-#if 1 /* control */3737+#if 0 /* control */3838#define DPRINTK(format, args...) printk(KERN_DEBUG format, ##args)3939#else4040#define DPRINTK(format, args...)
+4-12
net/sctp/socket.c
···156156 sizeof(struct sk_buff) +157157 sizeof(struct sctp_chunk);158158159159- sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk) +160160- sizeof(struct sk_buff) +161161- sizeof(struct sctp_chunk);162162-163159 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);164160}165161···34213425}3422342634233427static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port,34243424- void * __user *to, size_t space_left)34283428+ void __user **to, size_t space_left)34253429{34263430 struct list_head *pos;34273431 struct sctp_sockaddr_entry *addr;···44224426 * tcp_poll(). Note that, based on these implementations, we don't44234427 * lock the socket in this function, even though it seems that,44244428 * ideally, locking or some other mechanisms can be used to ensure44254425- * the integrity of the counters (sndbuf and wmem_queued) used44294429+ * the integrity of the counters (sndbuf and wmem_alloc) used44264430 * in this place. We assume that we don't need locks either until proven44274431 * otherwise.44284432 *···48294833 sizeof(struct sk_buff) +48304834 sizeof(struct sctp_chunk);4831483548324832- sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk) +48334833- sizeof(struct sk_buff) +48344834- sizeof(struct sctp_chunk);48354835-48364836 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);4837483748384838 sock_wfree(skb);···4912492049134921/* Is there any sndbuf space available on the socket?49144922 *49154915- * Note that wmem_queued is the sum of the send buffers on all of the49234923+ * Note that sk_wmem_alloc is the sum of the send buffers on all of the49164924 * associations on the same socket. For a UDP-style socket with49174925 * multiple associations, it is possible for it to be "unwriteable"49184926 * prematurely. I assume that this is acceptable because···49254933{49264934 int amt = 0;4927493549284928- amt = sk->sk_sndbuf - sk->sk_wmem_queued;49364936+ amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);49294937 if (amt < 0)49304938 amt = 0;49314939 return amt;
+4-2
net/sunrpc/auth_gss/auth_gss.c
···638638 gss_msg);639639 atomic_inc(&gss_msg->count);640640 gss_unhash_msg(gss_msg);641641- if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) {641641+ if (msg->errno == -ETIMEDOUT) {642642 unsigned long now = jiffies;643643 if (time_after(now, ratelimit)) {644644 printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"···786786 cred->gc_flags = 0;787787 cred->gc_base.cr_ops = &gss_credops;788788 cred->gc_service = gss_auth->service;789789- err = gss_create_upcall(gss_auth, cred);789789+ do {790790+ err = gss_create_upcall(gss_auth, cred);791791+ } while (err == -EAGAIN);790792 if (err < 0)791793 goto out_err;792794
+2-2
net/sunrpc/rpc_pipe.c
···174174 goto out;175175 msg = (struct rpc_pipe_msg *)filp->private_data;176176 if (msg != NULL) {177177- msg->errno = -EPIPE;177177+ msg->errno = -EAGAIN;178178 list_del_init(&msg->list);179179 rpci->ops->destroy_msg(msg);180180 }···183183 if (filp->f_mode & FMODE_READ)184184 rpci->nreaders --;185185 if (!rpci->nreaders)186186- __rpc_purge_upcall(inode, -EPIPE);186186+ __rpc_purge_upcall(inode, -EAGAIN);187187 if (rpci->ops->release_pipe)188188 rpci->ops->release_pipe(inode);189189out:
···346346 struct xfrm_policy *pol, **p;347347 struct xfrm_policy *delpol = NULL;348348 struct xfrm_policy **newpos = NULL;349349+ struct dst_entry *gc_list;349350350351 write_lock_bh(&xfrm_policy_lock);351352 for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL;) {···382381 xfrm_pol_hold(policy);383382 write_unlock_bh(&xfrm_policy_lock);384383385385- if (delpol) {384384+ if (delpol)386385 xfrm_policy_kill(delpol);386386+387387+ read_lock_bh(&xfrm_policy_lock);388388+ gc_list = NULL;389389+ for (policy = policy->next; policy; policy = policy->next) {390390+ struct dst_entry *dst;391391+392392+ write_lock(&policy->lock);393393+ dst = policy->bundles;394394+ if (dst) {395395+ struct dst_entry *tail = dst;396396+ while (tail->next)397397+ tail = tail->next;398398+ tail->next = gc_list;399399+ gc_list = dst;400400+401401+ policy->bundles = NULL;402402+ }403403+ write_unlock(&policy->lock);387404 }405405+ read_unlock_bh(&xfrm_policy_lock);406406+407407+ while (gc_list) {408408+ struct dst_entry *dst = gc_list;409409+410410+ gc_list = dst->next;411411+ dst_free(dst);412412+ }413413+388414 return 0;389415}390416EXPORT_SYMBOL(xfrm_policy_insert);···10421014}10431015EXPORT_SYMBOL(__xfrm_route_forward);1044101610451045-/* Optimize later using cookies and generation ids. */10461046-10471017static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)10481018{10491049- if (!stale_bundle(dst))10501050- return dst;10511051-10191019+ /* If it is marked obsolete, which is how we even get here,10201020+ * then we have purged it from the policy bundle list and we10211021+ * did that for a good reason.10221022+ */10521023 return NULL;10531024}10541025···11291102{11301103 xfrm_prune_bundles(stale_bundle);11311104 return 0;11051105+}11061106+11071107+static int always_true(struct dst_entry *dst)11081108+{11091109+ return 1;11101110+}11111111+11121112+void xfrm_flush_all_bundles(void)11131113+{11141114+ xfrm_prune_bundles(always_true);11321115}1133111611341117void xfrm_init_pmtu(struct dst_entry *dst)
+5
net/xfrm/xfrm_state.c
···431431 spin_lock_bh(&xfrm_state_lock);432432 __xfrm_state_insert(x);433433 spin_unlock_bh(&xfrm_state_lock);434434+435435+ xfrm_flush_all_bundles();434436}435437EXPORT_SYMBOL(xfrm_state_insert);436438···479477out:480478 spin_unlock_bh(&xfrm_state_lock);481479 xfrm_state_put_afinfo(afinfo);480480+481481+ if (!err)482482+ xfrm_flush_all_bundles();482483483484 if (x1) {484485 xfrm_state_delete(x1);
+18-11
sound/oss/au1550_ac97.c
···578578 } while ((stat & PSC_AC97STAT_DR) == 0);579579}580580581581+/* Hold spinlock for both start_dac() and start_adc() calls */581582static void582583start_dac(struct au1550_state *s)583584{584585 struct dmabuf *db = &s->dma_dac;585585- unsigned long flags;586586587587 if (!db->stopped)588588 return;589589-590590- spin_lock_irqsave(&s->lock, flags);591589592590 set_xmit_slots(db->num_channels);593591 au_writel(PSC_AC97PCR_TC, PSC_AC97PCR);···596598 au1xxx_dbdma_start(db->dmanr);597599598600 db->stopped = 0;599599-600600- spin_unlock_irqrestore(&s->lock, flags);601601}602602603603static void···714718}715719716720717717-/* hold spinlock for the following */718721static void719722dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)720723{721724 struct au1550_state *s = (struct au1550_state *) dev_id;722725 struct dmabuf *db = &s->dma_dac;723726 u32 ac97c_stat;727727+728728+ spin_lock(&s->lock);724729725730 ac97c_stat = au_readl(PSC_AC97STAT);726731 if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))···744747 /* wake up anybody listening */745748 if (waitqueue_active(&db->wait))746749 wake_up(&db->wait);750750+751751+ spin_unlock(&s->lock);747752}748753749754···757758 u32 obytes;758759 char *obuf;759760761761+ spin_lock(&s->lock);762762+760763 /* Pull the buffer from the dma queue.761764 */762765 au1xxx_dbdma_get_dest(dp->dmanr, (void *)(&obuf), &obytes);···766765 if ((dp->count + obytes) > dp->dmasize) {767766 /* Overrun. Stop ADC and log the error768767 */768768+ spin_unlock(&s->lock);769769 stop_adc(s);770770 dp->error++;771771 err("adc overrun");···789787 if (waitqueue_active(&dp->wait))790788 wake_up(&dp->wait);791789790790+ spin_unlock(&s->lock);792791}793792794793static loff_t···10511048 /* wait for samples in ADC dma buffer10521049 */10531050 do {10511051+ spin_lock_irqsave(&s->lock, flags);10541052 if (db->stopped)10551053 start_adc(s);10561056- spin_lock_irqsave(&s->lock, flags);10571054 avail = db->count;10581055 if (avail <= 0)10591056 __set_current_state(TASK_INTERRUPTIBLE);···15731570 if (get_user(val, (int *) arg))15741571 return -EFAULT;15751572 if (file->f_mode & FMODE_READ) {15761576- if (val & PCM_ENABLE_INPUT)15731573+ if (val & PCM_ENABLE_INPUT) {15741574+ spin_lock_irqsave(&s->lock, flags);15771575 start_adc(s);15781578- else15761576+ spin_unlock_irqrestore(&s->lock, flags);15771577+ } else15791578 stop_adc(s);15801579 }15811580 if (file->f_mode & FMODE_WRITE) {15821582- if (val & PCM_ENABLE_OUTPUT)15811581+ if (val & PCM_ENABLE_OUTPUT) {15821582+ spin_lock_irqsave(&s->lock, flags);15831583 start_dac(s);15841584- else15841584+ spin_unlock_irqrestore(&s->lock, flags);15851585+ } else15851586 stop_dac(s);15861587 }15871588 return 0;