Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 18 Aug 2007 16:34:28 +0000 (09:34 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 18 Aug 2007 16:34:28 +0000 (09:34 -0700)
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [MATH-EMU]: Fix underflow exception reporting.
  [SPARC64]: Create a HWCAP_SPARC_N2 and report it to userspace on Niagara-2.
  [SPARC64]: SMP trampoline needs to avoid %tick_cmpr on sun4v too.
  [SPARC64]: Do not touch %tick_cmpr on sun4v cpus.
  [SPARC64]: Niagara-2 optimized copies.
  [SPARC64]: Allow userspace to get at the machine description.
  [SPARC32]: Remove superfluous 'kernel_end' alignment on sun4c.
  [SPARC32]: Fix bogus ramdisk image location check.
  [SPARC32]: Remove iommu from struct sbus_bus and use archdata like sparc64.

237 files changed:
Documentation/fb/pvr2fb.txt
Documentation/i386/zero-page.txt
Documentation/kbuild/kconfig-language.txt
Documentation/kernel-parameters.txt
Documentation/memory-hotplug.txt [new file with mode: 0644]
Documentation/sysrq.txt
Documentation/thinkpad-acpi.txt
MAINTAINERS
Makefile
arch/alpha/kernel/sys_titan.c
arch/avr32/boards/atngw100/setup.c
arch/avr32/boards/atstk1000/Kconfig
arch/avr32/boards/atstk1000/atstk1002.c
arch/blackfin/kernel/init_task.c
arch/blackfin/kernel/process.c
arch/blackfin/kernel/sys_bfin.c
arch/blackfin/kernel/traps.c
arch/cris/Kconfig
arch/frv/kernel/entry.S
arch/i386/boot/edd.c
arch/i386/boot/video.c
arch/i386/kernel/alternative.c
arch/i386/kernel/apic.c
arch/i386/kernel/cpu/amd.c
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/doublefault.c
arch/i386/kernel/head.S
arch/i386/kernel/io_apic.c
arch/i386/kernel/paravirt.c
arch/i386/kernel/vmi.c
arch/i386/mm/pageattr.c
arch/i386/pci/common.c
arch/i386/pci/fixup.c
arch/i386/pci/irq.c
arch/i386/pci/legacy.c
arch/i386/pci/mmconfig.c
arch/i386/pci/numa.c
arch/i386/pci/pci.h
arch/i386/pci/visws.c
arch/i386/xen/enlighten.c
arch/powerpc/boot/flatdevtree.c
arch/powerpc/configs/ps3_defconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/pci_64.c
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/slb.c
arch/powerpc/mm/slice.c
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc832x_rdb.c
arch/powerpc/platforms/83xx/mpc836x_mds.c
arch/powerpc/platforms/85xx/mpc85xx_mds.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spu_manage.c
arch/powerpc/platforms/cell/spu_syscalls.c
arch/powerpc/platforms/ps3/Kconfig
arch/powerpc/platforms/ps3/device-init.c
arch/powerpc/platforms/ps3/spu.c
arch/ppc/kernel/misc.S
arch/s390/Kconfig
arch/s390/hypfs/inode.c
arch/x86_64/boot/compressed/head.S
arch/x86_64/kernel/apic.c
arch/x86_64/kernel/io_apic.c
arch/x86_64/kernel/pci-calgary.c
arch/x86_64/lib/memcpy.S
arch/x86_64/mm/pageattr.c
arch/x86_64/pci/mmconfig.c
arch/x86_64/vdso/.gitignore [new file with mode: 0644]
block/ll_rw_blk.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/bay.c
drivers/acpi/dock.c
drivers/acpi/ec.c
drivers/acpi/event.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/resources/rsxface.c
drivers/acpi/sbs.c
drivers/acpi/tables/tbxface.c
drivers/acpi/thermal.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/pata_artop.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_hpt3x2n.c
drivers/ata/pata_isapnp.c
drivers/ata/sata_mv.c
drivers/atm/fore200e.c
drivers/atm/iphase.c
drivers/atm/lanai.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/viodasd.c
drivers/block/xsysace.c
drivers/char/hvc_lguest.c
drivers/char/pcmcia/cm4000_cs.c
drivers/char/pcmcia/cm4040_cs.c
drivers/char/sonypi.c
drivers/char/tty_io.c
drivers/dma/ioatdma.c
drivers/dma/ioatdma.h
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-iop3xx.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/chips/isp1301_omap.c
drivers/i2c/chips/menelaus.c
drivers/lguest/lguest.c
drivers/lguest/lguest_bus.c
drivers/md/dm.c
drivers/misc/Kconfig
drivers/misc/sony-laptop.c
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.h
drivers/mtd/mtdchar.c
drivers/net/3c59x.c
drivers/net/ax88796.c
drivers/net/bonding/bond_main.c
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_hw.h
drivers/net/e1000/e1000_main.c
drivers/net/irda/irda-usb.c
drivers/net/myri10ge/myri10ge.c
drivers/net/natsemi.c
drivers/net/via-rhine.c
drivers/net/wan/hdlc_fr.c
drivers/net/xen-netfront.c
drivers/s390/char/monwriter.c
drivers/s390/char/vmur.c
drivers/s390/char/vmur.h
drivers/s390/cio/css.c
drivers/s390/cio/qdio.c
drivers/spi/spi_mpc83xx.c
drivers/spi/spidev.c
drivers/video/console/fbcon.c
drivers/video/matrox/g450_pll.c
drivers/video/matrox/matroxfb_DAC1064.h
drivers/video/matrox/matroxfb_base.h
drivers/video/matrox/matroxfb_misc.c
drivers/video/pvr2fb.c
drivers/video/stifb.c
fs/cifs/CHANGES
fs/cifs/README
fs/cifs/TODO
fs/cifs/file.c
fs/cifs/sess.c
fs/direct-io.c
fs/dlm/lock.c
fs/dlm/lowcomms.c
fs/dlm/member.c
fs/dlm/rcom.c
fs/ecryptfs/inode.c
fs/ecryptfs/main.c
fs/exec.c
fs/gfs2/lops.c
fs/gfs2/mount.c
fs/gfs2/ops_address.c
fs/gfs2/ops_file.c
fs/gfs2/rgrp.c
fs/ocfs2/alloc.c
fs/ocfs2/cluster/tcp.c
fs/ocfs2/file.c
fs/ocfs2/namei.c
fs/ocfs2/ocfs2.h
fs/ocfs2/super.c
fs/ocfs2/super.h
include/acpi/processor.h
include/asm-avr32/io.h
include/asm-avr32/pgalloc.h
include/asm-avr32/pgtable.h
include/asm-frv/unistd.h
include/asm-generic/pgtable.h
include/asm-i386/apic.h
include/asm-i386/cpufeature.h
include/asm-i386/paravirt.h
include/asm-i386/pci.h
include/asm-powerpc/dma-mapping.h
include/asm-powerpc/spu_priv1.h
include/asm-x86_64/pci.h
include/linux/bio.h
include/linux/blktrace_api.h
include/linux/clockchips.h
include/linux/cpu.h
include/linux/fs.h
include/linux/init.h
include/linux/kernel.h
include/linux/netdevice.h
include/linux/proc_fs.h
include/linux/rcupdate.h
include/linux/tty.h
kernel/irq/chip.c
kernel/irq/resend.c
kernel/kprobes.c
kernel/power/snapshot.c
kernel/profile.c
kernel/sched.c
kernel/sched_debug.c
kernel/sched_fair.c
kernel/sysctl.c
kernel/time/clockevents.c
lib/hexdump.c
mm/filemap.c
net/8021q/vlanproc.c
net/atm/lec.c
net/ax25/ax25_iface.c
net/bridge/br_device.c
net/bridge/br_if.c
net/bridge/br_stp_if.c
net/bridge/br_sysfs_br.c
net/core/dev.c
net/core/ethtool.c
net/dccp/ccid.c
net/dccp/feat.c
net/econet/af_econet.c
net/ipv4/ip_output.c
net/ipv4/ipconfig.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/nf_nat_sip.c
net/ipv6/ipv6_sockglue.c
net/ipv6/tcp_ipv6.c
net/mac80211/ieee80211.c
net/mac80211/ieee80211_sta.c
net/netfilter/nf_conntrack_sip.c
net/netfilter/xt_u32.c
net/sched/act_police.c
net/socket.c
net/sunrpc/auth_gss/svcauth_gss.c
net/tipc/port.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c
scripts/checkpatch.pl

index 2bf6c2321c2d0d181e87ae7238caa703aafd5b21..36bdeff585e2d12ffe84f6ef25b3d38ea874fac3 100644 (file)
@@ -9,14 +9,13 @@ one found in the Dreamcast.
 Advantages:
 
  * It provides a nice large console (128 cols + 48 lines with 1024x768)
-   without using tiny, unreadable fonts.
+   without using tiny, unreadable fonts (NOT on the Dreamcast)
  * You can run XF86_FBDev on top of /dev/fb0
  * Most important: boot logo :-)
 
 Disadvantages:
 
- * Driver is currently limited to the Dreamcast PowerVR 2 implementation
-   at the time of this writing.
+ * Driver is largely untested on non-Dreamcast systems.
 
 Configuration
 =============
@@ -29,11 +28,16 @@ Accepted options:
 font:X    - default font to use. All fonts are supported, including the
             SUN12x22 font which is very nice at high resolutions.
 
-mode:X    - default video mode. The following video modes are supported:
-            640x240-60, 640x480-60.
            
+mode:X    - default video mode with format [xres]x[yres]-<bpp>@<refresh rate>
+            The following video modes are supported:
+            640x640-16@60, 640x480-24@60, 640x480-32@60. The Dreamcast
+            defaults to 640x480-16@60. At the time of writing the
+            24bpp and 32bpp modes function poorly. Work to fix that is
+            ongoing
+
             Note: the 640x240 mode is currently broken, and should not be
-            used for any reason. It is only mentioned as a reference.
+            used for any reason. It is only mentioned here as a reference.
 
 inverse   - invert colors on screen (for LCD displays)
 
@@ -52,10 +56,10 @@ output:X  - output type. This can be any of the following: pal, ntsc, and
 X11
 ===
 
-XF86_FBDev should work, in theory. At the time of this writing it is
-totally untested and may or may not even portray the beginnings of
-working. If you end up testing this, please let me know!
+XF86_FBDev has been shown to work on the Dreamcast in the past - though not yet
+on any 2.6 series kernel.
 
 --
 Paul Mundt <lethal@linuxdc.org>
+Updated by Adrian McMenamin <adrian@mcmen.demon.co.uk>
 
index 75b3680c41eb835e751a242191f2439914166152..6c0817c45683fd07f6367c8234d419a4e824ee48 100644 (file)
@@ -1,3 +1,13 @@
+---------------------------------------------------------------------------
+!!!!!!!!!!!!!!!WARNING!!!!!!!!
+The zero page is a kernel internal data structure, not a stable ABI.  It might change
+without warning and the kernel has no way to detect old version of it.
+If you're writing some external code like a boot loader you should only use
+the stable versioned real mode boot protocol described in boot.txt. Otherwise the kernel
+might break you at any time.
+!!!!!!!!!!!!!WARNING!!!!!!!!!!!
+----------------------------------------------------------------------------
+
 Summary of boot_params layout (kernel point of view)
      ( collected by Hans Lermen and Martin Mares )
  
index 536d5bfbdb8d390fa412d6e0b200ac980ecebecd..fe8b0c4892cf14e6f39e255ac368f150c41647c8 100644 (file)
@@ -98,6 +98,15 @@ applicable everywhere (see syntax).
   times, the limit is set to the largest selection.
   Reverse dependencies can only be used with boolean or tristate
   symbols.
+  Note:
+       select is evil.... select will by brute force set a symbol
+       equal to 'y' without visiting the dependencies. So abusing
+       select you are able to select a symbol FOO even if FOO depends
+       on BAR that is not set. In general use select only for
+       non-visible symbols (no promts anywhere) and for symbols with
+       no dependencies. That will limit the usefulness but on the
+       other hand avoid the illegal configurations all over. kconfig
+       should one day warn about such things.
 
 - numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
   This allows to limit the range of possible input values for int
index efdb42fd3fb81f7caa5c787c1a094cc7bcc592b9..975f029be25cb991e02ac9d310a15cd767ad2d29 100644 (file)
@@ -163,6 +163,8 @@ and is between 256 and 4096 characters. It is defined in the file
        acpi_irq_isa=   [HW,ACPI] If irq_balance, mark listed IRQs used by ISA
                        Format: <irq>,<irq>...
 
+       acpi_no_auto_ssdt       [HW,ACPI] Disable automatic loading of SSDT
+
        acpi_os_name=   [HW,ACPI] Tell ACPI BIOS the name of the OS
                        Format: To spoof as Windows 98: ="Microsoft Windows"
 
@@ -1820,6 +1822,26 @@ and is between 256 and 4096 characters. It is defined in the file
        thash_entries=  [KNL,NET]
                        Set number of hash buckets for TCP connection
 
+       thermal.act=    [HW,ACPI]
+                       -1: disable all active trip points in all thermal zones
+                       <degrees C>: override all lowest active trip points
+
+       thermal.nocrt=  [HW,ACPI]
+                       Set to disable actions on ACPI thermal zone
+                       critical and hot trip points.
+
+       thermal.off=    [HW,ACPI]
+                       1: disable ACPI thermal control
+
+       thermal.psv=    [HW,ACPI]
+                       -1: disable all passive trip points
+                       <degrees C>: override all passive trip points to this value
+
+       thermal.tzp=    [HW,ACPI]
+                       Specify global default ACPI thermal zone polling rate
+                       <deci-seconds>: poll all this frequency
+                       0: no polling (default)
+
        time            Show timing data prefixed to each printk message line
                        [deprecated, see 'printk.time']
 
@@ -1922,7 +1944,7 @@ and is between 256 and 4096 characters. It is defined in the file
                        See header of drivers/scsi/wd7000.c.
 
        wdt=            [WDT] Watchdog
-                       See Documentation/watchdog/watchdog.txt.
+                       See Documentation/watchdog/wdt.txt.
 
        xd=             [HW,XT] Original XT pre-IDE (RLL encoded) disks.
        xd_geo=         See header of drivers/block/xd.c.
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
new file mode 100644 (file)
index 0000000..5fbcc22
--- /dev/null
@@ -0,0 +1,322 @@
+==============
+Memory Hotplug
+==============
+
+Last Updated: Jul 28 2007
+
+This document is about memory hotplug including how-to-use and current status.
+Because Memory Hotplug is still under development, contents of this text will
+be changed often.
+
+1. Introduction
+  1.1 purpose of memory hotplug
+  1.2. Phases of memory hotplug
+  1.3. Unit of Memory online/offline operation
+2. Kernel Configuration
+3. sysfs files for memory hotplug
+4. Physical memory hot-add phase
+  4.1 Hardware(Firmware) Support
+  4.2 Notify memory hot-add event by hand
+5. Logical Memory hot-add phase
+  5.1. State of memory
+  5.2. How to online memory
+6. Logical memory remove
+  6.1 Memory offline and ZONE_MOVABLE
+  6.2. How to offline memory
+7. Physical memory remove
+8. Future Work List
+
+Note(1): x86_64's has special implementation for memory hotplug.
+         This text does not describe it.
+Note(2): This text assumes that sysfs is mounted at /sys.
+
+
+---------------
+1. Introduction
+---------------
+
+1.1 purpose of memory hotplug
+------------
+Memory Hotplug allows users to increase/decrease the amount of memory.
+Generally, there are two purposes.
+
+(A) For changing the amount of memory.
+    This is to allow a feature like capacity on demand.
+(B) For installing/removing DIMMs or NUMA-nodes physically.
+    This is to exchange DIMMs/NUMA-nodes, reduce power consumption, etc.
+
+(A) is required by highly virtualized environments and (B) is required by
+hardware which supports memory power management.
+
+Linux memory hotplug is designed for both purpose.
+
+
+1.2. Phases of memory hotplug
+---------------
+There are 2 phases in Memory Hotplug.
+  1) Physical Memory Hotplug phase
+  2) Logical Memory Hotplug phase.
+
+The First phase is to communicate hardware/firmware and make/erase
+environment for hotplugged memory. Basically, this phase is necessary
+for the purpose (B), but this is good phase for communication between
+highly virtualized environments too.
+
+When memory is hotplugged, the kernel recognizes new memory, makes new memory
+management tables, and makes sysfs files for new memory's operation.
+
+If firmware supports notification of connection of new memory to OS,
+this phase is triggered automatically. ACPI can notify this event. If not,
+"probe" operation by system administration is used instead.
+(see Section 4.).
+
+Logical Memory Hotplug phase is to change memory state into
+avaiable/unavailable for users. Amount of memory from user's view is
+changed by this phase. The kernel makes all memory in it as free pages
+when a memory range is available.
+
+In this document, this phase is described as online/offline.
+
+Logical Memory Hotplug phase is triggred by write of sysfs file by system
+administrator. For the hot-add case, it must be executed after Physical Hotplug
+phase by hand.
+(However, if you writes udev's hotplug scripts for memory hotplug, these
+ phases can be execute in seamless way.)
+
+
+1.3. Unit of Memory online/offline operation
+------------
+Memory hotplug uses SPARSEMEM memory model. SPARSEMEM divides the whole memory
+into chunks of the same size. The chunk is called a "section". The size of
+a section is architecture dependent. For example, power uses 16MiB, ia64 uses
+1GiB. The unit of online/offline operation is "one section". (see Section 3.)
+
+To determine the size of sections, please read this file:
+
+/sys/devices/system/memory/block_size_bytes
+
+This file shows the size of sections in byte.
+
+-----------------------
+2. Kernel Configuration
+-----------------------
+To use memory hotplug feature, kernel must be compiled with following
+config options.
+
+- For all memory hotplug
+    Memory model -> Sparse Memory  (CONFIG_SPARSEMEM)
+    Allow for memory hot-add       (CONFIG_MEMORY_HOTPLUG)
+
+- To enable memory removal, the followings are also necessary
+    Allow for memory hot remove    (CONFIG_MEMORY_HOTREMOVE)
+    Page Migration                 (CONFIG_MIGRATION)
+
+- For ACPI memory hotplug, the followings are also necessary
+    Memory hotplug (under ACPI Support menu) (CONFIG_ACPI_HOTPLUG_MEMORY)
+    This option can be kernel module.
+
+- As a related configuration, if your box has a feature of NUMA-node hotplug
+  via ACPI, then this option is necessary too.
+    ACPI0004,PNP0A05 and PNP0A06 Container Driver (under ACPI Support menu)
+    (CONFIG_ACPI_CONTAINER).
+    This option can be kernel module too.
+
+--------------------------------
+3 sysfs files for memory hotplug
+--------------------------------
+All sections have their device information under /sys/devices/system/memory as
+
+/sys/devices/system/memory/memoryXXX
+(XXX is section id.)
+
+Now, XXX is defined as start_address_of_section / section_size.
+
+For example, assume 1GiB section size. A device for a memory starting at
+0x100000000 is /sys/device/system/memory/memory4
+(0x100000000 / 1Gib = 4)
+This device covers address range [0x100000000 ... 0x140000000)
+
+Under each section, you can see 3 files.
+
+/sys/devices/system/memory/memoryXXX/phys_index
+/sys/devices/system/memory/memoryXXX/phys_device
+/sys/devices/system/memory/memoryXXX/state
+
+'phys_index' : read-only and contains section id, same as XXX.
+'state'      : read-write
+               at read:  contains online/offline state of memory.
+               at write: user can specify "online", "offline" command
+'phys_device': read-only: designed to show the name of physical memory device.
+               This is not well implemented now.
+
+NOTE:
+  These directories/files appear after physical memory hotplug phase.
+
+
+--------------------------------
+4. Physical memory hot-add phase
+--------------------------------
+
+4.1 Hardware(Firmware) Support
+------------
+On x86_64/ia64 platform, memory hotplug by ACPI is supported.
+
+In general, the firmware (ACPI) which supports memory hotplug defines
+memory class object of _HID "PNP0C80". When a notify is asserted to PNP0C80,
+Linux's ACPI handler does hot-add memory to the system and calls a hotplug udev
+script. This will be done automatically.
+
+But scripts for memory hotplug are not contained in generic udev package(now).
+You may have to write it by yourself or online/offline memory by hand.
+Please see "How to online memory", "How to offline memory" in this text.
+
+If firmware supports NUMA-node hotplug, and defines an object _HID "ACPI0004",
+"PNP0A05", or "PNP0A06", notification is asserted to it, and ACPI handler
+calls hotplug code for all of objects which are defined in it.
+If memory device is found, memory hotplug code will be called.
+
+
+4.2 Notify memory hot-add event by hand
+------------
+In some environments, especially virtualized environment, firmware will not
+notify memory hotplug event to the kernel. For such environment, "probe"
+interface is supported. This interface depends on CONFIG_ARCH_MEMORY_PROBE.
+
+Now, CONFIG_ARCH_MEMORY_PROBE is supported only by powerpc but it does not
+contain highly architecture codes. Please add config if you need "probe"
+interface.
+
+Probe interface is located at
+/sys/devices/system/memory/probe
+
+You can tell the physical address of new memory to the kernel by
+
+% echo start_address_of_new_memory > /sys/devices/system/memory/probe
+
+Then, [start_address_of_new_memory, start_address_of_new_memory + section_size)
+memory range is hot-added. In this case, hotplug script is not called (in
+current implementation). You'll have to online memory by yourself.
+Please see "How to online memory" in this text.
+
+
+
+------------------------------
+5. Logical Memory hot-add phase
+------------------------------
+
+5.1. State of memory
+------------
+To see (online/offline) state of memory section, read 'state' file.
+
+% cat /sys/device/system/memory/memoryXXX/state
+
+
+If the memory section is online, you'll read "online".
+If the memory section is offline, you'll read "offline".
+
+
+5.2. How to online memory
+------------
+Even if the memory is hot-added, it is not at ready-to-use state.
+For using newly added memory, you have to "online" the memory section.
+
+For onlining, you have to write "online" to the section's state file as:
+
+% echo online > /sys/devices/system/memory/memoryXXX/state
+
+After this, section memoryXXX's state will be 'online' and the amount of
+available memory will be increased.
+
+Currently, newly added memory is added as ZONE_NORMAL (for powerpc, ZONE_DMA).
+This may be changed in future.
+
+
+
+------------------------
+6. Logical memory remove
+------------------------
+
+6.1 Memory offline and ZONE_MOVABLE
+------------
+Memory offlining is more complicated than memory online. Because memory offline
+has to make the whole memory section be unused, memory offline can fail if
+the section includes memory which cannot be freed.
+
+In general, memory offline can use 2 techniques.
+
+(1) reclaim and free all memory in the section.
+(2) migrate all pages in the section.
+
+In the current implementation, Linux's memory offline uses method (2), freeing
+all  pages in the section by page migration. But not all pages are
+migratable. Under current Linux, migratable pages are anonymous pages and
+page caches. For offlining a section by migration, the kernel has to guarantee
+that the section contains only migratable pages.
+
+Now, a boot option for making a section which consists of migratable pages is
+supported. By specifying "kernelcore=" or "movablecore=" boot option, you can
+create ZONE_MOVABLE...a zone which is just used for movable pages.
+(See also Documentation/kernel-parameters.txt)
+
+Assume the system has "TOTAL" amount of memory at boot time, this boot option
+creates ZONE_MOVABLE as following.
+
+1) When kernelcore=YYYY boot option is used,
+  Size of memory not for movable pages (not for offline) is YYYY.
+  Size of memory for movable pages (for offline) is TOTAL-YYYY.
+
+2) When movablecore=ZZZZ boot option is used,
+  Size of memory not for movable pages (not for offline) is TOTAL - ZZZZ.
+  Size of memory for movable pages (for offline) is ZZZZ.
+
+
+Note) Unfortunately, there is no information to show which section belongs
+to ZONE_MOVABLE. This is TBD.
+
+
+6.2. How to offline memory
+------------
+You can offline a section by using the same sysfs interface that was used in
+memory onlining.
+
+% echo offline > /sys/devices/system/memory/memoryXXX/state
+
+If offline succeeds, the state of the memory section is changed to be "offline".
+If it fails, some error core (like -EBUSY) will be returned by the kernel.
+Even if a section does not belong to ZONE_MOVABLE, you can try to offline it.
+If it doesn't contain 'unmovable' memory, you'll get success.
+
+A section under ZONE_MOVABLE is considered to be able to be offlined easily.
+But under some busy state, it may return -EBUSY. Even if a memory section
+cannot be offlined due to -EBUSY, you can retry offlining it and may be able to
+offline it (or not).
+(For example, a page is referred to by some kernel internal call and released
+ soon.)
+
+Consideration:
+Memory hotplug's design direction is to make the possibility of memory offlining
+higher and to guarantee unplugging memory under any situation. But it needs
+more work. Returning -EBUSY under some situation may be good because the user
+can decide to retry more or not by himself. Currently, memory offlining code
+does some amount of retry with 120 seconds timeout.
+
+-------------------------
+7. Physical memory remove
+-------------------------
+Need more implementation yet....
+ - Notification completion of remove works by OS to firmware.
+ - Guard from remove if not yet.
+
+--------------
+8. Future Work
+--------------
+  - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like
+    sysctl or new control file.
+  - showing memory section and physical device relationship.
+  - showing memory section and node relationship (maybe good for NUMA)
+  - showing memory section is under ZONE_MOVABLE or not
+  - test and make it better memory offlining.
+  - support HugeTLB page migration and offlining.
+  - memmap removing at memory offline.
+  - physical remove memory.
+
index ba328f255417a7e240a3e8df12b030faec34374d..ef19142896ca0688ca82b62a82a51fd13b7e7700 100644 (file)
@@ -1,6 +1,6 @@
 Linux Magic System Request Key Hacks
 Documentation for sysrq.c
