From 553ad97c66aba4c07e9575882a2da6ef007bbbeb Mon Sep 17 00:00:00 2001 From: Lucas Correia Villa Real Date: Thu, 9 Feb 2006 16:47:58 +0000 Subject: [PATCH] --- yaml --- r: 20199 b: refs/heads/master c: b514d3192736563dee3f4ba4b659558b3cadc7f7 h: refs/heads/master i: 20197: 621707b52e431e74ef9e6ffac92680ea0092aaac 20195: e03fdd3f5e8d6d62323c8136a0b26143c507aeba 20191: 3fd877b4cc783587707e5ac37845065eb7ee6a29 v: v3 --- [refs] | 2 +- .../powerpc/booting-without-of.txt | 60 +--- trunk/arch/arm/mach-s3c2410/s3c2400.h | 31 ++ trunk/arch/i386/kernel/smpboot.c | 4 + trunk/arch/i386/mach-voyager/voyager_smp.c | 2 +- trunk/arch/ia64/ia32/ia32_signal.c | 1 - trunk/arch/ia64/kernel/entry.S | 16 - trunk/arch/ia64/kernel/fsys.S | 29 +- trunk/arch/ia64/kernel/mca_drv.c | 3 - trunk/arch/ia64/sn/kernel/io_init.c | 8 +- trunk/arch/ia64/sn/kernel/irq.c | 4 +- trunk/arch/powerpc/Kconfig | 6 - trunk/arch/powerpc/Makefile | 3 - trunk/arch/powerpc/kernel/Makefile | 6 +- trunk/arch/powerpc/kernel/systbl.S | 3 +- trunk/arch/ppc/kernel/misc.S | 283 ++++++++++++++++++ trunk/arch/s390/kernel/compat_signal.c | 3 + trunk/arch/sparc64/kernel/systbls.S | 2 +- trunk/drivers/char/tty_io.c | 30 +- trunk/drivers/net/wireless/Kconfig | 2 +- trunk/drivers/scsi/sata_mv.c | 11 +- trunk/drivers/scsi/sata_sil.c | 10 +- trunk/include/asm-ia64/unistd.h | 17 +- trunk/include/asm-powerpc/unistd.h | 3 +- trunk/include/linux/cpumask.h | 2 +- trunk/include/linux/kbd_kern.h | 4 +- trunk/include/linux/kexec.h | 1 - trunk/include/linux/netlink.h | 3 +- trunk/include/linux/sched.h | 2 +- trunk/include/linux/tty.h | 2 - trunk/include/linux/tty_flip.h | 4 +- trunk/include/net/irda/irlap.h | 3 - trunk/init/initramfs.c | 24 +- trunk/init/main.c | 1 + trunk/ipc/mqueue.c | 3 +- trunk/ipc/shm.c | 1 - trunk/kernel/panic.c | 1 - trunk/kernel/sched.c | 129 ++++++-- trunk/kernel/signal.c | 9 +- trunk/mm/slab.c | 10 +- trunk/mm/vmscan.c | 25 +- trunk/net/bridge/br_if.c | 94 ++---- trunk/net/bridge/br_input.c | 19 +- trunk/net/bridge/br_netfilter.c | 53 +--- trunk/net/bridge/br_private.h | 6 +- trunk/net/bridge/br_stp_bpdu.c | 30 +- trunk/net/bridge/br_sysfs_if.c | 50 +++- trunk/net/core/rtnetlink.c | 2 +- trunk/net/ipv4/devinet.c | 2 +- trunk/net/ipv4/fib_semantics.c | 2 +- trunk/net/ipv4/tcp_input.c | 3 +- trunk/net/irda/irda_device.c | 4 +- trunk/net/irda/irnet/irnet_irda.c | 2 +- trunk/net/netlink/af_netlink.c | 7 +- trunk/scripts/kconfig/Makefile | 12 +- 55 files changed, 644 insertions(+), 405 deletions(-) create mode 100644 trunk/arch/arm/mach-s3c2410/s3c2400.h diff --git a/[refs] b/[refs] index 6c9be1b3f899..684cdd72c3ae 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d6c662d4f13801fe5ce24e8bbdea321e2572d7e5 +refs/heads/master: b514d3192736563dee3f4ba4b659558b3cadc7f7 diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index d02c64953dcd..54e5f9b1536d 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -44,6 +44,7 @@ compiler and the textural representation of the tree that can be "compiled" by dtc. + November 21, 2005: Rev 0.5 - Additions/generalizations for 32-bit - Changed to reflect the new arch/powerpc @@ -1306,65 +1307,6 @@ platforms are moved over to use the flattened-device-tree model. }; - f) Freescale SOC USB controllers - - The device node for a USB controller that is part of a Freescale - SOC is as described in the document "Open Firmware Recommended - Practice : Universal Serial Bus" with the following modifications - and additions : - - Required properties : - - compatible : Should be "fsl-usb2-mph" for multi port host usb - controllers, or "fsl-usb2-dr" for dual role usb controllers - - phy_type : For multi port host usb controllers, should be one of - "ulpi", or "serial". For dual role usb controllers, should be - one of "ulpi", "utmi", "utmi_wide", or "serial". - - reg : Offset and length of the register set for the device - - port0 : boolean; if defined, indicates port0 is connected for - fsl-usb2-mph compatible controllers. Either this property or - "port1" (or both) must be defined for "fsl-usb2-mph" compatible - controllers. - - port1 : boolean; if defined, indicates port1 is connected for - fsl-usb2-mph compatible controllers. Either this property or - "port0" (or both) must be defined for "fsl-usb2-mph" compatible - controllers. - - Recommended properties : - - interrupts : where a is the interrupt number and b is a - field that represents an encoding of the sense and level - information for the interrupt. This should be encoded based on - the information in section 2) depending on the type of interrupt - controller you have. - - interrupt-parent : the phandle for the interrupt controller that - services interrupts for this device. - - Example multi port host usb controller device node : - usb@22000 { - device_type = "usb"; - compatible = "fsl-usb2-mph"; - reg = <22000 1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <700>; - interrupts = <27 1>; - phy_type = "ulpi"; - port0; - port1; - }; - - Example dual role usb controller device node : - usb@23000 { - device_type = "usb"; - compatible = "fsl-usb2-dr"; - reg = <23000 1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <700>; - interrupts = <26 1>; - phy = "ulpi"; - }; - - More devices will be defined as this spec matures. diff --git a/trunk/arch/arm/mach-s3c2410/s3c2400.h b/trunk/arch/arm/mach-s3c2410/s3c2400.h new file mode 100644 index 000000000000..8b2394e1ed40 --- /dev/null +++ b/trunk/arch/arm/mach-s3c2410/s3c2400.h @@ -0,0 +1,31 @@ +/* arch/arm/mach-s3c2410/s3c2400.h + * + * Copyright (c) 2004 Simtec Electronics + * Ben Dooks + * + * Header file for S3C2400 cpu support + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Modifications: + * 09-Fev-2006 LCVR First version, based on s3c2410.h +*/ + +#ifdef CONFIG_CPU_S3C2400 + +extern int s3c2400_init(void); + +extern void s3c2400_map_io(struct map_desc *mach_desc, int size); + +extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no); + +extern void s3c2400_init_clocks(int xtal); + +#else +#define s3c2400_init_clocks NULL +#define s3c2400_init_uarts NULL +#define s3c2400_map_io NULL +#define s3c2400_init NULL +#endif diff --git a/trunk/arch/i386/kernel/smpboot.c b/trunk/arch/i386/kernel/smpboot.c index fb00ab7b7612..255adb498268 100644 --- a/trunk/arch/i386/kernel/smpboot.c +++ b/trunk/arch/i386/kernel/smpboot.c @@ -87,7 +87,11 @@ EXPORT_SYMBOL(cpu_online_map); cpumask_t cpu_callin_map; cpumask_t cpu_callout_map; EXPORT_SYMBOL(cpu_callout_map); +#ifdef CONFIG_HOTPLUG_CPU +cpumask_t cpu_possible_map = CPU_MASK_ALL; +#else cpumask_t cpu_possible_map; +#endif EXPORT_SYMBOL(cpu_possible_map); static cpumask_t smp_commenced_mask; diff --git a/trunk/arch/i386/mach-voyager/voyager_smp.c b/trunk/arch/i386/mach-voyager/voyager_smp.c index 6e4c3baef6cc..72a1b9cae2e4 100644 --- a/trunk/arch/i386/mach-voyager/voyager_smp.c +++ b/trunk/arch/i386/mach-voyager/voyager_smp.c @@ -240,7 +240,7 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE; cpumask_t cpu_callin_map = CPU_MASK_NONE; cpumask_t cpu_callout_map = CPU_MASK_NONE; EXPORT_SYMBOL(cpu_callout_map); -cpumask_t cpu_possible_map = CPU_MASK_NONE; +cpumask_t cpu_possible_map = CPU_MASK_ALL; EXPORT_SYMBOL(cpu_possible_map); /* The per processor IRQ masks (these are usually kept in sync) */ diff --git a/trunk/arch/ia64/ia32/ia32_signal.c b/trunk/arch/ia64/ia32/ia32_signal.c index b3355a9ca2c3..5856510210fa 100644 --- a/trunk/arch/ia64/ia32/ia32_signal.c +++ b/trunk/arch/ia64/ia32/ia32_signal.c @@ -515,7 +515,6 @@ sys32_signal (int sig, unsigned int handler) sigact_set_handler(&new_sa, handler, 0); new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK; - sigemptyset(&new_sa.sa.sa_mask); ret = do_sigaction(sig, &new_sa, &old_sa); diff --git a/trunk/arch/ia64/kernel/entry.S b/trunk/arch/ia64/kernel/entry.S index 27b222c277e4..7a6ffd613789 100644 --- a/trunk/arch/ia64/kernel/entry.S +++ b/trunk/arch/ia64/kernel/entry.S @@ -1601,21 +1601,5 @@ sys_call_table: data8 sys_inotify_add_watch data8 sys_inotify_rm_watch data8 sys_migrate_pages // 1280 - data8 sys_openat - data8 sys_mkdirat - data8 sys_mknodat - data8 sys_fchownat - data8 sys_futimesat // 1285 - data8 sys_newfstatat - data8 sys_unlinkat - data8 sys_renameat - data8 sys_linkat - data8 sys_symlinkat // 1290 - data8 sys_readlinkat - data8 sys_fchmodat - data8 sys_faccessat - data8 sys_ni_syscall // reserved for pselect - data8 sys_ni_syscall // 1295 reserved for ppoll - data8 sys_unshare .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls diff --git a/trunk/arch/ia64/kernel/fsys.S b/trunk/arch/ia64/kernel/fsys.S index ac6055c83115..ce423910ca97 100644 --- a/trunk/arch/ia64/kernel/fsys.S +++ b/trunk/arch/ia64/kernel/fsys.S @@ -878,8 +878,31 @@ fsyscall_table: data8 0 // timer_delete data8 0 // clock_settime data8 fsys_clock_gettime // clock_gettime - #define __NR_syscall_last 1255 - - .space 8*(NR_syscalls + 1024 - __NR_syscall_last), 0 + data8 0 // clock_getres // 1255 + data8 0 // clock_nanosleep + data8 0 // fstatfs64 + data8 0 // statfs64 + data8 0 + data8 0 // 1260 + data8 0 + data8 0 // mq_open + data8 0 // mq_unlink + data8 0 // mq_timedsend + data8 0 // mq_timedreceive // 1265 + data8 0 // mq_notify + data8 0 // mq_getsetattr + data8 0 // kexec_load + data8 0 + data8 0 // 1270 + data8 0 + data8 0 + data8 0 + data8 0 + data8 0 // 1275 + data8 0 + data8 0 + data8 0 + data8 0 + data8 0 // 1280 .org fsyscall_table + 8*NR_syscalls // guard against failures to increase NR_syscalls diff --git a/trunk/arch/ia64/kernel/mca_drv.c b/trunk/arch/ia64/kernel/mca_drv.c index 8fd93afa75a7..3492e3211a44 100644 --- a/trunk/arch/ia64/kernel/mca_drv.c +++ b/trunk/arch/ia64/kernel/mca_drv.c @@ -437,9 +437,6 @@ recover_from_read_error(slidx_table_t *slidx, * the process not have any locks of kernel. */ - /* Is minstate valid? */ - if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate)) - return 0; psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); /* diff --git a/trunk/arch/ia64/sn/kernel/io_init.c b/trunk/arch/ia64/sn/kernel/io_init.c index 3437c2390429..d7e4d79e16a8 100644 --- a/trunk/arch/ia64/sn/kernel/io_init.c +++ b/trunk/arch/ia64/sn/kernel/io_init.c @@ -617,15 +617,15 @@ void sn_bus_store_sysdata(struct pci_dev *dev) void sn_bus_free_sysdata(void) { struct sysdata_el *element; - struct list_head *list, *safe; + struct list_head *list; - list_for_each_safe(list, safe, &sn_sysdata_list) { +sn_sysdata_free_start: + list_for_each(list, &sn_sysdata_list) { element = list_entry(list, struct sysdata_el, entry); list_del(&element->entry); - list_del(&(((struct pcidev_info *) - (element->sysdata))->pdi_list)); kfree(element->sysdata); kfree(element); + goto sn_sysdata_free_start; } return; } diff --git a/trunk/arch/ia64/sn/kernel/irq.c b/trunk/arch/ia64/sn/kernel/irq.c index c373113d073a..74d87d903d5d 100644 --- a/trunk/arch/ia64/sn/kernel/irq.c +++ b/trunk/arch/ia64/sn/kernel/irq.c @@ -299,9 +299,7 @@ void sn_irq_unfixup(struct pci_dev *pci_dev) return; sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info; - if (!sn_irq_info) - return; - if (!sn_irq_info->irq_irq) { + if (!sn_irq_info || !sn_irq_info->irq_irq) { kfree(sn_irq_info); return; } diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig index 80d114a3a837..df338c5cc910 100644 --- a/trunk/arch/powerpc/Kconfig +++ b/trunk/arch/powerpc/Kconfig @@ -83,12 +83,6 @@ config GENERIC_TBSYNC default y if PPC32 && SMP default n -config DEFAULT_UIMAGE - bool - help - Used to allow a board to specify it wants a uImage built by default - default n - menu "Processor support" choice prompt "Processor Type" diff --git a/trunk/arch/powerpc/Makefile b/trunk/arch/powerpc/Makefile index 5500ab55d042..44dd82b791d1 100644 --- a/trunk/arch/powerpc/Makefile +++ b/trunk/arch/powerpc/Makefile @@ -142,7 +142,6 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ # Default to zImage, override when needed defaultimage-y := zImage defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux -defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage KBUILD_IMAGE := $(defaultimage-y) all: $(KBUILD_IMAGE) @@ -168,8 +167,6 @@ endef archclean: $(Q)$(MAKE) $(clean)=$(boot) - -archmrproper: $(Q)rm -rf arch/$(ARCH)/include archprepare: checkbin diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile index 80e9fe2632b8..c287980b7e65 100644 --- a/trunk/arch/powerpc/kernel/Makefile +++ b/trunk/arch/powerpc/kernel/Makefile @@ -12,10 +12,10 @@ endif obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ irq.o align.o signal_32.o pmc.o vdso.o \ - init_task.o process.o systbl.o + init_task.o process.o obj-y += vdso32/ obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ - signal_64.o ptrace32.o \ + signal_64.o ptrace32.o systbl.o \ paca.o cpu_setup_power4.o \ firmware.o sysfs.o idle_64.o obj-$(CONFIG_PPC64) += vdso64/ @@ -46,7 +46,7 @@ extra-$(CONFIG_8xx) := head_8xx.o extra-y += vmlinux.lds obj-y += time.o prom.o traps.o setup-common.o udbg.o -obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o +obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o obj-$(CONFIG_MODULES) += ppc_ksyms.o diff --git a/trunk/arch/powerpc/kernel/systbl.S b/trunk/arch/powerpc/kernel/systbl.S index 8a9f994ed917..007b15ee36d2 100644 --- a/trunk/arch/powerpc/kernel/systbl.S +++ b/trunk/arch/powerpc/kernel/systbl.S @@ -36,6 +36,8 @@ #ifdef CONFIG_PPC64 #define sys_sigpending sys_ni_syscall #define sys_old_getrlimit sys_ni_syscall +#else +#define ppc_rtas sys_ni_syscall #endif _GLOBAL(sys_call_table) @@ -321,4 +323,3 @@ SYSCALL(spu_run) SYSCALL(spu_create) COMPAT_SYS(pselect6) COMPAT_SYS(ppoll) -SYSCALL(unshare) diff --git a/trunk/arch/ppc/kernel/misc.S b/trunk/arch/ppc/kernel/misc.S index 5a936566fd61..c3427eed8345 100644 --- a/trunk/arch/ppc/kernel/misc.S +++ b/trunk/arch/ppc/kernel/misc.S @@ -1048,3 +1048,286 @@ _GLOBAL(name) \ blr SYSCALL(execve) + +/* Why isn't this a) automatic, b) written in 'C'? */ + .data + .align 4 +_GLOBAL(sys_call_table) + .long sys_restart_syscall /* 0 */ + .long sys_exit + .long ppc_fork + .long sys_read + .long sys_write + .long sys_open /* 5 */ + .long sys_close + .long sys_waitpid + .long sys_creat + .long sys_link + .long sys_unlink /* 10 */ + .long sys_execve + .long sys_chdir + .long sys_time + .long sys_mknod + .long sys_chmod /* 15 */ + .long sys_lchown + .long sys_ni_syscall /* old break syscall holder */ + .long sys_stat + .long sys_lseek + .long sys_getpid /* 20 */ + .long sys_mount + .long sys_oldumount + .long sys_setuid + .long sys_getuid + .long sys_stime /* 25 */ + .long sys_ptrace + .long sys_alarm + .long sys_fstat + .long sys_pause + .long sys_utime /* 30 */ + .long sys_ni_syscall /* old stty syscall holder */ + .long sys_ni_syscall /* old gtty syscall holder */ + .long sys_access + .long sys_nice + .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */ + .long sys_sync + .long sys_kill + .long sys_rename + .long sys_mkdir + .long sys_rmdir /* 40 */ + .long sys_dup + .long sys_pipe + .long sys_times + .long sys_ni_syscall /* old prof syscall holder */ + .long sys_brk /* 45 */ + .long sys_setgid + .long sys_getgid + .long sys_signal + .long sys_geteuid + .long sys_getegid /* 50 */ + .long sys_acct + .long sys_umount /* recycled never used phys() */ + .long sys_ni_syscall /* old lock syscall holder */ + .long sys_ioctl + .long sys_fcntl /* 55 */ + .long sys_ni_syscall /* old mpx syscall holder */ + .long sys_setpgid + .long sys_ni_syscall /* old ulimit syscall holder */ + .long sys_olduname + .long sys_umask /* 60 */ + .long sys_chroot + .long sys_ustat + .long sys_dup2 + .long sys_getppid + .long sys_getpgrp /* 65 */ + .long sys_setsid + .long sys_sigaction + .long sys_sgetmask + .long sys_ssetmask + .long sys_setreuid /* 70 */ + .long sys_setregid + .long sys_sigsuspend + .long sys_sigpending + .long sys_sethostname + .long sys_setrlimit /* 75 */ + .long sys_old_getrlimit + .long sys_getrusage + .long sys_gettimeofday + .long sys_settimeofday + .long sys_getgroups /* 80 */ + .long sys_setgroups + .long ppc_select + .long sys_symlink + .long sys_lstat + .long sys_readlink /* 85 */ + .long sys_uselib + .long sys_swapon + .long sys_reboot + .long old_readdir + .long sys_mmap /* 90 */ + .long sys_munmap + .long sys_truncate + .long sys_ftruncate + .long sys_fchmod + .long sys_fchown /* 95 */ + .long sys_getpriority + .long sys_setpriority + .long sys_ni_syscall /* old profil syscall holder */ + .long sys_statfs + .long sys_fstatfs /* 100 */ + .long sys_ni_syscall + .long sys_socketcall + .long sys_syslog + .long sys_setitimer + .long sys_getitimer /* 105 */ + .long sys_newstat + .long sys_newlstat + .long sys_newfstat + .long sys_uname + .long sys_ni_syscall /* 110 */ + .long sys_vhangup + .long sys_ni_syscall /* old 'idle' syscall */ + .long sys_ni_syscall + .long sys_wait4 + .long sys_swapoff /* 115 */ + .long sys_sysinfo + .long sys_ipc + .long sys_fsync + .long sys_sigreturn + .long ppc_clone /* 120 */ + .long sys_setdomainname + .long sys_newuname + .long sys_ni_syscall + .long sys_adjtimex + .long sys_mprotect /* 125 */ + .long sys_sigprocmask + .long sys_ni_syscall /* old sys_create_module */ + .long sys_init_module + .long sys_delete_module + .long sys_ni_syscall /* old sys_get_kernel_syms */ /* 130 */ + .long sys_quotactl + .long sys_getpgid + .long sys_fchdir + .long sys_bdflush + .long sys_sysfs /* 135 */ + .long sys_personality + .long sys_ni_syscall /* for afs_syscall */ + .long sys_setfsuid + .long sys_setfsgid + .long sys_llseek /* 140 */ + .long sys_getdents + .long ppc_select + .long sys_flock + .long sys_msync + .long sys_readv /* 145 */ + .long sys_writev + .long sys_getsid + .long sys_fdatasync + .long sys_sysctl + .long sys_mlock /* 150 */ + .long sys_munlock + .long sys_mlockall + .long sys_munlockall + .long sys_sched_setparam + .long sys_sched_getparam /* 155 */ + .long sys_sched_setscheduler + .long sys_sched_getscheduler + .long sys_sched_yield + .long sys_sched_get_priority_max + .long sys_sched_get_priority_min /* 160 */ + .long sys_sched_rr_get_interval + .long sys_nanosleep + .long sys_mremap + .long sys_setresuid + .long sys_getresuid /* 165 */ + .long sys_ni_syscall /* old sys_query_module */ + .long sys_poll + .long sys_nfsservctl + .long sys_setresgid + .long sys_getresgid /* 170 */ + .long sys_prctl + .long sys_rt_sigreturn + .long sys_rt_sigaction + .long sys_rt_sigprocmask + .long sys_rt_sigpending /* 175 */ + .long sys_rt_sigtimedwait + .long sys_rt_sigqueueinfo + .long sys_rt_sigsuspend + .long sys_pread64 + .long sys_pwrite64 /* 180 */ + .long sys_chown + .long sys_getcwd + .long sys_capget + .long sys_capset + .long sys_sigaltstack /* 185 */ + .long sys_sendfile + .long sys_ni_syscall /* streams1 */ + .long sys_ni_syscall /* streams2 */ + .long ppc_vfork + .long sys_getrlimit /* 190 */ + .long sys_readahead + .long sys_mmap2 + .long sys_truncate64 + .long sys_ftruncate64 + .long sys_stat64 /* 195 */ + .long sys_lstat64 + .long sys_fstat64 + .long sys_pciconfig_read + .long sys_pciconfig_write + .long sys_pciconfig_iobase /* 200 */ + .long sys_ni_syscall /* 201 - reserved - MacOnLinux - new */ + .long sys_getdents64 + .long sys_pivot_root + .long sys_fcntl64 + .long sys_madvise /* 205 */ + .long sys_mincore + .long sys_gettid + .long sys_tkill + .long sys_setxattr + .long sys_lsetxattr /* 210 */ + .long sys_fsetxattr + .long sys_getxattr + .long sys_lgetxattr + .long sys_fgetxattr + .long sys_listxattr /* 215 */ + .long sys_llistxattr + .long sys_flistxattr + .long sys_removexattr + .long sys_lremovexattr + .long sys_fremovexattr /* 220 */ + .long sys_futex + .long sys_sched_setaffinity + .long sys_sched_getaffinity + .long sys_ni_syscall + .long sys_ni_syscall /* 225 - reserved for Tux */ + .long sys_sendfile64 + .long sys_io_setup + .long sys_io_destroy + .long sys_io_getevents + .long sys_io_submit /* 230 */ + .long sys_io_cancel + .long sys_set_tid_address + .long sys_fadvise64 + .long sys_exit_group + .long sys_lookup_dcookie /* 235 */ + .long sys_epoll_create + .long sys_epoll_ctl + .long sys_epoll_wait + .long sys_remap_file_pages + .long sys_timer_create /* 240 */ + .long sys_timer_settime + .long sys_timer_gettime + .long sys_timer_getoverrun + .long sys_timer_delete + .long sys_clock_settime /* 245 */ + .long sys_clock_gettime + .long sys_clock_getres + .long sys_clock_nanosleep + .long sys_swapcontext + .long sys_tgkill /* 250 */ + .long sys_utimes + .long sys_statfs64 + .long sys_fstatfs64 + .long ppc_fadvise64_64 + .long sys_ni_syscall /* 255 - rtas (used on ppc64) */ + .long sys_debug_setcontext + .long sys_ni_syscall /* 257 reserved for vserver */ + .long sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */ + .long sys_ni_syscall /* 259 reserved for new sys_mbind */ + .long sys_ni_syscall /* 260 reserved for new sys_get_mempolicy */ + .long sys_ni_syscall /* 261 reserved for new sys_set_mempolicy */ + .long sys_mq_open + .long sys_mq_unlink + .long sys_mq_timedsend + .long sys_mq_timedreceive /* 265 */ + .long sys_mq_notify + .long sys_mq_getsetattr + .long sys_kexec_load + .long sys_add_key + .long sys_request_key /* 270 */ + .long sys_keyctl + .long sys_waitid + .long sys_ioprio_set + .long sys_ioprio_get + .long sys_inotify_init /* 275 */ + .long sys_inotify_add_watch + .long sys_inotify_rm_watch diff --git a/trunk/arch/s390/kernel/compat_signal.c b/trunk/arch/s390/kernel/compat_signal.c index 5291b5f8788d..ef706694a0c1 100644 --- a/trunk/arch/s390/kernel/compat_signal.c +++ b/trunk/arch/s390/kernel/compat_signal.c @@ -195,6 +195,9 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act, return ret; } +int +do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact); + asmlinkage long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, struct sigaction32 __user *oact, size_t sigsetsize) diff --git a/trunk/arch/sparc64/kernel/systbls.S b/trunk/arch/sparc64/kernel/systbls.S index a19168510be2..5928b3c33e27 100644 --- a/trunk/arch/sparc64/kernel/systbls.S +++ b/trunk/arch/sparc64/kernel/systbls.S @@ -146,7 +146,7 @@ sys_call_table: /*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid /*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat - .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_newfstatat + .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, compat_sys_newfstatat /*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index a23816d3e9a1..076e07c1da38 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -268,8 +268,6 @@ static struct tty_buffer *tty_buffer_alloc(size_t size) p->size = size; p->next = NULL; p->active = 0; - p->commit = 0; - p->read = 0; p->char_buf_ptr = (char *)(p->data); p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size; /* printk("Flip create %p\n", p); */ @@ -300,8 +298,6 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size) *tbh = t->next; t->next = NULL; t->used = 0; - t->commit = 0; - t->read = 0; /* DEBUG ONLY */ memset(t->data, '*', size); /* printk("Flip recycle %p\n", t); */ @@ -339,7 +335,6 @@ int tty_buffer_request_room(struct tty_struct *tty, size_t size) if (b != NULL) { b->next = n; b->active = 0; - b->commit = b->used; } else tty->buf.head = n; tty->buf.tail = n; @@ -2757,9 +2752,6 @@ static void flush_to_ldisc(void *private_) unsigned long flags; struct tty_ldisc *disc; struct tty_buffer *tbuf; - int count; - char *char_buf; - unsigned char *flag_buf; disc = tty_ldisc_ref(tty); if (disc == NULL) /* !TTY_LDISC */ @@ -2773,20 +2765,16 @@ static void flush_to_ldisc(void *private_) goto out; } spin_lock_irqsave(&tty->buf.lock, flags); - while((tbuf = tty->buf.head) != NULL) { - while ((count = tbuf->commit - tbuf->read) != 0) { - char_buf = tbuf->char_buf_ptr + tbuf->read; - flag_buf = tbuf->flag_buf_ptr + tbuf->read; - tbuf->read += count; - spin_unlock_irqrestore(&tty->buf.lock, flags); - disc->receive_buf(tty, char_buf, flag_buf, count); - spin_lock_irqsave(&tty->buf.lock, flags); - } - if (tbuf->active) - break; + while((tbuf = tty->buf.head) != NULL && !tbuf->active) { tty->buf.head = tbuf->next; if (tty->buf.head == NULL) tty->buf.tail = NULL; + spin_unlock_irqrestore(&tty->buf.lock, flags); + /* printk("Process buffer %p for %d\n", tbuf, tbuf->used); */ + disc->receive_buf(tty, tbuf->char_buf_ptr, + tbuf->flag_buf_ptr, + tbuf->used); + spin_lock_irqsave(&tty->buf.lock, flags); tty_buffer_free(tty, tbuf); } spin_unlock_irqrestore(&tty->buf.lock, flags); @@ -2883,10 +2871,8 @@ void tty_flip_buffer_push(struct tty_struct *tty) { unsigned long flags; spin_lock_irqsave(&tty->buf.lock, flags); - if (tty->buf.tail != NULL) { + if (tty->buf.tail != NULL) tty->buf.tail->active = 0; - tty->buf.tail->commit = tty->buf.tail->used; - } spin_unlock_irqrestore(&tty->buf.lock, flags); if (tty->low_latency) diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig index ef85d76575a2..233a4f608084 100644 --- a/trunk/drivers/net/wireless/Kconfig +++ b/trunk/drivers/net/wireless/Kconfig @@ -148,7 +148,7 @@ config IPW2100 In order to use this driver, you will need a firmware image for it. You can obtain the firmware from . Once you have the firmware image, you - will need to place it in /lib/firmware. + will need to place it in /etc/firmware. You will also very likely need the Wireless Tools in order to configure your card: diff --git a/trunk/drivers/scsi/sata_mv.c b/trunk/drivers/scsi/sata_mv.c index 6fddf17a3b70..cd54244058b5 100644 --- a/trunk/drivers/scsi/sata_mv.c +++ b/trunk/drivers/scsi/sata_mv.c @@ -509,12 +509,6 @@ static const struct mv_hw_ops mv6xxx_ops = { .reset_bus = mv_reset_pci_bus, }; -/* - * module options - */ -static int msi; /* Use PCI msi; either zero (off, default) or non-zero */ - - /* * Functions */ @@ -2197,7 +2191,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } /* Enable interrupts */ - if (msi && pci_enable_msi(pdev) == 0) { + if (pci_enable_msi(pdev) == 0) { hpriv->hp_flags |= MV_HP_FLAG_MSI; } else { pci_intx(pdev, 1); @@ -2252,8 +2246,5 @@ MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, mv_pci_tbl); MODULE_VERSION(DRV_VERSION); -module_param(msi, int, 0444); -MODULE_PARM_DESC(msi, "Enable use of PCI MSI (0=off, 1=on)"); - module_init(mv_init); module_exit(mv_exit); diff --git a/trunk/drivers/scsi/sata_sil.c b/trunk/drivers/scsi/sata_sil.c index 17f74d3c10e7..b017f85e6d6a 100644 --- a/trunk/drivers/scsi/sata_sil.c +++ b/trunk/drivers/scsi/sata_sil.c @@ -231,10 +231,6 @@ MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, sil_pci_tbl); MODULE_VERSION(DRV_VERSION); -static int slow_down = 0; -module_param(slow_down, int, 0444); -MODULE_PARM_DESC(slow_down, "Sledgehammer used to work around random problems, by limiting commands to 15 sectors (0=off, 1=on)"); - static unsigned char sil_get_device_cache_line(struct pci_dev *pdev) { @@ -358,10 +354,8 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev) } /* limit requests to 15 sectors */ - if (slow_down || - ((ap->flags & SIL_FLAG_MOD15WRITE) && - (quirks & SIL_QUIRK_MOD15WRITE))) { - printk(KERN_INFO "ata%u(%u): applying Seagate errata fix (mod15write workaround)\n", + if ((ap->flags & SIL_FLAG_MOD15WRITE) && (quirks & SIL_QUIRK_MOD15WRITE)) { + printk(KERN_INFO "ata%u(%u): applying Seagate errata fix\n", ap->id, dev->devno); ap->host->max_sectors = 15; ap->host->hostt->max_sectors = 15; diff --git a/trunk/include/asm-ia64/unistd.h b/trunk/include/asm-ia64/unistd.h index 019956c613e4..962f9bd1bdff 100644 --- a/trunk/include/asm-ia64/unistd.h +++ b/trunk/include/asm-ia64/unistd.h @@ -270,27 +270,12 @@ #define __NR_inotify_add_watch 1278 #define __NR_inotify_rm_watch 1279 #define __NR_migrate_pages 1280 -#define __NR_openat 1281 -#define __NR_mkdirat 1282 -#define __NR_mknodat 1283 -#define __NR_fchownat 1284 -#define __NR_futimesat 1285 -#define __NR_newfstatat 1286 -#define __NR_unlinkat 1287 -#define __NR_renameat 1288 -#define __NR_linkat 1289 -#define __NR_symlinkat 1290 -#define __NR_readlinkat 1291 -#define __NR_fchmodat 1292 -#define __NR_faccessat 1293 -/* 1294, 1295 reserved for pselect/ppoll */ -#define __NR_unshare 1296 #ifdef __KERNEL__ #include -#define NR_syscalls 273 /* length of syscall table */ +#define NR_syscalls 270 /* length of syscall table */ #define __ARCH_WANT_SYS_RT_SIGACTION diff --git a/trunk/include/asm-powerpc/unistd.h b/trunk/include/asm-powerpc/unistd.h index 35556993f066..a40cdff21a88 100644 --- a/trunk/include/asm-powerpc/unistd.h +++ b/trunk/include/asm-powerpc/unistd.h @@ -300,9 +300,8 @@ #define __NR_spu_create 279 #define __NR_pselect6 280 #define __NR_ppoll 281 -#define __NR_unshare 282 -#define __NR_syscalls 283 +#define __NR_syscalls 282 #ifdef __KERNEL__ #define __NR__exit __NR_exit diff --git a/trunk/include/linux/cpumask.h b/trunk/include/linux/cpumask.h index 60e56c6e03dd..20b446f26ecd 100644 --- a/trunk/include/linux/cpumask.h +++ b/trunk/include/linux/cpumask.h @@ -328,7 +328,7 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, * bitmap of size NR_CPUS. * * #ifdef CONFIG_HOTPLUG_CPU - * cpu_possible_map - has bit 'cpu' set iff cpu is populatable + * cpu_possible_map - all NR_CPUS bits set * cpu_present_map - has bit 'cpu' set iff cpu is populated * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler * #else diff --git a/trunk/include/linux/kbd_kern.h b/trunk/include/linux/kbd_kern.h index e87c32a5c86a..3aed37314ab8 100644 --- a/trunk/include/linux/kbd_kern.h +++ b/trunk/include/linux/kbd_kern.h @@ -153,10 +153,8 @@ static inline void con_schedule_flip(struct tty_struct *t) { unsigned long flags; spin_lock_irqsave(&t->buf.lock, flags); - if (t->buf.tail != NULL) { + if (t->buf.tail != NULL) t->buf.tail->active = 0; - t->buf.tail->commit = t->buf.tail->used; - } spin_unlock_irqrestore(&t->buf.lock, flags); schedule_work(&t->buf.work); } diff --git a/trunk/include/linux/kexec.h b/trunk/include/linux/kexec.h index cfb3410e32b1..a311f58c8a7c 100644 --- a/trunk/include/linux/kexec.h +++ b/trunk/include/linux/kexec.h @@ -6,7 +6,6 @@ #include #include #include -#include #include /* Verify architecture specific macros are defined */ diff --git a/trunk/include/linux/netlink.h b/trunk/include/linux/netlink.h index c256ebe2a7b4..6a2ccf78a356 100644 --- a/trunk/include/linux/netlink.h +++ b/trunk/include/linux/netlink.h @@ -160,8 +160,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb); /* finegrained unicast helpers: */ struct sock *netlink_getsockbyfilp(struct file *filp); -int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, - long timeo, struct sock *ssk); +int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo); void netlink_detachskb(struct sock *sk, struct sk_buff *skb); int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 9c1da0269a18..0cfcd1c7865e 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -1098,7 +1098,7 @@ extern struct sigqueue *sigqueue_alloc(void); extern void sigqueue_free(struct sigqueue *); extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); -extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); +extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *); extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); /* These can be the second arg to send_sig_info/send_group_sig_info. */ diff --git a/trunk/include/linux/tty.h b/trunk/include/linux/tty.h index f45cd74e6f24..a7bd3b4558d2 100644 --- a/trunk/include/linux/tty.h +++ b/trunk/include/linux/tty.h @@ -58,8 +58,6 @@ struct tty_buffer { int used; int size; int active; - int commit; - int read; /* Data points here */ unsigned long data[0]; }; diff --git a/trunk/include/linux/tty_flip.h b/trunk/include/linux/tty_flip.h index 222faf97d5f9..82961eb19888 100644 --- a/trunk/include/linux/tty_flip.h +++ b/trunk/include/linux/tty_flip.h @@ -29,10 +29,8 @@ _INLINE_ void tty_schedule_flip(struct tty_struct *tty) { unsigned long flags; spin_lock_irqsave(&tty->buf.lock, flags); - if (tty->buf.tail != NULL) { + if (tty->buf.tail != NULL) tty->buf.tail->active = 0; - tty->buf.tail->commit = tty->buf.tail->used; - } spin_unlock_irqrestore(&tty->buf.lock, flags); schedule_delayed_work(&tty->buf.work, 1); } diff --git a/trunk/include/net/irda/irlap.h b/trunk/include/net/irda/irlap.h index 2127cae1e0a6..f55e86e75030 100644 --- a/trunk/include/net/irda/irlap.h +++ b/trunk/include/net/irda/irlap.h @@ -50,9 +50,6 @@ /* May be different when we get VFIR */ #define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER) -/* Each IrDA device gets a random 32 bits IRLAP device address */ -#define LAP_ALEN 4 - #define BROADCAST 0xffffffff /* Broadcast device address */ #define CBROADCAST 0xfe /* Connection broadcast address */ #define XID_FORMAT 0x01 /* Discovery XID format */ diff --git a/trunk/init/initramfs.c b/trunk/init/initramfs.c index 637344b05981..0c5d9a3f951b 100644 --- a/trunk/init/initramfs.c +++ b/trunk/init/initramfs.c @@ -466,32 +466,10 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) extern char __initramfs_start[], __initramfs_end[]; #ifdef CONFIG_BLK_DEV_INITRD #include -#include static void __init free_initrd(void) { -#ifdef CONFIG_KEXEC - unsigned long crashk_start = (unsigned long)__va(crashk_res.start); - unsigned long crashk_end = (unsigned long)__va(crashk_res.end); - - /* - * If the initrd region is overlapped with crashkernel reserved region, - * free only memory that is not part of crashkernel region. - */ - if (initrd_start < crashk_end && initrd_end > crashk_start) { - /* - * Initialize initrd memory region since the kexec boot does - * not do. - */ - memset((void *)initrd_start, 0, initrd_end - initrd_start); - if (initrd_start < crashk_start) - free_initrd_mem(initrd_start, crashk_start); - if (initrd_end > crashk_end) - free_initrd_mem(crashk_end, initrd_end); - } else -#endif - free_initrd_mem(initrd_start, initrd_end); - + free_initrd_mem(initrd_start, initrd_end); initrd_start = 0; initrd_end = 0; } diff --git a/trunk/init/main.c b/trunk/init/main.c index 4c194c47395f..7c79da57d3a2 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -668,6 +668,7 @@ static int init(void * unused) */ child_reaper = current; + /* Sets up cpus_possible() */ smp_prepare_cpus(max_cpus); do_pre_smp_initcalls(); diff --git a/trunk/ipc/mqueue.c b/trunk/ipc/mqueue.c index fd2e26b6f966..59302fc3643b 100644 --- a/trunk/ipc/mqueue.c +++ b/trunk/ipc/mqueue.c @@ -1018,8 +1018,7 @@ asmlinkage long sys_mq_notify(mqd_t mqdes, goto out; } - ret = netlink_attachskb(sock, nc, 0, - MAX_SCHEDULE_TIMEOUT, NULL); + ret = netlink_attachskb(sock, nc, 0, MAX_SCHEDULE_TIMEOUT); if (ret == 1) goto retry; if (ret) { diff --git a/trunk/ipc/shm.c b/trunk/ipc/shm.c index 9162123a7b23..4c28d2d8e305 100644 --- a/trunk/ipc/shm.c +++ b/trunk/ipc/shm.c @@ -870,7 +870,6 @@ asmlinkage long sys_shmdt(char __user *shmaddr) * could possibly have landed at. Also cast things to loff_t to * prevent overflows and make comparisions vs. equal-width types. */ - size = PAGE_ALIGN(size); while (vma && (loff_t)(vma->vm_end - addr) <= size) { next = vma->vm_next; diff --git a/trunk/kernel/panic.c b/trunk/kernel/panic.c index 126dc43f1c74..c5c4ab255834 100644 --- a/trunk/kernel/panic.c +++ b/trunk/kernel/panic.c @@ -130,7 +130,6 @@ NORET_TYPE void panic(const char * fmt, ...) #endif local_irq_enable(); for (i = 0;;) { - touch_softlockup_watchdog(); i += panic_blink(i); mdelay(1); i++; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 87d93be336a1..bc38804e40dd 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -215,6 +215,7 @@ struct runqueue { */ unsigned long nr_running; #ifdef CONFIG_SMP + unsigned long prio_bias; unsigned long cpu_load[3]; #endif unsigned long long nr_switches; @@ -668,13 +669,68 @@ static int effective_prio(task_t *p) return prio; } +#ifdef CONFIG_SMP +static inline void inc_prio_bias(runqueue_t *rq, int prio) +{ + rq->prio_bias += MAX_PRIO - prio; +} + +static inline void dec_prio_bias(runqueue_t *rq, int prio) +{ + rq->prio_bias -= MAX_PRIO - prio; +} + +static inline void inc_nr_running(task_t *p, runqueue_t *rq) +{ + rq->nr_running++; + if (rt_task(p)) { + if (p != rq->migration_thread) + /* + * The migration thread does the actual balancing. Do + * not bias by its priority as the ultra high priority + * will skew balancing adversely. + */ + inc_prio_bias(rq, p->prio); + } else + inc_prio_bias(rq, p->static_prio); +} + +static inline void dec_nr_running(task_t *p, runqueue_t *rq) +{ + rq->nr_running--; + if (rt_task(p)) { + if (p != rq->migration_thread) + dec_prio_bias(rq, p->prio); + } else + dec_prio_bias(rq, p->static_prio); +} +#else +static inline void inc_prio_bias(runqueue_t *rq, int prio) +{ +} + +static inline void dec_prio_bias(runqueue_t *rq, int prio) +{ +} + +static inline void inc_nr_running(task_t *p, runqueue_t *rq) +{ + rq->nr_running++; +} + +static inline void dec_nr_running(task_t *p, runqueue_t *rq) +{ + rq->nr_running--; +} +#endif + /* * __activate_task - move a task to the runqueue. */ static inline void __activate_task(task_t *p, runqueue_t *rq) { enqueue_task(p, rq->active); - rq->nr_running++; + inc_nr_running(p, rq); } /* @@ -683,7 +739,7 @@ static inline void __activate_task(task_t *p, runqueue_t *rq) static inline void __activate_idle_task(task_t *p, runqueue_t *rq) { enqueue_task_head(p, rq->active); - rq->nr_running++; + inc_nr_running(p, rq); } static int recalc_task_prio(task_t *p, unsigned long long now) @@ -807,7 +863,7 @@ static void activate_task(task_t *p, runqueue_t *rq, int local) */ static void deactivate_task(struct task_struct *p, runqueue_t *rq) { - rq->nr_running--; + dec_nr_running(p, rq); dequeue_task(p, p->array); p->array = NULL; } @@ -951,27 +1007,61 @@ void kick_process(task_t *p) * We want to under-estimate the load of migration sources, to * balance conservatively. */ -static inline unsigned long source_load(int cpu, int type) +static unsigned long __source_load(int cpu, int type, enum idle_type idle) { runqueue_t *rq = cpu_rq(cpu); - unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE; + unsigned long running = rq->nr_running; + unsigned long source_load, cpu_load = rq->cpu_load[type-1], + load_now = running * SCHED_LOAD_SCALE; + if (type == 0) - return load_now; + source_load = load_now; + else + source_load = min(cpu_load, load_now); + + if (running > 1 || (idle == NOT_IDLE && running)) + /* + * If we are busy rebalancing the load is biased by + * priority to create 'nice' support across cpus. When + * idle rebalancing we should only bias the source_load if + * there is more than one task running on that queue to + * prevent idle rebalance from trying to pull tasks from a + * queue with only one running task. + */ + source_load = source_load * rq->prio_bias / running; - return min(rq->cpu_load[type-1], load_now); + return source_load; +} + +static inline unsigned long source_load(int cpu, int type) +{ + return __source_load(cpu, type, NOT_IDLE); } /* * Return a high guess at the load of a migration-target cpu */ -static inline unsigned long target_load(int cpu, int type) +static inline unsigned long __target_load(int cpu, int type, enum idle_type idle) { runqueue_t *rq = cpu_rq(cpu); - unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE; + unsigned long running = rq->nr_running; + unsigned long target_load, cpu_load = rq->cpu_load[type-1], + load_now = running * SCHED_LOAD_SCALE; + if (type == 0) - return load_now; + target_load = load_now; + else + target_load = max(cpu_load, load_now); - return max(rq->cpu_load[type-1], load_now); + if (running > 1 || (idle == NOT_IDLE && running)) + target_load = target_load * rq->prio_bias / running; + + return target_load; +} + +static inline unsigned long target_load(int cpu, int type) +{ + return __target_load(cpu, type, NOT_IDLE); } /* @@ -1440,7 +1530,7 @@ void fastcall wake_up_new_task(task_t *p, unsigned long clone_flags) list_add_tail(&p->run_list, ¤t->run_list); p->array = current->array; p->array->nr_active++; - rq->nr_running++; + inc_nr_running(p, rq); } set_need_resched(); } else @@ -1785,9 +1875,9 @@ void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p, runqueue_t *this_rq, prio_array_t *this_array, int this_cpu) { dequeue_task(p, src_array); - src_rq->nr_running--; + dec_nr_running(p, src_rq); set_task_cpu(p, this_cpu); - this_rq->nr_running++; + inc_nr_running(p, this_rq); enqueue_task(p, this_array); p->timestamp = (p->timestamp - src_rq->timestamp_last_tick) + this_rq->timestamp_last_tick; @@ -1966,9 +2056,9 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, /* Bias balancing toward cpus of our domain */ if (local_group) - load = target_load(i, load_idx); + load = __target_load(i, load_idx, idle); else - load = source_load(i, load_idx); + load = __source_load(i, load_idx, idle); avg_load += load; } @@ -2081,7 +2171,7 @@ static runqueue_t *find_busiest_queue(struct sched_group *group, int i; for_each_cpu_mask(i, group->cpumask) { - load = source_load(i, 0); + load = __source_load(i, 0, idle); if (load > max_load) { max_load = load; @@ -3481,8 +3571,10 @@ void set_user_nice(task_t *p, long nice) goto out_unlock; } array = p->array; - if (array) + if (array) { dequeue_task(p, array); + dec_prio_bias(rq, p->static_prio); + } old_prio = p->prio; new_prio = NICE_TO_PRIO(nice); @@ -3492,6 +3584,7 @@ void set_user_nice(task_t *p, long nice) if (array) { enqueue_task(p, array); + inc_prio_bias(rq, p->static_prio); /* * If the task increased its priority or is running and * lowered its priority, then reschedule its CPU: diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index ea154104a00b..b373fc2420da 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -2430,7 +2430,7 @@ sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo) } int -do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact) +do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact) { struct k_sigaction *k; sigset_t mask; @@ -2454,8 +2454,6 @@ do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact) *oact = *k; if (act) { - sigdelsetmask(&act->sa.sa_mask, - sigmask(SIGKILL) | sigmask(SIGSTOP)); /* * POSIX 3.3.1.3: * "Setting a signal action to SIG_IGN for a signal that is @@ -2481,6 +2479,8 @@ do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact) read_lock(&tasklist_lock); spin_lock_irq(&t->sighand->siglock); *k = *act; + sigdelsetmask(&k->sa.sa_mask, + sigmask(SIGKILL) | sigmask(SIGSTOP)); sigemptyset(&mask); sigaddset(&mask, sig); rm_from_queue_full(&mask, &t->signal->shared_pending); @@ -2495,6 +2495,8 @@ do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact) } *k = *act; + sigdelsetmask(&k->sa.sa_mask, + sigmask(SIGKILL) | sigmask(SIGSTOP)); } spin_unlock_irq(¤t->sighand->siglock); @@ -2700,7 +2702,6 @@ sys_signal(int sig, __sighandler_t handler) new_sa.sa.sa_handler = handler; new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK; - sigemptyset(&new_sa.sa.sa_mask); ret = do_sigaction(sig, &new_sa, &old_sa); diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index add05d808a4a..d66c2b0d9715 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -1717,12 +1717,6 @@ kmem_cache_create (const char *name, size_t size, size_t align, BUG(); } - /* - * Prevent CPUs from coming and going. - * lock_cpu_hotplug() nests outside cache_chain_mutex - */ - lock_cpu_hotplug(); - mutex_lock(&cache_chain_mutex); list_for_each(p, &cache_chain) { @@ -1924,6 +1918,8 @@ kmem_cache_create (const char *name, size_t size, size_t align, cachep->dtor = dtor; cachep->name = name; + /* Don't let CPUs to come and go */ + lock_cpu_hotplug(); if (g_cpucache_up == FULL) { enable_cpucache(cachep); @@ -1982,12 +1978,12 @@ kmem_cache_create (const char *name, size_t size, size_t align, /* cache setup completed, link it into the list */ list_add(&cachep->next, &cache_chain); + unlock_cpu_hotplug(); oops: if (!cachep && (flags & SLAB_PANIC)) panic("kmem_cache_create(): failed to create slab `%s'\n", name); mutex_unlock(&cache_chain_mutex); - unlock_cpu_hotplug(); return cachep; } EXPORT_SYMBOL(kmem_cache_create); diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 5db32fdfaf39..5a610804cd06 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -632,7 +632,7 @@ static int swap_page(struct page *page) struct address_space *mapping = page_mapping(page); if (page_mapped(page) && mapping) - if (try_to_unmap(page, 1) != SWAP_SUCCESS) + if (try_to_unmap(page, 0) != SWAP_SUCCESS) goto unlock_retry; if (PageDirty(page)) { @@ -839,7 +839,7 @@ EXPORT_SYMBOL(migrate_page); * pages are swapped out. * * The function returns after 10 attempts or if no pages - * are movable anymore because to has become empty + * are movable anymore because t has become empty * or no retryable pages exist anymore. * * Return: Number of pages not migrated when "to" ran empty. @@ -928,21 +928,12 @@ int migrate_pages(struct list_head *from, struct list_head *to, goto unlock_both; if (mapping->a_ops->migratepage) { - /* - * Most pages have a mapping and most filesystems - * should provide a migration function. Anonymous - * pages are part of swap space which also has its - * own migration function. This is the most common - * path for page migration. - */ rc = mapping->a_ops->migratepage(newpage, page); goto unlock_both; } /* - * Default handling if a filesystem does not provide - * a migration function. We can only migrate clean - * pages so try to write out any dirty pages first. + * Trigger writeout if page is dirty */ if (PageDirty(page)) { switch (pageout(page, mapping)) { @@ -958,10 +949,9 @@ int migrate_pages(struct list_head *from, struct list_head *to, ; /* try to migrate the page below */ } } - /* - * Buffers are managed in a filesystem specific way. - * We must have no buffers or drop them. + * If we have no buffer or can release the buffer + * then do a simple migration. */ if (!page_has_buffers(page) || try_to_release_page(page, GFP_KERNEL)) { @@ -976,11 +966,6 @@ int migrate_pages(struct list_head *from, struct list_head *to, * swap them out. */ if (pass > 4) { - /* - * Persistently unable to drop buffers..... As a - * measure of last resort we fall back to - * swap_page(). - */ unlock_page(newpage); newpage = NULL; rc = swap_page(page); diff --git a/trunk/net/bridge/br_if.c b/trunk/net/bridge/br_if.c index 7fa3a5a9971f..da687c8dc6ff 100644 --- a/trunk/net/bridge/br_if.c +++ b/trunk/net/bridge/br_if.c @@ -79,14 +79,9 @@ static int port_cost(struct net_device *dev) */ static void port_carrier_check(void *arg) { - struct net_device *dev = arg; - struct net_bridge_port *p; + struct net_bridge_port *p = arg; rtnl_lock(); - p = dev->br_port; - if (!p) - goto done; - if (netif_carrier_ok(p->dev)) { u32 cost = port_cost(p->dev); @@ -102,33 +97,19 @@ static void port_carrier_check(void *arg) br_stp_disable_port(p); spin_unlock_bh(&p->br->lock); } -done: rtnl_unlock(); } -static void release_nbp(struct kobject *kobj) -{ - struct net_bridge_port *p - = container_of(kobj, struct net_bridge_port, kobj); - kfree(p); -} - -static struct kobj_type brport_ktype = { -#ifdef CONFIG_SYSFS - .sysfs_ops = &brport_sysfs_ops, -#endif - .release = release_nbp, -}; - static void destroy_nbp(struct net_bridge_port *p) { struct net_device *dev = p->dev; + dev->br_port = NULL; p->br = NULL; p->dev = NULL; dev_put(dev); - kobject_put(&p->kobj); + br_sysfs_freeif(p); } static void destroy_nbp_rcu(struct rcu_head *head) @@ -152,24 +133,24 @@ static void del_nbp(struct net_bridge_port *p) struct net_bridge *br = p->br; struct net_device *dev = p->dev; - sysfs_remove_link(&br->ifobj, dev->name); + /* Race between RTNL notify and RCU callback */ + if (p->deleted) + return; dev_set_promiscuity(dev, -1); cancel_delayed_work(&p->carrier_check); + flush_scheduled_work(); spin_lock_bh(&br->lock); br_stp_disable_port(p); + p->deleted = 1; spin_unlock_bh(&br->lock); br_fdb_delete_by_port(br, p); list_del_rcu(&p->list); - rcu_assign_pointer(dev->br_port, NULL); - - kobject_del(&p->kobj); - call_rcu(&p->rcu, destroy_nbp_rcu); } @@ -179,6 +160,7 @@ static void del_br(struct net_bridge *br) struct net_bridge_port *p, *n; list_for_each_entry_safe(p, n, &br->port_list, list) { + br_sysfs_removeif(p); del_nbp(p); } @@ -272,17 +254,13 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, p->dev = dev; p->path_cost = port_cost(dev); p->priority = 0x8000 >> BR_PORT_BITS; + dev->br_port = p; p->port_no = index; br_init_port(p); p->state = BR_STATE_DISABLED; - INIT_WORK(&p->carrier_check, port_carrier_check, dev); + INIT_WORK(&p->carrier_check, port_carrier_check, p); kobject_init(&p->kobj); - kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR); - p->kobj.ktype = &brport_ktype; - p->kobj.parent = &(dev->class_dev.kobj); - p->kobj.kset = NULL; - return p; } @@ -410,43 +388,30 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) if (dev->br_port != NULL) return -EBUSY; - p = new_nbp(br, dev); - if (IS_ERR(p)) + if (IS_ERR(p = new_nbp(br, dev))) return PTR_ERR(p); - err = kobject_add(&p->kobj); - if (err) - goto err0; - - err = br_fdb_insert(br, p, dev->dev_addr); - if (err) - goto err1; - - err = br_sysfs_addif(p); - if (err) - goto err2; - - rcu_assign_pointer(dev->br_port, p); - dev_set_promiscuity(dev, 1); + if ((err = br_fdb_insert(br, p, dev->dev_addr))) + destroy_nbp(p); + + else if ((err = br_sysfs_addif(p))) + del_nbp(p); + else { + dev_set_promiscuity(dev, 1); - list_add_rcu(&p->list, &br->port_list); + list_add_rcu(&p->list, &br->port_list); - spin_lock_bh(&br->lock); - br_stp_recalculate_bridge_id(br); - br_features_recompute(br); - schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); - spin_unlock_bh(&br->lock); + spin_lock_bh(&br->lock); + br_stp_recalculate_bridge_id(br); + br_features_recompute(br); + if ((br->dev->flags & IFF_UP) + && (dev->flags & IFF_UP) && netif_carrier_ok(dev)) + br_stp_enable_port(p); + spin_unlock_bh(&br->lock); - dev_set_mtu(br->dev, br_min_mtu(br)); - kobject_uevent(&p->kobj, KOBJ_ADD); + dev_set_mtu(br->dev, br_min_mtu(br)); + } - return 0; -err2: - br_fdb_delete_by_port(br, p); -err1: - kobject_del(&p->kobj); -err0: - kobject_put(&p->kobj); return err; } @@ -458,6 +423,7 @@ int br_del_if(struct net_bridge *br, struct net_device *dev) if (!p || p->br != br) return -EINVAL; + br_sysfs_removeif(p); del_nbp(p); spin_lock_bh(&br->lock); diff --git a/trunk/net/bridge/br_input.c b/trunk/net/bridge/br_input.c index 4eef83755315..e3a73cead6b6 100644 --- a/trunk/net/bridge/br_input.c +++ b/trunk/net/bridge/br_input.c @@ -45,20 +45,18 @@ static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb) int br_handle_frame_finish(struct sk_buff *skb) { const unsigned char *dest = eth_hdr(skb)->h_dest; - struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); - struct net_bridge *br; + struct net_bridge_port *p = skb->dev->br_port; + struct net_bridge *br = p->br; struct net_bridge_fdb_entry *dst; int passedup = 0; - if (!p || p->state == BR_STATE_DISABLED) - goto drop; - /* insert into forwarding database after filtering to avoid spoofing */ - br = p->br; - br_fdb_update(br, p, eth_hdr(skb)->h_source); + br_fdb_update(p->br, p, eth_hdr(skb)->h_source); - if (p->state == BR_STATE_LEARNING) - goto drop; + if (p->state == BR_STATE_LEARNING) { + kfree_skb(skb); + goto out; + } if (br->dev->flags & IFF_PROMISC) { struct sk_buff *skb2; @@ -95,9 +93,6 @@ int br_handle_frame_finish(struct sk_buff *skb) out: return 0; -drop: - kfree_skb(skb); - goto out; } /* diff --git a/trunk/net/bridge/br_netfilter.c b/trunk/net/bridge/br_netfilter.c index b5018166b0e5..7cac3fb9f809 100644 --- a/trunk/net/bridge/br_netfilter.c +++ b/trunk/net/bridge/br_netfilter.c @@ -51,6 +51,9 @@ #define store_orig_dstaddr(skb) (skb_origaddr(skb) = (skb)->nh.iph->daddr) #define dnat_took_place(skb) (skb_origaddr(skb) != (skb)->nh.iph->daddr) +#define has_bridge_parent(device) ((device)->br_port != NULL) +#define bridge_parent(device) ((device)->br_port->br->dev) + #ifdef CONFIG_SYSCTL static struct ctl_table_header *brnf_sysctl_header; static int brnf_call_iptables = 1; @@ -95,12 +98,6 @@ static struct rtable __fake_rtable = { .rt_flags = 0, }; -static inline struct net_device *bridge_parent(const struct net_device *dev) -{ - struct net_bridge_port *port = rcu_dereference(dev->br_port); - - return port ? port->br->dev : NULL; -} /* PF_BRIDGE/PRE_ROUTING *********************************************/ /* Undo the changes made for ip6tables PREROUTING and continue the @@ -192,15 +189,11 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; skb->dev = bridge_parent(skb->dev); - if (!skb->dev) - kfree_skb(skb); - else { - if (skb->protocol == __constant_htons(ETH_P_8021Q)) { - skb_pull(skb, VLAN_HLEN); - skb->nh.raw += VLAN_HLEN; - } - skb->dst->output(skb); + if (skb->protocol == __constant_htons(ETH_P_8021Q)) { + skb_pull(skb, VLAN_HLEN); + skb->nh.raw += VLAN_HLEN; } + skb->dst->output(skb); return 0; } @@ -277,7 +270,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb) } /* Some common code for IPv4/IPv6 */ -static struct net_device *setup_pre_routing(struct sk_buff *skb) +static void setup_pre_routing(struct sk_buff *skb) { struct nf_bridge_info *nf_bridge = skb->nf_bridge; @@ -289,8 +282,6 @@ static struct net_device *setup_pre_routing(struct sk_buff *skb) nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING; nf_bridge->physindev = skb->dev; skb->dev = bridge_parent(skb->dev); - - return skb->dev; } /* We only check the length. A bridge shouldn't do any hop-by-hop stuff anyway */ @@ -385,8 +376,7 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook, nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; - if (!setup_pre_routing(skb)) - return NF_DROP; + setup_pre_routing(skb); NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL, br_nf_pre_routing_finish_ipv6); @@ -475,8 +465,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb, nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; - if (!setup_pre_routing(skb)) - return NF_DROP; + setup_pre_routing(skb); store_orig_dstaddr(skb); NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL, @@ -550,16 +539,11 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb, struct sk_buff *skb = *pskb; struct nf_bridge_info *nf_bridge; struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); - struct net_device *parent; int pf; if (!skb->nf_bridge) return NF_ACCEPT; - parent = bridge_parent(out); - if (!parent) - return NF_DROP; - if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) pf = PF_INET; else @@ -580,8 +564,8 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb, nf_bridge->mask |= BRNF_BRIDGED; nf_bridge->physoutdev = skb->dev; - NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in), parent, - br_nf_forward_finish); + NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in), + bridge_parent(out), br_nf_forward_finish); return NF_STOLEN; } @@ -704,8 +688,6 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb, goto out; } realoutdev = bridge_parent(skb->dev); - if (!realoutdev) - return NF_DROP; #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) /* iptables should match -o br0.x */ @@ -719,11 +701,9 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb, /* IP forwarded traffic has a physindev, locally * generated traffic hasn't. */ if (realindev != NULL) { - if (!(nf_bridge->mask & BRNF_DONT_TAKE_PARENT) ) { - struct net_device *parent = bridge_parent(realindev); - if (parent) - realindev = parent; - } + if (!(nf_bridge->mask & BRNF_DONT_TAKE_PARENT) && + has_bridge_parent(realindev)) + realindev = bridge_parent(realindev); NF_HOOK_THRESH(pf, NF_IP_FORWARD, skb, realindev, realoutdev, br_nf_local_out_finish, @@ -763,9 +743,6 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb, if (!nf_bridge) return NF_ACCEPT; - if (!realoutdev) - return NF_DROP; - if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) pf = PF_INET; else diff --git a/trunk/net/bridge/br_private.h b/trunk/net/bridge/br_private.h index 8f10e09f251b..e330b17b6d81 100644 --- a/trunk/net/bridge/br_private.h +++ b/trunk/net/bridge/br_private.h @@ -68,6 +68,7 @@ struct net_bridge_port /* STP */ u8 priority; u8 state; + u8 deleted; u16 port_no; unsigned char topology_change_ack; unsigned char config_pending; @@ -232,8 +233,9 @@ extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent); #ifdef CONFIG_SYSFS /* br_sysfs_if.c */ -extern struct sysfs_ops brport_sysfs_ops; extern int br_sysfs_addif(struct net_bridge_port *p); +extern void br_sysfs_removeif(struct net_bridge_port *p); +extern void br_sysfs_freeif(struct net_bridge_port *p); /* br_sysfs_br.c */ extern int br_sysfs_addbr(struct net_device *dev); @@ -242,6 +244,8 @@ extern void br_sysfs_delbr(struct net_device *dev); #else #define br_sysfs_addif(p) (0) +#define br_sysfs_removeif(p) do { } while(0) +#define br_sysfs_freeif(p) kfree(p) #define br_sysfs_addbr(dev) (0) #define br_sysfs_delbr(dev) do { } while(0) #endif /* CONFIG_SYSFS */ diff --git a/trunk/net/bridge/br_stp_bpdu.c b/trunk/net/bridge/br_stp_bpdu.c index 296f6a487c52..d071f1c9ad0b 100644 --- a/trunk/net/bridge/br_stp_bpdu.c +++ b/trunk/net/bridge/br_stp_bpdu.c @@ -133,35 +133,29 @@ void br_send_tcn_bpdu(struct net_bridge_port *p) static const unsigned char header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00}; -/* NO locks, but rcu_read_lock (preempt_disabled) */ +/* NO locks */ int br_stp_handle_bpdu(struct sk_buff *skb) { - struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); - struct net_bridge *br; + struct net_bridge_port *p = skb->dev->br_port; + struct net_bridge *br = p->br; unsigned char *buf; - if (!p) - goto err; - - br = p->br; - spin_lock(&br->lock); - - if (p->state == BR_STATE_DISABLED || !(br->dev->flags & IFF_UP)) - goto out; - /* insert into forwarding database after filtering to avoid spoofing */ - br_fdb_update(br, p, eth_hdr(skb)->h_source); - - if (!br->stp_enabled) - goto out; + br_fdb_update(p->br, p, eth_hdr(skb)->h_source); /* need at least the 802 and STP headers */ if (!pskb_may_pull(skb, sizeof(header)+1) || memcmp(skb->data, header, sizeof(header))) - goto out; + goto err; buf = skb_pull(skb, sizeof(header)); + spin_lock_bh(&br->lock); + if (p->state == BR_STATE_DISABLED + || !(br->dev->flags & IFF_UP) + || !br->stp_enabled) + goto out; + if (buf[0] == BPDU_TYPE_CONFIG) { struct br_config_bpdu bpdu; @@ -207,7 +201,7 @@ int br_stp_handle_bpdu(struct sk_buff *skb) br_received_tcn_bpdu(p); } out: - spin_unlock(&br->lock); + spin_unlock_bh(&br->lock); err: kfree_skb(skb); return 0; diff --git a/trunk/net/bridge/br_sysfs_if.c b/trunk/net/bridge/br_sysfs_if.c index c51c9e42aeb3..0ac0355d16dd 100644 --- a/trunk/net/bridge/br_sysfs_if.c +++ b/trunk/net/bridge/br_sysfs_if.c @@ -195,11 +195,23 @@ static ssize_t brport_store(struct kobject * kobj, return ret; } -struct sysfs_ops brport_sysfs_ops = { +/* called from kobject_put when port ref count goes to zero. */ +static void brport_release(struct kobject *kobj) +{ + kfree(container_of(kobj, struct net_bridge_port, kobj)); +} + +static struct sysfs_ops brport_sysfs_ops = { .show = brport_show, .store = brport_store, }; +static struct kobj_type brport_ktype = { + .sysfs_ops = &brport_sysfs_ops, + .release = brport_release, +}; + + /* * Add sysfs entries to ethernet device added to a bridge. * Creates a brport subdirectory with bridge attributes. @@ -211,6 +223,17 @@ int br_sysfs_addif(struct net_bridge_port *p) struct brport_attribute **a; int err; + ASSERT_RTNL(); + + kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR); + p->kobj.ktype = &brport_ktype; + p->kobj.parent = &(p->dev->class_dev.kobj); + p->kobj.kset = NULL; + + err = kobject_add(&p->kobj); + if(err) + goto out1; + err = sysfs_create_link(&p->kobj, &br->dev->class_dev.kobj, SYSFS_BRIDGE_PORT_LINK); if (err) @@ -222,7 +245,28 @@ int br_sysfs_addif(struct net_bridge_port *p) goto out2; } - err= sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name); -out2: + err = sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name); + if (err) + goto out2; + + kobject_uevent(&p->kobj, KOBJ_ADD); + return 0; + out2: + kobject_del(&p->kobj); + out1: return err; } + +void br_sysfs_removeif(struct net_bridge_port *p) +{ + pr_debug("br_sysfs_removeif\n"); + sysfs_remove_link(&p->br->ifobj, p->dev->name); + kobject_uevent(&p->kobj, KOBJ_REMOVE); + kobject_del(&p->kobj); +} + +void br_sysfs_freeif(struct net_bridge_port *p) +{ + pr_debug("br_sysfs_freeif\n"); + kobject_put(&p->kobj); +} diff --git a/trunk/net/core/rtnetlink.c b/trunk/net/core/rtnetlink.c index eca2976abb25..8700379685e0 100644 --- a/trunk/net/core/rtnetlink.c +++ b/trunk/net/core/rtnetlink.c @@ -455,7 +455,7 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) if (!skb) return; - if (rtnetlink_fill_ifinfo(skb, dev, type, 0, 0, change, 0) < 0) { + if (rtnetlink_fill_ifinfo(skb, dev, type, current->pid, 0, change, 0) < 0) { kfree_skb(skb); return; } diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c index 3ffa60dadc0c..95b9d81ac488 100644 --- a/trunk/net/ipv4/devinet.c +++ b/trunk/net/ipv4/devinet.c @@ -1135,7 +1135,7 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa) if (!skb) netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS); - else if (inet_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) { + else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) { kfree_skb(skb); netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL); } else { diff --git a/trunk/net/ipv4/fib_semantics.c b/trunk/net/ipv4/fib_semantics.c index 0f4145babb14..ef4724de7350 100644 --- a/trunk/net/ipv4/fib_semantics.c +++ b/trunk/net/ipv4/fib_semantics.c @@ -1045,7 +1045,7 @@ fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm, } nl->nlmsg_flags = NLM_F_REQUEST; - nl->nlmsg_pid = 0; + nl->nlmsg_pid = current->pid; nl->nlmsg_seq = 0; nl->nlmsg_len = NLMSG_LENGTH(sizeof(*rtm)); if (cmd == SIOCDELRT) { diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index e9a54ae7d690..a97ed5416c28 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -456,8 +456,7 @@ void tcp_rcv_space_adjust(struct sock *sk) tp->rcvq_space.space = space; - if (sysctl_tcp_moderate_rcvbuf && - !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) { + if (sysctl_tcp_moderate_rcvbuf) { int new_clamp = space; /* Receive space grows, normalize in order to diff --git a/trunk/net/irda/irda_device.c b/trunk/net/irda/irda_device.c index e3debbdb67f5..890bac0d4a56 100644 --- a/trunk/net/irda/irda_device.c +++ b/trunk/net/irda/irda_device.c @@ -343,12 +343,12 @@ static void irda_task_timer_expired(void *data) static void irda_device_setup(struct net_device *dev) { dev->hard_header_len = 0; - dev->addr_len = LAP_ALEN; + dev->addr_len = 0; dev->type = ARPHRD_IRDA; dev->tx_queue_len = 8; /* Window size + 1 s-frame */ - memset(dev->broadcast, 0xff, LAP_ALEN); + memset(dev->broadcast, 0xff, 4); dev->mtu = 2048; dev->flags = IFF_NOARP; diff --git a/trunk/net/irda/irnet/irnet_irda.c b/trunk/net/irda/irnet/irnet_irda.c index f65c7a83bc5c..07ec326c71f5 100644 --- a/trunk/net/irda/irnet/irnet_irda.c +++ b/trunk/net/irda/irnet/irnet_irda.c @@ -696,7 +696,7 @@ irnet_daddr_to_dname(irnet_socket * self) { /* Yes !!! Get it.. */ strlcpy(self->rname, discoveries[i].info, sizeof(self->rname)); - self->rname[sizeof(self->rname) - 1] = '\0'; + self->rname[NICKNAME_MAX_LEN + 1] = '\0'; DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n", self->daddr, self->rname); kfree(discoveries); diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index 6b9772d95872..2101b45d2ec6 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -702,8 +702,7 @@ struct sock *netlink_getsockbyfilp(struct file *filp) * 0: continue * 1: repeat lookup - reference dropped while waiting for socket memory. */ -int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, - long timeo, struct sock *ssk) +int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo) { struct netlink_sock *nlk; @@ -713,7 +712,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, test_bit(0, &nlk->state)) { DECLARE_WAITQUEUE(wait, current); if (!timeo) { - if (!ssk || nlk_sk(ssk)->pid == 0) + if (!nlk->pid) netlink_overrun(sk); sock_put(sk); kfree_skb(skb); @@ -798,7 +797,7 @@ int netlink_unicast(struct sock *ssk, struct sk_buff *skb, u32 pid, int nonblock kfree_skb(skb); return PTR_ERR(sk); } - err = netlink_attachskb(sk, skb, nonblock, timeo, ssk); + err = netlink_attachskb(sk, skb, nonblock, timeo); if (err == 1) goto retry; if (err) diff --git a/trunk/scripts/kconfig/Makefile b/trunk/scripts/kconfig/Makefile index 5760e057ecba..d64aae85c378 100644 --- a/trunk/scripts/kconfig/Makefile +++ b/trunk/scripts/kconfig/Makefile @@ -123,7 +123,17 @@ KBUILD_HAVE_NLS := $(shell \ then echo yes ; \ else echo no ; fi) ifeq ($(KBUILD_HAVE_NLS),no) -HOSTCFLAGS += -DKBUILD_NO_NLS + HOSTCFLAGS += -DKBUILD_NO_NLS +else + KBUILD_NEED_LINTL := $(shell \ + if echo -e "\#include \nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \ + $(HOSTCC) $(HOSTCFLAGS) -x c - -o /dev/null> /dev/null 2>&1 ; \ + then echo no ; \ + else echo yes ; fi) + ifeq ($(KBUILD_NEED_LINTL),yes) + HOSTLOADLIBES_conf += -lintl + HOSTLOADLIBES_mconf += -lintl + endif endif # generated files seem to need this to find local include files