]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@g5.osdl.org>
Sun, 12 Mar 2006 22:56:02 +0000 (14:56 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 12 Mar 2006 22:56:02 +0000 (14:56 -0800)
* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] iwmmxt thread state alignment
  [ARM] 3350/1: Enable 1-wire on ARM
  [ARM] 3356/1: Workaround for the ARM1136 I-cache invalidation problem
  [ARM] 3355/1: NSLU2: remove propmt depends
  [ARM] 3354/1: NAS100d: fix power led handling
  [ARM] Fix muldi3.S

176 files changed:
CREDITS
Documentation/dvb/bt8xx.txt
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
Documentation/video4linux/CARDLIST.saa7134
MAINTAINERS
Makefile
arch/alpha/kernel/irq.c
arch/i386/kernel/Makefile
arch/i386/kernel/acpi/Makefile
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/earlyquirk.c
arch/i386/kernel/cpu/common.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/machine_kexec.c
arch/i386/kernel/nmi.c
arch/i386/kernel/setup.c
arch/ia64/configs/gensparse_defconfig
arch/ia64/kernel/cyclone.c
arch/ia64/kernel/ivt.S
arch/ia64/kernel/mca_drv.c
arch/ia64/sn/kernel/sn2/sn2_smp.c
arch/ia64/sn/kernel/tiocx.c
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/arc/arc_con.c
arch/mips/kernel/irq-mv6434x.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/mm/tlbex.c
arch/mips/momentum/jaguar_atx/prom.c
arch/mips/momentum/jaguar_atx/setup.c
arch/mips/momentum/ocelot_c/irq.c
arch/mips/momentum/ocelot_c/prom.c
arch/mips/momentum/ocelot_c/setup.c
arch/mips/pci/pci-ocelot-c.c
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/ptrace.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/kernel/systbl.S
arch/powerpc/kernel/traps.c
arch/powerpc/platforms/powermac/pfunc_base.c
arch/powerpc/platforms/powermac/pfunc_core.c
arch/powerpc/platforms/powermac/smp.c
arch/ppc/kernel/asm-offsets.c
arch/ppc/kernel/entry.S
arch/s390/lib/spinlock.c
arch/s390/lib/uaccess.S
arch/s390/lib/uaccess64.S
arch/sh/Kconfig
arch/x86_64/kernel/machine_kexec.c
arch/xtensa/Kconfig
block/ll_rw_blk.c
drivers/block/DAC960.c
drivers/char/mmtimer.c
drivers/edac/Kconfig
drivers/edac/edac_mc.c
drivers/firmware/dcdbas.c
drivers/input/mouse/psmouse-base.c
drivers/macintosh/windfarm_core.c
drivers/macintosh/windfarm_cpufreq_clamp.c
drivers/macintosh/windfarm_lm75_sensor.c
drivers/macintosh/windfarm_max6690_sensor.c
drivers/macintosh/windfarm_pm112.c
drivers/md/raid1.c
drivers/media/dvb/b2c2/flexcop-fe-tuner.c
drivers/media/dvb/bt8xx/bt878.c
drivers/media/dvb/bt8xx/dst.c
drivers/media/dvb/dvb-core/demux.h
drivers/media/dvb/dvb-usb/cxusb.c
drivers/media/dvb/dvb-usb/dvb-usb-init.c
drivers/media/dvb/dvb-usb/dvb-usb.h
drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/mt312.c
drivers/media/dvb/frontends/mt312.h
drivers/media/dvb/frontends/stv0297.c
drivers/media/dvb/ttpci/av7110.c
drivers/media/dvb/ttpci/av7110_hw.c
drivers/media/dvb/ttpci/av7110_ir.c
drivers/media/video/cpia.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/saa7115.c
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/tda8290.c
drivers/media/video/tuner-core.c
drivers/media/video/videocodec.h
drivers/media/video/zr36050.c
drivers/media/video/zr36060.c
drivers/media/video/zr36120_i2c.c
drivers/misc/ibmasm/ibmasm.h
drivers/net/3c509.c
drivers/net/Kconfig
drivers/net/de620.c
drivers/net/dl2k.c
drivers/net/e1000/e1000_main.c
drivers/net/sky2.c
drivers/net/tg3.c
drivers/net/tulip/de2104x.c
drivers/net/tun.c
drivers/pcmcia/ds.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_genhd.c
drivers/s390/block/dasd_int.h
drivers/s390/block/dasd_proc.c
drivers/s390/net/smsgiucv.c
drivers/serial/ioc4_serial.c
drivers/serial/serial_core.c
drivers/serial/sn_console.c
drivers/video/arcfb.c
drivers/video/aty/aty128fb.c
drivers/video/aty/radeon_monitor.c
drivers/video/backlight/backlight.c
drivers/video/backlight/lcd.c
drivers/video/imsttfb.c
drivers/video/intelfb/intelfbdrv.c
drivers/video/kyro/STG4000VTG.c
drivers/video/neofb.c
drivers/video/s1d13xxxfb.c
drivers/video/savage/savagefb_driver.c
drivers/video/tdfxfb.c
fs/9p/9p.c
fs/9p/trans_fd.c
fs/9p/vfs_inode.c
fs/9p/vfs_super.c
fs/compat_ioctl.c
fs/dcache.c
fs/ext3/inode.c
fs/ext3/namei.c
fs/file_table.c
fs/jffs2/nodelist.c
fs/jffs2/readinode.c
fs/jffs2/scan.c
fs/namei.c
fs/partitions/ibm.c
fs/pipe.c
fs/udf/inode.c
fs/udf/super.c
fs/udf/udf_sb.h
include/asm-generic/unaligned.h
include/asm-i386/apic.h
include/asm-m68k/atomic.h
include/asm-mips/vga.h
include/asm-powerpc/cputable.h
include/asm-powerpc/eeh.h
include/asm-powerpc/kexec.h
include/asm-powerpc/pgtable-4k.h
include/asm-powerpc/thread_info.h
include/linux/compat_ioctl.h
include/linux/file.h
include/linux/fs.h
include/linux/gfp.h
include/linux/percpu_counter.h
include/linux/rcupdate.h
include/linux/sched.h
kernel/fork.c
kernel/rcupdate.c
kernel/sched.c
kernel/sysctl.c
mm/memory_hotplug.c
mm/mempolicy.c
mm/page_alloc.c
mm/rmap.c
mm/slab.c
mm/swap.c
mm/vmscan.c
net/bridge/netfilter/Makefile
net/ipv4/tcp_output.c
net/ipv6/addrconf.c
net/unix/af_unix.c
security/selinux/hooks.c

diff --git a/CREDITS b/CREDITS
index 6957ef4efab3a2fd60732456e5c515bee68bc57e..64511e2abc8e5ab94350ea1fc978901301ff90e2 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -3643,11 +3643,9 @@ S: Cambridge. CB1 7EG
 S: England
 
 N: Chris Wright
-E: chrisw@osdl.org
+E: chrisw@sous-sol.org
 D: hacking on LSM framework and security modules.
-S: c/o OSDL
-S: 12725 SW Millikan Way, Suite 400
-S: Beaverton, OR 97005
+S: Portland, OR
 S: USA
 
 N: Michal Wronski
index df6c05453cb517266448c5f2e81e1fc0627f4097..52ed462061dfdfc1ada13c2708f718755b07aeef 100644 (file)
@@ -111,4 +111,8 @@ source:  linux/Documentation/video4linux/CARDLIST.bttv
 If you have problems with this please do ask on the mailing list.
 
 --
-Authors: Richard Walker, Jamie Honan, Michael Hunold, Manu Abraham
+Authors: Richard Walker,
+        Jamie Honan,
+        Michael Hunold,
+        Manu Abraham,
+        Michael Krufky
index be5ae600f5337dbb14daa8d4cace110486e14f79..81bc51369f59a413108fd8b150c3090541ba49f8 100644 (file)
@@ -180,3 +180,12 @@ Why:       These events are not correct, and do not properly let userspace know
        when a file system has been mounted or unmounted.  Userspace should
        poll the /proc/mounts file instead to detect this properly.
 Who:   Greg Kroah-Hartman <gregkh@suse.de>
+
+---------------------------
+
+What:  Support for NEC DDB5074 and DDB5476 evaluation boards.
+When:  June 2006
+Why:   Board specific code doesn't build anymore since ~2.6.0 and no
+       users have complained indicating there is no more need for these
+       boards.  This should really be considered a last call.
+Who:   Ralf Baechle <ralf@linux-mips.org>
index 75205391b335f85c9b8a599d0d3b4c0dd1a8b41b..fc99075e0af47f0b73a2ae2dfb7d19920c604dea 100644 (file)
@@ -335,6 +335,12 @@ running once the system is up.
                        timesource is not avalible, it defaults to PIT.
                        Format: { pit | tsc | cyclone | pmtmr }
 
+       disable_8254_timer
+       enable_8254_timer
+                       [IA32/X86_64] Disable/Enable interrupt 0 timer routing
+                       over the 8254 in addition to over the IO-APIC. The
+                       kernel tries to set a sensible default.
+
        hpet=           [IA-32,HPET] option to disable HPET and use PIT.
                        Format: disable
 
@@ -1284,6 +1290,19 @@ running once the system is up.
                        New name for the ramdisk parameter.
                        See Documentation/ramdisk.txt.
 
+       rcu.blimit=     [KNL,BOOT] Set maximum number of finished
+                       RCU callbacks to process in one batch.
+
+       rcu.qhimark=    [KNL,BOOT] Set threshold of queued
+                       RCU callbacks over which batch limiting is disabled.
+
+       rcu.qlowmark=   [KNL,BOOT] Set threshold of queued
+                       RCU callbacks below which batch limiting is re-enabled.
+
+       rcu.rsinterval= [KNL,BOOT,SMP] Set the number of additional
+                       RCU callbacks to queued before forcing reschedule
+                       on all cpus.
+
        rdinit=         [KNL]
                        Format: <full_path>
                        Run specified binary instead of /init from the ramdisk,
index 8a352597830ffccc1eb942ae0020bfcb08b10ea6..da4fb890165f9de33e0d61e57acdbd1779db6230 100644 (file)
@@ -13,7 +13,7 @@
  12 -> Medion 7134                              [16be:0003]
  13 -> Typhoon TV+Radio 90031
  14 -> ELSA EX-VISION 300TV                     [1048:226b]
- 15 -> ELSA EX-VISION 500TV                     [1048:226b]
+ 15 -> ELSA EX-VISION 500TV                     [1048:226a]
  16 -> ASUS TV-FM 7134                          [1043:4842,1043:4830,1043:4840]
  17 -> AOPEN VA1000 POWER                       [1131:7133]
  18 -> BMK MPEX No Tuner
@@ -75,7 +75,7 @@
  74 -> LifeView FlyTV Platinum Mini2            [14c0:1212]
  75 -> AVerMedia AVerTVHD MCE A180              [1461:1044]
  76 -> SKNet MonsterTV Mobile                   [1131:4ee9]
- 77 -> Pinnacle PCTV 110i (saa7133)             [11bd:002e]
+ 77 -> Pinnacle PCTV 40i/50i/110i (saa7133)     [11bd:002e]
  78 -> ASUSTeK P7131 Dual                       [1043:4862]
  79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B)
  80 -> ASUS Digimatrix TV                       [1043:0210]
index 9c592aa0280ca1d0ca8c0c43a85295319b676be3..3d7d30dc5439b602cfad8f727345bd7de06dd550 100644 (file)
@@ -838,7 +838,6 @@ S:  Maintained
 
 DVB SUBSYSTEM AND DRIVERS
 P:     LinuxTV.org Project
-M:     mchehab@infradead.org
 M:     v4l-dvb-maintainer@linuxtv.org
 L:     linux-dvb@linuxtv.org (subscription required)
 W:     http://linuxtv.org/
@@ -1632,8 +1631,8 @@ S:        Supported
 
 LINUX SECURITY MODULE (LSM) FRAMEWORK
 P:     Chris Wright
-M:     chrisw@osdl.org
-L:     linux-security-module@wirex.com
+M:     chrisw@sous-sol.org
+L:     linux-security-module@vger.kernel.org
 W:     http://lsm.immunix.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
 S:     Supported
index 46eea76bc57088c14b427800354df5b5cb98b8b5..ac54c03c1b1a9ccaa002108d6748a18d23bea9f3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 16
-EXTRAVERSION =-rc5
+EXTRAVERSION =-rc6
 NAME=Sliding Snow Leopard
 
 # *DOCUMENTATION*
@@ -905,7 +905,7 @@ define filechk_version.h
        )
 endef
 
-include/linux/version.h: $(srctree)/Makefile .config FORCE
+include/linux/version.h: $(srctree)/Makefile .config .kernelrelease FORCE
        $(call filechk,version.h)
 
 # ---------------------------------------------------------------------------
index 9006063e73691da7b68449955a135f7c9317e2cd..da677f829f7689966bf09aeda6d89fc4b6a876d1 100644 (file)
@@ -151,8 +151,13 @@ handle_irq(int irq, struct pt_regs * regs)
        }
 
        irq_enter();
+       /*
+        * __do_IRQ() must be called with IPL_MAX. Note that we do not
+        * explicitly enable interrupts afterwards - some MILO PALcode
+        * (namely LX164 one) seems to have severe problems with RTI
+        * at IPL 0.
+        */
        local_irq_disable();
        __do_IRQ(irq, regs);
-       local_irq_enable();
        irq_exit();
 }
index 53bb9a79e274e5cf685edf4ffaa89c840a5954bd..65656c033d70d6eb93dd4e9c080bd1151161cdd3 100644 (file)
@@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
 
 obj-y                          += cpu/
 obj-y                          += timers/
-obj-$(CONFIG_ACPI)             += acpi/
+obj-y                          += acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)  += reboot.o
 obj-$(CONFIG_MCA)              += mca.o
 obj-$(CONFIG_X86_MSR)          += msr.o
index d51c7313cae8ac621c69f4be28718142d12b370e..7e9ac99354f43212bbbb6aa959642b0ec7dce91c 100644 (file)
@@ -1,4 +1,4 @@
-obj-y                          := boot.o
+obj-$(CONFIG_ACPI)             += boot.o
 obj-$(CONFIG_X86_IO_APIC)      += earlyquirk.o
 obj-$(CONFIG_ACPI_SLEEP)       += sleep.o wakeup.o
 
index 79577f0ace98847ee39a4f7ad4c9842f3ea88ec6..f1a21945963d77b80f125db518a432580647f10a 100644 (file)
@@ -1111,9 +1111,6 @@ int __init acpi_boot_table_init(void)
                disable_acpi();
                return error;
        }
-#ifdef __i386__
-       check_acpi_pci();
-#endif
 
        acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
 
index f1b9d2a46dab860c0cbf100e1bf6b9b0b220c024..2e3b643a4dc4df57552562015349c7657ca5b5d6 100644 (file)
@@ -7,14 +7,22 @@
 #include <linux/pci.h>
 #include <asm/pci-direct.h>
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 static int __init check_bridge(int vendor, int device)
 {
+#ifdef CONFIG_ACPI
        /* According to Nvidia all timer overrides are bogus. Just ignore
           them all. */
        if (vendor == PCI_VENDOR_ID_NVIDIA) {
                acpi_skip_timer_override = 1;
        }
+#endif
+       if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) {
+               timer_over_8254 = 0;
+               printk(KERN_INFO "ATI board detected. Disabling timer routing "
+                               "over 8254.\n");
+       }
        return 0;
 }
 
index 4ecd4b326ded5400a5e3641560c59c5e8621b6cd..e6bd095ae1085e75234d10aebdec2ac3d2190e43 100644 (file)
@@ -278,10 +278,10 @@ void __devinit generic_identify(struct cpuinfo_x86 * c)
                        c->x86_capability[4] = excap;
                        c->x86 = (tfms >> 8) & 15;
                        c->x86_model = (tfms >> 4) & 15;
-                       if (c->x86 == 0xf) {
+                       if (c->x86 == 0xf)
                                c->x86 += (tfms >> 20) & 0xff;
+                       if (c->x86 >= 0x6)
                                c->x86_model += ((tfms >> 16) & 0xF) << 4;
-                       } 
                        c->x86_mask = tfms & 15;
                } else {
                        /* Have CPUID level 0 only - unheard of */
index 235822b3f41b1db6d8a758ec0c2abd4f9c0c6726..39d9a5fa907e2eb6d40f098fcac9bb6d1ce6b9ef 100644 (file)
@@ -51,6 +51,8 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
 
+int timer_over_8254 __initdata = 1;
+
 /*
  *     Is the SiS APIC rmw bug present ?
  *     -1 = don't know, 0 = no, 1 = yes
@@ -2267,7 +2269,8 @@ static inline void check_timer(void)
        apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
        init_8259A(1);
        timer_ack = 1;
-       enable_8259A_irq(0);
+       if (timer_over_8254 > 0)
+               enable_8259A_irq(0);
 
        pin1  = find_isa_irq_pin(0, mp_INT);
        apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2392,6 +2395,20 @@ void __init setup_IO_APIC(void)
                print_IO_APIC();
 }
 
+static int __init setup_disable_8254_timer(char *s)
+{
+       timer_over_8254 = -1;
+       return 1;
+}
+static int __init setup_enable_8254_timer(char *s)
+{
+       timer_over_8254 = 2;
+       return 1;
+}
+
+__setup("disable_8254_timer", setup_disable_8254_timer);
+__setup("enable_8254_timer", setup_enable_8254_timer);
+
 /*
  *     Called after all the initialization is done. If we didnt find any
  *     APIC bugs then we can allow the modify fast path
index a912fed4848273381ce5d0d3025dc81a1c7deff4..f73d7374a2ba8db6cd903bc4e316df2ecdb4260b 100644 (file)
@@ -116,13 +116,13 @@ static void load_segments(void)
        __asm__ __volatile__ (
                "\tljmp $"STR(__KERNEL_CS)",$1f\n"
                "\t1:\n"
-               "\tmovl $"STR(__KERNEL_DS)",%eax\n"
-               "\tmovl %eax,%ds\n"
-               "\tmovl %eax,%es\n"
-               "\tmovl %eax,%fs\n"
-               "\tmovl %eax,%gs\n"
-               "\tmovl %eax,%ss\n"
-               );
+               "\tmovl $"STR(__KERNEL_DS)",%%eax\n"
+               "\tmovl %%eax,%%ds\n"
+               "\tmovl %%eax,%%es\n"
+               "\tmovl %%eax,%%fs\n"
+               "\tmovl %%eax,%%gs\n"
+               "\tmovl %%eax,%%ss\n"
+               ::: "eax", "memory");
 #undef STR
 #undef __STR
 }
index 63f39a7e2c96b0e3db1ce48ab73696e95db60a0c..be87c5e2ee9584747e05b57f8ce60ee2b29d93ed 100644 (file)
@@ -357,7 +357,7 @@ static void clear_msr_range(unsigned int base, unsigned int n)
                wrmsr(base+i, 0, 0);
 }
 
-static inline void write_watchdog_counter(const char *descr)
+static void write_watchdog_counter(const char *descr)
 {
        u64 count = (u64)cpu_khz * 1000;
 
@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
                         * die_nmi will return ONLY if NOTIFY_STOP happens..
                         */
                        die_nmi(regs, "NMI Watchdog detected LOCKUP");
-
+       } else {
                last_irq_sums[cpu] = sum;
                alert_counter[cpu] = 0;
        }
index 51e513b4f72d02db2e5c2dcac9b09d905c9854ed..ab62a9f4701edd22c69910ae05b71edde14bdd99 100644 (file)
@@ -1599,6 +1599,10 @@ void __init setup_arch(char **cmdline_p)
        if (efi_enabled)
                efi_map_memmap();
 
+#ifdef CONFIG_X86_IO_APIC
+       check_acpi_pci();       /* Checks more than just ACPI actually */
+#endif
+
 #ifdef CONFIG_ACPI
        /*
         * Parse the ACPI tables for possible boot-time SMP configuration.
index 184678fe7832aba13d44ca5d89348b67841c49f4..744fd2f79f6166c4e95ecaaacab875807ab1ffc5 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.16-rc5
-# Mon Feb 27 16:15:43 2006
+# Thu Mar  2 16:39:10 2006
 #
 
 #
@@ -312,7 +312,13 @@ CONFIG_FW_LOADER=m
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
 
 #
 # Block devices
@@ -357,6 +363,7 @@ CONFIG_BLK_DEV_IDESCSI=m
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPNP is not set
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -525,6 +532,7 @@ CONFIG_DUMMY=m
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_NET_SB1000 is not set
 
 #
 # ARCnet devices
index 6ade3790ce07967ae09a3d65a1810c399ea5495c..e00b21514f7c665e97e1374d41c323ef915c1d57 100644 (file)
@@ -36,7 +36,7 @@ int __init init_cyclone_clock(void)
        u32* volatile cyclone_timer;    /* Cyclone MPMC0 register */
 
        if (!use_cyclone)
-               return -ENODEV;
+               return 0;
 
        printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n");
 
index 9f80569a32b0acf6f96bed4d4c5161d08ace26ea..dcd906fe574949f032ff449fe2f46d8527bdba1d 100644 (file)
@@ -561,11 +561,12 @@ ENTRY(dirty_bit)
        ;;                                      // avoid RAW on r18
        mov ar.ccv=r18                          // set compare value for cmpxchg
        or r25=_PAGE_D|_PAGE_A,r18              // set the dirty and accessed bits
+       tbit.z p7,p6 = r18,_PAGE_P_BIT          // Check present bit
        ;;
-       cmpxchg8.acq r26=[r17],r25,ar.ccv
+(p6)   cmpxchg8.acq r26=[r17],r25,ar.ccv       // Only update if page is present
        mov r24=PAGE_SHIFT<<2
        ;;
-       cmp.eq p6,p7=r26,r18
+(p6)   cmp.eq p6,p7=r26,r18                    // Only compare if page is present
        ;;
 (p6)   itc.d r25                               // install updated PTE
        ;;
@@ -626,11 +627,12 @@ ENTRY(iaccess_bit)
        ;;
        mov ar.ccv=r18                          // set compare value for cmpxchg
        or r25=_PAGE_A,r18                      // set the accessed bit
+       tbit.z p7,p6 = r18,_PAGE_P_BIT          // Check present bit
        ;;
-       cmpxchg8.acq r26=[r17],r25,ar.ccv
+(p6)   cmpxchg8.acq r26=[r17],r25,ar.ccv       // Only if page present
        mov r24=PAGE_SHIFT<<2
        ;;
-       cmp.eq p6,p7=r26,r18
+(p6)   cmp.eq p6,p7=r26,r18                    // Only if page present
        ;;
 (p6)   itc.i r25                               // install updated PTE
        ;;
@@ -680,11 +682,12 @@ ENTRY(daccess_bit)
        ;;                                      // avoid RAW on r18
        mov ar.ccv=r18                          // set compare value for cmpxchg
        or r25=_PAGE_A,r18                      // set the dirty bit
+       tbit.z p7,p6 = r18,_PAGE_P_BIT          // Check present bit
        ;;