-Last update: 2007-MAR-14
+Last update: 2007-AUG-04
 
 *  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -78,7 +78,7 @@ On all -  write a character to /proc/sysrq-trigger.  e.g.:
 'g'    - Used by kgdb on ppc and sh platforms.
 
 'h'     - Will display help (actually any other key than those listed
-          above will display help. but 'h' is easy to remember :-)
+          here will display help. but 'h' is easy to remember :-)
 
 'i'     - Send a SIGKILL to all processes, except for init.
 
index 6711fbcf408078644bf237b2f46466b69b7040ff..eb2f5986e1eb911e94c760c5107dccef5b053f76 100644 (file)
@@ -105,10 +105,10 @@ The version of thinkpad-acpi's sysfs interface is exported by the driver
 as a driver attribute (see below).
 
 Sysfs driver attributes are on the driver's sysfs attribute space,
-for 2.6.20 this is /sys/bus/platform/drivers/thinkpad-acpi/.
+for 2.6.20 this is /sys/bus/platform/drivers/thinkpad_acpi/.
 
 Sysfs device attributes are on the driver's sysfs attribute space,
-for 2.6.20 this is /sys/devices/platform/thinkpad-acpi/.
+for 2.6.20 this is /sys/devices/platform/thinkpad_acpi/.
 
 Driver version
 --------------
index e65e96a14bec491b8f1c533069af487ede6d6f9c..371fe67a4eef3eb4bfe00039ea895da2a2c318c8 100644 (file)
@@ -97,6 +97,12 @@ M:   philb@gnu.org
 L:     netdev@vger.kernel.org
 S:     Maintained
 
+3C59X NETWORK DRIVER
+P:     Steffen Klassert
+M:     klassert@mathematik.tu-chemnitz.de
+L:     netdev@vger.kernel.org
+S:     Maintained
+
 3CR990 NETWORK DRIVER
 P:     David Dillow
 M:     dave@thedillows.org
@@ -612,6 +618,15 @@ W: http://sourceforge.net/projects/acpi4asus
 W:     http://xf.iksaif.net/acpi4asus
 S:     Maintained
 
+ASYNCHRONOUS TRANSFERS/TRANSFORMS API
+P:     Dan Williams
+M:     dan.j.williams@intel.com
+P:     Shannon Nelson
+M:     shannon.nelson@intel.com
+L:     linux-kernel@vger.kernel.org
+W:     http://sourceforge.net/projects/xscaleiop
+S:     Supported
+
 ATA OVER ETHERNET DRIVER
 P:     Ed L. Cashin
 M:     ecashin@coraid.com
@@ -664,7 +679,7 @@ S:  Maintained
 AUDIT SUBSYSTEM
 P:     David Woodhouse
 M:     dwmw2@infradead.org
-L:     linux-audit@redhat.com
+L:     linux-audit@redhat.com (subscribers-only)
 W:     http://people.redhat.com/sgrubb/audit/
 T:     git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
 S:     Maintained
@@ -994,7 +1009,7 @@ P: Steve French
 M:     sfrench@samba.org
 L:     linux-cifs-client@lists.samba.org
 L:     samba-technical@lists.samba.org
-W:     http://us1.samba.org/samba/Linux_CIFS_client.html
+W:     http://linux-cifs.samba.org/
 T:     git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
 S:     Supported
 
@@ -1277,11 +1292,13 @@ M:      tori@unhappy.mine.nu
 L:     netdev@vger.kernel.org
 S:     Maintained
 
-DMA GENERIC MEMCPY SUBSYSTEM
+DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
 P:     Shannon Nelson
 M:     shannon.nelson@intel.com
+P:     Dan Williams
+M:     dan.j.williams@intel.com
 L:     linux-kernel@vger.kernel.org
-S:     Maintained
+S:     Supported
 
 DME1737 HARDWARE MONITOR DRIVER
 P:     Juerg Haefliger
@@ -1958,6 +1975,12 @@ M:       shannon.nelson@intel.com
 L:     linux-kernel@vger.kernel.org
 S:     Supported
 
+INTEL IOP-ADMA DMA DRIVER
+P:     Dan Williams
+M:     dan.j.williams@intel.com
+L:     linux-kernel@vger.kernel.org
+S:     Supported
+
 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
 P:     Deepak Saxena
 M:     dsaxena@plexity.net
index 91759a60d2a3bbde1ec29c7e3f7b30d41f310fbb..f3229a4945bf57f80f4c87eb504123c4ed21bb29 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 23
-EXTRAVERSION =-rc2
+EXTRAVERSION =-rc3
 NAME = Holy Dancing Manatees, Batman!
 
 # *DOCUMENTATION*
index 1d3c1398c428d324d42f67b4fc24284831278b2b..52c91ccc164866d3c08ed24ed6984d7b53e35c65 100644 (file)
@@ -270,6 +270,19 @@ titan_dispatch_irqs(u64 mask)
 /*
  * Titan Family
  */
+static void __init
+titan_request_irq(unsigned int irq, irq_handler_t handler,
+                 unsigned long irqflags, const char *devname,
+                 void *dev_id)
+{
+       int err;
+       err = request_irq(irq, handler, irqflags, devname, dev_id);
+       if (err) {
+               printk("titan_request_irq for IRQ %d returned %d; ignoring\n",
+                      irq, err);
+       }
+}
+
 static void __init
 titan_late_init(void)
 {
@@ -278,15 +291,15 @@ titan_late_init(void)
         * all reported to the kernel as machine checks, so the handler
         * is a nop so it can be called to count the individual events.
         */
-       request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
                    "CChip Error", NULL);
-       request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 0 H_Error", NULL);
-       request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 1 H_Error", NULL);
-       request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 0 C_Error", NULL);
-       request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
                    "PChip 1 C_Error", NULL);
 
        /* 
@@ -345,9 +358,9 @@ privateer_init_pci(void)
         * Hook a couple of extra err interrupts that the
         * common titan code won't.
         */
-       request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
                    "NMI", NULL);
-       request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
+       titan_request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
                    "Temperature Warning", NULL);
 
        /*
index 2edcecdea8bdd3402c2e323e0afceb7c7937bb83..ef801563bbf58930cfb90762a345b0d480c99841 100644 (file)
@@ -9,6 +9,7 @@
  */
 #include <linux/clk.h>
 #include <linux/etherdevice.h>
+#include <linux/i2c-gpio.h>
 #include <linux/init.h>
 #include <linux/linkage.h>
 #include <linux/platform_device.h>
@@ -123,6 +124,19 @@ static struct platform_device ngw_gpio_leds = {
        }
 };
 
+static struct i2c_gpio_platform_data i2c_gpio_data = {
+       .sda_pin        = GPIO_PIN_PA(6),
+       .scl_pin        = GPIO_PIN_PA(7),
+};
+
+static struct platform_device i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &i2c_gpio_data,
+       },
+};
+
 static int __init atngw100_init(void)
 {
        unsigned        i;
@@ -147,6 +161,10 @@ static int __init atngw100_init(void)
        }
        platform_device_register(&ngw_gpio_leds);
 
+       at32_select_gpio(i2c_gpio_data.sda_pin, 0);
+       at32_select_gpio(i2c_gpio_data.scl_pin, 0);
+       platform_device_register(&i2c_gpio_device);
+
        return 0;
 }
 postcore_initcall(atngw100_init);
index 71bc7d364fb7c17ee8f1884f6f58d64732aedfa2..718578f640691c2e9b692c1b98acf53e6d7b5ca1 100644 (file)
@@ -50,4 +50,30 @@ config BOARD_ATSTK1002_SPI1
          GPIO lines and accessed through the J1 jumper block.  Say "y"
          here to configure that SPI controller.
 
+config BOARD_ATSTK1002_J2_LED
+       bool
+       default BOARD_ATSTK1002_J2_LED8 || BOARD_ATSTK1002_J2_RGB
+
+choice
+       prompt "LEDs connected to J2:"
+       depends on LEDS_GPIO && !BOARD_ATSTK1002_SW4_CUSTOM
+       optional
+       help
+         Select this if you have jumpered the J2 jumper block to the
+         LED0..LED7 amber leds, or to the RGB leds, using a ten-pin
+         IDC cable.  A default "heartbeat" trigger is provided, but
+         you can of course override this.
+
+config BOARD_ATSTK1002_J2_LED8
+       bool "LED0..LED7"
+       help
+         Select this if J2 is jumpered to LED0..LED7 amber leds.
+
+config BOARD_ATSTK1002_J2_RGB
+       bool "RGB leds"
+       help
+         Select this if J2 is jumpered to the RGB leds.
+
+endchoice
+
 endif  # stk 1002
index cb93eabb9c6c4145947df0bda8afaefd0d734340..c9981b731efa58e1d20aecee60222081ed813b06 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/etherdevice.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/leds.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/types.h>
@@ -120,6 +121,65 @@ static void __init set_hw_addr(struct platform_device *pdev)
        clk_put(pclk);
 }
 
+#ifdef CONFIG_BOARD_ATSTK1002_J2_LED
+
+static struct gpio_led stk_j2_led[] = {
+#ifdef CONFIG_BOARD_ATSTK1002_J2_LED8
+#define LEDSTRING "J2 jumpered to LED8"
+       { .name = "led0:amber", .gpio = GPIO_PIN_PB( 8), },
+       { .name = "led1:amber", .gpio = GPIO_PIN_PB( 9), },
+       { .name = "led2:amber", .gpio = GPIO_PIN_PB(10), },
+       { .name = "led3:amber", .gpio = GPIO_PIN_PB(13), },
+       { .name = "led4:amber", .gpio = GPIO_PIN_PB(14), },
+       { .name = "led5:amber", .gpio = GPIO_PIN_PB(15), },
+       { .name = "led6:amber", .gpio = GPIO_PIN_PB(16), },
+       { .name = "led7:amber", .gpio = GPIO_PIN_PB(30),
+                       .default_trigger = "heartbeat", },
+#else  /* RGB */
+#define LEDSTRING "J2 jumpered to RGB LEDs"
+       { .name = "r1:red",     .gpio = GPIO_PIN_PB( 8), },
+       { .name = "g1:green",   .gpio = GPIO_PIN_PB(10), },
+       { .name = "b1:blue",    .gpio = GPIO_PIN_PB(14), },
+
+       { .name = "r2:red",     .gpio = GPIO_PIN_PB( 9),
+                       .default_trigger = "heartbeat", },
+       { .name = "g2:green",   .gpio = GPIO_PIN_PB(13), },
+       { .name = "b2:blue",    .gpio = GPIO_PIN_PB(15),
+                       .default_trigger = "heartbeat", },
+       /* PB16, PB30 unused */
+#endif
+};
+
+static struct gpio_led_platform_data stk_j2_led_data = {
+       .num_leds       = ARRAY_SIZE(stk_j2_led),
+       .leds           = stk_j2_led,
+};
+
+static struct platform_device stk_j2_led_dev = {
+       .name           = "leds-gpio",
+       .id             = 2,    /* gpio block J2 */
+       .dev            = {
+               .platform_data  = &stk_j2_led_data,
+       },
+};
+
+static void setup_j2_leds(void)
+{
+       unsigned        i;
+
+       for (i = 0; i < ARRAY_SIZE(stk_j2_led); i++)
+               at32_select_gpio(stk_j2_led[i].gpio, AT32_GPIOF_OUTPUT);
+
+       printk("STK1002: " LEDSTRING "\n");
+       platform_device_register(&stk_j2_led_dev);
+}
+
+#else
+static void setup_j2_leds(void)
+{
+}
+#endif
+
 void __init setup_board(void)
 {
 #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
@@ -185,6 +245,8 @@ static int __init atstk1002_init(void)
        at32_add_device_ssc(0, ATMEL_SSC_TX);
 #endif
 
+       setup_j2_leds();
+
        return 0;
 }
 postcore_initcall(atstk1002_init);
index b45188f8512e380e18eb5afd5ff196a11d59af58..673c860ffc239f4a5655eb22940839d16f73c255 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/module.h>
 #include <linux/init_task.h>
 #include <linux/mqueue.h>
+#include <linux/fs.h>
 
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
index 5a51dd6ab28095966fac101dc229fb600934765f..6a7aefe4834639cd39b42b8d055187f4ad7e0d77 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/uaccess.h>
+#include <linux/fs.h>
+#include <linux/err.h>
 
 #include <asm/blackfin.h>
 #include <asm/fixed_code.h>
index f5e1ae3d1705958dceb302addac289613e489120..abcd14817d0e4f1291f115e9bf12df16982397a9 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/syscalls.h>
 #include <linux/mman.h>
 #include <linux/file.h>
+#include <linux/fs.h>
 #include <linux/uaccess.h>
 #include <linux/ipc.h>
 #include <linux/unistd.h>
index 8766bd612b4734778492aa6b9a9b693f1e2c9ee4..792a8416fe10160cc81e2660c553bba5c3db92a0 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
+#include <linux/fs.h>
 #include <asm/traps.h>
 #include <asm/cacheflush.h>
 #include <asm/blackfin.h>
index 4b41248b61ad8b6922df5b31c3ebdfa98d52945d..6b4d026a00a120e5728d8930bb6d4ad43a6b4006 100644 (file)
@@ -180,8 +180,6 @@ source "drivers/isdn/Kconfig"
 
 source "drivers/telephony/Kconfig"
 
-source "drivers/cdrom/Kconfig"
-
 #
 # input before char - char/joystick depends on it. As does USB.
 #
index 275673c192aad94632ef32a885ba3e0dbd37a304..1e74f3c5cee27d014d907c269778b018b828b563 100644 (file)
@@ -1496,6 +1496,7 @@ sys_call_table:
        .long sys_signalfd
        .long sys_timerfd
        .long sys_eventfd
+       .long sys_fallocate
 
 
 syscall_table_size = (. - sys_call_table)
index 658834d9f92a098acc2de75a1a5e9c028540b254..82b5c846a194acae54c1275150a76edf53d52518 100644 (file)
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
 
-struct edd_dapa {
-       u8      pkt_size;
-       u8      rsvd;
-       u16     sector_cnt;
-       u16     buf_off, buf_seg;
-       u64     lba;
-       u64     buf_lin_addr;
-};
-
 /*
  * Read the MBR (first sector) from a specific device.
  */
 static int read_mbr(u8 devno, void *buf)
 {
-       struct edd_dapa dapa;
-       u16 ax, bx, cx, dx, si;
-
-       memset(&dapa, 0, sizeof dapa);
-       dapa.pkt_size = sizeof(dapa);
-       dapa.sector_cnt = 1;
-       dapa.buf_off = (size_t)buf;
-       dapa.buf_seg = ds();
-       /* dapa.lba = 0; */
-
-       ax = 0x4200;            /* Extended Read */
-       si = (size_t)&dapa;
-       dx = devno;
-       asm("pushfl; stc; int $0x13; setc %%al; popfl"
-           : "+a" (ax), "+S" (si), "+d" (dx)
-           : "m" (dapa)
-           : "ebx", "ecx", "edi", "memory");
-
-       if (!(u8)ax)
-               return 0;       /* OK */
+       u16 ax, bx, cx, dx;
 
        ax = 0x0201;            /* Legacy Read, one sector */
        cx = 0x0001;            /* Sector 0-0-1 */
@@ -65,11 +37,10 @@ static int read_mbr(u8 devno, void *buf)
        return -(u8)ax;         /* 0 or -1 */
 }
 
-static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
+static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)
 {
        int sector_size;
        char *mbrbuf_ptr, *mbrbuf_end;
-       u32 mbrsig;
        u32 buf_base, mbr_base;
        extern char _end[];
 
@@ -85,15 +56,15 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
 
        /* Make sure we actually have space on the heap... */
        if (!(boot_params.hdr.loadflags & CAN_USE_HEAP))
-               return 0;
+               return -1;
        if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr)
-               return 0;
+               return -1;
 
        if (read_mbr(devno, mbrbuf_ptr))
-               return 0;
+               return -1;
 
-       mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
-       return mbrsig;
+       *mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
+       return 0;
 }
 
 static int get_edd_info(u8 devno, struct edd_info *ei)
@@ -160,6 +131,7 @@ void query_edd(void)
        int do_edd = 1;
        int devno;
        struct edd_info ei, *edp;
+       u32 *mbrptr;
 
        if (cmdline_find_option("edd", eddarg, sizeof eddarg) > 0) {
                if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip"))
@@ -168,7 +140,8 @@ void query_edd(void)
                        do_edd = 0;
        }
 
-       edp = (struct edd_info *)boot_params.eddbuf;
+       edp    = boot_params.eddbuf;
+       mbrptr = boot_params.edd_mbr_sig_buffer;
 
        if (!do_edd)
                return;
@@ -186,11 +159,8 @@ void query_edd(void)
                        boot_params.eddbuf_entries++;
                }
 
-               if (do_mbr) {
-                       u32 mbr_sig;
-                       mbr_sig = read_mbr_sig(devno, &ei);
-                       boot_params.edd_mbr_sig_buffer[devno-0x80] = mbr_sig;
-               }
+               if (do_mbr && !read_mbr_sig(devno, &ei, mbrptr++))
+                       boot_params.edd_mbr_sig_buf_entries = devno-0x80+1;
        }
 }
 
index 958130ef004296c02f79614838152f0e1beae102..693f20d3102e9322759adca6834f2de4e159d0a1 100644 (file)
@@ -61,7 +61,7 @@ static void store_video_mode(void)
 
        /* Not all BIOSes are clean with respect to the top bit */
        boot_params.screen_info.orig_video_mode = ax & 0x7f;
-       boot_params.screen_info.orig_video_page = page;
+       boot_params.screen_info.orig_video_page = page >> 8;
 }
 
 /*
index c85598acb8fd5854394dd4aa8e16877bd5c01848..1b66d5c70eaf65fc88fa1146313071843a069993 100644 (file)
@@ -11,6 +11,8 @@
 #include <asm/mce.h>
 #include <asm/nmi.h>
 
+#define MAX_PATCH_LEN (255-1)
+
 #ifdef CONFIG_HOTPLUG_CPU
 static int smp_alt_once;
 
@@ -148,7 +150,8 @@ static unsigned char** find_nop_table(void)
 
 #endif /* CONFIG_X86_64 */
 
-static void nop_out(void *insns, unsigned int len)
+/* Use this to add nops to a buffer, then text_poke the whole buffer. */
+static void add_nops(void *insns, unsigned int len)
 {
        unsigned char **noptable = find_nop_table();
 
@@ -156,7 +159,7 @@ static void nop_out(void *insns, unsigned int len)
                unsigned int noplen = len;
                if (noplen > ASM_NOP_MAX)
                        noplen = ASM_NOP_MAX;
-               text_poke(insns, noptable[noplen], noplen);
+               memcpy(insns, noptable[noplen], noplen);
                insns += noplen;
                len -= noplen;
        }
@@ -174,15 +177,15 @@ extern u8 *__smp_locks[], *__smp_locks_end[];
 void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
        struct alt_instr *a;
-       u8 *instr;
-       int diff;
+       char insnbuf[MAX_PATCH_LEN];
 
        DPRINTK("%s: alt table %p -> %p\n", __FUNCTION__, start, end);
        for (a = start; a < end; a++) {
+               u8 *instr = a->instr;
                BUG_ON(a->replacementlen > a->instrlen);
+               BUG_ON(a->instrlen > sizeof(insnbuf));
                if (!boot_cpu_has(a->cpuid))
                        continue;
-               instr = a->instr;
 #ifdef CONFIG_X86_64
                /* vsyscall code is not mapped yet. resolve it manually. */
                if (instr >= (u8 *)VSYSCALL_START && instr < (u8*)VSYSCALL_END) {
@@ -191,9 +194,10 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
                                __FUNCTION__, a->instr, instr);
                }
 #endif
-               memcpy(instr, a->replacement, a->replacementlen);
-               diff = a->instrlen - a->replacementlen;
-               nop_out(instr + a->replacementlen, diff);
+               memcpy(insnbuf, a->replacement, a->replacementlen);
+               add_nops(insnbuf + a->replacementlen,
+                        a->instrlen - a->replacementlen);
+               text_poke(instr, insnbuf, a->instrlen);
        }
 }
 
@@ -215,16 +219,18 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end)
 static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end)
 {
        u8 **ptr;
+       char insn[1];
 
        if (noreplace_smp)
                return;
 
+       add_nops(insn, 1);
        for (ptr = start; ptr < end; ptr++) {
                if (*ptr < text)
                        continue;
                if (*ptr > text_end)
                        continue;
-               nop_out(*ptr, 1);
+               text_poke(*ptr, insn, 1);
        };
 }
 
@@ -351,6 +357,7 @@ void apply_paravirt(struct paravirt_patch_site *start,
                    struct paravirt_patch_site *end)
 {
        struct paravirt_patch_site *p;
+       char insnbuf[MAX_PATCH_LEN];
 
        if (noreplace_paravirt)
                return;
@@ -358,13 +365,15 @@ void apply_paravirt(struct paravirt_patch_site *start,
        for (p = start; p < end; p++) {
                unsigned int used;
 
-               used = paravirt_ops.patch(p->instrtype, p->clobbers, p->instr,
-                                         p->len);
+               BUG_ON(p->len > MAX_PATCH_LEN);
+               used = paravirt_ops.patch(p->instrtype, p->clobbers, insnbuf,
+                                         (unsigned long)p->instr, p->len);
 
                BUG_ON(used > p->len);
 
                /* Pad the rest with nops */
-               nop_out(p->instr + used, p->len - used);
+               add_nops(insnbuf + used, p->len - used);
+               text_poke(p->instr, insnbuf, p->len);
        }
 }
 extern struct paravirt_patch_site __start_parainstructions[],
@@ -379,7 +388,7 @@ void __init alternative_instructions(void)
           that might execute the to be patched code.
           Other CPUs are not running. */
        stop_nmi();
-#ifdef CONFIG_MCE
+#ifdef CONFIG_X86_MCE
        stop_mce();
 #endif
 
@@ -417,7 +426,7 @@ void __init alternative_instructions(void)
        local_irq_restore(flags);
 
        restart_nmi();
-#ifdef CONFIG_MCE
+#ifdef CONFIG_X86_MCE
        restart_mce();
 #endif
 }
