Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Jan 2009 01:04:29 +0000 (17:04 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Jan 2009 01:04:29 +0000 (17:04 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (237 commits)
  Staging: android: binder: fix build errors
  Staging: android: add lowmemorykiller driver
  Staging: android: remove dummy android.c driver
  Staging: android: timed_gpio: Rename android_timed_gpio to timed_gpio
  Staging: android: add timed_gpio driver
  Staging: android: add ram_console driver
  Staging: android: add logging driver
  staging: android: binder: Fix use of euid
  Staging: android: binder: Fix gcc warnings about improper format specifiers for size_t in printk
  Staging: android: add binder driver
  Staging: add android framework
  Staging: epl: fix netdev->priv b0rkage
  Staging: epl: hr timers all run in hard irq context now
  Staging: epl: run Lindent on *.c files
  Staging: epl: run Lindent on *.h files
  Staging: epl: run Lindent on all user/*.h files
  Staging: epl: run Lindent on all kernel/*.h files
  Staging: add epl stack
  Staging: frontier: fix compiler warnings
  Staging: frontier: remove unused alphatrack_sysfs.c file
  ...

486 files changed:
.mailmap
Documentation/ABI/testing/sysfs-devices-memory
Documentation/DMA-mapping.txt
Documentation/DocBook/uio-howto.tmpl
Documentation/filesystems/Locking
Documentation/filesystems/proc.txt
Documentation/hwmon/adt7470
Documentation/ide/warm-plug-howto.txt
Documentation/ioctl/ioctl-number.txt
Documentation/kernel-doc-nano-HOWTO.txt
Documentation/kernel-parameters.txt
Documentation/kobject.txt
Documentation/kprobes.txt
Documentation/magic-number.txt
Documentation/memory-hotplug.txt
Documentation/mips/AU1xxx_IDE.README
Documentation/powerpc/cpu_features.txt
Documentation/s390/Debugging390.txt
Documentation/s390/cds.txt
Documentation/s390/s390dbf.txt
Documentation/sysctl/vm.txt
Documentation/vm/unevictable-lru.txt
Documentation/x86/zero-page.txt
MAINTAINERS
arch/alpha/include/asm/atomic.h
arch/arm/include/asm/atomic.h
arch/arm/kernel/ecard.c
arch/arm/kernel/kprobes.c
arch/arm/mach-aaec2000/core.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-lh7a40x/clcd.c
arch/arm/mach-netx/fb.c
arch/arm/mach-realview/core.h
arch/arm/mach-s3c2410/include/mach/spi.h
arch/arm/mach-versatile/core.h
arch/arm/plat-omap/include/mach/memory.h
arch/avr32/include/asm/atomic.h
arch/avr32/kernel/traps.c
arch/avr32/mach-at32ap/clock.c
arch/blackfin/include/asm/atomic.h
arch/cris/arch-v32/drivers/iop_fw_load.c
arch/cris/include/asm/atomic.h
arch/h8300/include/asm/atomic.h
arch/ia64/include/asm/atomic.h
arch/ia64/kernel/kprobes.c
arch/ia64/kernel/pci-dma.c
arch/ia64/mm/init.c
arch/ia64/sn/kernel/tiocx.c
arch/m68knommu/include/asm/atomic.h
arch/mips/include/asm/atomic.h
arch/mips/kernel/vpe.c
arch/parisc/include/asm/atomic.h
arch/powerpc/include/asm/atomic.h
arch/powerpc/include/asm/hugetlb.h
arch/powerpc/kernel/kprobes.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/mem.c
arch/s390/include/asm/atomic.h
arch/s390/include/asm/s390_rdev.h [deleted file]
arch/s390/kernel/kprobes.c
arch/s390/mm/init.c
arch/sh/include/asm/atomic.h
arch/sh/kernel/traps_32.c
arch/sh/mm/init.c
arch/sparc/include/asm/atomic_32.h
arch/sparc/include/asm/atomic_64.h
arch/um/kernel/trap.c
arch/x86/include/asm/atomic_32.h
arch/x86/include/asm/atomic_64.h
arch/x86/include/asm/unwind.h [deleted file]
arch/x86/kernel/kprobes.c
arch/x86/kernel/traps.c
arch/x86/mm/fault.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
block/bsg.c
block/genhd.c
drivers/acpi/processor_idle.c
drivers/ata/libata-scsi.c
drivers/base/attribute_container.c
drivers/base/base.h
drivers/base/bus.c
drivers/base/core.c
drivers/base/dd.c
drivers/base/driver.c
drivers/base/firmware_class.c
drivers/base/isa.c
drivers/base/memory.c
drivers/base/node.c
drivers/base/platform.c
drivers/base/power/main.c
drivers/base/power/trace.c
drivers/char/Kconfig
drivers/char/consolemap.c
drivers/char/mem.c
drivers/char/mwave/mwavedd.c
drivers/char/random.c
drivers/char/sysrq.c
drivers/edac/Kconfig
drivers/edac/Makefile
drivers/edac/edac_device.c
drivers/edac/edac_mc.c
drivers/edac/edac_pci.c
drivers/edac/edac_pci_sysfs.c
drivers/edac/i5400_edac.c [new file with mode: 0644]
drivers/edac/i82875p_edac.c
drivers/edac/mpc85xx_edac.c
drivers/firmware/dmi-id.c
drivers/firmware/dmi_scan.c
drivers/gpio/Kconfig
drivers/gpio/gpiolib.c
drivers/gpio/pca953x.c
drivers/gpio/twl4030-gpio.c
drivers/gpu/drm/drm_fops.c
drivers/gpu/drm/drm_sysfs.c
drivers/hwmon/adt7462.c
drivers/hwmon/adt7470.c
drivers/hwmon/adt7473.c
drivers/hwmon/applesmc.c
drivers/hwmon/hwmon.c
drivers/hwmon/ibmpex.c
drivers/hwmon/lm75.c
drivers/ide/Kconfig
drivers/ide/Makefile
drivers/ide/aec62xx.c
drivers/ide/alim15x3.c
drivers/ide/amd74xx.c
drivers/ide/au1xxx-ide.c
drivers/ide/cmd640.c
drivers/ide/cmd64x.c
drivers/ide/cs5520.c
drivers/ide/cy82c693.c
drivers/ide/falconide.c
drivers/ide/hpt366.c
drivers/ide/icside.c
drivers/ide/ide-acpi.c
drivers/ide/ide-atapi.c
drivers/ide/ide-cd.c
drivers/ide/ide-cd.h
drivers/ide/ide-disk.c
drivers/ide/ide-dma-sff.c
drivers/ide/ide-dma.c
drivers/ide/ide-floppy.c
drivers/ide/ide-gd.c
drivers/ide/ide-gd.h
drivers/ide/ide-h8300.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-park.c
drivers/ide/ide-pm.c
drivers/ide/ide-probe.c
drivers/ide/ide-proc.c
drivers/ide/ide-tape.c
drivers/ide/ide-taskfile.c
drivers/ide/ide.c
drivers/ide/it8172.c [new file with mode: 0644]
drivers/ide/it8213.c
drivers/ide/it821x.c
drivers/ide/ns87415.c
drivers/ide/palm_bk3710.c
drivers/ide/pdc202xx_new.c
drivers/ide/pdc202xx_old.c
drivers/ide/piix.c
drivers/ide/pmac.c
drivers/ide/q40ide.c
drivers/ide/qd65xx.c
drivers/ide/qd65xx.h
drivers/ide/sc1200.c
drivers/ide/scc_pata.c
drivers/ide/serverworks.c
drivers/ide/setup-pci.c
drivers/ide/sgiioc4.c
drivers/ide/siimage.c
drivers/ide/sis5513.c
drivers/ide/sl82c105.c
drivers/ide/slc90e66.c
drivers/ide/tc86c001.c
drivers/ide/triflex.c
drivers/ide/trm290.c
drivers/ide/tx4939ide.c
drivers/ide/umc8672.c
drivers/ide/via82cxxx.c
drivers/idle/i7300_idle.c
drivers/infiniband/core/sysfs.c
drivers/infiniband/core/ucm.c
drivers/infiniband/ulp/srp/ib_srp.c
drivers/isdn/mISDN/dsp_pipeline.c
drivers/lguest/lguest_device.c
drivers/macintosh/macio_asic.c
drivers/macintosh/therm_adt746x.c
drivers/media/dvb/dvb-core/dvbdev.c
drivers/media/video/v4l1-compat.c
drivers/memstick/core/memstick.c
drivers/memstick/core/mspro_block.c
drivers/memstick/host/tifm_ms.c
drivers/message/i2o/device.c
drivers/message/i2o/driver.c
drivers/message/i2o/i2o_proc.c
drivers/message/i2o/iop.c
drivers/misc/ibmasm/module.c
drivers/misc/ioc4.c
drivers/misc/sgi-gru/grumain.c
drivers/misc/sgi-xp/xp_main.c
drivers/misc/sgi-xp/xpc_main.c
drivers/misc/sgi-xp/xpnet.c
drivers/misc/tifm_7xx1.c
drivers/misc/tifm_core.c
drivers/mtd/devices/m25p80.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/maps/integrator-flash.c
drivers/mtd/maps/ixp2000.c
drivers/mtd/maps/ixp4xx.c
drivers/mtd/maps/omap_nor.c
drivers/mtd/maps/physmap.c
drivers/mtd/maps/physmap_of.c
drivers/mtd/mtdconcat.c
drivers/mtd/nand/fsl_upm.c
drivers/mtd/nand/plat_nand.c
drivers/mtd/nand/tmio_nand.c
drivers/mtd/onenand/generic.c
drivers/mtd/onenand/omap2.c
drivers/mtd/ubi/build.c
drivers/mtd/ubi/vmt.c
drivers/parport/ieee1284.c
drivers/pci/pci-driver.c
drivers/pnp/card.c
drivers/pnp/core.c
drivers/pnp/system.c
drivers/power/ds2760_battery.c
drivers/rapidio/rio-driver.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/class.c
drivers/rtc/interface.c
drivers/rtc/rtc-at32ap700x.c
drivers/rtc/rtc-au1xxx.c [new file with mode: 0644]
drivers/rtc/rtc-bfin.c
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-ds1216.c
drivers/rtc/rtc-ds1390.c
drivers/rtc/rtc-ds1511.c
drivers/rtc/rtc-ds1553.c
drivers/rtc/rtc-ds1672.c
drivers/rtc/rtc-ds3234.c
drivers/rtc/rtc-ep93xx.c
drivers/rtc/rtc-m48t59.c
drivers/rtc/rtc-max6902.c
drivers/rtc/rtc-mv.c [new file with mode: 0644]
drivers/rtc/rtc-pxa.c [new file with mode: 0644]
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sh.c
drivers/rtc/rtc-stk17ta8.c
drivers/rtc/rtc-test.c
drivers/rtc/rtc-twl4030.c
drivers/rtc/rtc-tx4939.c [new file with mode: 0644]
drivers/rtc/rtc-vr41xx.c
drivers/s390/Makefile
drivers/s390/block/dcssblk.c
drivers/s390/crypto/ap_bus.c
drivers/s390/kvm/kvm_virtio.c
drivers/s390/net/cu3088.c
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/s390/s390_rdev.c [deleted file]
drivers/serial/serial_core.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/atmel_spi.c
drivers/spi/pxa2xx_spi.c
drivers/spi/spi.c
drivers/spi/spi_bitbang.c
drivers/spi/spi_butterfly.c
drivers/spi/spi_gpio.c [new file with mode: 0644]
drivers/spi/spi_lm70llp.c
drivers/spi/spi_s3c24xx.c
drivers/thermal/thermal_sys.c
drivers/uio/uio.c
drivers/uio/uio_cif.c
drivers/uio/uio_pdrv_genirq.c
drivers/usb/core/usb.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/atmel_usba_udc.c
drivers/usb/gadget/fsl_qe_udc.c
drivers/usb/gadget/lh7a40x_udc.c
drivers/usb/gadget/pxa25x_udc.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/gadget/s3c2410_udc.c
drivers/video/aty/aty128fb.c
drivers/video/backlight/backlight.c
drivers/video/backlight/lcd.c
drivers/video/bfin-t350mcqb-fb.c
drivers/video/carminefb.c
drivers/video/cyber2000fb.c
drivers/video/fbmem.c
drivers/video/gbefb.c
drivers/video/geode/gx1fb_core.c
drivers/video/geode/gxfb_core.c
drivers/video/geode/lxfb_core.c
drivers/video/gxt4500.c
drivers/video/i810/i810_accel.c
drivers/video/intelfb/intelfbdrv.c
drivers/video/modedb.c
drivers/video/neofb.c
drivers/video/nvidia/nv_accel.c
drivers/video/output.c
drivers/video/pm3fb.c
drivers/video/sm501fb.c
drivers/video/via/viafbdev.c
drivers/virtio/virtio_pci.c
drivers/w1/w1.c
drivers/w1/w1_int.c
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenbus/xenbus_probe.h
firmware/dsp56k/bootstrap.asm
fs/Kconfig
fs/autofs4/autofs_i.h
fs/autofs4/dev-ioctl.c
fs/autofs4/expire.c
fs/autofs4/inode.c
fs/autofs4/waitq.c
fs/bfs/inode.c
fs/binfmt_misc.c
fs/block_dev.c
fs/buffer.c
fs/char_dev.c
fs/compat.c
fs/direct-io.c
fs/ecryptfs/crypto.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/file.c
fs/ecryptfs/inode.c
fs/ecryptfs/keystore.c
fs/ecryptfs/main.c
fs/ecryptfs/messaging.c
fs/ecryptfs/miscdev.c
fs/exec.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/fs-writeback.c
fs/fuse/control.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/minix/dir.c
fs/mpage.c
fs/ncpfs/getopt.c
fs/partitions/check.c
fs/proc/task_mmu.c
fs/select.c
fs/sync.c
fs/ubifs/super.c
include/asm-frv/atomic.h
include/asm-generic/bug.h
include/asm-generic/local.h
include/asm-generic/memory_model.h
include/asm-m32r/atomic.h
include/asm-m68k/atomic.h
include/asm-mn10300/atomic.h
include/asm-xtensa/atomic.h
include/linux/auto_dev-ioctl.h
include/linux/auto_fs4.h
include/linux/binfmts.h
include/linux/cgroup.h
include/linux/cpuset.h
include/linux/device.h
include/linux/fs.h
include/linux/fuse.h
include/linux/gfp.h
include/linux/hugetlb.h
include/linux/i2c/twl4030.h
include/linux/ide.h
include/linux/interrupt.h
include/linux/kernel.h
include/linux/klist.h
include/linux/kprobes.h
include/linux/memory.h
include/linux/memory_hotplug.h
include/linux/migrate.h
include/linux/miscdevice.h
include/linux/mm.h
include/linux/module.h
include/linux/mtd/concat.h
include/linux/node.h
include/linux/page-flags.h
include/linux/pagevec.h
include/linux/pci.h
include/linux/pci_ids.h
include/linux/percpu_counter.h
include/linux/platform_device.h
include/linux/pm.h
include/linux/poll.h
include/linux/rio_drv.h
include/linux/rmap.h
include/linux/sched.h
include/linux/spi/spi_gpio.h [new file with mode: 0644]
include/linux/swap.h
include/linux/types.h
include/linux/uio_driver.h
include/linux/unwind.h [deleted file]
include/linux/vmalloc.h
include/linux/writeback.h
init/Kconfig
init/do_mounts.c
init/do_mounts_md.c
init/main.c
ipc/ipc_sysctl.c
ipc/sem.c
ipc/shm.c
kernel/cgroup.c
kernel/compat.c
kernel/cpuset.c
kernel/dma-coherent.c
kernel/exit.c
kernel/fork.c
kernel/kmod.c
kernel/kprobes.c
kernel/ksysfs.c
kernel/module.c
kernel/panic.c
kernel/power/main.c
kernel/profile.c
kernel/signal.c
kernel/sys.c
kernel/sysctl.c
kernel/test_kprobes.c
kernel/time.c
kernel/tsacct.c
lib/bust_spinlocks.c
lib/dynamic_printk.c
lib/fault-inject.c
lib/klist.c
lib/kobject_uevent.c
lib/percpu_counter.c
lib/prio_heap.c
lib/proportions.c
lib/radix-tree.c
lib/swiotlb.c
lib/vsprintf.c
mm/Kconfig
mm/Makefile
mm/backing-dev.c
mm/bootmem.c
mm/filemap.c
mm/filemap_xip.c
mm/fremap.c
mm/hugetlb.c
mm/internal.h
mm/memcontrol.c
mm/memory.c
mm/memory_hotplug.c
mm/migrate.c
mm/mlock.c
mm/mmap.c
mm/mprotect.c
mm/oom_kill.c
mm/page-writeback.c
mm/page_alloc.c
mm/page_cgroup.c
mm/page_io.c
mm/rmap.c
mm/shmem.c
mm/swap.c
mm/swap_state.c
mm/swapfile.c
mm/tiny-shmem.c [deleted file]
mm/vmalloc.c
mm/vmscan.c
net/iucv/iucv.c
samples/firmware_class/firmware_sample_driver.c
samples/kobject/kobject-example.c
samples/kobject/kset-example.c
samples/markers/marker-example.c
samples/tracepoints/tracepoint-probe-sample.c
samples/tracepoints/tracepoint-probe-sample2.c
samples/tracepoints/tracepoint-sample.c
scripts/checkpatch.pl
scripts/markup_oops.pl [new file with mode: 0644]
sound/core/sound.c

index 97f7b4fb61398e2b0d4e3e6c2fc030f383849b39..4e83e7b52d15d2baf27f7f671483756c0c71c572 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -32,6 +32,7 @@ Christoph Hellwig <hch@lst.de>
 Corey Minyard <minyard@acm.org>
 David Brownell <david-b@pacbell.net>
 David Woodhouse <dwmw2@shinybook.infradead.org>
+Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 Domen Puncer <domen@coderock.org>
 Douglas Gilbert <dougg@torque.net>
 Ed L. Cashin <ecashin@coraid.com>
index 7a16fe1e2270d8e7353b209bd0dad24a5ce9b69e..9fe91c02ee40e4fb4bca0b1e7fb010f14d5554e3 100644 (file)
@@ -6,7 +6,6 @@ Description:
                internal state of the kernel memory blocks. Files could be
                added or removed dynamically to represent hot-add/remove
                operations.
-
 Users:         hotplug memory add/remove tools
                https://w3.opensource.ibm.com/projects/powerpc-utils/
 
@@ -19,6 +18,56 @@ Description:
                This is useful for a user-level agent to determine
                identify removable sections of the memory before attempting
                potentially expensive hot-remove memory operation
+Users:         hotplug memory remove tools
+               https://w3.opensource.ibm.com/projects/powerpc-utils/
+
+What:          /sys/devices/system/memory/memoryX/phys_device
+Date:          September 2008
+Contact:       Badari Pulavarty <pbadari@us.ibm.com>
+Description:
+               The file /sys/devices/system/memory/memoryX/phys_device
+               is read-only and is designed to show the name of physical
+               memory device.  Implementation is currently incomplete.
 
+What:          /sys/devices/system/memory/memoryX/phys_index
+Date:          September 2008
+Contact:       Badari Pulavarty <pbadari@us.ibm.com>
+Description:
+               The file /sys/devices/system/memory/memoryX/phys_index
+               is read-only and contains the section ID in hexadecimal
+               which is equivalent to decimal X contained in the
+               memory section directory name.
+
+What:          /sys/devices/system/memory/memoryX/state
+Date:          September 2008
+Contact:       Badari Pulavarty <pbadari@us.ibm.com>
+Description:
+               The file /sys/devices/system/memory/memoryX/state
+               is read-write.  When read, it's contents show the
+               online/offline state of the memory section.  When written,
+               root can toggle the the online/offline state of a removable
+               memory section (see removable file description above)
+               using the following commands.
+               # echo online > /sys/devices/system/memory/memoryX/state
+               # echo offline > /sys/devices/system/memory/memoryX/state
+
+               For example, if /sys/devices/system/memory/memory22/removable
+               contains a value of 1 and
+               /sys/devices/system/memory/memory22/state contains the
+               string "online" the following command can be executed by
+               by root to offline that section.
+               # echo offline > /sys/devices/system/memory/memory22/state
 Users:         hotplug memory remove tools
                https://w3.opensource.ibm.com/projects/powerpc-utils/
+
+What:          /sys/devices/system/node/nodeX/memoryY
+Date:          September 2008
+Contact:       Gary Hade <garyhade@us.ibm.com>
+Description:
+               When CONFIG_NUMA is enabled
+               /sys/devices/system/node/nodeX/memoryY is a symbolic link that
+               points to the corresponding /sys/devices/system/memory/memoryY
+               memory section directory.  For example, the following symbolic
+               link is created for memory section 9 on node0.
+               /sys/devices/system/node/node0/memory9 -> ../../memory/memory9
+
index c74fec8c2351168d1329c527183f3a975234030e..b2a4d6d244d932cf7cd72d3034fba0ba2c853dff 100644 (file)
@@ -26,7 +26,7 @@ mapped only for the time they are actually used and unmapped after the DMA
 transfer.
 
 The following API will work of course even on platforms where no such
-hardware exists, see e.g. include/asm-i386/pci.h for how it is implemented on
+hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on
 top of the virt_to_bus interface.
 
 First of all, you should make sure
index df87d1b93605ac54cf400bd7b8d44b0866d0789a..b787e4721c90d4134f2e579ecd46006a16ea4e4a 100644 (file)
@@ -41,6 +41,12 @@ GPL version 2.
 </abstract>
 
 <revhistory>
+       <revision>
+       <revnumber>0.6</revnumber>
+       <date>2008-12-05</date>
+       <authorinitials>hjk</authorinitials>
+       <revremark>Added description of portio sysfs attributes.</revremark>
+       </revision>
        <revision>
        <revnumber>0.5</revnumber>
        <date>2008-05-22</date>
@@ -318,6 +324,54 @@ interested in translating it, please email me
 offset = N * getpagesize();
 </programlisting>
 
+<para>
+       Sometimes there is hardware with memory-like regions that can not be
+       mapped with the technique described here, but there are still ways to
+       access them from userspace. The most common example are x86 ioports.
+       On x86 systems, userspace can access these ioports using
+       <function>ioperm()</function>, <function>iopl()</function>,
+       <function>inb()</function>, <function>outb()</function>, and similar
+       functions.
+</para>
+<para>
+       Since these ioport regions can not be mapped, they will not appear under
+       <filename>/sys/class/uio/uioX/maps/</filename> like the normal memory
+       described above. Without information about the port regions a hardware
+       has to offer, it becomes difficult for the userspace part of the
+       driver to find out which ports belong to which UIO device.
+</para>
+<para>
+       To address this situation, the new directory
+       <filename>/sys/class/uio/uioX/portio/</filename> was added. It only
+       exists if the driver wants to pass information about one or more port
+       regions to userspace. If that is the case, subdirectories named
+       <filename>port0</filename>, <filename>port1</filename>, and so on,
+       will appear underneath
+       <filename>/sys/class/uio/uioX/portio/</filename>.
+</para>
+<para>
+       Each <filename>portX/</filename> directory contains three read-only
+       files that show start, size, and type of the port region:
+</para>
+<itemizedlist>
+<listitem>
+       <para>
+       <filename>start</filename>: The first port of this region.
+       </para>
+</listitem>
+<listitem>
+       <para>
+       <filename>size</filename>: The number of ports in this region.
+       </para>
+</listitem>
+<listitem>
+       <para>
+       <filename>porttype</filename>: A string describing the type of port.
+       </para>
+</listitem>
+</itemizedlist>
+
+
 </sect1>
 </chapter>
 
@@ -339,12 +393,12 @@ offset = N * getpagesize();
 
 <itemizedlist>
 <listitem><para>
-<varname>char *name</varname>: Required. The name of your driver as
+<varname>const char *name</varname>: Required. The name of your driver as
 it will appear in sysfs. I recommend using the name of your module for this.
 </para></listitem>
 
 <listitem><para>
-<varname>char *version</varname>: Required. This string appears in
+<varname>const char *version</varname>: Required. This string appears in
 <filename>/sys/class/uio/uioX/version</filename>.
 </para></listitem>
 
@@ -355,6 +409,13 @@ mapping you need to fill one of the <varname>uio_mem</varname> structures.
 See the description below for details.
 </para></listitem>
 
+<listitem><para>
+<varname>struct uio_port port[ MAX_UIO_PORTS_REGIONS ]</varname>: Required
+if you want to pass information about ioports to userspace. For each port
+region you need to fill one of the <varname>uio_port</varname> structures.
+See the description below for details.
+</para></listitem>
+
 <listitem><para>
 <varname>long irq</varname>: Required. If your hardware generates an
 interrupt, it's your modules task to determine the irq number during
@@ -448,6 +509,42 @@ Please do not touch the <varname>kobj</varname> element of
 <varname>struct uio_mem</varname>! It is used by the UIO framework
 to set up sysfs files for this mapping. Simply leave it alone.
 </para>
+
+<para>
+Sometimes, your device can have one or more port regions which can not be
+mapped to userspace. But if there are other possibilities for userspace to
+access these ports, it makes sense to make information about the ports
+available in sysfs. For each region, you have to set up a
+<varname>struct uio_port</varname> in the <varname>port[]</varname> array.
+Here's a description of the fields of <varname>struct uio_port</varname>:
+</para>
+
+<itemizedlist>
+<listitem><para>
+<varname>char *porttype</varname>: Required. Set this to one of the predefined
+constants. Use <varname>UIO_PORT_X86</varname> for the ioports found in x86
+architectures.
+</para></listitem>
+
+<listitem><para>
+<varname>unsigned long start</varname>: Required if the port region is used.
+Fill in the number of the first port of this region.
+</para></listitem>
+
+<listitem><para>
+<varname>unsigned long size</varname>: Fill in the number of ports in this
+region. If <varname>size</varname> is zero, the region is considered unused.
+Note that you <emphasis>must</emphasis> initialize <varname>size</varname>
+with zero for all unused regions.
+</para></listitem>
+</itemizedlist>
+
+<para>
+Please do not touch the <varname>portio</varname> element of
+<varname>struct uio_port</varname>! It is used internally by the UIO
+framework to set up sysfs files for this region. Simply leave it alone.
+</para>
+
 </sect1>
 
 <sect1 id="adding_irq_handler">
index ccec55394380393ccf69a0272078ebd5465ceae3..cfbfa15a46ba6af6d642b8439f31ebf3abd46503 100644 (file)
@@ -397,7 +397,7 @@ prototypes:
 };
 
 locking rules:
-       All except ->poll() may block.
+       All may block.
                        BKL
 llseek:                        no      (see below)
 read:                  no
index 71df353e367c9e8c3f2833fe7114c875a6d49d3b..32e94635484f968c40291264d6e5b7df14d813ae 100644 (file)
@@ -1385,6 +1385,15 @@ swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer
 to retain dentry and inode caches.  Increasing vfs_cache_pressure beyond 100
 causes the kernel to prefer to reclaim dentries and inodes.
 
+dirty_background_bytes
+----------------------
+
+Contains the amount of dirty memory at which the pdflush background writeback
+daemon will start writeback.
+
+If dirty_background_bytes is written, dirty_background_ratio becomes a function
+of its value (dirty_background_bytes / the amount of dirtyable system memory).
+
 dirty_background_ratio
 ----------------------
 
@@ -1393,14 +1402,29 @@ pages + file cache, not including locked pages and HugePages), the number of
 pages at which the pdflush background writeback daemon will start writing out
 dirty data.
 
+If dirty_background_ratio is written, dirty_background_bytes becomes a function
+of its value (dirty_background_ratio * the amount of dirtyable system memory).
+
+dirty_bytes
+-----------
+
+Contains the amount of dirty memory at which a process generating disk writes
+will itself start writeback.
+
+If dirty_bytes is written, dirty_ratio becomes a function of its value
+(dirty_bytes / the amount of dirtyable system memory).
+
 dirty_ratio
------------------
+-----------
 
 Contains, as a percentage of the dirtyable system memory (free pages + mapped
 pages + file cache, not including locked pages and HugePages), the number of
 pages at which a process which is generating disk writes will itself start
 writing out dirty data.
 
+If dirty_ratio is written, dirty_bytes becomes a function of its value
+(dirty_ratio * the amount of dirtyable system memory).
+
 dirty_writeback_centisecs
 -------------------------
 
index 75d13ca147ccbe7234a85d4bf40ac715d3fa9c4d..8ce4aa0a0f5500cc5a6fbecc67644d4e1600dcf7 100644 (file)
@@ -31,15 +31,11 @@ Each of the measured inputs (temperature, fan speed) has corresponding high/low
 limit values. The ADT7470 will signal an ALARM if any measured value exceeds
 either limit.
 
-The ADT7470 DOES NOT sample all inputs continuously.  A single pin on the
-ADT7470 is connected to a multitude of thermal diodes, but the chip must be
-instructed explicitly to read the multitude of diodes.  If you want to use
-automatic fan control mode, you must manually read any of the temperature
-sensors or the fan control algorithm will not run.  The chip WILL NOT DO THIS
-AUTOMATICALLY; this must be done from userspace.  This may be a bug in the chip
-design, given that many other AD chips take care of this.  The driver will not
-read the registers more often than once every 5 seconds.  Further,
-configuration data is only read once per minute.
+The ADT7470 samples all inputs continuously.  A kernel thread is started up for
+the purpose of periodically querying the temperature sensors, thus allowing the
+automatic fan pwm control to set the fan speed.  The driver will not read the
+registers more often than once every 5 seconds.  Further, configuration data is
+only read once per minute.
 
 Special Features
 ----------------
@@ -72,5 +68,6 @@ pwm#_auto_point2_temp.
 Notes
 -----
 
-As stated above, the temperature inputs must be read periodically from
-userspace in order for the automatic pwm algorithm to run.
+The temperature inputs no longer need to be read periodically from userspace in
+order for the automatic pwm algorithm to run.  This was the case for earlier
+versions of the driver.
index d5885468b07261b283e3e65db5511ef2cf0c2c7c..98152bcd515aba70cba16d8815a61fb9c275dce9 100644 (file)
@@ -11,3 +11,8 @@ unplug old device(s) and plug new device(s)
 # echo -n "1" > /sys/class/ide_port/idex/scan
 
 done
+
+NOTE: please make sure that partitions are unmounted and that there are
+no other active references to devices before doing "delete_devices" step,
+also do not attempt "scan" step on devices currently in use -- otherwise
+results may be unpredictable and lead to data loss if you're unlucky
index 824699174436d9a49912873196e27f0d2a51c49a..f1d639903325ca697cd23f6e34e7074aba05daed 100644 (file)
@@ -84,7 +84,7 @@ Code  Seq#    Include File            Comments
 'B'    C0-FF                           advanced bbus
                                        <mailto:maassen@uni-freiburg.de>
 'C'    all     linux/soundcard.h
-'D'    all     asm-s390/dasd.h
+'D'    all     arch/s390/include/asm/dasd.h
 'E'    all     linux/input.h
 'F'    all     linux/fb.h
 'H'    all     linux/hiddev.h
@@ -105,7 +105,7 @@ Code        Seq#    Include File            Comments
 'S'    80-81   scsi/scsi_ioctl.h       conflict!
 'S'    82-FF   scsi/scsi.h             conflict!
 'T'    all     linux/soundcard.h       conflict!
-'T'    all     asm-i386/ioctls.h       conflict!
+'T'    all     arch/x86/include/asm/ioctls.h   conflict!
 'U'    00-EF   linux/drivers/usb/usb.h
 'V'    all     linux/vt.h
 'W'    00-1F   linux/watchdog.h        conflict!
@@ -120,7 +120,7 @@ Code        Seq#    Include File            Comments
                                        <mailto:natalia@nikhefk.nikhef.nl>
 'c'    00-7F   linux/comstats.h        conflict!
 'c'    00-7F   linux/coda.h            conflict!
-'c'    80-9F   asm-s390/chsc.h
+'c'    80-9F   arch/s390/include/asm/chsc.h
 'd'    00-FF   linux/char/drm/drm/h    conflict!
 'd'    00-DF   linux/video_decoder.h   conflict!
 'd'    F0-FF   linux/digi1.h
@@ -170,7 +170,7 @@ Code        Seq#    Include File            Comments
                                        <mailto:oe@port.de>
 0x80   00-1F   linux/fb.h
 0x81   00-1F   linux/videotext.h
-0x89   00-06   asm-i386/sockios.h
+0x89   00-06   arch/x86/include/asm/sockios.h
 0x89   0B-DF   linux/sockios.h
 0x89   E0-EF   linux/sockios.h         SIOCPROTOPRIVATE range
 0x89   F0-FF   linux/sockios.h         SIOCDEVPRIVATE range
index c6841eee9598ddd82932db9e4e4a451f9f33ad9d..d73fbd2b2b4503e4fb36325fe1ed2337eda6325f 100644 (file)
@@ -71,6 +71,11 @@ The @argument descriptions must begin on the very next line following
 this opening short function description line, with no intervening
 empty comment lines.
 
+If a function parameter is "..." (varargs), it should be listed in
+kernel-doc notation as:
+ * @...: description
+
+
 Example kernel-doc data structure comment.
 
 /**
@@ -282,6 +287,32 @@ struct my_struct {
 };
 
 
+Including documentation blocks in source files
+----------------------------------------------
+
+To facilitate having source code and comments close together, you can
+include kernel-doc documentation blocks that are free-form comments
+instead of being kernel-doc for functions, structures, unions,
+enums, or typedefs.  This could be used for something like a
+theory of operation for a driver or library code, for example.
+
+This is done by using a DOC: section keyword with a section title.  E.g.:
+
+/**
+ * DOC: Theory of Operation
+ *
+ * The whizbang foobar is a dilly of a gizmo.  It can do whatever you
+ * want it to do, at any time.  It reads your mind.  Here's how it works.
+ *
+ * foo bar splat
+ *
+ * The only drawback to this gizmo is that is can sometimes damage
+ * hardware, software, or its subject(s).
+ */
+
+DOC: sections are used in SGML templates files as indicated below.
+
+
 How to make new SGML template files
 -----------------------------------
 
@@ -302,6 +333,9 @@ exported using EXPORT_SYMBOL.
 !F<filename> <function [functions...]> is replaced by the
 documentation, in <filename>, for the functions listed.
 
+!P<filename> <section title> is replaced by the contents of the DOC:
+section titled <section title> from <filename>.
+Spaces are allowed in <section title>; do not quote the <section title>.
 
 Tim.
 */ <twaugh@redhat.com>
index a2d8805c03d5588f317a9677add758c94051e6a6..0b3f6711d2f1a5a084ddab87e3ce27b5efae72fb 100644 (file)
@@ -469,8 +469,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
        clearcpuid=BITNUM [X86]
                        Disable CPUID feature X for the kernel. See
-                       include/asm-x86/cpufeature.h for the valid bit numbers.
-                       Note the Linux specific bits are not necessarily
+                       arch/x86/include/asm/cpufeature.h for the valid bit
+                       numbers. Note the Linux specific bits are not necessarily
                        stable over kernel options, but the vendor specific
                        ones should be.
                        Also note that user programs calling CPUID directly
@@ -551,6 +551,11 @@ and is between 256 and 4096 characters. It is defined in the file
                        not work reliably with all consoles, but is known
                        to work with serial and VGA consoles.
 
+       coredump_filter=
+                       [KNL] Change the default value for
+                       /proc/<pid>/coredump_filter.
+                       See also Documentation/filesystems/proc.txt.
+
        cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
                        Format:
                        <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
@@ -1117,6 +1122,8 @@ and is between 256 and 4096 characters. It is defined in the file
                        If there are multiple matching configurations changing
                        the same attribute, the last one is used.
 
+       lmb=debug       [KNL] Enable lmb debug messages.
+
        load_ramdisk=   [RAM] List of ramdisks to load from floppy
                        See Documentation/blockdev/ramdisk.txt.
 
@@ -1569,6 +1576,10 @@ and is between 256 and 4096 characters. It is defined in the file
 
        nr_uarts=       [SERIAL] maximum number of UARTs to be registered.
 
+       ohci1394_dma=early      [HW] enable debugging via the ohci1394 driver.
+                       See Documentation/debugging-via-ohci1394.txt for more
+                       info.
+
        olpc_ec_timeout= [OLPC] ms delay when issuing EC commands
                        Rather than timing out after 20 ms if an EC
                        command is not properly ACKed, override the length
@@ -1793,10 +1804,10 @@ and is between 256 and 4096 characters. It is defined in the file
                        autoconfiguration.
                        Ranges are in pairs (memory base and size).
 
-       dynamic_printk
-                       Enables pr_debug()/dev_dbg() calls if
-                       CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. These can also
-                       be switched on/off via <debugfs>/dynamic_printk/modules
+       dynamic_printk  Enables pr_debug()/dev_dbg() calls if
+                       CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled.
+                       These can also be switched on/off via
+                       <debugfs>/dynamic_printk/modules
 
        print-fatal-signals=
                        [KNL] debug: print fatal signals
@@ -1884,7 +1895,7 @@ and is between 256 and 4096 characters. It is defined in the file
 
        reboot=         [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode
                        Format: <reboot_mode>[,<reboot_mode2>[,...]]
-                       See arch/*/kernel/reboot.c or arch/*/kernel/process.c                   
+                       See arch/*/kernel/reboot.c or arch/*/kernel/process.c
 
        relax_domain_level=
                        [KNL, SMP] Set scheduler's default relax_domain_level.
@@ -2432,8 +2443,8 @@ and is between 256 and 4096 characters. It is defined in the file
                        Format:
                        <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
 
-       norandmaps      Don't use address space randomization
-                       Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space
+       norandmaps      Don't use address space randomization.  Equivalent to
+                       echo 0 > /proc/sys/kernel/randomize_va_space
 
 ______________________________________________________________________
 
index f5d2aad65a672ce65082769b835d621bac11e59a..b2e374586bd8627719167011a992ec3eb81a1c96 100644 (file)
@@ -118,8 +118,8 @@ the name of the kobject, call kobject_rename():
 
     int kobject_rename(struct kobject *kobj, const char *new_name);
 
-Note kobject_rename does perform any locking or have a solid notion of
-what names are valid so the provide must provide their own sanity checking
+kobject_rename does not perform any locking or have a solid notion of
+what names are valid so the caller must provide their own sanity checking
 and serialization.
 
 There is a function called kobject_set_name() but that is legacy cruft and
index a79633d702bff23230bb0d76cb68565e078b4fb2..48b3de90eb1eb03ceb1929e4228ae3a57debc526 100644 (file)
@@ -497,7 +497,10 @@ The first column provides the kernel address where the probe is inserted.
 The second column identifies the type of probe (k - kprobe, r - kretprobe
 and j - jprobe), while the third column specifies the symbol+offset of
 the probe. If the probed function belongs to a module, the module name
-is also specified.
+is also specified. Following columns show probe status. If the probe is on
+a virtual address that is no longer valid (module init sections, module
+virtual addresses that correspond to modules that've been unloaded),
+such probes are marked with [GONE].
 
 /debug/kprobes/enabled: Turn kprobes ON/OFF
 
index 95070028d15eeae7e0bfb13993932eb40e2b84b1..505f19607542d5a328aebb1b06a331abbd967744 100644 (file)
@@ -125,14 +125,14 @@ TRIDENT_CARD_MAGIC    0x5072696E  trident_card      sound/oss/trident.c
 ROUTER_MAGIC          0x524d4157  wan_device        include/linux/wanrouter.h
 SCC_MAGIC             0x52696368  gs_port           drivers/char/scc.h
 SAVEKMSG_MAGIC1       0x53415645  savekmsg          arch/*/amiga/config.c
-GDA_MAGIC             0x58464552  gda               include/asm-mips64/sn/gda.h
+GDA_MAGIC             0x58464552  gda               arch/mips/include/asm/sn/gda.h
 RED_MAGIC1            0x5a2cf071  (any)             mm/slab.c
 STL_PORTMAGIC         0x5a7182c9  stlport           include/linux/stallion.h
 EEPROM_MAGIC_VALUE    0x5ab478d2  lanai_dev         drivers/atm/lanai.c
 HDLCDRV_MAGIC         0x5ac6e778  hdlcdrv_state     include/linux/hdlcdrv.h
 EPCA_MAGIC            0x5c6df104  channel           include/linux/epca.h
 PCXX_MAGIC            0x5c6df104  channel           drivers/char/pcxx.h
-KV_MAGIC              0x5f4b565f  kernel_vars_s     include/asm-mips64/sn/klkernvars.h
+KV_MAGIC              0x5f4b565f  kernel_vars_s     arch/mips/include/asm/sn/klkernvars.h
 I810_STATE_MAGIC      0x63657373  i810_state        sound/oss/i810_audio.c
 TRIDENT_STATE_MAGIC   0x63657373  trient_state      sound/oss/trident.c
 M3_CARD_MAGIC         0x646e6f50  m3_card           sound/oss/maestro3.c
@@ -158,7 +158,7 @@ CCB_MAGIC             0xf2691ad2  ccb               drivers/scsi/ncr53c8xx.c
 QUEUE_MAGIC_FREE      0xf7e1c9a3  queue_entry       drivers/scsi/arm/queue.c
 QUEUE_MAGIC_USED      0xf7e1cc33  queue_entry       drivers/scsi/arm/queue.c
 HTB_CMAGIC            0xFEFAFEF1  htb_class         net/sched/sch_htb.c
-NMI_MAGIC             0x48414d4d455201 nmi_s        include/asm-mips64/sn/nmi.h
+NMI_MAGIC             0x48414d4d455201 nmi_s        arch/mips/include/asm/sn/nmi.h
 
 Note that there are also defined special per-driver magic numbers in sound
 memory management. See include/sound/sndmagic.h for complete list of them. Many
index 168117bd6ee8b8d7eafbb72c626a2434556f4cc9..4c2ecf537a4ad5d1edf47d5c5295416650364bd3 100644 (file)
@@ -124,7 +124,7 @@ config options.
     This option can be kernel module too.
 
 --------------------------------
-3 sysfs files for memory hotplug
+4 sysfs files for memory hotplug
 --------------------------------
 All sections have their device information under /sys/devices/system/memory as
 
@@ -138,11 +138,12 @@ For example, assume 1GiB section size. A device for a memory starting at
 (0x100000000 / 1Gib = 4)
 This device covers address range [0x100000000 ... 0x140000000)
 
-Under each section, you can see 3 files.
+Under each section, you can see 4 files.
 
 /sys/devices/system/memory/memoryXXX/phys_index
 /sys/devices/system/memory/memoryXXX/phys_device
 /sys/devices/system/memory/memoryXXX/state
+/sys/devices/system/memory/memoryXXX/removable
 
 'phys_index' : read-only and contains section id, same as XXX.
 'state'      : read-write
@@ -150,10 +151,20 @@ Under each section, you can see 3 files.
                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.
+'removable'  : read-only: contains an integer value indicating
+               whether the memory section is removable or not
+               removable.  A value of 1 indicates that the memory
+               section is removable and a value of 0 indicates that
+               it is not removable.
 
 NOTE:
   These directories/files appear after physical memory hotplug phase.
 
+If CONFIG_NUMA is enabled the
+/sys/devices/system/memory/memoryXXX memory section
+directories can also be accessed via symbolic links located in
+the /sys/devices/system/node/node* directories.  For example:
+/sys/devices/system/node/node0/memory9 -> ../../memory/memory9
 
 --------------------------------
 4. Physical memory hot-add phase
@@ -365,7 +376,6 @@ node if necessary.
   - 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.
index 25a6ed1aaa5b1e3e7aa2e774a7beab34f78001f9..f54962aea84dd571ef0f2f25adb1381b9ce69335 100644 (file)
@@ -44,7 +44,7 @@ FILES, CONFIGS AND COMPATABILITY
 
 Two files are introduced:
 
-  a) 'include/asm-mips/mach-au1x00/au1xxx_ide.h'
+  a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h'
      containes : struct _auide_hwif
                  timing parameters for PIO mode 0/1/2/3/4
                  timing parameters for MWDMA 0/1/2
index 472739880e87a9c527fb8fed2df591b2669a4c81..ffa4183fdb8b97f66dfd2fb0d8ba8bfa4a98995b 100644 (file)
@@ -31,7 +31,7 @@ anyways).
 
 After detecting the processor type, the kernel patches out sections of code
 that shouldn't be used by writing nop's over it. Using cpufeatures requires
-just 2 macros (found in include/asm-ppc/cputable.h), as seen in head.S
+just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S
 transfer_to_handler:
 
        #ifdef CONFIG_ALTIVEC
index d30a281c570f025c35234fd52f2a899e29bc0ec2..10711d9f078860513959b4cbf7dfa7d71e21a409 100644 (file)
@@ -1402,7 +1402,7 @@ Syscalls are implemented on Linux for S390 by the Supervisor call instruction (S
 possibilities of these as the instruction is made up of a  0xA opcode & the second byte being
 the syscall number. They are traced using the simple command.
 TR SVC  <Optional value or range>
-the syscalls are defined in linux/include/asm-s390/unistd.h
+the syscalls are defined in linux/arch/s390/include/asm/unistd.h
 e.g. to trace all file opens just do
 TR SVC 5 ( as this is the syscall number of open )
 
index c4b7b2bd369ae74949cfd1182346dbc1d12427d6..480a78ef5a1e4240ced3abf810465c00a937f235 100644 (file)
@@ -98,7 +98,7 @@ platform. Some of the interface routines are specific to Linux/390 and some
 of them can be found on other Linux platforms implementations too.
 Miscellaneous function prototypes, data declarations, and macro definitions
 can be found in the architecture specific C header file
-linux/include/asm-s390/irq.h.
+linux/arch/s390/include/asm/irq.h.
 
 Overview of CDS interface concepts
 
index e05420973698a41002d77123c3aa9db8ecebc52d..2d10053dd97ea69ca314305f25b57bafaeab9e6c 100644 (file)
@@ -2,7 +2,7 @@ S390 Debug Feature
 ==================
 
 files: arch/s390/kernel/debug.c
-       include/asm-s390/debug.h
+       arch/s390/include/asm/debug.h
 
 Description:
 ------------
index d79eeda7a699cbeb72ad0a03332388f8d8a68eeb..cd05994a49e69795db29f75675180371e1fe3ae4 100644 (file)
@@ -41,7 +41,8 @@ Currently, these files are in /proc/sys/vm:
 
 ==============================================================
 
-dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
+dirty_bytes, dirty_ratio, dirty_background_bytes,
+dirty_background_ratio, dirty_expire_centisecs,
 dirty_writeback_centisecs, highmem_is_dirtyable,
 vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout,
 drop-caches, hugepages_treat_as_movable:
index 125eed560e5a1bfb25d08ee7ad903d3efd8faef4..0706a7282a8ca6ce26b39fd7d7d7c930d6891c94 100644 (file)
@@ -137,13 +137,6 @@ shrink_page_list() where they will be detected when vmscan walks the reverse
 map in try_to_unmap().  If try_to_unmap() returns SWAP_MLOCK, shrink_page_list()
 will cull the page at that point.
 
-Note that for anonymous pages, shrink_page_list() attempts to add the page to
-the swap cache before it tries to unmap the page.  To avoid this unnecessary
-consumption of swap space, shrink_page_list() calls try_to_munlock() to check
-whether any VM_LOCKED vmas map the page without attempting to unmap the page.
-If try_to_munlock() returns SWAP_MLOCK, shrink_page_list() will cull the page
-without consuming swap space.  try_to_munlock() will be described below.
-
 To "cull" an unevictable page, vmscan simply puts the page back on the lru
 list using putback_lru_page()--the inverse operation to isolate_lru_page()--
 after dropping the page lock.  Because the condition which makes the page
@@ -190,8 +183,8 @@ several places:
    in the VM_LOCKED flag being set for the vma.
 3) in the fault path, if mlocked pages are "culled" in the fault path,
    and when a VM_LOCKED stack segment is expanded.
-4) as mentioned above, in vmscan:shrink_page_list() with attempting to
-   reclaim a page in a VM_LOCKED vma--via try_to_unmap() or try_to_munlock().
+4) as mentioned above, in vmscan:shrink_page_list() when attempting to
+   reclaim a page in a VM_LOCKED vma via try_to_unmap().
 
 Mlocked pages become unlocked and rescued from the unevictable list when:
 
@@ -260,9 +253,9 @@ mlock_fixup() filters several classes of "special" vmas:
 
 2) vmas mapping hugetlbfs page are already effectively pinned into memory.
    We don't need nor want to mlock() these pages.  However, to preserve the
-   prior behavior of mlock()--before the unevictable/mlock changes--mlock_fixup()
-   will call make_pages_present() in the hugetlbfs vma range to allocate the
-   huge pages and populate the ptes.
+   prior behavior of mlock()--before the unevictable/mlock changes--
+   mlock_fixup() will call make_pages_present() in the hugetlbfs vma range
+   to allocate the huge pages and populate the ptes.
 
 3) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of
    kernel pages, such as the vdso page, relay channel pages, etc.  These pages
@@ -322,7 +315,7 @@ __mlock_vma_pages_range()--the same function used to mlock a vma range--
 passing a flag to indicate that munlock() is being performed.
 
 Because the vma access protections could have been changed to PROT_NONE after
-faulting in and mlocking some pages, get_user_pages() was unreliable for visiting
+faulting in and mlocking pages, get_user_pages() was unreliable for visiting
 these pages for munlocking.  Because we don't want to leave pages mlocked(),
 get_user_pages() was enhanced to accept a flag to ignore the permissions when
 fetching the pages--all of which should be resident as a result of previous
@@ -416,8 +409,8 @@ Mlocked Pages:  munmap()/exit()/exec() System Call Handling
 When unmapping an mlocked region of memory, whether by an explicit call to
 munmap() or via an internal unmap from exit() or exec() processing, we must
 munlock the pages if we're removing the last VM_LOCKED vma that maps the pages.
-Before the unevictable/mlock changes, mlocking did not mark the pages in any way,
-so unmapping them required no processing.
+Before the unevictable/mlock changes, mlocking did not mark the pages in any
+way, so unmapping them required no processing.
 
 To munlock a range of memory under the unevictable/mlock infrastructure, the
 munmap() hander and task address space tear down function call
@@ -517,12 +510,10 @@ couldn't be mlocked.
 Mlocked pages:  try_to_munlock() Reverse Map Scan
 
 TODO/FIXME:  a better name might be page_mlocked()--analogous to the
-page_referenced() reverse map walker--especially if we continue to call this
-from shrink_page_list().  See related TODO/FIXME below.
+page_referenced() reverse map walker.
 
-When munlock_vma_page()--see "Mlocked Pages:  munlock()/munlockall() System
-Call Handling" above--tries to munlock a page, or when shrink_page_list()
-encounters an anonymous page that is not yet in the swap cache, they need to
+When munlock_vma_page()--see "Mlocked Pages:  munlock()/munlockall()
+System Call Handling" above--tries to munlock a page, it needs to
 determine whether or not the page is mapped by any VM_LOCKED vma, without
 actually attempting to unmap all ptes from the page.  For this purpose, the
 unevictable/mlock infrastructure introduced a variant of try_to_unmap() called
@@ -535,10 +526,7 @@ for VM_LOCKED vmas.  When such a vma is found for anonymous pages and file
 pages mapped in linear VMAs, as in the try_to_unmap() case, the functions
 attempt to acquire the associated mmap semphore, mlock the page via
 mlock_vma_page() and return SWAP_MLOCK.  This effectively undoes the
-pre-clearing of the page's PG_mlocked done by munlock_vma_page() and informs
-shrink_page_list() that the anonymous page should be culled rather than added
-to the swap cache in preparation for a try_to_unmap() that will almost
-certainly fail.
+pre-clearing of the page's PG_mlocked done by munlock_vma_page.
 
 If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap
 semaphore, it will return SWAP_AGAIN.  This will allow shrink_page_list()
@@ -557,10 +545,7 @@ However, the scan can terminate when it encounters a VM_LOCKED vma and can
 successfully acquire the vma's mmap semphore for read and mlock the page.
 Although try_to_munlock() can be called many [very many!] times when
 munlock()ing a large region or tearing down a large address space that has been
-mlocked via mlockall(), overall this is a fairly rare event.  In addition,
-although shrink_page_list() calls try_to_munlock() for every anonymous page that
-it handles that is not yet in the swap cache, on average anonymous pages will
-have very short reverse map lists.
+mlocked via mlockall(), overall this is a fairly rare event.
 
 Mlocked Page:  Page Reclaim in shrink_*_list()
 
@@ -588,8 +573,8 @@ Some examples of these unevictable pages on the LRU lists are:
    munlock_vma_page() was forced to let the page back on to the normal
    LRU list for vmscan to handle.
 
-shrink_inactive_list() also culls any unevictable pages that it finds
-on the inactive lists, again diverting them to the appropriate zone's unevictable
+shrink_inactive_list() also culls any unevictable pages that it finds on
+the inactive lists, again diverting them to the appropriate zone's unevictable
 lru list.  shrink_inactive_list() should only see SHM_LOCKed pages that became
 SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or
 pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from
@@ -597,19 +582,7 @@ the lru to recheck via try_to_munlock().  shrink_inactive_list() won't notice
 the latter, but will pass on to shrink_page_list().
 
 shrink_page_list() again culls obviously unevictable pages that it could
-encounter for similar reason to shrink_inactive_list().  As already discussed,
-shrink_page_list() proactively looks for anonymous pages that should have
-PG_mlocked set but don't--these would not be detected by page_evictable()--to
-avoid adding them to the swap cache unnecessarily.  File pages mapped into
+encounter for similar reason to shrink_inactive_list().  Pages mapped into
 VM_LOCKED vmas but without PG_mlocked set will make it all the way to
-try_to_unmap().  shrink_page_list() will divert them to the unevictable list when
-try_to_unmap() returns SWAP_MLOCK, as discussed above.
-
-TODO/FIXME:  If we can enhance the swap cache to reliably remove entries
-with page_count(page) > 2, as long as all ptes are mapped to the page and
-not the swap entry, we can probably remove the call to try_to_munlock() in
-shrink_page_list() and just remove the page from the swap cache when
-try_to_unmap() returns SWAP_MLOCK.   Currently, remove_exclusive_swap_page()
-doesn't seem to allow that.
-
-
+try_to_unmap().  shrink_page_list() will divert them to the unevictable list
+when try_to_unmap() returns SWAP_MLOCK, as discussed above.
index 169ad423a3d12243023d5807d1d7a4025d1a3978..4f913857b8a26bae558c5b0f30a6bba0799fcbf9 100644 (file)
@@ -3,7 +3,7 @@ protocol of kernel. These should be filled by bootloader or 16-bit
 real-mode setup code of the kernel. References/settings to it mainly
 are in:
 
-  include/asm-x86/bootparam.h
+  arch/x86/include/asm/bootparam.h
 
 
 Offset Proto   Name            Meaning
index 141aff67bd6df3eae4545637cadeaffd7d0d368b..094dd52d73093f4f96679315b0c172f368ff1780 100644 (file)
@@ -616,7 +616,7 @@ M:  mkpetch@internode.on.net
 S:     Maintained
 
 ARM/TOSA MACHINE SUPPORT
-P:     Dmitry Baryshkov
+P:     Dmitry Eremin-Solenikov
 M:     dbaryshkov@gmail.com
 P:     Dirk Opfer
 M:     dirk@opfer-online.de
@@ -1092,11 +1092,8 @@ S:       Maintained
 
 CHECKPATCH
 P:     Andy Whitcroft
-M:     apw@shadowen.org
-P:     Randy Dunlap
-M:     rdunlap@xenotime.net
-P:     Joel Schopp
-M:     jschopp@austin.ibm.com
+M:     apw@canonical.com
+L:     linux-kernel@vger.kernel.org
 S:     Supported
 
 CISCO 10G ETHERNET DRIVER
index ca88e54dec93774770f3eb93629d908db69e499e..62b363584b2bda3761263d53a7cd17c30890debe 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _ALPHA_ATOMIC_H
 #define _ALPHA_ATOMIC_H
 
+#include <linux/types.h>
 #include <asm/barrier.h>
 #include <asm/system.h>
 
  */
 
 
-/*
- * Counter is volatile to make sure gcc doesn't try to be clever
- * and move things around on us. We need to use _exactly_ the address
- * the user gave us, not some alias that contains the same information.
- */
-typedef struct { volatile int counter; } atomic_t;
-typedef struct { volatile long counter; } atomic64_t;
-
 #define ATOMIC_INIT(i)         ( (atomic_t) { (i) } )
 #define ATOMIC64_INIT(i)       ( (atomic64_t) { (i) } )
 
index 325f881ccb50204041ed15b824ae0b73e2dcae3f..ee99723b3a6c4899283a76ba26c7140c08a146dd 100644 (file)
 #define __ASM_ARM_ATOMIC_H
 
 #include <linux/compiler.h>
+#include <linux/types.h>
 #include <asm/system.h>
 
-typedef struct { volatile int counter; } atomic_t;
-
 #define ATOMIC_INIT(i) { (i) }
 
 #ifdef __KERNEL__
index 60c079d8535528d6aa755b6d8fd488a13eaad560..eed2f795e1b32be8dd539b9cecb0436d013ade5f 100644 (file)
@@ -817,7 +817,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
        ec->dma = NO_DMA;
        ec->ops = &ecard_default_ops;
 
-       snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot);
+       dev_set_name(&ec->dev, "ecard%d", slot);
        ec->dev.parent = NULL;
        ec->dev.bus = &ecard_bus_type;
        ec->dev.dma_mask = &ec->dma_mask;
index 3f9abe0e9aff7e124fd399ce4fd9c4a47380c044..f692efddd4497b0cc505f0eb9a3a526c922489a2 100644 (file)
@@ -92,9 +92,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
        if (p->ainsn.insn) {
-               mutex_lock(&kprobe_mutex);
                free_insn_slot(p->ainsn.insn, 0);
-               mutex_unlock(&kprobe_mutex);
                p->ainsn.insn = NULL;
        }
 }
index 50e13965dfed159e3f4b0009b60c29353e31ceef..b5c5fc6ba3a9d32d39a0d6e4379c8de5d2ffbd42 100644 (file)
@@ -212,7 +212,7 @@ static struct clcd_board clcd_plat_data = {
 
 static struct amba_device clcd_device = {
        .dev            = {
-               .bus_id                 = "mb:16",
+               .init_name              = "mb:16",
                .coherent_dma_mask      = ~0,
                .platform_data          = &clcd_plat_data,
        },
index 4781f323703bdcf782914999ad576acc9a2227e9..6d9152de6074f1744965b2274d25a2ea02340bf5 100644 (file)
@@ -409,7 +409,7 @@ static struct amba_pl010_data ep93xx_uart_data = {
 
 static struct amba_device uart1_device = {
        .dev            = {
-               .bus_id         = "apb:uart1",
+               .init_name      = "apb:uart1",
                .platform_data  = &ep93xx_uart_data,
        },
        .res            = {
@@ -423,7 +423,7 @@ static struct amba_device uart1_device = {
 
 static struct amba_device uart2_device = {
        .dev            = {
-               .bus_id         = "apb:uart2",
+               .init_name      = "apb:uart2",
                .platform_data  = &ep93xx_uart_data,
        },
        .res            = {
@@ -437,7 +437,7 @@ static struct amba_device uart2_device = {
 
 static struct amba_device uart3_device = {
        .dev            = {
-               .bus_id         = "apb:uart3",
+               .init_name      = "apb:uart3",
                .platform_data  = &ep93xx_uart_data,
        },
        .res            = {
index c89c949b4d459930fc7ed6d0098cbe8e7126f3fa..6f8872913073f9ba8b4527ed0ffd50d22cafa84e 100644 (file)
@@ -37,7 +37,7 @@ static struct amba_pl010_data integrator_uart_data;
 
 static struct amba_device rtc_device = {
        .dev            = {
-               .bus_id = "mb:15",
+               .init_name = "mb:15",
        },
        .res            = {
                .start  = INTEGRATOR_RTC_BASE,
@@ -50,7 +50,7 @@ static struct amba_device rtc_device = {
 
 static struct amba_device uart0_device = {
        .dev            = {
-               .bus_id = "mb:16",
+               .init_name = "mb:16",
                .platform_data = &integrator_uart_data,
        },
        .res            = {
@@ -64,7 +64,7 @@ static struct amba_device uart0_device = {
 
 static struct amba_device uart1_device = {
        .dev            = {
-               .bus_id = "mb:17",
+               .init_name = "mb:17",
                .platform_data = &integrator_uart_data,
        },
        .res            = {
@@ -78,7 +78,7 @@ static struct amba_device uart1_device = {
 
 static struct amba_device kmi0_device = {
        .dev            = {
-               .bus_id = "mb:18",
+               .init_name = "mb:18",
        },
        .res            = {
                .start  = KMI0_BASE,
@@ -91,7 +91,7 @@ static struct amba_device kmi0_device = {
 
 static struct amba_device kmi1_device = {
        .dev            = {
-               .bus_id = "mb:19",
+               .init_name = "mb:19",
        },
        .res            = {
                .start  = KMI1_BASE,
index 427c2d8dc1239bc835121f4b3e19956c5b0721c8..4ac04055c2eadaefbffc0bdfa28372ab8d718ec9 100644 (file)
@@ -407,7 +407,7 @@ static struct mmc_platform_data mmc_data = {
 
 static struct amba_device mmc_device = {
        .dev            = {
-               .bus_id = "mb:1c",
+               .init_name = "mb:1c",
                .platform_data = &mmc_data,
        },
        .res            = {
@@ -421,7 +421,7 @@ static struct amba_device mmc_device = {
 
 static struct amba_device aaci_device = {
        .dev            = {
-               .bus_id = "mb:1d",
+               .init_name = "mb:1d",
        },
        .res            = {
                .start  = INTCP_PA_AACI_BASE,
@@ -532,7 +532,7 @@ static struct clcd_board clcd_data = {
 
 static struct amba_device clcd_device = {
        .dev            = {
-               .bus_id = "mb:c0",
+               .init_name = "mb:c0",
                .coherent_dma_mask = ~0,
                .platform_data = &clcd_data,
        },
index a2a543258fc371d5d36123ca394b4f3774866f34..c472b9e8b37cd3bf6710ae555b0e356b3ab9f01d 100644 (file)
@@ -207,7 +207,7 @@ static struct clcd_board clcd_platform_data = {
 static struct amba_device name##_device = {                    \
        .dev = {                                                \
                .coherent_dma_mask = ~0,                        \
-               .bus_id = busid,                                \
+               .init_name = busid,                             \
                .platform_data = plat,                          \
                },                                              \
        .res = {                                                \
index 8f1f992f002ee6804e19edf7cfd552a993f2f58d..ea8fa8898fe8570455d499705f6cba8fd5c68c74 100644 (file)
@@ -91,7 +91,7 @@ void clk_put(struct clk *clk)
 
 static struct amba_device fb_device = {
        .dev            = {
-               .bus_id = "fb",
+               .init_name = "fb",
                .coherent_dma_mask = ~0,
        },
        .res            = {
index 63be2abdc19ce299d52556ef4e68a28de6edabd8..44269b162d4918e468542ab58a3627cda43c014d 100644 (file)
@@ -31,7 +31,7 @@
 static struct amba_device name##_device = {                    \
        .dev            = {                                     \
                .coherent_dma_mask = ~0,                        \
-               .bus_id = busid,                                \
+               .init_name = busid,                             \
                .platform_data = plat,                          \
        },                                                      \
        .res            = {                                     \
index 774f3adfe8ade0fb5bef6a5d2defc5af3fc4e6bf..1d300fb112b170777a0025d85a7faf7e85ad225d 100644 (file)
@@ -14,7 +14,7 @@
 #define __ASM_ARCH_SPI_H __FILE__
 
 struct s3c2410_spi_info {
-       unsigned long            pin_cs;        /* simple gpio cs */
+       int                      pin_cs;        /* simple gpio cs */
        unsigned int             num_cs;        /* total chipselects */
        int                      bus_num;       /* bus number to use. */
 
index afcaa858eb1f916df6d40c5c916878447c296398..9d39886a8351d360dac960830f1fa870e31bc7be 100644 (file)
@@ -34,7 +34,7 @@ extern unsigned int mmc_status(struct device *dev);
 static struct amba_device name##_device = {                    \
        .dev            = {                                     \
                .coherent_dma_mask = ~0,                        \
-               .bus_id = busid,                                \
+               .init_name = busid,                             \
                .platform_data = plat,                          \
        },                                                      \
        .res            = {                                     \
index 211c9f6619e991f4b434a88a4ae94bb85215d7c7..d6b5ca6c7da20bf7790cd8497616aa1d6f4cc66f 100644 (file)
@@ -59,7 +59,7 @@
 
 #define virt_to_lbus(x)                ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
 #define lbus_to_virt(x)                ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
-#define is_lbus_device(dev)    (cpu_is_omap15xx() && dev && (strncmp(dev->bus_id, "ohci", 4) == 0))
+#define is_lbus_device(dev)    (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
 
 #define __arch_page_to_dma(dev, page)  ({is_lbus_device(dev) ? \
                                        (dma_addr_t)virt_to_lbus(page_address(page)) : \
index 7ef3862a73d02443d95eaf6520ff45417f3f00d5..318815107748dc8ee335e8fc7d2fc47fab8b10c0 100644 (file)
@@ -14,9 +14,9 @@
 #ifndef __ASM_AVR32_ATOMIC_H
 #define __ASM_AVR32_ATOMIC_H
 
+#include <linux/types.h>
 #include <asm/system.h>
 
-typedef struct { volatile int counter; } atomic_t;
 #define ATOMIC_INIT(i)  { (i) }
 
 #define atomic_read(v)         ((v)->counter)
index 0d987373bc01b6b6424824711903b501294776da..d547c8df157da7f31c5459e2fd4f2395faf1bc34 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/bug.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/kallsyms.h>
 #include <linux/kdebug.h>
index 138a00a2a2d0c5c833723a0a6610e8baf6d42a5c..442f08c5e6415f198df5c7843b69d144fa336ed6 100644 (file)
@@ -198,7 +198,7 @@ dump_clock(struct clk *parent, struct clkinf *r)
        unsigned        i;
 
        /* skip clocks coupled to devices that aren't registered */
-       if (parent->dev && !parent->dev->bus_id[0] && !parent->users)
+       if (parent->dev && !dev_name(parent->dev) && !parent->users)
                return;
 
        /* <nest spaces> name <pad to end> */
@@ -214,7 +214,7 @@ dump_clock(struct clk *parent, struct clkinf *r)
                parent->users ? "on" : "off",   /* NOTE: not-paranoid!! */
                clk_get_rate(parent));
        if (parent->dev)
-               seq_printf(r->s, ", for %s", parent->dev->bus_id);
+               seq_printf(r->s, ", for %s", dev_name(parent->dev));
        seq_printf(r->s, "\n");
 
        /* cost of this scan is small, but not linear... */
index 7cf508718605db96d005fff016d7c522b24787cf..25776c19064b556ee52801b1759d3719a7ba9914 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __ARCH_BLACKFIN_ATOMIC__
 #define __ARCH_BLACKFIN_ATOMIC__
 
+#include <linux/types.h>
 #include <asm/system.h>        /* local_irq_XXX() */
 
 /*
@@ -13,9 +14,6 @@
  * Tony Kou (tonyko@lineo.ca)   Lineo Inc.   2001
  */
 
-typedef struct {
-       int counter;
-} atomic_t;
 #define ATOMIC_INIT(i) { (i) }
 
 #define atomic_read(v)         ((v)->counter)
index 3b3857ec1f15f6753d0b2c2ff6c690f619a54890..2f8ea0f7a63c30e77f7948b404bc74618cc6e421 100644 (file)
 #error "Please contact <greg@kroah.com> for details on how to fix it properly."
 
 static struct device iop_spu_device[2] = {
-       { .bus_id =     "iop-spu0", },
-       { .bus_id =     "iop-spu1", },
+       { .init_name =     "iop-spu0", },
+       { .init_name =     "iop-spu1", },
 };
 
 static struct device iop_mpu_device = {
-       .bus_id =       "iop-mpu",
+       .init_name =       "iop-mpu",
 };
 
 static int wait_mpu_idle(void)
index f71ea686a2ea701480630169623b69cfcabfbff8..5718dd8902a11d0953f77c03d75db4306c861073 100644 (file)
@@ -4,7 +4,7 @@
 #define __ASM_CRIS_ATOMIC__
 
 #include <linux/compiler.h>
-
+#include <linux/types.h>
 #include <asm/system.h>
 #include <arch/atomic.h>
 
@@ -13,8 +13,6 @@
  * resource counting etc..
  */
 
-typedef struct { volatile int counter; } atomic_t;
-
 #define ATOMIC_INIT(i)  { (i) }
 
 #define atomic_read(v) ((v)->counter)
index b4cf0ea97ede7a0975271b65f8f9d06d68abaea9..833186c8dc3b9cab79f0e801feb602ee952a098c 100644 (file)
@@ -1,12 +1,13 @@
 #ifndef __ARCH_H8300_ATOMIC__
 #define __ARCH_H8300_ATOMIC__
 
+#include <linux/types.h>
+
 /*
  * Atomic operations that C can't guarantee us.  Useful for
  * resource counting etc..
  */
 
-typedef struct { int counter; } atomic_t;
 #define ATOMIC_INIT(i) { (i) }
 
 #define atomic_read(v)         ((v)->counter)
index 50c2b83fd5a04cccf72996add92fae7b2ba0b407..d37292bd98757402f2f075689bb0e04cf254cda6 100644 (file)
 #include <asm/intrinsics.h>
 #include <asm/system.h>
 
-/*
- * On IA-64, counter must always be volatile to ensure that that the
- * memory accesses are ordered.
- */
-typedef struct { volatile __s32 counter; } atomic_t;
-typedef struct { volatile __s64 counter; } atomic64_t;
 
 #define ATOMIC_INIT(i)         ((atomic_t) { (i) })
 #define ATOMIC64_INIT(i)       ((atomic64_t) { (i) })
index f07688da947c352217246d706435d09256d8894e..097b84d54e731c6ad7a0b27f9ac081ee0a4e67b8 100644 (file)
@@ -670,9 +670,11 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
-       mutex_lock(&kprobe_mutex);
-       free_insn_slot(p->ainsn.insn, p->ainsn.inst_flag & INST_FLAG_BOOSTABLE);
-       mutex_unlock(&kprobe_mutex);
+       if (p->ainsn.insn) {
+               free_insn_slot(p->ainsn.insn,
+                              p->ainsn.inst_flag & INST_FLAG_BOOSTABLE);
+               p->ainsn.insn = NULL;
+       }
 }
 /*
  * We are resuming execution after a single step fault, so the pt_regs
index 2a92f637431d77f0ddeba81c89643c332a3ddac4..d0ada067a4af52bd83fdac763b862d3b62e2ed13 100644 (file)
@@ -39,7 +39,7 @@ int iommu_detected __read_mostly;
    be probably a smaller DMA mask, but this is bug-to-bug compatible
    to i386. */
 struct device fallback_dev = {
-       .bus_id = "fallback device",
+       .init_name = "fallback device",
        .coherent_dma_mask = DMA_32BIT_MASK,
        .dma_mask = &fallback_dev.coherent_dma_mask,
 };
index 054bcd9439aa887a724fc031ec91701b7fefb218..56e12903973cc6456d9e2d7f48a7ec45e6301edd 100644 (file)
@@ -692,7 +692,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
        pgdat = NODE_DATA(nid);
 
        zone = pgdat->node_zones + ZONE_NORMAL;
-       ret = __add_pages(zone, start_pfn, nr_pages);
+       ret = __add_pages(nid, zone, start_pfn, nr_pages);
 
        if (ret)
                printk("%s: Problem encountered in __add_pages() as ret=%d\n",
index a88eba3314d7fb02b812c7b8cf5055788da90fa4..3f864238566d5aa1ae92c854dac9f783985978c4 100644 (file)
@@ -206,8 +206,7 @@ cx_device_register(nasid_t nasid, int part_num, int mfg_num,
        cx_dev->dev.parent = NULL;
        cx_dev->dev.bus = &tiocx_bus_type;
        cx_dev->dev.release = tiocx_bus_release;
-       snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d",
-                cx_dev->cx_id.nasid);
+       dev_set_name(&cx_dev->dev, "%d", cx_dev->cx_id.nasid);
        device_register(&cx_dev->dev);
        get_device(&cx_dev->dev);
 
index d5632a305dae8e992626dc7d79efc778805f5a51..6bb674855a3f57867ddd6d829eb8ca3e953f9bc9 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __ARCH_M68KNOMMU_ATOMIC__
 #define __ARCH_M68KNOMMU_ATOMIC__
 
+#include <linux/types.h>
 #include <asm/system.h>
 
 /*
@@ -12,7 +13,6 @@
  * We do not have SMP m68k systems, so we don't have to deal with that.
  */
 
-typedef struct { int counter; } atomic_t;
 #define ATOMIC_INIT(i) { (i) }
 
 #define atomic_read(v)         ((v)->counter)
index 1232be3885b01caa879576f3a9a1fd6dc91c8dbc..c996c3b4d074ddc2c3ed785b7bd9839e4c1cb663 100644 (file)
 #define _ASM_ATOMIC_H
 
 #include <linux/irqflags.h>
+#include <linux/types.h>
 #include <asm/barrier.h>
 #include <asm/cpu-features.h>
 #include <asm/war.h>
 #include <asm/system.h>
 
-typedef struct { volatile int counter; } atomic_t;
-
 #define ATOMIC_INIT(i)    { (i) }
 
 /*
@@ -404,8 +403,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 
 #ifdef CONFIG_64BIT
 
-typedef struct { volatile long counter; } atomic64_t;
-
 #define ATOMIC64_INIT(i)    { (i) }
 
 /*
index 010b27e01f7bf9c03dd1b55c64fe15ca69c14100..3ca5f42e819dc3ab4a6793510216d38218b6bc72 100644 (file)
@@ -1454,7 +1454,7 @@ static int __init vpe_module_init(void)
        device_initialize(&vpe_device);
        vpe_device.class        = &vpe_class,
        vpe_device.parent       = NULL,
-       strlcpy(vpe_device.bus_id, "vpe1", BUS_ID_SIZE);
+       dev_set_name(&vpe_device, "vpe1");
        vpe_device.devt = MKDEV(major, minor);
        err = device_add(&vpe_device);
        if (err) {
index 57fcc4a5ebb4e93188fa338f786f49bcf509be35..edbfe25c5fc142475e26d7ffff051d5a61003731 100644 (file)
@@ -155,14 +155,11 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
 #endif
 
-/* Note that we need not lock read accesses - aligned word writes/reads
- * are atomic, so a reader never sees unconsistent values.
- *
- * Cache-line alignment would conflict with, for example, linux/module.h
+/*
+ * Note that we need not lock read accesses - aligned word writes/reads
+ * are atomic, so a reader never sees inconsistent values.
  */
 
-typedef struct { volatile int counter; } atomic_t;
-
 /* It's possible to reduce all atomic operations to either
  * __atomic_add_return, atomic_set and atomic_read (the latter
  * is there only for consistency).
@@ -260,8 +257,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 
 #ifdef CONFIG_64BIT
 
-typedef struct { volatile s64 counter; } atomic64_t;
-
 #define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
 
 static __inline__ int
index 499be5bdd6fae52bd0f8894fa62e1553eb237912..b401950f5259e6a16a7d38a1fa3c0c509d6183ee 100644 (file)
@@ -5,7 +5,7 @@
  * PowerPC atomic operations
  */
 
-typedef struct { int counter; } atomic_t;
+#include <linux/types.h>
 
 #ifdef __KERNEL__
 #include <linux/compiler.h>
@@ -251,8 +251,6 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
 
 #ifdef __powerpc64__
 
-typedef struct { long counter; } atomic64_t;
-
 #define ATOMIC64_INIT(i)       { (i) }
 
 static __inline__ long atomic64_read(const atomic64_t *v)
index 26f0d0ab27a50261f99e5d36e831329d30f0834c..b1dafb6a9743938fdf4bc63bc0b771400122bc83 100644 (file)
@@ -17,6 +17,12 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
                              pte_t *ptep);
 
+/*
+ * The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
+ * to override the version in mm/hugetlb.c
+ */
+#define vma_mmu_pagesize vma_mmu_pagesize
+
 /*
  * If the arch doesn't supply something else, assume that hugepage
  * size aligned regions are ok without further preparation.
index de79915452c87d917728acbeefbd70a2b738d242..989edcdf0297fbf5d2ec03539e000b3a01c98d5d 100644 (file)
@@ -96,9 +96,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
-       mutex_lock(&kprobe_mutex);
-       free_insn_slot(p->ainsn.insn, 0);
-       mutex_unlock(&kprobe_mutex);
+       if (p->ainsn.insn) {
+               free_insn_slot(p->ainsn.insn, 0);
+               p->ainsn.insn = NULL;
+       }
 }
 
 static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
index 201c7a5486cb3f815e89ec8e54966b5f29f6feb0..9920d6a7cf290cc02339da13d337fa6eddbf021a 100644 (file)
@@ -512,6 +512,13 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
        return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0);
 }
 
+unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
+{
+       unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start);
+
+       return 1UL << mmu_psize_to_shift(psize);
+}
+
 /*
  * Called by asm hashtable.S for doing lazy icache flush
  */
index 53b06ebb3f2f7cad0a9dd690f30d0582184e8042..f00f09a77f12f3d628d0b0f51c1a56ebccbadb75 100644 (file)
@@ -132,7 +132,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
        /* this should work for most non-highmem platforms */
        zone = pgdata->node_zones;
 
-       return __add_pages(zone, start_pfn, nr_pages);
+       return __add_pages(nid, zone, start_pfn, nr_pages);
 }
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
index 2d184655bc5d9b3cad0e9c1bddec672af404c042..de432f2de2d22ed3f9f2362023a52caacea1bcb2 100644 (file)
@@ -2,6 +2,7 @@
 #define __ARCH_S390_ATOMIC__
 
 #include <linux/compiler.h>
+#include <linux/types.h>
 
 /*
  *  include/asm-s390/atomic.h
@@ -23,9 +24,6 @@
  * S390 uses 'Compare And Swap' for atomicity in SMP enviroment
  */
 
-typedef struct {
-       int counter;
-} __attribute__ ((aligned (4))) atomic_t;
 #define ATOMIC_INIT(i)  { (i) }
 
 #ifdef __KERNEL__
@@ -149,9 +147,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 #undef __CS_LOOP
 
 #ifdef __s390x__
-typedef struct {
-       long long counter;
-} __attribute__ ((aligned (8))) atomic64_t;
 #define ATOMIC64_INIT(i)  { (i) }
 
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
diff --git a/arch/s390/include/asm/s390_rdev.h b/arch/s390/include/asm/s390_rdev.h
deleted file mode 100644 (file)
index 6fa2044..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- *  include/asm-s390/ccwdev.h
- *
- *    Copyright (C) 2002,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation
- *    Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
- *               Carsten Otte  <cotte@de.ibm.com>
- *
- *  Interface for s390 root device
- */
-
-#ifndef _S390_RDEV_H_
-#define _S390_RDEV_H_
-extern struct device *s390_root_dev_register(const char *);
-extern void s390_root_dev_unregister(struct device *);
-#endif /* _S390_RDEV_H_ */
index 569079ec4ff004f010d64df7d746b0a01caff44c..9b92856632cfdf3b44914db277adba0c09311a61 100644 (file)
@@ -218,9 +218,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
-       mutex_lock(&kprobe_mutex);
-       free_insn_slot(p->ainsn.insn, 0);
-       mutex_unlock(&kprobe_mutex);
+       if (p->ainsn.insn) {
+               free_insn_slot(p->ainsn.insn, 0);
+               p->ainsn.insn = NULL;
+       }
 }
 
 static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
index 158b0d6d70462942975048759222c6fa69874433..f0258ca3b17ed0905bd8a80a42f15e4355a6fd87 100644 (file)
@@ -183,7 +183,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
        rc = vmem_add_mapping(start, size);
        if (rc)
                return rc;
-       rc = __add_pages(zone, PFN_DOWN(start), PFN_DOWN(size));
+       rc = __add_pages(nid, zone, PFN_DOWN(start), PFN_DOWN(size));
        if (rc)
                vmem_remove_mapping(start, size);
        return rc;
index c043ef003028e43fbffe622e801352ca61c3bb97..6327ffbb19928e51305a2d472cbdcd31863a0823 100644 (file)
@@ -7,16 +7,15 @@
  *
  */
 
-typedef struct { volatile int counter; } atomic_t;
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <asm/system.h>
 
 #define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
 
 #define atomic_read(v)         ((v)->counter)
 #define atomic_set(v,i)                ((v)->counter = (i))
 
-#include <linux/compiler.h>
-#include <asm/system.h>
-
 #if defined(CONFIG_GUSA_RB)
 #include <asm/atomic-grb.h>
 #elif defined(CONFIG_CPU_SH4A)
index 88807a2aacc32c583d7b5d1e2392ad0961a87181..c0aa3d83ec0e5e799daaf9265f16f3c30bfbadc9 100644 (file)
@@ -13,6 +13,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
+#include <linux/hardirq.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
index 6cbef8caeb560e69776579d5525bbad028e9aaec..3edf297c829bd141ef7765f385eaf738fa0386db 100644 (file)
@@ -311,7 +311,8 @@ int arch_add_memory(int nid, u64 start, u64 size)
        pgdat = NODE_DATA(nid);
 
        /* We only have ZONE_NORMAL, so this is easy.. */
-       ret = __add_pages(pgdat->node_zones + ZONE_NORMAL, start_pfn, nr_pages);
+       ret = __add_pages(nid, pgdat->node_zones + ZONE_NORMAL,
+                               start_pfn, nr_pages);
        if (unlikely(ret))
                printk("%s: Failed, __add_pages() == %d\n", __func__, ret);
 
index 5c944b5a804003f5cc2a87b7972e5c22cd18ceb7..ce465975a6a5e545c577f71e3203ba47bb3060ae 100644 (file)
@@ -13,8 +13,6 @@
 
 #include <linux/types.h>
 
-typedef struct { volatile int counter; } atomic_t;
-
 #ifdef __KERNEL__
 
 #define ATOMIC_INIT(i)  { (i) }
index 5982c5ae7f0799e9159cd89096e80e99d600c8fe..a0a70649269693e199973b190939e48937fc8157 100644 (file)
@@ -10,9 +10,6 @@
 #include <linux/types.h>
 #include <asm/system.h>
 
-typedef struct { volatile int counter; } atomic_t;
-typedef struct { volatile __s64 counter; } atomic64_t;
-
 #define ATOMIC_INIT(i)         { (i) }
 #define ATOMIC64_INIT(i)       { (i) }
 
index 44e4904194951f680f187fd4f6137ca289b9cab8..7384d8accfe7d005d896eced4de7ab745452efef 100644 (file)
@@ -64,11 +64,10 @@ good_area:
 
        do {
                int fault;
-survive:
+
                fault = handle_mm_fault(mm, vma, address, is_write);
                if (unlikely(fault & VM_FAULT_ERROR)) {
                        if (fault & VM_FAULT_OOM) {
-                               err = -ENOMEM;
                                goto out_of_memory;
                        } else if (fault & VM_FAULT_SIGBUS) {
                                err = -EACCES;
@@ -104,18 +103,14 @@ out:
 out_nosemaphore:
        return err;
 
-/*
- * We ran out of memory, or some other thing happened to us that made
- * us unable to handle the page fault gracefully.
- */
 out_of_memory:
-       if (is_global_init(current)) {
-               up_read(&mm->mmap_sem);
-               yield();
-               down_read(&mm->mmap_sem);
-               goto survive;
-       }
-       goto out;
+       /*
+        * We ran out of memory, call the OOM killer, and return the userspace
+        * (which will retry the fault, or kill us if we got oom-killed).
+        */
+       up_read(&mm->mmap_sem);
+       pagefault_out_of_memory();
+       return 0;
 }
 
 static void bad_segv(struct faultinfo fi, unsigned long ip)
@@ -214,9 +209,6 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
                si.si_addr = (void __user *)address;
                current->thread.arch.faultinfo = fi;
                force_sig_info(SIGBUS, &si, current);
-       } else if (err == -ENOMEM) {
-               printk(KERN_INFO "VM: killing process %s\n", current->comm);
-               do_exit(SIGKILL);
        } else {
                BUG_ON(err != -EFAULT);
                si.si_signo = SIGSEGV;
index ad5b9f6ecddf317e32f1abad071246b61471999a..85b46fba4229cc0334e05d5d9c5e66deff3fa69f 100644 (file)
@@ -2,6 +2,7 @@
 #define _ASM_X86_ATOMIC_32_H
 
 #include <linux/compiler.h>
+#include <linux/types.h>
 #include <asm/processor.h>
 #include <asm/cmpxchg.h>
 
  * resource counting etc..
  */
 
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-typedef struct {
-       int counter;
-} atomic_t;
-
 #define ATOMIC_INIT(i) { (i) }
 
 /**
index 279d2a731f3fb57e9cdb061d1917df4ed7bb053e..8c21731984daacec35c6df87071b3b94b758c4ca 100644 (file)
@@ -1,25 +1,15 @@
 #ifndef _ASM_X86_ATOMIC_64_H
 #define _ASM_X86_ATOMIC_64_H
 
+#include <linux/types.h>
 #include <asm/alternative.h>
 #include <asm/cmpxchg.h>
 
-/* atomic_t should be 32 bit signed type */
-
 /*
  * Atomic operations that C can't guarantee us.  Useful for
  * resource counting etc..
  */
 
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-typedef struct {
-       int counter;
-} atomic_t;
-
 #define ATOMIC_INIT(i) { (i) }
 
 /**
@@ -191,11 +181,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
 #define atomic_inc_return(v)  (atomic_add_return(1, v))
 #define atomic_dec_return(v)  (atomic_sub_return(1, v))
 
-/* An 64bit atomic type */
-
-typedef struct {
-       long counter;
-} atomic64_t;
+/* The 64-bit atomic type */
 
 #define ATOMIC64_INIT(i)       { (i) }
 
diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h
deleted file mode 100644 (file)
index 8b064bd..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _ASM_X86_UNWIND_H
-#define _ASM_X86_UNWIND_H
-
-#define UNW_PC(frame) ((void)(frame), 0UL)
-#define UNW_SP(frame) ((void)(frame), 0UL)
-#define UNW_FP(frame) ((void)(frame), 0UL)
-
-static inline int arch_unw_user_mode(const void *info)
-{
-       return 0;
-}
-
-#endif /* _ASM_X86_UNWIND_H */
index 6c27679ec6aa1753be87e05b6c72a10553f69574..eead6f8f921850ce3c4fcc4ef3e5b6a2b8aaecc5 100644 (file)
@@ -376,9 +376,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
 
 void __kprobes arch_remove_kprobe(struct kprobe *p)
 {
-       mutex_lock(&kprobe_mutex);
-       free_insn_slot(p->ainsn.insn, (p->ainsn.boostable == 1));
-       mutex_unlock(&kprobe_mutex);
+       if (p->ainsn.insn) {
+               free_insn_slot(p->ainsn.insn, (p->ainsn.boostable == 1));
+               p->ainsn.insn = NULL;
+       }
 }
 
 static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
index ce6650eb64e976e120cbefa87adae9b4675e94ed..c9a666cdd3db928278679f606c71a8006833065b 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/string.h>
-#include <linux/unwind.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/kexec.h>
@@ -51,7 +50,6 @@
 #include <asm/debugreg.h>
 #include <asm/atomic.h>
 #include <asm/system.h>
-#include <asm/unwind.h>
 #include <asm/traps.h>
 #include <asm/desc.h>
 #include <asm/i387.h>
index 57ec8c86a8776700729f682fc8a9b60b6a3482cd..9e268b6b204e1e3b34d639061aa43fcd9e0bbc3f 100644 (file)
@@ -667,7 +667,6 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
        if (unlikely(in_atomic() || !mm))
                goto bad_area_nosemaphore;
 
-again:
        /*
         * When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the
@@ -859,25 +858,14 @@ no_context:
        oops_end(flags, regs, sig);
 #endif
 
-/*
- * We ran out of memory, or some other thing happened to us that made
- * us unable to handle the page fault gracefully.
- */
 out_of_memory:
+       /*
+        * We ran out of memory, call the OOM killer, and return the userspace
+        * (which will retry the fault, or kill us if we got oom-killed).
+        */
        up_read(&mm->mmap_sem);
-       if (is_global_init(tsk)) {
-               yield();
-               /*
-                * Re-lookup the vma - in theory the vma tree might
-                * have changed:
-                */
-               goto again;
-       }
-
-       printk("VM: killing process %s\n", tsk->comm);
-       if (error_code & PF_USER)
-               do_group_exit(SIGKILL);
-       goto no_context;
+       pagefault_out_of_memory();
+       return;
 
 do_sigbus:
        up_read(&mm->mmap_sem);
index f99a6c6c432ebc5e53fac79bce694384c2ccdb05..544d724caeee010f149df1b26cf2c7baeab0e73f 100644 (file)
@@ -1079,7 +1079,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
        unsigned long start_pfn = start >> PAGE_SHIFT;
        unsigned long nr_pages = size >> PAGE_SHIFT;
 
-       return __add_pages(zone, start_pfn, nr_pages);
+       return __add_pages(nid, zone, start_pfn, nr_pages);
 }
 #endif
 
index 9f7a0d24d42a93b47e36d3ce40c70876f5d09e16..54c437e96541f2764aaeb566793b092e2af2f219 100644 (file)
@@ -857,7 +857,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
        if (last_mapped_pfn > max_pfn_mapped)
                max_pfn_mapped = last_mapped_pfn;
 
-       ret = __add_pages(zone, start_pfn, nr_pages);
+       ret = __add_pages(nid, zone, start_pfn, nr_pages);
        WARN_ON_ONCE(ret);
 
        return ret;
index e73e50daf3d0a36df8977cad29b550e3139fbef0..d414bb5607e89f4e3a05466b2a488db5e79c98a3 100644 (file)
@@ -42,7 +42,7 @@ struct bsg_device {
        int done_cmds;
        wait_queue_head_t wq_done;
        wait_queue_head_t wq_free;
-       char name[BUS_ID_SIZE];
+       char name[20];
        int max_queue;
        unsigned long flags;
 };
@@ -781,7 +781,7 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
        mutex_lock(&bsg_mutex);
        hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
 
-       strncpy(bd->name, rq->bsg_dev.class_dev->bus_id, sizeof(bd->name) - 1);
+       strncpy(bd->name, dev_name(rq->bsg_dev.class_dev), sizeof(bd->name) - 1);
        dprintk("bound to <%s>, max queue %d\n",
                format_dev_t(buf, inode->i_rdev), bd->max_queue);
 
@@ -992,7 +992,7 @@ int bsg_register_queue(struct request_queue *q, struct device *parent,
        if (name)
                devname = name;
        else
-               devname = parent->bus_id;
+               devname = dev_name(parent);
 
        /*
         * we need a proper transport to send commands, not a stacked device
index d84a7df1e2a094e663f7e1683bb941f1c3562e2d..397960cf26afcd61fc7c2bba2365944c8485c767 100644 (file)
@@ -1084,7 +1084,7 @@ dev_t blk_lookup_devt(const char *name, int partno)
                struct gendisk *disk = dev_to_disk(dev);
                struct hd_struct *part;
 
-               if (strcmp(dev->bus_id, name))
+               if (strcmp(dev_name(dev), name))
                        continue;
 
                part = disk_get_part(disk, partno);
index 38aca048e9515a6f0be0b36f6db9475cbaa889b3..66a9d81455628454f628496415f4bbee495732b4 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/pm_qos_params.h>
 #include <linux/clockchips.h>
 #include <linux/cpuidle.h>
+#include <linux/irqflags.h>
 
 /*
  * Include the apic definitions for x86 to have the APIC timer related defines
index 4040d8b532165b791fef71902b44a5905e21303a..9e92107691f2ff0f606e5272347d7a98afe2516b 100644 (file)
@@ -3369,7 +3369,7 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
 
        if (sdev) {
                ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n",
-                              sdev->sdev_gendev.bus_id);
+                              dev_name(&sdev->sdev_gendev));
 
                scsi_remove_device(sdev);
                scsi_device_put(sdev);
index f57652db0a2a1261ef79e0c59326be6163bcaa1c..b9cda053d3c0c20182a264c6da5424fe872c6e5e 100644 (file)
@@ -167,7 +167,7 @@ attribute_container_add_device(struct device *dev,
                ic->classdev.parent = get_device(dev);
                ic->classdev.class = cont->class;
                cont->class->dev_release = attribute_container_release;
-               strcpy(ic->classdev.bus_id, dev->bus_id);
+               dev_set_name(&ic->classdev, dev_name(dev));
                if (fn)
                        fn(cont, dev, &ic->classdev);
                else
index 0a5f055dffbaa389fd8f4b2f0bfe81fe5a352241..b676f8f801f8c5adde6577bcd45632470ece691d 100644 (file)
@@ -63,6 +63,32 @@ struct class_private {
 #define to_class(obj)  \
        container_of(obj, struct class_private, class_subsys.kobj)
 
+/**
+ * struct device_private - structure to hold the private to the driver core portions of the device structure.
+ *
+ * @klist_children - klist containing all children of this device
+ * @knode_parent - node in sibling list
+ * @knode_driver - node in driver list
+ * @knode_bus - node in bus list
+ * @device - pointer back to the struct class that this structure is
+ * associated with.
+ *
+ * Nothing outside of the driver core should ever touch these fields.
+ */
+struct device_private {
+       struct klist klist_children;
+       struct klist_node knode_parent;
+       struct klist_node knode_driver;
+       struct klist_node knode_bus;
+       struct device *device;
+};
+#define to_device_private_parent(obj)  \
+       container_of(obj, struct device_private, knode_parent)
+#define to_device_private_driver(obj)  \
+       container_of(obj, struct device_private, knode_driver)
+#define to_device_private_bus(obj)     \
+       container_of(obj, struct device_private, knode_bus)
+
 /* initialisation functions */
 extern int devices_init(void);
 extern int buses_init(void);
index 5aee1c0169eafed102c699281b5bb4875fefd20c..0f0a5044467223b4ac4379565b289d8033d451b1 100644 (file)
@@ -253,7 +253,14 @@ static ssize_t store_drivers_probe(struct bus_type *bus,
 static struct device *next_device(struct klist_iter *i)
 {
        struct klist_node *n = klist_next(i);
-       return n ? container_of(n, struct device, knode_bus) : NULL;
+       struct device *dev = NULL;
+       struct device_private *dev_prv;
+
+       if (n) {
+               dev_prv = to_device_private_bus(n);
+               dev = dev_prv->device;
+       }
+       return dev;
 }
 
 /**
@@ -286,7 +293,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start,
                return -EINVAL;
 
        klist_iter_init_node(&bus->p->klist_devices, &i,
-                            (start ? &start->knode_bus : NULL));
+                            (start ? &start->p->knode_bus : NULL));
        while ((dev = next_device(&i)) && !error)
                error = fn(dev, data);
        klist_iter_exit(&i);
@@ -320,7 +327,7 @@ struct device *bus_find_device(struct bus_type *bus,
                return NULL;
 
        klist_iter_init_node(&bus->p->klist_devices, &i,
-                            (start ? &start->knode_bus : NULL));
+                            (start ? &start->p->knode_bus : NULL));
        while ((dev = next_device(&i)))
                if (match(dev, data) && get_device(dev))
                        break;
@@ -333,7 +340,7 @@ static int match_name(struct device *dev, void *data)
 {
        const char *name = data;
 
-       return sysfs_streq(name, dev->bus_id);
+       return sysfs_streq(name, dev_name(dev));
 }
 
 /**
@@ -461,12 +468,12 @@ int bus_add_device(struct device *dev)
        int error = 0;
 
        if (bus) {
-               pr_debug("bus: '%s': add device %s\n", bus->name, dev->bus_id);
+               pr_debug("bus: '%s': add device %s\n", bus->name, dev_name(dev));
                error = device_add_attrs(bus, dev);
                if (error)
                        goto out_put;
                error = sysfs_create_link(&bus->p->devices_kset->kobj,
-                                               &dev->kobj, dev->bus_id);
+                                               &dev->kobj, dev_name(dev));
                if (error)
                        goto out_id;
                error = sysfs_create_link(&dev->kobj,
@@ -482,7 +489,7 @@ int bus_add_device(struct device *dev)
 out_deprecated:
        sysfs_remove_link(&dev->kobj, "subsystem");
 out_subsys:
-       sysfs_remove_link(&bus->p->devices_kset->kobj, dev->bus_id);
+       sysfs_remove_link(&bus->p->devices_kset->kobj, dev_name(dev));
 out_id:
        device_remove_attrs(bus, dev);
 out_put:
@@ -507,7 +514,8 @@ void bus_attach_device(struct device *dev)
                        ret = device_attach(dev);
                WARN_ON(ret < 0);
                if (ret >= 0)
-                       klist_add_tail(&dev->knode_bus, &bus->p->klist_devices);
+                       klist_add_tail(&dev->p->knode_bus,
+                                      &bus->p->klist_devices);
        }
 }
 
@@ -526,13 +534,13 @@ void bus_remove_device(struct device *dev)
                sysfs_remove_link(&dev->kobj, "subsystem");
                remove_deprecated_bus_links(dev);
                sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
-                                 dev->bus_id);
+                                 dev_name(dev));
                device_remove_attrs(dev->bus, dev);
-               if (klist_node_attached(&dev->knode_bus))
-                       klist_del(&dev->knode_bus);
+               if (klist_node_attached(&dev->p->knode_bus))
+                       klist_del(&dev->p->knode_bus);
 
                pr_debug("bus: '%s': remove device %s\n",
-                        dev->bus->name, dev->bus_id);
+                        dev->bus->name, dev_name(dev));
                device_release_driver(dev);
                bus_put(dev->bus);
        }
@@ -831,14 +839,16 @@ static void bus_remove_attrs(struct bus_type *bus)
 
 static void klist_devices_get(struct klist_node *n)
 {
-       struct device *dev = container_of(n, struct device, knode_bus);
+       struct device_private *dev_prv = to_device_private_bus(n);
+       struct device *dev = dev_prv->device;
 
        get_device(dev);
 }
 
 static void klist_devices_put(struct klist_node *n)
 {
-       struct device *dev = container_of(n, struct device, knode_bus);
+       struct device_private *dev_prv = to_device_private_bus(n);
+       struct device *dev = dev_prv->device;
 
        put_device(dev);
 }
@@ -993,18 +1003,20 @@ static void device_insertion_sort_klist(struct device *a, struct list_head *list
 {
        struct list_head *pos;
        struct klist_node *n;
+       struct device_private *dev_prv;
        struct device *b;
 
        list_for_each(pos, list) {
                n = container_of(pos, struct klist_node, n_node);
-               b = container_of(n, struct device, knode_bus);
+               dev_prv = to_device_private_bus(n);
+               b = dev_prv->device;
                if (compare(a, b) <= 0) {
-                       list_move_tail(&a->knode_bus.n_node,
-                                      &b->knode_bus.n_node);
+                       list_move_tail(&a->p->knode_bus.n_node,
+                                      &b->p->knode_bus.n_node);
                        return;
                }
        }
-       list_move_tail(&a->knode_bus.n_node, list);
+       list_move_tail(&a->p->knode_bus.n_node, list);
 }
 
 void bus_sort_breadthfirst(struct bus_type *bus,
@@ -1014,6 +1026,7 @@ void bus_sort_breadthfirst(struct bus_type *bus,
        LIST_HEAD(sorted_devices);
        struct list_head *pos, *tmp;
        struct klist_node *n;
+       struct device_private *dev_prv;
        struct device *dev;
        struct klist *device_klist;
 
@@ -1022,7 +1035,8 @@ void bus_sort_breadthfirst(struct bus_type *bus,
        spin_lock(&device_klist->k_lock);
        list_for_each_safe(pos, tmp, &device_klist->k_list) {
                n = container_of(pos, struct klist_node, n_node);
-               dev = container_of(n, struct device, knode_bus);
+               dev_prv = to_device_private_bus(n);
+               dev = dev_prv->device;
                device_insertion_sort_klist(dev, &sorted_devices, compare);
        }
        list_splice(&sorted_devices, &device_klist->k_list);
index 8c2cc2648f5a5c0ec330df4991f75b6be07131ae..61df508fa62bfef83754e143c4f20cdd6fdbe2e3 100644 (file)
@@ -109,6 +109,7 @@ static struct sysfs_ops dev_sysfs_ops = {
 static void device_release(struct kobject *kobj)
 {
        struct device *dev = to_dev(kobj);
+       struct device_private *p = dev->p;
 
        if (dev->release)
                dev->release(dev);
@@ -119,7 +120,8 @@ static void device_release(struct kobject *kobj)
        else
                WARN(1, KERN_ERR "Device '%s' does not have a release() "
                        "function, it is broken and must be fixed.\n",
-                       dev->bus_id);
+                       dev_name(dev));
+       kfree(p);
 }
 
 static struct kobj_type device_ktype = {
@@ -209,7 +211,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                retval = dev->bus->uevent(dev, env);
                if (retval)
                        pr_debug("device: '%s': %s: bus uevent() returned %d\n",
-                                dev->bus_id, __func__, retval);
+                                dev_name(dev), __func__, retval);
        }
 
        /* have the class specific function add its stuff */
@@ -217,7 +219,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                retval = dev->class->dev_uevent(dev, env);
                if (retval)
                        pr_debug("device: '%s': %s: class uevent() "
-                                "returned %d\n", dev->bus_id,
+                                "returned %d\n", dev_name(dev),
                                 __func__, retval);
        }
 
@@ -226,7 +228,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                retval = dev->type->uevent(dev, env);
                if (retval)
                        pr_debug("device: '%s': %s: dev_type uevent() "
-                                "returned %d\n", dev->bus_id,
+                                "returned %d\n", dev_name(dev),
                                 __func__, retval);
        }
 
@@ -507,14 +509,16 @@ EXPORT_SYMBOL_GPL(device_schedule_callback_owner);
 
 static void klist_children_get(struct klist_node *n)
 {
-       struct device *dev = container_of(n, struct device, knode_parent);
+       struct device_private *p = to_device_private_parent(n);
+       struct device *dev = p->device;
 
        get_device(dev);
 }
 
 static void klist_children_put(struct klist_node *n)
 {
-       struct device *dev = container_of(n, struct device, knode_parent);
+       struct device_private *p = to_device_private_parent(n);
+       struct device *dev = p->device;
 
        put_device(dev);
 }
@@ -536,9 +540,15 @@ static void klist_children_put(struct klist_node *n)
  */
 void device_initialize(struct device *dev)
 {
+       dev->p = kzalloc(sizeof(*dev->p), GFP_KERNEL);
+       if (!dev->p) {
+               WARN_ON(1);
+               return;
+       }
+       dev->p->device = dev;
        dev->kobj.kset = devices_kset;
        kobject_init(&dev->kobj, &device_ktype);
-       klist_init(&dev->klist_children, klist_children_get,
+       klist_init(&dev->p->klist_children, klist_children_get,
                   klist_children_put);
        INIT_LIST_HEAD(&dev->dma_pools);
        init_MUTEX(&dev->sem);
@@ -672,7 +682,7 @@ static int device_add_class_symlinks(struct device *dev)
        if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
            device_is_not_partition(dev)) {
                error = sysfs_create_link(&dev->class->p->class_subsys.kobj,
-                                         &dev->kobj, dev->bus_id);
+                                         &dev->kobj, dev_name(dev));
                if (error)
                        goto out_subsys;
        }
@@ -712,11 +722,11 @@ out_busid:
        if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
            device_is_not_partition(dev))
                sysfs_remove_link(&dev->class->p->class_subsys.kobj,
-                                 dev->bus_id);
+                                 dev_name(dev));
 #else
        /* link in the class directory pointing to the device */
        error = sysfs_create_link(&dev->class->p->class_subsys.kobj,
-                                 &dev->kobj, dev->bus_id);
+                                 &dev->kobj, dev_name(dev));
        if (error)
                goto out_subsys;
 
@@ -729,7 +739,7 @@ out_busid:
        return 0;
 
 out_busid:
-       sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev->bus_id);
+       sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev));
 #endif
 
 out_subsys:
@@ -758,12 +768,12 @@ static void device_remove_class_symlinks(struct device *dev)
        if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
            device_is_not_partition(dev))
                sysfs_remove_link(&dev->class->p->class_subsys.kobj,
-                                 dev->bus_id);
+                                 dev_name(dev));
 #else
        if (dev->parent && device_is_not_partition(dev))
                sysfs_remove_link(&dev->kobj, "device");
 
-       sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev->bus_id);
+       sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev));
 #endif
 
        sysfs_remove_link(&dev->kobj, "subsystem");
@@ -866,7 +876,7 @@ int device_add(struct device *dev)
        if (!strlen(dev->bus_id))
                goto done;
 
-       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
+       pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
 
        parent = get_device(dev->parent);
        setup_parent(dev, parent);
@@ -876,7 +886,7 @@ int device_add(struct device *dev)
                set_dev_node(dev, dev_to_node(parent));
 
        /* first, register with generic layer. */
-       error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id);
+       error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev));
        if (error)
                goto Error;
 
@@ -884,11 +894,6 @@ int device_add(struct device *dev)
        if (platform_notify)
                platform_notify(dev);
 
-       /* notify clients of device entry (new way) */
-       if (dev->bus)
-               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
-                                            BUS_NOTIFY_ADD_DEVICE, dev);
-
        error = device_create_file(dev, &uevent_attr);
        if (error)
                goto attrError;
@@ -916,10 +921,19 @@ int device_add(struct device *dev)
        if (error)
                goto DPMError;
        device_pm_add(dev);
+
+       /* Notify clients of device addition.  This call must come
+        * after dpm_sysf_add() and before kobject_uevent().
+        */
+       if (dev->bus)
+               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
+                                            BUS_NOTIFY_ADD_DEVICE, dev);
+
        kobject_uevent(&dev->kobj, KOBJ_ADD);
        bus_attach_device(dev);
        if (parent)
-               klist_add_tail(&dev->knode_parent, &parent->klist_children);
+               klist_add_tail(&dev->p->knode_parent,
+                              &parent->p->klist_children);
 
        if (dev->class) {
                mutex_lock(&dev->class->p->class_mutex);
@@ -940,9 +954,6 @@ done:
  DPMError:
        bus_remove_device(dev);
  BusError:
-       if (dev->bus)
-               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
-                                            BUS_NOTIFY_DEL_DEVICE, dev);
        device_remove_attrs(dev);
  AttrsError:
        device_remove_class_symlinks(dev);
@@ -1027,10 +1038,16 @@ void device_del(struct device *dev)
        struct device *parent = dev->parent;
        struct class_interface *class_intf;
 
+       /* Notify clients of device removal.  This call must come
+        * before dpm_sysfs_remove().
+        */
+       if (dev->bus)
+               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
+                                            BUS_NOTIFY_DEL_DEVICE, dev);
        device_pm_remove(dev);
        dpm_sysfs_remove(dev);
        if (parent)
-               klist_del(&dev->knode_parent);
+               klist_del(&dev->p->knode_parent);
        if (MAJOR(dev->devt)) {
                device_remove_sys_dev_entry(dev);
                device_remove_file(dev, &devt_attr);
@@ -1064,9 +1081,6 @@ void device_del(struct device *dev)
         */
        if (platform_notify_remove)
                platform_notify_remove(dev);
-       if (dev->bus)
-               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
-                                            BUS_NOTIFY_DEL_DEVICE, dev);
        kobject_uevent(&dev->kobj, KOBJ_REMOVE);
        cleanup_device_parent(dev);
        kobject_del(&dev->kobj);
@@ -1086,7 +1100,7 @@ void device_del(struct device *dev)
  */
 void device_unregister(struct device *dev)
 {
-       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
+       pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
        device_del(dev);
        put_device(dev);
 }
@@ -1094,7 +1108,14 @@ void device_unregister(struct device *dev)
 static struct device *next_device(struct klist_iter *i)
 {
        struct klist_node *n = klist_next(i);
-       return n ? container_of(n, struct device, knode_parent) : NULL;
+       struct device *dev = NULL;
+       struct device_private *p;
+
+       if (n) {
+               p = to_device_private_parent(n);
+               dev = p->device;
+       }
+       return dev;
 }
 
 /**
@@ -1116,7 +1137,7 @@ int device_for_each_child(struct device *parent, void *data,
        struct device *child;
        int error = 0;
 
-       klist_iter_init(&parent->klist_children, &i);
+       klist_iter_init(&parent->p->klist_children, &i);
        while ((child = next_device(&i)) && !error)
                error = fn(child, data);
        klist_iter_exit(&i);
@@ -1147,7 +1168,7 @@ struct device *device_find_child(struct device *parent, void *data,
        if (!parent)
                return NULL;
 
-       klist_iter_init(&parent->klist_children, &i);
+       klist_iter_init(&parent->p->klist_children, &i);
        while ((child = next_device(&i)))
                if (match(child, data) && get_device(child))
                        break;
@@ -1196,10 +1217,101 @@ EXPORT_SYMBOL_GPL(put_device);
 EXPORT_SYMBOL_GPL(device_create_file);
 EXPORT_SYMBOL_GPL(device_remove_file);
 
+struct root_device
+{
+       struct device dev;
+       struct module *owner;
+};
+
+#define to_root_device(dev) container_of(dev, struct root_device, dev)
+
+static void root_device_release(struct device *dev)
+{
+       kfree(to_root_device(dev));
+}
+
+/**
+ * __root_device_register - allocate and register a root device
+ * @name: root device name
+ * @owner: owner module of the root device, usually THIS_MODULE
+ *
+ * This function allocates a root device and registers it
+ * using device_register(). In order to free the returned
+ * device, use root_device_unregister().
+ *
+ * Root devices are dummy devices which allow other devices
+ * to be grouped under /sys/devices. Use this function to
+ * allocate a root device and then use it as the parent of
+ * any device which should appear under /sys/devices/{name}
+ *
+ * The /sys/devices/{name} directory will also contain a
+ * 'module' symlink which points to the @owner directory
+ * in sysfs.
+ *
+ * Note: You probably want to use root_device_register().
+ */
+struct device *__root_device_register(const char *name, struct module *owner)
+{
+       struct root_device *root;
+       int err = -ENOMEM;
+
+       root = kzalloc(sizeof(struct root_device), GFP_KERNEL);
+       if (!root)
+               return ERR_PTR(err);
+
+       err = dev_set_name(&root->dev, name);
+       if (err) {
+               kfree(root);
+               return ERR_PTR(err);
+       }
+
+       root->dev.release = root_device_release;
+
+       err = device_register(&root->dev);
+       if (err) {
+               put_device(&root->dev);
+               return ERR_PTR(err);
+       }
+
+#ifdef CONFIG_MODULE   /* gotta find a "cleaner" way to do this */
+       if (owner) {
+               struct module_kobject *mk = &owner->mkobj;
+
+               err = sysfs_create_link(&root->dev.kobj, &mk->kobj, "module");
+               if (err) {
+                       device_unregister(&root->dev);
+                       return ERR_PTR(err);
+               }
+               root->owner = owner;
+       }
+#endif
+
+       return &root->dev;
+}
+EXPORT_SYMBOL_GPL(__root_device_register);
+
+/**
+ * root_device_unregister - unregister and free a root device
+ * @root: device going away.
+ *
+ * This function unregisters and cleans up a device that was created by
+ * root_device_register().
+ */
+void root_device_unregister(struct device *dev)
+{
+       struct root_device *root = to_root_device(dev);
+
+       if (root->owner)
+               sysfs_remove_link(&root->dev.kobj, "module");
+
+       device_unregister(dev);
+}
+EXPORT_SYMBOL_GPL(root_device_unregister);
+
 
 static void device_create_release(struct device *dev)
 {
-       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
+       pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
        kfree(dev);
 }
 
@@ -1344,7 +1456,7 @@ int device_rename(struct device *dev, char *new_name)
        if (!dev)
                return -EINVAL;
 
-       pr_debug("device: '%s': %s: renaming to '%s'\n", dev->bus_id,
+       pr_debug("device: '%s': %s: renaming to '%s'\n", dev_name(dev),
                 __func__, new_name);
 
 #ifdef CONFIG_SYSFS_DEPRECATED
@@ -1381,7 +1493,7 @@ int device_rename(struct device *dev, char *new_name)
 #else
        if (dev->class) {
                error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj,
-                                                &dev->kobj, dev->bus_id);
+                                                &dev->kobj, dev_name(dev));
                if (error)
                        goto out;
                sysfs_remove_link(&dev->class->p->class_subsys.kobj,
@@ -1459,8 +1571,8 @@ int device_move(struct device *dev, struct device *new_parent)
        new_parent = get_device(new_parent);
        new_parent_kobj = get_device_parent(dev, new_parent);
 
-       pr_debug("device: '%s': %s: moving to '%s'\n", dev->bus_id,
-                __func__, new_parent ? new_parent->bus_id : "<NULL>");
+       pr_debug("device: '%s': %s: moving to '%s'\n", dev_name(dev),
+                __func__, new_parent ? dev_name(new_parent) : "<NULL>");
        error = kobject_move(&dev->kobj, new_parent_kobj);
        if (error) {
                cleanup_glue_dir(dev, new_parent_kobj);
@@ -1470,9 +1582,10 @@ int device_move(struct device *dev, struct device *new_parent)
        old_parent = dev->parent;
        dev->parent = new_parent;
        if (old_parent)
-               klist_remove(&dev->knode_parent);
+               klist_remove(&dev->p->knode_parent);
        if (new_parent) {
-               klist_add_tail(&dev->knode_parent, &new_parent->klist_children);
+               klist_add_tail(&dev->p->knode_parent,
+                              &new_parent->p->klist_children);
                set_dev_node(dev, dev_to_node(new_parent));
        }
 
@@ -1484,11 +1597,11 @@ int device_move(struct device *dev, struct device *new_parent)
                device_move_class_links(dev, new_parent, old_parent);
                if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
                        if (new_parent)
-                               klist_remove(&dev->knode_parent);
+                               klist_remove(&dev->p->knode_parent);
                        dev->parent = old_parent;
                        if (old_parent) {
-                               klist_add_tail(&dev->knode_parent,
-                                              &old_parent->klist_children);
+                               klist_add_tail(&dev->p->knode_parent,
+                                              &old_parent->p->klist_children);
                                set_dev_node(dev, dev_to_node(old_parent));
                        }
                }
index 20febc00a5258e253aeb9a309a9447660df40a38..6fdaf76f033fcc4704b879189db3828884b56544 100644 (file)
 
 static void driver_bound(struct device *dev)
 {
-       if (klist_node_attached(&dev->knode_driver)) {
+       if (klist_node_attached(&dev->p->knode_driver)) {
                printk(KERN_WARNING "%s: device %s already bound\n",
                        __func__, kobject_name(&dev->kobj));
                return;
        }
 
-       pr_debug("driver: '%s': %s: bound to device '%s'\n", dev->bus_id,
+       pr_debug("driver: '%s': %s: bound to device '%s'\n", dev_name(dev),
                 __func__, dev->driver->name);
 
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_BOUND_DRIVER, dev);
 
-       klist_add_tail(&dev->knode_driver, &dev->driver->p->klist_devices);
+       klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices);
 }
 
 static int driver_sysfs_add(struct device *dev)
@@ -104,13 +104,13 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 
        atomic_inc(&probe_count);
        pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
-                drv->bus->name, __func__, drv->name, dev->bus_id);
+                drv->bus->name, __func__, drv->name, dev_name(dev));
        WARN_ON(!list_empty(&dev->devres_head));
 
        dev->driver = drv;
        if (driver_sysfs_add(dev)) {
                printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
-                       __func__, dev->bus_id);
+                       __func__, dev_name(dev));
                goto probe_failed;
        }
 
@@ -127,7 +127,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
        driver_bound(dev);
        ret = 1;
        pr_debug("bus: '%s': %s: bound device %s to driver %s\n",
-                drv->bus->name, __func__, dev->bus_id, drv->name);
+                drv->bus->name, __func__, dev_name(dev), drv->name);
        goto done;
 
 probe_failed:
@@ -139,7 +139,7 @@ probe_failed:
                /* driver matched but the probe failed */
                printk(KERN_WARNING
                       "%s: probe of %s failed with error %d\n",
-                      drv->name, dev->bus_id, ret);
+                      drv->name, dev_name(dev), ret);
        }
        /*
         * Ignore errors returned by ->probe so that the next driver can try
@@ -194,7 +194,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
                goto done;
 
        pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
-                drv->bus->name, __func__, dev->bus_id, drv->name);
+                drv->bus->name, __func__, dev_name(dev), drv->name);
 
        ret = really_probe(dev, drv);
 
@@ -298,7 +298,6 @@ static void __device_release_driver(struct device *dev)
        drv = dev->driver;
        if (drv) {
                driver_sysfs_remove(dev);
-               sysfs_remove_link(&dev->kobj, "driver");
 
                if (dev->bus)
                        blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
@@ -311,7 +310,7 @@ static void __device_release_driver(struct device *dev)
                        drv->remove(dev);
                devres_release_all(dev);
                dev->driver = NULL;
-               klist_remove(&dev->knode_driver);
+               klist_remove(&dev->p->knode_driver);
        }
 }
 
@@ -341,6 +340,7 @@ EXPORT_SYMBOL_GPL(device_release_driver);
  */
 void driver_detach(struct device_driver *drv)
 {
+       struct device_private *dev_prv;
        struct device *dev;
 
        for (;;) {
@@ -349,8 +349,10 @@ void driver_detach(struct device_driver *drv)
                        spin_unlock(&drv->p->klist_devices.k_lock);
                        break;
                }
-               dev = list_entry(drv->p->klist_devices.k_list.prev,
-                               struct device, knode_driver.n_node);
+               dev_prv = list_entry(drv->p->klist_devices.k_list.prev,
+                                    struct device_private,
+                                    knode_driver.n_node);
+               dev = dev_prv->device;
                get_device(dev);
                spin_unlock(&drv->p->klist_devices.k_lock);
 
index 1e2bda780e48268eb38b834f7078644689b5dc7b..b76cc69f11067801e85f830573d098561eb97727 100644 (file)
 static struct device *next_device(struct klist_iter *i)
 {
        struct klist_node *n = klist_next(i);
-       return n ? container_of(n, struct device, knode_driver) : NULL;
+       struct device *dev = NULL;
+       struct device_private *dev_prv;
+
+       if (n) {
+               dev_prv = to_device_private_driver(n);
+               dev = dev_prv->device;
+       }
+       return dev;
 }
 
 /**
@@ -42,7 +49,7 @@ int driver_for_each_device(struct device_driver *drv, struct device *start,
                return -EINVAL;
 
        klist_iter_init_node(&drv->p->klist_devices, &i,
-                            start ? &start->knode_driver : NULL);
+                            start ? &start->p->knode_driver : NULL);
        while ((dev = next_device(&i)) && !error)
                error = fn(dev, data);
        klist_iter_exit(&i);
@@ -76,7 +83,7 @@ struct device *driver_find_device(struct device_driver *drv,
                return NULL;
 
        klist_iter_init_node(&drv->p->klist_devices, &i,
-                            (start ? &start->knode_driver : NULL));
+                            (start ? &start->p->knode_driver : NULL));
        while ((dev = next_device(&i)))
                if (match(dev, data) && get_device(dev))
                        break;
index b7e571031ecd144e12b7b8c361a9e6fb6ffd4961..44699d9dd85c8de9c81d5aa1bc7807d69b370103 100644 (file)
@@ -291,12 +291,6 @@ firmware_class_timeout(u_long data)
        fw_load_abort(fw_priv);
 }
 
-static inline void fw_setup_device_id(struct device *f_dev, struct device *dev)
-{
-       /* XXX warning we should watch out for name collisions */
-       strlcpy(f_dev->bus_id, dev->bus_id, BUS_ID_SIZE);
-}
-
 static int fw_register_device(struct device **dev_p, const char *fw_name,
                              struct device *device)
 {
@@ -321,7 +315,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
        fw_priv->timeout.data = (u_long) fw_priv;
        init_timer(&fw_priv->timeout);
 
-       fw_setup_device_id(f_dev, device);
+       dev_set_name(f_dev, dev_name(device));
        f_dev->parent = device;
        f_dev->class = &firmware_class;
        dev_set_drvdata(f_dev, fw_priv);
index efd5775749485d8ec6bfafa998cd9c6fff53f812..479694b6cbe3995a59bb5a89faf4ca7edffa8d56 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/isa.h>
 
 static struct device isa_bus = {
-       .bus_id         = "isa"
+       .init_name      = "isa"
 };
 
 struct isa_dev {
@@ -135,9 +135,8 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)
                isa_dev->dev.parent     = &isa_bus;
                isa_dev->dev.bus        = &isa_bus_type;
 
-               snprintf(isa_dev->dev.bus_id, BUS_ID_SIZE, "%s.%u",
-                               isa_driver->driver.name, id);
-
+               dev_set_name(&isa_dev->dev, "%s.%u",
+                            isa_driver->driver.name, id);
                isa_dev->dev.platform_data      = isa_driver;
                isa_dev->dev.release            = isa_dev_release;
                isa_dev->id                     = id;
index 5260e9e0df48a3f9b52221f179e72fac01b45f6a..989429cfed88a7395f38a4d1dd44d8d8ff8745ac 100644 (file)
@@ -347,8 +347,9 @@ static inline int memory_probe_init(void)
  * section belongs to...
  */
 
-static int add_memory_block(unsigned long node_id, struct mem_section *section,
-                    unsigned long state, int phys_device)
+static int add_memory_block(int nid, struct mem_section *section,
+                       unsigned long state, int phys_device,
+                       enum mem_add_context context)
 {
        struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL);
        int ret = 0;
@@ -370,6 +371,10 @@ static int add_memory_block(unsigned long node_id, struct mem_section *section,
                ret = mem_create_simple_file(mem, phys_device);
        if (!ret)
                ret = mem_create_simple_file(mem, removable);
+       if (!ret) {
+               if (context == HOTPLUG)
+                       ret = register_mem_sect_under_node(mem, nid);
+       }
 
        return ret;
 }
@@ -382,7 +387,7 @@ static int add_memory_block(unsigned long node_id, struct mem_section *section,
  *
  * This could be made generic for all sysdev classes.
  */
-static struct memory_block *find_memory_block(struct mem_section *section)
+struct memory_block *find_memory_block(struct mem_section *section)
 {
        struct kobject *kobj;
        struct sys_device *sysdev;
@@ -411,6 +416,7 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
        struct memory_block *mem;
 
        mem = find_memory_block(section);
+       unregister_mem_sect_under_nodes(mem);
        mem_remove_simple_file(mem, phys_index);
        mem_remove_simple_file(mem, state);
        mem_remove_simple_file(mem, phys_device);
@@ -424,9 +430,9 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
  * need an interface for the VM to add new memory regions,
  * but without onlining it.
  */
-int register_new_memory(struct mem_section *section)
+int register_new_memory(int nid, struct mem_section *section)
 {
-       return add_memory_block(0, section, MEM_OFFLINE, 0);
+       return add_memory_block(nid, section, MEM_OFFLINE, 0, HOTPLUG);
 }
 
 int unregister_memory_section(struct mem_section *section)
@@ -458,7 +464,8 @@ int __init memory_dev_init(void)
        for (i = 0; i < NR_MEM_SECTIONS; i++) {
                if (!present_section_nr(i))
                        continue;
-               err = add_memory_block(0, __nr_to_section(i), MEM_ONLINE, 0);
+               err = add_memory_block(0, __nr_to_section(i), MEM_ONLINE,
+                                       0, BOOT);
                if (!ret)
                        ret = err;
        }
index 91636cd8b6c9ad2e12c2bb0a4925397b6b0c454b..43fa90b837eec4e4e79f6b5ef4d2fb99139317f1 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/mm.h>
+#include <linux/memory.h>
 #include <linux/node.h>
 #include <linux/hugetlb.h>
 #include <linux/cpumask.h>
@@ -248,6 +249,105 @@ int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
        return 0;
 }
 
+#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
+#define page_initialized(page)  (page->lru.next)
+
+static int get_nid_for_pfn(unsigned long pfn)
+{
+       struct page *page;
+
+       if (!pfn_valid_within(pfn))
+               return -1;
+       page = pfn_to_page(pfn);
+       if (!page_initialized(page))
+               return -1;
+       return pfn_to_nid(pfn);
+}
+
+/* register memory section under specified node if it spans that node */
+int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
+{
+       unsigned long pfn, sect_start_pfn, sect_end_pfn;
+
+       if (!mem_blk)
+               return -EFAULT;
+       if (!node_online(nid))
+               return 0;
+       sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index);
+       sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1;
+       for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
+               int page_nid;
+
+               page_nid = get_nid_for_pfn(pfn);
+               if (page_nid < 0)
+                       continue;
+               if (page_nid != nid)
+                       continue;
+               return sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj,
+                                       &mem_blk->sysdev.kobj,
+                                       kobject_name(&mem_blk->sysdev.kobj));
+       }
+       /* mem section does not span the specified node */
+       return 0;
+}
+
+/* unregister memory section under all nodes that it spans */
+int unregister_mem_sect_under_nodes(struct memory_block *mem_blk)
+{
+       nodemask_t unlinked_nodes;
+       unsigned long pfn, sect_start_pfn, sect_end_pfn;
+
+       if (!mem_blk)
+               return -EFAULT;
+       nodes_clear(unlinked_nodes);
+       sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index);
+       sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1;
+       for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
+               unsigned int nid;
+
+               nid = get_nid_for_pfn(pfn);
+               if (nid < 0)
+                       continue;
+               if (!node_online(nid))
+                       continue;
+               if (node_test_and_set(nid, unlinked_nodes))
+                       continue;
+               sysfs_remove_link(&node_devices[nid].sysdev.kobj,
+                        kobject_name(&mem_blk->sysdev.kobj));
+       }
+       return 0;
+}
+
+static int link_mem_sections(int nid)
+{
+       unsigned long start_pfn = NODE_DATA(nid)->node_start_pfn;
+       unsigned long end_pfn = start_pfn + NODE_DATA(nid)->node_spanned_pages;
+       unsigned long pfn;
+       int err = 0;
+
+       for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
+               unsigned long section_nr = pfn_to_section_nr(pfn);
+               struct mem_section *mem_sect;
+               struct memory_block *mem_blk;
+               int ret;
+
+               if (!present_section_nr(section_nr))
+                       continue;
+               mem_sect = __nr_to_section(section_nr);
+               mem_blk = find_memory_block(mem_sect);
+               ret = register_mem_sect_under_node(mem_blk, nid);
+               if (!err)
+                       err = ret;
+
+               /* discard ref obtained in find_memory_block() */
+               kobject_put(&mem_blk->sysdev.kobj);
+       }
+       return err;
+}
+#else
+static int link_mem_sections(int nid) { return 0; }
+#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
+
 int register_one_node(int nid)
 {
        int error = 0;
@@ -267,6 +367,9 @@ int register_one_node(int nid)
                        if (cpu_to_node(cpu) == nid)
                                register_cpu_under_node(cpu, nid);
                }
+
+               /* link memory sections under this node */
+               error = link_mem_sections(nid);
        }
 
        return error;
index dfcbfe504867e9db43ea944c55cda9eae9328556..349a1013603fdb2485b3d82b2454ad1c3b2b3002 100644 (file)
@@ -24,7 +24,7 @@
                                 driver))
 
 struct device platform_bus = {
-       .bus_id         = "platform",
+       .init_name      = "platform",
 };
 EXPORT_SYMBOL_GPL(platform_bus);
 
@@ -242,16 +242,15 @@ int platform_device_add(struct platform_device *pdev)
        pdev->dev.bus = &platform_bus_type;
 
        if (pdev->id != -1)
-               snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s.%d", pdev->name,
-                        pdev->id);
+               dev_set_name(&pdev->dev, "%s.%d", pdev->name,  pdev->id);
        else
-               strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE);
+               dev_set_name(&pdev->dev, pdev->name);
 
        for (i = 0; i < pdev->num_resources; i++) {
                struct resource *p, *r = &pdev->resource[i];
 
                if (r->name == NULL)
-                       r->name = pdev->dev.bus_id;
+                       r->name = dev_name(&pdev->dev);
 
                p = r->parent;
                if (!p) {
@@ -264,14 +263,14 @@ int platform_device_add(struct platform_device *pdev)
                if (p && insert_resource(p, r)) {
                        printk(KERN_ERR
                               "%s: failed to claim resource %d\n",
-                              pdev->dev.bus_id, i);
+                              dev_name(&pdev->dev), i);
                        ret = -EBUSY;
                        goto failed;
                }
        }
 
        pr_debug("Registering platform device '%s'. Parent at %s\n",
-                pdev->dev.bus_id, pdev->dev.parent->bus_id);
+                dev_name(&pdev->dev), dev_name(pdev->dev.parent));
 
        ret = device_add(&pdev->dev);
        if (ret == 0)
@@ -503,8 +502,6 @@ int platform_driver_register(struct platform_driver *drv)
                drv->driver.suspend = platform_drv_suspend;
        if (drv->resume)
                drv->driver.resume = platform_drv_resume;
-       if (drv->pm)
-               drv->driver.pm = &drv->pm->base;
        return driver_register(&drv->driver);
 }
 EXPORT_SYMBOL_GPL(platform_driver_register);
@@ -609,7 +606,7 @@ static int platform_match(struct device *dev, struct device_driver *drv)
        struct platform_device *pdev;
 
        pdev = container_of(dev, struct platform_device, dev);
-       return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);
+       return (strcmp(pdev->name, drv->name) == 0);
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -686,7 +683,10 @@ static int platform_pm_suspend(struct device *dev)
        struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (drv && drv->pm) {
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
                if (drv->pm->suspend)
                        ret = drv->pm->suspend(dev);
        } else {
@@ -698,16 +698,15 @@ static int platform_pm_suspend(struct device *dev)
 
 static int platform_pm_suspend_noirq(struct device *dev)
 {
-       struct platform_driver *pdrv;
+       struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (!dev->driver)
+       if (!drv)
                return 0;
 
-       pdrv = to_platform_driver(dev->driver);
-       if (pdrv->pm) {
-               if (pdrv->pm->suspend_noirq)
-                       ret = pdrv->pm->suspend_noirq(dev);
+       if (drv->pm) {
+               if (drv->pm->suspend_noirq)
+                       ret = drv->pm->suspend_noirq(dev);
        } else {
                ret = platform_legacy_suspend_late(dev, PMSG_SUSPEND);
        }
@@ -720,7 +719,10 @@ static int platform_pm_resume(struct device *dev)
        struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (drv && drv->pm) {
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
                if (drv->pm->resume)
                        ret = drv->pm->resume(dev);
        } else {
@@ -732,16 +734,15 @@ static int platform_pm_resume(struct device *dev)
 
 static int platform_pm_resume_noirq(struct device *dev)
 {
-       struct platform_driver *pdrv;
+       struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (!dev->driver)
+       if (!drv)
                return 0;
 
-       pdrv = to_platform_driver(dev->driver);
-       if (pdrv->pm) {
-               if (pdrv->pm->resume_noirq)
-                       ret = pdrv->pm->resume_noirq(dev);
+       if (drv->pm) {
+               if (drv->pm->resume_noirq)
+                       ret = drv->pm->resume_noirq(dev);
        } else {
                ret = platform_legacy_resume_early(dev);
        }
@@ -780,16 +781,15 @@ static int platform_pm_freeze(struct device *dev)
 
 static int platform_pm_freeze_noirq(struct device *dev)
 {
-       struct platform_driver *pdrv;
+       struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (!dev->driver)
+       if (!drv)
                return 0;
 
-       pdrv = to_platform_driver(dev->driver);
-       if (pdrv->pm) {
-               if (pdrv->pm->freeze_noirq)
-                       ret = pdrv->pm->freeze_noirq(dev);
+       if (drv->pm) {
+               if (drv->pm->freeze_noirq)
+                       ret = drv->pm->freeze_noirq(dev);
        } else {
                ret = platform_legacy_suspend_late(dev, PMSG_FREEZE);
        }
@@ -802,7 +802,10 @@ static int platform_pm_thaw(struct device *dev)
        struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (drv && drv->pm) {
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
                if (drv->pm->thaw)
                        ret = drv->pm->thaw(dev);
        } else {
@@ -814,16 +817,15 @@ static int platform_pm_thaw(struct device *dev)
 
 static int platform_pm_thaw_noirq(struct device *dev)
 {
-       struct platform_driver *pdrv;
+       struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (!dev->driver)
+       if (!drv)
                return 0;
 
-       pdrv = to_platform_driver(dev->driver);
-       if (pdrv->pm) {
-               if (pdrv->pm->thaw_noirq)
-                       ret = pdrv->pm->thaw_noirq(dev);
+       if (drv->pm) {
+               if (drv->pm->thaw_noirq)
+                       ret = drv->pm->thaw_noirq(dev);
        } else {
                ret = platform_legacy_resume_early(dev);
        }
@@ -836,7 +838,10 @@ static int platform_pm_poweroff(struct device *dev)
        struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (drv && drv->pm) {
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
                if (drv->pm->poweroff)
                        ret = drv->pm->poweroff(dev);
        } else {
@@ -848,16 +853,15 @@ static int platform_pm_poweroff(struct device *dev)
 
 static int platform_pm_poweroff_noirq(struct device *dev)
 {
-       struct platform_driver *pdrv;
+       struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (!dev->driver)
+       if (!drv)
                return 0;
 
-       pdrv = to_platform_driver(dev->driver);
-       if (pdrv->pm) {
-               if (pdrv->pm->poweroff_noirq)
-                       ret = pdrv->pm->poweroff_noirq(dev);
+       if (drv->pm) {
+               if (drv->pm->poweroff_noirq)
+                       ret = drv->pm->poweroff_noirq(dev);
        } else {
                ret = platform_legacy_suspend_late(dev, PMSG_HIBERNATE);
        }
@@ -870,7 +874,10 @@ static int platform_pm_restore(struct device *dev)
        struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (drv && drv->pm) {
+       if (!drv)
+               return 0;
+
+       if (drv->pm) {
                if (drv->pm->restore)
                        ret = drv->pm->restore(dev);
        } else {
@@ -882,16 +889,15 @@ static int platform_pm_restore(struct device *dev)
 
 static int platform_pm_restore_noirq(struct device *dev)
 {
-       struct platform_driver *pdrv;
+       struct device_driver *drv = dev->driver;
        int ret = 0;
 
-       if (!dev->driver)
+       if (!drv)
                return 0;
 
-       pdrv = to_platform_driver(dev->driver);
-       if (pdrv->pm) {
-               if (pdrv->pm->restore_noirq)
-                       ret = pdrv->pm->restore_noirq(dev);
+       if (drv->pm) {
+               if (drv->pm->restore_noirq)
+                       ret = drv->pm->restore_noirq(dev);
        } else {
                ret = platform_legacy_resume_early(dev);
        }
@@ -912,17 +918,15 @@ static int platform_pm_restore_noirq(struct device *dev)
 
 #endif /* !CONFIG_HIBERNATION */
 
-static struct pm_ext_ops platform_pm_ops = {
-       .base = {
-               .prepare = platform_pm_prepare,
-               .complete = platform_pm_complete,
-               .suspend = platform_pm_suspend,
-               .resume = platform_pm_resume,
-               .freeze = platform_pm_freeze,
-               .thaw = platform_pm_thaw,
-               .poweroff = platform_pm_poweroff,
-               .restore = platform_pm_restore,
-       },
+static struct dev_pm_ops platform_dev_pm_ops = {
+       .prepare = platform_pm_prepare,
+       .complete = platform_pm_complete,
+       .suspend = platform_pm_suspend,
+       .resume = platform_pm_resume,
+       .freeze = platform_pm_freeze,
+       .thaw = platform_pm_thaw,
+       .poweroff = platform_pm_poweroff,
+       .restore = platform_pm_restore,
        .suspend_noirq = platform_pm_suspend_noirq,
        .resume_noirq = platform_pm_resume_noirq,
        .freeze_noirq = platform_pm_freeze_noirq,
@@ -931,7 +935,7 @@ static struct pm_ext_ops platform_pm_ops = {
        .restore_noirq = platform_pm_restore_noirq,
 };
 
-#define PLATFORM_PM_OPS_PTR    &platform_pm_ops
+#define PLATFORM_PM_OPS_PTR    (&platform_dev_pm_ops)
 
 #else /* !CONFIG_PM_SLEEP */
 
index 692c20ba51444acaafe4ca2e1c63237afa3e42bf..670c9d6c140743a7fac01bcfada07254d4da5016 100644 (file)
@@ -76,7 +76,7 @@ void device_pm_add(struct device *dev)
        if (dev->parent) {
                if (dev->parent->power.status >= DPM_SUSPENDING)
                        dev_warn(dev, "parent %s should not be sleeping\n",
-                               dev->parent->bus_id);
+                                dev_name(dev->parent));
        } else if (transition_started) {
                /*
                 * We refuse to register parentless devices while a PM
@@ -112,7 +112,8 @@ void device_pm_remove(struct device *dev)
  *     @ops:   PM operations to choose from.
  *     @state: PM transition of the system being carried out.
  */
-static int pm_op(struct device *dev, struct pm_ops *ops, pm_message_t state)
+static int pm_op(struct device *dev, struct dev_pm_ops *ops,
+                       pm_message_t state)
 {
        int error = 0;
 
@@ -174,7 +175,7 @@ static int pm_op(struct device *dev, struct pm_ops *ops, pm_message_t state)
  *     The operation is executed with interrupts disabled by the only remaining
  *     functional CPU in the system.
  */
-static int pm_noirq_op(struct device *dev, struct pm_ext_ops *ops,
+static int pm_noirq_op(struct device *dev, struct dev_pm_ops *ops,
                        pm_message_t state)
 {
        int error = 0;
@@ -354,7 +355,7 @@ static int resume_device(struct device *dev, pm_message_t state)
        if (dev->bus) {
                if (dev->bus->pm) {
                        pm_dev_dbg(dev, state, "");
-                       error = pm_op(dev, &dev->bus->pm->base, state);
+                       error = pm_op(dev, dev->bus->pm, state);
                } else if (dev->bus->resume) {
                        pm_dev_dbg(dev, state, "legacy ");
                        error = dev->bus->resume(dev);
@@ -451,9 +452,9 @@ static void complete_device(struct device *dev, pm_message_t state)
                dev->type->pm->complete(dev);
        }
 
-       if (dev->bus && dev->bus->pm && dev->bus->pm->base.complete) {
+       if (dev->bus && dev->bus->pm && dev->bus->pm->complete) {
                pm_dev_dbg(dev, state, "completing ");
-               dev->bus->pm->base.complete(dev);
+               dev->bus->pm->complete(dev);
        }
 
        up(&dev->sem);
@@ -624,7 +625,7 @@ static int suspend_device(struct device *dev, pm_message_t state)
        if (dev->bus) {
                if (dev->bus->pm) {
                        pm_dev_dbg(dev, state, "");
-                       error = pm_op(dev, &dev->bus->pm->base, state);
+                       error = pm_op(dev, dev->bus->pm, state);
                } else if (dev->bus->suspend) {
                        pm_dev_dbg(dev, state, "legacy ");
                        error = dev->bus->suspend(dev, state);
@@ -685,10 +686,10 @@ static int prepare_device(struct device *dev, pm_message_t state)
 
        down(&dev->sem);
 
-       if (dev->bus && dev->bus->pm && dev->bus->pm->base.prepare) {
+       if (dev->bus && dev->bus->pm && dev->bus->pm->prepare) {
                pm_dev_dbg(dev, state, "preparing ");
-               error = dev->bus->pm->base.prepare(dev);
-               suspend_report_result(dev->bus->pm->base.prepare, error);
+               error = dev->bus->pm->prepare(dev);
+               suspend_report_result(dev->bus->pm->prepare, error);
                if (error)
                        goto End;
        }
index 2aa6e8fc4defff41ffaa63745baa3a54029ece80..0a1a2c4dbc6e75e5647117b97ae1f055c2fdb080 100644 (file)
@@ -140,7 +140,7 @@ static unsigned int hash_string(unsigned int seed, const char *data, unsigned in
 
 void set_trace_device(struct device *dev)
 {
-       dev_hash_value = hash_string(DEVSEED, dev->bus_id, DEVHASH);
+       dev_hash_value = hash_string(DEVSEED, dev_name(dev), DEVHASH);
 }
 EXPORT_SYMBOL(set_trace_device);
 
@@ -192,7 +192,7 @@ static int show_dev_hash(unsigned int value)
 
        while (entry != &dpm_list) {
                struct device * dev = to_device(entry);
-               unsigned int hash = hash_string(DEVSEED, dev->bus_id, DEVHASH);
+               unsigned int hash = hash_string(DEVSEED, dev_name(dev), DEVHASH);
                if (hash == value) {
                        dev_info(dev, "hash matches\n");
                        match++;
index 1697043119bd27084024b1dd57996f71561ce4a1..35914b6e1d2aee32ddf29dc63b14a6d09e8298e8 100644 (file)
@@ -841,7 +841,7 @@ config JS_RTC
 
 config GEN_RTC
        tristate "Generic /dev/rtc emulation"
-       depends on RTC!=y && !IA64 && !ARM && !M32R && !MIPS && !SPARC && !FRV && !S390 && !SUPERH && !AVR32
+       depends on RTC!=y && !IA64 && !ARM && !M32R && !MIPS && !SPARC && !FRV && !S390 && !SUPERH && !AVR32 && !BLACKFIN
        ---help---
          If you say Y here and create a character special file /dev/rtc with
          major number 10 and minor number 135 using mknod ("man mknod"), you
index 4246b8e36cb32853eedb658b3e96f3c4a46ba978..45d3e80156d45e15d08a1fa164686031126adc4c 100644 (file)
@@ -554,7 +554,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
                __get_user(fontpos, &list->fontpos);
                if ((err1 = con_insert_unipair(p, unicode,fontpos)) != 0)
                        err = err1;
-                       list++;
+               list++;
        }
        
        if (con_unify_unimap(vc, p))
index 6431f6921a67acde3c214f784904c4ebd0f62678..3586b3b3df3f50b1bc1c87669edc6ac54ef8ac67 100644 (file)
@@ -425,9 +425,6 @@ static ssize_t read_oldmem(struct file *file, char __user *buf,
 }
 #endif
 
-extern long vread(char *buf, char *addr, unsigned long count);
-extern long vwrite(char *buf, char *addr, unsigned long count);
-
 #ifdef CONFIG_DEVKMEM
 /*
  * This function reads the *virtual* memory as seen by the kernel.
index 4f8d67fed292bfc6a9423a975fb08265dd78f69e..94ad2c3bfc4a290d025bffbbf14481fa1b8dd39d 100644 (file)
@@ -663,7 +663,7 @@ static int __init mwave_init(void)
 #if 0
        /* sysfs */
        memset(&mwave_device, 0, sizeof (struct device));
-       snprintf(mwave_device.bus_id, BUS_ID_SIZE, "mwave");
+       dev_set_name(&mwave_device, "mwave");
 
        if (device_register(&mwave_device))
                goto cleanup_error;
index c7afc068c28dcf6a64306754953682b0f9cfb70e..7c13581ca9cd6ac1ea4a2d54e80397831cebd75f 100644 (file)
@@ -407,7 +407,7 @@ struct entropy_store {
        /* read-write data: */
        spinlock_t lock;
        unsigned add_ptr;
-       int entropy_count;      /* Must at no time exceed ->POOLBITS! */
+       int entropy_count;
        int input_rotate;
 };
 
@@ -767,11 +767,10 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
 {
        unsigned long flags;
 
-       BUG_ON(r->entropy_count > r->poolinfo->POOLBITS);
-
        /* Hold lock while accounting */
        spin_lock_irqsave(&r->lock, flags);
 
+       BUG_ON(r->entropy_count > r->poolinfo->POOLBITS);
        DEBUG_ENT("trying to extract %d bits from %s\n",
                  nbytes * 8, r->name);
 
index 94966edfb44dedc340d4d81f230c43a0aec9b7bf..d41b9f6f7903d297976114553527ce51f7e44e3e 100644 (file)
@@ -82,7 +82,7 @@ static void sysrq_handle_loglevel(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_loglevel_op = {
        .handler        = sysrq_handle_loglevel,
-       .help_msg       = "loglevel0-8",
+       .help_msg       = "loglevel(0-9)",
        .action_msg     = "Changing Loglevel",
        .enable_mask    = SYSRQ_ENABLE_LOG,
 };
@@ -233,7 +233,7 @@ static void sysrq_handle_showallcpus(int key, struct tty_struct *tty)
 
 static struct sysrq_key_op sysrq_showallcpus_op = {
        .handler        = sysrq_handle_showallcpus,
-       .help_msg       = "aLlcpus",
+       .help_msg       = "show-backtrace-all-active-cpus(L)",
        .action_msg     = "Show backtrace of all active CPUs",
        .enable_mask    = SYSRQ_ENABLE_DUMP,
 };
@@ -247,7 +247,7 @@ static void sysrq_handle_showregs(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_showregs_op = {
        .handler        = sysrq_handle_showregs,
-       .help_msg       = "showPc",
+       .help_msg       = "show-registers(P)",
        .action_msg     = "Show Regs",
        .enable_mask    = SYSRQ_ENABLE_DUMP,
 };
@@ -258,7 +258,7 @@ static void sysrq_handle_showstate(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_showstate_op = {
        .handler        = sysrq_handle_showstate,
-       .help_msg       = "showTasks",
+       .help_msg       = "show-task-states(T)",
        .action_msg     = "Show State",
        .enable_mask    = SYSRQ_ENABLE_DUMP,
 };
@@ -269,7 +269,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_showstate_blocked_op = {
        .handler        = sysrq_handle_showstate_blocked,
-       .help_msg       = "shoW-blocked-tasks",
+       .help_msg       = "show-blocked-tasks(W)",
        .action_msg     = "Show Blocked State",
        .enable_mask    = SYSRQ_ENABLE_DUMP,
 };
@@ -297,7 +297,7 @@ static void sysrq_handle_showmem(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_showmem_op = {
        .handler        = sysrq_handle_showmem,
-       .help_msg       = "showMem",
+       .help_msg       = "show-memory-usage(M)",
        .action_msg     = "Show Memory",
        .enable_mask    = SYSRQ_ENABLE_DUMP,
 };
@@ -323,7 +323,7 @@ static void sysrq_handle_term(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_term_op = {
        .handler        = sysrq_handle_term,
-       .help_msg       = "tErm",
+       .help_msg       = "terminate-all-tasks(E)",
        .action_msg     = "Terminate All Tasks",
        .enable_mask    = SYSRQ_ENABLE_SIGNAL,
 };
@@ -341,7 +341,7 @@ static void sysrq_handle_moom(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_moom_op = {
        .handler        = sysrq_handle_moom,
-       .help_msg       = "Full",
+       .help_msg       = "memory-full-oom-kill(F)",
        .action_msg     = "Manual OOM execution",
        .enable_mask    = SYSRQ_ENABLE_SIGNAL,
 };
@@ -353,7 +353,7 @@ static void sysrq_handle_kill(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_kill_op = {
        .handler        = sysrq_handle_kill,
-       .help_msg       = "kIll",
+       .help_msg       = "kill-all-tasks(I)",
        .action_msg     = "Kill All Tasks",
        .enable_mask    = SYSRQ_ENABLE_SIGNAL,
 };
@@ -364,7 +364,7 @@ static void sysrq_handle_unrt(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_unrt_op = {
        .handler        = sysrq_handle_unrt,
-       .help_msg       = "Nice",
+       .help_msg       = "nice-all-RT-tasks(N)",
        .action_msg     = "Nice All RT Tasks",
        .enable_mask    = SYSRQ_ENABLE_RTNICE,
 };
index e2667a8c2997155a141da0a15a5054430bb86e0c..eee47fd16d79866899f7438fcdaea321a524d1f8 100644 (file)
@@ -109,6 +109,13 @@ config EDAC_X38
          Support for error detection and correction on the Intel
          X38 server chipsets.
 
+config EDAC_I5400
+       tristate "Intel 5400 (Seaburg) chipsets"
+       depends on EDAC_MM_EDAC && PCI && X86
+       help
+         Support for error detection and correction the Intel
+         i5400 MCH chipset (Seaburg).
+
 config EDAC_I82860
        tristate "Intel 82860"
        depends on EDAC_MM_EDAC && PCI && X86_32
index 62c2d9bad8dc711166cfb7ac63d144fe87b53319..b75196927de37901424bf58a6c009702ef7f1850 100644 (file)
@@ -20,6 +20,7 @@ endif
 obj-$(CONFIG_EDAC_AMD76X)              += amd76x_edac.o
 obj-$(CONFIG_EDAC_I5000)               += i5000_edac.o
 obj-$(CONFIG_EDAC_I5100)               += i5100_edac.o
+obj-$(CONFIG_EDAC_I5400)               += i5400_edac.o
 obj-$(CONFIG_EDAC_E7XXX)               += e7xxx_edac.o
 obj-$(CONFIG_EDAC_E752X)               += e752x_edac.o
 obj-$(CONFIG_EDAC_I82443BXGX)          += i82443bxgx_edac.o
index 4041e91432837b2d2cc9b898e10f04f20cc778ce..ca9113e1c1060ad9195d7cba55a35d70ed007f20 100644 (file)
@@ -333,7 +333,7 @@ static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
 fail0:
        edac_printk(KERN_WARNING, EDAC_MC,
                        "%s (%s) %s %s already assigned %d\n",
-                       rover->dev->bus_id, edac_dev_name(rover),
+                       dev_name(rover->dev), edac_dev_name(rover),
                        rover->mod_name, rover->ctl_name, rover->dev_idx);
        return 1;
 
index d110392d48f4cd17a854744abdfaef372cd73a84..25d66940b4fa333eae0998c502f16936a3613299 100644 (file)
@@ -401,7 +401,7 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci)
 
 fail0:
        edac_printk(KERN_WARNING, EDAC_MC,
-               "%s (%s) %s %s already assigned %d\n", p->dev->bus_id,
+               "%s (%s) %s %s already assigned %d\n", dev_name(p->dev),
                edac_dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx);
        return 1;
 
index 22ec9d5d4312940199a7cf425cb73f3d10b11229..5d3c8083a40ebdee27dd34fb260038fcca01ad53 100644 (file)
@@ -150,7 +150,7 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
 fail0:
        edac_printk(KERN_WARNING, EDAC_PCI,
                "%s (%s) %s %s already assigned %d\n",
-               rover->dev->bus_id, edac_dev_name(rover),
+               dev_name(rover->dev), edac_dev_name(rover),
                rover->mod_name, rover->ctl_name, rover->pci_idx);
        return 1;
 
index 5c153dccc95e29ad2ac92658a5dec9a97da7d30a..422728cfe99493ec078bae3d8a392470be157130 100644 (file)
@@ -569,7 +569,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
 
        local_irq_restore(flags);
 
-       debugf4("PCI STATUS= 0x%04x %s\n", status, dev->dev.bus_id);
+       debugf4("PCI STATUS= 0x%04x %s\n", status, dev_name(&dev->dev));
 
        /* check the status reg for errors on boards NOT marked as broken
         * if broken, we cannot trust any of the status bits
@@ -600,13 +600,13 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
        }
 
 
-       debugf4("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev->dev.bus_id);
+       debugf4("PCI HEADER TYPE= 0x%02x %s\n", header_type, dev_name(&dev->dev));
 
        if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
                /* On bridges, need to examine secondary status register  */
                status = get_pci_parity_status(dev, 1);
 
-               debugf4("PCI SEC_STATUS= 0x%04x %s\n", status, dev->dev.bus_id);
+               debugf4("PCI SEC_STATUS= 0x%04x %s\n", status, dev_name(&dev->dev));
 
                /* check the secondary status reg for errors,
                 * on NOT broken boards
diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c
new file mode 100644 (file)
index 0000000..b08b6d8
--- /dev/null
@@ -0,0 +1,1476 @@
+/*
+ * Intel 5400 class Memory Controllers kernel module (Seaburg)
+ *
+ * This file may be distributed under the terms of the
+ * GNU General Public License.
+ *
+ * Copyright (c) 2008 by:
+ *      Ben Woodard <woodard@redhat.com>
+ *      Mauro Carvalho Chehab <mchehab@redhat.com>
+ *
+ * Red Hat Inc. http://www.redhat.com
+ *
+ * Forked and adapted from the i5000_edac driver which was
+ * written by Douglas Thompson Linux Networx <norsk5@xmission.com>
+ *
+ * This module is based on the following document:
+ *
+ * Intel 5400 Chipset Memory Controller Hub (MCH) - Datasheet
+ *     http://developer.intel.com/design/chipsets/datashts/313070.htm
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/pci_ids.h>
+#include <linux/slab.h>
+#include <linux/edac.h>
+#include <linux/mmzone.h>
+
+#include "edac_core.h"
+
+/*
+ * Alter this version for the I5400 module when modifications are made
+ */
+#define I5400_REVISION    " Ver: 1.0.0 " __DATE__
+
+#define EDAC_MOD_STR      "i5400_edac"
+
+#define i5400_printk(level, fmt, arg...) \
+       edac_printk(level, "i5400", fmt, ##arg)
+
+#define i5400_mc_printk(mci, level, fmt, arg...) \
+       edac_mc_chipset_printk(mci, level, "i5400", fmt, ##arg)
+
+/* Limits for i5400 */
+#define NUM_MTRS_PER_BRANCH    4
+#define CHANNELS_PER_BRANCH    2
+#define        MAX_CHANNELS            4
+#define MAX_DIMMS              (MAX_CHANNELS * 4)      /* Up to 4 DIMM's per channel */
+#define MAX_CSROWS             (MAX_DIMMS * 2)         /* max possible csrows per channel */
+
+/* Device 16,
+ * Function 0: System Address
+ * Function 1: Memory Branch Map, Control, Errors Register
+ * Function 2: FSB Error Registers
+ *
+ * All 3 functions of Device 16 (0,1,2) share the SAME DID and
+ * uses PCI_DEVICE_ID_INTEL_5400_ERR for device 16 (0,1,2),
+ * PCI_DEVICE_ID_INTEL_5400_FBD0 and PCI_DEVICE_ID_INTEL_5400_FBD1
+ * for device 21 (0,1).
+ */
+
+       /* OFFSETS for Function 0 */
+#define                AMBASE                  0x48 /* AMB Mem Mapped Reg Region Base */
+#define                MAXCH                   0x56 /* Max Channel Number */
+#define                MAXDIMMPERCH            0x57 /* Max DIMM PER Channel Number */
+
+       /* OFFSETS for Function 1 */
+#define                TOLM                    0x6C
+#define                REDMEMB                 0x7C
+#define                        REC_ECC_LOCATOR_ODD(x)  ((x) & 0x3fe00) /* bits [17:9] indicate ODD, [8:0]  indicate EVEN */
+#define                MIR0                    0x80
+#define                MIR1                    0x84
+#define                AMIR0                   0x8c
+#define                AMIR1                   0x90
+
+       /* Fatal error registers */
+#define                FERR_FAT_FBD            0x98    /* also called as FERR_FAT_FB_DIMM at datasheet */
+#define                        FERR_FAT_FBDCHAN (3<<28)        /* channel index where the highest-order error occurred */
+
+#define                NERR_FAT_FBD            0x9c
+#define                FERR_NF_FBD             0xa0    /* also called as FERR_NFAT_FB_DIMM at datasheet */
+
+       /* Non-fatal error register */
+#define                NERR_NF_FBD             0xa4
+
+       /* Enable error mask */
+#define                EMASK_FBD               0xa8
+
+#define                ERR0_FBD                0xac
+#define                ERR1_FBD                0xb0
+#define                ERR2_FBD                0xb4
+#define                MCERR_FBD               0xb8
+
+       /* No OFFSETS for Device 16 Function 2 */
+
+/*
+ * Device 21,
+ * Function 0: Memory Map Branch 0
+ *
+ * Device 22,
+ * Function 0: Memory Map Branch 1
+ */
+
+       /* OFFSETS for Function 0 */
+#define AMBPRESENT_0   0x64
+#define AMBPRESENT_1   0x66
+#define MTR0           0x80
+#define MTR1           0x82
+#define MTR2           0x84
+#define MTR3           0x86
+
+       /* OFFSETS for Function 1 */
+#define NRECFGLOG              0x74
+#define RECFGLOG               0x78
+#define NRECMEMA               0xbe
+#define NRECMEMB               0xc0
+#define NRECFB_DIMMA           0xc4
+#define NRECFB_DIMMB           0xc8
+#define NRECFB_DIMMC           0xcc
+#define NRECFB_DIMMD           0xd0
+#define NRECFB_DIMME           0xd4
+#define NRECFB_DIMMF           0xd8
+#define REDMEMA                        0xdC
+#define RECMEMA                        0xf0
+#define RECMEMB                        0xf4
+#define RECFB_DIMMA            0xf8
+#define RECFB_DIMMB            0xec
+#define RECFB_DIMMC            0xf0
+#define RECFB_DIMMD            0xf4
+#define RECFB_DIMME            0xf8
+#define RECFB_DIMMF            0xfC
+
+/*
+ * Error indicator bits and masks
+ * Error masks are according with Table 5-17 of i5400 datasheet
+ */
+
+enum error_mask {
+       EMASK_M1  = 1<<0,  /* Memory Write error on non-redundant retry */
+       EMASK_M2  = 1<<1,  /* Memory or FB-DIMM configuration CRC read error */
+       EMASK_M3  = 1<<2,  /* Reserved */
+       EMASK_M4  = 1<<3,  /* Uncorrectable Data ECC on Replay */
+       EMASK_M5  = 1<<4,  /* Aliased Uncorrectable Non-Mirrored Demand Data ECC */
+       EMASK_M6  = 1<<5,  /* Unsupported on i5400 */
+       EMASK_M7  = 1<<6,  /* Aliased Uncorrectable Resilver- or Spare-Copy Data ECC */
+       EMASK_M8  = 1<<7,  /* Aliased Uncorrectable Patrol Data ECC */
+       EMASK_M9  = 1<<8,  /* Non-Aliased Uncorrectable Non-Mirrored Demand Data ECC */
+       EMASK_M10 = 1<<9,  /* Unsupported on i5400 */
+       EMASK_M11 = 1<<10, /* Non-Aliased Uncorrectable Resilver- or Spare-Copy Data ECC  */
+       EMASK_M12 = 1<<11, /* Non-Aliased Uncorrectable Patrol Data ECC */
+       EMASK_M13 = 1<<12, /* Memory Write error on first attempt */
+       EMASK_M14 = 1<<13, /* FB-DIMM Configuration Write error on first attempt */
+       EMASK_M15 = 1<<14, /* Memory or FB-DIMM configuration CRC read error */
+       EMASK_M16 = 1<<15, /* Channel Failed-Over Occurred */
+       EMASK_M17 = 1<<16, /* Correctable Non-Mirrored Demand Data ECC */
+       EMASK_M18 = 1<<17, /* Unsupported on i5400 */
+       EMASK_M19 = 1<<18, /* Correctable Resilver- or Spare-Copy Data ECC */
+       EMASK_M20 = 1<<19, /* Correctable Patrol Data ECC */
+       EMASK_M21 = 1<<20, /* FB-DIMM Northbound parity error on FB-DIMM Sync Status */
+       EMASK_M22 = 1<<21, /* SPD protocol Error */
+       EMASK_M23 = 1<<22, /* Non-Redundant Fast Reset Timeout */
+       EMASK_M24 = 1<<23, /* Refresh error */
+       EMASK_M25 = 1<<24, /* Memory Write error on redundant retry */
+       EMASK_M26 = 1<<25, /* Redundant Fast Reset Timeout */
+       EMASK_M27 = 1<<26, /* Correctable Counter Threshold Exceeded */
+       EMASK_M28 = 1<<27, /* DIMM-Spare Copy Completed */
+       EMASK_M29 = 1<<28, /* DIMM-Isolation Completed */
+};
+
+/*
+ * Names to translate bit error into something useful
+ */
+static const char *error_name[] = {
+       [0]  = "Memory Write error on non-redundant retry",
+       [1]  = "Memory or FB-DIMM configuration CRC read error",
+       /* Reserved */
+       [3]  = "Uncorrectable Data ECC on Replay",
+       [4]  = "Aliased Uncorrectable Non-Mirrored Demand Data ECC",
+       /* M6 Unsupported on i5400 */
+       [6]  = "Aliased Uncorrectable Resilver- or Spare-Copy Data ECC",
+       [7]  = "Aliased Uncorrectable Patrol Data ECC",
+       [8]  = "Non-Aliased Uncorrectable Non-Mirrored Demand Data ECC",
+       /* M10 Unsupported on i5400 */
+       [10] = "Non-Aliased Uncorrectable Resilver- or Spare-Copy Data ECC",
+       [11] = "Non-Aliased Uncorrectable Patrol Data ECC",
+       [12] = "Memory Write error on first attempt",
+       [13] = "FB-DIMM Configuration Write error on first attempt",
+       [14] = "Memory or FB-DIMM configuration CRC read error",
+       [15] = "Channel Failed-Over Occurred",
+       [16] = "Correctable Non-Mirrored Demand Data ECC",
+       /* M18 Unsupported on i5400 */
+       [18] = "Correctable Resilver- or Spare-Copy Data ECC",
+       [19] = "Correctable Patrol Data ECC",
+       [20] = "FB-DIMM Northbound parity error on FB-DIMM Sync Status",
+       [21] = "SPD protocol Error",
+       [22] = "Non-Redundant Fast Reset Timeout",
+       [23] = "Refresh error",
+       [24] = "Memory Write error on redundant retry",
+       [25] = "Redundant Fast Reset Timeout",
+       [26] = "Correctable Counter Threshold Exceeded",
+       [27] = "DIMM-Spare Copy Completed",
+       [28] = "DIMM-Isolation Completed",
+};
+
+/* Fatal errors */
+#define ERROR_FAT_MASK         (EMASK_M1 | \
+                                EMASK_M2 | \
+                                EMASK_M23)
+
+/* Correctable errors */
+#define ERROR_NF_CORRECTABLE   (EMASK_M27 | \
+                                EMASK_M20 | \
+                                EMASK_M19 | \
+                                EMASK_M18 | \
+                                EMASK_M17 | \
+                                EMASK_M16)
+#define ERROR_NF_DIMM_SPARE    (EMASK_M29 | \
+                                EMASK_M28)
+#define ERROR_NF_SPD_PROTOCOL  (EMASK_M22)
+#define ERROR_NF_NORTH_CRC     (EMASK_M21)
+
+/* Recoverable errors */
+#define ERROR_NF_RECOVERABLE   (EMASK_M26 | \
+                                EMASK_M25 | \
+                                EMASK_M24 | \
+                                EMASK_M15 | \
+                                EMASK_M14 | \
+                                EMASK_M13 | \
+                                EMASK_M12 | \
+                                EMASK_M11 | \
+                                EMASK_M9  | \
+                                EMASK_M8  | \
+                                EMASK_M7  | \
+                                EMASK_M5)
+
+/* uncorrectable errors */
+#define ERROR_NF_UNCORRECTABLE (EMASK_M4)
+
+/* mask to all non-fatal errors */
+#define ERROR_NF_MASK          (ERROR_NF_CORRECTABLE   | \
+                                ERROR_NF_UNCORRECTABLE | \
+                                ERROR_NF_RECOVERABLE   | \
+                                ERROR_NF_DIMM_SPARE    | \
+                                ERROR_NF_SPD_PROTOCOL  | \
+                                ERROR_NF_NORTH_CRC)
+
+/*
+ * Define error masks for the several registers
+ */
+
+/* Enable all fatal and non fatal errors */
+#define ENABLE_EMASK_ALL       (ERROR_FAT_MASK | ERROR_NF_MASK)
+
+/* mask for fatal error registers */
+#define FERR_FAT_MASK ERROR_FAT_MASK
+
+/* masks for non-fatal error register */
+static inline int to_nf_mask(unsigned int mask)
+{
+       return (mask & EMASK_M29) | (mask >> 3);
+};
+
+static inline int from_nf_ferr(unsigned int mask)
+{
+       return (mask & EMASK_M29) |             /* Bit 28 */
+              (mask & ((1 << 28) - 1) << 3);   /* Bits 0 to 27 */
+};
+
+#define FERR_NF_MASK           to_nf_mask(ERROR_NF_MASK)
+#define FERR_NF_CORRECTABLE    to_nf_mask(ERROR_NF_CORRECTABLE)
+#define FERR_NF_DIMM_SPARE     to_nf_mask(ERROR_NF_DIMM_SPARE)
+#define FERR_NF_SPD_PROTOCOL   to_nf_mask(ERROR_NF_SPD_PROTOCOL)
+#define FERR_NF_NORTH_CRC      to_nf_mask(ERROR_NF_NORTH_CRC)
+#define FERR_NF_RECOVERABLE    to_nf_mask(ERROR_NF_RECOVERABLE)
+#define FERR_NF_UNCORRECTABLE  to_nf_mask(ERROR_NF_UNCORRECTABLE)
+
+/* Defines to extract the vaious fields from the
+ *     MTRx - Memory Technology Registers
+ */
+#define MTR_DIMMS_PRESENT(mtr)         ((mtr) & (1 << 10))
+#define MTR_DIMMS_ETHROTTLE(mtr)       ((mtr) & (1 << 9))
+#define MTR_DRAM_WIDTH(mtr)            (((mtr) & (1 << 8)) ? 8 : 4)
+#define MTR_DRAM_BANKS(mtr)            (((mtr) & (1 << 6)) ? 8 : 4)
+#define MTR_DRAM_BANKS_ADDR_BITS(mtr)  ((MTR_DRAM_BANKS(mtr) == 8) ? 3 : 2)
+#define MTR_DIMM_RANK(mtr)             (((mtr) >> 5) & 0x1)
+#define MTR_DIMM_RANK_ADDR_BITS(mtr)   (MTR_DIMM_RANK(mtr) ? 2 : 1)
+#define MTR_DIMM_ROWS(mtr)             (((mtr) >> 2) & 0x3)
+#define MTR_DIMM_ROWS_ADDR_BITS(mtr)   (MTR_DIMM_ROWS(mtr) + 13)
+#define MTR_DIMM_COLS(mtr)             ((mtr) & 0x3)
+#define MTR_DIMM_COLS_ADDR_BITS(mtr)   (MTR_DIMM_COLS(mtr) + 10)
+
+/* This applies to FERR_NF_FB-DIMM as well as FERR_FAT_FB-DIMM */
+static inline int extract_fbdchan_indx(u32 x)
+{
+       return (x>>28) & 0x3;
+}
+
+#ifdef CONFIG_EDAC_DEBUG
+/* MTR NUMROW */
+static const char *numrow_toString[] = {
+       "8,192 - 13 rows",
+       "16,384 - 14 rows",
+       "32,768 - 15 rows",
+       "65,536 - 16 rows"
+};
+
+/* MTR NUMCOL */
+static const char *numcol_toString[] = {
+       "1,024 - 10 columns",
+       "2,048 - 11 columns",
+       "4,096 - 12 columns",
+       "reserved"
+};
+#endif
+
+/* Device name and register DID (Device ID) */
+struct i5400_dev_info {
+       const char *ctl_name;   /* name for this device */
+       u16 fsb_mapping_errors; /* DID for the branchmap,control */
+};
+
+/* Table of devices attributes supported by this driver */
+static const struct i5400_dev_info i5400_devs[] = {
+       {
+               .ctl_name = "I5400",
+               .fsb_mapping_errors = PCI_DEVICE_ID_INTEL_5400_ERR,
+       },
+};
+
+struct i5400_dimm_info {
+       int megabytes;          /* size, 0 means not present  */
+       int dual_rank;
+};
+
+/* driver private data structure */
+struct i5400_pvt {
+       struct pci_dev *system_address;         /* 16.0 */
+       struct pci_dev *branchmap_werrors;      /* 16.1 */
+       struct pci_dev *fsb_error_regs;         /* 16.2 */
+       struct pci_dev *branch_0;               /* 21.0 */
+       struct pci_dev *branch_1;               /* 22.0 */
+
+       u16 tolm;                               /* top of low memory */
+       u64 ambase;                             /* AMB BAR */
+
+       u16 mir0, mir1;
+
+       u16 b0_mtr[NUM_MTRS_PER_BRANCH];        /* Memory Technlogy Reg */
+       u16 b0_ambpresent0;                     /* Branch 0, Channel 0 */
+       u16 b0_ambpresent1;                     /* Brnach 0, Channel 1 */
+
+       u16 b1_mtr[NUM_MTRS_PER_BRANCH];        /* Memory Technlogy Reg */
+       u16 b1_ambpresent0;                     /* Branch 1, Channel 8 */
+       u16 b1_ambpresent1;                     /* Branch 1, Channel 1 */
+
+       /* DIMM information matrix, allocating architecture maximums */
+       struct i5400_dimm_info dimm_info[MAX_CSROWS][MAX_CHANNELS];
+
+       /* Actual values for this controller */
+       int maxch;                              /* Max channels */
+       int maxdimmperch;                       /* Max DIMMs per channel */
+};
+
+/* I5400 MCH error information retrieved from Hardware */
+struct i5400_error_info {
+       /* These registers are always read from the MC */
+       u32 ferr_fat_fbd;       /* First Errors Fatal */
+       u32 nerr_fat_fbd;       /* Next Errors Fatal */
+       u32 ferr_nf_fbd;        /* First Errors Non-Fatal */
+       u32 nerr_nf_fbd;        /* Next Errors Non-Fatal */
+
+       /* These registers are input ONLY if there was a Recoverable Error */
+       u32 redmemb;            /* Recoverable Mem Data Error log B */
+       u16 recmema;            /* Recoverable Mem Error log A */
+       u32 recmemb;            /* Recoverable Mem Error log B */
+
+       /* These registers are input ONLY if there was a Non-Rec Error */
+       u16 nrecmema;           /* Non-Recoverable Mem log A */
+       u16 nrecmemb;           /* Non-Recoverable Mem log B */
+
+};
+
+/* note that nrec_rdwr changed from NRECMEMA to NRECMEMB between the 5000 and
+   5400 better to use an inline function than a macro in this case */
+static inline int nrec_bank(struct i5400_error_info *info)
+{
+       return ((info->nrecmema) >> 12) & 0x7;
+}
+static inline int nrec_rank(struct i5400_error_info *info)
+{
+       return ((info->nrecmema) >> 8) & 0xf;
+}
+static inline int nrec_buf_id(struct i5400_error_info *info)
+{
+       return ((info->nrecmema)) & 0xff;
+}
+static inline int nrec_rdwr(struct i5400_error_info *info)
+{
+       return (info->nrecmemb) >> 31;
+}
+/* This applies to both NREC and REC string so it can be used with nrec_rdwr
+   and rec_rdwr */
+static inline const char *rdwr_str(int rdwr)
+{
+       return rdwr ? "Write" : "Read";
+}
+static inline int nrec_cas(struct i5400_error_info *info)
+{
+       return ((info->nrecmemb) >> 16) & 0x1fff;
+}
+static inline int nrec_ras(struct i5400_error_info *info)
+{
+       return (info->nrecmemb) & 0xffff;
+}
+static inline int rec_bank(struct i5400_error_info *info)
+{
+       return ((info->recmema) >> 12) & 0x7;
+}
+static inline int rec_rank(struct i5400_error_info *info)
+{
+       return ((info->recmema) >> 8) & 0xf;
+}
+static inline int rec_rdwr(struct i5400_error_info *info)
+{
+       return (info->recmemb) >> 31;
+}
+static inline int rec_cas(struct i5400_error_info *info)
+{
+       return ((info->recmemb) >> 16) & 0x1fff;
+}
+static inline int rec_ras(struct i5400_error_info *info)
+{
+       return (info->recmemb) & 0xffff;
+}
+
+static struct edac_pci_ctl_info *i5400_pci;
+
+/*
+ *     i5400_get_error_info    Retrieve the hardware error information from
+ *                             the hardware and cache it in the 'info'
+ *                             structure
+ */
+static void i5400_get_error_info(struct mem_ctl_info *mci,
+                                struct i5400_error_info *info)
+{
+       struct i5400_pvt *pvt;
+       u32 value;
+
+       pvt = mci->pvt_info;
+
+       /* read in the 1st FATAL error register */
+       pci_read_config_dword(pvt->branchmap_werrors, FERR_FAT_FBD, &value);
+
+       /* Mask only the bits that the doc says are valid
+        */
+       value &= (FERR_FAT_FBDCHAN | FERR_FAT_MASK);
+
+       /* If there is an error, then read in the
+          NEXT FATAL error register and the Memory Error Log Register A
+        */
+       if (value & FERR_FAT_MASK) {
+               info->ferr_fat_fbd = value;
+
+               /* harvest the various error data we need */
+               pci_read_config_dword(pvt->branchmap_werrors,
+                               NERR_FAT_FBD, &info->nerr_fat_fbd);
+               pci_read_config_word(pvt->branchmap_werrors,
+                               NRECMEMA, &info->nrecmema);
+               pci_read_config_word(pvt->branchmap_werrors,
+                               NRECMEMB, &info->nrecmemb);
+
+               /* Clear the error bits, by writing them back */
+               pci_write_config_dword(pvt->branchmap_werrors,
+                               FERR_FAT_FBD, value);
+       } else {
+               info->ferr_fat_fbd = 0;
+               info->nerr_fat_fbd = 0;
+               info->nrecmema = 0;
+               info->nrecmemb = 0;
+       }
+
+       /* read in the 1st NON-FATAL error register */
+       pci_read_config_dword(pvt->branchmap_werrors, FERR_NF_FBD, &value);
+
+       /* If there is an error, then read in the 1st NON-FATAL error
+        * register as well */
+       if (value & FERR_NF_MASK) {
+               info->ferr_nf_fbd = value;
+
+               /* harvest the various error data we need */
+               pci_read_config_dword(pvt->branchmap_werrors,
+                               NERR_NF_FBD, &info->nerr_nf_fbd);
+               pci_read_config_word(pvt->branchmap_werrors,
+     &nbs