-       cmpxchg8.acq r26=[r17],r25,ar.ccv
+(p6)   cmpxchg8.acq r26=[r17],r25,ar.ccv       // Only if page is present
        mov r24=PAGE_SHIFT<<2
        ;;
-       cmp.eq p6,p7=r26,r18
+(p6)   cmp.eq p6,p7=r26,r18                    // Only if page is present
        ;;
 (p6)   itc.d r25                               // install updated PTE
        /*
index 8fd93afa75a7bea9a2b687d70537ce21c8094164..e883d85906db5aa583db42f3dcbb9146e40af1a6 100644 (file)
@@ -123,8 +123,9 @@ mca_page_isolate(unsigned long paddr)
 void
 mca_handler_bh(unsigned long paddr)
 {
-       printk(KERN_DEBUG "OS_MCA: process [pid: %d](%s) encounters MCA.\n",
-               current->pid, current->comm);
+       printk(KERN_ERR
+               "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n",
+               current->pid, current->comm, paddr);
 
        spin_lock(&mca_bh_lock);
        switch (mca_page_isolate(paddr)) {
@@ -132,7 +133,7 @@ mca_handler_bh(unsigned long paddr)
                printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr);
                break;
        case ISOLATE_NG:
-               printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr);
+               printk(KERN_CRIT "Page isolation: ( %lx ) failure.\n", paddr);
                break;
        default:
                break;
@@ -567,10 +568,15 @@ recover_from_processor_error(int platform, slidx_table_t *slidx,
                return 0;
 
        /*
-        * If there is no bus error, record is weird but we need not to recover.
+        * The cache check and bus check bits have four possible states
+        *   cc bc
+        *    0  0      Weird record, not recovered
+        *    1  0      Cache error, not recovered
+        *    0  1      I/O error, attempt recovery
+        *    1  1      Memory error, attempt recovery
         */
        if (psp->bc == 0 || pbci == NULL)
-               return 1;
+               return 0;
 
        /*
         * Sorry, we cannot handle so many.
index 24eefb2fc55ffd56360209316e6c9b6a1f421e2a..b2e1e746b47fca6ebbda649e50077ce56127c2f2 100644 (file)
@@ -446,7 +446,7 @@ static struct proc_dir_entry *proc_sn2_ptc;
 static int __init sn2_ptc_init(void)
 {
        if (!ia64_platform_is("sn2"))
-               return -ENOSYS;
+               return 0;
 
        if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) {
                printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
index 8a56f8b5ffa2243d633f06dae80f7d0e53056e55..99cb28e74295476bc7e074034491f84fcbb77067 100644 (file)
@@ -484,7 +484,7 @@ static int __init tiocx_init(void)
        int found_tiocx_device = 0;
 
        if (!ia64_platform_is("sn2"))
-               return -ENODEV;
+               return 0;
 
        bus_register(&tiocx_bus_type);
 
index 767de847b4abd3ac15c703e929a3e68ee4d34007..3a0f89d2c8dc91586e6e189cf9d0eaa2082e916e 100644 (file)
@@ -1053,6 +1053,7 @@ config CPU_MIPS32_R1
        depends on SYS_HAS_CPU_MIPS32_R1
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 1 or later of the
          MIPS32 architecture.  Most modern embedded systems with a 32-bit
@@ -1069,6 +1070,7 @@ config CPU_MIPS32_R2
        depends on SYS_HAS_CPU_MIPS32_R2
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 2 or later of the
          MIPS32 architecture.  Most modern embedded systems with a 32-bit
@@ -1082,6 +1084,7 @@ config CPU_MIPS64_R1
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 1 or later of the
          MIPS64 architecture.  Many modern embedded systems with a 64-bit
@@ -1099,6 +1102,7 @@ config CPU_MIPS64_R2
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 2 or later of the
          MIPS64 architecture.  Many modern embedded systems with a 64-bit
index 38c0f3360d517aa05794879a8a2a342ca1d86f18..fe9da16f3a4012ecafd867f6f9ad5c6a3284b59e 100644 (file)
@@ -95,6 +95,7 @@ endif
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
 cflags-y                       += -G 0 -mno-abicalls -fno-pic -pipe
+cflags-y                       += -msoft-float
 LDFLAGS_vmlinux                        += -G 0 -static -n -nostdlib
 MODFLAGS                       += -mlong-calls
 
index 51785a6a7328905ee871acc81d1a4a28c14d7d32..bc32fe64f42add26fa0100b2c4592b58a8ce9231 100644 (file)
@@ -24,7 +24,7 @@ static void prom_console_write(struct console *co, const char *s,
        }
 }
 
-static int __init prom_console_setup(struct console *co, char *options)
+static int prom_console_setup(struct console *co, char *options)
 {
        return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
 }
index 0ac067f45cf545939c9272f54320d513664ac150..0613f1f36b1bb0f9dabb0adfcbfbf98b5d378e3c 100644 (file)
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <asm/ptrace.h>
-#include <linux/sched.h>
 #include <linux/kernel_stat.h>
+#include <linux/mv643xx.h>
+#include <linux/sched.h>
+
+#include <asm/ptrace.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <linux/mv643xx.h>
+#include <asm/marvell.h>
 
 static unsigned int irq_base;
 
index ff699dbb99f730b0a3da89883f96788ee254d160..2ad0cedf29fee2236c32d7e1ec1cd3ac34b0b0ad 100644 (file)
@@ -106,6 +106,9 @@ SECTIONS
   .con_initcall.init : { *(.con_initcall.init) }
   __con_initcall_end = .;
   SECURITY_INIT
+    /* .exit.text is discarded at runtime, not link time, to deal with
+     references from .rodata */
+  .exit.text : { *(.exit.text) }
   . = ALIGN(_PAGE_SIZE);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
@@ -133,7 +136,6 @@ SECTIONS
 
   /* Sections to be discarded */
   /DISCARD/ : {
-        *(.exit.text)
         *(.exit.data)
         *(.exitcall.exit)
 
index 0f9485806bac8b12e67f225145df92ca568304bd..ac4f4bfaae50af41ddf5184cd4e87e4c3752536f 100644 (file)
@@ -280,69 +280,69 @@ static void __init build_insn(u32 **buf, enum opcode opc, ...)
 }
 
 #define I_u1u2u3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, unsigned int c)                 \
        {                                                       \
                build_insn(buf, insn##op, a, b, c);             \
        }
 
 #define I_u2u1u3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, unsigned int c)                 \
        {                                                       \
                build_insn(buf, insn##op, b, a, c);             \
        }
 
 #define I_u3u1u2(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, unsigned int c)                 \
        {                                                       \
                build_insn(buf, insn##op, b, c, a);             \
        }
 
 #define I_u1u2s3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, signed int c)                   \
        {                                                       \
                build_insn(buf, insn##op, a, b, c);             \
        }
 
 #define I_u2s3u1(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                signed int b, unsigned int c)                   \
        {                                                       \
                build_insn(buf, insn##op, c, a, b);             \
        }
 
 #define I_u2u1s3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, signed int c)                   \
        {                                                       \
                build_insn(buf, insn##op, b, a, c);             \
        }
 
 #define I_u1u2(op)                                             \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b)                                 \
        {                                                       \
                build_insn(buf, insn##op, a, b);                \
        }
 
 #define I_u1s2(op)                                             \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                signed int b)                                   \
        {                                                       \
                build_insn(buf, insn##op, a, b);                \
        }
 
 #define I_u1(op)                                               \
-       static inline void i##op(u32 **buf, unsigned int a)     \
+       static inline void __init i##op(u32 **buf, unsigned int a)      \
        {                                                       \
                build_insn(buf, insn##op, a);                   \
        }
 
 #define I_0(op)                                                        \
-       static inline void i##op(u32 **buf)                     \
+       static inline void __init i##op(u32 **buf)              \
        {                                                       \
                build_insn(buf, insn##op);                      \
        }
@@ -623,42 +623,42 @@ static __init int __attribute__((unused)) insn_has_bdelay(struct reloc *rel,
 }
 
 /* convenience functions for labeled branches */
-static void __attribute__((unused)) il_bltz(u32 **p, struct reloc **r,
-                                           unsigned int reg, enum label_id l)
+static void __init __attribute__((unused))
+       il_bltz(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_bltz(p, reg, 0);
 }
 
-static void __attribute__((unused)) il_b(u32 **p, struct reloc **r,
+static void __init __attribute__((unused)) il_b(u32 **p, struct reloc **r,
                                         enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_b(p, 0);
 }
 
-static void il_beqz(u32 **p, struct reloc **r, unsigned int reg,
+static void __init il_beqz(u32 **p, struct reloc **r, unsigned int reg,
                    enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_beqz(p, reg, 0);
 }
 
-static void __attribute__((unused))
+static void __init __attribute__((unused))
 il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_beqzl(p, reg, 0);
 }
 
-static void il_bnez(u32 **p, struct reloc **r, unsigned int reg,
+static void __init il_bnez(u32 **p, struct reloc **r, unsigned int reg,
                    enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_bnez(p, reg, 0);
 }
 
-static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
+static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
                     enum label_id l)
 {
        r_mips_pc16(r, *p, l);
index aae7a802767a5ab1d79df4ba289c40c5ffe59760..1cadaa92946afcf2fa4204aaa6488d290caf9665 100644 (file)
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/bootmem.h>
+#include <linux/mv643xx.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-#include <asm/mv64340.h>
 #include <asm/pmon.h>
 
 #include "jaguar_atx_fpga.h"
index 301d67226d72e4caa9cbb379cddb8b6c5d852927..2699917b640ac40f0ab07a35aacc96898ee35009 100644 (file)
@@ -2,7 +2,7 @@
  * BRIEF MODULE DESCRIPTION
  * Momentum Computer Jaguar-ATX board dependent boot routines
  *
- * Copyright (C) 1996, 1997, 2001, 2004  Ralf Baechle (ralf@linux-mips.org)
+ * Copyright (C) 1996, 1997, 2001, 04, 06  Ralf Baechle (ralf@linux-mips.org)
  * Copyright (C) 2000 RidgeRun, Inc.
  * Copyright (C) 2001 Red Hat, Inc.
  * Copyright (C) 2002 Momentum Computer
@@ -55,6 +55,8 @@
 #include <linux/interrupt.h>
 #include <linux/timex.h>
 #include <linux/vmalloc.h>
+#include <linux/mv643xx.h>
+
 #include <asm/time.h>
 #include <asm/bootinfo.h>
 #include <asm/page.h>
@@ -64,7 +66,6 @@
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
 #include <asm/tlbflush.h>
-#include <asm/mv64340.h>
 
 #include "jaguar_atx_fpga.h"
 
index 300fe8e4fbe83f5b279e8faffbdacd3d8e51018d..a5764bc20e36593df6d96ff6b25c1407106d9c53 100644 (file)
 #include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/bitops.h>
+#include <linux/mv643xx.h>
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/irq_cpu.h>
 #include <asm/mipsregs.h>
-#include <asm/mv64340.h>
 #include <asm/system.h>
 
 extern asmlinkage void ocelot_handle_int(void);
index 5b6809724b15efa987fa2880fa46047bc528af1b..e92364482c7b09b65a276275ef4b649428b82268 100644 (file)
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/bootmem.h>
+#include <linux/mv643xx.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-#include <asm/mv64340.h>
 #include <asm/pmon.h>
 
 #include "ocelot_c_fpga.h"
index 15998d8a934198fce955dc33d18e64169ab41999..bd02e60d037a94ad0768d33077751168d2a593ff 100644 (file)
@@ -54,6 +54,7 @@
 #include <linux/pm.h>
 #include <linux/timex.h>
 #include <linux/vmalloc.h>
+#include <linux/mv643xx.h>
 
 #include <asm/time.h>
 #include <asm/bootinfo.h>
@@ -64,9 +65,9 @@
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
+#include <asm/marvell.h>
 #include <linux/bootmem.h>
 #include <linux/blkdev.h>
-#include <asm/mv64340.h>
 #include "ocelot_c_fpga.h"
 
 unsigned long marvell_base;
@@ -252,22 +253,22 @@ void __init plat_setup(void)
        /* shut down ethernet ports, just to be sure our memory doesn't get
         * corrupted by random ethernet traffic.
         */
-       MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
-       MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
-       MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
-       MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
        do {}
-         while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
+         while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
        do {}
-         while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
+         while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
        do {}
-         while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
+         while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
        do {}
-         while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
-       MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0),
-                MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
-       MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1),
-                MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
+         while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
+       MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0),
+                MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
+       MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1),
+                MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
 
        /* Turn off the Bit-Error LED */
        OCELOT_FPGA_WRITE(0x80, CLR);
index 1d84d36e034d0f58fbc49899f0ae0ebb951cca92..027759f7c904ac38d304d3a471b3982eaff89d37 100644 (file)
@@ -3,15 +3,17 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
+ * Copyright (C) 2004, 06 by Ralf Baechle (ralf@linux-mips.org)
  */
 
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <asm/mv64340.h>
+#include <linux/mv643xx.h>
 
 #include <linux/init.h>
 
+#include <asm/marvell.h>
+
 /*
  * We assume the address ranges have already been setup appropriately by
  * the firmware.  PMON in case of the Ocelot C does that.
index 840aad43a98bd218f5c985214e483b5578d6b763..c9a660e4c2db24d4dd03c46b9ecf0065e405e027 100644 (file)
@@ -92,7 +92,6 @@ int main(void)
 
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
        DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
-       DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
        DEFINE(TI_TASK, offsetof(struct thread_info, task));
 #ifdef CONFIG_PPC32
        DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
index 10696456a4c616d0d3900ec0b6370b9a2cb41402..e4e81374cb9a48011191a85cc75995430e64817f 100644 (file)
@@ -53,8 +53,10 @@ extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
                                 PPC_FEATURE_HAS_MMU)
 #define COMMON_USER_PPC64      (COMMON_USER | PPC_FEATURE_64)
 #define COMMON_USER_POWER4     (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
-#define COMMON_USER_POWER5     (COMMON_USER_PPC64 | PPC_FEATURE_POWER5)
-#define COMMON_USER_POWER5_PLUS        (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS)
+#define COMMON_USER_POWER5     (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
+                                PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
+#define COMMON_USER_POWER5_PLUS        (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
+                                PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
 #define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
                                 PPC_FEATURE_BOOKE)
 
@@ -267,7 +269,8 @@ struct cpu_spec     cpu_specs[] = {
                .cpu_name               = "Cell Broadband Engine",
                .cpu_features           = CPU_FTRS_CELL,
                .cpu_user_features      = COMMON_USER_PPC64 |
-                       PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP,
+                       PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
+                       PPC_FEATURE_SMT,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .cpu_setup              = __setup_cpu_be,
index f20a67261ec730b2c98ef5f0756eaa6301a38bfd..4827ca1ec89b74dfc782b47d921e30172a76200a 100644 (file)
@@ -227,7 +227,7 @@ ret_from_syscall:
        MTMSRD(r10)
        lwz     r9,TI_FLAGS(r12)
        li      r8,-_LAST_ERRNO
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK)
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
        bne-    syscall_exit_work
        cmplw   0,r3,r8
        blt+    syscall_exit_cont
@@ -287,8 +287,10 @@ syscall_dotrace:
 
 syscall_exit_work:
        andi.   r0,r9,_TIF_RESTOREALL
-       bne-    2f
-       cmplw   0,r3,r8
+       beq+    0f
+       REST_NVGPRS(r1)
+       b       2f
+0:     cmplw   0,r3,r8
        blt+    1f
        andi.   r0,r9,_TIF_NOERROR
        bne-    1f
@@ -302,9 +304,7 @@ syscall_exit_work:
 2:     andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
        beq     4f
 
-       /* Clear per-syscall TIF flags if any are set, but _leave_
-       _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
-       yet.  */
+       /* Clear per-syscall TIF flags if any are set.  */
 
        li      r11,_TIF_PERSYSCALL_MASK
        addi    r12,r12,TI_FLAGS
@@ -318,8 +318,13 @@ syscall_exit_work:
        subi    r12,r12,TI_FLAGS
        
 4:     /* Anything which requires enabling interrupts? */
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
-       beq     7f
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
+       beq     ret_from_except
+
+       /* Re-enable interrupts */
+       ori     r10,r10,MSR_EE
+       SYNC
+       MTMSRD(r10)
 
        /* Save NVGPRS if they're not saved already */
        lwz     r4,_TRAP(r1)
@@ -328,71 +333,11 @@ syscall_exit_work:
        SAVE_NVGPRS(r1)
        li      r4,0xc00
        stw     r4,_TRAP(r1)
-
-       /* Re-enable interrupts */
-5:     ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)
-
-       andi.   r0,r9,_TIF_SAVE_NVGPRS
-       bne     save_user_nvgprs
-
-save_user_nvgprs_cont:
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
-       beq     7f
-
+5:
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      do_syscall_trace_leave
-       REST_NVGPRS(r1)
-
-6:     lwz     r3,GPR3(r1)
-       LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
-       SYNC
-       MTMSRD(r10)             /* disable interrupts again */
-       rlwinm  r12,r1,0,0,(31-THREAD_SHIFT)    /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-7:
-       andi.   r0,r9,_TIF_NEED_RESCHED
-       bne     8f
-       lwz     r5,_MSR(r1)
-       andi.   r5,r5,MSR_PR
-       beq     ret_from_except
-       andi.   r0,r9,_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK
-       beq     ret_from_except
-       b       do_user_signal
-8:
-       ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)             /* re-enable interrupts */
-       bl      schedule
-       b       6b
-
-save_user_nvgprs:
-       lwz     r8,TI_SIGFRAME(r12)
-
-.macro savewords start, end
-  1:   stw \start,4*(\start)(r8)
-       .section __ex_table,"a"
-       .align  2
-       .long   1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savewords "(\start+1)",\end
-       .endif
-.endm  
-       savewords 14,31
-       b       save_user_nvgprs_cont
-
-       
-save_user_nvgprs_fault:
-       li      r3,11           /* SIGSEGV */
-       lwz     r4,TI_TASK(r12)
-       bl      force_sigsegv
+       b       ret_from_except_full
 
-       rlwinm  r12,r1,0,0,(31-THREAD_SHIFT)    /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-       b       save_user_nvgprs_cont
-       
 #ifdef SHOW_SYSCALLS
 do_show_syscall:
 #ifdef SHOW_SYSCALLS_TASK
@@ -490,6 +435,14 @@ ppc_clone:
        stw     r0,_TRAP(r1)            /* register set saved */
        b       sys_clone
 
+       .globl  ppc_swapcontext
+ppc_swapcontext:
+       SAVE_NVGPRS(r1)
+       lwz     r0,_TRAP(r1)
+       rlwinm  r0,r0,0,0,30            /* clear LSB to indicate full */
+       stw     r0,_TRAP(r1)            /* register set saved */
+       b       sys_swapcontext
+
 /*
  * Top-level page fault handling.
  * This is in assembler because if do_page_fault tells us that
@@ -683,7 +636,7 @@ user_exc_return:            /* r10 contains MSR_KERNEL here */
        /* Check current_thread_info()->flags */
        rlwinm  r9,r1,0,0,(31-THREAD_SHIFT)
        lwz     r9,TI_FLAGS(r9)
-       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK)
+       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
        bne     do_work
 
 restore_user:
index 388f861b8ed17dfe1e8a0d0496955e35e2254050..24be0cf86d7f75635de6cd81047f06ca832e5c6c 100644 (file)
@@ -160,7 +160,7 @@ syscall_exit:
        mtmsrd  r10,1
        ld      r9,TI_FLAGS(r12)
        li      r11,-_LAST_ERRNO
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_SAVE_NVGPRS|_TIF_NOERROR|_TIF_RESTORE_SIGMASK)
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
        bne-    syscall_exit_work
        cmpld   r3,r11
        ld      r5,_CCR(r1)
@@ -216,8 +216,10 @@ syscall_exit_work:
         If TIF_NOERROR is set, just save r3 as it is. */
 
        andi.   r0,r9,_TIF_RESTOREALL
-       bne-    2f
-       cmpld   r3,r11          /* r10 is -LAST_ERRNO */
+       beq+    0f
+       REST_NVGPRS(r1)
+       b       2f
+0:     cmpld   r3,r11          /* r10 is -LAST_ERRNO */
        blt+    1f
        andi.   r0,r9,_TIF_NOERROR
        bne-    1f
@@ -229,9 +231,7 @@ syscall_exit_work:
 2:     andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
        beq     4f
 
-       /* Clear per-syscall TIF flags if any are set, but _leave_
-       _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
-       yet.  */
+       /* Clear per-syscall TIF flags if any are set.  */
 
        li      r11,_TIF_PERSYSCALL_MASK
        addi    r12,r12,TI_FLAGS
@@ -240,10 +240,9 @@ syscall_exit_work:
        stdcx.  r10,0,r12
        bne-    3b
        subi    r12,r12,TI_FLAGS
-       
-4:     bl      .save_nvgprs
-       /* Anything else left to do? */
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
+
+4:     /* Anything else left to do? */
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
        beq     .ret_from_except_lite
 
        /* Re-enable interrupts */
@@ -251,26 +250,10 @@ syscall_exit_work:
        ori     r10,r10,MSR_EE
        mtmsrd  r10,1
 
-       andi.   r0,r9,_TIF_SAVE_NVGPRS
-       bne     save_user_nvgprs
-
-       /* If tracing, re-enable interrupts and do it */
-save_user_nvgprs_cont: 
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
-       beq     5f
-       
+       bl      .save_nvgprs
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      .do_syscall_trace_leave
-       REST_NVGPRS(r1)
-       clrrdi  r12,r1,THREAD_SHIFT
-
-       /* Disable interrupts again and handle other work if any */
-5:     mfmsr   r10
-       rldicl  r10,r10,48,1
-       rotldi  r10,r10,16
-       mtmsrd  r10,1
-
-       b       .ret_from_except_lite
+       b       .ret_from_except
 
 /* Save non-volatile GPRs, if not already saved. */
 _GLOBAL(save_nvgprs)
@@ -282,51 +265,6 @@ _GLOBAL(save_nvgprs)
        std     r0,_TRAP(r1)
        blr
 
-
-save_user_nvgprs:
-       ld      r10,TI_SIGFRAME(r12)
-       andi.   r0,r9,_TIF_32BIT
-       beq-    save_user_nvgprs_64
-
-       /* 32-bit save to userspace */
-
-.macro savewords start, end
-  1:   stw \start,4*(\start)(r10)
-       .section __ex_table,"a"
-       .align  3
-       .llong  1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savewords "(\start+1)",\end
-       .endif
-.endm  
-       savewords 14,31
-       b       save_user_nvgprs_cont
-
-save_user_nvgprs_64:
-       /* 64-bit save to userspace */
-
-.macro savelongs start, end
-  1:   std \start,8*(\start)(r10)
-       .section __ex_table,"a"
-       .align  3
-       .llong  1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savelongs "(\start+1)",\end
-       .endif
-.endm  
-       savelongs 14,31
-       b       save_user_nvgprs_cont
-
-save_user_nvgprs_fault:
-       li      r3,11           /* SIGSEGV */
-       ld      r4,TI_TASK(r12)
-       bl      .force_sigsegv
-
-       clrrdi  r12,r1,THREAD_SHIFT
-       ld      r9,TI_FLAGS(r12)
-       b       save_user_nvgprs_cont
        
 /*
  * The sigsuspend and rt_sigsuspend system calls can call do_signal
@@ -352,6 +290,16 @@ _GLOBAL(ppc_clone)
        bl      .sys_clone
        b       syscall_exit
 
+_GLOBAL(ppc32_swapcontext)
+       bl      .save_nvgprs
+       bl      .compat_sys_swapcontext
+       b       syscall_exit
+
+_GLOBAL(ppc64_swapcontext)
+       bl      .save_nvgprs
+       bl      .sys_swapcontext
+       b       syscall_exit
+
 _GLOBAL(ret_from_fork)
        bl      .schedule_tail
        REST_NVGPRS(r1)
index d34fe537400e657996521a7cba0025c3febc7bfa..813c2cd194c218dd0d2803c402b9a2e9281b887f 100644 (file)
@@ -978,7 +978,7 @@ static void __init prom_init_mem(void)
                        if (size == 0)
                                continue;
                        prom_debug("    %x %x\n", base, size);
-                       if (base == 0)
+                       if (base == 0 && (RELOC(of_platform) & PLATFORM_LPAR))
                                RELOC(rmo_top) = size;
                        if ((base + size) > RELOC(ram_top))
                                RELOC(ram_top) = base + size;
index 400793c7130466bc535f02fff0acc32db9b833c2..bcb83574335b0e80821bae2e6f78349f90ed7da4 100644 (file)
@@ -561,10 +561,7 @@ void do_syscall_trace_leave(struct pt_regs *regs)
                                   regs->result);
 
        if ((test_thread_flag(TIF_SYSCALL_TRACE)
-#ifdef CONFIG_PPC64
-            || test_thread_flag(TIF_SINGLESTEP)
-#endif
-            )
+            || test_thread_flag(TIF_SINGLESTEP))
            && (current->ptrace & PT_PTRACED))
                do_syscall_trace();
 }
index bd837b5dbf06cd5992ca4129bead41135f13b040..d7a4e814974d8a2e5e5a970b87971592a1ee4094 100644 (file)
@@ -151,10 +151,7 @@ static inline int save_general_regs(struct pt_regs *regs,
        elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
        int i;
 
-       if (!FULL_REGS(regs)) {
-               set_thread_flag(TIF_SAVE_NVGPRS);
-               current_thread_info()->nvgprs_frame = frame->mc_gregs;
-       }
+       WARN_ON(!FULL_REGS(regs));
 
        for (i = 0; i <= PT_RESULT; i ++) {
                if (i == 14 && !FULL_REGS(regs))
@@ -215,15 +212,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
 static inline int save_general_regs(struct pt_regs *regs,
                struct mcontext __user *frame)
 {
-       if (!FULL_REGS(regs)) {
-               /* Zero out the unsaved GPRs to avoid information
-                  leak, and set TIF_SAVE_NVGPRS to ensure that the
-                  registers do actually get saved later. */
-               memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
-               current_thread_info()->nvgprs_frame = &frame->mc_gregs;
-               set_thread_flag(TIF_SAVE_NVGPRS);
-       }
-
+       WARN_ON(!FULL_REGS(regs));
        return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE);
 }
 
@@ -826,8 +815,8 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int
 }
 
 long sys_swapcontext(struct ucontext __user *old_ctx,
-                      struct ucontext __user *new_ctx,
-                      int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
+                    struct ucontext __user *new_ctx,
+                    int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
 {
        unsigned char tmp;
 
index 497a5d3df359e5911b61110632b79ee540ff3095..4324f8a8ba247cf4e24f765d44d0217b28c175d4 100644 (file)
@@ -118,14 +118,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
        err |= __put_user(0, &sc->v_regs);
 #endif /* CONFIG_ALTIVEC */
        err |= __put_user(&sc->gp_regs, &sc->regs);
-       if (!FULL_REGS(regs)) {
-               /* Zero out the unsaved GPRs to avoid information
-                  leak, and set TIF_SAVE_NVGPRS to ensure that the
-                  registers do actually get saved later. */
-               memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
-               set_thread_flag(TIF_SAVE_NVGPRS);
-               current_thread_info()->nvgprs_frame = &sc->gp_regs;
-       }
+       WARN_ON(!FULL_REGS(regs));
        err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE);
        err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
        err |= __put_user(signr, &sc->signal);
index 8a9f994ed9170ec6e0a934db1c7671771ad5019e..1ad55f0466fd621b58f5271bceebb01ea07c4624 100644 (file)
@@ -288,7 +288,7 @@ COMPAT_SYS(clock_settime)
 COMPAT_SYS(clock_gettime)
 COMPAT_SYS(clock_getres)
 COMPAT_SYS(clock_nanosleep)
-COMPAT_SYS(swapcontext)
+SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
 COMPAT_SYS(tgkill)
 COMPAT_SYS(utimes)
 COMPAT_SYS(statfs64)
index 7509aa6474f2e7c03deb7fa896b658fd31f6247f..98660aedeeb77234865edaf7075fea0ca29da9df 100644 (file)
@@ -814,6 +814,8 @@ void __kprobes program_check_exception(struct pt_regs *regs)
                return;
        }
 