index bfc6cb7df7e7ff0a3d00f48bc8221e37e3e54e0d..f9fff29e01a9a3fecbf6f5a59936120416f23713 100644 (file)
@@ -61,8 +61,9 @@ static int enable_local_apic __initdata = 0;
 
 /* Local APIC timer verification ok */
 static int local_apic_timer_verify_ok;
-/* Disable local APIC timer from the kernel commandline or via dmi quirk */
-static int local_apic_timer_disabled;
+/* Disable local APIC timer from the kernel commandline or via dmi quirk
+   or using CPU MSR check */
+int local_apic_timer_disabled;
 /* Local APIC timer works in C2 */
 int local_apic_timer_c2_ok;
 EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);
@@ -370,12 +371,9 @@ void __init setup_boot_APIC_clock(void)
        long delta, deltapm;
        int pm_referenced = 0;
 
-       if (boot_cpu_has(X86_FEATURE_LAPIC_TIMER_BROKEN))
-               local_apic_timer_disabled = 1;
-
        /*
         * The local apic timer can be disabled via the kernel
-        * commandline or from the test above. Register the lapic
+        * commandline or from the CPU detection code. Register the lapic
         * timer as a dummy clock event source on SMP systems, so the
         * broadcast mechanism is used. On UP systems simply ignore it.
         */
index c7ba455d5ac77d97747f1c13a4f5ac6737bfb48d..dcf6bbb1c7c0011d3a91f2e722f7d1abf25c8364 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/mm.h>
 #include <asm/io.h>
 #include <asm/processor.h>
+#include <asm/apic.h>
 
 #include "cpu.h"
 
@@ -22,6 +23,7 @@
 extern void vide(void);
 __asm__(".align 4\nvide: ret");
 
+#ifdef CONFIG_X86_LOCAL_APIC
 #define ENABLE_C1E_MASK         0x18000000
 #define CPUID_PROCESSOR_SIGNATURE       1
 #define CPUID_XFAM              0x0ff00000
@@ -52,6 +54,7 @@ static __cpuinit int amd_apic_timer_broken(void)
         }
        return 0;
 }
+#endif
 
 int force_mwait __cpuinitdata;
 
@@ -282,8 +285,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
                        num_cache_leaves = 3;
        }
 
+#ifdef CONFIG_X86_LOCAL_APIC
        if (amd_apic_timer_broken())
-               set_bit(X86_FEATURE_LAPIC_TIMER_BROKEN, c->x86_capability);
+               local_apic_timer_disabled = 1;
+#endif
 
        if (c->x86 == 0x10 && !force_mwait)
                clear_bit(X86_FEATURE_MWAIT, c->x86_capability);
index 32d04b083e38f1c592778508909f9239f8f82f5f..705e13a3078136df5bd9700ca344ac643cd145df 100644 (file)
@@ -68,7 +68,8 @@ struct acpi_cpufreq_data {
 };
 
 static struct acpi_cpufreq_data *drv_data[NR_CPUS];
-static struct acpi_processor_performance *acpi_perf_data[NR_CPUS];
+/* acpi_perf_data is a pointer to percpu data. */
+static struct acpi_processor_performance *acpi_perf_data;
 
 static struct cpufreq_driver acpi_cpufreq_driver;
 
@@ -508,24 +509,14 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
  * do _PDC and _PSD and find out the processor dependency for the
  * actual init that will happen later...
  */
-static int acpi_cpufreq_early_init(void)
+static int __init acpi_cpufreq_early_init(void)
 {
-       struct acpi_processor_performance *data;
-       unsigned int i, j;
-
        dprintk("acpi_cpufreq_early_init\n");
 
-       for_each_possible_cpu(i) {
-               data = kzalloc(sizeof(struct acpi_processor_performance),
-                              GFP_KERNEL);
-               if (!data) {
-                       for_each_possible_cpu(j) {
-                               kfree(acpi_perf_data[j]);
-                               acpi_perf_data[j] = NULL;
-                       }
-                       return -ENOMEM;
-               }
-               acpi_perf_data[i] = data;
+       acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
+       if (!acpi_perf_data) {
+               dprintk("Memory allocation error for acpi_perf_data.\n");
+               return -ENOMEM;
        }
 
        /* Do initialization in ACPI core */
@@ -574,14 +565,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
        dprintk("acpi_cpufreq_cpu_init\n");
 
-       if (!acpi_perf_data[cpu])
-               return -ENODEV;
-
        data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL);
        if (!data)
                return -ENOMEM;
 
-       data->acpi_data = acpi_perf_data[cpu];
+       data->acpi_data = percpu_ptr(acpi_perf_data, cpu);
        drv_data[cpu] = data;
 
        if (cpu_has(c, X86_FEATURE_CONSTANT_TSC))
@@ -778,24 +766,25 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
 
 static int __init acpi_cpufreq_init(void)
 {
+       int ret;
+
        dprintk("acpi_cpufreq_init\n");
 
-       acpi_cpufreq_early_init();
+       ret = acpi_cpufreq_early_init();
+       if (ret)
+               return ret;
 
        return cpufreq_register_driver(&acpi_cpufreq_driver);
 }
 
 static void __exit acpi_cpufreq_exit(void)
 {
-       unsigned int i;
        dprintk("acpi_cpufreq_exit\n");
 
        cpufreq_unregister_driver(&acpi_cpufreq_driver);
 
-       for_each_possible_cpu(i) {
-               kfree(acpi_perf_data[i]);
-               acpi_perf_data[i] = NULL;
-       }
+       free_percpu(acpi_perf_data);
+
        return;
 }
 
index 265c5597efb01a13d0f605af3245c1f5968af7b6..40978af630e7f2a61d0170add5fbe0506052b6da 100644 (file)
@@ -13,7 +13,7 @@
 static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE];
 #define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE)
 
-#define ptr_ok(x) ((x) > PAGE_OFFSET && (x) < PAGE_OFFSET + 0x1000000)
+#define ptr_ok(x) ((x) > PAGE_OFFSET && (x) < PAGE_OFFSET + MAXMEM)
 
 static void doublefault_fn(void)
 {
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
        store_gdt(&gdt_desc);
        gdt = gdt_desc.address;
 
-       printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+       printk(KERN_EMERG "PANIC: double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
 
        if (ptr_ok(gdt)) {
                gdt += GDT_ENTRY_TSS << 3;
                tss = *(u16 *)(gdt+2);
                tss += *(u8 *)(gdt+4) << 16;
                tss += *(u8 *)(gdt+7) << 24;
-               printk("double fault, tss at %08lx\n", tss);
+               printk(KERN_EMERG "double fault, tss at %08lx\n", tss);
 
                if (ptr_ok(tss)) {
                        struct i386_hw_tss *t = (struct i386_hw_tss *)tss;
 
-                       printk("eip = %08lx, esp = %08lx\n", t->eip, t->esp);
+                       printk(KERN_EMERG "eip = %08lx, esp = %08lx\n", t->eip, t->esp);
 
-                       printk("eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
+                       printk(KERN_EMERG "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
                                t->eax, t->ebx, t->ecx, t->edx);
-                       printk("esi = %08lx, edi = %08lx\n",
+                       printk(KERN_EMERG "esi = %08lx, edi = %08lx\n",
                                t->esi, t->edi);
                }
        }
@@ -63,6 +63,7 @@ struct tss_struct doublefault_tss __cacheline_aligned = {
                .cs             = __KERNEL_CS,
                .ss             = __KERNEL_DS,
                .ds             = __USER_DS,
+               .fs             = __KERNEL_PERCPU,
 
                .__cr3          = __pa(swapper_pg_dir)
        }
index 7c52b222207ed80ffbaa06cbf6f9c06dd73d7229..8f0382161c91ec8e0a1c4f75b8ed22824c35eb90 100644 (file)
@@ -162,9 +162,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
  * which will be freed later
  */
 
-#ifdef CONFIG_HOTPLUG_CPU
-.section .text,"ax",@progbits
-#else
+#ifndef CONFIG_HOTPLUG_CPU
 .section .init.text,"ax",@progbits
 #endif
 
index 893df8280756194b68bb844852f1b69955985c5c..4b8a8da4b2e0345b2b1a8d4ba46f4d2f0e9bb2d0 100644 (file)
@@ -1256,12 +1256,15 @@ static struct irq_chip ioapic_chip;
 static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
 {
        if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
-                       trigger == IOAPIC_LEVEL)
+           trigger == IOAPIC_LEVEL) {
+               irq_desc[irq].status |= IRQ_LEVEL;
                set_irq_chip_and_handler_name(irq, &ioapic_chip,
                                         handle_fasteoi_irq, "fasteoi");
-       else
+       } else {
+               irq_desc[irq].status &= ~IRQ_LEVEL;
                set_irq_chip_and_handler_name(irq, &ioapic_chip,
                                         handle_edge_irq, "edge");
+       }
        set_intr_gate(vector, interrupt[irq]);
 }
 
index ea962c0667d50edb07df04e43a3ab1884dd7df1d..739cfb207dd7800503afebe58e9ccbff893ea8bb 100644 (file)
@@ -69,7 +69,8 @@ DEF_NATIVE(read_tsc, "rdtsc");
 
 DEF_NATIVE(ud2a, "ud2a");
 
-static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len)
+static unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
+                            unsigned long addr, unsigned len)
 {
        const unsigned char *start, *end;
        unsigned ret;
@@ -90,7 +91,7 @@ static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len)
 #undef SITE
 
        patch_site:
-               ret = paravirt_patch_insns(insns, len, start, end);
+               ret = paravirt_patch_insns(ibuf, len, start, end);
                break;
 
        case PARAVIRT_PATCH(make_pgd):
@@ -107,7 +108,7 @@ static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len)
                break;
 
        default:
-               ret = paravirt_patch_default(type, clobbers, insns, len);
+               ret = paravirt_patch_default(type, clobbers, ibuf, addr, len);
                break;
        }
 
@@ -129,68 +130,67 @@ struct branch {
        u32 delta;
 } __attribute__((packed));
 
-unsigned paravirt_patch_call(void *target, u16 tgt_clobbers,
-                            void *site, u16 site_clobbers,
+unsigned paravirt_patch_call(void *insnbuf,
+                            const void *target, u16 tgt_clobbers,
+                            unsigned long addr, u16 site_clobbers,
                             unsigned len)
 {
-       unsigned char *call = site;
-       unsigned long delta = (unsigned long)target - (unsigned long)(call+5);
-       struct branch b;
+       struct branch *b = insnbuf;
+       unsigned long delta = (unsigned long)target - (addr+5);
 
        if (tgt_clobbers & ~site_clobbers)
                return len;     /* target would clobber too much for this site */
        if (len < 5)
                return len;     /* call too long for patch site */
 
-       b.opcode = 0xe8; /* call */
-       b.delta = delta;
-       BUILD_BUG_ON(sizeof(b) != 5);
-       text_poke(call, (unsigned char *)&b, 5);
+       b->opcode = 0xe8; /* call */
+       b->delta = delta;
+       BUILD_BUG_ON(sizeof(*b) != 5);
 
        return 5;
 }
 
-unsigned paravirt_patch_jmp(void *target, void *site, unsigned len)
+unsigned paravirt_patch_jmp(const void *target, void *insnbuf,
+                           unsigned long addr, unsigned len)
 {
-       unsigned char *jmp = site;
-       unsigned long delta = (unsigned long)target - (unsigned long)(jmp+5);
-       struct branch b;
+       struct branch *b = insnbuf;
+       unsigned long delta = (unsigned long)target - (addr+5);
 
        if (len < 5)
                return len;     /* call too long for patch site */
 
-       b.opcode = 0xe9;        /* jmp */
-       b.delta = delta;
-       text_poke(jmp, (unsigned char *)&b, 5);
+       b->opcode = 0xe9;       /* jmp */
+       b->delta = delta;
 
        return 5;
 }
 
-unsigned paravirt_patch_default(u8 type, u16 clobbers, void *site, unsigned len)
+unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
+                               unsigned long addr, unsigned len)
 {
        void *opfunc = *((void **)&paravirt_ops + type);
        unsigned ret;
 
        if (opfunc == NULL)
                /* If there's no function, patch it with a ud2a (BUG) */
-               ret = paravirt_patch_insns(site, len, start_ud2a, end_ud2a);
+               ret = paravirt_patch_insns(insnbuf, len, start_ud2a, end_ud2a);
        else if (opfunc == paravirt_nop)
                /* If the operation is a nop, then nop the callsite */
                ret = paravirt_patch_nop();
        else if (type == PARAVIRT_PATCH(iret) ||
                 type == PARAVIRT_PATCH(irq_enable_sysexit))
                /* If operation requires a jmp, then jmp */
-               ret = paravirt_patch_jmp(opfunc, site, len);
+               ret = paravirt_patch_jmp(opfunc, insnbuf, addr, len);
        else
                /* Otherwise call the function; assume target could
                   clobber any caller-save reg */
-               ret = paravirt_patch_call(opfunc, CLBR_ANY,
-                                         site, clobbers, len);
+               ret = paravirt_patch_call(insnbuf, opfunc, CLBR_ANY,
+                                         addr, clobbers, len);
 
        return ret;
 }
 
-unsigned paravirt_patch_insns(void *site, unsigned len,
+unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
                              const char *start, const char *end)
 {
        unsigned insn_len = end - start;
@@ -198,7 +198,7 @@ unsigned paravirt_patch_insns(void *site, unsigned len,
        if (insn_len > len || start == NULL)
                insn_len = len;
        else
-               memcpy(site, start, insn_len);
+               memcpy(insnbuf, start, insn_len);
 
        return insn_len;
 }
index 72042bb7ec941a0537670136e105954331caa5d5..18673e0f193b9237910b33645f26c0bcb64dd99b 100644 (file)
@@ -87,12 +87,14 @@ struct vmi_timer_ops vmi_timer_ops;
 #define IRQ_PATCH_INT_MASK 0
 #define IRQ_PATCH_DISABLE  5
 
-static inline void patch_offset(unsigned char *eip, unsigned char *dest)
+static inline void patch_offset(void *insnbuf,
+                               unsigned long eip, unsigned long dest)
 {
-        *(unsigned long *)(eip+1) = dest-eip-5;
+        *(unsigned long *)(insnbuf+1) = dest-eip-5;
 }
 
-static unsigned patch_internal(int call, unsigned len, void *insns)
+static unsigned patch_internal(int call, unsigned len, void *insnbuf,
+                              unsigned long eip)
 {
        u64 reloc;
        struct vmi_relocation_info *const rel = (struct vmi_relocation_info *)&reloc;
@@ -100,14 +102,14 @@ static unsigned patch_internal(int call, unsigned len, void *insns)
        switch(rel->type) {
                case VMI_RELOCATION_CALL_REL:
                        BUG_ON(len < 5);
-                       *(char *)insns = MNEM_CALL;
-                       patch_offset(insns, rel->eip);
+                       *(char *)insnbuf = MNEM_CALL;
+                       patch_offset(insnbuf, eip, (unsigned long)rel->eip);
                        return 5;
 
                case VMI_RELOCATION_JUMP_REL:
                        BUG_ON(len < 5);
-                       *(char *)insns = MNEM_JMP;
-                       patch_offset(insns, rel->eip);
+                       *(char *)insnbuf = MNEM_JMP;
+                       patch_offset(insnbuf, eip, (unsigned long)rel->eip);
                        return 5;
 
                case VMI_RELOCATION_NOP:
@@ -128,21 +130,26 @@ static unsigned patch_internal(int call, unsigned len, void *insns)
  * Apply patch if appropriate, return length of new instruction
  * sequence.  The callee does nop padding for us.
  */
-static unsigned vmi_patch(u8 type, u16 clobbers, void *insns, unsigned len)
+static unsigned vmi_patch(u8 type, u16 clobbers, void *insns,
+                         unsigned long eip, unsigned len)
 {
        switch (type) {
                case PARAVIRT_PATCH(irq_disable):
-                       return patch_internal(VMI_CALL_DisableInterrupts, len, insns);
+                       return patch_internal(VMI_CALL_DisableInterrupts, len,
+                                             insns, eip);
                case PARAVIRT_PATCH(irq_enable):
-                       return patch_internal(VMI_CALL_EnableInterrupts, len, insns);
+                       return patch_internal(VMI_CALL_EnableInterrupts, len,
+                                             insns, eip);
                case PARAVIRT_PATCH(restore_fl):
-                       return patch_internal(VMI_CALL_SetInterruptMask, len, insns);
+                       return patch_internal(VMI_CALL_SetInterruptMask, len,
+                                             insns, eip);
                case PARAVIRT_PATCH(save_fl):
-                       return patch_internal(VMI_CALL_GetInterruptMask, len, insns);
+                       return patch_internal(VMI_CALL_GetInterruptMask, len,
+                                             insns, eip);
                case PARAVIRT_PATCH(iret):
-                       return patch_internal(VMI_CALL_IRET, len, insns);
+                       return patch_internal(VMI_CALL_IRET, len, insns, eip);
                case PARAVIRT_PATCH(irq_enable_sysexit):
-                       return patch_internal(VMI_CALL_SYSEXIT, len, insns);
+                       return patch_internal(VMI_CALL_SYSEXIT, len, insns, eip);
                default:
                        break;
        }
index 8927222b3ab2595202afcbb5f88810a8f8716a02..4241a74d16c8d3181256b9ed7b0c688edb2bfe85 100644 (file)
@@ -82,7 +82,7 @@ static void flush_kernel_map(void *arg)
        struct page *p;
 
        /* High level code is not ready for clflush yet */
-       if (cpu_has_clflush) {
+       if (0 && cpu_has_clflush) {
                list_for_each_entry (p, lh, lru)
                        cache_flush_page(p);
        } else if (boot_cpu_data.x86_model >= 4)
index 85503deeda46cbd336c5cf3e15bcb6a4998b8d10..ebc6f3c66340ccb319be52002283c53a2545312b 100644 (file)
@@ -455,3 +455,26 @@ void pcibios_disable_device (struct pci_dev *dev)
        if (!dev->msi_enabled && pcibios_disable_irq)
                pcibios_disable_irq(dev);
 }
+
+struct pci_bus *pci_scan_bus_with_sysdata(int busno)
+{
+       struct pci_bus *bus = NULL;
+       struct pci_sysdata *sd;
+
+       /*
+        * Allocate per-root-bus (not per bus) arch-specific data.
+        * TODO: leak; this memory is never freed.
+        * It's arguable whether it's worth the trouble to care.
+        */
+       sd = kzalloc(sizeof(*sd), GFP_KERNEL);
+       if (!sd) {
+               printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busno);
+               return NULL;
+       }
+       sd->node = -1;
+       bus = pci_scan_bus(busno, &pci_root_ops, sd);
+       if (!bus)
+               kfree(sd);
+
+       return bus;
+}
index e7306dbf6c4273be26008c28cfc0c2fe5a7bc7bd..c82cbf4c7226ec65a4acd21c68669279dc761c33 100644 (file)
@@ -25,9 +25,9 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
                pci_read_config_byte(d, reg++, &subb);
                DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb);
                if (busno)
-                       pci_scan_bus(busno, &pci_root_ops, NULL);       /* Bus A */
+                       pci_scan_bus_with_sysdata(busno);       /* Bus A */
                if (suba < subb)
-                       pci_scan_bus(suba+1, &pci_root_ops, NULL);      /* Bus B */
+                       pci_scan_bus_with_sysdata(suba+1);      /* Bus B */
        }
        pcibios_last_bus = -1;
 }
@@ -42,7 +42,7 @@ static void __devinit pci_fixup_i450gx(struct pci_dev *d)
        u8 busno;
        pci_read_config_byte(d, 0x4a, &busno);
        printk(KERN_INFO "PCI: i440KX/GX host bridge %s: secondary bus %02x\n", pci_name(d), busno);
-       pci_scan_bus(busno, &pci_root_ops, NULL);
+       pci_scan_bus_with_sysdata(busno);
        pcibios_last_bus = -1;
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx);
index f2cb942f828197ae61b36c2314cc8b2fcee75446..665db063a40a4da9630c66ad12511d335fc60bc7 100644 (file)
@@ -138,8 +138,9 @@ static void __init pirq_peer_trick(void)
        for(i = 1; i < 256; i++) {
                if (!busmap[i] || pci_find_bus(0, i))
                        continue;
-               if (pci_scan_bus(i, &pci_root_ops, NULL))
-                       printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i);
+               if (pci_scan_bus_with_sysdata(i))
+                       printk(KERN_INFO "PCI: Discovered primary peer "
+                              "bus %02x [IRQ]\n", i);
        }
        pcibios_last_bus = -1;
 }
index 149a9588c256797c1032c6f6cc1b1fa9645b2b3b..5565d7016b754d340c4f82aceec44f781b964d63 100644 (file)
@@ -26,7 +26,7 @@ static void __devinit pcibios_fixup_peer_bridges(void)
                            l != 0x0000 && l != 0xffff) {
                                DBG("Found device at %02x:%02x [%04x]\n", n, devfn, l);
                                printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n);
-                               pci_scan_bus(n, &pci_root_ops, NULL);
+                               pci_scan_bus_with_sysdata(n);
                                break;
                        }
                }
index bb1afd9e589d5bdf27a5bfe91b2c4cd78107e8f1..1bf5816d34c85e294717fecf082bdd90baf26f38 100644 (file)
@@ -82,16 +82,15 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
 
        switch (len) {
        case 1:
-               *value = readb(mmcfg_virt_addr + reg);
+               *value = mmio_config_readb(mmcfg_virt_addr + reg);
                break;
        case 2:
-               *value = readw(mmcfg_virt_addr + reg);
+               *value = mmio_config_readw(mmcfg_virt_addr + reg);
                break;
        case 4:
-               *value = readl(mmcfg_virt_addr + reg);
+               *value = mmio_config_readl(mmcfg_virt_addr + reg);
                break;
        }
-
        spin_unlock_irqrestore(&pci_config_lock, flags);
 
        return 0;
@@ -116,16 +115,15 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
 
        switch (len) {
        case 1:
-               writeb(value, mmcfg_virt_addr + reg);
+               mmio_config_writeb(mmcfg_virt_addr + reg, value);
                break;
        case 2:
-               writew(value, mmcfg_virt_addr + reg);
+               mmio_config_writew(mmcfg_virt_addr + reg, value);
                break;
        case 4:
-               writel(value, mmcfg_virt_addr + reg);
+               mmio_config_writel(mmcfg_virt_addr + reg, value);
                break;
        }
-
        spin_unlock_irqrestore(&pci_config_lock, flags);
 
        return 0;
index adbe17a38f6f932cb8e238767f85eab12632a2d6..f5f165f69e0c602b9a7619c5d4e316e5ff1839ca 100644 (file)
@@ -96,10 +96,14 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
                pci_read_config_byte(d, reg++, &suba);
                pci_read_config_byte(d, reg++, &subb);
                DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb);
