Merge branch 'x86/paravirt' into x86/apic
authorIngo Molnar <mingo@elte.hu>
Mon, 9 Feb 2009 11:16:59 +0000 (12:16 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 9 Feb 2009 11:16:59 +0000 (12:16 +0100)
Conflicts:
arch/x86/mach-voyager/voyager_smp.c

430 files changed:
Documentation/block/queue-sysfs.txt [new file with mode: 0644]
Documentation/kernel-parameters.txt
Documentation/powerpc/dts-bindings/fsl/mpc5200.txt [new file with mode: 0644]
Documentation/powerpc/mpc52xx-device-tree-bindings.txt [deleted file]
Documentation/video4linux/v4lgrab.c
Documentation/x86/boot.txt
MAINTAINERS
arch/arm/plat-mxc/include/mach/mmc.h [new file with mode: 0644]
arch/mips/Kconfig
arch/mips/alchemy/common/time.c
arch/mips/cavium-octeon/setup.c
arch/mips/configs/ip27_defconfig
arch/mips/include/asm/atomic.h
arch/mips/include/asm/mach-rc32434/gpio.h
arch/mips/include/asm/mach-rc32434/irq.h
arch/mips/include/asm/mach-rc32434/rb.h
arch/mips/include/asm/ptrace.h
arch/mips/include/asm/termios.h
arch/mips/include/asm/txx9/tx4939.h
arch/mips/kernel/genex.S
arch/mips/kernel/mips-mt-fpaff.c
arch/mips/kernel/traps.c
arch/mips/lib/memcpy-inatomic.S
arch/mips/lib/memcpy.S
arch/mips/mm/c-r4k.c
arch/mips/mm/fault.c
arch/mips/pci/pci-rc32434.c
arch/mips/rb532/devices.c
arch/mips/rb532/gpio.c
arch/mips/rb532/irq.c
arch/mips/rb532/serial.c
arch/mips/txx9/generic/setup_tx4939.c
arch/mips/txx9/rbtx4939/setup.c
arch/powerpc/configs/52xx/cm5200_defconfig
arch/powerpc/configs/52xx/lite5200b_defconfig
arch/powerpc/configs/52xx/motionpro_defconfig
arch/powerpc/configs/52xx/pcm030_defconfig
arch/powerpc/configs/52xx/tqm5200_defconfig
arch/powerpc/configs/mpc5200_defconfig
arch/powerpc/kernel/pci-common.c
arch/powerpc/platforms/52xx/mpc52xx_pci.c
arch/x86/Kconfig
arch/x86/Kconfig.cpu
arch/x86/Kconfig.debug
arch/x86/Makefile
arch/x86/boot/video-vesa.c
arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig
arch/x86/ia32/ia32_signal.c
arch/x86/include/asm/apic.h
arch/x86/include/asm/apm.h [moved from arch/x86/include/asm/mach-default/apm.h with 100% similarity]
arch/x86/include/asm/bigsmp/apic.h [deleted file]
arch/x86/include/asm/bigsmp/apicdef.h [deleted file]
arch/x86/include/asm/bigsmp/ipi.h [deleted file]
arch/x86/include/asm/cpu.h
arch/x86/include/asm/do_timer.h [moved from arch/x86/include/asm/mach-default/do_timer.h with 100% similarity]
arch/x86/include/asm/e820.h
arch/x86/include/asm/entry_arch.h [moved from arch/x86/include/asm/mach-default/entry_arch.h with 94% similarity]
arch/x86/include/asm/es7000/apic.h [deleted file]
arch/x86/include/asm/es7000/apicdef.h [deleted file]
arch/x86/include/asm/es7000/ipi.h [deleted file]
arch/x86/include/asm/es7000/mpparse.h [deleted file]
arch/x86/include/asm/es7000/wakecpu.h [deleted file]
arch/x86/include/asm/genapic.h
arch/x86/include/asm/genapic_32.h [deleted file]
arch/x86/include/asm/genapic_64.h [deleted file]
arch/x86/include/asm/hw_irq.h
arch/x86/include/asm/io.h
arch/x86/include/asm/io_apic.h
arch/x86/include/asm/ipi.h
arch/x86/include/asm/irq.h
arch/x86/include/asm/irq_vectors.h
arch/x86/include/asm/kvm.h
arch/x86/include/asm/mach-default/mach_apic.h [deleted file]
arch/x86/include/asm/mach-default/mach_apicdef.h [deleted file]
arch/x86/include/asm/mach-default/mach_ipi.h [deleted file]
arch/x86/include/asm/mach-default/mach_mpparse.h [deleted file]
arch/x86/include/asm/mach-default/mach_mpspec.h [deleted file]
arch/x86/include/asm/mach-default/mach_wakecpu.h [deleted file]
arch/x86/include/asm/mach-generic/gpio.h [deleted file]
arch/x86/include/asm/mach-generic/mach_apic.h [deleted file]
arch/x86/include/asm/mach-generic/mach_apicdef.h [deleted file]
arch/x86/include/asm/mach-generic/mach_ipi.h [deleted file]
arch/x86/include/asm/mach-generic/mach_mpparse.h [deleted file]
arch/x86/include/asm/mach-generic/mach_mpspec.h [deleted file]
arch/x86/include/asm/mach-generic/mach_wakecpu.h [deleted file]
arch/x86/include/asm/mach-rdc321x/gpio.h [deleted file]
arch/x86/include/asm/mach_timer.h [moved from arch/x86/include/asm/mach-default/mach_timer.h with 100% similarity]
arch/x86/include/asm/mach_traps.h [moved from arch/x86/include/asm/mach-default/mach_traps.h with 100% similarity]
arch/x86/include/asm/mce.h
arch/x86/include/asm/mpspec.h
arch/x86/include/asm/mtrr.h
arch/x86/include/asm/numaq.h
arch/x86/include/asm/numaq/apic.h [deleted file]
arch/x86/include/asm/numaq/apicdef.h [deleted file]
arch/x86/include/asm/numaq/ipi.h [deleted file]
arch/x86/include/asm/numaq/mpparse.h [deleted file]
arch/x86/include/asm/numaq/wakecpu.h [deleted file]
arch/x86/include/asm/paravirt.h
arch/x86/include/asm/pat.h
arch/x86/include/asm/pci-functions.h [moved from arch/x86/include/asm/mach-default/pci-functions.h with 100% similarity]
arch/x86/include/asm/pgtable.h
arch/x86/include/asm/prctl.h
arch/x86/include/asm/processor.h
arch/x86/include/asm/proto.h
arch/x86/include/asm/ptrace-abi.h
arch/x86/include/asm/rdc321x_defs.h [moved from arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h with 100% similarity]
arch/x86/include/asm/setup.h
arch/x86/include/asm/setup_arch.h [moved from arch/x86/include/asm/mach-default/setup_arch.h with 100% similarity]
arch/x86/include/asm/sigcontext.h
arch/x86/include/asm/sigcontext32.h
arch/x86/include/asm/smp.h
arch/x86/include/asm/smpboot_hooks.h [moved from arch/x86/include/asm/mach-default/smpboot_hooks.h with 83% similarity]
arch/x86/include/asm/spinlock.h
arch/x86/include/asm/summit/apic.h [deleted file]
arch/x86/include/asm/summit/apicdef.h [deleted file]
arch/x86/include/asm/summit/ipi.h [deleted file]
arch/x86/include/asm/summit/mpparse.h [deleted file]
arch/x86/include/asm/swab.h
arch/x86/include/asm/system.h
arch/x86/include/asm/thread_info.h
arch/x86/include/asm/uaccess.h
arch/x86/include/asm/voyager.h
arch/x86/include/asm/xen/page.h
arch/x86/kernel/Makefile
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/apic.c
arch/x86/kernel/apm_32.c
arch/x86/kernel/bigsmp_32.c [new file with mode: 0644]
arch/x86/kernel/cpu/addon_cpuid_features.c
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mtrr/main.c
arch/x86/kernel/crash.c
arch/x86/kernel/ds.c
arch/x86/kernel/entry_32.S
arch/x86/kernel/entry_64.S
arch/x86/kernel/es7000_32.c
arch/x86/kernel/genapic_64.c
arch/x86/kernel/genapic_flat_64.c
arch/x86/kernel/genx2apic_cluster.c
arch/x86/kernel/genx2apic_phys.c
arch/x86/kernel/genx2apic_uv_x.c
arch/x86/kernel/head_32.S
arch/x86/kernel/io_apic.c
arch/x86/kernel/ipi.c
arch/x86/kernel/irq.c
arch/x86/kernel/irq_32.c
arch/x86/kernel/irq_64.c
arch/x86/kernel/kgdb.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/nmi.c
arch/x86/kernel/numaq_32.c
arch/x86/kernel/paravirt-spinlocks.c
arch/x86/kernel/probe_32.c [new file with mode: 0644]
arch/x86/kernel/probe_roms_32.c
arch/x86/kernel/process.c
arch/x86/kernel/process_64.c
arch/x86/kernel/reboot.c
arch/x86/kernel/setup.c
arch/x86/kernel/signal.c
arch/x86/kernel/smp.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/stacktrace.c
arch/x86/kernel/summit_32.c
arch/x86/kernel/time_32.c
arch/x86/kernel/tlb_uv.c
arch/x86/kernel/traps.c
arch/x86/kernel/tsc.c
arch/x86/kernel/visws_quirks.c
arch/x86/kernel/vmiclock_32.c
arch/x86/mach-default/Makefile [deleted file]
arch/x86/mach-default/setup.c [deleted file]
arch/x86/mach-generic/Makefile [deleted file]
arch/x86/mach-generic/bigsmp.c [deleted file]
arch/x86/mach-generic/default.c [deleted file]
arch/x86/mach-generic/es7000.c [deleted file]
arch/x86/mach-generic/numaq.c [deleted file]
arch/x86/mach-generic/probe.c [deleted file]
arch/x86/mach-generic/summit.c [deleted file]
arch/x86/mach-rdc321x/Makefile [deleted file]
arch/x86/mach-rdc321x/gpio.c [deleted file]
arch/x86/mach-rdc321x/platform.c [deleted file]
arch/x86/mach-voyager/setup.c
arch/x86/mach-voyager/voyager_smp.c
arch/x86/mm/Makefile
arch/x86/mm/extable.c
arch/x86/mm/fault.c
arch/x86/mm/ioremap.c
arch/x86/mm/mmap.c
arch/x86/mm/pat.c
arch/x86/mm/tlb.c
arch/x86/pci/irq.c
arch/x86/pci/numaq_32.c
arch/x86/pci/pcbios.c
arch/x86/xen/multicalls.h
block/blk-core.c
block/blk.h
drivers/char/selection.c
drivers/clocksource/acpi_pm.c
drivers/clocksource/cyclone.c
drivers/eisa/Kconfig
drivers/gpu/drm/drm_gem.c
drivers/ide/Kconfig
drivers/ide/Makefile
drivers/ide/cs5536.c [new file with mode: 0644]
drivers/ide/icside.c
drivers/ide/ide-acpi.c
drivers/ide/ide-cd.c
drivers/ide/ide-io.c
drivers/ide/ide-probe.c
drivers/ide/tx4939ide.c
drivers/ide/via82cxxx.c
drivers/input/keyboard/Kconfig
drivers/input/mouse/Kconfig
drivers/media/common/saa7146_video.c
drivers/media/common/tuners/mxl5007t.c
drivers/media/dvb/dvb-core/dvb_ca_en50221.c
drivers/media/dvb/dvb-core/dvb_ca_en50221.h
drivers/media/dvb/dvb-usb/af9005-fe.c
drivers/media/dvb/dvb-usb/af9015.c
drivers/media/dvb/dvb-usb/dib0700_devices.c
drivers/media/dvb/dvb-usb/dvb-usb-ids.h
drivers/media/dvb/frontends/drx397xD.c
drivers/media/dvb/frontends/s5h1409.c
drivers/media/dvb/frontends/stb0899_algo.c
drivers/media/dvb/ttpci/budget.c
drivers/media/dvb/ttusb-dec/ttusb_dec.c
drivers/media/radio/radio-mr800.c
drivers/media/video/cs5345.c
drivers/media/video/cx23885/cx23885-417.c
drivers/media/video/cx23885/cx23885-video.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx88/cx88-dvb.c
drivers/media/video/cx88/cx88.h
drivers/media/video/em28xx/em28xx-audio.c
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-core.c
drivers/media/video/em28xx/em28xx-dvb.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/em28xx/em28xx.h
drivers/media/video/gspca/gspca.c
drivers/media/video/ivtv/ivtv-driver.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/saa7127.c
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa717x.c
drivers/media/video/tda9875.c
drivers/media/video/tveeprom.c
drivers/media/video/tvp514x.c
drivers/media/video/upd64031a.c
drivers/media/video/upd64083.c
drivers/media/video/usbvision/usbvision-i2c.c
drivers/media/video/uvc/uvc_ctrl.c
drivers/media/video/uvc/uvc_driver.c
drivers/media/video/uvc/uvc_isight.c
drivers/media/video/uvc/uvc_queue.c
drivers/media/video/uvc/uvc_status.c
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/uvc/uvc_video.c
drivers/media/video/uvc/uvcvideo.h
drivers/media/video/v4l2-subdev.c
drivers/media/video/zoran/zoran.h
drivers/media/video/zoran/zoran_card.c
drivers/media/video/zoran/zoran_card.h
drivers/media/video/zoran/zoran_driver.c
drivers/mmc/host/Kconfig
drivers/mmc/host/Makefile
drivers/mmc/host/mmci.c
drivers/mmc/host/mmci.h
drivers/mmc/host/mxcmmc.c [new file with mode: 0644]
drivers/mmc/host/pxamci.c
drivers/mmc/host/ricoh_mmc.c
drivers/mtd/nand/Kconfig
drivers/net/igb/e1000_82575.c
drivers/net/igb/igb.h
drivers/net/igb/igb_main.c
drivers/net/ps3_gelic_wireless.c
drivers/net/sfc/efx.c
drivers/net/sfc/efx.h
drivers/net/sfc/ethtool.c
drivers/net/sfc/falcon.c
drivers/net/sfc/mdio_10g.c
drivers/net/sfc/mdio_10g.h
drivers/net/sfc/net_driver.h
drivers/net/sfc/phy.h
drivers/net/sfc/selftest.c
drivers/net/sfc/sfe4001.c
drivers/net/sfc/tenxpress.c
drivers/net/sfc/workarounds.h
drivers/net/sky2.c
drivers/pci/hotplug/Makefile
drivers/pci/hotplug/fakephp.c
drivers/pci/intel-iommu.c
drivers/pci/msi.c
drivers/pci/pci-driver.c
drivers/pci/pci.c
drivers/regulator/bq24022.c
drivers/regulator/wm8350-regulator.c
drivers/usb/host/whci/asl.c
drivers/usb/host/whci/hw.c
drivers/usb/host/whci/pzl.c
drivers/usb/host/whci/whcd.h
drivers/usb/wusbcore/devconnect.c
drivers/usb/wusbcore/rh.c
drivers/uwb/allocator.c
drivers/uwb/drp.c
drivers/uwb/rsv.c
drivers/video/aty/mach64_ct.c
drivers/virtio/virtio_pci.c
drivers/watchdog/rdc321x_wdt.c
drivers/xen/balloon.c
drivers/xen/events.c
include/linux/aio_abi.h
include/linux/atalk.h
include/linux/atmbr2684.h
include/linux/auto_fs4.h
include/linux/bfs_fs.h
include/linux/bio.h
include/linux/blkdev.h
include/linux/blktrace_api.h
include/linux/can/bcm.h
include/linux/capability.h
include/linux/cdrom.h
include/linux/cgroupstats.h
include/linux/clockchips.h
include/linux/dlm_plock.h
include/linux/dn.h
include/linux/dvb/audio.h
include/linux/dvb/dmx.h
include/linux/dvb/frontend.h
include/linux/dvb/net.h
include/linux/dvb/video.h
include/linux/edd.h
include/linux/efs_fs_sb.h
include/linux/elf-fdpic.h
include/linux/elf.h
include/linux/errqueue.h
include/linux/genetlink.h
include/linux/gfs2_ondisk.h
include/linux/hid.h
include/linux/hiddev.h
include/linux/icmpv6.h
include/linux/if_addr.h
include/linux/if_addrlabel.h
include/linux/if_fc.h
include/linux/if_hippi.h
include/linux/if_link.h
include/linux/if_ppp.h
include/linux/if_strip.h
include/linux/if_tr.h
include/linux/igmp.h
include/linux/inet_diag.h
include/linux/ip6_tunnel.h
include/linux/ipv6.h
include/linux/ipv6_route.h
include/linux/ipx.h
include/linux/irda.h
include/linux/minix_fs.h
include/linux/module.h
include/linux/msdos_fs.h
include/linux/neighbour.h
include/linux/netfilter/xt_conntrack.h
include/linux/nfs_idmap.h
include/linux/nfsd/export.h
include/linux/nfsd/nfsfh.h
include/linux/nfsd/syscall.h
include/linux/nubus.h
include/linux/pci_ids.h
include/linux/phonet.h
include/linux/pkt_cls.h
include/linux/pkt_sched.h
include/linux/ppp_defs.h
include/linux/raid/md_p.h
include/linux/random.h
include/linux/rtnetlink.h
include/linux/signalfd.h
include/linux/slab_def.h
include/linux/smp.h
include/linux/sound.h
include/linux/spi/spidev.h
include/linux/synclink.h
include/linux/taskstats.h
include/linux/tc_act/tc_gact.h
include/linux/tc_act/tc_mirred.h
include/linux/tc_act/tc_pedit.h
include/linux/tc_ematch/tc_em_cmp.h
include/linux/tc_ematch/tc_em_meta.h
include/linux/tc_ematch/tc_em_nbyte.h
include/linux/tc_ematch/tc_em_text.h
include/linux/usb/cdc.h
include/linux/usb/gadgetfs.h
include/linux/video_decoder.h
include/linux/video_encoder.h
include/linux/videodev.h
include/linux/virtio_blk.h
include/linux/virtio_console.h
include/linux/virtio_net.h
include/media/v4l2-device.h
include/mtd/inftl-user.h
include/sound/hdsp.h
include/video/sisfb.h
include/video/uvesafb.h
init/main.c
ipc/shm.c
kernel/cpuset.c
kernel/hrtimer.c
kernel/irq/chip.c
kernel/irq/numa_migrate.c
kernel/module.c
kernel/sched.c
kernel/sched_fair.c
kernel/signal.c
kernel/smp.c
kernel/time/tick-common.c
kernel/trace/ftrace.c
kernel/trace/ring_buffer.c
kernel/trace/trace.c
kernel/trace/trace_irqsoff.c
kernel/trace/trace_sched_wakeup.c
mm/mlock.c
mm/mmap.c
mm/shmem.c
mm/slub.c
net/ipv6/ip6mr.c
net/packet/af_packet.c
sound/drivers/Kconfig

diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt
new file mode 100644 (file)
index 0000000..e164403
--- /dev/null
@@ -0,0 +1,63 @@
+Queue sysfs files
+=================
+
+This text file will detail the queue files that are located in the sysfs tree
+for each block device. Note that stacked devices typically do not export
+any settings, since their queue merely functions are a remapping target.
+These files are the ones found in the /sys/block/xxx/queue/ directory.
+
+Files denoted with a RO postfix are readonly and the RW postfix means
+read-write.
+
+hw_sector_size (RO)
+-------------------
+This is the hardware sector size of the device, in bytes.
+
+max_hw_sectors_kb (RO)
+----------------------
+This is the maximum number of kilobytes supported in a single data transfer.
+
+max_sectors_kb (RW)
+-------------------
+This is the maximum number of kilobytes that the block layer will allow
+for a filesystem request. Must be smaller than or equal to the maximum
+size allowed by the hardware.
+
+nomerges (RW)
+-------------
+This enables the user to disable the lookup logic involved with IO merging
+requests in the block layer. Merging may still occur through a direct
+1-hit cache, since that comes for (almost) free. The IO scheduler will not
+waste cycles doing tree/hash lookups for merges if nomerges is 1. Defaults
+to 0, enabling all merges.
+
+nr_requests (RW)
+----------------
+This controls how many requests may be allocated in the block layer for
+read or write requests. Note that the total allocated number may be twice
+this amount, since it applies only to reads or writes (not the accumulated
+sum).
+
+read_ahead_kb (RW)
+------------------
+Maximum number of kilobytes to read-ahead for filesystems on this block
+device.
+
+rq_affinity (RW)
+----------------
+If this option is enabled, the block layer will migrate request completions
+to the CPU that originally submitted the request. For some workloads
+this provides a significant reduction in CPU cycles due to caching effects.
+
+scheduler (RW)
+--------------
+When read, this file will display the current and available IO schedulers
+for this block device. The currently active IO scheduler will be enclosed
+in [] brackets. Writing an IO scheduler name to this file will switch
+control of this block device to that new IO scheduler. Note that writing
+an IO scheduler name to this file will attempt to load that IO scheduler
+module, if it isn't already present in the system.
+
+
+
+Jens Axboe <jens.axboe@oracle.com>, February 2009
index d8362cf..b182626 100644 (file)
@@ -937,6 +937,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
 
        intel_iommu=    [DMAR] Intel IOMMU driver (DMAR) option
+               on
+                       Enable intel iommu driver.
                off
                        Disable intel iommu driver.
                igfx_off [Default Off]
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt b/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt
new file mode 100644 (file)
index 0000000..8447fd7
--- /dev/null
@@ -0,0 +1,180 @@
+MPC5200 Device Tree Bindings
+----------------------------
+
+(c) 2006-2009 Secret Lab Technologies Ltd
+Grant Likely <grant.likely@secretlab.ca>
+
+Naming conventions
+------------------
+For mpc5200 on-chip devices, the format for each compatible value is
+<chip>-<device>[-<mode>].  The OS should be able to match a device driver
+to the device based solely on the compatible value.  If two drivers
+match on the compatible list; the 'most compatible' driver should be
+selected.
+
+The split between the MPC5200 and the MPC5200B leaves a bit of a
+conundrum.  How should the compatible property be set up to provide
+maximum compatibility information; but still accurately describe the
+chip?  For the MPC5200; the answer is easy.  Most of the SoC devices
+originally appeared on the MPC5200.  Since they didn't exist anywhere
+else; the 5200 compatible properties will contain only one item;
+"fsl,mpc5200-<device>".
+
+The 5200B is almost the same as the 5200, but not quite.  It fixes
+silicon bugs and it adds a small number of enhancements.  Most of the
+devices either provide exactly the same interface as on the 5200.  A few
+devices have extra functions but still have a backwards compatible mode.
+To express this information as completely as possible, 5200B device trees
+should have two items in the compatible list:
+       compatible = "fsl,mpc5200b-<device>","fsl,mpc5200-<device>";
+
+It is *strongly* recommended that 5200B device trees follow this convention
+(instead of only listing the base mpc5200 item).
+
+ie. ethernet on mpc5200: compatible = "fsl,mpc5200-fec";
+    ethernet on mpc5200b: compatible = "fsl,mpc5200b-fec", "fsl,mpc5200-fec";
+
+Modal devices, like PSCs, also append the configured function to the
+end of the compatible field.  ie. A PSC in i2s mode would specify
+"fsl,mpc5200-psc-i2s", not "fsl,mpc5200-i2s".  This convention is chosen to
+avoid naming conflicts with non-psc devices providing the same
+function.  For example, "fsl,mpc5200-spi" and "fsl,mpc5200-psc-spi" describe
+the mpc5200 simple spi device and a PSC spi mode respectively.
+
+At the time of writing, exact chip may be either 'fsl,mpc5200' or
+'fsl,mpc5200b'.
+
+The soc node
+------------
+This node describes the on chip SOC peripherals.  Every mpc5200 based
+board will have this node, and as such there is a common naming
+convention for SOC devices.
+
+Required properties:
+name                   description
+----                   -----------
+ranges                 Memory range of the internal memory mapped registers.
+                       Should be <0 [baseaddr] 0xc000>
+reg                    Should be <[baseaddr] 0x100>
+compatible             mpc5200: "fsl,mpc5200-immr"
+                       mpc5200b: "fsl,mpc5200b-immr"
+system-frequency       'fsystem' frequency in Hz; XLB, IPB, USB and PCI
+                       clocks are derived from the fsystem clock.
+bus-frequency          IPB bus frequency in Hz.  Clock rate
+                       used by most of the soc devices.
+
+soc child nodes
+---------------
+Any on chip SOC devices available to Linux must appear as soc5200 child nodes.
+
+Note: The tables below show the value for the mpc5200.  A mpc5200b device
+tree should use the "fsl,mpc5200b-<device>","fsl,mpc5200-<device>" form.
+
+Required soc5200 child nodes:
+name                           compatible              Description
+----                           ----------              -----------
+cdm@<addr>                     fsl,mpc5200-cdm         Clock Distribution
+interrupt-controller@<addr>    fsl,mpc5200-pic         need an interrupt
+                                                       controller to boot
+bestcomm@<addr>                        fsl,mpc5200-bestcomm    Bestcomm DMA controller
+
+Recommended soc5200 child nodes; populate as needed for your board
+name           compatible              Description
+----           ----------              -----------
+timer@<addr>   fsl,mpc5200-gpt          General purpose timers
+gpio@<addr>    fsl,mpc5200-gpio         MPC5200 simple gpio controller
+gpio@<addr>    fsl,mpc5200-gpio-wkup    MPC5200 wakeup gpio controller
+rtc@<addr>     fsl,mpc5200-rtc          Real time clock
+mscan@<addr>   fsl,mpc5200-mscan        CAN bus controller
+pci@<addr>     fsl,mpc5200-pci          PCI bridge
+serial@<addr>  fsl,mpc5200-psc-uart     PSC in serial mode
+i2s@<addr>     fsl,mpc5200-psc-i2s      PSC in i2s mode
+ac97@<addr>    fsl,mpc5200-psc-ac97     PSC in ac97 mode
+spi@<addr>     fsl,mpc5200-psc-spi      PSC in spi mode
+irda@<addr>    fsl,mpc5200-psc-irda     PSC in IrDA mode
+spi@<addr>     fsl,mpc5200-spi          MPC5200 spi device
+ethernet@<addr>        fsl,mpc5200-fec          MPC5200 ethernet device
+ata@<addr>     fsl,mpc5200-ata          IDE ATA interface
+i2c@<addr>     fsl,mpc5200-i2c          I2C controller
+usb@<addr>     fsl,mpc5200-ohci,ohci-be USB controller
+xlb@<addr>     fsl,mpc5200-xlb          XLB arbitrator
+
+fsl,mpc5200-gpt nodes
+---------------------
+On the mpc5200 and 5200b, GPT0 has a watchdog timer function.  If the board
+design supports the internal wdt, then the device node for GPT0 should
+include the empty property 'fsl,has-wdt'.
+
+An mpc5200-gpt can be used as a single line GPIO controller.  To do so,
+add the following properties to the gpt node:
+       gpio-controller;
+       #gpio-cells = <2>;
+When referencing the GPIO line from another node, the first cell must always
+be zero and the second cell represents the gpio flags and described in the
+gpio device tree binding.
+
+An mpc5200-gpt can be used as a single line edge sensitive interrupt
+controller.  To do so, add the following properties to the gpt node:
+       interrupt-controller;
+       #interrupt-cells = <1>;
+When referencing the IRQ line from another node, the cell represents the
+sense mode; 1 for edge rising, 2 for edge falling.
+
+fsl,mpc5200-psc nodes
+---------------------
+The PSCs should include a cell-index which is the index of the PSC in
+hardware.  cell-index is used to determine which shared SoC registers to
+use when setting up PSC clocking.  cell-index number starts at '0'.  ie:
+       PSC1 has 'cell-index = <0>'
+       PSC4 has 'cell-index = <3>'
+
+PSC in i2s mode:  The mpc5200 and mpc5200b PSCs are not compatible when in
+i2s mode.  An 'mpc5200b-psc-i2s' node cannot include 'mpc5200-psc-i2s' in the
+compatible field.
+
+
+fsl,mpc5200-gpio and fsl,mpc5200-gpio-wkup nodes
+------------------------------------------------
+Each GPIO controller node should have the empty property gpio-controller and
+#gpio-cells set to 2. First cell is the GPIO number which is interpreted
+according to the bit numbers in the GPIO control registers. The second cell
+is for flags which is currently unused.
+
+fsl,mpc5200-fec nodes
+---------------------
+The FEC node can specify one of the following properties to configure
+the MII link:
+- fsl,7-wire-mode - An empty property that specifies the link uses 7-wire
+                    mode instead of MII
+- current-speed   - Specifies that the MII should be configured for a fixed
+                    speed.  This property should contain two cells.  The
+                    first cell specifies the speed in Mbps and the second
+                    should be '0' for half duplex and '1' for full duplex
+- phy-handle      - Contains a phandle to an Ethernet PHY.
+
+Interrupt controller (fsl,mpc5200-pic) node
+-------------------------------------------
+The mpc5200 pic binding splits hardware IRQ numbers into two levels.  The
+split reflects the layout of the PIC hardware itself, which groups
+interrupts into one of three groups; CRIT, MAIN or PERP.  Also, the
+Bestcomm dma engine has it's own set of interrupt sources which are
+cascaded off of peripheral interrupt 0, which the driver interprets as a
+fourth group, SDMA.
+
+The interrupts property for device nodes using the mpc5200 pic consists
+of three cells; <L1 L2 level>
+
+    L1 := [CRIT=0, MAIN=1, PERP=2, SDMA=3]
+    L2 := interrupt number; directly mapped from the value in the
+          "ICTL PerStat, MainStat, CritStat Encoded Register"
+    level := [LEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3]
+
+For external IRQs, use the following interrupt property values (how to
+specify external interrupts is a frequently asked question):
+External interrupts:
+       external irq0:  interrupts = <0 0 n>;
+       external irq1:  interrupts = <1 1 n>;
+       external irq2:  interrupts = <1 2 n>;
+       external irq3:  interrupts = <1 3 n>;
+'n' is sense (0: level high, 1: edge rising, 2: edge falling 3: level low)
+
diff --git a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
deleted file mode 100644 (file)
index 6f12f1c..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-MPC5200 Device Tree Bindings
-----------------------------
-
-(c) 2006-2007 Secret Lab Technologies Ltd
-Grant Likely <grant.likely at secretlab.ca>
-
-********** DRAFT ***********
-* WARNING: Do not depend on the stability of these bindings just yet.
-* The MPC5200 device tree conventions are still in flux
-* Keep an eye on the linuxppc-dev mailing list for more details
-********** DRAFT ***********
-
-I - Introduction
-================
-Boards supported by the arch/powerpc architecture require device tree be
-passed by the boot loader to the kernel at boot time.  The device tree
-describes what devices are present on the board and how they are
-connected.  The device tree can either be passed as a binary blob (as
-described in Documentation/powerpc/booting-without-of.txt), or passed
-by Open Firmware (IEEE 1275) compatible firmware using an OF compatible
-client interface API.
-
-This document specifies the requirements on the device-tree for mpc5200
-based boards.  These requirements are above and beyond the details
-specified in either the Open Firmware spec or booting-without-of.txt
-
-All new mpc5200-based boards are expected to match this document.  In
-cases where this document is not sufficient to support a new board port,
-this document should be updated as part of adding the new board support.
-
-II - Philosophy
-===============
-The core of this document is naming convention.  The whole point of
-defining this convention is to reduce or eliminate the number of
-special cases required to support a 5200 board.  If all 5200 boards
-follow the same convention, then generic 5200 support code will work
-rather than coding special cases for each new board.
-
-This section tries to capture the thought process behind why the naming
-convention is what it is.
-
-1.  names
----------
-There is strong convention/requirements already established for children
-of the root node.  'cpus' describes the processor cores, 'memory'
-describes memory, and 'chosen' provides boot configuration.  Other nodes
-are added to describe devices attached to the processor local bus.
-
-Following convention already established with other system-on-chip
-processors, 5200 device trees should use the name 'soc5200' for the
-parent node of on chip devices, and the root node should be its parent.
-
-Child nodes are typically named after the configured function.  ie.
-the FEC node is named 'ethernet', and a PSC in uart mode is named 'serial'.
-
-2. device_type property
------------------------
-similar to the node name convention above; the device_type reflects the
-configured function of a device.  ie. 'serial' for a uart and 'spi' for
-an spi controller.  However, while node names *should* reflect the
-configured function, device_type *must* match the configured function
-exactly.
-
-3. compatible property
-----------------------
-Since device_type isn't enough to match devices to drivers, there also
-needs to be a naming convention for the compatible property.  Compatible
-is an list of device descriptions sorted from specific to generic.  For
-the mpc5200, the required format for each compatible value is
-<chip>-<device>[-<mode>].  The OS should be able to match a device driver
-to the device based solely on the compatible value.  If two drivers
-match on the compatible list; the 'most compatible' driver should be
-selected.
-
-The split between the MPC5200 and the MPC5200B leaves a bit of a
-conundrum.  How should the compatible property be set up to provide
-maximum compatibility information; but still accurately describe the
-chip?  For the MPC5200; the answer is easy.  Most of the SoC devices
-originally appeared on the MPC5200.  Since they didn't exist anywhere
-else; the 5200 compatible properties will contain only one item;
-"mpc5200-<device>".
-
-The 5200B is almost the same as the 5200, but not quite.  It fixes
-silicon bugs and it adds a small number of enhancements.  Most of the
-devices either provide exactly the same interface as on the 5200.  A few
-devices have extra functions but still have a backwards compatible mode.
-To express this information as completely as possible, 5200B device trees
-should have two items in the compatible list;
-"mpc5200b-<device>\0mpc5200-<device>".  It is *strongly* recommended
-that 5200B device trees follow this convention (instead of only listing
-the base mpc5200 item).
-
-If another chip appear on the market with one of the mpc5200 SoC
-devices, then the compatible list should include mpc5200-<device>.
-
-ie. ethernet on mpc5200: compatible = "mpc5200-ethernet"
-    ethernet on mpc5200b: compatible = "mpc5200b-ethernet\0mpc5200-ethernet"
-
-Modal devices, like PSCs, also append the configured function to the
-end of the compatible field.  ie. A PSC in i2s mode would specify
-"mpc5200-psc-i2s", not "mpc5200-i2s".  This convention is chosen to
-avoid naming conflicts with non-psc devices providing the same
-function.  For example, "mpc5200-spi" and "mpc5200-psc-spi" describe
-the mpc5200 simple spi device and a PSC spi mode respectively.
-
-If the soc device is more generic and present on other SOCs, the
-compatible property can specify the more generic device type also.
-
-ie. mscan: compatible = "mpc5200-mscan\0fsl,mscan";
-
-At the time of writing, exact chip may be either 'mpc5200' or
-'mpc5200b'.
-
-Device drivers should always try to match as generically as possible.
-
-III - Structure
-===============
-The device tree for an mpc5200 board follows the structure defined in
-booting-without-of.txt with the following additional notes:
-
-0) the root node
-----------------
-Typical root description node; see booting-without-of
-
-1) The cpus node
-----------------
-The cpus node follows the basic layout described in booting-without-of.
-The bus-frequency property holds the XLB bus frequency
-The clock-frequency property holds the core frequency
-
-2) The memory node
-------------------
-Typical memory description node; see booting-without-of.
-
-3) The soc5200 node
--------------------
-This node describes the on chip SOC peripherals.  Every mpc5200 based
-board will have this node, and as such there is a common naming
-convention for SOC devices.
-
-Required properties:
-name                   type            description
-----                   ----            -----------
-device_type            string          must be "soc"
-ranges                 int             should be <0 baseaddr baseaddr+10000>
-reg                    int             must be <baseaddr 10000>
-compatible             string          mpc5200: "mpc5200-soc"
-                                       mpc5200b: "mpc5200b-soc\0mpc5200-soc"
-system-frequency       int             Fsystem frequency; source of all
-                                       other clocks.
-bus-frequency          int             IPB bus frequency in HZ.  Clock rate
-                                       used by most of the soc devices.
-#interrupt-cells       int             must be <3>.
-
-Recommended properties:
-name                   type            description
-----                   ----            -----------
-model                  string          Exact model of the chip;
-                                       ie: model="fsl,mpc5200"
-revision               string          Silicon revision of chip
-                                       ie: revision="M08A"
-
-The 'model' and 'revision' properties are *strongly* recommended.  Having
-them presence acts as a bit of a safety net for working around as yet
-undiscovered bugs on one version of silicon.  For example, device drivers
-can use the model and revision properties to decide if a bug fix should
-be turned on.
-
-4) soc5200 child nodes
-----------------------
-Any on chip SOC devices available to Linux must appear as soc5200 child nodes.
-
-Note: The tables below show the value for the mpc5200.  A mpc5200b device
-tree should use the "mpc5200b-<device>\0mpc5200-<device> form.
-
-Required soc5200 child nodes:
-name           device_type             compatible      Description
-----           -----------             ----------      -----------
-cdm@<addr>     cdm                     mpc5200-cmd     Clock Distribution
-pic@<addr>     interrupt-controller    mpc5200-pic     need an interrupt
-                                                       controller to boot
-bestcomm@<addr>        dma-controller          mpc5200-bestcomm 5200 pic also requires
-                                                        the bestcomm device
-
-Recommended soc5200 child nodes; populate as needed for your board
-name           device_type     compatible        Description
-----           -----------     ----------        -----------
-gpt@<addr>     gpt             fsl,mpc5200-gpt   General purpose timers
-gpt@<addr>     gpt             fsl,mpc5200-gpt-gpio    General purpose
-                                                       timers in GPIO mode
-gpio@<addr>                    fsl,mpc5200-gpio        MPC5200 simple gpio
-                                                       controller
-gpio@<addr>                    fsl,mpc5200-gpio-wkup   MPC5200 wakeup gpio
-                                                       controller
-rtc@<addr>     rtc             mpc5200-rtc       Real time clock
-mscan@<addr>   mscan           mpc5200-mscan     CAN bus controller
-pci@<addr>     pci             mpc5200-pci       PCI bridge
-serial@<addr>  serial          mpc5200-psc-uart  PSC in serial mode
-i2s@<addr>     sound           mpc5200-psc-i2s   PSC in i2s mode
-ac97@<addr>    sound           mpc5200-psc-ac97  PSC in ac97 mode
-spi@<addr>     spi             mpc5200-psc-spi   PSC in spi mode
-irda@<addr>    irda            mpc5200-psc-irda  PSC in IrDA mode
-spi@<addr>     spi             mpc5200-spi       MPC5200 spi device
-ethernet@<addr>        network         mpc5200-fec       MPC5200 ethernet device
-ata@<addr>     ata             mpc5200-ata       IDE ATA interface
-i2c@<addr>     i2c             mpc5200-i2c       I2C controller
-usb@<addr>     usb-ohci-be     mpc5200-ohci,ohci-be    USB controller
-xlb@<addr>     xlb             mpc5200-xlb       XLB arbitrator
-
-Important child node properties
-name           type            description
-----           ----            -----------
-cell-index     int             When multiple devices are present, is the
-                               index of the device in the hardware (ie. There
-                               are 6 PSC on the 5200 numbered PSC1 to PSC6)
-                                   PSC1 has 'cell-index = <0>'
-                                   PSC4 has 'cell-index = <3>'
-
-5) General Purpose Timer nodes (child of soc5200 node)
-On the mpc5200 and 5200b, GPT0 has a watchdog timer function.  If the board
-design supports the internal wdt, then the device node for GPT0 should
-include the empty property 'fsl,has-wdt'.
-
-6) PSC nodes (child of soc5200 node)
-PSC nodes can define the optional 'port-number' property to force assignment
-order of serial ports.  For example, PSC5 might be physically connected to
-the port labeled 'COM1' and PSC1 wired to 'COM1'.  In this case, PSC5 would
-have a "port-number = <0>" property, and PSC1 would have "port-number = <1>".
-
-PSC in i2s mode:  The mpc5200 and mpc5200b PSCs are not compatible when in
-i2s mode.  An 'mpc5200b-psc-i2s' node cannot include 'mpc5200-psc-i2s' in the
-compatible field.
-
-7) GPIO controller nodes
-Each GPIO controller node should have the empty property gpio-controller and
-#gpio-cells set to 2. First cell is the GPIO number which is interpreted
-according to the bit numbers in the GPIO control registers. The second cell
-is for flags which is currently unsused.
-
-8) FEC nodes
-The FEC node can specify one of the following properties to configure
-the MII link:
-"fsl,7-wire-mode" - An empty property that specifies the link uses 7-wire
-                    mode instead of MII
-"current-speed"   - Specifies that the MII should be configured for a fixed
-                    speed.  This property should contain two cells.  The
-                    first cell specifies the speed in Mbps and the second
-                    should be '0' for half duplex and '1' for full duplex
-"phy-handle"      - Contains a phandle to an Ethernet PHY.
-
-IV - Extra Notes
-================
-
-1. Interrupt mapping
---------------------
-The mpc5200 pic driver splits hardware IRQ numbers into two levels.  The
-split reflects the layout of the PIC hardware itself, which groups
-interrupts into one of three groups; CRIT, MAIN or PERP.  Also, the
-Bestcomm dma engine has it's own set of interrupt sources which are
-cascaded off of peripheral interrupt 0, which the driver interprets as a
-fourth group, SDMA.
-
-The interrupts property for device nodes using the mpc5200 pic consists
-of three cells; <L1 L2 level>
-
-    L1 := [CRIT=0, MAIN=1, PERP=2, SDMA=3]
-    L2 := interrupt number; directly mapped from the value in the
-          "ICTL PerStat, MainStat, CritStat Encoded Register"
-    level := [LEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3]
-
-2. Shared registers
--------------------
-Some SoC devices share registers between them.  ie. the i2c devices use
-a single clock control register, and almost all device are affected by
-the port_config register.  Devices which need to manipulate shared regs
-should look to the parent SoC node.  The soc node is responsible
-for arbitrating all shared register access.
index 079b628..d6e70be 100644 (file)
@@ -4,12 +4,21 @@
  *
  *     Compile with:
  *             gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
- *      Use as:
- *              v4lgrab >image.ppm
+ *     Use as:
+ *             v4lgrab >image.ppm
  *
  *     Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
- *      Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
- *      with minor modifications (Dave Forrest, drf5n@virginia.edu).
+ *     Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
+ *     with minor modifications (Dave Forrest, drf5n@virginia.edu).
+ *
+ *
+ *     For some cameras you may need to pre-load libv4l to perform
+ *     the necessary decompression, e.g.:
+ *
+ *     export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
+ *     ./v4lgrab >image.ppm
+ *
+ *     see http://hansdegoede.livejournal.com/3636.html for details.
  *
  */
 
@@ -24,7 +33,7 @@
 #include <linux/types.h>
 #include <linux/videodev.h>
 
-#define FILE "/dev/video0"
+#define VIDEO_DEV "/dev/video0"
 
 /* Stole this from tvset.c */
 
@@ -90,7 +99,7 @@ int get_brightness_adj(unsigned char *image, long size, int *brightness) {
 
 int main(int argc, char ** argv)
 {
-  int fd = open(FILE, O_RDONLY), f;
+  int fd = open(VIDEO_DEV, O_RDONLY), f;
   struct video_capability cap;
   struct video_window win;
   struct video_picture vpic;
@@ -100,13 +109,13 @@ int main(int argc, char ** argv)
   unsigned int i, src_depth;
 
   if (fd < 0) {
-    perror(FILE);
+    perror(VIDEO_DEV);
     exit(1);
   }
 
   if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
     perror("VIDIOGCAP");
-    fprintf(stderr, "(" FILE " not a video4linux device?)\n");
+    fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
     close(fd);
     exit(1);
   }
index 7b4596a..1229969 100644 (file)
@@ -158,7 +158,7 @@ Offset      Proto   Name            Meaning
 0202/4 2.00+   header          Magic signature "HdrS"
 0206/2 2.00+   version         Boot protocol version supported
 0208/4 2.00+   realmode_swtch  Boot loader hook (see below)
-020C/2 2.00+   start_sys       The load-low segment (0x1000) (obsolete)
+020C/2 2.00+   start_sys_seg   The load-low segment (0x1000) (obsolete)
 020E/2 2.00+   kernel_version  Pointer to kernel version string
 0210/1 2.00+   type_of_loader  Boot loader identifier
 0211/1 2.00+   loadflags       Boot protocol option flags
@@ -170,10 +170,11 @@ Offset    Proto   Name            Meaning
 0224/2 2.01+   heap_end_ptr    Free memory after setup end
 0226/2 N/A     pad1            Unused
 0228/4 2.02+   cmd_line_ptr    32-bit pointer to the kernel command line
-022C/4 2.03+   initrd_addr_max Highest legal initrd address
+022C/4 2.03+   ramdisk_max     Highest legal initrd address
 0230/4 2.05+   kernel_alignment Physical addr alignment required for kernel
 0234/1 2.05+   relocatable_kernel Whether kernel is relocatable or not
-0235/3 N/A     pad2            Unused
+0235/1 N/A     pad2            Unused
+0236/2 N/A     pad3            Unused
 0238/4 2.06+   cmdline_size    Maximum size of the kernel command line
 023C/4 2.07+   hardware_subarch Hardware subarchitecture
 0240/8 2.07+   hardware_subarch_data Subarchitecture-specific data
@@ -299,14 +300,14 @@ Protocol: 2.00+
   e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version
   10.17.
 
-Field name:    readmode_swtch
+Field name:    realmode_swtch
 Type:          modify (optional)
 Offset/size:   0x208/4
 Protocol:      2.00+
 
   Boot loader hook (see ADVANCED BOOT LOADER HOOKS below.)
 
-Field name:    start_sys
+Field name:    start_sys_seg
 Type:          read
 Offset/size:   0x20c/2
 Protocol:      2.00+
@@ -468,7 +469,7 @@ Protocol:   2.02+
   zero, the kernel will assume that your boot loader does not support
   the 2.02+ protocol.
 
-Field name:    initrd_addr_max
+Field name:    ramdisk_max
 Type:          read
 Offset/size:   0x22c/4
 Protocol:      2.03+
index 474ec0c..cf0ab3a 100644 (file)
@@ -4841,6 +4841,7 @@ P:        Ingo Molnar
 M:     mingo@redhat.com
 P:     H. Peter Anvin
 M:     hpa@zytor.com
+M:     x86@kernel.org
 L:     linux-kernel@vger.kernel.org
 T:     git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
 S:     Maintained
diff --git a/arch/arm/plat-mxc/include/mach/mmc.h b/arch/arm/plat-mxc/include/mach/mmc.h
new file mode 100644 (file)
index 0000000..de2128d
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef ASMARM_ARCH_MMC_H
+#define ASMARM_ARCH_MMC_H
+
+#include <linux/mmc/host.h>
+
+struct device;
+
+/* board specific SDHC data, optional.
+ * If not present, a writable card with 3,3V is assumed.
+ */
+struct imxmmc_platform_data {
+       /* Return values for the get_ro callback should be:
+        *   0 for a read/write card
+        *   1 for a read-only card
+        *   -ENOSYS when not supported (equal to NULL callback)
+        *   or a negative errno value when something bad happened
+        */
+       int (*get_ro)(struct device *);
+
+       /* board specific hook to (de)initialize the SD slot.
+        * The board code can call 'handler' on a card detection
+        * change giving data as argument.
+        */
+       int (*init)(struct device *dev, irq_handler_t handler, void *data);
+       void (*exit)(struct device *dev, void *data);
+
+       /* available voltages. If not given, assume
+        * MMC_VDD_32_33 | MMC_VDD_33_34
+        */
+       unsigned int ocr_avail;
+
+       /* adjust slot voltage */
+       void (*setpower)(struct device *, unsigned int vdd);
+};
+
+#endif
index 52c80c2..600eef3 100644 (file)
@@ -351,7 +351,7 @@ config SGI_IP27
        select ARC64
        select BOOT_ELF64
        select DEFAULT_SGI_PARTITION
-       select DMA_IP27
+       select DMA_COHERENT
        select SYS_HAS_EARLY_PRINTK
        select HW_HAS_PCI
        select NR_CPUS_DEFAULT_64
@@ -761,9 +761,6 @@ config CFE
 config DMA_COHERENT
        bool
 
-config DMA_IP27
-       bool
-
 config DMA_NONCOHERENT
        bool
        select DMA_NEED_PCI_MAP_STATE
@@ -1368,7 +1365,7 @@ config CPU_SUPPORTS_64BIT_KERNEL
 #
 config HARDWARE_WATCHPOINTS
        bool
-       default y if CPU_MIPS32 || CPU_MIPS64
+       default y if CPU_MIPSR1 || CPU_MIPSR2
 
 menu "Kernel type"
 
index 3288014..6fd441d 100644 (file)
@@ -89,7 +89,7 @@ static struct clock_event_device au1x_rtcmatch2_clockdev = {
        .irq            = AU1000_RTC_MATCH2_INT,
        .set_next_event = au1x_rtcmatch2_set_next_event,
        .set_mode       = au1x_rtcmatch2_set_mode,
-       .cpumask        = CPU_MASK_ALL,
+       .cpumask        = CPU_MASK_ALL_PTR,
 };
 
 static struct irqaction au1x_rtcmatch2_irqaction = {
index e085fed..5f4e49b 100644 (file)
 #include <linux/serial.h>
 #include <linux/types.h>
 #include <linux/string.h>      /* for memset */
-#include <linux/serial.h>
 #include <linux/tty.h>
 #include <linux/time.h>
 #include <linux/platform_device.h>
 #include <linux/serial_core.h>
 #include <linux/serial_8250.h>
-#include <linux/string.h>
 
 #include <asm/processor.h>
 #include <asm/reboot.h>
index 34ea319..f2baea3 100644 (file)
@@ -53,7 +53,7 @@ CONFIG_GENERIC_TIME=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_ARC=y
-CONFIG_DMA_IP27=y
+CONFIG_DMA_COHERENT=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_SYS_HAS_EARLY_PRINTK=y
 # CONFIG_NO_IOPORT is not set
index c996c3b..1b332e1 100644 (file)
@@ -50,7 +50,7 @@
 static __inline__ void atomic_add(int i, atomic_t * v)
 {
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -62,7 +62,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
                : "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter));
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -95,7 +95,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
 static __inline__ void atomic_sub(int i, atomic_t * v)
 {
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -107,7 +107,7 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
                : "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter));
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -135,12 +135,12 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
  */
 static __inline__ int atomic_add_return(int i, atomic_t * v)
 {
-       unsigned long result;
+       int result;
 
        smp_llsc_mb();
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -154,7 +154,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -187,12 +187,12 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
 
 static __inline__ int atomic_sub_return(int i, atomic_t * v)
 {
-       unsigned long result;
+       int result;
 
        smp_llsc_mb();
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -206,7 +206,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -247,12 +247,12 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
  */
 static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
 {
-       unsigned long result;
+       int result;
 
        smp_llsc_mb();
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -270,7 +270,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               int temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -429,7 +429,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 static __inline__ void atomic64_add(long i, atomic64_t * v)
 {
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -441,7 +441,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                : "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter));
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -474,7 +474,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
 static __inline__ void atomic64_sub(long i, atomic64_t * v)
 {
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -486,7 +486,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                : "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter));
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -514,12 +514,12 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
  */
 static __inline__ long atomic64_add_return(long i, atomic64_t * v)
 {
-       unsigned long result;
+       long result;
 
        smp_llsc_mb();
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -533,7 +533,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -566,12 +566,12 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
 
 static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
 {
-       unsigned long result;
+       long result;
 
        smp_llsc_mb();
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -585,7 +585,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -626,12 +626,12 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
  */
 static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
 {
-       unsigned long result;
+       long result;
 
        smp_llsc_mb();
 
        if (cpu_has_llsc && R10000_LLSC_WAR) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
@@ -649,7 +649,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
                : "Ir" (i), "m" (v->counter)
                : "memory");
        } else if (cpu_has_llsc) {
-               unsigned long temp;
+               long temp;
 
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
index b5cf645..3cb50d1 100644 (file)
@@ -80,11 +80,8 @@ struct rb532_gpio_reg {
 /* Compact Flash GPIO pin */
 #define CF_GPIO_NUM            13
 
-extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val);
-extern unsigned get_434_reg(unsigned reg_offs);
-extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
-extern unsigned char get_latch_u5(void);
 extern void rb532_gpio_set_ilevel(int bit, unsigned gpio);
 extern void rb532_gpio_set_istat(int bit, unsigned gpio);
+extern void rb532_gpio_set_func(unsigned gpio);
 
 #endif /* _RC32434_GPIO_H_ */
index 56738d8..023a5b1 100644 (file)
@@ -30,4 +30,7 @@
 #define ETH0_RX_OVR_IRQ        (GROUP3_IRQ_BASE + 9)
 #define ETH0_TX_UND_IRQ        (GROUP3_IRQ_BASE + 10)
 
+#define GPIO_MAPPED_IRQ_BASE   GROUP4_IRQ_BASE
+#define GPIO_MAPPED_IRQ_GROUP  4
+
 #endif  /* __ASM_RC32434_IRQ_H */
index f25a849..6dc5f8d 100644 (file)
@@ -83,4 +83,7 @@ struct mpmc_device {
        void __iomem    *base;
 };
 
+extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
+extern unsigned char get_latch_u5(void);
+
 #endif  /* __ASM_RC32434_RB_H */
index 1f30d16..ce47118 100644 (file)
@@ -105,7 +105,7 @@ struct pt_watch_regs {
        enum pt_watch_style style;
        union {
                struct mips32_watch_regs mips32;
-               struct mips32_watch_regs mips64;
+               struct mips64_watch_regs mips64;
        };
 };
 
index a275661..8f77f77 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef _ASM_TERMIOS_H
 #define _ASM_TERMIOS_H
 
+#include <linux/errno.h>
 #include <asm/termbits.h>
 #include <asm/ioctls.h>
 
@@ -94,38 +95,81 @@ struct termio {
 /*
  * Translate a "termio" structure into a "termios". Ugh.
  */
-#define user_termio_to_kernel_termios(termios, termio) \
-({ \
-       unsigned short tmp; \
-       get_user(tmp, &(termio)->c_iflag); \
-       (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
-       get_user(tmp, &(termio)->c_oflag); \
-       (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
-       get_user(tmp, &(termio)->c_cflag); \
-       (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
-       get_user(tmp, &(termio)->c_lflag); \
-       (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
-       get_user((termios)->c_line, &(termio)->c_line); \
-       copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
-})
+static inline int user_termio_to_kernel_termios(struct ktermios *termios,
+       struct termio __user *termio)
+{
+       unsigned short iflag, oflag, cflag, lflag;
+       unsigned int err;
+
+       if (!access_ok(VERIFY_READ, termio, sizeof(struct termio)))
+               return -EFAULT;
+
+       err = __get_user(iflag, &termio->c_iflag);
+       termios->c_iflag = (termios->c_iflag & 0xffff0000) | iflag;
+       err |=__get_user(oflag, &termio->c_oflag);
+       termios->c_oflag = (termios->c_oflag & 0xffff0000) | oflag;
+       err |=__get_user(cflag, &termio->c_cflag);
+       termios->c_cflag = (termios->c_cflag & 0xffff0000) | cflag;
+       err |=__get_user(lflag, &termio->c_lflag);
+       termios->c_lflag = (termios->c_lflag & 0xffff0000) | lflag;
+       err |=__get_user(termios->c_line, &termio->c_line);
+       if (err)
+               return -EFAULT;
+
+       if (__copy_from_user(termios->c_cc, termio->c_cc, NCC))
+               return -EFAULT;
+
+       return 0;
+}
 
 /*
  * Translate a "termios" structure into a "termio". Ugh.
  */
-#define kernel_termios_to_user_termio(termio, termios) \
-({ \
-       put_user((termios)->c_iflag, &(termio)->c_iflag); \
-       put_user((termios)->c_oflag, &(termio)->c_oflag); \
-       put_user((termios)->c_cflag, &(termio)->c_cflag); \
-       put_user((termios)->c_lflag, &(termio)->c_lflag); \
-       put_user((termios)->c_line, &(termio)->c_line); \
-       copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
-})
-
-#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
-#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
-#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
-#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
+static inline int kernel_termios_to_user_termio(struct termio __user *termio,
+       struct ktermios *termios)
+{
+       int err;
+
+       if (!access_ok(VERIFY_WRITE, termio, sizeof(struct termio)))
+               return -EFAULT;
+
+       err = __put_user(termios->c_iflag, &termio->c_iflag);
+       err |= __put_user(termios->c_oflag, &termio->c_oflag);
+       err |= __put_user(termios->c_cflag, &termio->c_cflag);
+       err |= __put_user(termios->c_lflag, &termio->c_lflag);
+       err |= __put_user(termios->c_line, &termio->c_line);
+       if (err)
+               return -EFAULT;
+
+       if (__copy_to_user(termio->c_cc, termios->c_cc, NCC))
+               return -EFAULT;
+
+       return 0;
+}
+
+static inline int user_termios_to_kernel_termios(struct ktermios __user *k,
+       struct termios2 *u)
+{
+       return copy_from_user(k, u, sizeof(struct termios2)) ? -EFAULT : 0;
+}
+
+static inline int kernel_termios_to_user_termios(struct termios2 __user *u,
+       struct ktermios *k)
+{
+       return copy_to_user(u, k, sizeof(struct termios2)) ? -EFAULT : 0;
+}
+
+static inline int user_termios_to_kernel_termios_1(struct ktermios *k,
+       struct termios __user *u)
+{
+       return copy_from_user(k, u, sizeof(struct termios)) ? -EFAULT : 0;
+}
+
+static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
+       struct ktermios *k)
+{
+       return copy_to_user(u, k, sizeof(struct termios)) ? -EFAULT : 0;
+}
 
 #endif /* defined(__KERNEL__) */
 
index 88badb4..964ef7e 100644 (file)
@@ -541,5 +541,6 @@ void tx4939_irq_init(void);
 int tx4939_irq(void);
 void tx4939_mtd_init(int ch);
 void tx4939_ata_init(void);
+void tx4939_rtc_init(void);
 
 #endif /* __ASM_TXX9_TX4939_H */
index fb6f731..8882e57 100644 (file)
@@ -458,7 +458,11 @@ NESTED(nmi_handler, PT_SIZE, sp)
        BUILD_HANDLER fpe fpe fpe silent                /* #15 */
        BUILD_HANDLER mdmx mdmx sti silent              /* #22 */
 #ifdef         CONFIG_HARDWARE_WATCHPOINTS
-       BUILD_HANDLER watch watch sti silent            /* #23 */
+       /*
+        * For watch, interrupts will be enabled after the watch
+        * registers are read.
+        */
+       BUILD_HANDLER watch watch cli silent            /* #23 */
 #else
        BUILD_HANDLER watch watch sti verbose           /* #23 */
 #endif
index 5e77a3a..4246131 100644 (file)
@@ -79,7 +79,8 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
 
        euid = current_euid();
        retval = -EPERM;
-       if (euid != p->euid && euid != p->uid && !capable(CAP_SYS_NICE)) {
+       if (euid != p->cred->euid && euid != p->cred->uid &&
+           !capable(CAP_SYS_NICE)) {
                read_unlock(&tasklist_lock);
                goto out_unlock;
        }
index f6083c6..b2d7041 100644 (file)
@@ -944,6 +944,9 @@ asmlinkage void do_mdmx(struct pt_regs *regs)
        force_sig(SIGILL, current);
 }
 
+/*
+ * Called with interrupts disabled.
+ */
 asmlinkage void do_watch(struct pt_regs *regs)
 {
        u32 cause;
@@ -963,9 +966,12 @@ asmlinkage void do_watch(struct pt_regs *regs)
         */
        if (test_tsk_thread_flag(current, TIF_LOAD_WATCH)) {
                mips_read_watch_registers();
+               local_irq_enable();
                force_sig(SIGTRAP, current);
-       } else
+       } else {
                mips_clear_watch_registers();
+               local_irq_enable();
+       }
 }
 
 asmlinkage void do_mcheck(struct pt_regs *regs)
@@ -1582,7 +1588,11 @@ void __init set_handler(unsigned long offset, void *addr, unsigned long size)
 static char panic_null_cerr[] __cpuinitdata =
        "Trying to set NULL cache error exception handler";
 
-/* Install uncached CPU exception handler */
+/*
+ * Install uncached CPU exception handler.
+ * This is suitable only for the cache error exception which is the only
+ * exception handler that is being run uncached.
+ */
 void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
        unsigned long size)
 {
@@ -1593,7 +1603,7 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
        unsigned long uncached_ebase = TO_UNCAC(ebase);
 #endif
        if (cpu_has_mips_r2)
-               ebase += (read_c0_ebase() & 0x3ffff000);
+               uncached_ebase += (read_c0_ebase() & 0x3ffff000);
 
        if (!addr)
                panic(panic_null_cerr);
index 736d0fb..68853a0 100644 (file)
@@ -21,7 +21,7 @@
  * end of memory on some systems.  It's also a seriously bad idea on non
  * dma-coherent systems.
  */
-#if !defined(CONFIG_DMA_COHERENT) || !defined(CONFIG_DMA_IP27)
+#ifdef CONFIG_DMA_NONCOHERENT
 #undef CONFIG_CPU_HAS_PREFETCH
 #endif
 #ifdef CONFIG_MIPS_MALTA
index c06cccf..56a1f85 100644 (file)
@@ -21,7 +21,7 @@
  * end of memory on some systems.  It's also a seriously bad idea on non
  * dma-coherent systems.
  */
-#if !defined(CONFIG_DMA_COHERENT) || !defined(CONFIG_DMA_IP27)
+#ifdef CONFIG_DMA_NONCOHERENT
 #undef CONFIG_CPU_HAS_PREFETCH
 #endif
 #ifdef CONFIG_MIPS_MALTA
index 6e99665..c43f4b2 100644 (file)
@@ -618,15 +618,35 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
        if (cpu_has_inclusive_pcaches) {
                if (size >= scache_size)
                        r4k_blast_scache();
-               else
+               else {
+                       unsigned long lsize = cpu_scache_line_size();
+                       unsigned long almask = ~(lsize - 1);
+
+                       /*
+                        * There is no clearly documented alignment requirement
+                        * for the cache instruction on MIPS processors and
+                        * some processors, among them the RM5200 and RM7000
+                        * QED processors will throw an address error for cache
+                        * hit ops with insufficient alignment.  Solved by
+                        * aligning the address to cache line size.
+                        */
+                       cache_op(Hit_Writeback_Inv_SD, addr & almask);
+                       cache_op(Hit_Writeback_Inv_SD,
+                                (addr + size - 1) & almask);
                        blast_inv_scache_range(addr, addr + size);
+               }
                return;
        }
 
        if (cpu_has_safe_index_cacheops && size >= dcache_size) {
                r4k_blast_dcache();
        } else {
+               unsigned long lsize = cpu_dcache_line_size();
+               unsigned long almask = ~(lsize - 1);
+
                R4600_HIT_CACHEOP_WAR_IMPL;
+               cache_op(Hit_Writeback_Inv_D, addr & almask);
+               cache_op(Hit_Writeback_Inv_D, (addr + size - 1)  & almask);
                blast_inv_dcache_range(addr, addr + size);
        }
 
index fa636fc..55767ad 100644 (file)
@@ -97,7 +97,6 @@ good_area:
                        goto bad_area;
        }
 
-survive:
        /*
         * If for any reason at all we couldn't handle the fault,
         * make sure we exit gracefully rather than endlessly redo
@@ -167,21 +166,13 @@ no_context:
               field,  regs->regs[31]);
        die("Oops", regs);
 
-/*
- * 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:
-       up_read(&mm->mmap_sem);
-       if (is_global_init(tsk)) {
-               yield();
-               down_read(&mm->mmap_sem);
-               goto survive;
-       }
-       printk("VM: killing process %s\n", tsk->comm);
-       if (user_mode(regs))
-               do_group_exit(SIGKILL);
-       goto no_context;
+       /*
+        * 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).
+        */
+       pagefault_out_of_memory();
+       return;
 
 do_sigbus:
        up_read(&mm->mmap_sem);
index 1c2821e..71f7d27 100644 (file)
@@ -205,6 +205,8 @@ static int __init rc32434_pcibridge_init(void)
 
 static int __init rc32434_pci_init(void)
 {
+       void __iomem *io_map_base;
+
        pr_info("PCI: Initializing PCI\n");
 
        ioport_resource.start = rc32434_res_pci_io1.start;
@@ -212,6 +214,15 @@ static int __init rc32434_pci_init(void)
 
        rc32434_pcibridge_init();
 
+       io_map_base = ioremap(rc32434_res_pci_io1.start,
+               rc32434_res_pci_io1.end - rc32434_res_pci_io1.start + 1);
+
+       if (!io_map_base)
+               return -ENOMEM;
+
+       rc32434_controller.io_map_base =
+               (unsigned long)io_map_base - rc32434_res_pci_io1.start;
+
        register_pci_controller(&rc32434_controller);
        rc32434_sync();
 
index c1c2918..4a5f05b 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/serial_8250.h>
 
 #include <asm/bootinfo.h>
 
 #define ETH0_RX_DMA_ADDR  (DMA0_BASE_ADDR + 0 * DMA_CHAN_OFFSET)
 #define ETH0_TX_DMA_ADDR  (DMA0_BASE_ADDR + 1 * DMA_CHAN_OFFSET)
 
+extern unsigned int idt_cpu_freq;
+
+static struct mpmc_device dev3;
+
+void set_latch_u5(unsigned char or_mask, unsigned char nand_mask)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&dev3.lock, flags);
+
+       dev3.state = (dev3.state | or_mask) & ~nand_mask;
+       writeb(dev3.state, dev3.base);
+
+       spin_unlock_irqrestore(&dev3.lock, flags);
+}
+EXPORT_SYMBOL(set_latch_u5);
+
+unsigned char get_latch_u5(void)
+{
+       return dev3.state;
+}
+EXPORT_SYMBOL(get_latch_u5);
+
 static struct resource korina_dev0_res[] = {
        {
                .name = "korina_regs",
@@ -86,7 +110,7 @@ static struct korina_device korina_dev0_data = {
 static struct platform_device korina_dev0 = {
        .id = -1,
        .name = "korina",
-       .dev.platform_data = &korina_dev0_data,
+       .dev.driver_data = &korina_dev0_data,
        .resource = korina_dev0_res,
        .num_resources = ARRAY_SIZE(korina_dev0_res),
 };
@@ -214,12 +238,32 @@ static struct platform_device rb532_wdt = {
        .num_resources  = ARRAY_SIZE(rb532_wdt_res),
 };
 
+static struct plat_serial8250_port rb532_uart_res[] = {
+       {
+               .membase        = (char *)KSEG1ADDR(REGBASE + UART0BASE),
+               .irq            = UART0_IRQ,
+               .regshift       = 2,
+               .iotype         = UPIO_MEM,
+               .flags          = UPF_BOOT_AUTOCONF,
+       },
+       {
+               .flags          = 0,
+       }
+};
+
+static struct platform_device rb532_uart = {
+       .name              = "serial8250",
+       .id                = PLAT8250_DEV_PLATFORM,
+       .dev.platform_data = &rb532_uart_res,
+};
+
 static struct platform_device *rb532_devs[] = {
        &korina_dev0,
        &nand_slot0,
        &cf_slot0,
        &rb532_led,
        &rb532_button,
+       &rb532_uart,
        &rb532_wdt
 };
 
@@ -291,9 +335,20 @@ static int __init plat_setup_devices(void)
        nand_slot0_res[0].start = readl(IDT434_REG_BASE + DEV2BASE);
        nand_slot0_res[0].end = nand_slot0_res[0].start + 0x1000;
 
+       /* Read and map device controller 3 */
+       dev3.base = ioremap_nocache(readl(IDT434_REG_BASE + DEV3BASE), 1);
+
+       if (!dev3.base) {
+               printk(KERN_ERR "rb532: cannot remap device controller 3\n");
+               return -ENXIO;
+       }
+
        /* Initialise the NAND device */
        rb532_nand_setup();
 
+       /* set the uart clock to the current cpu frequency */
+       rb532_uart_res[0].uartclk = idt_cpu_freq;
+
        return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
 }
 
index 0e84c8a..37de05d 100644 (file)
@@ -41,8 +41,6 @@ struct rb532_gpio_chip {
        void __iomem     *regbase;
 };
 
-struct mpmc_device dev3;
-
 static struct resource rb532_gpio_reg0_res[] = {
        {
                .name   = "gpio_reg0",
@@ -52,61 +50,6 @@ static struct resource rb532_gpio_reg0_res[] = {
        }
 };
 
-static struct resource rb532_dev3_ctl_res[] = {
-       {
-               .name   = "dev3_ctl",
-               .start  = REGBASE + DEV3BASE,
-               .end    = REGBASE + DEV3BASE + sizeof(struct dev_reg) - 1,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val)
-{
-       unsigned long flags;
-       unsigned data;
-       unsigned i = 0;
-
-       spin_lock_irqsave(&dev3.lock, flags);
-
-       data = readl(IDT434_REG_BASE + reg_offs);
-       for (i = 0; i != len; ++i) {
-               if (val & (1 << i))
-                       data |= (1 << (i + bit));
-               else
-                       data &= ~(1 << (i + bit));
-       }
-       writel(data, (IDT434_REG_BASE + reg_offs));
-
-       spin_unlock_irqrestore(&dev3.lock, flags);
-}
-EXPORT_SYMBOL(set_434_reg);
-
-unsigned get_434_reg(unsigned reg_offs)
-{
-       return readl(IDT434_REG_BASE + reg_offs);
-}
-EXPORT_SYMBOL(get_434_reg);
-
-void set_latch_u5(unsigned char or_mask, unsigned char nand_mask)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&dev3.lock, flags);
-
-       dev3.state = (dev3.state | or_mask) & ~nand_mask;
-       writel(dev3.state, &dev3.base);
-
-       spin_unlock_irqrestore(&dev3.lock, flags);
-}
-EXPORT_SYMBOL(set_latch_u5);
-
-unsigned char get_latch_u5(void)
-{
-       return dev3.state;
-}
-EXPORT_SYMBOL(get_latch_u5);
-
 /* rb532_set_bit - sanely set a bit
  *
  * bitval: new value for the bit
@@ -119,13 +62,11 @@ static inline void rb532_set_bit(unsigned bitval,
        unsigned long flags;
        u32 val;
 
-       bitval = !!bitval;              /* map parameter to {0,1} */
-
        local_irq_save(flags);
 
        val = readl(ioaddr);
-       val &= ~( ~bitval << offset );   /* unset bit if bitval == 0 */
-       val |=  (  bitval << offset );   /* set bit if bitval == 1 */
+       val &= ~(!bitval << offset);   /* unset bit if bitval == 0 */
+       val |= (!!bitval << offset);   /* set bit if bitval == 1 */
        writel(val, ioaddr);
 
        local_irq_restore(flags);
@@ -171,8 +112,8 @@ static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 
        gpch = container_of(chip, struct rb532_gpio_chip, chip);
 
-       if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC))
-               return 1;       /* alternate function, GPIOCFG is ignored */
+       /* disable alternate function in case it's set */
+       rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC);
 
        rb532_set_bit(0, offset, gpch->regbase + GPIOCFG);
        return 0;
@@ -188,8 +129,8 @@ static int rb532_gpio_direction_output(struct gpio_chip *chip,
 
        gpch = container_of(chip, struct rb532_gpio_chip, chip);
 
-       if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC))
-               return 1;       /* alternate function, GPIOCFG is ignored */
+       /* disable alternate function in case it's set */
+       rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC);
 
        /* set the initial output value */
        rb532_set_bit(value, offset, gpch->regbase + GPIOD);
@@ -233,10 +174,11 @@ EXPORT_SYMBOL(rb532_gpio_set_istat);
 /*
  * Configure GPIO alternate function
  */
-static void rb532_gpio_set_func(int bit, unsigned gpio)
+void rb532_gpio_set_func(unsigned gpio)
 {
-       rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOFUNC);
+       rb532_set_bit(1, gpio, rb532_gpio_chip->regbase + GPIOFUNC);
 }
+EXPORT_SYMBOL(rb532_gpio_set_func);
 
 int __init rb532_gpio_init(void)
 {
@@ -253,20 +195,6 @@ int __init rb532_gpio_init(void)
        /* Register our GPIO chip */
        gpiochip_add(&rb532_gpio_chip->chip);
 
-       r = rb532_dev3_ctl_res;
-       dev3.base = ioremap_nocache(r->start, r->end - r->start);
-
-       if (!dev3.base) {
-               printk(KERN_ERR "rb532: cannot remap device controller 3\n");
-               return -ENXIO;
-       }
-
-       /* configure CF_GPIO_NUM as CFRDY IRQ source */
-       rb532_gpio_set_func(0, CF_GPIO_NUM);
-       rb532_gpio_direction_input(&rb532_gpio_chip->chip, CF_GPIO_NUM);
-       rb532_gpio_set_ilevel(1, CF_GPIO_NUM);
-       rb532_gpio_set_istat(0, CF_GPIO_NUM);
-
        return 0;
 }
 arch_initcall(rb532_gpio_init);
index 549b46d..53eeb5e 100644 (file)
@@ -46,6 +46,7 @@
 #include <asm/system.h>
 
 #include <asm/mach-rc32434/irq.h>
+#include <asm/mach-rc32434/gpio.h>
 
 struct intr_group {
        u32 mask;       /* mask of valid bits in pending/mask registers */
@@ -150,6 +151,9 @@ static void rb532_disable_irq(unsigned int irq_nr)
                mask |= intr_bit;
                WRITE_MASK(addr, mask);
 
+               if (group == GPIO_MAPPED_IRQ_GROUP)
+                       rb532_gpio_set_istat(0, irq_nr - GPIO_MAPPED_IRQ_BASE);
+
                /*
                 * if there are no more interrupts enabled in this
                 * group, disable corresponding IP
@@ -165,12 +169,35 @@ static void rb532_mask_and_ack_irq(unsigned int irq_nr)
        ack_local_irq(group_to_ip(irq_to_group(irq_nr)));
 }
 
+static int rb532_set_type(unsigned int irq_nr, unsigned type)
+{
+       int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE;
+       int group = irq_to_group(irq_nr);
+
+       if (group != GPIO_MAPPED_IRQ_GROUP)
+               return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL;
+
+       switch (type) {
+       case IRQ_TYPE_LEVEL_HIGH:
+               rb532_gpio_set_ilevel(1, gpio);
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+               rb532_gpio_set_ilevel(0, gpio);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 static struct irq_chip rc32434_irq_type = {
        .name           = "RB532",
        .ack            = rb532_disable_irq,
        .mask           = rb532_disable_irq,
        .mask_ack       = rb532_mask_and_ack_irq,
        .unmask         = rb532_enable_irq,
+       .set_type       = rb532_set_type,
 };
 
 void __init arch_init_irq(void)
index 3e0d7ec..00ed19f 100644 (file)
@@ -36,7 +36,7 @@
 extern unsigned int idt_cpu_freq;
 
 static struct uart_port rb532_uart = {
-       .type = PORT_16550A,
+       .flags = UPF_BOOT_AUTOCONF,
        .line = 0,
        .irq = UART0_IRQ,
        .iotype = UPIO_MEM,
index 6c0049a..5544096 100644 (file)
@@ -435,6 +435,28 @@ void __init tx4939_ata_init(void)
                platform_device_register(&ata1_dev);
 }
 
+void __init tx4939_rtc_init(void)
+{
+       static struct resource res[] = {
+               {
+                       .start = TX4939_RTC_REG & 0xfffffffffULL,
+                       .end = (TX4939_RTC_REG & 0xfffffffffULL) + 0x100 - 1,
+                       .flags = IORESOURCE_MEM,
+               }, {
+                       .start = TXX9_IRQ_BASE + TX4939_IR_RTC,
+                       .flags = IORESOURCE_IRQ,
+               },
+       };
+       static struct platform_device rtc_dev = {
+               .name = "tx4939rtc",
+               .id = -1,
+               .num_resources = ARRAY_SIZE(res),
+               .resource = res,
+       };
+
+       platform_device_register(&rtc_dev);
+}
+
 static void __init tx4939_stop_unused_modules(void)
 {
        __u64 pcfg, rst = 0, ckd = 0;
index 98fbd93..656603b 100644 (file)
@@ -336,6 +336,7 @@ static void __init rbtx4939_device_init(void)
        rbtx4939_led_setup();
        tx4939_wdt_init();
        tx4939_ata_init();
+       tx4939_rtc_init();
 }
 
 static void __init rbtx4939_setup(void)
index 99c495a..1239c61 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc4
-# Thu Nov 13 02:12:40 2008
+# Linux kernel version: 2.6.29-rc2
+# Mon Jan 26 21:41:58 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -43,7 +43,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_OF=y
@@ -71,14 +71,23 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 # CONFIG_RT_GROUP_SCHED is not set
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -110,7 +119,6 @@ CONFIG_SLUB_DEBUG=y
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_IOREMAP_PROT=y
@@ -121,13 +129,11 @@ CONFIG_HAVE_CLK=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_MODULES is not set
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -143,7 +149,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
 # CONFIG_FREEZER is not set
 
 #
@@ -182,9 +187,8 @@ CONFIG_PPC_MPC5200_SIMPLE=y
 # CONFIG_TAU is not set
 # CONFIG_FSL_ULI1575 is not set
 CONFIG_PPC_BESTCOMM=y
-# CONFIG_PPC_BESTCOMM_ATA is not set
 CONFIG_PPC_BESTCOMM_FEC=y
-# CONFIG_PPC_BESTCOMM_GEN_BD is not set
+# CONFIG_SIMPLE_GPIO is not set
 
 #
 # Kernel options
@@ -211,6 +215,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 # CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -222,12 +227,14 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
-# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_UNEVICTABLE_LRU=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -268,6 +275,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+CONFIG_COMPAT_NET_DEV_OPS=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -324,6 +332,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 # CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -336,6 +345,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_AF_RXRPC is not set
 # CONFIG_PHONET is not set
 # CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -427,6 +437,12 @@ CONFIG_MTD_PHYSMAP_OF=y
 # CONFIG_MTD_ONENAND is not set
 
 #
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_QINFO_PROBE is not set
+
+#
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
@@ -514,6 +530,9 @@ CONFIG_LXT_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_FIXED_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
@@ -539,6 +558,10 @@ CONFIG_FEC_MPC52xx_MDIO=y
 # CONFIG_IWLWIFI_LEDS is not set
 
 #
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
 # USB Network Adapters
 #
 # CONFIG_USB_CATC is not set
@@ -588,8 +611,10 @@ CONFIG_SERIAL_MPC52xx=y
 CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=57600
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_HVC_UDBG is not set
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
@@ -629,8 +654,6 @@ CONFIG_I2C_MPC=y
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-# CONFIG_EEPROM_LEGACY is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
@@ -675,10 +698,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
 # CONFIG_PMIC_DA903X is not set
 # CONFIG_MFD_WM8400 is not set
 # CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -736,6 +761,7 @@ CONFIG_USB_DEVICEFS=y
 # USB Host Controller Drivers
 #
 # CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
@@ -760,18 +786,17 @@ CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
 # CONFIG_USB_TMC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
 # CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
@@ -817,6 +842,10 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_VST is not set
 # CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
@@ -826,7 +855,6 @@ CONFIG_USB_STORAGE=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 # CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -847,6 +875,7 @@ CONFIG_FS_MBCACHE=y
 CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -883,10 +912,7 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -906,6 +932,7 @@ CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -1002,6 +1029,7 @@ CONFIG_NLS_ISO8859_1=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_T10DIF is not set
@@ -1053,6 +1081,7 @@ CONFIG_SCHED_DEBUG=y
 # CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1061,6 +1090,8 @@ CONFIG_SCHED_DEBUG=y
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 
 #
 # Tracers
@@ -1069,11 +1100,13 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 # CONFIG_SCHED_TRACER is not set
 # CONFIG_CONTEXT_SWITCH_TRACER is not set
 # CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1100,11 +1133,15 @@ CONFIG_CRYPTO=y
 #
 # CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_CRYPTD is not set
index 9796220..b7b8805 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc4
-# Thu Nov 13 02:10:16 2008
+# Linux kernel version: 2.6.29-rc2
+# Mon Jan 26 21:41:14 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -43,7 +43,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_OF=y
@@ -72,14 +72,23 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 CONFIG_GROUP_SCHED=y
 # CONFIG_FAIR_GROUP_SCHED is not set
 # CONFIG_RT_GROUP_SCHED is not set
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -112,7 +121,6 @@ CONFIG_SLUB_DEBUG=y
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_IOREMAP_PROT=y
@@ -123,7 +131,6 @@ CONFIG_HAVE_CLK=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
 # CONFIG_MODULE_FORCE_LOAD is not set
@@ -131,11 +138,9 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -151,7 +156,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
 CONFIG_FREEZER=y
 
 #
@@ -192,7 +196,7 @@ CONFIG_PPC_LITE5200=y
 CONFIG_PPC_BESTCOMM=y
 CONFIG_PPC_BESTCOMM_ATA=y
 CONFIG_PPC_BESTCOMM_FEC=y
-CONFIG_PPC_BESTCOMM_GEN_BD=y
+# CONFIG_SIMPLE_GPIO is not set
 
 #
 # Kernel options
@@ -220,6 +224,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 # CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -231,12 +236,14 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
-# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_UNEVICTABLE_LRU=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -264,6 +271,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
 CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
+# CONFIG_PCI_STUB is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_HAS_RAPIDIO is not set
@@ -286,6 +294,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+CONFIG_COMPAT_NET_DEV_OPS=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -342,6 +351,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 # CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -354,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_AF_RXRPC is not set
 # CONFIG_PHONET is not set
 # CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -396,13 +407,19 @@ CONFIG_BLK_DEV_RAM_SIZE=32768
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
-# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
 # CONFIG_ICS932S401 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
 # CONFIG_HP_ILO is not set
 # CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_93CX6 is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -445,6 +462,7 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_CXGB3_ISCSI is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
@@ -461,6 +479,8 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_LIBFC is not set
+# CONFIG_FCOE is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -580,6 +600,9 @@ CONFIG_LXT_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_FIXED_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
@@ -626,6 +649,7 @@ CONFIG_NETDEV_1000=y
 # CONFIG_JME is not set
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
+CONFIG_CHELSIO_T3_DEPENDS=y
 # CONFIG_CHELSIO_T3 is not set
 # CONFIG_ENIC is not set
 # CONFIG_IXGBE is not set
@@ -648,6 +672,10 @@ CONFIG_NETDEV_10000=y
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
 # CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
@@ -695,8 +723,10 @@ CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
 # CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_HVC_UDBG is not set
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
@@ -762,8 +792,6 @@ CONFIG_I2C_MPC=y
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-# CONFIG_EEPROM_LEGACY is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
@@ -796,10 +824,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
 # CONFIG_PMIC_DA903X is not set
 # CONFIG_MFD_WM8400 is not set
 # CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -846,9 +876,13 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 #
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 # CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
 # CONFIG_UWB is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -860,7 +894,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 # CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -881,6 +914,7 @@ CONFIG_FS_MBCACHE=y
 CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -914,10 +948,7 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -926,6 +957,7 @@ CONFIG_TMPFS=y
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -967,6 +999,7 @@ CONFIG_MSDOS_PARTITION=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_T10DIF is not set
@@ -1016,6 +1049,7 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1024,6 +1058,8 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 
 #
 # Tracers
@@ -1032,11 +1068,13 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 # CONFIG_SCHED_TRACER is not set
 # CONFIG_CONTEXT_SWITCH_TRACER is not set
 # CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1063,11 +1101,15 @@ CONFIG_CRYPTO=y
 #
 # CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_CRYPTD is not set
index d081e00..fb10f22 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc4
-# Thu Nov 13 02:11:02 2008
+# Linux kernel version: 2.6.29-rc2
+# Mon Jan 26 21:42:29 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -43,7 +43,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_OF=y
@@ -71,14 +71,23 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 # CONFIG_RT_GROUP_SCHED is not set
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -110,7 +119,6 @@ CONFIG_SLUB_DEBUG=y
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_IOREMAP_PROT=y
@@ -121,13 +129,11 @@ CONFIG_HAVE_CLK=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_MODULES is not set
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -143,7 +149,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
 # CONFIG_FREEZER is not set
 
 #
@@ -182,9 +187,9 @@ CONFIG_PPC_MPC5200_SIMPLE=y
 # CONFIG_TAU is not set
 # CONFIG_FSL_ULI1575 is not set
 CONFIG_PPC_BESTCOMM=y
-# CONFIG_PPC_BESTCOMM_ATA is not set
+CONFIG_PPC_BESTCOMM_ATA=y
 CONFIG_PPC_BESTCOMM_FEC=y
-# CONFIG_PPC_BESTCOMM_GEN_BD is not set
+# CONFIG_SIMPLE_GPIO is not set
 
 #
 # Kernel options
@@ -211,6 +216,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 # CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -222,12 +228,14 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
-# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_UNEVICTABLE_LRU=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -268,6 +276,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+CONFIG_COMPAT_NET_DEV_OPS=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -324,6 +333,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 # CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -336,6 +346,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_AF_RXRPC is not set
 # CONFIG_PHONET is not set
 # CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -427,6 +438,12 @@ CONFIG_MTD_ROM=y
 # CONFIG_MTD_ONENAND is not set
 
 #
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_QINFO_PROBE is not set
+
+#
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
@@ -447,10 +464,16 @@ CONFIG_BLK_DEV_RAM_SIZE=32768
 # CONFIG_ATA_OVER_ETH is not set
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
-# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ICS932S401 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
 # CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+CONFIG_EEPROM_LEGACY=y
+# CONFIG_EEPROM_93CX6 is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -492,6 +515,7 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
@@ -525,6 +549,9 @@ CONFIG_SMSC_PHY=y
 CONFIG_BROADCOM_PHY=y
 CONFIG_ICPLUS_PHY=y
 # CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_FIXED_PHY is not set
 CONFIG_MDIO_BITBANG=y
 CONFIG_NET_ETHERNET=y
@@ -548,6 +575,10 @@ CONFIG_FEC_MPC52xx_MDIO=y
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
 # CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -590,8 +621,10 @@ CONFIG_SERIAL_MPC52xx=y
 CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_HVC_UDBG is not set
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
@@ -629,8 +662,6 @@ CONFIG_I2C_MPC=y
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-CONFIG_EEPROM_LEGACY=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
@@ -659,6 +690,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADT7462 is not set
 # CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_F71805F is not set
@@ -678,6 +710,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_LM92 is not set
 # CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_LTC4245 is not set
 # CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_MAX6650 is not set
 # CONFIG_SENSORS_PC87360 is not set
@@ -721,10 +754,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
 # CONFIG_PMIC_DA903X is not set
 # CONFIG_MFD_WM8400 is not set
 # CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -835,7 +870,6 @@ CONFIG_RTC_DRV_DS1307=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 # CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -856,6 +890,7 @@ CONFIG_FS_MBCACHE=y
 CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -892,10 +927,7 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -915,6 +947,7 @@ CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -1011,6 +1044,7 @@ CONFIG_NLS_ISO8859_1=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_T10DIF is not set
@@ -1062,6 +1096,7 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1070,6 +1105,8 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 
 #
 # Tracers
@@ -1078,11 +1115,13 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 # CONFIG_SCHED_TRACER is not set
 # CONFIG_CONTEXT_SWITCH_TRACER is not set
 # CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1109,11 +1148,15 @@ CONFIG_CRYPTO=y
 #
 # CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_CRYPTD is not set
index b21b8e8..00944c0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc4
-# Thu Nov 13 02:13:16 2008
+# Linux kernel version: 2.6.29-rc2
+# Mon Jan 26 21:41:33 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -43,7 +43,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_OF=y
@@ -72,15 +72,24 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 # CONFIG_RT_GROUP_SCHED is not set
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -112,7 +121,6 @@ CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -124,7 +132,6 @@ CONFIG_HAVE_CLK=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
 # CONFIG_MODULE_FORCE_LOAD is not set
@@ -132,11 +139,9 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -152,7 +157,6 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
-CONFIG_CLASSIC_RCU=y
 # CONFIG_FREEZER is not set
 
 #
@@ -191,9 +195,9 @@ CONFIG_PPC_MPC5200_SIMPLE=y
 # CONFIG_TAU is not set
 # CONFIG_FSL_ULI1575 is not set
 CONFIG_PPC_BESTCOMM=y
-CONFIG_PPC_BESTCOMM_ATA=y
+CONFIG_PPC_BESTCOMM_ATA=m
 CONFIG_PPC_BESTCOMM_FEC=y
-CONFIG_PPC_BESTCOMM_GEN_BD=y
+# CONFIG_SIMPLE_GPIO is not set
 
 #
 # Kernel options
@@ -212,7 +216,6 @@ CONFIG_SCHED_HRTICK=y
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-# CONFIG_PREEMPT_RCU is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 # CONFIG_HAVE_AOUT is not set
@@ -222,6 +225,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 # CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -233,12 +237,14 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
-# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_UNEVICTABLE_LRU=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -261,6 +267,7 @@ CONFIG_PCI_SYSCALL=y
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
 CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_STUB is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_HAS_RAPIDIO is not set
@@ -283,6 +290,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+CONFIG_COMPAT_NET_DEV_OPS=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -333,6 +341,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 # CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -345,6 +354,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_AF_RXRPC is not set
 # CONFIG_PHONET is not set
 # CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -365,6 +375,7 @@ CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
 CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
 # CONFIG_MTD_REDBOOT_PARTS is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 # CONFIG_MTD_OF_PARTS is not set
@@ -413,9 +424,7 @@ CONFIG_MTD_CFI_UTIL=y
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_START=0x0
-CONFIG_MTD_PHYSMAP_LEN=0x0
-CONFIG_MTD_PHYSMAP_BANKWIDTH=1
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
 # CONFIG_MTD_PHYSMAP_OF is not set
 # CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
@@ -439,6 +448,12 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
 # CONFIG_MTD_ONENAND is not set
 
 #
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_QINFO_PROBE is not set
+
+#
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
@@ -587,6 +602,9 @@ CONFIG_PHYLIB=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_FIXED_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
@@ -621,6 +639,10 @@ CONFIG_FEC_MPC52xx_MDIO=y
 # CONFIG_IWLWIFI_LEDS is not set
 
 #
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
 # USB Network Adapters
 #
 # CONFIG_USB_CATC is not set
@@ -675,7 +697,9 @@ CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600
 # CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 # CONFIG_LEGACY_PTYS is not set
+# CONFIG_HVC_UDBG is not set
 # CONFIG_IPMI_HANDLER is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_NVRAM is not set
@@ -740,8 +764,6 @@ CONFIG_I2C_MPC=y
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-CONFIG_EEPROM_LEGACY=m
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
@@ -774,10 +796,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
 # CONFIG_PMIC_DA903X is not set
 # CONFIG_MFD_WM8400 is not set
 # CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -837,6 +861,7 @@ CONFIG_USB_DEVICEFS=y
 #
 # CONFIG_USB_C67X00_HCD is not set
 # CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=m
@@ -864,18 +889,17 @@ CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
 # CONFIG_USB_TMC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
 # CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
@@ -921,6 +945,10 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_VST is not set
 # CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
 # CONFIG_UWB is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -983,7 +1011,6 @@ CONFIG_RTC_DRV_PCF8563=m
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 # CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -1004,6 +1031,7 @@ CONFIG_FS_MBCACHE=m
 CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
 # CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY is not set
 # CONFIG_QUOTA is not set
@@ -1039,10 +1067,7 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -1062,6 +1087,7 @@ CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 # CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -1141,6 +1167,7 @@ CONFIG_NLS_ISO8859_1=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_T10DIF is not set
@@ -1173,6 +1200,8 @@ CONFIG_FRAME_WARN=1024
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 
 #
 # Tracers
@@ -1180,6 +1209,7 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_PRINT_STACK_DEPTH=64
 # CONFIG_IRQSTACKS is not set
 # CONFIG_BOOTX_TEXT is not set
 # CONFIG_PPC_EARLY_DEBUG is not set
index 7995457..65237ad 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc4
-# Thu Nov 13 02:09:30 2008
+# Linux kernel version: 2.6.29-rc2
+# Mon Jan 26 21:42:58 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -43,7 +43,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_OF=y
@@ -71,14 +71,23 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 # CONFIG_RT_GROUP_SCHED is not set
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -110,7 +119,6 @@ CONFIG_SLUB_DEBUG=y
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_IOREMAP_PROT=y
@@ -121,7 +129,6 @@ CONFIG_HAVE_CLK=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
 # CONFIG_MODULE_FORCE_LOAD is not set
@@ -129,11 +136,9 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -149,7 +154,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
 # CONFIG_FREEZER is not set
 
 #
@@ -188,9 +192,9 @@ CONFIG_PPC_MPC5200_BUGFIX=y
 # CONFIG_TAU is not set
 # CONFIG_FSL_ULI1575 is not set
 CONFIG_PPC_BESTCOMM=y
-# CONFIG_PPC_BESTCOMM_ATA is not set
+CONFIG_PPC_BESTCOMM_ATA=y
 CONFIG_PPC_BESTCOMM_FEC=y
-# CONFIG_PPC_BESTCOMM_GEN_BD is not set
+# CONFIG_SIMPLE_GPIO is not set
 
 #
 # Kernel options
@@ -217,6 +221,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 # CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -228,12 +233,14 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
-# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_UNEVICTABLE_LRU=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -274,6 +281,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+CONFIG_COMPAT_NET_DEV_OPS=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -330,6 +338,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 # CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -342,6 +351,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_AF_RXRPC is not set
 # CONFIG_PHONET is not set
 # CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -364,6 +374,7 @@ CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=y
 CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
 # CONFIG_MTD_REDBOOT_PARTS is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 # CONFIG_MTD_OF_PARTS is not set
@@ -433,6 +444,12 @@ CONFIG_MTD_PHYSMAP_OF=y
 # CONFIG_MTD_ONENAND is not set
 
 #
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_QINFO_PROBE is not set
+
+#
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
@@ -496,6 +513,7 @@ CONFIG_SCSI_WAIT_SCAN=m
 # CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
+# CONFIG_LIBFC is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_DH is not set
 CONFIG_ATA=y
@@ -530,6 +548,9 @@ CONFIG_LXT_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_FIXED_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
@@ -555,6 +576,10 @@ CONFIG_FEC_MPC52xx_MDIO=y
 # CONFIG_IWLWIFI_LEDS is not set
 
 #
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
 # USB Network Adapters
 #
 # CONFIG_USB_CATC is not set
@@ -604,8 +629,10 @@ CONFIG_SERIAL_MPC52xx=y
 CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_HVC_UDBG is not set
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
@@ -645,8 +672,6 @@ CONFIG_I2C_MPC=y
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-# CONFIG_EEPROM_LEGACY is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
@@ -675,6 +700,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADT7462 is not set
 # CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_F71805F is not set
@@ -694,6 +720,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_LM92 is not set
 # CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_LTC4245 is not set
 # CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_MAX6650 is not set
 # CONFIG_SENSORS_PC87360 is not set
@@ -742,10 +769,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
 # CONFIG_PMIC_DA903X is not set
 # CONFIG_MFD_WM8400 is not set
 # CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -803,6 +832,7 @@ CONFIG_USB_MON=y
 # USB Host Controller Drivers
 #
 # CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
@@ -827,18 +857,17 @@ CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
 # CONFIG_USB_TMC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
 # CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
@@ -884,6 +913,10 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_VST is not set
 # CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
@@ -947,7 +980,6 @@ CONFIG_RTC_DRV_DS1307=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 # CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -968,6 +1000,7 @@ CONFIG_FS_MBCACHE=y
 CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -1004,10 +1037,7 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -1027,6 +1057,7 @@ CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -1123,6 +1154,7 @@ CONFIG_NLS_ISO8859_1=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_T10DIF is not set
@@ -1174,6 +1206,7 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1182,6 +1215,8 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 
 #
 # Tracers
@@ -1190,11 +1225,13 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 # CONFIG_SCHED_TRACER is not set
 # CONFIG_CONTEXT_SWITCH_TRACER is not set
 # CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1221,11 +1258,15 @@ CONFIG_CRYPTO=y
 #
 # CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_CRYPTD is not set
index 5ff3de2..81afc8b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28-rc4
-# Thu Nov 13 02:09:07 2008
+# Linux kernel version: 2.6.29-rc2
+# Mon Jan 26 21:40:44 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -43,7 +43,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 CONFIG_OF=y
@@ -72,10 +72,19 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -108,7 +117,6 @@ CONFIG_SLUB_DEBUG=y
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_IOREMAP_PROT=y
@@ -119,7 +127,6 @@ CONFIG_HAVE_CLK=y
 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
 # CONFIG_MODULE_FORCE_LOAD is not set
@@ -127,11 +134,9 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
 
@@ -147,7 +152,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
 CONFIG_FREEZER=y
 
 #
@@ -192,7 +196,7 @@ CONFIG_RTAS_PROC=y
 CONFIG_PPC_BESTCOMM=y
 CONFIG_PPC_BESTCOMM_ATA=y
 CONFIG_PPC_BESTCOMM_FEC=y
-CONFIG_PPC_BESTCOMM_GEN_BD=y
+# CONFIG_SIMPLE_GPIO is not set
 
 #
 # Kernel options
@@ -220,6 +224,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 # CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -231,12 +236,14 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
-# CONFIG_RESOURCES_64BIT is not set
 # CONFIG_PHYS_ADDR_T_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_UNEVICTABLE_LRU=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_16K_PAGES is not set
+# CONFIG_PPC_64K_PAGES is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -264,6 +271,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
 CONFIG_PCI_LEGACY=y
 # CONFIG_PCI_DEBUG is not set
+# CONFIG_PCI_STUB is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 # CONFIG_HAS_RAPIDIO is not set
@@ -286,6 +294,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+CONFIG_COMPAT_NET_DEV_OPS=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -342,6 +351,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
 # CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
 
 #
 # Network testing
@@ -354,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_AF_RXRPC is not set
 # CONFIG_PHONET is not set
 # CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -376,6 +387,7 @@ CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=y
 CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
 # CONFIG_MTD_REDBOOT_PARTS is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 # CONFIG_MTD_OF_PARTS is not set
@@ -447,6 +459,12 @@ CONFIG_MTD_PHYSMAP_OF=y
 # CONFIG_MTD_ONENAND is not set
 
 #
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_QINFO_PROBE is not set
+
+#
 # UBI - Unsorted block images
 #
 # CONFIG_MTD_UBI is not set
@@ -474,13 +492,19 @@ CONFIG_BLK_DEV_RAM_SIZE=32768
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
-# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
 # CONFIG_ICS932S401 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
 # CONFIG_HP_ILO is not set
 # CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_93CX6 is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -539,6 +563,8 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_LIBFC is not set
+# CONFIG_FCOE is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -659,6 +685,9 @@ CONFIG_PHYLIB=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
 # CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_FIXED_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
@@ -693,6 +722,10 @@ CONFIG_FEC_MPC52xx_MDIO=y
 # CONFIG_IWLWIFI_LEDS is not set
 
 #
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
 # USB Network Adapters
 #
 # CONFIG_USB_CATC is not set
@@ -774,9 +807,11 @@ CONFIG_SERIAL_MPC52xx_CONSOLE=y
 CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
 # CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_HVC_RTAS is not set
+# CONFIG_HVC_UDBG is not set
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
@@ -844,8 +879,6 @@ CONFIG_I2C_MPC=y
 # Miscellaneous I2C Chip support
 #
 # CONFIG_DS1682 is not set
-# CONFIG_EEPROM_AT24 is not set
-# CONFIG_EEPROM_LEGACY is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
@@ -874,6 +907,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADT7462 is not set
 # CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_I5K_AMB is not set
@@ -894,6 +928,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_LM92 is not set
 # CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_LTC4245 is not set
 # CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_MAX6650 is not set
 # CONFIG_SENSORS_PC87360 is not set
@@ -953,10 +988,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
 # CONFIG_PMIC_DA903X is not set
 # CONFIG_MFD_WM8400 is not set
 # CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -1051,7 +1088,7 @@ CONFIG_LCD_CLASS_DEVICE=m
 # CONFIG_LCD_ILI9320 is not set
 # CONFIG_LCD_PLATFORM is not set
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
-# CONFIG_BACKLIGHT_CORGI is not set
+CONFIG_BACKLIGHT_GENERIC=y
 
 #
 # Display device support
@@ -1093,21 +1130,22 @@ CONFIG_HID_COMPAT=y
 CONFIG_HID_A4TECH=y
 # CONFIG_HID_APPLE is not set
 CONFIG_HID_BELKIN=y
-CONFIG_HID_BRIGHT=y
 CONFIG_HID_CHERRY=y
 # CONFIG_HID_CHICONY is not set
 CONFIG_HID_CYPRESS=y
-CONFIG_HID_DELL=y
 CONFIG_HID_EZKEY=y
 # CONFIG_HID_GYRATION is not set
 # CONFIG_HID_LOGITECH is not set
 # CONFIG_HID_MICROSOFT is not set
 # CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_NTRIG is not set
 # CONFIG_HID_PANTHERLORD is not set
 # CONFIG_HID_PETALYNX is not set
 # CONFIG_HID_SAMSUNG is not set
 # CONFIG_HID_SONY is not set
 # CONFIG_HID_SUNPLUS is not set
+# CONFIG_GREENASIA_FF is not set
+# CONFIG_HID_TOPSEED is not set
 # CONFIG_THRUSTMASTER_FF is not set
 # CONFIG_ZEROPLUS_FF is not set
 CONFIG_USB_SUPPORT=y
@@ -1137,6 +1175,7 @@ CONFIG_USB_MON=y
 #
 # CONFIG_USB_C67X00_HCD is not set
 # CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
@@ -1164,18 +1203,17 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_TMC is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
 #
 
 #
-# may also be needed; see USB_STORAGE Help for more information
+# see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
 # CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
@@ -1222,6 +1260,10 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_VST is not set
 # CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
 # CONFIG_UWB is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -1243,7 +1285,6 @@ CONFIG_NEW_LEDS=y
 # CONFIG_DMADEVICES is not set
 # CONFIG_UIO is not set
 # CONFIG_STAGING is not set
-CONFIG_STAGING_EXCLUDE_BUILD=y
 
 #
 # File systems
@@ -1264,6 +1305,7 @@ CONFIG_FS_MBCACHE=y
 CONFIG_FILE_LOCKING=y
 # CONFIG_XFS_FS is not set
 # CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -1300,10 +1342,7 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
+CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -1323,6 +1362,7 @@ CONFIG_JFFS2_ZLIB=y
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -1403,6 +1443,7 @@ CONFIG_NLS_ISO8859_1=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_T10DIF is not set
@@ -1454,6 +1495,7 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1462,6 +1504,8 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 
 #
 # Tracers
@@ -1470,11 +1514,13 @@ CONFIG_HAVE_FUNCTION_TRACER=y
 # CONFIG_SCHED_TRACER is not set
 # CONFIG_CONTEXT_SWITCH_TRACER is not set
 # CONFIG_BOOT_TRACER is not set
+# CONFIG_TRACE_BRANCH_PROFILING is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
+CONFIG_PRINT_STACK_DEPTH=64
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
@@ -1501,11 +1547,15 @@ CONFIG_CRYPTO=y
 #
 # CONFIG_CRYPTO_FIPS is not set
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_GF128MUL is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_CRYPTD is not set
index da5a385..19b12d2 100644 (file)
@@ -16,8 +16,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#define DEBUG
-
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/string.h>
@@ -258,7 +256,8 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
        } else {
                pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
                         oirq.size, oirq.specifier[0], oirq.specifier[1],
-                   oirq.controller->full_name);
+                        oirq.controller ? oirq.controller->full_name :
+                        "<default>");
 
                virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
                                             oirq.size);
index c3f2c21..87ff522 100644 (file)
 
 
 /* ======================================================================== */
-/* PCI windows config                                                       */
-/* ======================================================================== */
-
-#define MPC52xx_PCI_TARGET_IO  0xf0000000
-#define MPC52xx_PCI_TARGET_MEM 0x00000000
-
-
-/* ======================================================================== */
 /* Structures mapping & Defines for PCI Unit                                */
 /* ======================================================================== */
 
@@ -244,7 +236,7 @@ static struct pci_ops mpc52xx_pci_ops = {
 
 static void __init
 mpc52xx_pci_setup(struct pci_controller *hose,
-                  struct mpc52xx_pci __iomem *pci_regs)
+                  struct mpc52xx_pci __iomem *pci_regs, phys_addr_t pci_phys)
 {
        struct resource *res;
        u32 tmp;
@@ -314,10 +306,14 @@ mpc52xx_pci_setup(struct pci_controller *hose,
        /* Set all the IWCR fields at once; they're in the same reg */
        out_be32(&pci_regs->iwcr, MPC52xx_PCI_IWCR_PACK(iwcr0, iwcr1, iwcr2));
 
-       out_be32(&pci_regs->tbatr0,
-               MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_IO );
-       out_be32(&pci_regs->tbatr1,
-               MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_MEM );
+       /* Map IMMR onto PCI bus */
+       pci_phys &= 0xfffc0000; /* bar0 has only 14 significant bits */
+       out_be32(&pci_regs->tbatr0, MPC52xx_PCI_TBATR_ENABLE | pci_phys);
+       out_be32(&pci_regs->bar0, PCI_BASE_ADDRESS_MEM_PREFETCH | pci_phys);
+
+       /* Map memory onto PCI bus */
+       out_be32(&pci_regs->tbatr1, MPC52xx_PCI_TBATR_ENABLE);
+       out_be32(&pci_regs->bar1, PCI_BASE_ADDRESS_MEM_PREFETCH);
 
        out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD | MPC52xx_PCI_TCR_WCT8);
 
@@ -414,7 +410,7 @@ mpc52xx_add_bridge(struct device_node *node)
 
        /* Finish setting up PCI using values obtained by
         * pci_proces_bridge_OF_ranges */
-       mpc52xx_pci_setup(hose, pci_regs);
+       mpc52xx_pci_setup(hose, pci_regs, rsrc.start);
 
        return 0;
 }
index d6218e6..270ecf9 100644 (file)
@@ -5,7 +5,7 @@ mainmenu "Linux Kernel Configuration for x86"
 config 64BIT
        bool "64-bit kernel" if ARCH = "x86"
        default ARCH = "x86_64"
-       help
+       ---help---
          Say yes to build a 64-bit kernel - formerly known as x86_64
          Say no to build a 32-bit kernel - formerly known as i386
 
@@ -34,8 +34,8 @@ config X86
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACE_MCOUNT_TEST
-       select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
-       select HAVE_ARCH_KGDB if !X86_VOYAGER
+       select HAVE_KVM
+       select HAVE_ARCH_KGDB
        select HAVE_ARCH_TRACEHOOK
        select HAVE_GENERIC_DMA_COHERENT if X86_32
        select HAVE_EFFICIENT_UNALIGNED_ACCESS
@@ -140,11 +140,10 @@ config HAVE_CPUMASK_OF_CPU_MAP
 
 config ARCH_HIBERNATION_POSSIBLE
        def_bool y
-       depends on !SMP || !X86_VOYAGER
+       depends on !SMP
 
 config ARCH_SUSPEND_POSSIBLE
        def_bool y
-       depends on !X86_VOYAGER
 
 config ZONE_DMA32
        bool
@@ -174,11 +173,6 @@ config GENERIC_PENDING_IRQ
        depends on GENERIC_HARDIRQS && SMP
        default y
 
-config X86_SMP
-       bool
-       depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
-       default y
-
 config USE_GENERIC_SMP_HELPERS
        def_bool y
        depends on SMP
@@ -194,17 +188,11 @@ config X86_64_SMP
 config X86_HT
        bool
        depends on SMP
-       depends on (X86_32 && !X86_VOYAGER) || X86_64
-       default y
-
-config X86_BIOS_REBOOT
-       bool
-       depends on !X86_VOYAGER
        default y
 
 config X86_TRAMPOLINE
        bool
-       depends on X86_SMP || (X86_VOYAGER && SMP) || (64BIT && ACPI_SLEEP)
+       depends on SMP || (64BIT && ACPI_SLEEP)
        default y
 
 config KTIME_SCALAR
@@ -244,14 +232,10 @@ config SMP
 
          If you don't know what to do here, say N.
 
-config X86_HAS_BOOT_CPU_ID
-       def_bool y
-       depends on X86_VOYAGER
-
 config SPARSE_IRQ
        bool "Support sparse irq numbering"
        depends on PCI_MSI || HT_IRQ
-       help
+       ---help---
          This enables support for sparse irqs. This is useful for distro
          kernels that want to define a high CONFIG_NR_CPUS value but still
          want to have low kernel memory footprint on smaller machines.
@@ -265,70 +249,107 @@ config NUMA_MIGRATE_IRQ_DESC
        bool "Move irq desc when changing irq smp_affinity"
        depends on SPARSE_IRQ && NUMA
        default n
-       help
+       ---help---
          This enables moving irq_desc to cpu/node that irq will use handled.
 
          If you don't know what to do here, say N.
 
-config X86_FIND_SMP_CONFIG
-       def_bool y
-       depends on X86_MPPARSE || X86_VOYAGER
-
 config X86_MPPARSE
        bool "Enable MPS table" if ACPI
        default y
        depends on X86_LOCAL_APIC
-       help
+       ---help---
          For old smp systems that do not have proper acpi support. Newer systems
          (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
 
-choice
-       prompt "Subarchitecture Type"
-       default X86_PC
+config X86_BIGSMP
+       bool "Support for big SMP systems with more than 8 CPUs"
+       depends on X86_32 && SMP
+       ---help---
+         This option is needed for the systems that have more than 8 CPUs
 
-config X86_PC
-       bool "PC-compatible"
-       help
-         Choose this option if your computer is a standard PC or compatible.
+config X86_NON_STANDARD
+       bool "Support for non-standard x86 platforms"
+       ---help---
+         If you disable this option then the kernel will only support
+         standard PC platforms. (which covers the vast majority of
+         systems out there.)
+
+         If you enable this option then you'll be able to select a number
+         of less common non-PC x86 platforms: VisWS, RDC321, SGI/UV.
+
+         If you have one of these systems, or if you want to build a
+         generic distribution kernel, say Y here - otherwise say N.
+
+config X86_VISWS
+       bool "SGI 320/540 (Visual Workstation)"
+       depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT
+       depends on X86_NON_STANDARD
+       ---help---
+         The SGI Visual Workstation series is an IA32-based workstation
+         based on SGI systems chips with some legacy PC hardware attached.
+
+         Say Y here to create a kernel to run on the SGI 320 or 540.
+
+         A kernel compiled for the Visual Workstation will run on general
+         PCs as well. See <file:Documentation/sgi-visws.txt> for details.
+
+config X86_RDC321X
+       bool "RDC R-321x SoC"
+       depends on X86_32
+       depends on X86_NON_STANDARD
+       select M486
+       select X86_REBOOTFIXUPS
+       ---help---
+         This option is needed for RDC R-321x system-on-chip, also known
+         as R-8610-(G).
+         If you don't have one of these chips, you should say N here.
+
+config X86_UV
+       bool "SGI Ultraviolet"
+       depends on X86_64
+       depends on X86_NON_STANDARD
+       ---help---
+         This option is needed in order to support SGI Ultraviolet systems.
+         If you don't have one of these, you should say N here.
+
+config X86_VSMP
+       bool "Support for ScaleMP vSMP"
+       select PARAVIRT
+       depends on X86_64 && PCI
+       depends on X86_NON_STANDARD
+       ---help---
+         Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
+         supposed to run on these EM64T-based machines.  Only choose this option
+         if you have one of these machines.
 
 config X86_ELAN
        bool "AMD Elan"
        depends on X86_32
-       help
+       depends on X86_NON_STANDARD
+       ---help---
          Select this for an AMD Elan processor.
 
          Do not use this option for K6/Athlon/Opteron processors!
 
          If unsure, choose "PC-compatible" instead.
 
-config X86_VOYAGER
-       bool "Voyager (NCR)"
-       depends on X86_32 && (SMP || BROKEN) && !PCI
-       help
-         Voyager is an MCA-based 32-way capable SMP architecture proprietary
-         to NCR Corp.  Machine classes 345x/35xx/4100/51xx are Voyager-based.
-
-         *** WARNING ***
-
-         If you do not specifically know you have a Voyager based machine,
-         say N here, otherwise the kernel you build will not be bootable.
-
-config X86_GENERICARCH
-       bool "Generic architecture"
-       depends on X86_32
-       help
-          This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default
+config X86_32_NON_STANDARD
+       bool "Support non-standard 32-bit SMP architectures"
+       depends on X86_32 && SMP
+       depends on X86_NON_STANDARD
+       ---help---
+         This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default
          subarchitectures.  It is intended for a generic binary kernel.
          if you select them all, kernel will probe it one by one. and will
          fallback to default.
 
-if X86_GENERICARCH
-
 config X86_NUMAQ
        bool "NUMAQ (IBM/Sequent)"
-       depends on SMP && X86_32 && PCI && X86_MPPARSE
+       depends on X86_32_NON_STANDARD
        select NUMA
-       help
+       select X86_MPPARSE
+       ---help---
          This option is used for getting Linux to run on a NUMAQ (IBM/Sequent)
          NUMA multiquad box. This changes the way that processors are
          bootstrapped, and uses Clustered Logical APIC addressing mode instead
@@ -337,72 +358,36 @@ config X86_NUMAQ
 
 config X86_SUMMIT
        bool "Summit/EXA (IBM x440)"
-       depends on X86_32 && SMP
-       help
+       depends on X86_32_NON_STANDARD
+       ---help---
          This option is needed for IBM systems that use the Summit/EXA chipset.
          In particular, it is needed for the x440.
 
 config X86_ES7000
        bool "Support for Unisys ES7000 IA32 series"
-       depends on X86_32 && SMP
-       help
+       depends on X86_32_NON_STANDARD && X86_BIGSMP
+       ---help---
          Support for Unisys ES7000 systems.  Say 'Y' here if this kernel is
          supposed to run on an IA32-based Unisys ES7000 system.
 
-config X86_BIGSMP
-       bool "Support for big SMP systems with more than 8 CPUs"
-       depends on X86_32 && SMP
-       help
-         This option is needed for the systems that have more than 8 CPUs
-         and if the system is not of any sub-arch type above.
-
-endif
-
-config X86_VSMP
-       bool "Support for ScaleMP vSMP"
-       select PARAVIRT
-       depends on X86_64 && PCI
-       help
-         Support for ScaleMP vSMP systems.  Say 'Y' here if this kernel is
-         supposed to run on these EM64T-based machines.  Only choose this option
-         if you have one of these machines.
-
-endchoice
-
-config X86_VISWS
-       bool "SGI 320/540 (Visual Workstation)"
-       depends on X86_32 && PCI && !X86_VOYAGER && X86_MPPARSE && PCI_GODIRECT
-       help
-         The SGI Visual Workstation series is an IA32-based workstation
-         based on SGI systems chips with some legacy PC hardware attached.
-
-         Say Y here to create a kernel to run on the SGI 320 or 540.
-
-         A kernel compiled for the Visual Workstation will run on general
-         PCs as well. See <file:Documentation/sgi-visws.txt> for details.
+config X86_VOYAGER
+       bool "Voyager (NCR)"
+       depends on SMP && !PCI && BROKEN
+       depends on X86_32_NON_STANDARD
+       ---help---
+         Voyager is an MCA-based 32-way capable SMP architecture proprietary
+         to NCR Corp.  Machine classes 345x/35xx/4100/51xx are Voyager-based.
 
-config X86_RDC321X
-       bool "RDC R-321x SoC"
-       depends on X86_32
-       select M486
-       select X86_REBOOTFIXUPS
-       help
-         This option is needed for RDC R-321x system-on-chip, also known
-         as R-8610-(G).
-         If you don't have one of these chips, you should say N here.
+         *** WARNING ***
 
-config X86_UV
-       bool "SGI Ultraviolet"
-       depends on X86_64
-       help
-         This option is needed in order to support SGI Ultraviolet systems.
-         If you don't have one of these, you should say N here.
+         If you do not specifically know you have a Voyager based machine,
+         say N here, otherwise the kernel you build will not be bootable.
 
 config SCHED_OMIT_FRAME_POINTER
        def_bool y
        prompt "Single-depth WCHAN output"
        depends on X86
-       help
+       ---help---
          Calculate simpler /proc/<PID>/wchan values. If this option
          is disabled then wchan values will recurse back to the
          caller function. This provides more accurate wchan values,
@@ -412,7 +397,7 @@ config SCHED_OMIT_FRAME_POINTER
 
 menuconfig PARAVIRT_GUEST
        bool "Paravirtualized guest support"
-       help
+       ---help---
          Say Y here to get to see options related to running Linux under
          various hypervisors.  This option alone does not add any kernel code.
 
@@ -426,8 +411,7 @@ config VMI
        bool "VMI Guest support"
        select PARAVIRT
        depends on X86_32
-       depends on !X86_VOYAGER
-       help
+       ---help---
          VMI provides a paravirtualized interface to the VMware ESX server
          (it could be used by other hypervisors in theory too, but is not
          at the moment), by linking the kernel to a GPL-ed ROM module
@@ -437,8 +421,7 @@ config KVM_CLOCK
        bool "KVM paravirtualized clock"
        select PARAVIRT
        select PARAVIRT_CLOCK
-       depends on !X86_VOYAGER
-       help
+       ---help---
          Turning on this option will allow you to run a paravirtualized clock
          when running over the KVM hypervisor. Instead of relying on a PIT
          (or probably other) emulation by the underlying device model, the host
@@ -448,17 +431,15 @@ config KVM_CLOCK
 config KVM_GUEST
        bool "KVM Guest support"
        select PARAVIRT
-       depends on !X86_VOYAGER
-       help
-        This option enables various optimizations for running under the KVM
-        hypervisor.
+       ---help---
+         This option enables various optimizations for running under the KVM
+         hypervisor.
 
 source "arch/x86/lguest/Kconfig"
 
 config PARAVIRT
        bool "Enable paravirtualization code"
-       depends on !X86_VOYAGER
-       help
+       ---help---
          This changes the kernel so it can modify itself when it is run
          under a hypervisor, potentially improving performance significantly
          over full virtualization.  However, when run without a hypervisor
@@ -471,51 +452,51 @@ config PARAVIRT_CLOCK
 endif
 
 config PARAVIRT_DEBUG
-       bool "paravirt-ops debugging"
-       depends on PARAVIRT && DEBUG_KERNEL
-       help
-         Enable to debug paravirt_ops internals.  Specifically, BUG if
-        a paravirt_op is missing when it is called.
+       bool "paravirt-ops debugging"
+       depends on PARAVIRT && DEBUG_KERNEL
+       ---help---
+         Enable to debug paravirt_ops internals.  Specifically, BUG if
+         a paravirt_op is missing when it is called.
 
 config MEMTEST
        bool "Memtest"
-       help
+       ---help---
          This option adds a kernel parameter 'memtest', which allows memtest
          to be set.
-               memtest=0, mean disabled; -- default
-               memtest=1, mean do 1 test pattern;
-               ...
-               memtest=4, mean do 4 test patterns.
+               memtest=0, mean disabled; -- default
+               memtest=1, mean do 1 test pattern;
+               ...
+               memtest=4, mean do 4 test patterns.
          If you are unsure how to answer this question, answer N.
 
 config X86_SUMMIT_NUMA
        def_bool y
-       depends on X86_32 && NUMA && X86_GENERICARCH
+       depends on X86_32 && NUMA && X86_32_NON_STANDARD
 
 config X86_CYCLONE_TIMER
        def_bool y
-       depends on X86_GENERICARCH
+       depends on X86_32_NON_STANDARD
 
 source "arch/x86/Kconfig.cpu"
 
 config HPET_TIMER
        def_bool X86_64
        prompt "HPET Timer Support" if X86_32
-       help
-         Use the IA-PC HPET (High Precision Event Timer) to manage
-         time in preference to the PIT and RTC, if a HPET is
-         present.
-         HPET is the next generation timer replacing legacy 8254s.
-         The HPET provides a stable time base on SMP
-         systems, unlike the TSC, but it is more expensive to access,
-         as it is off-chip.  You can find the HPET spec at
-         <http://www.intel.com/hardwaredesign/hpetspec_1.pdf>.
+       ---help---
+         Use the IA-PC HPET (High Precision Event Timer) to manage
+         time in preference to the PIT and RTC, if a HPET is
+         present.
+         HPET is the next generation timer replacing legacy 8254s.
+         The HPET provides a stable time base on SMP
+         systems, unlike the TSC, but it is more expensive to access,
+         as it is off-chip.  You can find the HPET spec at
+         <http://www.intel.com/hardwaredesign/hpetspec_1.pdf>.
 
-         You can safely choose Y here.  However, HPET will only be
-         activated if the platform and the BIOS support this feature.
-         Otherwise the 8254 will be used for timing services.
+         You can safely choose Y here.  However, HPET will only be
+         activated if the platform and the BIOS support this feature.
+         Otherwise the 8254 will be used for timing services.
 
-         Choose N to continue using the legacy 8254 timer.
+         Choose N to continue using the legacy 8254 timer.
 
 config HPET_EMULATE_RTC
        def_bool y
@@ -526,7 +507,7 @@ config HPET_EMULATE_RTC
 config DMI
        default y
        bool "Enable DMI scanning" if EMBEDDED
-       help
+       ---help---
          Enabled scanning of DMI to identify machine quirks. Say Y
          here unless you have verified that your setup is not
          affected by entries in the DMI blacklist. Required by PNP
@@ -538,7 +519,7 @@ config GART_IOMMU
        select SWIOTLB
        select AGP
        depends on X86_64 && PCI
-       help
+       ---help---
          Support for full DMA access of devices with 32bit memory access only
          on systems with more than 3GB. This is usually needed for USB,
          sound, many IDE/SATA chipsets and some other devices.
@@ -553,7 +534,7 @@ config CALGARY_IOMMU
        bool "IBM Calgary IOMMU support"
        select SWIOTLB
        depends on X86_64 && PCI && EXPERIMENTAL
-       help
+       ---help---
          Support for hardware IOMMUs in IBM's xSeries x366 and x460
          systems. Needed to run systems with more than 3GB of memory
          properly with 32-bit PCI devices that do not support DAC
@@ -571,7 +552,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
        def_bool y
        prompt "Should Calgary be enabled by default?"
        depends on CALGARY_IOMMU
-       help
+       ---help---
          Should Calgary be enabled by default? if you choose 'y', Calgary
          will be used (if it exists). If you choose 'n', Calgary will not be
          used even if it exists. If you choose 'n' and would like to use
@@ -583,7 +564,7 @@ config AMD_IOMMU
        select SWIOTLB
        select PCI_MSI
        depends on X86_64 && PCI && ACPI
-       help
+       ---help---
          With this option you can enable support for AMD IOMMU hardware in
          your system. An IOMMU is a hardware component which provides
          remapping of DMA memory accesses from devices. With an AMD IOMMU you
@@ -598,7 +579,7 @@ config AMD_IOMMU_STATS
        bool "Export AMD IOMMU statistics to debugfs"
        depends on AMD_IOMMU
        select DEBUG_FS
-       help
+       ---help---
          This option enables code in the AMD IOMMU driver to collect various
          statistics about whats happening in the driver and exports that
          information to userspace via debugfs.
@@ -607,7 +588,7 @@ config AMD_IOMMU_STATS
 # need this always selected by IOMMU for the VIA workaround
 config SWIOTLB
        def_bool y if X86_64
-       help
+       ---help---
          Support for software bounce buffers used on x86-64 systems
          which don't have a hardware IOMMU (e.g. the current generation
          of Intel's x86-64 CPUs). Using this PCI devices which can only
@@ -625,7 +606,7 @@ config MAXSMP
        depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
        select CPUMASK_OFFSTACK
        default n
-       help
+       ---help---
          Configure maximum number of CPUS and NUMA Nodes for this architecture.
          If unsure, say N.
 
@@ -636,7 +617,7 @@ config NR_CPUS
        default "4096" if MAXSMP
        default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000)
        default "8" if SMP
-       help
+       ---help---
          This allows you to specify the maximum number of CPUs which this
          kernel will support.  The maximum supported value is 512 and the
          minimum value which makes sense is 2.
@@ -647,7 +628,7 @@ config NR_CPUS
 config SCHED_SMT
        bool "SMT (Hyperthreading) scheduler support"
        depends on X86_HT
-       help
+       ---help---
          SMT scheduler support improves the CPU scheduler's decision making
          when dealing with Intel Pentium 4 chips with HyperThreading at a
          cost of slightly increased overhead in some places. If unsure say
@@ -657,7 +638,7 @@ config SCHED_MC
        def_bool y
        prompt "Multi-core scheduler support"
        depends on X86_HT
-       help
+       ---help---
          Multi-core scheduler support improves the CPU scheduler's decision
          making when dealing with multi-core CPU chips at a cost of slightly
          increased overhead in some places. If unsure say N here.
@@ -666,8 +647,8 @@ source "kernel/Kconfig.preempt"
 
 config X86_UP_APIC
        bool "Local APIC support on uniprocessors"
-       depends on X86_32 && !SMP && !(X86_VOYAGER || X86_GENERICARCH)
-       help
+       depends on X86_32 && !SMP && !X86_32_NON_STANDARD
+       ---help---
          A local APIC (Advanced Programmable Interrupt Controller) is an
          integrated interrupt controller in the CPU. If you have a single-CPU
          system which has a processor with a local APIC, you can say Y here to
@@ -680,7 +661,7 @@ config X86_UP_APIC
 config X86_UP_IOAPIC
        bool "IO-APIC support on uniprocessors"
        depends on X86_UP_APIC
-       help
+       ---help---
          An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
          SMP-capable replacement for PC-style interrupt controllers. Most
          SMP systems and many recent uniprocessor systems have one.
@@ -691,11 +672,11 @@ config X86_UP_IOAPIC
 
 config X86_LOCAL_APIC
        def_bool y
-       depends on X86_64 || (X86_32 && (X86_UP_APIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH))
+       depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
 
 config X86_IO_APIC
        def_bool y
-       depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH))
+       depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
 
 config X86_VISWS_APIC
        def_bool y
@@ -705,7 +686,7 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
        bool "Reroute for broken boot IRQs"
        default n
        depends on X86_IO_APIC
-       help
+       ---help---
          This option enables a workaround that fixes a source of
          spurious interrupts. This is recommended when threaded
          interrupt handling is used on systems where the generation of
@@ -727,7 +708,6 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
 
 config X86_MCE
        bool "Machine Check Exception"
-       depends on !X86_VOYAGER
        ---help---
          Machine Check Exception support allows the processor to notify the
          kernel if it detects a problem (e.g. overheating, component failure).
@@ -746,7 +726,7 @@ config X86_MCE_INTEL
        def_bool y
        prompt "Intel MCE features"
        depends on X86_64 && X86_MCE && X86_LOCAL_APIC
-       help
+       ---help---
           Additional support for intel specific MCE features such as
           the thermal monitor.
 
@@ -754,14 +734,14 @@ config X86_MCE_AMD
        def_bool y
        prompt "AMD MCE features"
        depends on X86_64 && X86_MCE && X86_LOCAL_APIC
-       help
+       ---help---
           Additional support for AMD specific MCE features such as
           the DRAM Error Threshold.
 
 config X86_MCE_NONFATAL
        tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
        depends on X86_32 && X86_MCE
-       help
+       ---help---
          Enabling this feature starts a timer that triggers every 5 seconds which
          will look at the machine check registers to see if anything happened.
          Non-fatal problems automatically get corrected (but still logged).
@@ -774,7 +754,7 @@ config X86_MCE_NONFATAL
 config X86_MCE_P4THERMAL
        bool "check for P4 thermal throttling interrupt."
        depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP)
-       help
+       ---help---
          Enabling this feature will cause a message to be printed when the P4
          enters thermal throttling.
 
@@ -782,11 +762,11 @@ config VM86
        bool "Enable VM86 support" if EMBEDDED
        default y
        depends on X86_32
-       help
-          This option is required by programs like DOSEMU to run 16-bit legacy
+       ---help---
+         This option is required by programs like DOSEMU to run 16-bit legacy
          code on X86 processors. It also may be needed by software like
-          XFree86 to initialize some video cards via BIOS. Disabling this
-          option saves about 6k.
+         XFree86 to initialize some video cards via BIOS. Disabling this
+         option saves about 6k.
 
 config TOSHIBA
        tristate "Toshiba Laptop support"
@@ -860,33 +840,33 @@ config MICROCODE
          module will be called microcode.
 
 config MICROCODE_INTEL
-       bool "Intel microcode patch loading support"
-       depends on MICROCODE
-       default MICROCODE
-       select FW_LOADER
-       --help---
-         This options enables microcode patch loading support for Intel
-         processors.
-
-         For latest news and information on obtaining all the required
-         Intel ingredients for this driver, check:
-         <http://www.urbanmyth.org/microcode/>.
+       bool "Intel microcode patch loading support"
+       depends on MICROCODE
+       default MICROCODE
+       select FW_LOADER
+       ---help---
+         This options enables microcode patch loading support for Intel
+         processors.
+
+         For latest news and information on obtaining all the required
+         Intel ingredients for this driver, check:
+         <http://www.urbanmyth.org/microcode/>.
 
 config MICROCODE_AMD
-       bool "AMD microcode patch loading support"
-       depends on MICROCODE
-       select FW_LOADER
-       --help---
-         If you select this option, microcode patch loading support for AMD
-        processors will be enabled.
+       bool "AMD microcode patch loading support"
+       depends on MICROCODE
+       select FW_LOADER
+       ---help---
+         If you select this option, microcode patch loading support for AMD
+         processors will be enabled.
 
-   config MICROCODE_OLD_INTERFACE
+config MICROCODE_OLD_INTERFACE
        def_bool y
        depends on MICROCODE
 
 config X86_MSR
        tristate "/dev/cpu/*/msr - Model-specific register support"
-       help
+       ---help---
          This device gives privileged processes access to the x86
          Model-Specific Registers (MSRs).  It is a character device with
          major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr.
@@ -895,7 +875,7 @@ config X86_MSR
 
 config X86_CPUID
        tristate "/dev/cpu/*/cpuid - CPU information support"
-       help
+       ---help---
          This device gives processes access to the x86 CPUID instruction to
          be executed on a specific processor.  It is a character device
          with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
@@ -947,7 +927,7 @@ config NOHIGHMEM
 config HIGHMEM4G
        bool "4GB"
        depends on !X86_NUMAQ
-       help
+       ---help---
          Select this if you have a 32-bit processor and between 1 and 4
          gigabytes of physical RAM.
 
@@ -955,7 +935,7 @@ config HIGHMEM64G
        bool "64GB"
        depends on !M386 && !M486
        select X86_PAE
-       help
+       ---help---
          Select this if you have a 32-bit processor and more than 4
          gigabytes of physical RAM.
 
@@ -966,7 +946,7 @@ choice
        prompt "Memory split" if EMBEDDED
        default VMSPLIT_3G
        depends on X86_32
-       help
+       ---help---
          Select the desired split between kernel and user memory.
 
          If the address range available to the kernel is less than the
@@ -1012,20 +992,20 @@ config HIGHMEM
 config X86_PAE
        bool "PAE (Physical Address Extension) Support"
        depends on X86_32 && !HIGHMEM4G
-       help
+       ---help---
          PAE is required for NX support, and furthermore enables
          larger swapspace support for non-overcommit purposes. It
          has the cost of more pagetable lookup overhead, and also
          consumes more pagetable space per process.
 
 config ARCH_PHYS_ADDR_T_64BIT
-       def_bool X86_64 || X86_PAE
+       def_bool X86_64 || X86_PAE
 
 config DIRECT_GBPAGES
        bool "Enable 1GB pages for kernel pagetables" if EMBEDDED
        default y
        depends on X86_64
-       help
+       ---help---
          Allow the kernel linear mapping to use 1GB pages on CPUs that
          support it. This can improve the kernel's performance a tiny bit by
          reducing TLB pressure. If in doubt, say "Y".
@@ -1035,9 +1015,8 @@ config NUMA
        bool "Numa Memory Allocation and Scheduler Support"
        depends on SMP
        depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && EXPERIMENTAL)
-       default n if X86_PC
        default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP)
-       help
+       ---help---
          Enable NUMA (Non Uniform Memory Access) support.
 
          The kernel will try to allocate memory used by a CPU on the
@@ -1060,19 +1039,19 @@ config K8_NUMA
        def_bool y
        prompt "Old style AMD Opteron NUMA detection"
        depends on X86_64 && NUMA && PCI
-       help
-        Enable K8 NUMA node topology detection.  You should say Y here if
-        you have a multi processor AMD K8 system. This uses an old
-        method to read the NUMA configuration directly from the builtin
-        Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
-        instead, which also takes priority if both are compiled in.
+       ---help---
+         Enable K8 NUMA node topology detection.  You should say Y here if
+         you have a multi processor AMD K8 system. This uses an old
+         method to read the NUMA configuration directly from the builtin
+         Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
+         instead, which also takes priority if both are compiled in.
 
 config X86_64_ACPI_NUMA
        def_bool y
        prompt "ACPI NUMA detection"
        depends on X86_64 && NUMA && ACPI && PCI
        select ACPI_NUMA
-       help
+       ---help---
          Enable ACPI SRAT based node topology detection.
 
 # Some NUMA nodes have memory ranges that span
@@ -1087,7 +1066,7 @@ config NODES_SPAN_OTHER_NODES
 config NUMA_EMU
        bool "NUMA emulation"
        depends on X86_64 && NUMA
-       help
+       ---help---
          Enable NUMA emulation. A flat machine will be split
          into virtual nodes when booted with "numa=fake=N", where N is the
          number of nodes. This is only useful for debugging.
@@ -1100,7 +1079,7 @@ config NODES_SHIFT
        default "4" if X86_NUMAQ
        default "3"
        depends on NEED_MULTIPLE_NODES
-       help
+       ---help---
          Specify the maximum number of NUMA Nodes available on the target
          system.  Increases memory reserved to accomodate various tables.
 
@@ -1138,7 +1117,7 @@ config ARCH_SPARSEMEM_DEFAULT
 
 config ARCH_SPARSEMEM_ENABLE
        def_bool y
-       depends on X86_64 || NUMA || (EXPERIMENTAL && X86_PC) || X86_GENERICARCH
+       depends on X86_64 || NUMA || (EXPERIMENTAL && X86_32) || X86_32_NON_STANDARD
        select SPARSEMEM_STATIC if X86_32
        select SPARSEMEM_VMEMMAP_ENABLE if X86_64
 
@@ -1155,61 +1134,61 @@ source "mm/Kconfig"
 config HIGHPTE
        bool "Allocate 3rd-level pagetables from highmem"
        depends on X86_32 && (HIGHMEM4G || HIGHMEM64G)
-       help
+       ---help---
          The VM uses one page table entry for each page of physical memory.
          For systems with a lot of RAM, this can be wasteful of precious
          low memory.  Setting this option will put user-space page table
          entries in high memory.
 
 config X86_CHECK_BIOS_CORRUPTION
-        bool "Check for low memory corruption"
-       help
-        Periodically check for memory corruption in low memory, which
-        is suspected to be caused by BIOS.  Even when enabled in the
-        configuration, it is disabled at runtime.  Enable it by
-        setting "memory_corruption_check=1" on the kernel command
-        line.  By default it scans the low 64k of memory every 60
-        seconds; see the memory_corruption_check_size and
-        memory_corruption_check_period parameters in
-        Documentation/kernel-parameters.txt to adjust this.
-
-        When enabled with the default parameters, this option has
-        almost no overhead, as it reserves a relatively small amount
-        of memory and scans it infrequently.  It both detects corruption
-        and prevents it from affecting the running system.
-
-        It is, however, intended as a diagnostic tool; if repeatable
-        BIOS-originated corruption always affects the same memory,
-        you can use memmap= to prevent the kernel from using that
-        memory.
+       bool "Check for low memory corruption"
+       ---help---
+         Periodically check for memory corruption in low memory, which
+         is suspected to be caused by BIOS.  Even when enabled in the
+         configuration, it is disabled at runtime.  Enable it by
+         setting "memory_corruption_check=1" on the kernel command
+         line.  By default it scans the low 64k of memory every 60
+         seconds; see the memory_corruption_check_size and
+         memory_corruption_check_period parameters in
+         Documentation/kernel-parameters.txt to adjust this.
+
+         When enabled with the default parameters, this option has
+         almost no overhead, as it reserves a relatively small amount
+         of memory and scans it infrequently.  It both detects corruption
+         and prevents it from affecting the running system.
+
+         It is, however, intended as a diagnostic tool; if repeatable
+         BIOS-originated corruption always affects the same memory,
+         you can use memmap= to prevent the kernel from using that
+         memory.
 
 config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK
-        bool "Set the default setting of memory_corruption_check"
+       bool "Set the default setting of memory_corruption_check"
        depends on X86_CHECK_BIOS_CORRUPTION
        default y
-       help
-        Set whether the default state of memory_corruption_check is
-        on or off.
+       ---help---
+         Set whether the default state of memory_corruption_check is
+         on or off.
 
 config X86_RESERVE_LOW_64K
-        bool "Reserve low 64K of RAM on AMI/Phoenix BIOSen"
+       bool "Reserve low 64K of RAM on AMI/Phoenix BIOSen"
        default y
-       help
-        Reserve the first 64K of physical RAM on BIOSes that are known
-        to potentially corrupt that memory range. A numbers of BIOSes are
-        known to utilize this area during suspend/resume, so it must not
-        be used by the kernel.
+       ---help---
+         Reserve the first 64K of physical RAM on BIOSes that are known
+         to potentially corrupt that memory range. A numbers of BIOSes are
+         known to utilize this area during suspend/resume, so it must not
+         be used by the kernel.
 
-        Set this to N if you are absolutely sure that you trust the BIOS
-        to get all its memory reservations and usages right.
+         Set this to N if you are absolutely sure that you trust the BIOS
+         to get all its memory reservations and usages right.
 
-        If you have doubts about the BIOS (e.g. suspend/resume does not
-        work or there's kernel crashes after certain hardware hotplug
-        events) and it's not AMI or Phoenix, then you might want to enable
-        X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check typical
-        corruption patterns.
+         If you have doubts about the BIOS (e.g. suspend/resume does not
+         work or there's kernel crashes after certain hardware hotplug
+         events) and it's not AMI or Phoenix, then you might want to enable
+         X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check typical
+         corruption patterns.
 
-        Say Y if unsure.
+         Say Y if unsure.
 
 config MATH_EMULATION
        bool
@@ -1275,7 +1254,7 @@ config MTRR_SANITIZER
        def_bool y
        prompt "MTRR cleanup support"
        depends on MTRR
-       help
+       ---help---
          Convert MTRR layout from continuous to discrete, so X drivers can
          add writeback entries.
 
@@ -1290,7 +1269,7 @@ config MTRR_SANITIZER_ENABLE_DEFAULT
        range 0 1
        default "0"
        depends on MTRR_SANITIZER
-       help
+       ---help---
          Enable mtrr cleanup default value
 
 config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
@@ -1298,7 +1277,7 @@ config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
        range 0 7
        default "1"
        depends on MTRR_SANITIZER
-       help
+       ---help---
          mtrr cleanup spare entries default, it can be changed via
          mtrr_spare_reg_nr=N on the kernel command line.
 
@@ -1306,7 +1285,7 @@ config X86_PAT
        bool
        prompt "x86 PAT support"
        depends on MTRR
-       help
+       ---help---
          Use PAT attributes to setup page level cache control.
 
          PATs are the modern equivalents of MTRRs and are much more
@@ -1321,20 +1300,20 @@ config EFI
        bool "EFI runtime service support"
        depends on ACPI
        ---help---
-       This enables the kernel to use EFI runtime services that are
-       available (such as the EFI variable services).
+         This enables the kernel to use EFI runtime services that are
+         available (such as the EFI variable services).
 
-       This option is only useful on systems that have EFI firmware.
-       In addition, you should use the latest ELILO loader available
-       at <http://elilo.sourceforge.net> in order to take advantage
-       of EFI runtime services. However, even with this option, the
-       resultant kernel should continue to boot on existing non-EFI
-       platforms.
+         This option is only useful on systems that have EFI firmware.
+         In addition, you should use the latest ELILO loader available
+         at <http://elilo.sourceforge.net> in order to take advantage
+         of EFI runtime services. However, even with this option, the
+         resultant kernel should continue to boot on existing non-EFI
+         platforms.
 
 config SECCOMP
        def_bool y
        prompt "Enable seccomp to safely compute untrusted bytecode"
-       help
+       ---help---
          This kernel feature is useful for number crunching applications
          that may need to compute untrusted bytecode during their
          execution. By using pipes or other transports made available to
@@ -1354,8 +1333,8 @@ config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
        depends on X86_64
        select CC_STACKPROTECTOR_ALL
-       help
-          This option turns on the -fstack-protector GCC feature. This
+       ---help---
+         This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
          the stack just before the return address, and validates
          the value just before actually returning.  Stack based buffer
@@ -1372,8 +1351,7 @@ source kernel/Kconfig.hz
 
 config KEXEC
        bool "kexec system call"
-       depends on X86_BIOS_REBOOT
-       help
+       ---help---
          kexec is a system call that implements the ability to shutdown your
          current kernel, and to start another kernel.  It is like a reboot
          but it is independent of the system firmware.   And like a reboot
@@ -1390,7 +1368,7 @@ config KEXEC
 config CRASH_DUMP
        bool "kernel crash dumps"
        depends on X86_64 || (X86_32 && HIGHMEM)
-       help
+       ---help---
          Generate crash dump after being started by kexec.
          This should be normally only set in special crash dump kernels
          which are loaded in the main kernel with kexec-tools into
@@ -1405,7 +1383,7 @@ config KEXEC_JUMP
        bool "kexec jump (EXPERIMENTAL)"
        depends on EXPERIMENTAL
        depends on KEXEC && HIBERNATION && X86_32
-       help
+       ---help---
          Jump between original kernel and kexeced kernel and invoke
          code in physical address mode via KEXEC
 
@@ -1414,7 +1392,7 @@ config PHYSICAL_START
        default "0x1000000" if X86_NUMAQ
        default "0x200000" if X86_64
        default "0x100000"
-       help
+       ---help---
          This gives the physical address where the kernel is loaded.
 
          If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then
@@ -1455,7 +1433,7 @@ config PHYSICAL_START
 config RELOCATABLE
        bool "Build a relocatable kernel (EXPERIMENTAL)"
        depends on EXPERIMENTAL
-       help
+       ---help---
          This builds a kernel image that retains relocation information
          so it can be loaded someplace besides the default 1MB.
          The relocations tend to make the kernel binary about 10% larger,
@@ -1475,7 +1453,7 @@ config PHYSICAL_ALIGN
        default "0x100000" if X86_32
        default "0x200000" if X86_64
        range 0x2000 0x400000
-       help
+       ---help---
          This value puts the alignment restrictions on physical address
          where kernel is loaded and run from. Kernel is compiled for an
          address which meets above alignment restriction.
@@ -1496,7 +1474,7 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
        bool "Support for hot-pluggable CPUs"
-       depends on SMP && HOTPLUG && !X86_VOYAGER
+       depends on SMP && HOTPLUG
        ---help---
          Say Y here to allow turning CPUs off and on. CPUs can be
          controlled through /sys/devices/system/cpu.
@@ -1508,7 +1486,7 @@ config COMPAT_VDSO
        def_bool y
        prompt "Compat VDSO support"
        depends on X86_32 || IA32_EMULATION
-       help
+       ---help---
          Map the 32-bit VDSO to the predictable old-style address too.
        ---help---
          Say N here if you are running a sufficiently recent glibc
@@ -1520,7 +1498,7 @@ config COMPAT_VDSO
 config CMDLINE_BOOL
        bool "Built-in kernel command line"
        default n
-       help
+       ---help---
          Allow for specifying boot arguments to the kernel at
          build time.  On some systems (e.g. embedded ones), it is
          necessary or convenient to provide some or all of the
@@ -1538,7 +1516,7 @@ config CMDLINE
        string "Built-in kernel command string"
        depends on CMDLINE_BOOL
        default ""
-       help
+       ---help---
          Enter arguments here that should be compiled into the kernel
          image and used at boot time.  If the boot loader provides a
          command line at boot time, it is appended to this string to
@@ -1555,7 +1533,7 @@ config CMDLINE_OVERRIDE
        bool "Built-in command line overrides boot loader arguments"
        default n
        depends on CMDLINE_BOOL
-       help
+       ---help---
          Set this option to 'Y' to have the kernel ignore the boot loader
          command line, and use ONLY the built-in command line.
 
@@ -1577,7 +1555,6 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
        depends on NUMA
 
 menu "Power management and ACPI options"
-       depends on !X86_VOYAGER
 
 config ARCH_HIBERNATION_HEADER
        def_bool y
@@ -1655,7 +1632,7 @@ if APM
 
 config APM_IGNORE_USER_SUSPEND
        bool "Ignore USER SUSPEND"
-       help
+       ---help---
          This option will ignore USER SUSPEND requests. On machines with a
          compliant APM BIOS, you want to say N. However, on the NEC Versa M
          series notebooks, it is necessary to say Y because of a BIOS bug.
@@ -1679,7 +1656,7 @@ config APM_DO_ENABLE
 
 config APM_CPU_IDLE
        bool "Make CPU Idle calls when idle"
-       help
+       ---help---
          Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop.
          On some machines, this can activate improved power savings, such as
          a slowed CPU clock rate, when the machine is idle. These idle calls
@@ -1690,7 +1667,7 @@ config APM_CPU_IDLE
 
 config APM_DISPLAY_BLANK
        bool "Enable console blanking using APM"
-       help
+       ---help---
          Enable console blanking using the APM. Some laptops can use this to
          turn off the LCD backlight when the screen blanker of the Linux
          virtual console blanks the screen. Note that this is only used by
@@ -1703,7 +1680,7 @@ config APM_DISPLAY_BLANK
 
 config APM_ALLOW_INTS
        bool "Allow interrupts during APM BIOS calls"
-       help
+       ---help---
          Normally we disable external interrupts while we are making calls to
          the APM BIOS as a measure to lessen the effects of a badly behaving
          BIOS implementation.  The BIOS should reenable interrupts if it
@@ -1728,7 +1705,7 @@ config PCI
        bool "PCI support"
        default y
        select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
-       help
+       ---help---
          Find out whether you have a PCI motherboard. PCI is the name of a
          bus system, i.e. the way the CPU talks to the other stuff inside
          your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
@@ -1799,40 +1776,51 @@ config PCI_MMCONFIG
 config DMAR
        bool "Support for DMA Remapping Devices (EXPERIMENTAL)"
        depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL
-       help
+       ---help---
          DMA remapping (DMAR) devices support enables independent address
          translations for Direct Memory Access (DMA) from devices.
          These DMA remapping devices are reported via ACPI tables
          and include PCI device scope covered by these DMA
          remapping devices.
 
+config DMAR_DEFAULT_ON
+       def_bool n
+       prompt "Enable DMA Remapping Devices by default"
+       depends on DMAR
+       help
+         Selecting this option will enable a DMAR device at boot time if
+         one is found. If this option is not selected, DMAR support can
+         be enabled by passing intel_iommu=on to the kernel. It is
+         recommended you say N here while the DMAR code remains
+         experimental.
+
 config DMAR_GFX_WA
        def_bool y
        prompt "Support for Graphics workaround"
        depends on DMAR
-       help
-        Current Graphics drivers tend to use physical address
-        for DMA and avoid using DMA APIs. Setting this config
-        option permits the IOMMU driver to set a unity map for
-        all the OS-visible memory. Hence the driver can continue
-        to use physical addresses for DMA.
+       ---help---
+         Current Graphics drivers tend to use physical address
+         for DMA and avoid using DMA APIs. Setting this config
+         option permits the IOMMU driver to set a unity map for
+         all the OS-visible memory. Hence the driver can continue
+         to use physical addresses for DMA.
 
 config DMAR_FLOPPY_WA
        def_bool y
        depends on DMAR
-       help
-        Floppy disk drivers are know to bypass DMA API calls
-        thereby failing to work when IOMMU is enabled. This
-        workaround will setup a 1:1 mapping for the first
-        16M to make floppy (an ISA device) work.
+       ---help---
+         Floppy disk drivers are know to bypass DMA API calls
+         thereby failing to work when IOMMU is enabled. This
+         workaround will setup a 1:1 mapping for the first
+         16M to make floppy (an ISA device) work.
 
 config INTR_REMAP
        bool "Support for Interrupt Remapping (EXPERIMENTAL)"
        depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL
-       help
-        Supports Interrupt remapping for IO-APIC and MSI devices.
-        To use x2apic mode in the CPU's which support x2APIC enhancements or
-        to support platforms with CPU's having > 8 bit APIC ID, say Y.
+       ---help---
+         Supports Interrupt remapping for IO-APIC and MSI devices.
+         To use x2apic mode in the CPU's which support x2APIC enhancements or
+         to support platforms with CPU's having > 8 bit APIC ID, say Y.
 
 source "drivers/pci/pcie/Kconfig"
 
@@ -1846,8 +1834,7 @@ if X86_32
 
 config ISA
        bool "ISA support"
-       depends on !X86_VOYAGER
-       help
+       ---help---
          Find out whether you have ISA slots on your motherboard.  ISA is the
          name of a bus system, i.e. the way the CPU talks to the other stuff
          inside your box.  Other bus systems are PCI, EISA, MicroChannel
@@ -1873,9 +1860,8 @@ config EISA
 source "drivers/eisa/Kconfig"
 
 config MCA
-       bool "MCA support" if !X86_VOYAGER
-       default y if X86_VOYAGER
-       help
+       bool "MCA support"
+       ---help---
          MicroChannel Architecture is found in some IBM PS/2 machines and
          laptops.  It is a bus system similar to PCI or ISA. See
          <file:Documentation/mca.txt> (and especially the web page given
@@ -1885,8 +1871,7 @@ source "drivers/mca/Kconfig"
 
 config SCx200
        tristate "NatSemi SCx200 support"
-       depends on !X86_VOYAGER
-       help
+       ---help---
          This provides basic support for National Semiconductor's
          (now AMD's) Geode processors.  The driver probes for the
          PCI-IDs of several on-chip devices, so its a good dependency
@@ -1898,7 +1883,7 @@ config SCx200HR_TIMER
        tristate "NatSemi SCx200 27MHz High-Resolution Timer Support"
        depends on SCx200 && GENERIC_TIME
        default y
-       help
+       ---help---
          This driver provides a clocksource built upon the on-chip
          27MHz high-resolution timer.  Its also a workaround for
          NSC Geode SC-1100's buggy TSC, which loses time when the
@@ -1909,7 +1894,7 @@ config GEODE_MFGPT_TIMER
        def_bool y
        prompt "Geode Multi-Function General Purpose Timer (MFGPT) events"
        depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS
-       help
+       ---help---
          This driver provides a clock event source based on the MFGPT
          timer(s) in the CS5535 and CS5536 companion chip for the geode.
          MFGPTs have a better resolution and max interval than the
@@ -1918,7 +1903,7 @@ config GEODE_MFGPT_TIMER
 config OLPC
        bool "One Laptop Per Child support"
        default n
-       help
+       ---help---
          Add support for detecting the unique features of the OLPC
          XO hardware.
 
@@ -1943,16 +1928,16 @@ config IA32_EMULATION
        bool "IA32 Emulation"
        depends on X86_64
        select COMPAT_BINFMT_ELF
-       help
+       ---help---
          Include code to run 32-bit programs under a 64-bit kernel. You should
          likely turn this on, unless you're 100% sure that you don't have any
          32-bit programs left.
 
 config IA32_AOUT
-       tristate "IA32 a.out support"
-       depends on IA32_EMULATION
-       help
-         Support old a.out binaries in the 32bit emulation.
+       tristate "IA32 a.out support"
+       depends on IA32_EMULATION
+       ---help---
+         Support old a.out binaries in the 32bit emulation.
 
 config COMPAT
        def_bool y
index 8eb50ba..a95eaf0 100644 (file)
@@ -50,7 +50,7 @@ config M386
 config M486
        bool "486"
        depends on X86_32
-       help
+       ---help---
          Select this for a 486 series processor, either Intel or one of the
          compatible processors from AMD, Cyrix, IBM, or Intel.  Includes DX,
          DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or
@@ -59,7 +59,7 @@ config M486
 config M586
        bool "586/K5/5x86/6x86/6x86MX"
        depends on X86_32
-       help
+       ---help---
          Select this for an 586 or 686 series processor such as the AMD K5,
          the Cyrix 5x86, 6x86 and 6x86MX.  This choice does not
          assume the RDTSC (Read Time Stamp Counter) instruction.
@@ -67,21 +67,21 @@ config M586
 config M586TSC
        bool "Pentium-Classic"
        depends on X86_32
-       help
+       ---help---
          Select this for a Pentium Classic processor with the RDTSC (Read
          Time Stamp Counter) instruction for benchmarking.
 
 config M586MMX
        bool "Pentium-MMX"
        depends on X86_32
-       help
+       ---help---
          Select this for a Pentium with the MMX graphics/multimedia
          extended instructions.
 
 config M686
        bool "Pentium-Pro"
        depends on X86_32
-       help
+       ---help---
          Select this for Intel Pentium Pro chips.  This enables the use of
          Pentium Pro extended instructions, and disables the init-time guard
          against the f00f bug found in earlier Pentiums.
@@ -89,7 +89,7 @@ config M686
 config MPENTIUMII
        bool "Pentium-II/Celeron(pre-Coppermine)"
        depends on X86_32
-       help
+       ---help---
          Select this for Intel chips based on the Pentium-II and
          pre-Coppermine Celeron core.  This option enables an unaligned
          copy optimization, compiles the kernel with optimization flags
@@ -99,7 +99,7 @@ config MPENTIUMII
 config MPENTIUMIII
        bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
        depends on X86_32
-       help
+       ---help---
          Select this for Intel chips based on the Pentium-III and
          Celeron-Coppermine core.  This option enables use of some
          extended prefetch instructions in addition to the Pentium II
@@ -108,14 +108,14 @@ config MPENTIUMIII
 config MPENTIUMM
        bool "Pentium M"
        depends on X86_32
-       help
+       ---help---
          Select this for Intel Pentium M (not Pentium-4 M)
          notebook chips.
 
 config MPENTIUM4
        bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon"
        depends on X86_32
-       help
+       ---help---
          Select this for Intel Pentium 4 chips.  This includes the
          Pentium 4, Pentium D, P4-based Celeron and Xeon, and
          Pentium-4 M (not Pentium M) chips.  This option enables compile
@@ -151,7 +151,7 @@ config MPENTIUM4
 config MK6
        bool "K6/K6-II/K6-III"
        depends on X86_32
-       help
+       ---help---
          Select this for an AMD K6-family processor.  Enables use of
          some extended instructions, and passes appropriate optimization
          flags to GCC.
@@ -159,22 +159,22 @@ config MK6
 config MK7
        bool "Athlon/Duron/K7"
        depends on X86_32
-       help
+       ---help---
          Select this for an AMD Athlon K7-family processor.  Enables use of
          some extended instructions, and passes appropriate optimization
          flags to GCC.
 
 config MK8
        bool "Opteron/Athlon64/Hammer/K8"
-       help
-         Select this for an AMD Opteron or Athlon64 Hammer-family processor.  Enables
-         use of some extended instructions, and passes appropriate optimization
-         flags to GCC.
+       ---help---
+         Select this for an AMD Opteron or Athlon64 Hammer-family processor.
+         Enables use of some extended instructions, and passes appropriate
+         optimization flags to GCC.
 
 config MCRUSOE
        bool "Crusoe"
        depends on X86_32
-       help
+       ---help---
          Select this for a Transmeta Crusoe processor.  Treats the processor
          like a 586 with TSC, and sets some GCC optimization flags (like a
          Pentium Pro with no alignment requirements).
@@ -182,13 +182,13 @@ config MCRUSOE
 config MEFFICEON
        bool "Efficeon"
        depends on X86_32
-       help
+       ---help---
          Select this for a Transmeta Efficeon processor.
 
 config MWINCHIPC6
        bool "Winchip-C6"
        depends on X86_32
-       help
+       ---help---
          Select this for an IDT Winchip C6 chip.  Linux and GCC
          treat this chip as a 586TSC with some extended instructions
          and alignment requirements.
@@ -196,7 +196,7 @@ config MWINCHIPC6
 config MWINCHIP3D
        bool "Winchip-2/Winchip-2A/Winchip-3"
        depends on X86_32
-       help
+       ---help---
          Select this for an IDT Winchip-2, 2A or 3.  Linux and GCC
          treat this chip as a 586TSC with some extended instructions
          and alignment requirements.  Also enable out of order memory
@@ -206,19 +206,19 @@ config MWINCHIP3D
 config MGEODEGX1
        bool "GeodeGX1"
        depends on X86_32
-       help
+       ---help---
          Select this for a Geode GX1 (Cyrix MediaGX) chip.
 
 config MGEODE_LX
        bool "Geode GX/LX"
        depends on X86_32
-       help
+       ---help---
          Select this for AMD Geode GX and LX processors.
 
 config MCYRIXIII
        bool "CyrixIII/VIA-C3"
        depends on X86_32
-       help
+       ---help---
          Select this for a Cyrix III or C3 chip.  Presently Linux and GCC
          treat this chip as a generic 586. Whilst the CPU is 686 class,
          it lacks the cmov extension which gcc assumes is present when
@@ -230,7 +230,7 @@ config MCYRIXIII
 config MVIAC3_2
        bool "VIA C3-2 (Nehemiah)"
        depends on X86_32
-       help
+       ---help---
          Select this for a VIA C3 "Nehemiah". Selecting this enables usage
          of SSE and tells gcc to treat the CPU as a 686.
          Note, this kernel will not boot on older (pre model 9) C3s.
@@ -238,14 +238,14 @@ config MVIAC3_2
 config MVIAC7
        bool "VIA C7"
        depends on X86_32
-       help
+       ---help---
          Select this for a VIA C7.  Selecting this uses the correct cache
          shift and tells gcc to treat the CPU as a 686.
 
 config MPSC
        bool "Intel P4 / older Netburst based Xeon"
        depends on X86_64
-       help
+       ---help---
          Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey
          Xeon CPUs with Intel 64bit which is compatible with x86-64.
          Note that the latest Xeons (Xeon 51xx and 53xx) are not based on the
@@ -255,15 +255,17 @@ config MPSC
 
 config MCORE2
        bool "Core 2/newer Xeon"
-       help
-         Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx)
-         CPUs. You can distinguish newer from older Xeons by the CPU family
-         in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo)
+       ---help---
+
+         Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
+         53xx) CPUs. You can distinguish newer from older Xeons by the CPU
+         family in /proc/cpuinfo. Newer ones have 6 and older ones 15
+         (not a typo)
 
 config GENERIC_CPU
        bool "Generic-x86-64"
        depends on X86_64
-       help
+       ---help---
          Generic x86-64 CPU.
          Run equally well on all x86-64 CPUs.
 
@@ -272,7 +274,7 @@ endchoice
 config X86_GENERIC
        bool "Generic x86 support"
        depends on X86_32
-       help
+       ---help---
          Instead of just including optimizations for the selected
          x86 variant (e.g. PII, Crusoe or Athlon), include some more
          generic optimizations as well. This will make the kernel
@@ -317,15 +319,15 @@ config X86_XADD
 config X86_PPRO_FENCE
        bool "PentiumPro memory ordering errata workaround"
        depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1
-       help
-         Old PentiumPro multiprocessor systems had errata that could cause memory
-         operations to violate the x86 ordering standard in rare cases. Enabling this
-         option will attempt to work around some (but not all) occurances of
-         this problem, at the cost of much heavier spinlock and memory barrier
-         operations.
+       ---help---
+         Old PentiumPro multiprocessor systems had errata that could cause
+         memory operations to violate the x86 ordering standard in rare cases.
+         Enabling this option will attempt to work around some (but not all)
+         occurances of this problem, at the cost of much heavier spinlock and
+         memory barrier operations.
 
-         If unsure, say n here. Even distro kernels should think twice before enabling
-         this: there are few systems, and an unlikely bug.
+         If unsure, say n here. Even distro kernels should think twice before
+         enabling this: there are few systems, and an unlikely bug.
 
 config X86_F00F_BUG
        def_bool y
@@ -410,14 +412,14 @@ config X86_DEBUGCTLMSR
 
 menuconfig PROCESSOR_SELECT
        bool "Supported processor vendors" if EMBEDDED
-       help
+       ---help---
          This lets you choose what x86 vendor support code your kernel
          will include.
 
 config CPU_SUP_INTEL
        default y
        bool "Support Intel processors" if PROCESSOR_SELECT
-       help
+       ---help---
          This enables detection, tunings and quirks for Intel processors
 
          You need this enabled if you want your kernel to run on an
@@ -431,7 +433,7 @@ config CPU_SUP_CYRIX_32
        default y
        bool "Support Cyrix processors" if PROCESSOR_SELECT
        depends on !64BIT
-       help
+       ---help---
          This enables detection, tunings and quirks for Cyrix processors
 
          You need this enabled if you want your kernel to run on a
@@ -444,7 +446,7 @@ config CPU_SUP_CYRIX_32
 config CPU_SUP_AMD
        default y
        bool "Support AMD processors" if PROCESSOR_SELECT
-       help
+       ---help---
          This enables detection, tunings and quirks for AMD processors
 
          You need this enabled if you want your kernel to run on an
@@ -458,7 +460,7 @@ config CPU_SUP_CENTAUR_32
        default y
        bool "Support Centaur processors" if PROCESSOR_SELECT
        depends on !64BIT
-       help
+       ---help---
          This enables detection, tunings and quirks for Centaur processors
 
          You need this enabled if you want your kernel to run on a
@@ -472,7 +474,7 @@ config CPU_SUP_CENTAUR_64
        default y
        bool "Support Centaur processors" if PROCESSOR_SELECT
        depends on 64BIT
-       help
+       ---help---
          This enables detection, tunings and quirks for Centaur processors
 
          You need this enabled if you want your kernel to run on a
@@ -486,7 +488,7 @@ config CPU_SUP_TRANSMETA_32
        default y
        bool "Support Transmeta processors" if PROCESSOR_SELECT
        depends on !64BIT
-       help
+       ---help---
          This enables detection, tunings and quirks for Transmeta processors
 
          You need this enabled if you want your kernel to run on a
@@ -500,7 +502,7 @@ config CPU_SUP_UMC_32
        default y
        bool "Support UMC processors" if PROCESSOR_SELECT
        depends on !64BIT
-       help
+       ---help---
          This enables detection, tunings and quirks for UMC processors
 
          You need this enabled if you want your kernel to run on a
@@ -519,7 +521,7 @@ config X86_PTRACE_BTS
        bool "Branch Trace Store"
        default y
        depends on X86_DEBUGCTLMSR
-       help
+       ---help---
          This adds a ptrace interface to the hardware's branch trace store.
 
          Debuggers may use it to collect an execution trace of the debugged
index 28f1114..ba4781b 100644 (file)
@@ -7,7 +7,7 @@ source "lib/Kconfig.debug"
 
 config STRICT_DEVMEM
        bool "Filter access to /dev/mem"
-       help
+       ---help---
          If this option is disabled, you allow userspace (root) access to all
          of memory, including kernel and userspace memory. Accidental
          access to this is obviously disastrous, but specific access can
@@ -25,7 +25,7 @@ config STRICT_DEVMEM
 config X86_VERBOSE_BOOTUP
        bool "Enable verbose x86 bootup info messages"
        default y
-       help
+       ---help---
          Enables the informational output from the decompression stage
          (e.g. bzImage) of the boot. If you disable this you will still
          see errors. Disable this if you want silent bootup.
@@ -33,7 +33,7 @@ config X86_VERBOSE_BOOTUP
 config EARLY_PRINTK
        bool "Early printk" if EMBEDDED
        default y
-       help
+       ---help---
          Write kernel log output directly into the VGA buffer or to a serial
          port.
 
@@ -47,7 +47,7 @@ config EARLY_PRINTK_DBGP
        bool "Early printk via EHCI debug port"
        default n
        depends on EARLY_PRINTK && PCI
-       help
+       ---help---
          Write kernel log output directly into the EHCI debug port.
 
          This is useful for kernel debugging when your machine crashes very
@@ -59,14 +59,14 @@ config EARLY_PRINTK_DBGP
 config DEBUG_STACKOVERFLOW
        bool "Check for stack overflows"
        depends on DEBUG_KERNEL
-       help
+       ---help---
          This option will cause messages to be printed if free stack space
          drops below a certain limit.
 
 config DEBUG_STACK_USAGE
        bool "Stack utilization instrumentation"
        depends on DEBUG_KERNEL
-       help
+       ---help---
          Enables the display of the minimum amount of free stack which each
          task has ever had available in the sysrq-T and sysrq-P debug output.
 
@@ -75,7 +75,7 @@ config DEBUG_STACK_USAGE
 config DEBUG_PAGEALLOC
        bool "Debug page memory allocations"
        depends on DEBUG_KERNEL
-       help
+       ---help---
          Unmap pages from the kernel linear mapping after free_pages().
          This results in a large slowdown, but helps to find certain types
          of memory corruptions.
@@ -83,9 +83,9 @@ config DEBUG_PAGEALLOC
 config DEBUG_PER_CPU_MAPS
        bool "Debug access to per_cpu maps"
        depends on DEBUG_KERNEL
-       depends on X86_SMP
+       depends on SMP
        default n
-       help
+       ---help---
          Say Y to verify that the per_cpu map being accessed has
          been setup.  Adds a fair amount of code to kernel memory
          and decreases performance.
@@ -96,7 +96,7 @@ config X86_PTDUMP
        bool "Export kernel pagetable layout to userspace via debugfs"
        depends on DEBUG_KERNEL
        select DEBUG_FS
-       help
+       ---help---
          Say Y here if you want to show the kernel pagetable layout in a
          debugfs file. This information is only useful for kernel developers
          who are working in architecture specific areas of the kernel.
@@ -108,7 +108,7 @@ config DEBUG_RODATA
        bool "Write protect kernel read-only data structures"
        default y
        depends on DEBUG_KERNEL
-       help
+       ---help---
          Mark the kernel read-only data as write-protected in the pagetables,
          in order to catch accidental (and incorrect) writes to such const
          data. This is recommended so that we can catch kernel bugs sooner.
@@ -118,7 +118,7 @@ config DEBUG_RODATA_TEST
        bool "Testcase for the DEBUG_RODATA feature"
        depends on DEBUG_RODATA
        default y
-       help
+       ---help---
          This option enables a testcase for the DEBUG_RODATA
          feature as well as for the change_page_attr() infrastructure.
          If in doubt, say "N"
@@ -126,7 +126,7 @@ config DEBUG_RODATA_TEST
 config DEBUG_NX_TEST
        tristate "Testcase for the NX non-executable stack feature"
        depends on DEBUG_KERNEL && m
-       help
+       ---help---
          This option enables a testcase for the CPU NX capability
          and the software setup of this feature.
          If in doubt, say "N"
@@ -134,7 +134,7 @@ config DEBUG_NX_TEST
 config 4KSTACKS
        bool "Use 4Kb for kernel stacks instead of 8Kb"
        depends on X86_32
-       help
+       ---help---
          If you say Y here the kernel will use a 4Kb stacksize for the
          kernel stack attached to each process/thread. This facilitates
          running more threads on a system and also reduces the pressure
@@ -145,7 +145,7 @@ config DOUBLEFAULT
        default y
        bool "Enable doublefault exception handler" if EMBEDDED
        depends on X86_32
-       help
+       ---help---
          This option allows trapping of rare doublefault exceptions that
          would otherwise cause a system to silently reboot. Disabling this
          option saves about 4k and might cause you much additional grey
@@ -155,7 +155,7 @@ config IOMMU_DEBUG
        bool "Enable IOMMU debugging"
        depends on GART_IOMMU && DEBUG_KERNEL
        depends on X86_64
-       help
+       ---help---
          Force the IOMMU to on even when you have less than 4GB of
          memory and add debugging code. On overflow always panic. And
          allow to enable IOMMU leak tracing. Can be disabled at boot
@@ -171,7 +171,7 @@ config IOMMU_LEAK
        bool "IOMMU leak tracing"
        depends on DEBUG_KERNEL
        depends on IOMMU_DEBUG
-       help
+       ---help---
          Add a simple leak tracer to the IOMMU code. This is useful when you
          are debugging a buggy device driver that leaks IOMMU mappings.
 
@@ -224,25 +224,25 @@ choice
 
 config IO_DELAY_0X80
        bool "port 0x80 based port-IO delay [recommended]"
-       help
+       ---help---
          This is the traditional Linux IO delay used for in/out_p.
          It is the most tested hence safest selection here.
 
 config IO_DELAY_0XED
        bool "port 0xed based port-IO delay"
-       help
+       ---help---
          Use port 0xed as the IO delay. This frees up port 0x80 which is
          often used as a hardware-debug port.
 
 config IO_DELAY_UDELAY
        bool "udelay based port-IO delay"
-       help
+       ---help---
          Use udelay(2) as the IO delay method. This provides the delay
          while not having any side-effect on the IO port space.
 
 config IO_DELAY_NONE
        bool "no port-IO delay"
-       help
+       ---help---
          No port-IO delay. Will break on old boxes that require port-IO
          delay for certain operations. Should work on most new machines.
 
@@ -276,18 +276,18 @@ config DEBUG_BOOT_PARAMS
        bool "Debug boot parameters"
        depends on DEBUG_KERNEL
        depends on DEBUG_FS
-       help
+       ---help---
          This option will cause struct boot_params to be exported via debugfs.
 
 config CPA_DEBUG
        bool "CPA self-test code"
        depends on DEBUG_KERNEL
-       help
+       ---help---
          Do change_page_attr() self-tests every 30 seconds.
 
 config OPTIMIZE_INLINING
        bool "Allow gcc to uninline functions marked 'inline'"
-       help
+       ---help---
          This option determines if the kernel forces gcc to inline the functions
          developers have marked 'inline'. Doing so takes away freedom from gcc to
          do what it thinks is best, which is desirable for the gcc 3.x series of
@@ -300,4 +300,3 @@ config OPTIMIZE_INLINING
          If unsure, say N.
 
 endmenu
-
index cacee98..99550c4 100644 (file)
@@ -102,29 +102,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 # prevent gcc from generating any FP code by mistake
 KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
 
-###
-# Sub architecture support
-# fcore-y is linked before mcore-y files.
-
-# Default subarch .c files
-mcore-y  := arch/x86/mach-default/
-
-# Voyager subarch support
-mflags-$(CONFIG_X86_VOYAGER)   := -Iarch/x86/include/asm/mach-voyager
-mcore-$(CONFIG_X86_VOYAGER)    := arch/x86/mach-voyager/
-
-# generic subarchitecture
-mflags-$(CONFIG_X86_GENERICARCH):= -Iarch/x86/include/asm/mach-generic
-fcore-$(CONFIG_X86_GENERICARCH)        += arch/x86/mach-generic/
-mcore-$(CONFIG_X86_GENERICARCH)        := arch/x86/mach-default/
-
-# default subarch .h files
-mflags-y += -Iarch/x86/include/asm/mach-default
-
-# 64 bit does not support subarch support - clear sub arch variables
-fcore-$(CONFIG_X86_64)  :=
-mcore-$(CONFIG_X86_64)  :=
-
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
 
@@ -150,9 +127,6 @@ core-$(CONFIG_LGUEST_GUEST) += arch/x86/lguest/
 core-y += arch/x86/kernel/
 core-y += arch/x86/mm/
 
-# Remaining sub architecture files
-core-y += $(mcore-y)
-
 core-y += arch/x86/crypto/
 core-y += arch/x86/vdso/
 core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/
index 7511584..4a58c8c 100644 (file)
@@ -269,9 +269,8 @@ void vesa_store_edid(void)
           we genuinely have to assume all registers are destroyed here. */
 
        asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es"
-           : "+a" (ax), "+b" (bx)
-           :  "c" (cx), "D" (di)
-           : "esi");
+           : "+a" (ax), "+b" (bx), "+c" (cx), "+D" (di)
+           : : "esi", "edx");
 
        if (ax != 0x004f)
                return;         /* No EDID */
@@ -285,9 +284,9 @@ void vesa_store_edid(void)
        dx = 0;                 /* EDID block number */
        di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */
        asm(INT10
-           : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info)
-           : "c" (cx), "D" (di)
-           : "esi");
+           : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info),
+             "+c" (cx), "+D" (di)
+           : "esi");
 #endif /* CONFIG_FIRMWARE_EDID */
 }
 
index edba00d..739bce9 100644 (file)
@@ -188,7 +188,6 @@ CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 CONFIG_SMP=y
 CONFIG_X86_FIND_SMP_CONFIG=y
 CONFIG_X86_MPPARSE=y
-CONFIG_X86_PC=y
 # CONFIG_X86_ELAN is not set
 # CONFIG_X86_VOYAGER is not set
 # CONFIG_X86_GENERICARCH is not set
index 322dd27..02b514e 100644 (file)
@@ -187,7 +187,6 @@ CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 CONFIG_SMP=y
 CONFIG_X86_FIND_SMP_CONFIG=y
 CONFIG_X86_MPPARSE=y
-CONFIG_X86_PC=y
 # CONFIG_X86_ELAN is not set
 # CONFIG_X86_VOYAGER is not set
 # CONFIG_X86_GENERICARCH is not set
index 9dabd00..dd77ac0 100644 (file)
@@ -46,78 +46,83 @@ void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
 
 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
 {
-       int err;
+       int err = 0;
 
        if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
                return -EFAULT;
 
-       /* If you change siginfo_t structure, please make sure that
-          this code is fixed accordingly.
-          It should never copy any pad contained in the structure
-          to avoid security leaks, but must copy the generic
-          3 ints plus the relevant union member.  */
-       err = __put_user(from->si_signo, &to->si_signo);
-       err |= __put_user(from->si_errno, &to->si_errno);
-       err |= __put_user((short)from->si_code, &to->si_code);
-
-       if (from->si_code < 0) {
-               err |= __put_user(from->si_pid, &to->si_pid);
-               err |= __put_user(from->si_uid, &to->si_uid);
-               err |= __put_user(ptr_to_compat(from->si_ptr), &to->si_ptr);
-       } else {
-               /*
-                * First 32bits of unions are always present:
-                * si_pid === si_band === si_tid === si_addr(LS half)
-                */
-               err |= __put_user(from->_sifields._pad[0],
-                                 &to->_sifields._pad[0]);
-               switch (from->si_code >> 16) {
-               case __SI_FAULT >> 16:
-                       break;
-               case __SI_CHLD >> 16:
-                       err |= __put_user(from->si_utime, &to->si_utime);
-                       err |= __put_user(from->si_stime, &to->si_stime);
-                       err |= __put_user(from->si_status, &to->si_status);
-                       /* FALL THROUGH */
-               default:
-               case __SI_KILL >> 16:
-                       err |= __put_user(from->si_uid, &to->si_uid);
-                       break;
-               case __SI_POLL >> 16:
-                       err |= __put_user(from->si_fd, &to->si_fd);
-                       break;
-               case __SI_TIMER >> 16:
-                       err |= __put_user(from->si_overrun, &to->si_overrun);
-                       err |= __put_user(ptr_to_compat(from->si_ptr),
-                                         &to->si_ptr);
-                       break;
-                        /* This is not generated by the kernel as of now.  */
-               case __SI_RT >> 16:
-               case __SI_MESGQ >> 16:
-                       err |= __put_user(from->si_uid, &to->si_uid);
-                       err |= __put_user(from->si_int, &to->si_int);
-                       break;
+       put_user_try {
+               /* If you change siginfo_t structure, please make sure that
+                  this code is fixed accordingly.
+                  It should never copy any pad contained in the structure
+                  to avoid security leaks, but must copy the generic
+                  3 ints plus the relevant union member.  */
+               put_user_ex(from->si_signo, &to->si_signo);
+               put_user_ex(from->si_errno, &to->si_errno);
+               put_user_ex((short)from->si_code, &to->si_code);
+
+               if (from->si_code < 0) {
+                       put_user_ex(from->si_pid, &to->si_pid);
+                       put_user_ex(from->si_uid, &to->si_uid);
+                       put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr);
+               } else {
+                       /*
+                        * First 32bits of unions are always present:
+                        * si_pid === si_band === si_tid === si_addr(LS half)
+                        */
+                       put_user_ex(from->_sifields._pad[0],
+                                         &to->_sifields._pad[0]);
+                       switch (from->si_code >> 16) {
+                       case __SI_FAULT >> 16:
+                               break;
+                       case __SI_CHLD >> 16:
+                               put_user_ex(from->si_utime, &to->si_utime);
+                               put_user_ex(from->si_stime, &to->si_stime);
+                               put_user_ex(from->si_status, &to->si_status);
+                               /* FALL THROUGH */
+                       default:
+                       case __SI_KILL >> 16:
+                               put_user_ex(from->si_uid, &to->si_uid);
+                               break;
+                       case __SI_POLL >> 16:
+                               put_user_ex(from->si_fd, &to->si_fd);
+                               break;
+                       case __SI_TIMER >> 16:
+                               put_user_ex(from->si_overrun, &to->si_overrun);
+                               put_user_ex(ptr_to_compat(from->si_ptr),
+                                           &to->si_ptr);
+                               break;
+                                /* This is not generated by the kernel as of now.  */
+                       case __SI_RT >> 16:
+                       case __SI_MESGQ >> 16:
+                               put_user_ex(from->si_uid, &to->si_uid);
+                               put_user_ex(from->si_int, &to->si_int);
+                               break;
+                       }
                }
-       }
+       } put_user_catch(err);
+
        return err;
 }
 
 int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
 {
-       int err;
+       int err = 0;
        u32 ptr32;
 
        if (!access_ok(VERIFY_READ, from, sizeof(compat_siginfo_t)))
                return -EFAULT;
 
-       err = __get_user(to->si_signo, &from->si_signo);
-       err |= __get_user(to->si_errno, &from->si_errno);
-       err |= __get_user(to->si_code, &from->si_code);
+       get_user_try {
+               get_user_ex(to->si_signo, &from->si_signo);
+               get_user_ex(to->si_errno, &from->si_errno);
+               get_user_ex(to->si_code, &from->si_code);
 
-       err |= __get_user(to->si_pid, &from->si_pid);
-       err |= __get_user(to->si_uid, &from->si_uid);
-       err |= __get_user(ptr32, &from->si_ptr);
-       to->si_ptr = compat_ptr(ptr32);
+               get_user_ex(to->si_pid, &from->si_pid);
+               get_user_ex(to->si_uid, &from->si_uid);
+               get_user_ex(ptr32, &from->si_ptr);
+               to->si_ptr = compat_ptr(ptr32);
+       } get_user_catch(err);
 
        return err;
 }
@@ -142,17 +147,23 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
                                  struct pt_regs *regs)
 {
        stack_t uss, uoss;
-       int ret;
+       int ret, err = 0;
        mm_segment_t seg;
 
        if (uss_ptr) {
                u32 ptr;
 
                memset(&uss, 0, sizeof(stack_t));
-               if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t)) ||
-                           __get_user(ptr, &uss_ptr->ss_sp) ||
-                           __get_user(uss.ss_flags, &uss_ptr->ss_flags) ||
-                           __get_user(uss.ss_size, &uss_ptr->ss_size))
+               if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t)))
+                       return -EFAULT;
+
+               get_user_try {
+                       get_user_ex(ptr, &uss_ptr->ss_sp);
+                       get_user_ex(uss.ss_flags, &uss_ptr->ss_flags);
+                       get_user_ex(uss.ss_size, &uss_ptr->ss_size);
+               } get_user_catch(err);
+
+               if (err)
                        return -EFAULT;
                uss.ss_sp = compat_ptr(ptr);
        }
@@ -161,10 +172,16 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
        ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp);
        set_fs(seg);
        if (ret >= 0 && uoss_ptr)  {
-               if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)) ||
-                   __put_user(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp) ||
-                   __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) ||
-                   __put_user(uoss.ss_size, &uoss_ptr->ss_size))
+               if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
+                       return -EFAULT;
+
+               put_user_try {
+                       put_user_ex(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp);
+                       put_user_ex(uoss.ss_flags, &uoss_ptr->ss_flags);
+                       put_user_ex(uoss.ss_size, &uoss_ptr->ss_size);
+               } put_user_catch(err);
+
+               if (err)
                        ret = -EFAULT;
        }
        return ret;
@@ -174,18 +191,18 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
  * Do a signal return; undo the signal stack.
  */
 #define COPY(x)                        {               \
-       err |= __get_user(regs->x, &sc->x);     \
+       get_user_ex(regs->x, &sc->x);           \
 }
 
 #define COPY_SEG_CPL3(seg)     {                       \
                unsigned short tmp;                     \
-               err |= __get_user(tmp, &sc->seg);       \
+               get_user_ex(tmp, &sc->seg);             \
                regs->seg = tmp | 3;                    \
 }
 
 #define RELOAD_SEG(seg)                {               \
        unsigned int cur, pre;                  \
-       err |= __get_user(pre, &sc->seg);       \
+       get_user_ex(pre, &sc->seg);             \
        savesegment(seg, cur);                  \
        pre |= 3;                               \
        if (pre != cur)                         \
@@ -209,39 +226,42 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
               sc, sc->err, sc->ip, sc->cs, sc->flags);
 #endif
 
-       /*
-        * Reload fs and gs if they have changed in the signal
-        * handler.  This does not handle long fs/gs base changes in
-        * the handler, but does not clobber them at least in the
-        * normal case.
-        */
-       err |= __get_user(gs, &sc->gs);
-       gs |= 3;
-       savesegment(gs, oldgs);
-       if (gs != oldgs)
-               load_gs_index(gs);
-
-       RELOAD_SEG(fs);
-       RELOAD_SEG(ds);
-       RELOAD_SEG(es);
-
-       COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
-       COPY(dx); COPY(cx); COPY(ip);
-       /* Don't touch extended registers */
-
-       COPY_SEG_CPL3(cs);
-       COPY_SEG_CPL3(ss);
-
-       err |= __get_user(tmpflags, &sc->flags);
-       regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
-       /* disable syscall checks */
-       regs->orig_ax = -1;
-
-       err |= __get_user(tmp, &sc->fpstate);
-       buf = compat_ptr(tmp);
-       err |= restore_i387_xstate_ia32(buf);
-
-       err |= __get_user(*pax, &sc->ax);
+       get_user_try {
+               /*
+                * Reload fs and gs if they have changed in the signal
+                * handler.  This does not handle long fs/gs base changes in
+                * the handler, but does not clobber them at least in the
+                * normal case.
+                */
+               get_user_ex(gs, &sc->gs);
+               gs |= 3;
+               savesegment(gs, oldgs);
+               if (gs != oldgs)
+                       load_gs_index(gs);
+
+               RELOAD_SEG(fs);
+               RELOAD_SEG(ds);
+               RELOAD_SEG(es);
+
+               COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
+               COPY(dx); COPY(cx); COPY(ip);
+               /* Don't touch extended registers */
+
+               COPY_SEG_CPL3(cs);
+               COPY_SEG_CPL3(ss);
+
+               get_user_ex(tmpflags, &sc->flags);
+               regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
+               /* disable syscall checks */
+               regs->orig_ax = -1;
+
+               get_user_ex(tmp, &sc->fpstate);
+               buf = compat_ptr(tmp);
+               err |= restore_i387_xstate_ia32(buf);
+
+               get_user_ex(*pax, &sc->ax);
+       } get_user_catch(err);
+
        return err;
 }
 
@@ -319,36 +339,38 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
 {
        int tmp, err = 0;
 
-       savesegment(gs, tmp);
-       err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
-       savesegment(fs, tmp);
-       err |= __put_user(tmp, (unsigned int __user *)&sc->fs);
-       savesegment(ds, tmp);
-       err |= __put_user(tmp, (unsigned int __user *)&sc->ds);
-       savesegment(es, tmp);
-       err |= __put_user(tmp, (unsigned int __user *)&sc->es);
-
-       err |= __put_user(regs->di, &sc->di);
-       err |= __put_user(regs->si, &sc->si);
-       err |= __put_user(regs->bp, &sc->bp);
-       err |= __put_user(regs->sp, &sc->sp);
-       err |= __put_user(regs->bx, &sc->bx);
-       err |= __put_user(regs->dx, &sc->dx);
-       err |= __put_user(regs->cx, &sc->cx);
-       err |= __put_user(regs->ax, &sc->ax);
-       err |= __put_user(current->thread.trap_no, &sc->trapno);
-       err |= __put_user(current->thread.error_code, &sc->err);
-       err |= __put_user(regs->ip, &sc->ip);
-       err |= __put_user(regs->cs, (unsigned int __user *)&sc->cs);
-       err |= __put_user(regs->flags, &sc->flags);
-       err |= __put_user(regs->sp, &sc->sp_at_signal);
-       err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss);
-
-       err |= __put_user(ptr_to_compat(fpstate), &sc->fpstate);
-
-       /* non-iBCS2 extensions.. */
-       err |= __put_user(mask, &sc->oldmask);
-       err |= __put_user(current->thread.cr2, &sc->cr2);
+       put_user_try {
+               savesegment(gs, tmp);
+               put_user_ex(tmp, (unsigned int __user *)&sc->gs);
+               savesegment(fs, tmp);
+               put_user_ex(tmp, (unsigned int __user *)&sc->fs);
+               savesegment(ds, tmp);
+               put_user_ex(tmp, (unsigned int __user *)&sc->ds);
+               savesegment(es, tmp);
+               put_user_ex(tmp, (unsigned int __user *)&sc->es);
+
+               put_user_ex(regs->di, &sc->di);
+               put_user_ex(regs->si, &sc->si);
+               put_user_ex(regs->bp, &sc->bp);
+               put_user_ex(regs->sp, &sc->sp);
+               put_user_ex(regs->bx, &sc->bx);
+               put_user_ex(regs->dx, &sc->dx);
+               put_user_ex(regs->cx, &sc->cx);
+               put_user_ex(regs->ax, &sc->ax);
+               put_user_ex(current->thread.trap_no, &sc->trapno);
+               put_user_ex(current->thread.error_code, &sc->err);
+               put_user_ex(regs->ip, &sc->ip);
+               put_user_ex(regs->cs, (unsigned int __user *)&sc->cs);
+               put_user_ex(regs->flags, &sc->flags);
+               put_user_ex(regs->sp, &sc->sp_at_signal);
+               put_user_ex(regs->ss, (unsigned int __user *)&sc->ss);
+
+               put_user_ex(ptr_to_compat(fpstate), &sc->fpstate);
+
+               /* non-iBCS2 extensions.. */
+               put_user_ex(mask, &sc->oldmask);
+               put_user_ex(current->thread.cr2, &sc->cr2);
+       } put_user_catch(err);
 
        return err;
 }
@@ -437,13 +459,17 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
                else
                        restorer = &frame->retcode;
        }
-       err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
 
-       /*
-        * These are actually not used anymore, but left because some
-        * gdb versions depend on them as a marker.
-        */
-       err |= __put_user(*((u64 *)&code), (u64 *)frame->retcode);
+       put_user_try {
+               put_user_ex(ptr_to_compat(restorer), &frame->pretcode);
+
+               /*
+                * These are actually not used anymore, but left because some
+                * gdb versions depend on them as a marker.
+                */
+               put_user_ex(*((u64 *)&code), (u64 *)frame->retcode);
+       } put_user_catch(err);
+
        if (err)
                return -EFAULT;
 
@@ -496,41 +522,40 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
                return -EFAULT;
 
-       err |= __put_user(sig, &frame->sig);
-       err |= __put_user(ptr_to_compat(&frame->info), &frame->pinfo);
-       err |= __put_user(ptr_to_compat(&frame->uc), &frame->puc);
-       err |= copy_siginfo_to_user32(&frame->info, info);
-       if (err)
-               return -EFAULT;
+       put_user_try {
+               put_user_ex(sig, &frame->sig);
+               put_user_ex(ptr_to_compat(&frame->info), &frame->pinfo);
+               put_user_ex(ptr_to_compat(&frame->uc), &frame->puc);
+               err |= copy_siginfo_to_user32(&frame->info, info);
 
-       /* Create the ucontext.  */
-       if (cpu_has_xsave)
-               err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags);
-       else
-               err |= __put_user(0, &frame->uc.uc_flags);
-       err |= __put_user(0, &frame->uc.uc_link);
-       err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
-       err |= __put_user(sas_ss_flags(regs->sp),
-                         &frame->uc.uc_stack.ss_flags);
-       err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
-       err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
-                                    regs, set->sig[0]);
-       err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
-       if (err)
-               return -EFAULT;
+               /* Create the ucontext.  */
+               if (cpu_has_xsave)
+                       put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
+               else
+                       put_user_ex(0, &frame->uc.uc_flags);
+               put_user_ex(0, &frame->uc.uc_link);
+               put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
+               put_user_ex(sas_ss_flags(regs->sp),
+                           &frame->uc.uc_stack.ss_flags);
+               put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
+               err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
+                                            regs, set->sig[0]);
+               err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
+
+               if (ka->sa.sa_flags & SA_RESTORER)
+                       restorer = ka->sa.sa_restorer;
+               else
+                       restorer = VDSO32_SYMBOL(current->mm->context.vdso,
+                                                rt_sigreturn);
+               put_user_ex(ptr_to_compat(restorer), &frame->pretcode);
+
+               /*
+                * Not actually used anymore, but left because some gdb
+                * versions need it.
+                */
+               put_user_ex(*((u64 *)&code), (u64 *)frame->retcode);
+       } put_user_catch(err);
 
-       if (ka->sa.sa_flags & SA_RESTORER)
-               restorer = ka->sa.sa_restorer;
-       else
-               restorer = VDSO32_SYMBOL(current->mm->context.vdso,
-                                        rt_sigreturn);
-       err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
-
-       /*
-        * Not actually used anymore, but left because some gdb
-        * versions need it.
-        */
-       err |= __put_user(*((u64 *)&code), (u64 *)frame->retcode);
        if (err)
                return -EFAULT;
 
index ab1d51a..b03711d 100644 (file)
@@ -41,6 +41,21 @@ extern unsigned int apic_verbosity;
 extern int local_apic_timer_c2_ok;
 
 extern int disable_apic;
+
+#ifdef CONFIG_SMP
+extern void __inquire_remote_apic(int apicid);
+#else /* CONFIG_SMP */
+static inline void __inquire_remote_apic(int apicid)
+{
+}
+#endif /* CONFIG_SMP */
+
+static inline void default_inquire_remote_apic(int apicid)
+{
+       if (apic_verbosity >= APIC_DEBUG)
+               __inquire_remote_apic(apicid);
+}
+
 /*
  * Basic functions accessing APICs.
  */
@@ -196,4 +211,22 @@ static inline void disable_local_APIC(void) { }
 
 #endif /* !CONFIG_X86_LOCAL_APIC */
 
+#ifdef CONFIG_X86_64
+#define        SET_APIC_ID(x)          (apic->set_apic_id(x))
+#else
+
+#ifdef CONFIG_X86_LOCAL_APIC
+static inline unsigned default_get_apic_id(unsigned long x)
+{
+       unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+
+       if (APIC_XAPIC(ver))
+               return (x >> 24) & 0xFF;
+       else
+               return (x >> 24) & 0x0F;
+}
+#endif
+
+#endif
+
 #endif /* _ASM_X86_APIC_H */
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
deleted file mode 100644 (file)
index d8dd9f5..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#ifndef __ASM_MACH_APIC_H
-#define __ASM_MACH_APIC_H
-
-#define xapic_phys_to_log_apicid(cpu) (per_cpu(x86_bios_cpu_apicid, cpu))
-#define esr_disable (1)
-
-static inline int apic_id_registered(void)
-{
-       return (1);
-}
-
-static inline const cpumask_t *target_cpus(void)
-{
-#ifdef CONFIG_SMP
-       return &cpu_online_map;
-#else
-       return &cpumask_of_cpu(0);
-#endif
-}
-
-#undef APIC_DEST_LOGICAL
-#define APIC_DEST_LOGICAL      0
-#define APIC_DFR_VALUE         (APIC_DFR_FLAT)
-#define INT_DELIVERY_MODE      (dest_Fixed)
-#define INT_DEST_MODE          (0)    /* phys delivery to target proc */
-#define NO_BALANCE_IRQ         (0)
-
-static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
-{
-       return (0);
-}
-
-static inline unsigned long check_apicid_present(int bit)
-{
-       return (1);
-}
-
-static inline unsigned long calculate_ldr(int cpu)
-{
-       unsigned long val, id;
-       val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
-       id = xapic_phys_to_log_apicid(cpu);
-       val |= SET_APIC_LOGICAL_ID(id);
-       return val;
-}
-
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LDR and TPR before enabling
- * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116).  So here it goes...
- */
-static inline void init_apic_ldr(void)
-{
-       unsigned long val;
-       int cpu = smp_processor_id();
-
-       apic_write(APIC_DFR, APIC_DFR_VALUE);
-       val = calculate_ldr(cpu);
-       apic_write(APIC_LDR, val);
-}
-
-static inline void setup_apic_routing(void)
-{
-       printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
-               "Physflat", nr_ioapics);
-}
-
-static inline int multi_timer_check(int apic, int irq)
-{
-       return (0);
-}
-
-static inline int apicid_to_node(int logical_apicid)
-{
-       return apicid_2_node[hard_smp_processor_id()];
-}
-
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (mps_cpu < nr_cpu_ids)
-               return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
-
-       return BAD_APICID;
-}
-
-static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
-{
-       return physid_mask_of_physid(phys_apicid);
-}
-
-extern u8 cpu_2_logical_apicid[];
-/* Mapping from cpu number to logical apicid */
-static inline int cpu_to_logical_apicid(int cpu)
-{
-       if (cpu >= nr_cpu_ids)
-               return BAD_APICID;
-       return cpu_physical_id(cpu);
-}
-
-static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
-{
-       /* For clustered we don't have a good way to do this yet - hack */
-       return physids_promote(0xFFL);
-}
-
-static inline void setup_portio_remap(void)
-{
-}
-
-static inline void enable_apic_mode(void)
-{
-}
-
-static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
-       return (1);
-}
-
-/* As we are using single CPU as destination, pick only one CPU here */
-static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
-       int cpu;
-       int apicid;     
-
-       cpu = first_cpu(*cpumask);
-       apicid = cpu_to_logical_apicid(cpu);
-       return apicid;
-}
-
-static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                                 const struct cpumask *andmask)
-{
-       int cpu;
-
-       /*
-        * We're using fixed IRQ delivery, can only return one phys APIC ID.
-        * May as well be the first.
-        */
-       for_each_cpu_and(cpu, cpumask, andmask)
-               if (cpumask_test_cpu(cpu, cpu_online_mask))
-                       break;
-       if (cpu < nr_cpu_ids)
-               return cpu_to_logical_apicid(cpu);
-
-       return BAD_APICID;
-}
-
-static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
-{
-       return cpuid_apic >> index_msb;
-}
-
-#endif /* __ASM_MACH_APIC_H */
diff --git a/arch/x86/include/asm/bigsmp/apicdef.h b/arch/x86/include/asm/bigsmp/apicdef.h
deleted file mode 100644 (file)
index 392c3f5..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-#define                APIC_ID_MASK            (0xFF<<24)
-
-static inline unsigned get_apic_id(unsigned long x)
-{
-       return (((x)>>24)&0xFF);
-}
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/arch/x86/include/asm/bigsmp/ipi.h b/arch/x86/include/asm/bigsmp/ipi.h
deleted file mode 100644 (file)
index 27fcd01..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
-       send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(cpu_online_mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
index f03b23e..b185091 100644 (file)
@@ -32,10 +32,6 @@ extern void arch_unregister_cpu(int);
 
 DECLARE_PER_CPU(int, cpu_state);
 
-#ifdef CONFIG_X86_HAS_BOOT_CPU_ID
-extern unsigned char boot_cpu_id;
-#else
-#define boot_cpu_id                            0
-#endif
+extern unsigned int boot_cpu_id;
 
 #endif /* _ASM_X86_CPU_H */
index 3d8cedd..00d41ce 100644 (file)
@@ -49,6 +49,7 @@
 #define E820_RESERVED_KERN        128
 
 #ifndef __ASSEMBLY__
+#include <linux/types.h>
 struct e820entry {
        __u64 addr;     /* start of memory segment */
        __u64 size;     /* size of memory segment */
similarity index 94%
rename from arch/x86/include/asm/mach-default/entry_arch.h
rename to arch/x86/include/asm/entry_arch.h
index 6fa399a..854d538 100644 (file)
@@ -9,7 +9,7 @@
  * is no hardware IRQ pin equivalent for them, they are triggered
  * through the ICC by us (IPIs)
  */
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
 BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
 BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
 BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
@@ -41,10 +41,15 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
  * a much simpler SMP time architecture:
  */
 #ifdef CONFIG_X86_LOCAL_APIC
+
 BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
 BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
 BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
 
+#ifdef CONFIG_PERF_COUNTERS
+BUILD_INTERRUPT(perf_counter_interrupt, LOCAL_PERF_VECTOR)
+#endif
+
 #ifdef CONFIG_X86_MCE_P4THERMAL
 BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
 #endif
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
deleted file mode 100644 (file)
index c58b9cc..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-#ifndef __ASM_ES7000_APIC_H
-#define __ASM_ES7000_APIC_H
-
-#include <linux/gfp.h>
-
-#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
-#define esr_disable (1)
-
-static inline int apic_id_registered(void)
-{
-               return (1);
-}
-
-static inline const cpumask_t *target_cpus_cluster(void)
-{
-       return &CPU_MASK_ALL;
-}
-
-static inline const cpumask_t *target_cpus(void)
-{
-       return &cpumask_of_cpu(smp_processor_id());
-}
-
-#define APIC_DFR_VALUE_CLUSTER         (APIC_DFR_CLUSTER)
-#define INT_DELIVERY_MODE_CLUSTER      (dest_LowestPrio)
-#define INT_DEST_MODE_CLUSTER          (1) /* logical delivery broadcast to all procs */
-#define NO_BALANCE_IRQ_CLUSTER         (1)
-
-#define APIC_DFR_VALUE         (APIC_DFR_FLAT)
-#define INT_DELIVERY_MODE      (dest_Fixed)
-#define INT_DEST_MODE          (0)    /* phys delivery to target procs */
-#define NO_BALANCE_IRQ         (0)
-#undef  APIC_DEST_LOGICAL
-#define APIC_DEST_LOGICAL      0x0
-
-static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
-{
-       return 0;
-}
-static inline unsigned long check_apicid_present(int bit)
-{
-       return physid_isset(bit, phys_cpu_present_map);
-}
-
-#define apicid_cluster(apicid) (apicid & 0xF0)
-
-static inline unsigned long calculate_ldr(int cpu)
-{
-       unsigned long id;
-       id = xapic_phys_to_log_apicid(cpu);
-       return (SET_APIC_LOGICAL_ID(id));
-}
-
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LdR and TPR before enabling
- * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116).  So here it goes...
- */
-static inline void init_apic_ldr_cluster(void)
-{
-       unsigned long val;
-       int cpu = smp_processor_id();
-
-       apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
-       val = calculate_ldr(cpu);
-       apic_write(APIC_LDR, val);
-}
-
-static inline void init_apic_ldr(void)
-{
-       unsigned long val;
-       int cpu = smp_processor_id();
-
-       apic_write(APIC_DFR, APIC_DFR_VALUE);
-       val = calculate_ldr(cpu);
-       apic_write(APIC_LDR, val);
-}
-
-extern int apic_version [MAX_APICS];
-static inline void setup_apic_routing(void)
-{
-       int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
-       printk("Enabling APIC mode:  %s. Using %d I/O APICs, target cpus %lx\n",
-               (apic_version[apic] == 0x14) ?
-                       "Physical Cluster" : "Logical Cluster",
-                       nr_ioapics, cpus_addr(*target_cpus())[0]);
-}
-
-static inline int multi_timer_check(int apic, int irq)
-{
-       return 0;
-}
-
-static inline int apicid_to_node(int logical_apicid)
-{
-       return 0;
-}
-
-
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (!mps_cpu)
-               return boot_cpu_physical_apicid;
-       else if (mps_cpu < nr_cpu_ids)
-               return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
-       else
-               return BAD_APICID;
-}
-
-static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
-{
-       static int id = 0;
-       physid_mask_t mask;
-       mask = physid_mask_of_physid(id);
-       ++id;
-       return mask;
-}
-
-extern u8 cpu_2_logical_apicid[];
-/* Mapping from cpu number to logical apicid */
-static inline int cpu_to_logical_apicid(int cpu)
-{
-#ifdef CONFIG_SMP
-       if (cpu >= nr_cpu_ids)
-               return BAD_APICID;
-       return (int)cpu_2_logical_apicid[cpu];
-#else
-       return logical_smp_processor_id();
-#endif
-}
-
-static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
-{
-       /* For clustered we don't have a good way to do this yet - hack */
-       return physids_promote(0xff);
-}
-
-
-static inline void setup_portio_remap(void)
-{
-}
-
-extern unsigned int boot_cpu_physical_apicid;
-static inline int check_phys_apicid_present(int cpu_physical_apicid)
-{
-       boot_cpu_physical_apicid = read_apic_id();
-       return (1);
-}
-
-static inline unsigned int
-cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
-{
-       int num_bits_set;
-       int cpus_found = 0;
-       int cpu;
-       int apicid;
-
-       num_bits_set = cpumask_weight(cpumask);
-       /* Return id to all */
-       if (num_bits_set == nr_cpu_ids)
-               return 0xFF;
-       /*
-        * The cpus in the mask must all be on the apic cluster.  If are not
-        * on the same apicid cluster return default value of TARGET_CPUS.
-        */
-       cpu = cpumask_first(cpumask);
-       apicid = cpu_to_logical_apicid(cpu);
-       while (cpus_found < num_bits_set) {
-               if (cpumask_test_cpu(cpu, cpumask)) {
-                       int new_apicid = cpu_to_logical_apicid(cpu);
-                       if (apicid_cluster(apicid) !=
-                                       apicid_cluster(new_apicid)){
-                               printk ("%s: Not a valid mask!\n", __func__);
-                               return 0xFF;
-                       }
-                       apicid = new_apicid;
-                       cpus_found++;
-               }
-               cpu++;
-       }
-       return apicid;
-}
-
-static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
-       int num_bits_set;
-       int cpus_found = 0;
-       int cpu;
-       int apicid;
-
-       num_bits_set = cpus_weight(*cpumask);
-       /* Return id to all */
-       if (num_bits_set == nr_cpu_ids)
-               return cpu_to_logical_apicid(0);
-       /*
-        * The cpus in the mask must all be on the apic cluster.  If are not
-        * on the same apicid cluster return default value of TARGET_CPUS.
-        */
-       cpu = first_cpu(*cpumask);
-       apicid = cpu_to_logical_apicid(cpu);
-       while (cpus_found < num_bits_set) {
-               if (cpu_isset(cpu, *cpumask)) {
-                       int new_apicid = cpu_to_logical_apicid(cpu);
-                       if (apicid_cluster(apicid) !=
-                                       apicid_cluster(new_apicid)){
-                               printk ("%s: Not a valid mask!\n", __func__);
-                               return cpu_to_logical_apicid(0);
-                       }
-                       apicid = new_apicid;
-                       cpus_found++;
-               }
-               cpu++;
-       }
-       return apicid;
-}
-
-
-static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
-                                                 const struct cpumask *andmask)
-{
-       int apicid = cpu_to_logical_apicid(0);
-       cpumask_var_t cpumask;
-
-       if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
-               return apicid;
-
-       cpumask_and(cpumask, inmask, andmask);
-       cpumask_and(cpumask, cpumask, cpu_online_mask);
-       apicid = cpu_mask_to_apicid(cpumask);
-
-       free_cpumask_var(cpumask);
-       return apicid;
-}
-
-static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
-{
-       return cpuid_apic >> index_msb;
-}
-
-#endif /* __ASM_ES7000_APIC_H */
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
deleted file mode 100644 (file)
index 8b234a3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_ES7000_APICDEF_H
-#define __ASM_ES7000_APICDEF_H
-
-#define                APIC_ID_MASK            (0xFF<<24)
-
-static inline unsigned get_apic_id(unsigned long x)
-{
-       return (((x)>>24)&0xFF);
-}
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
deleted file mode 100644 (file)
index 7e8ed24..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_ES7000_IPI_H
-#define __ASM_ES7000_IPI_H
-
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
-       send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(cpu_online_mask, vector);
-}
-
-#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h
deleted file mode 100644 (file)
index c1629b0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __ASM_ES7000_MPPARSE_H
-#define __ASM_ES7000_MPPARSE_H
-
-#include <linux/acpi.h>
-
-extern int parse_unisys_oem (char *oemptr);
-extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
-extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);
-extern void setup_unisys(void);
-
-#ifndef CONFIG_X86_GENERICARCH
-extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
-extern int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid);
-#endif
-
-#ifdef CONFIG_ACPI
-
-static inline int es7000_check_dsdt(void)
-{
-       struct acpi_table_header header;
-
-       if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
-           !strncmp(header.oem_id, "UNISYS", 6))
-               return 1;
-       return 0;
-}
-#endif
-
-#endif /* __ASM_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
deleted file mode 100644 (file)
index 78f0daa..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __ASM_ES7000_WAKECPU_H
-#define __ASM_ES7000_WAKECPU_H
-
-#define TRAMPOLINE_PHYS_LOW    0x467
-#define TRAMPOLINE_PHYS_HIGH   0x469
-
-static inline void wait_for_init_deassert(atomic_t *deassert)
-{
-#ifndef CONFIG_ES7000_CLUSTERED_APIC
-       while (!atomic_read(deassert))
-               cpu_relax();
-#endif
-       return;
-}
-
-/* Nothing to do for most platforms, since cleared by the INIT cycle */
-static inline void smp_callin_clear_local_apic(void)
-{
-}
-
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-extern void __inquire_remote_apic(int apicid);
-
-static inline void inquire_remote_apic(int apicid)
-{
-       if (apic_verbosity >= APIC_DEBUG)
-               __inquire_remote_apic(apicid);
-}
-
-#endif /* __ASM_MACH_WAKECPU_H */
index d48bee6..273b994 100644 (file)
@@ -1,5 +1,263 @@
+#ifndef _ASM_X86_GENAPIC_H
+#define _ASM_X86_GENAPIC_H
+
+#include <linux/cpumask.h>
+
+#include <asm/mpspec.h>
+#include <asm/atomic.h>
+
+/*
+ * Copyright 2004 James Cleverdon, IBM.
+ * Subject to the GNU Public License, v.2
+ *
+ * Generic APIC sub-arch data struct.
+ *
+ * Hacked for x86-64 by James Cleverdon from i386 architecture code by
+ * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
+ * James Cleverdon.
+ */
+struct genapic {
+       char *name;
+
+       int (*probe)(void);
+       int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
+       int (*apic_id_registered)(void);
+
+       u32 irq_delivery_mode;
+       u32 irq_dest_mode;
+
+       const struct cpumask *(*target_cpus)(void);
+
+       int disable_esr;
+
+       int dest_logical;
+       unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
+       unsigned long (*check_apicid_present)(int apicid);
+
+       void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
+       void (*init_apic_ldr)(void);
+
+       physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
+
+       void (*setup_apic_routing)(void);
+       int (*multi_timer_check)(int apic, int irq);
+       int (*apicid_to_node)(int logical_apicid);
+       int (*cpu_to_logical_apicid)(int cpu);
+       int (*cpu_present_to_apicid)(int mps_cpu);
+       physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
+       void (*setup_portio_remap)(void);
+       int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
+       void (*enable_apic_mode)(void);
+       int (*phys_pkg_id)(int cpuid_apic, int index_msb);
+
+       /*
+        * When one of the next two hooks returns 1 the genapic
+        * is switched to this. Essentially they are additional
+        * probe functions:
+        */
+       int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid);
+
+       unsigned int (*get_apic_id)(unsigned long x);
+       unsigned long (*set_apic_id)(unsigned int id);
+       unsigned long apic_id_mask;
+
+       unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
+       unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
+                                              const struct cpumask *andmask);
+
+       /* ipi */
+       void (*send_IPI_mask)(const struct cpumask *mask, int vector);
+       void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
+                                        int vector);
+       void (*send_IPI_allbutself)(int vector);
+       void (*send_IPI_all)(int vector);
+       void (*send_IPI_self)(int vector);
+
+       /* wakeup_secondary_cpu */
+       int (*wakeup_cpu)(int apicid, unsigned long start_eip);
+
+       int trampoline_phys_low;
+       int trampoline_phys_high;
+
+       void (*wait_for_init_deassert)(atomic_t *deassert);
+       void (*smp_callin_clear_local_apic)(void);
+       void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
+       void (*inquire_remote_apic)(int apicid);
+};
+
+extern struct genapic *apic;
+
+/*
+ * Warm reset vector default position:
+ */
+#define DEFAULT_TRAMPOLINE_PHYS_LOW            0x467
+#define DEFAULT_TRAMPOLINE_PHYS_HIGH           0x469
+
 #ifdef CONFIG_X86_32
-# include "genapic_32.h"
+extern void es7000_update_genapic_to_cluster(void);
 #else
-# include "genapic_64.h"
+extern struct genapic apic_flat;
+extern struct genapic apic_physflat;
+extern struct genapic apic_x2apic_cluster;
+extern struct genapic apic_x2apic_phys;
+extern int default_acpi_madt_oem_check(char *, char *);
+
+extern void apic_send_IPI_self(int vector);
+
+extern struct genapic apic_x2apic_uv_x;
+DECLARE_PER_CPU(int, x2apic_extra_bits);
+
+extern void default_setup_apic_routing(void);
+
+extern int default_cpu_present_to_apicid(int mps_cpu);
+extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
 #endif
+
+static inline void default_wait_for_init_deassert(atomic_t *deassert)
+{
+       while (!atomic_read(deassert))
+               cpu_relax();
+       return;
+}
+
+extern void generic_bigsmp_probe(void);
+
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+#include <asm/smp.h>
+
+#define APIC_DFR_VALUE (APIC_DFR_FLAT)
+
+static inline const struct cpumask *default_target_cpus(void)
+{
+#ifdef CONFIG_SMP
+       return cpu_online_mask;
+#else
+       return cpumask_of(0);
+#endif
+}
+
+DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
+
+
+static inline unsigned int read_apic_id(void)
+{
+       unsigned int reg;
+
+       reg = apic_read(APIC_ID);
+
+       return apic->get_apic_id(reg);
+}
+
+#ifdef CONFIG_X86_64
+extern void default_setup_apic_routing(void);
+#else
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LDR and TPR before enabling
+ * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116).  So here it goes...
+ */
+extern void default_init_apic_ldr(void);
+
+static inline int default_apic_id_registered(void)
+{
+       return physid_isset(read_apic_id(), phys_cpu_present_map);
+}
+
+static inline unsigned int
+default_cpu_mask_to_apicid(const struct cpumask *cpumask)
+{
+       return cpumask_bits(cpumask)[0];
+}
+
+static inline unsigned int
+default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                              const struct cpumask *andmask)
+{
+       unsigned long mask1 = cpumask_bits(cpumask)[0];
+       unsigned long mask2 = cpumask_bits(andmask)[0];
+       unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
+
+       return (unsigned int)(mask1 & mask2 & mask3);
+}
+
+static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+       return cpuid_apic >> index_msb;
+}
+
+static inline void default_setup_apic_routing(void)
+{
+#ifdef CONFIG_X86_IO_APIC
+       printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
+                                       "Flat", nr_ioapics);
+#endif
+}
+
+extern int default_apicid_to_node(int logical_apicid);
+
+#endif
+
+static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+       return physid_isset(apicid, bitmap);
+}
+
+static inline unsigned long default_check_apicid_present(int bit)
+{
+       return physid_isset(bit, phys_cpu_present_map);
+}
+
+static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)
+{
+       return phys_map;
+}
+
+/* Mapping from cpu number to logical apicid */
+static inline int default_cpu_to_logical_apicid(int cpu)
+{
+       return 1 << cpu;
+}
+
+static inline int __default_cpu_present_to_apicid(int mps_cpu)
+{
+       if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
+               return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
+       else
+               return BAD_APICID;
+}
+
+static inline int
+__default_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+       return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
+}
+
+#ifdef CONFIG_X86_32
+static inline int default_cpu_present_to_apicid(int mps_cpu)
+{
+       return __default_cpu_present_to_apicid(mps_cpu);
+}
+
+static inline int
+default_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+       return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
+}
+#else
+extern int default_cpu_present_to_apicid(int mps_cpu);
+extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
+#endif
+
+static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
+{
+       return physid_mask_of_physid(phys_apicid);
+}
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
+#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
deleted file mode 100644 (file)
index 4334502..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef _ASM_X86_GENAPIC_32_H
-#define _ASM_X86_GENAPIC_32_H
-
-#include <asm/mpspec.h>
-#include <asm/atomic.h>
-
-/*
- * Generic APIC driver interface.
- *
- * An straight forward mapping of the APIC related parts of the
- * x86 subarchitecture interface to a dynamic object.
- *
- * This is used by the "generic" x86 subarchitecture.
- *
- * Copyright 2003 Andi Kleen, SuSE Labs.
- */
-
-struct mpc_bus;
-struct mpc_table;
-struct mpc_cpu;
-
-struct genapic {
-       char *name;
-       int (*probe)(void);
-
-       int (*apic_id_registered)(void);
-       const struct cpumask *(*target_cpus)(void);
-       int int_delivery_mode;
-       int int_dest_mode;
-       int ESR_DISABLE;
-       int apic_destination_logical;
-       unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
-       unsigned long (*check_apicid_present)(int apicid);
-       int no_balance_irq;
-       int no_ioapic_check;
-       void (*init_apic_ldr)(void);
-       physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
-
-       void (*setup_apic_routing)(void);
-       int (*multi_timer_check)(int apic, int irq);
-       int (*apicid_to_node)(int logical_apicid);
-       int (*cpu_to_logical_apicid)(int cpu);
-       int (*cpu_present_to_apicid)(int mps_cpu);
-       physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
-       void (*setup_portio_remap)(void);
-       int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
-       void (*enable_apic_mode)(void);
-       u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
-
-       /* mpparse */
-       /* When one of the next two hooks returns 1 the genapic
-          is switched to this. Essentially they are additional probe
-          functions. */
-       int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
-                            char *productid);
-       int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
-
-       unsigned (*get_apic_id)(unsigned long x);
-       unsigned long apic_id_mask;
-       unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
-       unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
-                                              const struct cpumask *andmask);
-       void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
-
-#ifdef CONFIG_SMP
-       /* ipi */
-       void (*send_IPI_mask)(const struct cpumask *mask, int vector);
-       void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
-                                        int vector);
-       void (*send_IPI_allbutself)(int vector);
-       void (*send_IPI_all)(int vector);
-#endif
-       int (*wakeup_cpu)(int apicid, unsigned long start_eip);
-       int trampoline_phys_low;
-       int trampoline_phys_high;
-       void (*wait_for_init_deassert)(atomic_t *deassert);
-       void (*smp_callin_clear_local_apic)(void);
-       void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
-       void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
-       void (*inquire_remote_apic)(int apicid);
-};
-
-#define APICFUNC(x) .x = x,
-
-/* More functions could be probably marked IPIFUNC and save some space
-   in UP GENERICARCH kernels, but I don't have the nerve right now
-   to untangle this mess. -AK  */
-#ifdef CONFIG_SMP
-#define IPIFUNC(x) APICFUNC(x)
-#else
-#define IPIFUNC(x)
-#endif
-
-#define APIC_INIT(aname, aprobe)                       \
-{                                                      \
-       .name = aname,                                  \
-       .probe = aprobe,                                \
-       .int_delivery_mode = INT_DELIVERY_MODE,         \
-       .int_dest_mode = INT_DEST_MODE,                 \
-       .no_balance_irq = NO_BALANCE_IRQ,               \
-       .ESR_DISABLE = esr_disable,                     \
-       .apic_destination_logical = APIC_DEST_LOGICAL,  \
-       APICFUNC(apic_id_registered)                    \
-       APICFUNC(target_cpus)                           \
-       APICFUNC(check_apicid_used)                     \
-       APICFUNC(check_apicid_present)                  \
-       APICFUNC(init_apic_ldr)                         \
-       APICFUNC(ioapic_phys_id_map)                    \
-       APICFUNC(setup_apic_routing)                    \
-       APICFUNC(multi_timer_check)                     \
-       APICFUNC(apicid_to_node)                        \
-       APICFUNC(cpu_to_logical_apicid)                 \
-       APICFUNC(cpu_present_to_apicid)                 \
-       APICFUNC(apicid_to_cpu_present)                 \
-       APICFUNC(setup_portio_remap)                    \
-       APICFUNC(check_phys_apicid_present)             \
-       APICFUNC(mps_oem_check)                         \
-       APICFUNC(get_apic_id)                           \
-       .apic_id_mask = APIC_ID_MASK,                   \
-       APICFUNC(cpu_mask_to_apicid)                    \
-       APICFUNC(cpu_mask_to_apicid_and)                \
-       APICFUNC(vector_allocation_domain)              \
-       APICFUNC(acpi_madt_oem_check)                   \
-       IPIFUNC(send_IPI_mask)                          \
-       IPIFUNC(send_IPI_allbutself)                    \
-       IPIFUNC(send_IPI_all)                           \
-       APICFUNC(enable_apic_mode)                      \
-       APICFUNC(phys_pkg_id)                           \
-       .trampoline_phys_low = TRAMPOLINE_PHYS_LOW,             \
-       .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,           \
-       APICFUNC(wait_for_init_deassert)                \
-       APICFUNC(smp_callin_clear_local_apic)           \
-       APICFUNC(store_NMI_vector)                      \
-       APICFUNC(restore_NMI_vector)                    \
-       APICFUNC(inquire_remote_apic)                   \
-}
-
-extern struct genapic *genapic;
-extern void es7000_update_genapic_to_cluster(void);
-
-#endif /* _ASM_X86_GENAPIC_32_H */
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
deleted file mode 100644 (file)
index 7bb092c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef _ASM_X86_GENAPIC_64_H
-#define _ASM_X86_GENAPIC_64_H
-
-#include <linux/cpumask.h>
-
-/*
- * Copyright 2004 James Cleverdon, IBM.
- * Subject to the GNU Public License, v.2
- *
- * Generic APIC sub-arch data struct.
- *
- * Hacked for x86-64 by James Cleverdon from i386 architecture code by
- * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
- * James Cleverdon.
- */
-
-struct genapic {
-       char *name;
-       int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
-       u32 int_delivery_mode;
-       u32 int_dest_mode;
-       int (*apic_id_registered)(void);
-       const struct cpumask *(*target_cpus)(void);
-       void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
-       void (*init_apic_ldr)(void);
-       /* ipi */
-       void (*send_IPI_mask)(const struct cpumask *mask, int vector);
-       void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
-                                        int vector);
-       void (*send_IPI_allbutself)(int vector);
-       void (*send_IPI_all)(int vector);
-       void (*send_IPI_self)(int vector);
-       /* */
-       unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
-       unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
-                                              const struct cpumask *andmask);
-       unsigned int (*phys_pkg_id)(int index_msb);
-       unsigned int (*get_apic_id)(unsigned long x);
-       unsigned long (*set_apic_id)(unsigned int id);
-       unsigned long apic_id_mask;
-       /* wakeup_secondary_cpu */
-       int (*wakeup_cpu)(int apicid, unsigned long start_eip);
-};
-
-extern struct genapic *genapic;
-
-extern struct genapic apic_flat;
-extern struct genapic apic_physflat;
-extern struct genapic apic_x2apic_cluster;
-extern struct genapic apic_x2apic_phys;
-extern int acpi_madt_oem_check(char *, char *);
-
-extern void apic_send_IPI_self(int vector);
-
-extern struct genapic apic_x2apic_uv_x;
-DECLARE_PER_CPU(int, x2apic_extra_bits);
-
-extern void setup_apic_routing(void);
-
-#endif /* _ASM_X86_GENAPIC_64_H */
index 8de644b..1b82781 100644 (file)
@@ -25,8 +25,6 @@
 #include <asm/irq.h>
 #include <asm/sections.h>
 
-#define platform_legacy_irq(irq)       ((irq) < 16)
-
 /* Interrupt handlers registered during init_IRQ */
 extern void apic_timer_interrupt(void);
 extern void error_interrupt(void);
@@ -58,7 +56,7 @@ extern void make_8259A_irq(unsigned int irq);
 extern void init_8259A(int aeoi);
 
 /* IOAPIC */
-#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
+#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs))
 extern unsigned long io_apic_irqs;
 
 extern void init_VISWS_APIC_irqs(void);
@@ -71,12 +69,6 @@ extern void setup_ioapic_dest(void);
 extern void enable_IO_APIC(void);
 #endif
 
-/* IPI functions */
-#ifdef CONFIG_X86_32
-extern void send_IPI_self(int vector);
-#endif
-extern void send_IPI(int dest, int vector);
-
 /* Statistics */
 extern atomic_t irq_err_count;
 extern atomic_t irq_mis_count;
@@ -84,21 +76,11 @@ extern atomic_t irq_mis_count;
 /* EISA */
 extern void eisa_set_level_irq(unsigned int irq);
 
-/* Voyager functions */
-extern asmlinkage void vic_cpi_interrupt(void);
-extern asmlinkage void vic_sys_interrupt(void);
-extern asmlinkage void vic_cmn_interrupt(void);
-extern asmlinkage void qic_timer_interrupt(void);
-extern asmlinkage void qic_invalidate_interrupt(void);
-extern asmlinkage void qic_reschedule_interrupt(void);
-extern asmlinkage void qic_enable_irq_interrupt(void);
-extern asmlinkage void qic_call_function_interrupt(void);
-
 /* SMP */
 extern void smp_apic_timer_interrupt(struct pt_regs *);
 extern void smp_spurious_interrupt(struct pt_regs *);
 extern void smp_error_interrupt(struct pt_regs *);
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
 extern void smp_reschedule_interrupt(struct pt_regs *);
 extern void smp_call_function_interrupt(struct pt_regs *);
 extern void smp_call_function_single_interrupt(struct pt_regs *);
index 1dbbdf4..bcf7ea4 100644 (file)
@@ -91,7 +91,7 @@ extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
 
 extern int ioremap_change_attr(unsigned long vaddr, unsigned long size,
                                unsigned long prot_val);
-extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size);
+extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);
 
 /*
  * early_ioremap() and early_iounmap() are for temporary early boot-time
index 08ec793..309d0e2 100644 (file)
@@ -143,15 +143,6 @@ extern int noioapicreroute;
 /* 1 if the timer IRQ uses the '8259A Virtual Wire' mode */
 extern int timer_through_8259;
 
-static inline void disable_ioapic_setup(void)
-{
-#ifdef CONFIG_PCI
-       noioapicquirk = 1;
-       noioapicreroute = -1;
-#endif
-       skip_ioapic_setup = 1;
-}
-
 /*
  * If we use the IO-APIC for IRQ routing, disable automatic
  * assignment of PCI IRQ's.
index c745a30..5f2efc5 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_IPI_H
 #define _ASM_X86_IPI_H
 
+#ifdef CONFIG_X86_LOCAL_APIC
+
 /*
  * Copyright 2004 James Cleverdon, IBM.
  * Subject to the GNU Public License, v.2
@@ -55,8 +57,8 @@ static inline void __xapic_wait_icr_idle(void)
                cpu_relax();
 }
 
-static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
-                                      unsigned int dest)
+static inline void
+__default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
 {
        /*
         * Subtle. In the case of the 'never do double writes' workaround
@@ -87,8 +89,8 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
  * This is used to send an IPI with no shorthand notation (the destination is
  * specified in bits 56 to 63 of the ICR).
  */
-static inline void __send_IPI_dest_field(unsigned int mask, int vector,
                                       unsigned int dest)
+static inline void
__default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest)
 {
        unsigned long cfg;
 
@@ -117,41 +119,46 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
        native_apic_mem_write(APIC_ICR, cfg);
 }
 
-static inline void send_IPI_mask_sequence(const struct cpumask *mask,
-                                         int vector)
-{
-       unsigned long flags;
-       unsigned long query_cpu;
+extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
+                                                int vector);
+extern void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
+                                                        int vector);
+#include <asm/genapic.h>
 
-       /*
-        * Hack. The clustered APIC addressing mode doesn't allow us to send
-        * to an arbitrary mask, so I do a unicast to each CPU instead.
-        * - mbligh
-        */
-       local_irq_save(flags);
-       for_each_cpu(query_cpu, mask) {
-               __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu),
-                                     vector, APIC_DEST_PHYSICAL);
-       }
-       local_irq_restore(flags);
+extern void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
+                                                        int vector);
+extern void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask,
+                                                        int vector);
+
+/* Avoid include hell */
+#define NMI_VECTOR 0x02
+
+extern int no_broadcast;
+
+static inline void __default_local_send_IPI_allbutself(int vector)
+{
+       if (no_broadcast || vector == NMI_VECTOR)
+               apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
+       else
+               __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical);
 }
 
-static inline void send_IPI_mask_allbutself(const struct cpumask *mask,
-                                           int vector)
+static inline void __default_local_send_IPI_all(int vector)
 {
-       unsigned long flags;
-       unsigned int query_cpu;
-       unsigned int this_cpu = smp_processor_id();
-
-       /* See Hack comment above */
-
-       local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
-               if (query_cpu != this_cpu)
-                       __send_IPI_dest_field(
-                               per_cpu(x86_cpu_to_apicid, query_cpu),
-                               vector, APIC_DEST_PHYSICAL);
-       local_irq_restore(flags);
+       if (no_broadcast || vector == NMI_VECTOR)
+               apic->send_IPI_mask(cpu_online_mask, vector);
+       else
+               __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical);
 }
 
+#ifdef CONFIG_X86_32
+extern void default_send_IPI_mask_logical(const struct cpumask *mask,
+                                                int vector);
+extern void default_send_IPI_allbutself(int vector);
+extern void default_send_IPI_all(int vector);
+extern void default_send_IPI_self(int vector);
+#endif
+
+#endif
+
 #endif /* _ASM_X86_IPI_H */
index 592688e..107eb21 100644 (file)
@@ -36,9 +36,11 @@ static inline int irq_canonicalize(int irq)
 extern void fixup_irqs(void);
 #endif
 
-extern unsigned int do_IRQ(struct pt_regs *regs);
 extern void init_IRQ(void);
 extern void native_init_IRQ(void);
+extern bool handle_irq(unsigned irq, struct pt_regs *regs);
+
+extern unsigned int do_IRQ(struct pt_regs *regs);
 
 /* Interrupt vector management */
 extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
index 9a83a10..b07278c 100644 (file)
@@ -1,47 +1,69 @@
 #ifndef _ASM_X86_IRQ_VECTORS_H
 #define _ASM_X86_IRQ_VECTORS_H
 
-#include <linux/threads.h>
+/*
+ * Linux IRQ vector layout.
+ *
+ * There are 256 IDT entries (per CPU - each entry is 8 bytes) which can
+ * be defined by Linux. They are used as a jump table by the CPU when a
+ * given vector is triggered - by a CPU-external, CPU-internal or
+ * software-triggered event.
+ *
+ * Linux sets the kernel code address each entry jumps to early during
+ * bootup, and never changes them. This is the general layout of the
+ * IDT entries:
+ *
+ *  Vectors   0 ...  31 : system traps and exceptions - hardcoded events
+ *  Vectors  32 ... 127 : device interrupts
+ *  Vector  128         : legacy int80 syscall interface
+ *  Vectors 129 ... 237 : device interrupts
+ *  Vectors 238 ... 255 : special interrupts
+ *
+ * 64-bit x86 has per CPU IDT tables, 32-bit has one shared IDT table.
+ *
+ * This file enumerates the exact layout of them:
+ */
 
-#define NMI_VECTOR             0x02
+#define NMI_VECTOR                     0x02
 
 /*
  * IDT vectors usable for external interrupt sources start
  * at 0x20:
  */
-#define FIRST_EXTERNAL_VECTOR  0x20
+#define FIRST_EXTERNAL_VECTOR          0x20
 
 #ifdef CONFIG_X86_32
-# define SYSCALL_VECTOR                0x80
+# define SYSCALL_VECTOR                        0x80
 #else
-# define IA32_SYSCALL_VECTOR   0x80
+# define IA32_SYSCALL_VECTOR           0x80
 #endif
 
 /*
  * Reserve the lowest usable priority level 0x20 - 0x2f for triggering
  * cleanup after irq migration.
  */
-#define IRQ_MOVE_CLEANUP_VECTOR        FIRST_EXTERNAL_VECTOR
+#define IRQ_MOVE_CLEANUP_VECTOR                FIRST_EXTERNAL_VECTOR
 
 /*
  * Vectors 0x30-0x3f are used for ISA interrupts.
  */
-#define IRQ0_VECTOR            (FIRST_EXTERNAL_VECTOR + 0x10)
-#define IRQ1_VECTOR            (IRQ0_VECTOR + 1)
-#define IRQ2_VECTOR            (IRQ0_VECTOR + 2)
-#define IRQ3_VECTOR            (IRQ0_VECTOR + 3)
-#define IRQ4_VECTOR            (IRQ0_VECTOR + 4)
-#define IRQ5_VECTOR            (IRQ0_VECTOR + 5)
-#define IRQ6_VECTOR            (IRQ0_VECTOR + 6)
-#define IRQ7_VECTOR            (IRQ0_VECTOR + 7)
-#define IRQ8_VECTOR            (IRQ0_VECTOR + 8)
-#define IRQ9_VECTOR            (IRQ0_VECTOR + 9)
-#define IRQ10_VECTOR           (IRQ0_VECTOR + 10)
-#define IRQ11_VECTOR           (IRQ0_VECTOR + 11)
-#define IRQ12_VECTOR           (IRQ0_VECTOR + 12)
-#define IRQ13_VECTOR           (IRQ0_VECTOR + 13)
-#define IRQ14_VECTOR           (IRQ0_VECTOR + 14)
-#define IRQ15_VECTOR           (IRQ0_VECTOR + 15)
+#define IRQ0_VECTOR                    (FIRST_EXTERNAL_VECTOR + 0x10)
+
+#define IRQ1_VECTOR                    (IRQ0_VECTOR +  1)
+#define IRQ2_VECTOR                    (IRQ0_VECTOR +  2)
+#define IRQ3_VECTOR                    (IRQ0_VECTOR +  3)
+#define IRQ4_VECTOR                    (IRQ0_VECTOR +  4)
+#define IRQ5_VECTOR                    (IRQ0_VECTOR +  5)
+#define IRQ6_VECTOR                    (IRQ0_VECTOR +  6)
+#define IRQ7_VECTOR                    (IRQ0_VECTOR +  7)
+#define IRQ8_VECTOR                    (IRQ0_VECTOR +  8)
+#define IRQ9_VECTOR                    (IRQ0_VECTOR +  9)
+#define IRQ10_VECTOR                   (IRQ0_VECTOR + 10)
+#define IRQ11_VECTOR                   (IRQ0_VECTOR + 11)
+#define IRQ12_VECTOR                   (IRQ0_VECTOR + 12)
+#define IRQ13_VECTOR                   (IRQ0_VECTOR + 13)
+#define IRQ14_VECTOR                   (IRQ0_VECTOR + 14)
+#define IRQ15_VECTOR                   (IRQ0_VECTOR + 15)
 
 /*
  * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
  *  into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
  *  TLB, reschedule and local APIC vectors are performance-critical.
  */
-#ifdef CONFIG_X86_32
 
-# define SPURIOUS_APIC_VECTOR          0xff
-# define ERROR_APIC_VECTOR             0xfe
-# define RESCHEDULE_VECTOR             0xfd
-# define CALL_FUNCTION_VECTOR          0xfc
-# define CALL_FUNCTION_SINGLE_VECTOR   0xfb
-# define THERMAL_APIC_VECTOR           0xfa
-/* 0xf8 - 0xf9 : free */
-# define INVALIDATE_TLB_VECTOR_END     0xf7
-# define INVALIDATE_TLB_VECTOR_START   0xf0    /* f0-f7 used for TLB flush */
+#define SPURIOUS_APIC_VECTOR           0xff
+/*
+ * Sanity check
+ */
+#if ((SPURIOUS_APIC_VECTOR & 0x0F) != 0x0F)
+# error SPURIOUS_APIC_VECTOR definition error
+#endif
 
-# define NUM_INVALIDATE_TLB_VECTORS    8
+#define ERROR_APIC_VECTOR              0xfe
+#define RESCHEDULE_VECTOR              0xfd
+#define CALL_FUNCTION_VECTOR           0xfc
+#define CALL_FUNCTION_SINGLE_VECTOR    0xfb
+#define THERMAL_APIC_VECTOR            0xfa
 
+#ifdef CONFIG_X86_32
+/* 0xf8 - 0xf9 : free */
 #else
-
-# define SPURIOUS_APIC_VECTOR          0xff
-# define ERROR_APIC_VECTOR             0xfe
-# define RESCHEDULE_VECTOR             0xfd
-# define CALL_FUNCTION_VECTOR          0xfc
-# define CALL_FUNCTION_SINGLE_VECTOR   0xfb
-# define THERMAL_APIC_VECTOR           0xfa
 # define THRESHOLD_APIC_VECTOR         0xf9
 # define UV_BAU_MESSAGE                        0xf8
-# define INVALIDATE_TLB_VECTOR_END     0xf7
-# define INVALIDATE_TLB_VECTOR_START   0xf0    /* f0-f7 used for TLB flush */
-
-#define NUM_INVALIDATE_TLB_VECTORS     8
-
 #endif
 
+/* f0-f7 used for spreading out TLB flushes: */
+#define INVALIDATE_TLB_VECTOR_END      0xf7
+#define INVALIDATE_TLB_VECTOR_START    0xf0
+#define NUM_INVALIDATE_TLB_VECTORS        8
+
 /*
  * Local APIC timer IRQ vector is on a different priority level,
  * to work around the 'lost local interrupt if more than 2 IRQ
  * sources per level' errata.
  */
-#define LOCAL_TIMER_VECTOR     0xef
+#define LOCAL_TIMER_VECTOR             0xef
+
+/*
+ * Performance monitoring interrupt vector:
+ */
+#define LOCAL_PERF_VECTOR              0xee
 
 /*
  * First APIC vector available to drivers: (vectors 0x30-0xee) we
  * start at 0x31(0x41) to spread out vectors evenly between priority
  * levels. (0x80 is the syscall vector)
  */
-#define FIRST_DEVICE_VECTOR    (IRQ15_VECTOR + 2)
-
-#define NR_VECTORS             256
-
-#define FPU_IRQ                        13
-
-#define        FIRST_VM86_IRQ          3
-#define LAST_VM86_IRQ          15
-#define invalid_vm86_irq(irq)  ((irq) < 3 || (irq) > 15)
+#define FIRST_DEVICE_VECTOR            (IRQ15_VECTOR + 2)
 
-#define NR_IRQS_LEGACY         16
+#define NR_VECTORS                      256
 
-#if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER)
-
-#include <asm/apicnum.h>       /* need MAX_IO_APICS */
-
-#ifndef CONFIG_SPARSE_IRQ
-# if NR_CPUS < MAX_IO_APICS
-#  define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
-# else
-#  define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
-# endif
-#else
+#define FPU_IRQ                                  13
 
-# define NR_IRQS                                       \
-       ((8 * NR_CPUS) > (32 * MAX_IO_APICS) ?          \
-               (NR_VECTORS + (8 * NR_CPUS)) :          \
-               (NR_VECTORS + (32 * MAX_IO_APICS)))     \
+#define        FIRST_VM86_IRQ                     3
+#define LAST_VM86_IRQ                    15
 
+#ifndef __ASSEMBLY__
+static inline int invalid_vm86_irq(int irq)
+{
+       return irq < 3 || irq > 15;
+}
 #endif
 
-#elif defined(CONFIG_X86_VOYAGER)
-
-# define NR_IRQS               224
+/*
+ * Size the maximum number of interrupts.
+ *
+ * If the irq_desc[] array has a sparse layout, we can size things
+ * generously - it scales up linearly with the maximum number of CPUs,
+ * and the maximum number of IO-APICs, whichever is higher.
+ *
+ * In other cases we size more conservatively, to not create too large
+ * static arrays.
+ */
 
-#else /* IO_APIC || VOYAGER */
+#define NR_IRQS_LEGACY                   16
 
-# define NR_IRQS               16
+#define CPU_VECTOR_LIMIT               (  8 * NR_CPUS      )
+#define IO_APIC_VECTOR_LIMIT           ( 32 * MAX_IO_APICS )
 
+#ifdef CONFIG_X86_IO_APIC
+# ifdef CONFIG_SPARSE_IRQ
+#  define NR_IRQS                                      \
+       (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ?      \
+               (NR_VECTORS + CPU_VECTOR_LIMIT)  :      \
+               (NR_VECTORS + IO_APIC_VECTOR_LIMIT))
+# else
+#  if NR_CPUS < MAX_IO_APICS
+#   define NR_IRQS                     (NR_VECTORS + 4*CPU_VECTOR_LIMIT)
+#  else
+#   define NR_IRQS                     (NR_VECTORS + IO_APIC_VECTOR_LIMIT)
+#  endif
+# endif
+#else /* !CONFIG_X86_IO_APIC: */
+# define NR_IRQS                       NR_IRQS_LEGACY
 #endif
 
-/* Voyager specific defines */
-/* These define the CPIs we use in linux */
-#define VIC_CPI_LEVEL0                 0
-#define VIC_CPI_LEVEL1                 1
-/* now the fake CPIs */
-#define VIC_TIMER_CPI                  2
-#define VIC_INVALIDATE_CPI             3
-#define VIC_RESCHEDULE_CPI             4
-#define VIC_ENABLE_IRQ_CPI             5
-#define VIC_CALL_FUNCTION_CPI          6
-#define VIC_CALL_FUNCTION_SINGLE_CPI   7
-
-/* Now the QIC CPIs:  Since we don't need the two initial levels,
- * these are 2 less than the VIC CPIs */
-#define QIC_CPI_OFFSET                 1
-#define QIC_TIMER_CPI                  (VIC_TIMER_CPI - QIC_CPI_OFFSET)
-#define QIC_INVALIDATE_CPI             (VIC_INVALIDATE_CPI - QIC_CPI_OFFSET)
-#define QIC_RESCHEDULE_CPI             (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET)
-#define QIC_ENABLE_IRQ_CPI             (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET)
-#define QIC_CALL_FUNCTION_CPI          (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET)
-#define QIC_CALL_FUNCTION_SINGLE_CPI   (VIC_CALL_FUNCTION_SINGLE_CPI - QIC_CPI_OFFSET)
-
-#define VIC_START_FAKE_CPI             VIC_TIMER_CPI
-#define VIC_END_FAKE_CPI               VIC_CALL_FUNCTION_SINGLE_CPI
-
-/* this is the SYS_INT CPI. */
-#define VIC_SYS_INT                    8
-#define VIC_CMN_INT                    15
-
-/* This is the boot CPI for alternate processors.  It gets overwritten
- * by the above once the system has activated all available processors */
-#define VIC_CPU_BOOT_CPI               VIC_CPI_LEVEL0
-#define VIC_CPU_BOOT_ERRATA_CPI                (VIC_CPI_LEVEL0 + 8)
-
-
 #endif /* _ASM_X86_IRQ_VECTORS_H */
index b95162a..d2e3bf3 100644 (file)
@@ -6,7 +6,7 @@
  *
  */
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/ioctl.h>
 
 /* Architectural interrupt line count. */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
deleted file mode 100644 (file)
index cc09cbb..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_APIC_H
-#define _ASM_X86_MACH_DEFAULT_MACH_APIC_H
-
-#ifdef CONFIG_X86_LOCAL_APIC
-
-#include <mach_apicdef.h>
-#include <asm/smp.h>
-
-#define APIC_DFR_VALUE (APIC_DFR_FLAT)
-
-static inline const struct cpumask *target_cpus(void)
-{ 
-#ifdef CONFIG_SMP
-       return cpu_online_mask;
-#else
-       return cpumask_of(0);
-#endif
-} 
-
-#define NO_BALANCE_IRQ (0)
-#define esr_disable (0)
-
-#ifdef CONFIG_X86_64
-#include <asm/genapic.h>
-#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
-#define INT_DEST_MODE (genapic->int_dest_mode)
-#define TARGET_CPUS      (genapic->target_cpus())
-#define apic_id_registered (genapic->apic_id_registered)
-#define init_apic_ldr (genapic->init_apic_ldr)
-#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
-#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
-#define phys_pkg_id    (genapic->phys_pkg_id)
-#define vector_allocation_domain    (genapic->vector_allocation_domain)
-#define read_apic_id()  (GET_APIC_ID(apic_read(APIC_ID)))
-#define send_IPI_self (genapic->send_IPI_self)
-#define wakeup_secondary_cpu (genapic->wakeup_cpu)
-extern void setup_apic_routing(void);
-#else
-#define INT_DELIVERY_MODE dest_LowestPrio
-#define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
-#define TARGET_CPUS (target_cpus())
-#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init
-/*
- * Set up the logical destination ID.
- *
- * Intel recommends to set DFR, LDR and TPR before enabling
- * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
- * document number 292116).  So here it goes...
- */
-static inline void init_apic_ldr(void)
-{
-       unsigned long val;
-
-       apic_write(APIC_DFR, APIC_DFR_VALUE);
-       val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
-       val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
-       apic_write(APIC_LDR, val);
-}
-
-static inline int apic_id_registered(void)
-{
-       return physid_isset(read_apic_id(), phys_cpu_present_map);
-}
-
-static inline unsigned int cpu_mask_to_apicid(const struct cpumask *cpumask)
-{
-       return cpumask_bits(cpumask)[0];
-}
-
-static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                                 const struct cpumask *andmask)
-{
-       unsigned long mask1 = cpumask_bits(cpumask)[0];
-       unsigned long mask2 = cpumask_bits(andmask)[0];
-       unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
-
-       return (unsigned int)(mask1 & mask2 & mask3);
-}
-
-static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
-{
-       return cpuid_apic >> index_msb;
-}
-
-static inline void setup_apic_routing(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-       printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
-                                       "Flat", nr_ioapics);
-#endif
-}
-
-static inline int apicid_to_node(int logical_apicid)
-{
-#ifdef CONFIG_SMP
-       return apicid_2_node[hard_smp_processor_id()];
-#else
-       return 0;
-#endif
-}
-
-static inline void vector_allocation_domain(int cpu, struct cpumask *retmask)
-{
-        /* Careful. Some cpus do not strictly honor the set of cpus
-         * specified in the interrupt destination when using lowest
-         * priority interrupt delivery mode.
-         *
-         * In particular there was a hyperthreading cpu observed to
-         * deliver interrupts to the wrong hyperthread when only one
-         * hyperthread was specified in the interrupt desitination.
-         */
-       *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
-}
-#endif
-
-static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
-{
-       return physid_isset(apicid, bitmap);
-}
-
-static inline unsigned long check_apicid_present(int bit)
-{
-       return physid_isset(bit, phys_cpu_present_map);
-}
-
-static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
-{
-       return phys_map;
-}
-
-static inline int multi_timer_check(int apic, int irq)
-{
-       return 0;
-}
-
-/* Mapping from cpu number to logical apicid */
-static inline int cpu_to_logical_apicid(int cpu)
-{
-       return 1 << cpu;
-}
-
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
-               return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
-       else
-               return BAD_APICID;
-}
-
-static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
-{
-       return physid_mask_of_physid(phys_apicid);
-}
-
-static inline void setup_portio_remap(void)
-{
-}
-
-static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
-       return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
-}
-
-static inline void enable_apic_mode(void)
-{
-}
-#endif /* CONFIG_X86_LOCAL_APIC */
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
deleted file mode 100644 (file)
index 5317993..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H
-#define _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H
-
-#include <asm/apic.h>
-
-#ifdef CONFIG_X86_64
-#define        APIC_ID_MASK            (genapic->apic_id_mask)
-#define GET_APIC_ID(x)         (genapic->get_apic_id(x))
-#define        SET_APIC_ID(x)          (genapic->set_apic_id(x))
-#else
-#define                APIC_ID_MASK            (0xF<<24)
-static inline unsigned get_apic_id(unsigned long x) 
-{
-       unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
-       if (APIC_XAPIC(ver))
-               return (((x)>>24)&0xFF);
-       else
-               return (((x)>>24)&0xF);
-} 
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
deleted file mode 100644 (file)
index 191312d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H
-#define _ASM_X86_MACH_DEFAULT_MACH_IPI_H
-
-/* Avoid include hell */
-#define NMI_VECTOR 0x02
-
-void send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-void __send_IPI_shortcut(unsigned int shortcut, int vector);
-
-extern int no_broadcast;
-
-#ifdef CONFIG_X86_64
-#include <asm/genapic.h>
-#define send_IPI_mask (genapic->send_IPI_mask)
-#define send_IPI_mask_allbutself (genapic->send_IPI_mask_allbutself)
-#else
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
-{
-       send_IPI_mask_bitmask(mask, vector);
-}
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-#endif
-
-static inline void __local_send_IPI_allbutself(int vector)
-{
-       if (no_broadcast || vector == NMI_VECTOR)
-               send_IPI_mask_allbutself(cpu_online_mask, vector);
-       else
-               __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
-}
-
-static inline void __local_send_IPI_all(int vector)
-{
-       if (no_broadcast || vector == NMI_VECTOR)
-               send_IPI_mask(cpu_online_mask, vector);
-       else
-               __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
-}
-
-#ifdef CONFIG_X86_64
-#define send_IPI_allbutself (genapic->send_IPI_allbutself)
-#define send_IPI_all (genapic->send_IPI_all)
-#else
-static inline void send_IPI_allbutself(int vector)
-{
-       /*
-        * if there are no other CPUs in the system then we get an APIC send 
-        * error if we try to broadcast, thus avoid sending IPIs in this case.
-        */
-       if (!(num_online_cpus() > 1))
-               return;
-
-       __local_send_IPI_allbutself(vector);
-       return;
-}
-
-static inline void send_IPI_all(int vector)
-{
-       __local_send_IPI_all(vector);
-}
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h
deleted file mode 100644 (file)
index c70a263..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
-#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
-
-static inline int
-mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
-{
-       return 0;
-}
-
-/* Hook from generic ACPI tables.c */
-static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
-       return 0;
-}
-
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mach-default/mach_mpspec.h b/arch/x86/include/asm/mach-default/mach_mpspec.h
deleted file mode 100644 (file)
index e85ede6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H
-#define _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H
-
-#define MAX_IRQ_SOURCES 256
-
-#if CONFIG_BASE_SMALL == 0
-#define MAX_MP_BUSSES 256
-#else
-#define MAX_MP_BUSSES 32
-#endif
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
deleted file mode 100644 (file)
index 89897a6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H
-#define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H
-
-#define TRAMPOLINE_PHYS_LOW (0x467)
-#define TRAMPOLINE_PHYS_HIGH (0x469)
-
-static inline void wait_for_init_deassert(atomic_t *deassert)
-{
-       while (!atomic_read(deassert))
-               cpu_relax();
-       return;
-}
-
-/* Nothing to do for most platforms, since cleared by the INIT cycle */
-static inline void smp_callin_clear_local_apic(void)
-{
-}
-
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-#ifdef CONFIG_SMP
-extern void __inquire_remote_apic(int apicid);
-#else /* CONFIG_SMP */
-static inline void __inquire_remote_apic(int apicid)
-{
-}
-#endif /* CONFIG_SMP */
-
-static inline void inquire_remote_apic(int apicid)
-{
-       if (apic_verbosity >= APIC_DEBUG)
-               __inquire_remote_apic(apicid);
-}
-
-#endif /* _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H */
diff --git a/arch/x86/include/asm/mach-generic/gpio.h b/arch/x86/include/asm/mach-generic/gpio.h
deleted file mode 100644 (file)
index 995c45e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_GPIO_H
-#define _ASM_X86_MACH_GENERIC_GPIO_H
-
-int gpio_request(unsigned gpio, const char *label);
-void gpio_free(unsigned gpio);
-int gpio_direction_input(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
-void gpio_set_value(unsigned gpio, int value);
-int gpio_to_irq(unsigned gpio);
-int irq_to_gpio(unsigned irq);
-
-#include <asm-generic/gpio.h>           /* cansleep wrappers */
-
-#endif /* _ASM_X86_MACH_GENERIC_GPIO_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
deleted file mode 100644 (file)
index 48553e9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_APIC_H
-#define _ASM_X86_MACH_GENERIC_MACH_APIC_H
-
-#include <asm/genapic.h>
-
-#define esr_disable (genapic->ESR_DISABLE)
-#define NO_BALANCE_IRQ (genapic->no_balance_irq)
-#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
-#define INT_DEST_MODE (genapic->int_dest_mode)
-#undef APIC_DEST_LOGICAL
-#define APIC_DEST_LOGICAL (genapic->apic_destination_logical)
-#define TARGET_CPUS      (genapic->target_cpus())
-#define apic_id_registered (genapic->apic_id_registered)
-#define init_apic_ldr (genapic->init_apic_ldr)
-#define ioapic_phys_id_map (genapic->ioapic_phys_id_map)
-#define setup_apic_routing (genapic->setup_apic_routing)
-#define multi_timer_check (genapic->multi_timer_check)
-#define apicid_to_node (genapic->apicid_to_node)
-#define cpu_to_logical_apicid (genapic->cpu_to_logical_apicid) 
-#define cpu_present_to_apicid (genapic->cpu_present_to_apicid)
-#define apicid_to_cpu_present (genapic->apicid_to_cpu_present)
-#define setup_portio_remap (genapic->setup_portio_remap)
-#define check_apicid_present (genapic->check_apicid_present)
-#define check_phys_apicid_present (genapic->check_phys_apicid_present)
-#define check_apicid_used (genapic->check_apicid_used)
-#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
-#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
-#define vector_allocation_domain (genapic->vector_allocation_domain)
-#define enable_apic_mode (genapic->enable_apic_mode)
-#define phys_pkg_id (genapic->phys_pkg_id)
-#define wakeup_secondary_cpu (genapic->wakeup_cpu)
-
-extern void generic_bigsmp_probe(void);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h
deleted file mode 100644 (file)
index 68041f3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_APICDEF_H
-#define _ASM_X86_MACH_GENERIC_MACH_APICDEF_H
-
-#ifndef APIC_DEFINITION
-#include <asm/genapic.h>
-
-#define GET_APIC_ID (genapic->get_apic_id)
-#define APIC_ID_MASK (genapic->apic_id_mask)
-#endif
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APICDEF_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
deleted file mode 100644 (file)
index ffd637e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_IPI_H
-#define _ASM_X86_MACH_GENERIC_MACH_IPI_H
-
-#include <asm/genapic.h>
-
-#define send_IPI_mask (genapic->send_IPI_mask)
-#define send_IPI_allbutself (genapic->send_IPI_allbutself)
-#define send_IPI_all (genapic->send_IPI_all)
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h
deleted file mode 100644 (file)
index 9444ab8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
-#define _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
-
-
-extern int mps_oem_check(struct mpc_table *, char *, char *);
-
-extern int acpi_madt_oem_check(char *, char *);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpspec.h b/arch/x86/include/asm/mach-generic/mach_mpspec.h
deleted file mode 100644 (file)
index 3bc4072..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H
-#define _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H
-
-#define MAX_IRQ_SOURCES 256
-
-/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
-/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
-#define MAX_MP_BUSSES 260
-
-extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
deleted file mode 100644 (file)
index 1ab16b1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
-#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
-
-#define TRAMPOLINE_PHYS_LOW (genapic->trampoline_phys_low)
-#define TRAMPOLINE_PHYS_HIGH (genapic->trampoline_phys_high)
-#define wait_for_init_deassert (genapic->wait_for_init_deassert)
-#define smp_callin_clear_local_apic (genapic->smp_callin_clear_local_apic)
-#define store_NMI_vector (genapic->store_NMI_vector)
-#define restore_NMI_vector (genapic->restore_NMI_vector)
-#define inquire_remote_apic (genapic->inquire_remote_apic)
-
-#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-rdc321x/gpio.h b/arch/x86/include/asm/mach-rdc321x/gpio.h
deleted file mode 100644 (file)
index c210ab5..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef _ASM_X86_MACH_RDC321X_GPIO_H
-#define _ASM_X86_MACH_RDC321X_GPIO_H
-
-#include <linux/kernel.h>
-
-extern int rdc_gpio_get_value(unsigned gpio);
-extern void rdc_gpio_set_value(unsigned gpio, int value);
-extern int rdc_gpio_direction_input(unsigned gpio);
-extern int rdc_gpio_direction_output(unsigned gpio, int value);
-extern int rdc_gpio_request(unsigned gpio, const char *label);
-extern void rdc_gpio_free(unsigned gpio);
-extern void __init rdc321x_gpio_setup(void);
-
-/* Wrappers for the arch-neutral GPIO API */
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return rdc_gpio_request(gpio, label);
-}
-
-static inline void gpio_free(unsigned gpio)
-{
-       might_sleep();
-       rdc_gpio_free(gpio);
-}
-
-static inline int gpio_direction_input(unsigned gpio)
-{
-       return rdc_gpio_direction_input(gpio);
-}
-
-static inline int gpio_direction_output(unsigned gpio, int value)
-{
-       return rdc_gpio_direction_output(gpio, value);
-}
-
-static inline int gpio_get_value(unsigned gpio)
-{
-       return rdc_gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
-       rdc_gpio_set_value(gpio, value);
-}
-
-static inline int gpio_to_irq(unsigned gpio)
-{
-       return gpio;
-}
-
-static inline int irq_to_gpio(unsigned irq)
-{
-       return irq;
-}
-
-/* For cansleep */
-#include <asm-generic/gpio.h>
-
-#endif /* _ASM_X86_MACH_RDC321X_GPIO_H */
index 1d6e17c..32c6e17 100644 (file)
@@ -3,8 +3,8 @@
 
 #ifdef __x86_64__
 
+#include <linux/types.h>
 #include <asm/ioctls.h>
-#include <asm/types.h>
 
 /*
  * Machine Check support for x86
@@ -115,8 +115,6 @@ extern int mce_notify_user(void);
 
 #endif /* !CONFIG_X86_32 */
 
-
-
 #ifdef CONFIG_X86_MCE
 extern void mcheck_init(struct cpuinfo_x86 *c);
 #else
@@ -126,5 +124,4 @@ extern void stop_mce(void);
 extern void restart_mce(void);
 
 #endif /* __KERNEL__ */
-
 #endif /* _ASM_X86_MCE_H */
index 62d14ce..8c56201 100644 (file)
@@ -9,7 +9,18 @@ extern int apic_version[MAX_APICS];
 extern int pic_mode;
 
 #ifdef CONFIG_X86_32
-#include <mach_mpspec.h>
+
+/*
+ * Summit or generic (i.e. installer) kernels need lots of bus entries.
+ * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
+ */
+#if CONFIG_BASE_SMALL == 0
+# define MAX_MP_BUSSES         260
+#else
+# define MAX_MP_BUSSES         32
+#endif
+
+#define MAX_IRQ_SOURCES                256
 
 extern unsigned int def_to_bigsmp;
 extern u8 apicid_2_node[];
@@ -20,15 +31,15 @@ extern int mp_bus_id_to_local[MAX_MP_BUSSES];
 extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
 #endif
 
-#define MAX_APICID 256
+#define MAX_APICID             256
 
-#else
+#else /* CONFIG_X86_64: */
 
-#define MAX_MP_BUSSES 256
+#define MAX_MP_BUSSES          256
 /* Each PCI slot may be a combo card with its own bus.  4 IRQ pins per slot. */
-#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4)
+#define MAX_IRQ_SOURCES                (MAX_MP_BUSSES * 4)
 
-#endif
+#endif /* CONFIG_X86_64 */
 
 extern void early_find_smp_config(void);
 extern void early_get_smp_config(void);
@@ -45,11 +56,13 @@ extern int smp_found_config;
 extern int mpc_default_type;
 extern unsigned long mp_lapic_addr;
 
-extern void find_smp_config(void);
 extern void get_smp_config(void);
+
 #ifdef CONFIG_X86_MPPARSE
+extern void find_smp_config(void);
 extern void early_reserve_e820_mpc_new(void);
 #else
+static inline void find_smp_config(void) { }
 static inline void early_reserve_e820_mpc_new(void) { }
 #endif
 
@@ -60,6 +73,7 @@ extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
                                   u32 gsi);
 extern void mp_config_acpi_legacy_irqs(void);
 extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low);
+extern int acpi_probe_gsi(void);
 #ifdef CONFIG_X86_IO_APIC
 extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
                                u32 gsi, int triggering, int polarity);
@@ -71,6 +85,11 @@ mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
        return 0;
 }
 #endif
+#else /* !CONFIG_ACPI: */
+static inline int acpi_probe_gsi(void)
+{
+       return 0;
+}
 #endif /* CONFIG_ACPI */
 
 #define PHYSID_ARRAY_SIZE      BITS_TO_LONGS(MAX_APICS)
@@ -142,4 +161,10 @@ static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map)
 
 extern physid_mask_t phys_cpu_present_map;
 
+extern int generic_mps_oem_check(struct mpc_table *, char *, char *);
+
+extern int default_acpi_madt_oem_check(char *, char *);
+
+extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
+
 #endif /* _ASM_X86_MPSPEC_H */
index 14080d2..a51ada8 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef _ASM_X86_MTRR_H
 #define _ASM_X86_MTRR_H
 
+#include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/errno.h>
 
index 1e8bd30..9f0a5f5 100644 (file)
@@ -31,6 +31,8 @@
 extern int found_numaq;
 extern int get_memcfg_numaq(void);
 
+extern void *xquad_portio;
+
 /*
  * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the
  */
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
deleted file mode 100644 (file)
index bf37bc4..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef __ASM_NUMAQ_APIC_H
-#define __ASM_NUMAQ_APIC_H
-
-#include <asm/io.h>
-#include <linux/mmzone.h>
-#include <linux/nodemask.h>
-
-#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
-
-static inline const cpumask_t *target_cpus(void)
-{
-       return &CPU_MASK_ALL;
-}
-
-#define NO_BALANCE_IRQ (1)
-#define esr_disable (1)
-
-#define INT_DELIVERY_MODE dest_LowestPrio
-#define INT_DEST_MODE 0     /* physical delivery on LOCAL quad */
-static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
-{
-       return physid_isset(apicid, bitmap);
-}
-static inline unsigned long check_apicid_present(int bit)
-{
-       return physid_isset(bit, phys_cpu_present_map);
-}
-#define apicid_cluster(apicid) (apicid & 0xF0)
-
-static inline int apic_id_registered(void)
-{
-       return 1;
-}
-
-static inline void init_apic_ldr(void)
-{
-       /* Already done in NUMA-Q firmware */
-}
-
-static inline void setup_apic_routing(void)
-{
-       printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
-               "NUMA-Q", nr_ioapics);
-}
-
-/*
- * Skip adding the timer int on secondary nodes, which causes
- * a small but painful rift in the time-space continuum.
- */
-static inline int multi_timer_check(int apic, int irq)
-{
-       return apic != 0 && irq == 0;
-}
-
-static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
-{
-       /* We don't have a good way to do this yet - hack */
-       return physids_promote(0xFUL);
-}
-
-/* Mapping from cpu number to logical apicid */
-extern u8 cpu_2_logical_apicid[];
-static inline int cpu_to_logical_apicid(int cpu)
-{
-       if (cpu >= nr_cpu_ids)
-               return BAD_APICID;
-       return (int)cpu_2_logical_apicid[cpu];
-}
-
-/*
- * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
- * cpu to APIC ID relation to properly interact with the intelligent
- * mode of the cluster controller.
- */
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (mps_cpu < 60)
-               return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
-       else
-               return BAD_APICID;
-}
-
-static inline int apicid_to_node(int logical_apicid) 
-{
-       return logical_apicid >> 4;
-}
-
-static inline physid_mask_t apicid_to_cpu_present(int logical_apicid)
-{
-       int node = apicid_to_node(logical_apicid);
-       int cpu = __ffs(logical_apicid & 0xf);
-
-       return physid_mask_of_physid(cpu + 4*node);
-}
-
-extern void *xquad_portio;
-
-static inline void setup_portio_remap(void)
-{
-       int num_quads = num_online_nodes();
-
-       if (num_quads <= 1)
-                       return;
-
-       printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
-       xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
-       printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
-               (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
-}
-
-static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
-       return (1);
-}
-
-static inline void enable_apic_mode(void)
-{
-}
-
-/*
- * We use physical apicids here, not logical, so just return the default
- * physical broadcast to stop people from breaking us
- */
-static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
-       return (int) 0xF;
-}
-
-static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                                 const struct cpumask *andmask)
-{
-       return (int) 0xF;
-}
-
-/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
-static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
-{
-       return cpuid_apic >> index_msb;
-}
-
-#endif /* __ASM_NUMAQ_APIC_H */
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
deleted file mode 100644 (file)
index e012a46..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ASM_NUMAQ_APICDEF_H
-#define __ASM_NUMAQ_APICDEF_H
-
-
-#define APIC_ID_MASK (0xF<<24)
-
-static inline unsigned get_apic_id(unsigned long x)
-{
-               return (((x)>>24)&0x0F);
-}
-
-#define         GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
deleted file mode 100644 (file)
index a8374c6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_NUMAQ_IPI_H
-#define __ASM_NUMAQ_IPI_H
-
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
-       send_IPI_mask_allbutself(cpu_online_mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(cpu_online_mask, vector);
-}
-
-#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/numaq/mpparse.h b/arch/x86/include/asm/numaq/mpparse.h
deleted file mode 100644 (file)
index a2eeefc..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_NUMAQ_MPPARSE_H
-#define __ASM_NUMAQ_MPPARSE_H
-
-extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
-
-#endif /* __ASM_NUMAQ_MPPARSE_H */
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
deleted file mode 100644 (file)
index 6f499df..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef __ASM_NUMAQ_WAKECPU_H
-#define __ASM_NUMAQ_WAKECPU_H
-
-/* This file copes with machines that wakeup secondary CPUs by NMIs */
-
-#define TRAMPOLINE_PHYS_LOW (0x8)
-#define TRAMPOLINE_PHYS_HIGH (0xa)
-
-/* We don't do anything here because we use NMI's to boot instead */
-static inline void wait_for_init_deassert(atomic_t *deassert)
-{
-}
-
-/*
- * Because we use NMIs rather than the INIT-STARTUP sequence to
- * bootstrap the CPUs, the APIC may be in a weird state. Kick it.
- */
-static inline void smp_callin_clear_local_apic(void)
-{
-       clear_local_APIC();
-}
-
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-       printk("Storing NMI vector\n");
-       *high =
-         *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH));
-       *low =
-         *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW));
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-       printk("Restoring NMI vector\n");
-       *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) =
-                                                                *high;
-       *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) =
-                                                                *low;
-}
-
-static inline void inquire_remote_apic(int apicid)
-{
-}
-
-#endif /* __ASM_NUMAQ_WAKECPU_H */
index c85e747..ff69173 100644 (file)
@@ -1471,8 +1471,6 @@ u64 _paravirt_ident_64(u64);
 
 #define paravirt_nop   ((void *)_paravirt_nop)
 
-void paravirt_use_bytelocks(void);
-
 #ifdef CONFIG_SMP
 
 static inline int __raw_spin_is_locked(struct raw_spinlock *lock)
index b8493b3..9709fdf 100644 (file)
@@ -5,10 +5,8 @@
 
 #ifdef CONFIG_X86_PAT
 extern int pat_enabled;
-extern void validate_pat_support(struct cpuinfo_x86 *c);
 #else
 static const int pat_enabled;
-static inline void validate_pat_support(struct cpuinfo_x86 *c) { }
 #endif
 
 extern void pat_init(void);
@@ -17,6 +15,4 @@ extern int reserve_memtype(u64 start, u64 end,
                unsigned long req_type, unsigned long *ret_type);
 extern int free_memtype(u64 start, u64 end);
 
-extern void pat_disable(char *reason);
-
 #endif /* _ASM_X86_PAT_H */
index 6ceaef0..6f7c102 100644 (file)
@@ -316,16 +316,30 @@ static inline pte_t pte_mkspecial(pte_t pte)
 
 extern pteval_t __supported_pte_mask;
 
+/*
+ * Mask out unsupported bits in a present pgprot.  Non-present pgprots
+ * can use those bits for other purposes, so leave them be.
+ */
+static inline pgprotval_t massage_pgprot(pgprot_t pgprot)
+{
+       pgprotval_t protval = pgprot_val(pgprot);
+
+       if (protval & _PAGE_PRESENT)
+               protval &= __supported_pte_mask;
+
+       return protval;
+}
+
 static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
 {
-       return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) |
-                     pgprot_val(pgprot)) & __supported_pte_mask);
+       return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) |
+                    massage_pgprot(pgprot));
 }
 
 static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
 {
-       return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) |
-                     pgprot_val(pgprot)) & __supported_pte_mask);
+       return __pmd(((phys_addr_t)page_nr << PAGE_SHIFT) |
+                    massage_pgprot(pgprot));
 }
 
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
@@ -337,7 +351,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
         * the newprot (if present):
         */
        val &= _PAGE_CHG_MASK;
-       val |= pgprot_val(newprot) & (~_PAGE_CHG_MASK) & __supported_pte_mask;
+       val |= massage_pgprot(newprot) & ~_PAGE_CHG_MASK;
 
        return __pte(val);
 }
@@ -353,7 +367,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
 
 #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK)
 
-#define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)
+#define canon_pgprot(p) __pgprot(massage_pgprot(p))
 
 static inline int is_new_memtype_allowed(unsigned long flags,
                                                unsigned long new_flags)
index a889464..3ac5032 100644 (file)
@@ -6,8 +6,4 @@
 #define ARCH_GET_FS 0x1003
 #define ARCH_GET_GS 0x1004
 
-#ifdef CONFIG_X86_64
-extern long sys_arch_prctl(int, unsigned long);
-#endif /* CONFIG_X86_64 */
-
 #endif /* _ASM_X86_PRCTL_H */
index 656d02e..d211f95 100644 (file)
@@ -73,7 +73,7 @@ struct cpuinfo_x86 {
        char                    pad0;
 #else
        /* Number of 4K pages in DTLB/ITLB combined(in pages): */
-       int                      x86_tlbsize;
+       int                     x86_tlbsize;
        __u8                    x86_virt_bits;
        __u8                    x86_phys_bits;
 #endif
index d6a22f9..49fb3ec 100644 (file)
@@ -18,11 +18,7 @@ extern void syscall32_cpu_init(void);
 
 extern void check_efer(void);
 
-#ifdef CONFIG_X86_BIOS_REBOOT
 extern int reboot_force;
-#else
-static const int reboot_force = 0;
-#endif
 
 long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
 
index 25f1bb8..8e0f8d1 100644 (file)
@@ -83,7 +83,7 @@
 #ifdef CONFIG_X86_PTRACE_BTS
 
 #ifndef __ASSEMBLY__
-#include <asm/types.h>
+#include <linux/types.h>
 
 /* configuration/status structure used in PTRACE_BTS_CONFIG and
    PTRACE_BTS_STATUS commands.
index 5369497..45b4027 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_SETUP_H
 #define _ASM_X86_SETUP_H
 
+#ifdef __KERNEL__
+
 #define COMMAND_LINE_SIZE 2048
 
 #ifndef __ASSEMBLY__
@@ -8,10 +10,8 @@
 /* Interrupt control for vSMPowered x86_64 systems */
 void vsmp_init(void);
 
-
 void setup_bios_corruption_check(void);
 
-
 #ifdef CONFIG_X86_VISWS
 extern void visws_early_detect(void);
 extern int is_visws_box(void);
@@ -43,7 +43,7 @@ struct x86_quirks {
        void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
        void (*mpc_oem_pci_bus)(struct mpc_bus *m);
        void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable,
-                                    unsigned short oemsize);
+                               unsigned short oemsize);
        int (*setup_ioapic_ids)(void);
        int (*update_genapic)(void);
 };
@@ -56,8 +56,6 @@ extern unsigned long saved_video_mode;
 #endif
 #endif /* __ASSEMBLY__ */
 
-#ifdef __KERNEL__
-
 #ifdef __i386__
 
 #include <linux/pfn.h>
index 0afcb5e..ec66649 100644 (file)
@@ -2,7 +2,7 @@
 #define _ASM_X86_SIGCONTEXT_H
 
 #include <linux/compiler.h>
-#include <asm/types.h>
+#include <linux/types.h>
 
 #define FP_XSTATE_MAGIC1       0x46505853U
 #define FP_XSTATE_MAGIC2       0x46505845U
index 6126188..ad1478c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_SIGCONTEXT32_H
 #define _ASM_X86_SIGCONTEXT32_H
 
+#include <linux/types.h>
+
 /* signal context for 32bit programs. */
 
 #define X86_FXSR_MAGIC         0x0000
index 45ef8a1..47d0e21 100644 (file)
@@ -182,28 +182,9 @@ static inline int logical_smp_processor_id(void)
        return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
 }
 
-#include <mach_apicdef.h>
-static inline unsigned int read_apic_id(void)
-{
-       unsigned int reg;
-
-       reg = *(u32 *)(APIC_BASE + APIC_ID);
-
-       return GET_APIC_ID(reg);
-}
 #endif
 
-
-# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
 extern int hard_smp_processor_id(void);
-# else
-#include <mach_apicdef.h>
-static inline int hard_smp_processor_id(void)
-{
-       /* we don't want to mark this access volatile - bad code generation */
-       return read_apic_id();
-}
-# endif /* APIC_DEFINITION */
 
 #else /* CONFIG_X86_LOCAL_APIC */
 
similarity index 83%
rename from arch/x86/include/asm/mach-default/smpboot_hooks.h
rename to arch/x86/include/asm/smpboot_hooks.h
index 23bf521..1def601 100644 (file)
@@ -13,10 +13,10 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
        CMOS_WRITE(0xa, 0xf);
        local_flush_tlb();
        pr_debug("1.\n");
-       *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) =
+       *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
                                                                 start_eip >> 4;
        pr_debug("2.\n");
-       *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) =
+       *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
                                                         start_eip & 0xf;
        pr_debug("3.\n");
 }
@@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_reset_vector(void)
         */
        CMOS_WRITE(0, 0xf);
 
-       *((volatile long *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0;
+       *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
 }
 
 static inline void __init smpboot_setup_io_apic(void)
index d17c919..139b424 100644 (file)
@@ -172,70 +172,8 @@ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
        return (((tmp >> TICKET_SHIFT) - tmp) & ((1 << TICKET_SHIFT) - 1)) > 1;
 }
 
-#ifdef CONFIG_PARAVIRT
-/*
- * Define virtualization-friendly old-style lock byte lock, for use in
- * pv_lock_ops if desired.
- *
- * This differs from the pre-2.6.24 spinlock by always using xchgb
- * rather than decb to take the lock; this allows it to use a
- * zero-initialized lock structure.  It also maintains a 1-byte
- * contention counter, so that we can implement
- * __byte_spin_is_contended.
- */
-struct __byte_spinlock {
-       s8 lock;
-       s8 spinners;
-};
-
-static inline int __byte_spin_is_locked(raw_spinlock_t *lock)
-{
-       struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
-       return bl->lock != 0;
-}
-
-static inline int __byte_spin_is_contended(raw_spinlock_t *lock)
-{
-       struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
-       return bl->spinners != 0;
-}
-
-static inline void __byte_spin_lock(raw_spinlock_t *lock)
-{
-       struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
-       s8 val = 1;
-
-       asm("1: xchgb %1, %0\n"
-           "   test %1,%1\n"
-           "   jz 3f\n"
-           "   " LOCK_PREFIX "incb %2\n"
-           "2: rep;nop\n"
-           "   cmpb $1, %0\n"
-           "   je 2b\n"
-           "   " LOCK_PREFIX "decb %2\n"
-           "   jmp 1b\n"
-           "3:"
-           : "+m" (bl->lock), "+q" (val), "+m" (bl->spinners): : "memory");
-}
-
-static inline int __byte_spin_trylock(raw_spinlock_t *lock)
-{
-       struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
-       u8 old = 1;
-
-       asm("xchgb %1,%0"
-           : "+m" (bl->lock), "+q" (old) : : "memory");
+#ifndef CONFIG_PARAVIRT
 
-       return old == 0;
-}
-
-static inline void __byte_spin_unlock(raw_spinlock_t *lock)
-{
-       struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
-       smp_wmb();
-       bl->lock = 0;
-}
-#else  /* !CONFIG_PARAVIRT */
 static inline int __raw_spin_is_locked(raw_spinlock_t *lock)
 {
        return __ticket_spin_is_locked(lock);
@@ -267,7 +205,7 @@ static __always_inline void __raw_spin_lock_flags(raw_spinlock_t *lock,
        __raw_spin_lock(lock);
 }
 
-#endif /* CONFIG_PARAVIRT */
+#endif
 
 static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock)
 {
@@ -329,8 +267,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *lock)
 {
        atomic_t *count = (atomic_t *)lock;
 
-       atomic_dec(count);
-       if (atomic_read(count) >= 0)
+       if (atomic_dec_return(count) >= 0)
                return 1;
        atomic_inc(count);
        return 0;
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
deleted file mode 100644 (file)
index 93d2c86..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-#ifndef __ASM_SUMMIT_APIC_H
-#define __ASM_SUMMIT_APIC_H
-
-#include <asm/smp.h>
-#include <linux/gfp.h>
-
-#define esr_disable (1)
-#define NO_BALANCE_IRQ (0)
-
-/* In clustered mode, the high nibble of APIC ID is a cluster number.
- * The low nibble is a 4-bit bitmap. */
-#define XAPIC_DEST_CPUS_SHIFT  4
-#define XAPIC_DEST_CPUS_MASK   ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
-#define XAPIC_DEST_CLUSTER_MASK        (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
-
-#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
-
-static inline const cpumask_t *target_cpus(void)
-{
-       /* CPU_MASK_ALL (0xff) has undefined behaviour with
-        * dest_LowestPrio mode logical clustered apic interrupt routing
-        * Just start on cpu 0.  IRQ balancing will spread load
-        */
-       return &cpumask_of_cpu(0);
-}
-
-#define INT_DELIVERY_MODE (dest_LowestPrio)
-#define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
-
-static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
-{
-       return 0;
-}
-
-/* we don't use the phys_cpu_present_map to indicate apicid presence */
-static inline unsigned long check_apicid_present(int bit)
-{
-       return 1;
-}
-
-#define apicid_cluster(apicid) ((apicid) & XAPIC_DEST_CLUSTER_MASK)
-
-extern u8 cpu_2_logical_apicid[];
-
-static inline void init_apic_ldr(void)
-{
-       unsigned long val, id;
-       int count = 0;
-       u8 my_id = (u8)hard_smp_processor_id();
-       u8 my_cluster = (u8)apicid_cluster(my_id);
-#ifdef CONFIG_SMP
-       u8 lid;
-       int i;
-
-       /* Create logical APIC IDs by counting CPUs already in cluster. */
-       for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
-               lid = cpu_2_logical_apicid[i];
-               if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
-                       ++count;
-       }
-#endif
-       /* We only have a 4 wide bitmap in cluster mode.  If a deranged
-        * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
-       BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
-       id = my_cluster | (1UL << count);
-       apic_write(APIC_DFR, APIC_DFR_VALUE);
-       val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
-       val |= SET_APIC_LOGICAL_ID(id);
-       apic_write(APIC_LDR, val);
-}
-
-static inline int multi_timer_check(int apic, int irq)
-{
-       return 0;
-}
-
-static inline int apic_id_registered(void)
-{
-       return 1;
-}
-
-static inline void setup_apic_routing(void)
-{
-       printk("Enabling APIC mode:  Summit.  Using %d I/O APICs\n",
-                                               nr_ioapics);
-}
-
-static inline int apicid_to_node(int logical_apicid)
-{
-#ifdef CONFIG_SMP
-       return apicid_2_node[hard_smp_processor_id()];
-#else
-       return 0;
-#endif
-}
-
-/* Mapping from cpu number to logical apicid */
-static inline int cpu_to_logical_apicid(int cpu)
-{
-#ifdef CONFIG_SMP
-       if (cpu >= nr_cpu_ids)
-               return BAD_APICID;
-       return (int)cpu_2_logical_apicid[cpu];
-#else
-       return logical_smp_processor_id();
-#endif
-}
-
-static inline int cpu_present_to_apicid(int mps_cpu)
-{
-       if (mps_cpu < nr_cpu_ids)
-               return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
-       else
-               return BAD_APICID;
-}
-
-static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_id_map)
-{
-       /* For clustered we don't have a good way to do this yet - hack */
-       return physids_promote(0x0F);
-}
-
-static inline physid_mask_t apicid_to_cpu_present(int apicid)
-{
-       return physid_mask_of_physid(0);
-}
-
-static inline void setup_portio_remap(void)
-{
-}
-
-static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
-       return 1;
-}
-
-static inline void enable_apic_mode(void)
-{
-}
-
-static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
-{
-       int num_bits_set;
-       int cpus_found = 0;
-       int cpu;
-       int apicid;
-
-       num_bits_set = cpus_weight(*cpumask);
-       /* Return id to all */
-       if (num_bits_set >= nr_cpu_ids)
-               return (int) 0xFF;
-       /*
-        * The cpus in the mask must all be on the apic cluster.  If are not
-        * on the same apicid cluster return default value of TARGET_CPUS.
-        */
-       cpu = first_cpu(*cpumask);
-       apicid = cpu_to_logical_apicid(cpu);
-       while (cpus_found < num_bits_set) {
-               if (cpu_isset(cpu, *cpumask)) {
-                       int new_apicid = cpu_to_logical_apicid(cpu);
-                       if (apicid_cluster(apicid) !=
-                                       apicid_cluster(new_apicid)){
-                               printk ("%s: Not a valid mask!\n", __func__);
-                               return 0xFF;
-                       }
-                       apicid = apicid | new_apicid;
-                       cpus_found++;
-               }
-               cpu++;
-       }
-       return apicid;
-}
-
-static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
-                                                 const struct cpumask *andmask)
-{
-       int apicid = cpu_to_logical_apicid(0);
-       cpumask_var_t cpumask;
-
-       if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
-               return apicid;
-
-       cpumask_and(cpumask, inmask, andmask);
-       cpumask_and(cpumask, cpumask, cpu_online_mask);
-       apicid = cpu_mask_to_apicid(cpumask);
-
-       free_cpumask_var(cpumask);
-       return apicid;
-}
-
-/* cpuid returns the value latched in the HW at reset, not the APIC ID
- * register's value.  For any box whose BIOS changes APIC IDs, like
- * clustered APIC systems, we must use hard_smp_processor_id.
- *
- * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
- */
-static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
-{
-       return hard_smp_processor_id() >> index_msb;
-}
-
-#endif /* __ASM_SUMMIT_APIC_H */
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
deleted file mode 100644 (file)
index f3fbca1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __ASM_SUMMIT_APICDEF_H
-#define __ASM_SUMMIT_APICDEF_H
-
-#define                APIC_ID_MASK            (0xFF<<24)
-
-static inline unsigned get_apic_id(unsigned long x)
-{
-       return (x>>24)&0xFF;
-}
-
-#define                GET_APIC_ID(x)  get_apic_id(x)
-
-#endif
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
deleted file mode 100644 (file)
index a8a2c24..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __ASM_SUMMIT_IPI_H
-#define __ASM_SUMMIT_IPI_H
-
-void send_IPI_mask_sequence(const cpumask_t *mask, int vector);
-void send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
-
-static inline void send_IPI_mask(const cpumask_t *mask, int vector)
-{
-       send_IPI_mask_sequence(mask, vector);
-}
-
-static inline void send_IPI_allbutself(int vector)
-{
-       cpumask_t mask = cpu_online_map;
-       cpu_clear(smp_processor_id(), mask);
-
-       if (!cpus_empty(mask))
-               send_IPI_mask(&mask, vector);
-}
-
-static inline void send_IPI_all(int vector)
-{
-       send_IPI_mask(&cpu_online_map, vector);
-}
-
-#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h
deleted file mode 100644 (file)
index 380e86c..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef __ASM_SUMMIT_MPPARSE_H
-#define __ASM_SUMMIT_MPPARSE_H
-
-#include <asm/tsc.h>
-
-extern int use_cyclone;
-
-#ifdef CONFIG_X86_SUMMIT_NUMA
-extern void setup_summit(void);
-#else
-#define setup_summit() {}
-#endif
-
-static inline int mps_oem_check(struct mpc_table *mpc, char *oem,
-               char *productid)
-{
-       if (!strncmp(oem, "IBM ENSW", 8) &&
-                       (!strncmp(productid, "VIGIL SMP", 9)
-                        || !strncmp(productid, "EXA", 3)
-                        || !strncmp(productid, "RUTHLESS SMP", 12))){
-               mark_tsc_unstable("Summit based system");
-               use_cyclone = 1; /*enable cyclone-timer*/
-               setup_summit();
-               return 1;
-       }
-       return 0;
-}
-
-/* Hook from generic ACPI tables.c */
-static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
-       if (!strncmp(oem_id, "IBM", 3) &&
-           (!strncmp(oem_table_id, "SERVIGIL", 8)
-            || !strncmp(oem_table_id, "EXA", 3))){
-               mark_tsc_unstable("Summit based system");
-               use_cyclone = 1; /*enable cyclone-timer*/
-               setup_summit();
-               return 1;
-       }
-       return 0;
-}
-
-struct rio_table_hdr {
-       unsigned char version;      /* Version number of this data structure           */
-                                   /* Version 3 adds chassis_num & WP_index           */
-       unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil)   */
-       unsigned char num_rio_dev;  /* # of RIO I/O devices (Cyclones and Winnipegs)   */
-} __attribute__((packed));
-
-struct scal_detail {
-       unsigned char node_id;      /* Scalability Node ID                             */
-       unsigned long CBAR;         /* Address of 1MB register space                   */
-       unsigned char port0node;    /* Node ID port connected to: 0xFF=None            */
-       unsigned char port0port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
-       unsigned char port1node;    /* Node ID port connected to: 0xFF = None          */
-       unsigned char port1port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
-       unsigned char port2node;    /* Node ID port connected to: 0xFF = None          */
-       unsigned char port2port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
-       unsigned char chassis_num;  /* 1 based Chassis number (1 = boot node)          */
-} __attribute__((packed));
-
-struct rio_detail {
-       unsigned char node_id;      /* RIO Node ID                                     */
-       unsigned long BBAR;         /* Address of 1MB register space                   */
-       unsigned char type;         /* Type of device                                  */
-       unsigned char owner_id;     /* For WPEG: Node ID of Cyclone that owns this WPEG*/
-                                   /* For CYC:  Node ID of Twister that owns this CYC */
-       unsigned char port0node;    /* Node ID port connected to: 0xFF=None            */
-       unsigned char port0port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
-       unsigned char port1node;    /* Node ID port connected to: 0xFF=None            */
-       unsigned char port1port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
-       unsigned char first_slot;   /* For WPEG: Lowest slot number below this WPEG    */
-                                   /* For CYC:  0                                     */
-       unsigned char status;       /* For WPEG: Bit 0 = 1 : the XAPIC is used         */
-                                   /*                 = 0 : the XAPIC is not used, ie:*/
-                                   /*                     ints fwded to another XAPIC */
-                                   /*           Bits1:7 Reserved                      */
-                                   /* For CYC:  Bits0:7 Reserved                      */
-       unsigned char WP_index;     /* For WPEG: WPEG instance index - lower ones have */
-                                   /*           lower slot numbers/PCI bus numbers    */
-                                   /* For CYC:  No meaning                            */
-       unsigned char chassis_num;  /* 1 based Chassis number                          */
-                                   /* For LookOut WPEGs this field indicates the      */
-                                   /* Expansion Chassis #, enumerated from Boot       */
-                                   /* Node WPEG external port, then Boot Node CYC     */
-                                   /* external port, then Next Vigil chassis WPEG     */
-                                   /* external port, etc.                             */
-                                   /* Shared Lookouts have only 1 chassis number (the */
-                                   /* first one assigned)                             */
-} __attribute__((packed));
-
-
-typedef enum {
-       CompatTwister = 0,  /* Compatibility Twister               */
-       AltTwister    = 1,  /* Alternate Twister of internal 8-way */
-       CompatCyclone = 2,  /* Compatibility Cyclone               */
-       AltCyclone    = 3,  /* Alternate Cyclone of internal 8-way */
-       CompatWPEG    = 4,  /* Compatibility WPEG                  */
-       AltWPEG       = 5,  /* Second Planar WPEG                  */
-       LookOutAWPEG  = 6,  /* LookOut WPEG                        */
-       LookOutBWPEG  = 7,  /* LookOut WPEG                        */
-} node_type;
-
-static inline int is_WPEG(struct rio_detail *rio){
-       return (rio->type == CompatWPEG || rio->type == AltWPEG ||
-               rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
-}
-
-#endif /* __ASM_SUMMIT_MPPARSE_H */
index 306d417..557cd9f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _ASM_X86_SWAB_H
 #define _ASM_X86_SWAB_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/compiler.h>
 
 static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
index 2fcc70b..c223837 100644 (file)
@@ -111,16 +111,16 @@ do {                                                                      \
             "movq "__percpu_arg([current_task])",%%rsi\n\t"              \
             __switch_canary                                              \
             "movq %P[thread_info](%%rsi),%%r8\n\t"                       \
-            LOCK_PREFIX "btr  %[tif_fork],%P[ti_flags](%%r8)\n\t"        \
             "movq %%rax,%%rdi\n\t"                                       \
-            "jc   ret_from_fork\n\t"                                     \
+            "testl  %[_tif_fork],%P[ti_flags](%%r8)\n\t"         \
+            "jnz   ret_from_fork\n\t"                                    \
             RESTORE_CONTEXT                                              \
             : "=a" (last)                                                \
               __switch_canary_oparam                                     \
             : [next] "S" (next), [prev] "D" (prev),                      \
               [threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \
               [ti_flags] "i" (offsetof(struct thread_info, flags)),      \
-              [tif_fork] "i" (TIF_FORK),                                 \
+              [_tif_fork] "i" (_TIF_FORK),                               \
               [thread_info] "i" (offsetof(struct task_struct, stack)),   \
               [current_task] "m" (per_cpu_var(current_task))             \
               __switch_canary_iparam                                     \
index b46f8ca..df9d5f7 100644 (file)
@@ -40,6 +40,7 @@ struct thread_info {
                                                */
        __u8                    supervisor_stack[0];
 #endif
+       int                     uaccess_err;
 };
 
 #define INIT_THREAD_INFO(tsk)                  \
index 4340055..0ec6de4 100644 (file)
@@ -121,7 +121,7 @@ extern int __get_user_bad(void);
 
 #define __get_user_x(size, ret, x, ptr)                      \
        asm volatile("call __get_user_" #size         \
-                    : "=a" (ret),"=d" (x)            \
+                    : "=a" (ret), "=d" (x)           \
                     : "0" (ptr))                     \
 
 /* Careful: we have to cast the result to the type of the pointer
@@ -181,12 +181,12 @@ extern int __get_user_bad(void);
 
 #define __put_user_x(size, x, ptr, __ret_pu)                   \
        asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
-                    :"0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
+                    : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
 
 
 
 #ifdef CONFIG_X86_32
-#define __put_user_u64(x, addr, err)                                   \
+#define __put_user_asm_u64(x, addr, err)                               \
        asm volatile("1:        movl %%eax,0(%2)\n"                     \
                     "2:        movl %%edx,4(%2)\n"                     \
                     "3:\n"                                             \
@@ -199,12 +199,22 @@ extern int __get_user_bad(void);
                     : "=r" (err)                                       \
                     : "A" (x), "r" (addr), "i" (-EFAULT), "0" (err))
 
+#define __put_user_asm_ex_u64(x, addr)                                 \
+       asm volatile("1:        movl %%eax,0(%1)\n"                     \
+                    "2:        movl %%edx,4(%1)\n"                     \
+                    "3:\n"                                             \
+                    _ASM_EXTABLE(1b, 2b - 1b)                          \
+                    _ASM_EXTABLE(2b, 3b - 2b)                          \
+                    : : "A" (x), "r" (addr))
+
 #define __put_user_x8(x, ptr, __ret_pu)                                \
        asm volatile("call __put_user_8" : "=a" (__ret_pu)      \
                     : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
 #else
-#define __put_user_u64(x, ptr, retval) \
+#define __put_user_asm_u64(x, ptr, retval) \
        __put_user_asm(x, ptr, retval, "q", "", "Zr", -EFAULT)
+#define __put_user_asm_ex_u64(x, addr) \
+       __put_user_asm_ex(x, addr, "q", "", "Zr")
 #define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu)
 #endif
 
@@ -276,10 +286,31 @@ do {                                                                      \
                __put_user_asm(x, ptr, retval, "w", "w", "ir", errret); \
                break;                                                  \
        case 4:                                                         \
-               __put_user_asm(x, ptr, retval, "l", "k",  "ir", errret);\
+               __put_user_asm(x, ptr, retval, "l", "k", "ir", errret); \
                break;                                                  \
        case 8:                                                         \
-               __put_user_u64((__typeof__(*ptr))(x), ptr, retval);     \
+               __put_user_asm_u64((__typeof__(*ptr))(x), ptr, retval); \
+               break;                                                  \
+       default:                                                        \
+               __put_user_bad();                                       \
+       }                                                               \
+} while (0)
+
+#define __put_user_size_ex(x, ptr, size)                               \
+do {                                                                   \
+       __chk_user_ptr(ptr);                                            \
+       switch (size) {                                                 \
+       case 1:                                                         \
+               __put_user_asm_ex(x, ptr, "b", "b", "iq");              \
+               break;                                                  \
+       case 2:                                                         \
+               __put_user_asm_ex(x, ptr, "w", "w", "ir");              \
+               break;                                                  \
+       case 4:                                                         \
+               __put_user_asm_ex(x, ptr, "l", "k", "ir");              \
+               break;                                                  \
+       case 8:                                                         \
+               __put_user_asm_ex_u64((__typeof__(*ptr))(x), ptr);      \
                break;                                                  \
        default:                                                        \
                __put_user_bad();                                       \
@@ -311,9 +342,12 @@ do {                                                                       \
 
 #ifdef CONFIG_X86_32
 #define __get_user_asm_u64(x, ptr, retval, errret)     (x) = __get_user_bad()
+#define __get_user_asm_ex_u64(x, ptr)                  (x) = __get_user_bad()
 #else
 #define __get_user_asm_u64(x, ptr, retval, errret) \
         __get_user_asm(x, ptr, retval, "q", "", "=r", errret)
+#define __get_user_asm_ex_u64(x, ptr) \
+        __get_user_asm_ex(x, ptr, "q", "", "=r")
 #endif
 
 #define __get_user_size(x, ptr, size, retval, errret)                  \
@@ -350,6 +384,33 @@ do {                                                                       \
                     : "=r" (err), ltype(x)                             \
                     : "m" (__m(addr)), "i" (errret), "0" (err))
 
+#define __get_user_size_ex(x, ptr, size)                               \
+do {                                                                   \
+       __chk_user_ptr(ptr);                                            \
+       switch (size) {                                                 \
+       case 1:                                                         \
+               __get_user_asm_ex(x, ptr, "b", "b", "=q");              \
+               break;                                                  \
+       case 2:                                                         \
+               __get_user_asm_ex(x, ptr, "w", "w", "=r");              \
+               break;                                                  \
+       case 4:                                                         \
+               __get_user_asm_ex(x, ptr, "l", "k", "=r");              \
+               break;                                                  \
+       case 8:                                                         \
+               __get_user_asm_ex_u64(x, ptr);                          \
+               break;                                                  \
+       default:                                                        \
+               (x) = __get_user_bad();                                 \
+       }                                                               \
+} while (0)
+
+#define __get_user_asm_ex(x, addr, itype, rtype, ltype)                        \
+       asm volatile("1:        mov"itype" %1,%"rtype"0\n"              \
+                    "2:\n"                                             \
+                    _ASM_EXTABLE(1b, 2b - 1b)                          \
+                    : ltype(x) : "m" (__m(addr)))
+
 #define __put_user_nocheck(x, ptr, size)                       \
 ({                                                             \
        int __pu_err;                                           \
@@ -385,6 +446,26 @@ struct __large_struct { unsigned long buf[100]; };
                     _ASM_EXTABLE(1b, 3b)                               \
                     : "=r"(err)                                        \
                     : ltype(x), "m" (__m(addr)), "i" (errret), "0" (err))
+
+#define __put_user_asm_ex(x, addr, itype, rtype, ltype)                        \
+       asm volatile("1:        mov"itype" %"rtype"0,%1\n"              \
+                    "2:\n"                                             \
+                    _ASM_EXTABLE(1b, 2b - 1b)                          \
+                    : : ltype(x), "m" (__m(addr)))
+
+/*
+ * uaccess_try and catch
+ */
+#define uaccess_try    do {                                            \
+       int prev_err = current_thread_info()->uaccess_err;              \
+       current_thread_info()->uaccess_err = 0;                         \
+       barrier();
+
+#define uaccess_catch(err)                                             \
+       (err) |= current_thread_info()->uaccess_err;                    \
+       current_thread_info()->uaccess_err = prev_err;                  \
+} while (0)
+
 /**
  * __get_user: - Get a simple variable from user space, with less checking.
  * @x:   Variable to store result.
@@ -408,6 +489,7 @@ struct __large_struct { unsigned long buf[100]; };
 
 #define __get_user(x, ptr)                                             \
        __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
+
 /**
  * __put_user: - Write a simple value into user space, with less checking.
  * @x:   Value to copy to user space.
@@ -435,6 +517,27 @@ struct __large_struct { unsigned long buf[100]; };
 #define __put_user_unaligned __put_user
 
 /*
+ * {get|put}_user_try and catch
+ *
+ * get_user_try {
+ *     get_user_ex(...);
+ * } get_user_catch(err)
+ */
+#define get_user_try           uaccess_try
+#define get_user_catch(err)    uaccess_catch(err)
+#define put_user_try           uaccess_try
+#define put_user_catch(err)    uaccess_catch(err)
+
+#define get_user_ex(x, ptr)    do {                                    \
+       unsigned long __gue_val;                                        \
+       __get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr))));       \
+       (x) = (__force __typeof__(*(ptr)))__gue_val;                    \
+} while (0)
+
+#define put_user_ex(x, ptr)                                            \
+       __put_user_size_ex((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
+
+/*
  * movsl can be slow when source and dest are not both 8-byte aligned
  */
 #ifdef CONFIG_X86_INTEL_USERCOPY
index b3e6473..c1635d4 100644 (file)
@@ -527,3 +527,45 @@ extern void voyager_smp_intr_init(void);
 #define VOYAGER_PSI_SUBREAD    2
 #define VOYAGER_PSI_SUBWRITE   3
 extern void voyager_cat_psi(__u8, __u16, __u8 *);
+
+/* These define the CPIs we use in linux */
+#define VIC_CPI_LEVEL0                 0
+#define VIC_CPI_LEVEL1                 1
+/* now the fake CPIs */
+#define VIC_TIMER_CPI                  2
+#define VIC_INVALIDATE_CPI             3
+#define VIC_RESCHEDULE_CPI             4
+#define VIC_ENABLE_IRQ_CPI             5
+#define VIC_CALL_FUNCTION_CPI          6
+#define VIC_CALL_FUNCTION_SINGLE_CPI   7
+
+/* Now the QIC CPIs:  Since we don't need the two initial levels,
+ * these are 2 less than the VIC CPIs */
+#define QIC_CPI_OFFSET                 1
+#define QIC_TIMER_CPI                  (VIC_TIMER_CPI - QIC_CPI_OFFSET)
+#define QIC_INVALIDATE_CPI             (VIC_INVALIDATE_CPI - QIC_CPI_OFFSET)
+#define QIC_RESCHEDULE_CPI             (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET)
+#define QIC_ENABLE_IRQ_CPI             (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET)
+#define QIC_CALL_FUNCTION_CPI          (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET)
+#define QIC_CALL_FUNCTION_SINGLE_CPI   (VIC_CALL_FUNCTION_SINGLE_CPI - QIC_CPI_OFFSET)
+
+#define VIC_START_FAKE_CPI             VIC_TIMER_CPI
+#define VIC_END_FAKE_CPI               VIC_CALL_FUNCTION_SINGLE_CPI
+
+/* this is the SYS_INT CPI. */
+#define VIC_SYS_INT                    8
+#define VIC_CMN_INT                    15
+
+/* This is the boot CPI for alternate processors.  It gets overwritten
+ * by the above once the system has activated all available processors */
+#define VIC_CPU_BOOT_CPI               VIC_CPI_LEVEL0
+#define VIC_CPU_BOOT_ERRATA_CPI                (VIC_CPI_LEVEL0 + 8)
+
+extern asmlinkage void vic_cpi_interrupt(void);
+extern asmlinkage void vic_sys_interrupt(void);
+extern asmlinkage void vic_cmn_interrupt(void);
+extern asmlinkage void qic_timer_interrupt(void);
+extern asmlinkage void qic_invalidate_interrupt(void);
+extern asmlinkage void qic_reschedule_interrupt(void);
+extern asmlinkage void qic_enable_irq_interrupt(void);
+extern asmlinkage void qic_call_function_interrupt(void);
index 7ef617e..4bd990e 100644 (file)
@@ -137,7 +137,7 @@ static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot)
        pte_t pte;
 
        pte.pte = ((phys_addr_t)page_nr << PAGE_SHIFT) |
-               (pgprot_val(pgprot) & __supported_pte_mask);
+                       massage_pgprot(pgprot);
 
        return pte;
 }
index 37fa30b..24f357e 100644 (file)
@@ -30,7 +30,7 @@ obj-y                 += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y                  += time_$(BITS).o ioport.o ldt.o dumpstack.o
 obj-y                  += setup.o i8259.o irqinit_$(BITS).o
 obj-$(CONFIG_X86_VISWS)        += visws_quirks.o
-obj-$(CONFIG_X86_32)   += probe_roms_32.o
+obj-$(CONFIG_X86_32)   += probe_32.o probe_roms_32.o
 obj-$(CONFIG_X86_32)   += sys_i386_32.o i386_ksyms_32.o
 obj-$(CONFIG_X86_64)   += sys_x86_64.o x8664_ksyms_64.o
 obj-$(CONFIG_X86_64)   += syscall_64.o vsyscall_64.o
@@ -50,20 +50,20 @@ obj-y                               += step.o
 obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 obj-y                          += cpu/
 obj-y                          += acpi/
-obj-$(CONFIG_X86_BIOS_REBOOT)  += reboot.o
+obj-y                          += reboot.o
 obj-$(CONFIG_MCA)              += mca_32.o
 obj-$(CONFIG_X86_MSR)          += msr.o
 obj-$(CONFIG_X86_CPUID)                += cpuid.o
 obj-$(CONFIG_PCI)              += early-quirks.o
 apm-y                          := apm_32.o
 obj-$(CONFIG_APM)              += apm.o
-obj-$(CONFIG_X86_SMP)          += smp.o
-obj-$(CONFIG_X86_SMP)          += smpboot.o tsc_sync.o ipi.o
+obj-$(CONFIG_SMP)              += smp.o
+obj-$(CONFIG_SMP)              += smpboot.o tsc_sync.o ipi.o
 obj-$(CONFIG_SMP)              += setup_percpu.o
 obj-$(CONFIG_X86_64_SMP)       += tsc_sync.o
 obj-$(CONFIG_X86_TRAMPOLINE)   += trampoline_$(BITS).o
 obj-$(CONFIG_X86_MPPARSE)      += mpparse.o
-obj-$(CONFIG_X86_LOCAL_APIC)   += apic.o nmi.o
+obj-$(CONFIG_X86_LOCAL_APIC)   += apic.o nmi.o ipi.o
 obj-$(CONFIG_X86_IO_APIC)      += io_apic.o
 obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
 obj-$(CONFIG_DYNAMIC_FTRACE)   += ftrace.o
@@ -71,9 +71,10 @@ obj-$(CONFIG_FUNCTION_GRAPH_TRACER)  += ftrace.o
 obj-$(CONFIG_KEXEC)            += machine_kexec_$(BITS).o
 obj-$(CONFIG_KEXEC)            += relocate_kernel_$(BITS).o crash.o
 obj-$(CONFIG_CRASH_DUMP)       += crash_dump_$(BITS).o
+obj-$(CONFIG_X86_BIGSMP)       += bigsmp_32.o
 obj-$(CONFIG_X86_NUMAQ)                += numaq_32.o
 obj-$(CONFIG_X86_ES7000)       += es7000_32.o
-obj-$(CONFIG_X86_SUMMIT_NUMA)  += summit_32.o
+obj-$(CONFIG_X86_SUMMIT)       += summit_32.o
 obj-y                          += vsmp_64.o
 obj-$(CONFIG_KPROBES)          += kprobes.o
 obj-$(CONFIG_MODULES)          += module_$(BITS).o
index 4cb5964..c334fe7 100644 (file)
 #include <asm/mpspec.h>
 #include <asm/smp.h>
 
-#ifdef CONFIG_X86_LOCAL_APIC
-# include <mach_apic.h>
-#endif
-
 static int __initdata acpi_force = 0;
 u32 acpi_rsdt_forced;
 #ifdef CONFIG_ACPI
@@ -56,16 +52,7 @@ int acpi_disabled = 1;
 EXPORT_SYMBOL(acpi_disabled);
 
 #ifdef CONFIG_X86_64
-
-#include <asm/proto.h>
-
-#else                          /* X86 */
-
-#ifdef CONFIG_X86_LOCAL_APIC
-#include <mach_apic.h>
-#include <mach_mpparse.h>
-#endif                         /* CONFIG_X86_LOCAL_APIC */
-
+# include <asm/proto.h>
 #endif                         /* X86 */
 
 #define BAD_MADT_ENTRY(entry, end) (                                       \
@@ -239,7 +226,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
                       madt->address);
        }
 
-       acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
+       default_acpi_madt_oem_check(madt->header.oem_id,
+                                   madt->header.oem_table_id);
 
        return 0;
 }
@@ -973,6 +961,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
        nr_ioapics++;
 }
 
+int __init acpi_probe_gsi(void)
+{
+       int idx;
+       int gsi;
+       int max_gsi = 0;
+
+       if (acpi_disabled)
+               return 0;
+
+       if (!acpi_ioapic)
+               return 0;
+
+       max_gsi = 0;
+       for (idx = 0; idx < nr_ioapics; idx++) {
+               gsi = mp_ioapic_routing[idx].gsi_end;
+
+               if (gsi > max_gsi)
+                       max_gsi = gsi;
+       }
+
+       return max_gsi + 1;
+}
+
 static void assign_to_mp_irq(struct mpc_intsrc *m,
                                    struct mpc_intsrc *mp_irq)
 {
@@ -1347,7 +1358,7 @@ static void __init acpi_process_madt(void)
                if (!error) {
                        acpi_lapic = 1;
 
-#ifdef CONFIG_X86_GENERICARCH
+#ifdef CONFIG_X86_BIGSMP
                        generic_bigsmp_probe();
 #endif
                        /*
@@ -1359,9 +1370,8 @@ static void __init acpi_process_madt(void)
                                acpi_ioapic = 1;
 
                                smp_found_config = 1;
-#ifdef CONFIG_X86_32
-                               setup_apic_routing();
-#endif
+                               if (apic->setup_apic_routing)
+                                       apic->setup_apic_routing();
                        }
                }
                if (error == -EINVAL) {
index c6f1564..8bd801d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Local APIC handling, local APIC timers
  *
- *     (c) 1999, 2000 Ingo Molnar <mingo@redhat.com>
+ *     (c) 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
  *
  *     Fixes
  *     Maciej W. Rozycki       :       Bits for genuine 82489DX APICs;
  *     Mikael Pettersson       :       PM converted to driver model.
  */
 
-#include <linux/init.h>
-
-#include <linux/mm.h>
-#include <linux/delay.h>
-#include <linux/bootmem.h>
-#include <linux/interrupt.h>
-#include <linux/mc146818rtc.h>
 #include <linux/kernel_stat.h>
-#include <linux/sysdev.h>
-#include <linux/ioport.h>
-#include <linux/cpu.h>
-#include <linux/clockchips.h>
+#include <linux/mc146818rtc.h>
 #include <linux/acpi_pmtmr.h>
+#include <linux/clockchips.h>
+#include <linux/interrupt.h>
+#include <linux/bootmem.h>
+#include <linux/ftrace.h>
+#include <linux/ioport.h>
 #include <linux/module.h>
-#include <linux/dmi.h>
+#include <linux/sysdev.h>
+#include <linux/delay.h>
+#include <linux/timex.h>
 #include <linux/dmar.h>
-#include <linux/ftrace.h>
-#include <linux/smp.h>
+#include <linux/init.h>
+#include <linux/cpu.h>
+#include <linux/dmi.h>
 #include <linux/nmi.h>
-#include <linux/timex.h>
+#include <linux/smp.h>
+#include <linux/mm.h>
 
-#include <asm/atomic.h>
-#include <asm/mtrr.h>
-#include <asm/mpspec.h>
-#include <asm/desc.h>
 #include <asm/arch_hooks.h>
-#include <asm/hpet.h>
 #include <asm/pgalloc.h>
+#include <asm/genapic.h>
+#include <asm/atomic.h>
+#include <asm/mpspec.h>
 #include <asm/i8253.h>
-#include <asm/idle.h>
+#include <asm/i8259.h>
 #include <asm/proto.h>
 #include <asm/apic.h>
-#include <asm/i8259.h>
+#include <asm/desc.h>
+#include <asm/hpet.h>
+#include <asm/idle.h>
+#include <asm/mtrr.h>
 #include <asm/smp.h>
 
-#include <mach_apic.h>
-#include <mach_apicdef.h>
-#include <mach_ipi.h>
-
-/*
- * Sanity check
- */
-#if ((SPURIOUS_APIC_VECTOR & 0x0F) != 0x0F)
-# error SPURIOUS_APIC_VECTOR definition error
-#endif
-
 unsigned int num_processors;
+
 unsigned disabled_cpus __cpuinitdata;
+
 /* Processor that is doing the boot up */
 unsigned int boot_cpu_physical_apicid = -1U;
-EXPORT_SYMBOL(boot_cpu_physical_apicid);
+
+/*
+ * The highest APIC ID seen during enumeration.
+ *
+ * This determines the messaging protocol we can use: if all APIC IDs
+ * are in the 0 ... 7 range, then we can use logical addressing which
+ * has some performance advantages (better broadcasting).
+ *
+ * If there's an APIC ID above 8, we use physical addressing.
+ */
 unsigned int max_physical_apicid;
 
-/* Bitmask of physically existing CPUs */
+/*
+ * Bitmask of physically existing CPUs:
+ */
 physid_mask_t phys_cpu_present_map;
 
 /*
@@ -475,7 +477,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
 static void lapic_timer_broadcast(const struct cpumask *mask)
 {
 #ifdef CONFIG_SMP
-       send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
+       apic->send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
 #endif
 }
 
@@ -1009,11 +1011,11 @@ int __init verify_local_APIC(void)
         */
        reg0 = apic_read(APIC_ID);
        apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0);
-       apic_write(APIC_ID, reg0 ^ APIC_ID_MASK);
+       apic_write(APIC_ID, reg0 ^ apic->apic_id_mask);
        reg1 = apic_read(APIC_ID);
        apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg1);
        apic_write(APIC_ID, reg0);
-       if (reg1 != (reg0 ^ APIC_ID_MASK))
+       if (reg1 != (reg0 ^ apic->apic_id_mask))
                return 0;
 
        /*
@@ -1107,7 +1109,7 @@ static void __cpuinit lapic_setup_esr(void)
                return;
        }
 
-       if (esr_disable) {
+       if (apic->disable_esr) {
                /*
                 * Something untraceable is creating bad interrupts on
                 * secondary quads ... for the moment, just leave the
@@ -1149,15 +1151,13 @@ void __cpuinit setup_local_APIC(void)
        int i, j;
 
        if (disable_apic) {
-#ifdef CONFIG_X86_IO_APIC
-               disable_ioapic_setup();
-#endif
+               arch_disable_smp_support();
                return;
        }
 
 #ifdef CONFIG_X86_32
        /* Pound the ESR really hard over the head with a big hammer - mbligh */
-       if (lapic_is_integrated() && esr_disable) {
+       if (lapic_is_integrated() && apic->disable_esr) {
                apic_write(APIC_ESR, 0);
                apic_write(APIC_ESR, 0);
                apic_write(APIC_ESR, 0);
@@ -1171,7 +1171,7 @@ void __cpuinit setup_local_APIC(void)
         * Double-check whether this APIC is really registered.
         * This is meaningless in clustered apic mode, so we skip it.
         */
-       if (!apic_id_registered())
+       if (!apic->apic_id_registered())
                BUG();
 
        /*
@@ -1179,7 +1179,7 @@ void __cpuinit setup_local_APIC(void)
         * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
         * document number 292116).  So here it goes...
         */
-       init_apic_ldr();
+       apic->init_apic_ldr();
 
        /*
         * Set Task Priority to 'accept all'. We never change this
@@ -1461,7 +1461,7 @@ static int __init detect_init_APIC(void)
        switch (boot_cpu_data.x86_vendor) {
        case X86_VENDOR_AMD:
                if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
-                   (boot_cpu_data.x86 == 15))
+                   (boot_cpu_data.x86 >= 15))
                        break;
                goto no_apic;
        case X86_VENDOR_INTEL:
@@ -1625,7 +1625,7 @@ int __init APIC_init_uniprocessor(void)
        enable_IR_x2apic();
 #endif
 #ifdef CONFIG_X86_64
-       setup_apic_routing();
+       default_setup_apic_routing();
 #endif
 
        verify_local_APIC();
@@ -1763,7 +1763,8 @@ void __init connect_bsp_APIC(void)
                outb(0x01, 0x23);
        }
 #endif
-       enable_apic_mode();
+       if (apic->enable_apic_mode)
+               apic->enable_apic_mode();
 }
 
 /**
@@ -1901,7 +1902,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
        }
 #endif
 
-#if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64)
+#if defined(CONFIG_SMP) || defined(CONFIG_X86_64)
        early_per_cpu(x86_cpu_to_apicid, cpu) = apicid;
        early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
 #endif
@@ -1910,11 +1911,30 @@ void __cpuinit generic_processor_info(int apicid, int version)
        set_cpu_present(cpu, true);
 }
 
-#ifdef CONFIG_X86_64
 int hard_smp_processor_id(void)
 {
        return read_apic_id();
 }
+
+void default_init_apic_ldr(void)
+{
+       unsigned long val;
+
+       apic_write(APIC_DFR, APIC_DFR_VALUE);
+       val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+       val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
+       apic_write(APIC_LDR, val);
+}
+
+#ifdef CONFIG_X86_32
+int default_apicid_to_node(int logical_apicid)
+{
+#ifdef CONFIG_SMP
+       return apicid_2_node[hard_smp_processor_id()];
+#else
+       return 0;
+#endif
+}
 #endif
 
 /*
index 98807bb..37ba5f8 100644 (file)
@@ -301,7 +301,7 @@ extern int (*console_blank_hook)(int);
  */
 #define APM_ZERO_SEGS
 
-#include "apm.h"
+#include <asm/apm.h>
 
 /*
  * Define to re-initialize the interrupt 0 timer to 100 Hz after a suspend.
diff --git a/arch/x86/kernel/bigsmp_32.c b/arch/x86/kernel/bigsmp_32.c
new file mode 100644 (file)
index 0000000..47a62f4
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
+ * Drives the local APIC in "clustered mode".
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <asm/ipi.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/dmi.h>
+#include <linux/smp.h>
+
+
+static inline unsigned bigsmp_get_apic_id(unsigned long x)
+{
+       return (x >> 24) & 0xFF;
+}
+
+#define xapic_phys_to_log_apicid(cpu) (per_cpu(x86_bios_cpu_apicid, cpu))
+
+static inline int bigsmp_apic_id_registered(void)
+{
+       return 1;
+}
+
+static inline const cpumask_t *bigsmp_target_cpus(void)
+{
+#ifdef CONFIG_SMP
+       return &cpu_online_map;
+#else
+       return &cpumask_of_cpu(0);
+#endif
+}
+
+#define APIC_DFR_VALUE         (APIC_DFR_FLAT)
+
+static inline unsigned long
+bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+       return 0;
+}
+
+static inline unsigned long bigsmp_check_apicid_present(int bit)
+{
+       return 1;
+}
+
+static inline unsigned long calculate_ldr(int cpu)
+{
+       unsigned long val, id;
+       val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+       id = xapic_phys_to_log_apicid(cpu);
+       val |= SET_APIC_LOGICAL_ID(id);
+       return val;
+}
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LDR and TPR before enabling
+ * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116).  So here it goes...
+ */
+static inline void bigsmp_init_apic_ldr(void)
+{
+       unsigned long val;
+       int cpu = smp_processor_id();
+
+       apic_write(APIC_DFR, APIC_DFR_VALUE);
+       val = calculate_ldr(cpu);
+       apic_write(APIC_LDR, val);
+}
+
+static inline void bigsmp_setup_apic_routing(void)
+{
+       printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
+               "Physflat", nr_ioapics);
+}
+
+static inline int bigsmp_apicid_to_node(int logical_apicid)
+{
+       return apicid_2_node[hard_smp_processor_id()];
+}
+
+static inline int bigsmp_cpu_present_to_apicid(int mps_cpu)
+{
+       if (mps_cpu < nr_cpu_ids)
+               return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
+
+       return BAD_APICID;
+}
+
+static inline physid_mask_t bigsmp_apicid_to_cpu_present(int phys_apicid)
+{
+       return physid_mask_of_physid(phys_apicid);
+}
+
+extern u8 cpu_2_logical_apicid[];
+/* Mapping from cpu number to logical apicid */
+static inline int bigsmp_cpu_to_logical_apicid(int cpu)
+{
+       if (cpu >= nr_cpu_ids)
+               return BAD_APICID;
+       return cpu_physical_id(cpu);
+}
+
+static inline physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map)
+{
+       /* For clustered we don't have a good way to do this yet - hack */
+       return physids_promote(0xFFL);
+}
+
+static inline void bigsmp_setup_portio_remap(void)
+{
+}
+
+static inline int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+       return 1;
+}
+
+/* As we are using single CPU as destination, pick only one CPU here */
+static inline unsigned int bigsmp_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+       return bigsmp_cpu_to_logical_apicid(first_cpu(*cpumask));
+}
+
+static inline unsigned int
+bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                             const struct cpumask *andmask)
+{
+       int cpu;
+
+       /*
+        * We're using fixed IRQ delivery, can only return one phys APIC ID.
+        * May as well be the first.
+        */
+       for_each_cpu_and(cpu, cpumask, andmask) {
+               if (cpumask_test_cpu(cpu, cpu_online_mask))
+                       break;
+       }
+       if (cpu < nr_cpu_ids)
+               return bigsmp_cpu_to_logical_apicid(cpu);
+
+       return BAD_APICID;
+}
+
+static inline int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+       return cpuid_apic >> index_msb;
+}
+
+static inline void bigsmp_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+       default_send_IPI_mask_sequence_phys(mask, vector);
+}
+
+static inline void bigsmp_send_IPI_allbutself(int vector)
+{
+       default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
+}
+
+static inline void bigsmp_send_IPI_all(int vector)
+{
+       bigsmp_send_IPI_mask(cpu_online_mask, vector);
+}
+
+static int dmi_bigsmp; /* can be set by dmi scanners */
+
+static int hp_ht_bigsmp(const struct dmi_system_id *d)
+{
+       printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
+       dmi_bigsmp = 1;
+       return 0;
+}
+
+
+static const struct dmi_system_id bigsmp_dmi_table[] = {
+       { hp_ht_bigsmp, "HP ProLiant DL760 G2",
+       { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
+       DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
+       },
+
+       { hp_ht_bigsmp, "HP ProLiant DL740",
+       { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
+       DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
+       },
+        { }
+};
+
+static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
+{
+       cpus_clear(*retmask);
+       cpu_set(cpu, *retmask);
+}
+
+static int probe_bigsmp(void)
+{
+       if (def_to_bigsmp)
+               dmi_bigsmp = 1;
+       else
+               dmi_check_system(bigsmp_dmi_table);
+       return dmi_bigsmp;
+}
+
+struct genapic apic_bigsmp = {
+
+       .name                           = "bigsmp",
+       .probe                          = probe_bigsmp,
+       .acpi_madt_oem_check            = NULL,
+       .apic_id_registered             = bigsmp_apic_id_registered,
+
+       .irq_delivery_mode              = dest_Fixed,
+       /* phys delivery to target CPU: */
+       .irq_dest_mode                  = 0,
+
+       .target_cpus                    = bigsmp_target_cpus,
+       .disable_esr                    = 1,
+       .dest_logical                   = 0,
+       .check_apicid_used              = bigsmp_check_apicid_used,
+       .check_apicid_present           = bigsmp_check_apicid_present,
+
+       .vector_allocation_domain       = bigsmp_vector_allocation_domain,
+       .init_apic_ldr                  = bigsmp_init_apic_ldr,
+
+       .ioapic_phys_id_map             = bigsmp_ioapic_phys_id_map,
+       .setup_apic_routing             = bigsmp_setup_apic_routing,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = bigsmp_apicid_to_node,
+       .cpu_to_logical_apicid          = bigsmp_cpu_to_logical_apicid,
+       .cpu_present_to_apicid          = bigsmp_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = bigsmp_apicid_to_cpu_present,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = bigsmp_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = bigsmp_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = bigsmp_get_apic_id,
+       .set_apic_id                    = NULL,
+       .apic_id_mask                   = 0xFF << 24,
+
+       .cpu_mask_to_apicid             = bigsmp_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = bigsmp_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = bigsmp_send_IPI_mask,
+       .send_IPI_mask_allbutself       = NULL,
+       .send_IPI_allbutself            = bigsmp_send_IPI_allbutself,
+       .send_IPI_all                   = bigsmp_send_IPI_all,
+       .send_IPI_self                  = default_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+
+       .wait_for_init_deassert         = default_wait_for_init_deassert,
+
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = default_inquire_remote_apic,
+};
index 2cf2363..e48640c 100644 (file)
@@ -7,7 +7,7 @@
 #include <asm/pat.h>
 #include <asm/processor.h>
 
-#include <mach_apic.h>
+#include <asm/genapic.h>
 
 struct cpuid_bit {
        u16 feature;
@@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
  */
 void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
        unsigned int eax, ebx, ecx, edx, sub_index;
        unsigned int ht_mask_width, core_plus_mask_width;
        unsigned int core_select_mask, core_level_siblings;
@@ -116,22 +116,14 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
 
        core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width;
 
-#ifdef CONFIG_X86_32
-       c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width)
+       c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, ht_mask_width)
                                                 & core_select_mask;
-       c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width);
+       c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, core_plus_mask_width);
        /*
         * Reinit the apicid, now that we have extended initial_apicid.
         */
-       c->apicid = phys_pkg_id(c->initial_apicid, 0);
-#else
-       c->cpu_core_id = phys_pkg_id(ht_mask_width) & core_select_mask;
-       c->phys_proc_id = phys_pkg_id(core_plus_mask_width);
-       /*
-        * Reinit the apicid, now that we have extended initial_apicid.
-        */
-       c->apicid = phys_pkg_id(0);
-#endif
+       c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
+
        c->x86_max_cores = (core_level_siblings / smp_num_siblings);
 
 
@@ -143,37 +135,3 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
        return;
 #endif
 }
-
-#ifdef CONFIG_X86_PAT
-void __cpuinit validate_pat_support(struct cpuinfo_x86 *c)
-{
-       if (!cpu_has_pat)
-               pat_disable("PAT not supported by CPU.");
-
-       switch (c->x86_vendor) {
-       case X86_VENDOR_INTEL:
-               /*
-                * There is a known erratum on Pentium III and Core Solo
-                * and Core Duo CPUs.
-                * " Page with PAT set to WC while associated MTRR is UC
-                *   may consolidate to UC "
-                * Because of this erratum, it is better to stick with
-                * setting WC in MTRR rather than using PAT on these CPUs.
-                *
-                * Enable PAT WC only on P4, Core 2 or later CPUs.
-                */
-               if (c->x86 > 0x6 || (c->x86 == 6 && c->x86_model >= 15))
-                       return;
-
-               pat_disable("PAT WC disabled due to known CPU erratum.");
-               return;
-
-       case X86_VENDOR_AMD:
-       case X86_VENDOR_CENTAUR:
-       case X86_VENDOR_TRANSMETA:
-               return;
-       }
-
-       pat_disable("PAT disabled. Not yet verified on this CPU type.");
-}
-#endif
index 7c878f6..ff4d7b9 100644 (file)
@@ -12,7 +12,7 @@
 # include <asm/cacheflush.h>
 #endif
 
-#include <mach_apic.h>
+#include <asm/genapic.h>
 
 #include "cpu.h"
 
index 0f73ea4..cbcdb79 100644 (file)
@@ -26,7 +26,7 @@
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/mpspec.h>
 #include <asm/apic.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
 #include <asm/genapic.h>
 #include <asm/uv/uv.h>
 #endif
@@ -224,6 +224,49 @@ static inline void squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
 #endif
 
 /*
+ * Some CPU features depend on higher CPUID levels, which may not always
+ * be available due to CPUID level capping or broken virtualization
+ * software.  Add those features to this table to auto-disable them.
+ */
+struct cpuid_dependent_feature {
+       u32 feature;
+       u32 level;
+};
+static const struct cpuid_dependent_feature __cpuinitconst
+cpuid_dependent_features[] = {
+       { X86_FEATURE_MWAIT,            0x00000005 },
+       { X86_FEATURE_DCA,              0x00000009 },
+       { X86_FEATURE_XSAVE,            0x0000000d },
+       { 0, 0 }
+};
+
+static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
+{
+       const struct cpuid_dependent_feature *df;
+       for (df = cpuid_dependent_features; df->feature; df++) {
+               /*
+                * Note: cpuid_level is set to -1 if unavailable, but
+                * extended_extended_level is set to 0 if unavailable
+                * and the legitimate extended levels are all negative
+                * when signed; hence the weird messing around with
+                * signs here...
+                */
+               if (cpu_has(c, df->feature) &&
+                   ((s32)df->feature < 0 ?
+                    (u32)df->feature > (u32)c->extended_cpuid_level :
+                    (s32)df->feature > (s32)c->cpuid_level)) {
+                       clear_cpu_cap(c, df->feature);
+                       if (warn)
+                               printk(KERN_WARNING
+                                      "CPU: CPU feature %s disabled "
+                                      "due to lack of CPUID level 0x%x\n",
+                                      x86_cap_flags[df->feature],
+                                      df->level);
+               }
+       }
+}      
+
+/*
  * Naming convention should be: <Name> [(<Codename>)]
  * This table only is used unless init_<vendor>() below doesn't set it;
  * in particular, if CPUID levels 0x80000002..4 are supported, this isn't used
@@ -404,11 +447,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
                }
 
                index_msb = get_count_order(smp_num_siblings);
-#ifdef CONFIG_X86_64
-               c->phys_proc_id = phys_pkg_id(index_msb);
-#else
-               c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
-#endif
+               c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb);
 
                smp_num_siblings = smp_num_siblings / c->x86_max_cores;
 
@@ -416,13 +455,8 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
                core_bits = get_count_order(c->x86_max_cores);
 
-#ifdef CONFIG_X86_64
-               c->cpu_core_id = phys_pkg_id(index_msb) &
-                                              ((1 << core_bits) - 1);
-#else
-               c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
+               c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, index_msb) &
                                               ((1 << core_bits) - 1);
-#endif
        }
 
 out:
@@ -591,11 +625,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
        if (this_cpu->c_early_init)
                this_cpu->c_early_init(c);
 
-       validate_pat_support(c);
-
 #ifdef CONFIG_SMP
        c->cpu_index = boot_cpu_id;
 #endif
+       filter_cpuid_features(c, false);
 }
 
 void __init early_cpu_init(void)
@@ -658,7 +691,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
                c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
 #ifdef CONFIG_X86_32
 # ifdef CONFIG_X86_HT
-               c->apicid = phys_pkg_id(c->initial_apicid, 0);
+               c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
 # else
                c->apicid = c->initial_apicid;
 # endif
@@ -705,7 +738,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
                this_cpu->c_identify(c);
 
 #ifdef CONFIG_X86_64
-       c->apicid = phys_pkg_id(0);
+       c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
 #endif
 
        /*
@@ -729,6 +762,9 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
         * we do "generic changes."
         */
 
+       /* Filter out anything that depends on CPUID levels we don't have */
+       filter_cpuid_features(c, true);
+
        /* If the model name is still unset, do table lookup. */
        if (!c->x86_model_id[0]) {
                char *p;
@@ -1058,22 +1094,19 @@ void __cpuinit cpu_init(void)
         */
        if (kgdb_connected && arch_kgdb_ops.correct_hw_break)
                arch_kgdb_ops.correct_hw_break();
-       else {
+       else
 #endif
-       /*
-        * Clear all 6 debug registers:
-        */
-
-       set_debugreg(0UL, 0);
-       set_debugreg(0UL, 1);
-       set_debugreg(0UL, 2);
-       set_debugreg(0UL, 3);
-       set_debugreg(0UL, 6);
-       set_debugreg(0UL, 7);
-#ifdef CONFIG_KGDB
-       /* If the kgdb is connected no debug regs should be altered. */
+       {
+               /*
+                * Clear all 6 debug registers:
+                */
+               set_debugreg(0UL, 0);
+               set_debugreg(0UL, 1);
+               set_debugreg(0UL, 2);
+               set_debugreg(0UL, 3);
+               set_debugreg(0UL, 6);
+               set_debugreg(0UL, 7);
        }
-#endif
 
        fpu_init();
 
index 549f2ad..1cef0aa 100644 (file)
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/mpspec.h>
 #include <asm/apic.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
 #endif
 
 static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
 {
        /* Unmask CPUID levels if masked: */
-       if (c->x86 == 6 && c->x86_model >= 15) {
+       if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
                u64 misc_enable;
 
                rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
@@ -63,6 +63,18 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
                set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
        }
 
+       /*
+        * There is a known erratum on Pentium III and Core Solo
+        * and Core Duo CPUs.
+        * " Page with PAT set to WC while associated MTRR is UC
+        *   may consolidate to UC "
+        * Because of this erratum, it is better to stick with
+        * setting WC in MTRR rather than using PAT on these CPUs.
+        *
+        * Enable PAT WC only on P4, Core 2 or later CPUs.
+        */
+       if (c->x86 == 6 && c->x86_model < 15)
+               clear_cpu_cap(c, X86_FEATURE_PAT);
 }
 
 #ifdef CONFIG_X86_32
index 58527a9..7293508 100644 (file)
@@ -36,8 +36,11 @@ static struct _cache_table cache_table[] __cpuinitdata =
 {
        { 0x06, LVL_1_INST, 8 },        /* 4-way set assoc, 32 byte line size */
        { 0x08, LVL_1_INST, 16 },       /* 4-way set assoc, 32 byte line size */
+       { 0x09, LVL_1_INST, 32 },       /* 4-way set assoc, 64 byte line size */
        { 0x0a, LVL_1_DATA, 8 },        /* 2 way set assoc, 32 byte line size */
        { 0x0c, LVL_1_DATA, 16 },       /* 4-way set assoc, 32 byte line size */
+       { 0x0d, LVL_1_DATA, 16 },       /* 4-way set assoc, 64 byte line size */
+       { 0x21, LVL_2,      256 },      /* 8-way set assoc, 64 byte line size */
        { 0x22, LVL_3,      512 },      /* 4-way set assoc, sectored cache, 64 byte line size */
        { 0x23, LVL_3,      1024 },     /* 8-way set assoc, sectored cache, 64 byte line size */
        { 0x25, LVL_3,      2048 },     /* 8-way set assoc, sectored cache, 64 byte line size */
@@ -85,6 +88,18 @@ static struct _cache_table cache_table[] __cpuinitdata =
        { 0x85, LVL_2,    2048 },       /* 8-way set assoc, 32 byte line size */
        { 0x86, LVL_2,     512 },       /* 4-way set assoc, 64 byte line size */
        { 0x87, LVL_2,    1024 },       /* 8-way set assoc, 64 byte line size */
+       { 0xd0, LVL_3,     512 },       /* 4-way set assoc, 64 byte line size */
+       { 0xd1, LVL_3,    1024 },       /* 4-way set assoc, 64 byte line size */
+       { 0xd2, LVL_3,    2048 },       /* 4-way set assoc, 64 byte line size */
+       { 0xd6, LVL_3,    1024 },       /* 8-way set assoc, 64 byte line size */
+       { 0xd7, LVL_3,    2038 },       /* 8-way set assoc, 64 byte line size */
+       { 0xd8, LVL_3,    4096 },       /* 12-way set assoc, 64 byte line size */
+       { 0xdc, LVL_3,    2048 },       /* 12-way set assoc, 64 byte line size */
+       { 0xdd, LVL_3,    4096 },       /* 12-way set assoc, 64 byte line size */
+       { 0xde, LVL_3,    8192 },       /* 12-way set assoc, 64 byte line size */
+       { 0xe2, LVL_3,    2048 },       /* 16-way set assoc, 64 byte line size */
+       { 0xe3, LVL_3,    4096 },       /* 16-way set assoc, 64 byte line size */
+       { 0xe4, LVL_3,    8192 },       /* 16-way set assoc, 64 byte line size */
        { 0x00, 0, 0}
 };
 
index d259e5d..236a401 100644 (file)
@@ -1594,8 +1594,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 
        /* kvm/qemu doesn't have mtrr set right, don't trim them all */
        if (!highest_pfn) {
-               WARN(!kvm_para_available(), KERN_WARNING
-                               "WARNING: strange, CPU MTRRs all blank?\n");
+               printk(KERN_INFO "CPU MTRRs all blank - virtualized system.\n");
                return 0;
        }
 
index 11b93ca..ad7f2a6 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/reboot.h>
 #include <asm/virtext.h>
 
-#include <mach_ipi.h>
+#include <asm/genapic.h>
 
 
 #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
index da91701..169a120 100644 (file)
@@ -15,8 +15,8 @@
  * - buffer allocation (memory accounting)
  *
  *
- * Copyright (C) 2007-2008 Intel Corporation.
- * Markus Metzger <markus.t.metzger@intel.com>, 2007-2008
+ * Copyright (C) 2007-2009 Intel Corporation.
+ * Markus Metzger <markus.t.metzger@intel.com>, 2007-2009
  */
 
 
@@ -890,7 +890,7 @@ int ds_set_pebs_reset(struct pebs_tracer *tracer, u64 value)
 }
 
 static const struct ds_configuration ds_cfg_netburst = {
-       .name = "netburst",
+       .name = "Netburst",
        .ctl[dsf_bts]           = (1 << 2) | (1 << 3),
        .ctl[dsf_bts_kernel]    = (1 << 5),
        .ctl[dsf_bts_user]      = (1 << 6),
@@ -904,7 +904,7 @@ static const struct ds_configuration ds_cfg_netburst = {
 #endif
 };
 static const struct ds_configuration ds_cfg_pentium_m = {
-       .name = "pentium m",
+       .name = "Pentium M",
        .ctl[dsf_bts]           = (1 << 6) | (1 << 7),
 
        .sizeof_field           = sizeof(long),
@@ -915,8 +915,8 @@ static const struct ds_configuration ds_cfg_pentium_m = {
        .sizeof_rec[ds_pebs]    = sizeof(long) * 18,
 #endif
 };
-static const struct ds_configuration ds_cfg_core2 = {
-       .name = "core 2",
+static const struct ds_configuration ds_cfg_core2_atom = {
+       .name = "Core 2/Atom",
        .ctl[dsf_bts]           = (1 << 6) | (1 << 7),
        .ctl[dsf_bts_kernel]    = (1 << 9),
        .ctl[dsf_bts_user]      = (1 << 10),
@@ -949,19 +949,22 @@ void __cpuinit ds_init_intel(struct cpuinfo_x86 *c)
        switch (c->x86) {
        case 0x6:
                switch (c->x86_model) {
-               case 0 ... 0xC:
-                       /* sorry, don't know about them */
-                       break;
-               case 0xD:
-               case 0xE: /* Pentium M */
+               case 0x9:
+               case 0xd: /* Pentium M */
                        ds_configure(&ds_cfg_pentium_m);
                        break;
-               default: /* Core2, Atom, ... */
-                       ds_configure(&ds_cfg_core2);
+               case 0xf:
+               case 0x17: /* Core2 */
+               case 0x1c: /* Atom */
+                       ds_configure(&ds_cfg_core2_atom);
+                       break;
+               case 0x1a: /* i7 */
+               default:
+                       /* sorry, don't know about them */
                        break;
                }
                break;
-       case 0xF:
+       case 0xf:
                switch (c->x86_model) {
                case 0x0:
                case 0x1:
index a0b91aa..65efd42 100644 (file)
@@ -688,7 +688,7 @@ ENDPROC(name)
 #define BUILD_INTERRUPT(name, nr)      BUILD_INTERRUPT3(name, nr, smp_##name)
 
 /* The include is where all of the SMP etc. interrupts come from */
-#include "entry_arch.h"
+#include <asm/entry_arch.h>
 
 ENTRY(coprocessor_error)
        RING0_INT_FRAME
index e4c9710..fbcf96b 100644 (file)
@@ -347,6 +347,7 @@ ENTRY(save_args)
        popq_cfi %rax                   /* move return address... */
        mov PER_CPU_VAR(irq_stack_ptr),%rsp
        EMPTY_FRAME 0
+       pushq_cfi %rbp                  /* backlink for unwinder */
        pushq_cfi %rax                  /* ... to the new stack */
        /*
         * We entered an interrupt context - irqs are off:
@@ -409,6 +410,8 @@ END(save_paranoid)
 ENTRY(ret_from_fork)
        DEFAULT_FRAME
 
+       LOCK ; btr $TIF_FORK,TI_flags(%r8)
+
        push kernel_eflags(%rip)
        CFI_ADJUST_CFA_OFFSET 8
        popf                                    # reset kernel eflags
index 53699c9..d6184c1 100644 (file)
@@ -40,7 +40,6 @@
 #include <asm/smp.h>
 #include <asm/atomic.h>
 #include <asm/apicdef.h>
-#include <mach_mpparse.h>
 #include <asm/genapic.h>
 #include <asm/setup.h>
 
@@ -182,20 +181,16 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
        return 0;
 }
 
-static void noop_wait_for_deassert(atomic_t *deassert_not_used)
-{
-}
-
 static int __init es7000_update_genapic(void)
 {
-       genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
+       apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
 
        /* MPENTIUMIII */
        if (boot_cpu_data.x86 == 6 &&
            (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) {
                es7000_update_genapic_to_cluster();
-               genapic->wait_for_init_deassert = noop_wait_for_deassert;
-               genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
+               apic->wait_for_init_deassert = NULL;
+               apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
        }
 
        return 0;
@@ -359,20 +354,449 @@ es7000_mip_write(struct mip_reg *mip_reg)
        return status;
 }
 
-void __init
-es7000_sw_apic(void)
-{
-       if (es7000_plat) {
-               int mip_status;
-               struct mip_reg es7000_mip_reg;
-
-               printk("ES7000: Enabling APIC mode.\n");
-               memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
-               es7000_mip_reg.off_0 = MIP_SW_APIC;
-               es7000_mip_reg.off_38 = (MIP_VALID);
-               while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
-                       printk("es7000_sw_apic: command failed, status = %x\n",
-                               mip_status);
+void __init es7000_enable_apic_mode(void)
+{
+       struct mip_reg es7000_mip_reg;
+       int mip_status;
+
+       if (!es7000_plat)
                return;
+
+       printk("ES7000: Enabling APIC mode.\n");
+               memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
+               es7000_mip_reg.off_0 = MIP_SW_APIC;
+               es7000_mip_reg.off_38 = MIP_VALID;
+
+               while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0) {
+               printk("es7000_enable_apic_mode: command failed, status = %x\n",
+                       mip_status);
+       }
+}
+
+/*
+ * APIC driver for the Unisys ES7000 chipset.
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/acpi.h>
+#include <linux/smp.h>
+#include <asm/ipi.h>
+
+#define APIC_DFR_VALUE_CLUSTER         (APIC_DFR_CLUSTER)
+#define INT_DELIVERY_MODE_CLUSTER      (dest_LowestPrio)
+#define INT_DEST_MODE_CLUSTER          (1) /* logical delivery broadcast to all procs */
+
+#define APIC_DFR_VALUE                 (APIC_DFR_FLAT)
+
+extern void es7000_enable_apic_mode(void);
+extern int apic_version [MAX_APICS];
+extern u8 cpu_2_logical_apicid[];
+extern unsigned int boot_cpu_physical_apicid;
+
+extern int parse_unisys_oem (char *oemptr);
+extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
+extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);
+extern void setup_unisys(void);
+
+#define apicid_cluster(apicid)         (apicid & 0xF0)
+#define xapic_phys_to_log_apicid(cpu)  per_cpu(x86_bios_cpu_apicid, cpu)
+
+static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
+{
+       /* Careful. Some cpus do not strictly honor the set of cpus
+        * specified in the interrupt destination when using lowest
+        * priority interrupt delivery mode.
+        *
+        * In particular there was a hyperthreading cpu observed to
+        * deliver interrupts to the wrong hyperthread when only one
+        * hyperthread was specified in the interrupt desitination.
+        */
+       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
+}
+
+
+static void es7000_wait_for_init_deassert(atomic_t *deassert)
+{
+#ifndef CONFIG_ES7000_CLUSTERED_APIC
+       while (!atomic_read(deassert))
+               cpu_relax();
+#endif
+       return;
+}
+
+static unsigned int es7000_get_apic_id(unsigned long x)
+{
+       return (x >> 24) & 0xFF;
+}
+
+#ifdef CONFIG_ACPI
+static int es7000_check_dsdt(void)
+{
+       struct acpi_table_header header;
+
+       if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
+           !strncmp(header.oem_id, "UNISYS", 6))
+               return 1;
+       return 0;
+}
+#endif
+
+static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+       default_send_IPI_mask_sequence_phys(mask, vector);
+}
+
+static void es7000_send_IPI_allbutself(int vector)
+{
+       default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
+}
+
+static void es7000_send_IPI_all(int vector)
+{
+       es7000_send_IPI_mask(cpu_online_mask, vector);
+}
+
+static int es7000_apic_id_registered(void)
+{
+               return 1;
+}
+
+static const cpumask_t *target_cpus_cluster(void)
+{
+       return &CPU_MASK_ALL;
+}
+
+static const cpumask_t *es7000_target_cpus(void)
+{
+       return &cpumask_of_cpu(smp_processor_id());
+}
+
+static unsigned long
+es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+       return 0;
+}
+static unsigned long es7000_check_apicid_present(int bit)
+{
+       return physid_isset(bit, phys_cpu_present_map);
+}
+
+static unsigned long calculate_ldr(int cpu)
+{
+       unsigned long id = xapic_phys_to_log_apicid(cpu);
+
+       return (SET_APIC_LOGICAL_ID(id));
+}
+
+/*
+ * Set up the logical destination ID.
+ *
+ * Intel recommends to set DFR, LdR and TPR before enabling
+ * an APIC.  See e.g. "AP-388 82489DX User's Manual" (Intel
+ * document number 292116).  So here it goes...
+ */
+static void es7000_init_apic_ldr_cluster(void)
+{
+       unsigned long val;
+       int cpu = smp_processor_id();
+
+       apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
+       val = calculate_ldr(cpu);
+       apic_write(APIC_LDR, val);
+}
+
+static void es7000_init_apic_ldr(void)
+{
+       unsigned long val;
+       int cpu = smp_processor_id();
+
+       apic_write(APIC_DFR, APIC_DFR_VALUE);
+       val = calculate_ldr(cpu);
+       apic_write(APIC_LDR, val);
+}
+
+static void es7000_setup_apic_routing(void)
+{
+       int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
+       printk("Enabling APIC mode:  %s. Using %d I/O APICs, target cpus %lx\n",
+               (apic_version[apic] == 0x14) ?
+                       "Physical Cluster" : "Logical Cluster",
+                       nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
+}
+
+static int es7000_apicid_to_node(int logical_apicid)
+{
+       return 0;
+}
+
+
+static int es7000_cpu_present_to_apicid(int mps_cpu)
+{
+       if (!mps_cpu)
+               return boot_cpu_physical_apicid;
+       else if (mps_cpu < nr_cpu_ids)
+               return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
+       else
+               return BAD_APICID;
+}
+
+static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
+{
+       static int id = 0;
+       physid_mask_t mask;
+
+       mask = physid_mask_of_physid(id);
+       ++id;
+
+       return mask;
+}
+
+/* Mapping from cpu number to logical apicid */
+static int es7000_cpu_to_logical_apicid(int cpu)
+{
+#ifdef CONFIG_SMP
+       if (cpu >= nr_cpu_ids)
+               return BAD_APICID;
+       return (int)cpu_2_logical_apicid[cpu];
+#else
+       return logical_smp_processor_id();
+#endif
+}
+
+static physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)
+{
+       /* For clustered we don't have a good way to do this yet - hack */
+       return physids_promote(0xff);
+}
+
+static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
+{
+       boot_cpu_physical_apicid = read_apic_id();
+       return (1);
+}
+
+static unsigned int
+es7000_cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
+{
+       int cpus_found = 0;
+       int num_bits_set;
+       int apicid;
+       int cpu;
+
+       num_bits_set = cpumask_weight(cpumask);
+       /* Return id to all */
+       if (num_bits_set == nr_cpu_ids)
+               return 0xFF;
+       /*
+        * The cpus in the mask must all be on the apic cluster.  If are not
+        * on the same apicid cluster return default value of target_cpus():
+        */
+       cpu = cpumask_first(cpumask);
+       apicid = es7000_cpu_to_logical_apicid(cpu);
+
+       while (cpus_found < num_bits_set) {
+               if (cpumask_test_cpu(cpu, cpumask)) {
+                       int new_apicid = es7000_cpu_to_logical_apicid(cpu);
+
+                       if (apicid_cluster(apicid) !=
+                                       apicid_cluster(new_apicid)) {
+                               printk ("%s: Not a valid mask!\n", __func__);
+
+                               return 0xFF;
+                       }
+                       apicid = new_apicid;
+                       cpus_found++;
+               }
+               cpu++;
        }
+       return apicid;
 }
+
+static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+       int cpus_found = 0;
+       int num_bits_set;
+       int apicid;
+       int cpu;
+
+       num_bits_set = cpus_weight(*cpumask);
+       /* Return id to all */
+       if (num_bits_set == nr_cpu_ids)
+               return es7000_cpu_to_logical_apicid(0);
+       /*
+        * The cpus in the mask must all be on the apic cluster.  If are not
+        * on the same apicid cluster return default value of target_cpus():
+        */
+       cpu = first_cpu(*cpumask);
+       apicid = es7000_cpu_to_logical_apicid(cpu);
+       while (cpus_found < num_bits_set) {
+               if (cpu_isset(cpu, *cpumask)) {
+                       int new_apicid = es7000_cpu_to_logical_apicid(cpu);
+
+                       if (apicid_cluster(apicid) !=
+                                       apicid_cluster(new_apicid)) {
+                               printk ("%s: Not a valid mask!\n", __func__);
+
+                               return es7000_cpu_to_logical_apicid(0);
+                       }
+                       apicid = new_apicid;
+                       cpus_found++;
+               }
+               cpu++;
+       }
+       return apicid;
+}
+
+static unsigned int
+es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
+                             const struct cpumask *andmask)
+{
+       int apicid = es7000_cpu_to_logical_apicid(0);
+       cpumask_var_t cpumask;
+
+       if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
+               return apicid;
+
+       cpumask_and(cpumask, inmask, andmask);
+       cpumask_and(cpumask, cpumask, cpu_online_mask);
+       apicid = es7000_cpu_mask_to_apicid(cpumask);
+
+       free_cpumask_var(cpumask);
+
+       return apicid;
+}
+
+static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+       return cpuid_apic >> index_msb;
+}
+
+void __init es7000_update_genapic_to_cluster(void)
+{
+       apic->target_cpus = target_cpus_cluster;
+       apic->irq_delivery_mode = INT_DELIVERY_MODE_CLUSTER;
+       apic->irq_dest_mode = INT_DEST_MODE_CLUSTER;
+
+       apic->init_apic_ldr = es7000_init_apic_ldr_cluster;
+
+       apic->cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster;
+}
+
+static int probe_es7000(void)
+{
+       /* probed later in mptable/ACPI hooks */
+       return 0;
+}
+
+static __init int
+es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
+{
+       if (mpc->oemptr) {
+               struct mpc_oemtable *oem_table =
+                       (struct mpc_oemtable *)mpc->oemptr;
+
+               if (!strncmp(oem, "UNISYS", 6))
+                       return parse_unisys_oem((char *)oem_table);
+       }
+       return 0;
+}
+
+#ifdef CONFIG_ACPI
+/* Hook from generic ACPI tables.c */
+static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+       unsigned long oem_addr = 0;
+       int check_dsdt;
+       int ret = 0;
+
+       /* check dsdt at first to avoid clear fix_map for oem_addr */
+       check_dsdt = es7000_check_dsdt();
+
+       if (!find_unisys_acpi_oem_table(&oem_addr)) {
+               if (check_dsdt)
+                       ret = parse_unisys_oem((char *)oem_addr);
+               else {
+                       setup_unisys();
+                       ret = 1;
+               }
+               /*
+                * we need to unmap it
+                */
+               unmap_unisys_acpi_oem_table(oem_addr);
+       }
+       return ret;
+}
+#else
+static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+       return 0;
+}
+#endif
+
+
+struct genapic apic_es7000 = {
+
+       .name                           = "es7000",
+       .probe                          = probe_es7000,
+       .acpi_madt_oem_check            = es7000_acpi_madt_oem_check,
+       .apic_id_registered             = es7000_apic_id_registered,
+
+       .irq_delivery_mode              = dest_Fixed,
+       /* phys delivery to target CPUs: */
+       .irq_dest_mode                  = 0,
+
+       .target_cpus                    = es7000_target_cpus,
+       .disable_esr                    = 1,
+       .dest_logical                   = 0,
+       .check_apicid_used              = es7000_check_apicid_used,
+       .check_apicid_present           = es7000_check_apicid_present,
+
+       .vector_allocation_domain       = es7000_vector_allocation_domain,
+       .init_apic_ldr                  = es7000_init_apic_ldr,
+
+       .ioapic_phys_id_map             = es7000_ioapic_phys_id_map,
+       .setup_apic_routing             = es7000_setup_apic_routing,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = es7000_apicid_to_node,
+       .cpu_to_logical_apicid          = es7000_cpu_to_logical_apicid,
+       .cpu_present_to_apicid          = es7000_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = es7000_apicid_to_cpu_present,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = es7000_check_phys_apicid_present,
+       .enable_apic_mode               = es7000_enable_apic_mode,
+       .phys_pkg_id                    = es7000_phys_pkg_id,
+       .mps_oem_check                  = es7000_mps_oem_check,
+
+       .get_apic_id                    = es7000_get_apic_id,
+       .set_apic_id                    = NULL,
+       .apic_id_mask                   = 0xFF << 24,
+
+       .cpu_mask_to_apicid             = es7000_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = es7000_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = es7000_send_IPI_mask,
+       .send_IPI_mask_allbutself       = NULL,
+       .send_IPI_allbutself            = es7000_send_IPI_allbutself,
+       .send_IPI_all                   = es7000_send_IPI_all,
+       .send_IPI_self                  = default_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+
+       .trampoline_phys_low            = 0x467,
+       .trampoline_phys_high           = 0x469,
+
+       .wait_for_init_deassert         = es7000_wait_for_init_deassert,
+
+       /* Nothing to do for most platforms, since cleared by the INIT cycle: */
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = default_inquire_remote_apic,
+};
index e656c27..820dea5 100644 (file)
@@ -29,7 +29,7 @@ extern struct genapic apic_x2xpic_uv_x;
 extern struct genapic apic_x2apic_phys;
 extern struct genapic apic_x2apic_cluster;
 
-struct genapic __read_mostly *genapic = &apic_flat;
+struct genapic __read_mostly *apic = &apic_flat;
 
 static struct genapic *apic_probe[] __initdata = {
 #ifdef CONFIG_X86_UV
@@ -44,17 +44,17 @@ static struct genapic *apic_probe[] __initdata = {
 /*
  * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
  */
-void __init setup_apic_routing(void)
+void __init default_setup_apic_routing(void)
 {
-       if (genapic == &apic_x2apic_phys || genapic == &apic_x2apic_cluster) {
+       if (apic == &apic_x2apic_phys || apic == &apic_x2apic_cluster) {
                if (!intr_remapping_enabled)
-                       genapic = &apic_flat;
+                       apic = &apic_flat;
        }
 
-       if (genapic == &apic_flat) {
+       if (apic == &apic_flat) {
                if (max_physical_apicid >= 8)
-                       genapic = &apic_physflat;
-               printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name);
+                       apic = &apic_physflat;
+               printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
        }
 
        if (x86_quirks->update_genapic)
@@ -65,18 +65,18 @@ void __init setup_apic_routing(void)
 
 void apic_send_IPI_self(int vector)
 {
-       __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
+       __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
 }
 
-int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
        int i;
 
        for (i = 0; apic_probe[i]; ++i) {
                if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
-                       genapic = apic_probe[i];
+                       apic = apic_probe[i];
                        printk(KERN_INFO "Setting APIC routing to %s.\n",
-                               genapic->name);
+                               apic->name);
                        return 1;
                }
        }
index 3418548..249d2d3 100644 (file)
@@ -19,7 +19,6 @@
 #include <asm/smp.h>
 #include <asm/ipi.h>
 #include <asm/genapic.h>
-#include <mach_apicdef.h>
 
 #ifdef CONFIG_ACPI
 #include <acpi/acpi_bus.h>
@@ -74,7 +73,7 @@ static inline void _flat_send_IPI_mask(unsigned long mask, int vector)
        unsigned long flags;
 
        local_irq_save(flags);
-       __send_IPI_dest_field(mask, vector, APIC_DEST_LOGICAL);
+       __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
        local_irq_restore(flags);
 }
 
@@ -85,14 +84,15 @@ static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector)
        _flat_send_IPI_mask(mask, vector);
 }
 
-static void flat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
                                        int vector)
+static void
flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector)
 {
        unsigned long mask = cpumask_bits(cpumask)[0];
        int cpu = smp_processor_id();
 
        if (cpu < BITS_PER_LONG)
                clear_bit(cpu, &mask);
+
        _flat_send_IPI_mask(mask, vector);
 }
 
@@ -114,23 +114,27 @@ static void flat_send_IPI_allbutself(int vector)
                        _flat_send_IPI_mask(mask, vector);
                }
        } else if (num_online_cpus() > 1) {
-               __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
+               __default_send_IPI_shortcut(APIC_DEST_ALLBUT,
+                                           vector, apic->dest_logical);
        }
 }
 
 static void flat_send_IPI_all(int vector)
 {
-       if (vector == NMI_VECTOR)
+       if (vector == NMI_VECTOR) {
                flat_send_IPI_mask(cpu_online_mask, vector);
-       else
-               __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
+       } else {
+               __default_send_IPI_shortcut(APIC_DEST_ALLINC,
+                                           vector, apic->dest_logical);
+       }
 }
 
-static unsigned int get_apic_id(unsigned long x)
+static unsigned int flat_get_apic_id(unsigned long x)
 {
        unsigned int id;
 
        id = (((x)>>24) & 0xFFu);
+
        return id;
 }
 
@@ -146,7 +150,7 @@ static unsigned int read_xapic_id(void)
 {
        unsigned int id;
 
-       id = get_apic_id(apic_read(APIC_ID));
+       id = flat_get_apic_id(apic_read(APIC_ID));
        return id;
 }
 
@@ -169,31 +173,62 @@ static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
        return mask1 & mask2;
 }
 
-static unsigned int phys_pkg_id(int index_msb)
+static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
 {
        return hard_smp_processor_id() >> index_msb;
 }
 
 struct genapic apic_flat =  {
-       .name = "flat",
-       .acpi_madt_oem_check = flat_acpi_madt_oem_check,
-       .int_delivery_mode = dest_LowestPrio,
-       .int_dest_mode = (APIC_DEST_LOGICAL != 0),
-       .target_cpus = flat_target_cpus,
-       .vector_allocation_domain = flat_vector_allocation_domain,
-       .apic_id_registered = flat_apic_id_registered,
-       .init_apic_ldr = flat_init_apic_ldr,
-       .send_IPI_all = flat_send_IPI_all,
-       .send_IPI_allbutself = flat_send_IPI_allbutself,
-       .send_IPI_mask = flat_send_IPI_mask,
-       .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself,
-       .send_IPI_self = apic_send_IPI_self,
-       .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
-       .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and,
-       .phys_pkg_id = phys_pkg_id,
-       .get_apic_id = get_apic_id,
-       .set_apic_id = set_apic_id,
-       .apic_id_mask = (0xFFu<<24),
+       .name                           = "flat",
+       .probe                          = NULL,
+       .acpi_madt_oem_check            = flat_acpi_madt_oem_check,
+       .apic_id_registered             = flat_apic_id_registered,
+
+       .irq_delivery_mode              = dest_LowestPrio,
+       .irq_dest_mode                  = 1, /* logical */
+
+       .target_cpus                    = flat_target_cpus,
+       .disable_esr                    = 0,
+       .dest_logical                   = APIC_DEST_LOGICAL,
+       .check_apicid_used              = NULL,
+       .check_apicid_present           = NULL,
+
+       .vector_allocation_domain       = flat_vector_allocation_domain,
+       .init_apic_ldr                  = flat_init_apic_ldr,
+
+       .ioapic_phys_id_map             = NULL,
+       .setup_apic_routing             = NULL,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = NULL,
+       .cpu_to_logical_apicid          = NULL,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = NULL,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = flat_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = flat_get_apic_id,
+       .set_apic_id                    = set_apic_id,
+       .apic_id_mask                   = 0xFFu << 24,
+
+       .cpu_mask_to_apicid             = flat_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = flat_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = flat_send_IPI_mask,
+       .send_IPI_mask_allbutself       = flat_send_IPI_mask_allbutself,
+       .send_IPI_allbutself            = flat_send_IPI_allbutself,
+       .send_IPI_all                   = flat_send_IPI_all,
+       .send_IPI_self                  = apic_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+       .wait_for_init_deassert         = NULL,
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = NULL,
 };
 
 /*
@@ -232,18 +267,18 @@ static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)
 
 static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
 {
-       send_IPI_mask_sequence(cpumask, vector);
+       default_send_IPI_mask_sequence_phys(cpumask, vector);
 }
 
 static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
                                              int vector)
 {
-       send_IPI_mask_allbutself(cpumask, vector);
+       default_send_IPI_mask_allbutself_phys(cpumask, vector);
 }
 
 static void physflat_send_IPI_allbutself(int vector)
 {
-       send_IPI_mask_allbutself(cpu_online_mask, vector);
+       default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
 }
 
 static void physflat_send_IPI_all(int vector)
@@ -276,32 +311,67 @@ physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one phys APIC ID.
         * May as well be the first.
         */
-       for_each_cpu_and(cpu, cpumask, andmask)
+       for_each_cpu_and(cpu, cpumask, andmask) {
                if (cpumask_test_cpu(cpu, cpu_online_mask))
                        break;
+       }
        if (cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_apicid, cpu);
+
        return BAD_APICID;
 }
 
 struct genapic apic_physflat =  {
-       .name = "physical flat",
-       .acpi_madt_oem_check = physflat_acpi_madt_oem_check,
-       .int_delivery_mode = dest_Fixed,
-       .int_dest_mode = (APIC_DEST_PHYSICAL != 0),
-       .target_cpus = physflat_target_cpus,
-       .vector_allocation_domain = physflat_vector_allocation_domain,
-       .apic_id_registered = flat_apic_id_registered,
-       .init_apic_ldr = flat_init_apic_ldr,/*not needed, but shouldn't hurt*/
-       .send_IPI_all = physflat_send_IPI_all,
-       .send_IPI_allbutself = physflat_send_IPI_allbutself,
-       .send_IPI_mask = physflat_send_IPI_mask,
-       .send_IPI_mask_allbutself = physflat_send_IPI_mask_allbutself,
-       .send_IPI_self = apic_send_IPI_self,
-       .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
-       .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and,
-       .phys_pkg_id = phys_pkg_id,
-       .get_apic_id = get_apic_id,
-       .set_apic_id = set_apic_id,
-       .apic_id_mask = (0xFFu<<24),
+
+       .name                           = "physical flat",
+       .probe                          = NULL,
+       .acpi_madt_oem_check            = physflat_acpi_madt_oem_check,
+       .apic_id_registered             = flat_apic_id_registered,
+
+       .irq_delivery_mode              = dest_Fixed,
+       .irq_dest_mode                  = 0, /* physical */
+
+       .target_cpus                    = physflat_target_cpus,
+       .disable_esr                    = 0,
+       .dest_logical                   = 0,
+       .check_apicid_used              = NULL,
+       .check_apicid_present           = NULL,
+
+       .vector_allocation_domain       = physflat_vector_allocation_domain,
+       /* not needed, but shouldn't hurt: */
+       .init_apic_ldr                  = flat_init_apic_ldr,
+
+       .ioapic_phys_id_map             = NULL,
+       .setup_apic_routing             = NULL,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = NULL,
+       .cpu_to_logical_apicid          = NULL,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = NULL,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = flat_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = flat_get_apic_id,
+       .set_apic_id                    = set_apic_id,
+       .apic_id_mask                   = 0xFFu << 24,
+
+       .cpu_mask_to_apicid             = physflat_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = physflat_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = physflat_send_IPI_mask,
+       .send_IPI_mask_allbutself       = physflat_send_IPI_mask_allbutself,
+       .send_IPI_allbutself            = physflat_send_IPI_allbutself,
+       .send_IPI_all                   = physflat_send_IPI_all,
+       .send_IPI_self                  = apic_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+       .wait_for_init_deassert         = NULL,
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = NULL,
 };
index 6ce497c..7c87156 100644 (file)
@@ -36,8 +36,8 @@ static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
        cpumask_set_cpu(cpu, retmask);
 }
 
-static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
                                 unsigned int dest)
+static void
__x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
 {
        unsigned long cfg;
 
@@ -57,45 +57,50 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
  */
 static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
 {
-       unsigned long flags;
        unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
+       for_each_cpu(query_cpu, mask) {
                __x2apic_send_IPI_dest(
                        per_cpu(x86_cpu_to_logical_apicid, query_cpu),
-                       vector, APIC_DEST_LOGICAL);
+                       vector, apic->dest_logical);
+       }
        local_irq_restore(flags);
 }
 
-static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
                                          int vector)
+static void
x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
 {
-       unsigned long flags;
-       unsigned long query_cpu;
        unsigned long this_cpu = smp_processor_id();
+       unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
-               if (query_cpu != this_cpu)
-                       __x2apic_send_IPI_dest(
+       for_each_cpu(query_cpu, mask) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __x2apic_send_IPI_dest(
                                per_cpu(x86_cpu_to_logical_apicid, query_cpu),
-                               vector, APIC_DEST_LOGICAL);
+                               vector, apic->dest_logical);
+       }
        local_irq_restore(flags);
 }
 
 static void x2apic_send_IPI_allbutself(int vector)
 {
-       unsigned long flags;
-       unsigned long query_cpu;
        unsigned long this_cpu = smp_processor_id();
+       unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_online_cpu(query_cpu)
-               if (query_cpu != this_cpu)
-                       __x2apic_send_IPI_dest(
+       for_each_online_cpu(query_cpu) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __x2apic_send_IPI_dest(
                                per_cpu(x86_cpu_to_logical_apicid, query_cpu),
-                               vector, APIC_DEST_LOGICAL);
+                               vector, apic->dest_logical);
+       }
        local_irq_restore(flags);
 }
 
@@ -111,21 +116,21 @@ static int x2apic_apic_id_registered(void)
 
 static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
-       int cpu;
-
        /*
         * We're using fixed IRQ delivery, can only return one logical APIC ID.
         * May as well be the first.
         */
-       cpu = cpumask_first(cpumask);
+       int cpu = cpumask_first(cpumask);
+
        if ((unsigned)cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_logical_apicid, cpu);
        else
                return BAD_APICID;
 }
 
-static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                                 const struct cpumask *andmask)
+static unsigned int
+x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                             const struct cpumask *andmask)
 {
        int cpu;
 
@@ -133,15 +138,18 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one logical APIC ID.
         * May as well be the first.
         */
-       for_each_cpu_and(cpu, cpumask, andmask)
+       for_each_cpu_and(cpu, cpumask, andmask) {
                if (cpumask_test_cpu(cpu, cpu_online_mask))
                        break;
+       }
+
        if (cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_logical_apicid, cpu);
+
        return BAD_APICID;
 }
 
-static unsigned int get_apic_id(unsigned long x)
+static unsigned int x2apic_cluster_phys_get_apic_id(unsigned long x)
 {
        unsigned int id;
 
@@ -157,7 +165,7 @@ static unsigned long set_apic_id(unsigned int id)
        return x;
 }
 
-static unsigned int phys_pkg_id(int index_msb)
+static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb)
 {
        return current_cpu_data.initial_apicid >> index_msb;
 }
@@ -172,27 +180,58 @@ static void init_x2apic_ldr(void)
        int cpu = smp_processor_id();
 
        per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR);
-       return;
 }
 
 struct genapic apic_x2apic_cluster = {
-       .name = "cluster x2apic",
-       .acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
-       .int_delivery_mode = dest_LowestPrio,
-       .int_dest_mode = (APIC_DEST_LOGICAL != 0),
-       .target_cpus = x2apic_target_cpus,
-       .vector_allocation_domain = x2apic_vector_allocation_domain,
-       .apic_id_registered = x2apic_apic_id_registered,
-       .init_apic_ldr = init_x2apic_ldr,
-       .send_IPI_all = x2apic_send_IPI_all,
-       .send_IPI_allbutself = x2apic_send_IPI_allbutself,
-       .send_IPI_mask = x2apic_send_IPI_mask,
-       .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,
-       .send_IPI_self = x2apic_send_IPI_self,
-       .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
-       .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and,
-       .phys_pkg_id = phys_pkg_id,
-       .get_apic_id = get_apic_id,
-       .set_apic_id = set_apic_id,
-       .apic_id_mask = (0xFFFFFFFFu),
+
+       .name                           = "cluster x2apic",
+       .probe                          = NULL,
+       .acpi_madt_oem_check            = x2apic_acpi_madt_oem_check,
+       .apic_id_registered             = x2apic_apic_id_registered,
+
+       .irq_delivery_mode              = dest_LowestPrio,
+       .irq_dest_mode                  = 1, /* logical */
+
+       .target_cpus                    = x2apic_target_cpus,
+       .disable_esr                    = 0,
+       .dest_logical                   = APIC_DEST_LOGICAL,
+       .check_apicid_used              = NULL,
+       .check_apicid_present           = NULL,
+
+       .vector_allocation_domain       = x2apic_vector_allocation_domain,
+       .init_apic_ldr                  = init_x2apic_ldr,
+
+       .ioapic_phys_id_map             = NULL,
+       .setup_apic_routing             = NULL,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = NULL,
+       .cpu_to_logical_apicid          = NULL,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = NULL,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = x2apic_cluster_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = x2apic_cluster_phys_get_apic_id,
+       .set_apic_id                    = set_apic_id,
+       .apic_id_mask                   = 0xFFFFFFFFu,
+
+       .cpu_mask_to_apicid             = x2apic_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = x2apic_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = x2apic_send_IPI_mask,
+       .send_IPI_mask_allbutself       = x2apic_send_IPI_mask_allbutself,
+       .send_IPI_allbutself            = x2apic_send_IPI_allbutself,
+       .send_IPI_all                   = x2apic_send_IPI_all,
+       .send_IPI_self                  = x2apic_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+       .wait_for_init_deassert         = NULL,
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = NULL,
 };
index 21bcc0e..5cbae8a 100644 (file)
@@ -55,8 +55,8 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
 
 static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
 {
-       unsigned long flags;
        unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
        for_each_cpu(query_cpu, mask) {
@@ -66,12 +66,12 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
        local_irq_restore(flags);
 }
 
-static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
                                          int vector)
+static void
x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
 {
-       unsigned long flags;
-       unsigned long query_cpu;
        unsigned long this_cpu = smp_processor_id();
+       unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
        for_each_cpu(query_cpu, mask) {
@@ -85,16 +85,17 @@ static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
 
 static void x2apic_send_IPI_allbutself(int vector)
 {
-       unsigned long flags;
-       unsigned long query_cpu;
        unsigned long this_cpu = smp_processor_id();
+       unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_online_cpu(query_cpu)
-               if (query_cpu != this_cpu)
-                       __x2apic_send_IPI_dest(
-                               per_cpu(x86_cpu_to_apicid, query_cpu),
-                               vector, APIC_DEST_PHYSICAL);
+       for_each_online_cpu(query_cpu) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
+                                      vector, APIC_DEST_PHYSICAL);
+       }
        local_irq_restore(flags);
 }
 
@@ -110,21 +111,21 @@ static int x2apic_apic_id_registered(void)
 
 static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
-       int cpu;
-
        /*
         * We're using fixed IRQ delivery, can only return one phys APIC ID.
         * May as well be the first.
         */
-       cpu = cpumask_first(cpumask);
+       int cpu = cpumask_first(cpumask);
+
        if ((unsigned)cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_apicid, cpu);
        else
                return BAD_APICID;
 }
 
-static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                                 const struct cpumask *andmask)
+static unsigned int
+x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                             const struct cpumask *andmask)
 {
        int cpu;
 
@@ -132,31 +133,28 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one phys APIC ID.
         * May as well be the first.
         */
-       for_each_cpu_and(cpu, cpumask, andmask)
+       for_each_cpu_and(cpu, cpumask, andmask) {
                if (cpumask_test_cpu(cpu, cpu_online_mask))
                        break;
+       }
+
        if (cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_apicid, cpu);
+
        return BAD_APICID;
 }
 
-static unsigned int get_apic_id(unsigned long x)
+static unsigned int x2apic_phys_get_apic_id(unsigned long x)
 {
-       unsigned int id;
-
-       id = x;
-       return id;
+       return x;
 }
 
 static unsigned long set_apic_id(unsigned int id)
 {
-       unsigned long x;
-
-       x = id;
-       return x;
+       return id;
 }
 
-static unsigned int phys_pkg_id(int index_msb)
+static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
 {
        return current_cpu_data.initial_apicid >> index_msb;
 }
@@ -168,27 +166,58 @@ static void x2apic_send_IPI_self(int vector)
 
 static void init_x2apic_ldr(void)
 {
-       return;
 }
 
 struct genapic apic_x2apic_phys = {
-       .name = "physical x2apic",
-       .acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
-       .int_delivery_mode = dest_Fixed,
-       .int_dest_mode = (APIC_DEST_PHYSICAL != 0),
-       .target_cpus = x2apic_target_cpus,
-       .vector_allocation_domain = x2apic_vector_allocation_domain,
-       .apic_id_registered = x2apic_apic_id_registered,
-       .init_apic_ldr = init_x2apic_ldr,
-       .send_IPI_all = x2apic_send_IPI_all,
-       .send_IPI_allbutself = x2apic_send_IPI_allbutself,
-       .send_IPI_mask = x2apic_send_IPI_mask,
-       .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,
-       .send_IPI_self = x2apic_send_IPI_self,
-       .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
-       .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and,
-       .phys_pkg_id = phys_pkg_id,
-       .get_apic_id = get_apic_id,
-       .set_apic_id = set_apic_id,
-       .apic_id_mask = (0xFFFFFFFFu),
+
+       .name                           = "physical x2apic",
+       .probe                          = NULL,
+       .acpi_madt_oem_check            = x2apic_acpi_madt_oem_check,
+       .apic_id_registered             = x2apic_apic_id_registered,
+
+       .irq_delivery_mode              = dest_Fixed,
+       .irq_dest_mode                  = 0, /* physical */
+
+       .target_cpus                    = x2apic_target_cpus,
+       .disable_esr                    = 0,
+       .dest_logical                   = 0,
+       .check_apicid_used              = NULL,
+       .check_apicid_present           = NULL,
+
+       .vector_allocation_domain       = x2apic_vector_allocation_domain,
+       .init_apic_ldr                  = init_x2apic_ldr,
+
+       .ioapic_phys_id_map             = NULL,
+       .setup_apic_routing             = NULL,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = NULL,
+       .cpu_to_logical_apicid          = NULL,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = NULL,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = x2apic_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = x2apic_phys_get_apic_id,
+       .set_apic_id                    = set_apic_id,
+       .apic_id_mask                   = 0xFFFFFFFFu,
+
+       .cpu_mask_to_apicid             = x2apic_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = x2apic_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = x2apic_send_IPI_mask,
+       .send_IPI_mask_allbutself       = x2apic_send_IPI_mask_allbutself,
+       .send_IPI_allbutself            = x2apic_send_IPI_allbutself,
+       .send_IPI_all                   = x2apic_send_IPI_all,
+       .send_IPI_self                  = x2apic_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+       .wait_for_init_deassert         = NULL,
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = NULL,
 };
index bfe3624..6adb5e6 100644 (file)
@@ -118,12 +118,13 @@ static void uv_send_IPI_one(int cpu, int vector)
        int pnode;
 
        apicid = per_cpu(x86_cpu_to_apicid, cpu);
-       lapicid = apicid & 0x3f;                /* ZZZ macro needed */
+       lapicid = apicid & 0x3f; /* ZZZ macro needed */
        pnode = uv_apicid_to_pnode(apicid);
-       val =
-           (1UL << UVH_IPI_INT_SEND_SHFT) | (lapicid <<
-                                             UVH_IPI_INT_APIC_ID_SHFT) |
-           (vector << UVH_IPI_INT_VECTOR_SHFT);
+
+       val = (     1UL << UVH_IPI_INT_SEND_SHFT    ) |
+             ( lapicid << UVH_IPI_INT_APIC_ID_SHFT ) |
+             (  vector << UVH_IPI_INT_VECTOR_SHFT  );
+
        uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
 }
 
@@ -137,22 +138,24 @@ static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
 
 static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
 {
-       unsigned int cpu;
        unsigned int this_cpu = smp_processor_id();
+       unsigned int cpu;
 
-       for_each_cpu(cpu, mask)
+       for_each_cpu(cpu, mask) {
                if (cpu != this_cpu)
                        uv_send_IPI_one(cpu, vector);
+       }
 }
 
 static void uv_send_IPI_allbutself(int vector)
 {
-       unsigned int cpu;
        unsigned int this_cpu = smp_processor_id();
+       unsigned int cpu;
 
-       for_each_online_cpu(cpu)
+       for_each_online_cpu(cpu) {
                if (cpu != this_cpu)
                        uv_send_IPI_one(cpu, vector);
+       }
 }
 
 static void uv_send_IPI_all(int vector)
@@ -171,21 +174,21 @@ static void uv_init_apic_ldr(void)
 
 static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
-       int cpu;
-
        /*
         * We're using fixed IRQ delivery, can only return one phys APIC ID.
         * May as well be the first.
         */
-       cpu = cpumask_first(cpumask);
+       int cpu = cpumask_first(cpumask);
+
        if ((unsigned)cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_apicid, cpu);
        else
                return BAD_APICID;
 }
 
-static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                             const struct cpumask *andmask)
+static unsigned int
+uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                         const struct cpumask *andmask)
 {
        int cpu;
 
@@ -193,15 +196,17 @@ static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one phys APIC ID.
         * May as well be the first.
         */
-       for_each_cpu_and(cpu, cpumask, andmask)
+       for_each_cpu_and(cpu, cpumask, andmask) {
                if (cpumask_test_cpu(cpu, cpu_online_mask))
                        break;
+       }
        if (cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_apicid, cpu);
+
        return BAD_APICID;
 }
 
-static unsigned int get_apic_id(unsigned long x)
+static unsigned int x2apic_get_apic_id(unsigned long x)
 {
        unsigned int id;
 
@@ -223,10 +228,10 @@ static unsigned long set_apic_id(unsigned int id)
 static unsigned int uv_read_apic_id(void)
 {
 
-       return get_apic_id(apic_read(APIC_ID));
+       return x2apic_get_apic_id(apic_read(APIC_ID));
 }
 
-static unsigned int phys_pkg_id(int index_msb)
+static int uv_phys_pkg_id(int initial_apicid, int index_msb)
 {
        return uv_read_apic_id() >> index_msb;
 }
@@ -237,25 +242,57 @@ static void uv_send_IPI_self(int vector)
 }
 
 struct genapic apic_x2apic_uv_x = {
-       .name = "UV large system",
-       .acpi_madt_oem_check = uv_acpi_madt_oem_check,
-       .int_delivery_mode = dest_Fixed,
-       .int_dest_mode = (APIC_DEST_PHYSICAL != 0),
-       .target_cpus = uv_target_cpus,
-       .vector_allocation_domain = uv_vector_allocation_domain,
-       .apic_id_registered = uv_apic_id_registered,
-       .init_apic_ldr = uv_init_apic_ldr,
-       .send_IPI_all = uv_send_IPI_all,
-       .send_IPI_allbutself = uv_send_IPI_allbutself,
-       .send_IPI_mask = uv_send_IPI_mask,
-       .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself,
-       .send_IPI_self = uv_send_IPI_self,
-       .cpu_mask_to_apicid = uv_cpu_mask_to_apicid,
-       .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and,
-       .phys_pkg_id = phys_pkg_id,
-       .get_apic_id = get_apic_id,
-       .set_apic_id = set_apic_id,
-       .apic_id_mask = (0xFFFFFFFFu),
+
+       .name                           = "UV large system",
+       .probe                          = NULL,
+       .acpi_madt_oem_check            = uv_acpi_madt_oem_check,
+       .apic_id_registered             = uv_apic_id_registered,
+
+       .irq_delivery_mode              = dest_Fixed,
+       .irq_dest_mode                  = 1, /* logical */
+
+       .target_cpus                    = uv_target_cpus,
+       .disable_esr                    = 0,
+       .dest_logical                   = APIC_DEST_LOGICAL,
+       .check_apicid_used              = NULL,
+       .check_apicid_present           = NULL,
+
+       .vector_allocation_domain       = uv_vector_allocation_domain,
+       .init_apic_ldr                  = uv_init_apic_ldr,
+
+       .ioapic_phys_id_map             = NULL,
+       .setup_apic_routing             = NULL,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = NULL,
+       .cpu_to_logical_apicid          = NULL,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = NULL,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = uv_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = x2apic_get_apic_id,
+       .set_apic_id                    = set_apic_id,
+       .apic_id_mask                   = 0xFFFFFFFFu,
+
+       .cpu_mask_to_apicid             = uv_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = uv_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = uv_send_IPI_mask,
+       .send_IPI_mask_allbutself       = uv_send_IPI_mask_allbutself,
+       .send_IPI_allbutself            = uv_send_IPI_allbutself,
+       .send_IPI_all                   = uv_send_IPI_all,
+       .send_IPI_self                  = uv_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+       .wait_for_init_deassert         = NULL,
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = NULL,
 };
 
 static __cpuinit void set_x2apic_extra_bits(int pnode)
index 24c0e5c..722464c 100644 (file)
@@ -548,12 +548,8 @@ early_fault:
        pushl %eax
        pushl %edx              /* trapno */
        pushl $fault_msg
-#ifdef CONFIG_EARLY_PRINTK
-       call early_printk
-#else
        call printk
 #endif
-#endif
        call dump_stack
 hlt_loop:
        hlt
@@ -580,11 +576,10 @@ ignore_int:
        pushl 32(%esp)
        pushl 40(%esp)
        pushl $int_msg
-#ifdef CONFIG_EARLY_PRINTK
-       call early_printk
-#else
        call printk
-#endif
+
+       call dump_stack
+
        addl $(5*4),%esp
        popl %ds
        popl %es
@@ -660,7 +655,7 @@ early_recursion_flag:
        .long 0
 
 int_msg:
-       .asciz "Unknown interrupt or fault at EIP %p %p %p\n"
+       .asciz "Unknown interrupt or fault at: %p %p %p\n"
 
 fault_msg:
 /* fault info: */
index e4d36bd..56e51eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Intel IO-APIC support for multi-Pentium hosts.
  *
- *     Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar, Hajnalka Szabo
+ *     Copyright (C) 1997, 1998, 1999, 2000, 2009 Ingo Molnar, Hajnalka Szabo
  *
  *     Many thanks to Stig Venaas for trying out countless experimental
  *     patches and reporting/debugging problems patiently!
@@ -62,9 +62,7 @@
 #include <asm/uv/uv_hub.h>
 #include <asm/uv/uv_irq.h>
 
-#include <mach_ipi.h>
-#include <mach_apic.h>
-#include <mach_apicdef.h>
+#include <asm/genapic.h>
 
 #define __apicdebuginit(type) static type __init
 
@@ -100,10 +98,19 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
 
 int skip_ioapic_setup;
 
+void arch_disable_smp_support(void)
+{
+#ifdef CONFIG_PCI
+       noioapicquirk = 1;
+       noioapicreroute = -1;
+#endif
+       skip_ioapic_setup = 1;
+}
+
 static int __init parse_noapic(char *str)
 {
        /* disable IO-APIC */
-       disable_ioapic_setup();
+       arch_disable_smp_support();
        return 0;
 }
 early_param("noapic", parse_noapic);
@@ -514,11 +521,11 @@ static void send_cleanup_vector(struct irq_cfg *cfg)
                for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
                        cfg->move_cleanup_count++;
                for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
-                       send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
+                       apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
        } else {
                cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
                cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
-               send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
+               apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
                free_cpumask_var(cleanup_mask);
        }
        cfg->move_in_progress = 0;
@@ -563,8 +570,9 @@ static int
 assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);
 
 /*
- * Either sets desc->affinity to a valid value, and returns cpu_mask_to_apicid
- * of that, or returns BAD_APICID and leaves desc->affinity untouched.
+ * Either sets desc->affinity to a valid value, and returns
+ * ->cpu_mask_to_apicid of that, or returns BAD_APICID and
+ * leaves desc->affinity untouched.
  */
 static unsigned int
 set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
@@ -582,7 +590,8 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
 
        cpumask_and(desc->affinity, cfg->domain, mask);
        set_extra_move_desc(desc, mask);
-       return cpu_mask_to_apicid_and(desc->affinity, cpu_online_mask);
+
+       return apic->cpu_mask_to_apicid_and(desc->affinity, cpu_online_mask);
 }
 
 static void
@@ -797,23 +806,6 @@ static void clear_IO_APIC (void)
                        clear_IO_APIC_pin(apic, pin);
 }
 
-#if !defined(CONFIG_SMP) && defined(CONFIG_X86_32)
-void send_IPI_self(int vector)
-{
-       unsigned int cfg;
-
-       /*
-        * Wait for idle.
-        */
-       apic_wait_icr_idle();
-       cfg = APIC_DM_FIXED | APIC_DEST_SELF | vector | APIC_DEST_LOGICAL;
-       /*
-        * Send the IPI. The write to APIC_ICR fires this off.
-        */
-       apic_write(APIC_ICR, cfg);
-}
-#endif /* !CONFIG_SMP && CONFIG_X86_32*/
-
 #ifdef CONFIG_X86_32
 /*
  * support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to
@@ -1316,7 +1308,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
                int new_cpu;
                int vector, offset;
 
-               vector_allocation_domain(cpu, tmp_mask);
+               apic->vector_allocation_domain(cpu, tmp_mask);
 
                vector = current_vector;
                offset = current_offset;
@@ -1486,7 +1478,7 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
                                              handle_edge_irq, "edge");
 }
 
-static int setup_ioapic_entry(int apic, int irq,
+static int setup_ioapic_entry(int apic_id, int irq,
                              struct IO_APIC_route_entry *entry,
                              unsigned int destination, int trigger,
                              int polarity, int vector)
@@ -1498,25 +1490,25 @@ static int setup_ioapic_entry(int apic, int irq,
 
 #ifdef CONFIG_INTR_REMAP
        if (intr_remapping_enabled) {
-               struct intel_iommu *iommu = map_ioapic_to_ir(apic);
+               struct intel_iommu *iommu = map_ioapic_to_ir(apic_id);
                struct irte irte;
                struct IR_IO_APIC_route_entry *ir_entry =
                        (struct IR_IO_APIC_route_entry *) entry;
                int index;
 
                if (!iommu)
-                       panic("No mapping iommu for ioapic %d\n", apic);
+                       panic("No mapping iommu for ioapic %d\n", apic_id);
 
                index = alloc_irte(iommu, irq, 1);
                if (index < 0)
-                       panic("Failed to allocate IRTE for ioapic %d\n", apic);
+                       panic("Failed to allocate IRTE for ioapic %d\n", apic_id);
 
                memset(&irte, 0, sizeof(irte));
 
                irte.present = 1;
-               irte.dst_mode = INT_DEST_MODE;
+               irte.dst_mode = apic->irq_dest_mode;
                irte.trigger_mode = trigger;
-               irte.dlvry_mode = INT_DELIVERY_MODE;
+               irte.dlvry_mode = apic->irq_delivery_mode;
                irte.vector = vector;
                irte.dest_id = IRTE_DEST(destination);
 
@@ -1529,8 +1521,8 @@ static int setup_ioapic_entry(int apic, int irq,
        } else
 #endif
        {
-               entry->delivery_mode = INT_DELIVERY_MODE;
-               entry->dest_mode = INT_DEST_MODE;
+               entry->delivery_mode = apic->irq_delivery_mode;
+               entry->dest_mode = apic->irq_dest_mode;
                entry->dest = destination;
        }
 
@@ -1547,7 +1539,7 @@ static int setup_ioapic_entry(int apic, int irq,
        return 0;
 }
 
-static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_desc *desc,
+static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq_desc *desc,
                              int trigger, int polarity)
 {
        struct irq_cfg *cfg;
@@ -1559,22 +1551,22 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
 
        cfg = desc->chip_data;
 
-       if (assign_irq_vector(irq, cfg, TARGET_CPUS))
+       if (assign_irq_vector(irq, cfg, apic->target_cpus()))
                return;
 
-       dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
+       dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
 
        apic_printk(APIC_VERBOSE,KERN_DEBUG
                    "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
                    "IRQ %d Mode:%i Active:%i)\n",
-                   apic, mp_ioapics[apic].apicid, pin, cfg->vector,
+                   apic_id, mp_ioapics[apic_id].apicid, pin, cfg->vector,
                    irq, trigger, polarity);
 
 
-       if (setup_ioapic_entry(mp_ioapics[apic].apicid, irq, &entry,
+       if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry,
                               dest, trigger, polarity, cfg->vector)) {
                printk("Failed to setup ioapic entry for ioapic  %d, pin %d\n",
-                      mp_ioapics[apic].apicid, pin);
+                      mp_ioapics[apic_id].apicid, pin);
                __clear_irq_vector(irq, cfg);
                return;
        }
@@ -1583,12 +1575,12 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
        if (irq < NR_IRQS_LEGACY)
                disable_8259A_irq(irq);
 
-       ioapic_write_entry(apic, pin, entry);
+       ioapic_write_entry(apic_id, pin, entry);
 }
 
 static void __init setup_IO_APIC_irqs(void)
 {
-       int apic, pin, idx, irq;
+       int apic_id, pin, idx, irq;
        int notcon = 0;
        struct irq_desc *desc;
        struct irq_cfg *cfg;
@@ -1596,19 +1588,19 @@ static void __init setup_IO_APIC_irqs(void)
 
        apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n");
 
-       for (apic = 0; apic < nr_ioapics; apic++) {
-               for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
+       for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
+               for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) {
 
-                       idx = find_irq_entry(apic, pin, mp_INT);
+                       idx = find_irq_entry(apic_id, pin, mp_INT);
                        if (idx == -1) {
                                if (!notcon) {
                                        notcon = 1;
                                        apic_printk(APIC_VERBOSE,
                                                KERN_DEBUG " %d-%d",
-                                               mp_ioapics[apic].apicid, pin);
+                                               mp_ioapics[apic_id].apicid, pin);
                                } else
                                        apic_printk(APIC_VERBOSE, " %d-%d",
-                                               mp_ioapics[apic].apicid, pin);
+                                               mp_ioapics[apic_id].apicid, pin);
                                continue;
                        }
                        if (notcon) {
@@ -1617,20 +1609,25 @@ static void __init setup_IO_APIC_irqs(void)
                                notcon = 0;
                        }
 
-                       irq = pin_2_irq(idx, apic, pin);
-#ifdef CONFIG_X86_32
-                       if (multi_timer_check(apic, irq))
+                       irq = pin_2_irq(idx, apic_id, pin);
+
+                       /*
+                        * Skip the timer IRQ if there's a quirk handler
+                        * installed and if it returns 1:
+                        */
+                       if (apic->multi_timer_check &&
+                                       apic->multi_timer_check(apic_id, irq))
                                continue;
-#endif
+
                        desc = irq_to_desc_alloc_cpu(irq, cpu);
                        if (!desc) {
                                printk(KERN_INFO "can not get irq_desc for %d\n", irq);
                                continue;
                        }
                        cfg = desc->chip_data;
-                       add_pin_to_irq_cpu(cfg, cpu, apic, pin);
+                       add_pin_to_irq_cpu(cfg, cpu, apic_id, pin);
 
-                       setup_IO_APIC_irq(apic, pin, irq, desc,
+                       setup_IO_APIC_irq(apic_id, pin, irq, desc,
                                        irq_trigger(idx), irq_polarity(idx));
                }
        }
@@ -1643,7 +1640,7 @@ static void __init setup_IO_APIC_irqs(void)
 /*
  * Set up the timer pin, possibly with the 8259A-master behind.
  */
-static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
+static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
                                        int vector)
 {
        struct IO_APIC_route_entry entry;
@@ -1659,10 +1656,10 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
         * We use logical delivery to get the timer IRQ
         * to the first CPU.
         */
-       entry.dest_mode = INT_DEST_MODE;
-       entry.mask = 1;                                 /* mask IRQ now */
-       entry.dest = cpu_mask_to_apicid(TARGET_CPUS);
-       entry.delivery_mode = INT_DELIVERY_MODE;
+       entry.dest_mode = apic->irq_dest_mode;
+       entry.mask = 0;                 /* don't mask IRQ for edge */
+       entry.dest = apic->cpu_mask_to_apicid(apic->target_cpus());
+       entry.delivery_mode = apic->irq_delivery_mode;
        entry.polarity = 0;
        entry.trigger = 0;
        entry.vector = vector;
@@ -1676,7 +1673,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
        /*
         * Add it to the IO-APIC irq-routing table:
         */
-       ioapic_write_entry(apic, pin, entry);
+       ioapic_write_entry(apic_id, pin, entry);
 }
 
 
@@ -2089,7 +2086,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
 {
        union IO_APIC_reg_00 reg_00;
        physid_mask_t phys_id_present_map;
-       int apic;
+       int apic_id;
        int i;
        unsigned char old_id;
        unsigned long flags;
@@ -2108,26 +2105,26 @@ static void __init setup_ioapic_ids_from_mpc(void)
         * This is broken; anything with a real cpu count has to
         * circumvent this idiocy regardless.
         */
-       phys_id_present_map = ioapic_phys_id_map(phys_cpu_present_map);
+       phys_id_present_map = apic->ioapic_phys_id_map(phys_cpu_present_map);
 
        /*
         * Set the IOAPIC ID to the value stored in the MPC table.
         */
-       for (apic = 0; apic < nr_ioapics; apic++) {
+       for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
 
                /* Read the register 0 value */
                spin_lock_irqsave(&ioapic_lock, flags);
-               reg_00.raw = io_apic_read(apic, 0);
+               reg_00.raw = io_apic_read(apic_id, 0);
                spin_unlock_irqrestore(&ioapic_lock, flags);
 
-               old_id = mp_ioapics[apic].apicid;
+               old_id = mp_ioapics[apic_id].apicid;
 
-               if (mp_ioapics[apic].apicid >= get_physical_broadcast()) {
+               if (mp_ioapics[apic_id].apicid >= get_physical_broadcast()) {
                        printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
-                               apic, mp_ioapics[apic].apicid);
+                               apic_id, mp_ioapics[apic_id].apicid);
                        printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
                                reg_00.bits.ID);
-                       mp_ioapics[apic].apicid = reg_00.bits.ID;
+                       mp_ioapics[apic_id].apicid = reg_00.bits.ID;
                }
 
                /*
@@ -2135,10 +2132,10 @@ static void __init setup_ioapic_ids_from_mpc(void)
                 * system must have a unique ID or we get lots of nice
                 * 'stuck on smp_invalidate_needed IPI wait' messages.
                 */
-               if (check_apicid_used(phys_id_present_map,
-                                       mp_ioapics[apic].apicid)) {
+               if (apic->check_apicid_used(phys_id_present_map,
+                                       mp_ioapics[apic_id].apicid)) {
                        printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
-                               apic, mp_ioapics[apic].apicid);
+                               apic_id, mp_ioapics[apic_id].apicid);
                        for (i = 0; i < get_physical_broadcast(); i++)
                                if (!physid_isset(i, phys_id_present_map))
                                        break;
@@ -2147,13 +2144,13 @@ static void __init setup_ioapic_ids_from_mpc(void)
                        printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
                                i);
                        physid_set(i, phys_id_present_map);
-                       mp_ioapics[apic].apicid = i;
+                       mp_ioapics[apic_id].apicid = i;
                } else {
                        physid_mask_t tmp;
-                       tmp = apicid_to_cpu_present(mp_ioapics[apic].apicid);
+                       tmp = apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid);
                        apic_printk(APIC_VERBOSE, "Setting %d in the "
                                        "phys_id_present_map\n",
-                                       mp_ioapics[apic].apicid);
+                                       mp_ioapics[apic_id].apicid);
                        physids_or(phys_id_present_map, phys_id_present_map, tmp);
                }
 
@@ -2162,11 +2159,11 @@ static void __init setup_ioapic_ids_from_mpc(void)
                 * We need to adjust the IRQ routing table
                 * if the ID changed.
                 */
-               if (old_id != mp_ioapics[apic].apicid)
+               if (old_id != mp_ioapics[apic_id].apicid)
                        for (i = 0; i < mp_irq_entries; i++)
                                if (mp_irqs[i].dstapic == old_id)
                                        mp_irqs[i].dstapic
-                                               = mp_ioapics[apic].apicid;
+                                               = mp_ioapics[apic_id].apicid;
 
                /*
                 * Read the right value from the MPC table and
@@ -2174,20 +2171,20 @@ static void __init setup_ioapic_ids_from_mpc(void)
                 */
                apic_printk(APIC_VERBOSE, KERN_INFO
                        "...changing IO-APIC physical APIC ID to %d ...",
-                       mp_ioapics[apic].apicid);
+                       mp_ioapics[apic_id].apicid);
 
-               reg_00.bits.ID = mp_ioapics[apic].apicid;
+               reg_00.bits.ID = mp_ioapics[apic_id].apicid;
                spin_lock_irqsave(&ioapic_lock, flags);
-               io_apic_write(apic, 0, reg_00.raw);
+               io_apic_write(apic_id, 0, reg_00.raw);
                spin_unlock_irqrestore(&ioapic_lock, flags);
 
                /*
                 * Sanity check
                 */
                spin_lock_irqsave(&ioapic_lock, flags);
-               reg_00.raw = io_apic_read(apic, 0);
+               reg_00.raw = io_apic_read(apic_id, 0);
                spin_unlock_irqrestore(&ioapic_lock, flags);
-               if (reg_00.bits.ID != mp_ioapics[apic].apicid)
+               if (reg_00.bits.ID != mp_ioapics[apic_id].apicid)
                        printk("could not set ID!\n");
                else
                        apic_printk(APIC_VERBOSE, " ok.\n");
@@ -2290,7 +2287,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
        unsigned long flags;
 
        spin_lock_irqsave(&vector_lock, flags);
-       send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector);
+       apic->send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector);
        spin_unlock_irqrestore(&vector_lock, flags);
 
        return 1;
@@ -2298,7 +2295,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
 #else
 static int ioapic_retrigger_irq(unsigned int irq)
 {
-       send_IPI_self(irq_cfg(irq)->vector);
+       apic->send_IPI_self(irq_cfg(irq)->vector);
 
        return 1;
 }
@@ -2362,7 +2359,7 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
 
        set_extra_move_desc(desc, mask);
 
-       dest = cpu_mask_to_apicid_and(cfg->domain, mask);
+       dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask);
 
        modify_ioapic_rte = desc->status & IRQ_LEVEL;
        if (modify_ioapic_rte) {
@@ -2527,14 +2524,15 @@ static void irq_complete_move(struct irq_desc **descp)
 
        vector = ~get_irq_regs()->orig_ax;
        me = smp_processor_id();
+
+       if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) {
 #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
                *descp = desc = move_irq_desc(desc, me);
                /* get the new one */
                cfg = desc->chip_data;
 #endif
-
-       if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
                send_cleanup_vector(cfg);
+       }
 }
 #else
 static inline void irq_complete_move(struct irq_desc **descp) {}
@@ -2865,19 +2863,15 @@ static inline void __init check_timer(void)
        int cpu = boot_cpu_id;
        int apic1, pin1, apic2, pin2;
        unsigned long flags;
-       unsigned int ver;
        int no_pin1 = 0;
 
        local_irq_save(flags);
 
-       ver = apic_read(APIC_LVR);
-       ver = GET_APIC_VERSION(ver);
-
        /*
         * get/set the timer IRQ vector:
         */
        disable_8259A_irq(0);
-       assign_irq_vector(0, cfg, TARGET_CPUS);
+       assign_irq_vector(0, cfg, apic->target_cpus());
 
        /*
         * As IRQ0 is to be enabled in the 8259A, the virtual
@@ -2891,7 +2885,13 @@ static inline void __init check_timer(void)
        apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
        init_8259A(1);
 #ifdef CONFIG_X86_32
-       timer_ack = (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
+       {
+               unsigned int ver;
+
+               ver = apic_read(APIC_LVR);
+               ver = GET_APIC_VERSION(ver);
+               timer_ack = (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
+       }
 #endif
 
        pin1  = find_isa_irq_pin(0, mp_INT);
@@ -2930,8 +2930,17 @@ static inline void __init check_timer(void)
                if (no_pin1) {
                        add_pin_to_irq_cpu(cfg, cpu, apic1, pin1);
                        setup_timer_IRQ0_pin(apic1, pin1, cfg->vector);
+               } else {
+                       /* for edge trigger, setup_IO_APIC_irq already
+                        * leave it unmasked.
+                        * so only need to unmask if it is level-trigger
+                        * do we really have level trigger timer?
+                        */
+                       int idx;
+                       idx = find_irq_entry(apic1, pin1, mp_INT);
+                       if (idx != -1 && irq_trigger(idx))
+                               unmask_IO_APIC_irq_desc(desc);
                }
-               unmask_IO_APIC_irq_desc(desc);
                if (timer_irq_works()) {
                        if (nmi_watchdog == NMI_IO_APIC) {
                                setup_nmi();
@@ -2945,6 +2954,7 @@ static inline void __init check_timer(void)
                if (intr_remapping_enabled)
                        panic("timer doesn't work through Interrupt-remapped IO-APIC");
 #endif
+               local_irq_disable();
                clear_IO_APIC_pin(apic1, pin1);
                if (!no_pin1)
                        apic_printk(APIC_QUIET, KERN_ERR "..MP-BIOS bug: "
@@ -2959,7 +2969,6 @@ static inline void __init check_timer(void)
                 */
                replace_pin_at_irq_cpu(cfg, cpu, apic1, pin1, apic2, pin2);
                setup_timer_IRQ0_pin(apic2, pin2, cfg->vector);
-               unmask_IO_APIC_irq_desc(desc);
                enable_8259A_irq(0);
                if (timer_irq_works()) {
                        apic_printk(APIC_QUIET, KERN_INFO "....... works.\n");
@@ -2974,6 +2983,7 @@ static inline void __init check_timer(void)
                /*
                 * Cleanup, just in case ...
                 */
+               local_irq_disable();
                disable_8259A_irq(0);
                clear_IO_APIC_pin(apic2, pin2);
                apic_printk(APIC_QUIET, KERN_INFO "....... failed.\n");
@@ -2999,6 +3009,7 @@ static inline void __init check_timer(void)
                apic_printk(APIC_QUIET, KERN_INFO "..... works.\n");
                goto out;
        }
+       local_irq_disable();
        disable_8259A_irq(0);
        apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector);
        apic_printk(APIC_QUIET, KERN_INFO "..... failed.\n");
@@ -3016,6 +3027,7 @@ static inline void __init check_timer(void)
                apic_printk(APIC_QUIET, KERN_INFO "..... works.\n");
                goto out;
        }
+       local_irq_disable();
        apic_printk(APIC_QUIET, KERN_INFO "..... failed :(.\n");
        panic("IO-APIC + timer doesn't work!  Boot with apic=debug and send a "
                "report.  Then try booting with the 'noapic' option.\n");
@@ -3167,6 +3179,7 @@ static int __init ioapic_init_sysfs(void)
 
 device_initcall(ioapic_init_sysfs);
 
+static int nr_irqs_gsi = NR_IRQS_LEGACY;
 /*
  * Dynamic irq allocate and deallocation
  */
@@ -3181,11 +3194,11 @@ unsigned int create_irq_nr(unsigned int irq_want)
        struct irq_desc *desc_new = NULL;
 
        irq = 0;
+       if (irq_want < nr_irqs_gsi)
+               irq_want = nr_irqs_gsi;
+
        spin_lock_irqsave(&vector_lock, flags);
        for (new = irq_want; new < nr_irqs; new++) {
-               if (platform_legacy_irq(new))
-                       continue;
-
                desc_new = irq_to_desc_alloc_cpu(new, cpu);
                if (!desc_new) {
                        printk(KERN_INFO "can not get irq_desc for %d\n", new);
@@ -3195,7 +3208,7 @@ unsigned int create_irq_nr(unsigned int irq_want)
 
                if (cfg_new->vector != 0)
                        continue;
-               if (__assign_irq_vector(new, cfg_new, TARGET_CPUS) == 0)
+               if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
                        irq = new;
                break;
        }
@@ -3210,7 +3223,6 @@ unsigned int create_irq_nr(unsigned int irq_want)
        return irq;
 }
 
-static int nr_irqs_gsi = NR_IRQS_LEGACY;
 int create_irq(void)
 {
        unsigned int irq_want;
@@ -3261,11 +3273,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
                return -ENXIO;
 
        cfg = irq_cfg(irq);
-       err = assign_irq_vector(irq, cfg, TARGET_CPUS);
+       err = assign_irq_vector(irq, cfg, apic->target_cpus());
        if (err)
                return err;
 
-       dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
+       dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
 
 #ifdef CONFIG_INTR_REMAP
        if (irq_remapped(irq)) {
@@ -3279,9 +3291,9 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
                memset (&irte, 0, sizeof(irte));
 
                irte.present = 1;
-               irte.dst_mode = INT_DEST_MODE;
+               irte.dst_mode = apic->irq_dest_mode;
                irte.trigger_mode = 0; /* edge */
-               irte.dlvry_mode = INT_DELIVERY_MODE;
+               irte.dlvry_mode = apic->irq_delivery_mode;
                irte.vector = cfg->vector;
                irte.dest_id = IRTE_DEST(dest);
 
@@ -3299,10 +3311,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
                msg->address_hi = MSI_ADDR_BASE_HI;
                msg->address_lo =
                        MSI_ADDR_BASE_LO |
-                       ((INT_DEST_MODE == 0) ?
+                       ((apic->irq_dest_mode == 0) ?
                                MSI_ADDR_DEST_MODE_PHYSICAL:
                                MSI_ADDR_DEST_MODE_LOGICAL) |
-                       ((INT_DELIVERY_MODE != dest_LowestPrio) ?
+                       ((apic->irq_delivery_mode != dest_LowestPrio) ?
                                MSI_ADDR_REDIRECTION_CPU:
                                MSI_ADDR_REDIRECTION_LOWPRI) |
                        MSI_ADDR_DEST_ID(dest);
@@ -3310,7 +3322,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
                msg->data =
                        MSI_DATA_TRIGGER_EDGE |
                        MSI_DATA_LEVEL_ASSERT |
-                       ((INT_DELIVERY_MODE != dest_LowestPrio) ?
+                       ((apic->irq_delivery_mode != dest_LowestPrio) ?
                                MSI_DATA_DELIVERY_FIXED:
                                MSI_DATA_DELIVERY_LOWPRI) |
                        MSI_DATA_VECTOR(cfg->vector);
@@ -3465,40 +3477,6 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
        return 0;
 }
 
-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc)
-{
-       unsigned int irq;
-       int ret;
-       unsigned int irq_want;
-
-       irq_want = nr_irqs_gsi;
-       irq = create_irq_nr(irq_want);
-       if (irq == 0)
-               return -1;
-
-#ifdef CONFIG_INTR_REMAP
-       if (!intr_remapping_enabled)
-               goto no_ir;
-
-       ret = msi_alloc_irte(dev, irq, 1);
-       if (ret < 0)
-               goto error;
-no_ir:
-#endif
-       ret = setup_msi_irq(dev, msidesc, irq);
-       if (ret < 0) {
-               destroy_irq(irq);
-               return ret;
-       }
-       return 0;
-
-#ifdef CONFIG_INTR_REMAP
-error:
-       destroy_irq(irq);
-       return ret;
-#endif
-}
-
 int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
        unsigned int irq;
@@ -3515,9 +3493,9 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
        sub_handle = 0;
        list_for_each_entry(msidesc, &dev->msi_list, list) {
                irq = create_irq_nr(irq_want);
-               irq_want++;
                if (irq == 0)
                        return -1;
+               irq_want = irq + 1;
 #ifdef CONFIG_INTR_REMAP
                if (!intr_remapping_enabled)
                        goto no_ir;
@@ -3732,12 +3710,13 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                return -ENXIO;
 
        cfg = irq_cfg(irq);
-       err = assign_irq_vector(irq, cfg, TARGET_CPUS);
+       err = assign_irq_vector(irq, cfg, apic->target_cpus());
        if (!err) {
                struct ht_irq_msg msg;
                unsigned dest;
 
-               dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
+               dest = apic->cpu_mask_to_apicid_and(cfg->domain,
+                                                   apic->target_cpus());
 
                msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
 
@@ -3745,11 +3724,11 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                        HT_IRQ_LOW_BASE |
                        HT_IRQ_LOW_DEST_ID(dest) |
                        HT_IRQ_LOW_VECTOR(cfg->vector) |
-                       ((INT_DEST_MODE == 0) ?
+                       ((apic->irq_dest_mode == 0) ?
                                HT_IRQ_LOW_DM_PHYSICAL :
                                HT_IRQ_LOW_DM_LOGICAL) |
                        HT_IRQ_LOW_RQEOI_EDGE |
-                       ((INT_DELIVERY_MODE != dest_LowestPrio) ?
+                       ((apic->irq_delivery_mode != dest_LowestPrio) ?
                                HT_IRQ_LOW_MT_FIXED :
                                HT_IRQ_LOW_MT_ARBITRATED) |
                        HT_IRQ_LOW_IRQ_MASKED;
@@ -3797,12 +3776,12 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
        BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
 
        entry->vector = cfg->vector;
-       entry->delivery_mode = INT_DELIVERY_MODE;
-       entry->dest_mode = INT_DEST_MODE;
+       entry->delivery_mode = apic->irq_delivery_mode;
+       entry->dest_mode = apic->irq_dest_mode;
        entry->polarity = 0;
        entry->trigger = 0;
        entry->mask = 0;
-       entry->dest = cpu_mask_to_apicid(eligible_cpu);
+       entry->dest = apic->cpu_mask_to_apicid(eligible_cpu);
 
        mmr_pnode = uv_blade_to_pnode(mmr_blade);
        uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
@@ -3845,14 +3824,24 @@ int __init io_apic_get_redir_entries (int ioapic)
 
 void __init probe_nr_irqs_gsi(void)
 {
-       int idx;
        int nr = 0;
 
-       for (idx = 0; idx < nr_ioapics; idx++)
-               nr += io_apic_get_redir_entries(idx) + 1;
-
-       if (nr > nr_irqs_gsi)
+       nr = acpi_probe_gsi();
+       if (nr > nr_irqs_gsi) {
                nr_irqs_gsi = nr;
+       } else {
+               /* for acpi=off or acpi is not compiled in */
+               int idx;
+
+               nr = 0;
+               for (idx = 0; idx < nr_ioapics; idx++)
+                       nr += io_apic_get_redir_entries(idx) + 1;
+
+               if (nr > nr_irqs_gsi)
+                       nr_irqs_gsi = nr;
+       }
+
+       printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
 }
 
 #ifdef CONFIG_SPARSE_IRQ
@@ -3860,11 +3849,17 @@ int __init arch_probe_nr_irqs(void)
 {
        int nr;
 
-       nr = ((8 * nr_cpu_ids) > (32 * nr_ioapics) ?
-               (NR_VECTORS + (8 * nr_cpu_ids)) :
-               (NR_VECTORS + (32 * nr_ioapics)));
+       if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
+               nr_irqs = NR_VECTORS * nr_cpu_ids;
 
-       if (nr < nr_irqs && nr > nr_irqs_gsi)
+       nr = nr_irqs_gsi + 8 * nr_cpu_ids;
+#if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ)
+       /*
+        * for MSI and HT dyn irq
+        */
+       nr += nr_irqs_gsi * 16;
+#endif
+       if (nr < nr_irqs)
                nr_irqs = nr;
 
        return 0;
@@ -3896,7 +3891,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
         */
 
        if (physids_empty(apic_id_map))
-               apic_id_map = ioapic_phys_id_map(phys_cpu_present_map);
+               apic_id_map = apic->ioapic_phys_id_map(phys_cpu_present_map);
 
        spin_lock_irqsave(&ioapic_lock, flags);
        reg_00.raw = io_apic_read(ioapic, 0);
@@ -3912,10 +3907,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
         * Every APIC in a system must have a unique ID or we get lots of nice
         * 'stuck on smp_invalidate_needed IPI wait' messages.
         */
-       if (check_apicid_used(apic_id_map, apic_id)) {
+       if (apic->check_apicid_used(apic_id_map, apic_id)) {
 
                for (i = 0; i < get_physical_broadcast(); i++) {
-                       if (!check_apicid_used(apic_id_map, i))
+                       if (!apic->check_apicid_used(apic_id_map, i))
                                break;
                }
 
@@ -3928,7 +3923,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
                apic_id = i;
        }
 
-       tmp = apicid_to_cpu_present(apic_id);
+       tmp = apic->apicid_to_cpu_present(apic_id);
        physids_or(apic_id_map, apic_id_map, tmp);
 
        if (reg_00.bits.ID != apic_id) {
@@ -4021,7 +4016,7 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
 /*
  * This function currently is only a helper for the i386 smp boot process where
  * we need to reprogram the ioredtbls to cater for the cpus which have come online
- * so mask in all cases should simply be TARGET_CPUS
+ * so mask in all cases should simply be apic->target_cpus()
  */
 #ifdef CONFIG_SMP
 void __init setup_ioapic_dest(void)
@@ -4062,7 +4057,7 @@ void __init setup_ioapic_dest(void)
                            (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
                                mask = desc->affinity;
                        else
-                               mask = TARGET_CPUS;
+                               mask = apic->target_cpus();
 
 #ifdef CONFIG_INTR_REMAP
                        if (intr_remapping_enabled)
index 285bbf8..dbf5445 100644 (file)
 #include <asm/mmu_context.h>
 #include <asm/apic.h>
 #include <asm/proto.h>
+#include <asm/ipi.h>
 
-#ifdef CONFIG_X86_32
-#include <mach_apic.h>
-#include <mach_ipi.h>
-
-/*
- * the following functions deal with sending IPIs between CPUs.
- *
- * We use 'broadcast', CPU->CPU IPIs and self-IPIs too.
- */
-
-static inline int __prepare_ICR(unsigned int shortcut, int vector)
+void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector)
 {
-       unsigned int icr = shortcut | APIC_DEST_LOGICAL;
-
-       switch (vector) {
-       default:
-               icr |= APIC_DM_FIXED | vector;
-               break;
-       case NMI_VECTOR:
-               icr |= APIC_DM_NMI;
-               break;
+       unsigned long query_cpu;
+       unsigned long flags;
+
+       /*
+        * Hack. The clustered APIC addressing mode doesn't allow us to send
+        * to an arbitrary mask, so I do a unicast to each CPU instead.
+        * - mbligh
+        */
+       local_irq_save(flags);
+       for_each_cpu(query_cpu, mask) {
+               __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
+                               query_cpu), vector, APIC_DEST_PHYSICAL);
        }
-       return icr;
+       local_irq_restore(flags);
 }
 
-static inline int __prepare_ICR2(unsigned int mask)
+void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
+                                                int vector)
 {
-       return SET_APIC_DEST_FIELD(mask);
-}
+       unsigned int this_cpu = smp_processor_id();
+       unsigned int query_cpu;
+       unsigned long flags;
 
-void __send_IPI_shortcut(unsigned int shortcut, int vector)
-{
-       /*
-        * Subtle. In the case of the 'never do double writes' workaround
-        * we have to lock out interrupts to be safe.  As we don't care
-        * of the value read we use an atomic rmw access to avoid costly
-        * cli/sti.  Otherwise we use an even cheaper single atomic write
-        * to the APIC.
-        */
-       unsigned int cfg;
+       /* See Hack comment above */
 
-       /*
-        * Wait for idle.
-        */
-       apic_wait_icr_idle();
+       local_irq_save(flags);
+       for_each_cpu(query_cpu, mask) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
+                                query_cpu), vector, APIC_DEST_PHYSICAL);
+       }
+       local_irq_restore(flags);
+}
 
-       /*
-        * No need to touch the target chip field
-        */
-       cfg = __prepare_ICR(shortcut, vector);
+void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
+                                                int vector)
+{
+       unsigned long flags;
+       unsigned int query_cpu;
 
        /*
-        * Send the IPI. The write to APIC_ICR fires this off.
+        * Hack. The clustered APIC addressing mode doesn't allow us to send
+        * to an arbitrary mask, so I do a unicasts to each CPU instead. This
+        * should be modified to do 1 message per cluster ID - mbligh
         */
-       apic_write(APIC_ICR, cfg);
-}
 
-void send_IPI_self(int vector)
-{
-       __send_IPI_shortcut(APIC_DEST_SELF, vector);
+       local_irq_save(flags);
+       for_each_cpu(query_cpu, mask)
+               __default_send_IPI_dest_field(
+                       apic->cpu_to_logical_apicid(query_cpu), vector,
+                       apic->dest_logical);
+       local_irq_restore(flags);
 }
 
-/*
- * This is used to send an IPI with no shorthand notation (the destination is
- * specified in bits 56 to 63 of the ICR).
- */
-static inline void __send_IPI_dest_field(unsigned long mask, int vector)
+void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask,
+                                                int vector)
 {
-       unsigned long cfg;
-
-       /*
-        * Wait for idle.
-        */
-       if (unlikely(vector == NMI_VECTOR))
-               safe_apic_wait_icr_idle();
-       else
-               apic_wait_icr_idle();
-
-       /*
-        * prepare target chip field
-        */
-       cfg = __prepare_ICR2(mask);
-       apic_write(APIC_ICR2, cfg);
+       unsigned long flags;
+       unsigned int query_cpu;
+       unsigned int this_cpu = smp_processor_id();
 
-       /*
-        * program the ICR
-        */
-       cfg = __prepare_ICR(0, vector);
+       /* See Hack comment above */
 
-       /*
-        * Send the IPI. The write to APIC_ICR fires this off.
-        */
-       apic_write(APIC_ICR, cfg);
+       local_irq_save(flags);
+       for_each_cpu(query_cpu, mask) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __default_send_IPI_dest_field(
+                       apic->cpu_to_logical_apicid(query_cpu), vector,
+                       apic->dest_logical);
+               }
+       local_irq_restore(flags);
 }
 
+#ifdef CONFIG_X86_32
+
 /*
  * This is only used on smaller machines.
  */
-void send_IPI_mask_bitmask(const struct cpumask *cpumask, int vector)
+void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)
 {
        unsigned long mask = cpumask_bits(cpumask)[0];
        unsigned long flags;
 
        local_irq_save(flags);
        WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);
-       __send_IPI_dest_field(mask, vector);
+       __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
        local_irq_restore(flags);
 }
 
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector)
+void default_send_IPI_allbutself(int vector)
 {
-       unsigned long flags;
-       unsigned int query_cpu;
-
        /*
-        * Hack. The clustered APIC addressing mode doesn't allow us to send
-        * to an arbitrary mask, so I do a unicasts to each CPU instead. This
-        * should be modified to do 1 message per cluster ID - mbligh
+        * if there are no other CPUs in the system then we get an APIC send
+        * error if we try to broadcast, thus avoid sending IPIs in this case.
         */
+       if (!(num_online_cpus() > 1))
+               return;
 
-       local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
-               __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu), vector);
-       local_irq_restore(flags);
+       __default_local_send_IPI_allbutself(vector);
 }
 
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
+void default_send_IPI_all(int vector)
 {
-       unsigned long flags;
-       unsigned int query_cpu;
-       unsigned int this_cpu = smp_processor_id();
-
-       /* See Hack comment above */
+       __default_local_send_IPI_all(vector);
+}
 
-       local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
-               if (query_cpu != this_cpu)
-                       __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu),
-                                             vector);
-       local_irq_restore(flags);
+void default_send_IPI_self(int vector)
+{
+       __default_send_IPI_shortcut(APIC_DEST_SELF, vector, apic->dest_logical);
 }
 
 /* must come after the send_IPI functions above for inlining */
index 8b30d0c..f13ca16 100644 (file)
@@ -6,10 +6,12 @@
 #include <linux/kernel_stat.h>
 #include <linux/seq_file.h>
 #include <linux/smp.h>
+#include <linux/ftrace.h>
 
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #include <asm/irq.h>
+#include <asm/idle.h>
 
 atomic_t irq_err_count;
 
@@ -188,4 +190,40 @@ u64 arch_irq_stat(void)
        return sum;
 }
 
+
+/*
+ * do_IRQ handles all normal device IRQ's (the special
+ * SMP cross-CPU interrupts have their own specific
+ * handlers).
+ */
+unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
+{
+       struct pt_regs *old_regs = set_irq_regs(regs);
+
+       /* high bit used in ret_from_ code  */
+       unsigned vector = ~regs->orig_ax;
+       unsigned irq;
+
+       exit_idle();
+       irq_enter();
+
+       irq = __get_cpu_var(vector_irq)[vector];
+
+       if (!handle_irq(irq, regs)) {
+#ifdef CONFIG_X86_64
+               if (!disable_apic)
+                       ack_APIC_irq();
+#endif
+
+               if (printk_ratelimit())
+                       printk(KERN_EMERG "%s: %d.%d No irq handler for vector (irq %d)\n",
+                              __func__, smp_processor_id(), vector, irq);
+       }
+
+       irq_exit();
+
+       set_irq_regs(old_regs);
+       return 1;
+}
+
 EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
index e0f29be..4beb9a1 100644 (file)
@@ -191,33 +191,16 @@ static inline int
 execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) { return 0; }
 #endif
 
-/*
- * do_IRQ handles all normal device IRQ's (the special
- * SMP cross-CPU interrupts have their own specific
- * handlers).
- */
-unsigned int do_IRQ(struct pt_regs *regs)
+bool handle_irq(unsigned irq, struct pt_regs *regs)
 {
-       struct pt_regs *old_regs;
-       /* high bit used in ret_from_ code */
-       int overflow;
-       unsigned vector = ~regs->orig_ax;
        struct irq_desc *desc;
-       unsigned irq;
-
-
-       old_regs = set_irq_regs(regs);
-       irq_enter();
-       irq = __get_cpu_var(vector_irq)[vector];
+       int overflow;
 
        overflow = check_stack_overflow();
 
        desc = irq_to_desc(irq);
-       if (unlikely(!desc)) {
-               printk(KERN_EMERG "%s: cannot handle IRQ %d vector %#x cpu %d\n",
-                                       __func__, irq, vector, smp_processor_id());
-               BUG();
-       }
+       if (unlikely(!desc))
+               return false;
 
        if (!execute_on_irq_stack(overflow, desc, irq)) {
                if (unlikely(overflow))
@@ -225,13 +208,11 @@ unsigned int do_IRQ(struct pt_regs *regs)
                desc->handle_irq(irq, desc);
        }
 
-       irq_exit();
-       set_irq_regs(old_regs);
-       return 1;
+       return true;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-#include <mach_apic.h>
+#include <asm/genapic.h>
 
 /* A cpu has been removed from cpu_online_mask.  Reset irq affinities. */
 void fixup_irqs(void)
index 018963a..977d8b4 100644 (file)
@@ -48,42 +48,18 @@ static inline void stack_overflow_check(struct pt_regs *regs)
 #endif
 }
 
-/*
- * do_IRQ handles all normal device IRQ's (the special
- * SMP cross-CPU interrupts have their own specific
- * handlers).
- */
-asmlinkage unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
+bool handle_irq(unsigned irq, struct pt_regs *regs)
 {
-       struct pt_regs *old_regs = set_irq_regs(regs);
        struct irq_desc *desc;
 
-       /* high bit used in ret_from_ code  */
-       unsigned vector = ~regs->orig_ax;
-       unsigned irq;
-
-       exit_idle();
-       irq_enter();
-       irq = __get_cpu_var(vector_irq)[vector];
-
        stack_overflow_check(regs);
 
        desc = irq_to_desc(irq);
-       if (likely(desc))
-               generic_handle_irq_desc(irq, desc);
-       else {
-               if (!disable_apic)
-                       ack_APIC_irq();
-
-               if (printk_ratelimit())
-                       printk(KERN_EMERG "%s: %d.%d No irq handler for vector\n",
-                               __func__, smp_processor_id(), vector);
-       }
-
-       irq_exit();
+       if (unlikely(!desc))
+               return false;
 
-       set_irq_regs(old_regs);
-       return 1;
+       generic_handle_irq_desc(irq, desc);
+       return true;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
index 10435a1..5c4f554 100644 (file)
@@ -46,7 +46,7 @@
 #include <asm/apicdef.h>
 #include <asm/system.h>
 
-#include <mach_ipi.h>
+#include <asm/genapic.h>
 
 /*
  * Put the error code here just in case the user cares:
@@ -347,7 +347,7 @@ void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
  */
 void kgdb_roundup_cpus(unsigned long flags)
 {
-       send_IPI_allbutself(APIC_DM_NMI);
+       apic->send_IPI_allbutself(APIC_DM_NMI);
 }
 #endif
 
index fa6bb26..66ebb82 100644 (file)
@@ -3,7 +3,7 @@
  *     compliant MP-table parsing routines.
  *
  *     (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
- *     (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
+ *     (c) 1998, 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
  *      (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>
  */
 
 #include <asm/setup.h>
 #include <asm/smp.h>
 
-#include <mach_apic.h>
-#ifdef CONFIG_X86_32
-#include <mach_apicdef.h>
-#include <mach_mpparse.h>
-#endif
-
+#include <asm/genapic.h>
 /*
  * Checksum an MP configuration block.
  */
@@ -292,16 +287,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
                return 0;
 
 #ifdef CONFIG_X86_32
-       /*
-        * need to make sure summit and es7000's mps_oem_check is safe to be
-        * called early via genericarch 's mps_oem_check
-        */
-       if (early) {
-#ifdef CONFIG_X86_NUMAQ
-               numaq_mps_oem_check(mpc, oem, str);
-#endif
-       } else
-               mps_oem_check(mpc, oem, str);
+       generic_mps_oem_check(mpc, oem, str);
 #endif
        /* save the local APIC address, it might be non-default */
        if (!acpi_lapic)
@@ -386,13 +372,13 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
                        (*x86_quirks->mpc_record)++;
        }
 
-#ifdef CONFIG_X86_GENERICARCH
-       generic_bigsmp_probe();
+#ifdef CONFIG_X86_BIGSMP
+       generic_bigsmp_probe();
 #endif
 
-#ifdef CONFIG_X86_32
-       setup_apic_routing();
-#endif
+       if (apic->setup_apic_routing)
+               apic->setup_apic_routing();
+
        if (!num_processors)
                printk(KERN_ERR "MPTABLE: no processors registered!\n");
        return num_processors;
index 23b6d9e..bdfad80 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <asm/mce.h>
 
-#include <mach_traps.h>
+#include <asm/mach_traps.h>
 
 int unknown_nmi_panic;
 int nmi_watchdog_enabled;
index f2191d4..0cc41a1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2002, IBM Corp.
  *
- * All rights reserved.          
+ * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * Send feedback to <gone@us.ibm.com>
  */
 
-#include <linux/mm.h>
+#include <linux/nodemask.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
 #include <linux/module.h>
-#include <linux/nodemask.h>
-#include <asm/numaq.h>
-#include <asm/topology.h>
+#include <linux/mm.h>
+
 #include <asm/processor.h>
+#include <asm/topology.h>
 #include <asm/genapic.h>
-#include <asm/e820.h>
+#include <asm/numaq.h>
 #include <asm/setup.h>
+#include <asm/e820.h>
 
 #define        MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
 
@@ -91,19 +92,20 @@ static int __init numaq_pre_time_init(void)
 }
 
 int found_numaq;
+
 /*
  * Have to match translation table entries to main table entries by counter
  * hence the mpc_record variable .... can't see a less disgusting way of
  * doing this ....
  */
 struct mpc_config_translation {
-       unsigned char mpc_type;
-       unsigned char trans_len;
-       unsigned char trans_type;
-       unsigned char trans_quad;
-       unsigned char trans_global;
-       unsigned char trans_local;
-       unsigned short trans_reserved;
+       unsigned char           mpc_type;
+       unsigned char           trans_len;
+       unsigned char           trans_type;
+       unsigned char           trans_quad;
+       unsigned char           trans_global;
+       unsigned char           trans_local;
+       unsigned short          trans_reserved;
 };
 
 /* x86_quirks member */
@@ -236,7 +238,7 @@ static int __init numaq_setup_ioapic_ids(void)
 
 static int __init numaq_update_genapic(void)
 {
-       genapic->wakeup_cpu = wakeup_secondary_cpu_via_nmi;
+       apic->wakeup_cpu = wakeup_secondary_cpu_via_nmi;
 
        return 0;
 }
@@ -291,3 +293,280 @@ int __init get_memcfg_numaq(void)
        smp_dump_qct();
        return 1;
 }
+
+/*
+ * APIC driver for the IBM NUMAQ chipset.
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <asm/ipi.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/numa.h>
+#include <linux/smp.h>
+#include <asm/numaq.h>
+#include <asm/io.h>
+#include <linux/mmzone.h>
+#include <linux/nodemask.h>
+
+#define NUMAQ_APIC_DFR_VALUE   (APIC_DFR_CLUSTER)
+
+static inline unsigned int numaq_get_apic_id(unsigned long x)
+{
+       return (x >> 24) & 0x0F;
+}
+
+static inline void numaq_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+       default_send_IPI_mask_sequence_logical(mask, vector);
+}
+
+static inline void numaq_send_IPI_allbutself(int vector)
+{
+       default_send_IPI_mask_allbutself_logical(cpu_online_mask, vector);
+}
+
+static inline void numaq_send_IPI_all(int vector)
+{
+       numaq_send_IPI_mask(cpu_online_mask, vector);
+}
+
+extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
+
+#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
+#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
+
+/*
+ * Because we use NMIs rather than the INIT-STARTUP sequence to
+ * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
+ */
+static inline void numaq_smp_callin_clear_local_apic(void)
+{
+       clear_local_APIC();
+}
+
+static inline void
+numaq_store_NMI_vector(unsigned short *high, unsigned short *low)
+{
+       printk("Storing NMI vector\n");
+       *high =
+         *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH));
+       *low =
+         *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_LOW));
+}
+
+static inline const cpumask_t *numaq_target_cpus(void)
+{
+       return &CPU_MASK_ALL;
+}
+
+static inline unsigned long
+numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+       return physid_isset(apicid, bitmap);
+}
+
+static inline unsigned long numaq_check_apicid_present(int bit)
+{
+       return physid_isset(bit, phys_cpu_present_map);
+}
+
+#define apicid_cluster(apicid) (apicid & 0xF0)
+
+static inline int numaq_apic_id_registered(void)
+{
+       return 1;
+}
+
+static inline void numaq_init_apic_ldr(void)
+{
+       /* Already done in NUMA-Q firmware */
+}
+
+static inline void numaq_setup_apic_routing(void)
+{
+       printk("Enabling APIC mode:  %s.  Using %d I/O APICs\n",
+               "NUMA-Q", nr_ioapics);
+}
+
+/*
+ * Skip adding the timer int on secondary nodes, which causes
+ * a small but painful rift in the time-space continuum.
+ */
+static inline int numaq_multi_timer_check(int apic, int irq)
+{
+       return apic != 0 && irq == 0;
+}
+
+static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map)
+{
+       /* We don't have a good way to do this yet - hack */
+       return physids_promote(0xFUL);
+}
+
+/* Mapping from cpu number to logical apicid */
+extern u8 cpu_2_logical_apicid[];
+
+static inline int numaq_cpu_to_logical_apicid(int cpu)
+{
+       if (cpu >= nr_cpu_ids)
+               return BAD_APICID;
+       return (int)cpu_2_logical_apicid[cpu];
+}
+
+/*
+ * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
+ * cpu to APIC ID relation to properly interact with the intelligent
+ * mode of the cluster controller.
+ */
+static inline int numaq_cpu_present_to_apicid(int mps_cpu)
+{
+       if (mps_cpu < 60)
+               return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
+       else
+               return BAD_APICID;
+}
+
+static inline int numaq_apicid_to_node(int logical_apicid) 
+{
+       return logical_apicid >> 4;
+}
+
+static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)
+{
+       int node = numaq_apicid_to_node(logical_apicid);
+       int cpu = __ffs(logical_apicid & 0xf);
+
+       return physid_mask_of_physid(cpu + 4*node);
+}
+
+/* Where the IO area was mapped on multiquad, always 0 otherwise */
+void *xquad_portio;
+
+static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+       return 1;
+}
+
+/*
+ * We use physical apicids here, not logical, so just return the default
+ * physical broadcast to stop people from breaking us
+ */
+static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+       return 0x0F;
+}
+
+static inline unsigned int
+numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                            const struct cpumask *andmask)
+{
+       return 0x0F;
+}
+
+/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
+static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+       return cpuid_apic >> index_msb;
+}
+static int __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
+{
+       numaq_mps_oem_check(mpc, oem, productid);
+       return found_numaq;
+}
+
+static int probe_numaq(void)
+{
+       /* already know from get_memcfg_numaq() */
+       return found_numaq;
+}
+
+static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
+{
+       /* Careful. Some cpus do not strictly honor the set of cpus
+        * specified in the interrupt destination when using lowest
+        * priority interrupt delivery mode.
+        *
+        * In particular there was a hyperthreading cpu observed to
+        * deliver interrupts to the wrong hyperthread when only one
+        * hyperthread was specified in the interrupt desitination.
+        */
+       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
+}
+
+static void numaq_setup_portio_remap(void)
+{
+       int num_quads = num_online_nodes();
+
+       if (num_quads <= 1)
+               return;
+
+       printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
+       xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
+       printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
+               (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
+}
+
+struct genapic apic_numaq = {
+
+       .name                           = "NUMAQ",
+       .probe                          = probe_numaq,
+       .acpi_madt_oem_check            = NULL,
+       .apic_id_registered             = numaq_apic_id_registered,
+
+       .irq_delivery_mode              = dest_LowestPrio,
+       /* physical delivery on LOCAL quad: */
+       .irq_dest_mode                  = 0,
+
+       .target_cpus                    = numaq_target_cpus,
+       .disable_esr                    = 1,
+       .dest_logical                   = APIC_DEST_LOGICAL,
+       .check_apicid_used              = numaq_check_apicid_used,
+       .check_apicid_present           = numaq_check_apicid_present,
+
+       .vector_allocation_domain       = numaq_vector_allocation_domain,
+       .init_apic_ldr                  = numaq_init_apic_ldr,
+
+       .ioapic_phys_id_map             = numaq_ioapic_phys_id_map,
+       .setup_apic_routing             = numaq_setup_apic_routing,
+       .multi_timer_check              = numaq_multi_timer_check,
+       .apicid_to_node                 = numaq_apicid_to_node,
+       .cpu_to_logical_apicid          = numaq_cpu_to_logical_apicid,
+       .cpu_present_to_apicid          = numaq_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = numaq_apicid_to_cpu_present,
+       .setup_portio_remap             = numaq_setup_portio_remap,
+       .check_phys_apicid_present      = numaq_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = numaq_phys_pkg_id,
+       .mps_oem_check                  = __numaq_mps_oem_check,
+
+       .get_apic_id                    = numaq_get_apic_id,
+       .set_apic_id                    = NULL,
+       .apic_id_mask                   = 0x0F << 24,
+
+       .cpu_mask_to_apicid             = numaq_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = numaq_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = numaq_send_IPI_mask,
+       .send_IPI_mask_allbutself       = NULL,
+       .send_IPI_allbutself            = numaq_send_IPI_allbutself,
+       .send_IPI_all                   = numaq_send_IPI_all,
+       .send_IPI_self                  = default_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = NUMAQ_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = NUMAQ_TRAMPOLINE_PHYS_HIGH,
+
+       /* We don't do anything here because we use NMI's to boot instead */
+       .wait_for_init_deassert         = NULL,
+
+       .smp_callin_clear_local_apic    = numaq_smp_callin_clear_local_apic,
+       .store_NMI_vector               = numaq_store_NMI_vector,
+       .inquire_remote_apic            = NULL,
+};
index 95777b0..3a7c5a4 100644 (file)
@@ -26,13 +26,3 @@ struct pv_lock_ops pv_lock_ops = {
 };
 EXPORT_SYMBOL(pv_lock_ops);
 
-void __init paravirt_use_bytelocks(void)
-{
-#ifdef CONFIG_SMP
-       pv_lock_ops.spin_is_locked = __byte_spin_is_locked;
-       pv_lock_ops.spin_is_contended = __byte_spin_is_contended;
-       pv_lock_ops.spin_lock = __byte_spin_lock;
-       pv_lock_ops.spin_trylock = __byte_spin_trylock;
-       pv_lock_ops.spin_unlock = __byte_spin_unlock;
-#endif
-}
diff --git a/arch/x86/kernel/probe_32.c b/arch/x86/kernel/probe_32.c
new file mode 100644 (file)
index 0000000..22337b7
--- /dev/null
@@ -0,0 +1,411 @@
+/*
+ * Default generic APIC driver. This handles up to 8 CPUs.
+ *
+ * Copyright 2003 Andi Kleen, SuSE Labs.
+ * Subject to the GNU Public License, v.2
+ *
+ * Generic x86 APIC driver probe layer.
+ */
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <linux/ctype.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <asm/fixmap.h>
+#include <asm/mpspec.h>
+#include <asm/apicdef.h>
+#include <asm/genapic.h>
+#include <asm/setup.h>
+
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/smp.h>
+#include <linux/init.h>
+#include <asm/genapic.h>
+#include <asm/ipi.h>
+
+#include <linux/smp.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/acpi.h>
+#include <asm/arch_hooks.h>
+#include <asm/e820.h>
+#include <asm/setup.h>
+
+#include <asm/genapic.h>
+
+#ifdef CONFIG_HOTPLUG_CPU
+#define DEFAULT_SEND_IPI       (1)
+#else
+#define DEFAULT_SEND_IPI       (0)
+#endif
+
+int no_broadcast = DEFAULT_SEND_IPI;
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
+{
+       /*
+        * Careful. Some cpus do not strictly honor the set of cpus
+        * specified in the interrupt destination when using lowest
+        * priority interrupt delivery mode.
+        *
+        * In particular there was a hyperthreading cpu observed to
+        * deliver interrupts to the wrong hyperthread when only one
+        * hyperthread was specified in the interrupt desitination.
+        */
+       *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
+}
+
+/* should be called last. */
+static int probe_default(void)
+{
+       return 1;
+}
+
+struct genapic apic_default = {
+
+       .name                           = "default",
+       .probe                          = probe_default,
+       .acpi_madt_oem_check            = NULL,
+       .apic_id_registered             = default_apic_id_registered,
+
+       .irq_delivery_mode              = dest_LowestPrio,
+       /* logical delivery broadcast to all CPUs: */
+       .irq_dest_mode                  = 1,
+
+       .target_cpus                    = default_target_cpus,
+       .disable_esr                    = 0,
+       .dest_logical                   = APIC_DEST_LOGICAL,
+       .check_apicid_used              = default_check_apicid_used,
+       .check_apicid_present           = default_check_apicid_present,
+
+       .vector_allocation_domain       = default_vector_allocation_domain,
+       .init_apic_ldr                  = default_init_apic_ldr,
+
+       .ioapic_phys_id_map             = default_ioapic_phys_id_map,
+       .setup_apic_routing             = default_setup_apic_routing,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = default_apicid_to_node,
+       .cpu_to_logical_apicid          = default_cpu_to_logical_apicid,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = default_apicid_to_cpu_present,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = default_phys_pkg_id,
+       .mps_oem_check                  = NULL,
+
+       .get_apic_id                    = default_get_apic_id,
+       .set_apic_id                    = NULL,
+       .apic_id_mask                   = 0x0F << 24,
+
+       .cpu_mask_to_apicid             = default_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = default_send_IPI_mask_logical,
+       .send_IPI_mask_allbutself       = default_send_IPI_mask_allbutself_logical,
+       .send_IPI_allbutself            = default_send_IPI_allbutself,
+       .send_IPI_all                   = default_send_IPI_all,
+       .send_IPI_self                  = default_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+
+       .wait_for_init_deassert         = default_wait_for_init_deassert,
+
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = default_inquire_remote_apic,
+};
+
+extern struct genapic apic_numaq;
+extern struct genapic apic_summit;
+extern struct genapic apic_bigsmp;
+extern struct genapic apic_es7000;
+extern struct genapic apic_default;
+
+struct genapic *apic = &apic_default;
+
+static struct genapic *apic_probe[] __initdata = {
+#ifdef CONFIG_X86_NUMAQ
+       &apic_numaq,
+#endif
+#ifdef CONFIG_X86_SUMMIT
+       &apic_summit,
+#endif
+#ifdef CONFIG_X86_BIGSMP
+       &apic_bigsmp,
+#endif
+#ifdef CONFIG_X86_ES7000
+       &apic_es7000,
+#endif
+       &apic_default,  /* must be last */
+       NULL,
+};
+
+static int cmdline_apic __initdata;
+static int __init parse_apic(char *arg)
+{
+       int i;
+
+       if (!arg)
+               return -EINVAL;
+
+       for (i = 0; apic_probe[i]; i++) {
+               if (!strcmp(apic_probe[i]->name, arg)) {
+                       apic = apic_probe[i];
+                       cmdline_apic = 1;
+                       return 0;
+               }
+       }
+
+       if (x86_quirks->update_genapic)
+               x86_quirks->update_genapic();
+
+       /* Parsed again by __setup for debug/verbose */
+       return 0;
+}
+early_param("apic", parse_apic);
+
+void __init generic_bigsmp_probe(void)
+{
+#ifdef CONFIG_X86_BIGSMP
+       /*
+        * This routine is used to switch to bigsmp mode when
+        * - There is no apic= option specified by the user
+        * - generic_apic_probe() has chosen apic_default as the sub_arch
+        * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
+        */
+
+       if (!cmdline_apic && apic == &apic_default) {
+               if (apic_bigsmp.probe()) {
+                       apic = &apic_bigsmp;
+                       if (x86_quirks->update_genapic)
+                               x86_quirks->update_genapic();
+                       printk(KERN_INFO "Overriding APIC driver with %s\n",
+                              apic->name);
+               }
+       }
+#endif
+}
+
+void __init generic_apic_probe(void)
+{
+       if (!cmdline_apic) {
+               int i;
+               for (i = 0; apic_probe[i]; i++) {
+                       if (apic_probe[i]->probe()) {
+                               apic = apic_probe[i];
+                               break;
+                       }
+               }
+               /* Not visible without early console */
+               if (!apic_probe[i])
+                       panic("Didn't find an APIC driver");
+
+               if (x86_quirks->update_genapic)
+                       x86_quirks->update_genapic();
+       }
+       printk(KERN_INFO "Using APIC driver %s\n", apic->name);
+}
+
+/* These functions can switch the APIC even after the initial ->probe() */
+
+int __init
+generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
+{
+       int i;
+
+       for (i = 0; apic_probe[i]; ++i) {
+               if (!apic_probe[i]->mps_oem_check)
+                       continue;
+               if (!apic_probe[i]->mps_oem_check(mpc, oem, productid))
+                       continue;
+
+               if (!cmdline_apic) {
+                       apic = apic_probe[i];
+                       if (x86_quirks->update_genapic)
+                               x86_quirks->update_genapic();
+                       printk(KERN_INFO "Switched to APIC driver `%s'.\n",
+                              apic->name);
+               }
+               return 1;
+       }
+       return 0;
+}
+
+int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+       int i;
+
+       for (i = 0; apic_probe[i]; ++i) {
+               if (!apic_probe[i]->acpi_madt_oem_check)
+                       continue;
+               if (!apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id))
+                       continue;
+
+               if (!cmdline_apic) {
+                       apic = apic_probe[i];
+                       if (x86_quirks->update_genapic)
+                               x86_quirks->update_genapic();
+                       printk(KERN_INFO "Switched to APIC driver `%s'.\n",
+                              apic->name);
+               }
+               return 1;
+       }
+       return 0;
+}
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
+/**
+ * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
+ *
+ * Description:
+ *     Perform any necessary interrupt initialisation prior to setting up
+ *     the "ordinary" interrupt call gates.  For legacy reasons, the ISA
+ *     interrupts should be initialised here if the machine emulates a PC
+ *     in any way.
+ **/
+void __init pre_intr_init_hook(void)
+{
+       if (x86_quirks->arch_pre_intr_init) {
+               if (x86_quirks->arch_pre_intr_init())
+                       return;
+       }
+       init_ISA_irqs();
+}
+
+/**
+ * intr_init_hook - post gate setup interrupt initialisation
+ *
+ * Description:
+ *     Fill in any interrupts that may have been left out by the general
+ *     init_IRQ() routine.  interrupts having to do with the machine rather
+ *     than the devices on the I/O bus (like APIC interrupts in intel MP
+ *     systems) are started here.
+ **/
+void __init intr_init_hook(void)
+{
+       if (x86_quirks->arch_intr_init) {
+               if (x86_quirks->arch_intr_init())
+                       return;
+       }
+}
+
+/**
+ * pre_setup_arch_hook - hook called prior to any setup_arch() execution
+ *
+ * Description:
+ *     generally used to activate any machine specific identification
+ *     routines that may be needed before setup_arch() runs.  On Voyager
+ *     this is used to get the board revision and type.
+ **/
+void __init pre_setup_arch_hook(void)
+{
+}
+
+/**
+ * trap_init_hook - initialise system specific traps
+ *
+ * Description:
+ *     Called as the final act of trap_init().  Used in VISWS to initialise
+ *     the various board specific APIC traps.
+ **/
+void __init trap_init_hook(void)
+{
+       if (x86_quirks->arch_trap_init) {
+               if (x86_quirks->arch_trap_init())
+                       return;
+       }
+}
+
+static struct irqaction irq0  = {
+       .handler = timer_interrupt,
+       .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
+       .mask = CPU_MASK_NONE,
+       .name = "timer"
+};
+
+/**
+ * pre_time_init_hook - do any specific initialisations before.
+ *
+ **/
+void __init pre_time_init_hook(void)
+{
+       if (x86_quirks->arch_pre_time_init)
+               x86_quirks->arch_pre_time_init();
+}
+
+/**
+ * time_init_hook - do any specific initialisations for the system timer.
+ *
+ * Description:
+ *     Must plug the system timer interrupt source at HZ into the IRQ listed
+ *     in irq_vectors.h:TIMER_IRQ
+ **/
+void __init time_init_hook(void)
+{
+       if (x86_quirks->arch_time_init) {
+               /*
+                * A nonzero return code does not mean failure, it means
+                * that the architecture quirk does not want any
+                * generic (timer) setup to be performed after this:
+                */
+               if (x86_quirks->arch_time_init())
+                       return;
+       }
+
+       irq0.mask = cpumask_of_cpu(0);
+       setup_irq(0, &irq0);
+}
+
+#ifdef CONFIG_MCA
+/**
+ * mca_nmi_hook - hook into MCA specific NMI chain
+ *
+ * Description:
+ *     The MCA (Microchannel Architecture) has an NMI chain for NMI sources
+ *     along the MCA bus.  Use this to hook into that chain if you will need
+ *     it.
+ **/
+void mca_nmi_hook(void)
+{
+       /*
+        * If I recall correctly, there's a whole bunch of other things that
+        * we can do to check for NMI problems, but that's all I know about
+        * at the moment.
+        */
+       pr_warning("NMI generated from unknown source!\n");
+}
+#endif
+
+static __init int no_ipi_broadcast(char *str)
+{
+       get_option(&str, &no_broadcast);
+       pr_info("Using %s mode\n",
+               no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
+       return 1;
+}
+__setup("no_ipi_broadcast=", no_ipi_broadcast);
+
+static int __init print_ipi_mode(void)
+{
+       pr_info("Using IPI %s mode\n",
+               no_broadcast ? "No-Shortcut" : "Shortcut");
+       return 0;
+}
+
+late_initcall(print_ipi_mode);
+
index 675a48c..071e7fe 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/setup.h>
 #include <asm/sections.h>
 #include <asm/io.h>
-#include <setup_arch.h>
+#include <asm/setup_arch.h>
 
 static struct resource system_rom_resource = {
        .name   = "System ROM",
index e68bb9e..89537f6 100644 (file)
@@ -344,7 +344,7 @@ static void c1e_idle(void)
 
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
        if (pm_idle == poll_idle && smp_num_siblings > 1) {
                printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
                        " performance may degrade.\n");
index c422eeb..8eb169e 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/uaccess.h>
 #include <linux/io.h>
 #include <linux/ftrace.h>
+#include <linux/dmi.h>
 
 #include <asm/pgtable.h>
 #include <asm/system.h>
@@ -168,14 +169,18 @@ void __show_regs(struct pt_regs *regs, int all)
        unsigned long d0, d1, d2, d3, d6, d7;
        unsigned int fsindex, gsindex;
        unsigned int ds, cs, es;
+       const char *board;
 
        printk("\n");
        print_modules();
-       printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s\n",
+       board = dmi_get_system_info(DMI_PRODUCT_NAME);
+       if (!board)
+               board = "";
+       printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s %s\n",
                current->pid, current->comm, print_tainted(),
                init_utsname()->release,
                (int)strcspn(init_utsname()->version, " "),
-               init_utsname()->version);
+               init_utsname()->version, board);
        printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
        printk_address(regs->ip, 1);
        printk(KERN_INFO "RSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss,
index f8536fe..32e8f0a 100644 (file)
@@ -24,7 +24,7 @@
 # include <asm/iommu.h>
 #endif
 
-#include <mach_ipi.h>
+#include <asm/genapic.h>
 
 /*
  * Power off function, if any
@@ -651,7 +651,7 @@ static int crash_nmi_callback(struct notifier_block *self,
 
 static void smp_send_nmi_allbutself(void)
 {
-       send_IPI_allbutself(NMI_VECTOR);
+       apic->send_IPI_allbutself(NMI_VECTOR);
 }
 
 static struct notifier_block crash_nmi_nb = {
index f41c448..8d8fa99 100644 (file)
@@ -81,7 +81,7 @@
 #include <asm/io_apic.h>
 #include <asm/ist.h>
 #include <asm/vmi.h>
-#include <setup_arch.h>
+#include <asm/setup_arch.h>
 #include <asm/bios_ebda.h>
 #include <asm/cacheflush.h>
 #include <asm/processor.h>
@@ -97,7 +97,7 @@
 #include <asm/mmu_context.h>
 #include <asm/proto.h>
 
-#include <mach_apic.h>
+#include <asm/genapic.h>
 #include <asm/paravirt.h>
 #include <asm/hypervisor.h>
 
 #define ARCH_SETUP
 #endif
 
+unsigned int boot_cpu_id __read_mostly;
+
+#ifdef CONFIG_X86_64
+int default_cpu_present_to_apicid(int mps_cpu)
+{
+       return __default_cpu_present_to_apicid(mps_cpu);
+}
+
+int default_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+       return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
+}
+#endif
+
 #ifndef CONFIG_DEBUG_BOOT_PARAMS
 struct boot_params __initdata boot_params;
 #else
@@ -588,10 +602,9 @@ early_param("elfcorehdr", setup_elfcorehdr);
 
 static int __init default_update_genapic(void)
 {
-#ifdef CONFIG_X86_SMP
-# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
-       genapic->wakeup_cpu = wakeup_secondary_cpu_via_init;
-# endif
+#ifdef CONFIG_SMP
+       if (!apic->wakeup_cpu)
+               apic->wakeup_cpu = wakeup_secondary_cpu_via_init;
 #endif
 
        return 0;
@@ -607,7 +620,7 @@ struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
 static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
 {
        printk(KERN_NOTICE
-               "%s detected: BIOS may corrupt low RAM, working it around.\n",
+               "%s detected: BIOS may corrupt low RAM, working around it.\n",
                d->ident);
 
        e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED);
@@ -892,12 +905,11 @@ void __init setup_arch(char **cmdline_p)
         */
        acpi_reserve_bootmem();
 #endif
-#ifdef CONFIG_X86_FIND_SMP_CONFIG
        /*
         * Find and reserve possible boot-time SMP configuration:
         */
        find_smp_config();
-#endif
+
        reserve_crashkernel();
 
 #ifdef CONFIG_X86_64
@@ -924,7 +936,7 @@ void __init setup_arch(char **cmdline_p)
        map_vsyscall();
 #endif
 
-#ifdef CONFIG_X86_GENERICARCH
+#if defined(CONFIG_X86_32_NON_STANDARD) || defined(CONFIG_X86_BIGSMP)
        generic_apic_probe();
 #endif
 
index df0587f..7fc78b0 100644 (file)
 #endif
 
 #define COPY(x)                        {               \
-       err |= __get_user(regs->x, &sc->x);     \
+       get_user_ex(regs->x, &sc->x);           \
 }
 
 #define COPY_SEG(seg)          {                       \
                unsigned short tmp;                     \
-               err |= __get_user(tmp, &sc->seg);       \
+               get_user_ex(tmp, &sc->seg);             \
                regs->seg = tmp;                        \
 }
 
 #define COPY_SEG_CPL3(seg)     {                       \
                unsigned short tmp;                     \
-               err |= __get_user(tmp, &sc->seg);       \
+               get_user_ex(tmp, &sc->seg);             \
                regs->seg = tmp | 3;                    \
 }
 
 #define GET_SEG(seg)           {                       \
                unsigned short tmp;                     \
-               err |= __get_user(tmp, &sc->seg);       \
+               get_user_ex(tmp, &sc->seg);             \
                loadsegment(seg, tmp);                  \
 }
 
@@ -83,45 +83,49 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
        /* Always make any pending restarted system calls return -EINTR */
        current_thread_info()->restart_block.fn = do_no_restart_syscall;
 
+       get_user_try {
+
 #ifdef CONFIG_X86_32
-       GET_SEG(gs);
-       COPY_SEG(fs);
-       COPY_SEG(es);
-       COPY_SEG(ds);
+               GET_SEG(gs);
+               COPY_SEG(fs);
+               COPY_SEG(es);
+               COPY_SEG(ds);
 #endif /* CONFIG_X86_32 */
 
-       COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
-       COPY(dx); COPY(cx); COPY(ip);
+               COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
+               COPY(dx); COPY(cx); COPY(ip);
 
 #ifdef CONFIG_X86_64
-       COPY(r8);
-       COPY(r9);
-       COPY(r10);
-       COPY(r11);
-       COPY(r12);
-       COPY(r13);
-       COPY(r14);
-       COPY(r15);
+               COPY(r8);
+               COPY(r9);
+               COPY(r10);
+               COPY(r11);
+               COPY(r12);
+               COPY(r13);
+               COPY(r14);
+               COPY(r15);
 #endif /* CONFIG_X86_64 */
 
 #ifdef CONFIG_X86_32
-       COPY_SEG_CPL3(cs);
-       COPY_SEG_CPL3(ss);
+               COPY_SEG_CPL3(cs);
+               COPY_SEG_CPL3(ss);
 #else /* !CONFIG_X86_32 */
-       /* Kernel saves and restores only the CS segment register on signals,
-        * which is the bare minimum needed to allow mixed 32/64-bit code.
-        * App's signal handler can save/restore other segments if needed. */
-       COPY_SEG_CPL3(cs);
+               /* Kernel saves and restores only the CS segment register on signals,
+                * which is the bare minimum needed to allow mixed 32/64-bit code.
+                * App's signal handler can save/restore other segments if needed. */
+               COPY_SEG_CPL3(cs);
 #endif /* CONFIG_X86_32 */
 
-       err |= __get_user(tmpflags, &sc->flags);
-       regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
-       regs->orig_ax = -1;             /* disable syscall checks */
+               get_user_ex(tmpflags, &sc->flags);
+               regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
+               regs->orig_ax = -1;             /* disable syscall checks */
+
+               get_user_ex(buf, &sc->fpstate);
+               err |= restore_i387_xstate(buf);
 
-       err |= __get_user(buf, &sc->fpstate);
-       err |= restore_i387_xstate(buf);
+               get_user_ex(*pax, &sc->ax);
+       } get_user_catch(err);
 
-       err |= __get_user(*pax, &sc->ax);
        return err;
 }
 
@@ -131,57 +135,60 @@ setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
 {
        int err = 0;
 
+       put_user_try {
+
 #ifdef CONFIG_X86_32
-       {
-               unsigned int tmp;
+               {
+                       unsigned int tmp;
 
-               savesegment(gs, tmp);
-               err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
-       }
-       err |= __put_user(regs->fs, (unsigned int __user *)&sc->fs);
-       err |= __put_user(regs->es, (unsigned int __user *)&sc->es);
-       err |= __put_user(regs->ds, (unsigned int __user *)&sc->ds);
+                       savesegment(gs, tmp);
+                       put_user_ex(tmp, (unsigned int __user *)&sc->gs);
+               }
+               put_user_ex(regs->fs, (unsigned int __user *)&sc->fs);
+               put_user_ex(regs->es, (unsigned int __user *)&sc->es);
+               put_user_ex(regs->ds, (unsigned int __user *)&sc->ds);
 #endif /* CONFIG_X86_32 */
 
-       err |= __put_user(regs->di, &sc->di);
-       err |= __put_user(regs->si, &sc->si);
-       err |= __put_user(regs->bp, &sc->bp);
-       err |= __put_user(regs->sp, &sc->sp);
-       err |= __put_user(regs->bx, &sc->bx);
-       err |= __put_user(regs->dx, &sc->dx);
-       err |= __put_user(regs->cx, &sc->cx);
-       err |= __put_user(regs->ax, &sc->ax);
+               put_user_ex(regs->di, &sc->di);
+               put_user_ex(regs->si, &sc->si);
+               put_user_ex(regs->bp, &sc->bp);
+               put_user_ex(regs->sp, &sc->sp);
+               put_user_ex(regs->bx, &sc->bx);
+               put_user_ex(regs->dx, &sc->dx);
+               put_user_ex(regs->cx, &sc->cx);
+               put_user_ex(regs->ax, &sc->ax);
 #ifdef CONFIG_X86_64
-       err |= __put_user(regs->r8, &sc->r8);
-       err |= __put_user(regs->r9, &sc->r9);
-       err |= __put_user(regs->r10, &sc->r10);
-       err |= __put_user(regs->r11, &sc->r11);
-       err |= __put_user(regs->r12, &sc->r12);
-       err |= __put_user(regs->r13, &sc->r13);
-       err |= __put_user(regs->r14, &sc->r14);
-       err |= __put_user(regs->r15, &sc->r15);
+               put_user_ex(regs->r8, &sc->r8);
+               put_user_ex(regs->r9, &sc->r9);
+               put_user_ex(regs->r10, &sc->r10);
+               put_user_ex(regs->r11, &sc->r11);
+               put_user_ex(regs->r12, &sc->r12);
+               put_user_ex(regs->r13, &sc->r13);
+               put_user_ex(regs->r14, &sc->r14);
+               put_user_ex(regs->r15, &sc->r15);
 #endif /* CONFIG_X86_64 */
 
-       err |= __put_user(current->thread.trap_no, &sc->trapno);
-       err |= __put_user(current->thread.error_code, &sc->err);
-       err |= __put_user(regs->ip, &sc->ip);
+               put_user_ex(current->thread.trap_no, &sc->trapno);
+               put_user_ex(current->thread.error_code, &sc->err);
+               put_user_ex(regs->ip, &sc->ip);
 #ifdef CONFIG_X86_32
-       err |= __put_user(regs->cs, (unsigned int __user *)&sc->cs);
-       err |= __put_user(regs->flags, &sc->flags);
-       err |= __put_user(regs->sp, &sc->sp_at_signal);
-       err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss);
+               put_user_ex(regs->cs, (unsigned int __user *)&sc->cs);
+               put_user_ex(regs->flags, &sc->flags);
+               put_user_ex(regs->sp, &sc->sp_at_signal);
+               put_user_ex(regs->ss, (unsigned int __user *)&sc->ss);
 #else /* !CONFIG_X86_32 */
-       err |= __put_user(regs->flags, &sc->flags);
-       err |= __put_user(regs->cs, &sc->cs);
-       err |= __put_user(0, &sc->gs);
-       err |= __put_user(0, &sc->fs);
+               put_user_ex(regs->flags, &sc->flags);
+               put_user_ex(regs->cs, &sc->cs);
+               put_user_ex(0, &sc->gs);
+               put_user_ex(0, &sc->fs);
 #endif /* CONFIG_X86_32 */
 
-       err |= __put_user(fpstate, &sc->fpstate);
+               put_user_ex(fpstate, &sc->fpstate);
 
-       /* non-iBCS2 extensions.. */
-       err |= __put_user(mask, &sc->oldmask);
-       err |= __put_user(current->thread.cr2, &sc->cr2);
+               /* non-iBCS2 extensions.. */
+               put_user_ex(mask, &sc->oldmask);
+               put_user_ex(current->thread.cr2, &sc->cr2);
+       } put_user_catch(err);
 
        return err;
 }
@@ -336,43 +343,41 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
                return -EFAULT;
 
-       err |= __put_user(sig, &frame->sig);
-       err |= __put_user(&frame->info, &frame->pinfo);
-       err |= __put_user(&frame->uc, &frame->puc);
-       err |= copy_siginfo_to_user(&frame->info, info);
-       if (err)
-               return -EFAULT;
-
-       /* Create the ucontext.  */
-       if (cpu_has_xsave)
-               err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags);
-       else
-               err |= __put_user(0, &frame->uc.uc_flags);
-       err |= __put_user(0, &frame->uc.uc_link);
-       err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
-       err |= __put_user(sas_ss_flags(regs->sp),
-                         &frame->uc.uc_stack.ss_flags);
-       err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
-       err |= setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
-                               regs, set->sig[0]);
-       err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
-       if (err)
-               return -EFAULT;
+       put_user_try {
+               put_user_ex(sig, &frame->sig);
+               put_user_ex(&frame->info, &frame->pinfo);
+               put_user_ex(&frame->uc, &frame->puc);
+               err |= copy_siginfo_to_user(&frame->info, info);
 
-       /* Set up to return from userspace.  */
-       restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
-       if (ka->sa.sa_flags & SA_RESTORER)
-               restorer = ka->sa.sa_restorer;
-       err |= __put_user(restorer, &frame->pretcode);
+               /* Create the ucontext.  */
+               if (cpu_has_xsave)
+                       put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
+               else
+                       put_user_ex(0, &frame->uc.uc_flags);
+               put_user_ex(0, &frame->uc.uc_link);
+               put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
+               put_user_ex(sas_ss_flags(regs->sp),
+                           &frame->uc.uc_stack.ss_flags);
+               put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
+               err |= setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
+                                       regs, set->sig[0]);
+               err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
+
+               /* Set up to return from userspace.  */
+               restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
+               if (ka->sa.sa_flags & SA_RESTORER)
+                       restorer = ka->sa.sa_restorer;
+               put_user_ex(restorer, &frame->pretcode);
 
-       /*
-        * This is movl $__NR_rt_sigreturn, %ax ; int $0x80
-        *
-        * WE DO NOT USE IT ANY MORE! It's only left here for historical
-        * reasons and because gdb uses it as a signature to notice
-        * signal handler stack frames.
-        */
-       err |= __put_user(*((u64 *)&rt_retcode), (u64 *)frame->retcode);
+               /*
+                * This is movl $__NR_rt_sigreturn, %ax ; int $0x80
+                *
+                * WE DO NOT USE IT ANY MORE! It's only left here for historical
+                * reasons and because gdb uses it as a signature to notice
+                * signal handler stack frames.
+                */
+               put_user_ex(*((u64 *)&rt_retcode), (u64 *)frame->retcode);
+       } put_user_catch(err);
 
        if (err)
                return -EFAULT;
@@ -436,28 +441,30 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
                        return -EFAULT;
        }
 
-       /* Create the ucontext.  */
-       if (cpu_has_xsave)
-               err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags);
-       else
-               err |= __put_user(0, &frame->uc.uc_flags);
-       err |= __put_user(0, &frame->uc.uc_link);
-       err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
-       err |= __put_user(sas_ss_flags(regs->sp),
-                         &frame->uc.uc_stack.ss_flags);
-       err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
-       err |= setup_sigcontext(&frame->uc.uc_mcontext, fp, regs, set->sig[0]);
-       err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
-
-       /* Set up to return from userspace.  If provided, use a stub
-          already in userspace.  */
-       /* x86-64 should always use SA_RESTORER. */
-       if (ka->sa.sa_flags & SA_RESTORER) {
-               err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
-       } else {
-               /* could use a vstub here */
-               return -EFAULT;
-       }
+       put_user_try {
+               /* Create the ucontext.  */
+               if (cpu_has_xsave)
+                       put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
+               else
+                       put_user_ex(0, &frame->uc.uc_flags);
+               put_user_ex(0, &frame->uc.uc_link);
+               put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
+               put_user_ex(sas_ss_flags(regs->sp),
+                           &frame->uc.uc_stack.ss_flags);
+               put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
+               err |= setup_sigcontext(&frame->uc.uc_mcontext, fp, regs, set->sig[0]);
+               err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
+
+               /* Set up to return from userspace.  If provided, use a stub
+                  already in userspace.  */
+               /* x86-64 should always use SA_RESTORER. */
+               if (ka->sa.sa_flags & SA_RESTORER) {
+                       put_user_ex(ka->sa.sa_restorer, &frame->pretcode);
+               } else {
+                       /* could use a vstub here */
+                       err |= -EFAULT;
+               }
+       } put_user_catch(err);
 
        if (err)
                return -EFAULT;
@@ -509,31 +516,41 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
              struct old_sigaction __user *oact)
 {
        struct k_sigaction new_ka, old_ka;
-       int ret;
+       int ret = 0;
 
        if (act) {
                old_sigset_t mask;
 
-               if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
-                   __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
-                   __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
+               if (!access_ok(VERIFY_READ, act, sizeof(*act)))
                        return -EFAULT;
 
-               __get_user(new_ka.sa.sa_flags, &act->sa_flags);
-               __get_user(mask, &act->sa_mask);
+               get_user_try {
+                       get_user_ex(new_ka.sa.sa_handler, &act->sa_handler);
+                       get_user_ex(new_ka.sa.sa_flags, &act->sa_flags);
+                       get_user_ex(mask, &act->sa_mask);
+                       get_user_ex(new_ka.sa.sa_restorer, &act->sa_restorer);
+               } get_user_catch(ret);
+
+               if (ret)
+                       return -EFAULT;
                siginitset(&new_ka.sa.sa_mask, mask);
        }
 
        ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
 
        if (!ret && oact) {
-               if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
-                   __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
-                   __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
+               if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
                        return -EFAULT;
 
-               __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
-               __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
+               put_user_try {
+                       put_user_ex(old_ka.sa.sa_handler, &oact->sa_handler);
+                       put_user_ex(old_ka.sa.sa_flags, &oact->sa_flags);
+                       put_user_ex(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
+                       put_user_ex(old_ka.sa.sa_restorer, &oact->sa_restorer);
+               } put_user_catch(ret);
+
+               if (ret)
+                       return -EFAULT;
        }
 
        return ret;
index e6faa33..eaaffae 100644 (file)
@@ -2,7 +2,7 @@
  *     Intel SMP support routines.
  *
  *     (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
- *     (c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com>
+ *     (c) 1998-99, 2000, 2009 Ingo Molnar <mingo@redhat.com>
  *      (c) 2002,2003 Andi Kleen, SuSE Labs.
  *
  *     i386 and x86_64 integration by Glauber Costa <gcosta@redhat.com>
@@ -26,8 +26,7 @@
 #include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
 #include <asm/proto.h>
-#include <mach_ipi.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
 /*
  *     Some notes on x86 processor bugs affecting SMP operation:
  *
@@ -118,12 +117,12 @@ static void native_smp_send_reschedule(int cpu)
                WARN_ON(1);
                return;
        }
-       send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
+       apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
 }
 
 void native_send_call_func_single_ipi(int cpu)
 {
-       send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
+       apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
 }
 
 void native_send_call_func_ipi(const struct cpumask *mask)
@@ -131,7 +130,7 @@ void native_send_call_func_ipi(const struct cpumask *mask)
        cpumask_var_t allbutself;
 
        if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) {
-               send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
+               apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
                return;
        }
 
@@ -140,9 +139,9 @@ void native_send_call_func_ipi(const struct cpumask *mask)
 
        if (cpumask_equal(mask, allbutself) &&
            cpumask_equal(cpu_online_mask, cpu_callout_mask))
-               send_IPI_allbutself(CALL_FUNCTION_VECTOR);
+               apic->send_IPI_allbutself(CALL_FUNCTION_VECTOR);
        else
-               send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
+               apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
 
        free_cpumask_var(allbutself);
 }
index 612d3c7..af57f88 100644 (file)
@@ -2,7 +2,7 @@
  *     x86 SMP booting functions
  *
  *     (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
- *     (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
+ *     (c) 1998, 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
  *     Copyright 2001 Andi Kleen, SuSE Labs.
  *
  *     Much of the core SMP work is based on previous work by Thomas Radke, to
@@ -65,9 +65,8 @@
 #include <asm/uv/uv.h>
 #include <linux/mc146818rtc.h>
 
-#include <mach_apic.h>
-#include <mach_wakecpu.h>
-#include <smpboot_hooks.h>
+#include <asm/genapic.h>
+#include <asm/smpboot_hooks.h>
 
 #ifdef CONFIG_X86_32
 u8 apicid_2_node[MAX_APICID];
@@ -163,7 +162,7 @@ static void map_cpu_to_logical_apicid(void)
 {
        int cpu = smp_processor_id();
        int apicid = logical_smp_processor_id();
-       int node = apicid_to_node(apicid);
+       int node = apic->apicid_to_node(apicid);
 
        if (!node_online(node))
                node = first_online_node;
@@ -196,7 +195,8 @@ static void __cpuinit smp_callin(void)
         * our local APIC.  We have to wait for the IPI or we'll
         * lock up on an APIC access.
         */
-       wait_for_init_deassert(&init_deasserted);
+       if (apic->wait_for_init_deassert)
+               apic->wait_for_init_deassert(&init_deasserted);
 
        /*
         * (This works even if the APIC is not enabled.)
@@ -243,7 +243,8 @@ static void __cpuinit smp_callin(void)
         */
 
        pr_debug("CALLIN, before setup_local_APIC().\n");
-       smp_callin_clear_local_apic();
+       if (apic->smp_callin_clear_local_apic)
+               apic->smp_callin_clear_local_apic();
        setup_local_APIC();
        end_local_APIC_setup();
        map_cpu_to_logical_apicid();
@@ -583,7 +584,7 @@ wakeup_secondary_cpu_via_nmi(int logical_apicid, unsigned long start_eip)
        /* Target chip */
        /* Boot on the stack */
        /* Kick the second */
-       apic_icr_write(APIC_DM_NMI | APIC_DEST_LOGICAL, logical_apicid);
+       apic_icr_write(APIC_DM_NMI | apic->dest_logical, logical_apicid);
 
        pr_debug("Waiting for send to finish...\n");
        send_status = safe_apic_wait_icr_idle();
@@ -749,7 +750,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
 /*
  * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
  * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
- * Returns zero if CPU booted OK, else error code from wakeup_secondary_cpu.
+ * Returns zero if CPU booted OK, else error code from ->wakeup_cpu.
  */
 {
        unsigned long boot_error = 0;
@@ -824,7 +825,8 @@ do_rest:
 
                pr_debug("Setting warm reset code and vector.\n");
 
-               store_NMI_vector(&nmi_high, &nmi_low);
+               if (apic->store_NMI_vector)
+                       apic->store_NMI_vector(&nmi_high, &nmi_low);
 
                smpboot_setup_warm_reset_vector(start_ip);
                /*
@@ -839,7 +841,7 @@ do_rest:
        /*
         * Starting actual IPI sequence...
         */
-       boot_error = wakeup_secondary_cpu(apicid, start_ip);
+       boot_error = apic->wakeup_cpu(apicid, start_ip);
 
        if (!boot_error) {
                /*
@@ -873,8 +875,8 @@ do_rest:
                        else
                                /* trampoline code not run */
                                printk(KERN_ERR "Not responding.\n");
-                       if (get_uv_system_type() != UV_NON_UNIQUE_APIC)
-                               inquire_remote_apic(apicid);
+                       if (apic->inquire_remote_apic)
+                               apic->inquire_remote_apic(apicid);
                }
        }
 
@@ -905,7 +907,7 @@ do_rest:
 
 int __cpuinit native_cpu_up(unsigned int cpu)
 {
-       int apicid = cpu_present_to_apicid(cpu);
+       int apicid = apic->cpu_present_to_apicid(cpu);
        unsigned long flags;
        int err;
 
@@ -998,14 +1000,14 @@ static int __init smp_sanity_check(unsigned max_cpus)
 {
        preempt_disable();
 
-#if defined(CONFIG_X86_PC) && defined(CONFIG_X86_32)
+#if !defined(CONFIG_X86_BIGSMP) && defined(CONFIG_X86_32)
        if (def_to_bigsmp && nr_cpu_ids > 8) {
                unsigned int cpu;
                unsigned nr;
 
                printk(KERN_WARNING
                       "More than 8 CPUs detected - skipping them.\n"
-                      "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
+                      "Use CONFIG_X86_BIGSMP.\n");
 
                nr = 0;
                for_each_present_cpu(cpu) {
@@ -1051,7 +1053,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
         * Should not be necessary because the MP table should list the boot
         * CPU too, but we do it for the sake of robustness anyway.
         */
-       if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
+       if (!apic->check_phys_apicid_present(boot_cpu_physical_apicid)) {
                printk(KERN_NOTICE
                        "weird, boot CPU (#%d) not listed by the BIOS.\n",
                        boot_cpu_physical_apicid);
@@ -1069,7 +1071,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
                printk(KERN_ERR "... forcing use of dummy APIC emulation."
                                "(tell your hw vendor)\n");
                smpboot_clear_io_apic();
-               disable_ioapic_setup();
+               arch_disable_smp_support();
                return -1;
        }
 
@@ -1128,7 +1130,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 
 #ifdef CONFIG_X86_64
        enable_IR_x2apic();
-       setup_apic_routing();
+       default_setup_apic_routing();
 #endif
 
        if (smp_sanity_check(max_cpus) < 0) {
@@ -1163,7 +1165,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 
        map_cpu_to_logical_apicid();
 
-       setup_portio_remap();
+       if (apic->setup_portio_remap)
+               apic->setup_portio_remap();
 
        smpboot_setup_io_apic();
        /*
index 10786af..f7bddc2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Stack trace management functions
  *
- *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
+ *  Copyright (C) 2006-2009 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
  */
 #include <linux/sched.h>
 #include <linux/stacktrace.h>
index 7b98785..1e733ef 100644 (file)
 #include <linux/init.h>
 #include <asm/io.h>
 #include <asm/bios_ebda.h>
-#include <asm/summit/mpparse.h>
 
+/*
+ * APIC driver for the IBM "Summit" chipset.
+ */
+#define APIC_DEFINITION 1
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <asm/mpspec.h>
+#include <asm/apic.h>
+#include <asm/smp.h>
+#include <asm/genapic.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <asm/ipi.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/gfp.h>
+#include <linux/smp.h>
+
+static inline unsigned summit_get_apic_id(unsigned long x)
+{
+       return (x >> 24) & 0xFF;
+}
+
+static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
+{
+       default_send_IPI_mask_sequence_logical(mask, vector);
+}
+
+static inline void summit_send_IPI_allbutself(int vector)
+{
+       cpumask_t mask = cpu_online_map;
+       cpu_clear(smp_processor_id(), mask);
+
+       if (!cpus_empty(mask))
+               summit_send_IPI_mask(&mask, vector);
+}
+
+static inline void summit_send_IPI_all(int vector)
+{
+       summit_send_IPI_mask(&cpu_online_map, vector);
+}
+
+#include <asm/tsc.h>
+
+extern int use_cyclone;
+
+#ifdef CONFIG_X86_SUMMIT_NUMA
+extern void setup_summit(void);
+#else
+#define setup_summit() {}
+#endif
+
+static inline int
+summit_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
+{
+       if (!strncmp(oem, "IBM ENSW", 8) &&
+                       (!strncmp(productid, "VIGIL SMP", 9)
+                        || !strncmp(productid, "EXA", 3)
+                        || !strncmp(productid, "RUTHLESS SMP", 12))){
+               mark_tsc_unstable("Summit based system");
+               use_cyclone = 1; /*enable cyclone-timer*/
+               setup_summit();
+               return 1;
+       }
+       return 0;
+}
+
+/* Hook from generic ACPI tables.c */
+static inline int summit_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+       if (!strncmp(oem_id, "IBM", 3) &&
+           (!strncmp(oem_table_id, "SERVIGIL", 8)
+            || !strncmp(oem_table_id, "EXA", 3))){
+               mark_tsc_unstable("Summit based system");
+               use_cyclone = 1; /*enable cyclone-timer*/
+               setup_summit();
+               return 1;
+       }
+       return 0;
+}
+
+struct rio_table_hdr {
+       unsigned char version;      /* Version number of this data structure           */
+                                   /* Version 3 adds chassis_num & WP_index           */
+       unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil)   */
+       unsigned char num_rio_dev;  /* # of RIO I/O devices (Cyclones and Winnipegs)   */
+} __attribute__((packed));
+
+struct scal_detail {
+       unsigned char node_id;      /* Scalability Node ID                             */
+       unsigned long CBAR;         /* Address of 1MB register space                   */
+       unsigned char port0node;    /* Node ID port connected to: 0xFF=None            */
+       unsigned char port0port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
+       unsigned char port1node;    /* Node ID port connected to: 0xFF = None          */
+       unsigned char port1port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
+       unsigned char port2node;    /* Node ID port connected to: 0xFF = None          */
+       unsigned char port2port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
+       unsigned char chassis_num;  /* 1 based Chassis number (1 = boot node)          */
+} __attribute__((packed));
+
+struct rio_detail {
+       unsigned char node_id;      /* RIO Node ID                                     */
+       unsigned long BBAR;         /* Address of 1MB register space                   */
+       unsigned char type;         /* Type of device                                  */
+       unsigned char owner_id;     /* For WPEG: Node ID of Cyclone that owns this WPEG*/
+                                   /* For CYC:  Node ID of Twister that owns this CYC */
+       unsigned char port0node;    /* Node ID port connected to: 0xFF=None            */
+       unsigned char port0port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
+       unsigned char port1node;    /* Node ID port connected to: 0xFF=None            */
+       unsigned char port1port;    /* Port num port connected to: 0,1,2, or 0xFF=None */
+       unsigned char first_slot;   /* For WPEG: Lowest slot number below this WPEG    */
+                                   /* For CYC:  0                                     */
+       unsigned char status;       /* For WPEG: Bit 0 = 1 : the XAPIC is used         */
+                                   /*                 = 0 : the XAPIC is not used, ie:*/
+                                   /*                     ints fwded to another XAPIC */
+                                   /*           Bits1:7 Reserved                      */
+                                   /* For CYC:  Bits0:7 Reserved                      */
+       unsigned char WP_index;     /* For WPEG: WPEG instance index - lower ones have */
+                                   /*           lower slot numbers/PCI bus numbers    */
+                                   /* For CYC:  No meaning                            */
+       unsigned char chassis_num;  /* 1 based Chassis number                          */
+                                   /* For LookOut WPEGs this field indicates the      */
+                                   /* Expansion Chassis #, enumerated from Boot       */
+                                   /* Node WPEG external port, then Boot Node CYC     */
+                                   /* external port, then Next Vigil chassis WPEG     */
+                                   /* external port, etc.                             */
+                                   /* Shared Lookouts have only 1 chassis number (the */
+                                   /* first one assigned)                             */
+} __attribute__((packed));
+
+
+typedef enum {
+       CompatTwister = 0,  /* Compatibility Twister               */
+       AltTwister    = 1,  /* Alternate Twister of internal 8-way */
+       CompatCyclone = 2,  /* Compatibility Cyclone               */
+       AltCyclone    = 3,  /* Alternate Cyclone of internal 8-way */
+       CompatWPEG    = 4,  /* Compatibility WPEG                  */
+       AltWPEG       = 5,  /* Second Planar WPEG                  */
+       LookOutAWPEG  = 6,  /* LookOut WPEG                        */
+       LookOutBWPEG  = 7,  /* LookOut WPEG                        */
+} node_type;
+
+static inline int is_WPEG(struct rio_detail *rio){
+       return (rio->type == CompatWPEG || rio->type == AltWPEG ||
+               rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
+}
+
+
+/* In clustered mode, the high nibble of APIC ID is a cluster number.
+ * The low nibble is a 4-bit bitmap. */
+#define XAPIC_DEST_CPUS_SHIFT  4
+#define XAPIC_DEST_CPUS_MASK   ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
+#define XAPIC_DEST_CLUSTER_MASK        (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
+
+#define SUMMIT_APIC_DFR_VALUE  (APIC_DFR_CLUSTER)
+
+static inline const cpumask_t *summit_target_cpus(void)
+{
+       /* CPU_MASK_ALL (0xff) has undefined behaviour with
+        * dest_LowestPrio mode logical clustered apic interrupt routing
+        * Just start on cpu 0.  IRQ balancing will spread load
+        */
+       return &cpumask_of_cpu(0);
+}
+
+static inline unsigned long
+summit_check_apicid_used(physid_mask_t bitmap, int apicid)
+{
+       return 0;
+}
+
+/* we don't use the phys_cpu_present_map to indicate apicid presence */
+static inline unsigned long summit_check_apicid_present(int bit)
+{
+       return 1;
+}
+
+#define apicid_cluster(apicid) ((apicid) & XAPIC_DEST_CLUSTER_MASK)
+
+extern u8 cpu_2_logical_apicid[];
+
+static inline void summit_init_apic_ldr(void)
+{
+       unsigned long val, id;
+       int count = 0;
+       u8 my_id = (u8)hard_smp_processor_id();
+       u8 my_cluster = (u8)apicid_cluster(my_id);
+#ifdef CONFIG_SMP
+       u8 lid;
+       int i;
+
+       /* Create logical APIC IDs by counting CPUs already in cluster. */
+       for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
+               lid = cpu_2_logical_apicid[i];
+               if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
+                       ++count;
+       }
+#endif
+       /* We only have a 4 wide bitmap in cluster mode.  If a deranged
+        * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
+       BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
+       id = my_cluster | (1UL << count);
+       apic_write(APIC_DFR, SUMMIT_APIC_DFR_VALUE);
+       val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
+       val |= SET_APIC_LOGICAL_ID(id);
+       apic_write(APIC_LDR, val);
+}
+
+static inline int summit_apic_id_registered(void)
+{
+       return 1;
+}
+
+static inline void summit_setup_apic_routing(void)
+{
+       printk("Enabling APIC mode:  Summit.  Using %d I/O APICs\n",
+                                               nr_ioapics);
+}
+
+static inline int summit_apicid_to_node(int logical_apicid)
+{
+#ifdef CONFIG_SMP
+       return apicid_2_node[hard_smp_processor_id()];
+#else
+       return 0;
+#endif
+}
+
+/* Mapping from cpu number to logical apicid */
+static inline int summit_cpu_to_logical_apicid(int cpu)
+{
+#ifdef CONFIG_SMP
+       if (cpu >= nr_cpu_ids)
+               return BAD_APICID;
+       return (int)cpu_2_logical_apicid[cpu];
+#else
+       return logical_smp_processor_id();
+#endif
+}
+
+static inline int summit_cpu_present_to_apicid(int mps_cpu)
+{
+       if (mps_cpu < nr_cpu_ids)
+               return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
+       else
+               return BAD_APICID;
+}
+
+static inline physid_mask_t
+summit_ioapic_phys_id_map(physid_mask_t phys_id_map)
+{
+       /* For clustered we don't have a good way to do this yet - hack */
+       return physids_promote(0x0F);
+}
+
+static inline physid_mask_t summit_apicid_to_cpu_present(int apicid)
+{
+       return physid_mask_of_physid(0);
+}
+
+static inline void summit_setup_portio_remap(void)
+{
+}
+
+static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+       return 1;
+}
+
+static inline unsigned int summit_cpu_mask_to_apicid(const cpumask_t *cpumask)
+{
+       int cpus_found = 0;
+       int num_bits_set;
+       int apicid;
+       int cpu;
+
+       num_bits_set = cpus_weight(*cpumask);
+       /* Return id to all */
+       if (num_bits_set >= nr_cpu_ids)
+               return 0xFF;
+       /*
+        * The cpus in the mask must all be on the apic cluster.  If are not
+        * on the same apicid cluster return default value of target_cpus():
+        */
+       cpu = first_cpu(*cpumask);
+       apicid = summit_cpu_to_logical_apicid(cpu);
+
+       while (cpus_found < num_bits_set) {
+               if (cpu_isset(cpu, *cpumask)) {
+                       int new_apicid = summit_cpu_to_logical_apicid(cpu);
+
+                       if (apicid_cluster(apicid) !=
+                                       apicid_cluster(new_apicid)) {
+                               printk ("%s: Not a valid mask!\n", __func__);
+
+                               return 0xFF;
+                       }
+                       apicid = apicid | new_apicid;
+                       cpus_found++;
+               }
+               cpu++;
+       }
+       return apicid;
+}
+
+static inline unsigned int
+summit_cpu_mask_to_apicid_and(const struct cpumask *inmask,
+                             const struct cpumask *andmask)
+{
+       int apicid = summit_cpu_to_logical_apicid(0);
+       cpumask_var_t cpumask;
+
+       if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
+               return apicid;
+
+       cpumask_and(cpumask, inmask, andmask);
+       cpumask_and(cpumask, cpumask, cpu_online_mask);
+       apicid = summit_cpu_mask_to_apicid(cpumask);
+
+       free_cpumask_var(cpumask);
+
+       return apicid;
+}
+
+/*
+ * cpuid returns the value latched in the HW at reset, not the APIC ID
+ * register's value.  For any box whose BIOS changes APIC IDs, like
+ * clustered APIC systems, we must use hard_smp_processor_id.
+ *
+ * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
+ */
+static inline int summit_phys_pkg_id(int cpuid_apic, int index_msb)
+{
+       return hard_smp_processor_id() >> index_msb;
+}
+
+static int probe_summit(void)
+{
+       /* probed later in mptable/ACPI hooks */
+       return 0;
+}
+
+static void summit_vector_allocation_domain(int cpu, cpumask_t *retmask)
+{
+       /* Careful. Some cpus do not strictly honor the set of cpus
+        * specified in the interrupt destination when using lowest
+        * priority interrupt delivery mode.
+        *
+        * In particular there was a hyperthreading cpu observed to
+        * deliver interrupts to the wrong hyperthread when only one
+        * hyperthread was specified in the interrupt desitination.
+        */
+       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
+}
+
+#ifdef CONFIG_X86_SUMMIT_NUMA
 static struct rio_table_hdr *rio_table_hdr __initdata;
 static struct scal_detail   *scal_devs[MAX_NUMNODES] __initdata;
 static struct rio_detail    *rio_devs[MAX_NUMNODES*4] __initdata;
@@ -186,3 +542,61 @@ void __init setup_summit(void)
                        next_wpeg = 0;
        } while (next_wpeg != 0);
 }
+#endif
+
+struct genapic apic_summit = {
+
+       .name                           = "summit",
+       .probe                          = probe_summit,
+       .acpi_madt_oem_check            = summit_acpi_madt_oem_check,
+       .apic_id_registered             = summit_apic_id_registered,
+
+       .irq_delivery_mode              = dest_LowestPrio,
+       /* logical delivery broadcast to all CPUs: */
+       .irq_dest_mode                  = 1,
+
+       .target_cpus                    = summit_target_cpus,
+       .disable_esr                    = 1,
+       .dest_logical                   = APIC_DEST_LOGICAL,
+       .check_apicid_used              = summit_check_apicid_used,
+       .check_apicid_present           = summit_check_apicid_present,
+
+       .vector_allocation_domain       = summit_vector_allocation_domain,
+       .init_apic_ldr                  = summit_init_apic_ldr,
+
+       .ioapic_phys_id_map             = summit_ioapic_phys_id_map,
+       .setup_apic_routing             = summit_setup_apic_routing,
+       .multi_timer_check              = NULL,
+       .apicid_to_node                 = summit_apicid_to_node,
+       .cpu_to_logical_apicid          = summit_cpu_to_logical_apicid,
+       .cpu_present_to_apicid          = summit_cpu_present_to_apicid,
+       .apicid_to_cpu_present          = summit_apicid_to_cpu_present,
+       .setup_portio_remap             = NULL,
+       .check_phys_apicid_present      = summit_check_phys_apicid_present,
+       .enable_apic_mode               = NULL,
+       .phys_pkg_id                    = summit_phys_pkg_id,
+       .mps_oem_check                  = summit_mps_oem_check,
+
+       .get_apic_id                    = summit_get_apic_id,
+       .set_apic_id                    = NULL,
+       .apic_id_mask                   = 0xFF << 24,
+
+       .cpu_mask_to_apicid             = summit_cpu_mask_to_apicid,
+       .cpu_mask_to_apicid_and         = summit_cpu_mask_to_apicid_and,
+
+       .send_IPI_mask                  = summit_send_IPI_mask,
+       .send_IPI_mask_allbutself       = NULL,
+       .send_IPI_allbutself            = summit_send_IPI_allbutself,
+       .send_IPI_all                   = summit_send_IPI_all,
+       .send_IPI_self                  = default_send_IPI_self,
+
+       .wakeup_cpu                     = NULL,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
+
+       .wait_for_init_deassert         = default_wait_for_init_deassert,
+
+       .smp_callin_clear_local_apic    = NULL,
+       .store_NMI_vector               = NULL,
+       .inquire_remote_apic            = default_inquire_remote_apic,
+};
index 3985cac..764c74e 100644 (file)
@@ -38,7 +38,7 @@
 #include <asm/time.h>
 #include <asm/timer.h>
 
-#include "do_timer.h"
+#include <asm/do_timer.h>
 
 int timer_ack;
 
index f4b2f27..f396e61 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/tsc.h>
 #include <asm/irq_vectors.h>
 
-#include <mach_apic.h>
+#include <asm/genapic.h>
 
 static struct bau_control      **uv_bau_table_bases __read_mostly;
 static int                     uv_bau_retry_limit __read_mostly;
index ed5aee5..214bc32 100644 (file)
@@ -54,7 +54,7 @@
 #include <asm/desc.h>
 #include <asm/i387.h>
 
-#include <mach_traps.h>
+#include <asm/mach_traps.h>
 
 #ifdef CONFIG_X86_64
 #include <asm/pgalloc.h>
index 599e581..83d53ce 100644 (file)
@@ -773,7 +773,7 @@ __cpuinit int unsynchronized_tsc(void)
        if (!cpu_has_tsc || tsc_unstable)
                return 1;
 
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
        if (apic_is_clustered_box())
                return 1;
 #endif
index d801d06..4fd646e 100644 (file)
@@ -32,9 +32,9 @@
 #include <asm/e820.h>
 #include <asm/io.h>
 
-#include <mach_ipi.h>
+#include <asm/genapic.h>
 
-#include "mach_apic.h"
+#include <asm/genapic.h>
 
 #include <linux/kernel_stat.h>
 
@@ -200,7 +200,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
                return;
        }
 
-       apic_cpus = apicid_to_cpu_present(m->apicid);
+       apic_cpus = apic->apicid_to_cpu_present(m->apicid);
        physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
        /*
         * Validate version
index c4c1f9e..a4791ef 100644 (file)
@@ -256,7 +256,7 @@ void __devinit vmi_time_bsp_init(void)
         */
        clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
        local_irq_disable();
-#ifdef CONFIG_X86_SMP
+#ifdef CONFIG_SMP
        /*
         * XXX handle_percpu_irq only defined for SMP; we need to switch over
         * to using it, since this is a local interrupt, which each CPU must
diff --git a/arch/x86/mach-default/Makefile b/arch/x86/mach-default/Makefile
deleted file mode 100644 (file)
index 012fe34..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the linux kernel.
-#
-
-obj-y                          := setup.o
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c
deleted file mode 100644 (file)
index df167f2..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *     Machine specific setup for generic
- */
-
-#include <linux/smp.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <asm/acpi.h>
-#include <asm/arch_hooks.h>
-#include <asm/e820.h>
-#include <asm/setup.h>
-
-#include <mach_ipi.h>
-
-#ifdef CONFIG_HOTPLUG_CPU
-#define DEFAULT_SEND_IPI       (1)
-#else
-#define DEFAULT_SEND_IPI       (0)
-#endif
-
-int no_broadcast = DEFAULT_SEND_IPI;
-
-/**
- * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
- *
- * Description:
- *     Perform any necessary interrupt initialisation prior to setting up
- *     the "ordinary" interrupt call gates.  For legacy reasons, the ISA
- *     interrupts should be initialised here if the machine emulates a PC
- *     in any way.
- **/
-void __init pre_intr_init_hook(void)
-{
-       if (x86_quirks->arch_pre_intr_init) {
-               if (x86_quirks->arch_pre_intr_init())
-                       return;
-       }
-       init_ISA_irqs();
-}
-
-/**
- * intr_init_hook - post gate setup interrupt initialisation
- *
- * Description:
- *     Fill in any interrupts that may have been left out by the general
- *     init_IRQ() routine.  interrupts having to do with the machine rather
- *     than the devices on the I/O bus (like APIC interrupts in intel MP
- *     systems) are started here.
- **/
-void __init intr_init_hook(void)
-{
-       if (x86_quirks->arch_intr_init) {
-               if (x86_quirks->arch_intr_init())
-                       return;
-       }
-}
-
-/**
- * pre_setup_arch_hook - hook called prior to any setup_arch() execution
- *
- * Description:
- *     generally used to activate any machine specific identification
- *     routines that may be needed before setup_arch() runs.  On Voyager
- *     this is used to get the board revision and type.
- **/
-void __init pre_setup_arch_hook(void)
-{
-}
-
-/**
- * trap_init_hook - initialise system specific traps
- *
- * Description:
- *     Called as the final act of trap_init().  Used in VISWS to initialise
- *     the various board specific APIC traps.
- **/
-void __init trap_init_hook(void)
-{
-       if (x86_quirks->arch_trap_init) {
-               if (x86_quirks->arch_trap_init())
-                       return;
-       }
-}
-
-static struct irqaction irq0  = {
-       .handler = timer_interrupt,
-       .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
-       .mask = CPU_MASK_NONE,
-       .name = "timer"
-};
-
-/**
- * pre_time_init_hook - do any specific initialisations before.
- *
- **/
-void __init pre_time_init_hook(void)
-{
-       if (x86_quirks->arch_pre_time_init)
-               x86_quirks->arch_pre_time_init();
-}
-
-/**
- * time_init_hook - do any specific initialisations for the system timer.
- *
- * Description:
- *     Must plug the system timer interrupt source at HZ into the IRQ listed
- *     in irq_vectors.h:TIMER_IRQ
- **/
-void __init time_init_hook(void)
-{
-       if (x86_quirks->arch_time_init) {
-               /*
-                * A nonzero return code does not mean failure, it means
-                * that the architecture quirk does not want any
-                * generic (timer) setup to be performed after this:
-                */
-               if (x86_quirks->arch_time_init())
-                       return;
-       }
-
-       irq0.mask = cpumask_of_cpu(0);
-       setup_irq(0, &irq0);
-}
-
-#ifdef CONFIG_MCA
-/**
- * mca_nmi_hook - hook into MCA specific NMI chain
- *
- * Description:
- *     The MCA (Microchannel Architecture) has an NMI chain for NMI sources
- *     along the MCA bus.  Use this to hook into that chain if you will need
- *     it.
- **/
-void mca_nmi_hook(void)
-{
-       /*
-        * If I recall correctly, there's a whole bunch of other things that
-        * we can do to check for NMI problems, but that's all I know about
-        * at the moment.
-        */
-       pr_warning("NMI generated from unknown source!\n");
-}
-#endif
-
-static __init int no_ipi_broadcast(char *str)
-{
-       get_option(&str, &no_broadcast);
-       pr_info("Using %s mode\n",
-               no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
-       return 1;
-}
-__setup("no_ipi_broadcast=", no_ipi_broadcast);
-
-static int __init print_ipi_mode(void)
-{
-       pr_info("Using IPI %s mode\n",
-               no_broadcast ? "No-Shortcut" : "Shortcut");
-       return 0;
-}
-
-late_initcall(print_ipi_mode);
-
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
deleted file mode 100644 (file)
index 6730f4e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Makefile for the generic architecture
-#
-
-EXTRA_CFLAGS                   := -Iarch/x86/kernel
-
-obj-y                          := probe.o default.o
-obj-$(CONFIG_X86_NUMAQ)                += numaq.o
-obj-$(CONFIG_X86_SUMMIT)       += summit.o
-obj-$(CONFIG_X86_BIGSMP)       += bigsmp.o
-obj-$(CONFIG_X86_ES7000)       += es7000.o
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
deleted file mode 100644 (file)
index bc4c784..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
- * Drives the local APIC in "clustered mode".
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/dmi.h>
-#include <asm/bigsmp/apicdef.h>
-#include <linux/smp.h>
-#include <asm/bigsmp/apic.h>
-#include <asm/bigsmp/ipi.h>
-#include <asm/mach-default/mach_mpparse.h>
-#include <asm/mach-default/mach_wakecpu.h>
-
-static int dmi_bigsmp; /* can be set by dmi scanners */
-
-static int hp_ht_bigsmp(const struct dmi_system_id *d)
-{
-       printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
-       dmi_bigsmp = 1;
-       return 0;
-}
-
-
-static const struct dmi_system_id bigsmp_dmi_table[] = {
-       { hp_ht_bigsmp, "HP ProLiant DL760 G2",
-       { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-       DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
-       },
-
-       { hp_ht_bigsmp, "HP ProLiant DL740",
-       { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
-       DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
-       },
-        { }
-};
-
-static void vector_allocation_domain(int cpu, cpumask_t *retmask)
-{
-       cpus_clear(*retmask);
-       cpu_set(cpu, *retmask);
-}
-
-static int probe_bigsmp(void)
-{
-       if (def_to_bigsmp)
-               dmi_bigsmp = 1;
-       else
-               dmi_check_system(bigsmp_dmi_table);
-       return dmi_bigsmp;
-}
-
-struct genapic apic_bigsmp = APIC_INIT("bigsmp", probe_bigsmp);
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
deleted file mode 100644 (file)
index e63a4a7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Default generic APIC driver. This handles up to 8 CPUs.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/mach-default/mach_apicdef.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/smp.h>
-#include <linux/init.h>
-#include <asm/mach-default/mach_apic.h>
-#include <asm/mach-default/mach_ipi.h>
-#include <asm/mach-default/mach_mpparse.h>
-#include <asm/mach-default/mach_wakecpu.h>
-
-/* should be called last. */
-static int probe_default(void)
-{
-       return 1;
-}
-
-struct genapic apic_default = APIC_INIT("default", probe_default);
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
deleted file mode 100644 (file)
index c2ded14..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * APIC driver for the Unisys ES7000 chipset.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <asm/es7000/apicdef.h>
-#include <linux/smp.h>
-#include <asm/es7000/apic.h>
-#include <asm/es7000/ipi.h>
-#include <asm/es7000/mpparse.h>
-#include <asm/mach-default/mach_wakecpu.h>
-
-void __init es7000_update_genapic_to_cluster(void)
-{
-       genapic->target_cpus = target_cpus_cluster;
-       genapic->int_delivery_mode = INT_DELIVERY_MODE_CLUSTER;
-       genapic->int_dest_mode = INT_DEST_MODE_CLUSTER;
-       genapic->no_balance_irq = NO_BALANCE_IRQ_CLUSTER;
-
-       genapic->init_apic_ldr = init_apic_ldr_cluster;
-
-       genapic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster;
-}
-
-static int probe_es7000(void)
-{
-       /* probed later in mptable/ACPI hooks */
-       return 0;
-}
-
-extern void es7000_sw_apic(void);
-static void __init enable_apic_mode(void)
-{
-       es7000_sw_apic();
-       return;
-}
-
-static __init int
-mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
-{
-       if (mpc->oemptr) {
-               struct mpc_oemtable *oem_table =
-                       (struct mpc_oemtable *)mpc->oemptr;
-               if (!strncmp(oem, "UNISYS", 6))
-                       return parse_unisys_oem((char *)oem_table);
-       }
-       return 0;
-}
-
-#ifdef CONFIG_ACPI
-/* Hook from generic ACPI tables.c */
-static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
-       unsigned long oem_addr = 0;
-       int check_dsdt;
-       int ret = 0;
-
-       /* check dsdt at first to avoid clear fix_map for oem_addr */
-       check_dsdt = es7000_check_dsdt();
-
-       if (!find_unisys_acpi_oem_table(&oem_addr)) {
-               if (check_dsdt)
-                       ret = parse_unisys_oem((char *)oem_addr);
-               else {
-                       setup_unisys();
-                       ret = 1;
-               }
-               /*
-                * we need to unmap it
-                */
-               unmap_unisys_acpi_oem_table(oem_addr);
-       }
-       return ret;
-}
-#else
-static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
-       return 0;
-}
-#endif
-
-static void vector_allocation_domain(int cpu, cpumask_t *retmask)
-{
-       /* Careful. Some cpus do not strictly honor the set of cpus
-        * specified in the interrupt destination when using lowest
-        * priority interrupt delivery mode.
-        *
-        * In particular there was a hyperthreading cpu observed to
-        * deliver interrupts to the wrong hyperthread when only one
-        * hyperthread was specified in the interrupt desitination.
-        */
-       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
-}
-
-struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000);
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
deleted file mode 100644 (file)
index 3679e22..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * APIC driver for the IBM NUMAQ chipset.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <asm/numaq/apicdef.h>
-#include <linux/smp.h>
-#include <asm/numaq/apic.h>
-#include <asm/numaq/ipi.h>
-#include <asm/numaq/mpparse.h>
-#include <asm/numaq/wakecpu.h>
-#include <asm/numaq.h>
-
-static int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
-{
-       numaq_mps_oem_check(mpc, oem, productid);
-       return found_numaq;
-}
-
-static int probe_numaq(void)
-{
-       /* already know from get_memcfg_numaq() */
-       return found_numaq;
-}
-
-/* Hook from generic ACPI tables.c */
-static int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
-       return 0;
-}
-
-static void vector_allocation_domain(int cpu, cpumask_t *retmask)
-{
-       /* Careful. Some cpus do not strictly honor the set of cpus
-        * specified in the interrupt destination when using lowest
-        * priority interrupt delivery mode.
-        *
-        * In particular there was a hyperthreading cpu observed to
-        * deliver interrupts to the wrong hyperthread when only one
-        * hyperthread was specified in the interrupt desitination.
-        */
-       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
-}
-
-struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq);
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
deleted file mode 100644 (file)
index 15a38da..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2003 Andi Kleen, SuSE Labs.
- * Subject to the GNU Public License, v.2
- *
- * Generic x86 APIC driver probe layer.
- */
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <linux/string.h>
-#include <linux/kernel.h>
-#include <linux/ctype.h>
-#include <linux/init.h>
-#include <linux/errno.h>
-#include <asm/fixmap.h>
-#include <asm/mpspec.h>
-#include <asm/apicdef.h>
-#include <asm/genapic.h>
-#include <asm/setup.h>
-
-extern struct genapic apic_numaq;
-extern struct genapic apic_summit;
-extern struct genapic apic_bigsmp;
-extern struct genapic apic_es7000;
-extern struct genapic apic_default;
-
-struct genapic *genapic = &apic_default;
-
-static struct genapic *apic_probe[] __initdata = {
-#ifdef CONFIG_X86_NUMAQ
-       &apic_numaq,
-#endif
-#ifdef CONFIG_X86_SUMMIT
-       &apic_summit,
-#endif
-#ifdef CONFIG_X86_BIGSMP
-       &apic_bigsmp,
-#endif
-#ifdef CONFIG_X86_ES7000
-       &apic_es7000,
-#endif
-       &apic_default,  /* must be last */
-       NULL,
-};
-
-static int cmdline_apic __initdata;
-static int __init parse_apic(char *arg)
-{
-       int i;
-
-       if (!arg)
-               return -EINVAL;
-
-       for (i = 0; apic_probe[i]; i++) {
-               if (!strcmp(apic_probe[i]->name, arg)) {
-                       genapic = apic_probe[i];
-                       cmdline_apic = 1;
-                       return 0;
-               }
-       }
-
-       if (x86_quirks->update_genapic)
-               x86_quirks->update_genapic();
-
-       /* Parsed again by __setup for debug/verbose */
-       return 0;
-}
-early_param("apic", parse_apic);
-
-void __init generic_bigsmp_probe(void)
-{
-#ifdef CONFIG_X86_BIGSMP
-       /*
-        * This routine is used to switch to bigsmp mode when
-        * - There is no apic= option specified by the user
-        * - generic_apic_probe() has chosen apic_default as the sub_arch
-        * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
-        */
-
-       if (!cmdline_apic && genapic == &apic_default) {
-               if (apic_bigsmp.probe()) {
-                       genapic = &apic_bigsmp;
-                       if (x86_quirks->update_genapic)
-                               x86_quirks->update_genapic();
-                       printk(KERN_INFO "Overriding APIC driver with %s\n",
-                              genapic->name);
-               }
-       }
-#endif
-}
-
-void __init generic_apic_probe(void)
-{
-       if (!cmdline_apic) {
-               int i;
-               for (i = 0; apic_probe[i]; i++) {
-                       if (apic_probe[i]->probe()) {
-                               genapic = apic_probe[i];
-                               break;
-                       }
-               }
-               /* Not visible without early console */
-               if (!apic_probe[i])
-                       panic("Didn't find an APIC driver");
-
-               if (x86_quirks->update_genapic)
-                       x86_quirks->update_genapic();
-       }
-       printk(KERN_INFO "Using APIC driver %s\n", genapic->name);
-}
-
-/* These functions can switch the APIC even after the initial ->probe() */
-
-int __init mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
-{
-       int i;
-       for (i = 0; apic_probe[i]; ++i) {
-               if (apic_probe[i]->mps_oem_check(mpc, oem, productid)) {
-                       if (!cmdline_apic) {
-                               genapic = apic_probe[i];
-                               if (x86_quirks->update_genapic)
-                                       x86_quirks->update_genapic();
-                               printk(KERN_INFO "Switched to APIC driver `%s'.\n",
-                                      genapic->name);
-                       }
-                       return 1;
-               }
-       }
-       return 0;
-}
-
-int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
-{
-       int i;
-       for (i = 0; apic_probe[i]; ++i) {
-               if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
-                       if (!cmdline_apic) {
-                               genapic = apic_probe[i];
-                               if (x86_quirks->update_genapic)
-                                       x86_quirks->update_genapic();
-                               printk(KERN_INFO "Switched to APIC driver `%s'.\n",
-                                      genapic->name);
-                       }
-                       return 1;
-               }
-       }
-       return 0;
-}
-
-int hard_smp_processor_id(void)
-{
-       return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
-}
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
deleted file mode 100644 (file)
index 2821ffc..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * APIC driver for the IBM "Summit" chipset.
- */
-#define APIC_DEFINITION 1
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <asm/mpspec.h>
-#include <asm/genapic.h>
-#include <asm/fixmap.h>
-#include <asm/apicdef.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <asm/summit/apicdef.h>
-#include <linux/smp.h>
-#include <asm/summit/apic.h>
-#include <asm/summit/ipi.h>
-#include <asm/summit/mpparse.h>
-#include <asm/mach-default/mach_wakecpu.h>
-
-static int probe_summit(void)
-{
-       /* probed later in mptable/ACPI hooks */
-       return 0;
-}
-
-static void vector_allocation_domain(int cpu, cpumask_t *retmask)
-{
-       /* Careful. Some cpus do not strictly honor the set of cpus
-        * specified in the interrupt destination when using lowest
-        * priority interrupt delivery mode.
-        *
-        * In particular there was a hyperthreading cpu observed to
-        * deliver interrupts to the wrong hyperthread when only one
-        * hyperthread was specified in the interrupt desitination.
-        */
-       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
-}
-
-struct genapic apic_summit = APIC_INIT("summit", probe_summit);
diff --git a/arch/x86/mach-rdc321x/Makefile b/arch/x86/mach-rdc321x/Makefile
deleted file mode 100644 (file)
index 8325b4c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the RDC321x specific parts of the kernel
-#
-obj-$(CONFIG_X86_RDC321X)        := gpio.o platform.o
-
diff --git a/arch/x86/mach-rdc321x/gpio.c b/arch/x86/mach-rdc321x/gpio.c
deleted file mode 100644 (file)
index 247f33d..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- *  GPIO support for RDC SoC R3210/R8610
- *
- *  Copyright (C) 2007, Florian Fainelli <florian@openwrt.org>
- *  Copyright (C) 2008, Volker Weiss <dev@tintuc.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-
-#include <linux/spinlock.h>
-#include <linux/io.h>
-#include <linux/types.h>
-#include <linux/module.h>
-
-#include <asm/gpio.h>
-#include <asm/mach-rdc321x/rdc321x_defs.h>
-
-
-/* spin lock to protect our private copy of GPIO data register plus
-   the access to PCI conf registers. */
-static DEFINE_SPINLOCK(gpio_lock);
-
-/* copy of GPIO data registers */
-static u32 gpio_data_reg1;
-static u32 gpio_data_reg2;
-
-static u32 gpio_request_data[2];
-
-
-static inline void rdc321x_conf_write(unsigned addr, u32 value)
-{
-       outl((1 << 31) | (7 << 11) | addr, RDC3210_CFGREG_ADDR);
-       outl(value, RDC3210_CFGREG_DATA);
-}
-
-static inline void rdc321x_conf_or(unsigned addr, u32 value)
-{
-       outl((1 << 31) | (7 << 11) | addr, RDC3210_CFGREG_ADDR);
-       value |= inl(RDC3210_CFGREG_DATA);
-       outl(value, RDC3210_CFGREG_DATA);
-}
-
-static inline u32 rdc321x_conf_read(unsigned addr)
-{
-       outl((1 << 31) | (7 << 11) | addr, RDC3210_CFGREG_ADDR);
-
-       return inl(RDC3210_CFGREG_DATA);
-}
-
-/* configure pin as GPIO */
-static void rdc321x_configure_gpio(unsigned gpio)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&gpio_lock, flags);
-       rdc321x_conf_or(gpio < 32
-               ? RDC321X_GPIO_CTRL_REG1 : RDC321X_GPIO_CTRL_REG2,
-               1 << (gpio & 0x1f));
-       spin_unlock_irqrestore(&gpio_lock, flags);
-}
-
-/* initially setup the 2 copies of the gpio data registers.
-   This function must be called by the platform setup code. */
-void __init rdc321x_gpio_setup()
-{
-       /* this might not be, what others (BIOS, bootloader, etc.)
-          wrote to these registers before, but it's a good guess. Still
-          better than just using 0xffffffff. */
-
-       gpio_data_reg1 = rdc321x_conf_read(RDC321X_GPIO_DATA_REG1);
-       gpio_data_reg2 = rdc321x_conf_read(RDC321X_GPIO_DATA_REG2);
-}
-
-/* determine, if gpio number is valid */
-static inline int rdc321x_is_gpio(unsigned gpio)
-{
-       return gpio <= RDC321X_MAX_GPIO;
-}
-
-/* request GPIO */
-int rdc_gpio_request(unsigned gpio, const char *label)
-{
-       unsigned long flags;
-
-       if (!rdc321x_is_gpio(gpio))
-               return -EINVAL;
-
-       spin_lock_irqsave(&gpio_lock, flags);
-       if (gpio_request_data[(gpio & 0x20) ? 1 : 0] & (1 << (gpio & 0x1f)))
-               goto inuse;
-       gpio_request_data[(gpio & 0x20) ? 1 : 0] |= (1 << (gpio & 0x1f));
-       spin_unlock_irqrestore(&gpio_lock, flags);
-
-       return 0;
-inuse:
-       spin_unlock_irqrestore(&gpio_lock, flags);
-       return -EINVAL;
-}
-EXPORT_SYMBOL(rdc_gpio_request);
-
-/* release previously-claimed GPIO */
-void rdc_gpio_free(unsigned gpio)
-{
-       unsigned long flags;
-
-       if (!rdc321x_is_gpio(gpio))
-               return;
-
-       spin_lock_irqsave(&gpio_lock, flags);
-       gpio_request_data[(gpio & 0x20) ? 1 : 0] &= ~(1 << (gpio & 0x1f));
-       spin_unlock_irqrestore(&gpio_lock, flags);
-}
-EXPORT_SYMBOL(rdc_gpio_free);
-
-/* read GPIO pin */
-int rdc_gpio_get_value(unsigned gpio)
-{
-       u32 reg;
-       unsigned long flags;
-
-       spin_lock_irqsave(&gpio_lock, flags);
-       reg = rdc321x_conf_read(gpio < 32
-               ? RDC321X_GPIO_DATA_REG1 : RDC321X_GPIO_DATA_REG2);
-       spin_unlock_irqrestore(&gpio_lock, flags);
-
-       return (1 << (gpio & 0x1f)) & reg ? 1 : 0;
-}
-EXPORT_SYMBOL(rdc_gpio_get_value);
-
-/* set GPIO pin to value */
-void rdc_gpio_set_value(unsigned gpio, int value)
-{
-       unsigned long flags;
-       u32 reg;
-
-       reg = 1 << (gpio & 0x1f);
-       if (gpio < 32) {
-               spin_lock_irqsave(&gpio_lock, flags);
-               if (value)
-                       gpio_data_reg1 |= reg;
-               else
-                       gpio_data_reg1 &= ~reg;
-               rdc321x_conf_write(RDC321X_GPIO_DATA_REG1, gpio_data_reg1);
-               spin_unlock_irqrestore(&gpio_lock, flags);
-       } else {
-               spin_lock_irqsave(&gpio_lock, flags);
-               if (value)
-                       gpio_data_reg2 |= reg;
-               else
-                       gpio_data_reg2 &= ~reg;
-               rdc321x_conf_write(RDC321X_GPIO_DATA_REG2, gpio_data_reg2);
-               spin_unlock_irqrestore(&gpio_lock, flags);
-       }
-}
-EXPORT_SYMBOL(rdc_gpio_set_value);
-
-/* configure GPIO pin as input */
-int rdc_gpio_direction_input(unsigned gpio)
-{
-       if (!rdc321x_is_gpio(gpio))
-               return -EINVAL;
-
-       rdc321x_configure_gpio(gpio);
-
-       return 0;
-}
-EXPORT_SYMBOL(rdc_gpio_direction_input);
-
-/* configure GPIO pin as output and set value */
-int rdc_gpio_direction_output(unsigned gpio, int value)
-{
-       if (!rdc321x_is_gpio(gpio))
-               return -EINVAL;
-
-       gpio_set_value(gpio, value);
-       rdc321x_configure_gpio(gpio);
-
-       return 0;
-}
-EXPORT_SYMBOL(rdc_gpio_direction_output);
diff --git a/arch/x86/mach-rdc321x/platform.c b/arch/x86/mach-rdc321x/platform.c
deleted file mode 100644 (file)
index 4f4e50c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  Generic RDC321x platform devices
- *
- *  Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
- *
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU General Public License
- *  as published by the Free Software Foundation; either version 2
- *  of the License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the
- *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA  02110-1301, USA.
- *
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/leds.h>
-
-#include <asm/gpio.h>
-
-/* LEDS */
-static struct gpio_led default_leds[] = {
-       { .name = "rdc:dmz", .gpio = 1, },
-};
-
-static struct gpio_led_platform_data rdc321x_led_data = {
-       .num_leds = ARRAY_SIZE(default_leds),
-       .leds = default_leds,
-};
-
-static struct platform_device rdc321x_leds = {
-       .name = "leds-gpio",
-       .id = -1,
-       .dev = {
-               .platform_data = &rdc321x_led_data,
-       }
-};
-
-/* Watchdog */
-static struct platform_device rdc321x_wdt = {
-       .name = "rdc321x-wdt",
-       .id = -1,
-       .num_resources = 0,
-};
-
-static struct platform_device *rdc321x_devs[] = {
-       &rdc321x_leds,
-       &rdc321x_wdt
-};
-
-static int __init rdc_board_setup(void)
-{
-       rdc321x_gpio_setup();
-
-       return platform_add_devices(rdc321x_devs, ARRAY_SIZE(rdc321x_devs));
-}
-
-arch_initcall(rdc_board_setup);
index 0ade625..66b7eb5 100644 (file)
@@ -34,13 +34,23 @@ void __init intr_init_hook(void)
        setup_irq(2, &irq2);
 }
 
-void __init pre_setup_arch_hook(void)
+static void voyager_disable_tsc(void)
 {
        /* Voyagers run their CPUs from independent clocks, so disable
         * the TSC code because we can't sync them */
        setup_clear_cpu_cap(X86_FEATURE_TSC);
 }
 
+void __init pre_setup_arch_hook(void)
+{
+       voyager_disable_tsc();
+}
+
+void __init pre_time_init_hook(void)
+{
+       voyager_disable_tsc();
+}
+
 void __init trap_init_hook(void)
 {
 }
index 58c7cac..6f5a38c 100644 (file)
@@ -81,7 +81,7 @@ static void enable_local_vic_irq(unsigned int irq);
 static void disable_local_vic_irq(unsigned int irq);
 static void before_handle_vic_irq(unsigned int irq);
 static void after_handle_vic_irq(unsigned int irq);
-static void set_vic_irq_affinity(unsigned int irq, cpumask_t mask);
+static void set_vic_irq_affinity(unsigned int irq, const struct cpumask *mask);
 static void ack_vic_irq(unsigned int irq);
 static void vic_enable_cpi(void);
 static void do_boot_cpu(__u8 cpuid);
@@ -211,8 +211,6 @@ static __u32 cpu_booted_map;
 static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
 
 /* This is for the new dynamic CPU boot code */
-cpumask_t cpu_callin_map = CPU_MASK_NONE;
-cpumask_t cpu_callout_map = CPU_MASK_NONE;
 
 /* The per processor IRQ masks (these are usually kept in sync) */
 static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
@@ -378,7 +376,7 @@ void __init find_smp_config(void)
        cpus_addr(phys_cpu_present_map)[0] |=
            voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
                                       3) << 24;
-       cpu_possible_map = phys_cpu_present_map;
+       init_cpu_possible(&phys_cpu_present_map);
        printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n",
               cpus_addr(phys_cpu_present_map)[0]);
        /* Here we set up the VIC to enable SMP */
@@ -1598,16 +1596,16 @@ static void after_handle_vic_irq(unsigned int irq)
  * change the mask and then do an interrupt enable CPI to re-enable on
  * the selected processors */
 
-void set_vic_irq_affinity(unsigned int irq, cpumask_t mask)
+void set_vic_irq_affinity(unsigned int irq, const struct cpumask *mask)
 {
        /* Only extended processors handle interrupts */
        unsigned long real_mask;
        unsigned long irq_mask = 1 << irq;
        int cpu;
 
-       real_mask = cpus_addr(mask)[0] & voyager_extended_vic_processors;
+       real_mask = cpus_addr(*mask)[0] & voyager_extended_vic_processors;
 
-       if (cpus_addr(mask)[0] == 0)
+       if (cpus_addr(*mask)[0] == 0)
                /* can't have no CPUs to accept the interrupt -- extremely
                 * bad things will happen */
                return;
@@ -1749,10 +1747,10 @@ static void __cpuinit voyager_smp_prepare_boot_cpu(void)
        int cpu = smp_processor_id();
        switch_to_new_gdt(cpu);
 
-       cpu_set(cpu, cpu_online_map);
-       cpu_set(cpu, cpu_callout_map);
-       cpu_set(cpu, cpu_possible_map);
-       cpu_set(cpu, cpu_present_map);
+       cpu_online_map = cpumask_of_cpu(smp_processor_id());
+       cpu_callout_map = cpumask_of_cpu(smp_processor_id());
+       cpu_callin_map = CPU_MASK_NONE;
+       cpu_present_map = cpumask_of_cpu(smp_processor_id());
 }
 
 static int __cpuinit voyager_cpu_up(unsigned int cpu)
@@ -1781,9 +1779,9 @@ void __init smp_setup_processor_id(void)
        current_thread_info()->cpu = hard_smp_processor_id();
 }
 
-static void voyager_send_call_func(cpumask_t callmask)
+static void voyager_send_call_func(const struct cpumask *callmask)
 {
-       __u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id());
+       __u32 mask = cpus_addr(*callmask)[0] & ~(1 << smp_processor_id());
        send_CPI(mask, VIC_CALL_FUNCTION_CPI);
 }
 
index 9f05157..2b938a3 100644 (file)
@@ -1,7 +1,7 @@
 obj-y  :=  init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
            pat.o pgtable.o gup.o
 
-obj-$(CONFIG_X86_SMP)          += tlb.o
+obj-$(CONFIG_SMP)              += tlb.o
 
 obj-$(CONFIG_X86_32)           += pgtable_32.o iomap_32.o
 
index 7e8db53..61b41ca 100644 (file)
@@ -23,6 +23,12 @@ int fixup_exception(struct pt_regs *regs)
 
        fixup = search_exception_tables(regs->ip);
        if (fixup) {
+               /* If fixup is less than 16, it means uaccess error */
+               if (fixup->fixup < 16) {
+                       current_thread_info()->uaccess_err = -EFAULT;
+                       regs->ip += fixup->fixup;
+                       return 1;
+               }
                regs->ip = fixup->fixup;
                return 1;
        }
index 65709a6..d3eee74 100644 (file)
@@ -420,7 +420,6 @@ static noinline void pgtable_bad(struct pt_regs *regs,
        printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
               tsk->comm, address);
        dump_pagetable(address);
-       tsk = current;
        tsk->thread.cr2 = address;
        tsk->thread.trap_no = 14;
        tsk->thread.error_code = error_code;
index af750ab..1448bcb 100644 (file)
@@ -367,7 +367,7 @@ EXPORT_SYMBOL(ioremap_nocache);
  *
  * Must be freed with iounmap.
  */
-void __iomem *ioremap_wc(unsigned long phys_addr, unsigned long size)
+void __iomem *ioremap_wc(resource_size_t phys_addr, unsigned long size)
 {
        if (pat_enabled)
                return __ioremap_caller(phys_addr, size, _PAGE_CACHE_WC,
index 56fe712..1658296 100644 (file)
@@ -4,7 +4,7 @@
  * Based on code by Ingo Molnar and Andi Kleen, copyrighted
  * as follows:
  *
- * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
+ * Copyright 2003-2009 Red Hat Inc.
  * All Rights Reserved.
  * Copyright 2005 Andi Kleen, SUSE Labs.
  * Copyright 2007 Jiri Kosina, SUSE Labs.
index 7b61036..9127e31 100644 (file)
@@ -30,7 +30,7 @@
 #ifdef CONFIG_X86_PAT
 int __read_mostly pat_enabled = 1;
 
-void __cpuinit pat_disable(char *reason)
+void __cpuinit pat_disable(const char *reason)
 {
        pat_enabled = 0;
        printk(KERN_INFO "%s\n", reason);
@@ -42,6 +42,11 @@ static int __init nopat(char *str)
        return 0;
 }
 early_param("nopat", nopat);
+#else
+static inline void pat_disable(const char *reason)
+{
+       (void)reason;
+}
 #endif
 
 
@@ -78,16 +83,20 @@ void pat_init(void)
        if (!pat_enabled)
                return;
 
-       /* Paranoia check. */
-       if (!cpu_has_pat && boot_pat_state) {
-               /*
-                * If this happens we are on a secondary CPU, but
-                * switched to PAT on the boot CPU. We have no way to
-                * undo PAT.
-                */
-               printk(KERN_ERR "PAT enabled, "
-                      "but not supported by secondary CPU\n");
-               BUG();
+       if (!cpu_has_pat) {
+               if (!boot_pat_state) {
+                       pat_disable("PAT not supported by CPU.");
+                       return;
+               } else {
+                       /*
+                        * If this happens we are on a secondary CPU, but
+                        * switched to PAT on the boot CPU. We have no way to
+                        * undo PAT.
+                        */
+                       printk(KERN_ERR "PAT enabled, "
+                              "but not supported by secondary CPU\n");
+                       BUG();
+               }
        }
 
        /* Set PWT to Write-Combining. All other bits stay the same */
index 72a6d4e..14c5af4 100644 (file)
@@ -14,7 +14,7 @@
 DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate)
                        = { &init_mm, 0, };
 
-#include <mach_ipi.h>
+#include <asm/genapic.h>
 /*
  *     Smarter SMP flushing macros.
  *             c/o Linus Torvalds.
@@ -196,7 +196,7 @@ static void flush_tlb_others_ipi(const struct cpumask *cpumask,
         * We have to send the IPI only to
         * CPUs affected.
         */
-       send_IPI_mask(to_cpumask(f->flush_cpumask),
+       apic->send_IPI_mask(to_cpumask(f->flush_cpumask),
                      INVALIDATE_TLB_VECTOR_START + sender);
 
        while (!cpumask_empty(to_cpumask(f->flush_cpumask)))
index 4064345..fecbce6 100644 (file)
@@ -572,6 +572,7 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
        case PCI_DEVICE_ID_INTEL_ICH7_1:
        case PCI_DEVICE_ID_INTEL_ICH7_30:
        case PCI_DEVICE_ID_INTEL_ICH7_31:
+       case PCI_DEVICE_ID_INTEL_TGP_LPC:
        case PCI_DEVICE_ID_INTEL_ESB2_0:
        case PCI_DEVICE_ID_INTEL_ICH8_0:
        case PCI_DEVICE_ID_INTEL_ICH8_1:
index 2089354..5601e82 100644 (file)
@@ -5,7 +5,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/nodemask.h>
-#include <mach_apic.h>
+#include <asm/genapic.h>
 #include <asm/mpspec.h>
 #include <asm/pci_x86.h>
 
 
 #define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
 
-/* Where the IO area was mapped on multiquad, always 0 otherwise */
-void *xquad_portio;
-EXPORT_SYMBOL(xquad_portio);
-
 #define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
 
 #define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \
index b82cae9..1c975cc 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/module.h>
 #include <linux/uaccess.h>
 #include <asm/pci_x86.h>
-#include <asm/mach-default/pci-functions.h>
+#include <asm/pci-functions.h>
 
 /* BIOS32 signature: "_32_" */
 #define BIOS32_SIGNATURE       (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
index e786fa7..9e565da 100644 (file)
@@ -19,8 +19,10 @@ DECLARE_PER_CPU(unsigned long, xen_mc_irq_flags);
    paired with xen_mc_issue() */
 static inline void xen_mc_batch(void)
 {
+       unsigned long flags;
        /* need to disable interrupts until this entry is complete */
-       local_irq_save(__get_cpu_var(xen_mc_irq_flags));
+       local_irq_save(flags);
+       __get_cpu_var(xen_mc_irq_flags) = flags;
 }
 
 static inline struct multicall_space xen_mc_entry(size_t args)
index ca69f3d..29bcfac 100644 (file)
@@ -69,7 +69,7 @@ static void drive_stat_acct(struct request *rq, int new_io)
        int rw = rq_data_dir(rq);
        int cpu;
 
-       if (!blk_fs_request(rq) || !disk || !blk_queue_io_stat(disk->queue))
+       if (!blk_fs_request(rq) || !disk || !blk_do_io_stat(disk->queue))
                return;
 
        cpu = part_stat_lock();
@@ -1667,7 +1667,7 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes)
 {
        struct gendisk *disk = req->rq_disk;
 
-       if (!disk || !blk_queue_io_stat(disk->queue))
+       if (!disk || !blk_do_io_stat(disk->queue))
                return;
 
        if (blk_fs_request(req)) {
@@ -1686,7 +1686,7 @@ static void blk_account_io_done(struct request *req)
 {
        struct gendisk *disk = req->rq_disk;
 
-       if (!disk || !blk_queue_io_stat(disk->queue))
+       if (!disk || !blk_do_io_stat(disk->queue))
                return;
 
        /*
index 6e1ed40..0dce92c 100644 (file)
@@ -108,4 +108,12 @@ static inline int blk_cpu_to_group(int cpu)
 #endif
 }
 
+static inline int blk_do_io_stat(struct request_queue *q)
+{
+       if (q)
+               return blk_queue_io_stat(q);
+
+       return 0;
+}
+
 #endif
index f29fbe9..cb8ca56 100644 (file)
@@ -268,7 +268,7 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t
 
        /* Allocate a new buffer before freeing the old one ... */
        multiplier = use_unicode ? 3 : 1;  /* chars can take up to 3 bytes */
-       bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL);
+       bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL);
        if (!bp) {
                printk(KERN_WARNING "selection: kmalloc() failed\n");
                clear_selection();
index e1129fa..ee19b6e 100644 (file)
@@ -143,7 +143,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE,
 #endif
 
 #ifndef CONFIG_X86_64
-#include "mach_timer.h"
+#include <asm/mach_timer.h>
 #define PMTMR_EXPECTED_RATE \
   ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10))
 /*
index 1bde303..8615059 100644 (file)
@@ -7,7 +7,7 @@
 #include <asm/pgtable.h>
 #include <asm/io.h>
 
-#include "mach_timer.h"
+#include <asm/mach_timer.h>
 
 #define CYCLONE_CBAR_ADDR      0xFEB00CD0      /* base address ptr */
 #define CYCLONE_PMCC_OFFSET    0x51A0          /* offset to control register */
index c064657..2705284 100644 (file)
@@ -3,7 +3,7 @@
 #
 config EISA_VLB_PRIMING
        bool "Vesa Local Bus priming"
-       depends on X86_PC && EISA
+       depends on X86 && EISA
        default n
        ---help---
          Activate this option if your system contains a Vesa Local
@@ -24,11 +24,11 @@ config EISA_PCI_EISA
          When in doubt, say Y.
 
 # Using EISA_VIRTUAL_ROOT on something other than an Alpha or
-# an X86_PC may lead to crashes...
+# an X86 may lead to crashes...
 
 config EISA_VIRTUAL_ROOT
        bool "EISA virtual root device"
-       depends on EISA && (ALPHA || X86_PC)
+       depends on EISA && (ALPHA || X86)
        default y
        ---help---
          Activate this option if your system only have EISA bus
index 9da5814..6915fb8 100644 (file)
@@ -136,7 +136,7 @@ drm_gem_object_alloc(struct drm_device *dev, size_t size)
        obj = kcalloc(1, sizeof(*obj), GFP_KERNEL);
 
        obj->dev = dev;
-       obj->filp = shmem_file_setup("drm mm object", size, 0);
+       obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE);
        if (IS_ERR(obj->filp)) {
                kfree(obj);
                return NULL;
index b1c6f68..3dad229 100644 (file)
@@ -465,6 +465,16 @@ config BLK_DEV_CS5535
 
          It is safe to say Y to this question.
 
+config BLK_DEV_CS5536
+       tristate "CS5536 chipset support"
+       depends on X86_32
+       select BLK_DEV_IDEDMA_PCI
+       help
+         This option enables support for the AMD CS5536
+         companion chip used with the Geode LX processor family.
+
+         If unsure, say N.
+
 config BLK_DEV_HPT366
        tristate "HPT36X/37X chipset support"
        select BLK_DEV_IDEDMA_PCI
index c2b9c93..d0e3d7d 100644 (file)
@@ -43,6 +43,7 @@ obj-$(CONFIG_BLK_DEV_CMD64X)          += cmd64x.o
 obj-$(CONFIG_BLK_DEV_CS5520)           += cs5520.o
 obj-$(CONFIG_BLK_DEV_CS5530)           += cs5530.o
 obj-$(CONFIG_BLK_DEV_CS5535)           += cs5535.o
+obj-$(CONFIG_BLK_DEV_CS5536)           += cs5536.o
 obj-$(CONFIG_BLK_DEV_SC1200)           += sc1200.o
 obj-$(CONFIG_BLK_DEV_CY82C693)         += cy82c693.o
 obj-$(CONFIG_BLK_DEV_DELKIN)           += delkin_cb.o
diff --git a/drivers/ide/cs5536.c b/drivers/ide/cs5536.c
new file mode 100644 (file)
index 0000000..7a62db7
--- /dev/null
@@ -0,0 +1,308 @@
+/*
+ * CS5536 PATA support
+ * (C) 2007 Martin K. Petersen <mkp@mkp.net>
+ * (C) 2009 Bartlomiej Zolnierkiewicz
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Documentation:
+ *     Available from AMD web site.
+ *
+ * The IDE timing registers for the CS5536 live in the Geode Machine
+ * Specific Register file and not PCI config space.  Most BIOSes
+ * virtualize the PCI registers so the chip looks like a standard IDE
+ * controller.  Unfortunately not all implementations get this right.
+ * In particular some have problems with unaligned accesses to the
+ * virtualized PCI registers.  This driver always does full dword
+ * writes to work around the issue.  Also, in case of a bad BIOS this
+ * driver can be loaded with the "msr=1" parameter which forces using
+ * the Machine Specific Registers to configure the device.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/ide.h>
+#include <asm/msr.h>
+
+#define DRV_NAME       "cs5536"
+
+enum {
+       MSR_IDE_CFG             = 0x51300010,
+       PCI_IDE_CFG             = 0x40,
+
+       CFG                     = 0,
+       DTC                     = 2,
+       CAST                    = 3,
+       ETC                     = 4,
+
+       IDE_CFG_CHANEN          = (1 << 1),
+       IDE_CFG_CABLE           = (1 << 17) | (1 << 16),
+
+       IDE_D0_SHIFT            = 24,
+       IDE_D1_SHIFT            = 16,
+       IDE_DRV_MASK            = 0xff,
+
+       IDE_CAST_D0_SHIFT       = 6,
+       IDE_CAST_D1_SHIFT       = 4,
+       IDE_CAST_DRV_MASK       = 0x3,
+
+       IDE_CAST_CMD_SHIFT      = 24,
+       IDE_CAST_CMD_MASK       = 0xff,
+
+       IDE_ETC_UDMA_MASK       = 0xc0,
+};
+
+static int use_msr;
+
+static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
+{
+       if (unlikely(use_msr)) {
+               u32 dummy;
+
+               rdmsr(MSR_IDE_CFG + reg, *val, dummy);
+               return 0;
+       }
+
+       return pci_read_config_dword(pdev, PCI_IDE_CFG + reg * 4, val);
+}
+
+static int cs5536_write(struct pci_dev *pdev, int reg, int val)
+{
+       if (unlikely(use_msr)) {
+               wrmsr(MSR_IDE_CFG + reg, val, 0);
+               return 0;
+       }
+
+       return pci_write_config_dword(pdev, PCI_IDE_CFG + reg * 4, val);
+}
+
+static void cs5536_program_dtc(ide_drive_t *drive, u8 tim)
+{
+       struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
+       int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
+       u32 dtc;
+
+       cs5536_read(pdev, DTC, &dtc);
+       dtc &= ~(IDE_DRV_MASK << dshift);
+       dtc |= tim << dshift;
+       cs5536_write(pdev, DTC, dtc);
+}
+
+/**
+ *     cs5536_cable_detect     -       detect cable type
+ *     @hwif: Port to detect on
+ *
+ *     Perform cable detection for ATA66 capable cable.
+ *
+ *     Returns a cable type.
+ */
+
+static u8 cs5536_cable_detect(ide_hwif_t *hwif)
+{
+       struct pci_dev *pdev = to_pci_dev(hwif->dev);
+       u32 cfg;
+
+       cs5536_read(pdev, CFG, &cfg);
+
+       if (cfg & IDE_CFG_CABLE)
+               return ATA_CBL_PATA80;
+       else
+               return ATA_CBL_PATA40;
+}
+
+/**
+ *     cs5536_set_pio_mode             -       PIO timing setup
+ *     @drive: ATA device
+ *     @pio: PIO mode number
+ */
+
+static void cs5536_set_pio_mode(ide_drive_t *drive, const u8 pio)
+{
+       static const u8 drv_timings[5] = {
+               0x98, 0x55, 0x32, 0x21, 0x20,
+       };
+
+       static const u8 addr_timings[5] = {
+               0x2, 0x1, 0x0, 0x0, 0x0,
+       };
+
+       static const u8 cmd_timings[5] = {
+               0x99, 0x92, 0x90, 0x22, 0x20,
+       };
+
+       struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
+       ide_drive_t *pair = ide_get_pair_dev(drive);
+       int cshift = (drive->dn & 1) ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
+       u32 cast;
+       u8 cmd_pio = pio;
+
+       if (pair)
+               cmd_pio = min(pio, ide_get_best_pio_mode(pair, 255, 4));
+
+       drive->drive_data &= (IDE_DRV_MASK << 8);
+       drive->drive_data |= drv_timings[pio];
+
+       cs5536_program_dtc(drive, drv_timings[pio]);
+
+       cs5536_read(pdev, CAST, &cast);
+
+       cast &= ~(IDE_CAST_DRV_MASK << cshift);
+       cast |= addr_timings[pio] << cshift;
+
+       cast &= ~(IDE_CAST_CMD_MASK << IDE_CAST_CMD_SHIFT);
+       cast |= cmd_timings[cmd_pio] << IDE_CAST_CMD_SHIFT;
+
+       cs5536_write(pdev, CAST, cast);
+}
+
+/**
+ *     cs5536_set_dma_mode             -       DMA timing setup
+ *     @drive: ATA device
+ *     @mode: DMA mode
+ */
+
+static void cs5536_set_dma_mode(ide_drive_t *drive, const u8 mode)
+{
+       static const u8 udma_timings[6] = {
+               0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6,
+       };
+
+       static const u8 mwdma_timings[3] = {
+               0x67, 0x21, 0x20,
+       };
+
+       struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
+       int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
+       u32 etc;
+
+       cs5536_read(pdev, ETC, &etc);
+
+       if (mode >= XFER_UDMA_0) {
+               etc &= ~(IDE_DRV_MASK << dshift);
+               etc |= udma_timings[mode - XFER_UDMA_0] << dshift;
+       } else { /* MWDMA */
+               etc &= ~(IDE_ETC_UDMA_MASK << dshift);
+               drive->drive_data &= IDE_DRV_MASK;
+               drive->drive_data |= mwdma_timings[mode - XFER_MW_DMA_0] << 8;
+       }
+
+       cs5536_write(pdev, ETC, etc);
+}
+
+static void cs5536_dma_start(ide_drive_t *drive)
+{
+       if (drive->current_speed < XFER_UDMA_0 &&
+           (drive->drive_data >> 8) != (drive->drive_data & IDE_DRV_MASK))
+               cs5536_program_dtc(drive, drive->drive_data >> 8);
+
+       ide_dma_start(drive);
+}
+
+static int cs5536_dma_end(ide_drive_t *drive)
+{
+       int ret = ide_dma_end(drive);
+
+       if (drive->current_speed < XFER_UDMA_0 &&
+           (drive->drive_data >> 8) != (drive->drive_data & IDE_DRV_MASK))
+               cs5536_program_dtc(drive, drive->drive_data & IDE_DRV_MASK);
+
+       return ret;
+}
+
+static const struct ide_port_ops cs5536_port_ops = {
+       .set_pio_mode           = cs5536_set_pio_mode,
+       .set_dma_mode           = cs5536_set_dma_mode,
+       .cable_detect           = cs5536_cable_detect,
+};
+
+static const struct ide_dma_ops cs5536_dma_ops = {
+       .dma_host_set           = ide_dma_host_set,
+       .dma_setup              = ide_dma_setup,
+       .dma_exec_cmd           = ide_dma_exec_cmd,
+       .dma_start              = cs5536_dma_start,
+       .dma_end                = cs5536_dma_end,
+       .dma_test_irq           = ide_dma_test_irq,
+       .dma_lost_irq           = ide_dma_lost_irq,
+       .dma_timeout            = ide_dma_timeout,
+};
+
+static const struct ide_port_info cs5536_info = {
+       .name           = DRV_NAME,
+       .port_ops       = &cs5536_port_ops,
+       .dma_ops        = &cs5536_dma_ops,
+       .host_flags     = IDE_HFLAG_SINGLE,
+       .pio_mask       = ATA_PIO4,
+       .mwdma_mask     = ATA_MWDMA2,
+       .udma_mask      = ATA_UDMA5,
+};
+
+/**
+ *     cs5536_init_one
+ *     @dev: PCI device
+ *     @id: Entry in match table
+ */
+
+static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id)
+{
+       u32 cfg;
+
+       if (use_msr)
+               printk(KERN_INFO DRV_NAME ": Using MSR regs instead of PCI\n");
+
+       cs5536_read(dev, CFG, &cfg);
+
+       if ((cfg & IDE_CFG_CHANEN) == 0) {
+               printk(KERN_ERR DRV_NAME ": disabled by BIOS\n");
+               return -ENODEV;
+       }
+
+       return ide_pci_init_one(dev, &cs5536_info, NULL);
+}
+
+static const struct pci_device_id cs5536_pci_tbl[] = {
+       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), },
+       { },
+};
+
+static struct pci_driver cs5536_pci_driver = {
+       .name           = DRV_NAME,
+       .id_table       = cs5536_pci_tbl,
+       .probe          = cs5536_init_one,
+       .remove         = ide_pci_remove,
+       .suspend        = ide_pci_suspend,
+       .resume         = ide_pci_resume,
+};
+
+static int __init cs5536_init(void)
+{
+       return pci_register_driver(&cs5536_pci_driver);
+}
+
+static void __exit cs5536_exit(void)
+{
+       pci_unregister_driver(&cs5536_pci_driver);
+}
+
+MODULE_AUTHOR("Martin K. Petersen, Bartlomiej Zolnierkiewicz");
+MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(pci, cs5536_pci_tbl);
+
+module_param_named(msr, use_msr, int, 0644);
+MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
+
+module_init(cs5536_init);
+module_exit(cs5536_exit);
index 97a35c6..415d7e2 100644 (file)
@@ -534,7 +534,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
                d.dma_ops = NULL;
        }
 
-       ret = ide_host_register(host, NULL, hws);
+       ret = ide_host_register(host, &d, hws);
        if (ret)
                goto err_free;
 
index d8f295b..ec7d07f 100644 (file)
@@ -282,7 +282,7 @@ static int do_drive_get_GTF(ide_drive_t *drive,
        port = hwif->channel ? drive->dn - 2: drive->dn;
 
        DEBPRINT("ENTER: %s at %s, port#: %d, hard_port#: %d\n",
-                hwif->name, dev->bus_id, port, hwif->channel);
+                hwif->name, dev_name(dev), port, hwif->channel);
 
        if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) {
                DEBPRINT("%s drive %d:%d not present\n",
index cae6937..0bfeb0c 100644 (file)
@@ -787,6 +787,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
                if (blk_fs_request(rq)) {
                        ide_end_request(drive, 1, rq->nr_sectors);
                        return ide_stopped;
+               } else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) {
+                       ide_end_request(drive, 1, 1);
+                       return ide_stopped;
                }
                goto end_request;
        }
index cc16331..9ee51ad 100644 (file)
@@ -418,11 +418,14 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq)
        ide_hwif_t *hwif = drive->hwif;
        struct scatterlist *sg = hwif->sg_table;
 
-       if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) {
-               hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
-       } else {
+       if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
                sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
                hwif->sg_nents = 1;
+       } else if (!rq->bio) {
+               sg_init_one(sg, rq->data, rq->data_len);
+               hwif->sg_nents = 1;
+       } else {
+               hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
        }
 }
 
index 0db1ed9..ce0818a 100644 (file)
@@ -1467,6 +1467,30 @@ struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
 }
 EXPORT_SYMBOL_GPL(ide_host_alloc);
 
+static void ide_port_free(ide_hwif_t *hwif)
+{
+       ide_port_free_devices(hwif);
+       ide_free_port_slot(hwif->index);
+       kfree(hwif);
+}
+
+static void ide_disable_port(ide_hwif_t *hwif)
+{
+       struct ide_host *host = hwif->host;
+       int i;
+
+       printk(KERN_INFO "%s: disabling port\n", hwif->name);
+
+       for (i = 0; i < MAX_HOST_PORTS; i++) {
+               if (host->ports[i] == hwif) {
+                       host->ports[i] = NULL;
+                       host->n_ports--;
+               }
+       }
+
+       ide_port_free(hwif);
+}
+
 int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
                      hw_regs_t **hws)
 {
@@ -1507,8 +1531,12 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
                        hwif->present = 1;
 
                if (hwif->chipset != ide_4drives || !hwif->mate ||
-                   !hwif->mate->present)
-                       ide_register_port(hwif);
+                   !hwif->mate->present) {
+                       if (ide_register_port(hwif)) {
+                               ide_disable_port(hwif);
+                               continue;
+                       }
+               }
 
                if (hwif->present)
                        ide_port_tune_devices(hwif);
@@ -1521,7 +1549,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
                if (hwif_init(hwif) == 0) {
                        printk(KERN_INFO "%s: failed to initialize IDE "
                                         "interface\n", hwif->name);
-                       hwif->present = 0;
+                       device_unregister(&hwif->gendev);
+                       ide_disable_port(hwif);
                        continue;
                }
 
@@ -1660,12 +1689,8 @@ void ide_host_free(struct ide_host *host)
        int i;
 
        ide_host_for_each_port(i, hwif, host) {
-               if (hwif == NULL)
-                       continue;
-
-               ide_port_free_devices(hwif);
-               ide_free_port_slot(hwif->index);
-               kfree(hwif);
+               if (hwif)
+                       ide_port_free(hwif);
        }
 
        kfree(host);
index 882f6f0..40b0812 100644 (file)
@@ -261,9 +261,9 @@ static int tx4939ide_build_dmatable(ide_drive_t *drive, struct request *rq)
                                bcount = cur_len;
                        /*
                         * This workaround for zero count seems required.
-                        * (standard ide_build_dmatable do it too)
+                        * (standard ide_build_dmatable does it too)
                         */
-                       if ((bcount & 0xffff) == 0x0000)
+                       if (bcount == 0x10000)
                                bcount = 0x8000;
                        *table++ = bcount & 0xffff;
                        *table++ = cur_addr;
index 703c3ee..6092fe3 100644 (file)
@@ -448,6 +448,11 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
                d.host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
 #endif
 
+#ifdef CONFIG_AMIGAONE
+       if (machine_is(amigaone))
+               d.host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
+#endif
+
        d.udma_mask = via_config->udma_mask;
 
        vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
index 3556168..ea2638b 100644 (file)
@@ -13,11 +13,11 @@ menuconfig INPUT_KEYBOARD
 if INPUT_KEYBOARD
 
 config KEYBOARD_ATKBD
-       tristate "AT keyboard" if EMBEDDED || !X86_PC
+       tristate "AT keyboard" if EMBEDDED || !X86
        default y
        select SERIO
        select SERIO_LIBPS2
-       select SERIO_I8042 if X86_PC
+       select SERIO_I8042 if X86
        select SERIO_GSCPS2 if GSC
        help
          Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
index 093c8c1..9bef935 100644 (file)
@@ -17,7 +17,7 @@ config MOUSE_PS2
        default y
        select SERIO
        select SERIO_LIBPS2
-       select SERIO_I8042 if X86_PC
+       select SERIO_I8042 if X86
        select SERIO_GSCPS2 if GSC
        help
          Say Y here if you have a PS/2 mouse connected to your system. This
index 6098b62..47fee05 100644 (file)
@@ -576,6 +576,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
                vv->vflip = c->value;
                break;
        default: {
+               mutex_unlock(&dev->lock);
                return -EINVAL;
        }
        }
index 64379f2..3ec2894 100644 (file)
@@ -657,7 +657,7 @@ static int mxl5007t_get_status(struct dvb_frontend *fe, u32 *status)
 {
        struct mxl5007t_state *state = fe->tuner_priv;
        int rf_locked, ref_locked;
-       s32 rf_input_level;
+       s32 rf_input_level = 0;
        int ret;
 
        if (fe->ops.i2c_gate_ctrl)
index 98ee167..7e3aeaa 100644 (file)
@@ -93,6 +93,9 @@ struct dvb_ca_slot {
        /* current state of the CAM */
        int slot_state;
 
+       /* mutex used for serializing access to one CI slot */
+       struct mutex slot_lock;
+
        /* Number of CAMCHANGES that have occurred since last processing */
        atomic_t camchange_count;
 
@@ -711,14 +714,20 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
        dprintk("%s\n", __func__);
 
 
-       // sanity check
+       /* sanity check */
        if (bytes_write > ca->slot_info[slot].link_buf_size)
                return -EINVAL;
 
-       /* check if interface is actually waiting for us to read from it, or if a read is in progress */
+       /* it is possible we are dealing with a single buffer implementation,
+          thus if there is data available for read or if there is even a read
+          already in progress, we do nothing but awake the kernel thread to
+          process the data if necessary. */
        if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
                goto exitnowrite;
        if (status & (STATUSREG_DA | STATUSREG_RE)) {
+               if (status & STATUSREG_DA)
+                       dvb_ca_en50221_thread_wakeup(ca);
+
                status = -EAGAIN;
                goto exitnowrite;
        }
@@ -987,6 +996,8 @@ static int dvb_ca_en50221_thread(void *data)
                /* go through all the slots processing them */
                for (slot = 0; slot < ca->slot_count; slot++) {
 
+                       mutex_lock(&ca->slot_info[slot].slot_lock);
+
                        // check the cam status + deal with CAMCHANGEs
                        while (dvb_ca_en50221_check_camstatus(ca, slot)) {
                                /* clear down an old CI slot if necessary */
@@ -1122,7 +1133,7 @@ static int dvb_ca_en50221_thread(void *data)
 
                        case DVB_CA_SLOTSTATE_RUNNING:
                                if (!ca->open)
-                                       continue;
+                                       break;
 
                                // poll slots for data
                                pktcount = 0;
@@ -1146,6 +1157,8 @@ static int dvb_ca_en50221_thread(void *data)
                                }
                                break;
                        }
+
+                       mutex_unlock(&ca->slot_info[slot].slot_lock);
                }
        }
 
@@ -1181,6 +1194,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file,
        switch (cmd) {
        case CA_RESET:
                for (slot = 0; slot < ca->slot_count; slot++) {
+                       mutex_lock(&ca->slot_info[slot].slot_lock);
                        if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE) {
                                dvb_ca_en50221_slot_shutdown(ca, slot);
                                if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)
@@ -1188,6 +1202,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file,
                                                                     slot,
                                                                     DVB_CA_EN50221_CAMCHANGE_INSERTED);
                        }
+                       mutex_unlock(&ca->slot_info[slot].slot_lock);
                }
                ca->next_read_slot = 0;
                dvb_ca_en50221_thread_wakeup(ca);
@@ -1308,7 +1323,9 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
                                goto exit;
                        }
 
+                       mutex_lock(&ca->slot_info[slot].slot_lock);
                        status = dvb_ca_en50221_write_data(ca, slot, fragbuf, fraglen + 2);
+                       mutex_unlock(&ca->slot_info[slot].slot_lock);
                        if (status == (fraglen + 2)) {
                                written = 1;
                                break;
@@ -1664,6 +1681,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
                ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE;
                atomic_set(&ca->slot_info[i].camchange_count, 0);
                ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED;
+               mutex_init(&ca->slot_info[i].slot_lock);
        }
 
        if (signal_pending(current)) {
index 8467e63..7df2e14 100644 (file)
@@ -45,8 +45,10 @@ struct dvb_ca_en50221 {
        /* the module owning this structure */
        struct module* owner;
 
-       /* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
-        * they may be called from several threads at once */
+       /* NOTE: the read_*, write_* and poll_slot_status functions will be
+        * called for different slots concurrently and need to use locks where
+        * and if appropriate. There will be no concurrent access to one slot.
+        */
 
        /* functions for accessing attribute memory on the CAM */
        int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
index b1a9c4c..199ece0 100644 (file)
@@ -220,7 +220,7 @@ static int af9005_get_post_vit_ber(struct dvb_frontend *fe,
                                   u16 * abort_count)
 {
        u32 loc_cw_count = 0, loc_err_count;
-       u16 loc_abort_count;
+       u16 loc_abort_count = 0;
        int ret;
 
        ret =
index e1e9aa5..6a97a40 100644 (file)
@@ -694,7 +694,12 @@ static int af9015_read_config(struct usb_device *udev)
 
        /* IR remote controller */
        req.addr = AF9015_EEPROM_IR_MODE;
-       ret = af9015_rw_udev(udev, &req);
+       /* first message will timeout often due to possible hw bug */
+       for (i = 0; i < 4; i++) {
+               ret = af9015_rw_udev(udev, &req);
+               if (!ret)
+                       break;
+       }
        if (ret)
                goto error;
        deb_info("%s: IR mode:%d\n", __func__, val);
@@ -835,18 +840,19 @@ static int af9015_read_config(struct usb_device *udev)
        if (!dvb_usb_af9015_dual_mode)
                af9015_config.dual_mode = 0;
 
-       /* set buffer size according to USB port speed */
+       /* Set adapter0 buffer size according to USB port speed, adapter1 buffer
+          size can be static because it is enabled only USB2.0 */
        for (i = 0; i < af9015_properties_count; i++) {
                /* USB1.1 set smaller buffersize and disable 2nd adapter */
                if (udev->speed == USB_SPEED_FULL) {
-                       af9015_properties[i].adapter->stream.u.bulk.buffersize =
-                               TS_USB11_MAX_PACKET_SIZE;
+                       af9015_properties[i].adapter[0].stream.u.bulk.buffersize
+                               TS_USB11_MAX_PACKET_SIZE;
                        /* disable 2nd adapter because we don't have
                           PID-filters */
                        af9015_config.dual_mode = 0;
                } else {
-                       af9015_properties[i].adapter->stream.u.bulk.buffersize =
-                               TS_USB20_MAX_PACKET_SIZE;
+                       af9015_properties[i].adapter[0].stream.u.bulk.buffersize
+                               TS_USB20_MAX_PACKET_SIZE;
                }
        }
 
@@ -1254,6 +1260,12 @@ static struct dvb_usb_device_properties af9015_properties[] = {
                                        .type = USB_BULK,
                                        .count = 6,
                                        .endpoint = 0x85,
+                                       .u = {
+                                               .bulk = {
+                                                       .buffersize =
+                                               TS_USB20_MAX_PACKET_SIZE,
+                                               }
+                                       }
                                },
                        }
                },
@@ -1353,6 +1365,12 @@ static struct dvb_usb_device_properties af9015_properties[] = {
                                        .type = USB_BULK,
                                        .count = 6,
                                        .endpoint = 0x85,
+                                       .u = {
+                                               .bulk = {
+                                                       .buffersize =
+                                               TS_USB20_MAX_PACKET_SIZE,
+                                               }
+                                       }
                                },
                        }
                },
index 3917327..635d30a 100644 (file)
@@ -1393,6 +1393,9 @@ struct usb_device_id dib0700_usb_id_table[] = {
        { USB_DEVICE(USB_VID_ASUS,      USB_PID_ASUS_U3000H) },
 /* 40 */{ USB_DEVICE(USB_VID_PINNACLE,  USB_PID_PINNACLE_PCTV801E) },
        { USB_DEVICE(USB_VID_PINNACLE,  USB_PID_PINNACLE_PCTV801E_SE) },
+       { USB_DEVICE(USB_VID_TERRATEC,  USB_PID_TERRATEC_CINERGY_T_EXPRESS) },
+       { USB_DEVICE(USB_VID_TERRATEC,
+                       USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) },
        { 0 }           /* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
@@ -1537,7 +1540,8 @@ struct dvb_usb_device_properties dib0700_devices[] = {
                        {   "DiBcom STK7700D reference design",
                                { &dib0700_usb_id_table[14], NULL },
                                { NULL },
-                       }
+                       },
+
                },
 
                .rc_interval      = DEFAULT_RC_INTERVAL,
@@ -1557,7 +1561,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
                        },
                },
 
-               .num_device_descs = 2,
+               .num_device_descs = 3,
                .devices = {
                        {   "ASUS My Cinema U3000 Mini DVBT Tuner",
                                { &dib0700_usb_id_table[23], NULL },
@@ -1566,6 +1570,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
                        {   "Yuan EC372S",
                                { &dib0700_usb_id_table[31], NULL },
                                { NULL },
+                       },
+                       {   "Terratec Cinergy T Express",
+                               { &dib0700_usb_id_table[42], NULL },
+                               { NULL },
                        }
                },
 
@@ -1653,7 +1661,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
                        }
                },
 
-               .num_device_descs = 4,
+               .num_device_descs = 5,
                .devices = {
                        {   "DiBcom STK7070PD reference design",
                                { &dib0700_usb_id_table[17], NULL },
@@ -1670,6 +1678,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
                        {   "Hauppauge Nova-TD-500 (84xxx)",
                                { &dib0700_usb_id_table[36], NULL },
                                { NULL },
+                       },
+                       {  "Terratec Cinergy DT USB XS Diversity",
+                               { &dib0700_usb_id_table[43], NULL },
+                               { NULL },
                        }
                }
        }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
index a4fca3f..0db0c06 100644 (file)
 #define USB_PID_AVERMEDIA_A309                         0xa309
 #define USB_PID_TECHNOTREND_CONNECT_S2400               0x3006
 #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY       0x005a
+#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2     0x0081
 #define USB_PID_TERRATEC_CINERGY_HT_USB_XE             0x0058
 #define USB_PID_TERRATEC_CINERGY_HT_EXPRESS            0x0060
+#define USB_PID_TERRATEC_CINERGY_T_EXPRESS             0x0062
 #define USB_PID_TERRATEC_CINERGY_T_XXS                 0x0078
 #define USB_PID_PINNACLE_EXPRESSCARD_320CX             0x022e
 #define USB_PID_PINNACLE_PCTV2000E                     0x022c
index ec4e08d..1e81e71 100644 (file)
@@ -646,7 +646,7 @@ static int drx_tune(struct drx397xD_state *s,
        u32 edi = 0, ebx = 0, ebp = 0, edx = 0;
        u16 v20 = 0, v1E = 0, v16 = 0, v14 = 0, v12 = 0, v10 = 0, v0E = 0;
 
-       int rc, df_tuner;
+       int rc, df_tuner = 0;
        int a, b, c, d;
        pr_debug("%s %d\n", __func__, s->config.d60);
 
index cf4d893..3e08d98 100644 (file)
@@ -545,9 +545,6 @@ static int s5h1409_set_frontend(struct dvb_frontend *fe,
 
        s5h1409_enable_modulation(fe, p->u.vsb.modulation);
 
-       /* Allow the demod to settle */
-       msleep(100);
-
        if (fe->ops.tuner_ops.set_params) {
                if (fe->ops.i2c_gate_ctrl)
                        fe->ops.i2c_gate_ctrl(fe, 1);
@@ -562,6 +559,10 @@ static int s5h1409_set_frontend(struct dvb_frontend *fe,
                s5h1409_set_qam_interleave_mode(fe);
        }
 
+       /* Issue a reset to the demod so it knows to resync against the
+          newly tuned frequency */
+       s5h1409_softreset(fe);
+
        return 0;
 }
 
index 83dc7e1..a67d177 100644 (file)
@@ -31,6 +31,8 @@ inline u32 stb0899_do_div(u64 n, u32 d)
        return n;
 }
 
+#if 0
+/* These functions are currently unused */
 /*
  * stb0899_calc_srate
  * Compute symbol rate
@@ -63,6 +65,7 @@ static u32 stb0899_get_srate(struct stb0899_state *state)
 
        return stb0899_calc_srate(internal->master_clk, sfr);
 }
+#endif
 
 /*
  * stb0899_set_srate
index 1638e1d..83e9e77 100644 (file)
@@ -470,6 +470,7 @@ static void frontend_init(struct budget *budget)
                budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap);
                if (budget->dvb_frontend) {
                        budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params;
+                       budget->dvb_frontend->tuner_priv = NULL;
                        break;
                }
                break;
index 0aa96df..d91e063 100644 (file)
@@ -1384,7 +1384,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
 {
        int result;
-       unsigned int mode, model, version;
+       unsigned int mode = 0, model = 0, version = 0;
 
        dprintk("%s\n", __func__);
 
index 0747dc8..fdfc7bf 100644 (file)
@@ -194,10 +194,10 @@ static int amradio_start(struct amradio_device *radio)
                return retval;
        }
 
-       mutex_unlock(&radio->lock);
-
        radio->muted = 0;
 
+       mutex_unlock(&radio->lock);
+
        return retval;
 }
 
@@ -230,10 +230,10 @@ static int amradio_stop(struct amradio_device *radio)
                return retval;
        }
 
-       mutex_unlock(&radio->lock);
-
        radio->muted = 1;
 
+       mutex_unlock(&radio->lock);
+
        return retval;
 }
 
@@ -284,10 +284,10 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
                return retval;
        }
 
-       mutex_unlock(&radio->lock);
-
        radio->stereo = 0;
 
+       mutex_unlock(&radio->lock);
+
        return retval;
 }
 
index 14bebf8..87e9107 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/i2c.h>
index 8f1db57..bfe2584 100644 (file)
@@ -1586,7 +1586,8 @@ static int mpeg_open(struct file *file)
        lock_kernel();
        list_for_each(list, &cx23885_devlist) {
                h = list_entry(list, struct cx23885_dev, devlist);
-               if (h->v4l_device->minor == minor) {
+               if (h->v4l_device &&
+                   h->v4l_device->minor == minor) {
                        dev = h;
                        break;
                }
index 2d81c4d..eaa1189 100644 (file)
@@ -730,12 +730,13 @@ static int video_open(struct file *file)
        lock_kernel();
        list_for_each(list, &cx23885_devlist) {
                h = list_entry(list, struct cx23885_dev, devlist);
-               if (h->video_dev->minor == minor) {
+               if (h->video_dev &&
+                   h->video_dev->minor == minor) {
                        dev  = h;
                        type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                }
                if (h->vbi_dev &&
-                  h->vbi_dev->minor == minor) {
+                   h->vbi_dev->minor == minor) {
                        dev  = h;
                        type = V4L2_BUF_TYPE_VBI_CAPTURE;
                }
index 88f2fd3..25eb3be 100644 (file)
@@ -1382,6 +1382,14 @@ static int cx25840_log_status(struct v4l2_subdev *sd)
 
 static int cx25840_command(struct i2c_client *client, unsigned cmd, void *arg)
 {
+       /* ignore this command */
+       if (cmd == TUNER_SET_TYPE_ADDR || cmd == TUNER_SET_CONFIG)
+               return 0;
+
+       /* Old-style drivers rely on initialization on first use, so
+          call the init whenever a command is issued to this driver.
+          New-style drivers using v4l2_subdev should call init explicitly. */
+       cx25840_init(i2c_get_clientdata(client), 0);
        return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg);
 }
 
index 613dfea..aef5297 100644 (file)
@@ -614,34 +614,41 @@ static struct stv0288_config tevii_tuner_earda_config = {
        .set_ts_params = cx24116_set_ts_param,
 };
 
-static int dvb_register(struct cx8802_dev *dev)
+static int cx8802_alloc_frontends(struct cx8802_dev *dev)
 {
        struct cx88_core *core = dev->core;
-       struct videobuf_dvb_frontend *fe0, *fe1 = NULL;
-       int mfe_shared = 0; /* bus not shared by default */
+       struct videobuf_dvb_frontend *fe = NULL;
        int i;
 
-       if (0 != core->i2c_rc) {
-               printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
-               goto frontend_detach;
-       }
-
-       if (!core->board.num_frontends)
-               return -EINVAL;
-
        mutex_init(&dev->frontends.lock);
        INIT_LIST_HEAD(&dev->frontends.felist);
 
+       if (!core->board.num_frontends)
+               return -ENODEV;
+
        printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__,
                         core->board.num_frontends);
        for (i = 1; i <= core->board.num_frontends; i++) {
-               fe0 = videobuf_dvb_alloc_frontend(&dev->frontends, i);
-               if (!fe0) {
+               fe = videobuf_dvb_alloc_frontend(&dev->frontends, i);
+               if (!fe) {
                        printk(KERN_ERR "%s() failed to alloc\n", __func__);
                        videobuf_dvb_dealloc_frontends(&dev->frontends);
-                       goto frontend_detach;
+                       return -ENOMEM;
                }
        }
+       return 0;
+}
+
+static int dvb_register(struct cx8802_dev *dev)
+{
+       struct cx88_core *core = dev->core;
+       struct videobuf_dvb_frontend *fe0, *fe1 = NULL;
+       int mfe_shared = 0; /* bus not shared by default */
+
+       if (0 != core->i2c_rc) {
+               printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
+               goto frontend_detach;
+       }
 
        /* Get the first frontend */
        fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
@@ -1243,6 +1250,8 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
        struct cx88_core *core = drv->core;
        struct cx8802_dev *dev = drv->core->dvbdev;
        int err;
+       struct videobuf_dvb_frontend *fe;
+       int i;
 
        dprintk( 1, "%s\n", __func__);
        dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
@@ -1258,39 +1267,34 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
        /* If vp3054 isn't enabled, a stub will just return 0 */
        err = vp3054_i2c_probe(dev);
        if (0 != err)
-               goto fail_probe;
+               goto fail_core;
 
        /* dvb stuff */
        printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name);
        dev->ts_gen_cntrl = 0x0c;
 
+       err = cx8802_alloc_frontends(dev);
+       if (err)
+               goto fail_core;
+
        err = -ENODEV;
-       if (core->board.num_frontends) {
-               struct videobuf_dvb_frontend *fe;
-               int i;
-
-               for (i = 1; i <= core->board.num_frontends; i++) {
-                       fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
-                       if (fe == NULL) {
-                               printk(KERN_ERR "%s() failed to get frontend(%d)\n",
+       for (i = 1; i <= core->board.num_frontends; i++) {
+               fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
+               if (fe == NULL) {
+                       printk(KERN_ERR "%s() failed to get frontend(%d)\n",
                                        __func__, i);
-                               goto fail_probe;
-                       }
-                       videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
+                       goto fail_probe;
+               }
+               videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
                                    &dev->pci->dev, &dev->slock,
                                    V4L2_BUF_TYPE_VIDEO_CAPTURE,
                                    V4L2_FIELD_TOP,
                                    sizeof(struct cx88_buffer),
                                    dev);
-                       /* init struct videobuf_dvb */
-                       fe->dvb.name = dev->core->name;
-               }
-       } else {
-               /* no frontends allocated */
-               printk(KERN_ERR "%s/2 .num_frontends should be non-zero\n",
-                       core->name);
-               goto fail_core;
+               /* init struct videobuf_dvb */
+               fe->dvb.name = dev->core->name;
        }
+
        err = dvb_register(dev);
        if (err)
                /* frontends/adapter de-allocated in dvb_register */
index 60a8b31..6025fdd 100644 (file)
@@ -336,8 +336,8 @@ struct cx88_core {
        /* config info -- dvb */
 #if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
        int                        (*prev_set_voltage)(struct dvb_frontend *fe, fe_sec_voltage_t voltage);
-       void                       (*gate_ctrl)(struct cx88_core  *core, int open);
 #endif
+       void                       (*gate_ctrl)(struct cx88_core  *core, int open);
 
        /* state info */
        struct task_struct         *kthread;
index 94378cc..5d882a4 100644 (file)
@@ -62,9 +62,15 @@ static int em28xx_isoc_audio_deinit(struct em28xx *dev)
 
        dprintk("Stopping isoc\n");
        for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
-               usb_unlink_urb(dev->adev.urb[i]);
+               if (!irqs_disabled())
+                       usb_kill_urb(dev->adev.urb[i]);
+               else
+                       usb_unlink_urb(dev->adev.urb[i]);
                usb_free_urb(dev->adev.urb[i]);
                dev->adev.urb[i] = NULL;
+
+               kfree(dev->adev.transfer_buffer[i]);
+               dev->adev.transfer_buffer[i] = NULL;
        }
 
        return 0;
@@ -389,11 +395,15 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream,
 static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream
                                                    *substream)
 {
-       struct em28xx *dev;
+       unsigned long flags;
 
+       struct em28xx *dev;
        snd_pcm_uframes_t hwptr_done;
+
        dev = snd_pcm_substream_chip(substream);
+       spin_lock_irqsave(&dev->adev.slock, flags);
        hwptr_done = dev->adev.hwptr_done_capture;
+       spin_unlock_irqrestore(&dev->adev.slock, flags);
 
        return hwptr_done;
 }
index ef9bf00..3b3ca3f 100644 (file)
@@ -102,6 +102,18 @@ static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
 /* Board  - EM2870 Kworld 355u
    Analog - No input analog */
 
+static struct em28xx_reg_seq kworld_330u_analog[] = {
+       {EM28XX_R08_GPIO,       0x6d,   ~EM_GPIO_4,     10},
+       {EM2880_R04_GPO,        0x00,   0xff,           10},
+       { -1,                   -1,     -1,             -1},
+};
+
+static struct em28xx_reg_seq kworld_330u_digital[] = {
+       {EM28XX_R08_GPIO,       0x6e,   ~EM_GPIO_4,     10},
+       {EM2880_R04_GPO,        0x08,   0xff,           10},
+       { -1,                   -1,     -1,             -1},
+};
+
 /* Callback for the most boards */
 static struct em28xx_reg_seq default_tuner_gpio[] = {
        {EM28XX_R08_GPIO,       EM_GPIO_4,      EM_GPIO_4,      10},
@@ -1177,29 +1189,33 @@ struct em28xx_board em28xx_boards[] = {
                        .gpio     = hauppauge_wintv_hvr_900_analog,
                } },
        },
-       [EM2883_BOARD_KWORLD_HYBRID_A316] = {
+       [EM2883_BOARD_KWORLD_HYBRID_330U] = {
                .name         = "Kworld PlusTV HD Hybrid 330",
                .tuner_type   = TUNER_XC2028,
                .tuner_gpio   = default_tuner_gpio,
                .decoder      = EM28XX_TVP5150,
                .mts_firmware = 1,
                .has_dvb      = 1,
-               .dvb_gpio     = default_digital,
+               .dvb_gpio     = kworld_330u_digital,
+               .xclk             = EM28XX_XCLK_FREQUENCY_12MHZ,
+               .i2c_speed        = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_EEPROM_ON_BOARD | EM28XX_I2C_EEPROM_KEY_VALID,
                .input        = { {
                        .type     = EM28XX_VMUX_TELEVISION,
                        .vmux     = TVP5150_COMPOSITE0,
                        .amux     = EM28XX_AMUX_VIDEO,
-                       .gpio     = default_analog,
+                       .gpio     = kworld_330u_analog,
+                       .aout     = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
                }, {
                        .type     = EM28XX_VMUX_COMPOSITE1,
                        .vmux     = TVP5150_COMPOSITE1,
                        .amux     = EM28XX_AMUX_LINE_IN,
-                       .gpio     = hauppauge_wintv_hvr_900_analog,
+                       .gpio     = kworld_330u_analog,
+                       .aout     = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
                }, {
                        .type     = EM28XX_VMUX_SVIDEO,
                        .vmux     = TVP5150_SVIDEO,
                        .amux     = EM28XX_AMUX_LINE_IN,
-                       .gpio     = hauppauge_wintv_hvr_900_analog,
+                       .gpio     = kworld_330u_analog,
                } },
        },
        [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
@@ -1249,7 +1265,7 @@ struct usb_device_id em28xx_id_table [] = {
        { USB_DEVICE(0xeb1a, 0xe310),
                        .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
        { USB_DEVICE(0xeb1a, 0xa316),
-                       .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 },
+                       .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
        { USB_DEVICE(0xeb1a, 0xe320),
                        .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
        { USB_DEVICE(0xeb1a, 0xe323),
@@ -1526,6 +1542,10 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
                /* FIXME: Better to specify the needed IF */
                ctl->demod = XC3028_FE_DEFAULT;
                break;
+       case EM2883_BOARD_KWORLD_HYBRID_330U:
+               ctl->demod = XC3028_FE_CHINA;
+               ctl->fname = XC2028_DEFAULT_FIRMWARE;
+               break;
        default:
                ctl->demod = XC3028_FE_OREN538;
        }
index eb5fb05..94fb1b6 100644 (file)
@@ -438,6 +438,10 @@ int em28xx_audio_analog_set(struct em28xx *dev)
        if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
                int vol;
 
+               em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200);
+               em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031);
+               em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80);
+
                /* LSB: left channel - both channels with the same level */
                vol = (0x1f - dev->volume) | ((0x1f - dev->volume) << 8);
 
@@ -454,6 +458,15 @@ int em28xx_audio_analog_set(struct em28xx *dev)
                                em28xx_warn("couldn't setup AC97 register %d\n",
                                     outputs[i].reg);
                }
+
+               if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) {
+                       int sel = ac97_return_record_select(dev->ctl_aoutput);
+
+                       /* Use the same input for both left and right channels */
+                       sel |= (sel << 8);
+
+                       em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel);
+               }
        }
 
        return ret;
@@ -847,8 +860,11 @@ void em28xx_uninit_isoc(struct em28xx *dev)
        for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {
                urb = dev->isoc_ctl.urb[i];
                if (urb) {
-                       usb_kill_urb(urb);
-                       usb_unlink_urb(urb);
+                       if (!irqs_disabled())
+                               usb_kill_urb(urb);
+                       else
+                               usb_unlink_urb(urb);
+
                        if (dev->isoc_ctl.transfer_buffer[i]) {
                                usb_buffer_free(dev->udev,
                                        urb->transfer_buffer_length,
index d38cb21..9ad8527 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "lgdt330x.h"
 #include "zl10353.h"
+#include "s5h1409.h"
 #ifdef EM28XX_DRX397XD_SUPPORT
 #include "drx397xD.h"
 #endif
@@ -232,6 +233,15 @@ static struct zl10353_config em28xx_zl10353_with_xc3028 = {
        .if2 = 45600,
 };
 
+static struct s5h1409_config em28xx_s5h1409_with_xc3028 = {
+       .demod_address = 0x32 >> 1,
+       .output_mode   = S5H1409_PARALLEL_OUTPUT,
+       .gpio          = S5H1409_GPIO_OFF,
+       .inversion     = S5H1409_INVERSION_OFF,
+       .status_mode   = S5H1409_DEMODLOCKING,
+       .mpeg_timing   = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
+};
+
 #ifdef EM28XX_DRX397XD_SUPPORT
 /* [TODO] djh - not sure yet what the device config needs to contain */
 static struct drx397xD_config em28xx_drx397xD_with_xc3028 = {
@@ -412,7 +422,6 @@ static int dvb_init(struct em28xx *dev)
        case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
        case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
        case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
-       case EM2883_BOARD_KWORLD_HYBRID_A316:
        case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
                dvb->frontend = dvb_attach(lgdt330x_attach,
                                           &em2880_lgdt3303_dev,
@@ -433,6 +442,15 @@ static int dvb_init(struct em28xx *dev)
                        goto out_free;
                }
                break;
+       case EM2883_BOARD_KWORLD_HYBRID_330U:
+               dvb->frontend = dvb_attach(s5h1409_attach,
+                                          &em28xx_s5h1409_with_xc3028,
+                                          &dev->i2c_adap);
+               if (attach_xc3028(0x61, dev) < 0) {
+                       result = -EINVAL;
+                       goto out_free;
+               }
+               break;
        case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
 #ifdef EM28XX_DRX397XD_SUPPORT
                /* We don't have the config structure properly populated, so
index 416b691..8e61b2c 100644 (file)
@@ -886,10 +886,10 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
        if (0 == INPUT(i)->type)
                return -EINVAL;
 
-       mutex_lock(&dev->lock);
-
-       video_mux(dev, i);
+       dev->ctl_input = i;
 
+       mutex_lock(&dev->lock);
+       video_mux(dev, dev->ctl_input);
        mutex_unlock(&dev->lock);
        return 0;
 }
@@ -939,6 +939,12 @@ static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
        struct em28xx_fh   *fh  = priv;
        struct em28xx      *dev = fh->dev;
 
+
+       if (a->index >= MAX_EM28XX_INPUT)
+               return -EINVAL;
+       if (0 == INPUT(a->index)->type)
+               return -EINVAL;
+
        mutex_lock(&dev->lock);
 
        dev->ctl_ainput = INPUT(a->index)->amux;
@@ -1950,6 +1956,7 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev,
 
 int em28xx_register_analog_devices(struct em28xx *dev)
 {
+      u8 val;
        int ret;
 
        printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n",
@@ -1957,34 +1964,34 @@ int em28xx_register_analog_devices(struct em28xx *dev)
                (EM28XX_VERSION_CODE >> 16) & 0xff,
                (EM28XX_VERSION_CODE >> 8) & 0xff, EM28XX_VERSION_CODE & 0xff);
 
+       /* set default norm */
+       dev->norm = em28xx_video_template.current_norm;
+       dev->width = norm_maxw(dev);
+       dev->height = norm_maxh(dev);
+       dev->interlaced = EM28XX_INTERLACED_DEFAULT;
+       dev->hscale = 0;
+       dev->vscale = 0;
+       dev->ctl_input = 0;
+
        /* Analog specific initialization */
        dev->format = &format[0];
-       video_mux(dev, 0);
+       video_mux(dev, dev->ctl_input);
+
+       /* Audio defaults */
+       dev->mute = 1;
+       dev->volume = 0x1f;
 
        /* enable vbi capturing */
 
 /*     em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */
-/*     em28xx_write_reg(dev, EM28XX_R0F_XCLK, 0x80); clk register */
+       val = (u8)em28xx_read_reg(dev, EM28XX_R0F_XCLK);
+       em28xx_write_reg(dev, EM28XX_R0F_XCLK, (EM28XX_XCLK_AUDIO_UNMUTE | val));
        em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51);
 
-       dev->mute = 1;          /* maybe not the right place... */
-       dev->volume = 0x1f;
-
        em28xx_set_outfmt(dev);
        em28xx_colorlevels_set_default(dev);
        em28xx_compression_disable(dev);
 
-       /* set default norm */
-       dev->norm = em28xx_video_template.current_norm;
-       dev->width = norm_maxw(dev);
-       dev->height = norm_maxh(dev);
-       dev->interlaced = EM28XX_INTERLACED_DEFAULT;
-       dev->hscale = 0;
-       dev->vscale = 0;
-
-       /* FIXME: This is a very bad hack! Not all devices have TV on input 2 */
-       dev->ctl_input = 2;
-
        /* allocate and fill video video_device struct */
        dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video");
        if (!dev->vdev) {
index 6c6b94a..dd2cd36 100644 (file)
@@ -94,7 +94,7 @@
 #define EM2882_BOARD_KWORLD_VS_DVBT              54
 #define EM2882_BOARD_TERRATEC_HYBRID_XS                  55
 #define EM2882_BOARD_PINNACLE_HYBRID_PRO         56
-#define EM2883_BOARD_KWORLD_HYBRID_A316                  57
+#define EM2883_BOARD_KWORLD_HYBRID_330U                  57
 #define EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU     58
 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850     60
 #define EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2    61
@@ -300,13 +300,32 @@ enum em28xx_amux {
 };
 
 enum em28xx_aout {
+       /* AC97 outputs */
        EM28XX_AOUT_MASTER = 1 << 0,
        EM28XX_AOUT_LINE   = 1 << 1,
        EM28XX_AOUT_MONO   = 1 << 2,
        EM28XX_AOUT_LFE    = 1 << 3,
        EM28XX_AOUT_SURR   = 1 << 4,
+
+       /* PCM IN Mixer - used by AC97_RECORD_SELECT register */
+       EM28XX_AOUT_PCM_IN = 1 << 7,
+
+       /* Bits 10-8 are used to indicate the PCM IN record select */
+       EM28XX_AOUT_PCM_MIC_PCM = 0 << 8,
+       EM28XX_AOUT_PCM_CD      = 1 << 8,
+       EM28XX_AOUT_PCM_VIDEO   = 2 << 8,
+       EM28XX_AOUT_PCM_AUX     = 3 << 8,
+       EM28XX_AOUT_PCM_LINE    = 4 << 8,
+       EM28XX_AOUT_PCM_STEREO  = 5 << 8,
+       EM28XX_AOUT_PCM_MONO    = 6 << 8,
+       EM28XX_AOUT_PCM_PHONE   = 7 << 8,
 };
 
+static inline int ac97_return_record_select(int a_out)
+{
+       return (a_out & 0x700) >> 8;
+}
+
 struct em28xx_reg_seq {
        int reg;
        unsigned char val, mask;
index 5e36b9a..2ed2452 100644 (file)
@@ -423,7 +423,8 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
                        break;
 
                gspca_dev->urb[i] = NULL;
-               usb_kill_urb(urb);
+               if (!gspca_dev->present)
+                       usb_kill_urb(urb);
                if (urb->transfer_buffer != NULL)
                        usb_buffer_free(gspca_dev->dev,
                                        urb->transfer_buffer_length,
@@ -1950,7 +1951,6 @@ void gspca_disconnect(struct usb_interface *intf)
        struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
 
        gspca_dev->present = 0;
-       gspca_dev->streaming = 0;
 
        usb_set_intfdata(intf, NULL);
 
index e8e5921..c46c990 100644 (file)
@@ -949,8 +949,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
        itv->instance = atomic_inc_return(&ivtv_instance) - 1;
 
        retval = v4l2_device_register(&dev->dev, &itv->device);
-       if (retval)
+       if (retval) {
+               kfree(itv);
                return retval;
+       }
        /* "ivtv + PCI ID" is a bit of a mouthful, so use
           "ivtv + instance" instead. */
        snprintf(itv->device.name, sizeof(itv->device.name),
index 39fbc97..0d81018 100644 (file)
@@ -62,7 +62,6 @@
 #include <linux/poll.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <linux/version.h>
 #include <asm/io.h>
 
 #include "pwc.h"
index d6848f7..05221d4 100644 (file)
@@ -149,7 +149,7 @@ static const struct i2c_reg_value saa7127_init_config_common[] = {
        { SAA7127_REG_COPYGEN_0,                        0x77 },
        { SAA7127_REG_COPYGEN_1,                        0x41 },
        { SAA7127_REG_COPYGEN_2,                        0x00 }, /* Macrovision enable/disable */
-       { SAA7127_REG_OUTPUT_PORT_CONTROL,              0x9e },
+       { SAA7127_REG_OUTPUT_PORT_CONTROL,              0xbf },
        { SAA7127_REG_GAIN_LUMINANCE_RGB,               0x00 },
        { SAA7127_REG_GAIN_COLORDIFF_RGB,               0x00 },
        { SAA7127_REG_INPUT_PORT_CONTROL_1,             0x80 }, /* for color bars */
@@ -488,12 +488,18 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output)
                break;
 
        case SAA7127_OUTPUT_TYPE_COMPOSITE:
-               state->reg_2d = 0x08;   /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
+               if (state->ident == V4L2_IDENT_SAA7129)
+                       state->reg_2d = 0x20;   /* CVBS only */
+               else
+                       state->reg_2d = 0x08;   /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
                state->reg_3a = 0x13;   /* by default switch YUV to RGB-matrix on */
                break;
 
        case SAA7127_OUTPUT_TYPE_SVIDEO:
-               state->reg_2d = 0xff;   /* 11111111  croma -> R, luma -> CVBS + G + B */
+               if (state->ident == V4L2_IDENT_SAA7129)
+                       state->reg_2d = 0x18;   /* Y + C */
+               else
+                       state->reg_2d = 0xff;   /*11111111  croma -> R, luma -> CVBS + G + B */
                state->reg_3a = 0x13;   /* by default switch YUV to RGB-matrix on */
                break;
 
@@ -508,7 +514,10 @@ static int saa7127_set_output_type(struct v4l2_subdev *sd, int output)
                break;
 
        case SAA7127_OUTPUT_TYPE_BOTH:
-               state->reg_2d = 0xbf;
+               if (state->ident == V4L2_IDENT_SAA7129)
+                       state->reg_2d = 0x38;
+               else
+                       state->reg_2d = 0xbf;
                state->reg_3a = 0x13;   /* by default switch YUV to RGB-matrix on */
                break;
 
@@ -731,24 +740,6 @@ static int saa7127_probe(struct i2c_client *client,
                return -ENODEV;
        }
 
-       /* Configure Encoder */
-
-       v4l2_dbg(1, debug, sd, "Configuring encoder\n");
-       saa7127_write_inittab(sd, saa7127_init_config_common);
-       saa7127_set_std(sd, V4L2_STD_NTSC);
-       saa7127_set_output_type(sd, SAA7127_OUTPUT_TYPE_BOTH);
-       saa7127_set_vps(sd, &vbi);
-       saa7127_set_wss(sd, &vbi);
-       saa7127_set_cc(sd, &vbi);
-       saa7127_set_xds(sd, &vbi);
-       if (test_image == 1)
-               /* The Encoder has an internal Colorbar generator */
-               /* This can be used for debugging */
-               saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_TEST_IMAGE);
-       else
-               saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL);
-       saa7127_set_video_enable(sd, 1);
-
        if (id->driver_data) {  /* Chip type is already known */
                state->ident = id->driver_data;
        } else {                /* Needs detection */
@@ -770,6 +761,23 @@ static int saa7127_probe(struct i2c_client *client,
 
        v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
                        client->addr << 1, client->adapter->name);
+
+       v4l2_dbg(1, debug, sd, "Configuring encoder\n");
+       saa7127_write_inittab(sd, saa7127_init_config_common);
+       saa7127_set_std(sd, V4L2_STD_NTSC);
+       saa7127_set_output_type(sd, SAA7127_OUTPUT_TYPE_BOTH);
+       saa7127_set_vps(sd, &vbi);
+       saa7127_set_wss(sd, &vbi);
+       saa7127_set_cc(sd, &vbi);
+       saa7127_set_xds(sd, &vbi);
+       if (test_image == 1)
+               /* The Encoder has an internal Colorbar generator */
+               /* This can be used for debugging */
+               saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_TEST_IMAGE);
+       else
+               saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL);
+       saa7127_set_video_enable(sd, 1);
+
        if (state->ident == V4L2_IDENT_SAA7129)
                saa7127_write_inittab(sd, saa7129_init_config_extra);
        return 0;
index 26194a0..c750d3d 100644 (file)
@@ -1089,7 +1089,11 @@ static int saa7134_alsa_init(void)
 
        list_for_each(list,&saa7134_devlist) {
                dev = list_entry(list, struct saa7134_dev, devlist);
-               alsa_device_init(dev);
+               if (dev->pci->device == PCI_DEVICE_ID_PHILIPS_SAA7130)
+                       printk(KERN_INFO "%s/alsa: %s doesn't support digital audio\n",
+                               dev->name, saa7134_boards[dev->board].name);
+               else
+                       alsa_device_init(dev);
        }
 
        if (dev == NULL)
index dfbe08a..99221d7 100644 (file)
@@ -660,6 +660,10 @@ static int saa7134_hwinit1(struct saa7134_dev *dev)
 
        saa_writel(SAA7134_IRQ1, 0);
        saa_writel(SAA7134_IRQ2, 0);
+
+       /* Clear any stale IRQ reports */
+       saa_writel(SAA7134_IRQ_REPORT, saa_readl(SAA7134_IRQ_REPORT));
+
        mutex_init(&dev->lock);
        spin_lock_init(&dev->slock);
 
index 454ad1d..88c5e94 100644 (file)
@@ -30,7 +30,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 56f0c0e..00c6cbe 100644 (file)
@@ -242,7 +242,7 @@ static int tda9875_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 static int tda9875_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 {
        struct tda9875 *t = to_state(sd);
-       int chvol=0, volume, balance, left, right;
+       int chvol = 0, volume = 0, balance = 0, left, right;
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_VOLUME:
index 3b0b84c..78277ab 100644 (file)
@@ -427,6 +427,9 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
        const char *t_fmt_name2[8] = { " none", "", "", "", "", "", "", "" };
 
        memset(tvee, 0, sizeof(*tvee));
+       tvee->tuner_type = TUNER_ABSENT;
+       tvee->tuner2_type = TUNER_ABSENT;
+
        done = len = beenhere = 0;
 
        /* Different eeprom start offsets for em28xx, cx2388x and cx23418 */
index ac9aa40..8e23aa5 100644 (file)
@@ -1401,7 +1401,7 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
 
        decoder->pdata = client->dev.platform_data;
        if (!decoder->pdata) {
-               v4l_err(client, "No platform data\n!!");
+               v4l_err(client, "No platform data!!\n");
                return -ENODEV;
        }
        /*
index 4f16eff..f4522bb 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/i2c.h>
index 4b712f6..a5fb74b 100644 (file)
@@ -21,7 +21,6 @@
  * 02110-1301, USA.
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/i2c.h>
index 9907b9a..6b66ae4 100644 (file)
@@ -157,7 +157,7 @@ usbvision_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
        struct i2c_msg *pmsg;
        struct usb_usbvision *usbvision;
        int i, ret;
-       unsigned char addr;
+       unsigned char addr = 0;
 
        usbvision = (struct usb_usbvision *)i2c_get_adapdata(i2c_adap);
 
index 2208165..d2576f6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *      uvc_ctrl.c  --  USB Video Class driver - Controls
  *
- *      Copyright (C) 2005-2008
+ *      Copyright (C) 2005-2009
  *          Laurent Pinchart (laurent.pinchart@skynet.be)
  *
  *      This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/version.h>
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/uaccess.h>
@@ -29,7 +28,7 @@
 #define UVC_CTRL_DATA_BACKUP   1
 
 /* ------------------------------------------------------------------------
- * Control, formats, ...
+ * Controls
  */
 
 static struct uvc_control_info uvc_ctrls[] = {
@@ -635,7 +634,7 @@ static __s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
                mask = (1 << bits) - 1;
        }
 
-       /* Sign-extend the value if needed */
+       /* Sign-extend the value if needed. */
        if (mapping->data_type == UVC_CTRL_DATA_TYPE_SIGNED)
                value |= -(value & (1 << (mapping->size - 1)));
 
index 89d8bd1..b128732 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *      uvc_driver.c  --  USB Video Class driver
  *
- *      Copyright (C) 2005-2008
+ *      Copyright (C) 2005-2009
  *          Laurent Pinchart (laurent.pinchart@skynet.be)
  *
  *      This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/version.h>
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/usb.h>
@@ -49,7 +48,7 @@ static unsigned int uvc_quirks_param;
 unsigned int uvc_trace_param;
 
 /* ------------------------------------------------------------------------
- * Control, formats, ...
+ * Video formats
  */
 
 static struct uvc_format_desc uvc_fmts[] = {
@@ -474,7 +473,7 @@ static int uvc_parse_format(struct uvc_device *dev,
 
                /* Several UVC chipsets screw up dwMaxVideoFrameBufferSize
                 * completely. Observed behaviours range from setting the
-                * value to 1.1x the actual frame size of hardwiring the
+                * value to 1.1x the actual frame size to hardwiring the
                 * 16 low bits to 0. This results in a higher than necessary
                 * memory usage as well as a wrong image size information. For
                 * uncompressed formats this can be fixed by computing the
@@ -487,7 +486,7 @@ static int uvc_parse_format(struct uvc_device *dev,
                /* Some bogus devices report dwMinFrameInterval equal to
                 * dwMaxFrameInterval and have dwFrameIntervalStep set to
                 * zero. Setting all null intervals to 1 fixes the problem and
-                * some other divisions by zero which could happen.
+                * some other divisions by zero that could happen.
                 */
                for (i = 0; i < n; ++i) {
                        interval = get_unaligned_le32(&buffer[26+4*i]);
@@ -1200,13 +1199,13 @@ static void uvc_unregister_video(struct uvc_device *dev)
  * Scan the UVC descriptors to locate a chain starting at an Output Terminal
  * and containing the following units:
  *
- * - a USB Streaming Output Terminal
+ * - one Output Terminal (USB Streaming or Display)
  * - zero or one Processing Unit
  * - zero, one or mode single-input Selector Units
  * - zero or one multiple-input Selector Units, provided all inputs are
  *   connected to input terminals
  * - zero, one or mode single-input Extension Units
- * - one Camera Input Terminal, or one or more External terminals.
+ * - one or more Input Terminals (Camera, External or USB Streaming)
  *
  * A side forward scan is made on each detected entity to check for additional
  * extension units.
@@ -1531,10 +1530,6 @@ static int uvc_register_video(struct uvc_device *dev)
 
        /* Set the driver data before calling video_register_device, otherwise
         * uvc_v4l2_open might race us.
-        *
-        * FIXME: usb_set_intfdata hasn't been called so far. Is that a
-        *        problem ? Does any function which could be called here get
-        *        a pointer to the usb_interface ?
         */
        dev->video.vdev = vdev;
        video_set_drvdata(vdev, &dev->video);
@@ -1569,7 +1564,7 @@ void uvc_delete(struct kref *kref)
        struct uvc_device *dev = container_of(kref, struct uvc_device, kref);
        struct list_head *p, *n;
 
-       /* Unregister the video device */
+       /* Unregister the video device. */
        uvc_unregister_video(dev);
        usb_put_intf(dev->intf);
        usb_put_dev(dev->udev);
@@ -1612,7 +1607,7 @@ static int uvc_probe(struct usb_interface *intf,
                uvc_trace(UVC_TRACE_PROBE, "Probing generic UVC device %s\n",
                                udev->devpath);
 
-       /* Allocate memory for the device and initialize it */
+       /* Allocate memory for the device and initialize it. */
        if ((dev = kzalloc(sizeof *dev, GFP_KERNEL)) == NULL)
                return -ENOMEM;
 
@@ -1633,14 +1628,14 @@ static int uvc_probe(struct usb_interface *intf,
                        le16_to_cpu(udev->descriptor.idVendor),
                        le16_to_cpu(udev->descriptor.idProduct));
 
-       /* Parse the Video Class control descriptor */
+       /* Parse the Video Class control descriptor. */
        if (uvc_parse_control(dev) < 0) {
                uvc_trace(UVC_TRACE_PROBE, "Unable to parse UVC "
                        "descriptors.\n");
                goto error;
        }
 
-       uvc_printk(KERN_INFO, "Found UVC %u.%02u device %s (%04x:%04x)\n",
+       uvc_printk(KERN_INFO, "Found UVC %u.%02x device %s (%04x:%04x)\n",
                dev->uvc_version >> 8, dev->uvc_version & 0xff,
                udev->product ? udev->product : "<unnamed>",
                le16_to_cpu(udev->descriptor.idVendor),
@@ -1653,18 +1648,18 @@ static int uvc_probe(struct usb_interface *intf,
                        "linux-uvc-devel mailing list.\n");
        }
 
-       /* Initialize controls */
+       /* Initialize controls. */
        if (uvc_ctrl_init_device(dev) < 0)
                goto error;
 
-       /* Register the video devices */
+       /* Register the video devices. */
        if (uvc_register_video(dev) < 0)
                goto error;
 
-       /* Save our data pointer in the interface data */
+       /* Save our data pointer in the interface data. */
        usb_set_intfdata(intf, dev);
 
-       /* Initialize the interrupt URB */
+       /* Initialize the interrupt URB. */
        if ((ret = uvc_status_init(dev)) < 0) {
                uvc_printk(KERN_INFO, "Unable to initialize the status "
                        "endpoint (%d), status interrupt will not be "
@@ -1839,24 +1834,24 @@ static struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0 },
        /* Apple Built-In iSight */
-       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
          .idVendor             = 0x05ac,
          .idProduct            = 0x8501,
-         .bInterfaceClass      = USB_CLASS_VIDEO,
-         .bInterfaceSubClass   = 1,
-         .bInterfaceProtocol   = 0,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
          .driver_info          = UVC_QUIRK_PROBE_MINMAX
                                | UVC_QUIRK_BUILTIN_ISIGHT },
        /* Genesys Logic USB 2.0 PC Camera */
-       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
-         .idVendor             = 0x05e3,
-         .idProduct            = 0x0505,
-         .bInterfaceClass      = USB_CLASS_VIDEO,
-         .bInterfaceSubClass   = 1,
-         .bInterfaceProtocol   = 0,
-         .driver_info          = UVC_QUIRK_STREAM_NO_FID },
+         .idVendor             = 0x05e3,
+         .idProduct            = 0x0505,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_QUIRK_STREAM_NO_FID },
        /* MT6227 */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
index 37bdefd..436f462 100644 (file)
@@ -3,6 +3,8 @@
  *
  *     Copyright (C) 2006-2007
  *             Ivan N. Zlatev <contact@i-nz.net>
+ *     Copyright (C) 2008-2009
+ *             Laurent Pinchart <laurent.pinchart@skynet.be>
  *
  *      This program is free software; you can redistribute it and/or modify
  *      it under the terms of the GNU General Public License as published by
index 4254634..0155752 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *      uvc_queue.c  --  USB Video Class driver - Buffers management
  *
- *      Copyright (C) 2005-2008
+ *      Copyright (C) 2005-2009
  *          Laurent Pinchart (laurent.pinchart@skynet.be)
  *
  *      This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/version.h>
 #include <linux/mm.h>
 #include <linux/list.h>
 #include <linux/module.h>
  * to user space will return -EBUSY.
  *
  * Video buffers are managed using two queues. However, unlike most USB video
- * drivers which use an in queue and an out queue, we use a main queue which
- * holds all queued buffers (both 'empty' and 'done' buffers), and an irq
- * queue which holds empty buffers. This design (copied from video-buf)
- * minimizes locking in interrupt, as only one queue is shared between
- * interrupt and user contexts.
+ * drivers that use an in queue and an out queue, we use a main queue to hold
+ * all queued buffers (both 'empty' and 'done' buffers), and an irq queue to
+ * hold empty buffers. This design (copied from video-buf) minimizes locking
+ * in interrupt, as only one queue is shared between interrupt and user
+ * contexts.
  *
  * Use cases
  * ---------
  *
- * Unless stated otherwise, all operations which modify the irq buffers queue
+ * Unless stated otherwise, all operations that modify the irq buffers queue
  * are protected by the irq spinlock.
  *
  * 1. The user queues the buffers, starts streaming and dequeues a buffer.
  *
  *    The buffers are added to the main and irq queues. Both operations are
- *    protected by the queue lock, and the latert is protected by the irq
+ *    protected by the queue lock, and the later is protected by the irq
  *    spinlock as well.
  *
  *    The completion handler fetches a buffer from the irq queue and fills it
@@ -60,7 +59,7 @@
  *    returns immediately.
  *
  *    When the buffer is full, the completion handler removes it from the irq
- *    queue, marks it as ready (UVC_BUF_STATE_DONE) and wake its wait queue.
+ *    queue, marks it as ready (UVC_BUF_STATE_DONE) and wakes its wait queue.
  *    At that point, any process waiting on the buffer will be woken up. If a
  *    process tries to dequeue a buffer after it has been marked ready, the
  *    dequeing will succeed immediately.
@@ -91,8 +90,8 @@ void uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
 /*
  * Allocate the video buffers.
  *
- * Pages are reserved to make sure they will not be swaped, as they will be
- * filled in URB completion handler.
+ * Pages are reserved to make sure they will not be swapped, as they will be
+ * filled in the URB completion handler.
  *
  * Buffers will be individually mapped, so they must all be page aligned.
  */
@@ -210,8 +209,8 @@ int uvc_query_buffer(struct uvc_video_queue *queue,
        __uvc_query_buffer(&queue->buffer[v4l2_buf->index], v4l2_buf);
 
 done:
-       mutex_unlock(&queue->mutex);
-       return ret;
+       mutex_unlock(&queue->mutex);
+       return ret;
 }
 
 /*
@@ -236,7 +235,7 @@ int uvc_queue_buffer(struct uvc_video_queue *queue,
        }
 
        mutex_lock(&queue->mutex);
-       if (v4l2_buf->index >= queue->count)  {
+       if (v4l2_buf->index >= queue->count) {
                uvc_trace(UVC_TRACE_CAPTURE, "[E] Out of range index.\n");
                ret = -EINVAL;
                goto done;
@@ -429,7 +428,7 @@ done:
  * Cancel the video buffers queue.
  *
  * Cancelling the queue marks all buffers on the irq queue as erroneous,
- * wakes them up and remove them from the queue.
+ * wakes them up and removes them from the queue.
  *
  * If the disconnect parameter is set, further calls to uvc_queue_buffer will
  * fail with -ENODEV.
index 5d60b26..c1e4ae2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *      uvc_status.c  --  USB Video Class driver - Status endpoint
  *
- *      Copyright (C) 2007-2008
+ *      Copyright (C) 2007-2009
  *          Laurent Pinchart (laurent.pinchart@skynet.be)
  *
  *      This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/version.h>
 #include <linux/input.h>
 #include <linux/usb.h>
 #include <linux/usb/input.h>
index fa150ff..d681519 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *      uvc_v4l2.c  --  USB Video Class driver - V4L2 API
  *
- *      Copyright (C) 2005-2008
+ *      Copyright (C) 2005-2009
  *          Laurent Pinchart (laurent.pinchart@skynet.be)
  *
  *      This program is free software; you can redistribute it and/or modify
@@ -37,7 +37,7 @@
  * must be grouped (for instance the Red Balance, Blue Balance and Do White
  * Balance V4L2 controls use the White Balance Component UVC control) or
  * otherwise translated. The approach we take here is to use a translation
- * table for the controls which can be mapped directly, and handle the others
+ * table for the controls that can be mapped directly, and handle the others
  * manually.
  */
 static int uvc_v4l2_query_menu(struct uvc_video_device *video,
@@ -189,7 +189,7 @@ static int uvc_v4l2_try_format(struct uvc_video_device *video,
                probe->dwMaxVideoFrameSize =
                        video->streaming->ctrl.dwMaxVideoFrameSize;
 
-       /* Probe the device */
+       /* Probe the device. */
        if ((ret = uvc_probe_video(video, probe)) < 0)
                goto done;
 
@@ -354,11 +354,11 @@ static int uvc_v4l2_set_streamparm(struct uvc_video_device *video,
  *
  * Each open instance of a UVC device can either be in a privileged or
  * unprivileged state. Only a single instance can be in a privileged state at
- * a given time. Trying to perform an operation which requires privileges will
+ * a given time. Trying to perform an operation that requires privileges will
  * automatically acquire the required privileges if possible, or return -EBUSY
  * otherwise. Privileges are dismissed when closing the instance.
  *
- * Operations which require privileges are:
+ * Operations that require privileges are:
  *
  * - VIDIOC_S_INPUT
  * - VIDIOC_S_PARM
index e7c3199..9bc4705 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *      uvc_video.c  --  USB Video Class driver - Video handling
  *
- *      Copyright (C) 2005-2008
+ *      Copyright (C) 2005-2009
  *          Laurent Pinchart (laurent.pinchart@skynet.be)
  *
  *      This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/version.h>
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/usb.h>
@@ -115,7 +114,7 @@ static int uvc_get_video_ctrl(struct uvc_video_device *video,
                ctrl->wCompQuality = le16_to_cpup((__le16 *)data);
                ret = 0;
                goto out;
-       } else if (query == GET_DEF && probe == 1) {
+       } else if (query == GET_DEF && probe == 1 && ret != size) {
                /* Many cameras don't support the GET_DEF request on their
                 * video probe control. Warn once and return, the caller will
                 * fall back to GET_CUR.
@@ -160,7 +159,7 @@ static int uvc_get_video_ctrl(struct uvc_video_device *video,
        }
 
        /* Some broken devices return a null or wrong dwMaxVideoFrameSize.
-        * Try to get the value from the format and frame descriptor.
+        * Try to get the value from the format and frame descriptors.
         */
        uvc_fixup_buffer_size(video, ctrl);
        ret = 0;
@@ -191,9 +190,6 @@ static int uvc_set_video_ctrl(struct uvc_video_device *video,
        *(__le16 *)&data[12] = cpu_to_le16(ctrl->wCompQuality);
        *(__le16 *)&data[14] = cpu_to_le16(ctrl->wCompWindowSize);
        *(__le16 *)&data[16] = cpu_to_le16(ctrl->wDelay);
-       /* Note: Some of the fields below are not required for IN devices (see
-        * UVC spec, 4.3.1.1), but we still copy them in case support for OUT
-        * devices is added in the future. */
        put_unaligned_le32(ctrl->dwMaxVideoFrameSize, &data[18]);
        put_unaligned_le32(ctrl->dwMaxPayloadTransferSize, &data[22]);
 
@@ -400,7 +396,7 @@ static int uvc_video_decode_start(struct uvc_video_device *video,
         *
         * Empty buffers (bytesused == 0) don't trigger end of frame detection
         * as it doesn't make sense to return an empty buffer. This also
-        * avoids detecting and of frame conditions at FID toggling if the
+        * avoids detecting end of frame conditions at FID toggling if the
         * previous payload had the EOF bit set.
         */
        if (fid != video->last_fid && buf->buf.bytesused != 0) {
@@ -453,6 +449,17 @@ static void uvc_video_decode_end(struct uvc_video_device *video,
        }
 }
 
+/* Video payload encoding is handled by uvc_video_encode_header() and
+ * uvc_video_encode_data(). Only bulk transfers are currently supported.
+ *
+ * uvc_video_encode_header is called at the start of a payload. It adds header
+ * data to the transfer buffer and returns the header size. As the only known
+ * UVC output device transfers a whole frame in a single payload, the EOF bit
+ * is always set in the header.
+ *
+ * uvc_video_encode_data is called for every URB and copies the data from the
+ * video buffer to the transfer buffer.
+ */
 static int uvc_video_encode_header(struct uvc_video_device *video,
                struct uvc_buffer *buf, __u8 *data, int len)
 {
@@ -953,7 +960,7 @@ int uvc_video_suspend(struct uvc_video_device *video)
 }
 
 /*
- * Reconfigure the video interface and restart streaming if it was enable
+ * Reconfigure the video interface and restart streaming if it was enabled
  * before suspend.
  *
  * If an error occurs, disable the video queue. This will wake all pending
@@ -985,8 +992,8 @@ int uvc_video_resume(struct uvc_video_device *video)
  */
 
 /*
- * Initialize the UVC video device by retrieving the default format and
- * committing it.
+ * Initialize the UVC video device by switching to alternate setting 0 and
+ * retrieve the default format.
  *
  * Some cameras (namely the Fuji Finepix) set the format and frame
  * indexes to zero. The UVC standard doesn't clearly make this a spec
@@ -1014,7 +1021,7 @@ int uvc_video_init(struct uvc_video_device *video)
         */
        usb_set_interface(video->dev->udev, video->streaming->intfnum, 0);
 
-       /* Some webcams don't suport GET_DEF request on the probe control. We
+       /* Some webcams don't suport GET_DEF requests on the probe control. We
         * fall back to GET_CUR if GET_DEF fails.
         */
        if ((ret = uvc_get_video_ctrl(video, probe, 1, GET_DEF)) < 0 &&
index bcf4361..027947e 100644 (file)
@@ -72,149 +72,149 @@ struct uvc_xu_control {
  * UVC constants
  */
 
-#define SC_UNDEFINED                    0x00
-#define SC_VIDEOCONTROL                 0x01
-#define SC_VIDEOSTREAMING               0x02
-#define SC_VIDEO_INTERFACE_COLLECTION   0x03
+#define SC_UNDEFINED                   0x00
+#define SC_VIDEOCONTROL                        0x01
+#define SC_VIDEOSTREAMING              0x02
+#define SC_VIDEO_INTERFACE_COLLECTION  0x03
 
-#define PC_PROTOCOL_UNDEFINED           0x00
+#define PC_PROTOCOL_UNDEFINED          0x00
 
-#define CS_UNDEFINED                    0x20
-#define CS_DEVICE                       0x21
-#define CS_CONFIGURATION                0x22
-#define CS_STRING                       0x23
-#define CS_INTERFACE                    0x24
-#define CS_ENDPOINT                     0x25
+#define CS_UNDEFINED                   0x20
+#define CS_DEVICE                      0x21
+#define CS_CONFIGURATION               0x22
+#define CS_STRING                      0x23
+#define CS_INTERFACE                   0x24
+#define CS_ENDPOINT                    0x25
 
 /* VideoControl class specific interface descriptor */
-#define VC_DESCRIPTOR_UNDEFINED         0x00
-#define VC_HEADER                       0x01
-#define VC_INPUT_TERMINAL               0x02
-#define VC_OUTPUT_TERMINAL              0x03
-#define VC_SELECTOR_UNIT                0x04
-#define VC_PROCESSING_UNIT              0x05
-#define VC_EXTENSION_UNIT               0x06
+#define VC_DESCRIPTOR_UNDEFINED                0x00
+#define VC_HEADER                      0x01
+#define VC_INPUT_TERMINAL              0x02
+#define VC_OUTPUT_TERMINAL             0x03
+#define VC_SELECTOR_UNIT               0x04
+#define VC_PROCESSING_UNIT             0x05
+#define VC_EXTENSION_UNIT              0x06
 
 /* VideoStreaming class specific interface descriptor */
-#define VS_UNDEFINED                    0x00
-#define VS_INPUT_HEADER                 0x01
-#define VS_OUTPUT_HEADER                0x02
-#define VS_STILL_IMAGE_FRAME            0x03
-#define VS_FORMAT_UNCOMPRESSED          0x04
-#define VS_FRAME_UNCOMPRESSED           0x05
-#define VS_FORMAT_MJPEG                 0x06
-#define VS_FRAME_MJPEG                  0x07
-#define VS_FORMAT_MPEG2TS               0x0a
-#define VS_FORMAT_DV                    0x0c
-#define VS_COLORFORMAT                  0x0d
-#define VS_FORMAT_FRAME_BASED           0x10
-#define VS_FRAME_FRAME_BASED            0x11
-#define VS_FORMAT_STREAM_BASED          0x12
+#define VS_UNDEFINED                   0x00
+#define VS_INPUT_HEADER                        0x01
+#define VS_OUTPUT_HEADER               0x02
+#define VS_STILL_IMAGE_FRAME           0x03
+#define VS_FORMAT_UNCOMPRESSED         0x04
+#define VS_FRAME_UNCOMPRESSED          0x05
+#define VS_FORMAT_MJPEG                        0x06
+#define VS_FRAME_MJPEG                 0x07
+#define VS_FORMAT_MPEG2TS              0x0a
+#define VS_FORMAT_DV                   0x0c
+#define VS_COLORFORMAT                 0x0d
+#define VS_FORMAT_FRAME_BASED          0x10
+#define VS_FRAME_FRAME_BASED           0x11
+#define VS_FORMAT_STREAM_BASED         0x12
 
 /* Endpoint type */
-#define EP_UNDEFINED                    0x00
-#define EP_GENERAL                      0x01
-#define EP_ENDPOINT                     0x02
-#define EP_INTERRUPT                    0x03
+#define EP_UNDEFINED                   0x00
+#define EP_GENERAL                     0x01
+#define EP_ENDPOINT                    0x02
+#define EP_INTERRUPT                   0x03
 
 /* Request codes */
-#define RC_UNDEFINED                    0x00
-#define SET_CUR                         0x01
-#define GET_CUR                         0x81
-#define GET_MIN                         0x82
-#define GET_MAX                         0x83
-#define GET_RES                         0x84
-#define GET_LEN                         0x85
-#define GET_INFO                        0x86
-#define GET_DEF                         0x87
+#define RC_UNDEFINED                   0x00
+#define SET_CUR                                0x01
+#define GET_CUR                                0x81
+#define GET_MIN                                0x82
+#define GET_MAX                                0x83
+#define GET_RES                                0x84
+#define GET_LEN                                0x85
+#define GET_INFO                       0x86
+#define GET_DEF                                0x87
 
 /* VideoControl interface controls */
-#define VC_CONTROL_UNDEFINED            0x00
-#define VC_VIDEO_POWER_MODE_CONTROL     0x01
-#define VC_REQUEST_ERROR_CODE_CONTROL   0x02
+#define VC_CONTROL_UNDEFINED           0x00
+#define VC_VIDEO_POWER_MODE_CONTROL    0x01
+#define VC_REQUEST_ERROR_CODE_CONTROL  0x02
 
 /* Terminal controls */
-#define TE_CONTROL_UNDEFINED            0x00
+#define TE_CONTROL_UNDEFINED           0x00
 
 /* Selector Unit controls */
-#define SU_CONTROL_UNDEFINED            0x00
-#define SU_INPUT_SELECT_CONTROL         0x01
+#define SU_CONTROL_UNDEFINED           0x00
+#define SU_INPUT_SELECT_CONTROL                0x01
 
 /* Camera Terminal controls */
-#define CT_CONTROL_UNDEFINED                           0x00
-#define CT_SCANNING_MODE_CONTROL                       0x01
-#define CT_AE_MODE_CONTROL                             0x02
-#define CT_AE_PRIORITY_CONTROL                         0x03
-#define CT_EXPOSURE_TIME_ABSOLUTE_CONTROL               0x04
-#define CT_EXPOSURE_TIME_RELATIVE_CONTROL               0x05
-#define CT_FOCUS_ABSOLUTE_CONTROL                      0x06
-#define CT_FOCUS_RELATIVE_CONTROL                      0x07
-#define CT_FOCUS_AUTO_CONTROL                          0x08
-#define CT_IRIS_ABSOLUTE_CONTROL                       0x09
-#define CT_IRIS_RELATIVE_CONTROL                       0x0a
-#define CT_ZOOM_ABSOLUTE_CONTROL                       0x0b
-#define CT_ZOOM_RELATIVE_CONTROL                       0x0c
-#define CT_PANTILT_ABSOLUTE_CONTROL                    0x0d
-#define CT_PANTILT_RELATIVE_CONTROL                    0x0e
-#define CT_ROLL_ABSOLUTE_CONTROL                       0x0f
-#define CT_ROLL_RELATIVE_CONTROL                       0x10
-#define CT_PRIVACY_CONTROL                             0x11
+#define CT_CONTROL_UNDEFINED                           0x00
+#define CT_SCANNING_MODE_CONTROL                       0x01
+#define CT_AE_MODE_CONTROL                             0x02
+#define CT_AE_PRIORITY_CONTROL                         0x03
+#define CT_EXPOSURE_TIME_ABSOLUTE_CONTROL              0x04
+#define CT_EXPOSURE_TIME_RELATIVE_CONTROL              0x05
+#define CT_FOCUS_ABSOLUTE_CONTROL                      0x06
+#define CT_FOCUS_RELATIVE_CONTROL                      0x07
+#define CT_FOCUS_AUTO_CONTROL                          0x08
+#define CT_IRIS_ABSOLUTE_CONTROL                       0x09
+#define CT_IRIS_RELATIVE_CONTROL                       0x0a
+#define CT_ZOOM_ABSOLUTE_CONTROL                       0x0b
+#define CT_ZOOM_RELATIVE_CONTROL                       0x0c
+#define CT_PANTILT_ABSOLUTE_CONTROL                    0x0d
+#define CT_PANTILT_RELATIVE_CONTROL                    0x0e
+#define CT_ROLL_ABSOLUTE_CONTROL                       0x0f
+#define CT_ROLL_RELATIVE_CONTROL                       0x10
+#define CT_PRIVACY_CONTROL                             0x11
 
 /* Processing Unit controls */
-#define PU_CONTROL_UNDEFINED                           0x00
-#define PU_BACKLIGHT_COMPENSATION_CONTROL               0x01
-#define PU_BRIGHTNESS_CONTROL                          0x02
-#define PU_CONTRAST_CONTROL                            0x03
-#define PU_GAIN_CONTROL                                0x04
-#define PU_POWER_LINE_FREQUENCY_CONTROL                0x05
-#define PU_HUE_CONTROL                                 0x06
-#define PU_SATURATION_CONTROL                          0x07
-#define PU_SHARPNESS_CONTROL                           0x08
-#define PU_GAMMA_CONTROL                               0x09
-#define PU_WHITE_BALANCE_TEMPERATURE_CONTROL            0x0a
-#define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL       0x0b
-#define PU_WHITE_BALANCE_COMPONENT_CONTROL              0x0c
-#define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL         0x0d
-#define PU_DIGITAL_MULTIPLIER_CONTROL                  0x0e
-#define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL             0x0f
-#define PU_HUE_AUTO_CONTROL                            0x10
-#define PU_ANALOG_VIDEO_STANDARD_CONTROL                0x11
-#define PU_ANALOG_LOCK_STATUS_CONTROL                  0x12
+#define PU_CONTROL_UNDEFINED                           0x00
+#define PU_BACKLIGHT_COMPENSATION_CONTROL              0x01
+#define PU_BRIGHTNESS_CONTROL                          0x02
+#define PU_CONTRAST_CONTROL                            0x03
+#define PU_GAIN_CONTROL                                        0x04
+#define PU_POWER_LINE_FREQUENCY_CONTROL                        0x05
+#define PU_HUE_CONTROL                                 0x06
+#define PU_SATURATION_CONTROL                          0x07
+#define PU_SHARPNESS_CONTROL                           0x08
+#define PU_GAMMA_CONTROL                               0x09
+#define PU_WHITE_BALANCE_TEMPERATURE_CONTROL           0x0a
+#define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL      0x0b
+#define PU_WHITE_BALANCE_COMPONENT_CONTROL             0x0c
+#define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL                0x0d
+#define PU_DIGITAL_MULTIPLIER_CONTROL                  0x0e
+#define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL            0x0f
+#define PU_HUE_AUTO_CONTROL                            0x10
+#define PU_ANALOG_VIDEO_STANDARD_CONTROL               0x11
+#define PU_ANALOG_LOCK_STATUS_CONTROL                  0x12
 
 #define LXU_MOTOR_PANTILT_RELATIVE_CONTROL             0x01
 #define LXU_MOTOR_PANTILT_RESET_CONTROL                        0x02
 #define LXU_MOTOR_FOCUS_MOTOR_CONTROL                  0x03
 
 /* VideoStreaming interface controls */
-#define VS_CONTROL_UNDEFINED            0x00
-#define VS_PROBE_CONTROL                0x01
-#define VS_COMMIT_CONTROL               0x02
-#define VS_STILL_PROBE_CONTROL          0x03
-#define VS_STILL_COMMIT_CONTROL         0x04
-#define VS_STILL_IMAGE_TRIGGER_CONTROL  0x05
-#define VS_STREAM_ERROR_CODE_CONTROL    0x06
-#define VS_GENERATE_KEY_FRAME_CONTROL   0x07
-#define VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
-#define VS_SYNC_DELAY_CONTROL           0x09
-
-#define TT_VENDOR_SPECIFIC              0x0100
-#define TT_STREAMING                    0x0101
+#define VS_CONTROL_UNDEFINED           0x00
+#define VS_PROBE_CONTROL               0x01
+#define VS_COMMIT_CONTROL              0x02
+#define VS_STILL_PROBE_CONTROL         0x03
+#define VS_STILL_COMMIT_CONTROL                0x04
+#define VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
+#define VS_STREAM_ERROR_CODE_CONTROL   0x06
+#define VS_GENERATE_KEY_FRAME_CONTROL  0x07
+#define VS_UPDATE_FRAME_SEGMENT_CONTROL        0x08
+#define VS_SYNC_DELAY_CONTROL          0x09
+
+#define TT_VENDOR_SPECIFIC             0x0100
+#define TT_STREAMING                   0x0101
 
 /* Input Terminal types */
-#define ITT_VENDOR_SPECIFIC             0x0200
-#define ITT_CAMERA                      0x0201
-#define ITT_MEDIA_TRANSPORT_INPUT       0x0202
+#define ITT_VENDOR_SPECIFIC            0x0200
+#define ITT_CAMERA                     0x0201
+#define ITT_MEDIA_TRANSPORT_INPUT      0x0202
 
 /* Output Terminal types */
-#define OTT_VENDOR_SPECIFIC             0x0300
-#define OTT_DISPLAY                     0x0301
-#define OTT_MEDIA_TRANSPORT_OUTPUT      0x0302
+#define OTT_VENDOR_SPECIFIC            0x0300
+#define OTT_DISPLAY                    0x0301
+#define OTT_MEDIA_TRANSPORT_OUTPUT     0x0302
 
 /* External Terminal types */
-#define EXTERNAL_VENDOR_SPECIFIC        0x0400
-#define COMPOSITE_CONNECTOR             0x0401
-#define SVIDEO_CONNECTOR                0x0402
-#define COMPONENT_CONNECTOR             0x0403
+#define EXTERNAL_VENDOR_SPECIFIC       0x0400
+#define COMPOSITE_CONNECTOR            0x0401
+#define SVIDEO_CONNECTOR               0x0402
+#define COMPONENT_CONNECTOR            0x0403
 
 #define UVC_TERM_INPUT                 0x0000
 #define UVC_TERM_OUTPUT                        0x8000
@@ -541,11 +541,11 @@ struct uvc_streaming {
 };
 
 enum uvc_buffer_state {
-       UVC_BUF_STATE_IDLE       = 0,
-       UVC_BUF_STATE_QUEUED     = 1,
-       UVC_BUF_STATE_ACTIVE     = 2,
-       UVC_BUF_STATE_DONE       = 3,
-       UVC_BUF_STATE_ERROR      = 4,
+       UVC_BUF_STATE_IDLE      = 0,
+       UVC_BUF_STATE_QUEUED    = 1,
+       UVC_BUF_STATE_ACTIVE    = 2,
+       UVC_BUF_STATE_DONE      = 3,
+       UVC_BUF_STATE_ERROR     = 4,
 };
 
 struct uvc_buffer {
index fbe9cc0..2120880 100644 (file)
@@ -28,13 +28,13 @@ int v4l2_subdev_command(struct v4l2_subdev *sd, unsigned cmd, void *arg)
 {
        switch (cmd) {
        case VIDIOC_QUERYCTRL:
-               return v4l2_subdev_call(sd, core, querymenu, arg);
+               return v4l2_subdev_call(sd, core, queryctrl, arg);
        case VIDIOC_G_CTRL:
                return v4l2_subdev_call(sd, core, g_ctrl, arg);
        case VIDIOC_S_CTRL:
                return v4l2_subdev_call(sd, core, s_ctrl, arg);
        case VIDIOC_QUERYMENU:
-               return v4l2_subdev_call(sd, core, queryctrl, arg);
+               return v4l2_subdev_call(sd, core, querymenu, arg);
        case VIDIOC_LOG_STATUS:
                return v4l2_subdev_call(sd, core, log_status);
        case VIDIOC_DBG_G_CHIP_IDENT:
index 46b7ad4..e873a91 100644 (file)
@@ -349,7 +349,6 @@ struct card_info {
        u16 i2c_decoder, i2c_encoder;                   /* I2C types */
        u16 video_vfe, video_codec;                     /* videocodec types */
        u16 audio_chip;                                 /* audio type */
-       u16 vendor_id, device_id;       /* subsystem vendor/device ID */
 
        int inputs;             /* number of video inputs */
        struct input {
@@ -401,7 +400,6 @@ struct zoran {
        char name[32];          /* name of this device */
        struct pci_dev *pci_dev;        /* PCI device */
        unsigned char revision; /* revision of zr36057 */
-       unsigned int zr36057_adr;       /* bus address of IO mem returned by PCI BIOS */
        unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */
 
        spinlock_t spinlock;    /* Spinlock */
@@ -490,16 +488,10 @@ struct zoran {
        wait_queue_head_t test_q;
 };
 
-/*The following should be done in more portable way. It depends on define
-  of _ALPHA_BUZ in the Makefile.*/
-
-#ifdef _ALPHA_BUZ
-#define btwrite(dat,adr)    writel((dat), zr->zr36057_adr+(adr))
-#define btread(adr)         readl(zr->zr36057_adr+(adr))
-#else
+/* There was something called _ALPHA_BUZ that used the PCI address instead of
+ * the kernel iomapped address for btread/btwrite.  */
 #define btwrite(dat,adr)    writel((dat), zr->zr36057_mem+(adr))
 #define btread(adr)         readl(zr->zr36057_mem+(adr))
-#endif
 
 #define btand(dat,adr)      btwrite((dat) & btread(adr), adr)
 #define btor(dat,adr)       btwrite((dat) | btread(adr), adr)
index 05f3919..5d2f090 100644 (file)
 
 extern const struct zoran_format zoran_formats[];
 
-static int card[BUZ_MAX] = { -1, -1, -1, -1 };
+static int card[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
 module_param_array(card, int, NULL, 0444);
-MODULE_PARM_DESC(card, "The type of card");
+MODULE_PARM_DESC(card, "Card type");
 
-static int encoder[BUZ_MAX] = { -1, -1, -1, -1 };
+static int encoder[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
 module_param_array(encoder, int, NULL, 0444);
-MODULE_PARM_DESC(encoder, "i2c TV encoder");
+MODULE_PARM_DESC(encoder, "Video encoder chip");
 
-static int decoder[BUZ_MAX] = { -1, -1, -1, -1 };
+static int decoder[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
 module_param_array(decoder, int, NULL, 0444);
-MODULE_PARM_DESC(decoder, "i2c TV decoder");
+MODULE_PARM_DESC(decoder, "Video decoder chip");
 
 /*
    The video mem address of the video card.
@@ -104,9 +104,9 @@ module_param(default_norm, int, 0444);
 MODULE_PARM_DESC(default_norm, "Default norm (0=PAL, 1=NTSC, 2=SECAM)");
 
 /* /dev/videoN, -1 for autodetect */
-static int video_nr[BUZ_MAX] = {-1, -1, -1, -1};
+static int video_nr[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
 module_param_array(video_nr, int, NULL, 0444);
-MODULE_PARM_DESC(video_nr, "video device number (-1=Auto)");
+MODULE_PARM_DESC(video_nr, "Video device number (-1=Auto)");
 
 /*
    Number and size of grab buffers for Video 4 Linux
@@ -153,9 +153,21 @@ MODULE_DESCRIPTION("Zoran-36057/36067 JPEG codec driver");
 MODULE_AUTHOR("Serguei Miridonov");
 MODULE_LICENSE("GPL");
 
+#define ZR_DEVICE(subven, subdev, data)        { \
+       .vendor = PCI_VENDOR_ID_ZORAN, .device = PCI_DEVICE_ID_ZORAN_36057, \
+       .subvendor = (subven), .subdevice = (subdev), .driver_data = (data) }
+
+static struct pci_device_id zr36067_pci_tbl[] = {
+       ZR_DEVICE(PCI_VENDOR_ID_MIRO, PCI_DEVICE_ID_MIRO_DC10PLUS, DC10plus),
+       ZR_DEVICE(PCI_VENDOR_ID_MIRO, PCI_DEVICE_ID_MIRO_DC30PLUS, DC30plus),
+       ZR_DEVICE(PCI_VENDOR_ID_ELECTRONICDESIGNGMBH, PCI_DEVICE_ID_LML_33R10, LML33R10),
+       ZR_DEVICE(PCI_VENDOR_ID_IOMEGA, PCI_DEVICE_ID_IOMEGA_BUZ, BUZ),
+       ZR_DEVICE(PCI_ANY_ID, PCI_ANY_ID, NUM_CARDS),
+       {0}
+};
+MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl);
 
-int zoran_num;                 /* number of Buzs in use */
-struct zoran *zoran[BUZ_MAX];
+static unsigned int zoran_num;         /* number of cards found */
 
 /* videocodec bus functions ZR36060 */
 static u32
@@ -472,8 +484,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
        }, {
                .type = DC10plus,
                .name = "DC10plus",
-               .vendor_id = PCI_VENDOR_ID_MIRO,
-               .device_id = PCI_DEVICE_ID_MIRO_DC10PLUS,
                .i2c_decoder = I2C_DRIVERID_SAA7110,
                .i2c_encoder = I2C_DRIVERID_ADV7175,
                .video_codec = CODEC_TYPE_ZR36060,
@@ -531,8 +541,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
        }, {
                .type = DC30plus,
                .name = "DC30plus",
-               .vendor_id = PCI_VENDOR_ID_MIRO,
-               .device_id = PCI_DEVICE_ID_MIRO_DC30PLUS,
                .i2c_decoder = I2C_DRIVERID_VPX3220,
                .i2c_encoder = I2C_DRIVERID_ADV7175,
                .video_codec = CODEC_TYPE_ZR36050,
@@ -589,8 +597,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
        }, {
                .type = LML33R10,
                .name = "LML33R10",
-               .vendor_id = PCI_VENDOR_ID_ELECTRONICDESIGNGMBH,
-               .device_id = PCI_DEVICE_ID_LML_33R10,
                .i2c_decoder = I2C_DRIVERID_SAA7114,
                .i2c_encoder = I2C_DRIVERID_ADV7170,
                .video_codec = CODEC_TYPE_ZR36060,
@@ -618,8 +624,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
        }, {
                .type = BUZ,
                .name = "Buz",
-               .vendor_id = PCI_VENDOR_ID_IOMEGA,
-               .device_id = PCI_DEVICE_ID_IOMEGA_BUZ,
                .i2c_decoder = I2C_DRIVERID_SAA7111A,
                .i2c_encoder = I2C_DRIVERID_SAA7185B,
                .video_codec = CODEC_TYPE_ZR36060,
@@ -649,8 +653,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
                .name = "6-Eyes",
                /* AverMedia chose not to brand the 6-Eyes. Thus it
                   can't be autodetected, and requires card=x. */
-               .vendor_id = -1,
-               .device_id = -1,
                .i2c_decoder = I2C_DRIVERID_KS0127,
                .i2c_encoder = I2C_DRIVERID_BT866,
                .video_codec = CODEC_TYPE_ZR36060,
@@ -1138,7 +1140,8 @@ zr36057_init (struct zoran *zr)
        strcpy(zr->video_dev->name, ZR_DEVNAME(zr));
        err = video_register_device(zr->video_dev, VFL_TYPE_GRABBER, video_nr[zr->id]);
        if (err < 0)
-               goto exit_unregister;
+               goto exit_free;
+       video_set_drvdata(zr->video_dev, zr);
 
        zoran_init_hardware(zr);
        if (zr36067_debug > 2)
@@ -1153,19 +1156,19 @@ zr36057_init (struct zoran *zr)
        zr->initialized = 1;
        return 0;
 
-exit_unregister:
-       zoran_unregister_i2c(zr);
 exit_free:
        kfree(zr->stat_com);
        kfree(zr->video_dev);
        return err;
 }
 
-static void
-zoran_release (struct zoran *zr)
+static void __devexit zoran_remove(struct pci_dev *pdev)
 {
+       struct zoran *zr = pci_get_drvdata(pdev);
+
        if (!zr->initialized)
                goto exit_free;
+
        /* unregister videocodec bus */
        if (zr->codec) {
                struct videocodec_master *master = zr->codec->master_data;
@@ -1194,6 +1197,7 @@ zoran_release (struct zoran *zr)
        pci_disable_device(zr->pci_dev);
        video_unregister_device(zr->video_dev);
 exit_free:
+       pci_set_drvdata(pdev, NULL);
        kfree(zr);
 }
 
@@ -1256,338 +1260,329 @@ zoran_setup_videocodec (struct zoran *zr,
  *   Scan for a Buz card (actually for the PCI controller ZR36057),
  *   request the irq and map the io memory
  */
-static int __devinit
-find_zr36057 (void)
+static int __devinit zoran_probe(struct pci_dev *pdev,
+                                const struct pci_device_id *ent)
 {
        unsigned char latency, need_latency;
        struct zoran *zr;
-       struct pci_dev *dev = NULL;
        int result;
        struct videocodec_master *master_vfe = NULL;
        struct videocodec_master *master_codec = NULL;
        int card_num;
        char *i2c_enc_name, *i2c_dec_name, *codec_name, *vfe_name;
+       unsigned int nr;
 
-       zoran_num = 0;
-       while (zoran_num < BUZ_MAX &&
-              (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
-               card_num = card[zoran_num];
-               zr = kzalloc(sizeof(struct zoran), GFP_KERNEL);
-               if (!zr) {
-                       dprintk(1,
-                               KERN_ERR
-                               "%s: find_zr36057() - kzalloc failed\n",
-                               ZORAN_NAME);
-                       continue;
-               }
-               zr->pci_dev = dev;
-               //zr->zr36057_mem = NULL;
-               zr->id = zoran_num;
-               snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
-               spin_lock_init(&zr->spinlock);
-               mutex_init(&zr->resource_lock);
-               if (pci_enable_device(dev))
-                       goto zr_free_mem;
-               zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0);
-               pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION,
-                                    &zr->revision);
-               if (zr->revision < 2) {
-                       dprintk(1,
-                               KERN_INFO
-                               "%s: Zoran ZR36057 (rev %d) irq: %d, memory: 0x%08x.\n",
-                               ZR_DEVNAME(zr), zr->revision, zr->pci_dev->irq,
-                               zr->zr36057_adr);
 
-                       if (card_num == -1) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - no card specified, please use the card=X insmod option\n",
-                                       ZR_DEVNAME(zr));
-                               goto zr_free_mem;
-                       }
-               } else {
-                       int i;
-                       unsigned short ss_vendor, ss_device;
+       nr = zoran_num++;
+       if (nr >= BUZ_MAX) {
+               dprintk(1,
+                       KERN_ERR
+                       "%s: driver limited to %d card(s) maximum\n",
+                       ZORAN_NAME, BUZ_MAX);
+               return -ENOENT;
+       }
 
-                       ss_vendor = zr->pci_dev->subsystem_vendor;
-                       ss_device = zr->pci_dev->subsystem_device;
+       zr = kzalloc(sizeof(struct zoran), GFP_KERNEL);
+       if (!zr) {
+               dprintk(1,
+                       KERN_ERR
+                       "%s: find_zr36057() - kzalloc failed\n",
+                       ZORAN_NAME);
+               return -ENOMEM;
+       }
+       zr->pci_dev = pdev;
+       zr->id = nr;
+       snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
+       spin_lock_init(&zr->spinlock);
+       mutex_init(&zr->resource_lock);
+       if (pci_enable_device(pdev))
+               goto zr_free_mem;
+       pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision);
+
+       dprintk(1,
+               KERN_INFO
+               "%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n",
+               ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision,
+               zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0));
+       if (zr->revision >= 2) {
+               dprintk(1,
+                       KERN_INFO
+                       "%s: Subsystem vendor=0x%04x id=0x%04x\n",
+                       ZR_DEVNAME(zr), zr->pci_dev->subsystem_vendor,
+                       zr->pci_dev->subsystem_device);
+       }
+
+       /* Use auto-detected card type? */
+       if (card[nr] == -1) {
+               if (zr->revision < 2) {
                        dprintk(1,
-                               KERN_INFO
-                               "%s: Zoran ZR36067 (rev %d) irq: %d, memory: 0x%08x\n",
-                               ZR_DEVNAME(zr), zr->revision, zr->pci_dev->irq,
-                               zr->zr36057_adr);
+                               KERN_ERR
+                               "%s: No card type specified, please use the card=X module parameter\n",
+                               ZR_DEVNAME(zr));
                        dprintk(1,
-                               KERN_INFO
-                               "%s: subsystem vendor=0x%04x id=0x%04x\n",
-                               ZR_DEVNAME(zr), ss_vendor, ss_device);
-                       if (card_num == -1) {
-                               dprintk(3,
-                                       KERN_DEBUG
-                                       "%s: find_zr36057() - trying to autodetect card type\n",
-                                       ZR_DEVNAME(zr));
-                               for (i=0;i<NUM_CARDS;i++) {
-                                       if (ss_vendor == zoran_cards[i].vendor_id &&
-                                           ss_device == zoran_cards[i].device_id) {
-                                               dprintk(3,
-                                                       KERN_DEBUG
-                                                       "%s: find_zr36057() - card %s detected\n",
-                                                       ZR_DEVNAME(zr),
-                                                       zoran_cards[i].name);
-                                               card_num = i;
-                                               break;
-                                       }
-                               }
-                               if (i == NUM_CARDS) {
-                                       dprintk(1,
-                                               KERN_ERR
-                                               "%s: find_zr36057() - unknown card\n",
-                                               ZR_DEVNAME(zr));
-                                       goto zr_free_mem;
-                               }
-                       }
-               }
-
-               if (card_num < 0 || card_num >= NUM_CARDS) {
-                       dprintk(2,
                                KERN_ERR
-                               "%s: find_zr36057() - invalid cardnum %d\n",
-                               ZR_DEVNAME(zr), card_num);
+                               "%s: It is not possible to auto-detect ZR36057 based cards\n",
+                               ZR_DEVNAME(zr));
                        goto zr_free_mem;
                }
 
-               /* even though we make this a non pointer and thus
-                * theoretically allow for making changes to this struct
-                * on a per-individual card basis at runtime, this is
-                * strongly discouraged. This structure is intended to
-                * keep general card information, no settings or anything */
-               zr->card = zoran_cards[card_num];
-               snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)),
-                        "%s[%u]", zr->card.name, zr->id);
-
-               zr->zr36057_mem = ioremap_nocache(zr->zr36057_adr, 0x1000);
-               if (!zr->zr36057_mem) {
+               card_num = ent->driver_data;
+               if (card_num >= NUM_CARDS) {
                        dprintk(1,
                                KERN_ERR
-                               "%s: find_zr36057() - ioremap failed\n",
+                               "%s: Unknown card, try specifying card=X module parameter\n",
                                ZR_DEVNAME(zr));
                        goto zr_free_mem;
                }
-
-               result = request_irq(zr->pci_dev->irq,
-                                    zoran_irq,
-                                    IRQF_SHARED | IRQF_DISABLED,
-                                    ZR_DEVNAME(zr),
-                                    (void *) zr);
-               if (result < 0) {
-                       if (result == -EINVAL) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - bad irq number or handler\n",
-                                       ZR_DEVNAME(zr));
-                       } else if (result == -EBUSY) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - IRQ %d busy, change your PnP config in BIOS\n",
-                                       ZR_DEVNAME(zr), zr->pci_dev->irq);
-                       } else {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - can't assign irq, error code %d\n",
-                                       ZR_DEVNAME(zr), result);
-                       }
-                       goto zr_unmap;
-               }
-
-               /* set PCI latency timer */
-               pci_read_config_byte(zr->pci_dev, PCI_LATENCY_TIMER,
-                                    &latency);
-               need_latency = zr->revision > 1 ? 32 : 48;
-               if (latency != need_latency) {
-                       dprintk(2,
-                               KERN_INFO
-                               "%s: Changing PCI latency from %d to %d.\n",
-                               ZR_DEVNAME(zr), latency, need_latency);
-                       pci_write_config_byte(zr->pci_dev,
-                                             PCI_LATENCY_TIMER,
-                                             need_latency);
+               dprintk(3,
+                       KERN_DEBUG
+                       "%s: %s() - card %s detected\n",
+                       ZR_DEVNAME(zr), __func__, zoran_cards[card_num].name);
+       } else {
+               card_num = card[nr];
+               if (card_num >= NUM_CARDS || card_num < 0) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: User specified card type %d out of range (0 .. %d)\n",
+                               ZR_DEVNAME(zr), card_num, NUM_CARDS - 1);
+                       goto zr_free_mem;
                }
+       }
 
-               zr36057_restart(zr);
-               /* i2c */
-               dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n",
-                       ZR_DEVNAME(zr));
+       /* even though we make this a non pointer and thus
+        * theoretically allow for making changes to this struct
+        * on a per-individual card basis at runtime, this is
+        * strongly discouraged. This structure is intended to
+        * keep general card information, no settings or anything */
+       zr->card = zoran_cards[card_num];
+       snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)),
+                "%s[%u]", zr->card.name, zr->id);
+
+       zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0);
+       if (!zr->zr36057_mem) {
+               dprintk(1,
+                       KERN_ERR
+                       "%s: %s() - ioremap failed\n",
+                       ZR_DEVNAME(zr), __func__);
+               goto zr_free_mem;
+       }
 
-               /* i2c decoder */
-               if (decoder[zr->id] != -1) {
-                       i2c_dec_name = i2cid_to_modulename(decoder[zr->id]);
-                       zr->card.i2c_decoder = decoder[zr->id];
-               } else if (zr->card.i2c_decoder != 0) {
-                       i2c_dec_name =
-                               i2cid_to_modulename(zr->card.i2c_decoder);
+       result = request_irq(zr->pci_dev->irq, zoran_irq,
+                            IRQF_SHARED | IRQF_DISABLED, ZR_DEVNAME(zr), zr);
+       if (result < 0) {
+               if (result == -EINVAL) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() - bad irq number or handler\n",
+                               ZR_DEVNAME(zr));
+               } else if (result == -EBUSY) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() - IRQ %d busy, change your PnP config in BIOS\n",
+                               ZR_DEVNAME(zr), zr->pci_dev->irq);
                } else {
-                       i2c_dec_name = NULL;
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() - can't assign irq, error code %d\n",
+                               ZR_DEVNAME(zr), result);
                }
+               goto zr_unmap;
+       }
 
-               if (i2c_dec_name) {
-                       if ((result = request_module(i2c_dec_name)) < 0) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: failed to load module %s: %d\n",
-                                       ZR_DEVNAME(zr), i2c_dec_name, result);
-                       }
-               }
+       /* set PCI latency timer */
+       pci_read_config_byte(zr->pci_dev, PCI_LATENCY_TIMER,
+                            &latency);
+       need_latency = zr->revision > 1 ? 32 : 48;
+       if (latency != need_latency) {
+               dprintk(2,
+                       KERN_INFO
+                       "%s: Changing PCI latency from %d to %d\n",
+                       ZR_DEVNAME(zr), latency, need_latency);
+               pci_write_config_byte(zr->pci_dev, PCI_LATENCY_TIMER,
+                                     need_latency);
+       }
 
-               /* i2c encoder */
-               if (encoder[zr->id] != -1) {
-                       i2c_enc_name = i2cid_to_modulename(encoder[zr->id]);
-                       zr->card.i2c_encoder = encoder[zr->id];
-               } else if (zr->card.i2c_encoder != 0) {
-                       i2c_enc_name =
-                               i2cid_to_modulename(zr->card.i2c_encoder);
-               } else {
-                       i2c_enc_name = NULL;
-               }
+       zr36057_restart(zr);
+       /* i2c */
+       dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n",
+               ZR_DEVNAME(zr));
+
+       /* i2c decoder */
+       if (decoder[zr->id] != -1) {
+               i2c_dec_name = i2cid_to_modulename(decoder[zr->id]);
+               zr->card.i2c_decoder = decoder[zr->id];
+       } else if (zr->card.i2c_decoder != 0) {
+               i2c_dec_name = i2cid_to_modulename(zr->card.i2c_decoder);
+       } else {
+               i2c_dec_name = NULL;
+       }
 
-               if (i2c_enc_name) {
-                       if ((result = request_module(i2c_enc_name)) < 0) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: failed to load module %s: %d\n",
-                                       ZR_DEVNAME(zr), i2c_enc_name, result);
-                       }
+       if (i2c_dec_name) {
+               result = request_module(i2c_dec_name);
+               if (result < 0) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: failed to load module %s: %d\n",
+                               ZR_DEVNAME(zr), i2c_dec_name, result);
                }
+       }
+
+       /* i2c encoder */
+       if (encoder[zr->id] != -1) {
+               i2c_enc_name = i2cid_to_modulename(encoder[zr->id]);
+               zr->card.i2c_encoder = encoder[zr->id];
+       } else if (zr->card.i2c_encoder != 0) {
+               i2c_enc_name = i2cid_to_modulename(zr->card.i2c_encoder);
+       } else {
+               i2c_enc_name = NULL;
+       }
 
-               if (zoran_register_i2c(zr) < 0) {
+       if (i2c_enc_name) {
+               result = request_module(i2c_enc_name);
+               if (result < 0) {
                        dprintk(1,
                                KERN_ERR
-                               "%s: find_zr36057() - can't initialize i2c bus\n",
-                               ZR_DEVNAME(zr));
-                       goto zr_free_irq;
+                               "%s: failed to load module %s: %d\n",
+                               ZR_DEVNAME(zr), i2c_enc_name, result);
                }
+       }
 
-               dprintk(2,
-                       KERN_INFO "%s: Initializing videocodec bus...\n",
+       if (zoran_register_i2c(zr) < 0) {
+               dprintk(1,
+                       KERN_ERR
+                       "%s: find_zr36057() - can't initialize i2c bus\n",
                        ZR_DEVNAME(zr));
+               goto zr_free_irq;
+       }
 
-               if (zr->card.video_codec != 0 &&
-                   (codec_name =
-                    codecid_to_modulename(zr->card.video_codec)) != NULL) {
-                       if ((result = request_module(codec_name)) < 0) {
+       dprintk(2,
+               KERN_INFO "%s: Initializing videocodec bus...\n",
+               ZR_DEVNAME(zr));
+
+       if (zr->card.video_codec) {
+               codec_name = codecid_to_modulename(zr->card.video_codec);
+               if (codec_name) {
+                       result = request_module(codec_name);
+                       if (result) {
                                dprintk(1,
                                        KERN_ERR
                                        "%s: failed to load modules %s: %d\n",
                                        ZR_DEVNAME(zr), codec_name, result);
                        }
                }
-               if (zr->card.video_vfe != 0 &&
-                   (vfe_name =
-                    codecid_to_modulename(zr->card.video_vfe)) != NULL) {
-                       if ((result = request_module(vfe_name)) < 0) {
+       }
+       if (zr->card.video_vfe) {
+               vfe_name = codecid_to_modulename(zr->card.video_vfe);
+               if (vfe_name) {
+                       result = request_module(vfe_name);
+                       if (result < 0) {
                                dprintk(1,
                                        KERN_ERR
                                        "%s: failed to load modules %s: %d\n",
                                        ZR_DEVNAME(zr), vfe_name, result);
                        }
                }
+       }
 
-               /* reset JPEG codec */
-               jpeg_codec_sleep(zr, 1);
-               jpeg_codec_reset(zr);
-               /* video bus enabled */
-               /* display codec revision */
-               if (zr->card.video_codec != 0) {
-                       master_codec = zoran_setup_videocodec(zr,
-                                                             zr->card.video_codec);
-                       if (!master_codec)
-                               goto zr_unreg_i2c;
-                       zr->codec = videocodec_attach(master_codec);
-                       if (!zr->codec) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - no codec found\n",
-                                       ZR_DEVNAME(zr));
-                               goto zr_free_codec;
-                       }
-                       if (zr->codec->type != zr->card.video_codec) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - wrong codec\n",
-                                       ZR_DEVNAME(zr));
-                               goto zr_detach_codec;
-                       }
+       /* reset JPEG codec */
+       jpeg_codec_sleep(zr, 1);
+       jpeg_codec_reset(zr);
+       /* video bus enabled */
+       /* display codec revision */
+       if (zr->card.video_codec != 0) {
+               master_codec = zoran_setup_videocodec(zr, zr->card.video_codec);
+               if (!master_codec)
+                       goto zr_unreg_i2c;
+               zr->codec = videocodec_attach(master_codec);
+               if (!zr->codec) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() - no codec found\n",
+                               ZR_DEVNAME(zr));
+                       goto zr_free_codec;
                }
-               if (zr->card.video_vfe != 0) {
-                       master_vfe = zoran_setup_videocodec(zr,
-                                                           zr->card.video_vfe);
-                       if (!master_vfe)
-                               goto zr_detach_codec;
-                       zr->vfe = videocodec_attach(master_vfe);
-                       if (!zr->vfe) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() - no VFE found\n",
-                                       ZR_DEVNAME(zr));
-                               goto zr_free_vfe;
-                       }
-                       if (zr->vfe->type != zr->card.video_vfe) {
-                               dprintk(1,
-                                       KERN_ERR
-                                       "%s: find_zr36057() = wrong VFE\n",
-                                       ZR_DEVNAME(zr));
-                               goto zr_detach_vfe;
-                       }
+               if (zr->codec->type != zr->card.video_codec) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() - wrong codec\n",
+                               ZR_DEVNAME(zr));
+                       goto zr_detach_codec;
+               }
+       }
+       if (zr->card.video_vfe != 0) {
+               master_vfe = zoran_setup_videocodec(zr, zr->card.video_vfe);
+               if (!master_vfe)
+                       goto zr_detach_codec;
+               zr->vfe = videocodec_attach(master_vfe);
+               if (!zr->vfe) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() - no VFE found\n",
+                               ZR_DEVNAME(zr));
+                       goto zr_free_vfe;
+               }
+               if (zr->vfe->type != zr->card.video_vfe) {
+                       dprintk(1,
+                               KERN_ERR
+                               "%s: find_zr36057() = wrong VFE\n",
+                               ZR_DEVNAME(zr));
+                       goto zr_detach_vfe;
                }
-               /* Success so keep the pci_dev referenced */
-               pci_dev_get(zr->pci_dev);
-               zoran[zoran_num++] = zr;
-               continue;
-
-               // Init errors
-             zr_detach_vfe:
-               videocodec_detach(zr->vfe);
-             zr_free_vfe:
-               kfree(master_vfe);
-             zr_detach_codec:
-               videocodec_detach(zr->codec);
-             zr_free_codec:
-               kfree(master_codec);
-             zr_unreg_i2c:
-               zoran_unregister_i2c(zr);
-             zr_free_irq:
-               btwrite(0, ZR36057_SPGPPCR);
-               free_irq(zr->pci_dev->irq, zr);
-             zr_unmap:
-               iounmap(zr->zr36057_mem);
-             zr_free_mem:
-               kfree(zr);
-               continue;
        }
-       if (dev)        /* Clean up ref count on early exit */
-               pci_dev_put(dev);
 
-       if (zoran_num == 0) {
-               dprintk(1, KERN_INFO "No known MJPEG cards found.\n");
+       /* take care of Natoma chipset and a revision 1 zr36057 */
+       if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) {
+               zr->jpg_buffers.need_contiguous = 1;
+               dprintk(1,
+                       KERN_INFO
+                       "%s: ZR36057/Natoma bug, max. buffer size is 128K\n",
+                       ZR_DEVNAME(zr));
        }
-       return zoran_num;
+
+       if (zr36057_init(zr) < 0)
+               goto zr_detach_vfe;
+
+       zoran_proc_init(zr);
+
+       pci_set_drvdata(pdev, zr);
+
+       return 0;
+
+zr_detach_vfe:
+       videocodec_detach(zr->vfe);
+zr_free_vfe:
+       kfree(master_vfe);
+zr_detach_codec:
+       videocodec_detach(zr->codec);
+zr_free_codec:
+       kfree(master_codec);
+zr_unreg_i2c:
+       zoran_unregister_i2c(zr);
+zr_free_irq:
+       btwrite(0, ZR36057_SPGPPCR);
+       free_irq(zr->pci_dev->irq, zr);
+zr_unmap:
+       iounmap(zr->zr36057_mem);
+zr_free_mem:
+       kfree(zr);
+
+       return -ENODEV;
 }
 
-static int __init
-init_dc10_cards (void)
+static struct pci_driver zoran_driver = {
+       .name = "zr36067",
+       .id_table = zr36067_pci_tbl,
+       .probe = zoran_probe,
+       .remove = zoran_remove,
+};
+
+static int __init zoran_init(void)
 {
-       int i;
+       int res;
 
-       memset(zoran, 0, sizeof(zoran));
        printk(KERN_INFO "Zoran MJPEG board driver version %d.%d.%d\n",
               MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION);
 
-       /* Look for cards */
-       if (find_zr36057() < 0) {
-               return -EIO;
-       }
-       if (zoran_num == 0)
-               return -ENODEV;
-       dprintk(1, KERN_INFO "%s: %d card(s) found\n", ZORAN_NAME,
-               zoran_num);
        /* check the parameters we have been given, adjust if necessary */
        if (v4l_nbufs < 2)
                v4l_nbufs = 2;
@@ -1629,37 +1624,22 @@ init_dc10_cards (void)
                        ZORAN_NAME);
        }
 
-       /* take care of Natoma chipset and a revision 1 zr36057 */
-       for (i = 0; i < zoran_num; i++) {
-               struct zoran *zr = zoran[i];
-
-               if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) {
-                       zr->jpg_buffers.need_contiguous = 1;
-                       dprintk(1,
-                               KERN_INFO
-                               "%s: ZR36057/Natoma bug, max. buffer size is 128K\n",
-                               ZR_DEVNAME(zr));
-               }
-
-               if (zr36057_init(zr) < 0) {
-                       for (i = 0; i < zoran_num; i++)
-                               zoran_release(zoran[i]);
-                       return -EIO;
-               }
-               zoran_proc_init(zr);
+       res = pci_register_driver(&zoran_driver);
+       if (res) {
+               dprintk(1,
+                       KERN_ERR
+                       "%s: Unable to register ZR36057 driver\n",
+                       ZORAN_NAME);
+               return res;
        }
 
        return 0;
 }
 
-static void __exit
-unload_dc10_cards (void)
+static void __exit zoran_exit(void)
 {
-       int i;
-
-       for (i = 0; i < zoran_num; i++)
-               zoran_release(zoran[i]);
+       pci_unregister_driver(&zoran_driver);
 }
 
-module_init(init_dc10_cards);
-module_exit(unload_dc10_cards);
+module_init(zoran_init);
+module_exit(zoran_exit);
index e4dc9d2..4507bdc 100644 (file)
@@ -40,8 +40,6 @@ extern int zr36067_debug;
 
 /* Anybody who uses more than four? */
 #define BUZ_MAX 4
-extern int zoran_num;
-extern struct zoran *zoran[BUZ_MAX];
 
 extern struct video_device zoran_template;
 
index b58b9dd..120ef23 100644 (file)
@@ -1196,83 +1196,54 @@ zoran_close_end_session (struct file *file)
  *   Open a zoran card. Right now the flags stuff is just playing
  */
 
-static int
-zoran_open(struct file  *file)
+static int zoran_open(struct file *file)
 {
-       unsigned int minor = video_devdata(file)->minor;
-       struct zoran *zr = NULL;
+       struct zoran *zr = video_drvdata(file);
        struct zoran_fh *fh;
-       int i, res, first_open = 0, have_module_locks = 0;
+       int res, first_open = 0;
 
-       lock_kernel();
-       /* find the device */
-       for (i = 0; i < zoran_num; i++) {
-               if (zoran[i]->video_dev->minor == minor) {
-                       zr = zoran[i];
-                       break;
-               }
-       }
+       dprintk(2, KERN_INFO "%s: zoran_open(%s, pid=[%d]), users(-)=%d\n",
+               ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user + 1);
 
-       if (!zr) {
-               dprintk(1, KERN_ERR "%s: device not found!\n", ZORAN_NAME);
-               res = -ENODEV;
-               goto open_unlock_and_return;
-       }
+       lock_kernel();
 
        /* see fs/device.c - the kernel already locks during open(),
         * so locking ourselves only causes deadlocks */
        /*mutex_lock(&zr->resource_lock);*/
 
+       if (zr->user >= 2048) {
+               dprintk(1, KERN_ERR "%s: too many users (%d) on device\n",
+                       ZR_DEVNAME(zr), zr->user);
+               res = -EBUSY;
+               goto fail_unlock;
+       }
+
        if (!zr->decoder) {
                dprintk(1,
                        KERN_ERR "%s: no TV decoder loaded for device!\n",
                        ZR_DEVNAME(zr));
                res = -EIO;
-               goto open_unlock_and_return;
+               goto fail_unlock;
        }
 
-       /* try to grab a module lock */
-       if (!try_module_get(THIS_MODULE)) {
-               dprintk(1,
-                       KERN_ERR
-                       "%s: failed to acquire my own lock! PANIC!\n",
-                       ZR_DEVNAME(zr));
-               res = -ENODEV;
-               goto open_unlock_and_return;
-       }
        if (!try_module_get(zr->decoder->driver->driver.owner)) {
                dprintk(1,
                        KERN_ERR
-                       "%s: failed to grab ownership of i2c decoder\n",
+                       "%s: failed to grab ownership of video decoder\n",
                        ZR_DEVNAME(zr));
                res = -EIO;
-               module_put(THIS_MODULE);
-               goto open_unlock_and_return;
+               goto fail_unlock;
        }
        if (zr->encoder &&
            !try_module_get(zr->encoder->driver->driver.owner)) {
                dprintk(1,
                        KERN_ERR
-                       "%s: failed to grab ownership of i2c encoder\n",
+                       "%s: failed to grab ownership of video encoder\n",
                        ZR_DEVNAME(zr));
                res = -EIO;
-               module_put(zr->decoder->driver->driver.owner);
-               module_put(THIS_MODULE);
-               goto open_unlock_and_return;
+               goto fail_decoder;
        }
 
-       have_module_locks = 1;
-
-       if (zr->user >= 2048) {
-               dprintk(1, KERN_ERR "%s: too many users (%d) on device\n",
-                       ZR_DEVNAME(zr), zr->user);
-               res = -EBUSY;
-               goto open_unlock_and_return;
-       }
-
-       dprintk(1, KERN_INFO "%s: zoran_open(%s, pid=[%d]), users(-)=%d\n",
-               ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user);
-
        /* now, create the open()-specific file_ops struct */
        fh = kzalloc(sizeof(struct zoran_fh), GFP_KERNEL);
        if (!fh) {
@@ -1281,7 +1252,7 @@ zoran_open(struct file  *file)
                        "%s: zoran_open() - allocation of zoran_fh failed\n",
                        ZR_DEVNAME(zr));
                res = -ENOMEM;
-               goto open_unlock_and_return;
+               goto fail_encoder;
        }
        /* used to be BUZ_MAX_WIDTH/HEIGHT, but that gives overflows
         * on norm-change! */
@@ -1292,9 +1263,8 @@ zoran_open(struct file  *file)
                        KERN_ERR
                        "%s: zoran_open() - allocation of overlay_mask failed\n",
                        ZR_DEVNAME(zr));
-               kfree(fh);
                res = -ENOMEM;
-               goto open_unlock_and_return;
+               goto fail_fh;
        }
 
        if (zr->user++ == 0)
@@ -1319,22 +1289,19 @@ zoran_open(struct file  *file)
 
        return 0;
 
-open_unlock_and_return:
-       /* if we grabbed locks, release them accordingly */
-       if (have_module_locks) {
-               module_put(zr->decoder->driver->driver.owner);
-               if (zr->encoder) {
-                       module_put(zr->encoder->driver->driver.owner);
-               }
-               module_put(THIS_MODULE);
-       }
-
-       /* if there's no device found, we didn't obtain the lock either */
-       if (zr) {
-               /*mutex_unlock(&zr->resource_lock);*/
-       }
+fail_fh:
+       kfree(fh);
+fail_encoder:
+       if (zr->encoder)
+               module_put(zr->encoder->driver->driver.owner);
+fail_decoder:
+       module_put(zr->decoder->driver->driver.owner);
+fail_unlock:
        unlock_kernel();
 
+       dprintk(2, KERN_INFO "%s: open failed (%d), users(-)=%d\n",
+               ZR_DEVNAME(zr), res, zr->user);
+
        return res;
 }
 
@@ -1344,8 +1311,8 @@ zoran_close(struct file  *file)
        struct zoran_fh *fh = file->private_data;
        struct zoran *zr = fh->zr;
 
-       dprintk(1, KERN_INFO "%s: zoran_close(%s, pid=[%d]), users(+)=%d\n",
-               ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user);
+       dprintk(2, KERN_INFO "%s: zoran_close(%s, pid=[%d]), users(+)=%d\n",
+               ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user - 1);
 
        /* kernel locks (fs/device.c), so don't do that ourselves
         * (prevents deadlocks) */
@@ -1391,10 +1358,8 @@ zoran_close(struct file  *file)
 
        /* release locks on the i2c modules */
        module_put(zr->decoder->driver->driver.owner);
-       if (zr->encoder) {
-                module_put(zr->encoder->driver->driver.owner);
-       }
-       module_put(THIS_MODULE);
+       if (zr->encoder)
+               module_put(zr->encoder->driver->driver.owner);
 
        /*mutex_unlock(&zr->resource_lock);*/
 
index 0efa390..99d4b28 100644 (file)
@@ -145,6 +145,16 @@ config MMC_IMX
 
          If unsure, say N.
 
+config MMC_MXC
+       tristate "Freescale i.MX2/3 Multimedia Card Interface support"
+       depends on ARCH_MXC
+       help
+         This selects the Freescale i.MX2/3 Multimedia card Interface.
+         If you have a i.MX platform with a Multimedia Card slot,
+         say Y or M here.
+
+         If unsure, say N.
+
 config MMC_TIFM_SD
        tristate "TI Flash Media MMC/SD Interface support  (EXPERIMENTAL)"
        depends on EXPERIMENTAL && PCI
index 98cab84..dedec55 100644 (file)
@@ -9,6 +9,7 @@ endif
 obj-$(CONFIG_MMC_ARMMMCI)      += mmci.o
 obj-$(CONFIG_MMC_PXA)          += pxamci.o
 obj-$(CONFIG_MMC_IMX)          += imxmmc.o
+obj-$(CONFIG_MMC_MXC)          += mxcmmc.o
 obj-$(CONFIG_MMC_SDHCI)                += sdhci.o
 obj-$(CONFIG_MMC_SDHCI_PCI)    += sdhci-pci.o
 obj-$(CONFIG_MMC_RICOH_MMC)    += ricoh_mmc.o
index 1bcbdd6..2909bbc 100644 (file)
@@ -430,6 +430,8 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                                clk = 255;
                        host->cclk = host->mclk / (2 * (clk + 1));
                }
+               if (host->hw_designer == 0x80)
+                       clk |= MCI_FCEN; /* Bug fix in ST IP block */
                clk |= MCI_CLK_ENABLE;
        }
 
@@ -440,15 +442,27 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        case MMC_POWER_OFF:
                break;
        case MMC_POWER_UP:
-               pwr |= MCI_PWR_UP;
-               break;
+               /* The ST version does not have this, fall through to POWER_ON */
+               if (host->hw_designer != 0x80) {
+                       pwr |= MCI_PWR_UP;
+                       break;
+               }
        case MMC_POWER_ON:
                pwr |= MCI_PWR_ON;
                break;
        }
 
-       if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
-               pwr |= MCI_ROD;
+       if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) {
+               if (host->hw_designer != 0x80)
+                       pwr |= MCI_ROD;
+               else {
+                       /*
+                        * The ST Micro variant use the ROD bit for something
+                        * else and only has OD (Open Drain).
+                        */
+                       pwr |= MCI_OD;
+               }
+       }
 
        writel(clk, host->base + MMCICLOCK);
 
@@ -500,6 +514,12 @@ static int mmci_probe(struct amba_device *dev, void *id)
        }
 
        host = mmc_priv(mmc);
+       /* Bits 12 thru 19 is the designer */
+       host->hw_designer = (dev->periphid >> 12) & 0xff;
+       /* Bits 20 thru 23 is the revison */
+       host->hw_revision = (dev->periphid >> 20) & 0xf;
+       DBG(host, "designer ID = 0x%02x\n", host->hw_designer);
+       DBG(host, "revision = 0x%01x\n", host->hw_revision);
        host->clk = clk_get(&dev->dev, NULL);
        if (IS_ERR(host->clk)) {
                ret = PTR_ERR(host->clk);
@@ -693,6 +713,15 @@ static struct amba_id mmci_ids[] = {
                .id     = 0x00041181,
                .mask   = 0x000fffff,
        },
+       /* ST Micro variants */
+       {
+               .id     = 0x00180180,
+               .mask   = 0x00ffffff,
+       },
+       {
+               .id     = 0x00280180,
+               .mask   = 0x00ffffff,
+       },
        { 0, 0 },
 };
 
index 0f39c49..0441bac 100644 (file)
 #define MCI_PWR_OFF            0x00
 #define MCI_PWR_UP             0x02
 #define MCI_PWR_ON             0x03
+#define MCI_DATA2DIREN         (1 << 2)
+#define MCI_CMDDIREN           (1 << 3)
+#define MCI_DATA0DIREN         (1 << 4)
+#define MCI_DATA31DIREN                (1 << 5)
 #define MCI_OD                 (1 << 6)
 #define MCI_ROD                        (1 << 7)
+/* The ST Micro version does not have ROD */
+#define MCI_FBCLKEN            (1 << 7)
+#define MCI_DATA74DIREN                (1 << 8)
 
 #define MMCICLOCK              0x004
 #define MCI_CLK_ENABLE         (1 << 8)
 #define MCI_CLK_PWRSAVE                (1 << 9)
 #define MCI_CLK_BYPASS         (1 << 10)
+#define MCI_WIDE_BUS           (1 << 11)
+/* HW flow control on the ST Micro version */
+#define MCI_FCEN               (1 << 13)
 
 #define MMCIARGUMENT           0x008
 #define MMCICOMMAND            0x00c
 #define MCI_CPSM_INTERRUPT     (1 << 8)
 #define MCI_CPSM_PENDING       (1 << 9)
 #define MCI_CPSM_ENABLE                (1 << 10)
+#define MCI_SDIO_SUSP          (1 << 11)
+#define MCI_ENCMD_COMPL                (1 << 12)
+#define MCI_NIEN               (1 << 13)
+#define MCI_CE_ATACMD          (1 << 14)
 
 #define MMCIRESPCMD            0x010
 #define MMCIRESPONSE0          0x014
 #define MCI_DPSM_DIRECTION     (1 << 1)
 #define MCI_DPSM_MODE          (1 << 2)
 #define MCI_DPSM_DMAENABLE     (1 << 3)
+#define MCI_DPSM_BLOCKSIZE     (1 << 4)
+#define MCI_DPSM_RWSTART       (1 << 8)
+#define MCI_DPSM_RWSTOP                (1 << 9)
+#define MCI_DPSM_RWMOD         (1 << 10)
+#define MCI_DPSM_SDIOEN                (1 << 11)
 
 #define MMCIDATACNT            0x030
 #define MMCISTATUS             0x034
@@ -63,6 +82,8 @@
 #define MCI_RXFIFOEMPTY                (1 << 19)
 #define MCI_TXDATAAVLBL                (1 << 20)
 #define MCI_RXDATAAVLBL                (1 << 21)
+#define MCI_SDIOIT             (1 << 22)
+#define MCI_CEATAEND           (1 << 23)
 
 #define MMCICLEAR              0x038
 #define MCI_CMDCRCFAILCLR      (1 << 0)
@@ -75,6 +96,8 @@
 #define MCI_CMDSENTCLR         (1 << 7)
 #define MCI_DATAENDCLR         (1 << 8)
 #define MCI_DATABLOCKENDCLR    (1 << 10)
+#define MCI_SDIOITC            (1 << 22)
+#define MCI_CEATAENDC          (1 << 23)
 
 #define MMCIMASK0              0x03c
 #define MCI_CMDCRCFAILMASK     (1 << 0)
 #define MCI_RXFIFOEMPTYMASK    (1 << 19)
 #define MCI_TXDATAAVLBLMASK    (1 << 20)
 #define MCI_RXDATAAVLBLMASK    (1 << 21)
+#define MCI_SDIOITMASK         (1 << 22)
+#define MCI_CEATAENDMASK       (1 << 23)
 
 #define MMCIMASK1              0x040
 #define MMCIFIFOCNT            0x048
@@ -136,6 +161,9 @@ struct mmci_host {
        u32                     pwr;
        struct mmc_platform_data *plat;
 
+       u8                      hw_designer;
+       u8                      hw_revision:4;
+
        struct timer_list       timer;
        unsigned int            oldstat;
 
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
new file mode 100644 (file)
index 0000000..dda0be4
--- /dev/null
@@ -0,0 +1,880 @@
+/*
+ *  linux/drivers/mmc/host/mxcmmc.c - Freescale i.MX MMCI driver
+ *
+ *  This is a driver for the SDHC controller found in Freescale MX2/MX3
+ *  SoCs. It is basically the same hardware as found on MX1 (imxmmc.c).
+ *  Unlike the hardware found on MX1, this hardware just works and does
+ *  not need all the quirks found in imxmmc.c, hence the seperate driver.
+ *
+ *  Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
+ *  Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
+ *
+ *  derived from pxamci.c by Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/blkdev.h>
+#include <linux/dma-mapping.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/card.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/gpio.h>
+
+#include <asm/dma.h>
+#include <asm/irq.h>
+#include <asm/sizes.h>
+#include <mach/mmc.h>
+
+#ifdef CONFIG_ARCH_MX2
+#include <mach/dma-mx1-mx2.h>
+#define HAS_DMA
+#endif
+
+#define DRIVER_NAME "imx-mmc"
+
+#define MMC_REG_STR_STP_CLK            0x00
+#define MMC_REG_STATUS                 0x04
+#define MMC_REG_CLK_RATE               0x08
+#define MMC_REG_CMD_DAT_CONT           0x0C
+#define MMC_REG_RES_TO                 0x10
+#define MMC_REG_READ_TO                        0x14
+#define MMC_REG_BLK_LEN                        0x18
+#define MMC_REG_NOB                    0x1C
+#define MMC_REG_REV_NO                 0x20
+#define MMC_REG_INT_CNTR               0x24
+#define MMC_REG_CMD                    0x28
+#define MMC_REG_ARG                    0x2C
+#define MMC_REG_RES_FIFO               0x34
+#define MMC_REG_BUFFER_ACCESS          0x38
+
+#define STR_STP_CLK_RESET               (1 << 3)
+#define STR_STP_CLK_START_CLK           (1 << 1)
+#define STR_STP_CLK_STOP_CLK            (1 << 0)
+
+#define STATUS_CARD_INSERTION          (1 << 31)
+#define STATUS_CARD_REMOVAL            (1 << 30)
+#define STATUS_YBUF_EMPTY              (1 << 29)
+#define STATUS_XBUF_EMPTY              (1 << 28)
+#define STATUS_YBUF_FULL               (1 << 27)
+#define STATUS_XBUF_FULL               (1 << 26)
+#define STATUS_BUF_UND_RUN             (1 << 25)
+#define STATUS_BUF_OVFL                        (1 << 24)
+#define STATUS_SDIO_INT_ACTIVE         (1 << 14)
+#define STATUS_END_CMD_RESP            (1 << 13)
+#define STATUS_WRITE_OP_DONE           (1 << 12)
+#define STATUS_DATA_TRANS_DONE         (1 << 11)
+#define STATUS_READ_OP_DONE            (1 << 11)
+#define STATUS_WR_CRC_ERROR_CODE_MASK  (3 << 10)
+#define STATUS_CARD_BUS_CLK_RUN                (1 << 8)
+#define STATUS_BUF_READ_RDY            (1 << 7)
+#define STATUS_BUF_WRITE_RDY           (1 << 6)
+#define STATUS_RESP_CRC_ERR            (1 << 5)
+#define STATUS_CRC_READ_ERR            (1 << 3)
+#define STATUS_CRC_WRITE_ERR           (1 << 2)
+#define STATUS_TIME_OUT_RESP           (1 << 1)
+#define STATUS_TIME_OUT_READ           (1 << 0)
+#define STATUS_ERR_MASK                        0x2f
+
+#define CMD_DAT_CONT_CMD_RESP_LONG_OFF (1 << 12)
+#define CMD_DAT_CONT_STOP_READWAIT     (1 << 11)
+#define CMD_DAT_CONT_START_READWAIT    (1 << 10)
+#define CMD_DAT_CONT_BUS_WIDTH_4       (2 << 8)
+#define CMD_DAT_CONT_INIT              (1 << 7)
+#define CMD_DAT_CONT_WRITE             (1 << 4)
+#define CMD_DAT_CONT_DATA_ENABLE       (1 << 3)
+#define CMD_DAT_CONT_RESPONSE_48BIT_CRC        (1 << 0)
+#define CMD_DAT_CONT_RESPONSE_136BIT   (2 << 0)
+#define CMD_DAT_CONT_RESPONSE_48BIT    (3 << 0)
+
+#define INT_SDIO_INT_WKP_EN            (1 << 18)
+#define INT_CARD_INSERTION_WKP_EN      (1 << 17)
+#define INT_CARD_REMOVAL_WKP_EN                (1 << 16)
+#define INT_CARD_INSERTION_EN          (1 << 15)
+#define INT_CARD_REMOVAL_EN            (1 << 14)
+#define INT_SDIO_IRQ_EN                        (1 << 13)
+#define INT_DAT0_EN                    (1 << 12)
+#define INT_BUF_READ_EN                        (1 << 4)
+#define INT_BUF_WRITE_EN               (1 << 3)
+#define INT_END_CMD_RES_EN             (1 << 2)
+#define INT_WRITE_OP_DONE_EN           (1 << 1)
+#define INT_READ_OP_EN                 (1 << 0)
+
+struct mxcmci_host {
+       struct mmc_host         *mmc;
+       struct resource         *res;
+       void __iomem            *base;
+       int                     irq;
+       int                     detect_irq;
+       int                     dma;
+       int                     do_dma;
+       unsigned int            power_mode;
+       struct imxmmc_platform_data *pdata;
+
+       struct mmc_request      *req;
+       struct mmc_command      *cmd;
+       struct mmc_data         *data;
+
+       unsigned int            dma_nents;
+       unsigned int            datasize;
+       unsigned int            dma_dir;
+
+       u16                     rev_no;
+       unsigned int            cmdat;
+
+       struct clk              *clk;
+
+       int                     clock;
+
+       struct work_struct      datawork;
+};
+
+static inline int mxcmci_use_dma(struct mxcmci_host *host)
+{
+       return host->do_dma;
+}
+
+static void mxcmci_softreset(struct mxcmci_host *host)
+{
+       int i;
+
+       /* reset sequence */
+       writew(STR_STP_CLK_RESET, host->base + MMC_REG_STR_STP_CLK);
+       writew(STR_STP_CLK_RESET | STR_STP_CLK_START_CLK,
+                       host->base + MMC_REG_STR_STP_CLK);
+
+       for (i = 0; i < 8; i++)
+               writew(STR_STP_CLK_START_CLK, host->base + MMC_REG_STR_STP_CLK);
+
+       writew(0xff, host->base + MMC_REG_RES_TO);
+}
+
+static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
+{
+       unsigned int nob = data->blocks;
+       unsigned int blksz = data->blksz;
+       unsigned int datasize = nob * blksz;
+#ifdef HAS_DMA
+       struct scatterlist *sg;
+       int i;
+#endif
+       if (data->flags & MMC_DATA_STREAM)
+               nob = 0xffff;
+
+       host->data = data;
+       data->bytes_xfered = 0;
+
+       writew(nob, host->base + MMC_REG_NOB);
+       writew(blksz, host->base + MMC_REG_BLK_LEN);
+       host->datasize = datasize;
+
+#ifdef HAS_DMA
+       for_each_sg(data->sg, sg, data->sg_len, i) {
+               if (sg->offset & 3 || sg->length & 3) {
+                       host->do_dma = 0;
+                       return;
+               }
+       }
+
+       if (data->flags & MMC_DATA_READ) {
+               host->dma_dir = DMA_FROM_DEVICE;
+               host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
+                                            data->sg_len,  host->dma_dir);
+
+               imx_dma_setup_sg(host->dma, data->sg, host->dma_nents, datasize,
+                                host->res->start + MMC_REG_BUFFER_ACCESS,
+                                DMA_MODE_READ);
+       } else {
+               host->dma_dir = DMA_TO_DEVICE;
+               host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
+                                            data->sg_len,  host->dma_dir);
+
+               imx_dma_setup_sg(host->dma, data->sg, host->dma_nents, datasize,
+                                host->res->start + MMC_REG_BUFFER_ACCESS,
+                                DMA_MODE_WRITE);
+       }
+
+       wmb();
+
+       imx_dma_enable(host->dma);
+#endif /* HAS_DMA */
+}
+
+static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
+               unsigned int cmdat)
+{
+       WARN_ON(host->cmd != NULL);
+       host->cmd = cmd;
+
+       switch (mmc_resp_type(cmd)) {
+       case MMC_RSP_R1: /* short CRC, OPCODE */
+       case MMC_RSP_R1B:/* short CRC, OPCODE, BUSY */
+               cmdat |= CMD_DAT_CONT_RESPONSE_48BIT_CRC;
+               break;
+       case MMC_RSP_R2: /* long 136 bit + CRC */
+               cmdat |= CMD_DAT_CONT_RESPONSE_136BIT;
+               break;
+       case MMC_RSP_R3: /* short */
+               cmdat |= CMD_DAT_CONT_RESPONSE_48BIT;
+               break;
+       case MMC_RSP_NONE:
+               break;
+       default:
+               dev_err(mmc_dev(host->mmc), "unhandled response type 0x%x\n",
+                               mmc_resp_type(cmd));
+               cmd->error = -EINVAL;
+               return -EINVAL;
+       }
+
+       if (mxcmci_use_dma(host))
+               writel(INT_READ_OP_EN | INT_WRITE_OP_DONE_EN |
+                               INT_END_CMD_RES_EN,
+                               host->base + MMC_REG_INT_CNTR);
+       else
+               writel(INT_END_CMD_RES_EN, host->base + MMC_REG_INT_CNTR);
+
+       writew(cmd->opcode, host->base + MMC_REG_CMD);
+       writel(cmd->arg, host->base + MMC_REG_ARG);
+       writew(cmdat, host->base + MMC_REG_CMD_DAT_CONT);
+
+       return 0;
+}
+
+static void mxcmci_finish_request(struct mxcmci_host *host,
+               struct mmc_request *req)
+{
+       writel(0, host->base + MMC_REG_INT_CNTR);
+
+       host->req = NULL;
+       host->cmd = NULL;
+       host->data = NULL;
+
+       mmc_request_done(host->mmc, req);
+}
+
+static int mxcmci_finish_data(struct mxcmci_host *host, unsigned int stat)
+{
+       struct mmc_data *data = host->data;
+       int data_error;
+
+#ifdef HAS_DMA
+       if (mxcmci_use_dma(host)) {
+               imx_dma_disable(host->dma);
+               dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_nents,
+                               host->dma_dir);
+       }
+#endif
+
+       if (stat & STATUS_ERR_MASK) {
+               dev_dbg(mmc_dev(host->mmc), "request failed. status: 0x%08x\n",
+                               stat);
+               if (stat & STATUS_CRC_READ_ERR) {
+                       data->error = -EILSEQ;
+               } else if (stat & STATUS_CRC_WRITE_ERR) {
+                       u32 err_code = (stat >> 9) & 0x3;
+                       if (err_code == 2) /* No CRC response */
+                               data->error = -ETIMEDOUT;
+                       else
+                               data->error = -EILSEQ;
+               } else if (stat & STATUS_TIME_OUT_READ) {
+                       data->error = -ETIMEDOUT;
+               } else {
+                       data->error = -EIO;
+               }
+       } else {
+               data->bytes_xfered = host->datasize;
+       }
+
+       data_error = data->error;
+
+       host->data = NULL;
+
+       return data_error;
+}
+
+static void mxcmci_read_response(struct mxcmci_host *host, unsigned int stat)
+{
+       struct mmc_command *cmd = host->cmd;
+       int i;
+       u32 a, b, c;
+
+       if (!cmd)
+               return;
+
+       if (stat & STATUS_TIME_OUT_RESP) {
+               dev_dbg(mmc_dev(host->mmc), "CMD TIMEOUT\n");
+               cmd->error = -ETIMEDOUT;
+       } else if (stat & STATUS_RESP_CRC_ERR && cmd->flags & MMC_RSP_CRC) {
+               dev_dbg(mmc_dev(host->mmc), "cmd crc error\n");
+               cmd->error = -EILSEQ;
+       }
+
+       if (cmd->flags & MMC_RSP_PRESENT) {
+               if (cmd->flags & MMC_RSP_136) {
+                       for (i = 0; i < 4; i++) {
+                               a = readw(host->base + MMC_REG_RES_FIFO);
+                               b = readw(host->base + MMC_REG_RES_FIFO);
+                               cmd->resp[i] = a << 16 | b;
+                       }
+               } else {
+                       a = readw(host->base + MMC_REG_RES_FIFO);
+                       b = readw(host->base + MMC_REG_RES_FIFO);
+                       c = readw(host->base + MMC_REG_RES_FIFO);
+                       cmd->resp[0] = a << 24 | b << 8 | c >> 8;
+               }
+       }
+}
+
+static int mxcmci_poll_status(struct mxcmci_host *host, u32 mask)
+{
+       u32 stat;
+       unsigned long timeout = jiffies + HZ;
+
+       do {
+               stat = readl(host->base + MMC_REG_STATUS);
+               if (stat & STATUS_ERR_MASK)
+                       return stat;
+               if (time_after(jiffies, timeout))
+                       return STATUS_TIME_OUT_READ;
+               if (stat & mask)
+                       return 0;
+               cpu_relax();
+       } while (1);
+}
+
+static int mxcmci_pull(struct mxcmci_host *host, void *_buf, int bytes)
+{
+       unsigned int stat;
+       u32 *buf = _buf;
+
+       while (bytes > 3) {
+               stat = mxcmci_poll_status(host,
+                               STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE);
+               if (stat)
+                       return stat;
+               *buf++ = readl(host->base + MMC_REG_BUFFER_ACCESS);
+               bytes -= 4;
+       }
+
+       if (bytes) {
+               u8 *b = (u8 *)buf;
+               u32 tmp;
+
+               stat = mxcmci_poll_status(host,
+                               STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE);
+               if (stat)
+                       return stat;
+               tmp = readl(host->base + MMC_REG_BUFFER_ACCESS);
+               memcpy(b, &tmp, bytes);
+       }
+
+       return 0;
+}
+
+static int mxcmci_push(struct mxcmci_host *host, void *_buf, int bytes)
+{
+       unsigned int stat;
+       u32 *buf = _buf;
+
+       while (bytes > 3) {
+               stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY);
+               if (stat)
+                       return stat;
+               writel(*buf++, host->base + MMC_REG_BUFFER_ACCESS);
+               bytes -= 4;
+       }
+
+       if (bytes) {
+               u8 *b = (u8 *)buf;
+               u32 tmp;
+
+               stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY);
+               if (stat)
+                       return stat;
+
+               memcpy(&tmp, b, bytes);
+               writel(tmp, host->base + MMC_REG_BUFFER_ACCESS);
+       }
+
+       stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY);
+       if (stat)
+               return stat;
+
+       return 0;
+}
+
+static int mxcmci_transfer_data(struct mxcmci_host *host)
+{
+       struct mmc_data *data = host->req->data;
+       struct scatterlist *sg;
+       int stat, i;
+
+       host->datasize = 0;
+
+       host->data = data;
+       host->datasize = 0;
+
+       if (data->flags & MMC_DATA_READ) {
+               for_each_sg(data->sg, sg, data->sg_len, i) {
+                       stat = mxcmci_pull(host, sg_virt(sg), sg->length);
+                       if (stat)
+                               return stat;
+                       host->datasize += sg->length;
+               }
+       } else {
+               for_each_sg(data->sg, sg, data->sg_len, i) {
+                       stat = mxcmci_push(host, sg_virt(sg), sg->length);
+                       if (stat)
+                               return stat;
+                       host->datasize += sg->length;
+               }
+               stat = mxcmci_poll_status(host, STATUS_WRITE_OP_DONE);
+               if (stat)
+                       return stat;
+       }
+       return 0;
+}
+
+static void mxcmci_datawork(struct work_struct *work)
+{
+       struct mxcmci_host *host = container_of(work, struct mxcmci_host,
+                                                 datawork);
+       int datastat = mxcmci_transfer_data(host);
+       mxcmci_finish_data(host, datastat);
+
+       if (host->req->stop) {
+               if (mxcmci_start_cmd(host, host->req->stop, 0)) {
+                       mxcmci_finish_request(host, host->req);
+                       return;
+               }
+       } else {
+               mxcmci_finish_request(host, host->req);
+       }
+}
+
+#ifdef HAS_DMA
+static void mxcmci_data_done(struct mxcmci_host *host, unsigned int stat)
+{
+       struct mmc_data *data = host->data;
+       int data_error;
+
+       if (!data)
+               return;
+
+       data_error = mxcmci_finish_data(host, stat);
+
+       mxcmci_read_response(host, stat);
+       host->cmd = NULL;
+
+       if (host->req->stop) {
+               if (mxcmci_start_cmd(host, host->req->stop, 0)) {
+                       mxcmci_finish_request(host, host->req);
+                       return;
+               }
+       } else {
+               mxcmci_finish_request(host, host->req);
+       }
+}
+#endif /* HAS_DMA */
+
+static void mxcmci_cmd_done(struct mxcmci_host *host, unsigned int stat)
+{
+       mxcmci_read_response(host, stat);
+       host->cmd = NULL;
+
+       if (!host->data && host->req) {
+               mxcmci_finish_request(host, host->req);
+               return;
+       }
+
+       /* For the DMA case the DMA engine handles the data transfer
+        * automatically. For non DMA we have to to it ourselves.
+        * Don't do it in interrupt context though.
+        */
+       if (!mxcmci_use_dma(host) && host->data)
+               schedule_work(&host->datawork);
+
+}
+
+static irqreturn_t mxcmci_irq(int irq, void *devid)
+{
+       struct mxcmci_host *host = devid;
+       u32 stat;
+
+       stat = readl(host->base + MMC_REG_STATUS);
+       writel(stat, host->base + MMC_REG_STATUS);
+
+       dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat);
+
+       if (stat & STATUS_END_CMD_RESP)
+               mxcmci_cmd_done(host, stat);
+#ifdef HAS_DMA
+       if (mxcmci_use_dma(host) &&
+                 (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE)))
+               mxcmci_data_done(host, stat);
+#endif
+       return IRQ_HANDLED;
+}
+
+static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
+{
+       struct mxcmci_host *host = mmc_priv(mmc);
+       unsigned int cmdat = host->cmdat;
+
+       WARN_ON(host->req != NULL);
+
+       host->req = req;
+       host->cmdat &= ~CMD_DAT_CONT_INIT;
+#ifdef HAS_DMA
+       host->do_dma = 1;
+#endif
+       if (req->data) {
+               mxcmci_setup_data(host, req->data);
+
+               cmdat |= CMD_DAT_CONT_DATA_ENABLE;
+
+               if (req->data->flags & MMC_DATA_WRITE)
+                       cmdat |= CMD_DAT_CONT_WRITE;
+       }
+
+       if (mxcmci_start_cmd(host, req->cmd, cmdat))
+               mxcmci_finish_request(host, req);
+}
+
+static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios)
+{
+       unsigned int divider;
+       int prescaler = 0;
+       unsigned int clk_in = clk_get_rate(host->clk);
+
+       while (prescaler <= 0x800) {
+               for (divider = 1; divider <= 0xF; divider++) {
+                       int x;
+
+                       x = (clk_in / (divider + 1));
+
+                       if (prescaler)
+                               x /= (prescaler * 2);
+
+                       if (x <= clk_ios)
+                               break;
+               }
+               if (divider < 0x10)
+                       break;
+
+               if (prescaler == 0)
+                       prescaler = 1;
+               else
+                       prescaler <<= 1;
+       }
+
+       writew((prescaler << 4) | divider, host->base + MMC_REG_CLK_RATE);
+
+       dev_dbg(mmc_dev(host->mmc), "scaler: %d divider: %d in: %d out: %d\n",
+                       prescaler, divider, clk_in, clk_ios);
+}
+
+static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+{
+       struct mxcmci_host *host = mmc_priv(mmc);
+#ifdef HAS_DMA
+       unsigned int blen;
+       /*
+        * use burstlen of 64 in 4 bit mode (--> reg value  0)
+        * use burstlen of 16 in 1 bit mode (--> reg value 16)
+        */
+       if (ios->bus_width == MMC_BUS_WIDTH_4)
+               blen = 0;
+       else
+               blen = 16;
+
+       imx_dma_config_burstlen(host->dma, blen);
+#endif
+       if (ios->bus_width == MMC_BUS_WIDTH_4)
+               host->cmdat |= CMD_DAT_CONT_BUS_WIDTH_4;
+       else
+               host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4;
+
+       if (host->power_mode != ios->power_mode) {
+               if (host->pdata && host->pdata->setpower)
+                       host->pdata->setpower(mmc_dev(mmc), ios->vdd);
+               host->power_mode = ios->power_mode;
+               if (ios->power_mode == MMC_POWER_ON)
+                       host->cmdat |= CMD_DAT_CONT_INIT;
+       }
+
+       if (ios->clock) {
+               mxcmci_set_clk_rate(host, ios->clock);
+               writew(STR_STP_CLK_START_CLK, host->base + MMC_REG_STR_STP_CLK);
+       } else {
+               writew(STR_STP_CLK_STOP_CLK, host->base + MMC_REG_STR_STP_CLK);
+       }
+
+       host->clock = ios->clock;
+}
+
+static irqreturn_t mxcmci_detect_irq(int irq, void *data)
+{
+       struct mmc_host *mmc = data;
+
+       dev_dbg(mmc_dev(mmc), "%s\n", __func__);
+
+       mmc_detect_change(mmc, msecs_to_jiffies(250));
+       return IRQ_HANDLED;
+}
+
+static int mxcmci_get_ro(struct mmc_host *mmc)
+{
+       struct mxcmci_host *host = mmc_priv(mmc);
+
+       if (host->pdata && host->pdata->get_ro)
+               return !!host->pdata->get_ro(mmc_dev(mmc));
+       /*
+        * Board doesn't support read only detection; let the mmc core
+        * decide what to do.
+        */
+       return -ENOSYS;
+}
+
+
+static const struct mmc_host_ops mxcmci_ops = {
+       .request        = mxcmci_request,
+       .set_ios        = mxcmci_set_ios,
+       .get_ro         = mxcmci_get_ro,
+};
+
+static int mxcmci_probe(struct platform_device *pdev)
+{
+       struct mmc_host *mmc;
+       struct mxcmci_host *host = NULL;
+       struct resource *r;
+       int ret = 0, irq;
+
+       printk(KERN_INFO "i.MX SDHC driver\n");
+
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       irq = platform_get_irq(pdev, 0);
+       if (!r || irq < 0)
+               return -EINVAL;
+
+       r = request_mem_region(r->start, resource_size(r), pdev->name);
+       if (!r)
+               return -EBUSY;
+
+       mmc = mmc_alloc_host(sizeof(struct mxcmci_host), &pdev->dev);
+       if (!mmc) {
+               ret = -ENOMEM;
+               goto out_release_mem;
+       }
+
+       mmc->ops = &mxcmci_ops;
+       mmc->caps = MMC_CAP_4_BIT_DATA;
+
+       /* MMC core transfer sizes tunable parameters */
+       mmc->max_hw_segs = 64;
+       mmc->max_phys_segs = 64;
+       mmc->max_blk_size = 2048;
+       mmc->max_blk_count = 65535;
+       mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+       mmc->max_seg_size = mmc->max_seg_size;
+
+       host = mmc_priv(mmc);
+       host->base = ioremap(r->start, resource_size(r));
+       if (!host->base) {
+               ret = -ENOMEM;
+               goto out_free;
+       }
+
+       host->mmc = mmc;
+       host->pdata = pdev->dev.platform_data;
+
+       if (host->pdata && host->pdata->ocr_avail)
+               mmc->ocr_avail = host->pdata->ocr_avail;
+       else
+               mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+
+       host->res = r;
+       host->irq = irq;
+
+       host->clk = clk_get(&pdev->dev, "sdhc_clk");
+       if (IS_ERR(host->clk)) {
+               ret = PTR_ERR(host->clk);
+               goto out_iounmap;
+       }
+       clk_enable(host->clk);
+
+       mxcmci_softreset(host);
+
+       host->rev_no = readw(host->base + MMC_REG_REV_NO);
+       if (host->rev_no != 0x400) {
+               ret = -ENODEV;
+               dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n",
+                       host->rev_no);
+               goto out_clk_put;
+       }
+
+       mmc->f_min = clk_get_rate(host->clk) >> 7;
+       mmc->f_max = clk_get_rate(host->clk) >> 1;
+
+       /* recommended in data sheet */
+       writew(0x2db4, host->base + MMC_REG_READ_TO);
+
+       writel(0, host->base + MMC_REG_INT_CNTR);
+
+#ifdef HAS_DMA
+       host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW);
+       if (host->dma < 0) {
+               dev_err(mmc_dev(host->mmc), "imx_dma_request_by_prio failed\n");
+               ret = -EBUSY;
+               goto out_clk_put;
+       }
+
+       r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
+       if (!r) {
+               ret = -EINVAL;
+               goto out_free_dma;
+       }
+
+       ret = imx_dma_config_channel(host->dma,
+                                    IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_FIFO,
+                                    IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
+                                    r->start, 0);
+       if (ret) {
+               dev_err(mmc_dev(host->mmc), "failed to config DMA channel\n");
+               goto out_free_dma;
+       }
+#endif
+       INIT_WORK(&host->datawork, mxcmci_datawork);
+
+       ret = request_irq(host->irq, mxcmci_irq, 0, DRIVER_NAME, host);
+       if (ret)
+               goto out_free_dma;
+
+       platform_set_drvdata(pdev, mmc);
+
+       if (host->pdata && host->pdata->init) {
+               ret = host->pdata->init(&pdev->dev, mxcmci_detect_irq,
+                               host->mmc);
+               if (ret)
+                       goto out_free_irq;
+       }
+
+       mmc_add_host(mmc);
+
+       return 0;
+
+out_free_irq:
+       free_irq(host->irq, host);
+out_free_dma:
+#ifdef HAS_DMA
+       imx_dma_free(host->dma);
+#endif
+out_clk_put:
+       clk_disable(host->clk);
+       clk_put(host->clk);
+out_iounmap:
+       iounmap(host->base);
+out_free:
+       mmc_free_host(mmc);
+out_release_mem:
+       release_mem_region(host->res->start, resource_size(host->res));
+       return ret;
+}
+
+static int mxcmci_remove(struct platform_device *pdev)
+{
+       struct mmc_host *mmc = platform_get_drvdata(pdev);
+       struct mxcmci_host *host = mmc_priv(mmc);
+
+       platform_set_drvdata(pdev, NULL);
+
+       mmc_remove_host(mmc);
+
+       if (host->pdata && host->pdata->exit)
+               host->pdata->exit(&pdev->dev, mmc);
+
+       free_irq(host->irq, host);
+       iounmap(host->base);
+#ifdef HAS_DMA
+       imx_dma_free(host->dma);
+#endif
+       clk_disable(host->clk);
+       clk_put(host->clk);
+
+       release_mem_region(host->res->start, resource_size(host->res));
+       release_resource(host->res);
+
+       mmc_free_host(mmc);
+
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int mxcmci_suspend(struct platform_device *dev, pm_message_t state)
+{
+       struct mmc_host *mmc = platform_get_drvdata(dev);
+       int ret = 0;
+
+       if (mmc)
+               ret = mmc_suspend_host(mmc, state);
+
+       return ret;
+}
+
+static int mxcmci_resume(struct platform_device *dev)
+{
+       struct mmc_host *mmc = platform_get_drvdata(dev);
+       struct mxcmci_host *host;
+       int ret = 0;
+
+       if (mmc) {
+               host = mmc_priv(mmc);
+               ret = mmc_resume_host(mmc);
+       }
+
+       return ret;
+}
+#else
+#define mxcmci_suspend  NULL
+#define mxcmci_resume   NULL
+#endif /* CONFIG_PM */
+
+static struct platform_driver mxcmci_driver = {
+       .probe          = mxcmci_probe,
+       .remove         = mxcmci_remove,
+       .suspend        = mxcmci_suspend,
+       .resume         = mxcmci_resume,
+       .driver         = {
+               .name           = DRIVER_NAME,
+               .owner          = THIS_MODULE,
+       }
+};
+
+static int __init mxcmci_init(void)
+{
+       return platform_driver_register(&mxcmci_driver);
+}
+
+static void __exit mxcmci_exit(void)
+{
+       platform_driver_unregister(&mxcmci_driver);
+}
+
+module_init(mxcmci_init);
+module_exit(mxcmci_exit);
+
+MODULE_DESCRIPTION("i.MX Multimedia Card Interface Driver");
+MODULE_AUTHOR("Sascha Hauer, Pengutronix");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:imx-mmc");
index 3c5483b..9702ad3 100644 (file)
@@ -180,7 +180,15 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
        else
                DALGN &= ~(1 << host->dma);
        DDADR(host->dma) = host->sg_dma;
-       DCSR(host->dma) = DCSR_RUN;
+
+       /*
+        * workaround for erratum #91:
+        * only start DMA now if we are doing a read,
+        * otherwise we wait until CMD/RESP has finished
+        * before starting DMA.
+        */
+       if (!cpu_is_pxa27x() || data->flags & MMC_DATA_READ)
+               DCSR(host->dma) = DCSR_RUN;
 }
 
 static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, unsigned int cmdat)
@@ -251,23 +259,28 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
        if (stat & STAT_TIME_OUT_RESPONSE) {
                cmd->error = -ETIMEDOUT;
        } else if (stat & STAT_RES_CRC_ERR && cmd->flags & MMC_RSP_CRC) {
-#ifdef CONFIG_PXA27x
                /*
                 * workaround for erratum #42:
                 * Intel PXA27x Family Processor Specification Update Rev 001
                 * A bogus CRC error can appear if the msb of a 136 bit
                 * response is a one.
                 */
-               if (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000) {
+               if (cpu_is_pxa27x() &&
+                   (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000))
                        pr_debug("ignoring CRC from command %d - *risky*\n", cmd->opcode);
-               } else
-#endif
-               cmd->error = -EILSEQ;
+               else
+                       cmd->error = -EILSEQ;
        }
 
        pxamci_disable_irq(host, END_CMD_RES);
        if (host->data && !cmd->error) {
                pxamci_enable_irq(host, DATA_TRAN_DONE);
+               /*
+                * workaround for erratum #91, if doing write
+                * enable DMA late
+                */
+               if (cpu_is_pxa27x() && host->data->flags & MMC_DATA_WRITE)
+                       DCSR(host->dma) = DCSR_RUN;
        } else {
                pxamci_finish_request(host, host->mrq);
        }
index be9e7b3..f627905 100644 (file)
@@ -196,7 +196,7 @@ static void __devexit ricoh_mmc_remove(struct pci_dev *pdev)
        pci_set_drvdata(pdev, NULL);
 }
 
-static int ricoh_mmc_suspend(struct pci_dev *pdev, pm_message_t state)
+static int ricoh_mmc_suspend_late(struct pci_dev *pdev, pm_message_t state)
 {
        struct pci_dev *fw_dev = NULL;
 
@@ -210,7 +210,7 @@ static int ricoh_mmc_suspend(struct pci_dev *pdev, pm_message_t state)
        return 0;
 }
 
-static int ricoh_mmc_resume(struct pci_dev *pdev)
+static int ricoh_mmc_resume_early(struct pci_dev *pdev)
 {
        struct pci_dev *fw_dev = NULL;
 
@@ -229,8 +229,8 @@ static struct pci_driver ricoh_mmc_driver = {
        .id_table =     pci_ids,
        .probe =        ricoh_mmc_probe,
        .remove =       __devexit_p(ricoh_mmc_remove),
-       .suspend =      ricoh_mmc_suspend,
-       .resume =       ricoh_mmc_resume,
+       .suspend_late = ricoh_mmc_suspend_late,
+       .resume_early = ricoh_mmc_resume_early,
 };
 
 /*****************************************************************************\
index 8b12e6e..2ff8879 100644 (file)
@@ -273,7 +273,7 @@ config MTD_NAND_CAFE
 
 config MTD_NAND_CS553X
        tristate "NAND support for CS5535/CS5536 (AMD Geode companion chip)"
-       depends on X86_32 && (X86_PC || X86_GENERICARCH)
+       depends on X86_32
        help
          The CS553x companion chips for the AMD Geode processor
          include NAND flash controllers with built-in hardware ECC
index f5e2e72..13ca73f 100644 (file)
@@ -699,11 +699,18 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
 
        /* SGMII link check is done through the PCS register. */
        if ((hw->phy.media_type != e1000_media_type_copper) ||
-           (igb_sgmii_active_82575(hw)))
+           (igb_sgmii_active_82575(hw))) {
                ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed,
                                                             &duplex);
-       else
+               /*
+                * Use this flag to determine if link needs to be checked or
+                * not.  If  we have link clear the flag so that we do not
+                * continue to check for link.
+                */
+               hw->mac.get_link_status = !hw->mac.serdes_has_link;
+       } else {
                ret_val = igb_check_for_copper_link(hw);
+       }
 
        return ret_val;
 }
index 5a27825..aebef8e 100644 (file)
@@ -300,11 +300,10 @@ struct igb_adapter {
 
 #define IGB_FLAG_HAS_MSI           (1 << 0)
 #define IGB_FLAG_MSI_ENABLE        (1 << 1)
-#define IGB_FLAG_HAS_DCA           (1 << 2)
-#define IGB_FLAG_DCA_ENABLED       (1 << 3)
-#define IGB_FLAG_IN_NETPOLL        (1 << 5)
-#define IGB_FLAG_QUAD_PORT_A       (1 << 6)
-#define IGB_FLAG_NEED_CTX_IDX      (1 << 7)
+#define IGB_FLAG_DCA_ENABLED       (1 << 2)
+#define IGB_FLAG_IN_NETPOLL        (1 << 3)
+#define IGB_FLAG_QUAD_PORT_A       (1 << 4)
+#define IGB_FLAG_NEED_CTX_IDX      (1 << 5)
 
 enum e1000_state_t {
        __IGB_TESTING,
index b82b0fb..a50db53 100644 (file)
@@ -206,10 +206,11 @@ static int __init igb_init_module(void)
 
        global_quad_port_a = 0;
 
-       ret = pci_register_driver(&igb_driver);
 #ifdef CONFIG_IGB_DCA
        dca_register_notify(&dca_notifier);
 #endif
+
+       ret = pci_register_driver(&igb_driver);
        return ret;
 }
 
@@ -1156,11 +1157,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 
        /* set flags */
        switch (hw->mac.type) {
-       case e1000_82576:
        case e1000_82575:
-               adapter->flags |= IGB_FLAG_HAS_DCA;
                adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
                break;
+       case e1000_82576:
        default:
                break;
        }
@@ -1310,8 +1310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
                goto err_register;
 
 #ifdef CONFIG_IGB_DCA
-       if ((adapter->flags & IGB_FLAG_HAS_DCA) &&
-           (dca_add_requester(&pdev->dev) == 0)) {
+       if (dca_add_requester(&pdev->dev) == 0) {
                adapter->flags |= IGB_FLAG_DCA_ENABLED;
                dev_info(&pdev->dev, "DCA enabled\n");
                /* Always use CB2 mode, difference is masked
@@ -1835,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
        rctl |= E1000_RCTL_SECRC;
 
        /*
-        * disable store bad packets, long packet enable, and clear size bits.
+        * disable store bad packets and clear size bits.
         */
-       rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256);
+       rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
 
-       if (adapter->netdev->mtu > ETH_DATA_LEN)
+       /* enable LPE when to prevent packets larger than max_frame_size */
                rctl |= E1000_RCTL_LPE;
 
        /* Setup buffer sizes */
@@ -1865,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
         */
        /* allocations using alloc_page take too long for regular MTU
         * so only enable packet split for jumbo frames */
-       if (rctl & E1000_RCTL_LPE) {
+       if (adapter->netdev->mtu > ETH_DATA_LEN) {
                adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
                srrctl |= adapter->rx_ps_hdr_size <<
                         E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
@@ -3473,19 +3472,16 @@ static int __igb_notify_dca(struct device *dev, void *data)
        struct e1000_hw *hw = &adapter->hw;
        unsigned long event = *(unsigned long *)data;
 
-       if (!(adapter->flags & IGB_FLAG_HAS_DCA))
-               goto out;
-
        switch (event) {
        case DCA_PROVIDER_ADD:
                /* if already enabled, don't do it again */
                if (adapter->flags & IGB_FLAG_DCA_ENABLED)
                        break;
-               adapter->flags |= IGB_FLAG_DCA_ENABLED;
                /* Always use CB2 mode, difference is masked
                 * in the CB driver. */
                wr32(E1000_DCA_CTRL, 2);
                if (dca_add_requester(dev) == 0) {
+                       adapter->flags |= IGB_FLAG_DCA_ENABLED;
                        dev_info(&adapter->pdev->dev, "DCA enabled\n");
                        igb_setup_dca(adapter);
                        break;
@@ -3502,7 +3498,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
                }
                break;
        }
-out:
+
        return 0;
 }
 
index ec23142..335da48 100644 (file)
@@ -2168,7 +2168,7 @@ static void gelic_wl_connected_event(struct gelic_wl_info *wl,
                complete(&wl->assoc_done);
                netif_carrier_on(port_to_netdev(wl_port(wl)));
        } else
-               pr_debug("%s: event %#lx under wpa\n",
+               pr_debug("%s: event %#llx under wpa\n",
                                 __func__, event);
 }
 
index 101c00a..847e9bb 100644 (file)
@@ -676,9 +676,8 @@ static int efx_init_port(struct efx_nic *efx)
        rc = efx->phy_op->init(efx);
        if (rc)
                return rc;
-       efx->phy_op->reconfigure(efx);
-
        mutex_lock(&efx->mac_lock);
+       efx->phy_op->reconfigure(efx);
        rc = falcon_switch_mac(efx);
        mutex_unlock(&efx->mac_lock);
        if (rc)
@@ -686,7 +685,7 @@ static int efx_init_port(struct efx_nic *efx)
        efx->mac_op->reconfigure(efx);
 
        efx->port_initialized = true;
-       efx->stats_enabled = true;
+       efx_stats_enable(efx);
        return 0;
 
 fail:
@@ -735,6 +734,7 @@ static void efx_fini_port(struct efx_nic *efx)
        if (!efx->port_initialized)
                return;
 
+       efx_stats_disable(efx);
        efx->phy_op->fini(efx);
        efx->port_initialized = false;
 
@@ -1368,6 +1368,20 @@ static int efx_net_stop(struct net_device *net_dev)
        return 0;
 }
 
+void efx_stats_disable(struct efx_nic *efx)
+{
+       spin_lock(&efx->stats_lock);
+       ++efx->stats_disable_count;
+       spin_unlock(&efx->stats_lock);
+}
+
+void efx_stats_enable(struct efx_nic *efx)
+{
+       spin_lock(&efx->stats_lock);
+       --efx->stats_disable_count;
+       spin_unlock(&efx->stats_lock);
+}
+
 /* Context: process, dev_base_lock or RTNL held, non-blocking. */
 static struct net_device_stats *efx_net_stats(struct net_device *net_dev)
 {
@@ -1376,12 +1390,12 @@ static struct net_device_stats *efx_net_stats(struct net_device *net_dev)
        struct net_device_stats *stats = &net_dev->stats;
 
        /* Update stats if possible, but do not wait if another thread
-        * is updating them (or resetting the NIC); slightly stale
-        * stats are acceptable.
+        * is updating them or if MAC stats fetches are temporarily
+        * disabled; slightly stale stats are acceptable.
         */
        if (!spin_trylock(&efx->stats_lock))
                return stats;
-       if (efx->stats_enabled) {
+       if (!efx->stats_disable_count) {
                efx->mac_op->update_stats(efx);
                falcon_update_nic_stats(efx);
        }
@@ -1629,16 +1643,12 @@ static void efx_unregister_netdev(struct efx_nic *efx)
 
 /* Tears down the entire software state and most of the hardware state
  * before reset.  */
-void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd)
+void efx_reset_down(struct efx_nic *efx, enum reset_type method,
+                   struct ethtool_cmd *ecmd)
 {
        EFX_ASSERT_RESET_SERIALISED(efx);
 
-       /* The net_dev->get_stats handler is quite slow, and will fail
-        * if a fetch is pending over reset. Serialise against it. */
-       spin_lock(&efx->stats_lock);
-       efx->stats_enabled = false;
-       spin_unlock(&efx->stats_lock);
-
+       efx_stats_disable(efx);
        efx_stop_all(efx);
        mutex_lock(&efx->mac_lock);
        mutex_lock(&efx->spi_lock);
@@ -1646,6 +1656,8 @@ void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd)
        efx->phy_op->get_settings(efx, ecmd);
 
        efx_fini_channels(efx);
+       if (efx->port_initialized && method != RESET_TYPE_INVISIBLE)
+               efx->phy_op->fini(efx);
 }
 
 /* This function will always ensure that the locks acquired in
@@ -1653,7 +1665,8 @@ void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd)
  * that we were unable to reinitialise the hardware, and the
  * driver should be disabled. If ok is false, then the rx and tx
  * engines are not restarted, pending a RESET_DISABLE. */
-int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok)
+int efx_reset_up(struct efx_nic *efx, enum reset_type method,
+                struct ethtool_cmd *ecmd, bool ok)
 {
        int rc;
 
@@ -1665,6 +1678,15 @@ int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok)
                ok = false;
        }
 
+       if (efx->port_initialized && method != RESET_TYPE_INVISIBLE) {
+               if (ok) {
+                       rc = efx->phy_op->init(efx);
+                       if (rc)
+                               ok = false;
+               } else
+                       efx->port_initialized = false;
+       }
+
        if (ok) {
                efx_init_channels(efx);
 
@@ -1677,7 +1699,7 @@ int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok)
 
        if (ok) {
                efx_start_all(efx);
-               efx->stats_enabled = true;
+               efx_stats_enable(efx);
        }
        return rc;
 }
@@ -1709,7 +1731,7 @@ static int efx_reset(struct efx_nic *efx)
 
        EFX_INFO(efx, "resetting (%d)\n", method);
 
-       efx_reset_down(efx, &ecmd);
+       efx_reset_down(efx, method, &ecmd);
 
        rc = falcon_reset_hw(efx, method);
        if (rc) {
@@ -1728,10 +1750,10 @@ static int efx_reset(struct efx_nic *efx)
 
        /* Leave device stopped if necessary */
        if (method == RESET_TYPE_DISABLE) {
-               efx_reset_up(efx, &ecmd, false);
+               efx_reset_up(efx, method, &ecmd, false);
                rc = -EIO;
        } else {
-               rc = efx_reset_up(efx, &ecmd, true);
+               rc = efx_reset_up(efx, method, &ecmd, true);
        }
 
 out_disable:
@@ -1883,6 +1905,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
        efx->rx_checksum_enabled = true;
        spin_lock_init(&efx->netif_stop_lock);
        spin_lock_init(&efx->stats_lock);
+       efx->stats_disable_count = 1;
        mutex_init(&efx->mac_lock);
        efx->mac_op = &efx_dummy_mac_operations;
        efx->phy_op = &efx_dummy_phy_operations;
index 0dd7a53..55d0f13 100644 (file)
@@ -36,13 +36,16 @@ extern void efx_process_channel_now(struct efx_channel *channel);
 extern void efx_flush_queues(struct efx_nic *efx);
 
 /* Ports */
+extern void efx_stats_disable(struct efx_nic *efx);
+extern void efx_stats_enable(struct efx_nic *efx);
 extern void efx_reconfigure_port(struct efx_nic *efx);
 extern void __efx_reconfigure_port(struct efx_nic *efx);
 
 /* Reset handling */
-extern void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd);
-extern int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd,
-                       bool ok);
+extern void efx_reset_down(struct efx_nic *efx, enum reset_type method,
+                          struct ethtool_cmd *ecmd);
+extern int efx_reset_up(struct efx_nic *efx, enum reset_type method,
+                       struct ethtool_cmd *ecmd, bool ok);
 
 /* Global */
 extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type);
index 53d259e..7b5924c 100644 (file)
@@ -219,9 +219,6 @@ int efx_ethtool_set_settings(struct net_device *net_dev,
        struct efx_nic *efx = netdev_priv(net_dev);
        int rc;
 
-       if (EFX_WORKAROUND_13963(efx) && !ecmd->autoneg)
-               return -EINVAL;
-
        /* Falcon GMAC does not support 1000Mbps HD */
        if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) {
                EFX_LOG(efx, "rejecting unsupported 1000Mbps HD"
index 5b9f2d9..d5378e6 100644 (file)
@@ -824,10 +824,6 @@ static void falcon_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
                            rx_ev_pause_frm ? " [PAUSE]" : "");
        }
 #endif
-
-       if (unlikely(rx_ev_eth_crc_err && EFX_WORKAROUND_10750(efx) &&
-                    efx->phy_type == PHY_TYPE_SFX7101))
-               tenxpress_crc_err(efx);
 }
 
 /* Handle receive events that are not in-order. */
@@ -1887,7 +1883,7 @@ static int falcon_reset_macs(struct efx_nic *efx)
 
        /* MAC stats will fail whilst the TX fifo is draining. Serialise
         * the drain sequence with the statistics fetch */
-       spin_lock(&efx->stats_lock);
+       efx_stats_disable(efx);
 
        falcon_read(efx, &reg, MAC0_CTRL_REG_KER);
        EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1);
@@ -1917,7 +1913,7 @@ static int falcon_reset_macs(struct efx_nic *efx)
                udelay(10);
        }
 
-       spin_unlock(&efx->stats_lock);
+       efx_stats_enable(efx);
 
        /* If we've reset the EM block and the link is up, then
         * we'll have to kick the XAUI link so the PHY can recover */
@@ -2277,6 +2273,10 @@ int falcon_switch_mac(struct efx_nic *efx)
        struct efx_mac_operations *old_mac_op = efx->mac_op;
        efx_oword_t nic_stat;
        unsigned strap_val;
+       int rc = 0;
+
+       /* Don't try to fetch MAC stats while we're switching MACs */
+       efx_stats_disable(efx);
 
        /* Internal loopbacks override the phy speed setting */
        if (efx->loopback_mode == LOOPBACK_GMAC) {
@@ -2287,16 +2287,12 @@ int falcon_switch_mac(struct efx_nic *efx)
                efx->link_fd = true;
        }
 
+       WARN_ON(!mutex_is_locked(&efx->mac_lock));
        efx->mac_op = (EFX_IS10G(efx) ?
                       &falcon_xmac_operations : &falcon_gmac_operations);
-       if (old_mac_op == efx->mac_op)
-               return 0;
-
-       WARN_ON(!mutex_is_locked(&efx->mac_lock));
-
-       /* Not all macs support a mac-level link state */
-       efx->mac_up = true;
 
+       /* Always push the NIC_STAT_REG setting even if the mac hasn't
+        * changed, because this function is run post online reset */
        falcon_read(efx, &nic_stat, NIC_STAT_REG);
        strap_val = EFX_IS10G(efx) ? 5 : 3;
        if (falcon_rev(efx) >= FALCON_REV_B0) {
@@ -2309,9 +2305,17 @@ int falcon_switch_mac(struct efx_nic *efx)
                BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val);
        }
 
+       if (old_mac_op == efx->mac_op)
+               goto out;
 
        EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G');
-       return falcon_reset_macs(efx);
+       /* Not all macs support a mac-level link state */
+       efx->mac_up = true;
+
+       rc = falcon_reset_macs(efx);
+out:
+       efx_stats_enable(efx);
+       return rc;
 }
 
 /* This call is responsible for hooking in the MAC and PHY operations */
index f6a1642..f9e2f95 100644 (file)
@@ -15,6 +15,7 @@
 #include "net_driver.h"
 #include "mdio_10g.h"
 #include "boards.h"
+#include "workarounds.h"
 
 int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd,
                            int spins, int spintime)
@@ -179,17 +180,12 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask)
                return false;
        else if (efx_phy_mode_disabled(efx->phy_mode))
                return false;
-       else if (efx->loopback_mode == LOOPBACK_PHYXS) {
+       else if (efx->loopback_mode == LOOPBACK_PHYXS)
                mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS |
                              MDIO_MMDREG_DEVS_PCS |
                              MDIO_MMDREG_DEVS_PMAPMD |
                              MDIO_MMDREG_DEVS_AN);
-               if (!mmd_mask) {
-                       reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS,
-                                                MDIO_PHYXS_STATUS2);
-                       return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN));
-               }
-       } else if (efx->loopback_mode == LOOPBACK_PCS)
+       else if (efx->loopback_mode == LOOPBACK_PCS)
                mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS |
                              MDIO_MMDREG_DEVS_PMAPMD |
                              MDIO_MMDREG_DEVS_AN);
@@ -197,6 +193,13 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask)
                mmd_mask &= ~(MDIO_MMDREG_DEVS_PMAPMD |
                              MDIO_MMDREG_DEVS_AN);
 
+       if (!mmd_mask) {
+               /* Use presence of XGMII faults in leui of link state */
+               reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS,
+                                        MDIO_PHYXS_STATUS2);
+               return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN));
+       }
+
        while (mmd_mask) {
                if (mmd_mask & 1) {
                        /* Double reads because link state is latched, and a
@@ -263,7 +266,7 @@ void mdio_clause45_set_mmds_lpower(struct efx_nic *efx,
        }
 }
 
-static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr, u32 xnp)
+static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr)
 {
        int phy_id = efx->mii.phy_id;
        u32 result = 0;
@@ -278,9 +281,6 @@ static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr, u32 xnp)
                result |= ADVERTISED_100baseT_Half;
        if (reg & ADVERTISE_100FULL)
                result |= ADVERTISED_100baseT_Full;
-       if (reg & LPA_RESV)
-               result |= xnp;
-
        return result;
 }
 
@@ -310,7 +310,7 @@ void mdio_clause45_get_settings(struct efx_nic *efx,
  */
 void mdio_clause45_get_settings_ext(struct efx_nic *efx,
                                    struct ethtool_cmd *ecmd,
-                                   u32 xnp, u32 xnp_lpa)
+                                   u32 npage_adv, u32 npage_lpa)
 {
        int phy_id = efx->mii.phy_id;
        int reg;
@@ -361,8 +361,8 @@ void mdio_clause45_get_settings_ext(struct efx_nic *efx,
                        ecmd->autoneg = AUTONEG_ENABLE;
                        ecmd->advertising |=
                                ADVERTISED_Autoneg |
-                               mdio_clause45_get_an(efx,
-                                                    MDIO_AN_ADVERTISE, xnp);
+                               mdio_clause45_get_an(efx, MDIO_AN_ADVERTISE) |
+                               npage_adv;
                } else
                        ecmd->autoneg = AUTONEG_DISABLE;
        } else
@@ -371,27 +371,30 @@ void mdio_clause45_get_settings_ext(struct efx_nic *efx,
        if (ecmd->autoneg) {
                /* If AN is complete, report best common mode,
                 * otherwise report best advertised mode. */
-               u32 common = ecmd->advertising;
+               u32 modes = 0;
                if (mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
                                       MDIO_MMDREG_STAT1) &
-                   (1 << MDIO_AN_STATUS_AN_DONE_LBN)) {
-                       common &= mdio_clause45_get_an(efx, MDIO_AN_LPA,
-                                                      xnp_lpa);
-               }
-               if (common & ADVERTISED_10000baseT_Full) {
+                   (1 << MDIO_AN_STATUS_AN_DONE_LBN))
+                       modes = (ecmd->advertising &
+                                (mdio_clause45_get_an(efx, MDIO_AN_LPA) |
+                                 npage_lpa));
+               if (modes == 0)
+                       modes = ecmd->advertising;
+
+               if (modes & ADVERTISED_10000baseT_Full) {
                        ecmd->speed = SPEED_10000;
                        ecmd->duplex = DUPLEX_FULL;
-               } else if (common & (ADVERTISED_1000baseT_Full |
-                                    ADVERTISED_1000baseT_Half)) {
+               } else if (modes & (ADVERTISED_1000baseT_Full |
+                                   ADVERTISED_1000baseT_Half)) {
                        ecmd->speed = SPEED_1000;
-                       ecmd->duplex = !!(common & ADVERTISED_1000baseT_Full);
-               } else if (common & (ADVERTISED_100baseT_Full |
-                                    ADVERTISED_100baseT_Half)) {
+                       ecmd->duplex = !!(modes & ADVERTISED_1000baseT_Full);
+               } else if (modes & (ADVERTISED_100baseT_Full |
+                                   ADVERTISED_100baseT_Half)) {
                        ecmd->speed = SPEED_100;
-                       ecmd->duplex = !!(common & ADVERTISED_100baseT_Full);
+                       ecmd->duplex = !!(modes & ADVERTISED_100baseT_Full);
                } else {
                        ecmd->speed = SPEED_10;
-                       ecmd->duplex = !!(common & ADVERTISED_10baseT_Full);
+                       ecmd->duplex = !!(modes & ADVERTISED_10baseT_Full);
                }
        } else {
                /* Report forced settings */
@@ -415,7 +418,7 @@ int mdio_clause45_set_settings(struct efx_nic *efx,
        int phy_id = efx->mii.phy_id;
        struct ethtool_cmd prev;
        u32 required;
-       int ctrl1_bits, reg;
+       int reg;
 
        efx->phy_op->get_settings(efx, &prev);
 
@@ -430,99 +433,83 @@ int mdio_clause45_set_settings(struct efx_nic *efx,
        if (prev.port != PORT_TP || ecmd->port != PORT_TP)
                return -EINVAL;
 
-       /* Check that PHY supports these settings and work out the
-        * basic control bits */
-       if (ecmd->duplex) {
+       /* Check that PHY supports these settings */
+       if (ecmd->autoneg) {
+               required = SUPPORTED_Autoneg;
+       } else if (ecmd->duplex) {
                switch (ecmd->speed) {
-               case SPEED_10:
-                       ctrl1_bits = BMCR_FULLDPLX;
-                       required = SUPPORTED_10baseT_Full;
-                       break;
-               case SPEED_100:
-                       ctrl1_bits = BMCR_SPEED100 | BMCR_FULLDPLX;
-                       required = SUPPORTED_100baseT_Full;
-                       break;
-               case SPEED_1000:
-                       ctrl1_bits = BMCR_SPEED1000 | BMCR_FULLDPLX;
-                       required = SUPPORTED_1000baseT_Full;
-                       break;
-               case SPEED_10000:
-                       ctrl1_bits = (BMCR_SPEED1000 | BMCR_SPEED100 |
-                                     BMCR_FULLDPLX);
-                       required = SUPPORTED_10000baseT_Full;
-                       break;
-               default:
-                       return -EINVAL;
+               case SPEED_10:  required = SUPPORTED_10baseT_Full;  break;
+               case SPEED_100: required = SUPPORTED_100baseT_Full; break;
+               default:        return -EINVAL;
                }
        } else {
                switch (ecmd->speed) {
-               case SPEED_10:
-                       ctrl1_bits = 0;
-                       required = SUPPORTED_10baseT_Half;
-                       break;
-               case SPEED_100:
-                       ctrl1_bits = BMCR_SPEED100;
-                       required = SUPPORTED_100baseT_Half;
-                       break;
-               case SPEED_1000:
-                       ctrl1_bits = BMCR_SPEED1000;
-                       required = SUPPORTED_1000baseT_Half;
-                       break;
-               default:
-                       return -EINVAL;
+               case SPEED_10:  required = SUPPORTED_10baseT_Half;  break;
+               case SPEED_100: required = SUPPORTED_100baseT_Half; break;
+               default:        return -EINVAL;
                }
        }
-       if (ecmd->autoneg)
-               required |= SUPPORTED_Autoneg;
        required |= ecmd->advertising;
        if (required & ~prev.supported)
                return -EINVAL;
 
-       /* Set the basic control bits */
-       reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD,
-                                MDIO_MMDREG_CTRL1);
-       reg &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX | 0x003c);
-       reg |= ctrl1_bits;
-       mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD, MDIO_MMDREG_CTRL1,
-                           reg);
-
-       /* Set the AN registers */
-       if (ecmd->autoneg != prev.autoneg ||
-           ecmd->advertising != prev.advertising) {
-               bool xnp = false;
-
-               if (efx->phy_op->set_xnp_advertise)
-                       xnp = efx->phy_op->set_xnp_advertise(efx,
-                                                            ecmd->advertising);
-
-               if (ecmd->autoneg) {
-                       reg = 0;
-                       if (ecmd->advertising & ADVERTISED_10baseT_Half)
-                               reg |= ADVERTISE_10HALF;
-                       if (ecmd->advertising & ADVERTISED_10baseT_Full)
-                               reg |= ADVERTISE_10FULL;
-                       if (ecmd->advertising & ADVERTISED_100baseT_Half)
-                               reg |= ADVERTISE_100HALF;
-                       if (ecmd->advertising & ADVERTISED_100baseT_Full)
-                               reg |= ADVERTISE_100FULL;
-                       if (xnp)
-                               reg |= ADVERTISE_RESV;
-                       mdio_clause45_write(efx, phy_id, MDIO_MMD_AN,
-                                           MDIO_AN_ADVERTISE, reg);
-               }
+       if (ecmd->autoneg) {
+               bool xnp = (ecmd->advertising & ADVERTISED_10000baseT_Full
+                           || EFX_WORKAROUND_13204(efx));
+
+               /* Set up the base page */
+               reg = ADVERTISE_CSMA;
+               if (ecmd->advertising & ADVERTISED_10baseT_Half)
+                       reg |= ADVERTISE_10HALF;
+               if (ecmd->advertising & ADVERTISED_10baseT_Full)
+                       reg |= ADVERTISE_10FULL;
+               if (ecmd->advertising & ADVERTISED_100baseT_Half)
+                       reg |= ADVERTISE_100HALF;
+               if (ecmd->advertising & ADVERTISED_100baseT_Full)
+                       reg |= ADVERTISE_100FULL;
+               if (xnp)
+                       reg |= ADVERTISE_RESV;
+               else if (ecmd->advertising & (ADVERTISED_1000baseT_Half |
+                                             ADVERTISED_1000baseT_Full))
+                       reg |= ADVERTISE_NPAGE;
+               reg |= efx_fc_advertise(efx->wanted_fc);
+               mdio_clause45_write(efx, phy_id, MDIO_MMD_AN,
+                                   MDIO_AN_ADVERTISE, reg);
+
+               /* Set up the (extended) next page if necessary */
+               if (efx->phy_op->set_npage_adv)
+                       efx->phy_op->set_npage_adv(efx, ecmd->advertising);
 
+               /* Enable and restart AN */
                reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
                                         MDIO_MMDREG_CTRL1);
-               if (ecmd->autoneg)
-                       reg |= BMCR_ANENABLE | BMCR_ANRESTART;
-               else
-                       reg &= ~BMCR_ANENABLE;
+               reg |= BMCR_ANENABLE;
+               if (!(EFX_WORKAROUND_15195(efx) &&
+                     LOOPBACK_MASK(efx) & efx->phy_op->loopbacks))
+                       reg |= BMCR_ANRESTART;
                if (xnp)
                        reg |= 1 << MDIO_AN_CTRL_XNP_LBN;
                else
                        reg &= ~(1 << MDIO_AN_CTRL_XNP_LBN);
                mdio_clause45_write(efx, phy_id, MDIO_MMD_AN,
                                    MDIO_MMDREG_CTRL1, reg);
+       } else {
+               /* Disable AN */
+               mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_AN,
+                                      MDIO_MMDREG_CTRL1,
+                                      __ffs(BMCR_ANENABLE), false);
+
+               /* Set the basic control bits */
+               reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD,
+                                        MDIO_MMDREG_CTRL1);
+               reg &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX |
+                        0x003c);
+               if (ecmd->speed == SPEED_100)
+                       reg |= BMCR_SPEED100;
+               if (ecmd->duplex)
+                       reg |= BMCR_FULLDPLX;
+               mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD,
+                                   MDIO_MMDREG_CTRL1, reg);
        }
 
        return 0;
index 09bf801..8ba4977 100644 (file)
 #define MDIO_AN_XNP                    22
 #define MDIO_AN_LPA_XNP                        25
 
-#define MDIO_AN_10GBT_ADVERTISE                32
+#define MDIO_AN_10GBT_CTRL             32
+#define MDIO_AN_10GBT_CTRL_ADV_10G_LBN 12
 #define MDIO_AN_10GBT_STATUS           (33)
 #define MDIO_AN_10GBT_STATUS_MS_FLT_LBN (15) /* MASTER/SLAVE config fault */
 #define MDIO_AN_10GBT_STATUS_MS_LBN     (14) /* MASTER/SLAVE config */
index 5f255f7..e019ad1 100644 (file)
@@ -566,7 +566,7 @@ struct efx_mac_operations {
  * @poll: Poll for hardware state. Serialised by the mac_lock.
  * @get_settings: Get ethtool settings. Serialised by the mac_lock.
  * @set_settings: Set ethtool settings. Serialised by the mac_lock.
- * @set_xnp_advertise: Set abilities advertised in Extended Next Page
+ * @set_npage_adv: Set abilities advertised in (Extended) Next Page
  *     (only needed where AN bit is set in mmds)
  * @num_tests: Number of PHY-specific tests/results
  * @test_names: Names of the tests/results
@@ -586,7 +586,7 @@ struct efx_phy_operations {
                              struct ethtool_cmd *ecmd);
        int (*set_settings) (struct efx_nic *efx,
                             struct ethtool_cmd *ecmd);
-       bool (*set_xnp_advertise) (struct efx_nic *efx, u32);
+       void (*set_npage_adv) (struct efx_nic *efx, u32);
        u32 num_tests;
        const char *const *test_names;
        int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags);
@@ -754,8 +754,7 @@ union efx_multicast_hash {
  *     &struct net_device_stats.
  * @stats_buffer: DMA buffer for statistics
  * @stats_lock: Statistics update lock. Serialises statistics fetches
- * @stats_enabled: Temporarily disable statistics fetches.
- *     Serialised by @stats_lock
+ * @stats_disable_count: Nest count for disabling statistics fetches
  * @mac_op: MAC interface
  * @mac_address: Permanent MAC address
  * @phy_type: PHY type
@@ -837,7 +836,7 @@ struct efx_nic {
        struct efx_mac_stats mac_stats;
        struct efx_buffer stats_buffer;
        spinlock_t stats_lock;
-       bool stats_enabled;
+       unsigned int stats_disable_count;
 
        struct efx_mac_operations *mac_op;
        unsigned char mac_address[ETH_ALEN];
index 58c493e..07e855c 100644 (file)
@@ -17,7 +17,6 @@ extern struct efx_phy_operations falcon_sfx7101_phy_ops;
 extern struct efx_phy_operations falcon_sft9001_phy_ops;
 
 extern void tenxpress_phy_blink(struct efx_nic *efx, bool blink);
-extern void tenxpress_crc_err(struct efx_nic *efx);
 
 /****************************************************************************
  * Exported functions from the driver for XFP optical PHYs
index dba0d64..0a59808 100644 (file)
@@ -665,6 +665,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
 {
        enum efx_loopback_mode loopback_mode = efx->loopback_mode;
        int phy_mode = efx->phy_mode;
+       enum reset_type reset_method = RESET_TYPE_INVISIBLE;
        struct ethtool_cmd ecmd;
        struct efx_channel *channel;
        int rc_test = 0, rc_reset = 0, rc;
@@ -718,21 +719,21 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
        mutex_unlock(&efx->mac_lock);
 
        /* free up all consumers of SRAM (including all the queues) */
-       efx_reset_down(efx, &ecmd);
+       efx_reset_down(efx, reset_method, &ecmd);
 
        rc = efx_test_chip(efx, tests);
        if (rc && !rc_test)
                rc_test = rc;
 
        /* reset the chip to recover from the register test */
-       rc_reset = falcon_reset_hw(efx, RESET_TYPE_ALL);
+       rc_reset = falcon_reset_hw(efx, reset_method);
 
        /* Ensure that the phy is powered and out of loopback
         * for the bist and loopback tests */
        efx->phy_mode &= ~PHY_MODE_LOW_POWER;
        efx->loopback_mode = LOOPBACK_NONE;
 
-       rc = efx_reset_up(efx, &ecmd, rc_reset == 0);
+       rc = efx_reset_up(efx, reset_method, &ecmd, rc_reset == 0);
        if (rc && !rc_reset)
                rc_reset = rc;
 
index 16b80ac..cb25ae5 100644 (file)
@@ -186,19 +186,22 @@ static int sfn4111t_reset(struct efx_nic *efx)
 {
        efx_oword_t reg;
 
-       /* GPIO pins are also used for I2C, so block that temporarily */
+       /* GPIO 3 and the GPIO register are shared with I2C, so block that */
        mutex_lock(&efx->i2c_adap.bus_lock);
 
+       /* Pull RST_N (GPIO 2) low then let it up again, setting the
+        * FLASH_CFG_1 strap (GPIO 3) appropriately.  Only change the
+        * output enables; the output levels should always be 0 (low)
+        * and we rely on external pull-ups. */
        falcon_read(efx, &reg, GPIO_CTL_REG_KER);
        EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, true);
-       EFX_SET_OWORD_FIELD(reg, GPIO2_OUT, false);
        falcon_write(efx, &reg, GPIO_CTL_REG_KER);
        msleep(1000);
-       EFX_SET_OWORD_FIELD(reg, GPIO2_OUT, true);
-       EFX_SET_OWORD_FIELD(reg, GPIO3_OEN, true);
-       EFX_SET_OWORD_FIELD(reg, GPIO3_OUT,
-                           !(efx->phy_mode & PHY_MODE_SPECIAL));
+       EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, false);
+       EFX_SET_OWORD_FIELD(reg, GPIO3_OEN,
+                           !!(efx->phy_mode & PHY_MODE_SPECIAL));
        falcon_write(efx, &reg, GPIO_CTL_REG_KER);
+       msleep(1);
 
        mutex_unlock(&efx->i2c_adap.bus_lock);
 
@@ -232,12 +235,18 @@ static ssize_t set_phy_flash_cfg(struct device *dev,
        } else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) {
                err = -EBUSY;
        } else {
+               /* Reset the PHY, reconfigure the MAC and enable/disable
+                * MAC stats accordingly. */
                efx->phy_mode = new_mode;
+               if (new_mode & PHY_MODE_SPECIAL)
+                       efx_stats_disable(efx);
                if (efx->board_info.type == EFX_BOARD_SFE4001)
                        err = sfe4001_poweron(efx);
                else
                        err = sfn4111t_reset(efx);
                efx_reconfigure_port(efx);
+               if (!(new_mode & PHY_MODE_SPECIAL))
+                       efx_stats_enable(efx);
        }
        rtnl_unlock();
 
@@ -326,6 +335,11 @@ int sfe4001_init(struct efx_nic *efx)
        efx->board_info.monitor = sfe4001_check_hw;
        efx->board_info.fini = sfe4001_fini;
 
+       if (efx->phy_mode & PHY_MODE_SPECIAL) {
+               /* PHY won't generate a 156.25 MHz clock and MAC stats fetch
+                * will fail. */
+               efx_stats_disable(efx);
+       }
        rc = sfe4001_poweron(efx);
        if (rc)
                goto fail_ioexp;
@@ -372,17 +386,25 @@ static void sfn4111t_fini(struct efx_nic *efx)
        i2c_unregister_device(efx->board_info.hwmon_client);
 }
 
-static struct i2c_board_info sfn4111t_hwmon_info = {
+static struct i2c_board_info sfn4111t_a0_hwmon_info = {
        I2C_BOARD_INFO("max6647", 0x4e),
        .irq            = -1,
 };
 
+static struct i2c_board_info sfn4111t_r5_hwmon_info = {
+       I2C_BOARD_INFO("max6646", 0x4d),
+       .irq            = -1,
+};
+
 int sfn4111t_init(struct efx_nic *efx)
 {
        int rc;
 
        efx->board_info.hwmon_client =
-               i2c_new_device(&efx->i2c_adap, &sfn4111t_hwmon_info);
+               i2c_new_device(&efx->i2c_adap,
+                              (efx->board_info.minor < 5) ?
+                              &sfn4111t_a0_hwmon_info :
+                              &sfn4111t_r5_hwmon_info);
        if (!efx->board_info.hwmon_client)
                return -EIO;
 
@@ -394,8 +416,10 @@ int sfn4111t_init(struct efx_nic *efx)
        if (rc)
                goto fail_hwmon;
 
-       if (efx->phy_mode & PHY_MODE_SPECIAL)
+       if (efx->phy_mode & PHY_MODE_SPECIAL) {
+               efx_stats_disable(efx);
                sfn4111t_reset(efx);
+       }
 
        return 0;
 
index 9ecb77d..f0efd24 100644 (file)
@@ -67,6 +67,8 @@
 #define PMA_PMD_EXT_CLK312_WIDTH 1
 #define PMA_PMD_EXT_LPOWER_LBN  12
 #define PMA_PMD_EXT_LPOWER_WIDTH 1
+#define PMA_PMD_EXT_ROBUST_LBN 14
+#define PMA_PMD_EXT_ROBUST_WIDTH 1
 #define PMA_PMD_EXT_SSR_LBN    15
 #define PMA_PMD_EXT_SSR_WIDTH  1
 
 #define C22EXT_STATUS_LINK_LBN  2
 #define C22EXT_STATUS_LINK_WIDTH 1
 
-#define C22EXT_MSTSLV_REG       49162
-#define C22EXT_MSTSLV_1000_HD_LBN 10
-#define C22EXT_MSTSLV_1000_HD_WIDTH 1
-#define C22EXT_MSTSLV_1000_FD_LBN 11
-#define C22EXT_MSTSLV_1000_FD_WIDTH 1
+#define C22EXT_MSTSLV_CTRL                     49161
+#define C22EXT_MSTSLV_CTRL_ADV_1000_HD_LBN     8
+#define C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN     9
+
+#define C22EXT_MSTSLV_STATUS                   49162
+#define C22EXT_MSTSLV_STATUS_LP_1000_HD_LBN    10
+#define C22EXT_MSTSLV_STATUS_LP_1000_FD_LBN    11
 
 /* Time to wait between powering down the LNPGA and turning off the power
  * rails */
 #define LNPGA_PDOWN_WAIT       (HZ / 5)
 
-static int crc_error_reset_threshold = 100;
-module_param(crc_error_reset_threshold, int, 0644);
-MODULE_PARM_DESC(crc_error_reset_threshold,
-                "Max number of CRC errors before XAUI reset");
-
 struct tenxpress_phy_data {
        enum efx_loopback_mode loopback_mode;
-       atomic_t bad_crc_count;
        enum efx_phy_mode phy_mode;
        int bad_lp_tries;
 };
 
-void tenxpress_crc_err(struct efx_nic *efx)
-{
-       struct tenxpress_phy_data *phy_data = efx->phy_data;
-       if (phy_data != NULL)
-               atomic_inc(&phy_data->bad_crc_count);
-}
-
 static ssize_t show_phy_short_reach(struct device *dev,
                                    struct device_attribute *attr, char *buf)
 {
@@ -284,7 +275,9 @@ static int tenxpress_init(struct efx_nic *efx)
                                         PMA_PMD_XCONTROL_REG);
                reg |= ((1 << PMA_PMD_EXT_GMII_EN_LBN) |
                        (1 << PMA_PMD_EXT_CLK_OUT_LBN) |
-                       (1 << PMA_PMD_EXT_CLK312_LBN));
+                       (1 << PMA_PMD_EXT_CLK312_LBN) |
+                       (1 << PMA_PMD_EXT_ROBUST_LBN));
+
                mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD,
                                    PMA_PMD_XCONTROL_REG, reg);
                mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT,
@@ -346,6 +339,7 @@ static int tenxpress_phy_init(struct efx_nic *efx)
        rc = tenxpress_init(efx);
        if (rc < 0)
                goto fail;
+       mdio_clause45_set_pause(efx);
 
        if (efx->phy_type == PHY_TYPE_SFT9001B) {
                rc = device_create_file(&efx->pci_dev->dev,
@@ -376,8 +370,8 @@ static int tenxpress_special_reset(struct efx_nic *efx)
 
        /* The XGMAC clock is driven from the SFC7101/SFT9001 312MHz clock, so
         * a special software reset can glitch the XGMAC sufficiently for stats
-        * requests to fail. Since we don't often special_reset, just lock. */
-       spin_lock(&efx->stats_lock);
+        * requests to fail. */
+       efx_stats_disable(efx);
 
        /* Initiate reset */
        reg = mdio_clause45_read(efx, efx->mii.phy_id,
@@ -392,17 +386,17 @@ static int tenxpress_special_reset(struct efx_nic *efx)
        rc = mdio_clause45_wait_reset_mmds(efx,
                                           TENXPRESS_REQUIRED_DEVS);
        if (rc < 0)
-               goto unlock;
+               goto out;
 
        /* Try and reconfigure the device */
        rc = tenxpress_init(efx);
        if (rc < 0)
-               goto unlock;
+               goto out;
 
        /* Wait for the XGXS state machine to churn */
        mdelay(10);
-unlock:
-       spin_unlock(&efx->stats_lock);
+out:
+       efx_stats_enable(efx);
        return rc;
 }
 
@@ -520,7 +514,7 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)
 {
        struct tenxpress_phy_data *phy_data = efx->phy_data;
        struct ethtool_cmd ecmd;
-       bool phy_mode_change, loop_reset, loop_toggle, loopback;
+       bool phy_mode_change, loop_reset;
 
        if (efx->phy_mode & (PHY_MODE_OFF | PHY_MODE_SPECIAL)) {
                phy_data->phy_mode = efx->phy_mode;
@@ -531,12 +525,10 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)
 
        phy_mode_change = (efx->phy_mode == PHY_MODE_NORMAL &&
                           phy_data->phy_mode != PHY_MODE_NORMAL);
-       loopback = LOOPBACK_MASK(efx) & efx->phy_op->loopbacks;
-       loop_toggle = LOOPBACK_CHANGED(phy_data, efx, efx->phy_op->loopbacks);
        loop_reset = (LOOPBACK_OUT_OF(phy_data, efx, efx->phy_op->loopbacks) ||
                      LOOPBACK_CHANGED(phy_data, efx, 1 << LOOPBACK_GPHY));
 
-       if (loop_reset || loop_toggle || loopback || phy_mode_change) {
+       if (loop_reset || phy_mode_change) {
                int rc;
 
                efx->phy_op->get_settings(efx, &ecmd);
@@ -551,20 +543,6 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)
                                falcon_reset_xaui(efx);
                }
 
-               if (efx->phy_type != PHY_TYPE_SFX7101) {
-                       /* Only change autoneg once, on coming out or
-                        * going into loopback */
-                       if (loop_toggle)
-                               ecmd.autoneg = !loopback;
-                       if (loopback) {
-                               ecmd.duplex = DUPLEX_FULL;
-                               if (efx->loopback_mode == LOOPBACK_GPHY)
-                                       ecmd.speed = SPEED_1000;
-                               else
-                                       ecmd.speed = SPEED_10000;
-                       }
-               }
-
                rc = efx->phy_op->set_settings(efx, &ecmd);
                WARN_ON(rc);
        }
@@ -623,13 +601,6 @@ static void tenxpress_phy_poll(struct efx_nic *efx)
 
        if (phy_data->phy_mode != PHY_MODE_NORMAL)
                return;
-
-       if (EFX_WORKAROUND_10750(efx) &&
-           atomic_read(&phy_data->bad_crc_count) > crc_error_reset_threshold) {
-               EFX_ERR(efx, "Resetting XAUI due to too many CRC errors\n");
-               falcon_reset_xaui(efx);
-               atomic_set(&phy_data->bad_crc_count, 0);
-       }
 }
 
 static void tenxpress_phy_fini(struct efx_nic *efx)
@@ -772,107 +743,76 @@ reset:
        return rc;
 }
 
-static u32 tenxpress_get_xnp_lpa(struct efx_nic *efx)
+static void
+tenxpress_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
 {
-       int phy = efx->mii.phy_id;
-       u32 lpa = 0;
+       int phy_id = efx->mii.phy_id;
+       u32 adv = 0, lpa = 0;
        int reg;
 
        if (efx->phy_type != PHY_TYPE_SFX7101) {
-               reg = mdio_clause45_read(efx, phy, MDIO_MMD_C22EXT,
-                                        C22EXT_MSTSLV_REG);
-               if (reg & (1 << C22EXT_MSTSLV_1000_HD_LBN))
+               reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT,
+                                        C22EXT_MSTSLV_CTRL);
+               if (reg & (1 << C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN))
+                       adv |= ADVERTISED_1000baseT_Full;
+               reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT,
+                                        C22EXT_MSTSLV_STATUS);
+               if (reg & (1 << C22EXT_MSTSLV_STATUS_LP_1000_HD_LBN))
                        lpa |= ADVERTISED_1000baseT_Half;
-               if (reg & (1 << C22EXT_MSTSLV_1000_FD_LBN))
+               if (reg & (1 << C22EXT_MSTSLV_STATUS_LP_1000_FD_LBN))
                        lpa |= ADVERTISED_1000baseT_Full;
        }
-       reg = mdio_clause45_read(efx, phy, MDIO_MMD_AN, MDIO_AN_10GBT_STATUS);
+       reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
+                                MDIO_AN_10GBT_CTRL);
+       if (reg & (1 << MDIO_AN_10GBT_CTRL_ADV_10G_LBN))
+               adv |= ADVERTISED_10000baseT_Full;
+       reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
+                                MDIO_AN_10GBT_STATUS);
        if (reg & (1 << MDIO_AN_10GBT_STATUS_LP_10G_LBN))
                lpa |= ADVERTISED_10000baseT_Full;
-       return lpa;
-}
 
-static void sfx7101_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
-{
-       mdio_clause45_get_settings_ext(efx, ecmd, ADVERTISED_10000baseT_Full,
-                                      tenxpress_get_xnp_lpa(efx));
-       ecmd->supported |= SUPPORTED_10000baseT_Full;
-       ecmd->advertising |= ADVERTISED_10000baseT_Full;
+       mdio_clause45_get_settings_ext(efx, ecmd, adv, lpa);
+
+       if (efx->phy_type != PHY_TYPE_SFX7101)
+               ecmd->supported |= (SUPPORTED_100baseT_Full |
+                                   SUPPORTED_1000baseT_Full);
+
+       /* In loopback, the PHY automatically brings up the correct interface,
+        * but doesn't advertise the correct speed. So override it */
+       if (efx->loopback_mode == LOOPBACK_GPHY)
+               ecmd->speed = SPEED_1000;
+       else if (LOOPBACK_MASK(efx) & efx->phy_op->loopbacks)
+               ecmd->speed = SPEED_10000;
 }
 
-static void sft9001_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
+static int tenxpress_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
 {
-       int phy_id = efx->mii.phy_id;
-       u32 xnp_adv = 0;
-       int reg;
-
-       reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD,
-                                PMA_PMD_SPEED_ENABLE_REG);
-       if (EFX_WORKAROUND_13204(efx) && (reg & (1 << PMA_PMD_100TX_ADV_LBN)))
-               xnp_adv |= ADVERTISED_100baseT_Full;
-       if (reg & (1 << PMA_PMD_1000T_ADV_LBN))
-               xnp_adv |= ADVERTISED_1000baseT_Full;
-       if (reg & (1 << PMA_PMD_10000T_ADV_LBN))
-               xnp_adv |= ADVERTISED_10000baseT_Full;
-
-       mdio_clause45_get_settings_ext(efx, ecmd, xnp_adv,
-                                      tenxpress_get_xnp_lpa(efx));
-
-       ecmd->supported |= (SUPPORTED_100baseT_Half |
-                           SUPPORTED_100baseT_Full |
-                           SUPPORTED_1000baseT_Full);
+       if (!ecmd->autoneg)
+               return -EINVAL;
 
-       /* Use the vendor defined C22ext register for duplex settings */
-       if (ecmd->speed != SPEED_10000 && !ecmd->autoneg) {
-               reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT,
-                                        GPHY_XCONTROL_REG);
-               ecmd->duplex = (reg & (1 << GPHY_DUPLEX_LBN) ?
-                               DUPLEX_FULL : DUPLEX_HALF);
-       }
+       return mdio_clause45_set_settings(efx, ecmd);
 }
 
-static int sft9001_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
+static void sfx7101_set_npage_adv(struct efx_nic *efx, u32 advertising)
 {
-       int phy_id = efx->mii.phy_id;
-       int rc;
-
-       rc = mdio_clause45_set_settings(efx, ecmd);
-       if (rc)
-               return rc;
-
-       if (ecmd->speed != SPEED_10000 && !ecmd->autoneg)
-               mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT,
-                                      GPHY_XCONTROL_REG, GPHY_DUPLEX_LBN,
-                                      ecmd->duplex == DUPLEX_FULL);
-
-       return rc;
+       mdio_clause45_set_flag(efx, efx->mii.phy_id, MDIO_MMD_AN,
+                              MDIO_AN_10GBT_CTRL,
+                              MDIO_AN_10GBT_CTRL_ADV_10G_LBN,
+                              advertising & ADVERTISED_10000baseT_Full);
 }
 
-static bool sft9001_set_xnp_advertise(struct efx_nic *efx, u32 advertising)
+static void sft9001_set_npage_adv(struct efx_nic *efx, u32 advertising)
 {
-       int phy = efx->mii.phy_id;
-       int reg = mdio_clause45_read(efx, phy, MDIO_MMD_PMAPMD,
-                                    PMA_PMD_SPEED_ENABLE_REG);
-       bool enabled;
-
-       reg &= ~((1 << 2) | (1 << 3));
-       if (EFX_WORKAROUND_13204(efx) &&
-           (advertising & ADVERTISED_100baseT_Full))
-               reg |= 1 << PMA_PMD_100TX_ADV_LBN;
-       if (advertising & ADVERTISED_1000baseT_Full)
-               reg |= 1 << PMA_PMD_1000T_ADV_LBN;
-       if (advertising & ADVERTISED_10000baseT_Full)
-               reg |= 1 << PMA_PMD_10000T_ADV_LBN;
-       mdio_clause45_write(efx, phy, MDIO_MMD_PMAPMD,
-                           PMA_PMD_SPEED_ENABLE_REG, reg);
-
-       enabled = (advertising &
-                  (ADVERTISED_1000baseT_Half |
-                   ADVERTISED_1000baseT_Full |
-                   ADVERTISED_10000baseT_Full));
-       if (EFX_WORKAROUND_13204(efx))
-               enabled |= (advertising & ADVERTISED_100baseT_Full);
-       return enabled;
+       int phy_id = efx->mii.phy_id;
+
+       mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT,
+                              C22EXT_MSTSLV_CTRL,
+                              C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN,
+                              advertising & ADVERTISED_1000baseT_Full);
+       mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_AN,
+                              MDIO_AN_10GBT_CTRL,
+                              MDIO_AN_10GBT_CTRL_ADV_10G_LBN,
+                              advertising & ADVERTISED_10000baseT_Full);
 }
 
 struct efx_phy_operations falcon_sfx7101_phy_ops = {
@@ -882,8 +822,9 @@ struct efx_phy_operations falcon_sfx7101_phy_ops = {
        .poll             = tenxpress_phy_poll,
        .fini             = tenxpress_phy_fini,
        .clear_interrupt  = efx_port_dummy_op_void,
-       .get_settings     = sfx7101_get_settings,
-       .set_settings     = mdio_clause45_set_settings,
+       .get_settings     = tenxpress_get_settings,
+       .set_settings     = tenxpress_set_settings,
+       .set_npage_adv    = sfx7101_set_npage_adv,
        .num_tests        = ARRAY_SIZE(sfx7101_test_names),
        .test_names       = sfx7101_test_names,
        .run_tests        = sfx7101_run_tests,
@@ -898,9 +839,9 @@ struct efx_phy_operations falcon_sft9001_phy_ops = {
        .poll             = tenxpress_phy_poll,
        .fini             = tenxpress_phy_fini,
        .clear_interrupt  = efx_port_dummy_op_void,
-       .get_settings     = sft9001_get_settings,
-       .set_settings     = sft9001_set_settings,
-       .set_xnp_advertise = sft9001_set_xnp_advertise,
+       .get_settings     = tenxpress_get_settings,
+       .set_settings     = tenxpress_set_settings,
+       .set_npage_adv    = sft9001_set_npage_adv,
        .num_tests        = ARRAY_SIZE(sft9001_test_names),
        .test_names       = sft9001_test_names,
        .run_tests        = sft9001_run_tests,
index 82e03e1..78de68f 100644 (file)
@@ -18,8 +18,8 @@
 #define EFX_WORKAROUND_ALWAYS(efx) 1
 #define EFX_WORKAROUND_FALCON_A(efx) (falcon_rev(efx) <= FALCON_REV_A1)
 #define EFX_WORKAROUND_10G(efx) EFX_IS10G(efx)
-#define EFX_WORKAROUND_SFX7101(efx) ((efx)->phy_type == PHY_TYPE_SFX7101)
-#define EFX_WORKAROUND_SFT9001A(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A)
+#define EFX_WORKAROUND_SFT9001(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A || \
+                                    (efx)->phy_type == PHY_TYPE_SFT9001B)
 
 /* XAUI resets if link not detected */
 #define EFX_WORKAROUND_5147 EFX_WORKAROUND_ALWAYS
@@ -29,8 +29,6 @@
 #define EFX_WORKAROUND_7884 EFX_WORKAROUND_10G
 /* TX pkt parser problem with <= 16 byte TXes */
 #define EFX_WORKAROUND_9141 EFX_WORKAROUND_ALWAYS
-/* Low rate CRC errors require XAUI reset */
-#define EFX_WORKAROUND_10750 EFX_WORKAROUND_SFX7101
 /* TX_EV_PKT_ERR can be caused by a dangling TX descriptor
  * or a PCIe error (bug 11028) */
 #define EFX_WORKAROUND_10727 EFX_WORKAROUND_ALWAYS
@@ -55,8 +53,8 @@
 #define EFX_WORKAROUND_8071 EFX_WORKAROUND_FALCON_A
 
 /* Need to send XNP pages for 100BaseT */
-#define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001A
-/* Need to keep AN enabled */
-#define EFX_WORKAROUND_13963 EFX_WORKAROUND_SFT9001A
+#define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001
+/* Don't restart AN in near-side loopback */
+#define EFX_WORKAROUND_15195 EFX_WORKAROUND_SFT9001
 
 #endif /* EFX_WORKAROUNDS_H */
index 3668e81..994703c 100644 (file)
@@ -1403,9 +1403,6 @@ static int sky2_up(struct net_device *dev)
 
        }
 
-       if (netif_msg_ifup(sky2))
-               printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
-
        netif_carrier_off(dev);
 
        /* must be power of 2 */
@@ -1484,6 +1481,9 @@ static int sky2_up(struct net_device *dev)
        sky2_write32(hw, B0_IMSK, imask);
 
        sky2_set_multicast(dev);
+
+       if (netif_msg_ifup(sky2))
+               printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
        return 0;
 
 err_out:
index e31fb91..2aa117c 100644 (file)
@@ -5,11 +5,15 @@
 obj-$(CONFIG_HOTPLUG_PCI)              += pci_hotplug.o
 obj-$(CONFIG_HOTPLUG_PCI_COMPAQ)       += cpqphp.o
 obj-$(CONFIG_HOTPLUG_PCI_IBM)          += ibmphp.o
+
+# pciehp should be linked before acpiphp in order to allow the native driver
+# to attempt to bind first. We can then fall back to generic support.
+
+obj-$(CONFIG_HOTPLUG_PCI_PCIE)         += pciehp.o
 obj-$(CONFIG_HOTPLUG_PCI_ACPI)         += acpiphp.o
 obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM)     += acpiphp_ibm.o
 obj-$(CONFIG_HOTPLUG_PCI_CPCI_ZT5550)  += cpcihp_zt5550.o
 obj-$(CONFIG_HOTPLUG_PCI_CPCI_GENERIC) += cpcihp_generic.o
-obj-$(CONFIG_HOTPLUG_PCI_PCIE)         += pciehp.o
 obj-$(CONFIG_HOTPLUG_PCI_SHPC)         += shpchp.o
 obj-$(CONFIG_HOTPLUG_PCI_RPA)          += rpaphp.o
 obj-$(CONFIG_HOTPLUG_PCI_RPA_DLPAR)    += rpadlpar_io.o
index b0e7de9..d8649e1 100644 (file)
@@ -195,13 +195,13 @@ static void remove_slot_worker(struct work_struct *work)
  * Tries hard not to re-enable already existing devices;
  * also handles scanning of subfunctions.
  */
-static void pci_rescan_slot(struct pci_dev *temp)
+static int pci_rescan_slot(struct pci_dev *temp)
 {
        struct pci_bus *bus = temp->bus;
        struct pci_dev *dev;
        int func;
-       int retval;
        u8 hdr_type;
+       int count = 0;
 
        if (!pci_read_config_byte(temp, PCI_HEADER_TYPE, &hdr_type)) {
                temp->hdr_type = hdr_type & 0x7f;
@@ -213,17 +213,12 @@ static void pci_rescan_slot(struct pci_dev *temp)
                                dbg("New device on %s function %x:%x\n",
                                        bus->name, temp->devfn >> 3,
                                        temp->devfn & 7);
-                               retval = pci_bus_add_device(dev);
-                               if (retval)
-                                       dev_err(&dev->dev, "error adding "
-                                               "device, continuing.\n");
-                               else
-                                       add_slot(dev);
+                               count++;
                        }
                }
                /* multifunction device? */
                if (!(hdr_type & 0x80))
-                       return;
+                       return count;
 
                /* continue scanning for other functions */
                for (func = 1, temp->devfn++; func < 8; func++, temp->devfn++) {
@@ -239,16 +234,13 @@ static void pci_rescan_slot(struct pci_dev *temp)
                                        dbg("New device on %s function %x:%x\n",
                                                bus->name, temp->devfn >> 3,
                                                temp->devfn & 7);
-                                       retval = pci_bus_add_device(dev);
-                                       if (retval)
-                                               dev_err(&dev->dev, "error adding "
-                                                       "device, continuing.\n");
-                                       else
-                                               add_slot(dev);
+                                       count++;
                                }
                        }
                }
        }
+
+       return count;
 }
 
 
@@ -262,6 +254,8 @@ static void pci_rescan_bus(const struct pci_bus *bus)
 {
        unsigned int devfn;
        struct pci_dev *dev;
+       int retval;
+       int found = 0;
        dev = alloc_pci_dev();
        if (!dev)
                return;
@@ -270,7 +264,23 @@ static void pci_rescan_bus(const struct pci_bus *bus)
        dev->sysdata = bus->sysdata;
        for (devfn = 0; devfn < 0x100; devfn += 8) {
                dev->devfn = devfn;
-               pci_rescan_slot(dev);
+               found += pci_rescan_slot(dev);
+       }
+
+       if (found) {
+               pci_bus_assign_resources(bus);
+               list_for_each_entry(dev, &bus->devices, bus_list) {
+                       /* Skip already-added devices */
+                       if (dev->is_added)
+                                       continue;
+                       retval = pci_bus_add_device(dev);
+                       if (retval)
+                               dev_err(&dev->dev,
+                                       "Error adding device, continuing\n");
+                       else
+                               add_slot(dev);
+               }
+               pci_bus_add_devices(bus);
        }
        kfree(dev);
 }
index 3dfecb2..f4b7c79 100644 (file)
@@ -268,7 +268,12 @@ static long list_size;
 
 static void domain_remove_dev_info(struct dmar_domain *domain);
 
-int dmar_disabled;
+#ifdef CONFIG_DMAR_DEFAULT_ON
+int dmar_disabled = 0;
+#else
+int dmar_disabled = 1;
+#endif /*CONFIG_DMAR_DEFAULT_ON*/
+
 static int __initdata dmar_map_gfx = 1;
 static int dmar_forcedac;
 static int intel_iommu_strict;
@@ -284,9 +289,12 @@ static int __init intel_iommu_setup(char *str)
        if (!str)
                return -EINVAL;
        while (*str) {
-               if (!strncmp(str, "off", 3)) {
+               if (!strncmp(str, "on", 2)) {
+                       dmar_disabled = 0;
+                       printk(KERN_INFO "Intel-IOMMU: enabled\n");
+               } else if (!strncmp(str, "off", 3)) {
                        dmar_disabled = 1;
-                       printk(KERN_INFO"Intel-IOMMU: disabled\n");
+                       printk(KERN_INFO "Intel-IOMMU: disabled\n");
                } else if (!strncmp(str, "igfx_off", 8)) {
                        dmar_map_gfx = 0;
                        printk(KERN_INFO
index 896a15d..44f15ff 100644 (file)
@@ -103,6 +103,16 @@ static void msix_set_enable(struct pci_dev *dev, int enable)
        }
 }
 
+/*
+ * Essentially, this is ((1 << (1 << x)) - 1), but without the
+ * undefinedness of a << 32.
+ */
+static inline __attribute_const__ u32 msi_mask(unsigned x)
+{
+       static const u32 mask[] = { 1, 2, 4, 0xf, 0xff, 0xffff, 0xffffffff };
+       return mask[x];
+}
+
 static void msix_flush_writes(struct irq_desc *desc)
 {
        struct msi_desc *entry;
@@ -407,8 +417,7 @@ static int msi_capability_init(struct pci_dev *dev)
 
                /* All MSIs are unmasked by default, Mask them all */
                pci_read_config_dword(dev, base, &maskbits);
-               temp = (1 << multi_msi_capable(control));
-               temp = ((temp - 1) & ~temp);
+               temp = msi_mask((control & PCI_MSI_FLAGS_QMASK) >> 1);
                maskbits |= temp;
                pci_write_config_dword(dev, base, maskbits);
                entry->msi_attrib.maskbits_mask = temp;
index 9de07b7..ab1d615 100644 (file)
@@ -370,6 +370,7 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state)
        }
 
        pci_save_state(pci_dev);
+       pci_dev->state_saved = true;
        /*
         * This is for compatibility with existing code with legacy PM support.
         */
@@ -419,6 +420,7 @@ static int pci_legacy_resume(struct device *dev)
 static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
 {
        pci_restore_standard_config(pci_dev);
+       pci_dev->state_saved = false;
        pci_fixup_device(pci_fixup_resume_early, pci_dev);
 }
 
@@ -555,6 +557,13 @@ static int pci_pm_resume(struct device *dev)
        struct device_driver *drv = dev->driver;
        int error = 0;
 
+       /*
+        * This is necessary for the suspend error path in which resume is
+        * called without restoring the standard config registers of the device.
+        */
+       if (pci_dev->state_saved)
+               pci_restore_standard_config(pci_dev);
+
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_resume(dev);
 
@@ -660,7 +669,10 @@ static int pci_pm_poweroff(struct device *dev)
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_HIBERNATE);
 
-       if (drv && drv->pm && drv->pm->poweroff) {
+       if (!drv || !drv->pm)
+               return 0;
+
+       if (drv->pm->poweroff) {
                error = drv->pm->poweroff(dev);
                suspend_report_result(drv->pm->poweroff, error);
        }
@@ -710,6 +722,13 @@ static int pci_pm_restore(struct device *dev)
        struct device_driver *drv = dev->driver;
        int error = 0;
 
+       /*
+        * This is necessary for the hibernation error path in which restore is
+        * called without restoring the standard config registers of the device.
+        */
+       if (pci_dev->state_saved)
+               pci_restore_standard_config(pci_dev);
+
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_resume(dev);
 
index 17bd932..4880755 100644 (file)
@@ -1393,35 +1393,35 @@ int pci_restore_standard_config(struct pci_dev *dev)
        pci_power_t prev_state;
        int error;
 
-       pci_restore_state(dev);
        pci_update_current_state(dev, PCI_D0);
 
        prev_state = dev->current_state;
        if (prev_state == PCI_D0)
-               return 0;
+               goto Restore;
 
        error = pci_raw_set_power_state(dev, PCI_D0, false);
        if (error)
                return error;
 
-       if (pci_is_bridge(dev)) {
-               if (prev_state > PCI_D1)
-                       mdelay(PCI_PM_BUS_WAIT);
-       } else {
-               switch(prev_state) {
-               case PCI_D3cold:
-               case PCI_D3hot:
-                       mdelay(pci_pm_d3_delay);
-                       break;
-               case PCI_D2:
-                       udelay(PCI_PM_D2_DELAY);
-                       break;
-               }
+       /*
+        * This assumes that we won't get a bus in B2 or B3 from the BIOS, but
+        * we've made this assumption forever and it appears to be universally
+        * satisfied.
+        */
+       switch(prev_state) {
+       case PCI_D3cold:
+       case PCI_D3hot:
+               mdelay(pci_pm_d3_delay);
+               break;
+       case PCI_D2:
+               udelay(PCI_PM_D2_DELAY);
+               break;
        }
 
        dev->current_state = PCI_D0;
 
-       return 0;
+ Restore:
+       return pci_restore_state(dev);
 }
 
 /**
index 366565a..c175e38 100644 (file)
@@ -152,11 +152,7 @@ static void __exit bq24022_exit(void)
        platform_driver_unregister(&bq24022_driver);
 }
 
-/*
- * make sure this is probed before gpio_vbus and pda_power,
- * but after asic3 or other GPIO expander drivers.
- */
-subsys_initcall(bq24022_init);
+module_init(bq24022_init);
 module_exit(bq24022_exit);
 
 MODULE_AUTHOR("Philipp Zabel");
index 7aa3524..5056e23 100644 (file)
@@ -1435,7 +1435,7 @@ int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink,
        struct platform_device *pdev;
        int ret;
 
-       if (lednum > ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
+       if (lednum >= ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
                dev_err(wm8350->dev, "Invalid LED index %d\n", lednum);
                return -ENODEV;
        }
index 577c0d2..2291c5f 100644 (file)
@@ -170,12 +170,17 @@ void asl_stop(struct whc *whc)
 void asl_update(struct whc *whc, uint32_t wusbcmd)
 {
        struct wusbhc *wusbhc = &whc->wusbhc;
+       long t;
 
        mutex_lock(&wusbhc->mutex);
        if (wusbhc->active) {
                whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
-               wait_event(whc->async_list_wq,
-                          (le_readl(whc->base + WUSBCMD) & WUSBCMD_ASYNC_UPDATED) == 0);
+               t = wait_event_timeout(
+                       whc->async_list_wq,
+                       (le_readl(whc->base + WUSBCMD) & WUSBCMD_ASYNC_UPDATED) == 0,
+                       msecs_to_jiffies(1000));
+               if (t == 0)
+                       whc_hw_error(whc, "ASL update timeout");
        }
        mutex_unlock(&wusbhc->mutex);
 }
index d498e72..6afa2e3 100644 (file)
@@ -87,3 +87,18 @@ out:
 
        return ret;
 }
+
+/**
+ * whc_hw_error - recover from a hardware error
+ * @whc:    the WHCI HC that broke.
+ * @reason: a description of the failure.
+ *
+ * Recover from broken hardware with a full reset.
+ */
+void whc_hw_error(struct whc *whc, const char *reason)
+{
+       struct wusbhc *wusbhc = &whc->wusbhc;
+
+       dev_err(&whc->umc->dev, "hardware error: %s\n", reason);
+       wusbhc_reset_all(wusbhc);
+}
index 2ae5abf..7dc85a0 100644 (file)
@@ -183,12 +183,17 @@ void pzl_stop(struct whc *whc)
 void pzl_update(struct whc *whc, uint32_t wusbcmd)
 {
        struct wusbhc *wusbhc = &whc->wusbhc;
+       long t;
 
        mutex_lock(&wusbhc->mutex);
        if (wusbhc->active) {
                whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
-               wait_event(whc->periodic_list_wq,
-                          (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0);
+               t = wait_event_timeout(
+                       whc->periodic_list_wq,
+                       (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0,
+                       msecs_to_jiffies(1000));
+               if (t == 0)
+                       whc_hw_error(whc, "PZL update timeout");
        }
        mutex_unlock(&wusbhc->mutex);
 }
index 0f3540f..d3543a1 100644 (file)
@@ -137,6 +137,7 @@ void whc_clean_up(struct whc *whc);
 /* hw.c */
 void whc_write_wusbcmd(struct whc *whc, u32 mask, u32 val);
 int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len);
+void whc_hw_error(struct whc *whc, const char *reason);
 
 /* wusb.c */
 int whc_wusbhc_start(struct wusbhc *wusbhc);
index e2e7e4b..8e18141 100644 (file)
@@ -386,6 +386,7 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc,
                          | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED);
        port->change |= USB_PORT_STAT_C_CONNECTION | USB_PORT_STAT_C_ENABLE;
        if (wusb_dev) {
+               dev_dbg(wusbhc->dev, "disconnecting device from port %d\n", wusb_dev->port_idx);
                if (!list_empty(&wusb_dev->cack_node))
                        list_del_init(&wusb_dev->cack_node);
                /* For the one in cack_add() */
index 3937bf6..9fe4246 100644 (file)
@@ -100,6 +100,9 @@ static int wusbhc_rh_port_reset(struct wusbhc *wusbhc, u8 port_idx)
        struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx);
        struct wusb_dev *wusb_dev = port->wusb_dev;
 
+       if (wusb_dev == NULL)
+               return -ENOTCONN;
+
        port->status |= USB_PORT_STAT_RESET;
        port->change |= USB_PORT_STAT_C_RESET;
 
index c8185e6..c13cec7 100644 (file)
@@ -15,7 +15,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/uwb.h>
 
index 2b4f940..4f5ca99 100644 (file)
@@ -66,14 +66,14 @@ static void uwb_rc_set_drp_cmd_done(struct uwb_rc *rc, void *arg,
        } else
                dev_err(&rc->uwb_dev.dev, "SET-DRP-IE: timeout\n");
 
-       spin_lock(&rc->rsvs_lock);
+       spin_lock_bh(&rc->rsvs_lock);
        if (rc->set_drp_ie_pending > 1) {
                rc->set_drp_ie_pending = 0;
                uwb_rsv_queue_update(rc);       
        } else {
                rc->set_drp_ie_pending = 0;     
        }
-       spin_unlock(&rc->rsvs_lock);
+       spin_unlock_bh(&rc->rsvs_lock);
 }
 
 /**
index ec6eecb..6b76f4b 100644 (file)
@@ -114,7 +114,8 @@ void uwb_rsv_dump(char *text, struct uwb_rsv *rsv)
                devaddr = rsv->target.devaddr;
        uwb_dev_addr_print(target, sizeof(target), &devaddr);
 
-       dev_dbg(dev, "rsv %s -> %s: %s\n", owner, target, uwb_rsv_state_str(rsv->state));
+       dev_dbg(dev, "rsv %s %s -> %s: %s\n",
+               text, owner, target, uwb_rsv_state_str(rsv->state));
 }
 
 static void uwb_rsv_release(struct kref *kref)
@@ -511,8 +512,7 @@ void uwb_rsv_remove(struct uwb_rsv *rsv)
 
        if (uwb_rsv_is_owner(rsv))
                uwb_rsv_put_stream(rsv);
-       
-       del_timer_sync(&rsv->timer);
+
        uwb_dev_put(rsv->owner);
        if (rsv->target.type == UWB_RSV_TARGET_DEV)
                uwb_dev_put(rsv->target.dev);
@@ -870,7 +870,7 @@ void uwb_rsv_queue_update(struct uwb_rc *rc)
  */
 void uwb_rsv_sched_update(struct uwb_rc *rc)
 {
-       spin_lock(&rc->rsvs_lock);
+       spin_lock_bh(&rc->rsvs_lock);
        if (!delayed_work_pending(&rc->rsv_update_work)) {
                if (rc->set_drp_ie_pending > 0) {
                        rc->set_drp_ie_pending++;
@@ -879,7 +879,7 @@ void uwb_rsv_sched_update(struct uwb_rc *rc)
                uwb_rsv_queue_update(rc);
        }
 unlock:
-       spin_unlock(&rc->rsvs_lock);
+       spin_unlock_bh(&rc->rsvs_lock);
 }
 
 /*
@@ -943,13 +943,22 @@ void uwb_rsv_remove_all(struct uwb_rc *rc)
 
        mutex_lock(&rc->rsvs_mutex);
        list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) {
-               uwb_rsv_remove(rsv);
+               if (rsv->state != UWB_RSV_STATE_NONE)
+                       uwb_rsv_set_state(rsv, UWB_RSV_STATE_NONE);
+               del_timer_sync(&rsv->timer);
        }
        /* Cancel any postponed update. */
        rc->set_drp_ie_pending = 0;
        mutex_unlock(&rc->rsvs_mutex);
 
        cancel_delayed_work_sync(&rc->rsv_update_work);
+       flush_workqueue(rc->rsv_workq);
+
+       mutex_lock(&rc->rsvs_mutex);
+       list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) {
+               uwb_rsv_remove(rsv);
+       }
+       mutex_unlock(&rc->rsvs_mutex);
 }
 
 void uwb_rsv_init(struct uwb_rc *rc)
index c50c7cf..2745b85 100644 (file)
@@ -8,6 +8,9 @@
 #include <asm/io.h>
 #include <video/mach64.h>
 #include "atyfb.h"
+#ifdef CONFIG_PPC
+#include <asm/machdep.h>
+#endif
 
 #undef DEBUG
 
@@ -536,6 +539,14 @@ static int __devinit aty_init_pll_ct(const struct fb_info *info,
        pll->ct.xclk_post_div_real = postdividers[xpost_div];
        pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
 
+#ifdef CONFIG_PPC
+       if (machine_is(powermac)) {
+               /* Override PLL_EXT_CNTL & 0x07. */
+               pll->ct.xclk_post_div = xpost_div;
+               pll->ct.xclk_ref_div = 1;
+       }
+#endif
+
 #ifdef DEBUG
        pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) /
                        (par->ref_clk_per * pll->ct.pll_ref_div);
index bef6b45..330aacb 100644 (file)
@@ -192,7 +192,7 @@ static irqreturn_t vp_interrupt(int irq, void *opaque)
                drv = container_of(vp_dev->vdev.dev.driver,
                                   struct virtio_driver, driver);
 
-               if (drv->config_changed)
+               if (drv && drv->config_changed)
                        drv->config_changed(&vp_dev->vdev);
        }
 
index bf92802..36e221b 100644 (file)
@@ -37,7 +37,7 @@
 #include <linux/io.h>
 #include <linux/uaccess.h>
 
-#include <asm/mach-rdc321x/rdc321x_defs.h>
+#include <asm/rdc321x_defs.h>
 
 #define RDC_WDT_MASK   0x80000000 /* Mask */
 #define RDC_WDT_EN     0x00800000 /* Enable bit */
index 2ba8f95..efa4b36 100644 (file)
@@ -498,7 +498,7 @@ static ssize_t store_target_kb(struct sys_device *dev,
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
 
-       target_bytes = memparse(buf, &endchar);
+       target_bytes = simple_strtoull(buf, &endchar, 0) * 1024;
 
        balloon_set_new_target(target_bytes >> PAGE_SHIFT);
 
@@ -508,8 +508,39 @@ static ssize_t store_target_kb(struct sys_device *dev,
 static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR,
                   show_target_kb, store_target_kb);
 
+
+static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr,
+                             char *buf)
+{
+       return sprintf(buf, "%llu\n",
+                      (u64)balloon_stats.target_pages << PAGE_SHIFT);
+}
+
+static ssize_t store_target(struct sys_device *dev,
+                           struct sysdev_attribute *attr,
+                           const char *buf,
+                           size_t count)
+{
+       char *endchar;
+       unsigned long long target_bytes;
+
+       if (!capable(CAP_SYS_ADMIN))
+               return -EPERM;
+
+       target_bytes = memparse(buf, &endchar);
+
+       balloon_set_new_target(target_bytes >> PAGE_SHIFT);
+
+       return count;
+}
+
+static SYSDEV_ATTR(target, S_IRUGO | S_IWUSR,
+                  show_target, store_target);
+
+
 static struct sysdev_attribute *balloon_attrs[] = {
        &attr_target_kb,
+       &attr_target,
 };
 
 static struct attribute *balloon_info_attrs[] = {
index 3141e14..7c37054 100644 (file)
@@ -820,8 +820,11 @@ void xen_irq_resume(void)
 
 static struct irq_chip xen_dynamic_chip __read_mostly = {
        .name           = "xen-dyn",
+
+       .disable        = disable_dynirq,
        .mask           = disable_dynirq,
        .unmask         = enable_dynirq,
+
        .ack            = ack_dynirq,
        .set_affinity   = set_affinity_irq,
        .retrigger      = retrigger_dynirq,
index 9e01729..2c87316 100644 (file)
@@ -27,6 +27,7 @@
 #ifndef __LINUX__AIO_ABI_H
 #define __LINUX__AIO_ABI_H
 
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 typedef unsigned long  aio_context_t;
index e9ebac2..d34c187 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_ATALK_H__
 #define __LINUX_ATALK_H__
 
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 /*
index 52bf72a..fdb2629 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_ATMBR2684_H
 #define _LINUX_ATMBR2684_H
 
+#include <linux/types.h>
 #include <linux/atm.h>
 #include <linux/if.h>          /* For IFNAMSIZ */
 
index 55fa478..8b49ac4 100644 (file)
@@ -12,6 +12,7 @@
 #define _LINUX_AUTO_FS4_H
 
 /* Include common v3 definitions */
+#include <linux/types.h>
 #include <linux/auto_fs.h>
 
 /* autofs v4 definitions */
index 8ed6dfd..1c0b355 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef _LINUX_BFS_FS_H
 #define _LINUX_BFS_FS_H
 
+#include <linux/types.h>
+
 #define BFS_BSIZE_BITS         9
 #define BFS_BSIZE              (1<<BFS_BSIZE_BITS)
 
@@ -17,7 +19,6 @@
 #define BFS_VDIR 2L
 #define BFS_VREG 1L
 
-
 /* BFS inode layout on disk */
 struct bfs_inode {
        __le16 i_ino;
index 0942765..2aa283a 100644 (file)
@@ -451,12 +451,13 @@ extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly;
 
 #ifdef CONFIG_HIGHMEM
 /*
- * remember to add offset! and never ever reenable interrupts between a
- * bvec_kmap_irq and bvec_kunmap_irq!!
+ * remember never ever reenable interrupts between a bvec_kmap_irq and
+ * bvec_kunmap_irq!
  *
  * This function MUST be inlined - it plays with the CPU interrupt flags.
  */
-static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
+static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec,
+               unsigned long *flags)
 {
        unsigned long addr;
 
@@ -472,7 +473,8 @@ static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
        return (char *) addr + bvec->bv_offset;
 }
 
-static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
+static __always_inline void bvec_kunmap_irq(char *buffer,
+               unsigned long *flags)
 {
        unsigned long ptr = (unsigned long) buffer & PAGE_MASK;
 
index d08c4b8..dcaa0fd 100644 (file)
@@ -455,7 +455,7 @@ struct request_queue
 
 #define QUEUE_FLAG_DEFAULT     ((1 << QUEUE_FLAG_IO_STAT) |            \
                                 (1 << QUEUE_FLAG_CLUSTER) |            \
-                                 1 << QUEUE_FLAG_STACKABLE)
+                                (1 << QUEUE_FLAG_STACKABLE))
 
 static inline int queue_is_locked(struct request_queue *q)
 {
index 1dba349..25379cb 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef BLKTRACE_H
 #define BLKTRACE_H
 
+#include <linux/types.h>
 #ifdef __KERNEL__
 #include <linux/blkdev.h>
 #include <linux/relay.h>
index 7f29327..1432b27 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef CAN_BCM_H
 #define CAN_BCM_H
 
+#include <linux/types.h>
+
 /**
  * struct bcm_msg_head - head of messages to/from the broadcast manager
  * @opcode:    opcode, see enum below.
index 02bdb76..1b98725 100644 (file)
@@ -69,10 +69,6 @@ typedef struct __user_cap_data_struct {
 #define VFS_CAP_U32             VFS_CAP_U32_2
 #define VFS_CAP_REVISION       VFS_CAP_REVISION_2
 
-#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
-extern int file_caps_enabled;
-#endif
-
 struct vfs_cap_data {
        __le32 magic_etc;            /* Little endian */
        struct {
@@ -96,6 +92,10 @@ struct vfs_cap_data {
 #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
 #define _KERNEL_CAPABILITY_U32S    _LINUX_CAPABILITY_U32S_3
 
+#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
+extern int file_caps_enabled;
+#endif
+
 typedef struct kernel_cap_struct {
        __u32 cap[_KERNEL_CAPABILITY_U32S];
 } kernel_cap_t;
index 0b49e08..78e9047 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef        _LINUX_CDROM_H
 #define        _LINUX_CDROM_H
 
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 /*******************************************************
index 4f53abf..3753c33 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef _LINUX_CGROUPSTATS_H
 #define _LINUX_CGROUPSTATS_H
 
+#include <linux/types.h>
 #include <linux/taskstats.h>
 
 /*
index cea1536..3a1dbba 100644 (file)
@@ -36,6 +36,7 @@ enum clock_event_nofitiers {
        CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
        CLOCK_EVT_NOTIFY_SUSPEND,
        CLOCK_EVT_NOTIFY_RESUME,
+       CLOCK_EVT_NOTIFY_CPU_DYING,
        CLOCK_EVT_NOTIFY_CPU_DEAD,
 };
 
index 18d5fdb..2dd2124 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __DLM_PLOCK_DOT_H__
 #define __DLM_PLOCK_DOT_H__
 
+#include <linux/types.h>
+
 #define DLM_PLOCK_MISC_NAME            "dlm_plock"
 
 #define DLM_PLOCK_VERSION_MAJOR        1
index 02bba04..fe99908 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_DN_H
 #define _LINUX_DN_H
 
+#include <linux/types.h>
+
 /*
 
        DECnet Data Structures and Constants
index 89412e1..bb0df2a 100644 (file)
 #ifndef _DVBAUDIO_H_
 #define _DVBAUDIO_H_
 
-#ifdef __KERNEL__
 #include <linux/types.h>
-#else
-#include <stdint.h>
-#endif
-
 
 typedef enum {
        AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
index 402fb7a..fef9437 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef _DVBDMX_H_
 #define _DVBDMX_H_
 
-#include <asm/types.h>
+#include <linux/types.h>
 #ifdef __KERNEL__
 #include <linux/time.h>
 #else
index 55026b1..51c8d2d 100644 (file)
@@ -26,8 +26,7 @@
 #ifndef _DVBFRONTEND_H_
 #define _DVBFRONTEND_H_
 
-#include <asm/types.h>
-
+#include <linux/types.h>
 
 typedef enum fe_type {
        FE_QPSK,
index 5be474b..f451e7e 100644 (file)
@@ -24,8 +24,7 @@
 #ifndef _DVBNET_H_
 #define _DVBNET_H_
 
-#include <asm/types.h>
-
+#include <linux/types.h>
 
 struct dvb_net_if {
        __u16 pid;
index 50839fe..bd49c3e 100644 (file)
 #ifndef _DVBVIDEO_H_
 #define _DVBVIDEO_H_
 
-#include <linux/compiler.h>
-
-#ifdef __KERNEL__
 #include <linux/types.h>
+#ifdef __KERNEL__
+#include <linux/compiler.h>
 #else
-#include <asm/types.h>
 #include <stdint.h>
 #include <time.h>
 #endif
 
-
 typedef enum {
        VIDEO_FORMAT_4_3,     /* Select 4:3 format */
        VIDEO_FORMAT_16_9,    /* Select 16:9 format. */
index 5d747c5..4cbd0fe 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef _LINUX_EDD_H
 #define _LINUX_EDD_H
 
+#include <linux/types.h>
+
 #define EDDNR 0x1e9            /* addr of number of edd_info structs at EDDBUF
                                   in boot_params - treat this as 1 byte  */
 #define EDDBUF 0xd00           /* addr of edd_info structs in boot_params */
index ff1945e..a01be90 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef __EFS_FS_SB_H__
 #define __EFS_FS_SB_H__
 
+#include <linux/types.h>
 #include <linux/magic.h>
 
 /* EFS superblock magic numbers */
index 9f5b745..7cd2e80 100644 (file)
@@ -58,11 +58,13 @@ struct elf_fdpic_params {
 #define ELF_FDPIC_FLAG_PRESENT         0x80000000      /* T if this object is present */
 };
 
+#ifdef __KERNEL__
 #ifdef CONFIG_MMU
 extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
                                      struct elf_fdpic_params *interp_params,
                                      unsigned long *start_stack,
                                      unsigned long *start_brk);
 #endif
+#endif /* __KERNEL__ */
 
 #endif /* _LINUX_ELF_FDPIC_H */
index 0b61ca4..45a937b 100644 (file)
@@ -377,6 +377,7 @@ typedef struct elf64_note {
   Elf64_Word n_type;   /* Content type */
 } Elf64_Nhdr;
 
+#ifdef __KERNEL__
 #if ELF_CLASS == ELFCLASS32
 
 extern Elf32_Dyn _DYNAMIC [];
@@ -404,5 +405,5 @@ static inline int elf_coredump_extra_notes_write(struct file *file,
 extern int elf_coredump_extra_notes_size(void);
 extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
 #endif
-
+#endif /* __KERNEL__ */
 #endif /* _LINUX_ELF_H */
index 92f8d4f..ceb1454 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_ERRQUEUE_H
 #define _LINUX_ERRQUEUE_H 1
 
+#include <linux/types.h>
+
 struct sock_extended_err
 {
        __u32   ee_errno;       
index 7da02c9..b834ef6 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_GENERIC_NETLINK_H
 #define __LINUX_GENERIC_NETLINK_H
 
+#include <linux/types.h>
 #include <linux/netlink.h>
 
 #define GENL_NAMSIZ    16      /* length of family name */
index 14d0df0..c56b4bc 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef __GFS2_ONDISK_DOT_H__
 #define __GFS2_ONDISK_DOT_H__
 
+#include <linux/types.h>
+
 #define GFS2_MAGIC             0x01161970
 #define GFS2_BASIC_BLOCK       512
 #define GFS2_BASIC_BLOCK_SHIFT 9
index 81aa84d..fa8ee9c 100644 (file)
@@ -791,6 +791,7 @@ dbg_hid(const char *fmt, ...)
                __FILE__ , ## arg)
 #endif /* HID_FF */
 
+#ifdef __KERNEL__
 #ifdef CONFIG_HID_COMPAT
 #define HID_COMPAT_LOAD_DRIVER(name)   \
 /* prototype to avoid sparse warning */        \
@@ -804,6 +805,7 @@ EXPORT_SYMBOL(hid_compat_##name)
        extern void hid_compat_##name(void);    \
        hid_compat_##name();                    \
 } while (0)
+#endif /* __KERNEL__ */
 
 #endif
 
index c760ae0..bb6f58b 100644 (file)
@@ -27,6 +27,8 @@
  * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
  */
 
+#include <linux/types.h>
+
 /*
  * The event structure itself
  */
index a93a8dd..10d701e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_ICMPV6_H
 #define _LINUX_ICMPV6_H
 
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 struct icmp6hdr {
index 43f3bed..a60c821 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_IF_ADDR_H
 #define __LINUX_IF_ADDR_H
 
+#include <linux/types.h>
 #include <linux/netlink.h>
 
 struct ifaddrmsg
index 9fe79c9..89571f6 100644 (file)
@@ -10,6 +10,8 @@
 #ifndef __LINUX_IF_ADDRLABEL_H
 #define __LINUX_IF_ADDRLABEL_H
 
+#include <linux/types.h>
+
 struct ifaddrlblmsg
 {
        __u8            ifal_family;            /* Address family */
index 376a34e..6ed7f1b 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef _LINUX_IF_FC_H
 #define _LINUX_IF_FC_H
 
+#include <linux/types.h>
 
 #define FC_ALEN        6               /* Octets in one ethernet addr   */
 #define FC_HLEN   (sizeof(struct fch_hdr)+sizeof(struct fcllc))
index f0f2351..4a7c994 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef _LINUX_IF_HIPPI_H
 #define _LINUX_IF_HIPPI_H
 
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 /*
index f9032c8..176c518 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_IF_LINK_H
 #define _LINUX_IF_LINK_H
 
+#include <linux/types.h>
 #include <linux/netlink.h>
 
 /* The struct should be in sync with struct net_device_stats */
index c3b1f85..fcef103 100644 (file)
@@ -33,6 +33,7 @@
 #ifndef _IF_PPP_H_
 #define _IF_PPP_H_
 
+#include <linux/types.h>
 #include <linux/compiler.h>
 
 /*
index fb5c5c9..6526a62 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef __LINUX_STRIP_H
 #define __LINUX_STRIP_H
 
+#include <linux/types.h>
+
 typedef struct {
     __u8 c[6];
 } MetricomAddress;
index 5bcec8b..fc23aeb 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef _LINUX_IF_TR_H
 #define _LINUX_IF_TR_H
 
+#include <linux/types.h>
 #include <asm/byteorder.h>     /* For __be16 */
 
 /* IEEE 802.5 Token-Ring magic constants.  The frame sizes omit the preamble
index f734a0b..92fbd8c 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef _LINUX_IGMP_H
 #define _LINUX_IGMP_H
 
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 /*
index 6e8bc54..bc8c490 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _INET_DIAG_H_
 #define _INET_DIAG_H_ 1
 
+#include <linux/types.h>
+
 /* Just some random number */
 #define TCPDIAG_GETSOCK 18
 #define DCCPDIAG_GETSOCK 19
index 1e7cc4a..acb9ad6 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _IP6_TUNNEL_H
 #define _IP6_TUNNEL_H
 
+#include <linux/types.h>
+
 #define IPV6_TLV_TNL_ENCAP_LIMIT 4
 #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
 
index 0b816ca..476d946 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _IPV6_H
 #define _IPV6_H
 
+#include <linux/types.h>
 #include <linux/in6.h>
 #include <asm/byteorder.h>
 
index b323ff5..1e7d8af 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef _LINUX_IPV6_ROUTE_H
 #define _LINUX_IPV6_ROUTE_H
 
+#include <linux/types.h>
+
 #define RTF_DEFAULT    0x00010000      /* default - learned via ND     */
 #define RTF_ALLONLINK  0x00020000      /* (deprecated and will be removed)
                                           fallback, no routers on link */
index eb19b4e..aabb1d2 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _IPX_H_
 #define _IPX_H_
+#include <linux/types.h>
 #include <linux/sockios.h>
 #include <linux/socket.h>
 #define IPX_NODE_LEN   6
index 28f88ec..00bdad0 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef KERNEL_IRDA_H
 #define KERNEL_IRDA_H
 
+#include <linux/types.h>
+
 /* Please do *not* add any #include in this file, this file is
  * included as-is in user space.
  * Please fix the calling file to properly included needed files before
index 0e39745..13fe09e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_MINIX_FS_H
 #define _LINUX_MINIX_FS_H
 
+#include <linux/types.h>
 #include <linux/magic.h>
 
 /*
index 4f7ea12..f3b8329 100644 (file)
@@ -219,11 +219,6 @@ void *__symbol_get_gpl(const char *symbol);
 
 #endif
 
-struct module_ref
-{
-       local_t count;
-} ____cacheline_aligned;
-
 enum module_state
 {
        MODULE_STATE_LIVE,
@@ -344,8 +339,11 @@ struct module
        /* Destruction function. */
        void (*exit)(void);
 
-       /* Reference counts */
-       struct module_ref ref[NR_CPUS];
+#ifdef CONFIG_SMP
+       char *refptr;
+#else
+       local_t ref;
+#endif
 #endif
 };
 #ifndef MODULE_ARCH_INIT
@@ -395,13 +393,22 @@ void __symbol_put(const char *symbol);
 #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
 void symbol_put_addr(void *addr);
 
+static inline local_t *__module_ref_addr(struct module *mod, int cpu)
+{
+#ifdef CONFIG_SMP
+       return (local_t *) (mod->refptr + per_cpu_offset(cpu));
+#else
+       return &mod->ref;
+#endif
+}
+
 /* Sometimes we know we already have a refcount, and it's easier not
    to handle the error case (which only happens with rmmod --wait). */
 static inline void __module_get(struct module *module)
 {
        if (module) {
                BUG_ON(module_refcount(module) == 0);
-               local_inc(&module->ref[get_cpu()].count);
+               local_inc(__module_ref_addr(module, get_cpu()));
                put_cpu();
        }
 }
@@ -413,7 +420,7 @@ static inline int try_module_get(struct module *module)
        if (module) {
                unsigned int cpu = get_cpu();
                if (likely(module_is_live(module)))
-                       local_inc(&module->ref[cpu].count);
+                       local_inc(__module_ref_addr(module, cpu));
                else
                        ret = 0;
                put_cpu();
index e0a9b20..ce38f1c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_MSDOS_FS_H
 #define _LINUX_MSDOS_FS_H
 
+#include <linux/types.h>
 #include <linux/magic.h>
 #include <asm/byteorder.h>
 
index bd3bbf6..8730d5d 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_NEIGHBOUR_H
 #define __LINUX_NEIGHBOUR_H
 
+#include <linux/types.h>
 #include <linux/netlink.h>
 
 struct ndmsg
index f3fd83e..8f53452 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef _XT_CONNTRACK_H
 #define _XT_CONNTRACK_H
 
+#include <linux/types.h>
 #include <linux/netfilter/nf_conntrack_tuple_common.h>
 
 #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
index 15a9f3b..91a1c24 100644 (file)
@@ -37,6 +37,8 @@
 #ifndef NFS_IDMAP_H
 #define NFS_IDMAP_H
 
+#include <linux/types.h>
+
 /* XXX from bits/utmp.h  */
 #define IDMAP_NAMESZ  128
 
index 5431512..bcd0201 100644 (file)
@@ -10,9 +10,8 @@
 #ifndef NFSD_EXPORT_H
 #define NFSD_EXPORT_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
+#ifdef __KERNEL__
 # include <linux/in.h>
 #endif
 
index b2e0938..fa317f6 100644 (file)
@@ -14,9 +14,8 @@
 #ifndef _LINUX_NFSD_FH_H
 #define _LINUX_NFSD_FH_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
+#ifdef __KERNEL__
 # include <linux/string.h>
 # include <linux/fs.h>
 #endif
index 4e43976..7a3b565 100644 (file)
@@ -9,9 +9,8 @@
 #ifndef NFSD_SYSCALL_H
 #define NFSD_SYSCALL_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
+#ifdef __KERNEL__
 # include <linux/in.h>
 #endif 
 #include <linux/posix_types.h>
index c435507..7382af3 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef LINUX_NUBUS_H
 #define LINUX_NUBUS_H
 
+#include <linux/types.h>
 #ifdef __KERNEL__
 #include <asm/nubus.h>
 #endif
index febc10e..52a9fe0 100644 (file)
 #define PCI_DEVICE_ID_INTEL_ICH7_0     0x27b8
 #define PCI_DEVICE_ID_INTEL_ICH7_1     0x27b9
 #define PCI_DEVICE_ID_INTEL_ICH7_30    0x27b0
+#define PCI_DEVICE_ID_INTEL_TGP_LPC    0x27bc
 #define PCI_DEVICE_ID_INTEL_ICH7_31    0x27bd
 #define PCI_DEVICE_ID_INTEL_ICH7_17    0x27da
 #define PCI_DEVICE_ID_INTEL_ICH7_19    0x27dd
index 4157faa..ee5e3c9 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef LINUX_PHONET_H
 #define LINUX_PHONET_H
 
+#include <linux/types.h>
+
 /* Automatic protocol selection */
 #define PN_PROTO_TRANSPORT     0
 /* Phonet datagram socket */
index e6aa848..3c842ed 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_PKT_CLS_H
 #define __LINUX_PKT_CLS_H
 
+#include <linux/types.h>
 #include <linux/pkt_sched.h>
 
 /* I think i could have done better macros ; for now this is stolen from
index e3f133a..b2648e8 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __LINUX_PKT_SCHED_H
 #define __LINUX_PKT_SCHED_H
 
+#include <linux/types.h>
+
 /* Logical priority bands not depending on specific packet scheduler.
    Every scheduler will map them to real traffic classes, if it has
    no more precise mechanism to classify packets.
index 6e8adc7..1c866bd 100644 (file)
@@ -25,6 +25,8 @@
  * OR MODIFICATIONS.
  */
 
+#include <linux/types.h>
+
 /*
  *  ==FILEVERSION 20000114==
  *
index 9491026..6ba830f 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef _MD_P_H
 #define _MD_P_H
 
+#include <linux/types.h>
+
 /*
  * RAID superblock.
  *
index 407ea36..25d02fe 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef _LINUX_RANDOM_H
 #define _LINUX_RANDOM_H
 
+#include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/irqnr.h>
 
index e88f705..1e5f673 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_RTNETLINK_H
 #define __LINUX_RTNETLINK_H
 
+#include <linux/types.h>
 #include <linux/netlink.h>
 #include <linux/if_link.h>
 #include <linux/if_addr.h>
index bef0c46..b363b91 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef _LINUX_SIGNALFD_H
 #define _LINUX_SIGNALFD_H
 
+#include <linux/types.h>
 /* For O_CLOEXEC and O_NONBLOCK */
 #include <linux/fcntl.h>
 
index 39c3a5e..6ca6a7b 100644 (file)
@@ -43,10 +43,7 @@ static inline void *kmalloc(size_t size, gfp_t flags)
                        i++;
 #include <linux/kmalloc_sizes.h>
 #undef CACHE
-               {
-                       extern void __you_cannot_kmalloc_that_much(void);
-                       __you_cannot_kmalloc_that_much();
-               }
+               return NULL;
 found:
 #ifdef CONFIG_ZONE_DMA
                if (flags & GFP_DMA)
@@ -77,10 +74,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
                        i++;
 #include <linux/kmalloc_sizes.h>
 #undef CACHE
-               {
-                       extern void __you_cannot_kmalloc_that_much(void);
-                       __you_cannot_kmalloc_that_much();
-               }
+               return NULL;
 found:
 #ifdef CONFIG_ZONE_DMA
                if (flags & GFP_DMA)
index 715196b..bbacb7b 100644 (file)
@@ -176,6 +176,12 @@ static inline void init_call_single_data(void)
 #define put_cpu()              preempt_enable()
 #define put_cpu_no_resched()   preempt_enable_no_resched()
 
+/*
+ * Callback to arch code if there's nosmp or maxcpus=0 on the
+ * boot command line:
+ */
+extern void arch_disable_smp_support(void);
+
 void smp_setup_processor_id(void);
 
 #endif /* __LINUX_SMP_H */
index 9e2a94f..44dcf05 100644 (file)
@@ -25,6 +25,7 @@
 #define SND_DEV_AMIDI          13      /* Like /dev/midi (obsolete) */
 #define SND_DEV_ADMMIDI                14      /* Like /dev/dmmidi (onsolete) */
 
+#ifdef __KERNEL__
 /*
  *     Sound core interface functions
  */
@@ -40,3 +41,4 @@ extern void unregister_sound_special(int unit);
 extern void unregister_sound_mixer(int unit);
 extern void unregister_sound_midi(int unit);
 extern void unregister_sound_dsp(int unit);
+#endif /* __KERNEL__ */
index c93ef9d..95251cc 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef SPIDEV_H
 #define SPIDEV_H
 
+#include <linux/types.h>
 
 /* User space versions of kernel symbols for SPI clocking modes,
  * matching <linux/spi/spi.h>
index c844a22..99b8bdb 100644 (file)
@@ -13,6 +13,8 @@
 #define _SYNCLINK_H_
 #define SYNCLINK_H_VERSION 3.6
 
+#include <linux/types.h>
+
 #define BIT0   0x0001
 #define BIT1   0x0002
 #define BIT2   0x0004
index 18269e9..341dddb 100644 (file)
@@ -16,6 +16,8 @@
 #ifndef _LINUX_TASKSTATS_H
 #define _LINUX_TASKSTATS_H
 
+#include <linux/types.h>
+
 /* Format for per-task data returned to userland when
  *     - a task exits
  *     - listener requests stats for a task
index 23a03eb..e895c0a 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_GACT_H
 #define __LINUX_TC_GACT_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_GACT 5
index 71d6340..0a99ab6 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_MIR_H
 #define __LINUX_TC_MIR_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_MIRRED 8
index 83e56e3..54ce906 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_PED_H
 #define __LINUX_TC_PED_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_PEDIT 7
index c7f4d43..38e7f7b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_EM_CMP_H
 #define __LINUX_TC_EM_CMP_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 struct tcf_em_cmp
index c50d2ba..dcfb733 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_EM_META_H
 #define __LINUX_TC_EM_META_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 enum
index f19d1f5..9ed8c2e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_EM_NBYTE_H
 #define __LINUX_TC_EM_NBYTE_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 struct tcf_em_nbyte
index 7cd43e9..d12a73a 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LINUX_TC_EM_TEXT_H
 #define __LINUX_TC_EM_TEXT_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TC_EM_TEXT_ALGOSIZ     16
index 18a7293..3c86ed2 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __LINUX_USB_CDC_H
 #define __LINUX_USB_CDC_H
 
+#include <linux/types.h>
+
 #define USB_CDC_SUBCLASS_ACM                   0x02
 #define USB_CDC_SUBCLASS_ETHERNET              0x06
 #define USB_CDC_SUBCLASS_WHCM                  0x08
index ea45f26..612102e 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef __LINUX_USB_GADGETFS_H
 #define __LINUX_USB_GADGETFS_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <asm/ioctl.h>
 
 #include <linux/usb/ch9.h>
index 121e26d..e26c0c8 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_VIDEO_DECODER_H
 #define _LINUX_VIDEO_DECODER_H
 
+#include <linux/types.h>
+
 #define HAVE_VIDEO_DECODER 1
 
 struct video_decoder_capability { /* this name is too long */
index 4b0e690..b7b6423 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _LINUX_VIDEO_ENCODER_H
 #define _LINUX_VIDEO_ENCODER_H
 
+#include <linux/types.h>
+
 struct video_encoder_capability { /* this name is too long */
        __u32   flags;
 #define        VIDEO_ENCODER_PAL       1       /* can encode PAL signal */
index 15a653d..837f392 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef __LINUX_VIDEODEV_H
 #define __LINUX_VIDEODEV_H
 
+#include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/videodev2.h>
 
index c1aef85..94c56d2 100644 (file)
@@ -2,6 +2,7 @@
 #define _LINUX_VIRTIO_BLK_H
 /* This header is BSD licensed so anyone can use the definitions to implement
  * compatible drivers/servers. */
+#include <linux/types.h>
 #include <linux/virtio_config.h>
 
 /* The ID for virtio_block */
index 7615ffc..dc16111 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _LINUX_VIRTIO_CONSOLE_H
 #define _LINUX_VIRTIO_CONSOLE_H
+#include <linux/types.h>
 #include <linux/virtio_config.h>
 /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
  * anyone can use the definitions to implement compatible drivers/servers. */
index 5cdd0aa..3efa86c 100644 (file)
@@ -2,6 +2,7 @@
 #define _LINUX_VIRTIO_NET_H
 /* This header is BSD licensed so anyone can use the definitions to implement
  * compatible drivers/servers. */
+#include <linux/types.h>
 #include <linux/virtio_config.h>
 
 /* The ID for virtio_net */
index 9bf4ccc..55e41af 100644 (file)
@@ -94,16 +94,16 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
 /* Call the specified callback for all subdevs matching grp_id (if 0, then
    match them all). Ignore any errors. Note that you cannot add or delete
    a subdev while walking the subdevs list. */
-#define v4l2_device_call_all(dev, grp_id, o, f, args...)               \
+#define v4l2_device_call_all(dev, grpid, o, f, args...)                \
        __v4l2_device_call_subdevs(dev,                                 \
-                       !(grp_id) || sd->grp_id == (grp_id), o, f , ##args)
+                       !(grpid) || sd->grp_id == (grpid), o, f , ##args)
 
 /* Call the specified callback for all subdevs matching grp_id (if 0, then
    match them all). If the callback returns an error other than 0 or
    -ENOIOCTLCMD, then return with that error code. Note that you cannot
    add or delete a subdev while walking the subdevs list. */
-#define v4l2_device_call_until_err(dev, grp_id, o, f, args...)                 \
+#define v4l2_device_call_until_err(dev, grpid, o, f, args...)          \
        __v4l2_device_call_subdevs_until_err(dev,                       \
-                      !(grp_id) || sd->grp_id == (grp_id), o, f , ##args)
+                      !(grpid) || sd->grp_id == (grpid), o, f , ##args)
 
 #endif
index e17eda3..d409d48 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef __MTD_INFTL_USER_H__
 #define __MTD_INFTL_USER_H__
 
+#include <linux/types.h>
+
 #define        OSAK_VERSION    0x5120
 #define        PERCENTUSED     98
 
index dec6b1d..d98a78d 100644 (file)
@@ -19,6 +19,8 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <linux/types.h>
+
 #define HDSP_MATRIX_MIXER_SIZE 2048
 
 enum HDSP_IO_Type {
index e402eb5..fdd74f1 100644 (file)
@@ -21,8 +21,8 @@
 #ifndef _LINUX_SISFB_H_
 #define _LINUX_SISFB_H_
 
+#include <linux/types.h>
 #include <asm/ioctl.h>
-#include <asm/types.h>
 
 /**********************************************/
 /*                   PUBLIC                   */
index 95bcef1..0993a22 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _UVESAFB_H
 #define _UVESAFB_H
 
+#include <linux/types.h>
+
 struct v86_regs {
        __u32 ebx;
        __u32 ecx;
index bfe4fb0..6441083 100644 (file)
@@ -136,14 +136,14 @@ unsigned int __initdata setup_max_cpus = NR_CPUS;
  * greater than 0, limits the maximum number of CPUs activated in
  * SMP mode to <NUM>.
  */
-#ifndef CONFIG_X86_IO_APIC
-static inline void disable_ioapic_setup(void) {};
-#endif
+
+void __weak arch_disable_smp_support(void) { }
 
 static int __init nosmp(char *str)
 {
        setup_max_cpus = 0;
-       disable_ioapic_setup();
+       arch_disable_smp_support();
+
        return 0;
 }
 
@@ -153,14 +153,14 @@ static int __init maxcpus(char *str)
 {
        get_option(&str, &setup_max_cpus);
        if (setup_max_cpus == 0)
-               disable_ioapic_setup();
+               arch_disable_smp_support();
 
        return 0;
 }
 
 early_param("maxcpus", maxcpus);
 #else
-#define setup_max_cpus NR_CPUS
+const unsigned int setup_max_cpus = NR_CPUS;
 #endif
 
 /*
index a9e09ad..c0a021f 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -368,14 +368,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
                file = hugetlb_file_setup(name, size);
                shp->mlock_user = current_user();
        } else {
-               int acctflag = VM_ACCOUNT;
+               int acctflag = 0;
                /*
                 * Do not allow no accounting for OVERCOMMIT_NEVER, even
                 * if it's asked for.
                 */
                if  ((shmflg & SHM_NORESERVE) &&
                                sysctl_overcommit_memory != OVERCOMMIT_NEVER)
-                       acctflag = 0;
+                       acctflag = VM_NORESERVE;
                file = shmem_file_setup(name, size, acctflag);
        }
        error = PTR_ERR(file);
index a856788..f76db9d 100644 (file)
 #include <linux/cgroup.h>
 
 /*
+ * Workqueue for cpuset related tasks.
+ *
+ * Using kevent workqueue may cause deadlock when memory_migrate
+ * is set. So we create a separate workqueue thread for cpuset.
+ */
+static struct workqueue_struct *cpuset_wq;
+
+/*
  * Tracks how many cpusets are currently defined in system.
  * When there is only one cpuset (the root cpuset) we can
  * short circuit some hooks.
@@ -831,7 +839,7 @@ static DECLARE_WORK(rebuild_sched_domains_work, do_rebuild_sched_domains);
  */
 static void async_rebuild_sched_domains(void)
 {
-       schedule_work(&rebuild_sched_domains_work);
+       queue_work(cpuset_wq, &rebuild_sched_domains_work);
 }
 
 /*
@@ -2111,6 +2119,9 @@ void __init cpuset_init_smp(void)
 
        hotcpu_notifier(cpuset_track_online_cpus, 0);
        hotplug_memory_notifier(cpuset_track_online_nodes, 10);
+
+       cpuset_wq = create_singlethread_workqueue("cpuset");
+       BUG_ON(!cpuset_wq);
 }
 
 /**
index f33afb0..f394d2a 100644 (file)
@@ -501,6 +501,13 @@ static void hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base)
                        continue;
                timer = rb_entry(base->first, struct hrtimer, node);
                expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
+               /*
+                * clock_was_set() has changed base->offset so the
+                * result might be negative. Fix it up to prevent a
+                * false positive in clockevents_program_event()
+                */
+               if (expires.tv64 < 0)
+                       expires.tv64 = 0;
                if (expires.tv64 < cpu_base->expires_next.tv64)
                        cpu_base->expires_next = expires;
        }
@@ -1158,6 +1165,29 @@ static void __run_hrtimer(struct hrtimer *timer)
 
 #ifdef CONFIG_HIGH_RES_TIMERS
 
+static int force_clock_reprogram;
+
+/*
+ * After 5 iteration's attempts, we consider that hrtimer_interrupt()
+ * is hanging, which could happen with something that slows the interrupt
+ * such as the tracing. Then we force the clock reprogramming for each future
+ * hrtimer interrupts to avoid infinite loops and use the min_delta_ns
+ * threshold that we will overwrite.
+ * The next tick event will be scheduled to 3 times we currently spend on
+ * hrtimer_interrupt(). This gives a good compromise, the cpus will spend
+ * 1/4 of their time to process the hrtimer interrupts. This is enough to
+ * let it running without serious starvation.
+ */
+
+static inline void
+hrtimer_interrupt_hanging(struct clock_event_device *dev,
+                       ktime_t try_time)
+{
+       force_clock_reprogram = 1;
+       dev->min_delta_ns = (unsigned long)try_time.tv64 * 3;
+       printk(KERN_WARNING "hrtimer: interrupt too slow, "
+               "forcing clock min delta to %lu ns\n", dev->min_delta_ns);
+}
 /*
  * High resolution timer interrupt
  * Called with interrupts disabled
@@ -1167,6 +1197,7 @@ void hrtimer_interrupt(struct clock_event_device *dev)
        struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
        struct hrtimer_clock_base *base;
        ktime_t expires_next, now;
+       int nr_retries = 0;
        int i;
 
        BUG_ON(!cpu_base->hres_active);
@@ -1174,6 +1205,10 @@ void hrtimer_interrupt(struct clock_event_device *dev)
        dev->next_event.tv64 = KTIME_MAX;
 
  retry:
+       /* 5 retries is enough to notice a hang */
+       if (!(++nr_retries % 5))
+               hrtimer_interrupt_hanging(dev, ktime_sub(ktime_get(), now));
+
        now = ktime_get();
 
        expires_next.tv64 = KTIME_MAX;
@@ -1226,7 +1261,7 @@ void hrtimer_interrupt(struct clock_event_device *dev)
 
        /* Reprogramming necessary ? */
        if (expires_next.tv64 != KTIME_MAX) {
-               if (tick_program_event(expires_next, 0))
+               if (tick_program_event(expires_next, force_clock_reprogram))
                        goto retry;
        }
 }
@@ -1580,6 +1615,10 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
                break;
 
 #ifdef CONFIG_HOTPLUG_CPU
+       case CPU_DYING:
+       case CPU_DYING_FROZEN:
+               clockevents_notify(CLOCK_EVT_NOTIFY_CPU_DYING, &scpu);
+               break;
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
        {
index c248eba..122fef4 100644 (file)
@@ -386,6 +386,7 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
 out_unlock:
        spin_unlock(&desc->lock);
 }
+EXPORT_SYMBOL_GPL(handle_level_irq);
 
 /**
  *     handle_fasteoi_irq - irq handler for transparent controllers
@@ -596,6 +597,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
        }
        spin_unlock_irqrestore(&desc->lock, flags);
 }
+EXPORT_SYMBOL_GPL(__set_irq_handler);
 
 void
 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
index 666260e..7f9b804 100644 (file)
@@ -78,7 +78,7 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
        desc = irq_desc_ptrs[irq];
 
        if (desc && old_desc != desc)
-                       goto out_unlock;
+               goto out_unlock;
 
        node = cpu_to_node(cpu);
        desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
@@ -97,10 +97,15 @@ static struct irq_desc *__real_move_irq_desc(struct irq_desc *old_desc,
        }
 
        irq_desc_ptrs[irq] = desc;
+       spin_unlock_irqrestore(&sparse_irq_lock, flags);
 
        /* free the old one */
        free_one_irq_desc(old_desc, desc);
+       spin_unlock(&old_desc->lock);
        kfree(old_desc);
+       spin_lock(&desc->lock);
+
+       return desc;
 
 out_unlock:
        spin_unlock_irqrestore(&sparse_irq_lock, flags);
index e8b51d4..ba22484 100644 (file)
@@ -573,13 +573,13 @@ static char last_unloaded_module[MODULE_NAME_LEN+1];
 /* Init the unload section of the module. */
 static void module_unload_init(struct module *mod)
 {
-       unsigned int i;
+       int cpu;
 
        INIT_LIST_HEAD(&mod->modules_which_use_me);
-       for (i = 0; i < NR_CPUS; i++)
-               local_set(&mod->ref[i].count, 0);
+       for_each_possible_cpu(cpu)
+               local_set(__module_ref_addr(mod, cpu), 0);
        /* Hold reference count during initialization. */
-       local_set(&mod->ref[raw_smp_processor_id()].count, 1);
+       local_set(__module_ref_addr(mod, raw_smp_processor_id()), 1);
        /* Backwards compatibility macros put refcount during init. */
        mod->waiter = current;
 }
@@ -717,10 +717,11 @@ static int try_stop_module(struct module *mod, int flags, int *forced)
 
 unsigned int module_refcount(struct module *mod)
 {
-       unsigned int i, total = 0;
+       unsigned int total = 0;
+       int cpu;
 
-       for (i = 0; i < NR_CPUS; i++)
-               total += local_read(&mod->ref[i].count);
+       for_each_possible_cpu(cpu)
+               total += local_read(__module_ref_addr(mod, cpu));
        return total;
 }
 EXPORT_SYMBOL(module_refcount);
@@ -894,7 +895,7 @@ void module_put(struct module *module)
 {
        if (module) {
                unsigned int cpu = get_cpu();
-               local_dec(&module->ref[cpu].count);
+               local_dec(__module_ref_addr(module, cpu));
                /* Maybe they're waiting for us to drop reference? */
                if (unlikely(!module_is_live(module)))
                        wake_up_process(module->waiter);
@@ -1464,7 +1465,10 @@ static void free_module(struct module *mod)
        kfree(mod->args);
        if (mod->percpu)
                percpu_modfree(mod->percpu);
-
+#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
+       if (mod->refptr)
+               percpu_modfree(mod->refptr);
+#endif
        /* Free lock-classes: */
        lockdep_free_key_range(mod->module_core, mod->core_size);
 
@@ -2011,6 +2015,14 @@ static noinline struct module *load_module(void __user *umod,
        if (err < 0)
                goto free_mod;
 
+#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
+       mod->refptr = percpu_modalloc(sizeof(local_t), __alignof__(local_t),
+                                     mod->name);
+       if (!mod->refptr) {
+               err = -ENOMEM;
+               goto free_mod;
+       }
+#endif
        if (pcpuindex) {
                /* We have a special allocation for this section. */
                percpu = percpu_modalloc(sechdrs[pcpuindex].sh_size,
@@ -2018,7 +2030,7 @@ static noinline struct module *load_module(void __user *umod,
                                         mod->name);
                if (!percpu) {
                        err = -ENOMEM;
-                       goto free_mod;
+                       goto free_percpu;
                }
                sechdrs[pcpuindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
                mod->percpu = percpu;
@@ -2282,6 +2294,9 @@ static noinline struct module *load_module(void __user *umod,
  free_percpu:
        if (percpu)
                percpu_modfree(percpu);
+#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
+       percpu_modfree(mod->refptr);
+#endif
  free_mod:
        kfree(args);
  free_hdr:
index c71d7d5..4007561 100644 (file)
@@ -2266,6 +2266,16 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
        if (!sched_feat(SYNC_WAKEUPS))
                sync = 0;
 
+       if (!sync) {
+               if (current->se.avg_overlap < sysctl_sched_migration_cost &&
+                         p->se.avg_overlap < sysctl_sched_migration_cost)
+                       sync = 1;
+       } else {
+               if (current->se.avg_overlap >= sysctl_sched_migration_cost ||
+                         p->se.avg_overlap >= sysctl_sched_migration_cost)
+                       sync = 0;
+       }
+
 #ifdef CONFIG_SMP
        if (sched_feat(LB_WAKEUP_UPDATE)) {
                struct sched_domain *sd;
index 5cc1c16..a7e50ba 100644 (file)
@@ -719,7 +719,7 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup)
                __enqueue_entity(cfs_rq, se);
 }
 
-static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
+static void __clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
        if (cfs_rq->last == se)
                cfs_rq->last = NULL;
@@ -728,6 +728,12 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
                cfs_rq->next = NULL;
 }
 
+static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
+{
+       for_each_sched_entity(se)
+               __clear_buddies(cfs_rq_of(se), se);
+}
+
 static void
 dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
 {
@@ -768,8 +774,14 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 
        ideal_runtime = sched_slice(cfs_rq, curr);
        delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
-       if (delta_exec > ideal_runtime)
+       if (delta_exec > ideal_runtime) {
                resched_task(rq_of(cfs_rq)->curr);
+               /*
+                * The current task ran long enough, ensure it doesn't get
+                * re-elected due to buddy favours.
+                */
+               clear_buddies(cfs_rq, curr);
+       }
 }
 
 static void
@@ -1179,20 +1191,15 @@ wake_affine(struct sched_domain *this_sd, struct rq *this_rq,
            int idx, unsigned long load, unsigned long this_load,
            unsigned int imbalance)
 {
-       struct task_struct *curr = this_rq->curr;
-       struct task_group *tg;
        unsigned long tl = this_load;
        unsigned long tl_per_task;
+       struct task_group *tg;
        unsigned long weight;
        int balanced;
 
        if (!(this_sd->flags & SD_WAKE_AFFINE) || !sched_feat(AFFINE_WAKEUPS))
                return 0;
 
-       if (sync && (curr->se.avg_overlap > sysctl_sched_migration_cost ||
-                       p->se.avg_overlap > sysctl_sched_migration_cost))
-               sync = 0;
-
        /*
         * If sync wakeup then subtract the (maximum possible)
         * effect of the currently running task from the load
@@ -1419,9 +1426,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)
        if (!sched_feat(WAKEUP_PREEMPT))
                return;
 
-       if (sched_feat(WAKEUP_OVERLAP) && (sync ||
-                       (se->avg_overlap < sysctl_sched_migration_cost &&
-                        pse->avg_overlap < sysctl_sched_migration_cost))) {
+       if (sched_feat(WAKEUP_OVERLAP) && sync) {
                resched_task(curr);
                return;
        }
@@ -1452,6 +1457,11 @@ static struct task_struct *pick_next_task_fair(struct rq *rq)
 
        do {
                se = pick_next_entity(cfs_rq);
+               /*
+                * If se was a buddy, clear it so that it will have to earn
+                * the favour again.
+                */
+               __clear_buddies(cfs_rq, se);
                set_next_entity(cfs_rq, se);
                cfs_rq = group_cfs_rq(se);
        } while (cfs_rq);
index e737597..b6b3676 100644 (file)
@@ -909,7 +909,9 @@ static void print_fatal_signal(struct pt_regs *regs, int signr)
        }
 #endif
        printk("\n");
+       preempt_disable();
        show_regs(regs);
+       preempt_enable();
 }
 
 static int __init setup_print_fatal_signals(char *str)
index 5cfa0e5..bbedbb7 100644 (file)
@@ -18,6 +18,7 @@ __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_function_lock);
 enum {
        CSD_FLAG_WAIT           = 0x01,
        CSD_FLAG_ALLOC          = 0x02,
+       CSD_FLAG_LOCK           = 0x04,
 };
 
 struct call_function_data {
@@ -186,6 +187,9 @@ void generic_smp_call_function_single_interrupt(void)
                        if (data_flags & CSD_FLAG_WAIT) {
                                smp_wmb();
                                data->flags &= ~CSD_FLAG_WAIT;
+                       } else if (data_flags & CSD_FLAG_LOCK) {
+                               smp_wmb();
+                               data->flags &= ~CSD_FLAG_LOCK;
                        } else if (data_flags & CSD_FLAG_ALLOC)
                                kfree(data);
                }
@@ -196,6 +200,8 @@ void generic_smp_call_function_single_interrupt(void)
        }
 }
 
+static DEFINE_PER_CPU(struct call_single_data, csd_data);
+
 /*
  * smp_call_function_single - Run a function on a specific CPU
  * @func: The function to run. This must be fast and non-blocking.
@@ -224,14 +230,38 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
                func(info);
                local_irq_restore(flags);
        } else if ((unsigned)cpu < nr_cpu_ids && cpu_online(cpu)) {
-               struct call_single_data *data = NULL;
+               struct call_single_data *data;
 
                if (!wait) {
+                       /*
+                        * We are calling a function on a single CPU
+                        * and we are not going to wait for it to finish.
+                        * We first try to allocate the data, but if we
+                        * fail, we fall back to use a per cpu data to pass
+                        * the information to that CPU. Since all callers
+                        * of this code will use the same data, we must
+                        * synchronize the callers to prevent a new caller
+                        * from corrupting the data before the callee
+                        * can access it.
+                        *
+                        * The CSD_FLAG_LOCK is used to let us know when
+                        * the IPI handler is done with the data.
+                        * The first caller will set it, and the callee
+                        * will clear it. The next caller must wait for
+                        * it to clear before we set it again. This
+                        * will make sure the callee is done with the
+                        * data before a new caller will use it.
+                        */
                        data = kmalloc(sizeof(*data), GFP_ATOMIC);
                        if (data)
                                data->flags = CSD_FLAG_ALLOC;
-               }
-               if (!data) {
+                       else {
+                               data = &per_cpu(csd_data, me);
+                               while (data->flags & CSD_FLAG_LOCK)
+                                       cpu_relax();
+                               data->flags = CSD_FLAG_LOCK;
+                       }
+               } else {
                        data = &d;
                        data->flags = CSD_FLAG_WAIT;
                }
index 63e05d4..21a5ca8 100644 (file)
@@ -274,6 +274,21 @@ out_bc:
 }
 
 /*
+ * Transfer the do_timer job away from a dying cpu.
+ *
+ * Called with interrupts disabled.
+ */
+static void tick_handover_do_timer(int *cpup)
+{
+       if (*cpup == tick_do_timer_cpu) {
+               int cpu = cpumask_first(cpu_online_mask);
+
+               tick_do_timer_cpu = (cpu < nr_cpu_ids) ? cpu :
+                       TICK_DO_TIMER_NONE;
+       }
+}
+
+/*
  * Shutdown an event device on a given cpu:
  *
  * This is called on a life CPU, when a CPU is dead. So we cannot
@@ -297,13 +312,6 @@ static void tick_shutdown(unsigned int *cpup)
                clockevents_exchange_device(dev, NULL);
                td->evtdev = NULL;
        }
-       /* Transfer the do_timer job away from this cpu */
-       if (*cpup == tick_do_timer_cpu) {
-               int cpu = cpumask_first(cpu_online_mask);
-
-               tick_do_timer_cpu = (cpu < nr_cpu_ids) ? cpu :
-                       TICK_DO_TIMER_NONE;
-       }
        spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
@@ -357,6 +365,10 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason,
                tick_broadcast_oneshot_control(reason);
                break;
 
+       case CLOCK_EVT_NOTIFY_CPU_DYING:
+               tick_handover_do_timer(dev);
+               break;
+
        case CLOCK_EVT_NOTIFY_CPU_DEAD:
                tick_shutdown_broadcast_oneshot(dev);
                tick_shutdown_broadcast(dev);
index 2f32969..7dcf6e9 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/clocksource.h>
 #include <linux/kallsyms.h>
 #include <linux/seq_file.h>
+#include <linux/suspend.h>
 #include <linux/debugfs.h>
 #include <linux/hardirq.h>
 #include <linux/kthread.h>
@@ -1965,6 +1966,7 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
 static atomic_t ftrace_graph_active;
+static struct notifier_block ftrace_suspend_notifier;
 
 int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
 {
@@ -2043,6 +2045,27 @@ static int start_graph_tracing(void)
        return ret;
 }
 
+/*
+ * Hibernation protection.
+ * The state of the current task is too much unstable during
+ * suspend/restore to disk. We want to protect against that.
+ */
+static int
+ftrace_suspend_notifier_call(struct notifier_block *bl, unsigned long state,
+                                                       void *unused)
+{
+       switch (state) {
+       case PM_HIBERNATION_PREPARE:
+               pause_graph_tracing();
+               break;
+
+       case PM_POST_HIBERNATION:
+               unpause_graph_tracing();
+               break;
+       }
+       return NOTIFY_DONE;
+}
+
 int register_ftrace_graph(trace_func_graph_ret_t retfunc,
                        trace_func_graph_ent_t entryfunc)
 {
@@ -2050,6 +2073,9 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc,
 
        mutex_lock(&ftrace_sysctl_lock);
 
+       ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
+       register_pm_notifier(&ftrace_suspend_notifier);
+
        atomic_inc(&ftrace_graph_active);
        ret = start_graph_tracing();
        if (ret) {
@@ -2075,6 +2101,7 @@ void unregister_ftrace_graph(void)
        ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub;
        ftrace_graph_entry = ftrace_graph_entry_stub;
        ftrace_shutdown(FTRACE_STOP_FUNC_RET);
+       unregister_pm_notifier(&ftrace_suspend_notifier);
 
        mutex_unlock(&ftrace_sysctl_lock);
 }
index 8b0daf0..bd38c5c 100644 (file)
@@ -246,7 +246,7 @@ static inline int test_time_stamp(u64 delta)
        return 0;
 }
 
-#define BUF_PAGE_SIZE (PAGE_SIZE - sizeof(struct buffer_data_page))
+#define BUF_PAGE_SIZE (PAGE_SIZE - offsetof(struct buffer_data_page, data))
 
 /*
  * head_page == tail_page && head == tail then buffer is empty.
@@ -1025,12 +1025,8 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
                }
 
                if (next_page == head_page) {
-                       if (!(buffer->flags & RB_FL_OVERWRITE)) {
-                               /* reset write */
-                               if (tail <= BUF_PAGE_SIZE)
-                                       local_set(&tail_page->write, tail);
+                       if (!(buffer->flags & RB_FL_OVERWRITE))
                                goto out_unlock;
-                       }
 
                        /* tail_page has not moved yet? */
                        if (tail_page == cpu_buffer->tail_page) {
@@ -1105,6 +1101,10 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
        return event;
 
  out_unlock:
+       /* reset write */
+       if (tail <= BUF_PAGE_SIZE)
+               local_set(&tail_page->write, tail);
+
        __raw_spin_unlock(&cpu_buffer->lock);
        local_irq_restore(flags);
        return NULL;
@@ -2174,6 +2174,9 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
 
        cpu_buffer->overrun = 0;
        cpu_buffer->entries = 0;
+
+       cpu_buffer->write_stamp = 0;
+       cpu_buffer->read_stamp = 0;
 }
 
 /**
index c580233..17bb88d 100644 (file)
@@ -40,7 +40,7 @@
 
 #define TRACE_BUFFER_FLAGS     (RB_FL_OVERWRITE)
 
-unsigned long __read_mostly    tracing_max_latency = (cycle_t)ULONG_MAX;
+unsigned long __read_mostly    tracing_max_latency;
 unsigned long __read_mostly    tracing_thresh;
 
 /*
@@ -3736,7 +3736,7 @@ static struct notifier_block trace_die_notifier = {
  * it if we decide to change what log level the ftrace dump
  * should be at.
  */
-#define KERN_TRACE             KERN_INFO
+#define KERN_TRACE             KERN_EMERG
 
 static void
 trace_printk_seq(struct trace_seq *s)
@@ -3770,6 +3770,7 @@ void ftrace_dump(void)
        dump_ran = 1;
 
        /* No turning back! */
+       tracing_off();
        ftrace_kill();
 
        for_each_tracing_cpu(cpu) {
index 7c2e326..62a78d9 100644 (file)
@@ -380,6 +380,7 @@ static void stop_irqsoff_tracer(struct trace_array *tr)
 
 static void __irqsoff_tracer_init(struct trace_array *tr)
 {
+       tracing_max_latency = 0;
        irqsoff_trace = tr;
        /* make sure that the tracer is visible */
        smp_wmb();
index 43586b6..42ae1e7 100644 (file)
@@ -333,6 +333,7 @@ static void stop_wakeup_tracer(struct trace_array *tr)
 
 static int wakeup_tracer_init(struct trace_array *tr)
 {
+       tracing_max_latency = 0;
        wakeup_trace = tr;
        start_wakeup_tracer(tr);
        return 0;
index 2904a34..028ec48 100644 (file)
@@ -294,14 +294,10 @@ static inline int __mlock_posix_error_return(long retval)
  *
  * return number of pages [> 0] to be removed from locked_vm on success
  * of "special" vmas.
- *
- * return negative error if vma spanning @start-@range disappears while
- * mmap semaphore is dropped.  Unlikely?
  */
 long mlock_vma_pages_range(struct vm_area_struct *vma,
                        unsigned long start, unsigned long end)
 {
-       struct mm_struct *mm = vma->vm_mm;
        int nr_pages = (end - start) / PAGE_SIZE;
        BUG_ON(!(vma->vm_flags & VM_LOCKED));
 
@@ -314,20 +310,8 @@ long mlock_vma_pages_range(struct vm_area_struct *vma,
        if (!((vma->vm_flags & (VM_DONTEXPAND | VM_RESERVED)) ||
                        is_vm_hugetlb_page(vma) ||
                        vma == get_gate_vma(current))) {
-               long error;
-               downgrade_write(&mm->mmap_sem);
-
-               error = __mlock_vma_pages_range(vma, start, end, 1);
 
-               up_read(&mm->mmap_sem);
-               /* vma can change or disappear */
-               down_write(&mm->mmap_sem);
-               vma = find_vma(mm, start);
-               /* non-NULL vma must contain @start, but need to check @end */
-               if (!vma ||  end > vma->vm_end)
-                       return -ENOMEM;
-
-               return 0;       /* hide other errors from mmap(), et al */
+               return __mlock_vma_pages_range(vma, start, end, 1);
        }
 
        /*
@@ -438,41 +422,14 @@ success:
        vma->vm_flags = newflags;
 
        if (lock) {
-               /*
-                * mmap_sem is currently held for write.  Downgrade the write
-                * lock to a read lock so that other faults, mmap scans, ...
-                * while we fault in all pages.
-                */
-               downgrade_write(&mm->mmap_sem);
-
                ret = __mlock_vma_pages_range(vma, start, end, 1);
 
-               /*
-                * Need to reacquire mmap sem in write mode, as our callers
-                * expect this.  We have no support for atomically upgrading
-                * a sem to write, so we need to check for ranges while sem
-                * is unlocked.
-                */
-               up_read(&mm->mmap_sem);
-               /* vma can change or disappear */
-               down_write(&mm->mmap_sem);
-               *prev = find_vma(mm, start);
-               /* non-NULL *prev must contain @start, but need to check @end */
-               if (!(*prev) || end > (*prev)->vm_end)
-                       ret = -ENOMEM;
-               else if (ret > 0) {
+               if (ret > 0) {
                        mm->locked_vm -= ret;
                        ret = 0;
                } else
                        ret = __mlock_posix_error_return(ret); /* translate if needed */
        } else {
-               /*
-                * TODO:  for unlocking, pages will already be resident, so
-                * we don't need to wait for allocations/reclaim/pagein, ...
-                * However, unlocking a very large region can still take a
-                * while.  Should we downgrade the semaphore for both lock
-                * AND unlock ?
-                */
                __mlock_vma_pages_range(vma, start, end, 0);
        }
 
index c581df1..214b6a2 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1090,6 +1090,15 @@ int vma_wants_writenotify(struct vm_area_struct *vma)
                mapping_cap_account_dirty(vma->vm_file->f_mapping);
 }
 
+/*
+ * We account for memory if it's a private writeable mapping,
+ * and VM_NORESERVE wasn't set.
+ */
+static inline int accountable_mapping(unsigned int vm_flags)
+{
+       return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE;
+}
+
 unsigned long mmap_region(struct file *file, unsigned long addr,
                          unsigned long len, unsigned long flags,
                          unsigned int vm_flags, unsigned long pgoff,
@@ -1117,23 +1126,24 @@ munmap_back:
        if (!may_expand_vm(mm, len >> PAGE_SHIFT))
                return -ENOMEM;
 
-       if (flags & MAP_NORESERVE)
+       /*
+        * Set 'VM_NORESERVE' if we should not account for the
+        * memory use of this mapping. We only honor MAP_NORESERVE
+        * if we're allowed to overcommit memory.
+        */
+       if ((flags & MAP_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER)
+               vm_flags |= VM_NORESERVE;
+       if (!accountable)
                vm_flags |= VM_NORESERVE;
 
-       if (accountable && (!(flags & MAP_NORESERVE) ||
-                           sysctl_overcommit_memory == OVERCOMMIT_NEVER)) {
-               if (vm_flags & VM_SHARED) {
-                       /* Check memory availability in shmem_file_setup? */
-                       vm_flags |= VM_ACCOUNT;
-               } else if (vm_flags & VM_WRITE) {
-                       /*
-                        * Private writable mapping: check memory availability
-                        */
-                       charged = len >> PAGE_SHIFT;
-                       if (security_vm_enough_memory(charged))
-                               return -ENOMEM;
-                       vm_flags |= VM_ACCOUNT;
-               }
+       /*
+        * Private writable mapping: check memory availability
+        */
+       if (accountable_mapping(vm_flags)) {
+               charged = len >> PAGE_SHIFT;
+               if (security_vm_enough_memory(charged))
+                       return -ENOMEM;
+               vm_flags |= VM_ACCOUNT;
        }
 
        /*
@@ -1184,14 +1194,6 @@ munmap_back:
                        goto free_vma;
        }
 
-       /* We set VM_ACCOUNT in a shared mapping's vm_flags, to inform
-        * shmem_zero_setup (perhaps called through /dev/zero's ->mmap)
-        * that memory reservation must be checked; but that reservation
-        * belongs to shared memory object, not to vma: so now clear it.
-        */
-       if ((vm_flags & (VM_SHARED|VM_ACCOUNT)) == (VM_SHARED|VM_ACCOUNT))
-               vma->vm_flags &= ~VM_ACCOUNT;
-
        /* Can addr have changed??
         *
         * Answer: Yes, several device drivers can do it in their
index 5d0de96..19d566c 100644 (file)
@@ -2628,7 +2628,7 @@ struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
                goto close_file;
 
 #ifdef CONFIG_SHMEM
-       SHMEM_I(inode)->flags = flags & VM_ACCOUNT;
+       SHMEM_I(inode)->flags = (flags & VM_NORESERVE) ? 0 : VM_ACCOUNT;
 #endif
        d_instantiate(dentry, inode);
        inode->i_size = size;
index 6392ae5..bdc9abb 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1996,7 +1996,7 @@ static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s,
 static void free_kmem_cache_cpu(struct kmem_cache_cpu *c, int cpu)
 {
        if (c < per_cpu(kmem_cache_cpu, cpu) ||
-                       c > per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) {
+                       c >= per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) {
                kfree(c);
                return;
        }
index d19a84b..228be55 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/pim.h>
 #include <net/addrconf.h>
 #include <linux/netfilter_ipv6.h>
+#include <net/ip6_checksum.h>
 
 /* Big lock, protecting vif table, mrt cache and mroute socket state.
    Note that the changes are semaphored via rtnl_lock.
index 5f94db2..9454d4a 100644 (file)
@@ -77,6 +77,7 @@
 #include <linux/poll.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/mutex.h>
 
 #ifdef CONFIG_INET
 #include <net/inet_common.h>
@@ -175,6 +176,7 @@ struct packet_sock {
 #endif
        struct packet_type      prot_hook;
        spinlock_t              bind_lock;
+       struct mutex            pg_vec_lock;
        unsigned int            running:1,      /* prot_hook is attached*/
                                auxdata:1,
                                origdev:1;
@@ -1069,6 +1071,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol)
         */
 
        spin_lock_init(&po->bind_lock);
+       mutex_init(&po->pg_vec_lock);
        po->prot_hook.func = packet_rcv;
 
        if (sock->type == SOCK_PACKET)
@@ -1865,6 +1868,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing
        synchronize_net();
 
        err = -EBUSY;
+       mutex_lock(&po->pg_vec_lock);
        if (closing || atomic_read(&po->mapped) == 0) {
                err = 0;
 #define XC(a, b) ({ __typeof__ ((a)) __t; __t = (a); (a) = (b); __t; })
@@ -1886,6 +1890,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing
                if (atomic_read(&po->mapped))
                        printk(KERN_DEBUG "packet_mmap: vma is busy: %d\n", atomic_read(&po->mapped));
        }
+       mutex_unlock(&po->pg_vec_lock);
 
        spin_lock(&po->bind_lock);
        if (was_running && !po->running) {
@@ -1918,7 +1923,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
 
        size = vma->vm_end - vma->vm_start;
 
-       lock_sock(sk);
+       mutex_lock(&po->pg_vec_lock);
        if (po->pg_vec == NULL)
                goto out;
        if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE)
@@ -1941,7 +1946,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
        err = 0;
 
 out:
-       release_sock(sk);
+       mutex_unlock(&po->pg_vec_lock);
        return err;
 }
 #endif
index 0bcf146..84714a6 100644 (file)
@@ -33,7 +33,7 @@ if SND_DRIVERS
 
 config SND_PCSP
        tristate "PC-Speaker support (READ HELP!)"
-       depends on PCSPKR_PLATFORM && X86_PC && HIGH_RES_TIMERS
+       depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS
        depends on INPUT
        depends on EXPERIMENTAL
        select SND_PCM