+       local_irq_enable();
+
        /* Try to emulate it if we should. */
        if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
                switch (emulate_instruction(regs)) {
index 4ffd2a9832a0c9fba43974b1f0fa00227372599f..9b7150f104147f7de2bdce33da432321bd936c01 100644 (file)
@@ -9,7 +9,12 @@
 #include <asm/pmac_feature.h>
 #include <asm/pmac_pfunc.h>
 
+#undef DEBUG
+#ifdef DEBUG
 #define DBG(fmt...)    printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
 
 static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs)
 {
index 356a739e52b2d9c446b0c720c50f1d843faf90c5..4baa75b1d36ff60a7cb9088a7e6ffa5d10301e0f 100644 (file)
 #define LOG_PARSE(fmt...)
 #define LOG_ERROR(fmt...)      printk(fmt)
 #define LOG_BLOB(t,b,c)
+
+#undef DEBUG
+#ifdef DEBUG
 #define DBG(fmt...)            printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
 
 /* Command numbers */
 #define PMF_CMD_LIST                   0
index 0df2cdcd805c1776ecd85b2de340bf3db0742390..6d64a9bf3474db8a29decd772667aafd6f03a8ea 100644 (file)
@@ -435,7 +435,7 @@ struct smp_ops_t psurge_smp_ops = {
  */
 
 static void (*pmac_tb_freeze)(int freeze);
-static unsigned long timebase;
+static u64 timebase;
 static int tb_req;
 
 static void smp_core99_give_timebase(void)
index 7964bf660e9274b9abb460d548a5c368db591809..77e4dc780f8cfa3efae51e0f1a088a1c9123bcfc 100644 (file)
@@ -131,7 +131,6 @@ main(void)
        DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
        DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
 
-       DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
        DEFINE(TI_TASK, offsetof(struct thread_info, task));
        DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
index a48b950722a11385059b6606057b1d34f20ca3fc..3a28159784883df5b54a4de11538aa922ea7cf87 100644 (file)
@@ -227,7 +227,7 @@ ret_from_syscall:
        MTMSRD(r10)
        lwz     r9,TI_FLAGS(r12)
        li      r8,-_LAST_ERRNO
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL)
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
        bne-    syscall_exit_work
        cmplw   0,r3,r8
        blt+    syscall_exit_cont
@@ -287,8 +287,10 @@ syscall_dotrace:
 
 syscall_exit_work:
        andi.   r0,r9,_TIF_RESTOREALL
-       bne-    2f
-       cmplw   0,r3,r8
+       beq+    0f
+       REST_NVGPRS(r1)
+       b       2f
+0:     cmplw   0,r3,r8
        blt+    1f
        andi.   r0,r9,_TIF_NOERROR
        bne-    1f
@@ -302,9 +304,7 @@ syscall_exit_work:
 2:     andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
        beq     4f
 
-       /* Clear per-syscall TIF flags if any are set, but _leave_
-       _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
-       yet.  */
+       /* Clear per-syscall TIF flags if any are set.  */
 
        li      r11,_TIF_PERSYSCALL_MASK
        addi    r12,r12,TI_FLAGS
@@ -318,8 +318,13 @@ syscall_exit_work:
        subi    r12,r12,TI_FLAGS
        
 4:     /* Anything which requires enabling interrupts? */
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
-       beq     7f
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
+       beq     ret_from_except
+
+       /* Re-enable interrupts */
+       ori     r10,r10,MSR_EE
+       SYNC
+       MTMSRD(r10)
 
        /* Save NVGPRS if they're not saved already */
        lwz     r4,TRAP(r1)
@@ -328,71 +333,11 @@ syscall_exit_work:
        SAVE_NVGPRS(r1)
        li      r4,0xc00
        stw     r4,TRAP(r1)
-
-       /* Re-enable interrupts */
-5:     ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)
-
-       andi.   r0,r9,_TIF_SAVE_NVGPRS
-       bne     save_user_nvgprs
-
-save_user_nvgprs_cont:
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
-       beq     7f
-
+5:
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      do_syscall_trace_leave
-       REST_NVGPRS(r1)
-
-6:     lwz     r3,GPR3(r1)
-       LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
-       SYNC
-       MTMSRD(r10)             /* disable interrupts again */
-       rlwinm  r12,r1,0,0,18   /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-7:
-       andi.   r0,r9,_TIF_NEED_RESCHED
-       bne     8f
-       lwz     r5,_MSR(r1)
-       andi.   r5,r5,MSR_PR
-       beq     ret_from_except
-       andi.   r0,r9,_TIF_SIGPENDING
-       beq     ret_from_except
-       b       do_user_signal
-8:
-       ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)             /* re-enable interrupts */
-       bl      schedule
-       b       6b
-
-save_user_nvgprs:
-       lwz     r8,TI_SIGFRAME(r12)
-
-.macro savewords start, end
-  1:   stw \start,4*(\start)(r8)
-       .section __ex_table,"a"
-       .align  2
-       .long   1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savewords "(\start+1)",\end
-       .endif
-.endm  
-       savewords 14,31
-       b       save_user_nvgprs_cont
-
-       
-save_user_nvgprs_fault:
-       li      r3,11           /* SIGSEGV */
-       lwz     r4,TI_TASK(r12)
-       bl      force_sigsegv
+       b       ret_from_except_full
 
-       rlwinm  r12,r1,0,0,18   /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-       b       save_user_nvgprs_cont
-       
 #ifdef SHOW_SYSCALLS
 do_show_syscall:
 #ifdef SHOW_SYSCALLS_TASK
@@ -490,6 +435,14 @@ ppc_clone:
        stw     r0,TRAP(r1)             /* register set saved */
        b       sys_clone
 
+       .globl  ppc_swapcontext
+ppc_swapcontext:
+       SAVE_NVGPRS(r1)
+       lwz     r0,TRAP(r1)
+       rlwinm  r0,r0,0,0,30            /* clear LSB to indicate full */
+       stw     r0,TRAP(r1)             /* register set saved */
+       b       sys_swapcontext
+
 /*
  * Top-level page fault handling.
  * This is in assembler because if do_page_fault tells us that
@@ -683,7 +636,7 @@ user_exc_return:            /* r10 contains MSR_KERNEL here */
        /* Check current_thread_info()->flags */
        rlwinm  r9,r1,0,0,18
        lwz     r9,TI_FLAGS(r9)
-       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL)
+       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
        bne     do_work
 
 restore_user:
index 60f80a4eed4e52cfc99756738024738a42537237..b9b7958a226a75a5787129404b1eb525c95832b4 100644 (file)
@@ -2,8 +2,7 @@
  *  arch/s390/lib/spinlock.c
  *    Out of line spinlock code.
  *
- *  S390 version
- *    Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Copyright (C) IBM Corp. 2004, 2006
  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
  */
 
@@ -44,6 +43,8 @@ _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc)
                        _diag44();
                        count = spin_retry;
                }
+               if (__raw_spin_is_locked(lp))
+                       continue;
                if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
                        return;
        }
@@ -56,6 +57,8 @@ _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc)
        int count = spin_retry;
 
        while (count-- > 0) {
+               if (__raw_spin_is_locked(lp))
+                       continue;
                if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
                        return 1;
        }
@@ -74,6 +77,8 @@ _raw_read_lock_wait(raw_rwlock_t *rw)
                        _diag44();
                        count = spin_retry;
                }
+               if (!__raw_read_can_lock(rw))
+                       continue;
                old = rw->lock & 0x7fffffffU;
                if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
                        return;
@@ -88,6 +93,8 @@ _raw_read_trylock_retry(raw_rwlock_t *rw)
        int count = spin_retry;
 
        while (count-- > 0) {
+               if (!__raw_read_can_lock(rw))
+                       continue;
                old = rw->lock & 0x7fffffffU;
                if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
                        return 1;
@@ -106,6 +113,8 @@ _raw_write_lock_wait(raw_rwlock_t *rw)
                        _diag44();
                        count = spin_retry;
                }
+               if (!__raw_write_can_lock(rw))
+                       continue;
                if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
                        return;
        }
@@ -118,6 +127,8 @@ _raw_write_trylock_retry(raw_rwlock_t *rw)
        int count = spin_retry;
 
        while (count-- > 0) {
+               if (!__raw_write_can_lock(rw))
+                       continue;
                if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
                        return 1;
        }
index 88fc94fe6488079667b482264787b40b0c3d2660..5d59e26250481ec325b9740dccaefa0bf57765a3 100644 (file)
@@ -198,12 +198,12 @@ __strnlen_user_asm:
 0:     srst    %r2,%r1
        jo      0b
        sacf    0
-       jh      1f              # \0 found in string ?
        ahi     %r2,1           # strnlen_user result includes the \0
-1:     slr     %r2,%r3
+                               # or return count+1 if \0 not found
+       slr     %r2,%r3
        br      %r14
 2:     sacf    0
-       lhi     %r2,-EFAULT
+       slr     %r2,%r2         # return 0 on exception
        br      %r14
        .section __ex_table,"a"
        .long   0b,2b
index 50219786fc7ac8bc86138594a4fd253c3a2048eb..19b41a33c230cb02e1d5f527cb3c43bb12de0e31 100644 (file)
@@ -194,12 +194,12 @@ __strnlen_user_asm:
 0:     srst    %r2,%r1
        jo      0b
        sacf    0
-       jh      1f              # \0 found in string ?
        aghi    %r2,1           # strnlen_user result includes the \0
-1:     slgr    %r2,%r3
+                               # or return count+1 if \0 not found
+       slgr    %r2,%r3
        br      %r14
 2:     sacf    0
-       lghi    %r2,-EFAULT
+       slgr    %r2,%r2         # return 0 on exception
        br      %r14
        .section __ex_table,"a"
        .quad   0b,2b
index e73621d03a28600e3cf99f825e1ca733c6705a78..e9b275d90737ba9601152adc91ac37693818d00f 100644 (file)
@@ -392,9 +392,9 @@ config SH_TMU
 
 endmenu
 
-source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
+#source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
 
-source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
+#source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
 
 config SH_PCLK_FREQ
        int "Peripheral clock frequency (in Hz)"
index 89fab51e20f4b4dbeb21c67f97f20849a00839f1..25ac8a3faae635417ae7377cadf7f56ae2dec823 100644 (file)
@@ -140,7 +140,7 @@ static void load_segments(void)
                "\tmovl %0,%%ss\n"
                "\tmovl %0,%%fs\n"
                "\tmovl %0,%%gs\n"
-               : : "a" (__KERNEL_DS)
+               : : "a" (__KERNEL_DS) : "memory"
                );
 }
 
index 7ee4a14ec3b1949d38766b4247bf71d2f2f14159..e90ef5db89138d258fdbce8cbc259cc55aeb7c1b 100644 (file)
@@ -26,6 +26,10 @@ config GENERIC_HARDIRQS
        bool
        default y
 
+config RWSEM_GENERIC_SPINLOCK
+       bool
+       default y
+
 source "init/Kconfig"
 
 menu "Processor type and features"
index 03d9c82b0fe7911fd6e922f746249795ccb80d46..0ef2971a9e8207ee5bbee9fd50e3873466308b33 100644 (file)
@@ -625,26 +625,31 @@ static inline int ordered_bio_endio(struct request *rq, struct bio *bio,
  *    Different hardware can have different requirements as to what pages
  *    it can do I/O directly to. A low level driver can call
  *    blk_queue_bounce_limit to have lower memory pages allocated as bounce
- *    buffers for doing I/O to pages residing above @page. By default
- *    the block layer sets this to the highest numbered "low" memory page.
+ *    buffers for doing I/O to pages residing above @page.
  **/
 void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr)
 {
        unsigned long bounce_pfn = dma_addr >> PAGE_SHIFT;
-
-       /*
-        * set appropriate bounce gfp mask -- unfortunately we don't have a
-        * full 4GB zone, so we have to resort to low memory for any bounces.
-        * ISA has its own < 16MB zone.
-        */
-       if (bounce_pfn < blk_max_low_pfn) {
-               BUG_ON(dma_addr < BLK_BOUNCE_ISA);
+       int dma = 0;
+
+       q->bounce_gfp = GFP_NOIO;
+#if BITS_PER_LONG == 64
+       /* Assume anything <= 4GB can be handled by IOMMU.
+          Actually some IOMMUs can handle everything, but I don't
+          know of a way to test this here. */
+       if (bounce_pfn < (0xffffffff>>PAGE_SHIFT))
+               dma = 1;
+       q->bounce_pfn = max_low_pfn;
+#else
+       if (bounce_pfn < blk_max_low_pfn)
+               dma = 1;
+       q->bounce_pfn = bounce_pfn;
+#endif
+       if (dma) {
                init_emergency_isa_pool();
                q->bounce_gfp = GFP_NOIO | GFP_DMA;
-       } else
-               q->bounce_gfp = GFP_NOIO;
-
-       q->bounce_pfn = bounce_pfn;
+               q->bounce_pfn = bounce_pfn;
+       }
 }
 
 EXPORT_SYMBOL(blk_queue_bounce_limit);
index 6ede1f352c2954d246ead5288a31cb181ea220df..37b8cda3e8bc909c02d38fbf02e99fded1d1d88a 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/timer.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/random.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include "DAC960.h"
@@ -3463,7 +3464,7 @@ static inline boolean DAC960_ProcessCompletedRequest(DAC960_Command_T *Command,
                Command->SegmentCount, Command->DmaDirection);
 
         if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) {
-
+               add_disk_randomness(Request->rq_disk);
                end_that_request_last(Request, UpToDate);
 
                if (Command->Completion) {
index c92378121b4ca054fdce184963b14290a7c6bb55..1b05fa688996dc8e94e5e26c0436d5e5ea92ca52 100644 (file)
@@ -675,7 +675,7 @@ static int __init mmtimer_init(void)
        cnodeid_t node, maxn = -1;
 
        if (!ia64_platform_is("sn2"))
-               return -1;
+               return 0;
 
        /*
         * Sanity check the cycles/sec variable
index 18a4556511216062c523a988477ffb35520a5ce1..52f3eb45d2b9eb6a498197d4809abccffdce1920 100644 (file)
@@ -6,17 +6,29 @@
 # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $
 #
 
-menu 'EDAC - error detection and reporting (RAS)'
+menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)'
 
 config EDAC
-       tristate "EDAC core system error reporting"
-       depends on X86
+       tristate "EDAC core system error reporting (EXPERIMENTAL)"
+       depends on X86 && EXPERIMENTAL
        help
          EDAC is designed to report errors in the core system.
          These are low-level errors that are reported in the CPU or
          supporting chipset: memory errors, cache errors, PCI errors,
          thermal throttling, etc..  If unsure, select 'Y'.
 
+         If this code is reporting problems on your system, please
+         see the EDAC project web pages for more information at:
+
+         <http://bluesmoke.sourceforge.net/>
+
+         and:
+
+         <http://buttersideup.com/edacwiki>
+
+         There is also a mailing list for the EDAC project, which can
+         be found via the sourceforge page.
+
 
 comment "Reporting subsystems"
        depends on EDAC
index b10ee4698b1db95f8b3045fd7fd814648cedfed0..262e44544dc874bca9eb962036a88f9c022ab980 100644 (file)
@@ -132,11 +132,13 @@ static struct kobject edac_pci_kobj;
  * /sys/devices/system/edac/mc;
  *     data structures and methods
  */
+#if 0
 static ssize_t memctrl_string_show(void *ptr, char *buffer)
 {
        char *value = (char*) ptr;
        return sprintf(buffer, "%s\n", value);
 }
+#endif
 
 static ssize_t memctrl_int_show(void *ptr, char *buffer)
 {
@@ -207,7 +209,9 @@ struct memctrl_dev_attribute attr_##_name = {                       \
 };
 
 /* cwrow<id> attribute f*/
+#if 0
 MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL);
+#endif
 
 /* csrow<id> control files */
 MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
@@ -222,7 +226,6 @@ static struct memctrl_dev_attribute *memctrl_attr[] = {
        &attr_log_ue,
        &attr_log_ce,
        &attr_poll_msec,
-       &attr_mc_version,
        NULL,
 };
 
@@ -309,6 +312,8 @@ struct list_control {
        int *count;
 };
 
+
+#if 0
 /* Output the list as:  vendor_id:device:id<,vendor_id:device_id> */
 static ssize_t edac_pci_list_string_show(void *ptr, char *buffer)
 {
@@ -430,6 +435,7 @@ static ssize_t edac_pci_list_string_store(void *ptr, const char *buffer,
        return count;
 }
 
+#endif
 static ssize_t edac_pci_int_show(void *ptr, char *buffer)
 {
        int *value = ptr;
@@ -498,6 +504,7 @@ struct edac_pci_dev_attribute edac_pci_attr_##_name = {             \
        .store  = _store,                                       \
 };
 
+#if 0
 static struct list_control pci_whitelist_control = {
        .list = pci_whitelist,
        .count = &pci_whitelist_count
@@ -520,6 +527,7 @@ EDAC_PCI_STRING_ATTR(pci_parity_blacklist,
        S_IRUGO|S_IWUSR,
        edac_pci_list_string_show,
        edac_pci_list_string_store);
+#endif
 
 /* PCI Parity control files */
 EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store);
@@ -531,8 +539,6 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = {
        &edac_pci_attr_check_pci_parity,
        &edac_pci_attr_panic_on_pci_parity,
        &edac_pci_attr_pci_parity_count,
-       &edac_pci_attr_pci_parity_whitelist,
-       &edac_pci_attr_pci_parity_blacklist,
        NULL,
 };
 
index 8ed6ddbb9c5d5f1932bb3ff7ca756f37aa39a552..4652512f7d1a928a6830b5d15d91f4c20bdfc59e 100644 (file)
@@ -39,7 +39,7 @@
 #include "dcdbas.h"
 
 #define DRIVER_NAME            "dcdbas"
-#define DRIVER_VERSION         "5.6.0-1"
+#define DRIVER_VERSION         "5.6.0-2"
 #define DRIVER_DESCRIPTION     "Dell Systems Management Base Driver"
 
 static struct platform_device *dcdbas_pdev;
@@ -581,9 +581,13 @@ static int __init dcdbas_init(void)
  */
 static void __exit dcdbas_exit(void)
 {
-       platform_device_unregister(dcdbas_pdev);
+       /*
+        * make sure functions that use dcdbas_pdev are called
+        * before platform_device_unregister
+        */
        unregister_reboot_notifier(&dcdbas_reboot_nb);
        smi_data_buf_free();
+       platform_device_unregister(dcdbas_pdev);
 }
 
 module_init(dcdbas_init);
index 19b1b0121726faa5b5d66a9d22bdaf08192af351..ad62174676761e095ba26e232db99e6df843e52d 100644 (file)
@@ -58,7 +58,7 @@ static unsigned int psmouse_resetafter = 5;
 module_param_named(resetafter, psmouse_resetafter, uint, 0644);
 MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never).");
 
-static unsigned int psmouse_resync_time = 5;
+static unsigned int psmouse_resync_time;
 module_param_named(resync_time, psmouse_resync_time, uint, 0644);
 MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never).");
 