-               if (busno)
-                       pci_scan_bus(QUADLOCAL2BUS(quad,busno), &pci_root_ops, NULL);   /* Bus A */
-               if (suba < subb)
-                       pci_scan_bus(QUADLOCAL2BUS(quad,suba+1), &pci_root_ops, NULL);  /* Bus B */
+               if (busno) {
+                       /* Bus A */
+                       pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno));
+               }
+               if (suba < subb) {
+                       /* Bus B */
+                       pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, suba+1));
+               }
        }
        pcibios_last_bus = -1;
 }
@@ -123,8 +127,7 @@ static int __init pci_numa_init(void)
                                continue;
                        printk("Scanning PCI bus %d for quad %d\n", 
                                QUADLOCAL2BUS(quad,0), quad);
-                       pci_scan_bus(QUADLOCAL2BUS(quad,0), 
-                               &pci_root_ops, NULL);
+                       pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, 0));
                }
        return 0;
 }
index e58bae2076ad50b96a0e2fb78493e198e44816ec..8c66f275756f9f9ac4dc0d1177b396307fb3a7fc 100644 (file)
@@ -104,3 +104,46 @@ extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
 extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
                                           unsigned int devfn);
 extern int __init pci_mmcfg_arch_init(void);
+
+/*
+ * AMD Fam10h CPUs are buggy, and cannot access MMIO config space
+ * on their northbrige except through the * %eax register. As such, you MUST
+ * NOT use normal IOMEM accesses, you need to only use the magic mmio-config
+ * accessor functions.
+ * In fact just use pci_config_*, nothing else please.
+ */
+static inline unsigned char mmio_config_readb(void __iomem *pos)
+{
+       u8 val;
+       asm volatile("movb (%1),%%al" : "=a" (val) : "r" (pos));
+       return val;
+}
+
+static inline unsigned short mmio_config_readw(void __iomem *pos)
+{
+       u16 val;
+       asm volatile("movw (%1),%%ax" : "=a" (val) : "r" (pos));
+       return val;
+}
+
+static inline unsigned int mmio_config_readl(void __iomem *pos)
+{
+       u32 val;
+       asm volatile("movl (%1),%%eax" : "=a" (val) : "r" (pos));
+       return val;
+}
+
+static inline void mmio_config_writeb(void __iomem *pos, u8 val)
+{
+       asm volatile("movb %%al,(%1)" :: "a" (val), "r" (pos) : "memory");
+}
+
+static inline void mmio_config_writew(void __iomem *pos, u16 val)
+{
+       asm volatile("movw %%ax,(%1)" :: "a" (val), "r" (pos) : "memory");
+}
+
+static inline void mmio_config_writel(void __iomem *pos, u32 val)
+{
+       asm volatile("movl %%eax,(%1)" :: "a" (val), "r" (pos) : "memory");
+}
index f1b486d4190b0c38411eac8c76d95dbaf3d67721..8ecb1c72259497348be3c5c899655516a255697c 100644 (file)
@@ -101,8 +101,8 @@ static int __init pcibios_init(void)
                "bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0);
 
        raw_pci_ops = &pci_direct_conf1;
-       pci_scan_bus(pci_bus0, &pci_root_ops, NULL);
-       pci_scan_bus(pci_bus1, &pci_root_ops, NULL);
+       pci_scan_bus_with_sysdata(pci_bus0);
+       pci_scan_bus_with_sysdata(pci_bus1);
        pci_fixup_irqs(visws_swizzle, visws_map_irq);
        pcibios_resource_survey();
        return 0;
index 9a8c1181c001cec6c6105bd40dd2875e9e312074..f0c37511d8da82d6e30650a6d7f0cc6cbd6dd368 100644 (file)
@@ -842,7 +842,8 @@ void __init xen_setup_vcpu_info_placement(void)
        }
 }
 
-static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len)
+static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,
+                         unsigned long addr, unsigned len)
 {
        char *start, *end, *reloc;
        unsigned ret;
@@ -869,7 +870,7 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len)
                if (start == NULL || (end-start) > len)
                        goto default_patch;
 
-               ret = paravirt_patch_insns(insns, len, start, end);
+               ret = paravirt_patch_insns(insnbuf, len, start, end);
 
                /* Note: because reloc is assigned from something that
                   appears to be an array, gcc assumes it's non-null,
@@ -877,8 +878,8 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len)
                   end. */
                if (reloc > start && reloc < end) {
                        int reloc_off = reloc - start;
-                       long *relocp = (long *)(insns + reloc_off);
-                       long delta = start - (char *)insns;
+                       long *relocp = (long *)(insnbuf + reloc_off);
+                       long delta = start - (char *)addr;
 
                        *relocp += delta;
                }
@@ -886,7 +887,8 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len)
 
        default_patch:
        default:
-               ret = paravirt_patch_default(type, clobbers, insns, len);
+               ret = paravirt_patch_default(type, clobbers, insnbuf,
+                                            addr, len);
                break;
        }
 
index b732644788db799f83c6c90921ac14cd5f4e8069..13761bf160c406c4b4e29fb9fa8b869db35886f5 100644 (file)
@@ -134,20 +134,6 @@ static char *ft_next(struct ft_cxt *cxt, char *p, struct ft_atom *ret)
 #define HDR_SIZE       _ALIGN(sizeof(struct boot_param_header), 8)
 #define EXPAND_INCR    1024    /* alloc this much extra when expanding */
 
-/* See if the regions are in the standard order and non-overlapping */
-static int ft_ordered(struct ft_cxt *cxt)
-{
-       char *p = (char *)cxt->bph + HDR_SIZE;
-       enum ft_rgn_id r;
-
-       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r) {
-               if (p > cxt->rgn[r].start)
-                       return 0;
-               p = cxt->rgn[r].start + cxt->rgn[r].size;
-       }
-       return p <= (char *)cxt->bph + cxt->max_size;
-}
-
 /* Copy the tree to a newly-allocated region and put things in order */
 static int ft_reorder(struct ft_cxt *cxt, int nextra)
 {
@@ -573,10 +559,6 @@ int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
        cxt->rgn[FT_STRUCT].size = struct_size(cxt);
        cxt->rgn[FT_STRINGS].start = blob + be32_to_cpu(bph->off_dt_strings);
        cxt->rgn[FT_STRINGS].size = be32_to_cpu(bph->dt_strings_size);
-       /* Leave as '0' to force first ft_make_space call to do a ft_reorder
-        * and move dt to an area allocated by realloc.
-       cxt->isordered = ft_ordered(cxt);
-       */
 
        cxt->p = cxt->rgn[FT_STRUCT].start;
        cxt->str_anchor = cxt->rgn[FT_STRINGS].start;
index d0b43df444267a7696d7a0e9206461db66e4a8e2..ca7a197998ee5429a450802b7e7b756d1ce3d281 100644 (file)
@@ -1,9 +1,23 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc6
-# Tue Jun 26 14:15:19 2007
+# Linux kernel version: 2.6.23-rc2
+# Tue Aug  7 19:17:26 2007
 #
 CONFIG_PPC64=y
+
+#
+# Processor support
+#
+# CONFIG_POWER4_ONLY is not set
+CONFIG_POWER3=y
+CONFIG_POWER4=y
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+CONFIG_PPC_STD_MMU=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_VIRT_CPU_ACCOUNTING=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
 CONFIG_64BIT=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
@@ -15,6 +29,7 @@ CONFIG_ARCH_HAS_ILOG2_U64=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_COMPAT=y
@@ -22,50 +37,32 @@ CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
+CONFIG_OF=y
 # CONFIG_PPC_UDBG_16550 is not set
 # CONFIG_GENERIC_TBSYNC is not set
 CONFIG_AUDIT_ARCH=y
 CONFIG_GENERIC_BUG=y
 # CONFIG_DEFAULT_UIMAGE is not set
-
-#
-# Processor support
-#
-# CONFIG_POWER4_ONLY is not set
-CONFIG_POWER3=y
-CONFIG_POWER4=y
-CONFIG_PPC_FPU=y
 # CONFIG_PPC_DCR_NATIVE is not set
 # CONFIG_PPC_DCR_MMIO is not set
 # CONFIG_PPC_OF_PLATFORM_PCI is not set
-CONFIG_ALTIVEC=y
-CONFIG_PPC_STD_MMU=y
-# CONFIG_PPC_MM_SLICES is not set
-CONFIG_VIRT_CPU_ACCOUNTING=y
-CONFIG_SMP=y
-CONFIG_NR_CPUS=2
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=17
@@ -100,10 +97,6 @@ CONFIG_SLAB=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
@@ -111,12 +104,9 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
 CONFIG_STOP_MACHINE=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_BLK_DEV_BSG=y
 
 #
 # IO Schedulers
@@ -136,7 +126,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_EMBEDDED6xx is not set
-# CONFIG_APUS is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_86xx is not set
 # CONFIG_PPC_PSERIES is not set
 # CONFIG_PPC_ISERIES is not set
 # CONFIG_PPC_MPC52xx is not set
@@ -223,6 +215,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
 CONFIG_ARCH_MEMORY_PROBE=y
 # CONFIG_PPC_HAS_HASH_64K is not set
 # CONFIG_PPC_64K_PAGES is not set
@@ -241,6 +234,7 @@ CONFIG_ZONE_DMA=y
 CONFIG_GENERIC_ISA_DMA=y
 # CONFIG_PCI is not set
 # CONFIG_PCI_DOMAINS is not set
+# CONFIG_PCI_SYSCALL is not set
 # CONFIG_ARCH_SUPPORTS_MSI is not set
 
 #
@@ -365,6 +359,7 @@ CONFIG_WIRELESS_EXT=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -379,26 +374,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
+CONFIG_OF_DEVICE=y
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
@@ -411,11 +391,8 @@ CONFIG_BLK_DEV_RAM_SIZE=65535
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
-# CONFIG_BLINK is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_IDE is not set
 
 #
@@ -423,6 +400,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -455,37 +433,22 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_ISCSI_TCP is not set
-# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_LOWLEVEL is not set
 # CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
 # CONFIG_MACINTOSH_DRIVERS is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 # CONFIG_NET_ETHERNET is not set
 CONFIG_MII=m
 CONFIG_NETDEV_1000=y
-CONFIG_NETDEV_10000=y
 CONFIG_GELIC_NET=y
+# CONFIG_NETDEV_10000 is not set
 
 #
 # Wireless LAN
@@ -518,15 +481,7 @@ CONFIG_USB_NET_MCS7830=m
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -604,10 +559,6 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=16
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
@@ -616,10 +567,6 @@ CONFIG_GEN_RTC=y
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_HANGCHECK_TIMER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
 # CONFIG_I2C is not set
 
@@ -628,11 +575,8 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
 
 #
@@ -657,6 +601,7 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
@@ -691,11 +636,13 @@ CONFIG_FB_PS3_DEFAULT_SIZE_M=18
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
+CONFIG_FB_LOGO_EXTRA=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 CONFIG_LOGO_LINUX_CLUT224=y
@@ -709,6 +656,8 @@ CONFIG_SOUND=y
 # Advanced Linux Sound Architecture
 #
 CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
 # CONFIG_SND_SEQUENCER is not set
 # CONFIG_SND_MIXER_OSS is not set
 # CONFIG_SND_PCM_OSS is not set
@@ -734,6 +683,12 @@ CONFIG_SND_VERBOSE_PROCFS=y
 # ALSA PowerMac requires I2C
 #
 
+#
+# ALSA PowerPC devices
+#
+CONFIG_SND_PS3=y
+CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
+
 #
 # USB devices
 #
@@ -747,13 +702,14 @@ CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_SOC is not set
 
 #
-# Open Sound System
+# SoC Audio support for SuperH
 #
-# CONFIG_SOUND_PRIME is not set
 
 #
-# HID Devices
+# Open Sound System
 #
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
 
@@ -770,10 +726,7 @@ CONFIG_USB_HID=m
 #
 # CONFIG_USB_KBD is not set
 # CONFIG_USB_MOUSE is not set
-
-#
-# USB support
-#
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
@@ -803,6 +756,7 @@ CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -879,31 +833,8 @@ CONFIG_USB_MON=y
 #
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
+# CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
 
 #
@@ -919,6 +850,11 @@ CONFIG_USB_MON=y
 # DMA Devices
 #
 
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
 #
 # File systems
 #
@@ -948,8 +884,8 @@ CONFIG_QUOTA=y
 CONFIG_QFMT_V2=y
 CONFIG_QUOTACTL=y
 CONFIG_DNOTIFY=y
-# CONFIG_AUTOFS_FS is not set
-CONFIG_AUTOFS4_FS=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
 # CONFIG_FUSE_FS is not set
 
 #
@@ -1030,7 +966,6 @@ CONFIG_CIFS=m
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
@@ -1096,6 +1031,7 @@ CONFIG_BITREVERSE=y
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
@@ -1120,6 +1056,7 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -1150,10 +1087,6 @@ CONFIG_IRQSTACKS=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
@@ -1191,7 +1124,4 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
+CONFIG_CRYPTO_HW=y
index f39a72f30aadb81543fd3873491ccf94689b4d85..b0cb2e662c25a6e14f3b8e708a46993422c5e19f 100644 (file)
@@ -81,6 +81,7 @@ obj-y                         += iomap.o
 endif
 
 ifeq ($(CONFIG_PPC_ISERIES),y)
+CFLAGS_lparmap.s               += -g0
 extra-y += lparmap.s
 $(obj)/head_64.o:      $(obj)/lparmap.s
 AFLAGS_head_64.o += -I$(obj)
index 1448af92c6a9b36a1c6129522af1ac4c482d415b..171800002ede558df462e60a6c346c8442f74f9f 100644 (file)
@@ -1672,8 +1672,9 @@ _GLOBAL(__start_initialization_multiplatform)
         * Are we booted from a PROM Of-type client-interface ?
         */
        cmpldi  cr0,r5,0
-       bne     .__boot_from_prom               /* yes -> prom */
-
+       beq     1f
+       b       .__boot_from_prom               /* yes -> prom */
+1:
        /* Save parameters */
        mr      r31,r3
        mr      r30,r4
@@ -1701,7 +1702,7 @@ _GLOBAL(__start_initialization_multiplatform)
        bl      .__mmu_off
        b       .__after_prom_start
 
-_STATIC(__boot_from_prom)
+_INIT_STATIC(__boot_from_prom)
        /* Save parameters */
        mr      r31,r3
        mr      r30,r4
@@ -1768,9 +1769,10 @@ _STATIC(__after_prom_start)
                                        /*      the source addr          */
 
        cmpdi   r4,0                    /* In some cases the loader may  */
-       beq     .start_here_multiplatform /* have already put us at zero */
+       bne     1f
+       b       .start_here_multiplatform /* have already put us at zero */
                                        /* so we can skip the copy.      */
-       LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
+1:     LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
        sub     r5,r5,r27
 
        li      r6,0x100                /* Start offset, the first 0x100 */
@@ -1957,7 +1959,7 @@ _GLOBAL(enable_64b_mode)
 /*
  * This is where the main kernel code starts.
  */
-_STATIC(start_here_multiplatform)
+_INIT_STATIC(start_here_multiplatform)
        /* get a new offset, now that the kernel has moved. */
        bl      .reloc_offset
        mr      r26,r3
@@ -2019,7 +2021,7 @@ _STATIC(start_here_multiplatform)
        b       .       /* prevent speculative execution */
        
        /* This is where all platforms converge execution */
-_STATIC(start_here_common)
+_INIT_STATIC(start_here_common)
        /* relocation is on at this point */
 
        /* The following code sets up the SP and TOC now that we are */
index e708ab7ca9e845968a6b71d910ecbaaa3f64c6e2..8533de50347d5284b23cbe0538673ba74b6b95fe 100644 (file)
@@ -301,9 +301,19 @@ _GLOBAL(_tlbie)
        mfspr   r4,SPRN_MMUCR
        mfspr   r5,SPRN_PID                     /* Get PID */
        rlwimi  r4,r5,0,24,31                   /* Set TID */
-       mtspr   SPRN_MMUCR,r4
 
+       /* We have to run the search with interrupts disabled, even critical
+        * and debug interrupts (in fact the only critical exceptions we have
+        * are debug and machine check).  Otherwise  an interrupt which causes
+        * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
+       mfmsr   r5
+       lis     r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
+       addi    r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
+       andc    r6,r5,r6
+       mtmsr   r6
+       mtspr   SPRN_MMUCR,r4
        tlbsx.  r3, 0, r3
+       mtmsr   r5
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64,
index a97e23ac197639bd17eda467be127214f863af38..291ffbc360c9a023f30a6b40b4c77b9d272ebb31 100644 (file)
@@ -313,6 +313,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
 
        dev->current_state = 4;         /* unknown power state */
        dev->error_state = pci_channel_io_normal;
+       dev->dma_mask = 0xffffffff;
 
        if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
                /* a PCI-PCI bridge */
index f1789578747aa340c7cf3cc7cc006f3f8ef39a98..a47151e806cae072c1836b49f4c3c8630a4c2bd0 100644 (file)
@@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
 
 #ifdef CONFIG_PPC_MM_SLICES
        /* We only prefault standard pages for now */
-       if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
+       if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
                return;
 #endif
 
index b0697017d0e8dcd10e8f80bf9e817cf53dc92f89..a73d2d700973e4cd14cda75800484de3979cf639 100644 (file)
@@ -69,20 +69,9 @@ static inline void slb_shadow_update(unsigned long ea,
        smp_wmb();
 }
 
-static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags,
-                                       unsigned long entry)
+static inline void slb_shadow_clear(unsigned long entry)
 {
-       /*
-        * Updating the shadow buffer before writing the SLB ensures
-        * we don't get a stale entry here if we get preempted by PHYP
-        * between these two statements.
-        */
-       slb_shadow_update(ea, flags, entry);
-
-       asm volatile("slbmte  %0,%1" :
-                    : "r" (mk_vsid_data(ea, flags)),
-                      "r" (mk_esid_data(ea, entry))
-                    : "memory" );
+       get_slb_shadow()->save_area[entry].esid = 0;
 }
 
 void slb_flush_and_rebolt(void)
@@ -100,11 +89,13 @@ void slb_flush_and_rebolt(void)
        vflags = SLB_VSID_KERNEL | vmalloc_llp;
 
        ksp_esid_data = mk_esid_data(get_paca()->kstack, 2);
-       if ((ksp_esid_data & ESID_MASK) == PAGE_OFFSET)
+       if ((ksp_esid_data & ESID_MASK) == PAGE_OFFSET) {
                ksp_esid_data &= ~SLB_ESID_V;
-
-       /* Only third entry (stack) may change here so only resave that */
-       slb_shadow_update(get_paca()->kstack, lflags, 2);
+               slb_shadow_clear(2);
+       } else {
+               /* Update stack entry; others don't change */
+               slb_shadow_update(get_paca()->kstack, lflags, 2);
+       }
 
        /* We need to do this all in asm, so we're sure we don't touch
         * the stack between the slbia and rebolting it. */
@@ -235,16 +226,12 @@ void slb_initialize(void)
        vflags = SLB_VSID_KERNEL | vmalloc_llp;
 
        /* Invalidate the entire SLB (even slot 0) & all the ERATS */
-       asm volatile("isync":::"memory");
-       asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
-       asm volatile("isync; slbia; isync":::"memory");
-       create_shadowed_slbe(PAGE_OFFSET, lflags, 0);
-
-       create_shadowed_slbe(VMALLOC_START, vflags, 1);
-
-       /* We don't bolt the stack for the time being - we're in boot,
-        * so the stack is in the bolted segment.  By the time it goes
-        * elsewhere, we'll call _switch() which will bolt in the new
-        * one. */
-       asm volatile("isync":::"memory");
+       slb_shadow_update(PAGE_OFFSET, lflags, 0);
+       asm volatile("isync; slbia; sync; slbmte  %0,%1; isync" ::
+                    "r" (get_slb_shadow()->save_area[0].vsid),
+                    "r" (get_slb_shadow()->save_area[0].esid) : "memory");
+
+       slb_shadow_update(VMALLOC_START, vflags, 1);
+
+       slb_flush_and_rebolt();
 }
index f833dba2a0287ea06218f180620b8634300a58e7..d5fd3909d13a2cb45c01b2c56d236b67ea39b9a5 100644 (file)
@@ -405,6 +405,8 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
 
        if (len > mm->task_size)
                return -ENOMEM;
+       if (len & ((1ul << pshift) - 1))
+               return -EINVAL;
        if (fixed && (addr & ((1ul << pshift) - 1)))
                return -EINVAL;
        if (fixed && addr > (mm->task_size - len))
index b39cb52c6fb90290c2c6ca368f22f88dc331ddf4..2c8e641a739b5ac4ef3f66a0f2f48025d27332eb 100644 (file)
@@ -106,7 +106,6 @@ static struct of_device_id mpc832x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
-       { .type = "mdio", },
        {},
 };
 
index b2b28a44738c901a0faf6f4efbf762dee4b03f57..090906170a41ebed91c8c38c06da1d0b51456ac5 100644 (file)
@@ -70,7 +70,6 @@ static struct of_device_id mpc832x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
-       { .type = "mdio", },
        {},
 };
 
index 0e615fd65c1fd1050c91a833a920fa03945f834d..84b58934aafde7580cc15a118d333ec8efbfd3e1 100644 (file)
@@ -113,7 +113,6 @@ static struct of_device_id mpc836x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
-       { .type = "mdio", },
        {},
 };
 
index e8003bf00c9a2d87fe0784260abdfd251399eeb5..be25ecd911ba05263060d86c7751822c6d8bbf4e 100644 (file)
@@ -142,7 +142,6 @@ static struct of_device_id mpc85xx_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
        { .type = "qe", },
-       { .type = "mdio", },
        {},
 };
 
index 90124228b8f43c37bd02f06e927402d29a5c058c..095a30304c56861b8259cf776a9870907238083d 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/spu_priv1.h>
 #include <asm/xmon.h>
 #include <asm/prom.h>
-#include "spu_priv1_mmio.h"
 
 const struct spu_management_ops *spu_management_ops;
 EXPORT_SYMBOL_GPL(spu_management_ops);
@@ -636,138 +635,6 @@ static ssize_t spu_stat_show(struct sys_device *sysdev, char *buf)
 
 static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL);
 
