diff --git a/[refs] b/[refs] index ae31cc1e4018..836946500aa0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c6b33cc4e9882b44f1b0c36396f420076e04a4e2 +refs/heads/master: 2ca2c570b0e38b0c214426b1708ee1b0c3a5067d diff --git a/trunk/CREDITS b/trunk/CREDITS index 75c5ce82720c..8218e790f43d 100644 --- a/trunk/CREDITS +++ b/trunk/CREDITS @@ -516,10 +516,9 @@ S: Orlando, Florida S: USA N: Lennert Buytenhek -E: kernel@wantstofly.org -D: Original (2.4) rewrite of the ethernet bridging code -D: Various ARM bits and pieces -S: Ravenhorst 58 +E: buytenh@gnu.org +D: Rewrite of the ethernet bridging code +S: Ravenhorst 58B S: 2317 AK Leiden S: The Netherlands diff --git a/trunk/Documentation/DocBook/Makefile b/trunk/Documentation/DocBook/Makefile index 867608ab3ca0..36526a1e76d7 100644 --- a/trunk/Documentation/DocBook/Makefile +++ b/trunk/Documentation/DocBook/Makefile @@ -53,8 +53,8 @@ installmandocs: mandocs ### #External programs used -KERNELDOC = $(srctree)/scripts/kernel-doc -DOCPROC = $(objtree)/scripts/basic/docproc +KERNELDOC = scripts/kernel-doc +DOCPROC = scripts/basic/docproc XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl #XMLTOFLAGS += --skip-validation diff --git a/trunk/Documentation/filesystems/fuse.txt b/trunk/Documentation/filesystems/fuse.txt index 397a41adb4c3..345392c4caeb 100644 --- a/trunk/Documentation/filesystems/fuse.txt +++ b/trunk/Documentation/filesystems/fuse.txt @@ -94,8 +94,8 @@ Mount options filesystem is free to implement it's access policy or leave it to the underlying file access mechanism (e.g. in case of network filesystems). This option enables permission checking, restricting - access based on file mode. It is usually useful together with the - 'allow_other' mount option. + access based on file mode. This is option is usually useful + together with the 'allow_other' mount option. 'allow_other' diff --git a/trunk/Documentation/tty.txt b/trunk/Documentation/tty.txt index 5f799e612e03..dab56604745d 100644 --- a/trunk/Documentation/tty.txt +++ b/trunk/Documentation/tty.txt @@ -39,37 +39,28 @@ Line Discipline Methods TTY side interfaces: -open() - Called when the line discipline is attached to - the terminal. No other call into the line - discipline for this tty will occur until it - completes successfully. Can sleep. - close() - This is called on a terminal when the line discipline is being unplugged. At the point of execution no further users will enter the ldisc code for this tty. Can sleep. -hangup() - Called when the tty line is hung up. - The line discipline should cease I/O to the tty. - No further calls into the ldisc code will occur. - Can sleep. +open() - Called when the line discipline is attached to + the terminal. No other call into the line + discipline for this tty will occur until it + completes successfully. Can sleep. write() - A process is writing data through the line discipline. Multiple write calls are serialized by the tty layer for the ldisc. May sleep. -flush_buffer() - (optional) May be called at any point between - open and close, and instructs the line discipline - to empty its input buffer. +flush_buffer() - May be called at any point between open and close. -chars_in_buffer() - (optional) Report the number of bytes in the input - buffer. +chars_in_buffer() - Report the number of bytes in the buffer. -set_termios() - (optional) Called on termios structure changes. - The caller passes the old termios data and the - current data is in the tty. Called under the - termios semaphore so allowed to sleep. Serialized - against itself only. +set_termios() - Called on termios structure changes. The caller + passes the old termios data and the current data + is in the tty. Called under the termios semaphore so + allowed to sleep. Serialized against itself only. read() - Move data from the line discipline to the user. Multiple read calls may occur in parallel and the @@ -101,88 +92,6 @@ write_wakeup() - May be called at any point between open and close. this function. In such a situation defer it. -Driver Access - -Line discipline methods can call the following methods of the underlying -hardware driver through the function pointers within the tty->driver -structure: - -write() Write a block of characters to the tty device. - Returns the number of characters accepted. - -put_char() Queues a character for writing to the tty device. - If there is no room in the queue, the character is - ignored. - -flush_chars() (Optional) If defined, must be called after - queueing characters with put_char() in order to - start transmission. - -write_room() Returns the numbers of characters the tty driver - will accept for queueing to be written. - -ioctl() Invoke device specific ioctl. - Expects data pointers to refer to userspace. - Returns ENOIOCTLCMD for unrecognized ioctl numbers. - -set_termios() Notify the tty driver that the device's termios - settings have changed. New settings are in - tty->termios. Previous settings should be passed in - the "old" argument. - -throttle() Notify the tty driver that input buffers for the - line discipline are close to full, and it should - somehow signal that no more characters should be - sent to the tty. - -unthrottle() Notify the tty driver that characters can now be - sent to the tty without fear of overrunning the - input buffers of the line disciplines. - -stop() Ask the tty driver to stop outputting characters - to the tty device. - -start() Ask the tty driver to resume sending characters - to the tty device. - -hangup() Ask the tty driver to hang up the tty device. - -break_ctl() (Optional) Ask the tty driver to turn on or off - BREAK status on the RS-232 port. If state is -1, - then the BREAK status should be turned on; if - state is 0, then BREAK should be turned off. - If this routine is not implemented, use ioctls - TIOCSBRK / TIOCCBRK instead. - -wait_until_sent() Waits until the device has written out all of the - characters in its transmitter FIFO. - -send_xchar() Send a high-priority XON/XOFF character to the device. - - -Flags - -Line discipline methods have access to tty->flags field containing the -following interesting flags: - -TTY_THROTTLED Driver input is throttled. The ldisc should call - tty->driver->unthrottle() in order to resume - reception when it is ready to process more data. - -TTY_DO_WRITE_WAKEUP If set, causes the driver to call the ldisc's - write_wakeup() method in order to resume - transmission when it can accept more data - to transmit. - -TTY_IO_ERROR If set, causes all subsequent userspace read/write - calls on the tty to fail, returning -EIO. - -TTY_OTHER_CLOSED Device is a pty and the other side has closed. - -TTY_NO_WRITE_SPLIT Prevent driver from splitting up writes into - smaller chunks. - - Locking Callers to the line discipline functions from the tty layer are required to diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index d5a97d3e23c3..db090362d731 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -355,24 +355,6 @@ P: Ian Molton M: spyro@f2s.com S: Maintained -ARM/ADI ROADRUNNER MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/ADS SPHERE MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/AJECO 1ARM MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - ARM/ATMEL AT91RM9200 ARM ARCHITECTURE P: Andrew Victor M: andrew@sanpeople.com @@ -380,89 +362,17 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) W: http://maxim.org.za/at91_26.html S: Maintained -ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - ARM/CORGI MACHINE SUPPORT P: Richard Purdie M: rpurdie@rpsys.net S: Maintained -ARM/GLOMATION GESBC9312SX MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - ARM/HP JORNADA 7XX MACHINE SUPPORT P: Kristoffer Ericson M: kristoffer_e1@hotmail.com W: www.jlime.com S: Maintained -ARM/INTEL IOP32X ARM ARCHITECTURE -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/INTEL IOP13XX ARM ARCHITECTURE -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/INTEL IQ81342EX MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/INTEL IXP2000 ARM ARCHITECTURE -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/INTEL IXDP2850 MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/INTEL IXP23XX ARM ARCHITECTURE -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/INTEL XSC3 (MANZANO) ARM CORE -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/LOGICPD PXA270 MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - ARM/TOSA MACHINE SUPPORT P: Dirk Opfer M: dirk@opfer-online.de @@ -481,12 +391,6 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) W: http://www.arm.linux.org.uk/ S: Maintained -ARM/RADISYS ENP2611 MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - ARM/SHARK MACHINE SUPPORT P: Alexander Schulz M: alex@shark-linux.de @@ -514,18 +418,6 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) W: http://www.fluff.org/ben/linux/ S: Maintained -ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - -ARM/THECUS N2100 MACHINE SUPPORT -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained - ARPD SUPPORT P: Jonathan Layes L: netdev@vger.kernel.org @@ -796,24 +688,12 @@ M: joel.becker@oracle.com L: linux-kernel@vger.kernel.org S: Supported -CIRRUS LOGIC EP93XX ETHERNET DRIVER -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: netdev@vger.kernel.org -S: Maintained - CIRRUS LOGIC GENERIC FBDEV DRIVER P: Jeff Garzik M: jgarzik@pobox.com L: linux-fbdev-devel@lists.sourceforge.net (subscribers-only) S: Odd Fixes -CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: linux-usb-devel@lists.sourceforge.net -S: Maintained - CIRRUS LOGIC CS4280/CS461x SOUNDDRIVER P: Cirrus Logic Corporation (kernel 2.2 driver) M: Cirrus Logic Corporation, Thomas Woller @@ -1683,12 +1563,6 @@ P: Deepak Saxena M: dsaxena@plexity.net S: Maintained -INTEL IXP2000 ETHERNET DRIVER -P: Lennert Buytenhek -M: kernel@wantstofly.org -L: netdev@vger.kernel.org -S: Maintained - INTEL PRO/100 ETHERNET SUPPORT P: John Ronciak M: john.ronciak@intel.com @@ -2057,9 +1931,9 @@ S: Maintained LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) P: Eric Moore -M: Eric.Moore@lsi.com -M: support@lsi.com -L: mpt_linux_developer@lsi.com +M: Eric.Moore@lsil.com +M: support@lsil.com +L: mpt_linux_developer@lsil.com L: linux-scsi@vger.kernel.org W: http://www.lsilogic.com/support S: Supported diff --git a/trunk/Makefile b/trunk/Makefile index 0e9eee768288..d6b64a08e28c 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 20 -EXTRAVERSION =-rc3 +EXTRAVERSION =-rc2 NAME = Homicidal Dwarf Hamster # *DOCUMENTATION* @@ -1040,7 +1040,7 @@ CLEAN_FILES += vmlinux System.map \ # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include2 usr/include MRPROPER_FILES += .config .config.old include/asm .version .old_version \ - include/linux/autoconf.h include/linux/utsrelease.h include/linux/version.h \ + include/linux/autoconf.h generated-headers \ Module.symvers tags TAGS cscope* # clean - Delete most, but leave enough to build external modules diff --git a/trunk/arch/arm/mach-omap2/board-apollon.c b/trunk/arch/arm/mach-omap2/board-apollon.c index 878ff9181d0e..03d6905ba490 100644 --- a/trunk/arch/arm/mach-omap2/board-apollon.c +++ b/trunk/arch/arm/mach-omap2/board-apollon.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/trunk/arch/arm/mach-omap2/gpmc.c b/trunk/arch/arm/mach-omap2/gpmc.c index d8f57824423f..f4f04d87df32 100644 --- a/trunk/arch/arm/mach-omap2/gpmc.c +++ b/trunk/arch/arm/mach-omap2/gpmc.c @@ -17,7 +17,6 @@ #include #include -#include #include #undef DEBUG @@ -339,13 +338,19 @@ void __init gpmc_mem_init(void) int cs; unsigned long boot_rom_space = 0; - /* never allocate the first page, to facilitate bug detection; - * even if we didn't boot from ROM. - */ - boot_rom_space = BOOT_ROM_SPACE; - /* In apollon the CS0 is mapped as 0x0000 0000 */ - if (machine_is_omap_apollon()) - boot_rom_space = 0; + if (cpu_is_omap242x()) { + u32 l; + l = omap_readl(OMAP242X_CONTROL_STATUS); + /* In case of internal boot the 1st MB is redirected to the + * boot ROM memory space. + */ + if (l & (1 << 3)) + boot_rom_space = BOOT_ROM_SPACE; + } else + /* We assume internal boot if the mode can't be + * determined. + */ + boot_rom_space = BOOT_ROM_SPACE; gpmc_mem_root.start = GPMC_MEM_START + boot_rom_space; gpmc_mem_root.end = GPMC_MEM_END; diff --git a/trunk/arch/i386/boot/compressed/.gitignore b/trunk/arch/i386/boot/compressed/.gitignore deleted file mode 100644 index be0ed065249b..000000000000 --- a/trunk/arch/i386/boot/compressed/.gitignore +++ /dev/null @@ -1 +0,0 @@ -relocs diff --git a/trunk/arch/i386/boot/compressed/head.S b/trunk/arch/i386/boot/compressed/head.S index 3517a32aaf41..f395a4bb38bb 100644 --- a/trunk/arch/i386/boot/compressed/head.S +++ b/trunk/arch/i386/boot/compressed/head.S @@ -28,7 +28,7 @@ #include #include -.section ".text.head","ax",@progbits +.section ".text.head" .globl startup_32 startup_32: diff --git a/trunk/arch/i386/defconfig b/trunk/arch/i386/defconfig index 88b7c1cf65a2..e075ff05c46d 100644 --- a/trunk/arch/i386/defconfig +++ b/trunk/arch/i386/defconfig @@ -1167,7 +1167,7 @@ CONFIG_USB_STORAGE=y # USB Input Devices # CONFIG_USB_HID=y -# CONFIG_USB_HIDINPUT_POWERBOOK is not set +# CONFIG_USB_HID_POWERBOOK is not set # CONFIG_HID_FF is not set # CONFIG_USB_HIDDEV is not set # CONFIG_USB_AIPTEK is not set diff --git a/trunk/arch/sparc/kernel/ioport.c b/trunk/arch/sparc/kernel/ioport.c index 987ec6782f99..cbbc98846b00 100644 --- a/trunk/arch/sparc/kernel/ioport.c +++ b/trunk/arch/sparc/kernel/ioport.c @@ -153,7 +153,7 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset, } EXPORT_SYMBOL(of_ioremap); -void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) +void of_iounmap(void __iomem *base, unsigned long size) { iounmap(base); } @@ -726,8 +726,7 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, /* IIep is write-through, not flushing. */ for (n = 0; n < nents; n++) { BUG_ON(page_address(sg->page) == NULL); - sg->dvma_address = - virt_to_phys(page_address(sg->page)) + sg->offset; + sg->dvma_address = virt_to_phys(page_address(sg->page)); sg->dvma_length = sg->length; sg++; } diff --git a/trunk/arch/sparc64/defconfig b/trunk/arch/sparc64/defconfig index 5a9e68b13e60..0f0d38f6197c 100644 --- a/trunk/arch/sparc64/defconfig +++ b/trunk/arch/sparc64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.20-rc2 -# Thu Dec 28 15:09:49 2006 +# Linux kernel version: 2.6.19 +# Sat Dec 9 15:41:30 2006 # CONFIG_SPARC=y CONFIG_SPARC64=y @@ -334,7 +334,7 @@ CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_UB=m # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_INITRD is not set CONFIG_CDROM_PKTCDVD=m @@ -840,7 +840,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_LM92 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set # CONFIG_SENSORS_SIS5595 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_SMSC47M192 is not set @@ -851,7 +850,6 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83791D is not set # CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # CONFIG_SENSORS_W83627EHF is not set @@ -964,6 +962,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SND_MPU401_UART=m CONFIG_SND_AC97_CODEC=m +CONFIG_SND_AC97_BUS=m CONFIG_SND_DUMMY=m CONFIG_SND_VIRMIDI=m CONFIG_SND_MTPAV=m @@ -1046,7 +1045,6 @@ CONFIG_SND_SUN_CS4231=m # Open Sound System # # CONFIG_SOUND_PRIME is not set -CONFIG_AC97_BUS=m # # HID Devices @@ -1098,26 +1096,14 @@ CONFIG_USB_UHCI_HCD=m # # may also be needed; see USB_STORAGE Help for more information # -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_DPCM is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE is not set # CONFIG_USB_LIBUSUAL is not set # # USB Input Devices # CONFIG_USB_HID=y -# CONFIG_USB_HIDINPUT_POWERBOOK is not set +# CONFIG_USB_HID_POWERBOOK is not set # CONFIG_HID_FF is not set CONFIG_USB_HIDDEV=y # CONFIG_USB_AIPTEK is not set @@ -1235,10 +1221,6 @@ CONFIG_USB_HIDDEV=y # DMA Devices # -# -# Virtualization -# - # # Misc Linux/SPARC drivers # @@ -1415,8 +1397,6 @@ CONFIG_PRINTK_TIME=y CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_UNUSED_SYMBOLS is not set -CONFIG_DEBUG_FS=y -# CONFIG_HEADERS_CHECK is not set CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=18 CONFIG_DETECT_SOFTLOCKUP=y @@ -1434,9 +1414,12 @@ CONFIG_SCHEDSTATS=y # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_LIST is not set +# CONFIG_UNWIND_INFO is not set CONFIG_FORCED_INLINING=y +# CONFIG_HEADERS_CHECK is not set # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_LKDTM is not set # CONFIG_DEBUG_STACK_USAGE is not set @@ -1506,4 +1489,3 @@ CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_PLIST=y -CONFIG_IOMAP_COPY=y diff --git a/trunk/arch/sparc64/kernel/isa.c b/trunk/arch/sparc64/kernel/isa.c index 98721a8f8619..ad1c4f55420f 100644 --- a/trunk/arch/sparc64/kernel/isa.c +++ b/trunk/arch/sparc64/kernel/isa.c @@ -22,15 +22,14 @@ static void __init report_dev(struct sparc_isa_device *isa_dev, int child) printk(" [%s", isa_dev->prom_node->name); } -static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev) +static struct linux_prom_registers * __init +isa_dev_get_resource(struct sparc_isa_device *isa_dev) { struct linux_prom_registers *pregs; unsigned long base, len; int prop_len; pregs = of_get_property(isa_dev->prom_node, "reg", &prop_len); - if (!pregs) - return; /* Only the first one is interesting. */ len = pregs[0].reg_size; @@ -45,9 +44,12 @@ static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev) request_resource(&isa_dev->bus->parent->io_space, &isa_dev->resource); + + return pregs; } -static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev) +static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev, + struct linux_prom_registers *pregs) { struct of_device *op = of_find_device_by_node(isa_dev->prom_node); @@ -67,6 +69,7 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev) printk(" ->"); while (dp) { + struct linux_prom_registers *regs; struct sparc_isa_device *isa_dev; isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); @@ -82,8 +85,8 @@ static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev) isa_dev->bus = parent_isa_dev->bus; isa_dev->prom_node = dp; - isa_dev_get_resource(isa_dev); - isa_dev_get_irq(isa_dev); + regs = isa_dev_get_resource(isa_dev); + isa_dev_get_irq(isa_dev, regs); report_dev(isa_dev, 1); @@ -96,6 +99,7 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) struct device_node *dp = isa_br->prom_node->child; while (dp) { + struct linux_prom_registers *regs; struct sparc_isa_device *isa_dev; isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); @@ -133,8 +137,8 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) isa_dev->bus = isa_br; isa_dev->prom_node = dp; - isa_dev_get_resource(isa_dev); - isa_dev_get_irq(isa_dev); + regs = isa_dev_get_resource(isa_dev); + isa_dev_get_irq(isa_dev, regs); report_dev(isa_dev, 0); diff --git a/trunk/arch/sparc64/kernel/of_device.c b/trunk/arch/sparc64/kernel/of_device.c index b0f3e0082a0d..cec0eceae552 100644 --- a/trunk/arch/sparc64/kernel/of_device.c +++ b/trunk/arch/sparc64/kernel/of_device.c @@ -144,12 +144,9 @@ void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned lo } EXPORT_SYMBOL(of_ioremap); -void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) +void of_iounmap(void __iomem *base, unsigned long size) { - if (res->flags & IORESOURCE_MEM) - release_mem_region((unsigned long) base, size); - else - release_region((unsigned long) base, size); + release_region((unsigned long) base, size); } EXPORT_SYMBOL(of_iounmap); diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index 054822a3e05e..a8e8802eed4d 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/arch/sparc64/mm/init.c @@ -872,115 +872,6 @@ static unsigned long __init choose_bootmap_pfn(unsigned long start_pfn, prom_halt(); } -static void __init trim_pavail(unsigned long *cur_size_p, - unsigned long *end_of_phys_p) -{ - unsigned long to_trim = *cur_size_p - cmdline_memory_size; - unsigned long avoid_start, avoid_end; - int i; - - to_trim = PAGE_ALIGN(to_trim); - - avoid_start = avoid_end = 0; -#ifdef CONFIG_BLK_DEV_INITRD - avoid_start = initrd_start; - avoid_end = PAGE_ALIGN(initrd_end); -#endif - - /* Trim some pavail[] entries in order to satisfy the - * requested "mem=xxx" kernel command line specification. - * - * We must not trim off the kernel image area nor the - * initial ramdisk range (if any). Also, we must not trim - * any pavail[] entry down to zero in order to preserve - * the invariant that all pavail[] entries have a non-zero - * size which is assumed by all of the code in here. - */ - for (i = 0; i < pavail_ents; i++) { - unsigned long start, end, kern_end; - unsigned long trim_low, trim_high, n; - - kern_end = PAGE_ALIGN(kern_base + kern_size); - - trim_low = start = pavail[i].phys_addr; - trim_high = end = start + pavail[i].reg_size; - - if (kern_base >= start && - kern_base < end) { - trim_low = kern_base; - if (kern_end >= end) - continue; - } - if (kern_end >= start && - kern_end < end) { - trim_high = kern_end; - } - if (avoid_start && - avoid_start >= start && - avoid_start < end) { - if (trim_low > avoid_start) - trim_low = avoid_start; - if (avoid_end >= end) - continue; - } - if (avoid_end && - avoid_end >= start && - avoid_end < end) { - if (trim_high < avoid_end) - trim_high = avoid_end; - } - - if (trim_high <= trim_low) - continue; - - if (trim_low == start && trim_high == end) { - /* Whole chunk is available for trimming. - * Trim all except one page, in order to keep - * entry non-empty. - */ - n = (end - start) - PAGE_SIZE; - if (n > to_trim) - n = to_trim; - - if (n) { - pavail[i].phys_addr += n; - pavail[i].reg_size -= n; - to_trim -= n; - } - } else { - n = (trim_low - start); - if (n > to_trim) - n = to_trim; - - if (n) { - pavail[i].phys_addr += n; - pavail[i].reg_size -= n; - to_trim -= n; - } - if (to_trim) { - n = end - trim_high; - if (n > to_trim) - n = to_trim; - if (n) { - pavail[i].reg_size -= n; - to_trim -= n; - } - } - } - - if (!to_trim) - break; - } - - /* Recalculate. */ - *cur_size_p = 0UL; - for (i = 0; i < pavail_ents; i++) { - *end_of_phys_p = pavail[i].phys_addr + - pavail[i].reg_size; - *cur_size_p += pavail[i].reg_size; - } -} - static unsigned long __init bootmem_init(unsigned long *pages_avail, unsigned long phys_base) { @@ -998,13 +889,31 @@ static unsigned long __init bootmem_init(unsigned long *pages_avail, end_of_phys_memory = pavail[i].phys_addr + pavail[i].reg_size; bytes_avail += pavail[i].reg_size; + if (cmdline_memory_size) { + if (bytes_avail > cmdline_memory_size) { + unsigned long slack = bytes_avail - cmdline_memory_size; + + bytes_avail -= slack; + end_of_phys_memory -= slack; + + pavail[i].reg_size -= slack; + if ((long)pavail[i].reg_size <= 0L) { + pavail[i].phys_addr = 0xdeadbeefUL; + pavail[i].reg_size = 0UL; + pavail_ents = i; + } else { + pavail[i+1].reg_size = 0Ul; + pavail[i+1].phys_addr = 0xdeadbeefUL; + pavail_ents = i + 1; + } + break; + } + } } - /* Determine the location of the initial ramdisk before trying - * to honor the "mem=xxx" command line argument. We must know - * where the kernel image and the ramdisk image are so that we - * do not trim those two areas from the physical memory map. - */ + *pages_avail = bytes_avail >> PAGE_SHIFT; + + end_pfn = end_of_phys_memory >> PAGE_SHIFT; #ifdef CONFIG_BLK_DEV_INITRD /* Now have to check initial ramdisk, so that bootmap does not overwrite it */ @@ -1023,16 +932,6 @@ static unsigned long __init bootmem_init(unsigned long *pages_avail, } } #endif - - if (cmdline_memory_size && - bytes_avail > cmdline_memory_size) - trim_pavail(&bytes_avail, - &end_of_phys_memory); - - *pages_avail = bytes_avail >> PAGE_SHIFT; - - end_pfn = end_of_phys_memory >> PAGE_SHIFT; - /* Initialize the boot-time allocator. */ max_pfn = max_low_pfn = end_pfn; min_low_pfn = (phys_base >> PAGE_SHIFT); diff --git a/trunk/arch/x86_64/Kconfig b/trunk/arch/x86_64/Kconfig index d4275537b25b..ef6672455695 100644 --- a/trunk/arch/x86_64/Kconfig +++ b/trunk/arch/x86_64/Kconfig @@ -480,14 +480,13 @@ config CALGARY_IOMMU config CALGARY_IOMMU_ENABLED_BY_DEFAULT bool "Should Calgary be enabled by default?" - default y depends on CALGARY_IOMMU help - Should Calgary be enabled by default? if you choose 'y', Calgary + Should Calgary be enabled by default? If you choose 'y', Calgary will be used (if it exists). If you choose 'n', Calgary will not be used even if it exists. If you choose 'n' and would like to use Calgary anyway, pass 'iommu=calgary' on the kernel command line. - If unsure, say Y. + If unsure, say N. # need this always selected by IOMMU for the VIA workaround config SWIOTLB diff --git a/trunk/arch/x86_64/defconfig b/trunk/arch/x86_64/defconfig index 9cc7c21547a2..ac80b1209fc0 100644 --- a/trunk/arch/x86_64/defconfig +++ b/trunk/arch/x86_64/defconfig @@ -1191,7 +1191,7 @@ CONFIG_USB_STORAGE=y # USB Input Devices # CONFIG_USB_HID=y -# CONFIG_USB_HIDINPUT_POWERBOOK is not set +# CONFIG_USB_HID_POWERBOOK is not set # CONFIG_HID_FF is not set # CONFIG_USB_HIDDEV is not set # CONFIG_USB_AIPTEK is not set diff --git a/trunk/block/cfq-iosched.c b/trunk/block/cfq-iosched.c index 07b706243772..4b4217d9be78 100644 --- a/trunk/block/cfq-iosched.c +++ b/trunk/block/cfq-iosched.c @@ -577,9 +577,9 @@ static int cfq_allow_merge(request_queue_t *q, struct request *rq, pid_t key; /* - * Disallow merge of a sync bio into an async request. + * Disallow merge, if bio and rq aren't both sync or async */ - if ((bio_data_dir(bio) == READ || bio_sync(bio)) && !rq_is_sync(rq)) + if (!!bio_sync(bio) != !!rq_is_sync(rq)) return 0; /* @@ -592,7 +592,7 @@ static int cfq_allow_merge(request_queue_t *q, struct request *rq, if (cfqq == RQ_CFQQ(rq)) return 1; - return 0; + return 1; } static inline void diff --git a/trunk/drivers/ata/libata-sff.c b/trunk/drivers/ata/libata-sff.c index 623cec914c9b..10ee22ae5c15 100644 --- a/trunk/drivers/ata/libata-sff.c +++ b/trunk/drivers/ata/libata-sff.c @@ -1027,15 +1027,13 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, #endif } - if (!legacy_mode) { - rc = pci_request_regions(pdev, DRV_NAME); - if (rc) { - disable_dev_on_err = 0; - goto err_out; - } - } else { - /* Deal with combined mode hack. This side of the logic all - goes away once the combined mode hack is killed in 2.6.21 */ + rc = pci_request_regions(pdev, DRV_NAME); + if (rc) { + disable_dev_on_err = 0; + goto err_out; + } + + if (legacy_mode) { if (!request_region(ATA_PRIMARY_CMD, 8, "libata")) { struct resource *conflict, res; res.start = ATA_PRIMARY_CMD; @@ -1073,13 +1071,6 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, } } else legacy_mode |= ATA_PORT_SECONDARY; - - if (legacy_mode & ATA_PORT_PRIMARY) - pci_request_region(pdev, 1, DRV_NAME); - if (legacy_mode & ATA_PORT_SECONDARY) - pci_request_region(pdev, 3, DRV_NAME); - /* If there is a DMA resource, allocate it */ - pci_request_region(pdev, 4, DRV_NAME); } /* we have legacy mode, but all ports are unavailable */ @@ -1123,20 +1114,11 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, err_out_ent: kfree(probe_ent); err_out_regions: - /* All this conditional stuff is needed for the combined mode hack - until 2.6.21 when it can go */ - if (legacy_mode) { - pci_release_region(pdev, 4); - if (legacy_mode & ATA_PORT_PRIMARY) { - release_region(ATA_PRIMARY_CMD, 8); - pci_release_region(pdev, 1); - } - if (legacy_mode & ATA_PORT_SECONDARY) { - release_region(ATA_SECONDARY_CMD, 8); - pci_release_region(pdev, 3); - } - } else - pci_release_regions(pdev); + if (legacy_mode & ATA_PORT_PRIMARY) + release_region(ATA_PRIMARY_CMD, 8); + if (legacy_mode & ATA_PORT_SECONDARY) + release_region(ATA_SECONDARY_CMD, 8); + pci_release_regions(pdev); err_out: if (disable_dev_on_err) pci_disable_device(pdev); diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c index 05dfe357527c..9d2ddb209343 100644 --- a/trunk/drivers/block/cciss.c +++ b/trunk/drivers/block/cciss.c @@ -225,8 +225,6 @@ static inline CommandList_struct *removeQ(CommandList_struct **Qptr, #include "cciss_scsi.c" /* For SCSI tape support */ -#define RAID_UNKNOWN 6 - #ifdef CONFIG_PROC_FS /* @@ -234,6 +232,7 @@ static inline CommandList_struct *removeQ(CommandList_struct **Qptr, */ #define ENG_GIG 1000000000 #define ENG_GIG_FACTOR (ENG_GIG/512) +#define RAID_UNKNOWN 6 static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG", "UNKNOWN" }; diff --git a/trunk/drivers/char/ipmi/ipmi_watchdog.c b/trunk/drivers/char/ipmi/ipmi_watchdog.c index 6b634e8d9519..78280380a905 100644 --- a/trunk/drivers/char/ipmi/ipmi_watchdog.c +++ b/trunk/drivers/char/ipmi/ipmi_watchdog.c @@ -216,13 +216,13 @@ static int set_param_str(const char *val, struct kernel_param *kp) { action_fn fn = (action_fn) kp->arg; int rv = 0; - char valcp[16]; - char *s; + char *dup, *s; - strncpy(valcp, val, 16); - valcp[15] = '\0'; + dup = kstrdup(val, GFP_KERNEL); + if (!dup) + return -ENOMEM; - s = strstrip(valcp); + s = strstrip(dup); down_read(®ister_sem); rv = fn(s, NULL); @@ -235,6 +235,7 @@ static int set_param_str(const char *val, struct kernel_param *kp) out_unlock: up_read(®ister_sem); + kfree(dup); return rv; } diff --git a/trunk/drivers/char/isicom.c b/trunk/drivers/char/isicom.c index 01084abffddf..5a747e685993 100644 --- a/trunk/drivers/char/isicom.c +++ b/trunk/drivers/char/isicom.c @@ -230,20 +230,6 @@ static struct isi_port isi_ports[PORT_COUNT]; * it wants to talk. */ -static inline int WaitTillCardIsFree(u16 base) -{ - unsigned int count = 0; - unsigned int a = in_atomic(); /* do we run under spinlock? */ - - while (!(inw(base + 0xe) & 0x1) && count++ < 100) - if (a) - mdelay(1); - else - msleep(1); - - return !(inw(base + 0xe) & 0x1); -} - static int lock_card(struct isi_board *card) { char retries; @@ -290,71 +276,69 @@ static void unlock_card(struct isi_board *card) * ISI Card specific ops ... */ -/* card->lock HAS to be held */ static void raise_dtr(struct isi_port *port) { struct isi_board *card = port->card; unsigned long base = card->base; u16 channel = port->channel; - if (WaitTillCardIsFree(base)) + if (!lock_card(card)) return; outw(0x8000 | (channel << card->shift_count) | 0x02, base); outw(0x0504, base); InterruptTheCard(base); port->status |= ISI_DTR; + unlock_card(card); } -/* card->lock HAS to be held */ static inline void drop_dtr(struct isi_port *port) { struct isi_board *card = port->card; unsigned long base = card->base; u16 channel = port->channel; - if (WaitTillCardIsFree(base)) + if (!lock_card(card)) return; outw(0x8000 | (channel << card->shift_count) | 0x02, base); outw(0x0404, base); InterruptTheCard(base); port->status &= ~ISI_DTR; + unlock_card(card); } -/* card->lock HAS to be held */ static inline void raise_rts(struct isi_port *port) { struct isi_board *card = port->card; unsigned long base = card->base; u16 channel = port->channel; - if (WaitTillCardIsFree(base)) + if (!lock_card(card)) return; outw(0x8000 | (channel << card->shift_count) | 0x02, base); outw(0x0a04, base); InterruptTheCard(base); port->status |= ISI_RTS; + unlock_card(card); } - -/* card->lock HAS to be held */ static inline void drop_rts(struct isi_port *port) { struct isi_board *card = port->card; unsigned long base = card->base; u16 channel = port->channel; - if (WaitTillCardIsFree(base)) + if (!lock_card(card)) return; outw(0x8000 | (channel << card->shift_count) | 0x02, base); outw(0x0804, base); InterruptTheCard(base); port->status &= ~ISI_RTS; + unlock_card(card); } -/* card->lock MUST NOT be held */ static inline void raise_dtr_rts(struct isi_port *port) { struct isi_board *card = port->card; @@ -371,20 +355,35 @@ static inline void raise_dtr_rts(struct isi_port *port) unlock_card(card); } -/* card->lock HAS to be held */ static void drop_dtr_rts(struct isi_port *port) { struct isi_board *card = port->card; unsigned long base = card->base; u16 channel = port->channel; - if (WaitTillCardIsFree(base)) + if (!lock_card(card)) return; outw(0x8000 | (channel << card->shift_count) | 0x02, base); outw(0x0c04, base); InterruptTheCard(base); port->status &= ~(ISI_RTS | ISI_DTR); + unlock_card(card); +} + +static inline void kill_queue(struct isi_port *port, short queue) +{ + struct isi_board *card = port->card; + unsigned long base = card->base; + u16 channel = port->channel; + + if (!lock_card(card)) + return; + + outw(0x8000 | (channel << card->shift_count) | 0x02, base); + outw((queue << 8) | 0x06, base); + InterruptTheCard(base); + unlock_card(card); } /* @@ -745,7 +744,7 @@ static void isicom_config_port(struct isi_port *port) else raise_dtr(port); - if (WaitTillCardIsFree(base) == 0) { + if (lock_card(card)) { outw(0x8000 | (channel << shift_count) |0x03, base); outw(linuxb_to_isib[baud] << 8 | 0x03, base); channel_setup = 0; @@ -773,6 +772,7 @@ static void isicom_config_port(struct isi_port *port) } outw(channel_setup, base); InterruptTheCard(base); + unlock_card(card); } if (C_CLOCAL(tty)) port->flags &= ~ASYNC_CHECK_CD; @@ -791,11 +791,12 @@ static void isicom_config_port(struct isi_port *port) if (I_IXOFF(tty)) flow_ctrl |= ISICOM_INITIATE_XONXOFF; - if (WaitTillCardIsFree(base) == 0) { + if (lock_card(card)) { outw(0x8000 | (channel << shift_count) |0x04, base); outw(flow_ctrl << 8 | 0x05, base); outw((STOP_CHAR(tty)) << 8 | (START_CHAR(tty)), base); InterruptTheCard(base); + unlock_card(card); } /* rx enabled -> enable port for rx on the card */ @@ -820,9 +821,10 @@ static inline void isicom_setup_board(struct isi_board *bp) } port = bp->ports; bp->status |= BOARD_ACTIVE; + spin_unlock_irqrestore(&bp->card_lock, flags); for (channel = 0; channel < bp->port_count; channel++, port++) drop_dtr_rts(port); - spin_unlock_irqrestore(&bp->card_lock, flags); + return; } static int isicom_setup_port(struct isi_port *port) @@ -855,12 +857,7 @@ static int isicom_setup_port(struct isi_port *port) port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; /* discard any residual data */ - if (WaitTillCardIsFree(card->base) == 0) { - outw(0x8000 | (port->channel << card->shift_count) | 0x02, - card->base); - outw(((ISICOM_KILLTX | ISICOM_KILLRX) << 8) | 0x06, card->base); - InterruptTheCard(card->base); - } + kill_queue(port, ISICOM_KILLTX | ISICOM_KILLRX); isicom_config_port(port); port->flags |= ASYNC_INITIALIZED; @@ -986,22 +983,28 @@ static int isicom_open(struct tty_struct *tty, struct file *filp) static inline void isicom_shutdown_board(struct isi_board *bp) { + unsigned long flags; + + spin_lock_irqsave(&bp->card_lock, flags); if (bp->status & BOARD_ACTIVE) { bp->status &= ~BOARD_ACTIVE; } + spin_unlock_irqrestore(&bp->card_lock, flags); } -/* card->lock HAS to be held */ static void isicom_shutdown_port(struct isi_port *port) { struct isi_board *card = port->card; struct tty_struct *tty; + unsigned long flags; tty = port->tty; - if (!(port->flags & ASYNC_INITIALIZED)) + spin_lock_irqsave(&card->card_lock, flags); + if (!(port->flags & ASYNC_INITIALIZED)) { + spin_unlock_irqrestore(&card->card_lock, flags); return; - + } if (port->xmit_buf) { free_page((unsigned long) port->xmit_buf); port->xmit_buf = NULL; @@ -1009,6 +1012,7 @@ static void isicom_shutdown_port(struct isi_port *port) port->flags &= ~ASYNC_INITIALIZED; /* 3rd October 2000 : Vinayak P Risbud */ port->tty = NULL; + spin_unlock_irqrestore(&card->card_lock, flags); /*Fix done by Anil .S on 30-04-2001 remote login through isi port has dtr toggle problem @@ -1254,12 +1258,10 @@ static int isicom_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear) { struct isi_port *port = tty->driver_data; - unsigned long flags; if (isicom_paranoia_check(port, tty->name, "isicom_ioctl")) return -ENODEV; - spin_lock_irqsave(&port->card->card_lock, flags); if (set & TIOCM_RTS) raise_rts(port); if (set & TIOCM_DTR) @@ -1269,7 +1271,6 @@ static int isicom_tiocmset(struct tty_struct *tty, struct file *file, drop_rts(port); if (clear & TIOCM_DTR) drop_dtr(port); - spin_unlock_irqrestore(&port->card->card_lock, flags); return 0; } @@ -1302,10 +1303,7 @@ static int isicom_set_serial_info(struct isi_port *port, (newinfo.flags & ASYNC_FLAGS)); } if (reconfig_port) { - unsigned long flags; - spin_lock_irqsave(&port->card->card_lock, flags); isicom_config_port(port); - spin_unlock_irqrestore(&port->card->card_lock, flags); } return 0; } @@ -1386,7 +1384,6 @@ static void isicom_set_termios(struct tty_struct *tty, struct ktermios *old_termios) { struct isi_port *port = tty->driver_data; - unsigned long flags; if (isicom_paranoia_check(port, tty->name, "isicom_set_termios")) return; @@ -1395,9 +1392,7 @@ static void isicom_set_termios(struct tty_struct *tty, tty->termios->c_iflag == old_termios->c_iflag) return; - spin_lock_irqsave(&port->card->card_lock, flags); isicom_config_port(port); - spin_unlock_irqrestore(&port->card->card_lock, flags); if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios->c_cflag & CRTSCTS)) { @@ -1474,15 +1469,11 @@ static void do_isicom_hangup(struct work_struct *work) static void isicom_hangup(struct tty_struct *tty) { struct isi_port *port = tty->driver_data; - unsigned long flags; if (isicom_paranoia_check(port, tty->name, "isicom_hangup")) return; - spin_lock_irqsave(&port->card->card_lock, flags); isicom_shutdown_port(port); - spin_unlock_irqrestore(&port->card->card_lock, flags); - port->count = 0; port->flags &= ~ASYNC_NORMAL_ACTIVE; port->tty = NULL; @@ -1587,6 +1578,16 @@ static int __devinit reset_card(struct pci_dev *pdev, return retval; } +static inline int WaitTillCardIsFree(u16 base) +{ + unsigned long count = 0; + + while (!(inw(base + 0xe) & 0x1) && count++ < 100) + msleep(5); + + return !(inw(base + 0xe) & 0x1); +} + static int __devinit load_firmware(struct pci_dev *pdev, const unsigned int index, const unsigned int signature) { diff --git a/trunk/drivers/char/mxser.c b/trunk/drivers/char/mxser.c index 83f604b19290..c063359baf78 100644 --- a/trunk/drivers/char/mxser.c +++ b/trunk/drivers/char/mxser.c @@ -717,7 +717,6 @@ static int mxser_init(void) /* Initialize the tty_driver structure */ memset(mxvar_sdriver, 0, sizeof(struct tty_driver)); - mxvar_sdriver->owner = THIS_MODULE; mxvar_sdriver->magic = TTY_DRIVER_MAGIC; mxvar_sdriver->name = "ttyMI"; mxvar_sdriver->major = ttymajor; diff --git a/trunk/drivers/char/mxser_new.c b/trunk/drivers/char/mxser_new.c index 1bb030b3a51a..cd989dce7c53 100644 --- a/trunk/drivers/char/mxser_new.c +++ b/trunk/drivers/char/mxser_new.c @@ -2690,7 +2690,6 @@ static int __init mxser_module_init(void) MXSER_VERSION); /* Initialize the tty_driver structure */ - mxvar_sdriver->owner = THIS_MODULE; mxvar_sdriver->magic = TTY_DRIVER_MAGIC; mxvar_sdriver->name = "ttyMI"; mxvar_sdriver->major = ttymajor; diff --git a/trunk/drivers/ide/pci/piix.c b/trunk/drivers/ide/pci/piix.c index edb37f3d558d..b1e9a8eba6b6 100644 --- a/trunk/drivers/ide/pci/piix.c +++ b/trunk/drivers/ide/pci/piix.c @@ -1,14 +1,13 @@ /* - * linux/drivers/ide/pci/piix.c Version 0.45 May 12, 2006 + * linux/drivers/ide/pci/piix.c Version 0.44 March 20, 2003 * * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer * Copyright (C) 1998-2000 Andre Hedrick * Copyright (C) 2003 Red Hat Inc - * Copyright (C) 2006 MontaVista Software, Inc. * * May be copied or modified under the terms of the GNU General Public License * - * PIO mode setting function for Intel chipsets. + * PIO mode setting function for Intel chipsets. * For use instead of BIOS settings. * * 40-41 @@ -26,7 +25,7 @@ * sitre = word42 & 0x4000; secondary * * 44 8421|8421 hdd|hdb - * + * * 48 8421 hdd|hdc|hdb|hda udma enabled * * 0001 hda @@ -353,25 +352,57 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) return (ide_config_drive_speed(drive, speed)); } +/** + * piix_faulty_dma0 - check for DMA0 errata + * @hwif: IDE interface to check + * + * If an ICH/ICH0/ICH2 interface is is operating in multi-word + * DMA mode with 600nS cycle time the IDE PIO prefetch buffer will + * inadvertently provide an extra piece of secondary data to the primary + * device resulting in data corruption. + * + * With such a device this test function returns true. This allows + * our tuning code to follow Intel recommendations and use PIO on + * such devices. + */ + +static int piix_faulty_dma0(ide_hwif_t *hwif) +{ + switch(hwif->pci_dev->device) + { + case PCI_DEVICE_ID_INTEL_82801AA_1: /* ICH */ + case PCI_DEVICE_ID_INTEL_82801AB_1: /* ICH0 */ + case PCI_DEVICE_ID_INTEL_82801BA_8: /* ICH2 */ + case PCI_DEVICE_ID_INTEL_82801BA_9: /* ICH2 */ + return 1; + } + return 0; +} + /** * piix_config_drive_for_dma - configure drive for DMA * @drive: IDE drive to configure * * Set up a PIIX interface channel for the best available speed. - * We prefer UDMA if it is available and then MWDMA. If DMA is - * not available we switch to PIO and return 0. + * We prefer UDMA if it is available and then MWDMA. If DMA is + * not available we switch to PIO and return 0. */ static int piix_config_drive_for_dma (ide_drive_t *drive) { u8 speed = ide_dma_speed(drive, piix_ratemask(drive)); - - /* - * If no DMA speed was available or the chipset has DMA bugs - * then disable DMA and use PIO - */ - if (!speed || no_piix_dma) - return 0; + + /* Some ICH devices cannot support DMA mode 0 */ + if(speed == XFER_MW_DMA_0 && piix_faulty_dma0(HWIF(drive))) + speed = 0; + + /* If no DMA speed was available or the chipset has DMA bugs + then disable DMA and use PIO */ + + if (!speed || no_piix_dma) { + u8 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); + speed = piix_dma_2_pio(XFER_PIO_0 + tspeed); + } (void) piix_tune_chipset(drive, speed); return ide_dma_enable(drive); @@ -394,16 +425,17 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive) if ((id->capability & 1) && drive->autodma) { - if (ide_use_dma(drive) && piix_config_drive_for_dma(drive)) - return hwif->ide_dma_on(drive); + if (ide_use_dma(drive)) { + if (piix_config_drive_for_dma(drive)) + return hwif->ide_dma_on(drive); + } goto fast_ata_pio; } else if ((id->capability & 8) || (id->field_valid & 2)) { fast_ata_pio: /* Find best PIO mode. */ - (void) hwif->speedproc(drive, XFER_PIO_0 + - ide_get_best_pio_mode(drive, 255, 4, NULL)); + hwif->tuneproc(drive, 255); return hwif->ide_dma_off_quietly(drive); } /* IORDY not supported */ diff --git a/trunk/drivers/ide/pci/slc90e66.c b/trunk/drivers/ide/pci/slc90e66.c index 9be7e49cba0e..4a1853af3bbb 100644 --- a/trunk/drivers/ide/pci/slc90e66.c +++ b/trunk/drivers/ide/pci/slc90e66.c @@ -1,10 +1,9 @@ /* - * linux/drivers/ide/pci/slc90e66.c Version 0.12 May 12, 2006 + * linux/drivers/ide/pci/slc90e66.c Version 0.11 September 11, 2002 * * Copyright (C) 2000-2002 Andre Hedrick - * Copyright (C) 2006 MontaVista Software, Inc. * - * This is a look-alike variation of the ICH0 PIIX4 Ultra-66, + * This a look-a-like variation of the ICH0 PIIX4 Ultra-66, * but this keeps the ISA-Bridge and slots alive. * */ @@ -159,8 +158,10 @@ static int slc90e66_config_drive_for_dma (ide_drive_t *drive) { u8 speed = ide_dma_speed(drive, slc90e66_ratemask(drive)); - if (!speed) - return 0; + if (!(speed)) { + u8 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); + speed = slc90e66_dma_2_pio(XFER_PIO_0 + tspeed); + } (void) slc90e66_tune_chipset(drive, speed); return ide_dma_enable(drive); @@ -175,15 +176,16 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) if (id && (id->capability & 1) && drive->autodma) { - if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive)) - return hwif->ide_dma_on(drive); + if (ide_use_dma(drive)) { + if (slc90e66_config_drive_for_dma(drive)) + return hwif->ide_dma_on(drive); + } goto fast_ata_pio; } else if ((id->capability & 8) || (id->field_valid & 2)) { fast_ata_pio: - (void) hwif->speedproc(drive, XFER_PIO_0 + - ide_get_best_pio_mode(drive, 255, 4, NULL)); + hwif->tuneproc(drive, 5); return hwif->ide_dma_off_quietly(drive); } /* IORDY not supported */ diff --git a/trunk/drivers/ieee1394/sbp2.c b/trunk/drivers/ieee1394/sbp2.c index 2b5d7ab3adf7..e68b80b7340d 100644 --- a/trunk/drivers/ieee1394/sbp2.c +++ b/trunk/drivers/ieee1394/sbp2.c @@ -490,11 +490,11 @@ static int sbp2util_create_command_orb_pool(struct sbp2_lu *lu) spin_unlock_irqrestore(&lu->cmd_orb_lock, flags); return -ENOMEM; } - cmd->command_orb_dma = dma_map_single(hi->host->device.parent, + cmd->command_orb_dma = dma_map_single(&hi->host->device, &cmd->command_orb, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); - cmd->sge_dma = dma_map_single(hi->host->device.parent, + cmd->sge_dma = dma_map_single(&hi->host->device, &cmd->scatter_gather_element, sizeof(cmd->scatter_gather_element), DMA_BIDIRECTIONAL); @@ -516,11 +516,10 @@ static void sbp2util_remove_command_orb_pool(struct sbp2_lu *lu) if (!list_empty(&lu->cmd_orb_completed)) list_for_each_safe(lh, next, &lu->cmd_orb_completed) { cmd = list_entry(lh, struct sbp2_command_info, list); - dma_unmap_single(host->device.parent, - cmd->command_orb_dma, + dma_unmap_single(&host->device, cmd->command_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); - dma_unmap_single(host->device.parent, cmd->sge_dma, + dma_unmap_single(&host->device, cmd->sge_dma, sizeof(cmd->scatter_gather_element), DMA_BIDIRECTIONAL); kfree(cmd); @@ -602,17 +601,17 @@ static void sbp2util_mark_command_completed(struct sbp2_lu *lu, if (cmd->cmd_dma) { if (cmd->dma_type == CMD_DMA_SINGLE) - dma_unmap_single(host->device.parent, cmd->cmd_dma, + dma_unmap_single(&host->device, cmd->cmd_dma, cmd->dma_size, cmd->dma_dir); else if (cmd->dma_type == CMD_DMA_PAGE) - dma_unmap_page(host->device.parent, cmd->cmd_dma, + dma_unmap_page(&host->device, cmd->cmd_dma, cmd->dma_size, cmd->dma_dir); /* XXX: Check for CMD_DMA_NONE bug */ cmd->dma_type = CMD_DMA_NONE; cmd->cmd_dma = 0; } if (cmd->sge_buffer) { - dma_unmap_sg(host->device.parent, cmd->sge_buffer, + dma_unmap_sg(&host->device, cmd->sge_buffer, cmd->dma_size, cmd->dma_dir); cmd->sge_buffer = NULL; } @@ -837,37 +836,37 @@ static int sbp2_start_device(struct sbp2_lu *lu) struct sbp2_fwhost_info *hi = lu->hi; int error; - lu->login_response = dma_alloc_coherent(hi->host->device.parent, + lu->login_response = dma_alloc_coherent(&hi->host->device, sizeof(struct sbp2_login_response), &lu->login_response_dma, GFP_KERNEL); if (!lu->login_response) goto alloc_fail; - lu->query_logins_orb = dma_alloc_coherent(hi->host->device.parent, + lu->query_logins_orb = dma_alloc_coherent(&hi->host->device, sizeof(struct sbp2_query_logins_orb), &lu->query_logins_orb_dma, GFP_KERNEL); if (!lu->query_logins_orb) goto alloc_fail; - lu->query_logins_response = dma_alloc_coherent(hi->host->device.parent, + lu->query_logins_response = dma_alloc_coherent(&hi->host->device, sizeof(struct sbp2_query_logins_response), &lu->query_logins_response_dma, GFP_KERNEL); if (!lu->query_logins_response) goto alloc_fail; - lu->reconnect_orb = dma_alloc_coherent(hi->host->device.parent, + lu->reconnect_orb = dma_alloc_coherent(&hi->host->device, sizeof(struct sbp2_reconnect_orb), &lu->reconnect_orb_dma, GFP_KERNEL); if (!lu->reconnect_orb) goto alloc_fail; - lu->logout_orb = dma_alloc_coherent(hi->host->device.parent, + lu->logout_orb = dma_alloc_coherent(&hi->host->device, sizeof(struct sbp2_logout_orb), &lu->logout_orb_dma, GFP_KERNEL); if (!lu->logout_orb) goto alloc_fail; - lu->login_orb = dma_alloc_coherent(hi->host->device.parent, + lu->login_orb = dma_alloc_coherent(&hi->host->device, sizeof(struct sbp2_login_orb), &lu->login_orb_dma, GFP_KERNEL); if (!lu->login_orb) @@ -930,32 +929,32 @@ static void sbp2_remove_device(struct sbp2_lu *lu) list_del(&lu->lu_list); if (lu->login_response) - dma_free_coherent(hi->host->device.parent, + dma_free_coherent(&hi->host->device, sizeof(struct sbp2_login_response), lu->login_response, lu->login_response_dma); if (lu->login_orb) - dma_free_coherent(hi->host->device.parent, + dma_free_coherent(&hi->host->device, sizeof(struct sbp2_login_orb), lu->login_orb, lu->login_orb_dma); if (lu->reconnect_orb) - dma_free_coherent(hi->host->device.parent, + dma_free_coherent(&hi->host->device, sizeof(struct sbp2_reconnect_orb), lu->reconnect_orb, lu->reconnect_orb_dma); if (lu->logout_orb) - dma_free_coherent(hi->host->device.parent, + dma_free_coherent(&hi->host->device, sizeof(struct sbp2_logout_orb), lu->logout_orb, lu->logout_orb_dma); if (lu->query_logins_orb) - dma_free_coherent(hi->host->device.parent, + dma_free_coherent(&hi->host->device, sizeof(struct sbp2_query_logins_orb), lu->query_logins_orb, lu->query_logins_orb_dma); if (lu->query_logins_response) - dma_free_coherent(hi->host->device.parent, + dma_free_coherent(&hi->host->device, sizeof(struct sbp2_query_logins_response), lu->query_logins_response, lu->query_logins_response_dma); @@ -1446,7 +1445,7 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb, cmd->dma_size = sgpnt[0].length; cmd->dma_type = CMD_DMA_PAGE; - cmd->cmd_dma = dma_map_page(hi->host->device.parent, + cmd->cmd_dma = dma_map_page(&hi->host->device, sgpnt[0].page, sgpnt[0].offset, cmd->dma_size, cmd->dma_dir); @@ -1458,8 +1457,8 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb, &cmd->scatter_gather_element[0]; u32 sg_count, sg_len; dma_addr_t sg_addr; - int i, count = dma_map_sg(hi->host->device.parent, sgpnt, - scsi_use_sg, dma_dir); + int i, count = dma_map_sg(&hi->host->device, sgpnt, scsi_use_sg, + dma_dir); cmd->dma_size = scsi_use_sg; cmd->sge_buffer = sgpnt; @@ -1509,8 +1508,7 @@ static void sbp2_prep_command_orb_no_sg(struct sbp2_command_orb *orb, cmd->dma_dir = dma_dir; cmd->dma_size = scsi_request_bufflen; cmd->dma_type = CMD_DMA_SINGLE; - cmd->cmd_dma = dma_map_single(hi->host->device.parent, - scsi_request_buffer, + cmd->cmd_dma = dma_map_single(&hi->host->device, scsi_request_buffer, cmd->dma_size, cmd->dma_dir); orb->data_descriptor_hi = ORB_SET_NODE_ID(hi->host->node_id); orb->misc |= ORB_SET_DIRECTION(orb_direction); @@ -1628,11 +1626,10 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu, size_t length; unsigned long flags; - dma_sync_single_for_device(hi->host->device.parent, - cmd->command_orb_dma, + dma_sync_single_for_device(&hi->host->device, cmd->command_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); - dma_sync_single_for_device(hi->host->device.parent, cmd->sge_dma, + dma_sync_single_for_device(&hi->host->device, cmd->sge_dma, sizeof(cmd->scatter_gather_element), DMA_BIDIRECTIONAL); @@ -1658,15 +1655,14 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu, * The target's fetch agent may or may not have read this * previous ORB yet. */ - dma_sync_single_for_cpu(hi->host->device.parent, last_orb_dma, + dma_sync_single_for_cpu(&hi->host->device, last_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); last_orb->next_ORB_lo = cpu_to_be32(cmd->command_orb_dma); wmb(); /* Tells hardware that this pointer is valid */ last_orb->next_ORB_hi = 0; - dma_sync_single_for_device(hi->host->device.parent, - last_orb_dma, + dma_sync_single_for_device(&hi->host->device, last_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); addr += SBP2_DOORBELL_OFFSET; @@ -1794,11 +1790,10 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, else cmd = sbp2util_find_command_for_orb(lu, sb->ORB_offset_lo); if (cmd) { - dma_sync_single_for_cpu(hi->host->device.parent, - cmd->command_orb_dma, + dma_sync_single_for_cpu(&hi->host->device, cmd->command_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); - dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma, + dma_sync_single_for_cpu(&hi->host->device, cmd->sge_dma, sizeof(cmd->scatter_gather_element), DMA_BIDIRECTIONAL); /* Grab SCSI command pointers and check status. */ @@ -1887,6 +1882,16 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt, if (unlikely(SCpnt->device->lun)) goto done; + /* handle the request sense command here (auto-request sense) */ + if (SCpnt->cmnd[0] == REQUEST_SENSE) { + memcpy(SCpnt->request_buffer, SCpnt->sense_buffer, + SCpnt->request_bufflen); + memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer)); + sbp2scsi_complete_command(lu, SBP2_SCSI_STATUS_GOOD, SCpnt, + done); + return 0; + } + if (unlikely(!hpsb_node_entry_valid(lu->ne))) { SBP2_ERR("Bus reset in progress - rejecting command"); result = DID_BUS_BUSY << 16; @@ -1926,11 +1931,10 @@ static void sbp2scsi_complete_all_commands(struct sbp2_lu *lu, u32 status) while (!list_empty(&lu->cmd_orb_inuse)) { lh = lu->cmd_orb_inuse.next; cmd = list_entry(lh, struct sbp2_command_info, list); - dma_sync_single_for_cpu(hi->host->device.parent, - cmd->command_orb_dma, + dma_sync_single_for_cpu(&hi->host->device, cmd->command_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); - dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma, + dma_sync_single_for_cpu(&hi->host->device, cmd->sge_dma, sizeof(cmd->scatter_gather_element), DMA_BIDIRECTIONAL); sbp2util_mark_command_completed(lu, cmd); @@ -2055,12 +2059,11 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt) spin_lock_irqsave(&lu->cmd_orb_lock, flags); cmd = sbp2util_find_command_for_SCpnt(lu, SCpnt); if (cmd) { - dma_sync_single_for_cpu(hi->host->device.parent, + dma_sync_single_for_cpu(&hi->host->device, cmd->command_orb_dma, sizeof(struct sbp2_command_orb), DMA_TO_DEVICE); - dma_sync_single_for_cpu(hi->host->device.parent, - cmd->sge_dma, + dma_sync_single_for_cpu(&hi->host->device, cmd->sge_dma, sizeof(cmd->scatter_gather_element), DMA_BIDIRECTIONAL); sbp2util_mark_command_completed(lu, cmd); diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_provider.c b/trunk/drivers/infiniband/hw/mthca/mthca_provider.c index 7b96751695ea..7ec7c4b937f9 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_provider.c @@ -1100,11 +1100,10 @@ static struct ib_fmr *mthca_alloc_fmr(struct ib_pd *pd, int mr_access_flags, struct mthca_fmr *fmr; int err; - fmr = kmalloc(sizeof *fmr, GFP_KERNEL); + fmr = kmemdup(fmr_attr, sizeof *fmr, GFP_KERNEL); if (!fmr) return ERR_PTR(-ENOMEM); - memcpy(&fmr->attr, fmr_attr, sizeof *fmr_attr); err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num, convert_access(mr_access_flags), fmr); diff --git a/trunk/drivers/input/serio/i8042-sparcio.h b/trunk/drivers/input/serio/i8042-sparcio.h index d9ca55891cd7..54adba2d8ed5 100644 --- a/trunk/drivers/input/serio/i8042-sparcio.h +++ b/trunk/drivers/input/serio/i8042-sparcio.h @@ -16,7 +16,6 @@ static int i8042_aux_irq = -1; #define I8042_MUX_PHYS_DESC "sparcps2/serio%d" static void __iomem *kbd_iobase; -static struct resource *kbd_res; #define I8042_COMMAND_REG (kbd_iobase + 0x64UL) #define I8042_DATA_REG (kbd_iobase + 0x60UL) @@ -61,7 +60,6 @@ static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_dev i8042_kbd_irq = irq; kbd_iobase = of_ioremap(&kbd->resource[0], 0, 8, "kbd"); - kbd_res = &kbd->resource[0]; } else if (!strcmp(dp->name, OBP_PS2MS_NAME1) || !strcmp(dp->name, OBP_PS2MS_NAME2)) { struct of_device *ms = of_find_device_by_node(dp); @@ -79,7 +77,7 @@ static int __devinit sparc_i8042_probe(struct of_device *op, const struct of_dev static int __devexit sparc_i8042_remove(struct of_device *op) { - of_iounmap(kbd_res, kbd_iobase, 8); + of_iounmap(kbd_iobase, 8); return 0; } @@ -121,7 +119,7 @@ static int __init i8042_platform_init(void) if (i8042_kbd_irq == -1 || i8042_aux_irq == -1) { if (kbd_iobase) { - of_iounmap(kbd_res, kbd_iobase, 8); + of_iounmap(kbd_iobase, 8); kbd_iobase = (void __iomem *) NULL; } return -ENODEV; diff --git a/trunk/drivers/kvm/kvm.h b/trunk/drivers/kvm/kvm.h index 100df6f38d92..930e04ce1af6 100644 --- a/trunk/drivers/kvm/kvm.h +++ b/trunk/drivers/kvm/kvm.h @@ -278,6 +278,7 @@ struct kvm_arch_ops { struct kvm_segment *var, int seg); void (*set_segment)(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg); + int (*is_long_mode)(struct kvm_vcpu *vcpu); void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); void (*set_cr0_no_modeswitch)(struct kvm_vcpu *vcpu, @@ -319,8 +320,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module); void kvm_exit_arch(void); void kvm_mmu_destroy(struct kvm_vcpu *vcpu); -int kvm_mmu_create(struct kvm_vcpu *vcpu); -int kvm_mmu_setup(struct kvm_vcpu *vcpu); +int kvm_mmu_init(struct kvm_vcpu *vcpu); int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); @@ -375,8 +375,9 @@ void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0); void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0); void lmsw(struct kvm_vcpu *vcpu, unsigned long msw); -int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); -int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); +#ifdef CONFIG_X86_64 +void set_efer(struct kvm_vcpu *vcpu, u64 efer); +#endif void fx_init(struct kvm_vcpu *vcpu); @@ -402,15 +403,6 @@ static inline struct page *_gfn_to_page(struct kvm *kvm, gfn_t gfn) return (slot) ? slot->phys_mem[gfn - slot->base_gfn] : NULL; } -static inline int is_long_mode(struct kvm_vcpu *vcpu) -{ -#ifdef CONFIG_X86_64 - return vcpu->shadow_efer & EFER_LME; -#else - return 0; -#endif -} - static inline int is_pae(struct kvm_vcpu *vcpu) { return vcpu->cr4 & CR4_PAE_MASK; diff --git a/trunk/drivers/kvm/kvm_main.c b/trunk/drivers/kvm/kvm_main.c index ce7fe640f18d..9f24f22e4cb2 100644 --- a/trunk/drivers/kvm/kvm_main.c +++ b/trunk/drivers/kvm/kvm_main.c @@ -245,8 +245,7 @@ static void kvm_free_physmem_slot(struct kvm_memory_slot *free, if (!dont || free->phys_mem != dont->phys_mem) if (free->phys_mem) { for (i = 0; i < free->npages; ++i) - if (free->phys_mem[i]) - __free_page(free->phys_mem[i]); + __free_page(free->phys_mem[i]); vfree(free->phys_mem); } @@ -399,7 +398,7 @@ void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) return; } - if (is_long_mode(vcpu)) { + if (kvm_arch_ops->is_long_mode(vcpu)) { if (!(cr4 & CR4_PAE_MASK)) { printk(KERN_DEBUG "set_cr4: #GP, clearing PAE while " "in long mode\n"); @@ -426,7 +425,7 @@ EXPORT_SYMBOL_GPL(set_cr4); void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) { - if (is_long_mode(vcpu)) { + if (kvm_arch_ops->is_long_mode(vcpu)) { if ( cr3 & CR3_L_MODE_RESEVED_BITS) { printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n"); inject_gp(vcpu); @@ -522,14 +521,12 @@ static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n) if (r < 0) goto out_free_vcpus; - r = kvm_mmu_create(vcpu); - if (r < 0) - goto out_free_vcpus; - kvm_arch_ops->vcpu_load(vcpu); - r = kvm_mmu_setup(vcpu); + + r = kvm_arch_ops->vcpu_setup(vcpu); if (r >= 0) - r = kvm_arch_ops->vcpu_setup(vcpu); + r = kvm_mmu_init(vcpu); + vcpu_put(vcpu); if (r < 0) @@ -1106,51 +1103,6 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val, } } -int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) -{ - u64 data; - - switch (msr) { - case 0xc0010010: /* SYSCFG */ - case 0xc0010015: /* HWCR */ - case MSR_IA32_PLATFORM_ID: - case MSR_IA32_P5_MC_ADDR: - case MSR_IA32_P5_MC_TYPE: - case MSR_IA32_MC0_CTL: - case MSR_IA32_MCG_STATUS: - case MSR_IA32_MCG_CAP: - case MSR_IA32_MC0_MISC: - case MSR_IA32_MC0_MISC+4: - case MSR_IA32_MC0_MISC+8: - case MSR_IA32_MC0_MISC+12: - case MSR_IA32_MC0_MISC+16: - case MSR_IA32_UCODE_REV: - case MSR_IA32_PERF_STATUS: - /* MTRR registers */ - case 0xfe: - case 0x200 ... 0x2ff: - data = 0; - break; - case 0xcd: /* fsb frequency */ - data = 3; - break; - case MSR_IA32_APICBASE: - data = vcpu->apic_base; - break; -#ifdef CONFIG_X86_64 - case MSR_EFER: - data = vcpu->shadow_efer; - break; -#endif - default: - printk(KERN_ERR "kvm: unhandled rdmsr: 0x%x\n", msr); - return 1; - } - *pdata = data; - return 0; -} -EXPORT_SYMBOL_GPL(kvm_get_msr_common); - /* * Reads an msr value (of 'msr_index') into 'pdata'. * Returns 0 on success, non-0 otherwise. @@ -1163,7 +1115,7 @@ static int get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) #ifdef CONFIG_X86_64 -static void set_efer(struct kvm_vcpu *vcpu, u64 efer) +void set_efer(struct kvm_vcpu *vcpu, u64 efer) { if (efer & EFER_RESERVED_BITS) { printk(KERN_DEBUG "set_efer: 0x%llx #GP, reserved bits\n", @@ -1186,36 +1138,10 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer) vcpu->shadow_efer = efer; } +EXPORT_SYMBOL_GPL(set_efer); #endif -int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) -{ - switch (msr) { -#ifdef CONFIG_X86_64 - case MSR_EFER: - set_efer(vcpu, data); - break; -#endif - case MSR_IA32_MC0_STATUS: - printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n", - __FUNCTION__, data); - break; - case MSR_IA32_UCODE_REV: - case MSR_IA32_UCODE_WRITE: - case 0x200 ... 0x2ff: /* MTRRs */ - break; - case MSR_IA32_APICBASE: - vcpu->apic_base = data; - break; - default: - printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr); - return 1; - } - return 0; -} -EXPORT_SYMBOL_GPL(kvm_set_msr_common); - /* * Writes msr value into into the appropriate "register". * Returns 0 on success, non-0 otherwise. @@ -1939,11 +1865,6 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) { int r; - if (kvm_arch_ops) { - printk(KERN_ERR "kvm: already loaded the other module\n"); - return -EEXIST; - } - kvm_arch_ops = ops; if (!kvm_arch_ops->cpu_has_kvm_support()) { @@ -1986,7 +1907,6 @@ void kvm_exit_arch(void) unregister_reboot_notifier(&kvm_reboot_notifier); on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); kvm_arch_ops->hardware_unsetup(); - kvm_arch_ops = NULL; } static __init int kvm_init(void) diff --git a/trunk/drivers/kvm/mmu.c b/trunk/drivers/kvm/mmu.c index 790423c5f23d..bdffe83b19e8 100644 --- a/trunk/drivers/kvm/mmu.c +++ b/trunk/drivers/kvm/mmu.c @@ -578,7 +578,7 @@ static int init_kvm_mmu(struct kvm_vcpu *vcpu) if (!is_paging(vcpu)) return nonpaging_init_context(vcpu); - else if (is_long_mode(vcpu)) + else if (kvm_arch_ops->is_long_mode(vcpu)) return paging64_init_context(vcpu); else if (is_pae(vcpu)) return paging32E_init_context(vcpu); @@ -639,22 +639,28 @@ static int alloc_mmu_pages(struct kvm_vcpu *vcpu) return -ENOMEM; } -int kvm_mmu_create(struct kvm_vcpu *vcpu) +int kvm_mmu_init(struct kvm_vcpu *vcpu) { + int r; + ASSERT(vcpu); ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); ASSERT(list_empty(&vcpu->free_pages)); - return alloc_mmu_pages(vcpu); -} + r = alloc_mmu_pages(vcpu); + if (r) + goto out; -int kvm_mmu_setup(struct kvm_vcpu *vcpu) -{ - ASSERT(vcpu); - ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); - ASSERT(!list_empty(&vcpu->free_pages)); + r = init_kvm_mmu(vcpu); + if (r) + goto out_free_pages; - return init_kvm_mmu(vcpu); + return 0; + +out_free_pages: + free_mmu_pages(vcpu); +out: + return r; } void kvm_mmu_destroy(struct kvm_vcpu *vcpu) diff --git a/trunk/drivers/kvm/paging_tmpl.h b/trunk/drivers/kvm/paging_tmpl.h index 09bb9b4ed12d..a9771b4c5bb8 100644 --- a/trunk/drivers/kvm/paging_tmpl.h +++ b/trunk/drivers/kvm/paging_tmpl.h @@ -68,7 +68,7 @@ static void FNAME(init_walker)(struct guest_walker *walker, hpa = safe_gpa_to_hpa(vcpu, vcpu->cr3 & PT64_BASE_ADDR_MASK); walker->table = kmap_atomic(pfn_to_page(hpa >> PAGE_SHIFT), KM_USER0); - ASSERT((!is_long_mode(vcpu) && is_pae(vcpu)) || + ASSERT((!kvm_arch_ops->is_long_mode(vcpu) && is_pae(vcpu)) || (vcpu->cr3 & ~(PAGE_MASK | CR3_FLAGS_MASK)) == 0); walker->table = (pt_element_t *)( (unsigned long)walker->table | @@ -131,7 +131,7 @@ static pt_element_t *FNAME(fetch_guest)(struct kvm_vcpu *vcpu, (walker->table[index] & PT_PAGE_SIZE_MASK) && (PTTYPE == 64 || is_pse(vcpu)))) return &walker->table[index]; - if (walker->level != 3 || is_long_mode(vcpu)) + if (walker->level != 3 || kvm_arch_ops->is_long_mode(vcpu)) walker->inherited_ar &= walker->table[index]; paddr = safe_gpa_to_hpa(vcpu, walker->table[index] & PT_BASE_ADDR_MASK); kunmap_atomic(walker->table, KM_USER0); diff --git a/trunk/drivers/kvm/svm.c b/trunk/drivers/kvm/svm.c index fa0428735717..9ec87636ded6 100644 --- a/trunk/drivers/kvm/svm.c +++ b/trunk/drivers/kvm/svm.c @@ -166,6 +166,11 @@ static inline void write_dr7(unsigned long val) asm volatile ("mov %0, %%dr7" :: "r" (val)); } +static inline int svm_is_long_mode(struct kvm_vcpu *vcpu) +{ + return vcpu->svm->vmcb->save.efer & KVM_EFER_LMA; +} + static inline void force_new_asid(struct kvm_vcpu *vcpu) { vcpu->svm->asid_generation--; @@ -241,7 +246,7 @@ static int has_svm(void) { uint32_t eax, ebx, ecx, edx; - if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) { + if (current_cpu_data.x86_vendor != X86_VENDOR_AMD) { printk(KERN_INFO "has_svm: not amd\n"); return 0; } @@ -1068,6 +1073,22 @@ static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_ru static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) { switch (ecx) { + case MSR_IA32_P5_MC_ADDR: + case MSR_IA32_P5_MC_TYPE: + case MSR_IA32_MC0_CTL: + case MSR_IA32_MCG_STATUS: + case MSR_IA32_MCG_CAP: + case MSR_IA32_MC0_MISC: + case MSR_IA32_MC0_MISC+4: + case MSR_IA32_MC0_MISC+8: + case MSR_IA32_MC0_MISC+12: + case MSR_IA32_MC0_MISC+16: + case MSR_IA32_UCODE_REV: + /* MTRR registers */ + case 0xfe: + case 0x200 ... 0x2ff: + *data = 0; + break; case MSR_IA32_TIME_STAMP_COUNTER: { u64 tsc; @@ -1075,6 +1096,12 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) *data = vcpu->svm->vmcb->control.tsc_offset + tsc; break; } + case MSR_EFER: + *data = vcpu->shadow_efer; + break; + case MSR_IA32_APICBASE: + *data = vcpu->apic_base; + break; case MSR_K6_STAR: *data = vcpu->svm->vmcb->save.star; break; @@ -1102,7 +1129,8 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) *data = vcpu->svm->vmcb->save.sysenter_esp; break; default: - return kvm_get_msr_common(vcpu, ecx, data); + printk(KERN_ERR "kvm: unhandled rdmsr: 0x%x\n", ecx); + return 1; } return 0; } @@ -1126,6 +1154,15 @@ static int rdmsr_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) { switch (ecx) { +#ifdef CONFIG_X86_64 + case MSR_EFER: + set_efer(vcpu, data); + break; +#endif + case MSR_IA32_MC0_STATUS: + printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" + , __FUNCTION__, data); + break; case MSR_IA32_TIME_STAMP_COUNTER: { u64 tsc; @@ -1133,6 +1170,13 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) vcpu->svm->vmcb->control.tsc_offset = data - tsc; break; } + case MSR_IA32_UCODE_REV: + case MSR_IA32_UCODE_WRITE: + case 0x200 ... 0x2ff: /* MTRRs */ + break; + case MSR_IA32_APICBASE: + vcpu->apic_base = data; + break; case MSR_K6_STAR: vcpu->svm->vmcb->save.star = data; break; @@ -1160,7 +1204,8 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) vcpu->svm->vmcb->save.sysenter_esp = data; break; default: - return kvm_set_msr_common(vcpu, ecx, data); + printk(KERN_ERR "kvm: unhandled wrmsr: %x\n", ecx); + return 1; } return 0; } @@ -1564,6 +1609,7 @@ static struct kvm_arch_ops svm_arch_ops = { .get_segment_base = svm_get_segment_base, .get_segment = svm_get_segment, .set_segment = svm_set_segment, + .is_long_mode = svm_is_long_mode, .get_cs_db_l_bits = svm_get_cs_db_l_bits, .set_cr0 = svm_set_cr0, .set_cr0_no_modeswitch = svm_set_cr0, diff --git a/trunk/drivers/kvm/vmx.c b/trunk/drivers/kvm/vmx.c index d0a2c2d5342a..983a15b1977c 100644 --- a/trunk/drivers/kvm/vmx.c +++ b/trunk/drivers/kvm/vmx.c @@ -26,6 +26,7 @@ #include "segment_descriptor.h" +#define MSR_IA32_FEATURE_CONTROL 0x03a MODULE_AUTHOR("Qumranet"); MODULE_LICENSE("GPL"); @@ -343,7 +344,8 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) data = vmcs_readl(GUEST_GS_BASE); break; case MSR_EFER: - return kvm_get_msr_common(vcpu, msr_index, pdata); + data = vcpu->shadow_efer; + break; #endif case MSR_IA32_TIME_STAMP_COUNTER: data = guest_read_tsc(); @@ -357,13 +359,33 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) case MSR_IA32_SYSENTER_ESP: data = vmcs_read32(GUEST_SYSENTER_ESP); break; + case MSR_IA32_P5_MC_ADDR: + case MSR_IA32_P5_MC_TYPE: + case MSR_IA32_MC0_CTL: + case MSR_IA32_MCG_STATUS: + case MSR_IA32_MCG_CAP: + case MSR_IA32_MC0_MISC: + case MSR_IA32_MC0_MISC+4: + case MSR_IA32_MC0_MISC+8: + case MSR_IA32_MC0_MISC+12: + case MSR_IA32_MC0_MISC+16: + case MSR_IA32_UCODE_REV: + /* MTRR registers */ + case 0xfe: + case 0x200 ... 0x2ff: + data = 0; + break; + case MSR_IA32_APICBASE: + data = vcpu->apic_base; + break; default: msr = find_msr_entry(vcpu, msr_index); - if (msr) { - data = msr->data; - break; + if (!msr) { + printk(KERN_ERR "kvm: unhandled rdmsr: %x\n", msr_index); + return 1; } - return kvm_get_msr_common(vcpu, msr_index, pdata); + data = msr->data; + break; } *pdata = data; @@ -380,8 +402,6 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) struct vmx_msr_entry *msr; switch (msr_index) { #ifdef CONFIG_X86_64 - case MSR_EFER: - return kvm_set_msr_common(vcpu, msr_index, data); case MSR_FS_BASE: vmcs_writel(GUEST_FS_BASE, data); break; @@ -398,17 +418,32 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) case MSR_IA32_SYSENTER_ESP: vmcs_write32(GUEST_SYSENTER_ESP, data); break; +#ifdef __x86_64 + case MSR_EFER: + set_efer(vcpu, data); + break; + case MSR_IA32_MC0_STATUS: + printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" + , __FUNCTION__, data); + break; +#endif case MSR_IA32_TIME_STAMP_COUNTER: { guest_write_tsc(data); break; } + case MSR_IA32_UCODE_REV: + case MSR_IA32_UCODE_WRITE: + case 0x200 ... 0x2ff: /* MTRRs */ + break; + case MSR_IA32_APICBASE: + vcpu->apic_base = data; + break; default: msr = find_msr_entry(vcpu, msr_index); - if (msr) { - msr->data = data; - break; + if (!msr) { + printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr_index); + return 1; } - return kvm_set_msr_common(vcpu, msr_index, data); msr->data = data; break; } @@ -518,11 +553,11 @@ static __init void setup_vmcs_descriptor(void) { u32 vmx_msr_low, vmx_msr_high; - rdmsr(MSR_IA32_VMX_BASIC, vmx_msr_low, vmx_msr_high); + rdmsr(MSR_IA32_VMX_BASIC_MSR, vmx_msr_low, vmx_msr_high); vmcs_descriptor.size = vmx_msr_high & 0x1fff; vmcs_descriptor.order = get_order(vmcs_descriptor.size); vmcs_descriptor.revision_id = vmx_msr_low; -} +}; static struct vmcs *alloc_vmcs_cpu(int cpu) { @@ -865,6 +900,11 @@ static void vmx_set_segment(struct kvm_vcpu *vcpu, vmcs_write32(sf->ar_bytes, ar); } +static int vmx_is_long_mode(struct kvm_vcpu *vcpu) +{ + return vmcs_read32(VM_ENTRY_CONTROLS) & VM_ENTRY_CONTROLS_IA32E_MASK; +} + static void vmx_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) { u32 ar = vmcs_read32(GUEST_CS_AR_BYTES); @@ -1038,12 +1078,12 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) vmcs_write64(GUEST_IA32_DEBUGCTL, 0); /* Control */ - vmcs_write32_fixedbits(MSR_IA32_VMX_PINBASED_CTLS, + vmcs_write32_fixedbits(MSR_IA32_VMX_PINBASED_CTLS_MSR, PIN_BASED_VM_EXEC_CONTROL, PIN_BASED_EXT_INTR_MASK /* 20.6.1 */ | PIN_BASED_NMI_EXITING /* 20.6.1 */ ); - vmcs_write32_fixedbits(MSR_IA32_VMX_PROCBASED_CTLS, + vmcs_write32_fixedbits(MSR_IA32_VMX_PROCBASED_CTLS_MSR, CPU_BASED_VM_EXEC_CONTROL, CPU_BASED_HLT_EXITING /* 20.6.2 */ | CPU_BASED_CR8_LOAD_EXITING /* 20.6.2 */ @@ -1126,7 +1166,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) virt_to_phys(vcpu->guest_msrs + NR_BAD_MSRS)); vmcs_writel(VM_EXIT_MSR_LOAD_ADDR, virt_to_phys(vcpu->host_msrs + NR_BAD_MSRS)); - vmcs_write32_fixedbits(MSR_IA32_VMX_EXIT_CTLS, VM_EXIT_CONTROLS, + vmcs_write32_fixedbits(MSR_IA32_VMX_EXIT_CTLS_MSR, VM_EXIT_CONTROLS, (HOST_IS_64 << 9)); /* 22.2,1, 20.7.1 */ vmcs_write32(VM_EXIT_MSR_STORE_COUNT, nr_good_msrs); /* 22.2.2 */ vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, nr_good_msrs); /* 22.2.2 */ @@ -1134,7 +1174,7 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) /* 22.2.1, 20.8.1 */ - vmcs_write32_fixedbits(MSR_IA32_VMX_ENTRY_CTLS, + vmcs_write32_fixedbits(MSR_IA32_VMX_ENTRY_CTLS_MSR, VM_ENTRY_CONTROLS, 0); vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); /* 22.2.1 */ @@ -1935,6 +1975,7 @@ static struct kvm_arch_ops vmx_arch_ops = { .get_segment_base = vmx_get_segment_base, .get_segment = vmx_get_segment, .set_segment = vmx_set_segment, + .is_long_mode = vmx_is_long_mode, .get_cs_db_l_bits = vmx_get_cs_db_l_bits, .set_cr0 = vmx_set_cr0, .set_cr0_no_modeswitch = vmx_set_cr0_no_modeswitch, diff --git a/trunk/drivers/kvm/vmx.h b/trunk/drivers/kvm/vmx.h index 4c0ab151836a..797278341581 100644 --- a/trunk/drivers/kvm/vmx.h +++ b/trunk/drivers/kvm/vmx.h @@ -286,11 +286,11 @@ enum vmcs_field { #define CR4_VMXE 0x2000 -#define MSR_IA32_VMX_BASIC 0x480 +#define MSR_IA32_VMX_BASIC_MSR 0x480 #define MSR_IA32_FEATURE_CONTROL 0x03a -#define MSR_IA32_VMX_PINBASED_CTLS 0x481 -#define MSR_IA32_VMX_PROCBASED_CTLS 0x482 -#define MSR_IA32_VMX_EXIT_CTLS 0x483 -#define MSR_IA32_VMX_ENTRY_CTLS 0x484 +#define MSR_IA32_VMX_PINBASED_CTLS_MSR 0x481 +#define MSR_IA32_VMX_PROCBASED_CTLS_MSR 0x482 +#define MSR_IA32_VMX_EXIT_CTLS_MSR 0x483 +#define MSR_IA32_VMX_ENTRY_CTLS_MSR 0x484 #endif diff --git a/trunk/drivers/macintosh/via-pmu-backlight.c b/trunk/drivers/macintosh/via-pmu-backlight.c index 801a974342f9..6c29fe727c0f 100644 --- a/trunk/drivers/macintosh/via-pmu-backlight.c +++ b/trunk/drivers/macintosh/via-pmu-backlight.c @@ -147,7 +147,7 @@ void __init pmu_backlight_init() snprintf(name, sizeof(name), "pmubl"); - bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data); + bd = backlight_device_register(name, NULL, &pmu_backlight_data); if (IS_ERR(bd)) { printk("pmubl: Backlight registration failed\n"); goto error; diff --git a/trunk/drivers/mtd/devices/m25p80.c b/trunk/drivers/mtd/devices/m25p80.c index 78c2511ae9e0..334e078ffaff 100644 --- a/trunk/drivers/mtd/devices/m25p80.c +++ b/trunk/drivers/mtd/devices/m25p80.c @@ -437,7 +437,7 @@ static int __devinit m25p_probe(struct spi_device *spi) * or JEDEC get-id commands. Try them ... */ DEBUG(MTD_DEBUG_LEVEL1, "%s: no chip id\n", - spi->dev.bus_id); + flash->spi->dev.bus_id); return -ENODEV; } @@ -447,7 +447,7 @@ static int __devinit m25p_probe(struct spi_device *spi) } if (i == ARRAY_SIZE(m25p_data)) { DEBUG(MTD_DEBUG_LEVEL1, "%s: unrecognized id %s\n", - spi->dev.bus_id, data->type); + flash->spi->dev.bus_id, data->type); return -ENODEV; } diff --git a/trunk/drivers/mtd/devices/mtd_dataflash.c b/trunk/drivers/mtd/devices/mtd_dataflash.c index 910e4061dfd2..0a7e86859bf1 100644 --- a/trunk/drivers/mtd/devices/mtd_dataflash.c +++ b/trunk/drivers/mtd/devices/mtd_dataflash.c @@ -536,7 +536,7 @@ static int __devinit dataflash_probe(struct spi_device *spi) if (status <= 0 || status == 0xff) { DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n", spi->dev.bus_id, status); - if (status == 0 || status == 0xff) + if (status == 0xff) status = -ENODEV; return status; } diff --git a/trunk/drivers/pci/probe.c b/trunk/drivers/pci/probe.c index 0e0401dd02cb..1ae9c3f50ffa 100644 --- a/trunk/drivers/pci/probe.c +++ b/trunk/drivers/pci/probe.c @@ -639,8 +639,6 @@ static void pci_read_irq(struct pci_dev *dev) dev->irq = irq; } -#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) - /** * pci_setup_device - fill in class and map information of a device * @dev: the device structure to fill @@ -651,6 +649,9 @@ static void pci_read_irq(struct pci_dev *dev) * Returns 0 on success and -1 if unknown type of device (not normal, bridge * or CardBus). */ + +#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) + static int pci_setup_device(struct pci_dev * dev) { u32 class; diff --git a/trunk/drivers/scsi/ibmvscsi/Makefile b/trunk/drivers/scsi/ibmvscsi/Makefile index f67d9efc7a99..6ac0633d5452 100644 --- a/trunk/drivers/scsi/ibmvscsi/Makefile +++ b/trunk/drivers/scsi/ibmvscsi/Makefile @@ -1,9 +1,7 @@ obj-$(CONFIG_SCSI_IBMVSCSI) += ibmvscsic.o ibmvscsic-y += ibmvscsi.o -ifndef CONFIG_PPC_PSERIES ibmvscsic-$(CONFIG_PPC_ISERIES) += iseries_vscsi.o -endif ibmvscsic-$(CONFIG_PPC_PSERIES) += rpa_vscsi.o obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvstgt.o diff --git a/trunk/drivers/serial/sunsab.c b/trunk/drivers/serial/sunsab.c index 145d6236954b..493d5bbb661b 100644 --- a/trunk/drivers/serial/sunsab.c +++ b/trunk/drivers/serial/sunsab.c @@ -1037,8 +1037,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up, err = request_irq(up->port.irq, sunsab_interrupt, IRQF_SHARED, "sab", up); if (err) { - of_iounmap(&op->resource[0], - up->port.membase, + of_iounmap(up->port.membase, sizeof(union sab82532_async_regs)); return err; } @@ -1065,8 +1064,7 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * sizeof(union sab82532_async_regs), (inst * 2) + 1); if (err) { - of_iounmap(&op->resource[0], - up[0].port.membase, + of_iounmap(up[0].port.membase, sizeof(union sab82532_async_regs)); free_irq(up[0].port.irq, &up[0]); return err; @@ -1084,13 +1082,10 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * static void __devexit sab_remove_one(struct uart_sunsab_port *up) { - struct of_device *op = to_of_device(up->port.dev); - uart_remove_one_port(&sunsab_reg, &up->port); if (!(up->port.line & 1)) free_irq(up->port.irq, up); - of_iounmap(&op->resource[0], - up->port.membase, + of_iounmap(up->port.membase, sizeof(union sab82532_async_regs)); } diff --git a/trunk/drivers/serial/sunsu.c b/trunk/drivers/serial/sunsu.c index 3ec3df21816b..564592b2b2ba 100644 --- a/trunk/drivers/serial/sunsu.c +++ b/trunk/drivers/serial/sunsu.c @@ -1480,13 +1480,13 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m return 0; out_unmap: - of_iounmap(&op->resource[0], up->port.membase, up->reg_size); + of_iounmap(up->port.membase, up->reg_size); return err; } -static int __devexit su_remove(struct of_device *op) +static int __devexit su_remove(struct of_device *dev) { - struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); + struct uart_sunsu_port *up = dev_get_drvdata(&dev->dev);; if (up->su_type == SU_PORT_MS || up->su_type == SU_PORT_KBD) { @@ -1499,9 +1499,9 @@ static int __devexit su_remove(struct of_device *op) } if (up->port.membase) - of_iounmap(&op->resource[0], up->port.membase, up->reg_size); + of_iounmap(up->port.membase, up->reg_size); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/serial/sunzilog.c b/trunk/drivers/serial/sunzilog.c index 244f796dc625..75de919a9471 100644 --- a/trunk/drivers/serial/sunzilog.c +++ b/trunk/drivers/serial/sunzilog.c @@ -1379,15 +1379,13 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m if (!keyboard_mouse) { err = uart_add_one_port(&sunzilog_reg, &up[0].port); if (err) { - of_iounmap(&op->resource[0], - rp, sizeof(struct zilog_layout)); + of_iounmap(rp, sizeof(struct zilog_layout)); return err; } err = uart_add_one_port(&sunzilog_reg, &up[1].port); if (err) { uart_remove_one_port(&sunzilog_reg, &up[0].port); - of_iounmap(&op->resource[0], - rp, sizeof(struct zilog_layout)); + of_iounmap(rp, sizeof(struct zilog_layout)); return err; } } else { @@ -1416,18 +1414,18 @@ static void __devexit zs_remove_one(struct uart_sunzilog_port *up) uart_remove_one_port(&sunzilog_reg, &up->port); } -static int __devexit zs_remove(struct of_device *op) +static int __devexit zs_remove(struct of_device *dev) { - struct uart_sunzilog_port *up = dev_get_drvdata(&op->dev); + struct uart_sunzilog_port *up = dev_get_drvdata(&dev->dev); struct zilog_layout __iomem *regs; zs_remove_one(&up[0]); zs_remove_one(&up[1]); regs = sunzilog_chip_regs[up[0].port.line / 2]; - of_iounmap(&op->resource[0], regs, sizeof(struct zilog_layout)); + of_iounmap(regs, sizeof(struct zilog_layout)); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/spi/spi_mpc83xx.c b/trunk/drivers/spi/spi_mpc83xx.c index e9798bf7b8c6..ff0b04895db0 100644 --- a/trunk/drivers/spi/spi_mpc83xx.c +++ b/trunk/drivers/spi/spi_mpc83xx.c @@ -112,8 +112,6 @@ u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \ { \ u32 data; \ const type * tx = mpc83xx_spi->tx; \ - if (!tx) \ - return 0; \ data = *tx++; \ mpc83xx_spi->tx = tx; \ return data; \ diff --git a/trunk/drivers/spi/spi_s3c24xx.c b/trunk/drivers/spi/spi_s3c24xx.c index 8ca08713528e..2ebe1fc4c398 100644 --- a/trunk/drivers/spi/spi_s3c24xx.c +++ b/trunk/drivers/spi/spi_s3c24xx.c @@ -174,7 +174,7 @@ static int s3c24xx_spi_setup(struct spi_device *spi) static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count) { - return hw->tx ? hw->tx[count] : 0; + return hw->tx ? hw->tx[count] : 0xff; } static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t) diff --git a/trunk/drivers/spi/spi_s3c24xx_gpio.c b/trunk/drivers/spi/spi_s3c24xx_gpio.c index eda53ed04cbc..bcaf4bd18eb9 100644 --- a/trunk/drivers/spi/spi_s3c24xx_gpio.c +++ b/trunk/drivers/spi/spi_s3c24xx_gpio.c @@ -23,7 +23,7 @@ #include #include -#include +#include struct s3c2410_spigpio { struct spi_bitbang bitbang; diff --git a/trunk/drivers/usb/input/Kconfig b/trunk/drivers/usb/input/Kconfig index f877cd4f317a..e308f6dc2b87 100644 --- a/trunk/drivers/usb/input/Kconfig +++ b/trunk/drivers/usb/input/Kconfig @@ -29,7 +29,7 @@ config USB_HID comment "Input core support is needed for USB HID input layer or HIDBP support" depends on USB_HID && INPUT=n -config USB_HIDINPUT_POWERBOOK +config USB_HID_POWERBOOK bool "Enable support for iBook/PowerBook special keys" default n depends on USB_HID diff --git a/trunk/drivers/video/bw2.c b/trunk/drivers/video/bw2.c index 9bb6257d6918..c66e3d52cbf3 100644 --- a/trunk/drivers/video/bw2.c +++ b/trunk/drivers/video/bw2.c @@ -320,7 +320,7 @@ static int __devinit bw2_init_one(struct of_device *op) all->info.fbops = &bw2_ops; all->info.screen_base = - of_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); + sbus_ioremap(&op->resource[0], 0, all->par.fbsize, "bw2 ram"); all->info.par = &all->par; bw2_blank(0, &all->info); @@ -329,10 +329,8 @@ static int __devinit bw2_init_one(struct of_device *op) err= register_framebuffer(&all->info); if (err < 0) { - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct bw2_regs)); - of_iounmap(&op->resource[0], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct bw2_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); return err; } @@ -353,18 +351,18 @@ static int __devinit bw2_probe(struct of_device *dev, const struct of_device_id return bw2_init_one(op); } -static int __devexit bw2_remove(struct of_device *op) +static int __devexit bw2_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); - of_iounmap(&op->resource[0], all->par.regs, sizeof(struct bw2_regs)); - of_iounmap(&op->resource[0], all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct bw2_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/cg14.c b/trunk/drivers/video/cg14.c index ec6a51a5822d..7f926c619b61 100644 --- a/trunk/drivers/video/cg14.c +++ b/trunk/drivers/video/cg14.c @@ -452,20 +452,16 @@ struct all_info { struct cg14_par par; }; -static void cg14_unmap_regs(struct of_device *op, struct all_info *all) +static void cg14_unmap_regs(struct all_info *all) { if (all->par.regs) - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct cg14_regs)); + of_iounmap(all->par.regs, sizeof(struct cg14_regs)); if (all->par.clut) - of_iounmap(&op->resource[0], - all->par.clut, sizeof(struct cg14_clut)); + of_iounmap(all->par.clut, sizeof(struct cg14_clut)); if (all->par.cursor) - of_iounmap(&op->resource[0], - all->par.cursor, sizeof(struct cg14_cursor)); + of_iounmap(all->par.cursor, sizeof(struct cg14_cursor)); if (all->info.screen_base) - of_iounmap(&op->resource[1], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->info.screen_base, all->par.fbsize); } static int __devinit cg14_init_one(struct of_device *op) @@ -510,7 +506,7 @@ static int __devinit cg14_init_one(struct of_device *op) if (!all->par.regs || !all->par.clut || !all->par.cursor || !all->info.screen_base) - cg14_unmap_regs(op, all); + cg14_unmap_regs(all); is_8mb = (((op->resource[1].end - op->resource[1].start) + 1) == (8 * 1024 * 1024)); @@ -545,7 +541,7 @@ static int __devinit cg14_init_one(struct of_device *op) __cg14_reset(&all->par); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - cg14_unmap_regs(op, all); + cg14_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -556,7 +552,7 @@ static int __devinit cg14_init_one(struct of_device *op) err = register_framebuffer(&all->info); if (err < 0) { fb_dealloc_cmap(&all->info.cmap); - cg14_unmap_regs(op, all); + cg14_unmap_regs(all); kfree(all); return err; } @@ -578,18 +574,18 @@ static int __devinit cg14_probe(struct of_device *dev, const struct of_device_id return cg14_init_one(op); } -static int __devexit cg14_remove(struct of_device *op) +static int __devexit cg14_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - cg14_unmap_regs(op, all); + cg14_unmap_regs(all); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/cg3.c b/trunk/drivers/video/cg3.c index ada6f7e3a891..9c8c753ef454 100644 --- a/trunk/drivers/video/cg3.c +++ b/trunk/drivers/video/cg3.c @@ -403,10 +403,8 @@ static int __devinit cg3_init_one(struct of_device *op) cg3_do_default_mode(&all->par); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct cg3_regs)); - of_iounmap(&op->resource[0], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct cg3_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); return -ENOMEM; } @@ -417,10 +415,8 @@ static int __devinit cg3_init_one(struct of_device *op) err = register_framebuffer(&all->info); if (err < 0) { fb_dealloc_cmap(&all->info.cmap); - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct cg3_regs)); - of_iounmap(&op->resource[0], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct cg3_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); return err; } @@ -440,19 +436,19 @@ static int __devinit cg3_probe(struct of_device *dev, const struct of_device_id return cg3_init_one(op); } -static int __devexit cg3_remove(struct of_device *op) +static int __devexit cg3_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - of_iounmap(&op->resource[0], all->par.regs, sizeof(struct cg3_regs)); - of_iounmap(&op->resource[0], all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct cg3_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/cg6.c b/trunk/drivers/video/cg6.c index 4dad23a28f58..64146be2eeb0 100644 --- a/trunk/drivers/video/cg6.c +++ b/trunk/drivers/video/cg6.c @@ -658,26 +658,21 @@ struct all_info { struct cg6_par par; }; -static void cg6_unmap_regs(struct of_device *op, struct all_info *all) +static void cg6_unmap_regs(struct all_info *all) { if (all->par.fbc) - of_iounmap(&op->resource[0], all->par.fbc, 4096); + of_iounmap(all->par.fbc, 4096); if (all->par.tec) - of_iounmap(&op->resource[0], - all->par.tec, sizeof(struct cg6_tec)); + of_iounmap(all->par.tec, sizeof(struct cg6_tec)); if (all->par.thc) - of_iounmap(&op->resource[0], - all->par.thc, sizeof(struct cg6_thc)); + of_iounmap(all->par.thc, sizeof(struct cg6_thc)); if (all->par.bt) - of_iounmap(&op->resource[0], - all->par.bt, sizeof(struct bt_regs)); + of_iounmap(all->par.bt, sizeof(struct bt_regs)); if (all->par.fhc) - of_iounmap(&op->resource[0], - all->par.fhc, sizeof(u32)); + of_iounmap(all->par.fhc, sizeof(u32)); if (all->info.screen_base) - of_iounmap(&op->resource[0], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->info.screen_base, all->par.fbsize); } static int __devinit cg6_init_one(struct of_device *op) @@ -725,7 +720,7 @@ static int __devinit cg6_init_one(struct of_device *op) all->par.fbsize, "cgsix ram"); if (!all->par.fbc || !all->par.tec || !all->par.thc || !all->par.bt || !all->par.fhc || !all->info.screen_base) { - cg6_unmap_regs(op, all); + cg6_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -739,7 +734,7 @@ static int __devinit cg6_init_one(struct of_device *op) cg6_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - cg6_unmap_regs(op, all); + cg6_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -749,7 +744,7 @@ static int __devinit cg6_init_one(struct of_device *op) err = register_framebuffer(&all->info); if (err < 0) { - cg6_unmap_regs(op, all); + cg6_unmap_regs(all); fb_dealloc_cmap(&all->info.cmap); kfree(all); return err; @@ -772,18 +767,18 @@ static int __devinit cg6_probe(struct of_device *dev, const struct of_device_id return cg6_init_one(op); } -static int __devexit cg6_remove(struct of_device *op) +static int __devexit cg6_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - cg6_unmap_regs(op, all); + cg6_unmap_regs(all); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/ffb.c b/trunk/drivers/video/ffb.c index 15854aec3180..949141bd44d4 100644 --- a/trunk/drivers/video/ffb.c +++ b/trunk/drivers/video/ffb.c @@ -910,8 +910,7 @@ static int ffb_init_one(struct of_device *op) all->par.dac = of_ioremap(&op->resource[1], 0, sizeof(struct ffb_dac), "ffb dac"); if (!all->par.dac) { - of_iounmap(&op->resource[2], - all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); kfree(all); return -ENOMEM; } @@ -969,10 +968,8 @@ static int ffb_init_one(struct of_device *op) if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { printk(KERN_ERR "ffb: Could not allocate color map.\n"); - of_iounmap(&op->resource[2], - all->par.fbc, sizeof(struct ffb_fbc)); - of_iounmap(&op->resource[1], - all->par.dac, sizeof(struct ffb_dac)); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.dac, sizeof(struct ffb_dac)); kfree(all); return -ENOMEM; } @@ -983,10 +980,8 @@ static int ffb_init_one(struct of_device *op) if (err < 0) { printk(KERN_ERR "ffb: Could not register framebuffer.\n"); fb_dealloc_cmap(&all->info.cmap); - of_iounmap(&op->resource[2], - all->par.fbc, sizeof(struct ffb_fbc)); - of_iounmap(&op->resource[1], - all->par.dac, sizeof(struct ffb_dac)); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.dac, sizeof(struct ffb_dac)); kfree(all); return err; } @@ -1008,19 +1003,19 @@ static int __devinit ffb_probe(struct of_device *dev, const struct of_device_id return ffb_init_one(op); } -static int __devexit ffb_remove(struct of_device *op) +static int __devexit ffb_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - of_iounmap(&op->resource[2], all->par.fbc, sizeof(struct ffb_fbc)); - of_iounmap(&op->resource[1], all->par.dac, sizeof(struct ffb_dac)); + of_iounmap(all->par.fbc, sizeof(struct ffb_fbc)); + of_iounmap(all->par.dac, sizeof(struct ffb_dac)); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/leo.c b/trunk/drivers/video/leo.c index a038aa5a9e1c..f3a24338d9ac 100644 --- a/trunk/drivers/video/leo.c +++ b/trunk/drivers/video/leo.c @@ -530,21 +530,20 @@ struct all_info { struct leo_par par; }; -static void leo_unmap_regs(struct of_device *op, struct all_info *all) +static void leo_unmap_regs(struct all_info *all) { if (all->par.lc_ss0_usr) - of_iounmap(&op->resource[0], all->par.lc_ss0_usr, 0x1000); + of_iounmap(all->par.lc_ss0_usr, 0x1000); if (all->par.ld_ss0) - of_iounmap(&op->resource[0], all->par.ld_ss0, 0x1000); + of_iounmap(all->par.ld_ss0, 0x1000); if (all->par.ld_ss1) - of_iounmap(&op->resource[0], all->par.ld_ss1, 0x1000); + of_iounmap(all->par.ld_ss1, 0x1000); if (all->par.lx_krn) - of_iounmap(&op->resource[0], all->par.lx_krn, 0x1000); + of_iounmap(all->par.lx_krn, 0x1000); if (all->par.cursor) - of_iounmap(&op->resource[0], - all->par.cursor, sizeof(struct leo_cursor)); + of_iounmap(all->par.cursor, sizeof(struct leo_cursor)); if (all->info.screen_base) - of_iounmap(&op->resource[0], all->info.screen_base, 0x800000); + of_iounmap(all->info.screen_base, 0x800000); } static int __devinit leo_init_one(struct of_device *op) @@ -593,7 +592,7 @@ static int __devinit leo_init_one(struct of_device *op) !all->par.lx_krn || !all->par.cursor || !all->info.screen_base) { - leo_unmap_regs(op, all); + leo_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -608,7 +607,7 @@ static int __devinit leo_init_one(struct of_device *op) leo_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - leo_unmap_regs(op, all); + leo_unmap_regs(all); kfree(all); return -ENOMEM;; } @@ -618,7 +617,7 @@ static int __devinit leo_init_one(struct of_device *op) err = register_framebuffer(&all->info); if (err < 0) { fb_dealloc_cmap(&all->info.cmap); - leo_unmap_regs(op, all); + leo_unmap_regs(all); kfree(all); return err; } @@ -639,18 +638,18 @@ static int __devinit leo_probe(struct of_device *dev, const struct of_device_id return leo_init_one(op); } -static int __devexit leo_remove(struct of_device *op) +static int __devexit leo_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - leo_unmap_regs(op, all); + leo_unmap_regs(all); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/p9100.c b/trunk/drivers/video/p9100.c index 637b78bb4bf7..56ac51d6a7f3 100644 --- a/trunk/drivers/video/p9100.c +++ b/trunk/drivers/video/p9100.c @@ -297,8 +297,7 @@ static int __devinit p9100_init_one(struct of_device *op) all->info.screen_base = of_ioremap(&op->resource[2], 0, all->par.fbsize, "p9100 ram"); if (!all->info.screen_base) { - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); kfree(all); return -ENOMEM; } @@ -307,10 +306,8 @@ static int __devinit p9100_init_one(struct of_device *op) p9100_blank(0, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct p9100_regs)); - of_iounmap(&op->resource[2], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); return -ENOMEM; } @@ -320,10 +317,8 @@ static int __devinit p9100_init_one(struct of_device *op) err = register_framebuffer(&all->info); if (err < 0) { fb_dealloc_cmap(&all->info.cmap); - of_iounmap(&op->resource[0], - all->par.regs, sizeof(struct p9100_regs)); - of_iounmap(&op->resource[2], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); return err; } @@ -345,19 +340,19 @@ static int __devinit p9100_probe(struct of_device *dev, const struct of_device_i return p9100_init_one(op); } -static int __devexit p9100_remove(struct of_device *op) +static int __devexit p9100_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - of_iounmap(&op->resource[0], all->par.regs, sizeof(struct p9100_regs)); - of_iounmap(&op->resource[2], all->info.screen_base, all->par.fbsize); + of_iounmap(all->par.regs, sizeof(struct p9100_regs)); + of_iounmap(all->info.screen_base, all->par.fbsize); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/drivers/video/tcx.c b/trunk/drivers/video/tcx.c index 5a99669232ce..6990ab11cd06 100644 --- a/trunk/drivers/video/tcx.c +++ b/trunk/drivers/video/tcx.c @@ -350,23 +350,18 @@ struct all_info { struct tcx_par par; }; -static void tcx_unmap_regs(struct of_device *op, struct all_info *all) +static void tcx_unmap_regs(struct all_info *all) { if (all->par.tec) - of_iounmap(&op->resource[7], - all->par.tec, sizeof(struct tcx_tec)); + of_iounmap(all->par.tec, sizeof(struct tcx_tec)); if (all->par.thc) - of_iounmap(&op->resource[9], - all->par.thc, sizeof(struct tcx_thc)); + of_iounmap(all->par.thc, sizeof(struct tcx_thc)); if (all->par.bt) - of_iounmap(&op->resource[8], - all->par.bt, sizeof(struct bt_regs)); + of_iounmap(all->par.bt, sizeof(struct bt_regs)); if (all->par.cplane) - of_iounmap(&op->resource[4], - all->par.cplane, all->par.fbsize * sizeof(u32)); + of_iounmap(all->par.cplane, all->par.fbsize * sizeof(u32)); if (all->info.screen_base) - of_iounmap(&op->resource[0], - all->info.screen_base, all->par.fbsize); + of_iounmap(all->info.screen_base, all->par.fbsize); } static int __devinit tcx_init_one(struct of_device *op) @@ -403,7 +398,7 @@ static int __devinit tcx_init_one(struct of_device *op) all->par.fbsize, "tcx ram"); if (!all->par.tec || !all->par.thc || !all->par.bt || !all->info.screen_base) { - tcx_unmap_regs(op, all); + tcx_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -414,7 +409,7 @@ static int __devinit tcx_init_one(struct of_device *op) all->par.fbsize * sizeof(u32), "tcx cplane"); if (!all->par.cplane) { - tcx_unmap_regs(op, all); + tcx_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -466,7 +461,7 @@ static int __devinit tcx_init_one(struct of_device *op) tcx_blank(FB_BLANK_UNBLANK, &all->info); if (fb_alloc_cmap(&all->info.cmap, 256, 0)) { - tcx_unmap_regs(op, all); + tcx_unmap_regs(all); kfree(all); return -ENOMEM; } @@ -477,7 +472,7 @@ static int __devinit tcx_init_one(struct of_device *op) err = register_framebuffer(&all->info); if (err < 0) { fb_dealloc_cmap(&all->info.cmap); - tcx_unmap_regs(op, all); + tcx_unmap_regs(all); kfree(all); return err; } @@ -500,18 +495,18 @@ static int __devinit tcx_probe(struct of_device *dev, const struct of_device_id return tcx_init_one(op); } -static int __devexit tcx_remove(struct of_device *op) +static int __devexit tcx_remove(struct of_device *dev) { - struct all_info *all = dev_get_drvdata(&op->dev); + struct all_info *all = dev_get_drvdata(&dev->dev); unregister_framebuffer(&all->info); fb_dealloc_cmap(&all->info.cmap); - tcx_unmap_regs(op, all); + tcx_unmap_regs(all); kfree(all); - dev_set_drvdata(&op->dev, NULL); + dev_set_drvdata(&dev->dev, NULL); return 0; } diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index ee20fc4240e0..5f577a63bdf0 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -599,6 +599,9 @@ static void use_mm(struct mm_struct *mm) * by the calling kernel thread * (Note: this routine is intended to be called only * from a kernel thread context) + * + * Comments: Called with ctx->ctx_lock held. This nests + * task_lock instead ctx_lock. */ static void unuse_mm(struct mm_struct *mm) { @@ -847,16 +850,14 @@ static void aio_kick_handler(struct work_struct *work) { struct kioctx *ctx = container_of(work, struct kioctx, wq.work); mm_segment_t oldfs = get_fs(); - struct mm_struct *mm; int requeue; set_fs(USER_DS); use_mm(ctx->mm); spin_lock_irq(&ctx->ctx_lock); requeue =__aio_run_iocbs(ctx); - mm = ctx->mm; + unuse_mm(ctx->mm); spin_unlock_irq(&ctx->ctx_lock); - unuse_mm(mm); set_fs(oldfs); /* * we're in a worker thread already, don't use queue_delayed_work, diff --git a/trunk/fs/ocfs2/aops.c b/trunk/fs/ocfs2/aops.c index 93628b02ef5d..ef6cd30108a9 100644 --- a/trunk/fs/ocfs2/aops.c +++ b/trunk/fs/ocfs2/aops.c @@ -540,7 +540,8 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create) { int ret; - u64 p_blkno, inode_blocks; + u64 vbo_max; /* file offset, max_blocks from iblock */ + u64 p_blkno; int contig_blocks; unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; @@ -549,23 +550,12 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, * nicely aligned and of the right size, so there's no need * for us to check any of that. */ - spin_lock(&OCFS2_I(inode)->ip_lock); - inode_blocks = ocfs2_clusters_to_blocks(inode->i_sb, - OCFS2_I(inode)->ip_clusters); + vbo_max = ((u64)iblock + max_blocks) << blocksize_bits; - /* - * For a read which begins past the end of file, we return a hole. - */ - if (!create && (iblock >= inode_blocks)) { - spin_unlock(&OCFS2_I(inode)->ip_lock); - ret = 0; - goto bail; - } - - /* - * Any write past EOF is not allowed because we'd be extending. - */ - if (create && (iblock + max_blocks) > inode_blocks) { + spin_lock(&OCFS2_I(inode)->ip_lock); + if ((iblock + max_blocks) > + ocfs2_clusters_to_blocks(inode->i_sb, + OCFS2_I(inode)->ip_clusters)) { spin_unlock(&OCFS2_I(inode)->ip_lock); ret = -EIO; goto bail; diff --git a/trunk/fs/ocfs2/cluster/heartbeat.c b/trunk/fs/ocfs2/cluster/heartbeat.c index 277ca67a2ad6..a25ef5a50386 100644 --- a/trunk/fs/ocfs2/cluster/heartbeat.c +++ b/trunk/fs/ocfs2/cluster/heartbeat.c @@ -1447,15 +1447,6 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, return ret; } -static ssize_t o2hb_region_pid_read(struct o2hb_region *reg, - char *page) -{ - if (!reg->hr_task) - return 0; - - return sprintf(page, "%u\n", reg->hr_task->pid); -} - struct o2hb_region_attribute { struct configfs_attribute attr; ssize_t (*show)(struct o2hb_region *, char *); @@ -1494,19 +1485,11 @@ static struct o2hb_region_attribute o2hb_region_attr_dev = { .store = o2hb_region_dev_write, }; -static struct o2hb_region_attribute o2hb_region_attr_pid = { - .attr = { .ca_owner = THIS_MODULE, - .ca_name = "pid", - .ca_mode = S_IRUGO | S_IRUSR }, - .show = o2hb_region_pid_read, -}; - static struct configfs_attribute *o2hb_region_attrs[] = { &o2hb_region_attr_block_bytes.attr, &o2hb_region_attr_start_block.attr, &o2hb_region_attr_blocks.attr, &o2hb_region_attr_dev.attr, - &o2hb_region_attr_pid.attr, NULL, }; diff --git a/trunk/fs/ocfs2/dlmglue.c b/trunk/fs/ocfs2/dlmglue.c index e335541727f9..e6220137bf69 100644 --- a/trunk/fs/ocfs2/dlmglue.c +++ b/trunk/fs/ocfs2/dlmglue.c @@ -2718,15 +2718,6 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres, inode = ocfs2_lock_res_inode(lockres); mapping = inode->i_mapping; - /* - * We need this before the filemap_fdatawrite() so that it can - * transfer the dirty bit from the PTE to the - * page. Unfortunately this means that even for EX->PR - * downconverts, we'll lose our mappings and have to build - * them up again. - */ - unmap_mapping_range(mapping, 0, 0, 0); - if (filemap_fdatawrite(mapping)) { mlog(ML_ERROR, "Could not sync inode %llu for downconvert!", (unsigned long long)OCFS2_I(inode)->ip_blkno); @@ -2734,6 +2725,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres, sync_mapping_buffers(mapping); if (blocking == LKM_EXMODE) { truncate_inode_pages(mapping, 0); + unmap_mapping_range(mapping, 0, 0, 0); } else { /* We only need to wait on the I/O if we're not also * truncating pages because truncate_inode_pages waits diff --git a/trunk/fs/ocfs2/file.c b/trunk/fs/ocfs2/file.c index 10953a508f2f..9fd590b9bde3 100644 --- a/trunk/fs/ocfs2/file.c +++ b/trunk/fs/ocfs2/file.c @@ -149,17 +149,6 @@ int ocfs2_should_update_atime(struct inode *inode, ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))) return 0; - /* - * We can be called with no vfsmnt structure - NFSD will - * sometimes do this. - * - * Note that our action here is different than touch_atime() - - * if we can't tell whether this is a noatime mount, then we - * don't know whether to trust the value of s_atime_quantum. - */ - if (vfsmnt == NULL) - return 0; - if ((vfsmnt->mnt_flags & MNT_NOATIME) || ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) return 0; @@ -977,6 +966,8 @@ int ocfs2_permission(struct inode *inode, int mask, struct nameidata *nd) } ret = generic_permission(inode, mask, NULL); + if (ret) + mlog_errno(ret); ocfs2_meta_unlock(inode, 0); out: diff --git a/trunk/fs/ramfs/file-mmu.c b/trunk/fs/ramfs/file-mmu.c index 54ebbc84207f..0947fb57dcf3 100644 --- a/trunk/fs/ramfs/file-mmu.c +++ b/trunk/fs/ramfs/file-mmu.c @@ -25,13 +25,11 @@ */ #include -#include const struct address_space_operations ramfs_aops = { .readpage = simple_readpage, .prepare_write = simple_prepare_write, - .commit_write = simple_commit_write, - .set_page_dirty = __set_page_dirty_nobuffers, + .commit_write = simple_commit_write }; const struct file_operations ramfs_file_operations = { diff --git a/trunk/fs/ramfs/file-nommu.c b/trunk/fs/ramfs/file-nommu.c index e9d6c4733282..61cbe1ef06b9 100644 --- a/trunk/fs/ramfs/file-nommu.c +++ b/trunk/fs/ramfs/file-nommu.c @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -31,8 +30,7 @@ static int ramfs_nommu_setattr(struct dentry *, struct iattr *); const struct address_space_operations ramfs_aops = { .readpage = simple_readpage, .prepare_write = simple_prepare_write, - .commit_write = simple_commit_write, - .set_page_dirty = __set_page_dirty_nobuffers, + .commit_write = simple_commit_write }; const struct file_operations ramfs_file_operations = { diff --git a/trunk/include/asm-arm/arch-ep93xx/irqs.h b/trunk/include/asm-arm/arch-ep93xx/irqs.h index 9a42f5de9e57..ae532e304bf1 100644 --- a/trunk/include/asm-arm/arch-ep93xx/irqs.h +++ b/trunk/include/asm-arm/arch-ep93xx/irqs.h @@ -22,9 +22,9 @@ #define IRQ_EP93XX_DMAM2P9 16 #define IRQ_EP93XX_DMAM2M0 17 #define IRQ_EP93XX_DMAM2M1 18 -#define IRQ_EP93XX_GPIO0MUX 20 -#define IRQ_EP93XX_GPIO1MUX 21 -#define IRQ_EP93XX_GPIO2MUX 22 +#define IRQ_EP93XX_GPIO0MUX 19 +#define IRQ_EP93XX_GPIO1MUX 20 +#define IRQ_EP93XX_GPIO2MUX 21 #define IRQ_EP93XX_GPIO3MUX 22 #define IRQ_EP93XX_UART1RX 23 #define IRQ_EP93XX_UART1TX 24 diff --git a/trunk/include/asm-generic/bug.h b/trunk/include/asm-generic/bug.h index 14fae1fa87df..a06eecd48292 100644 --- a/trunk/include/asm-generic/bug.h +++ b/trunk/include/asm-generic/bug.h @@ -35,7 +35,7 @@ struct bug_entry { #define WARN_ON(condition) ({ \ typeof(condition) __ret_warn_on = (condition); \ if (unlikely(__ret_warn_on)) { \ - printk("BUG: at %s:%d %s()\n", __FILE__, \ + printk("WARNING at %s:%d %s()\n", __FILE__, \ __LINE__, __FUNCTION__); \ dump_stack(); \ } \ diff --git a/trunk/include/asm-sparc/of_device.h b/trunk/include/asm-sparc/of_device.h index 7cb00c1b09c6..80ea31f6e17f 100644 --- a/trunk/include/asm-sparc/of_device.h +++ b/trunk/include/asm-sparc/of_device.h @@ -33,7 +33,7 @@ struct of_device #define to_of_device(d) container_of(d, struct of_device, dev) extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); -extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); +extern void of_iounmap(void __iomem *base, unsigned long size); extern struct of_device *of_find_device_by_node(struct device_node *); diff --git a/trunk/include/asm-sparc64/of_device.h b/trunk/include/asm-sparc64/of_device.h index 60e9173c9acb..a62c7b997d66 100644 --- a/trunk/include/asm-sparc64/of_device.h +++ b/trunk/include/asm-sparc64/of_device.h @@ -34,7 +34,7 @@ struct of_device #define to_of_device(d) container_of(d, struct of_device, dev) extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); -extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); +extern void of_iounmap(void __iomem *base, unsigned long size); extern struct of_device *of_find_device_by_node(struct device_node *); diff --git a/trunk/include/linux/cpuset.h b/trunk/include/linux/cpuset.h index fd404416f31c..826b15e914e2 100644 --- a/trunk/include/linux/cpuset.h +++ b/trunk/include/linux/cpuset.h @@ -55,7 +55,7 @@ extern int cpuset_excl_nodes_overlap(const struct task_struct *p); extern int cpuset_memory_pressure_enabled; extern void __cpuset_memory_pressure_bump(void); -extern struct file_operations proc_cpuset_operations; +extern const struct file_operations proc_cpuset_operations; extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); extern void cpuset_lock(void); diff --git a/trunk/include/linux/net.h b/trunk/include/linux/net.h index f28d8a2e2c91..6f0dfeba509a 100644 --- a/trunk/include/linux/net.h +++ b/trunk/include/linux/net.h @@ -19,6 +19,7 @@ #define _LINUX_NET_H #include +#include #include struct poll_table_struct; @@ -56,7 +57,6 @@ typedef enum { #ifdef __KERNEL__ #include -#include #define SOCK_ASYNC_NOSPACE 0 #define SOCK_ASYNC_WAITDATA 1 diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index fea0d9db6846..6be767c76b37 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -906,7 +906,6 @@ static inline void netif_poll_disable(struct net_device *dev) static inline void netif_poll_enable(struct net_device *dev) { - smp_mb__before_clear_bit(); clear_bit(__LINK_STATE_RX_SCHED, &dev->state); } diff --git a/trunk/include/linux/spi/spi.h b/trunk/include/linux/spi/spi.h index 176f6e36dbfa..c8bb68099eb9 100644 --- a/trunk/include/linux/spi/spi.h +++ b/trunk/include/linux/spi/spi.h @@ -289,7 +289,7 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); * the data being transferred; that may reduce overhead, when the * underlying driver uses dma. * - * If the transmit buffer is null, zeroes will be shifted out + * If the transmit buffer is null, undefined data will be shifted out * while filling rx_buf. If the receive buffer is null, the data * shifted in will be discarded. Only "len" bytes shift out (or in). * It's an error to try to shift out a partial word. (For example, by diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index 6b05dc69c959..232aed2b10f9 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -2656,7 +2656,7 @@ static int cpuset_open(struct inode *inode, struct file *file) return single_open(file, proc_cpuset_show, pid); } -struct file_operations proc_cpuset_operations = { +const struct file_operations proc_cpuset_operations = { .open = cpuset_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 35401720635b..46cf6b681460 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -597,10 +597,6 @@ choose_new_parent(struct task_struct *p, struct task_struct *reaper) static void reparent_thread(struct task_struct *p, struct task_struct *father, int traced) { - if (p->pdeath_signal) - /* We already hold the tasklist_lock here. */ - group_send_sig_info(p->pdeath_signal, SEND_SIG_NOINFO, p); - /* Move the child from its dying parent to the new one. */ if (unlikely(traced)) { /* Preserve ptrace links if someone else is tracing this child. */ @@ -635,6 +631,10 @@ reparent_thread(struct task_struct *p, struct task_struct *father, int traced) /* We don't want people slaying init. */ if (p->exit_signal != -1) p->exit_signal = SIGCHLD; + + if (p->pdeath_signal) + /* We already hold the tasklist_lock here. */ + group_send_sig_info(p->pdeath_signal, SEND_SIG_NOINFO, p); /* If we'd notified the old parent about this child's death, * also notify the new parent. diff --git a/trunk/kernel/lockdep.c b/trunk/kernel/lockdep.c index 509efd49540f..01e750559034 100644 --- a/trunk/kernel/lockdep.c +++ b/trunk/kernel/lockdep.c @@ -1318,16 +1318,12 @@ static inline int lookup_chain_cache(u64 chain_key, struct lock_class *class) cache_hit: debug_atomic_inc(&chain_lookup_hits); if (very_verbose(class)) - printk("\nhash chain already cached, key: " - "%016Lx tail class: [%p] %s\n", - (unsigned long long)chain_key, - class->key, class->name); + printk("\nhash chain already cached, key: %016Lx tail class: [%p] %s\n", chain_key, class->key, class->name); return 0; } } if (very_verbose(class)) - printk("\nnew hash chain, key: %016Lx tail class: [%p] %s\n", - (unsigned long long)chain_key, class->key, class->name); + printk("\nnew hash chain, key: %016Lx tail class: [%p] %s\n", chain_key, class->key, class->name); /* * Allocate a new chain entry from the static array, and add * it to the hash: diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c index dbce132b354c..b565eaeff7e6 100644 --- a/trunk/kernel/module.c +++ b/trunk/kernel/module.c @@ -1132,10 +1132,8 @@ static int mod_sysfs_setup(struct module *mod, goto out; mod->drivers_dir = kobject_add_dir(&mod->mkobj.kobj, "drivers"); - if (!mod->drivers_dir) { - err = -ENOMEM; + if (!mod->drivers_dir) goto out_unreg; - } err = module_param_sysfs_setup(mod, kparam, num_params); if (err) diff --git a/trunk/kernel/rcutorture.c b/trunk/kernel/rcutorture.c index 482b11ff65cb..c52f981ea008 100644 --- a/trunk/kernel/rcutorture.c +++ b/trunk/kernel/rcutorture.c @@ -522,7 +522,6 @@ rcu_torture_writer(void *arg) VERBOSE_PRINTK_STRING("rcu_torture_writer task started"); set_user_nice(current, 19); - current->flags |= PF_NOFREEZE; do { schedule_timeout_uninterruptible(1); @@ -562,7 +561,6 @@ rcu_torture_fakewriter(void *arg) VERBOSE_PRINTK_STRING("rcu_torture_fakewriter task started"); set_user_nice(current, 19); - current->flags |= PF_NOFREEZE; do { schedule_timeout_uninterruptible(1 + rcu_random(&rand)%10); @@ -593,7 +591,6 @@ rcu_torture_reader(void *arg) VERBOSE_PRINTK_STRING("rcu_torture_reader task started"); set_user_nice(current, 19); - current->flags |= PF_NOFREEZE; do { idx = cur_ops->readlock(); diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 3df33da0dafc..b515e3caad7f 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -4617,6 +4617,17 @@ asmlinkage long sys_sched_yield(void) return 0; } +static inline int __resched_legal(int expected_preempt_count) +{ +#ifdef CONFIG_PREEMPT + if (unlikely(preempt_count() != expected_preempt_count)) + return 0; +#endif + if (unlikely(system_state != SYSTEM_RUNNING)) + return 0; + return 1; +} + static void __cond_resched(void) { #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP @@ -4636,8 +4647,7 @@ static void __cond_resched(void) int __sched cond_resched(void) { - if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) && - system_state == SYSTEM_RUNNING) { + if (need_resched() && __resched_legal(0)) { __cond_resched(); return 1; } @@ -4663,7 +4673,7 @@ int cond_resched_lock(spinlock_t *lock) ret = 1; spin_lock(lock); } - if (need_resched() && system_state == SYSTEM_RUNNING) { + if (need_resched() && __resched_legal(1)) { spin_release(&lock->dep_map, 1, _THIS_IP_); _raw_spin_unlock(lock); preempt_enable_no_resched(); @@ -4679,7 +4689,7 @@ int __sched cond_resched_softirq(void) { BUG_ON(!in_softirq()); - if (need_resched() && system_state == SYSTEM_RUNNING) { + if (need_resched() && __resched_legal(0)) { raw_local_irq_disable(); _local_bh_enable(); raw_local_irq_enable(); diff --git a/trunk/mm/oom_kill.c b/trunk/mm/oom_kill.c index 6969cfb33901..64cf3c214634 100644 --- a/trunk/mm/oom_kill.c +++ b/trunk/mm/oom_kill.c @@ -174,12 +174,7 @@ static inline int constrained_alloc(struct zonelist *zonelist, gfp_t gfp_mask) { #ifdef CONFIG_NUMA struct zone **z; - nodemask_t nodes; - int node; - /* node has memory ? */ - for_each_online_node(node) - if (NODE_DATA(node)->node_present_pages) - node_set(node, nodes); + nodemask_t nodes = node_online_map; for (z = zonelist->zones; *z; z++) if (cpuset_zone_allowed_softwall(*z, gfp_mask)) diff --git a/trunk/mm/rmap.c b/trunk/mm/rmap.c index 669acb22b572..57306fa0114d 100644 --- a/trunk/mm/rmap.c +++ b/trunk/mm/rmap.c @@ -452,7 +452,7 @@ static int page_mkclean_one(struct page *page, struct vm_area_struct *vma) entry = ptep_clear_flush(vma, address, pte); entry = pte_wrprotect(entry); entry = pte_mkclean(entry); - set_pte_at(mm, address, pte, entry); + set_pte_at(vma, address, pte, entry); lazy_mmu_prot_update(entry); ret = 1; } diff --git a/trunk/mm/slob.c b/trunk/mm/slob.c index 5adc29cb58dd..2e9236e10ed1 100644 --- a/trunk/mm/slob.c +++ b/trunk/mm/slob.c @@ -60,8 +60,6 @@ static DEFINE_SPINLOCK(slob_lock); static DEFINE_SPINLOCK(block_lock); static void slob_free(void *b, int size); -static void slob_timer_cbk(void); - static void *slob_alloc(size_t size, gfp_t gfp, int align) { @@ -328,7 +326,7 @@ const char *kmem_cache_name(struct kmem_cache *c) EXPORT_SYMBOL(kmem_cache_name); static struct timer_list slob_timer = TIMER_INITIALIZER( - (void (*)(unsigned long))slob_timer_cbk, 0, 0); + (void (*)(unsigned long))kmem_cache_init, 0, 0); int kmem_cache_shrink(struct kmem_cache *d) { @@ -341,12 +339,7 @@ int kmem_ptr_validate(struct kmem_cache *a, const void *b) return 0; } -void __init kmem_cache_init(void) -{ - slob_timer_cbk(); -} - -static void slob_timer_cbk(void) +void kmem_cache_init(void) { void *p = slob_alloc(PAGE_SIZE, 0, PAGE_SIZE-1); diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 40fea4918390..63eb9ab0032b 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -692,7 +692,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, __count_vm_events(KSWAPD_STEAL, nr_freed); } else __count_zone_vm_events(PGSCAN_DIRECT, zone, nr_scan); - __count_zone_vm_events(PGSTEAL, zone, nr_freed); + __count_vm_events(PGACTIVATE, nr_freed); if (nr_taken == 0) goto done; diff --git a/trunk/net/xfrm/xfrm_algo.c b/trunk/net/xfrm/xfrm_algo.c index f1cf3402e75c..6b381fc0383d 100644 --- a/trunk/net/xfrm/xfrm_algo.c +++ b/trunk/net/xfrm/xfrm_algo.c @@ -399,8 +399,7 @@ static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, if (!probe) break; - status = crypto_has_alg(list[i].name, type, - mask | CRYPTO_ALG_ASYNC); + status = crypto_has_alg(name, type, mask | CRYPTO_ALG_ASYNC); if (!status) break; diff --git a/trunk/security/selinux/ss/services.c b/trunk/security/selinux/ss/services.c index ee0581557966..bdb7070dd3dc 100644 --- a/trunk/security/selinux/ss/services.c +++ b/trunk/security/selinux/ss/services.c @@ -2660,11 +2660,9 @@ int selinux_netlbl_inode_permission(struct inode *inode, int mask) rcu_read_unlock(); return 0; } - local_bh_disable(); - bh_lock_sock_nested(sock->sk); + lock_sock(sock->sk); rc = selinux_netlbl_socket_setsid(sock, sksec->sid); - bh_unlock_sock(sock->sk); - local_bh_enable(); + release_sock(sock->sk); rcu_read_unlock(); return rc; diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index 4e0c3c1b908b..29e4c48151bc 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -5070,8 +5070,6 @@ static struct hda_board_config alc883_cfg_tbl[] = { { .modelname = "6stack-dig", .config = ALC883_6ST_DIG }, { .pci_subvendor = 0x1462, .pci_subdevice = 0x6668, .config = ALC883_6ST_DIG }, /* MSI */ - { .pci_subvendor = 0x1462, .pci_subdevice = 0x7280, - .config = ALC883_6ST_DIG }, /* MSI K9A Platinum (MS-7280) */ { .pci_subvendor = 0x105b, .pci_subdevice = 0x6668, .config = ALC883_6ST_DIG }, /* Foxconn */ { .modelname = "6stack-dig-demo", .config = ALC888_DEMO_BOARD },