index bb8d5efe19bfc456e3825459c63ff746a4215963..6c0ba04bc57a299caf6868d509fc5aa7ecb55cfa 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
 
+#include <asm/prom.h>
+
 #include "windfarm.h"
 
 #define VERSION "0.2"
@@ -465,6 +467,11 @@ static int __init windfarm_core_init(void)
 {
        DBG("wf: core loaded\n");
 
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
        platform_device_register(&wf_platform_device);
        return 0;
 }
index 607dbaca69c96fbb2172556bc4a14e5ca72f93d6..81337cd16e80d1fc80f87ee17fb82aa88a03d00f 100644 (file)
@@ -8,6 +8,8 @@
 #include <linux/wait.h>
 #include <linux/cpufreq.h>
 
+#include <asm/prom.h>
+
 #include "windfarm.h"
 
 #define VERSION "0.3"
@@ -74,6 +76,12 @@ static int __init wf_cpufreq_clamp_init(void)
 {
        struct wf_control *clamp;
 
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
+
        clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL);
        if (clamp == NULL)
                return -ENOMEM;
index 906d3ecae6e69e043a31835963c17695a61fdc4c..423bfa2432c02ad4939219c40e2a177f33cf0f8c 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "windfarm.h"
 
-#define VERSION "0.1"
+#define VERSION "0.2"
 
 #undef DEBUG
 
@@ -113,6 +113,7 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
                                             const char *loc)
 {
        struct wf_lm75_sensor *lm;
+       int rc;
 
        DBG("wf_lm75: creating  %s device at address 0x%02x\n",
            ds1775 ? "ds1775" : "lm75", addr);
@@ -139,9 +140,11 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
        lm->i2c.driver = &wf_lm75_driver;
        strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1);
 
-       if (i2c_attach_client(&lm->i2c)) {
-               printk(KERN_ERR "windfarm: failed to attach %s %s to i2c\n",
-                      ds1775 ? "ds1775" : "lm75", lm->i2c.name);
+       rc = i2c_attach_client(&lm->i2c);
+       if (rc) {
+               printk(KERN_ERR "windfarm: failed to attach %s %s to i2c,"
+                      " err %d\n", ds1775 ? "ds1775" : "lm75",
+                      lm->i2c.name, rc);
                goto fail;
        }
 
@@ -175,16 +178,22 @@ static int wf_lm75_attach(struct i2c_adapter *adapter)
             (dev = of_get_next_child(busnode, dev)) != NULL;) {
                const char *loc =
                        get_property(dev, "hwsensor-location", NULL);
-               u32 *reg = (u32 *)get_property(dev, "reg", NULL);
-               DBG(" dev: %s... (loc: %p, reg: %p)\n", dev->name, loc, reg);
-               if (loc == NULL || reg == NULL)
+               u8 addr;
+
+               /* We must re-match the adapter in order to properly check
+                * the channel on multibus setups
+                */
+               if (!pmac_i2c_match_adapter(dev, adapter))
+                       continue;
+               addr = pmac_i2c_get_dev_addr(dev);
+               if (loc == NULL || addr == 0)
                        continue;
                /* real lm75 */
                if (device_is_compatible(dev, "lm75"))
-                       wf_lm75_create(adapter, *reg, 0, loc);
+                       wf_lm75_create(adapter, addr, 0, loc);
                /* ds1775 (compatible, better resolution */
                else if (device_is_compatible(dev, "ds1775"))
-                       wf_lm75_create(adapter, *reg, 1, loc);
+                       wf_lm75_create(adapter, addr, 1, loc);
        }
        return 0;
 }
@@ -206,6 +215,11 @@ static int wf_lm75_detach(struct i2c_client *client)
 
 static int __init wf_lm75_sensor_init(void)
 {
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
        return i2c_add_driver(&wf_lm75_driver);
 }
 
index 5b9ad6ca7cba07e28996d4af2f3f703ad2321c0a..8e99d408fddd5c62db695acb61266fe9b70b9b88 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "windfarm.h"
 
-#define VERSION "0.1"
+#define VERSION "0.2"
 
 /* This currently only exports the external temperature sensor,
    since that's all the control loops need. */
@@ -81,7 +81,7 @@ static struct wf_sensor_ops wf_max6690_ops = {
 static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr)
 {
        struct wf_6690_sensor *max;
-       char *name = "u4-temp";
+       char *name = "backside-temp";
 
        max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
        if (max == NULL) {
@@ -118,7 +118,6 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
        struct device_node *busnode, *dev = NULL;
        struct pmac_i2c_bus *bus;
        const char *loc;
-       u32 *reg;
 
        bus = pmac_i2c_adapter_to_bus(adapter);
        if (bus == NULL)
@@ -126,16 +125,23 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
        busnode = pmac_i2c_get_bus_node(bus);
 
        while ((dev = of_get_next_child(busnode, dev)) != NULL) {
+               u8 addr;
+
+               /* We must re-match the adapter in order to properly check
+                * the channel on multibus setups
+                */
+               if (!pmac_i2c_match_adapter(dev, adapter))
+                       continue;
                if (!device_is_compatible(dev, "max6690"))
                        continue;
+               addr = pmac_i2c_get_dev_addr(dev);
                loc = get_property(dev, "hwsensor-location", NULL);
-               reg = (u32 *) get_property(dev, "reg", NULL);
-               if (!loc || !reg)
+               if (loc == NULL || addr == 0)
                        continue;
-               printk("found max6690, loc=%s reg=%x\n", loc, *reg);
+               printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
                if (strcmp(loc, "BACKSIDE"))
                        continue;
-               wf_max6690_create(adapter, *reg);
+               wf_max6690_create(adapter, addr);
        }
 
        return 0;
@@ -153,6 +159,11 @@ static int wf_max6690_detach(struct i2c_client *client)
 
 static int __init wf_max6690_sensor_init(void)
 {
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
        return i2c_add_driver(&wf_max6690_driver);
 }
 
index c2a4e689c784e776fca5968561d6da4d23e0935a..ef66bf2778ecab42565e2da225c368b8af056aee 100644 (file)
@@ -358,6 +358,7 @@ static void backside_fan_tick(void)
                return;
        if (!backside_tick) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Backside control loop started.\n");
                backside_param.min = backside_fan->ops->get_min(backside_fan);
                backside_param.max = backside_fan->ops->get_max(backside_fan);
                wf_pid_init(&backside_pid, &backside_param);
@@ -407,6 +408,7 @@ static void drive_bay_fan_tick(void)
                return;
        if (!drive_bay_tick) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Drive bay control loop started.\n");
                drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan);
                drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan);
                wf_pid_init(&drive_bay_pid, &drive_bay_prm);
@@ -458,6 +460,7 @@ static void slots_fan_tick(void)
                return;
        if (!slots_started) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Slots control loop started.\n");
                wf_pid_init(&slots_pid, &slots_param);
                slots_started = 1;
        }
@@ -504,6 +507,7 @@ static void pm112_tick(void)
 
        if (!started) {
                started = 1;
+               printk(KERN_INFO "windfarm: CPUs control loops started.\n");
                for (i = 0; i < nr_cores; ++i) {
                        if (create_cpu_loop(i) < 0) {
                                failure_state = FAILURE_PERM;
@@ -594,8 +598,6 @@ static void pm112_new_sensor(struct wf_sensor *sr)
 {
        unsigned int i;
 
-       if (have_all_sensors)
-               return;
        if (!strncmp(sr->name, "cpu-temp-", 9)) {
                i = sr->name[9] - '0';
                if (sr->name[10] == 0 && i < NR_CORES &&
@@ -613,7 +615,7 @@ static void pm112_new_sensor(struct wf_sensor *sr)
        } else if (!strcmp(sr->name, "slots-power")) {
                if (slots_power == NULL && wf_get_sensor(sr) == 0)
                        slots_power = sr;
-       } else if (!strcmp(sr->name, "u4-temp")) {
+       } else if (!strcmp(sr->name, "backside-temp")) {
                if (u4_temp == NULL && wf_get_sensor(sr) == 0)
                        u4_temp = sr;
        } else
index d39f584cd8b3000d048f3f83007a9dc3ec672a1e..5d88329e3c7a7e3bd3ff7240d358d2173e86a957 100644 (file)
@@ -306,6 +306,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
        r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private);
        int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state);
        conf_t *conf = mddev_to_conf(r1_bio->mddev);
+       struct bio *to_put = NULL;
 
        if (bio->bi_size)
                return 1;
@@ -323,6 +324,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
                 * this branch is our 'one mirror IO has finished' event handler:
                 */
                r1_bio->bios[mirror] = NULL;
+               to_put = bio;
                if (!uptodate) {
                        md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);
                        /* an I/O failed, we can't clear the bitmap */
@@ -375,7 +377,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
                        /* Don't dec_pending yet, we want to hold
                         * the reference over the retry
                         */
-                       return 0;
+                       goto out;
                }
                if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {
                        /* free extra copy of the data pages */
@@ -392,10 +394,11 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
                raid_end_bio_io(r1_bio);
        }
 
-       if (r1_bio->bios[mirror]==NULL)
-               bio_put(bio);
-
        rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
+ out:
+       if (to_put)
+               bio_put(to_put);
+
        return 0;
 }
 
@@ -857,7 +860,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
        atomic_set(&r1_bio->remaining, 0);
        atomic_set(&r1_bio->behind_remaining, 0);
 
-       do_barriers = bio->bi_rw & BIO_RW_BARRIER;
+       do_barriers = bio_barrier(bio);
        if (do_barriers)
                set_bit(R1BIO_Barrier, &r1_bio->state);
 
index 390cc3a99ce6525a6cc668f0543f144e8923a788..9c7f122826e0089d9931402be70ddedf18c2e436 100644 (file)
@@ -526,7 +526,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
                info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address);
        } else
        /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