-/* Hardcoded affinity idxs for QS20 */
-#define SPES_PER_BE 8
-static int QS20_reg_idxs[SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
-static int QS20_reg_memory[SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
-
-static struct spu *spu_lookup_reg(int node, u32 reg)
-{
-       struct spu *spu;
-
-       list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
-               if (*(u32 *)get_property(spu_devnode(spu), "reg", NULL) == reg)
-                       return spu;
-       }
-       return NULL;
-}
-
-static void init_aff_QS20_harcoded(void)
-{
-       int node, i;
-       struct spu *last_spu, *spu;
-       u32 reg;
-
-       for (node = 0; node < MAX_NUMNODES; node++) {
-               last_spu = NULL;
-               for (i = 0; i < SPES_PER_BE; i++) {
-                       reg = QS20_reg_idxs[i];
-                       spu = spu_lookup_reg(node, reg);
-                       if (!spu)
-                               continue;
-                       spu->has_mem_affinity = QS20_reg_memory[reg];
-                       if (last_spu)
-                               list_add_tail(&spu->aff_list,
-                                               &last_spu->aff_list);
-                       last_spu = spu;
-               }
-       }
-}
-
-static int of_has_vicinity(void)
-{
-       struct spu* spu;
-
-       spu = list_entry(cbe_spu_info[0].spus.next, struct spu, cbe_list);
-       return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
-}
-
-static struct spu *aff_devnode_spu(int cbe, struct device_node *dn)
-{
-       struct spu *spu;
-
-       list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list)
-               if (spu_devnode(spu) == dn)
-                       return spu;
-       return NULL;
-}
-
-static struct spu *
-aff_node_next_to(int cbe, struct device_node *target, struct device_node *avoid)
-{
-       struct spu *spu;
-       const phandle *vic_handles;
-       int lenp, i;
-
-       list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list) {
-               if (spu_devnode(spu) == avoid)
-                       continue;
-               vic_handles = get_property(spu_devnode(spu), "vicinity", &lenp);
-               for (i=0; i < (lenp / sizeof(phandle)); i++) {
-                       if (vic_handles[i] == target->linux_phandle)
-                               return spu;
-               }
-       }
-       return NULL;
-}
-
-static void init_aff_fw_vicinity_node(int cbe)
-{
-       struct spu *spu, *last_spu;
-       struct device_node *vic_dn, *last_spu_dn;
-       phandle avoid_ph;
-       const phandle *vic_handles;
-       const char *name;
-       int lenp, i, added, mem_aff;
-
-       last_spu = list_entry(cbe_spu_info[cbe].spus.next, struct spu, cbe_list);
-       avoid_ph = 0;
-       for (added = 1; added < cbe_spu_info[cbe].n_spus; added++) {
-               last_spu_dn = spu_devnode(last_spu);
-               vic_handles = get_property(last_spu_dn, "vicinity", &lenp);
-
-               for (i = 0; i < (lenp / sizeof(phandle)); i++) {
-                       if (vic_handles[i] == avoid_ph)
-                               continue;
-
-                       vic_dn = of_find_node_by_phandle(vic_handles[i]);
-                       if (!vic_dn)
-                               continue;
-
-                       name = get_property(vic_dn, "name", NULL);
-                       if (strcmp(name, "spe") == 0) {
-                               spu = aff_devnode_spu(cbe, vic_dn);
-                               avoid_ph = last_spu_dn->linux_phandle;
-                       }
-                       else {
-                               mem_aff = strcmp(name, "mic-tm") == 0;
-                               spu = aff_node_next_to(cbe, vic_dn, last_spu_dn);
-                               if (!spu)
-                                       continue;
-                               if (mem_aff) {
-                                       last_spu->has_mem_affinity = 1;
-                                       spu->has_mem_affinity = 1;
-                               }
-                               avoid_ph = vic_dn->linux_phandle;
-                       }
-                       list_add_tail(&spu->aff_list, &last_spu->aff_list);
-                       last_spu = spu;
-                       break;
-               }
-       }
-}
-
-static void init_aff_fw_vicinity(void)
-{
-       int cbe;
-
-       /* sets has_mem_affinity for each spu, as long as the
-        * spu->aff_list list, linking each spu to its neighbors
-        */
-       for (cbe = 0; cbe < MAX_NUMNODES; cbe++)
-               init_aff_fw_vicinity_node(cbe);
-}
-
 static int __init init_spu_base(void)
 {
        int i, ret = 0;
@@ -811,13 +678,7 @@ static int __init init_spu_base(void)
        mutex_unlock(&spu_full_list_mutex);
        spu_add_sysdev_attr(&attr_stat);
 
-       if (of_has_vicinity()) {
-               init_aff_fw_vicinity();
-       } else {
-               long root = of_get_flat_dt_root();
-               if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
-                       init_aff_QS20_harcoded();
-       }
+       spu_init_affinity();
 
        return 0;
 
index 75ed50fcc3dbaf70903fc74b00ab75b3e7d99ad3..5eb88346181acd58fac6742ff895315894a4759a 100644 (file)
@@ -361,8 +361,171 @@ static int of_destroy_spu(struct spu *spu)
        return 0;
 }
 
+/* Hardcoded affinity idxs for qs20 */
+#define QS20_SPES_PER_BE 8
+static int qs20_reg_idxs[QS20_SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
+static int qs20_reg_memory[QS20_SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
+
+static struct spu *spu_lookup_reg(int node, u32 reg)
+{
+       struct spu *spu;
+       u32 *spu_reg;
+
+       list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
+               spu_reg = (u32*)of_get_property(spu_devnode(spu), "reg", NULL);
+               if (*spu_reg == reg)
+                       return spu;
+       }
+       return NULL;
+}
+
+static void init_affinity_qs20_harcoded(void)
+{
+       int node, i;
+       struct spu *last_spu, *spu;
+       u32 reg;
+
+       for (node = 0; node < MAX_NUMNODES; node++) {
+               last_spu = NULL;
+               for (i = 0; i < QS20_SPES_PER_BE; i++) {
+                       reg = qs20_reg_idxs[i];
+                       spu = spu_lookup_reg(node, reg);
+                       if (!spu)
+                               continue;
+                       spu->has_mem_affinity = qs20_reg_memory[reg];
+                       if (last_spu)
+                               list_add_tail(&spu->aff_list,
+                                               &last_spu->aff_list);
+                       last_spu = spu;
+               }
+       }
+}
+
+static int of_has_vicinity(void)
+{
+       struct spu* spu;
+
+       spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list);
+       return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
+}
+
+static struct spu *devnode_spu(int cbe, struct device_node *dn)
+{
+       struct spu *spu;
+
+       list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list)
+               if (spu_devnode(spu) == dn)
+                       return spu;
+       return NULL;
+}
+
+static struct spu *
+neighbour_spu(int cbe, struct device_node *target, struct device_node *avoid)
+{
+       struct spu *spu;
+       struct device_node *spu_dn;
+       const phandle *vic_handles;
+       int lenp, i;
+
+       list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list) {
+               spu_dn = spu_devnode(spu);
+               if (spu_dn == avoid)
+                       continue;
+               vic_handles = of_get_property(spu_dn, "vicinity", &lenp);
+               for (i=0; i < (lenp / sizeof(phandle)); i++) {
+                       if (vic_handles[i] == target->linux_phandle)
+                               return spu;
+               }
+       }
+       return NULL;
+}
+
+static void init_affinity_node(int cbe)
+{
+       struct spu *spu, *last_spu;
+       struct device_node *vic_dn, *last_spu_dn;
+       phandle avoid_ph;
+       const phandle *vic_handles;
+       const char *name;
+       int lenp, i, added;
+
+       last_spu = list_first_entry(&cbe_spu_info[cbe].spus, struct spu,
+                                                               cbe_list);
+       avoid_ph = 0;
+       for (added = 1; added < cbe_spu_info[cbe].n_spus; added++) {
+               last_spu_dn = spu_devnode(last_spu);
+               vic_handles = of_get_property(last_spu_dn, "vicinity", &lenp);
+
+               /*
+                * Walk through each phandle in vicinity property of the spu
+                * (tipically two vicinity phandles per spe node)
+                */
+               for (i = 0; i < (lenp / sizeof(phandle)); i++) {
+                       if (vic_handles[i] == avoid_ph)
+                               continue;
+
+                       vic_dn = of_find_node_by_phandle(vic_handles[i]);
+                       if (!vic_dn)
+                               continue;
+
+                       /* a neighbour might be spe, mic-tm, or bif0 */
+                       name = of_get_property(vic_dn, "name", NULL);
+                       if (!name)
+                               continue;
+
+                       if (strcmp(name, "spe") == 0) {
+                               spu = devnode_spu(cbe, vic_dn);
+                               avoid_ph = last_spu_dn->linux_phandle;
+                       } else {
+                               /*
+                                * "mic-tm" and "bif0" nodes do not have
+                                * vicinity property. So we need to find the
+                                * spe which has vic_dn as neighbour, but
+                                * skipping the one we came from (last_spu_dn)
+                                */
+                               spu = neighbour_spu(cbe, vic_dn, last_spu_dn);
+                               if (!spu)
+                                       continue;
+                               if (!strcmp(name, "mic-tm")) {
+                                       last_spu->has_mem_affinity = 1;
+                                       spu->has_mem_affinity = 1;
+                               }
+                               avoid_ph = vic_dn->linux_phandle;
+                       }
+
+                       list_add_tail(&spu->aff_list, &last_spu->aff_list);
+                       last_spu = spu;
+                       break;
+               }
+       }
+}
+
+static void init_affinity_fw(void)
+{
+       int cbe;
+
+       for (cbe = 0; cbe < MAX_NUMNODES; cbe++)
+               init_affinity_node(cbe);
+}
+
+static int __init init_affinity(void)
+{
+       if (of_has_vicinity()) {
+               init_affinity_fw();
+       } else {
+               long root = of_get_flat_dt_root();
+               if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
+                       init_affinity_qs20_harcoded();
+               else
+                       printk("No affinity configuration found");
+       }
+
+       return 0;
+}
+
 const struct spu_management_ops spu_management_of_ops = {
        .enumerate_spus = of_enumerate_spus,
        .create_spu = of_create_spu,
        .destroy_spu = of_destroy_spu,
+       .init_affinity = init_affinity,
 };
index dd2c6688c8aaa6f0bad47ab8b160856b24c34290..027ac32cc63659c8c2af89270041742dcb96e345 100644 (file)
@@ -45,6 +45,7 @@ asmlinkage long sys_spu_create(const char __user *name,
        if (owner && try_module_get(owner)) {
                if (flags & SPU_CREATE_AFFINITY_SPU) {
                        neighbor = fget_light(neighbor_fd, &fput_needed);
+                       ret = -EBADF;
                        if (neighbor) {
                                ret = spufs_calls.create_thread(name, flags,
                                                                mode, neighbor);
index d4fc74f7bb15a09eb6d2f4b357ac574c9def5e7b..67144d1d14056de4a88076830cc40a274ce5980d 100644 (file)
@@ -1,5 +1,5 @@
 config PPC_PS3
-       bool "Sony PS3 (incomplete)"
+       bool "Sony PS3"
        depends on PPC_MULTIPLATFORM && PPC64
        select PPC_CELL
        select USB_ARCH_HAS_OHCI
@@ -10,10 +10,10 @@ config PPC_PS3
        select MEMORY_HOTPLUG
        help
          This option enables support for the Sony PS3 game console
-         and other platforms using the PS3 hypervisor.
-         Support for this platform is not yet complete, so
-         enabling this will not result in a bootable kernel on a
-         PS3 system.
+         and other platforms using the PS3 hypervisor.  Enabling this
+         option will allow building otheros.bld, a kernel image suitable
+         for programming into flash memory, and vmlinux, a kernel image
+         suitable for loading via kexec.
 
 menu "PS3 Platform Options"
        depends on PPC_PS3
index 825ebb2cbc2adbb014d31a4172358b5751d2dec8..ce15cada88d4ed992b478d828e8f896b0e6f85be 100644 (file)
@@ -273,55 +273,58 @@ static int ps3stor_wait_for_completion(u64 dev_id, u64 tag,
 
 static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
 {
+       int error = -ENODEV;
        int result;
        const u64 notification_dev_id = (u64)-1LL;
        const unsigned int timeout = HZ;
        u64 lpar;
        u64 tag;
+       void *buf;
+       enum ps3_notify_type {
+               notify_device_ready = 0,
+               notify_region_probe = 1,
+               notify_region_update = 2,
+       };
        struct {
                u64 operation_code;     /* must be zero */
-               u64 event_mask;         /* 1 = device ready */
+               u64 event_mask;         /* OR of 1UL << enum ps3_notify_type */
        } *notify_cmd;
        struct {
-               u64 event_type;         /* notify_device_ready */
+               u64 event_type;         /* enum ps3_notify_type */
                u64 bus_id;
                u64 dev_id;
                u64 dev_type;
                u64 dev_port;
        } *notify_event;
-       enum {
-               notify_device_ready = 1
-       };
 
        pr_debug(" -> %s:%u: bus_id %u, dev_id %u, dev_type %u\n", __func__,
                 __LINE__, repo->bus_id, repo->dev_id, repo->dev_type);
 
-       notify_cmd = kzalloc(512, GFP_KERNEL);
-       notify_event = (void *)notify_cmd;
-       if (!notify_cmd)
+       buf = kzalloc(512, GFP_KERNEL);
+       if (!buf)
                return -ENOMEM;
 
-       lpar = ps3_mm_phys_to_lpar(__pa(notify_cmd));
+       lpar = ps3_mm_phys_to_lpar(__pa(buf));
+       notify_cmd = buf;
+       notify_event = buf;
 
        result = lv1_open_device(repo->bus_id, notification_dev_id, 0);
        if (result) {
                printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,
                       __LINE__, ps3_result(result));
-               result = -ENODEV;
                goto fail_free;
        }
 
        /* Setup and write the request for device notification. */
 
-       notify_cmd->operation_code = 0; /* must be zero */
-       notify_cmd->event_mask = 0x01;  /* device ready */
+       notify_cmd->operation_code = 0; /* must be zero */
+       notify_cmd->event_mask = 1UL << notify_region_probe;
 
        result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
                                   &tag);
        if (result) {
                printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,
                       ps3_result(result));
-               result = -ENODEV;
                goto fail_close;
        }
 
@@ -332,13 +335,11 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
        if (result) {
                printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,
                       __LINE__, ps3_result(result));
-               result = -ENODEV;
                goto fail_close;
        }
 
        /* Loop here processing the requested notification events. */
 
-       result = -ENODEV;
        while (1) {
                memset(notify_event, 0, sizeof(*notify_event));
 
@@ -358,7 +359,7 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
                        break;
                }
 
-               if (notify_event->event_type != notify_device_ready ||
+               if (notify_event->event_type != notify_region_probe ||
                    notify_event->bus_id != repo->bus_id) {
                        pr_debug("%s:%u: bad notify_event: event %lu, "
                                 "dev_id %lu, dev_type %lu\n",
@@ -371,7 +372,7 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
                    notify_event->dev_type == repo->dev_type) {
                        pr_debug("%s:%u: device ready: dev_id %u\n", __func__,
                                 __LINE__, repo->dev_id);
-                       result = 0;
+                       error = 0;
                        break;
                }
 
@@ -386,9 +387,9 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
 fail_close:
        lv1_close_device(repo->bus_id, notification_dev_id);
 fail_free:
-       kfree(notify_cmd);
+       kfree(buf);
        pr_debug(" <- %s:%u\n", __func__, __LINE__);
-       return result;
+       return error;
 }
 
 static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
index 502d80ed982bf657b6e08cc2ba511ef3baade432..ac2a4b8a4c1424270954c51b96b7e1d687140384 100644 (file)
@@ -414,10 +414,16 @@ static int __init ps3_enumerate_spus(int (*fn)(void *data))
        return num_resource_id;
 }
 
+static int ps3_init_affinity(void)
+{
+       return 0;
+}
+
 const struct spu_management_ops spu_management_ps3_ops = {
        .enumerate_spus = ps3_enumerate_spus,
        .create_spu = ps3_create_spu,
        .destroy_spu = ps3_destroy_spu,
+       .init_affinity = ps3_init_affinity,
 };
 
 /* spu_priv1_ops */
index 0da55368655c90a0018504d79c0125fd51326e25..a22e1f4d94c82edd1c3ee92d7ea491b82a716b30 100644 (file)
@@ -237,9 +237,19 @@ _GLOBAL(_tlbie)
        mfspr   r4,SPRN_MMUCR
        mfspr   r5,SPRN_PID                     /* Get PID */
        rlwimi  r4,r5,0,24,31                   /* Set TID */
-       mtspr   SPRN_MMUCR,r4
 
+       /* We have to run the search with interrupts disabled, even critical
+        * and debug interrupts (in fact the only critical exceptions we have
+        * are debug and machine check).  Otherwise  an interrupt which causes
+        * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */
+       mfmsr   r5
+       lis     r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha
+       addi    r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
+       andc    r6,r5,r6
+       mtmsr   r6
+       mtspr   SPRN_MMUCR,r4
        tlbsx.  r3, 0, r3
+       mtmsr   r5
        bne     10f
        sync
        /* There are only 64 TLB entries, so r3 < 64,
index 098c62c29f9c3cda9b4292da5790ae1265be259d..b71132166f606343f810e47387c7a26b4918fced 100644 (file)
@@ -109,10 +109,6 @@ config HOTPLUG_CPU
          can be controlled through /sys/devices/system/cpu/cpu#.
          Say N if you want to disable CPU hotplug.
 
-config DEFAULT_MIGRATION_COST
-       int
-       default "1000000"
-
 config MATHEMU
        bool "IEEE FPU emulation"
        depends on MARCH_G5
index 8e1ea1c4012846a8a8d2f31f45f289ceabf39e6f..ad4ca75c0f044dd66b7fdbbfc502f5cd4d0a7adb 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/parser.h>
 #include <linux/sysfs.h>
 #include <linux/module.h>
+#include <linux/seq_file.h>
+#include <linux/mount.h>
 #include <asm/ebcdic.h>
 #include "hypfs.h"
 
@@ -256,6 +258,15 @@ static int hypfs_parse_options(char *options, struct super_block *sb)
        return 0;
 }
 
+static int hypfs_show_options(struct seq_file *s, struct vfsmount *mnt)
+{
+       struct hypfs_sb_info *hypfs_info = mnt->mnt_sb->s_fs_info;
+
+       seq_printf(s, ",uid=%u", hypfs_info->uid);
+       seq_printf(s, ",gid=%u", hypfs_info->gid);
+       return 0;
+}
+
 static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
 {
        struct inode *root_inode;
@@ -459,6 +470,7 @@ static struct file_system_type hypfs_type = {
 static struct super_operations hypfs_s_ops = {
        .statfs         = simple_statfs,
        .drop_inode     = hypfs_drop_inode,
+       .show_options   = hypfs_show_options,
 };
 
 static decl_subsys(s390, NULL, NULL);
index 1312bfaff306866319fcbb8dec3caf06f933c0d1..9fd8030cc54ff2e48b05004ddf34e577fb494a85 100644 (file)
@@ -195,6 +195,11 @@ ENTRY(startup_64)
        movl    %eax, %ds
        movl    %eax, %es
        movl    %eax, %ss
+       movl    %eax, %fs
+       movl    %eax, %gs
+       lldt    %ax
+       movl    $0x20, %eax
+       ltr     %ax
 
        /* Compute the decompressed kernel start address.  It is where
         * we were loaded at aligned to a 2M boundary. %rbp contains the
@@ -295,6 +300,8 @@ gdt:
        .quad   0x0000000000000000      /* NULL descriptor */
        .quad   0x00af9a000000ffff      /* __KERNEL_CS */
        .quad   0x00cf92000000ffff      /* __KERNEL_DS */
+       .quad   0x0080890000000000      /* TS descriptor */
+       .quad   0x0000000000000000      /* TS continued */
 gdt_end:
        .bss
 /* Stack for uncompression */
index 900ff38d68de5418d2fe6b6d34937da43035050a..925758dbca0c6016b52e91ab90e7503c90ea08c0 100644 (file)
@@ -791,10 +791,8 @@ static void setup_APIC_timer(unsigned int clocks)
 
        /* wait for irq slice */
        if (hpet_address && hpet_use_timer) {
-               int trigger = hpet_readl(HPET_T0_CMP);
-               while (hpet_readl(HPET_COUNTER) >= trigger)
-                       /* do nothing */ ;
-               while (hpet_readl(HPET_COUNTER) <  trigger)
+               u32 trigger = hpet_readl(HPET_T0_CMP);
+               while (hpet_readl(HPET_T0_CMP) == trigger)
                        /* do nothing */ ;
        } else {
                int c1, c2;
index 050141c0602bbd10d6a429d0016ccd8e6fd3ad83..f57f8b901912dba2829ebd3ced20ec754c61a813 100644 (file)
@@ -800,12 +800,15 @@ static struct irq_chip ioapic_chip;
 
 static void ioapic_register_intr(int irq, unsigned long trigger)
 {
-       if (trigger)
+       if (trigger) {
+               irq_desc[irq].status |= IRQ_LEVEL;
                set_irq_chip_and_handler_name(irq, &ioapic_chip,
                                              handle_fasteoi_irq, "fasteoi");
-       else
+       } else {
+               irq_desc[irq].status &= ~IRQ_LEVEL;
                set_irq_chip_and_handler_name(irq, &ioapic_chip,
                                              handle_edge_irq, "edge");
+       }
 }
 
 static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq,
index ba16c968ca3f8a8a4f37c1862b1a9caa35261204..71da01e73f038162fe955181baad38f16de1126e 100644 (file)
@@ -367,16 +367,15 @@ static inline struct iommu_table *find_iommu_table(struct device *dev)
 
        pdev = to_pci_dev(dev);
 
-       /* is the device behind a bridge? */
-       if (unlikely(pdev->bus->parent))
-               pbus = pdev->bus->parent;
-       else
-               pbus = pdev->bus;
+       pbus = pdev->bus;
+
+       /* is the device behind a bridge? Look for the root bus */
+       while (pbus->parent)
+               pbus = pbus->parent;
 
        tbl = pci_iommu(pbus);
 
-       BUG_ON(pdev->bus->parent &&
-              (tbl->it_busno != pdev->bus->parent->number));
+       BUG_ON(tbl && (tbl->it_busno != pbus->number));
 
        return tbl;
 }
index 0ea0ddc875a7128203b8a0c8a7c4f5784fb2b680..c22981fa2f3a95240f3a4c99d00da41d1b7392ec 100644 (file)
@@ -124,6 +124,8 @@ ENDPROC(__memcpy)
        .quad memcpy
        .quad 1b
        .byte X86_FEATURE_REP_GOOD
-       .byte .Lfinal - memcpy
+       /* Replace only beginning, memcpy is used to apply alternatives, so it
+        * is silly to overwrite itself with nops - reboot is only outcome... */
+       .byte 2b - 1b
        .byte 2b - 1b
        .previous
index 7e161c698af47cb98a766c8253c8596cfeeb4b74..10b9809ce821fa36be3dfebdb994ad635c2cf2ff 100644 (file)
@@ -75,7 +75,8 @@ static void flush_kernel_map(void *arg)
 
        /* When clflush is available always use it because it is
           much cheaper than WBINVD. */
-       if (!cpu_has_clflush)
+       /* clflush is still broken. Disable for now. */
+       if (1 || !cpu_has_clflush)
                asm volatile("wbinvd" ::: "memory");
        else list_for_each_entry(pg, l, lru) {
                void *adr = page_address(pg);
index 65d82736987e600b642646f4d14e515b4fc020fc..4095e4d66a1d9345b236ee514260db23cf94c64b 100644 (file)
@@ -66,13 +66,13 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
 
        switch (len) {
        case 1:
-               *value = readb(addr + reg);
+               *value = mmio_config_readb(addr + reg);
                break;
        case 2:
-               *value = readw(addr + reg);
+               *value = mmio_config_readw(addr + reg);
                break;
        case 4:
-               *value = readl(addr + reg);
+               *value = mmio_config_readl(addr + reg);
                break;
        }
 
@@ -94,13 +94,13 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
 
        switch (len) {
        case 1:
-               writeb(value, addr + reg);
+               mmio_config_writeb(addr + reg, value);
                break;
        case 2:
-               writew(value, addr + reg);
+               mmio_config_writew(addr + reg, value);
                break;
        case 4:
-               writel(value, addr + reg);
+               mmio_config_writel(addr + reg, value);
                break;
        }
 
diff --git a/arch/x86_64/vdso/.gitignore b/arch/x86_64/vdso/.gitignore
new file mode 100644 (file)
index 0000000..f8b69d8
--- /dev/null
@@ -0,0 +1 @@
+vdso.lds
index 8c2caff87cc342819d53eb893f82269ea2205dec..a15845c164f298c97854e21e1c7d79019af646a6 100644 (file)
@@ -3047,6 +3047,10 @@ static inline void blk_partition_remap(struct bio *bio)
 
                bio->bi_sector += p->start_sect;
                bio->bi_bdev = bdev->bd_contains;
+
+               blk_add_trace_remap(bdev_get_queue(bio->bi_bdev), bio,
+                                   bdev->bd_dev, bio->bi_sector,
+                                   bio->bi_sector - p->start_sect);
        }
 }
 
index 9c4bd220c44fdf30381046b169c336365f10214a..86fd142f4bf3929731a7b43ef3dc1d1d825f696d 100644 (file)
@@ -1192,6 +1192,7 @@ static int asus_hotk_get_info(void)
                        break;
                default:
                        kfree(model);
+                       model = NULL;
                        break;
                }
        }