-       if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) {
+       if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) {
                ops = fc->fe->ops;
 
                ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd;
index 34c3189a1a33980d16cf0c9f997e570d745e6108..356f447ee2ab917a818ab37ecdb207d6f099f9dc 100644 (file)
@@ -382,7 +382,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *
 EXPORT_SYMBOL(bt878_device_control);
 
 
-struct cards card_list[] __devinitdata = {
+static struct cards card_list[] __devinitdata = {
 
        { 0x01010071, BTTV_BOARD_NEBULA_DIGITV,                 "Nebula Electronics DigiTV" },
        { 0x07611461, BTTV_BOARD_AVDVBT_761,                    "AverMedia AverTV DVB-T 761" },
index 3a2ff1cc24b709eb70fad464b0deb36ac9744fbe..0310e3dd07e60e0c41489aac538f3da89aecc78e 100644 (file)
@@ -602,7 +602,7 @@ static int dst_type_print(u8 type)
 
 */
 
-struct dst_types dst_tlist[] = {
+static struct dst_types dst_tlist[] = {
        {
                .device_id = "200103A",
                .offset = 0,
index 9f025825b2d2ca816940254fbd3fb8f4dcf9145a..0c1d87c5227ab0bf3e903d95e3cc92ce982b6d98 100644 (file)
@@ -216,7 +216,7 @@ struct dmx_frontend {
 /*--------------------------------------------------------------------------*/
 
 /*
- * Flags OR'ed in the capabilites field of struct dmx_demux.
+ * Flags OR'ed in the capabilities field of struct dmx_demux.
  */
 
 #define DMX_TS_FILTERING                        1
index f327fac1688e744555eb6b345773de22c9708352..162f9795cd899268056f830b45f67ce6ad5c6b70 100644 (file)
@@ -282,7 +282,7 @@ static struct cx22702_config cxusb_cx22702_config = {
        .pll_set  = dvb_usb_pll_set_i2c,
 };
 
-static struct lgdt330x_config cxusb_lgdt330x_config = {
+static struct lgdt330x_config cxusb_lgdt3303_config = {
        .demod_address = 0x0e,
        .demod_chip    = LGDT3303,
        .pll_set       = dvb_usb_pll_set_i2c,
@@ -357,14 +357,14 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
        return -EIO;
 }
 
-static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
+static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d)
 {
        if (usb_set_interface(d->udev,0,7) < 0)
                err("set interface failed");
 
        cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
 
-       if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL)
+       if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL)
                return 0;
 
        return -EIO;
@@ -506,7 +506,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
 
        .streaming_ctrl   = cxusb_streaming_ctrl,
        .power_ctrl       = cxusb_power_ctrl,
-       .frontend_attach  = cxusb_lgdt330x_frontend_attach,
+       .frontend_attach  = cxusb_lgdt3303_frontend_attach,
        .tuner_attach     = cxusb_lgh064f_tuner_attach,
 
        .i2c_algo         = &cxusb_i2c_algo,
index 716f8bf528cdc1999fe00d658f0e643ff8968750..ce34a55e5c243095ca8853f4e382f93fdd2047dc 100644 (file)
@@ -47,7 +47,7 @@ static int dvb_usb_init(struct dvb_usb_device *d)
 
        d->state = DVB_USB_STATE_INIT;
 
-/* check the capabilites and set appropriate variables */
+/* check the capabilities and set appropriate variables */
 
 /* speed - when running at FULL speed we need a HW PID filter */
        if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & DVB_USB_HAS_PID_FILTER)) {
index 5e5d21ad93c984d7f4ee387326adb4c43a76589b..d4909e5c67e063f89a92d3f7dd184d209ffea800 100644 (file)
@@ -87,7 +87,7 @@ struct dvb_usb_device;
 
 /**
  * struct dvb_usb_properties - properties of a dvb-usb-device
- * @caps: capabilites of the DVB USB device.
+ * @caps: capabilities of the DVB USB device.
  * @pid_filter_count: number of PID filter position in the optional hardware
  *  PID-filter.
  *
index 76b6a2aef32f481f316d22d9d3c42096b15b239c..c676b1e23ab0d1cb2d3ef2d6c4ead09a9dbf73d4 100644 (file)
@@ -29,7 +29,7 @@ config DVB_TDA8083
          A DVB-S tuner module. Say Y when you want to support this frontend.
 
 config DVB_MT312
-       tristate "Zarlink MT312 based"
+       tristate "Zarlink VP310/MT312 based"
        depends on DVB_CORE
        help
          A DVB-S tuner module. Say Y when you want to support this frontend.
index ec4e641acc64446db0f8577342652dd8614c2961..d3aea83cf218e23fff5cc841cb1178152af885c7 100644 (file)
@@ -612,76 +612,6 @@ static void mt312_release(struct dvb_frontend* fe)
        kfree(state);
 }
 
-static struct dvb_frontend_ops vp310_mt312_ops;
-
-struct dvb_frontend* vp310_attach(const struct mt312_config* config,
-                                 struct i2c_adapter* i2c)
-{
-       struct mt312_state* state = NULL;
-
-       /* allocate memory for the internal state */
-       state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
-       if (state == NULL)
-               goto error;
-
-       /* setup the state */
-       state->config = config;
-       state->i2c = i2c;
-       memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
-       strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");
-
-       /* check if the demod is there */
-       if (mt312_readreg(state, ID, &state->id) < 0)
-               goto error;
-       if (state->id != ID_VP310) {
-               goto error;
-       }
-
-       /* create dvb_frontend */
-       state->frequency = 90;
-       state->frontend.ops = &state->ops;
-       state->frontend.demodulator_priv = state;
-       return &state->frontend;
-
-error:
-       kfree(state);
-       return NULL;
-}
-
-struct dvb_frontend* mt312_attach(const struct mt312_config* config,
-                                 struct i2c_adapter* i2c)
-{
-       struct mt312_state* state = NULL;
-
-       /* allocate memory for the internal state */
-       state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
-       if (state == NULL)
-               goto error;
-
-       /* setup the state */
-       state->config = config;
-       state->i2c = i2c;
-       memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
-       strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");
-
-       /* check if the demod is there */
-       if (mt312_readreg(state, ID, &state->id) < 0)
-               goto error;
-       if (state->id != ID_MT312) {
-               goto error;
-       }
-
-       /* create dvb_frontend */
-       state->frequency = 60;
-       state->frontend.ops = &state->ops;
-       state->frontend.demodulator_priv = state;
-       return &state->frontend;
-
-error:
-       kfree(state);
-       return NULL;
-}
-
 static struct dvb_frontend_ops vp310_mt312_ops = {
 
        .info = {
@@ -720,6 +650,49 @@ static struct dvb_frontend_ops vp310_mt312_ops = {
        .set_voltage = mt312_set_voltage,
 };
 
+struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
+                                       struct i2c_adapter* i2c)
+{
+       struct mt312_state* state = NULL;
+
+       /* allocate memory for the internal state */
+       state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
+       if (state == NULL)
+               goto error;
+
+       /* setup the state */
+       state->config = config;
+       state->i2c = i2c;
+       memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
+
+       /* check if the demod is there */
+       if (mt312_readreg(state, ID, &state->id) < 0)
+               goto error;
+
+       switch (state->id) {
+       case ID_VP310:
+               strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");
+               state->frequency = 90;
+               break;
+       case ID_MT312:
+               strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");
+               state->frequency = 60;
+               break;
+       default:
+               printk (KERN_WARNING "Only Zarlink VP310/MT312 are supported chips.\n");
+               goto error;
+       }
+
+       /* create dvb_frontend */
+       state->frontend.ops = &state->ops;
+       state->frontend.demodulator_priv = state;
+       return &state->frontend;
+
+error:
+       kfree(state);
+       return NULL;
+}
+
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
 
@@ -727,5 +700,4 @@ MODULE_DESCRIPTION("Zarlink VP310/MT312 DVB-S Demodulator driver");
 MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>");
 MODULE_LICENSE("GPL");
 
-EXPORT_SYMBOL(mt312_attach);
-EXPORT_SYMBOL(vp310_attach);
+EXPORT_SYMBOL(vp310_mt312_attach);
index b3a53a73a117e0dd3a5f92ac12b1ef5b630fcd81..074d844f01393678e2e271273f8ba54bdcd6641f 100644 (file)
@@ -38,10 +38,8 @@ struct mt312_config
        int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
 };
 
-extern struct dvb_frontend* mt312_attach(const struct mt312_config* config,
-                                        struct i2c_adapter* i2c);
+struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
+                                       struct i2c_adapter* i2c);
 
-extern struct dvb_frontend* vp310_attach(const struct mt312_config* config,
-                                        struct i2c_adapter* i2c);
 
 #endif // MT312_H
index 6122ba754bc57167939c1342d21708025c09623c..eb15676d374f1fd4aadee45345163cd094ab56c3 100644 (file)
@@ -393,10 +393,6 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
                break;
 
        case QAM_128:
-               delay = 150;
-               sweeprate = 1000;
-               break;
-
        case QAM_256:
                delay = 200;
                sweeprate = 500;
index d36369e9e88f4557f2db1cd9c95c66b7f22f2454..7c6ccb96b1574dd4e8d24bcc9159a3ecb093d803 100644 (file)
@@ -1439,7 +1439,7 @@ static int check_firmware(struct av7110* av7110)
        len = ntohl(*(u32*) ptr);
        ptr += 4;
        if (len >= 512) {
-               printk("dvb-ttpci: dpram file is way to big.\n");
+               printk("dvb-ttpci: dpram file is way too big.\n");
                return -EINVAL;
        }
        if (crc != crc32_le(0, ptr, len)) {
@@ -2477,7 +2477,8 @@ static int frontend_init(struct av7110 *av7110)
  * The same behaviour of missing VSYNC can be duplicated on budget
  * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble.
  */
-static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext)
+static int __devinit av7110_attach(struct saa7146_dev* dev,
+                                  struct saa7146_pci_extension_data *pci_ext)
 {
        const int length = TS_WIDTH * TS_HEIGHT;
        struct pci_dev *pdev = dev->pci;
@@ -2827,7 +2828,7 @@ err_kfree_0:
        goto out;
 }
 
-static int av7110_detach(struct saa7146_dev* saa)
+static int __devexit av7110_detach(struct saa7146_dev* saa)
 {
        struct av7110 *av7110 = saa->ext_priv;
        dprintk(4, "%p\n", av7110);
@@ -2974,7 +2975,7 @@ static struct saa7146_extension av7110_extension = {
        .module         = THIS_MODULE,
        .pci_tbl        = &pci_tbl[0],
        .attach         = av7110_attach,
-       .detach         = av7110_detach,
+       .detach         = __devexit_p(av7110_detach),
 
        .irq_mask       = MASK_19 | MASK_03 | MASK_10,
        .irq_func       = av7110_irq,
index b2e63e9fc0536675a63ded41962e576c2e4d415b..0bb6e74ae7f0f83edaf538bd45f5cc682a843461 100644 (file)
@@ -245,6 +245,9 @@ int av7110_bootarm(struct av7110 *av7110)
 
        /* test DEBI */
        iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
+       /* FIXME: Why does Nexus CA require 2x iwdebi for first init? */
+       iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
+
        if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) {
                printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: "
                       "%08x != %08x (check your BIOS 'Plug&Play OS' settings)\n",
index 617e4f6c0ed78154f87a509455abd2f0906ac677..d54bbcdde2cce8c787587d3cb1dc8167fe45ba6d 100644 (file)
@@ -208,7 +208,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom)
 }
 
 
-int __init av7110_ir_init(struct av7110 *av7110)
+int __devinit av7110_ir_init(struct av7110 *av7110)
 {
        static struct proc_dir_entry *e;
 
@@ -248,7 +248,7 @@ int __init av7110_ir_init(struct av7110 *av7110)
 }
 
 
-void __exit av7110_ir_exit(struct av7110 *av7110)
+void __devexit av7110_ir_exit(struct av7110 *av7110)
 {
        int i;
 
index 9f59541155d9bfbd004d22d2aed584b5173f8677..85d964b5b33c5e55bd5e99506ba25774b3fc267c 100644 (file)
@@ -3369,7 +3369,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
        //DBG("cpia_ioctl: %u\n", ioctlnr);
 
        switch (ioctlnr) {
-       /* query capabilites */
+       /* query capabilities */
        case VIDIOCGCAP:
        {
                struct video_capability *b = arg;
index 08ffd1f325fcc2c0f8e1c1510ee35396fcabe623..5588b9a5c4304c795c5036acd232dca0747b7347 100644 (file)
@@ -567,7 +567,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = {
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Contrast",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
@@ -576,7 +576,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = {
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Saturation",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
index 048d000941c78439bbfb3f1f3456524c106398cb..ffd87ce55556acf7e786381f67da905d5891dea3 100644 (file)
@@ -1027,7 +1027,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = {
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Contrast",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
@@ -1036,7 +1036,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = {
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Saturation",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
index a7a6ab9298a91062f67c2c1a089cd2ee87c35e57..7df5e0826e123fb2659995e5836c313a6aef432e 100644 (file)
@@ -54,10 +54,12 @@ MODULE_PARM_DESC(debug,"enable debug messages [alsa]");
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;      /* ID for this card */
-static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
+static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1};
 
 module_param_array(index, int, NULL, 0444);
+module_param_array(enable, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
+MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s).");
 
 #define dprintk(fmt, arg...)    if (debug) \
        printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg)
index 5a35d3b6550d9deb61dcba84b88335c06f0a7dcb..6bc63a4086c151970beb6ddc2d9cf5b4f431a67c 100644 (file)
@@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
                .inputs         = {{
                        .name = name_tv,
                        .vmux = 3,
@@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
                        .name = name_tv,
@@ -2187,7 +2187,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = 0x61,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs = {{
                        .name   = name_tv,
@@ -2211,7 +2211,7 @@ struct saa7134_board saa7134_boards[] = {
                .radio_type     = UNSET,
                .tuner_addr     = 0x61,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs = {{
                        .name   = name_tv,
@@ -2392,7 +2392,7 @@ struct saa7134_board saa7134_boards[] = {
                }},
        },
        [SAA7134_BOARD_PINNACLE_PCTV_110i] = {
-               .name           = "Pinnacle PCTV 110i (saa7133)",
+              .name           = "Pinnacle PCTV 40i/50i/110i (saa7133)",
                .audio_clock    = 0x00187de7,
                .tuner_type     = TUNER_PHILIPS_TDA8290,
                .radio_type     = UNSET,
@@ -2407,6 +2407,10 @@ struct saa7134_board saa7134_boards[] = {
                },{
                          .name = name_comp1,
                          .vmux = 1,
+                        .amux = LINE2,
+              },{
+                        .name = name_comp2,
+                        .vmux = 0,
                          .amux = LINE2,
                },{
                          .name = name_svideo,
@@ -2745,7 +2749,7 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .vendor       = PCI_VENDOR_ID_PHILIPS,
                .device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
                .subvendor    = 0x1048,
-               .subdevice    = 0x226b,
+               .subdevice    = 0x226a,
                .driver_data  = SAA7134_BOARD_ELSA_500TV,
        },{
                .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -3201,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev)
                /* power-up tuner chip */
                saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0x00040000, 0x00040000);
                saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000);
+       case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
+               /* this turns the remote control chip off to work around a bug in it */
+               saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
+               saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80);
+               break;
        case SAA7134_BOARD_MONSTERTV_MOBILE:
                /* power-up tuner chip */
                saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0x00040000, 0x00040000);
index 1a536e865277e79c06c541920b57a3b3c5ea6849..9db8e13f21c32c59f0a2cb5417242f5fc7862e76 100644 (file)
@@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
        mt352_write(fe, fsm_ctl_cfg,    sizeof(fsm_ctl_cfg));
        mt352_write(fe, scan_ctl_cfg,   sizeof(scan_ctl_cfg));
        mt352_write(fe, irq_cfg,        sizeof(irq_cfg));
+
        return 0;
 }
 
@@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
                                  struct dvb_frontend_parameters* params,
                                  u8* pllbuf)
 {
-       static int on  = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
-       static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE;
+       u8 off[] = { 0x00, 0xf1};
+       u8 on[]  = { 0x00, 0x71};
+       struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
+
        struct saa7134_dev *dev = fe->dvb->priv;
        struct v4l2_frequency f;
 
@@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
        f.tuner     = 0;
        f.type      = V4L2_TUNER_DIGITAL_TV;
        f.frequency = params->frequency / 1000 * 16 / 1000;
-       saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
+       i2c_transfer(&dev->i2c_adap, &msg, 1);
        saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
-       saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off);
+       msg.buf = on;
+       i2c_transfer(&dev->i2c_adap, &msg, 1);
 
        pinnacle_antenna_pwr(dev, antenna_pwr);
 
index 7b4fb282ac82332fd2df6f78c1a7954fbb1a9e16..a796a4e1917cb04ed1356f20028cf5cc91805cd7 100644 (file)
@@ -580,9 +580,10 @@ int tda8290_init(struct i2c_client *c)
 
 int tda8290_probe(struct i2c_client *c)
 {
-       unsigned char soft_reset[]  = { 0x00, 0x00 };
-       unsigned char easy_mode_b[] = { 0x01, 0x02 };
-       unsigned char easy_mode_g[] = { 0x01, 0x04 };
+       unsigned char soft_reset[]   = { 0x00, 0x00 };
+       unsigned char easy_mode_b[]  = { 0x01, 0x02 };
+       unsigned char easy_mode_g[]  = { 0x01, 0x04 };
+       unsigned char restore_9886[] = { 0x00, 0xd6, 0x30 };
        unsigned char addr_dto_lsb = 0x07;
        unsigned char data;
 
@@ -599,6 +600,7 @@ int tda8290_probe(struct i2c_client *c)
                        return 0;
                }
        }
+       i2c_master_send(c, restore_9886, 3);
        return -1;
 }
 
index e7ee619d62c5287171890da403c952b3c7615d65..b6101bf446d4897e62d85e215ae27e290140087c 100644 (file)
@@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                        struct v4l2_frequency *f = arg;
 
                        switch_v4l2();
-                       if (V4L2_TUNER_RADIO == f->type &&
-                           V4L2_TUNER_RADIO != t->mode) {
+                       if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode)
+                               || (V4L2_TUNER_DIGITAL_TV == f->type
+                                       && V4L2_TUNER_DIGITAL_TV != t->mode)) {
                                if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
                                            == EINVAL)
                                        return 0;
index 156ae57096fe481a1371b54ba854d0679b2de2f5..b1239ac7f371a734ad393c15cc74805186f8e9c8 100644 (file)
@@ -56,7 +56,7 @@
    the slave is bound to it). Otherwise it doesn't need this functions and
    therfor they may not be initialized.
 
-   The other fuctions are just for convenience, as they are for shure used by
+   The other fuctions are just for convenience, as they are for sure used by
    most/all of the codecs. The last ones may be ommited, too. 
 
    See the structure declaration below for more information and which data has
index bd0cd28543ca02f7f007c4abff113f9792d8149a..6699725be60590decc82bc682ebc6861de831684 100644 (file)
@@ -159,7 +159,7 @@ zr36050_wait_end (struct zr36050 *ptr)
 
        while (!(zr36050_read_status1(ptr) & 0x4)) {
                udelay(1);
-               if (i++ > 200000) {     // 200ms, there is for shure something wrong!!!
+               if (i++ > 200000) {     // 200ms, there is for sure something wrong!!!
                        dprintk(1,
                                "%s: timout at wait_end (last status: 0x%02x)\n",
                                ptr->name, ptr->status1);
index 28fa31a5f1501a2afcc2989085b6fd3b372d76cd..d8dd003a7aadef1260da978e8f50f4c3e615ee3e 100644 (file)
@@ -161,7 +161,7 @@ zr36060_wait_end (struct zr36060 *ptr)
 
        while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) {
                udelay(1);
-               if (i++ > 200000) {     // 200ms, there is for shure something wrong!!!
+               if (i++ > 200000) {     // 200ms, there is for sure something wrong!!!
                        dprintk(1,
                                "%s: timout at wait_end (last status: 0x%02x)\n",
                                ptr->name, ptr->status);
index 6bfe84d657f1668a556064cd5b1a4eb545f90ea9..21fde43a6aed7fc26c4fb0a34125edcc6b14e8ec 100644 (file)
@@ -65,7 +65,7 @@ void attach_inform(struct i2c_bus *bus, int id)
         case I2C_DRIVERID_VIDEODECODER:
                DEBUG(printk(CARD_INFO "decoder attached\n",CARD));
 
-               /* fetch the capabilites of the decoder */
+               /* fetch the capabilities of the decoder */
                rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_CAPABILITIES, &dc);
                if (rv) {
                        DEBUG(printk(CARD_DEBUG "decoder is not V4L aware!\n",CARD));
index 1cef2387fa65f05eaffb1830f692a2c5278cc5c7..6aba419544488c58571d115f264368d30b3bed67 100644 (file)
@@ -101,15 +101,16 @@ struct command {
 static inline void command_put(struct command *cmd)
 {
        unsigned long flags;
+       spinlock_t *lock = cmd->lock;
 
-       spin_lock_irqsave(cmd->lock, flags);
-        kobject_put(&cmd->kobj);
-       spin_unlock_irqrestore(cmd->lock, flags);
+       spin_lock_irqsave(lock, flags);
+       kobject_put(&cmd->kobj);
+       spin_unlock_irqrestore(lock, flags);
 }
 
 static inline void command_get(struct command *cmd)
 {
-        kobject_get(&cmd->kobj);
+       kobject_get(&cmd->kobj);
 }
 
 
index 824e430486c2720dce930244b149dcd0650a60e5..830528dce0ca72daf59744ce49d1f5cf6a74fcdb 100644 (file)
@@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL");
 
 static int __init el3_init_module(void)
 {
+       int ret = 0;
        el3_cards = 0;
 
        if (debug >= 0)
@@ -1589,14 +1590,16 @@ static int __init el3_init_module(void)
        }
 
 #ifdef CONFIG_EISA
-       if (eisa_driver_register (&el3_eisa_driver) < 0) {
-               eisa_driver_unregister (&el3_eisa_driver);
-       }
+       ret = eisa_driver_register(&el3_eisa_driver);
 #endif
 #ifdef CONFIG_MCA
-       mca_register_driver(&el3_mca_driver);
+       {
+               int err = mca_register_driver(&el3_mca_driver);
+               if (ret == 0)
+                       ret = err;
+       }
 #endif
-       return 0;
+       return ret;
 }
 
 static void __exit el3_cleanup_module(void)
index e45a8f9597194810190d3c937f99deb854239f42..aa633fa95e648e5872fa00bf85ba8d6a355973b5 100644 (file)
@@ -1087,7 +1087,8 @@ config NE2000
          without a specific driver are compatible with NE2000.
 
          If you have a PCI NE2000 card however, say N here and Y to "PCI
-         NE2000 support", above. If you have a NE2000 card and are running on
+         NE2000 and clone support" under "EISA, VLB, PCI and on board
+         controllers" below. If you have a NE2000 card and are running on
          an MCA system (a bus system used on some IBM PS/2 computers and
          laptops), say N here and Y to "NE/2 (ne2000 MCA version) support",
          below.
index 0069f5fa973aa907ee0d4d33c5ab5addc95601bc..22fc5b869a6080d9735edd0b0cda6b331521bf7e 100644 (file)
@@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net_device *dev)
 #ifdef MODULE
 static struct net_device *de620_dev;
 
-int init_module(void)
+int __init init_module(void)
 {
        de620_dev = de620_probe(-1);
        if (IS_ERR(de620_dev))
index 430c628279b311b7c18b60240961ab6a3ee577b9..fb9dae302dcca350121a6297929de5ab510c26bc 100644 (file)
@@ -50,8 +50,8 @@
 
 */
 #define DRV_NAME       "D-Link DL2000-based linux driver"
-#define DRV_VERSION    "v1.17a"
-#define DRV_RELDATE    "2002/10/04"
+#define DRV_VERSION    "v1.17b"
+#define DRV_RELDATE    "2006/03/10"
 #include "dl2k.h"
 
 static char version[] __devinitdata =
@@ -765,7 +765,7 @@ rio_free_tx (struct net_device *dev, int irq)
                        break;
                skb = np->tx_skbuff[entry];
                pci_unmap_single (np->pdev,
-                                 np->tx_ring[entry].fraginfo,
+                                 np->tx_ring[entry].fraginfo & 0xffffffffffff,
                                  skb->len, PCI_DMA_TODEVICE);
                if (irq)
                        dev_kfree_skb_irq (skb);
@@ -892,14 +892,16 @@ receive_packet (struct net_device *dev)
 
                        /* Small skbuffs for short packets */
                        if (pkt_len > copy_thresh) {
-                               pci_unmap_single (np->pdev, desc->fraginfo,
+                               pci_unmap_single (np->pdev,
+                                                 desc->fraginfo & 0xffffffffffff,
                                                  np->rx_buf_sz,
                                                  PCI_DMA_FROMDEVICE);
                                skb_put (skb = np->rx_skbuff[entry], pkt_len);
                                np->rx_skbuff[entry] = NULL;
                        } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) {
                                pci_dma_sync_single_for_cpu(np->pdev,
-                                                           desc->fraginfo,
+                                                           desc->fraginfo & 
+                                                               0xffffffffffff,
                                                            np->rx_buf_sz,
                                                            PCI_DMA_FROMDEVICE);
                                skb->dev = dev;
@@ -910,7 +912,8 @@ receive_packet (struct net_device *dev)
                                                  pkt_len, 0);
                                skb_put (skb, pkt_len);
                                pci_dma_sync_single_for_device(np->pdev,
-                                                              desc->fraginfo,
+                                                              desc->fraginfo &
+                                                                0xffffffffffff,
                                                               np->rx_buf_sz,
                                                               PCI_DMA_FROMDEVICE);
                        }
@@ -1796,8 +1799,9 @@ rio_close (struct net_device *dev)
                np->rx_ring[i].fraginfo = 0;
                skb = np->rx_skbuff[i];
                if (skb) {
-                       pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo,
-                                         skb->len, PCI_DMA_FROMDEVICE);
+                       pci_unmap_single(np->pdev, 
+                                        np->rx_ring[i].fraginfo & 0xffffffffffff,
+                                        skb->len, PCI_DMA_FROMDEVICE);
                        dev_kfree_skb (skb);
                        np->rx_skbuff[i] = NULL;
                }
@@ -1805,8 +1809,9 @@ rio_close (struct net_device *dev)
        for (i = 0; i < TX_RING_SIZE; i++) {
                skb = np->tx_skbuff[i];
                if (skb) {
-                       pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo,
-                                         skb->len, PCI_DMA_TODEVICE);
+                       pci_unmap_single(np->pdev, 
+                                        np->tx_ring[i].fraginfo & 0xffffffffffff,
+                                        skb->len, PCI_DMA_TODEVICE);
                        dev_kfree_skb (skb);
                        np->tx_skbuff[i] = NULL;
                }
index 5b7d0f425af21a76966230ebdb97815bee869d21..4c4db96d0b7bd7b74064af24f59730d0f56d68b4 100644 (file)
@@ -2917,7 +2917,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                        if (!__pskb_pull_tail(skb, pull_size)) {
                                printk(KERN_ERR "__pskb_pull_tail failed.\n");
                                dev_kfree_skb_any(skb);
-                               return -EFAULT;
+                               return NETDEV_TX_OK;
                        }
                        len = skb->len - skb->data_len;
                }
index 72c1630977d6542696b8d4d7e05d146f92629fa8..73260364cba3f9c590dbc05775868d7ce62283c8 100644 (file)
@@ -74,7 +74,7 @@
 #define TX_RING_SIZE           512
 #define TX_DEF_PENDING         (TX_RING_SIZE - 1)
 #define TX_MIN_PENDING         64
-#define MAX_SKB_TX_LE          (4 + 2*MAX_SKB_FRAGS)
+#define MAX_SKB_TX_LE          (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS)
 
 #define STATUS_RING_SIZE       2048    /* 2 ports * (TX + 2*RX) */
 #define STATUS_LE_BYTES                (STATUS_RING_SIZE*sizeof(struct sky2_status_le))
@@ -622,8 +622,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
 
        /* Configure Rx MAC FIFO */
        sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
-       sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T),
-                    GMF_RX_CTRL_DEF);
+       sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
+                    GMF_OPER_ON | GMF_RX_F_FL_ON);
 
        /* Flush Rx MAC FIFO on any flow control or error */
        sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
@@ -995,6 +995,10 @@ static int sky2_rx_start(struct sky2_port *sky2)
                sky2_rx_add(sky2, re->mapaddr);
        }
 
+       /* Truncate oversize frames */
+       sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8);
+       sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
+
        /* Tell chip about available buffers */
        sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);
        sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX));
@@ -1145,6 +1149,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
        struct sky2_tx_le *le = NULL;
        struct tx_ring_info *re;
        unsigned i, len;
+       int avail;
        dma_addr_t mapping;
        u32 addr64;
        u16 mss;
@@ -1287,12 +1292,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
        re->idx = sky2->tx_prod;
        le->ctrl |= EOP;
 
+       avail = tx_avail(sky2);
+       if (mss != 0 || avail < TX_MIN_PENDING) {
+               le->ctrl |= FRC_STAT;
+               if (avail <= MAX_SKB_TX_LE)
+                       netif_stop_queue(dev);
+       }
+
        sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod,
                     &sky2->tx_last_put, TX_RING_SIZE);
 
-       if (tx_avail(sky2) <= MAX_SKB_TX_LE)
-               netif_stop_queue(dev);
-
 out_unlock:
        spin_unlock(&sky2->tx_lock);
 
@@ -1707,10 +1716,12 @@ static void sky2_tx_timeout(struct net_device *dev)
 
 
 #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
-/* Want receive buffer size to be multiple of 64 bits, and incl room for vlan */
+/* Want receive buffer size to be multiple of 64 bits
+ * and incl room for vlan and truncation
+ */
 static inline unsigned sky2_buf_size(int mtu)
 {
-       return roundup(mtu + ETH_HLEN + 4, 8);
+       return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8;
 }
 
 static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -1793,7 +1804,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2,
        if (!(status & GMR_FS_RX_OK))
                goto resubmit;
 
-       if ((status >> 16) != length || length > sky2->rx_bufsize)
+       if (length > sky2->netdev->mtu + ETH_HLEN)
                goto oversize;
 
        if (length < copybreak) {
@@ -3243,8 +3254,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
                }
        }
 
-       err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM,
-                         DRV_NAME, hw);
+       err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw);
        if (err) {
                printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
                       pci_name(pdev), pdev->irq);
index 15545620ab0e2d6a2efe77bdb07c99d2bc7a6938..b8f1524da5578b7d4b34f53713d370fae3e361da 100644 (file)
@@ -10543,8 +10543,6 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str)
                        strcat(str, "66MHz");
                else if (clock_ctrl == 6)
                        strcat(str, "100MHz");
-               else if (clock_ctrl == 7)
-                       strcat(str, "133MHz");
        } else {
                strcpy(str, "PCI:");
                if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED)
index d7fb3ffe06acbbf4f85f5b93b7a7c6db0f238b98..2d0cfbceee22452d05512d23bf57e286ed30a092 100644 (file)
@@ -1362,7 +1362,6 @@ static int de_open (struct net_device *dev)
 {
        struct de_private *de = dev->priv;
        int rc;
-       unsigned long flags;
 
        if (netif_msg_ifup(de))
                printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1376,18 +1375,20 @@ static int de_open (struct net_device *dev)
                return rc;
        }
 
-       rc = de_init_hw(de);
-       if (rc) {
-               printk(KERN_ERR "%s: h/w init failure, err=%d\n",
-                      dev->name, rc);
-               goto err_out_free;
-       }
+       dw32(IntrMask, 0);
 
        rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
        if (rc) {
                printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
                       dev->name, dev->irq, rc);
-               goto err_out_hw;
+               goto err_out_free;
+       }
+
+       rc = de_init_hw(de);
+       if (rc) {
+               printk(KERN_ERR "%s: h/w init failure, err=%d\n",
+                      dev->name, rc);
+               goto err_out_free_irq;
        }
 
        netif_start_queue(dev);
@@ -1395,11 +1396,8 @@ static int de_open (struct net_device *dev)
 
        return 0;
 
-err_out_hw:
-       spin_lock_irqsave(&de->lock, flags);
-       de_stop_hw(de);
-       spin_unlock_irqrestore(&de->lock, flags);
-
+err_out_free_irq:
+       free_irq(dev->irq, dev);
 err_out_free:
        de_free_rings(de);
        return rc;
@@ -1455,6 +1453,8 @@ static void de_tx_timeout (struct net_device *dev)
        synchronize_irq(dev->irq);
        de_clean_rings(de);
 
+       de_init_rings(de);
+
        de_init_hw(de);
        
        netif_wake_queue(dev);
index 50b8c6754b1ef333a225406a7465e9fdd2985dd6..a1ed2d9837402a31f6f46d90b4ae4c49bbd3e485 100644 (file)
@@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
 
        if (align)
                skb_reserve(skb, align);
-       if (memcpy_fromiovec(skb_put(skb, len), iv, len))
+       if (memcpy_fromiovec(skb_put(skb, len), iv, len)) {
+               tun->stats.rx_dropped++;
+               kfree_skb(skb);
                return -EFAULT;
+       }
 
        skb->dev = tun->dev;
        switch (tun->flags & TUN_TYPE_MASK) {
index 54ad93daca3c4b3900877a6feceb09710401b519..bb96ce1db08c314507d333a1c6145ebfb09006bf 100644 (file)
@@ -411,7 +411,7 @@ static int pcmcia_device_probe(struct device * dev)
         * pseudo devices, and if not, add the second one.
         */
        did = (struct pcmcia_device_id *) p_dev->dev.driver_data;
-       if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
+       if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
            (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
                pcmcia_add_pseudo_device(p_dev->socket);
 
index af1d5b404cee3fe90a0fe35cb872906511d96341..33157c84d1d3fccbf3a0d14c4d7e083c6355d547 100644 (file)
@@ -215,9 +215,10 @@ dasd_state_basic_to_known(struct dasd_device * device)
  * interrupt for this detection ccw uses the kernel event daemon to
  * trigger the call to dasd_change_state. All this is done in the
  * discipline code, see dasd_eckd.c.
- * After the analysis ccw is done (do_analysis returned 0 or error)
- * the block device is setup. Either a fake disk is added to allow
- * formatting or a proper device request queue is created.
+ * After the analysis ccw is done (do_analysis returned 0) the block
+ * device is setup.
+ * In case the analysis returns an error, the device setup is stopped
+ * (a fake disk was already added to allow formatting).
  */
 static inline int
 dasd_state_basic_to_ready(struct dasd_device * device)
@@ -227,13 +228,19 @@ dasd_state_basic_to_ready(struct dasd_device * device)
        rc = 0;
        if (device->discipline->do_analysis != NULL)
                rc = device->discipline->do_analysis(device);
-       if (rc)
+       if (rc) {
+               if (rc != -EAGAIN)
+                       device->state = DASD_STATE_UNFMT;
                return rc;
+       }
+       /* make disk known with correct capacity */
        dasd_setup_queue(device);
+       set_capacity(device->gdp, device->blocks << device->s2b_shift);
        device->state = DASD_STATE_READY;
-       if (dasd_scan_partitions(device) != 0)
+       rc = dasd_scan_partitions(device);
+       if (rc)
                device->state = DASD_STATE_BASIC;
-       return 0;
+       return rc;
 }
 
 /*
@@ -253,6 +260,15 @@ dasd_state_ready_to_basic(struct dasd_device * device)
        device->state = DASD_STATE_BASIC;
 }
 
+/*
+ * Back to basic.
+ */
+static inline void
+dasd_state_unfmt_to_basic(struct dasd_device * device)
+{
+       device->state = DASD_STATE_BASIC;
+}
+
 /*
  * Make the device online and schedule the bottom half to start
  * the requeueing of requests from the linux request queue to the
@@ -319,8 +335,12 @@ dasd_decrease_state(struct dasd_device *device)
        if (device->state == DASD_STATE_READY &&
            device->target <= DASD_STATE_BASIC)
                dasd_state_ready_to_basic(device);
-       
-       if (device->state == DASD_STATE_BASIC && 
+
+       if (device->state == DASD_STATE_UNFMT &&
+           device->target <= DASD_STATE_BASIC)
+               dasd_state_unfmt_to_basic(device);
+
+       if (device->state == DASD_STATE_BASIC &&
            device->target <= DASD_STATE_KNOWN)
                dasd_state_basic_to_known(device);
        
@@ -1722,7 +1742,7 @@ dasd_open(struct inode *inp, struct file *filp)
                goto out;
        }
 
-       if (device->state < DASD_STATE_BASIC) {
+       if (device->state <= DASD_STATE_BASIC) {
                DBF_DEV_EVENT(DBF_ERR, device, " %s",
                              " Cannot open unrecognized device");
                rc = -ENODEV;
index 65dc844b975cffb00a5d45251c48f6dbddf1269a..fce2835e7d19a5008427665b0ef9110e8c920e2a 100644 (file)
@@ -100,8 +100,6 @@ dasd_scan_partitions(struct dasd_device * device)
 {
        struct block_device *bdev;
 
-       /* Make the disk known. */
-       set_capacity(device->gdp, device->blocks << device->s2b_shift);
        bdev = bdget_disk(device->gdp, 0);
        if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0)
                return -ENODEV;
index 0592354cc604313ceced956df1a63a7f86a49ab9..7cb0b9e78a6a74df36b410ba15e56bb198f16527 100644 (file)
@@ -26,7 +26,7 @@
  *   new: the dasd_device structure is allocated.
  *   known: the discipline for the device is identified.
  *   basic: the device can do basic i/o.
- *   accept: the device is analysed (format is known).
+ *   unfmt: the device could not be analyzed (format is unknown).
  *   ready: partition detection is done and the device is can do block io.
  *   online: the device accepts requests from the block device queue.
  *
@@ -47,8 +47,9 @@
 #define DASD_STATE_NEW   0
 #define DASD_STATE_KNOWN  1
 #define DASD_STATE_BASIC  2
-#define DASD_STATE_READY  3
-#define DASD_STATE_ONLINE 4
+#define DASD_STATE_UNFMT  3
+#define DASD_STATE_READY  4
+#define DASD_STATE_ONLINE 5
 
 #include <linux/module.h>
 #include <linux/wait.h>
index 2d5da3c75ca712cf1f5abb3632993e8815ffa97a..1aa3c261718a6813f34105e42db85ce7c054513f 100644 (file)
@@ -93,6 +93,9 @@ dasd_devices_show(struct seq_file *m, void *v)
        case DASD_STATE_BASIC:
                seq_printf(m, "basic");
                break;
+       case DASD_STATE_UNFMT:
+               seq_printf(m, "unformatted");
+               break;
        case DASD_STATE_READY:
        case DASD_STATE_ONLINE:
                seq_printf(m, "active ");
index d6469baa7e16ef1698d7ff9ff27436aca11fc723..72118ee689549a3bdb499fcfc9b11d3feda2e753 100644 (file)
@@ -168,7 +168,7 @@ smsg_init(void)
                driver_unregister(&smsg_driver);
                return -EIO;    /* better errno ? */
        }
-       rc = iucv_connect (&smsg_pathid, 1, 0, "*MSG    ", 0, 0, 0, 0,
+       rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG    ", 0, 0, 0, 0,
                           smsg_handle, 0);
        if (rc) {
                printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG");
index f3763d2ccb866e31de2d3ff06ddda631f20eac7c..a37579ce6d763c89223787ba01b782633038397d 100644 (file)
@@ -2301,7 +2301,6 @@ static void receive_chars(struct uart_port *the_port)
        int read_count, request_count = IOC4_MAX_CHARS;
        struct uart_icount *icount;
        struct uart_info *info = the_port->info;
-       int flip = 0;
        unsigned long pflags;
 
        /* Make sure all the pointers are "good" ones */
@@ -2313,7 +2312,7 @@ static void receive_chars(struct uart_port *the_port)
        spin_lock_irqsave(&the_port->lock, pflags);
        tty = info->tty;
 
-       request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS - 2);
+       request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS);
 
        if (request_count > 0) {
                icount = &the_port->icount;
@@ -2326,8 +2325,7 @@ static void receive_chars(struct uart_port *the_port)
 
        spin_unlock_irqrestore(&the_port->lock, pflags);
 
-       if (flip)
-               tty_flip_buffer_push(tty);
+       tty_flip_buffer_push(tty);
 }
 
 /**
index 95fb4939c675f8119a2b630c6e23a380fc7a9d44..cc1faa31d124f0308a565970bc968245cf73f351 100644 (file)
@@ -71,6 +71,11 @@ static void uart_change_pm(struct uart_state *state, int pm_state);
 void uart_write_wakeup(struct uart_port *port)
 {
        struct uart_info *info = port->info;
+       /*
+        * This means you called this function _after_ the port was
+        * closed.  No cookie for you.
+        */
+       BUG_ON(!info);
        tasklet_schedule(&info->tlet);
 }
 
@@ -471,14 +476,26 @@ static void uart_flush_chars(struct tty_struct *tty)
 }
 
 static int
-uart_write(struct tty_struct *tty, const unsigned char * buf, int count)
+uart_write(struct tty_struct *tty, const unsigned char *buf, int count)
 {
        struct uart_state *state = tty->driver_data;
-       struct uart_port *port = state->port;
-       struct circ_buf *circ = &state->info->xmit;
+       struct uart_port *port;
+       struct circ_buf *circ;
        unsigned long flags;
        int c, ret = 0;
 
+       /*
+        * This means you called this function _after_ the port was
+        * closed.  No cookie for you.
+        */
+       if (!state || !state->info) {
+               WARN_ON(1);
+               return -EL3HLT;
+       }
+
+       port = state->port;
+       circ = &state->info->xmit;
+
        if (!circ->buf)
                return 0;
 
@@ -521,6 +538,15 @@ static void uart_flush_buffer(struct tty_struct *tty)
        struct uart_port *port = state->port;
        unsigned long flags;
 
+       /*
+        * This means you called this function _after_ the port was
+        * closed.  No cookie for you.
+        */
+       if (!state || !state->info) {
+               WARN_ON(1);
+               return;
+       }
+
        DPRINTK("uart_flush_buffer(%d) called\n", tty->index);
 
        spin_lock_irqsave(&port->lock, flags);
index 43e67d6c29d448a14923ec8c4df45973ac252030..60ea4a3f071396637de3fc4459a10aebc7c9d268 100644 (file)
@@ -820,7 +820,7 @@ static int __init sn_sal_module_init(void)
        int retval;
 
        if (!ia64_platform_is("sn2"))
-               return -ENODEV;
+               return 0;
 
        printk(KERN_INFO "sn_console: Console driver init\n");
 
index df8e5667b348efa317be6d5732e2e478162d0e22..466042808dafabec885e89da3b103712a8908ac7 100644 (file)
@@ -253,7 +253,7 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
 {
        unsigned char *src;
        unsigned int xindex, yindex, chipindex, linesize;
-       int i, count;
+       int i;
        unsigned char val;
        unsigned char bitmask, rightshift;
 
@@ -282,7 +282,6 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
                }
                ks108_writeb_data(par, chipindex, val);
                left++;
-               count++;
                if (bitmask == 0x80) {
                        bitmask = 1;
                        src++;
@@ -460,11 +459,11 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
        inode = file->f_dentry->d_inode;
        fbidx = iminor(inode);
        info = registered_fb[fbidx];
-       par = info->par;
 
        if (!info || !info->screen_base)
                return -ENODEV;
 
+       par = info->par;
        xres = info->var.xres;
        fbmemlength = (xres * info->var.yres)/8;
 
index bfc8a93b2c73baad26e81a034961c70df0999186..620c9a934e0ec10d8647f5e3702b3a265f971e46 100644 (file)
@@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
        unsigned char post_dividers[] = {1,2,4,8,3,6,12};
        u32 output_freq;
        u32 vclk;        /* in .01 MHz */
-       int i;
+       int i = 0;
        u32 n, d;
 
        vclk = 100000000 / period_in_ps;        /* convert units to 10 kHz */
@@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
        /* now, find an acceptable divider */
        for (i = 0; i < sizeof(post_dividers); i++) {
                output_freq = post_dividers[i] * vclk;
-               if (output_freq >= c.ppll_min && output_freq <= c.ppll_max)
+               if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) {
+                       pll->post_divider = post_dividers[i];
                        break;
+               }
        }
 
        /* calculate feedback divider */
        n = c.ref_divider * output_freq;
        d = c.ref_clk;
 
-       pll->post_divider = post_dividers[i];
        pll->feedback_divider = round_div(n, d);
        pll->vclk = vclk;
 
index 7f9838dceab50f05421f7d3a53064e54db6bbd56..98c05bc0de44ac88c1e979d047c6f493b2d7ab0b 100644 (file)
@@ -396,6 +396,10 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
                                s1[i] = *s;
                        i++;
                }
+
+               if (i > 4)
+                       i = 4;
+
        } while (*s++);
        if (second)
                s2[i] = 0;
index bd39bbd88d41e7042e7fa76bf2a35e1c3145ebbc..151fda8dded005fb4209a13ee5702e32108bb404 100644 (file)
@@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda
 
        new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL);
        if (unlikely(!new_bd))
-               return ERR_PTR(ENOMEM);
+               return ERR_PTR(-ENOMEM);
 
        init_MUTEX(&new_bd->sem);
        new_bd->props = bp;
index 9e32485ee7bbc448da71b86c7e89fd4b76ffb2ea..86908a60c630d9624fab519c24d1ab0f28091e3b 100644 (file)
@@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
 
        new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
        if (unlikely(!new_ld))
-               return ERR_PTR(ENOMEM);
+               return ERR_PTR(-ENOMEM);
 
        init_MUTEX(&new_ld->sem);
        new_ld->props = lp;
index ad416ae475963650a782e8c33b7f0e82a79cc298..7db42542eb19894be08530edb36940647ac62e6d 100644 (file)
@@ -1510,6 +1510,8 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                default:
                        printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
                                         "contact maintainer.\n", pdev->device);
+                       release_mem_region(addr, size);
+                       framebuffer_release(info);
                        return -ENODEV;
        }
 
index 6b8bd3cdf9c08f38fb9269c8da75a24b7267eb43..995b47c165a71cbb93c9bc05ec3c133cdeaea098 100644 (file)
@@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green,
        if (regno > 255)
                return 1;
 
-       switch (dinfo->depth) {
-       case 8:
-               {
-                       red >>= 8;
-                       green >>= 8;
-                       blue >>= 8;
+       if (dinfo->depth == 8) {
+               red >>= 8;
+               green >>= 8;
+               blue >>= 8;
+
+               intelfbhw_setcolreg(dinfo, regno, red, green, blue,
+                                   transp);
+       }
 
-                       intelfbhw_setcolreg(dinfo, regno, red, green, blue,
-                                           transp);
+       if (regno < 16) {
+               switch (dinfo->depth) {
+               case 15:
+                       dinfo->pseudo_palette[regno] = ((red & 0xf800) >>  1) |
+                               ((green & 0xf800) >>  6) |
+                               ((blue & 0xf800) >> 11);
+                       break;
+               case 16:
+                       dinfo->pseudo_palette[regno] = (red & 0xf800) |
+                               ((green & 0xfc00) >>  5) |
+                               ((blue  & 0xf800) >> 11);
+                       break;
+               case 24:
+                       dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
+                               (green & 0xff00) |
+                               ((blue  & 0xff00) >> 8);
+                       break;
                }
-               break;
-       case 15:
-               dinfo->pseudo_palette[regno] = ((red & 0xf800) >>  1) |
-                                              ((green & 0xf800) >>  6) |
-                                              ((blue & 0xf800) >> 11);
-               break;
-       case 16:
-               dinfo->pseudo_palette[regno] = (red & 0xf800) |
-                                              ((green & 0xfc00) >>  5) |
-                                              ((blue  & 0xf800) >> 11);
-               break;
-       case 24:
-               dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
-                                              (green & 0xff00) |
-                                              ((blue  & 0xff00) >> 8);
-               break;
        }
+
        return 0;
 }
 
index 3690b04190afbde7e88a687cde55c6232964e991..bd389709d23403d9b2d85950f267c78143838487 100644 (file)
@@ -17,7 +17,7 @@
 void DisableVGA(volatile STG4000REG __iomem *pSTGReg)
 {
        u32 tmp;
-       volatile u32 count, i;
+       volatile u32 count = 0, i;
 
        /* Reset the VGA registers */
        tmp = STG_READ_REG(SoftwareReset);
index a2e201dc40f774a57976d1b41201cfb9aa574031..b961d5601bd90a7242830a33b1fbe6e12f830de3 100644 (file)
@@ -486,10 +486,8 @@ static void vgaHWRestore(const struct fb_info *info,
 static inline int neo2200_sync(struct fb_info *info)
 {
        struct neofb_par *par = info->par;
-       int waitcycles;
 
-       while (readl(&par->neo2200->bltStat) & 1)
-               waitcycles++;
+       while (readl(&par->neo2200->bltStat) & 1);
        return 0;
 }
 
index e5d0f92eeae36613314f4bd347f9090777c07a02..feec47bdd47996dbe4ab22ee8fbbc3859585a8dd 100644 (file)
@@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device *pdev)
                goto bail;
        }
 
+       platform_set_drvdata(pdev, info);
        default_par = info->par;
        default_par->regs = ioremap_nocache(pdev->resource[1].start,
                        pdev->resource[1].end - pdev->resource[1].start +1);
@@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device *pdev)
                goto bail;
        }
 
-       platform_set_drvdata(pdev, info);
-
        printk(KERN_INFO "fb%d: %s frame buffer device\n",
               info->node, info->fix.id);
 
index ab727eaa7f43f3819ca45cff046a3bf057e28b0c..10e6b3aab9eaf18f7bd11824cfa63c12b88ba86e 100644 (file)
@@ -2021,8 +2021,8 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
 #if defined(CONFIG_FB_SAVAGE_I2C)
        savagefb_create_i2c_busses(info);
        savagefb_probe_i2c_connector(info, &par->edid);
-       kfree(par->edid);
        fb_edid_to_monspecs(par->edid, &info->monspecs);
+       kfree(par->edid);
        fb_videomode_to_modelist(info->monspecs.modedb,
                                 info->monspecs.modedb_len,
                                 &info->modelist);
index 3e7baf4c9fa8066be24cab44fb97e0aafd8fde5a..5e5328d682db52aee991d6b48fa11951395250ba 100644 (file)
@@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
        if (regno >= info->cmap.len || regno > 255) return 1;
    
        switch (info->fix.visual) {
-               case FB_VISUAL_PSEUDOCOLOR:
-                       rgbcol =(((u32)red   & 0xff00) << 8) |
-                               (((u32)green & 0xff00) << 0) |
-                               (((u32)blue  & 0xff00) >> 8);
-                       do_setpalentry(par, regno, rgbcol);
-                       break;
-               /* Truecolor has no hardware color palettes. */
-               case FB_VISUAL_TRUECOLOR:
+       case FB_VISUAL_PSEUDOCOLOR:
+               rgbcol =(((u32)red   & 0xff00) << 8) |
+                       (((u32)green & 0xff00) << 0) |
+                       (((u32)blue  & 0xff00) >> 8);
+               do_setpalentry(par, regno, rgbcol);
+               break;
+       /* Truecolor has no hardware color palettes. */
+       case FB_VISUAL_TRUECOLOR:
+               if (regno < 16) {
                        rgbcol = (CNVT_TOHW( red, info->var.red.length) <<
                                  info->var.red.offset) |
-                                (CNVT_TOHW( green, info->var.green.length) <<
-                                 info->var.green.offset) |
-                                (CNVT_TOHW( blue, info->var.blue.length) <<
-                                 info->var.blue.offset) |
-                                (CNVT_TOHW( transp, info->var.transp.length) <<
-                                 info->var.transp.offset);
-                               par->palette[regno] = rgbcol;
-                       break;
-               default:
-                       DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
-                       break;
+                               (CNVT_TOHW( green, info->var.green.length) <<
+                                info->var.green.offset) |
+                               (CNVT_TOHW( blue, info->var.blue.length) <<
+                                info->var.blue.offset) |
+                               (CNVT_TOHW( transp, info->var.transp.length) <<
+                                info->var.transp.offset);
+                       par->palette[regno] = rgbcol;
+               }
+
+               break;
+       default:
+               DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
+               break;
        }
+
        return 0;
 }
 
index 1a6d08761f3942da8e56c3f79518bbfc32bf09ac..f86a28d1d6a6ac08168a891351e059a59f583859 100644 (file)
@@ -111,7 +111,6 @@ static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc,
        if (!rc)
                return;
 
-       dprintk(DEBUG_9P, "tcall id %d rcall id %d\n", tc->id, rc->id);
        v9ses = a;
        if (rc->id == RCLUNK)
                v9fs_put_idpool(fid, &v9ses->fidpool);
index 1a28ef97a3d116f9aa307443794ffe6314fefb60..5b2ce21b10fab55b6bf6e5db54b615d3c961c2ea 100644 (file)
@@ -80,6 +80,7 @@ static int v9fs_fd_send(struct v9fs_transport *trans, void *v, int len)
        if (!trans || trans->status != Connected || !ts)
                return -EIO;
 
+       oldfs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
        ret = vfs_write(ts->out_file, (void __user *)v, len, &ts->out_file->f_pos);
index dce729d428699c7653f18cdb0b6f5ff51ee40a7a..3ad8455f8577b290a869d20d7a66d4b66ba85de2 100644 (file)
@@ -265,8 +265,7 @@ v9fs_create(struct v9fs_session_info *v9ses, u32 pfid, char *name,
        fid = v9fs_get_idpool(&v9ses->fidpool);
        if (fid < 0) {
                eprintk(KERN_WARNING, "no free fids available\n");
-               err = -ENOSPC;
-               goto error;
+               return -ENOSPC;
        }
 
        err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall);
@@ -313,8 +312,7 @@ v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry *dentry)
        nfid = v9fs_get_idpool(&v9ses->fidpool);
        if (nfid < 0) {
                eprintk(KERN_WARNING, "no free fids available\n");
-               err = -ENOSPC;
-               goto error;
+               return ERR_PTR(-ENOSPC);
        }
 
        err = v9fs_t_walk(v9ses, fid, nfid, (char *) dentry->d_name.name,
@@ -612,7 +610,7 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
        int result = 0;
 
        dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
-               dir, dentry->d_iname, dentry, nameidata);
+               dir, dentry->d_name.name, dentry, nameidata);
 
        sb = dir->i_sb;
        v9ses = v9fs_inode2v9ses(dir);
index cdf787ee08debcd70bdd7bf68d7faca85d12af59..d05318fa684e9bc645b1c96bfc6e12521185ab3f 100644 (file)
@@ -156,7 +156,6 @@ static struct super_block *v9fs_get_sb(struct file_system_type
        stat_result = v9fs_t_stat(v9ses, newfid, &fcall);
        if (stat_result < 0) {
                dprintk(DEBUG_ERROR, "stat error\n");
-               kfree(fcall);
                v9fs_t_clunk(v9ses, newfid);
        } else {
                /* Setup the Root Inode */
index 537ac70edfe5c75c3424645d1cb199d0094c8208..c666769a875d2fc0e80927caf6db038b036bc42b 100644 (file)
@@ -446,7 +446,7 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)
        ifr = ifc.ifc_req;
        ifr32 = compat_ptr(ifc32.ifcbuf);
        for (i = 0, j = 0;
-             i + sizeof (struct ifreq32) < ifc32.ifc_len && j < ifc.ifc_len;
+             i + sizeof (struct ifreq32) <= ifc32.ifc_len && j < ifc.ifc_len;
             i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) {
                if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32)))
                        return -EFAULT;
index a173bba326666e322ca92813c1667671f783f65e..11dc83092d4aa48c78650f6dee4b48b834d25d7e 100644 (file)
@@ -1736,7 +1736,7 @@ void __init vfs_caches_init(unsigned long mempages)
                        SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
        filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0,
-                       SLAB_HWCACHE_ALIGN|SLAB_PANIC, filp_ctor, filp_dtor);
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
        dcache_init(mempages);
        inode_init(mempages);
index 3fc4238e9703dca7b67b3fe9f81a221376901e45..0384e539b88f47a18c32c0b6dce63c8f0e4558e0 100644 (file)
@@ -1624,15 +1624,14 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page,
         * For "nobh" option,  we can only work if we don't need to
         * read-in the page - otherwise we create buffers to do the IO.
         */
-       if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH)) {
-               if (PageUptodate(page)) {
-                       kaddr = kmap_atomic(page, KM_USER0);
-                       memset(kaddr + offset, 0, length);
-                       flush_dcache_page(page);
-                       kunmap_atomic(kaddr, KM_USER0);
-                       set_page_dirty(page);
-                       goto unlock;
-               }
+       if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) &&
+            ext3_should_writeback_data(inode) && PageUptodate(page)) {
+               kaddr = kmap_atomic(page, KM_USER0);
+               memset(kaddr + offset, 0, length);
+               flush_dcache_page(page);
+               kunmap_atomic(kaddr, KM_USER0);
+               set_page_dirty(page);
+               goto unlock;
        }
 
        if (!page_has_buffers(page))
index 8bd8ac0777046e39c466fae28cec573140e72c29..b8f5cd1e540d40870ed98a2a25dcdeb06be8f9b4 100644 (file)
@@ -2141,7 +2141,8 @@ retry:
                 * We have a transaction open.  All is sweetness.  It also sets
                 * i_size in generic_commit_write().
                 */
-               err = page_symlink(inode, symname, l);
+               err = __page_symlink(inode, symname, l,
+                               mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
                if (err) {
                        ext3_dec_count(handle, inode);
                        ext3_mark_inode_dirty(handle, inode);
index 768b581675433ed0e02eb0a9bcf35288de7adca5..44fabeaa9415b315155b7bf92497491a8ef1bb08 100644 (file)
@@ -5,6 +5,7 @@
  *  Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  */
 
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/capability.h>
 #include <linux/cdev.h>
 #include <linux/fsnotify.h>
+#include <linux/sysctl.h>
+#include <linux/percpu_counter.h>
+
+#include <asm/atomic.h>
 
 /* sysctl tunables... */
 struct files_stat_struct files_stat = {
        .max_files = NR_FILE
 };
 
-EXPORT_SYMBOL(files_stat); /* Needed by unix.o */
-
 /* public. Not pretty! */
- __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock);
+__cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock);
 