index 81651032791b32364e3ed3b4cc45c0341a9db355..d7b499fe0cd932fec5f8c6a9c7237cd38b962acc 100644 (file)
@@ -113,7 +113,7 @@ struct acpi_battery_info {
        acpi_string oem_info;
 };
 
-enum acpi_battery_files{
+enum acpi_battery_files {
        ACPI_BATTERY_INFO = 0,
        ACPI_BATTERY_STATE,
        ACPI_BATTERY_ALARM,
@@ -129,13 +129,14 @@ struct acpi_battery_flags {
 };
 
 struct acpi_battery {
-       struct mutex mutex;
        struct acpi_device *device;
        struct acpi_battery_flags flags;
        struct acpi_buffer bif_data;
        struct acpi_buffer bst_data;
+       struct mutex lock;
        unsigned long alarm;
        unsigned long update_time[ACPI_BATTERY_NUMFILES];
+
 };
 
 inline int acpi_battery_present(struct acpi_battery *battery)
@@ -235,10 +236,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
                return 0;
 
        /* Evaluate _BIF */
-
-       status =
-           acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL,
-                                &buffer);
+       mutex_lock(&battery->lock);
+       status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF",
+                                     NULL, &buffer);
+       mutex_unlock(&battery->lock);
        if (ACPI_FAILURE(status)) {
                ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
                return -ENODEV;
@@ -285,10 +286,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
                return 0;
 
        /* Evaluate _BST */
-
-       status =
-           acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL,
-                                &buffer);
+       mutex_lock(&battery->lock);
+       status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST",
+                                     NULL, &buffer);
+       mutex_unlock(&battery->lock);
        if (ACPI_FAILURE(status)) {
                ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
                return -ENODEV;
@@ -336,9 +337,10 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery,
 
        arg0.integer.value = alarm;
 
-       status =
-           acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
+       mutex_lock(&battery->lock);
+       status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
                                 &arg_list, NULL);
+       mutex_unlock(&battery->lock);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
@@ -658,8 +660,6 @@ acpi_battery_write_alarm(struct file *file,
        if (!battery || (count > sizeof(alarm_string) - 1))
                return -EINVAL;
 
-       mutex_lock(&battery->mutex);
-
        result = acpi_battery_update(battery, 1, &update_result);
        if (result) {
                result = -ENODEV;
@@ -688,9 +688,7 @@ acpi_battery_write_alarm(struct file *file,
        acpi_battery_check_result(battery, result);
 
        if (!result)
-               result = count;
-
-       mutex_unlock(&battery->mutex);
+               return count;
 
        return result;
 }
@@ -714,8 +712,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
        int update_result = ACPI_BATTERY_NONE_UPDATE;
        int update = 0;
 
-       mutex_lock(&battery->mutex);
-
        update = (get_seconds() - battery->update_time[fid] >= update_time);
        update = (update | battery->flags.update[fid]);
 
@@ -733,7 +729,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
        result = acpi_read_funcs[fid].print(seq, result);
        acpi_battery_check_result(battery, result);
        battery->flags.update[fid] = result;
-       mutex_unlock(&battery->mutex);
        return result;
 }
 
@@ -897,10 +892,7 @@ static int acpi_battery_add(struct acpi_device *device)
        if (!battery)
                return -ENOMEM;
 
-       mutex_init(&battery->mutex);
-
-       mutex_lock(&battery->mutex);
-
+       mutex_init(&battery->lock);
        battery->device = device;
        strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
@@ -936,7 +928,6 @@ static int acpi_battery_add(struct acpi_device *device)
                kfree(battery);
        }
 
-       mutex_unlock(&battery->mutex);
 
        return result;
 }
@@ -951,8 +942,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
 
        battery = acpi_driver_data(device);
 
-       mutex_lock(&battery->mutex);
-
        status = acpi_remove_notify_handler(device->handle,
                                            ACPI_ALL_NOTIFY,
                                            acpi_battery_notify);
@@ -963,9 +952,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
 
        kfree(battery->bst_data.pointer);
 
-       mutex_unlock(&battery->mutex);
-
-       mutex_destroy(&battery->mutex);
+       mutex_destroy(&battery->lock);
 
        kfree(battery);
 
index 56a5b3fffeb364a14e8fe3ff7f5b9a1ff103f51e..6daf6088ac888329177f35e4f7258bc8dfa42ddb 100644 (file)
@@ -337,7 +337,7 @@ static void bay_notify(acpi_handle handle, u32 event, void *data)
        char *envp[] = { event_string, NULL };
 
        bay_dprintk(handle, "Bay event");
-       sprintf(event_string, "BAY_EVENT=%d\n", event);
+       sprintf(event_string, "BAY_EVENT=%d", event);
        kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
 }
 
index 6192c8be66df62587e0ee49e3af2a31b145b38bc..1dabdf4c07b36308e4ece7f7f3a0497ee4bb0c1c 100644 (file)
@@ -336,13 +336,13 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
 static void dock_event(struct dock_station *ds, u32 event, int num)
 {
        struct device *dev = &dock_device->dev;
-       char event_string[7];
+       char event_string[13];
        char *envp[] = { event_string, NULL };
 
        if (num == UNDOCK_EVENT)
-               sprintf(event_string, "UNDOCK");
+               sprintf(event_string, "EVENT=undock");
        else
-               sprintf(event_string, "DOCK");
+               sprintf(event_string, "EVENT=dock");
 
        /*
         * Indicate that the status of the dock station has
index 469f3f57f88133c43ad30f492fb8b7c28fd8658d..56bee9e065cf3e395e6680b4667cdaad5da45d84 100644 (file)
@@ -471,7 +471,6 @@ static void acpi_ec_gpe_query(void *ec_cxt)
                }
        }
        mutex_unlock(&ec->lock);
-       printk(KERN_ERR PREFIX "Handler for query 0x%x is not found!\n", value);
 }
 
 static u32 acpi_ec_gpe_handler(void *data)
@@ -665,30 +664,44 @@ acpi_ec_register_query_methods(acpi_handle handle, u32 level,
        return AE_OK;
 }
 
-static int ec_parse_device(struct acpi_ec *ec, acpi_handle handle)
+static acpi_status
+ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
 {
-       if (ACPI_FAILURE(acpi_walk_resources(handle, METHOD_NAME__CRS,
-                                    ec_parse_io_ports, ec)))
-               return -EINVAL;
+       acpi_status status;
+
+       struct acpi_ec *ec = context;
+       status = acpi_walk_resources(handle, METHOD_NAME__CRS,
+                                    ec_parse_io_ports, ec);
+       if (ACPI_FAILURE(status))
+               return status;
 
        /* Get GPE bit assignment (EC events). */
        /* TODO: Add support for _GPE returning a package */
-       if (ACPI_FAILURE(acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe)))
-               return -EINVAL;
-
-       /* Use the global lock for all EC transactions? */
-       acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
+       status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe);
+       if (ACPI_FAILURE(status))
+               return status;
 
        /* Find and register all query methods */
        acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1,
                            acpi_ec_register_query_methods, ec, NULL);
 
+       /* Use the global lock for all EC transactions? */
+       acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
+
        ec->handle = handle;
 
-       printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx",
+       printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
                          ec->gpe, ec->command_addr, ec->data_addr);
 
-       return 0;
+       return AE_CTRL_TERMINATE;
+}
+
+static void ec_remove_handlers(struct acpi_ec *ec)
+{
+       acpi_remove_address_space_handler(ec->handle,
+                                         ACPI_ADR_SPACE_EC,
+                                         &acpi_ec_space_handler);
+       acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
 }
 
 static int acpi_ec_add(struct acpi_device *device)
@@ -705,7 +718,8 @@ static int acpi_ec_add(struct acpi_device *device)
        if (!ec)
                return -ENOMEM;
 
-       if (ec_parse_device(ec, device->handle)) {
+       if (ec_parse_device(device->handle, 0, ec, NULL) !=
+           AE_CTRL_TERMINATE) {
                kfree(ec);
                return -EINVAL;
        }
@@ -713,16 +727,13 @@ static int acpi_ec_add(struct acpi_device *device)
        /* Check if we found the boot EC */
        if (boot_ec) {
                if (boot_ec->gpe == ec->gpe) {
-                       /* We might have incorrect info for GL at boot time */
-                       mutex_lock(&boot_ec->lock);
-                       boot_ec->global_lock = ec->global_lock;
-                       /* Copy handlers from new ec into boot ec */
-                       list_splice(&ec->list, &boot_ec->list);
-                       mutex_unlock(&boot_ec->lock);
-                       kfree(ec);
-                       ec = boot_ec;
+                       ec_remove_handlers(boot_ec);
+                       mutex_destroy(&boot_ec->lock);
+                       kfree(boot_ec);
+                       first_ec = boot_ec = NULL;
                }
-       } else
+       }
+       if (!first_ec)
                first_ec = ec;
        ec->handle = device->handle;
        acpi_driver_data(device) = ec;
@@ -734,14 +745,14 @@ static int acpi_ec_add(struct acpi_device *device)
 static int acpi_ec_remove(struct acpi_device *device, int type)
 {
        struct acpi_ec *ec;
-       struct acpi_ec_query_handler *handler;
+       struct acpi_ec_query_handler *handler, *tmp;
 
        if (!device)
                return -EINVAL;
 
        ec = acpi_driver_data(device);
        mutex_lock(&ec->lock);
-       list_for_each_entry(handler, &ec->list, node) {
+       list_for_each_entry_safe(handler, tmp, &ec->list, node) {
                list_del(&handler->node);
                kfree(handler);
        }
@@ -751,9 +762,6 @@ static int acpi_ec_remove(struct acpi_device *device, int type)
        if (ec == first_ec)
                first_ec = NULL;
 
-       /* Don't touch boot EC */
-       if (boot_ec != ec)
-               kfree(ec);
        return 0;
 }
 
@@ -817,9 +825,7 @@ static int acpi_ec_start(struct acpi_device *device)
        if (!ec)
                return -EINVAL;
 
-       /* Boot EC is already working */
-       if (ec != boot_ec)
-               ret = ec_install_handlers(ec);
+       ret = ec_install_handlers(ec);
 
        /* EC is fully operational, allow queries */
        atomic_set(&ec->query_pending, 0);
@@ -829,7 +835,6 @@ static int acpi_ec_start(struct acpi_device *device)
 
 static int acpi_ec_stop(struct acpi_device *device, int type)
 {
-       acpi_status status;
        struct acpi_ec *ec;
 
        if (!device)
@@ -838,21 +843,7 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
        ec = acpi_driver_data(device);
        if (!ec)
                return -EINVAL;
-
-       /* Don't touch boot EC */
-       if (ec == boot_ec)
-               return 0;
-
-       status = acpi_remove_address_space_handler(ec->handle,
-                                                  ACPI_ADR_SPACE_EC,
-                                                  &acpi_ec_space_handler);
-       if (ACPI_FAILURE(status))
-               return -ENODEV;
-
-       status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
-       if (ACPI_FAILURE(status))
-               return -ENODEV;
-
+       ec_remove_handlers(ec);
        return 0;
 }
 
@@ -868,18 +859,21 @@ int __init acpi_ec_ecdt_probe(void)
        /*
         * Generate a boot ec context
         */
-
        status = acpi_get_table(ACPI_SIG_ECDT, 1,
                                (struct acpi_table_header **)&ecdt_ptr);
-       if (ACPI_FAILURE(status))
-               goto error;
-
-       printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n");
-
-       boot_ec->command_addr = ecdt_ptr->control.address;
-       boot_ec->data_addr = ecdt_ptr->data.address;
-       boot_ec->gpe = ecdt_ptr->gpe;
-       boot_ec->handle = ACPI_ROOT_OBJECT;
+       if (ACPI_SUCCESS(status)) {
+               printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n\n");
+               boot_ec->command_addr = ecdt_ptr->control.address;
+               boot_ec->data_addr = ecdt_ptr->data.address;
+               boot_ec->gpe = ecdt_ptr->gpe;
+               boot_ec->handle = ACPI_ROOT_OBJECT;
+       } else {
+               printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
+               status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
+                                               boot_ec, NULL);
+               if (ACPI_FAILURE(status))
+                       goto error;
+       }
 
        ret = ec_install_handlers(boot_ec);
        if (!ret) {
index dfa5853b17f097555095c9b87668d03a39ba6bd8..95637a4ff782b1d5975e656a23dcd2559d0dbcb9 100644 (file)
@@ -108,7 +108,7 @@ static const struct file_operations acpi_system_event_ops = {
 };
 
 #ifdef CONFIG_NET
-unsigned int acpi_event_seqnum;
+static unsigned int acpi_event_seqnum;
 struct acpi_genl_event {
        acpi_device_class device_class;
        char bus_id[15];
index a898991f77cbcfb18fc41c481afeca1fc63f0697..a8634a0655fca429b0a52f3c43b8d57a8ccc3095 100644 (file)
@@ -969,11 +969,17 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
        }
 
        if (pr->flags.bm_check) {
-               /* bus mastering control is necessary */
                if (!pr->flags.bm_control) {
-                       /* In this case we enter C3 without bus mastering */
-                       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                               "C3 support without bus mastering control\n"));
+                       if (pr->flags.has_cst != 1) {
+                               /* bus mastering control is necessary */
+                               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                       "C3 support requires BM control\n"));
+                               return;
+                       } else {
+                               /* Here we enter C3 without bus mastering */
+                               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                       "C3 support without BM control\n"));
+                       }
                }
        } else {
                /*
index c4efc0c17f8f3029d244962be92482b30e36bcb4..463b0247cbc517c40567446df9446fff389c849b 100644 (file)
@@ -539,7 +539,7 @@ end:
 }
 
 int acpi_processor_preregister_performance(
-               struct acpi_processor_performance **performance)
+               struct acpi_processor_performance *performance)
 {
        int count, count_target;
        int retval = 0;
@@ -567,12 +567,12 @@ int acpi_processor_preregister_performance(
                        continue;
                }
 
-               if (!performance || !performance[i]) {
+               if (!performance || !percpu_ptr(performance, i)) {
                        retval = -EINVAL;
                        continue;
                }
 
-               pr->performance = performance[i];
+               pr->performance = percpu_ptr(performance, i);
                cpu_set(i, pr->performance->shared_cpu_map);
                if (acpi_processor_get_psd(pr)) {
                        retval = -EINVAL;
index f63813a358c57f37b96c9c0517f5b37b9d63ce4c..4c3fd4cdaf7382f6b04fb9b1470716c95454aea7 100644 (file)
@@ -474,8 +474,6 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context)
        return (AE_CTRL_TERMINATE);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_rs_match_vendor_resource)
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_walk_resources
index 7d8e78ea13a514c4969aaecc069b73f2a3b400d8..82c3a550016d82068798351123f5d2b429ef64d4 100644 (file)
@@ -1415,7 +1415,7 @@ static int acpi_sbs_update_run(struct acpi_sbs *sbs, int id, int data_type)
        char dir_name[32];
        int do_battery_init = 0, do_ac_init = 0;
        int old_remaining_capacity = 0;
-       int update_ac = 1, update_battery = 1;
+       int update_battery = 1;
        int up_tm = update_time;
 
        if (sbs_zombie(sbs)) {
@@ -1435,10 +1435,6 @@ static int acpi_sbs_update_run(struct acpi_sbs *sbs, int id, int data_type)
 
        sbs->run_cnt++;
 
-       if (!update_ac && !update_battery) {
-               goto end;
-       }
-
        old_ac_present = sbs->ac.ac_present;
 
        result = acpi_ac_get_present(sbs);
index 5b302c4e293f78dd734e9c322a6551f03c01b493..a9e3331fee5deade7a3e8047a3c9da980e103f25 100644 (file)
@@ -52,6 +52,8 @@ ACPI_MODULE_NAME("tbxface")
 /* Local prototypes */
 static acpi_status acpi_tb_load_namespace(void);
 
+static int no_auto_ssdt;
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_allocate_root_table
@@ -536,6 +538,10 @@ static acpi_status acpi_tb_load_namespace(void)
 
                ACPI_INFO((AE_INFO, "Table DSDT replaced by host OS"));
                acpi_tb_print_table_header(0, table);
+
+               if (no_auto_ssdt == 0) {
+                       printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\"");
+               }
        }
 
        status =
@@ -577,6 +583,11 @@ static acpi_status acpi_tb_load_namespace(void)
                        continue;
                }
 
+               if (no_auto_ssdt) {
+                       printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n");
+                       continue;
+               }
+
                /* Ignore errors while loading tables, get as many as possible */
 
                (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
@@ -622,3 +633,15 @@ acpi_status acpi_load_tables(void)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_load_tables)
+
+
+static int __init acpi_no_auto_ssdt_setup(char *s) {
+
+        printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n");
+
+        no_auto_ssdt = 1;
+
+        return 1;
+}
+
+__setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup);
index 5a62de1b7f2a0e040f1d32a537bc8693a37b0584..1e06159fd9c4a529435615646aedce6c77c0fa96 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/dmi.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/proc_fs.h>
@@ -74,10 +75,26 @@ MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION("ACPI Thermal Zone Driver");
 MODULE_LICENSE("GPL");
 
+static int act;
+module_param(act, int, 0644);
+MODULE_PARM_DESC(act, "Disable or override all lowest active trip points.\n");
+
 static int tzp;
-module_param(tzp, int, 0);
+module_param(tzp, int, 0444);
 MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
 
+static int nocrt;
+module_param(nocrt, int, 0);
+MODULE_PARM_DESC(nocrt, "Set to disable action on ACPI thermal zone critical and hot trips.\n");
+
+static int off;
+module_param(off, int, 0);
+MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n");
+
+static int psv;
+module_param(psv, int, 0644);
+MODULE_PARM_DESC(psv, "Disable or override all passive trip points.\n");
+
 static int acpi_thermal_add(struct acpi_device *device);
 static int acpi_thermal_remove(struct acpi_device *device, int type);
 static int acpi_thermal_resume(struct acpi_device *device);
@@ -339,9 +356,16 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
 
        /* Passive: Processors (optional) */
 