-static DEFINE_SPINLOCK(filp_count_lock);
+static struct percpu_counter nr_files __cacheline_aligned_in_smp;
 
-/* slab constructors and destructors are called from arbitrary
- * context and must be fully threaded - use a local spinlock
- * to protect files_stat.nr_files
- */
-void filp_ctor(void *objp, struct kmem_cache *cachep, unsigned long cflags)
+static inline void file_free_rcu(struct rcu_head *head)
 {
-       if ((cflags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-           SLAB_CTOR_CONSTRUCTOR) {
-               unsigned long flags;
-               spin_lock_irqsave(&filp_count_lock, flags);
-               files_stat.nr_files++;
-               spin_unlock_irqrestore(&filp_count_lock, flags);
-       }
+       struct file *f =  container_of(head, struct file, f_u.fu_rcuhead);
+       kmem_cache_free(filp_cachep, f);
 }
 
-void filp_dtor(void *objp, struct kmem_cache *cachep, unsigned long dflags)
+static inline void file_free(struct file *f)
 {
-       unsigned long flags;
-       spin_lock_irqsave(&filp_count_lock, flags);
-       files_stat.nr_files--;
-       spin_unlock_irqrestore(&filp_count_lock, flags);
+       percpu_counter_dec(&nr_files);
+       call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
 }
 
-static inline void file_free_rcu(struct rcu_head *head)
+/*
+ * Return the total number of open files in the system
+ */
+static int get_nr_files(void)
 {
-       struct file *f =  container_of(head, struct file, f_u.fu_rcuhead);
-       kmem_cache_free(filp_cachep, f);
+       return percpu_counter_read_positive(&nr_files);
 }
 
-static inline void file_free(struct file *f)
+/*
+ * Return the maximum number of open files in the system
+ */
+int get_max_files(void)
 {
-       call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
+       return files_stat.max_files;
 }
+EXPORT_SYMBOL_GPL(get_max_files);
+
+/*
+ * Handle nr_files sysctl
+ */
+#if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
+int proc_nr_files(ctl_table *table, int write, struct file *filp,
+                     void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       files_stat.nr_files = get_nr_files();
+       return proc_dointvec(table, write, filp, buffer, lenp, ppos);
+}
+#else
+int proc_nr_files(ctl_table *table, int write, struct file *filp,
+                     void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       return -ENOSYS;
+}
+#endif
 
 /* Find an unused file structure and return a pointer to it.
  * Returns NULL, if there are no more free file structures or
@@ -78,14 +94,20 @@ struct file *get_empty_filp(void)
        /*
         * Privileged users can go above max_files
         */
-       if (files_stat.nr_files >= files_stat.max_files &&
-                               !capable(CAP_SYS_ADMIN))
-               goto over;
+       if (get_nr_files() >= files_stat.max_files && !capable(CAP_SYS_ADMIN)) {
+               /*
+                * percpu_counters are inaccurate.  Do an expensive check before
+                * we go and fail.
+                */
+               if (percpu_counter_sum(&nr_files) >= files_stat.max_files)
+                       goto over;
+       }
 
        f = kmem_cache_alloc(filp_cachep, GFP_KERNEL);
        if (f == NULL)
                goto fail;
 
+       percpu_counter_inc(&nr_files);
        memset(f, 0, sizeof(*f));
        if (security_file_alloc(f))
                goto fail_sec;
@@ -101,10 +123,10 @@ struct file *get_empty_filp(void)
 
 over:
        /* Ran out of filps - report that */
-       if (files_stat.nr_files > old_max) {
+       if (get_nr_files() > old_max) {
                printk(KERN_INFO "VFS: file-max limit %d reached\n",
-                                       files_stat.max_files);
-               old_max = files_stat.nr_files;
+                                       get_max_files());
+               old_max = get_nr_files();
        }
        goto fail;
 
@@ -276,4 +298,5 @@ void __init files_init(unsigned long mempages)
        if (files_stat.max_files < NR_FILE)
                files_stat.max_files = NR_FILE;
        files_defer_init();
+       percpu_counter_init(&nr_files);
 } 
index b635e167a3faf721763e1605265a634606bb67fd..d4d0c41490cddad3a99c89727dd848a405693520 100644 (file)
@@ -406,7 +406,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
        int err = 0, pointed = 0;
        struct jffs2_eraseblock *jeb;
        unsigned char *buffer;
-       uint32_t crc, ofs, retlen, len;
+       uint32_t crc, ofs, len;
+       size_t retlen;
 
        BUG_ON(tn->csize == 0);
 
index 5f0652df5d47dab051839cf88218e2c353c28733..f1695642d0f7f218757fbdcff49ac0e0ed440a35 100644 (file)
@@ -112,7 +112,7 @@ static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_r
  *         negative error code on failure.
  */
 static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref,
-                               struct jffs2_raw_dirent *rd, uint32_t read, struct jffs2_full_dirent **fdp,
+                               struct jffs2_raw_dirent *rd, size_t read, struct jffs2_full_dirent **fdp,
                                uint32_t *latest_mctime, uint32_t *mctime_ver)
 {
        struct jffs2_full_dirent *fd;
index 3e51dd1da8aa7f271dc1205139d9dc0d658cec52..cf55b221fc2b7dc86d9778a4c6d5c02a38fdbb70 100644 (file)
@@ -233,7 +233,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
                c->nextblock->dirty_size = 0;
        }
 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
-       if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
+       if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
                /* If we're going to start writing into a block which already
                   contains data, and the end of the data isn't page-aligned,
                   skip a little and align it. */
index 557dcf395ca122c1d30ca53b4b36293dab78da1f..8dc2b038d5d9c8965b71ec08bd1e5432af62f97e 100644 (file)
@@ -2613,13 +2613,15 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
        }
 }
 
-int page_symlink(struct inode *inode, const char *symname, int len)
+int __page_symlink(struct inode *inode, const char *symname, int len,
+               gfp_t gfp_mask)
 {
        struct address_space *mapping = inode->i_mapping;
-       struct page *page = grab_cache_page(mapping, 0);
+       struct page *page;
        int err = -ENOMEM;
        char *kaddr;
 
+       page = find_or_create_page(mapping, 0, gfp_mask);
        if (!page)
                goto fail;
        err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
@@ -2654,6 +2656,12 @@ fail:
        return err;
 }
 
+int page_symlink(struct inode *inode, const char *symname, int len)
+{
+       return __page_symlink(inode, symname, len,
+                       mapping_gfp_mask(inode->i_mapping));
+}
+
 struct inode_operations page_symlink_inode_operations = {
        .readlink       = generic_readlink,
        .follow_link    = page_follow_link_light,
@@ -2672,6 +2680,7 @@ EXPORT_SYMBOL(lookup_one_len);
 EXPORT_SYMBOL(page_follow_link_light);
 EXPORT_SYMBOL(page_put_link);
 EXPORT_SYMBOL(page_readlink);
+EXPORT_SYMBOL(__page_symlink);
 EXPORT_SYMBOL(page_symlink);
 EXPORT_SYMBOL(page_symlink_inode_operations);
 EXPORT_SYMBOL(path_lookup);
index 78010ad60e47e39da1ad55ec0c20beb75f0b266a..1e4a93835fed7e11b6c7eea7e7196d3cea9ed19b 100644 (file)
@@ -52,6 +52,7 @@ int
 ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
 {
        int blocksize, offset, size;
+       loff_t i_size;
        dasd_information_t *info;
        struct hd_geometry *geo;
        char type[5] = {0,};
@@ -63,6 +64,13 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
        unsigned char *data;
        Sector sect;
 
+       blocksize = bdev_hardsect_size(bdev);
+       if (blocksize <= 0)
+               return 0;
+       i_size = i_size_read(bdev->bd_inode);
+       if (i_size == 0)
+               return 0;
+
        if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL)
                goto out_noinfo;
        if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL)
@@ -73,9 +81,6 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
        if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 ||
            ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
                goto out_noioctl;
-       
-       if ((blocksize = bdev_hardsect_size(bdev)) <= 0)
-               goto out_badsect;
 
        /*
         * Get volume label, extract name and type.
@@ -111,7 +116,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
                } else {
                        printk("CMS1/%8s:", name);
                        offset = (info->label_block + 1);
-                       size = bdev->bd_inode->i_size >> 9;
+                       size = i_size >> 9;
                }
                put_partition(state, 1, offset*(blocksize >> 9),
                                 size-offset*(blocksize >> 9));
@@ -168,7 +173,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
                else
                        printk("(nonl)/%8s:", name);
                offset = (info->label_block + 1);
-               size = (bdev->bd_inode->i_size >> 9);
+               size = i_size >> 9;
                put_partition(state, 1, offset*(blocksize >> 9),
                                 size-offset*(blocksize >> 9));
        }
@@ -180,7 +185,6 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
        return 1;
        
 out_readerr:
-out_badsect:
 out_noioctl:
        kfree(label);
 out_nolab:
index d722579df79a679314750e9adf0be617a5729887..8aada8e426f44f12095b59810c5f270bc128f014 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -605,7 +605,7 @@ struct file_operations rdwr_fifo_fops = {
        .fasync         = pipe_rdwr_fasync,
 };
 
-struct file_operations read_pipe_fops = {
+static struct file_operations read_pipe_fops = {
        .llseek         = no_llseek,
        .read           = pipe_read,
        .readv          = pipe_readv,
@@ -617,7 +617,7 @@ struct file_operations read_pipe_fops = {
        .fasync         = pipe_read_fasync,
 };
 
-struct file_operations write_pipe_fops = {
+static struct file_operations write_pipe_fops = {
        .llseek         = no_llseek,
        .read           = bad_pipe_r,
        .write          = pipe_write,
@@ -629,7 +629,7 @@ struct file_operations write_pipe_fops = {
        .fasync         = pipe_write_fasync,
 };
 
-struct file_operations rdwr_pipe_fops = {
+static struct file_operations rdwr_pipe_fops = {
        .llseek         = no_llseek,
        .read           = pipe_read,
        .readv          = pipe_readv,
index 395e582ee5425cab1ad65177d5f8c02bedc9e932..d04cff2273b681a9944f3a319af83114340341cb 100644 (file)
@@ -1045,10 +1045,14 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
        }
 
        inode->i_uid = le32_to_cpu(fe->uid);
-       if ( inode->i_uid == -1 ) inode->i_uid = UDF_SB(inode->i_sb)->s_uid;
+       if (inode->i_uid == -1 || UDF_QUERY_FLAG(inode->i_sb,
+                                       UDF_FLAG_UID_IGNORE))
+               inode->i_uid = UDF_SB(inode->i_sb)->s_uid;
 
        inode->i_gid = le32_to_cpu(fe->gid);
-       if ( inode->i_gid == -1 ) inode->i_gid = UDF_SB(inode->i_sb)->s_gid;
+       if (inode->i_gid == -1 || UDF_QUERY_FLAG(inode->i_sb,
+                                       UDF_FLAG_GID_IGNORE))
+               inode->i_gid = UDF_SB(inode->i_sb)->s_gid;
 
        inode->i_nlink = le16_to_cpu(fe->fileLinkCount);
        if (!inode->i_nlink)
@@ -1335,10 +1339,14 @@ udf_update_inode(struct inode *inode, int do_sync)
                return err;
        }
 
-       if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid)
+       if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET))
+               fe->uid = cpu_to_le32(-1);
+       else if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid)
                fe->uid = cpu_to_le32(inode->i_uid);
 
-       if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid)
+       if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET))
+               fe->gid = cpu_to_le32(-1);
+       else if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid)
                fe->gid = cpu_to_le32(inode->i_gid);
 
        udfperms =      ((inode->i_mode & S_IRWXO)     ) |
index 4a6f49adc609b051b16bea2e5e59d7719b1e5ed7..368d8f81fe54777c8c0f3a6e2e9d7aac2b912562 100644 (file)
@@ -269,7 +269,7 @@ enum {
        Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock,
        Opt_anchor, Opt_volume, Opt_partition, Opt_fileset,
        Opt_rootdir, Opt_utf8, Opt_iocharset,
-       Opt_err
+       Opt_err, Opt_uforget, Opt_uignore, Opt_gforget, Opt_gignore
 };
 
 static match_table_t tokens = {
@@ -282,6 +282,10 @@ static match_table_t tokens = {
        {Opt_adinicb, "adinicb"},
        {Opt_shortad, "shortad"},
        {Opt_longad, "longad"},
+       {Opt_uforget, "uid=forget"},
+       {Opt_uignore, "uid=ignore"},
+       {Opt_gforget, "gid=forget"},
+       {Opt_gignore, "gid=ignore"},
        {Opt_gid, "gid=%u"},
        {Opt_uid, "uid=%u"},
        {Opt_umask, "umask=%o"},
@@ -414,6 +418,18 @@ udf_parse_options(char *options, struct udf_options *uopt)
                                uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
                                break;
 #endif
+                       case Opt_uignore:
+                               uopt->flags |= (1 << UDF_FLAG_UID_IGNORE);
+                               break;
+                       case Opt_uforget:
+                               uopt->flags |= (1 << UDF_FLAG_UID_FORGET);
+                               break;
+                       case Opt_gignore:
+                           uopt->flags |= (1 << UDF_FLAG_GID_IGNORE);
+                               break;
+                       case Opt_gforget:
+                           uopt->flags |= (1 << UDF_FLAG_GID_FORGET);
+                               break;
                        default:
                                printk(KERN_ERR "udf: bad mount option \"%s\" "
                                                "or missing value\n", p);
index 663669810be60afbae65f2a262a657f98bfa7f64..110f8d62616f4fa513c0fbd123e7292e92793faf 100644 (file)
 #define UDF_FLAG_VARCONV               8
 #define UDF_FLAG_NLS_MAP               9
 #define UDF_FLAG_UTF8                  10
+#define UDF_FLAG_UID_FORGET     11    /* save -1 for uid to disk */
+#define UDF_FLAG_UID_IGNORE     12    /* use sb uid instead of on disk uid */
+#define UDF_FLAG_GID_FORGET     13
+#define UDF_FLAG_GID_IGNORE     14
 
 #define UDF_PART_FLAG_UNALLOC_BITMAP   0x0001
 #define UDF_PART_FLAG_UNALLOC_TABLE    0x0002
index 4dc8ddb401c15828797b4a7e21586e4b6d3e3418..09ec447fe2af5de7cb67b142257f28fadb805413 100644 (file)
@@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u16 *addr)
 
 #define __get_unaligned(ptr, size) ({          \
        const void *__gu_p = ptr;               \
-       __typeof__(*(ptr)) val;                 \
+       __u64 val;                              \
        switch (size) {                         \
        case 1:                                 \
                val = *(const __u8 *)__gu_p;    \
@@ -95,7 +95,7 @@ static inline void __ustw(__u16 val, __u16 *addr)
        default:                                \
                bad_unaligned_access_length();  \
        };                                      \
-       val;                                    \
+       (__typeof__(*(ptr)))val;                \
 })
 
 #define __put_unaligned(val, ptr, size)                \
index d30b8571573fd7dcb87d225f287b746c85cbdd8f..ff9ac8d19eb2584565cb5d8f93b196dc929cbc2d 100644 (file)
@@ -137,6 +137,8 @@ void switch_APIC_timer_to_ipi(void *cpumask);
 void switch_ipi_to_APIC_timer(void *cpumask);
 #define ARCH_APICTIMER_STOPS_ON_C3     1
 
+extern int timer_over_8254;
+
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline void lapic_shutdown(void) { }
 
index a4a84d5c65d50eff5cfeca8239a8c6bb16cf71c1..862e497c26453070674af81cd0786f5d1c5ad30d 100644 (file)
@@ -55,6 +55,7 @@ static inline int atomic_inc_and_test(atomic_t *v)
 }
 
 #ifdef CONFIG_RMW_INSNS
+
 static inline int atomic_add_return(int i, atomic_t *v)
 {
        int t, tmp;
@@ -82,7 +83,12 @@ static inline int atomic_sub_return(int i, atomic_t *v)
                        : "g" (i), "2" (atomic_read(v)));
        return t;
 }
+
+#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
+
 #else /* !CONFIG_RMW_INSNS */
+
 static inline int atomic_add_return(int i, atomic_t * v)
 {
        unsigned long flags;
@@ -110,6 +116,32 @@ static inline int atomic_sub_return(int i, atomic_t * v)
 
        return t;
 }
+
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
+{
+       unsigned long flags;
+       int prev;
+
+       local_irq_save(flags);
+       prev = atomic_read(v);
+       if (prev == old)
+               atomic_set(v, new);
+       local_irq_restore(flags);
+       return prev;
+}
+
+static inline int atomic_xchg(atomic_t *v, int new)
+{
+       unsigned long flags;
+       int prev;
+
+       local_irq_save(flags);
+       prev = atomic_read(v);
+       atomic_set(v, new);
+       local_irq_restore(flags);
+       return prev;
+}
+
 #endif /* !CONFIG_RMW_INSNS */
 
 #define atomic_dec_return(v)   atomic_sub_return(1, (v))
@@ -139,9 +171,6 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *v)
        __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask));
 }
 
-#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-
 #define atomic_add_unless(v, a, u)                             \
 ({                                                             \
        int c, old;                                             \
index ca5cec97e16711a02b5800d18b88fd4b94020b4f..34755c0a63988e21121a33c943fbada2234bb7da 100644 (file)
@@ -26,6 +26,9 @@
  *  <linux/vt_buffer.h> has already done the right job for us.
  */
 
+#undef scr_writew
+#undef scr_readw
+
 static inline void scr_writew(u16 val, volatile u16 *addr)
 {
        *addr = cpu_to_le16(val);
index 90d005bb4d1cf976b6b28d61464bfe7750515096..5638518968c3d8a9b2c543983d5eb389505ca0b5 100644 (file)
@@ -20,6 +20,8 @@
 #define PPC_FEATURE_POWER5_PLUS                0x00020000
 #define PPC_FEATURE_CELL               0x00010000
 #define PPC_FEATURE_BOOKE              0x00008000
+#define PPC_FEATURE_SMT                        0x00004000
+#define PPC_FEATURE_ICACHE_SNOOP       0x00002000
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
index eb392032e19b8e39680395c548f20aa58c3f8e7b..5207758a6dd9d4b760623dd2218d848964f7da9b 100644 (file)
@@ -118,6 +118,8 @@ static inline void pci_addr_cache_build(void) { }
 
 static inline void eeh_add_device_early(struct device_node *dn) { }
 
+static inline void eeh_add_device_late(struct pci_dev *dev) { }
+
 static inline void eeh_remove_device(struct pci_dev *dev) { }
 
 static inline void eeh_add_device_tree_early(struct device_node *dn) { }
index bda2f217e6fe4a79a05ae8c7d9c291062f1122cd..6a2af2f6853b368ad8765de253814e1a1f0f090e 100644 (file)
@@ -93,7 +93,8 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
                        "mfxer  %0\n"
                        "std    %0, 296(%2)\n"
                        : "=&r" (tmp1), "=&r" (tmp2)
-                       : "b" (newregs));
+                       : "b" (newregs)
+                       : "memory");
        }
 }
 #else
index e9590c06ad9276541a191ec1f3a3057452c7bde9..80a7832d272177ec255189ba68b361a29d83df12 100644 (file)
@@ -88,4 +88,4 @@
     (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
 
 #define pud_ERROR(e) \
-       printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pud_val(e))
+       printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e))
index 237fc2b729745121069423ae767ae38e181f2de9..ffc7462d77ba752f1d803a73326a09a48531f026 100644 (file)
@@ -37,7 +37,6 @@ struct thread_info {
        int             preempt_count;          /* 0 => preemptable,
                                                   <0 => BUG */
        struct restart_block restart_block;
-       void __user *nvgprs_frame;
        /* low level flags - has atomic operations done on it */
        unsigned long   flags ____cacheline_aligned_in_smp;
 };
@@ -120,7 +119,6 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_MEMDIE             10
 #define TIF_SECCOMP            11      /* secure computing */
 #define TIF_RESTOREALL         12      /* Restore all regs (implies NOERROR) */
-#define TIF_SAVE_NVGPRS                13      /* Save r14-r31 in signal frame */
 #define TIF_NOERROR            14      /* Force successful syscall return */
 #define TIF_RESTORE_SIGMASK    15      /* Restore signal mask in do_signal */
 
@@ -137,15 +135,13 @@ static inline struct thread_info *current_thread_info(void)
 #define _TIF_SINGLESTEP                (1<<TIF_SINGLESTEP)
 #define _TIF_SECCOMP           (1<<TIF_SECCOMP)
 #define _TIF_RESTOREALL                (1<<TIF_RESTOREALL)
-#define _TIF_SAVE_NVGPRS       (1<<TIF_SAVE_NVGPRS)
 #define _TIF_NOERROR           (1<<TIF_NOERROR)
 #define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
 #define _TIF_SYSCALL_T_OR_A    (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP)
 
 #define _TIF_USER_WORK_MASK    (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
-                                _TIF_NEED_RESCHED | _TIF_RESTOREALL | \
-                                _TIF_RESTORE_SIGMASK)
-#define _TIF_PERSYSCALL_MASK   (_TIF_RESTOREALL|_TIF_NOERROR|_TIF_SAVE_NVGPRS)
+                                _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
+#define _TIF_PERSYSCALL_MASK   (_TIF_RESTOREALL|_TIF_NOERROR)
 
 #endif /* __KERNEL__ */
 
index 8fad50f8e3890d9f267ec3e7361d619390557f38..ae7dfb790df3b5ebcd2c1e5e0f695c31553c306d 100644 (file)
@@ -696,6 +696,8 @@ COMPATIBLE_IOCTL(MEMLOCK)
 COMPATIBLE_IOCTL(MEMUNLOCK)
 COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
 COMPATIBLE_IOCTL(MEMGETREGIONINFO)
+COMPATIBLE_IOCTL(MEMGETBADBLOCK)
+COMPATIBLE_IOCTL(MEMSETBADBLOCK)
 /* NBD */
 ULONG_IOCTL(NBD_SET_SOCK)
 ULONG_IOCTL(NBD_SET_BLKSIZE)
index 418b6101b59a02d8b9efb7501e3de51808a59f95..9901b850f2e466158556711303829d6d114686ce 100644 (file)
@@ -60,8 +60,6 @@ extern void put_filp(struct file *);
 extern int get_unused_fd(void);
 extern void FASTCALL(put_unused_fd(unsigned int fd));
 struct kmem_cache;
-extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags);
-extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags);
 
 extern struct file ** alloc_fd_array(int);
 extern void free_fd_array(struct file **, int);
index e059da9470076a7af7a2a68e76bd29605369e75a..128d0082522c4ad067bbffd4199b879ba79c977b 100644 (file)
@@ -35,6 +35,7 @@ struct files_stat_struct {
        int max_files;          /* tunable */
 };
 extern struct files_stat_struct files_stat;