-       status =
-           acpi_evaluate_integer(tz->device->handle, "_PSV", NULL,
-                                 &tz->trips.passive.temperature);
+       if (psv == -1) {
+               status = AE_SUPPORT;
+       } else if (psv > 0) {
+               tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv);
+               status = AE_OK;
+       } else {
+               status = acpi_evaluate_integer(tz->device->handle,
+                       "_PSV", NULL, &tz->trips.passive.temperature);
+       }
+
        if (ACPI_FAILURE(status)) {
                tz->trips.passive.flags.valid = 0;
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No passive threshold\n"));
@@ -386,11 +410,33 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
 
                char name[5] = { '_', 'A', 'C', ('0' + i), '\0' };
 
-               status =
-                   acpi_evaluate_integer(tz->device->handle, name, NULL,
-                                         &tz->trips.active[i].temperature);
-               if (ACPI_FAILURE(status))
+               if (act == -1)
+                       break;  /* disable all active trip points */
+
+               status = acpi_evaluate_integer(tz->device->handle,
+                       name, NULL, &tz->trips.active[i].temperature);
+
+               if (ACPI_FAILURE(status)) {
+                       if (i == 0)     /* no active trip points */
+                               break;
+                       if (act <= 0)   /* no override requested */
+                               break;
+                       if (i == 1) {   /* 1 trip point */
+                               tz->trips.active[0].temperature =
+                                       CELSIUS_TO_KELVIN(act);
+                       } else {        /* multiple trips */
+                               /*
+                                * Don't allow override higher than
+                                * the next higher trip point
+                                */
+                               tz->trips.active[i - 1].temperature =
+                                   (tz->trips.active[i - 2].temperature <
+                                       CELSIUS_TO_KELVIN(act) ?
+                                       tz->trips.active[i - 2].temperature :
+                                       CELSIUS_TO_KELVIN(act));
+                       }
                        break;
+               }
 
                name[2] = 'L';
                status =
@@ -427,7 +473,7 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz)
 
 static int acpi_thermal_critical(struct acpi_thermal *tz)
 {
-       if (!tz || !tz->trips.critical.flags.valid)
+       if (!tz || !tz->trips.critical.flags.valid || nocrt)
                return -EINVAL;
 
        if (tz->temperature >= tz->trips.critical.temperature) {
@@ -449,7 +495,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
 
 static int acpi_thermal_hot(struct acpi_thermal *tz)
 {
-       if (!tz || !tz->trips.hot.flags.valid)
+       if (!tz || !tz->trips.hot.flags.valid || nocrt)
                return -EINVAL;
 
        if (tz->temperature >= tz->trips.hot.temperature) {
@@ -824,12 +870,14 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
                goto end;
 
        if (tz->trips.critical.flags.valid)
-               seq_printf(seq, "critical (S5):           %ld C\n",
-                          KELVIN_TO_CELSIUS(tz->trips.critical.temperature));
+               seq_printf(seq, "critical (S5):           %ld C%s",
+                          KELVIN_TO_CELSIUS(tz->trips.critical.temperature),
+                          nocrt ? " <disabled>\n" : "\n");
 
        if (tz->trips.hot.flags.valid)
-               seq_printf(seq, "hot (S4):                %ld C\n",
-                          KELVIN_TO_CELSIUS(tz->trips.hot.temperature));
+               seq_printf(seq, "hot (S4):                %ld C%s",
+                          KELVIN_TO_CELSIUS(tz->trips.hot.temperature),
+                          nocrt ? " <disabled>\n" : "\n");
 
        if (tz->trips.passive.flags.valid) {
                seq_printf(seq,
@@ -1281,11 +1329,78 @@ static int acpi_thermal_resume(struct acpi_device *device)
        return AE_OK;
 }
 
+#ifdef CONFIG_DMI
+static int thermal_act(struct dmi_system_id *d) {
+
+       if (act == 0) {
+               printk(KERN_NOTICE "ACPI: %s detected: "
+                       "disabling all active thermal trip points\n", d->ident);
+               act = -1;
+       }
+       return 0;
+}
+static int thermal_tzp(struct dmi_system_id *d) {
+
+       if (tzp == 0) {
+               printk(KERN_NOTICE "ACPI: %s detected: "
+                       "enabling thermal zone polling\n", d->ident);
+               tzp = 300;      /* 300 dS = 30 Seconds */
+       }
+       return 0;
+}
+static int thermal_psv(struct dmi_system_id *d) {
+
+       if (psv == 0) {
+               printk(KERN_NOTICE "ACPI: %s detected: "
+                       "disabling all passive thermal trip points\n", d->ident);
+               psv = -1;
+       }
+       return 0;
+}
+
+static struct dmi_system_id thermal_dmi_table[] __initdata = {
+       /*
+        * Award BIOS on this AOpen makes thermal control almost worthless.
+        * http://bugzilla.kernel.org/show_bug.cgi?id=8842
+        */
+       {
+        .callback = thermal_act,
+        .ident = "AOpen i915GMm-HFS",
+        .matches = {
+               DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
+               DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+               },
+       },
+       {
+        .callback = thermal_psv,
+        .ident = "AOpen i915GMm-HFS",
+        .matches = {
+               DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
+               DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+               },
+       },
+       {
+        .callback = thermal_tzp,
+        .ident = "AOpen i915GMm-HFS",
+        .matches = {
+               DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
+               DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+               },
+       },
+       {}
+};
+#endif /* CONFIG_DMI */
+
 static int __init acpi_thermal_init(void)
 {
        int result = 0;
 
+       dmi_check_system(thermal_dmi_table);
 
+       if (off) {
+               printk(KERN_NOTICE "ACPI: thermal control disabled\n");
+               return -ENODEV;
+       }
        acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
        if (!acpi_thermal_dir)
                return -ENODEV;
index a78832ea81fa0f5cc9460cca362f498307820cb1..071d274afaabcf6a971831019c44e50900d306c9 100644 (file)
@@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = {
                /* PM   PS   SM   SS       MAP */
                {  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
                {  RV,  RV,  RV,  RV },
-               {  IDE,  IDE,  NA,  NA }, /* 10b (IDE mode) */
+               {  P0,  P2, IDE, IDE }, /* 10b (IDE mode) */
                {  RV,  RV,  RV,  RV },
        },
 };
@@ -900,6 +900,13 @@ static int piix_broken_suspend(void)
                                DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
                        },
                },
+               {
+                       .ident = "TECRA M7",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"),
+                       },
+               },
                {
                        .ident = "Satellite U205",
                        .matches = {
index 60e78bef469fed2f49423deea956a16b60a0448b..99d4fbffb0dfd574acd2f280c960895548254791 100644 (file)
@@ -1723,7 +1723,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
                tf.protocol = ATA_PROT_NODATA;
                tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
                err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
-               if (err_mask) {
+               if (err_mask && id[2] != 0x738c) {
                        rc = -EIO;
                        reason = "SPINUP failed";
                        goto err_out;
index ce589d96ca424f3083564dc9f193eef0717501f2..b5352ebecef93a9cf047b5f6cdb3cd4dc1a10c50 100644 (file)
@@ -2,6 +2,7 @@
  *    pata_artop.c - ARTOP ATA controller driver
  *
  *     (C) 2006 Red Hat <alan@redhat.com>
+ *     (C) 2007 Bartlomiej Zolnierkiewicz
  *
  *    Based in part on drivers/ide/pci/aec62xx.c
  *     Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
@@ -28,7 +29,7 @@
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_artop"
-#define DRV_VERSION    "0.4.3"
+#define DRV_VERSION    "0.4.4"
 
 /*
  *     The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
@@ -430,7 +431,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
                .udma_mask      = ATA_UDMA4,
                .port_ops       = &artop6260_ops,
        };
-       static const struct ata_port_info info_626x_fast = {
+       static const struct ata_port_info info_628x = {
                .sht            = &artop_sht,
                .flags          = ATA_FLAG_SLAVE_POSS,
                .pio_mask       = 0x1f, /* pio0-4 */
@@ -438,6 +439,14 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
                .udma_mask      = ATA_UDMA5,
                .port_ops       = &artop6260_ops,
        };
+       static const struct ata_port_info info_628x_fast = {
+               .sht            = &artop_sht,
+               .flags          = ATA_FLAG_SLAVE_POSS,
+               .pio_mask       = 0x1f, /* pio0-4 */
+               .mwdma_mask     = 0x07, /* mwdma0-2 */
+               .udma_mask      = ATA_UDMA6,
+               .port_ops       = &artop6260_ops,
+       };
        const struct ata_port_info *ppi[] = { NULL, NULL };
 
        if (!printed_version++)
@@ -455,13 +464,13 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
        }
        else if (id->driver_data == 1)  /* 6260 */
                ppi[0] = &info_626x;
-       else if (id->driver_data == 2)  { /* 6260 or 6260 + fast */
+       else if (id->driver_data == 2)  { /* 6280 or 6280 + fast */
                unsigned long io = pci_resource_start(pdev, 4);
                u8 reg;
 
-               ppi[0] = &info_626x;
+               ppi[0] = &info_628x;
                if (inb(io) & 0x10)
-                       ppi[0] = &info_626x_fast;
+                       ppi[0] = &info_628x_fast;
                /* Mac systems come up with some registers not set as we
                   will need them */
 
index 84d9c5568567461b782da104f41c857fb8f75f11..c5ddd937dbf21a438af2cbe8fb0f2c385b88a774 100644 (file)
@@ -8,12 +8,10 @@
  * Copyright (C) 1999-2003             Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001         Sun Microsystems, Inc.
  * Portions Copyright (C) 2003         Red Hat Inc
- * Portions Copyright (C) 2005-2006    MontaVista Software, Inc.
+ * Portions Copyright (C) 2005-2007    MontaVista Software, Inc.
  *
  * TODO
- *     PLL mode
- *     Look into engine reset on timeout errors. Should not be
- *             required.
+ *     Look into engine reset on timeout errors. Should not be required.
  */
 
 #include <linux/kernel.h>
@@ -26,7 +24,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt37x"
-#define DRV_VERSION    "0.6.7"
+#define DRV_VERSION    "0.6.9"
 
 struct hpt_clock {
        u8      xfer_speed;
@@ -1092,9 +1090,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                int dpll, adjust;
 
                /* Compute DPLL */
-               dpll = 2;
-               if (port->udma_mask & 0xE0)
-                       dpll = 3;
+               dpll = (port->udma_mask & 0xC0) ? 3 : 2;
 
                f_low = (MHz[clock_slot] * 48) / MHz[dpll];
                f_high = f_low + 2;
@@ -1116,7 +1112,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
                }
                if (adjust == 8) {
-                       printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
+                       printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n");
                        return -ENODEV;
                }
                if (dpll == 3)
@@ -1124,7 +1120,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                else
                        private_data = (void *)hpt37x_timings_50;
 
-               printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]);
+               printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n",
+                      MHz[clock_slot], MHz[dpll]);
        } else {
                private_data = (void *)chip_table->clocks[clock_slot];
                /*
@@ -1137,7 +1134,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        port = &info_hpt370_33;
                if (clock_slot < 2 && port == &info_hpt370a)
                        port = &info_hpt370a_33;
-               printk(KERN_INFO "hpt37x: %s: Bus clock %dMHz.\n", chip_table->name, MHz[clock_slot]);
+               printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n",
+                      chip_table->name, MHz[clock_slot]);
        }
 
        /* Now kick off ATA set up */
index aa29cde09f8bbd594022f23a1e7803b6adfc5d87..f8f234bfc8ce2bc1ef075fccedd6df98d52fec2f 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright (C) 1999-2003             Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001         Sun Microsystems, Inc.
  * Portions Copyright (C) 2003         Red Hat Inc
- * Portions Copyright (C) 2005-2006    MontaVista Software, Inc.
+ * Portions Copyright (C) 2005-2007    MontaVista Software, Inc.
  *
  *
  * TODO
@@ -25,7 +25,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt3x2n"
-#define DRV_VERSION    "0.3.3"
+#define DRV_VERSION    "0.3.4"
 
 enum {
        HPT_PCI_FAST    =       (1 << 31),
@@ -579,10 +579,12 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
        }
        if (adjust == 8) {
-               printk(KERN_WARNING "hpt3x2n: DPLL did not stabilize.\n");
+               printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n");
                return -ENODEV;
        }
 
+       printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n",
+              pci_mhz);
        /* Set our private data up. We only need a few flags so we use
           it directly */
        port.private_data = NULL;
index 5525518204e65dc07850f2283f8a5e1b775a9703..91a396fa5b20f0f75fdbc550ab6d1b9654738145 100644 (file)
@@ -139,6 +139,8 @@ static struct pnp_device_id isapnp_devices[] = {
        {.id = ""}
 };
 
+MODULE_DEVICE_TABLE(pnp, isapnp_devices);
+
 static struct pnp_driver isapnp_driver = {
        .name           = DRV_NAME,
        .id_table       = isapnp_devices,
index 8ec520885b959557d0dc8d6bc3d80407cda3460f..3acf65e75eb2dd0b64b6ce2d2bfc7670c7f1cf8b 100644 (file)
@@ -621,6 +621,9 @@ static const struct pci_device_id mv_pci_tbl[] = {
        { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
        { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
        { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
+       /* RocketRAID 1740/174x have different identifiers */
+       { PCI_VDEVICE(TTI, 0x1740), chip_508x },
+       { PCI_VDEVICE(TTI, 0x1742), chip_508x },
 
        { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
        { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
index 405ee5e092211ee8078ff80adbc4fbaa5cd928b7..8b12925fe7a41e7a54f846d1f64274c737a82009 100644 (file)
@@ -2435,7 +2435,7 @@ fore200e_init_cmd_queue(struct fore200e* fore200e)
 }
 
 
-static void __init
+static void __devinit
 fore200e_param_bs_queue(struct fore200e* fore200e,
                        enum buffer_scheme scheme, enum buffer_magn magn,
                        int queue_length, int pool_size, int supply_blksize)
index a3b605a0ca17a47e106359e4299d5db2e70515df..ef52452640e0b7f9c89594e6a9195653a1eee1a9 100644 (file)
@@ -1601,14 +1601,14 @@ static int rx_init(struct atm_dev *dev)
   
        skb_queue_head_init(&iadev->rx_dma_q);  
        iadev->rx_free_desc_qhead = NULL;   
-       iadev->rx_open = kmalloc(4*iadev->num_vc,GFP_KERNEL);
-       if (!iadev->rx_open)  
-       {  
+
+       iadev->rx_open = kzalloc(4 * iadev->num_vc, GFP_KERNEL);
+       if (!iadev->rx_open) {
                printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n",
                dev->number);  
                goto err_free_dle;
        }  
-       memset(iadev->rx_open, 0, 4*iadev->num_vc);  
+
         iadev->rxing = 1;
         iadev->rx_pkt_cnt = 0;
        /* Mode Register */  
@@ -3171,12 +3171,12 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
         unsigned long flags;
        int ret;
 
-       iadev = kmalloc(sizeof(*iadev), GFP_KERNEL); 
+       iadev = kzalloc(sizeof(*iadev), GFP_KERNEL);
        if (!iadev) {
                ret = -ENOMEM;
                goto err_out;
        }
-       memset(iadev, 0, sizeof(*iadev));
+
        iadev->pci = pdev;
 
        IF_INIT(printk("ia detected at bus:%d dev: %d function:%d\n",
index 55fd1b4543fdc5e034e8c358fc05967259f339b4..144a49f152207402c044caca1c0c8dde47f10747 100644 (file)
@@ -65,7 +65,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <linux/dma-mapping.h>
 
 /* -------------------- TUNABLE PARAMATERS: */
 
index a11b2bd54bbe6ca76e626a1bb50cdd2253d39a6d..084358a828e9de7f2e5fc27f48d47a523beb1ab5 100644 (file)
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
 {
        ReadCapdata_struct *buf;
        int return_code;
-       buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
-       if (buf == NULL) {
+
+       buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
+       if (!buf) {
                printk(KERN_WARNING "cciss: out of memory\n");
                return;
        }
-       memset(buf, 0, sizeof(ReadCapdata_struct));
+
        if (withirq)
                return_code = sendcmd_withirq(CCISS_READ_CAPACITY,
                                ctlr, buf, sizeof(ReadCapdata_struct),
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
                printk(KERN_INFO "      blocks= %llu block_size= %d\n",
                (unsigned long long)*total_size+1, *block_size);
        kfree(buf);
-       return;
 }
 
 static void
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
 {
        ReadCapdata_struct_16 *buf;
        int return_code;
-       buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
-       if (buf == NULL) {
+
+       buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
+       if (!buf) {
                printk(KERN_WARNING "cciss: out of memory\n");
                return;
        }
-       memset(buf, 0, sizeof(ReadCapdata_struct_16));
+
        if (withirq) {
                return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16,
                        ctlr, buf, sizeof(ReadCapdata_struct_16),
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
        printk(KERN_INFO "      blocks= %llu block_size= %d\n",
               (unsigned long long)*total_size+1, *block_size);
        kfree(buf);
-       return;
 }
 
 static int cciss_revalidate(struct gendisk *disk)
index be4e3477d83b87f785ba22b43121635acd906b0f..eb9799acf65b8a202606b9e8686a66360a4e9840 100644 (file)
@@ -420,18 +420,17 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev)
                        goto Enomem2;
        }
 
-       hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent(
+       hba[i]->cmd_pool = pci_alloc_consistent(
                hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t),
                &(hba[i]->cmd_pool_dhandle));
-       hba[i]->cmd_pool_bits = kmalloc(
-               ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long),
+       hba[i]->cmd_pool_bits = kcalloc(
+               (NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG, sizeof(unsigned long),
                GFP_KERNEL);
 
        if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool)
                        goto Enomem1;
 
        memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t));
-       memset(hba[i]->cmd_pool_bits, 0, ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long));
        printk(KERN_INFO "cpqarray: Finding drives on %s",
                hba[i]->devname);
 
@@ -1660,45 +1659,30 @@ static void getgeometry(int ctlr)
 
        info_p->log_drv_map = 0;        
        
-       id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL);
-       if(id_ldrive == NULL)
-       {
+       id_ldrive = kzalloc(sizeof(id_log_drv_t), GFP_KERNEL);
+       if (!id_ldrive) {
                printk( KERN_ERR "cpqarray:  out of memory.\n");
-               return;
+               goto err_0;
        }
 
-       id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
-       if(id_ctlr_buf == NULL)
-       {
-               kfree(id_ldrive);
+       id_ctlr_buf = kzalloc(sizeof(id_ctlr_t), GFP_KERNEL);
+       if (!id_ctlr_buf) {
                printk( KERN_ERR "cpqarray:  out of memory.\n");
-               return;
+               goto err_1;
        }
 
-       id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
-       if(id_lstatus_buf == NULL)
-       {
-               kfree(id_ctlr_buf);
-               kfree(id_ldrive);
+       id_lstatus_buf = kzalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
+       if (!id_lstatus_buf) {
                printk( KERN_ERR "cpqarray:  out of memory.\n");
-               return;
+               goto err_2;
        }
 
-       sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL);
-       if(sense_config_buf == NULL)
-       {
-               kfree(id_lstatus_buf);
-               kfree(id_ctlr_buf);
-               kfree(id_ldrive);
+       sense_config_buf = kzalloc(sizeof(config_t), GFP_KERNEL);
+       if (!sense_config_buf) {
                printk( KERN_ERR "cpqarray:  out of memory.\n");
-               return;
+               goto err_3;
        }
 
-       memset(id_ldrive, 0, sizeof(id_log_drv_t));
-       memset(id_ctlr_buf, 0, sizeof(id_ctlr_t));
-       memset(id_lstatus_buf, 0, sizeof(sense_log_drv_stat_t));
-       memset(sense_config_buf, 0, sizeof(config_t));
-
        info_p->phys_drives = 0;
        info_p->log_drv_map = 0;
        info_p->drv_assign_map = 0;
@@ -1712,13 +1696,8 @@ static void getgeometry(int ctlr)
                 * so the idastubopen will fail on all logical drives
                 * on the controller.
                 */
-                /* Free all the buffers and return */ 
                printk(KERN_ERR "cpqarray: error sending ID controller\n");
-               kfree(sense_config_buf);
-                kfree(id_lstatus_buf);
-                kfree(id_ctlr_buf);
-                kfree(id_ldrive);
-                return;
+                goto err_4;
         }
 
        info_p->log_drives = id_ctlr_buf->nr_drvs;
@@ -1764,12 +1743,7 @@ static void getgeometry(int ctlr)
                                " failed to report status of logical drive %d\n"
                         "Access to this controller has been disabled\n",
                                ctlr, log_unit);
-                       /* Free all the buffers and return */
-                       kfree(sense_config_buf);
-                       kfree(id_lstatus_buf);
-                       kfree(id_ctlr_buf);
-                       kfree(id_ldrive);
-                       return;
+                       goto err_4;
                }
                /*
                   Make sure the logical drive is configured
@@ -1798,14 +1772,8 @@ static void getgeometry(int ctlr)
                                 sizeof(config_t), 0, 0, log_unit);
                                if (ret_code == IO_ERROR) {
                                        info_p->log_drv_map = 0;
-                                       /* Free all the buffers and return */
                                        printk(KERN_ERR "cpqarray: error sending sense config\n");
-                                       kfree(sense_config_buf);
-                                       kfree(id_lstatus_buf);
-                                       kfree(id_ctlr_buf);
-                                       kfree(id_ldrive);
-                                       return;
-
+                                       goto err_4;
                                }
 
                                info_p->phys_drives =
@@ -1820,12 +1788,18 @@ static void getgeometry(int ctlr)
                        log_index = log_index + 1;
                }               /* end of if logical drive configured */
        }                       /* end of for log_unit */
+
+       /* Free all the buffers and return */
+err_4:
        kfree(sense_config_buf);
-       kfree(id_ldrive);
+err_3:
        kfree(id_lstatus_buf);
+err_2:
        kfree(id_ctlr_buf);
+err_1:
+       kfree(id_ldrive);
+err_0:
        return;
-
 }
 
 static void __exit cpqarray_exit(void)
index 85916e2665d4852ed9ed4e36ef04a5f00d599277..af3969a9c96301d3ab515c44b1554c472ddcd4e3 100644 (file)
@@ -41,7 +41,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/completion.h>
 #include <linux/device.h>
-#include <linux/kernel.h>
 
 #include <asm/uaccess.h>
 #include <asm/vio.h>
index cb27e8863d7c58eac90af527f1bcf84f92186fcb..3ede0b63da13cc4f34b59c229318b3745622179c 100644 (file)
@@ -902,26 +902,17 @@ static int ace_release(struct inode *inode, struct file *filp)
        return 0;
 }
 
-static int ace_ioctl(struct inode *inode, struct file *filp,
-                    unsigned int cmd, unsigned long arg)
+static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
 {
-       struct ace_device *ace = inode->i_bdev->bd_disk->private_data;
-       struct hd_geometry __user *geo = (struct hd_geometry __user *)arg;
-       struct hd_geometry g;
-       dev_dbg(ace->dev, "ace_ioctl()\n");
-
-       switch (cmd) {
-       case HDIO_GETGEO:
-               g.heads = ace->cf_id.heads;
-               g.sectors = ace->cf_id.sectors;
-               g.cylinders = ace->cf_id.cyls;
-               g.start = 0;
-               return copy_to_user(geo, &g, sizeof(g)) ? -EFAULT : 0;
+       struct ace_device *ace = bdev->bd_disk->private_data;
 
-       default:
-               return -ENOTTY;
-       }
-       return -ENOTTY;
+       dev_dbg(ace->dev, "ace_getgeo()\n");
+
+       geo->heads = ace->cf_id.heads;
+       geo->sectors = ace->cf_id.sectors;
+       geo->cylinders = ace->cf_id.cyls;
+
+       return 0;
 }
 
 static struct block_device_operations ace_fops = {
@@ -930,7 +921,7 @@ static struct block_device_operations ace_fops = {
        .release = ace_release,
        .media_changed = ace_media_changed,
        .revalidate_disk = ace_revalidate_disk,
-       .ioctl = ace_ioctl,
+       .getgeo = ace_getgeo,
 };
 
 /* --------------------------------------------------------------------
index feeccbaec4382c55c1583fcad49cf73264a407ce..3d6bd0baa56dec3e45e84638719c8842986a935c 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/lguest_bus.h>
+#include <asm/paravirt.h>
 #include "hvc_console.h"
 
 /*D:340 This is our single console input buffer, with associated "struct
index fee58e03dbe2bb30e5d8d715e9fab42be3b04e85..4177f6db83e9c45336bf0b604dd113424b8076ad 100644 (file)
@@ -1629,7 +1629,7 @@ static int cmm_open(struct inode *inode, struct file *filp)
 {
        struct cm4000_dev *dev;
        struct pcmcia_device *link;
-       int rc, minor = iminor(inode);
+       int minor = iminor(inode);
 
        if (minor >= CM4000_MAX_DEV)
                return -ENODEV;
@@ -1668,7 +1668,6 @@ static int cmm_open(struct inode *inode, struct file *filp)
        start_monitor(dev);
 
        link->open = 1;         /* only one open per device */
-       rc = 0;
 
        DEBUGP(2, dev, "<- cmm_open\n");
        return nonseekable_open(inode, filp);
@@ -1824,7 +1823,7 @@ static int cm4000_resume(struct pcmcia_device *link)
 
 static void cm4000_release(struct pcmcia_device *link)
 {
-       cmm_cm4000_release(link->priv); /* delay release until device closed */
+       cmm_cm4000_release(link);       /* delay release until device closed */
        pcmcia_disable_device(link);
 }
 
index af88181a17f477cd01e5a1f2644a9c8039619262..b24a3e7bbb9f23b409a77dfb2ffc4ff93a0c9f26 100644 (file)
@@ -599,7 +599,7 @@ cs_release:
 
 static void reader_release(struct pcmcia_device *link)
 {
-       cm4040_reader_release(link->priv);
+       cm4040_reader_release(link);
        pcmcia_disable_device(link);
 }
 
index 73037a4d3c5023f2e7b31fccf804f61a8ece0b08..aeec67e27264463c5697ac4652212d8a8e13fb73 100644 (file)
@@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
        return 0;
 }
 
+const static struct acpi_device_id sonypi_device_ids[] = {
+       {"SNY6001", 0},
+       {"", 0},
+};
+
 static struct acpi_driver sonypi_acpi_driver = {
        .name           = "sonypi",
        .class          = "hkey",
-       .ids            = "SNY6001",
+       .ids            = sonypi_device_ids,
        .ops            = {
                           .add = sonypi_acpi_add,
                           .remove = sonypi_acpi_remove,
index de37ebc3a4cf03fa9e94d68fbf7e0f70b9293337..51ea93cab6c4c098cbd40dba6d17aa96e09b5c6e 100644 (file)
@@ -369,25 +369,54 @@ static void tty_buffer_free(struct tty_struct *tty, struct tty_buffer *b)
 }
 
 /**
- *     tty_buffer_flush                -       flush full tty buffers
+ *     __tty_buffer_flush              -       flush full tty buffers
  *     @tty: tty to flush
  *
- *     flush all the buffers containing receive data
+ *     flush all the buffers containing receive data. Caller must
+ *     hold the buffer lock and must have ensured no parallel flush to
+ *     ldisc is running.
  *
- *     Locking: none
+ *     Locking: Caller must hold tty->buf.lock
  */
 
-static void tty_buffer_flush(struct tty_struct *tty)
+static void __tty_buffer_flush(struct tty_struct *tty)
 {
        struct tty_buffer *thead;
-       unsigned long flags;
 
-       spin_lock_irqsave(&tty->buf.lock, flags);
        while((thead = tty->buf.head) != NULL) {
                tty->buf.head = thead->next;
                tty_buffer_free(tty, thead);
        }
        tty->buf.tail = NULL;
+}
+
+/**
+ *     tty_buffer_flush                -       flush full tty buffers
+ *     @tty: tty to flush
+ *
+ *     flush all the buffers containing receive data. If the buffer is
+ *     being processed by flush_to_ldisc then we defer the processing
+ *     to that function
+ *
+ *     Locking: none
+ */
+
+static void tty_buffer_flush(struct tty_struct *tty)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&tty->buf.lock, flags);
+
+       /* If the data is being pushed to the tty layer then we can't
+          process it here. Instead set a flag and the flush_to_ldisc
+          path will process the flush request before it exits */
+       if (test_bit(TTY_FLUSHING, &tty->flags)) {
+               set_bit(TTY_FLUSHPENDING, &tty->flags);
+               spin_unlock_irqrestore(&tty->buf.lock, flags);
+               wait_event(tty->read_wait,
+                               test_bit(TTY_FLUSHPENDING, &tty->flags) == 0);
+               return;
+       } else
+               __tty_buffer_flush(tty);
        spin_unlock_irqrestore(&tty->buf.lock, flags);
 }
 
@@ -3594,6 +3623,7 @@ static void flush_to_ldisc(struct work_struct *work)
                return;
 
        spin_lock_irqsave(&tty->buf.lock, flags);
+       set_bit(TTY_FLUSHING, &tty->flags);     /* So we know a flush is running */
        head = tty->buf.head;
        if (head != NULL) {
                tty->buf.head = NULL;
@@ -3607,6 +3637,11 @@ static void flush_to_ldisc(struct work_struct *work)
                                tty_buffer_free(tty, tbuf);
                                continue;
                        }
+                       /* Ldisc or user is trying to flush the buffers
+                          we are feeding to the ldisc, stop feeding the
+                          line discipline as we want to empty the queue */
+                       if (test_bit(TTY_FLUSHPENDING, &tty->flags))
+                               break;
                        if (!tty->receive_room) {
                                schedule_delayed_work(&tty->buf.work, 1);
                                break;
@@ -3620,8 +3655,17 @@ static void flush_to_ldisc(struct work_struct *work)
                        disc->receive_buf(tty, char_buf, flag_buf, count);
                        spin_lock_irqsave(&tty->buf.lock, flags);
                }
+               /* Restore the queue head */
                tty->buf.head = head;
        }
+       /* We may have a deferred request to flush the input buffer,
+          if so pull the chain under the lock and empty the queue */
+       if (test_bit(TTY_FLUSHPENDING, &tty->flags)) {
+               __tty_buffer_flush(tty);
+               clear_bit(TTY_FLUSHPENDING, &tty->flags);
+               wake_up(&tty->read_wait);
+       }
+       clear_bit(TTY_FLUSHING, &tty->flags);
        spin_unlock_irqrestore(&tty->buf.lock, flags);
 
        tty_ldisc_deref(disc);
index 5fbe56b5cea09bb01f74e40488f63187dd851c1f..2d1f17865b64a933f8a9901b899952fe0018706c 100644 (file)
@@ -347,8 +347,7 @@ ioat_dma_prep_memcpy(struct dma_chan *chan, size_t len, int int_en)
        new->async_tx.ack = 0; /* client is in control of this ack */
        new->async_tx.cookie = -EBUSY;
 
-       pci_unmap_len_set(new, src_len, orig_len);
-       pci_unmap_len_set(new, dst_len, orig_len);
+       pci_unmap_len_set(new, len, orig_len);
        spin_unlock_bh(&ioat_chan->desc_lock);
 
        return new ? &new->async_tx : NULL;
@@ -423,11 +422,11 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *chan)
                        */
                        pci_unmap_page(chan->device->pdev,
                                        pci_unmap_addr(desc, dst),
-                                       pci_unmap_len(desc, dst_len),
+                                       pci_unmap_len(desc, len),
                                        PCI_DMA_FROMDEVICE);
                        pci_unmap_page(chan->device->pdev,
                                        pci_unmap_addr(desc, src),
-                                       pci_unmap_len(desc, src_len),
+                                       pci_unmap_len(desc, len),
                                        PCI_DMA_TODEVICE);
                }
 
index d3726478031a4ffd3c66db68e5e3361792658fb5..bf4dad70e0f59b78b328e1fb4fe8e60240d8fe7a 100644 (file)
@@ -111,10 +111,9 @@ struct ioat_desc_sw {
        struct ioat_dma_descriptor *hw;
        struct list_head node;
        int tx_cnt;
+       DECLARE_PCI_UNMAP_LEN(len)
        DECLARE_PCI_UNMAP_ADDR(src)
-       DECLARE_PCI_UNMAP_LEN(src_len)
        DECLARE_PCI_UNMAP_ADDR(dst)
-       DECLARE_PCI_UNMAP_LEN(dst_len)
        struct dma_async_tx_descriptor async_tx;
 };
 
index 8f5c686123b8a5da5fae95064cb3bd8355ca5428..289816db52aed4b956dd515238f65a8fda481597 100644 (file)
@@ -272,11 +272,11 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
                /* Make sure the SMBus host is ready to start transmitting */
                temp = inb_p(SMBHSTSTS);
                if (i == 1) {
-                       /* Erronenous conditions before transaction:
+                       /* Erroneous conditions before transaction:
                         * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
                        errmask = 0x9f;
                } else {
-                       /* Erronenous conditions during transaction:
+                       /* Erroneous conditions during transaction:
                         * Failed, Bus_Err, Dev_Err, Intr */
                        errmask = 0x1e;
                }
index 440342bc62e183d0d20b8acced8ea0a9a5cd5b86..ace644e21b14380585f05103028a133b02a904af 100644 (file)
@@ -490,6 +490,7 @@ iop3xx_i2c_probe(struct platform_device *pdev)
        memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
        new_adapter->id = I2C_HW_IOP3XX;
        new_adapter->owner = THIS_MODULE;
+       new_adapter->class = I2C_CLASS_HWMON;
        new_adapter->dev.parent = &pdev->dev;
        new_adapter->nr = pdev->id;
 
index 851c3ed513d015e50b5c75c362a014dfa09c1c1d..d8de4ac88b7d9d7718b9693eb1506f8ec45709a6 100644 (file)
@@ -105,6 +105,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
                        schedule();
                        if (time_after(jiffies, orig_jiffies + timeout)) {
                                pr_debug("I2C: timeout\n");
+                               writeccr(i2c, 0);
                                result = -EIO;
                                break;
                        }
@@ -116,10 +117,12 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
                result = wait_event_interruptible_timeout(i2c->queue,
                        (i2c->interrupt & CSR_MIF), timeout * HZ);
 
-               if (unlikely(result < 0))
+               if (unlikely(result < 0)) {
                        pr_debug("I2C: wait interrupted\n");
-               else if (unlikely(!(i2c->interrupt & CSR_MIF))) {
+                       writeccr(i2c, 0);
+               } else if (unlikely(!(i2c->interrupt & CSR_MIF))) {
                        pr_debug("I2C: wait timeout\n");
+                       writeccr(i2c, 0);
                        result = -ETIMEDOUT;
                }
 
@@ -172,7 +175,6 @@ static void mpc_i2c_start(struct mpc_i2c *i2c)
 static void mpc_i2c_stop(struct mpc_i2c *i2c)
 {
        writeccr(i2c, CCR_MEN);
-       writeccr(i2c, 0);
 }
 
 static int mpc_write(struct mpc_i2c *i2c, int target,
@@ -261,6 +263,7 @@ static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
        while (readb(i2c->base + MPC_I2C_SR) & CSR_MBB) {
                if (signal_pending(current)) {
                        pr_debug("I2C: Interrupted\n");
+                       writeccr(i2c, 0);
                        return -EINTR;
                }
                if (time_after(jiffies, orig_jiffies + HZ)) {
@@ -362,7 +365,7 @@ static int fsl_i2c_probe(struct platform_device *pdev)
 
       fail_add:
        if (i2c->irq != 0)
-               free_irq(i2c->irq, NULL);
+               free_irq(i2c->irq, i2c);
       fail_irq:
        iounmap(i2c->base);
       fail_map:
index 251154ae5d97ad3eb0bddff1067c3a655075ba5f..bb7bf68a7fb66eb4fb648ba0d770d2bcbda38333 100644 (file)
@@ -107,6 +107,21 @@ struct mv64xxx_i2c_data {
  *
  *****************************************************************************
  */
+
+/* Reset hardware and initialize FSM */
+static void
+mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data)
+{
+       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SOFT_RESET);
+       writel((((drv_data->freq_m & 0xf) << 3) | (drv_data->freq_n & 0x7)),
+               drv_data->reg_base + MV64XXX_I2C_REG_BAUD);
+       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SLAVE_ADDR);
+       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_EXT_SLAVE_ADDR);
+       writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP,
+               drv_data->reg_base + MV64XXX_I2C_REG_CONTROL);
+       drv_data->state = MV64XXX_I2C_STATE_IDLE;
+}
+
 static void
 mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
 {
@@ -203,7 +218,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
                         drv_data->state, status, drv_data->msg->addr,
                         drv_data->msg->flags);
                drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP;
-               drv_data->state = MV64XXX_I2C_STATE_IDLE;
+               mv64xxx_i2c_hw_init(drv_data);
                drv_data->rc = -EIO;
        }
 }
@@ -367,6 +382,7 @@ mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data)
                                "mv64xxx: I2C bus locked, block: %d, "
                                "time_left: %d\n", drv_data->block,
                                (int)time_left);
+                       mv64xxx_i2c_hw_init(drv_data);
                }
        } else
                spin_unlock_irqrestore(&drv_data->lock, flags);
@@ -443,19 +459,6 @@ static const struct i2c_algorithm mv64xxx_i2c_algo = {
  *
  *****************************************************************************
  */
-static void __devinit
-mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data)
-{
-       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SOFT_RESET);
-       writel((((drv_data->freq_m & 0xf) << 3) | (drv_data->freq_n & 0x7)),
-               drv_data->reg_base + MV64XXX_I2C_REG_BAUD);
-       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_SLAVE_ADDR);
-       writel(0, drv_data->reg_base + MV64XXX_I2C_REG_EXT_SLAVE_ADDR);
-       writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP,
-               drv_data->reg_base + MV64XXX_I2C_REG_CONTROL);
-       drv_data->state = MV64XXX_I2C_STATE_IDLE;
-}
-
 static int __devinit
 mv64xxx_i2c_map_regs(struct platform_device *pd,
        struct mv64xxx_i2c_data *drv_data)
index e4540fcf6476e17fc5aa6d1f764d583fc0403c1d..c44ada5f4292e301bfb4e2e1165e06b1007b626f 100644 (file)
@@ -39,8 +39,8 @@
 #include <asm/io.h>
 
 #include <asm/arch/regs-gpio.h>
-#include <asm/arch/regs-iic.h>
-#include <asm/arch/iic.h>
+#include <asm/plat-s3c/regs-iic.h>
+#include <asm/plat-s3c/iic.h>
 
 /* i2c controller state */
 
index 9fafadb92510219e74ddce66bdc223e88165bc9a..fe04e46991aa9911967c267166c4b11db944cc6f 100644 (file)
@@ -18,8 +18,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#undef DEBUG
-#undef VERBOSE
 
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -44,7 +42,7 @@
 
 
 #define        DRIVER_VERSION  "24 August 2004"
-#define        DRIVER_NAME     (isp1301_driver.name)
+#define        DRIVER_NAME     (isp1301_driver.driver.name)
 
 MODULE_DESCRIPTION("ISP1301 USB OTG Transceiver Driver");
 MODULE_LICENSE("GPL");
@@ -55,6 +53,7 @@ struct isp1301 {
        void                    (*i2c_release)(struct device *dev);
 
        int                     irq;
+       int                     irq_type;
 
        u32                     last_otg_ctrl;
        unsigned                working:1;
@@ -63,7 +62,7 @@ struct isp1301 {
 
        /* use keventd context to change the state for us */
        struct work_struct      work;
-       
+
        unsigned long           todo;
 #              define WORK_UPDATE_ISP  0       /* update ISP from OTG */
 #              define WORK_UPDATE_OTG  1       /* update OTG from ISP */
@@ -94,7 +93,7 @@ struct isp1301 {
 
 /* board-specific PM hooks */
 
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/mux.h>
 #include <asm/mach-types.h>
 
@@ -291,7 +290,7 @@ static void power_up(struct isp1301 *isp)
 {
        // isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_2, MC2_GLOBAL_PWR_DN);
        isp1301_clear_bits(isp, ISP1301_MODE_CONTROL_1, MC1_SUSPEND_REG);
-       
+
        /* do this only when cpu is driving transceiver,
         * so host won't see a low speed device...
         */
@@ -799,7 +798,7 @@ static irqreturn_t omap_otg_irq(int irq, void *_isp)
                /* role is host */
                } else {
                        if (!(otg_ctrl & OTG_ID)) {
-                               otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
+                               otg_ctrl &= OTG_CTRL_MASK & ~OTG_XCEIV_INPUTS;
                                OTG_CTRL_REG = otg_ctrl | OTG_A_BUSREQ;
                        }
 
@@ -1100,9 +1099,9 @@ static u8 isp1301_clear_latch(struct isp1301 *isp)
 }
 
 static void
-isp1301_work(void *data)
+isp1301_work(struct work_struct *work)
 {
-       struct isp1301  *isp = data;
+       struct isp1301  *isp = container_of(work, struct isp1301, work);
        int             stop;
 
        /* implicit lock:  we're the only task using this device */
@@ -1244,7 +1243,7 @@ static int isp1301_detach_client(struct i2c_client *i2c)
  *  - DEVICE mode, for when there's a B/Mini-B (device) connector
  *
  * As a rule, you won't have an isp1301 chip unless it's there to
- * support the OTG mode.  Other modes help testing USB controllers 
+ * support the OTG mode.  Other modes help testing USB controllers
  * in isolation from (full) OTG support, or maybe so later board
  * revisions can help to support those feature.
  */
@@ -1260,9 +1259,9 @@ static int isp1301_otg_enable(struct isp1301 *isp)
         * a few more interrupts than are strictly needed.
         */
        isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
-               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
+               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
        isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
-               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
+               INTR_VBUS_VLD | INTR_SESS_VLD | INTR_ID_GND);
 
        dev_info(&isp->client.dev, "ready for dual-role USB ...\n");
 
@@ -1306,9 +1305,9 @@ isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host)
 
        dev_info(&isp->client.dev, "A-Host sessions ok\n");
        isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
-               INTR_ID_GND);
+               INTR_ID_GND);
        isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
-               INTR_ID_GND);
+               INTR_ID_GND);
 
        /* If this has a Mini-AB connector, this mode is highly
         * nonstandard ... but can be handy for testing, especially with
@@ -1368,9 +1367,9 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget)
                isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1, MC1_DAT_SE0);
 
        isp1301_set_bits(isp, ISP1301_INTERRUPT_RISING,
-               INTR_SESS_VLD);
+               INTR_SESS_VLD);
        isp1301_set_bits(isp, ISP1301_INTERRUPT_FALLING,
-               INTR_VBUS_VLD);
+               INTR_VBUS_VLD);
        dev_info(&isp->client.dev, "B-Peripheral sessions ok\n");
        dump_regs(isp, __FUNCTION__);
 
@@ -1494,7 +1493,7 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
        if (!isp)
                return 0;
 
-       INIT_WORK(&isp->work, isp1301_work, isp);
+       INIT_WORK(&isp->work, isp1301_work);
        init_timer(&isp->timer);
        isp->timer.function = isp1301_timer;
        isp->timer.data = (unsigned long) isp;
@@ -1572,13 +1571,14 @@ fail1:
                /* IRQ wired at M14 */
                omap_cfg_reg(M14_1510_GPIO2);
                isp->irq = OMAP_GPIO_IRQ(2);
-               omap_request_gpio(2);
-               omap_set_gpio_direction(2, 1);
-               omap_set_gpio_edge_ctrl(2, OMAP_GPIO_FALLING_EDGE);
+               if (gpio_request(2, "isp1301") == 0)
+                       gpio_direction_input(2);
+               isp->irq_type = IRQF_TRIGGER_FALLING;
        }
 
+       isp->irq_type |= IRQF_SAMPLE_RANDOM;
        status = request_irq(isp->irq, isp1301_irq,
-                       IRQF_SAMPLE_RANDOM, DRIVER_NAME, isp);
+                       isp->irq_type, DRIVER_NAME, isp);
        if (status < 0) {
                dev_dbg(&i2c->dev, "can't get IRQ %d, err %d\n",
                                isp->irq, status);
index 48a7e2f0bdd3c87d9385bd32bb675d52abd88835..d9c92c5e007730ac62f7140ef51f5edb9d5eafb3 100644 (file)
@@ -1,4 +1,3 @@
-#define DEBUG
 /*
  * Copyright (C) 2004 Texas Instruments, Inc.
  *
@@ -933,7 +932,7 @@ static int menelaus_set_time(struct device *dev, struct rtc_time *t)
                return status;
        status = menelaus_write_reg(MENELAUS_RTC_WKDAY, BIN2BCD(t->tm_wday));
        if (status < 0) {
-               dev_err(&the_menelaus->client->dev, "rtc write reg %02x",
+               dev_err(&the_menelaus->client->dev, "rtc write reg %02x "
                                "err %d\n", MENELAUS_RTC_WKDAY, status);
                return status;
        }
index 524beea7fb19b7fe659436dcbbdf3844619fe519..6e135ac0834f9c867ae2e475fee47ae2bb05405c 100644 (file)
@@ -936,23 +936,24 @@ static const struct lguest_insns
 /* Now our patch routine is fairly simple (based on the native one in
  * paravirt.c).  If we have a replacement, we copy it in and return how much of
  * the available space we used. */
-static unsigned lguest_patch(u8 type, u16 clobber, void *insns, unsigned len)
+static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
+                            unsigned long addr, unsigned len)
 {
        unsigned int insn_len;
 
        /* Don't do anything special if we don't have a replacement */
        if (type >= ARRAY_SIZE(lguest_insns) || !lguest_insns[type].start)
-               return paravirt_patch_default(type, clobber, insns, len);
+               return paravirt_patch_default(type, clobber, ibuf, addr, len);
 
        insn_len = lguest_insns[type].end - lguest_insns[type].start;
 
        /* Similarly if we can't fit replacement (shouldn't happen, but let's
         * be thorough). */
        if (len < insn_len)
-               return paravirt_patch_default(type, clobber, insns, len);
+               return paravirt_patch_default(type, clobber, ibuf, addr, len);
 
        /* Copy in our instructions. */
-       memcpy(insns, lguest_insns[type].start, insn_len);
+       memcpy(ibuf, lguest_insns[type].start, insn_len);
        return insn_len;
 }
 
index 55a7940ca7325263fa69fc331cf9956b4ee20496..9e7752cc8002ea60ffa98d0f2e920b73b7f52447 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/bootmem.h>
 #include <linux/lguest_bus.h>
 #include <asm/io.h>
+#include <asm/paravirt.h>
 
 static ssize_t type_show(struct device *_dev,
                          struct device_attribute *attr, char *buf)
index 141ff9fa296e2a429436e1c402ef330df0c89cac..2120155929a6d0d860e4dffb78c2395cfcffdaa2 100644 (file)
@@ -580,8 +580,8 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
                /* the bio has been remapped so dispatch it */
 
                blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone,
-                                   tio->io->bio->bi_bdev->bd_dev, sector,
-                                   clone->bi_sector);
+                                   tio->io->bio->bi_bdev->bd_dev,
+                                   clone->bi_sector, sector);
 
                generic_make_request(clone);
        } else if (r < 0 || r == DM_MAPIO_REQUEUE) {
index aaaa61ea4217a5013da3933b768da1e99d261ed3..518d5d33546489e2d4de6fca87e5a9983ce05fb0 100644 (file)
@@ -200,14 +200,22 @@ config THINKPAD_ACPI_BAY
 config THINKPAD_ACPI_INPUT_ENABLED
        bool "Enable input layer support by default"
        depends on THINKPAD_ACPI
-       default y
+       default n
        ---help---
-         Enables hot key handling over the input layer by default.  If unset,
-         the driver does not enable any hot key handling by default, and also
-         starts up with a mostly empty keymap.
-
-         If you are not sure, say Y here.  Say N to retain the deprecated
-         behavior of ibm-acpi, and thinkpad-acpi for kernels up to 2.6.21.
+         This option enables thinkpad-acpi hot key handling over the input
+         layer at driver load time.  When it is unset, the driver does not
+         enable hot key handling by default, and also starts up with a mostly
+         empty keymap.
+
+         This option should be enabled if you have a new enough HAL or other
+         userspace support that properly handles the thinkpad-acpi event
+         device.  It auto-tunes the hot key support to those reported by the
+         firmware and enables it automatically.
+
+         If unsure, say N here to retain the old behaviour of ibm-acpi, and
+         thinkpad-acpi up to kernel 2.6.21: userspace will have to enable and
+         set up the thinkpad-acpi hot key handling using the sysfs interace
+         after loading the driver.
 
 
 endif # MISC_DEVICES
index 14ee06c8f12727ebd3d0a950b7e870d440616305..91da6880ae9390fc2e46490836cd7de97ba27367 100644 (file)
@@ -845,7 +845,7 @@ static struct sony_nc_event sony_C_events[] = {
 };
 
 /* SNC-only model map */
-struct dmi_system_id sony_nc_ids[] = {
+static struct dmi_system_id sony_nc_ids[] = {
                {
                        .ident = "Sony Vaio FE Series",
                        .callback = sony_nc_C_enable,
@@ -942,6 +942,11 @@ static int sony_nc_resume(struct acpi_device *device)
                }
        }
 
+       /* set the last requested brightness level */
+       if (sony_backlight_device &&
+                       !sony_backlight_update_status(sony_backlight_device))
+               printk(KERN_WARNING DRV_PFX "unable to restore brightness level");
+
        /* re-initialize models with specific requirements */
        dmi_check_system(sony_nc_ids);
 
index fa80f355e522ffc65f6a67caa96659e1e7f2e7d0..f6cd34a3dbaca218cf0ff8a19ff94d03c41cb8d7 100644 (file)
@@ -4668,12 +4668,15 @@ static int __init thinkpad_acpi_module_init(void)
                thinkpad_acpi_module_exit();
                return ret;
        }
+       tp_features.platform_drv_registered = 1;
+
        ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver);
        if (ret) {
                printk(IBM_ERR "unable to create sysfs driver attributes\n");
                thinkpad_acpi_module_exit();
                return ret;
        }
+       tp_features.platform_drv_attrs_registered = 1;
 
 
        /* Device initialization */
@@ -4756,8 +4759,11 @@ static void thinkpad_acpi_module_exit(void)
        if (tpacpi_pdev)
                platform_device_unregister(tpacpi_pdev);
 
-       tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver);
-       platform_driver_unregister(&tpacpi_pdriver);
+       if (tp_features.platform_drv_attrs_registered)
+               tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver);
+
+       if (tp_features.platform_drv_registered)
+               platform_driver_unregister(&tpacpi_pdriver);
 
        if (proc_dir)
                remove_proc_entry(IBM_PROC_DIR, acpi_root_dir);
index 88af089d64945b41a5150e545a5064ce1b6f0a5a..eee8809a50d9aed1ed796a20fe6f4c5a6ae4ae5c 100644 (file)
@@ -246,6 +246,8 @@ static struct {
        u16 wan:1;
        u16 fan_ctrl_status_undef:1;
        u16 input_device_registered:1;
+       u16 platform_drv_registered:1;
+       u16 platform_drv_attrs_registered:1;
 } tp_features;
 
 struct thinkpad_id_data {
index 8c86b802f212afa98ca588d06717e46d4b9afe3f..d091b2430b480254c4cb2743a28def0e6805486a 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <linux/device.h>
 #include <linux/fs.h>
+#include <linux/mm.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index 001c66dd3a94055a53e60da7f9988e6c6236b854..a8c0f436cdd2b3088e4cdeb165841f243e2823d0 100644 (file)
@@ -1555,6 +1555,7 @@ vortex_up(struct net_device *dev)
                mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
                mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
                vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
+               vp->mii.full_duplex = vp->full_duplex;
 
                vortex_check_media(dev, 1);
        }
index 83da1770bafb6cde94eb3bda73b97e2118996fae..90e0734e60375abe0325cc5cfd0c7a49e0b9c43f 100644 (file)
@@ -821,8 +821,9 @@ static int ax_probe(struct platform_device *pdev)
        dev->base_addr = (unsigned long)ei_status.mem;
 
        if (ei_status.mem == NULL) {
-               dev_err(&pdev->dev, "Cannot ioremap area (%08zx,%08zx)\n