+extern int get_max_files(void);
 
 struct inodes_stat_t {
        int nr_inodes;
@@ -1418,9 +1419,6 @@ extern int is_bad_inode(struct inode *);
 extern struct file_operations read_fifo_fops;
 extern struct file_operations write_fifo_fops;
 extern struct file_operations rdwr_fifo_fops;
-extern struct file_operations read_pipe_fops;
-extern struct file_operations write_pipe_fops;
-extern struct file_operations rdwr_pipe_fops;
 
 extern int fs_may_remount_ro(struct super_block *);
 
@@ -1666,6 +1664,8 @@ extern int vfs_follow_link(struct nameidata *, const char *);
 extern int page_readlink(struct dentry *, char __user *, int);
 extern void *page_follow_link_light(struct dentry *, struct nameidata *);
 extern void page_put_link(struct dentry *, struct nameidata *, void *);
+extern int __page_symlink(struct inode *inode, const char *symname, int len,
+               gfp_t gfp_mask);
 extern int page_symlink(struct inode *inode, const char *symname, int len);
 extern struct inode_operations page_symlink_inode_operations;
 extern int generic_readlink(struct dentry *, char __user *, int);
index 20f9148e38d930e23d33c8c80376c7e6018ea9e0..7851e6b520cf013f4091cd4932f69cb4b00e76b5 100644 (file)
@@ -157,9 +157,9 @@ extern void FASTCALL(free_cold_page(struct page *page));
 
 void page_alloc_init(void);
 #ifdef CONFIG_NUMA
-void drain_remote_pages(void);
+void drain_node_pages(int node);
 #else
-static inline void drain_remote_pages(void) { };
+static inline void drain_node_pages(int node) { };
 #endif
 
 #endif /* __LINUX_GFP_H */
index bd6708e2c02703e70be886a4229eb4071be33137..682525511c9e90d352f2d46730932e9711ce457e 100644 (file)
@@ -39,6 +39,7 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
 }
 
 void percpu_counter_mod(struct percpu_counter *fbc, long amount);
+long percpu_counter_sum(struct percpu_counter *fbc);
 
 static inline long percpu_counter_read(struct percpu_counter *fbc)
 {
@@ -92,6 +93,11 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc)
        return fbc->count;
 }
 
+static inline long percpu_counter_sum(struct percpu_counter *fbc)
+{
+       return percpu_counter_read_positive(fbc);
+}
+
 #endif /* CONFIG_SMP */
 
 static inline void percpu_counter_inc(struct percpu_counter *fbc)
index b87aefa082e2b69c868f673946dd1cbc16610a51..c2ec6c77874eacc0cd7a340b7acc7c386aea0ead 100644 (file)
@@ -98,13 +98,17 @@ struct rcu_data {
        long            batch;           /* Batch # for current RCU batch */
        struct rcu_head *nxtlist;
        struct rcu_head **nxttail;
-       long            count; /* # of queued items */
+       long            qlen;            /* # of queued callbacks */
        struct rcu_head *curlist;
        struct rcu_head **curtail;
        struct rcu_head *donelist;
        struct rcu_head **donetail;
+       long            blimit;          /* Upper limit on a processed batch */
        int cpu;
        struct rcu_head barrier;
+#ifdef CONFIG_SMP
+       long            last_rs_qlen;    /* qlen during the last resched */
+#endif
 };
 
 DECLARE_PER_CPU(struct rcu_data, rcu_data);
index ff2e09c953b9414ad4cc12dab212ad38d4aab76b..62e6314382f091826490f80ef6c839d9587c8694 100644 (file)
@@ -892,7 +892,6 @@ static inline int pid_alive(struct task_struct *p)
 }
 
 extern void free_task(struct task_struct *tsk);
-extern void __put_task_struct(struct task_struct *tsk);
 #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
 
 extern void __put_task_struct_cb(struct rcu_head *rhp);
index fbea12d7a94378105bfa728b4c9d6e98d07d2bf3..a8eab86de7f103123158f2de62481e67366a57b0 100644 (file)
@@ -108,8 +108,10 @@ void free_task(struct task_struct *tsk)
 }
 EXPORT_SYMBOL(free_task);
 
-void __put_task_struct(struct task_struct *tsk)
+void __put_task_struct_cb(struct rcu_head *rhp)
 {
+       struct task_struct *tsk = container_of(rhp, struct task_struct, rcu);
+
        WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE)));
        WARN_ON(atomic_read(&tsk->usage));
        WARN_ON(tsk == current);
index 0cf8146bd58595b4115d07b39cdb866695a3b601..8cf15a569fcdece3c61b0ad61574802eba95f51f 100644 (file)
@@ -67,7 +67,43 @@ DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L };
 
 /* Fake initialization required by compiler */
 static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL};
-static int maxbatch = 10000;
+static int blimit = 10;
+static int qhimark = 10000;
+static int qlowmark = 100;
+#ifdef CONFIG_SMP
+static int rsinterval = 1000;
+#endif
+
+static atomic_t rcu_barrier_cpu_count;
+static struct semaphore rcu_barrier_sema;
+static struct completion rcu_barrier_completion;
+
+#ifdef CONFIG_SMP
+static void force_quiescent_state(struct rcu_data *rdp,
+                       struct rcu_ctrlblk *rcp)
+{
+       int cpu;
+       cpumask_t cpumask;
+       set_need_resched();
+       if (unlikely(rdp->qlen - rdp->last_rs_qlen > rsinterval)) {
+               rdp->last_rs_qlen = rdp->qlen;
+               /*
+                * Don't send IPI to itself. With irqs disabled,
+                * rdp->cpu is the current cpu.
+                */
+               cpumask = rcp->cpumask;
+               cpu_clear(rdp->cpu, cpumask);
+               for_each_cpu_mask(cpu, cpumask)
+                       smp_send_reschedule(cpu);
+       }
+}
+#else
+static inline void force_quiescent_state(struct rcu_data *rdp,
+                       struct rcu_ctrlblk *rcp)
+{
+       set_need_resched();
+}
+#endif
 
 /**
  * call_rcu - Queue an RCU callback for invocation after a grace period.
@@ -92,17 +128,13 @@ void fastcall call_rcu(struct rcu_head *head,
        rdp = &__get_cpu_var(rcu_data);
        *rdp->nxttail = head;
        rdp->nxttail = &head->next;
-
-       if (unlikely(++rdp->count > 10000))
-               set_need_resched();
-
+       if (unlikely(++rdp->qlen > qhimark)) {
+               rdp->blimit = INT_MAX;
+               force_quiescent_state(rdp, &rcu_ctrlblk);
+       }
        local_irq_restore(flags);
 }
 
-static atomic_t rcu_barrier_cpu_count;
-static struct semaphore rcu_barrier_sema;
-static struct completion rcu_barrier_completion;
-
 /**
  * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.
  * @head: structure to be used for queueing the RCU updates.
@@ -131,12 +163,12 @@ void fastcall call_rcu_bh(struct rcu_head *head,
        rdp = &__get_cpu_var(rcu_bh_data);
        *rdp->nxttail = head;
        rdp->nxttail = &head->next;
-       rdp->count++;
-/*
- *  Should we directly call rcu_do_batch() here ?
- *  if (unlikely(rdp->count > 10000))
- *      rcu_do_batch(rdp);
- */
+
+       if (unlikely(++rdp->qlen > qhimark)) {
+               rdp->blimit = INT_MAX;
+               force_quiescent_state(rdp, &rcu_bh_ctrlblk);
+       }
+
        local_irq_restore(flags);
 }
 
@@ -199,10 +231,12 @@ static void rcu_do_batch(struct rcu_data *rdp)
                next = rdp->donelist = list->next;
                list->func(list);
                list = next;
-               rdp->count--;
-               if (++count >= maxbatch)
+               rdp->qlen--;
+               if (++count >= rdp->blimit)
                        break;
        }
+       if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark)
+               rdp->blimit = blimit;
        if (!rdp->donelist)
                rdp->donetail = &rdp->donelist;
        else
@@ -473,6 +507,7 @@ static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
        rdp->quiescbatch = rcp->completed;
        rdp->qs_pending = 0;
        rdp->cpu = cpu;
+       rdp->blimit = blimit;
 }
 
 static void __devinit rcu_online_cpu(int cpu)
@@ -567,7 +602,12 @@ void synchronize_kernel(void)
        synchronize_rcu();
 }
 
-module_param(maxbatch, int, 0);
+module_param(blimit, int, 0);
+module_param(qhimark, int, 0);
+module_param(qlowmark, int, 0);
+#ifdef CONFIG_SMP
+module_param(rsinterval, int, 0);
+#endif
 EXPORT_SYMBOL_GPL(rcu_batches_completed);
 EXPORT_SYMBOL(call_rcu);  /* WARNING: GPL-only in April 2006. */
 EXPORT_SYMBOL(call_rcu_bh);  /* WARNING: GPL-only in April 2006. */
index 3454bb869fd068c070e8fbf219e981018305df99..4d46e90f59c32fcbe88f320af11794c43af9e55a 100644 (file)
@@ -178,13 +178,6 @@ static unsigned int task_timeslice(task_t *p)
 #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran)      \
                                < (long long) (sd)->cache_hot_time)
 
-void __put_task_struct_cb(struct rcu_head *rhp)
-{
-       __put_task_struct(container_of(rhp, struct task_struct, rcu));
-}
-
-EXPORT_SYMBOL_GPL(__put_task_struct_cb);
-
 /*
  * These are the runqueue data structures:
  */
@@ -4335,6 +4328,7 @@ void __devinit init_idle(task_t *idle, int cpu)
        runqueue_t *rq = cpu_rq(cpu);
        unsigned long flags;
 
+       idle->timestamp = sched_clock();
        idle->sleep_avg = 0;
        idle->array = NULL;
        idle->prio = MAX_PRIO;
index de2d9109194ef75a6bb5257bf06de852c98f9366..32b48e8ee36e8aaa6334a3979317eaf2b8848725 100644 (file)
@@ -50,6 +50,9 @@
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 
+extern int proc_nr_files(ctl_table *table, int write, struct file *filp,
+                     void __user *buffer, size_t *lenp, loff_t *ppos);
+
 #if defined(CONFIG_SYSCTL)
 
 /* External variables not in a header file. */
@@ -943,7 +946,7 @@ static ctl_table fs_table[] = {
                .data           = &files_stat,
                .maxlen         = 3*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &proc_nr_files,
        },
        {
                .ctl_name       = FS_MAXFILE,
index a918f77f02f3bb42bc4b11bab07e20ffd1773c5d..1fe76d963ac21a2d09d5d8cb8e21e687163202f1 100644 (file)
@@ -130,6 +130,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
                onlined_pages++;
        }
        zone->present_pages += onlined_pages;
+       zone->zone_pgdat->node_present_pages += onlined_pages;
 
        setup_per_zone_pages_min();
 
index d80fa7d8f720e2b985fbbcfbd45282ee9e629e09..954981b14303f2298a19646c770984aebac0a812 100644 (file)
@@ -1789,6 +1789,7 @@ static void gather_stats(struct page *page, void *private, int pte_dirty)
        cond_resched();
 }
 
+#ifdef CONFIG_HUGETLB_PAGE
 static void check_huge_range(struct vm_area_struct *vma,
                unsigned long start, unsigned long end,
                struct numa_maps *md)
@@ -1814,6 +1815,13 @@ static void check_huge_range(struct vm_area_struct *vma,
                gather_stats(page, md, pte_dirty(*ptep));
        }
 }
+#else
+static inline void check_huge_range(struct vm_area_struct *vma,
+               unsigned long start, unsigned long end,
+               struct numa_maps *md)
+{
+}
+#endif
 
 int show_numa_map(struct seq_file *m, void *v)
 {
index 791690d7d3fa02e4e5956af69fffedf654088adc..234bd4895d14dc9a837473ce5474eee03253b0f1 100644 (file)
@@ -590,21 +590,20 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
 }
 
 #ifdef CONFIG_NUMA
-/* Called from the slab reaper to drain remote pagesets */
-void drain_remote_pages(void)
+/*
+ * Called from the slab reaper to drain pagesets on a particular node that
+ * belong to the currently executing processor.
+ */
+void drain_node_pages(int nodeid)
 {
-       struct zone *zone;
-       int i;
+       int i, z;
        unsigned long flags;
 
        local_irq_save(flags);
-       for_each_zone(zone) {
+       for (z = 0; z < MAX_NR_ZONES; z++) {
+               struct zone *zone = NODE_DATA(nodeid)->node_zones + z;
                struct per_cpu_pageset *pset;
 
-               /* Do not drain local pagesets */
-               if (zone->zone_pgdat->node_id == numa_node_id())
-                       continue;
-
                pset = zone_pcp(zone, smp_processor_id());
                for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
                        struct per_cpu_pages *pcp;
index d8ce5ff6145492469a3b81640946fca58d7e8002..67f0e20b101ffbba34a8a3568374e14ab1a2bee8 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -537,9 +537,6 @@ void page_add_new_anon_rmap(struct page *page,
  */
 void page_add_file_rmap(struct page *page)
 {
-       BUG_ON(PageAnon(page));
-       BUG_ON(!pfn_valid(page_to_pfn(page)));
-
        if (atomic_inc_and_test(&page->_mapcount))
                __inc_page_state(nr_mapped);
 }
index f2e92dc1c9ce3d1fe1ca8cdfe685684f5bc1005d..d0bd7f07ab041d3d7da06c5cec610035c3058b33 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -789,6 +789,47 @@ static void __slab_error(const char *function, struct kmem_cache *cachep, char *
        dump_stack();
 }
 
+#ifdef CONFIG_NUMA
+/*
+ * Special reaping functions for NUMA systems called from cache_reap().
+ * These take care of doing round robin flushing of alien caches (containing
+ * objects freed on different nodes from which they were allocated) and the
+ * flushing of remote pcps by calling drain_node_pages.
+ */
+static DEFINE_PER_CPU(unsigned long, reap_node);
+
+static void init_reap_node(int cpu)
+{
+       int node;
+
+       node = next_node(cpu_to_node(cpu), node_online_map);
+       if (node == MAX_NUMNODES)
+               node = 0;
+
+       __get_cpu_var(reap_node) = node;
+}
+
+static void next_reap_node(void)
+{
+       int node = __get_cpu_var(reap_node);
+
+       /*
+        * Also drain per cpu pages on remote zones
+        */
+       if (node != numa_node_id())
+               drain_node_pages(node);
+
+       node = next_node(node, node_online_map);
+       if (unlikely(node >= MAX_NUMNODES))
+               node = first_node(node_online_map);
+       __get_cpu_var(reap_node) = node;
+}
+
+#else
+#define init_reap_node(cpu) do { } while (0)
+#define next_reap_node(void) do { } while (0)
+#endif
+
 /*
  * Initiate the reap timer running on the target CPU.  We run at around 1 to 2Hz
  * via the workqueue/eventd.
@@ -806,6 +847,7 @@ static void __devinit start_cpu_timer(int cpu)
         * at that time.
         */
        if (keventd_up() && reap_work->func == NULL) {
+               init_reap_node(cpu);
                INIT_WORK(reap_work, cache_reap, NULL);
                schedule_delayed_work_on(cpu, reap_work, HZ + 3 * cpu);
        }
@@ -884,6 +926,23 @@ static void __drain_alien_cache(struct kmem_cache *cachep,
        }
 }
 
+/*
+ * Called from cache_reap() to regularly drain alien caches round robin.
+ */
+static void reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3)
+{
+       int node = __get_cpu_var(reap_node);
+
+       if (l3->alien) {
+               struct array_cache *ac = l3->alien[node];
+               if (ac && ac->avail) {
+                       spin_lock_irq(&ac->lock);
+                       __drain_alien_cache(cachep, ac, node);
+                       spin_unlock_irq(&ac->lock);
+               }
+       }
+}
+
 static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **alien)
 {
        int i = 0;
@@ -902,6 +961,7 @@ static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache **al
 #else
 
 #define drain_alien_cache(cachep, alien) do { } while (0)
+#define reap_alien(cachep, l3) do { } while (0)
 
 static inline struct array_cache **alloc_alien_cache(int node, int limit)
 {
@@ -1124,6 +1184,7 @@ void __init kmem_cache_init(void)
        struct cache_sizes *sizes;
        struct cache_names *names;
        int i;
+       int order;
 
        for (i = 0; i < NUM_INIT_LISTS; i++) {
                kmem_list3_init(&initkmem_list3[i]);
@@ -1167,11 +1228,15 @@ void __init kmem_cache_init(void)
 
        cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, cache_line_size());
 
-       cache_estimate(0, cache_cache.buffer_size, cache_line_size(), 0,
-                      &left_over, &cache_cache.num);
+       for (order = 0; order < MAX_ORDER; order++) {
+               cache_estimate(order, cache_cache.buffer_size,
+                       cache_line_size(), 0, &left_over, &cache_cache.num);
+               if (cache_cache.num)
+                       break;
+       }
        if (!cache_cache.num)
                BUG();
-
+       cache_cache.gfporder = order;
        cache_cache.colour = left_over / cache_cache.colour_off;
        cache_cache.slab_size = ALIGN(cache_cache.num * sizeof(kmem_bufctl_t) +
                                      sizeof(struct slab), cache_line_size());
@@ -1647,6 +1712,14 @@ static inline size_t calculate_slab_order(struct kmem_cache *cachep,
                cachep->gfporder = gfporder;
                left_over = remainder;
 
+               /*
+                * A VFS-reclaimable slab tends to have most allocations
+                * as GFP_NOFS and we really don't want to have to be allocating
+                * higher-order pages when we are unable to shrink dcache.
+                */
+               if (flags & SLAB_RECLAIM_ACCOUNT)
+                       break;
+
                /*
                 * Large number of objects is good, but very large slabs are
                 * currently bad for the gfp()s.
@@ -1869,17 +1942,7 @@ kmem_cache_create (const char *name, size_t size, size_t align,
 
        size = ALIGN(size, align);
 
-       if ((flags & SLAB_RECLAIM_ACCOUNT) && size <= PAGE_SIZE) {
-               /*
-                * A VFS-reclaimable slab tends to have most allocations
-                * as GFP_NOFS and we really don't want to have to be allocating
-                * higher-order pages when we are unable to shrink dcache.
-                */
-               cachep->gfporder = 0;
-               cache_estimate(cachep->gfporder, size, align, flags,
-                              &left_over, &cachep->num);
-       } else
-               left_over = calculate_slab_order(cachep, size, align, flags);
+       left_over = calculate_slab_order(cachep, size, align, flags);
 
        if (!cachep->num) {
                printk("kmem_cache_create: couldn't create cache %s.\n", name);
@@ -3494,8 +3557,7 @@ static void cache_reap(void *unused)
                check_irq_on();
 
                l3 = searchp->nodelists[numa_node_id()];
-               if (l3->alien)
-                       drain_alien_cache(searchp, l3->alien);
+               reap_alien(searchp, l3);
                spin_lock_irq(&l3->list_lock);
 
                drain_array_locked(searchp, cpu_cache_get(searchp), 0,
@@ -3545,7 +3607,7 @@ static void cache_reap(void *unused)
        }
        check_irq_on();
        mutex_unlock(&cache_chain_mutex);
-       drain_remote_pages();
+       next_reap_node();
        /* Setup the next iteration */
        schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC);
 }
index cce3dda59c595560dc90ede2bf6f12e193e4312f..e9ec06d845e808a36702c6fa64af986ece2f56a1 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -489,13 +489,34 @@ void percpu_counter_mod(struct percpu_counter *fbc, long amount)
        if (count >= FBC_BATCH || count <= -FBC_BATCH) {
                spin_lock(&fbc->lock);
                fbc->count += count;
+               *pcount = 0;
                spin_unlock(&fbc->lock);
-               count = 0;
+       } else {
+               *pcount = count;
        }
-       *pcount = count;
        put_cpu();
 }
 EXPORT_SYMBOL(percpu_counter_mod);
+
+/*
+ * Add up all the per-cpu counts, return the result.  This is a more accurate
+ * but much slower version of percpu_counter_read_positive()
+ */
+long percpu_counter_sum(struct percpu_counter *fbc)
+{
+       long ret;
+       int cpu;
+
+       spin_lock(&fbc->lock);
+       ret = fbc->count;
+       for_each_cpu(cpu) {
+               long *pcount = per_cpu_ptr(fbc->counters, cpu);
+               ret += *pcount;
+       }
+       spin_unlock(&fbc->lock);
+       return ret < 0 ? 0 : ret;
+}
+EXPORT_SYMBOL(percpu_counter_sum);
 #endif
 
 /*
index b0af7593d01e315a83c79ec6841c9a4a3b91c1e1..7ccf763bb30bf37b71fdd0dd25b135c26a2b6587 100644 (file)
@@ -1883,7 +1883,8 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
 
        if (!(gfp_mask & __GFP_WAIT) ||
                zone->all_unreclaimable ||
-               atomic_read(&zone->reclaim_in_progress) > 0)
+               atomic_read(&zone->reclaim_in_progress) > 0 ||
+               (p->flags & PF_MEMALLOC))
                        return 0;
 
        node_id = zone->zone_pgdat->node_id;
index 8bf6d9f6e9d34c09ef752e9f1afc1d05e24edee0..905087e0d485309eb2b774a624cca52fdb949105 100644 (file)
@@ -29,4 +29,4 @@ obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_snat.o
 
 # watchers
 obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o
-obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_ulog.o
+obj-$(CONFIG_BRIDGE_EBT_ULOG) += ebt_ulog.o
index a7623ead39a8b6a91fe34b81afd5193d9ed6cce3..9f498a6c8895b63412c60e302fc9ea3245695d60 100644 (file)
@@ -1036,6 +1036,10 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_
 
        limit = min(send_win, cong_win);
 
+       /* If a full-sized TSO skb can be sent, do it. */
+       if (limit >= 65536)
+               return 0;
+
        if (sysctl_tcp_tso_win_divisor) {
                u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);
 
index b7d8822c1be49cbcd73ca303d7d253e93cdec406..19727d9419625427cedeb7c674c2974bc60821c6 100644 (file)
@@ -822,7 +822,7 @@ struct ipv6_saddr_score {
        int             addr_type;
        unsigned int    attrs;
        int             matchlen;
-       unsigned int    scope;
+       int             scope;
        unsigned int    rule;
 };
 
index 1b5989b1b6700cd8d5edf0926782939733e5c329..c323cc6a28b0e3f6042058879ead5dd9d5d36aaa 100644 (file)
@@ -547,7 +547,7 @@ static struct sock * unix_create1(struct socket *sock)
        struct sock *sk = NULL;
        struct unix_sock *u;
 
-       if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files)
+       if (atomic_read(&unix_nr_socks) >= 2*get_max_files())
                goto out;
 
        sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1);
index b7773bf68efa8fb104c45312b8a385cbb701d499..b65c201e9ff50386ea6cb43ed2c0c91f63a4cfe7 100644 (file)
@@ -1262,7 +1262,7 @@ static int selinux_ptrace(struct task_struct *parent, struct task_struct *child)
 
        rc = task_has_perm(parent, child, PROCESS__PTRACE);
        /* Save the SID of the tracing process for later use in apply_creds. */
-       if (!rc)
+       if (!(child->ptrace & PT_PTRACED) && !rc)
                csec->ptrace_sid = psec->sid;
        return rc;
 }