]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 27 Jun 2010 14:39:57 +0000 (07:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 27 Jun 2010 14:39:57 +0000 (07:39 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: usb/endpoint, fix dangling pointer use
  ALSA: asihpi - Get rid of incorrect "long" types and casts.
  ASoC: DaVinci: Fix McASP hardware FIFO configuration
  ALSA: hda - Fix line-in for mb5 model MacBook (Pro) 5,1 / 5,2
  ALSA: usb-audio: fix UAC2 control value queries
  ALSA: usb-audio: parse UAC2 sample rate ranges correctly
  ALSA: usb-audio: fix control messages for USB_RECIP_INTERFACE
  ALSA: usb-audio: add check for faulty clock in parse_audio_format_rates_v2()
  ALSA: hda - Don't check capture source mixer if no ADC is available

297 files changed:
Documentation/ABI/testing/sysfs-bus-pci
MAINTAINERS
Makefile
arch/alpha/include/asm/bitops.h
arch/alpha/kernel/Makefile
arch/alpha/kernel/ns87312.c [deleted file]
arch/alpha/kernel/pc873xx.c [new file with mode: 0644]
arch/alpha/kernel/pc873xx.h [new file with mode: 0644]
arch/alpha/kernel/pci-sysfs.c
arch/alpha/kernel/sys_sio.c
arch/arm/common/sa1111.c
arch/arm/mach-msm/dma.c
arch/arm/mach-nomadik/clock.c
arch/arm/mach-nomadik/clock.h
arch/arm/mach-nomadik/cpu-8815.c
arch/arm/mach-pxa/palmtc.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-ux500/Makefile
arch/arm/mach-ux500/clock.c
arch/arm/mach-ux500/clock.h
arch/arm/mach-ux500/cpu.c
arch/arm/mm/copypage-feroceon.c
arch/arm/mm/copypage-v4wb.c
arch/arm/mm/copypage-v4wt.c
arch/arm/mm/copypage-xsc3.c
arch/arm/mm/fault.c
arch/arm/mm/highmem.c
arch/arm/mm/init.c
arch/arm/plat-nomadik/timer.c
arch/arm/vfp/vfphw.S
arch/frv/kernel/gdb-stub.c
arch/ia64/kvm/kvm-ia64.c
arch/microblaze/include/asm/page.h
arch/microblaze/kernel/dma.c
arch/microblaze/pci/pci-common.c
arch/mn10300/unit-asb2305/pci-asb2305.c
arch/powerpc/Kconfig.debug
arch/powerpc/boot/Makefile
arch/powerpc/boot/addRamDisk.c [deleted file]
arch/powerpc/boot/dts/lite5200.dts
arch/powerpc/boot/dts/lite5200b.dts
arch/powerpc/configs/40x/acadia_defconfig
arch/powerpc/configs/40x/ep405_defconfig
arch/powerpc/configs/40x/hcu4_defconfig
arch/powerpc/configs/40x/kilauea_defconfig
arch/powerpc/configs/40x/makalu_defconfig
arch/powerpc/configs/40x/virtex_defconfig
arch/powerpc/configs/40x/walnut_defconfig
arch/powerpc/configs/44x/arches_defconfig
arch/powerpc/configs/44x/bamboo_defconfig
arch/powerpc/configs/44x/canyonlands_defconfig
arch/powerpc/configs/44x/ebony_defconfig
arch/powerpc/configs/44x/eiger_defconfig
arch/powerpc/configs/44x/katmai_defconfig
arch/powerpc/configs/44x/rainier_defconfig
arch/powerpc/configs/44x/redwood_defconfig
arch/powerpc/configs/44x/sam440ep_defconfig
arch/powerpc/configs/44x/sequoia_defconfig
arch/powerpc/configs/44x/taishan_defconfig
arch/powerpc/configs/44x/virtex5_defconfig
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/86xx/gef_ppc9a_defconfig
arch/powerpc/configs/86xx/gef_sbc310_defconfig
arch/powerpc/configs/86xx/gef_sbc610_defconfig
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
arch/powerpc/configs/86xx/sbc8641d_defconfig
arch/powerpc/configs/adder875_defconfig
arch/powerpc/configs/amigaone_defconfig
arch/powerpc/configs/c2k_defconfig
arch/powerpc/configs/cell_defconfig
arch/powerpc/configs/celleb_defconfig
arch/powerpc/configs/chrp32_defconfig
arch/powerpc/configs/ep8248e_defconfig
arch/powerpc/configs/ep88xc_defconfig
arch/powerpc/configs/g5_defconfig
arch/powerpc/configs/gamecube_defconfig
arch/powerpc/configs/holly_defconfig
arch/powerpc/configs/iseries_defconfig
arch/powerpc/configs/linkstation_defconfig
arch/powerpc/configs/maple_defconfig
arch/powerpc/configs/mgcoge_defconfig
arch/powerpc/configs/mgsuvd_defconfig
arch/powerpc/configs/mpc512x_defconfig
arch/powerpc/configs/mpc5200_defconfig
arch/powerpc/configs/mpc7448_hpc2_defconfig
arch/powerpc/configs/pasemi_defconfig
arch/powerpc/configs/pmac32_defconfig
arch/powerpc/configs/ppc40x_defconfig
arch/powerpc/configs/ppc44x_defconfig
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/configs/ppc64e_defconfig
arch/powerpc/configs/pq2fads_defconfig
arch/powerpc/configs/prpmc2800_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/configs/storcenter_defconfig
arch/powerpc/configs/wii_defconfig
arch/powerpc/include/asm/irq.h
arch/powerpc/include/asm/kdump.h
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/machine_kexec_64.c
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/misc_64.S
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kvm/e500.c
arch/powerpc/mm/pgtable_32.c
arch/powerpc/oprofile/op_model_cell.c
arch/powerpc/platforms/52xx/mpc52xx_pm.c
arch/powerpc/sysdev/mpic.c
arch/s390/appldata/appldata_os.c
arch/s390/defconfig
arch/s390/kernel/module.c
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/sigp.c
arch/s390/mm/extmem.c
arch/x86/include/asm/msr-index.h
arch/x86/include/asm/suspend_32.h
arch/x86/include/asm/suspend_64.h
arch/x86/kernel/e820.c
arch/x86/kvm/mmu.c
arch/x86/kvm/svm.c
arch/x86/pci/i386.c
arch/x86/power/cpu.c
drivers/acpi/acpi_pad.c
drivers/acpi/acpica/acconfig.h
drivers/acpi/acpica/acevents.h
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/achware.h
drivers/acpi/acpica/evgpe.c
drivers/acpi/acpica/evgpeblk.c
drivers/acpi/acpica/evxface.c
drivers/acpi/acpica/evxfevnt.c
drivers/acpi/acpica/exsystem.c
drivers/acpi/acpica/hwgpe.c
drivers/acpi/acpica/hwvalid.c
drivers/acpi/acpica/nsinit.c
drivers/acpi/blacklist.c
drivers/acpi/button.c
drivers/acpi/fan.c
drivers/acpi/processor_driver.c
drivers/acpi/sleep.c
drivers/acpi/system.c
drivers/acpi/wakeup.c
drivers/ata/libahci.c
drivers/ata/sata_sil24.c
drivers/ata/sata_via.c
drivers/char/tpm/tpm.h
drivers/char/vt.c
drivers/firewire/core-card.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nv50_fb.c
drivers/gpu/drm/nouveau/nv50_gpio.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_combios.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_fb.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
drivers/gpu/drm/radeon/radeon_pm.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
drivers/hwmon/i5k_amb.c
drivers/hwmon/k10temp.c
drivers/hwmon/k8temp.c
drivers/input/misc/hp_sdc_rtc.c
drivers/mmc/host/Kconfig
drivers/mtd/mtdchar.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/r852.c
drivers/net/8139cp.c
drivers/net/8139too.c
drivers/net/gianfar.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/phy/lxt.c
drivers/net/r8169.c
drivers/net/tulip/de2104x.c
drivers/net/usb/asix.c
drivers/net/wimax/i2400m/fw.c
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/p54/p54usb.c
drivers/net/wireless/wl12xx/wl1251_sdio.c
drivers/pci/hotplug/cpqphp_core.c
drivers/pci/intel-iommu.c
drivers/pci/pci-sysfs.c
drivers/pci/quirks.c
drivers/pci/setup-res.c
drivers/pci/slot.c
drivers/pcmcia/ds.c
drivers/pcmcia/yenta_socket.c
drivers/s390/cio/itcw.c
drivers/vhost/net.c
drivers/video/omap/lcdc.c
drivers/video/omap/rfbi.c
drivers/watchdog/at32ap700x_wdt.c
drivers/watchdog/imx2_wdt.c
drivers/watchdog/wm8350_wdt.c
fs/block_dev.c
fs/btrfs/acl.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/relocation.c
fs/btrfs/root-tree.c
fs/btrfs/super.c
fs/ceph/caps.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/mon_client.c
fs/ceph/super.c
fs/cifs/cifsfs.c
fs/cifs/cifsproto.h
fs/cifs/dir.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/sess.c
fs/jffs2/acl.c
fs/jffs2/dir.c
fs/jffs2/fs.c
fs/nfsd/nfs4state.c
fs/nfsd/vfs.c
fs/pipe.c
fs/proc/proc_devtree.c
fs/xfs/linux-2.6/xfs_aops.c
include/acpi/acexcep.h
include/acpi/acpixf.h
include/acpi/actypes.h
include/drm/radeon_drm.h
include/linux/miscdevice.h
include/linux/pci_ids.h
include/linux/skbuff.h
include/linux/suspend.h
include/linux/writeback.h
include/trace/events/ext4.h
include/trace/events/signal.h
init/main.c
kernel/perf_event.c
kernel/power/Kconfig
kernel/power/Makefile
kernel/power/nvs.c [moved from kernel/power/hibernate_nvs.c with 80% similarity]
kernel/power/suspend.c
mm/page-writeback.c
net/8021q/vlan_core.c
net/caif/cfrfml.c
net/caif/cfveil.c
net/core/dev.c
net/core/gen_estimator.c
net/core/pktgen.c
net/ipv4/ipmr.c
net/ipv6/icmp.c
net/ipv6/ip6mr.c
net/ipv6/mcast.c
net/mac80211/driver-ops.h
net/mac80211/mlme.c
net/mac80211/rx.c
scripts/Makefile.modbuiltin
scripts/mod/modpost.c
security/keys/keyctl.c
sound/soc/fsl/mpc5200_dma.h
sound/soc/pxa/spitz.c
tools/perf/util/symbol.c
virt/kvm/ioapic.c
virt/kvm/iommu.c

index 428676cfa61e51917d1fabf0b66e442c943c3768..25be3250f7d66f17c0a4d88974441ced8f4ca633 100644 (file)
@@ -133,46 +133,6 @@ Description:
                The symbolic link points to the PCI device sysfs entry of the
                Physical Function this device associates with.
 
-
-What:          /sys/bus/pci/slots/...
-Date:          April 2005 (possibly older)
-KernelVersion: 2.6.12 (possibly older)
-Contact:       linux-pci@vger.kernel.org
-Description:
-               When the appropriate driver is loaded, it will create a
-               directory per claimed physical PCI slot in
-               /sys/bus/pci/slots/.  The names of these directories are
-               specific to the driver, which in turn, are specific to the
-               platform, but in general, should match the label on the
-               machine's physical chassis.
-
-               The drivers that can create slot directories include the
-               PCI hotplug drivers, and as of 2.6.27, the pci_slot driver.
-
-               The slot directories contain, at a minimum, a file named
-               'address' which contains the PCI bus:device:function tuple.
-               Other files may appear as well, but are specific to the
-               driver.
-
-What:          /sys/bus/pci/slots/.../function[0-7]
-Date:          March 2010
-KernelVersion: 2.6.35
-Contact:       linux-pci@vger.kernel.org
-Description:
-               If PCI slot directories (as described above) are created,
-               and the physical slot is actually populated with a device,
-               symbolic links in the slot directory pointing to the
-               device's PCI functions are created as well.
-
-What:          /sys/bus/pci/devices/.../slot
-Date:          March 2010
-KernelVersion: 2.6.35
-Contact:       linux-pci@vger.kernel.org
-Description:
-               If PCI slot directories (as described above) are created,
-               a symbolic link pointing to the slot directory will be
-               created as well.
-
 What:          /sys/bus/pci/slots/.../module
 Date:          June 2009
 Contact:       linux-pci@vger.kernel.org
index 67accd730ac91a22dd12cf7fa47cc8d02061f8d8..b15f01e3a0dd23e2ebccc31736023f495a2a424e 100644 (file)
@@ -1581,7 +1581,7 @@ F:        include/linux/coda*.h
 
 COMMON INTERNET FILE SYSTEM (CIFS)
 M:     Steve French <sfrench@samba.org>
-L:     linux-cifs-client@lists.samba.org (moderated for non-subscribers)
+L:     linux-cifs@vger.kernel.org
 L:     samba-technical@lists.samba.org (moderated for non-subscribers)
 W:     http://linux-cifs.samba.org/
 Q:     http://patchwork.ozlabs.org/project/linux-cifs-client/list/
@@ -2978,7 +2978,6 @@ F:        drivers/net/ixgb/
 F:     drivers/net/ixgbe/
 
 INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
-M:     Zhu Yi <yi.zhu@intel.com>
 M:     Reinette Chatre <reinette.chatre@intel.com>
 M:     Intel Linux Wireless <ilw@linux.intel.com>
 L:     linux-wireless@vger.kernel.org
@@ -2988,7 +2987,6 @@ F:        Documentation/networking/README.ipw2100
 F:     drivers/net/wireless/ipw2x00/ipw2100.*
 
 INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
-M:     Zhu Yi <yi.zhu@intel.com>
 M:     Reinette Chatre <reinette.chatre@intel.com>
 M:     Intel Linux Wireless <ilw@linux.intel.com>
 L:     linux-wireless@vger.kernel.org
@@ -3019,8 +3017,8 @@ F:        drivers/net/wimax/i2400m/
 F:     include/linux/wimax/i2400m.h
 
 INTEL WIRELESS WIFI LINK (iwlwifi)
-M:     Zhu Yi <yi.zhu@intel.com>
 M:     Reinette Chatre <reinette.chatre@intel.com>
+M:     Wey-Yi Guy <wey-yi.w.guy@intel.com>
 M:     Intel Linux Wireless <ilw@linux.intel.com>
 L:     linux-wireless@vger.kernel.org
 W:     http://intellinuxwireless.org
@@ -3030,7 +3028,6 @@ F:        drivers/net/wireless/iwlwifi/
 
 INTEL WIRELESS MULTICOMM 3200 WIFI (iwmc3200wifi)
 M:     Samuel Ortiz <samuel.ortiz@intel.com>
-M:     Zhu Yi <yi.zhu@intel.com>
 M:     Intel Linux Wireless <ilw@linux.intel.com>
 L:     linux-wireless@vger.kernel.org
 S:     Supported
@@ -4215,6 +4212,7 @@ OPEN FIRMWARE AND FLATTENED DEVICE TREE
 M:     Grant Likely <grant.likely@secretlab.ca>
 L:     devicetree-discuss@lists.ozlabs.org
 W:     http://fdt.secretlab.ca
+T:     git git://git.secretlab.ca/git/linux-2.6.git
 S:     Maintained
 F:     drivers/of
 F:     include/linux/of*.h
@@ -5387,6 +5385,7 @@ M:        David Brownell <dbrownell@users.sourceforge.net>
 M:     Grant Likely <grant.likely@secretlab.ca>
 L:     spi-devel-general@lists.sourceforge.net
 Q:     http://patchwork.kernel.org/project/spi-devel-general/list/
+T:     git git://git.secretlab.ca/git/linux-2.6.git
 S:     Maintained
 F:     Documentation/spi/
 F:     drivers/spi/
index 654c31aaec64a4a091807034d47c2f284836795a..662e820cfc4ae754f9e82c69a9821401ab0d7eb5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 35
-EXTRAVERSION = -rc2
+EXTRAVERSION = -rc3
 NAME = Sheep on Meth
 
 # *DOCUMENTATION*
@@ -944,7 +944,7 @@ ifdef CONFIG_LOCALVERSION_AUTO
        localver-extra = $(scm-identifier)
 else
        ifneq ($(scm-identifier),)
-               ifeq ($(LOCALVERSION),)
+               ifeq ("$(origin LOCALVERSION)", "undefined")
                        localver-extra = +
                endif
        endif
@@ -1095,7 +1095,7 @@ all: modules
 #      using awk while concatenating to the final file.
 
 PHONY += modules
-modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
+modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
        $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
        @$(kecho) '  Building modules, stage 2.';
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1117,7 +1117,7 @@ PHONY += modules_install
 modules_install: _modinst_ _modinst_post
 
 PHONY += _modinst_
-_modinst_: modules.builtin
+_modinst_:
        @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
                echo "Warning: you may need to install module-init-tools"; \
                echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\
index 1dce24bc455a7ff9a13495517c53743a142cd49d..adfab8a21dfe95714700580a58795da1f6f5d634 100644 (file)
@@ -410,7 +410,7 @@ static inline unsigned long __arch_hweight64(unsigned long w)
        return __kernel_ctpop(w);
 }
 
-static inline unsigned int __arch_weight32(unsigned int w)
+static inline unsigned int __arch_hweight32(unsigned int w)
 {
        return __arch_hweight64(w);
 }
index 7739a62440a7a7027e241385171827189f783dd8..5a62fb46ef20b60759db3c7fdb68dad4daf3e525 100644 (file)
@@ -35,7 +35,7 @@ endif
 
 obj-y   += irq_pyxis.o irq_i8259.o irq_srm.o
 obj-y   += err_ev6.o
-obj-y   += es1888.o smc37c669.o smc37c93x.o ns87312.o gct.o
+obj-y   += es1888.o smc37c669.o smc37c93x.o pc873xx.o gct.o
 obj-y    += srmcons.o
 
 else
@@ -63,11 +63,11 @@ obj-$(CONFIG_ALPHA_WILDFIRE)        += core_wildfire.o
 # Board support
 obj-$(CONFIG_ALPHA_ALCOR)      += sys_alcor.o irq_i8259.o irq_srm.o
 obj-$(CONFIG_ALPHA_CABRIOLET)  += sys_cabriolet.o irq_i8259.o irq_srm.o \
-                                  ns87312.o
+                                  pc873xx.o
 obj-$(CONFIG_ALPHA_EB164)      += sys_cabriolet.o irq_i8259.o irq_srm.o \
-                                  ns87312.o
+                                  pc873xx.o
 obj-$(CONFIG_ALPHA_EB66P)      += sys_cabriolet.o irq_i8259.o irq_srm.o \
-                                  ns87312.o
+                                  pc873xx.o
 obj-$(CONFIG_ALPHA_LX164)      += sys_cabriolet.o irq_i8259.o irq_srm.o \
                                   smc37c93x.o
 obj-$(CONFIG_ALPHA_PC164)      += sys_cabriolet.o irq_i8259.o irq_srm.o \
@@ -90,14 +90,14 @@ obj-$(CONFIG_ALPHA_RUFFIAN) += sys_ruffian.o irq_pyxis.o irq_i8259.o
 obj-$(CONFIG_ALPHA_RX164)      += sys_rx164.o irq_i8259.o
 obj-$(CONFIG_ALPHA_SABLE)      += sys_sable.o
 obj-$(CONFIG_ALPHA_LYNX)       += sys_sable.o
-obj-$(CONFIG_ALPHA_BOOK1)      += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
-obj-$(CONFIG_ALPHA_AVANTI)     += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
-obj-$(CONFIG_ALPHA_NONAME)     += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
-obj-$(CONFIG_ALPHA_P2K)                += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
-obj-$(CONFIG_ALPHA_XL)         += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
+obj-$(CONFIG_ALPHA_BOOK1)      += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
+obj-$(CONFIG_ALPHA_AVANTI)     += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
+obj-$(CONFIG_ALPHA_NONAME)     += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
+obj-$(CONFIG_ALPHA_P2K)                += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
+obj-$(CONFIG_ALPHA_XL)         += sys_sio.o irq_i8259.o irq_srm.o pc873xx.o
 obj-$(CONFIG_ALPHA_SX164)      += sys_sx164.o irq_pyxis.o irq_i8259.o \
                                   irq_srm.o smc37c669.o
-obj-$(CONFIG_ALPHA_TAKARA)     += sys_takara.o irq_i8259.o ns87312.o
+obj-$(CONFIG_ALPHA_TAKARA)     += sys_takara.o irq_i8259.o pc873xx.o
 obj-$(CONFIG_ALPHA_WILDFIRE)   += sys_wildfire.o irq_i8259.o
 
 # Error support
diff --git a/arch/alpha/kernel/ns87312.c b/arch/alpha/kernel/ns87312.c
deleted file mode 100644 (file)
index 342b56d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *     linux/arch/alpha/kernel/ns87312.c
- */
-
-#include <linux/init.h>
-#include <asm/io.h>
-#include "proto.h"
-
-
-/*
- * The SRM console *disables* the IDE interface, this code ensures it's
- * enabled.
- *
- * This code bangs on a control register of the 87312 Super I/O chip
- * that implements parallel port/serial ports/IDE/FDI.  Depending on
- * the motherboard, the Super I/O chip can be configured through a
- * pair of registers that are located either at I/O ports 0x26e/0x26f
- * or 0x398/0x399.  Unfortunately, autodetecting which base address is
- * in use works only once (right after a reset).  The Super I/O chip
- * has the additional quirk that configuration register data must be
- * written twice (I believe this is a safety feature to prevent
- * accidental modification---fun, isn't it?).
- */
-
-void __init
-ns87312_enable_ide(long ide_base)
-{
-       int data;
-       unsigned long flags;
-
-       local_irq_save(flags);
-       outb(0, ide_base);              /* set the index register for reg #0 */
-       data = inb(ide_base+1);         /* read the current contents */
-       outb(0, ide_base);              /* set the index register for reg #0 */
-       outb(data | 0x40, ide_base+1);  /* turn on IDE */
-       outb(data | 0x40, ide_base+1);  /* turn on IDE, really! */
-       local_irq_restore(flags);
-}
diff --git a/arch/alpha/kernel/pc873xx.c b/arch/alpha/kernel/pc873xx.c
new file mode 100644 (file)
index 0000000..27dcbff
--- /dev/null
@@ -0,0 +1,88 @@
+#include <linux/ioport.h>
+#include <asm/io.h>
+
+#include "pc873xx.h"
+
+static unsigned pc873xx_probelist[] = {0x398, 0x26e, 0};
+
+static char *pc873xx_names[] = {
+       "PC87303", "PC87306", "PC87312", "PC87332", "PC87334"
+};
+
+static unsigned int base, model;
+
+
+unsigned int __init pc873xx_get_base()
+{
+       return base;
+}
+
+char *__init pc873xx_get_model()
+{
+       return pc873xx_names[model];
+}
+
+static unsigned char __init pc873xx_read(unsigned int base, int reg)
+{
+       outb(reg, base);
+       return inb(base + 1);
+}
+
+static void __init pc873xx_write(unsigned int base, int reg, unsigned char data)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       outb(reg, base);
+       outb(data, base + 1);
+       outb(data, base + 1);           /* Must be written twice */
+       local_irq_restore(flags);
+}
+
+int __init pc873xx_probe(void)
+{
+       int val, index = 0;
+
+       while ((base = pc873xx_probelist[index++])) {
+
+               if (request_region(base, 2, "Super IO PC873xx") == NULL)
+                       continue;
+
+               val = pc873xx_read(base, REG_SID);
+               if ((val & 0xf0) == 0x10) {
+                       model = PC87332;
+                       break;
+               } else if ((val & 0xf8) == 0x70) {
+                       model = PC87306;
+                       break;
+               } else if ((val & 0xf8) == 0x50) {
+                       model = PC87334;
+                       break;
+               } else if ((val & 0xf8) == 0x40) {
+                       model = PC87303;
+                       break;
+               }
+
+               release_region(base, 2);
+       }
+
+       return (base == 0) ? -1 : 1;
+}
+
+void __init pc873xx_enable_epp19(void)
+{
+       unsigned char data;
+
+       printk(KERN_INFO "PC873xx enabling EPP v1.9\n");
+       data = pc873xx_read(base, REG_PCR);
+       pc873xx_write(base, REG_PCR, (data & 0xFC) | 0x02);
+}
+
+void __init pc873xx_enable_ide(void)
+{
+       unsigned char data;
+
+       printk(KERN_INFO "PC873xx enabling IDE interrupt\n");
+       data = pc873xx_read(base, REG_FER);
+       pc873xx_write(base, REG_FER, data | 0x40);
+}
diff --git a/arch/alpha/kernel/pc873xx.h b/arch/alpha/kernel/pc873xx.h
new file mode 100644 (file)
index 0000000..25e1695
--- /dev/null
@@ -0,0 +1,35 @@
+
+#ifndef _PC873xx_H_
+#define _PC873xx_H_
+
+/*
+ * Control Register Values
+ */
+#define REG_FER        0x00
+#define REG_FAR        0x01
+#define REG_PTR        0x02
+#define REG_FCR        0x03
+#define REG_PCR        0x04
+#define REG_KRR        0x05
+#define REG_PMC        0x06
+#define REG_TUP        0x07
+#define REG_SID        0x08
+#define REG_ASC        0x09
+#define REG_IRC        0x0e
+
+/*
+ * Model numbers
+ */
+#define PC87303        0
+#define PC87306        1
+#define PC87312        2
+#define PC87332        3
+#define PC87334        4
+
+int pc873xx_probe(void);
+unsigned int pc873xx_get_base(void);
+char *pc873xx_get_model(void);
+void pc873xx_enable_epp19(void);
+void pc873xx_enable_ide(void);
+
+#endif
index a5fffc882c72f78429545cea81d5575ec16d11f2..738fc824e2ea373f85b3ae04fb7eb1346ecacdac 100644 (file)
@@ -53,7 +53,6 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
 
 /**
  * pci_mmap_resource - map a PCI resource into user memory space
- * @filp: open sysfs file
  * @kobj: kobject for mapping
  * @attr: struct bin_attribute for the file being mapped
  * @vma: struct vm_area_struct passed into the mmap
@@ -61,7 +60,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
  *
  * Use the bus mapping routines to map a PCI resource into userspace.
  */
-static int pci_mmap_resource(struct file *filp, struct kobject *kobj,
+static int pci_mmap_resource(struct kobject *kobj,
                             struct bin_attribute *attr,
                             struct vm_area_struct *vma, int sparse)
 {
index d4327e461c22156543e044eff59abc1ba628e0ad..85b4aea01ef8bcfee02fdcae4ddd9bd44d0cc91d 100644 (file)
@@ -34,6 +34,7 @@
 #include "irq_impl.h"
 #include "pci_impl.h"
 #include "machvec_impl.h"
+#include "pc873xx.h"
 
 #if defined(ALPHA_RESTORE_SRM_SETUP)
 /* Save LCA configuration data as the console had it set up.  */
@@ -208,7 +209,27 @@ noname_init_pci(void)
        common_init_pci();
        sio_pci_route();
        sio_fixup_irq_levels(sio_collect_irq_levels());
-       ns87312_enable_ide(0x26e);
+
+       if (pc873xx_probe() == -1) {
+               printk(KERN_ERR "Probing for PC873xx Super IO chip failed.\n");
+       } else {
+               printk(KERN_INFO "Found %s Super IO chip at 0x%x\n",
+                       pc873xx_get_model(), pc873xx_get_base());
+
+               /* Enabling things in the Super IO chip doesn't actually
+                * configure and enable things, the legacy drivers still
+                * need to do the actual configuration and enabling.
+                * This only unblocks them.
+                */
+
+#if !defined(CONFIG_ALPHA_AVANTI)
+               /* Don't bother on the Avanti family.
+                * None of them had on-board IDE.
+                */
+               pc873xx_enable_ide();
+#endif
+               pc873xx_enable_epp19();
+       }
 }
 
 static inline void __init
index a52a27c1d9be16f6eafb055a3bc95663b1ec6ce3..6f80665f477e70b0acad4d6ead228295446863c3 100644 (file)
@@ -951,8 +951,6 @@ static int sa1111_resume(struct platform_device *dev)
        if (!save)
                return 0;
 
-       spin_lock_irqsave(&sachip->lock, flags);
-
        /*
         * Ensure that the SA1111 is still here.
         * FIXME: shouldn't do this here.
@@ -969,6 +967,13 @@ static int sa1111_resume(struct platform_device *dev)
         * First of all, wake up the chip.
         */
        sa1111_wake(sachip);
+
+       /*
+        * Only lock for write ops. Also, sa1111_wake must be called with
+        * released spinlock!
+        */
+       spin_lock_irqsave(&sachip->lock, flags);
+
        sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0);
        sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1);
 
index d029d1f5f9e2c16343d9650afe4190531d1b635d..02cae5e2951c2d8ebc6cade2c582d5bb37d25d54 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
+#include <linux/completion.h>
 #include <mach/dma.h>
 
 #define MSM_DMOV_CHANNEL_COUNT 16
index 2c471fc451d743a590bd22c9cbdd07a985191c1d..f035f4185274160757e11d32377509defbdfb1b7 100644 (file)
@@ -32,7 +32,10 @@ void clk_disable(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_disable);
 
-/* We have a fixed clock alone, for now */
+static struct clk clk_24 = {
+       .rate = 2400000,
+};
+
 static struct clk clk_48 = {
        .rate = 48 * 1000 * 1000,
 };
@@ -50,6 +53,8 @@ static struct clk clk_default;
        }
 
 static struct clk_lookup lookups[] = {
+       CLK(&clk_24, "mtu0"),
+       CLK(&clk_24, "mtu1"),
        CLK(&clk_48, "uart0"),
        CLK(&clk_48, "uart1"),
        CLK(&clk_default, "gpio.0"),
@@ -59,10 +64,8 @@ static struct clk_lookup lookups[] = {
        CLK(&clk_default, "rng"),
 };
 
-static int __init clk_init(void)
+int __init clk_init(void)
 {
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
        return 0;
 }
-
-arch_initcall(clk_init);
index 5563985a2cc7debf405729fffa1ca82899d87598..78da2e7c3985041cec5de8a5f3a536ca08e9373e 100644 (file)
@@ -11,3 +11,5 @@
 struct clk {
        unsigned long           rate;
 };
+
+int __init clk_init(void);
index 91c3c901b469619a7fc58fb163114b62bd9696e8..ac58e3b03b1a5516e87379450ccffcd9dd4a1fb7 100644 (file)
@@ -31,6 +31,8 @@
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
 
+#include "clock.h"
+
 #define __MEM_4K_RESOURCE(x) \
        .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
 
@@ -143,6 +145,12 @@ void __init cpu8815_init_irq(void)
        /* This modified VIC cell has two register blocks, at 0 and 0x20 */
        vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START +  0, ~0, 0);
        vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0);
+
+       /*
+        * Init clocks here so that they are available for system timer
+        * initialization.
+        */
+       clk_init();
 }
 
 /*
index 033b567e50bbd372e37defbd1764943cd09cfa73..ce1104d1bc17862834f92473cbe304070e996457 100644 (file)
@@ -263,11 +263,11 @@ const struct matrix_keymap_data palmtc_keymap_data = {
        .keymap_size            = ARRAY_SIZE(palmtc_matrix_keys),
 };
 
-const static unsigned int palmtc_keypad_row_gpios[] = {
+static const unsigned int palmtc_keypad_row_gpios[] = {
        0, 9, 10, 11
 };
 
-const static unsigned int palmtc_keypad_col_gpios[] = {
+static const unsigned int palmtc_keypad_col_gpios[] = {
        18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 79, 80
 };
 
index 4d2413ed0ffa57b72c9c2b732c1d182f016a756e..c1048a35f187e990984a83111110671241ff1f93 100644 (file)
@@ -818,6 +818,9 @@ static struct i2c_board_info akita_i2c_board_info[] = {
                .type           = "max7310",
                .addr           = 0x18,
                .platform_data  = &akita_ioexp,
+       }, {
+               .type           = "wm8750",
+               .addr           = 0x1b,
        },
 };
 
index c7bc4199e3a8691e3a8e180d5291e556e79dd8cd..4556aea9c3c5acfcd1aa9ed860dffcd9e06cabaf 100644 (file)
@@ -7,4 +7,5 @@ obj-$(CONFIG_UX500_SOC_DB5500)  += cpu-db5500.o devices-db5500.o
 obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
 obj-$(CONFIG_MACH_U8500_MOP)   += board-mop500.o
 obj-$(CONFIG_MACH_U5500)       += board-u5500.o
-obj-$(CONFIG_SMP)              += platsmp.o headsmp.o localtimer.o
+obj-$(CONFIG_SMP)              += platsmp.o headsmp.o
+obj-$(CONFIG_LOCAL_TIMERS)     += localtimer.o
index 6544855af2f169d8fe31af7bf140f11e765c701c..fe84b9021c7adee213fdb94c7639c7f77e2dfaa5 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <asm/clkdev.h>
 
+#include <plat/mtu.h>
 #include <mach/hardware.h>
 #include "clock.h"
 
@@ -59,6 +60,9 @@
 #define PRCM_DMACLK_MGT                0x074
 #define PRCM_B2R2CLK_MGT       0x078
 #define PRCM_TVCLK_MGT         0x07C
+#define PRCM_TCR               0x1C8
+#define PRCM_TCR_STOPPED       (1 << 16)
+#define PRCM_TCR_DOZE_MODE     (1 << 17)
 #define PRCM_UNIPROCLK_MGT     0x278
 #define PRCM_SSPCLK_MGT                0x280
 #define PRCM_RNGCLK_MGT                0x284
@@ -120,10 +124,95 @@ void clk_disable(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_disable);
 
+/*
+ * The MTU has a separate, rather complex muxing setup
+ * with alternative parents (peripheral cluster or
+ * ULP or fixed 32768 Hz) depending on settings
+ */
+static unsigned long clk_mtu_get_rate(struct clk *clk)
+{
+       void __iomem *addr = __io_address(U8500_PRCMU_BASE)
+               + PRCM_TCR;
+       u32 tcr = readl(addr);
+       int mtu = (int) clk->data;
+       /*
+        * One of these is selected eventually
+        * TODO: Replace the constant with a reference
+        * to the ULP source once this is modeled.
+        */
+       unsigned long clk32k = 32768;
+       unsigned long mturate;
+       unsigned long retclk;
+
+       /* Get the rate from the parent as a default */
+       if (clk->parent_periph)
+               mturate = clk_get_rate(clk->parent_periph);
+       else if (clk->parent_cluster)
+               mturate = clk_get_rate(clk->parent_cluster);
+       else
+               /* We need to be connected SOMEWHERE */
+               BUG();
+
+       /*
+        * Are we in doze mode?
+        * In this mode the parent peripheral or the fixed 32768 Hz
+        * clock is fed into the block.
+        */
+       if (!(tcr & PRCM_TCR_DOZE_MODE)) {
+               /*
+                * Here we're using the clock input from the APE ULP
+                * clock domain. But first: are the timers stopped?
+                */
+               if (tcr & PRCM_TCR_STOPPED) {
+                       clk32k = 0;
+                       mturate = 0;
+               } else {
+                       /* Else default mode: 0 and 2.4 MHz */
+                       clk32k = 0;
+                       if (cpu_is_u5500())
+                               /* DB5500 divides by 8 */
+                               mturate /= 8;
+                       else if (cpu_is_u8500ed()) {
+                               /*
+                                * This clocking setting must not be used
+                                * in the ED chip, it is simply not
+                                * connected anywhere!
+                                */
+                               mturate = 0;
+                               BUG();
+                       } else
+                               /*
+                                * In this mode the ulp38m4 clock is divided
+                                * by a factor 16, on the DB8500 typically
+                                * 38400000 / 16 ~ 2.4 MHz.
+                                * TODO: Replace the constant with a reference
+                                * to the ULP source once this is modeled.
+                                */
+                               mturate = 38400000 / 16;
+               }
+       }
+
+       /* Return the clock selected for this MTU */
+       if (tcr & (1 << mtu))
+               retclk = clk32k;
+       else
+               retclk = mturate;
+
+       pr_info("MTU%d clock rate: %lu Hz\n", mtu, retclk);
+       return retclk;
+}
+
 unsigned long clk_get_rate(struct clk *clk)
 {
        unsigned long rate;
 
+       /*
+        * If there is a custom getrate callback for this clock,
+        * it will take precedence.
+        */
+       if (clk->get_rate)
+               return clk->get_rate(clk);
+
        if (clk->ops && clk->ops->get_rate)
                return clk->ops->get_rate(clk);
 
@@ -341,8 +430,9 @@ static DEFINE_PRCC_CLK(5, usb_v1,   0,  0, NULL);
 
 /* Peripheral Cluster #6 */
 
-static DEFINE_PRCC_CLK(6, mtu1_v1,     8, -1, NULL);
-static DEFINE_PRCC_CLK(6, mtu0_v1,     7, -1, NULL);
+/* MTU ID in data */
+static DEFINE_PRCC_CLK_CUSTOM(6, mtu1_v1, 8, -1, NULL, clk_mtu_get_rate, 1);
+static DEFINE_PRCC_CLK_CUSTOM(6, mtu0_v1, 7, -1, NULL, clk_mtu_get_rate, 0);
 static DEFINE_PRCC_CLK(6, cfgreg_v1,   6,  6, NULL);
 static DEFINE_PRCC_CLK(6, dmc_ed,      6,  6, NULL);
 static DEFINE_PRCC_CLK(6, hash1,       5, -1, NULL);
@@ -357,8 +447,9 @@ static DEFINE_PRCC_CLK(6, rng_v1,   0,  0, &clk_rngclk);
 /* Peripheral Cluster #7 */
 
 static DEFINE_PRCC_CLK(7, tzpc0_ed,    4, -1, NULL);
-static DEFINE_PRCC_CLK(7, mtu1_ed,     3, -1, NULL);
-static DEFINE_PRCC_CLK(7, mtu0_ed,     2, -1, NULL);
+/* MTU ID in data */
+static DEFINE_PRCC_CLK_CUSTOM(7, mtu1_ed, 3, -1, NULL, clk_mtu_get_rate, 1);
+static DEFINE_PRCC_CLK_CUSTOM(7, mtu0_ed, 2, -1, NULL, clk_mtu_get_rate, 0);
 static DEFINE_PRCC_CLK(7, wdg_ed,      1, -1, NULL);
 static DEFINE_PRCC_CLK(7, cfgreg_ed,   0, -1, NULL);
 
@@ -503,15 +594,17 @@ static struct clk_lookup u8500_v1_clks[] = {
        CLK(uiccclk,    "uicc",         NULL),
 };
 
-static int __init clk_init(void)
+int __init clk_init(void)
 {
        if (cpu_is_u8500ed()) {
                clk_prcmu_ops.enable = clk_prcmu_ed_enable;
                clk_prcmu_ops.disable = clk_prcmu_ed_disable;
+               clk_per6clk.rate = 100000000;
        } else if (cpu_is_u5500()) {
                /* Clock tree for U5500 not implemented yet */
                clk_prcc_ops.enable = clk_prcc_ops.disable = NULL;
                clk_prcmu_ops.enable = clk_prcmu_ops.disable = NULL;
+               clk_per6clk.rate = 26000000;
        }
 
        clkdev_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks));
@@ -522,4 +615,3 @@ static int __init clk_init(void)
 
        return 0;
 }
-arch_initcall(clk_init);
index e4f99b65026f7787f863c53ca5c4e09a017ffa45..a058025015273f81b20cc6cd34a46255811e744a 100644 (file)
@@ -28,6 +28,9 @@ struct clkops {
  * @ops:               pointer to clkops struct used to control this clock
  * @name:              name, for debugging
  * @enabled:           refcount. positive if enabled, zero if disabled
+ * @get_rate:          custom callback for getting the clock rate
+ * @data:              custom per-clock data for example for the get_rate
+ *                     callback
  * @rate:              fixed rate for clocks which don't implement
  *                     ops->getrate
  * @prcmu_cg_off:      address offset of the combined enable/disable register
@@ -67,6 +70,8 @@ struct clk {
        const struct clkops     *ops;
        const char              *name;
        unsigned int            enabled;
+       unsigned long           (*get_rate)(struct clk *);
+       void                    *data;
 
        unsigned long           rate;
        struct list_head        list;
@@ -117,9 +122,26 @@ struct clk clk_##_name = {                                         \
                .parent_periph  = _kernclk                              \
        }
 
+#define DEFINE_PRCC_CLK_CUSTOM(_pclust, _name, _bus_en, _kernel_en, _kernclk, _callback, _data) \
+struct clk clk_##_name = {                                             \
+               .name           = #_name,                               \
+               .ops            = &clk_prcc_ops,                        \
+               .cluster        = _pclust,                              \
+               .prcc_bus       = _bus_en,                              \
+               .prcc_kernel    = _kernel_en,                           \
+               .parent_cluster = &clk_per##_pclust##clk,               \
+               .parent_periph  = _kernclk,                             \
+               .get_rate       = _callback,                            \
+               .data           = (void *) _data                        \
+       }
+
+
 #define CLK(_clk, _devname, _conname)                  \
        {                                               \
                .clk    = &clk_##_clk,                  \
                .dev_id = _devname,                     \
                .con_id = _conname,                     \
        }
+
+int __init clk_db8500_ed_fixup(void);
+int __init clk_init(void);
index d81ad023963c74dbb1ea8998cd9ed541cae5da8e..e0fd747e447ad6e3e299e57aadcfcfbcd4241867 100644 (file)
@@ -62,6 +62,12 @@ void __init ux500_init_irq(void)
 {
        gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29);
        gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE));
+
+       /*
+        * Init clocks here so that they are available for system timer
+        * initialization.
+        */
+       clk_init();
 }
 
 #ifdef CONFIG_CACHE_L2X0
index 5eb4fd93893dfa113cddf7944eeb063d968965a2..ac163de7dc015f5c02c305d450f18151fdecc795 100644 (file)
@@ -18,7 +18,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
 {
        asm("\
        stmfd   sp!, {r4-r9, lr}                \n\
-       mov     ip, %0                          \n\
+       mov     ip, %2                          \n\
 1:     mov     lr, r1                          \n\
        ldmia   r1!, {r2 - r9}                  \n\
        pld     [lr, #32]                       \n\
@@ -64,7 +64,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
        mcr     p15, 0, ip, c7, c10, 4          @ drain WB\n\
        ldmfd   sp!, {r4-r9, pc}"
        :
-       : "I" (PAGE_SIZE));
+       : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE));
 }
 
 void feroceon_copy_user_highpage(struct page *to, struct page *from,
index 7c2eb55cd4a9263c9d3eb3e17d590cac0cc5d9b3..cb589cbb2b6c0322b1cdd61faf72a602db04a72e 100644 (file)
@@ -27,7 +27,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
 {
        asm("\
        stmfd   sp!, {r4, lr}                   @ 2\n\
-       mov     r2, %0                          @ 1\n\
+       mov     r2, %2                          @ 1\n\
        ldmia   r1!, {r3, r4, ip, lr}           @ 4\n\
 1:     mcr     p15, 0, r0, c7, c6, 1           @ 1   invalidate D line\n\
        stmia   r0!, {r3, r4, ip, lr}           @ 4\n\
@@ -44,7 +44,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
        mcr     p15, 0, r1, c7, c10, 4          @ 1   drain WB\n\
        ldmfd    sp!, {r4, pc}                  @ 3"
        :
-       : "I" (PAGE_SIZE / 64));
+       : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
 }
 
 void v4wb_copy_user_highpage(struct page *to, struct page *from,
index 172e6a55458eb321dbf0708be20433a4daa7909f..30c7d048a324b975535aef82062ea20f582793ed 100644 (file)
@@ -25,7 +25,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
 {
        asm("\
        stmfd   sp!, {r4, lr}                   @ 2\n\
-       mov     r2, %0                          @ 1\n\
+       mov     r2, %2                          @ 1\n\
        ldmia   r1!, {r3, r4, ip, lr}           @ 4\n\
 1:     stmia   r0!, {r3, r4, ip, lr}           @ 4\n\
        ldmia   r1!, {r3, r4, ip, lr}           @ 4+1\n\
@@ -40,7 +40,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
        mcr     p15, 0, r2, c7, c7, 0           @ flush ID cache\n\
        ldmfd   sp!, {r4, pc}                   @ 3"
        :
-       : "I" (PAGE_SIZE / 64));
+       : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
 }
 
 void v4wt_copy_user_highpage(struct page *to, struct page *from,
index 747ad4140fc75527d9c7b7409caf98e59504894d..f9cde0702f1eef3bbdb279462532865092f21152 100644 (file)
@@ -34,7 +34,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
 {
        asm("\
        stmfd   sp!, {r4, r5, lr}               \n\
-       mov     lr, %0                          \n\
+       mov     lr, %2                          \n\
                                                \n\
        pld     [r1, #0]                        \n\
        pld     [r1, #32]                       \n\
@@ -67,7 +67,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
                                                \n\
        ldmfd   sp!, {r4, r5, pc}"
        :
-       : "I" (PAGE_SIZE / 64 - 1));
+       : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64 - 1));
 }
 
 void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
index 92f5801f99c1d09c735fb586c9c44bc5df802f13..cbfb2edcf7d12a3a1cae18f04c041d94dc055bcc 100644 (file)
@@ -393,6 +393,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
        if (addr < TASK_SIZE)
                return do_page_fault(addr, fsr, regs);
 
+       if (user_mode(regs))
+               goto bad_area;
+
        index = pgd_index(addr);
 
        /*
index 77b030f5ec09fa2dfbbcc562f345eb0ec04e3092..086816b205b8cf25c9d178c9d56c44a654e2ff9f 100644 (file)
@@ -48,7 +48,16 @@ void *kmap_atomic(struct page *page, enum km_type type)
 
        debug_kmap_atomic(type);
 
-       kmap = kmap_high_get(page);
+#ifdef CONFIG_DEBUG_HIGHMEM
+       /*
+        * There is no cache coherency issue when non VIVT, so force the
+        * dedicated kmap usage for better debugging purposes in that case.
+        */
+       if (!cache_is_vivt())
+               kmap = NULL;
+       else
+#endif
+               kmap = kmap_high_get(page);
        if (kmap)
                return kmap;
 
index 1ba6cf5a2c025b3dd22c84e0b190455e8c574ab3..f6a9994653237ddc2a56c7c1fbd9070615cea937 100644 (file)
@@ -678,10 +678,10 @@ void __init mem_init(void)
 void free_initmem(void)
 {
 #ifdef CONFIG_HAVE_TCM
-       extern char *__tcm_start, *__tcm_end;
+       extern char __tcm_start, __tcm_end;
 
-       totalram_pages += free_area(__phys_to_pfn(__pa(__tcm_start)),
-                                   __phys_to_pfn(__pa(__tcm_end)),
+       totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)),
+                                   __phys_to_pfn(__pa(&__tcm_end)),
                                    "TCM link");
 #endif
 
index 0ff3798769abb9a6fe2d03b390c5500c478b5141..08aaa4a7f65fe0e868b1a8cbfa8dd80d73209cec 100644 (file)
@@ -13,7 +13,9 @@
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/clockchips.h>
+#include <linux/clk.h>
 #include <linux/jiffies.h>
+#include <linux/err.h>
 #include <asm/mach/time.h>
 
 #include <plat/mtu.h>
@@ -124,13 +126,25 @@ static struct irqaction nmdk_timer_irq = {
 void __init nmdk_timer_init(void)
 {
        unsigned long rate;
-       u32 cr = MTU_CRn_32BITS;;
+       struct clk *clk0;
+       struct clk *clk1;
+       u32 cr;
+
+       clk0 = clk_get_sys("mtu0", NULL);
+       BUG_ON(IS_ERR(clk0));
+
+       clk1 = clk_get_sys("mtu1", NULL);
+       BUG_ON(IS_ERR(clk1));
+
+       clk_enable(clk0);
+       clk_enable(clk1);
 
        /*
         * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:
         * use a divide-by-16 counter if it's more than 16MHz
         */
-       rate = CLOCK_TICK_RATE;
+       cr = MTU_CRn_32BITS;;
+       rate = clk_get_rate(clk0);
        if (rate > 16 << 20) {
                rate /= 16;
                cr |= MTU_CRn_PRESCALE_16;
@@ -153,6 +167,14 @@ void __init nmdk_timer_init(void)
                       nmdk_clksrc.name);
 
        /* Timer 1 is used for events, fix according to rate */
+       cr = MTU_CRn_32BITS;
+       rate = clk_get_rate(clk1);
+       if (rate > 16 << 20) {
+               rate /= 16;
+               cr |= MTU_CRn_PRESCALE_16;
+       } else {
+               cr |= MTU_CRn_PRESCALE_1;
+       }
        writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
        nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift);
        nmdk_clkevt.max_delta_ns =
index 66dc2d03b7fc70c1130bd7b0a751dbeed6d53b17..d66cead97d28b3c5d63d9c22d4fdcb77b7d7bd8e 100644 (file)
@@ -277,7 +277,7 @@ ENTRY(vfp_put_double)
 #ifdef CONFIG_VFPv3
        @ d16 - d31 registers
        .irp    dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
-1:     mcrr    p11, 3, r1, r2, c\dr    @ fmdrr r1, r2, d\dr
+1:     mcrr    p11, 3, r0, r1, c\dr    @ fmdrr r0, r1, d\dr
        mov     pc, lr
        .org    1b + 8
        .endr
index 84d103c33c9c4356220725a853405ccf15ab8870..a4dba6b20bd0b8f4e2cd9582bd97c9a39a8453b7 100644 (file)
@@ -1789,6 +1789,12 @@ void gdbstub(int sigval)
                        flush_cache = 1;
                        break;
 
+                       /* pNN: Read value of reg N and return it */
+               case 'p':
+                       /* return no value, indicating that we don't support
+                        * this command and that gdb should use 'g' instead */
+                       break;
+
                        /* PNN,=RRRRRRRR: Write value R to reg N return OK */
                case 'P':
                        ptr = &input_buffer[1];
index d5f4e9161201f648dbaf90ec96c300ec63d6536b..21b701374f72335905ee9bfde866975e60800229 100644 (file)
@@ -144,6 +144,7 @@ int kvm_arch_hardware_enable(void *garbage)
                                VP_INIT_ENV : VP_INIT_ENV_INITALIZE,
                        __pa(kvm_vm_buffer), KVM_VM_BUFFER_BASE, &tmp_base);
        if (status != 0) {
+               spin_unlock(&vp_lock);
                printk(KERN_WARNING"kvm: Failed to Enable VT Support!!!!\n");
                return -EINVAL;
        }
index de493f86d28f7884b2adb7a625c0848a38aa6b74..464ff32bee3d29139cebead6a21be92207016a36 100644 (file)
@@ -34,6 +34,8 @@
 /* MS be sure that SLAB allocates aligned objects */
 #define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
 
+#define ARCH_SLAB_MINALIGN     L1_CACHE_BYTES
+
 #define PAGE_UP(addr)  (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
 #define PAGE_DOWN(addr)        ((addr)&(~((PAGE_SIZE)-1)))
 
index 9dcd90b5df55bdf08cd869fba62f56219797c555..79c74659f204b7da1aed7172f255f4556cbc77fb 100644 (file)
@@ -90,7 +90,6 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
        /* FIXME this part of code is untested */
        for_each_sg(sgl, sg, nents, i) {
                sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
-               sg->dma_length = sg->length;
                __dma_sync_page(page_to_phys(sg_page(sg)), sg->offset,
                                                        sg->length, direction);
        }
index 9cb782b8e036f763b09d61054652897da5c9141b..23be25fec4d67bf7e48d612b50e1da9f766371ae 100644 (file)
@@ -1277,6 +1277,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
                printk(KERN_WARNING "PCI: Cannot allocate resource region "
                       "%d of PCI bridge %d, will remap\n", i, bus->number);
 clear_resource:
+               res->start = res->end = 0;
                res->flags = 0;
        }
 
index d6119b879a9812f9f1e50749b06d764c38ebfb5c..45b40ac6c4647b3bb0751a1352e21e2e0a66ae3e 100644 (file)
@@ -117,6 +117,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
                                         * Invalidate the resource to prevent
                                         * child resource allocations in this
                                         * range. */
+                                       r->start = r->end = 0;
                                        r->flags = 0;
                                }
                        }
index 53696da4518f9569aabf9a4b668cb725f1a5c4a1..2d38a50e66ba45c5ca0779bbec98efb39cb7fdcf 100644 (file)
@@ -135,13 +135,6 @@ config DEBUGGER
        depends on KGDB || XMON
        default y
 
-config IRQSTACKS
-       bool "Use separate kernel stacks when processing interrupts"
-       help
-         If you say Y here the kernel will use separate kernel stacks
-         for handling hard and soft interrupts.  This can help avoid
-         overflowing the process kernel stacks.
-
 config VIRQ_DEBUG
        bool "Expose hardware/virtual IRQ mapping via debugfs"
        depends on DEBUG_FS
index ad0df7d0a6435b85589b18b3c710c46ead736fd8..fae8192c8fcce0a7069b1d7dff785f5fdda67273 100644 (file)
@@ -141,7 +141,7 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
 $(obj)/wrapper.a: $(obj-wlib) FORCE
        $(call if_changed,bootar)
 
-hostprogs-y    := addnote addRamDisk hack-coff mktree
+hostprogs-y    := addnote hack-coff mktree
 
 targets                += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
 extra-y                := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
diff --git a/arch/powerpc/boot/addRamDisk.c b/arch/powerpc/boot/addRamDisk.c
deleted file mode 100644 (file)
index 893f446..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <elf.h>
-
-#define ElfHeaderSize  (64 * 1024)
-#define ElfPages  (ElfHeaderSize / 4096)
-#define KERNELBASE (0xc000000000000000)
-#define _ALIGN_UP(addr,size)   (((addr)+((size)-1))&(~((size)-1)))
-
-struct addr_range {
-       unsigned long long addr;
-       unsigned long memsize;
-       unsigned long offset;
-};
-
-static int check_elf64(void *p, int size, struct addr_range *r)
-{
-       Elf64_Ehdr *elf64 = p;
-       Elf64_Phdr *elf64ph;
-
-       if (elf64->e_ident[EI_MAG0] != ELFMAG0 ||
-           elf64->e_ident[EI_MAG1] != ELFMAG1 ||
-           elf64->e_ident[EI_MAG2] != ELFMAG2 ||
-           elf64->e_ident[EI_MAG3] != ELFMAG3 ||
-           elf64->e_ident[EI_CLASS] != ELFCLASS64 ||
-           elf64->e_ident[EI_DATA] != ELFDATA2MSB ||
-           elf64->e_type != ET_EXEC || elf64->e_machine != EM_PPC64)
-               return 0;
-
-       if ((elf64->e_phoff + sizeof(Elf64_Phdr)) > size)
-               return 0;
-
-       elf64ph = (Elf64_Phdr *) ((unsigned long)elf64 +
-                                 (unsigned long)elf64->e_phoff);
-
-       r->memsize = (unsigned long)elf64ph->p_memsz;
-       r->offset = (unsigned long)elf64ph->p_offset;
-       r->addr = (unsigned long long)elf64ph->p_vaddr;
-
-#ifdef DEBUG
-       printf("PPC64 ELF file, ph:\n");
-       printf("p_type   0x%08x\n", elf64ph->p_type);
-       printf("p_flags  0x%08x\n", elf64ph->p_flags);
-       printf("p_offset 0x%016llx\n", elf64ph->p_offset);
-       printf("p_vaddr  0x%016llx\n", elf64ph->p_vaddr);
-       printf("p_paddr  0x%016llx\n", elf64ph->p_paddr);
-       printf("p_filesz 0x%016llx\n", elf64ph->p_filesz);
-       printf("p_memsz  0x%016llx\n", elf64ph->p_memsz);
-       printf("p_align  0x%016llx\n", elf64ph->p_align);
-       printf("... skipping 0x%08lx bytes of ELF header\n",
-              (unsigned long)elf64ph->p_offset);
-#endif
-
-       return 64;
-}
-static void get4k(FILE *file, char *buf )
-{
-       unsigned j;
-       unsigned num = fread(buf, 1, 4096, file);
-       for ( j=num; j<4096; ++j )
-               buf[j] = 0;
-}
-
-static void put4k(FILE *file, char *buf )
-{
-       fwrite(buf, 1, 4096, file);
-}
-
-static void death(const char *msg, FILE *fdesc, const char *fname)
-{
-       fprintf(stderr, msg);
-       fclose(fdesc);
-       unlink(fname);
-       exit(1);
-}
-
-int main(int argc, char **argv)
-{
-       char inbuf[4096];
-       struct addr_range vmlinux;
-       FILE *ramDisk;
-       FILE *inputVmlinux;
-       FILE *outputVmlinux;
-
-       char *rd_name, *lx_name, *out_name;
-
-       size_t i;
-       unsigned long ramFileLen;
-       unsigned long ramLen;
-       unsigned long roundR;
-       unsigned long offset_end;
-
-       unsigned long kernelLen;
-       unsigned long actualKernelLen;
-       unsigned long round;
-       unsigned long roundedKernelLen;
-       unsigned long ramStartOffs;
-       unsigned long ramPages;
-       unsigned long roundedKernelPages;
-       unsigned long hvReleaseData;
-       u_int32_t eyeCatcher = 0xc8a5d9c4;
-       unsigned long naca;
-       unsigned long xRamDisk;
-       unsigned long xRamDiskSize;
-       long padPages;
-  
-  
-       if (argc < 2) {
-               fprintf(stderr, "Name of RAM disk file missing.\n");
-               exit(1);
-       }
-       rd_name = argv[1];
-
-       if (argc < 3) {
-               fprintf(stderr, "Name of vmlinux file missing.\n");
-               exit(1);
-       }
-       lx_name = argv[2];
-
-       if (argc < 4) {
-               fprintf(stderr, "Name of vmlinux output file missing.\n");
-               exit(1);
-       }
-       out_name = argv[3];
-
-
-       ramDisk = fopen(rd_name, "r");
-       if ( ! ramDisk ) {
-               fprintf(stderr, "RAM disk file \"%s\" failed to open.\n", rd_name);
-               exit(1);
-       }
-
-       inputVmlinux = fopen(lx_name, "r");
-       if ( ! inputVmlinux ) {
-               fprintf(stderr, "vmlinux file \"%s\" failed to open.\n", lx_name);
-               exit(1);
-       }
-  
-       outputVmlinux = fopen(out_name, "w+");
-       if ( ! outputVmlinux ) {
-               fprintf(stderr, "output vmlinux file \"%s\" failed to open.\n", out_name);
-               exit(1);
-       }
-
-       i = fread(inbuf, 1, sizeof(inbuf), inputVmlinux);
-       if (i != sizeof(inbuf)) {
-               fprintf(stderr, "can not read vmlinux file %s: %u\n", lx_name, i);
-               exit(1);
-       }
-
-       i = check_elf64(inbuf, sizeof(inbuf), &vmlinux);
-       if (i == 0) {
-               fprintf(stderr, "You must have a linux kernel specified as argv[2]\n");
-               exit(1);
-       }
-
-       /* Input Vmlinux file */
-       fseek(inputVmlinux, 0, SEEK_END);
-       kernelLen = ftell(inputVmlinux);
-       fseek(inputVmlinux, 0, SEEK_SET);
-       printf("kernel file size = %lu\n", kernelLen);
-
-       actualKernelLen = kernelLen - ElfHeaderSize;
-
-       printf("actual kernel length (minus ELF header) = %lu\n", actualKernelLen);
-
-       round = actualKernelLen % 4096;
-       roundedKernelLen = actualKernelLen;
-       if ( round )
-               roundedKernelLen += (4096 - round);
-       printf("Vmlinux length rounded up to a 4k multiple = %ld/0x%lx \n", roundedKernelLen, roundedKernelLen);
-       roundedKernelPages = roundedKernelLen / 4096;
-       printf("Vmlinux pages to copy = %ld/0x%lx \n", roundedKernelPages, roundedKernelPages);
-
-       offset_end = _ALIGN_UP(vmlinux.memsize, 4096);
-       /* calc how many pages we need to insert between the vmlinux and the start of the ram disk */
-       padPages = offset_end/4096 - roundedKernelPages;
-
-       /* Check and see if the vmlinux is already larger than _end in System.map */
-       if (padPages < 0) {
-               /* vmlinux is larger than _end - adjust the offset to the start of the embedded ram disk */ 
-               offset_end = roundedKernelLen;
-               printf("vmlinux is larger than _end indicates it needs to be - offset_end = %lx \n", offset_end);
-               padPages = 0;
-               printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages);
-       }
-       else {
-               /* _end is larger than vmlinux - use the offset to _end that we calculated from the system map */
-               printf("vmlinux is smaller than _end indicates is needed - offset_end = %lx \n", offset_end);
-               printf("will insert %lx pages between the vmlinux and the start of the ram disk \n", padPages);
-       }
-
-
-
-       /* Input Ram Disk file */
-       // Set the offset that the ram disk will be started at.
-       ramStartOffs = offset_end;  /* determined from the input vmlinux file and the system map */
-       printf("Ram Disk will start at offset = 0x%lx \n", ramStartOffs);
-  
-       fseek(ramDisk, 0, SEEK_END);
-       ramFileLen = ftell(ramDisk);
-       fseek(ramDisk, 0, SEEK_SET);
-       printf("%s file size = %ld/0x%lx \n", rd_name, ramFileLen, ramFileLen);
-
-       ramLen = ramFileLen;
-
-       roundR = 4096 - (ramLen % 4096);
-       if ( roundR ) {
-               printf("Rounding RAM disk file up to a multiple of 4096, adding %ld/0x%lx \n", roundR, roundR);
-               ramLen += roundR;
-       }
-
-       printf("Rounded RAM disk size is %ld/0x%lx \n", ramLen, ramLen);
-       ramPages = ramLen / 4096;
-       printf("RAM disk pages to copy = %ld/0x%lx\n", ramPages, ramPages);
-
-
-
-  // Copy 64K ELF header
-       for (i=0; i<(ElfPages); ++i) {
-               get4k( inputVmlinux, inbuf );
-               put4k( outputVmlinux, inbuf );
-       }
-
-       /* Copy the vmlinux (as full pages). */
-       fseek(inputVmlinux, ElfHeaderSize, SEEK_SET);
-       for ( i=0; i<roundedKernelPages; ++i ) {
-               get4k( inputVmlinux, inbuf );
-               put4k( outputVmlinux, inbuf );
-       }
-  
-       /* Insert pad pages (if appropriate) that are needed between */
-       /* | the end of the vmlinux and the ram disk. */
-       for (i=0; i<padPages; ++i) {
-               memset(inbuf, 0, 4096);
-               put4k(outputVmlinux, inbuf);
-       }
-
-       /* Copy the ram disk (as full pages). */
-       for ( i=0; i<ramPages; ++i ) {
-               get4k( ramDisk, inbuf );
-               put4k( outputVmlinux, inbuf );
-       }
-
-       /* Close the input files */
-       fclose(ramDisk);
-       fclose(inputVmlinux);
-       /* And flush the written output file */
-       fflush(outputVmlinux);
-
-
-
-       /* Fixup the new vmlinux to contain the ram disk starting offset (xRamDisk) and the ram disk size (xRamDiskSize) */
-       /* fseek to the hvReleaseData pointer */
-       fseek(outputVmlinux, ElfHeaderSize + 0x24, SEEK_SET);
-       if (fread(&hvReleaseData, 4, 1, outputVmlinux) != 1) {
-               death("Could not read hvReleaseData pointer\n", outputVmlinux, out_name);
-       }
-       hvReleaseData = ntohl(hvReleaseData); /* Convert to native int */
-       printf("hvReleaseData is at %08lx\n", hvReleaseData);
-
-       /* fseek to the hvReleaseData */
-       fseek(outputVmlinux, ElfHeaderSize + hvReleaseData, SEEK_SET);
-       if (fread(inbuf, 0x40, 1, outputVmlinux) != 1) {
-               death("Could not read hvReleaseData\n", outputVmlinux, out_name);
-       }
-       /* Check hvReleaseData sanity */
-       if (memcmp(inbuf, &eyeCatcher, 4) != 0) {
-               death("hvReleaseData is invalid\n", outputVmlinux, out_name);
-       }
-       /* Get the naca pointer */
-       naca = ntohl(*((u_int32_t*) &inbuf[0x0C])) - KERNELBASE;
-       printf("Naca is at offset 0x%lx \n", naca);
-
-       /* fseek to the naca */
-       fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
-       if (fread(inbuf, 0x18, 1, outputVmlinux) != 1) {
-               death("Could not read naca\n", outputVmlinux, out_name);
-       }
-       xRamDisk = ntohl(*((u_int32_t *) &inbuf[0x0c]));
-       xRamDiskSize = ntohl(*((u_int32_t *) &inbuf[0x14]));
-       /* Make sure a RAM disk isn't already present */
-       if ((xRamDisk != 0) || (xRamDiskSize != 0)) {
-               death("RAM disk is already attached to this kernel\n", outputVmlinux, out_name);
-       }
-       /* Fill in the values */
-       *((u_int32_t *) &inbuf[0x0c]) = htonl(ramStartOffs);
-       *((u_int32_t *) &inbuf[0x14]) = htonl(ramPages);
-
-       /* Write out the new naca */
-       fflush(outputVmlinux);
-       fseek(outputVmlinux, ElfHeaderSize + naca, SEEK_SET);
-       if (fwrite(inbuf, 0x18, 1, outputVmlinux) != 1) {
-               death("Could not write naca\n", outputVmlinux, out_name);
-       }
-       printf("Ram Disk of 0x%lx pages is attached to the kernel at offset 0x%08lx\n",
-              ramPages, ramStartOffs);
-
-       /* Done */
-       fclose(outputVmlinux);
-       /* Set permission to executable */
-       chmod(out_name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
-
-       return 0;
-}
-
index 82ff2b13bc37905deebbda9816616a2d92a0ee61..179a1785d6454dbfdda53a532474dfa4c5c5340e 100644 (file)
                        compatible = "fsl,mpc5200-gpio";
                        reg = <0xb00 0x40>;
                        interrupts = <1 7 0>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
                };
 
                gpio@c00 {
                        compatible = "fsl,mpc5200-gpio-wkup";
                        reg = <0xc00 0x40>;
                        interrupts = <1 8 0 0 3 0>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
                };
 
                spi@f00 {
                        reg = <0x3000 0x400>;   // fec range, since we need to setup fec interrupts
                        interrupts = <2 5 0>;   // these are for "mii command finished", not link changes & co.
 
-                       phy0: ethernet-phy@1 {
-                               reg = <1>;
+                       phy0: ethernet-phy@0 {
+                               reg = <0>;
                        };
                };
 
                        compatible = "fsl,mpc5200-i2c","fsl-i2c";
                        reg = <0x3d40 0x40>;
                        interrupts = <2 16 0>;
+
+                       eeprom@50 {
+                               compatible = "atmel,24c02";
+                               reg = <0x50>;
+                       };
                };
+
                sram@8000 {
                        compatible = "fsl,mpc5200-sram";
                        reg = <0x8000 0x4000>;
                          0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
                          0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
        };
+
+       localbus {
+               compatible = "fsl,mpc5200-lpb","simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+
+               ranges = <0 0 0xff000000 0x01000000>;
+
+               flash@0,0 {
+                       compatible = "amd,am29lv652d", "cfi-flash";
+                       reg = <0 0 0x01000000>;
+                       bank-width = <1>;
+               };
+       };
 };
index e45a63be3a8618f73b0ed0921e81cf4d755dd2ae..59702ace900f9dc07a447e51fe34bb481b83864e 100644 (file)
                        compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
                        reg = <0x3d40 0x40>;
                        interrupts = <2 16 0>;
+
+                       eeprom@50 {
+                               compatible = "atmel,24c02";
+                               reg = <0x50>;
+                       };
                };
 
                sram@8000 {
index 8e95f8d227b94764fe73f397c25ce4ca5b8d0ecd..4aa17b676a3f51f761a4fe279a639142effc51f6 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 918f23fd2b1896b93093172b0527d038225e67a9..9a5f1ab777ed3541103355ce1d708e0e8fb64191 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index f87ef0382280f0695ed21a0ef58f284db4d3e20f..0b452135d1d449c82796eb50a89543c991a0cd09 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 19fbcb0753760b1932bdaee567e79da3cac71277..4d2de0bed60e0d1024fbd5a6db6e345b7801b34c 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index eb41cd695979550e3ec9152f4fa49ab0f7e45c83..a1f3f505e4a76b7d4177a750f44b8b2f7dbf43fa 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 416e79ac0711aeeb4d97ee4cab178de7a571d855..c763135771404d32ea809d911a289420318137de 100644 (file)
@@ -77,8 +77,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index bfff0eae39d29bf01c4af98f65a0aa40f14f3793..6597b2f1d1a80ad09a2a7390846dcd70fe854835 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 1f6d0490e28d10582be09dc89065ac608e8d66b7..2d3dfb55fbed3af160b298271116ef37079f92a2 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_RCU_FANOUT=32
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 788faac6c27a0d4c213f9308ef29fdd8d2fc8348..51a00c46df195a9cfab1ac851659c6489aee8eaa 100644 (file)
@@ -102,8 +102,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 4ef8bcab61f838dc8298dd5eea4790ddff1aa15b..1028b1bfb6022170f3022830c2f9ec737747d83d 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_RCU_FANOUT=32
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index ca17b1496e32c82adc26d1438bc283804dabc8b2..69f5633cbd4f20d51a0b5fd535e6db3cab475e7f 100644 (file)
@@ -101,8 +101,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index e3149bade0b25c6d101eb081ef58e568752baf03..dcd859c8b4a6487a26fa73c65b137958e905f056 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_RCU_FANOUT=32
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index af244e1d255e2908dd107b5f97f5aacc44559b18..a2c24d1e051e14b0132146649ffd8827aefe13d5 100644 (file)
@@ -97,8 +97,7 @@ CONFIG_RCU_FANOUT=32
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 8fed3b26af2e39c450b68012121bebbfce6b81c6..3bb55b57077e1fe06f7c14b229a2e1563cd0e2bb 100644 (file)
@@ -101,8 +101,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index a67ec91a28c3ebcdffff742122d1ee414979e912..684f40dc8a41b65d9750497f9a78023ba4e54be0 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_RCU_FANOUT=32
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 886cb6aa64326fa1441d70b3f5e1b9f5655c4e8b..e202924e617322f4fb3d008e44135ca967e224e0 100644 (file)
@@ -103,8 +103,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 1b2f41dbcafbb7e5020d3eab045ef7cebb494286..c348a4662a9e7caeff57aef7f8db1931849651ac 100644 (file)
@@ -102,8 +102,7 @@ CONFIG_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 12041d355b8ca1a9e47914d68211d416a405fb92..f4cb7e84cb833f398c3659c2ad7eb0263bcb1806 100644 (file)
@@ -101,8 +101,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 2518b8568c70c5538c96c9fed3b19e2d709abcac..c7ead0ec00bc229b2ea2ab278102d73926d44e30 100644 (file)
@@ -80,8 +80,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 218d49b36a0ce3e0e538539826dbbefba940dd86..7664c83c17c267308f598e27200a0ca14b487081 100644 (file)
@@ -95,8 +95,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 90492ff25232aad737899f3b883ac53d97a22c49..eac7c17eef3468bf70e0e1b505a967958b774115 100644 (file)
@@ -96,8 +96,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index dffc8cac825fb72e4e108dfdf6f10d6a7decd005..27afb6ecdf6119dd42cf1fd8f9aabf56604c787e 100644 (file)
@@ -95,8 +95,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 3cb2a522046a9aac204099641b693604da6ab266..5fe39ddb4e14e75c8c151159d00d5b9a076090c6 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
index 96181c62abfafe805cb39c61799dce5176daed15..a108b84c0074284c929bccb37d22197faf2407a6 100644 (file)
@@ -95,8 +95,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 183c59c6d8966a0c41469a178adbef50524a173e..b728a7d642504e7c486c7955e1209fa2922fd4c8 100644 (file)
@@ -103,8 +103,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 1524d948a2ba2f952ff6d6961553054ec276bc72..8e738de5f6a59aa8176ef362fcdd5d09e9ebb813 100644 (file)
@@ -103,8 +103,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 767c204c060311f6c32549b4ee38f38296ced643..59bf9e27d7f2d6d3de298db786b2f77e8df016c6 100644 (file)
@@ -103,8 +103,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 55b9e4e867acede870365cee89c1f93a9b624e2d..4e8b01e73245036b4c8f196ce034a38765df5cfe 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 1be38eb057832fbf0019ff7d4bf5d307917bcb4c..20fde6374aaded20bda4a49d7851db92ffe812f8 100644 (file)
@@ -103,8 +103,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index a63009457323cb87eff5d5a3b3b74b9a7a5a540b..74f714d85936313dfd3e9746c29239553ac693db 100644 (file)
@@ -102,8 +102,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 9f89d5c9c0be129161fca939a0c232031ae8e232..a670cee255b9d35acd5098e9edaca2a962e2a080 100644 (file)
@@ -92,8 +92,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
index b63cc38df6b1d37aadb80928266e284c32d453d9..851287e78fc3f19af8ba46e33f0c4d6217b7e304 100644 (file)
@@ -87,8 +87,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 4ab6074db3cfbeebdf7f1e7b6ec07d2334909808..b429a655b54134111411fb52cdb72064a6f0e81c 100644 (file)
@@ -102,8 +102,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index c6d2baa7aaebf3e5f8c7a7058b85de662426df6a..943371954317342109ea67a6876353c537564012 100644 (file)
@@ -83,8 +83,7 @@ CONFIG_CPUSETS=y
 # CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_PROC_PID_CPUSET=y
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
index d2123779512aab461de284edb05b860a9a50c89c..6be6c09eba6d0d975288ec4d65fe4014bb0346c7 100644 (file)
@@ -78,8 +78,7 @@ CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_USER_SCHED is not set
 # CONFIG_CGROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 5094a65a44938cc7ece391efc7cbbf9257674403..2fdab660fce31f3f3b078448fe133f4d9ae646dd 100644 (file)
@@ -77,8 +77,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 81e904e9f392799854c9057677e6381f352549c0..6b708395a7c69685798bb8cc0e4e078362f8eb0e 100644 (file)
@@ -96,8 +96,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
index c5af46ef5f40a1dc074e9db224d2bedf8b972dbe..1cee889dd9ec7bf86aed3d3de2c83fcf4f20a96b 100644 (file)
@@ -91,8 +91,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
index 826a65d3f002ddb37d1f1f077888ab3b56839448..57d3ffa3026af016e7ab811a299dbe108c9b12e2 100644 (file)
@@ -82,8 +82,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 942e1193e9e4e8c053b1d3a237ae4ec74f0b5840..1c2dbf07ac35dbb38332772ec5d2629803421438 100644 (file)
@@ -101,8 +101,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index a211a79959ca867b3210f4461c64df9f486c6ff7..a60d61bee48df33557f4d4b7c1f0fdc2743e8db9 100644 (file)
@@ -73,7 +73,6 @@ CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
 # CONFIG_FAIR_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
index 76982c51a4c793d3910ae09d5545b1f6f9114766..151c8e14f3ab677acd1fd3a023cd07667c14b4b2 100644 (file)
@@ -81,8 +81,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 588a2add393fa9e713f959c367c31a215a2fb55f..8ecacf74d3e5d1909fb226c553dd547db37dc9f9 100644 (file)
@@ -97,8 +97,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 8b244003b9e1bcf7b48b2518a374ebc578f16e5d..dc50eec58e780c64949130421b5f32cfe73cc559 100644 (file)
@@ -78,8 +78,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 0cbd56fe2e1e132e19f24360b6fbcd8753303e91..b36ebb7e843e699b9527d0e3ac99abdb39174a53 100644 (file)
@@ -96,8 +96,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index c1be26151021154783b21fae5f4e0bba635b0b56..0dd5015ea81d1ac522e55988a694bbf1cb5b91fc 100644 (file)
@@ -90,8 +90,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index a04727295d46ed7f2fb40b1f5b8cb0ae661f2031..aa2654e6edeb739ced7022e2e9c7093a75bdd8c2 100644 (file)
@@ -97,8 +97,7 @@ CONFIG_RCU_FANOUT=32
 CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 7012ac0134f0d99655f618514138b257f9be28b9..f875ec21c91c7f0934dd3a68ad57e1db34e5aa0d 100644 (file)
@@ -97,8 +97,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 27c63ceeb45a633feb5fefb57c290f22d470fdd2..b1e88fe1d9fb0693de2adff45650d572d6417d52 100644 (file)
@@ -95,8 +95,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 20ba0cfff8ba35dcdd50737140ccf640b9a1034b..74a7216183e8cf645ed43a093e336f18cf4fbdce 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_RCU_FANOUT=64
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index ea8870a34482a27daf52c512687cfdfd5658f486..753bb7912e28b17e34711bc890865e12a35a070f 100644 (file)
@@ -93,8 +93,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 35b60683cde5570c314b33360113f1617e369e7a..afb4d1bb2ba98c83b6623081fac98f3ac12c723f 100644 (file)
@@ -99,8 +99,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 46f5c47e9f8512287db8d4aecc02c59aee9690da..bd3d23fb4dd3e8a70560c639e9ccb3bb25106c67 100644 (file)
@@ -103,8 +103,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index dad617e2a88cfe4161f605bb8861fafd5814cf3f..369f4e02c5dd45f7d7ace372dd240e177209b6d5 100644 (file)
@@ -93,8 +93,7 @@ CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_PROC_PID_CPUSET=y
 CONFIG_RELAY=y
 CONFIG_NAMESPACES=y
index 8195f1650cbfe0aaef708fd68f097316aca0e632..403e82e2e83cc51ca03732b2fc8a18d08a46f13d 100644 (file)
@@ -107,8 +107,7 @@ CONFIG_CPUSETS=y
 CONFIG_PROC_PID_CPUSET=y
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 68c175ea427a465dbb53ace458d40cc320fc781f..12c8ee8dd12be81f9877b583a564ba21f98164aa 100644 (file)
@@ -96,8 +96,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index 93f4505b5ac2a1334c1344438b6db9b40fa216f8..a18f597c6e5fa8f20fd18b4cc674783764cca71c 100644 (file)
@@ -98,8 +98,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
index 16a14589bd40ab6a331933c032d6fe72312234f9..16ae717d195885d15659df18c0b846cb489f3b85 100644 (file)
@@ -92,8 +92,7 @@ CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
 CONFIG_CGROUP_CPUACCT=y
 # CONFIG_RESOURCE_COUNTERS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 CONFIG_PROC_PID_CPUSET=y
 CONFIG_RELAY=y
 CONFIG_NAMESPACES=y
index b1625801526e8fbc901775b53a9a763aed74d3ca..01be0e207f40173f8c103f06b4bd45ce19ffad12 100644 (file)
@@ -95,8 +95,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
index c386828c639a37d8a8083fdfcbc26167d8f43c34..ee054f8118be65ba14344bb80c6163ad7433a969 100644 (file)
@@ -102,8 +102,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 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_SYSFS_DEPRECATED_V2 is not set
 CONFIG_RELAY=y
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
index e054baef184599f2c13703ed688afb1d8fe0d3f6..ecba37a91749a1e869ed26afff90563b85813cb6 100644 (file)
@@ -358,7 +358,6 @@ extern void exc_lvl_ctx_init(void);
 #define exc_lvl_ctx_init()
 #endif
 
-#ifdef CONFIG_IRQSTACKS
 /*
  * Per-cpu stacks for handling hard and soft interrupts.
  */
@@ -369,11 +368,6 @@ extern void irq_ctx_init(void);
 extern void call_do_softirq(struct thread_info *tp);
 extern int call_handle_irq(int irq, void *p1,
                           struct thread_info *tp, void *func);
-#else
-#define irq_ctx_init()
-
-#endif /* CONFIG_IRQSTACKS */
-
 extern void do_IRQ(struct pt_regs *regs);
 
 #endif /* _ASM_IRQ_H */
index 5ebfe5d3c61ff23c8dd411f8ed8816d0e5286c01..6857af58b02eef9ddc9f2a91d42d28259a5a4b6b 100644 (file)
@@ -3,8 +3,17 @@
 
 #include <asm/page.h>
 
-/* Kdump kernel runs at 32 MB, change at your peril. */
+/*
+ * If CONFIG_RELOCATABLE is enabled we can place the kdump kernel anywhere.
+ * To keep enough space in the RMO for the first stage kernel on 64bit, we
+ * place it at 64MB. If CONFIG_RELOCATABLE is not enabled we must place
+ * the second stage at 32MB.
+ */
+#if defined(CONFIG_RELOCATABLE) && defined(CONFIG_PPC64)
+#define KDUMP_KERNELBASE       0x4000000
+#else
 #define KDUMP_KERNELBASE       0x2000000
+#endif
 
 /* How many bytes to reserve at zero for kdump. The reserve limit should
  * be greater or equal to the trampoline's end address.
index 30817d9b20cb59ecb12741edee7d0dacf5366dc3..3333bbdd23efaffce914c4b64c24ac766aba1fc3 100644 (file)
@@ -317,7 +317,6 @@ void fixup_irqs(const struct cpumask *map)
 }
 #endif
 
-#ifdef CONFIG_IRQSTACKS
 static inline void handle_one_irq(unsigned int irq)
 {
        struct thread_info *curtp, *irqtp;
@@ -358,12 +357,6 @@ static inline void handle_one_irq(unsigned int irq)
        if (irqtp->flags)
                set_bits(irqtp->flags, &curtp->flags);
 }
-#else
-static inline void handle_one_irq(unsigned int irq)
-{
-       generic_handle_irq(irq);
-}
-#endif
 
 static inline void check_stack_overflow(void)
 {
@@ -455,7 +448,6 @@ void exc_lvl_ctx_init(void)
 }
 #endif
 
-#ifdef CONFIG_IRQSTACKS
 struct thread_info *softirq_ctx[NR_CPUS] __read_mostly;
 struct thread_info *hardirq_ctx[NR_CPUS] __read_mostly;
 
@@ -492,10 +484,6 @@ static inline void do_softirq_onstack(void)
        irqtp->task = NULL;
 }
 
-#else
-#define do_softirq_onstack()   __do_softirq()
-#endif /* CONFIG_IRQSTACKS */
-
 void do_softirq(void)
 {
        unsigned long flags;
index 26f9900f773cb2e17634538f1674882c0cd7447b..ed31a29c4ff772cb22bbf038603b4bbd83731888 100644 (file)
@@ -182,28 +182,12 @@ static void kexec_prepare_cpus_wait(int wait_state)
 
        my_cpu = get_cpu();
        /* Make sure each CPU has atleast made it to the state we need */
-       for (i=0; i < NR_CPUS; i++) {
+       for_each_online_cpu(i) {
                if (i == my_cpu)
                        continue;
 
                while (paca[i].kexec_state < wait_state) {
                        barrier();
-                       if (!cpu_possible(i)) {
-                               printk("kexec: cpu %d hw_cpu_id %d is not"
-                                               " possible, ignoring\n",
-                                               i, paca[i].hw_cpu_id);
-                               break;
-                       }
-                       if (!cpu_online(i)) {
-                               /* Fixme: this can be spinning in
-                                * pSeries_secondary_wait with a paca
-                                * waiting for it to go online.
-                                */
-                               printk("kexec: cpu %d hw_cpu_id %d is not"
-                                               " online, ignoring\n",
-                                               i, paca[i].hw_cpu_id);
-                               break;
-                       }
                        if (i != notified) {
                                printk( "kexec: waiting for cpu %d (physical"
                                                " %d) to enter %i state\n",
index dc66d52dcff56b8be102b6ed25f160d9b44eaf87..6bbd7a604d243c9f8f9f906d683a9a20df2f9a43 100644 (file)
@@ -33,7 +33,6 @@
 
        .text
 
-#ifdef CONFIG_IRQSTACKS
 _GLOBAL(call_do_softirq)
        mflr    r0
        stw     r0,4(r1)
@@ -56,7 +55,6 @@ _GLOBAL(call_handle_irq)
        lwz     r0,4(r1)
        mtlr    r0
        blr
-#endif /* CONFIG_IRQSTACKS */
 
 /*
  * This returns the high 64 bits of the product of two 64-bit numbers.
index a2b18dffa03e4266a402aa58f8118e45fdffa74f..e5144906a56da692d1151db9e55db00ebdc73b2a 100644 (file)
@@ -28,7 +28,6 @@
 
        .text
 
-#ifdef CONFIG_IRQSTACKS
 _GLOBAL(call_do_softirq)
        mflr    r0
        std     r0,16(r1)
@@ -52,7 +51,6 @@ _GLOBAL(call_handle_irq)
        ld      r0,16(r1)
        mtlr    r0
        blr
-#endif /* CONFIG_IRQSTACKS */
 
        .section        ".toc","aw"
 PPC64_CACHES:
index 6646005dffb102b8b57172442aa8a71c5ed85a82..5b38f6ae2b299695139c25a21cff0b73f8857808 100644 (file)
@@ -1309,6 +1309,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
                printk(KERN_WARNING "PCI: Cannot allocate resource region "
                       "%d of PCI bridge %d, will remap\n", i, bus->number);
 clear_resource:
+               res->start = res->end = 0;
                res->flags = 0;
        }
 
index 9d255b4f0a0ec72678bbad3787d596a8c6be13d1..773424df828a393d9a2860ded0b380978cfdd9cc 100644 (file)
@@ -1005,7 +1005,6 @@ out:
        return error;
 }
 
-#ifdef CONFIG_IRQSTACKS
 static inline int valid_irq_stack(unsigned long sp, struct task_struct *p,
                                  unsigned long nbytes)
 {
@@ -1030,10 +1029,6 @@ static inline int valid_irq_stack(unsigned long sp, struct task_struct *p,
        return 0;
 }
 
-#else
-#define valid_irq_stack(sp, p, nb)     0
-#endif /* CONFIG_IRQSTACKS */
-
 int validate_sp(unsigned long sp, struct task_struct *p,
                       unsigned long nbytes)
 {
index bfc2abafac44ab2f8d510384e4eb9a98a9b8cb17..67a84d8f118d665ff78d965752ab08dc3152760e 100644 (file)
@@ -94,12 +94,8 @@ struct flash_block_list {
        struct flash_block_list *next;
        struct flash_block blocks[FLASH_BLOCKS_PER_NODE];
 };
-struct flash_block_list_header { /* just the header of flash_block_list */
-       unsigned long num_blocks;
-       struct flash_block_list *next;
-};
 
-static struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
+static struct flash_block_list *rtas_firmware_flash_list;
 
 /* Use slab cache to guarantee 4k alignment */
 static struct kmem_cache *flash_block_cache = NULL;
@@ -108,13 +104,14 @@ static struct kmem_cache *flash_block_cache = NULL;
 
 /* Local copy of the flash block list.
  * We only allow one open of the flash proc file and create this
- * list as we go.  This list will be put in the
- * rtas_firmware_flash_list var once it is fully read.
+ * list as we go.  The rtas_firmware_flash_list varable will be
+ * set once the data is fully read.
  *
  * For convenience as we build the list we use virtual addrs,
  * we do not fill in the version number, and the length field
  * is treated as the number of entries currently in the block
- * (i.e. not a byte count).  This is all fixed on release.
+ * (i.e. not a byte count).  This is all fixed when calling 
+ * the flash routine.
  */
 
 /* Status int must be first member of struct */
@@ -201,16 +198,16 @@ static int rtas_flash_release(struct inode *inode, struct file *file)
        if (uf->flist) {    
                /* File was opened in write mode for a new flash attempt */
                /* Clear saved list */
-               if (rtas_firmware_flash_list.next) {
-                       free_flash_list(rtas_firmware_flash_list.next);
-                       rtas_firmware_flash_list.next = NULL;
+               if (rtas_firmware_flash_list) {
+                       free_flash_list(rtas_firmware_flash_list);
+                       rtas_firmware_flash_list = NULL;
                }
 
                if (uf->status != FLASH_AUTH)  
                        uf->status = flash_list_valid(uf->flist);
 
                if (uf->status == FLASH_IMG_READY) 
-                       rtas_firmware_flash_list.next = uf->flist;
+                       rtas_firmware_flash_list = uf->flist;
                else
                        free_flash_list(uf->flist);
 
@@ -593,7 +590,7 @@ static void rtas_flash_firmware(int reboot_type)
        unsigned long rtas_block_list;
        int i, status, update_token;
 
-       if (rtas_firmware_flash_list.next == NULL)
+       if (rtas_firmware_flash_list == NULL)
                return;         /* nothing to do */
 
        if (reboot_type != SYS_RESTART) {
@@ -610,20 +607,25 @@ static void rtas_flash_firmware(int reboot_type)
                return;
        }
 
-       /* NOTE: the "first" block list is a global var with no data
-        * blocks in the kernel data segment.  We do this because
-        * we want to ensure this block_list addr is under 4GB.
+       /*
+        * NOTE: the "first" block must be under 4GB, so we create
+        * an entry with no data blocks in the reserved buffer in
+        * the kernel data segment.
         */
-       rtas_firmware_flash_list.num_blocks = 0;
-       flist = (struct flash_block_list *)&rtas_firmware_flash_list;
+       spin_lock(&rtas_data_buf_lock);
+       flist = (struct flash_block_list *)&rtas_data_buf[0];
+       flist->num_blocks = 0;
+       flist->next = rtas_firmware_flash_list;
        rtas_block_list = virt_to_abs(flist);
        if (rtas_block_list >= 4UL*1024*1024*1024) {
                printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
+               spin_unlock(&rtas_data_buf_lock);
                return;
        }
 
        printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
        /* Update the block_list in place. */
+       rtas_firmware_flash_list = NULL; /* too hard to backout on error */
        image_size = 0;
        for (f = flist; f; f = next) {
                /* Translate data addrs to absolute */
@@ -664,6 +666,7 @@ static void rtas_flash_firmware(int reboot_type)
                printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
                break;
        }
+       spin_unlock(&rtas_data_buf_lock);
 }
 
 static void remove_flash_pde(struct proc_dir_entry *dp)
index 8f58986c2ad9a7c56117f24bee6fd089333b80b6..7d84b210f1680de8a41fb23d0ad09a7e19ce905b 100644 (file)
@@ -241,7 +241,6 @@ int __init ppc_init(void)
 
 arch_initcall(ppc_init);
 
-#ifdef CONFIG_IRQSTACKS
 static void __init irqstack_early_init(void)
 {
        unsigned int i;
@@ -255,9 +254,6 @@ static void __init irqstack_early_init(void)
                        __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
        }
 }
-#else
-#define irqstack_early_init()
-#endif
 
 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
 static void __init exc_lvl_early_init(void)
index f3fb5a79de52bfecc41d1f42237c10c1bf5168d0..643dcac40fcbc56c8cc3102a74e76a6aae4381eb 100644 (file)
@@ -432,7 +432,6 @@ static u64 slb0_limit(void)
        return 1UL << SID_SHIFT;
 }
 
-#ifdef CONFIG_IRQSTACKS
 static void __init irqstack_early_init(void)
 {
        u64 limit = slb0_limit();
@@ -451,9 +450,6 @@ static void __init irqstack_early_init(void)
                                            THREAD_SIZE, limit));
        }
 }
-#else
-#define irqstack_early_init()
-#endif
 
 #ifdef CONFIG_PPC_BOOK3E
 static void __init exc_lvl_early_init(void)
index bc2b4004eb265a70ea4b082693e0b9eb9cf49e3f..e8a00b0c444912d3b1bd0b300e9869942dc48198 100644 (file)
@@ -164,7 +164,7 @@ static int __init kvmppc_e500_init(void)
        return kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE);
 }
 
-static void __init kvmppc_e500_exit(void)
+static void __exit kvmppc_e500_exit(void)
 {
        kvmppc_booke_exit();
 }
index 9fc02dc72ce9e98a5bdcc238a8e152c35a6be5f7..34347b2e7e313995c803d34c847034dff7a9c1cf 100644 (file)
@@ -115,11 +115,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
        struct page *ptepage;
 
-#ifdef CONFIG_HIGHPTE
-       gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT | __GFP_ZERO;
-#else
        gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO;
-#endif
 
        ptepage = alloc_pages(flags, 0);
        if (!ptepage)
index 2c9e52267292635570973ab97b9d03fe89606d95..7fd90d02d8c6d1917b53cfaaf5badb8818a076d7 100644 (file)
@@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n)
                index = ENTRIES-1;
 
        /* make sure index is valid */
-       if ((index > ENTRIES) || (index < 0))
+       if ((index >= ENTRIES) || (index < 0))
                index = ENTRIES-1;
 
        return initial_lfsr[index];
index a55b0b6813ed2a9f249a2051e861176e572a6d59..76722532bd95e516955397c5a81d651159cddc2e 100644 (file)
@@ -64,10 +64,19 @@ int mpc52xx_pm_prepare(void)
                { .type = "builtin", .compatible = "mpc5200", }, /* efika */
                {}
        };
+       struct resource res;
 
        /* map the whole register space */
        np = of_find_matching_node(NULL, immr_ids);
-       mbar = of_iomap(np, 0);
+
+       if (of_address_to_resource(np, 0, &res)) {
+               pr_err("mpc52xx_pm_prepare(): could not get IMMR address\n");
+               of_node_put(np);
+               return -ENOSYS;
+       }
+
+       mbar = ioremap(res.start, 0xc000); /* we should map whole region including SRAM */
+
        of_node_put(np);
        if (!mbar) {
                pr_err("mpc52xx_pm_prepare(): could not map registers\n");
index 2102487612a428cdac78735021d55629fc7f369a..20b73c025a4566e599f46192fed18df2ed002fda 100644 (file)
@@ -1666,7 +1666,7 @@ static int mpic_resume(struct sys_device *dev)
                               mpic->save_data[i].dest);
 
 #ifdef CONFIG_MPIC_U3_HT_IRQS
-       {
+       if (mpic->fixups) {
                struct mpic_irq_fixup *fixup = &mpic->fixups[i];
 
                if (fixup->base) {
index 55c80ffd42b9b9ef5a4fb7e3768c4b2deb462e83..92f1cb745d6946c603586820a4daed13b461d7a3 100644 (file)
@@ -181,7 +181,7 @@ static int __init appldata_os_init(void)
                goto out;
        }
 
-       appldata_os_data = kzalloc(max_size, GFP_DMA);
+       appldata_os_data = kzalloc(max_size, GFP_KERNEL | GFP_DMA);
        if (appldata_os_data == NULL) {
                rc = -ENOMEM;
                goto out;
index bcd6884985ad53ec8ebb758c3b050c15c28228c9..253f158db668c51269c0a6d9245ae6da52991166 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.34-rc3
-# Fri Apr  9 09:57:10 2010
+# Linux kernel version: 2.6.35-rc1
+# Fri Jun  4 11:32:40 2010
 #
 CONFIG_SCHED_MC=y
 CONFIG_MMU=y
@@ -35,11 +35,13 @@ CONFIG_CONSTRUCTORS=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_HAVE_KERNEL_GZIP=y
 CONFIG_HAVE_KERNEL_BZIP2=y
 CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
 CONFIG_KERNEL_GZIP=y
 # CONFIG_KERNEL_BZIP2 is not set
 # CONFIG_KERNEL_LZMA is not set
@@ -77,6 +79,7 @@ CONFIG_CGROUP_NS=y
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
 # CONFIG_CGROUP_SCHED is not set
+# CONFIG_BLK_CGROUP is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -157,7 +160,6 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 CONFIG_BLK_DEV_BSG=y
 # CONFIG_BLK_DEV_INTEGRITY is not set
-# CONFIG_BLK_CGROUP is not set
 CONFIG_BLOCK_COMPAT=y
 
 #
@@ -166,7 +168,6 @@ CONFIG_BLOCK_COMPAT=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
-# CONFIG_CFQ_GROUP_IOSCHED is not set
 CONFIG_DEFAULT_DEADLINE=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
@@ -247,7 +248,6 @@ CONFIG_64BIT=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
 CONFIG_HOTPLUG_CPU=y
-# CONFIG_SCHED_BOOK is not set
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_AUDIT_ARCH=y
@@ -320,7 +320,6 @@ CONFIG_COMPAT_BINFMT_ELF=y
 # CONFIG_HAVE_AOUT is not set
 CONFIG_BINFMT_MISC=m
 CONFIG_FORCE_MAX_ZONEORDER=9
-# CONFIG_PROCESS_DEBUG is not set
 CONFIG_PFAULT=y
 # CONFIG_SHARED_KERNEL is not set
 # CONFIG_CMM is not set
@@ -457,6 +456,7 @@ CONFIG_NF_CONNTRACK=m
 # CONFIG_IP6_NF_IPTABLES is not set
 # CONFIG_IP_DCCP is not set
 CONFIG_IP_SCTP=m
+# CONFIG_NET_SCTPPROBE is not set
 # CONFIG_SCTP_DBG_MSG is not set
 # CONFIG_SCTP_DBG_OBJCNT is not set
 # CONFIG_SCTP_HMAC_NONE is not set
@@ -465,6 +465,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_RDS is not set
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
+# CONFIG_L2TP is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
@@ -525,6 +526,7 @@ CONFIG_NET_ACT_NAT=m
 # CONFIG_NET_CLS_IND is not set
 CONFIG_NET_SCH_FIFO=y
 # CONFIG_DCB is not set
+CONFIG_RPS=y
 
 #
 # Network testing
@@ -546,6 +548,7 @@ CONFIG_CAN_VCAN=m
 # CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
 # CONFIG_PCMCIA is not set
 CONFIG_CCW=y
 
@@ -728,6 +731,7 @@ CONFIG_VIRTIO_NET=m
 # Character devices
 #
 CONFIG_DEVKMEM=y
+# CONFIG_N_GSM is not set
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
@@ -775,6 +779,7 @@ CONFIG_S390_TAPE_34XX=m
 # CONFIG_MONREADER is not set
 CONFIG_MONWRITER=m
 CONFIG_S390_VMUR=m
+# CONFIG_RAMOOPS is not set
 
 #
 # PPS support
@@ -788,10 +793,6 @@ CONFIG_S390_VMUR=m
 # CONFIG_NEW_LEDS is not set
 CONFIG_ACCESSIBILITY=y
 # CONFIG_AUXDISPLAY is not set
-
-#
-# TI VLYNQ
-#
 # CONFIG_STAGING is not set
 
 #
@@ -976,6 +977,7 @@ CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
 CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
 # CONFIG_LKDTM is not set
+# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_LATENCYTOP is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1010,6 +1012,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
 CONFIG_KPROBE_EVENT=y
 # CONFIG_RING_BUFFER_BENCHMARK is not set
 # CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
 CONFIG_SAMPLES=y
 # CONFIG_SAMPLE_TRACEPOINTS is not set
 # CONFIG_SAMPLE_TRACE_EVENTS is not set
index 639380a0c45c6278db26a03ea7b39eeec8fc48f2..22cfd634c35531b7f8a1d4057f92b4af72e20d1a 100644 (file)
@@ -55,8 +55,10 @@ void *module_alloc(unsigned long size)
 /* Free memory returned from module_alloc */
 void module_free(struct module *mod, void *module_region)
 {
-       vfree(mod->arch.syminfo);
-       mod->arch.syminfo = NULL;
+       if (mod) {
+               vfree(mod->arch.syminfo);
+               mod->arch.syminfo = NULL;
+       }
        vfree(module_region);
 }
 
index 8093e6f47f49735d978f19ff4ea40db7ab797313..ae3705816878f7a7eb4195ff4001ec136a567d2f 100644 (file)
@@ -761,7 +761,7 @@ static int __init kvm_s390_init(void)
         * to hold the maximum amount of facilites. On the other hand, we
         * only set facilities that are known to work in KVM.
         */
-       facilities = (unsigned long long *) get_zeroed_page(GFP_DMA);
+       facilities = (unsigned long long *) get_zeroed_page(GFP_KERNEL|GFP_DMA);
        if (!facilities) {
                kvm_exit();
                return -ENOMEM;
index eff3c5989b46b1135336cb806794febeebf6c905..702276f5e2fa4a25c0507e70ddde359916a971f6 100644 (file)
@@ -113,7 +113,7 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action)
 {
        struct kvm_s390_interrupt_info *inti;
 
-       inti = kzalloc(sizeof(*inti), GFP_KERNEL);
+       inti = kzalloc(sizeof(*inti), GFP_ATOMIC);
        if (!inti)
                return -ENOMEM;
        inti->type = KVM_S390_SIGP_STOP;
index 6409fd57eb049c837bd9693db08e835908121c99..3cc95dd0a3a6a1cb7bc133f0890786bf2324e4bf 100644 (file)
@@ -105,7 +105,7 @@ static int
 dcss_set_subcodes(void)
 {
 #ifdef CONFIG_64BIT
-       char *name = kmalloc(8 * sizeof(char), GFP_DMA);
+       char *name = kmalloc(8 * sizeof(char), GFP_KERNEL | GFP_DMA);
        unsigned long rx, ry;
        int rc;
 
@@ -252,12 +252,13 @@ dcss_diag_translate_rc (int vm_rc) {
 static int
 query_segment_type (struct dcss_segment *seg)
 {
-       struct qin64  *qin = kmalloc (sizeof(struct qin64), GFP_DMA);
-       struct qout64 *qout = kmalloc (sizeof(struct qout64), GFP_DMA);
-
-       int diag_cc, rc, i;
        unsigned long dummy, vmrc;
+       int diag_cc, rc, i;
+       struct qout64 *qout;
+       struct qin64 *qin;
 
+       qin = kmalloc(sizeof(*qin), GFP_KERNEL | GFP_DMA);
+       qout = kmalloc(sizeof(*qout), GFP_KERNEL | GFP_DMA);
        if ((qin == NULL) || (qout == NULL)) {
                rc = -ENOMEM;
                goto out_free;
@@ -286,7 +287,7 @@ query_segment_type (struct dcss_segment *seg)
           copy data for the new format. */
        if (segext_scode == DCSS_SEGEXT) {
                struct qout64_old *qout_old;
-               qout_old = kzalloc(sizeof(struct qout64_old), GFP_DMA);
+               qout_old = kzalloc(sizeof(*qout_old), GFP_KERNEL | GFP_DMA);
                if (qout_old == NULL) {
                        rc = -ENOMEM;
                        goto out_free;
@@ -407,11 +408,11 @@ segment_overlaps_others (struct dcss_segment *seg)
 static int
 __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long *end)
 {
-       struct dcss_segment *seg = kmalloc(sizeof(struct dcss_segment),
-                       GFP_DMA);
-       int rc, diag_cc;
        unsigned long start_addr, end_addr, dummy;
+       struct dcss_segment *seg;
+       int rc, diag_cc;
 
+       seg = kmalloc(sizeof(*seg), GFP_KERNEL | GFP_DMA);
        if (seg == NULL) {
                rc = -ENOMEM;
                goto out;
index b49d8ca228f6ffe743e19d0423c676e62b1d29df..8c7ae4318629445f16b588e9535b0dc2a105836c 100644 (file)
 #define MSR_AMD64_PATCH_LOADER         0xc0010020
 #define MSR_AMD64_OSVW_ID_LENGTH       0xc0010140
 #define MSR_AMD64_OSVW_STATUS          0xc0010141
+#define MSR_AMD64_DC_CFG               0xc0011022
 #define MSR_AMD64_IBSFETCHCTL          0xc0011030
 #define MSR_AMD64_IBSFETCHLINAD                0xc0011031
 #define MSR_AMD64_IBSFETCHPHYSAD       0xc0011032
index 48dcfa62ea07eb5985ef61c526ed767da3795283..fd921c3a68414e341fe8fffa8b1df1326eba2ba7 100644 (file)
@@ -15,6 +15,8 @@ static inline int arch_prepare_suspend(void) { return 0; }
 struct saved_context {
        u16 es, fs, gs, ss;
        unsigned long cr0, cr2, cr3, cr4;
+       u64 misc_enable;
+       bool misc_enable_saved;
        struct desc_ptr gdt;
        struct desc_ptr idt;
        u16 ldt;
index 06284f42b7599a8f46669fc3e4f6c9d8bbea7eb7..8d942afae681bec8fe2c47a9bf57955dbc4317b0 100644 (file)
@@ -27,6 +27,8 @@ struct saved_context {
        u16 ds, es, fs, gs, ss;
        unsigned long gs_base, gs_kernel_base, fs_base;
        unsigned long cr0, cr2, cr3, cr4, cr8;
+       u64 misc_enable;
+       bool misc_enable_saved;
        unsigned long efer;
        u16 gdt_pad;
        u16 gdt_limit;
index 7bca3c6a02fb186ebd039ff495f05fd051f32b6e..0d6fc71bedb152802401b49eb801696cb5ee460d 100644 (file)
@@ -729,7 +729,7 @@ static int __init e820_mark_nvs_memory(void)
                struct e820entry *ei = &e820.map[i];
 
                if (ei->type == E820_NVS)
-                       hibernate_nvs_register(ei->addr, ei->size);
+                       suspend_nvs_register(ei->addr, ei->size);
        }
 
        return 0;
index 81563e76e28f28a6f046630e1c13dbffd7215232..a6f695d76928675008a99f2030b00299856840c4 100644 (file)
@@ -1815,6 +1815,9 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
 
                spte |= PT_WRITABLE_MASK;
 
+               if (!tdp_enabled && !(pte_access & ACC_WRITE_MASK))
+                       spte &= ~PT_USER_MASK;
+
                /*
                 * Optimization: for pte sync, if spte was writable the hash
                 * lookup is unnecessary (and expensive). Write protection
@@ -1870,6 +1873,8 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
 
                        child = page_header(pte & PT64_BASE_ADDR_MASK);
                        mmu_page_remove_parent_pte(child, sptep);
+                       __set_spte(sptep, shadow_trap_nonpresent_pte);
+                       kvm_flush_remote_tlbs(vcpu->kvm);
                } else if (pfn != spte_to_pfn(*sptep)) {
                        pgprintk("hfn old %lx new %lx\n",
                                 spte_to_pfn(*sptep), pfn);
index 96dc232bfc56562a9cf0b178df962ba33a5c3c43..ce438e0fdd268f394995d604070b8b2aad783e4d 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/ftrace_event.h>
 #include <linux/slab.h>
 
+#include <asm/tlbflush.h>
 #include <asm/desc.h>
 
 #include <asm/virtext.h>
@@ -56,6 +57,8 @@ MODULE_LICENSE("GPL");
 
 #define DEBUGCTL_RESERVED_BITS (~(0x3fULL))
 
+static bool erratum_383_found __read_mostly;
+
 static const u32 host_save_user_msrs[] = {
 #ifdef CONFIG_X86_64
        MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
@@ -374,6 +377,31 @@ static void svm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr,
        svm->vmcb->control.event_inj_err = error_code;
 }
 
+static void svm_init_erratum_383(void)
+{
+       u32 low, high;
+       int err;
+       u64 val;
+
+       /* Only Fam10h is affected */
+       if (boot_cpu_data.x86 != 0x10)
+               return;
+
+       /* Use _safe variants to not break nested virtualization */
+       val = native_read_msr_safe(MSR_AMD64_DC_CFG, &err);
+       if (err)
+               return;
+
+       val |= (1ULL << 47);
+
+       low  = lower_32_bits(val);
+       high = upper_32_bits(val);
+
+       native_write_msr_safe(MSR_AMD64_DC_CFG, low, high);
+
+       erratum_383_found = true;
+}
+
 static int has_svm(void)
 {
        const char *msg;
@@ -429,6 +457,8 @@ static int svm_hardware_enable(void *garbage)
 
        wrmsrl(MSR_VM_HSAVE_PA, page_to_pfn(sd->save_area) << PAGE_SHIFT);
 
+       svm_init_erratum_383();
+
        return 0;
 }
 
@@ -1410,8 +1440,59 @@ static int nm_interception(struct vcpu_svm *svm)
        return 1;
 }
 
-static int mc_interception(struct vcpu_svm *svm)
+static bool is_erratum_383(void)
 {
+       int err, i;
+       u64 value;
+
+       if (!erratum_383_found)
+               return false;
+
+       value = native_read_msr_safe(MSR_IA32_MC0_STATUS, &err);
+       if (err)
+               return false;
+
+       /* Bit 62 may or may not be set for this mce */
+       value &= ~(1ULL << 62);
+
+       if (value != 0xb600000000010015ULL)
+               return false;
+
+       /* Clear MCi_STATUS registers */
+       for (i = 0; i < 6; ++i)
+               native_write_msr_safe(MSR_IA32_MCx_STATUS(i), 0, 0);
+
+       value = native_read_msr_safe(MSR_IA32_MCG_STATUS, &err);
+       if (!err) {
+               u32 low, high;
+
+               value &= ~(1ULL << 2);
+               low    = lower_32_bits(value);
+               high   = upper_32_bits(value);
+
+               native_write_msr_safe(MSR_IA32_MCG_STATUS, low, high);
+       }
+
+       /* Flush tlb to evict multi-match entries */
+       __flush_tlb_all();
+
+       return true;
+}
+
+static void svm_handle_mce(struct vcpu_svm *svm)
+{
+       if (is_erratum_383()) {
+               /*
+                * Erratum 383 triggered. Guest state is corrupt so kill the
+                * guest.
+                */
+               pr_err("KVM: Guest triggered AMD Erratum 383\n");
+
+               set_bit(KVM_REQ_TRIPLE_FAULT, &svm->vcpu.requests);
+
+               return;
+       }
+
        /*
         * On an #MC intercept the MCE handler is not called automatically in
         * the host. So do it by hand here.
@@ -1420,6 +1501,11 @@ static int mc_interception(struct vcpu_svm *svm)
                "int $0x12\n");
        /* not sure if we ever come back to this point */
 
+       return;
+}
+
+static int mc_interception(struct vcpu_svm *svm)
+{
        return 1;
 }
 
@@ -3088,6 +3174,14 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
                vcpu->arch.regs_avail &= ~(1 << VCPU_EXREG_PDPTR);
                vcpu->arch.regs_dirty &= ~(1 << VCPU_EXREG_PDPTR);
        }
+
+       /*
+        * We need to handle MC intercepts here before the vcpu has a chance to
+        * change the physical cpu
+        */
+       if (unlikely(svm->vmcb->control.exit_code ==
+                    SVM_EXIT_EXCP_BASE + MC_VECTOR))
+               svm_handle_mce(svm);
 }
 
 #undef R
index 97da2ba9344b4ca7fa1f08d7cd015fe77a332ea6..6fdb3ec30c3197e15fc54e18c91291f5eb403450 100644 (file)
@@ -96,6 +96,7 @@ EXPORT_SYMBOL(pcibios_align_resource);
  *       the fact the PCI specs explicitly allow address decoders to be
  *       shared between expansion ROMs and other resource regions, it's
  *       at least dangerous)
+ *     - bad resource sizes or overlaps with other regions
  *
  *  Our solution:
  *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
@@ -136,6 +137,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
                                         * child resource allocations in this
                                         * range.
                                         */
+                                       r->start = r->end = 0;
                                        r->flags = 0;
                                }
                        }
index 0a979f3e5b8a7596aaf7d402cf73b0bb7eace8a9..1290ba54b3506ba5325cecc01ac52853b36d0f26 100644 (file)
@@ -105,6 +105,8 @@ static void __save_processor_state(struct saved_context *ctxt)
        ctxt->cr4 = read_cr4();
        ctxt->cr8 = read_cr8();
 #endif
+       ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE,
+                                              &ctxt->misc_enable);
 }
 
 /* Needed by apm.c */
@@ -152,6 +154,8 @@ static void fix_processor_context(void)
  */
 static void __restore_processor_state(struct saved_context *ctxt)
 {
+       if (ctxt->misc_enable_saved)
+               wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable);
        /*
         * control registers
         */
index d269a8f3329cc0cbe9b5bcc8120c6a5b1c5320b7..446aced33aff81d7a2c4a949abce8979006db720 100644 (file)
@@ -46,6 +46,8 @@ static unsigned long power_saving_mwait_eax;
 
 static unsigned char tsc_detected_unstable;
 static unsigned char tsc_marked_unstable;
+static unsigned char lapic_detected_unstable;
+static unsigned char lapic_marked_unstable;
 
 static void power_saving_mwait_init(void)
 {
@@ -75,9 +77,6 @@ static void power_saving_mwait_init(void)
        power_saving_mwait_eax = (highest_cstate << MWAIT_SUBSTATE_SIZE) |
                (highest_subcstate - 1);
 
-       for_each_online_cpu(i)
-               clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &i);
-
 #if defined(CONFIG_GENERIC_TIME) && defined(CONFIG_X86)
        switch (boot_cpu_data.x86_vendor) {
        case X86_VENDOR_AMD:
@@ -86,13 +85,15 @@ static void power_saving_mwait_init(void)
                 * AMD Fam10h TSC will tick in all
                 * C/P/S0/S1 states when this bit is set.
                 */
-               if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
-                       return;
-
-               /*FALL THROUGH*/
+               if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
+                       tsc_detected_unstable = 1;
+               if (!boot_cpu_has(X86_FEATURE_ARAT))
+                       lapic_detected_unstable = 1;
+               break;
        default:
-               /* TSC could halt in idle */
+               /* TSC & LAPIC could halt in idle */
                tsc_detected_unstable = 1;
+               lapic_detected_unstable = 1;
        }
 #endif
 }
@@ -180,10 +181,20 @@ static int power_saving_thread(void *data)
                                mark_tsc_unstable("TSC halts in idle");
                                tsc_marked_unstable = 1;
                        }
+                       if (lapic_detected_unstable && !lapic_marked_unstable) {
+                               int i;
+                               /* LAPIC could halt in idle, so notify users */
+                               for_each_online_cpu(i)
+                                       clockevents_notify(
+                                               CLOCK_EVT_NOTIFY_BROADCAST_ON,
+                                               &i);
+                               lapic_marked_unstable = 1;
+                       }
                        local_irq_disable();
                        cpu = smp_processor_id();
-                       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
-                               &cpu);
+                       if (lapic_marked_unstable)
+                               clockevents_notify(
+                                       CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
                        stop_critical_timings();
 
                        __monitor((void *)&current_thread_info()->flags, 0, 0);
@@ -192,8 +203,9 @@ static int power_saving_thread(void *data)
                                __mwait(power_saving_mwait_eax, 1);
 
                        start_critical_timings();
-                       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
-                               &cpu);
+                       if (lapic_marked_unstable)
+                               clockevents_notify(
+                                       CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
                        local_irq_enable();
 
                        if (jiffies > expire_time) {
index 33181ad350d5e1be00982cec40f497f0c47aa2ae..b17d8de9f6ffd5c98b7f02f610c8bc0ce1248ace 100644 (file)
 
 #define ACPI_MAX_LOOP_ITERATIONS        0xFFFF
 
+/* Maximum sleep allowed via Sleep() operator */
+
+#define ACPI_MAX_SLEEP                  20000  /* Two seconds */
+
 /******************************************************************************
  *
  * ACPI Specification constants (Do not change unless the specification changes)
index 64d1e5c2d4ae694d3fb863803521fa965ba1e07e..c3f43daa8be3b84fa33e411f8240fd4e47c87ba5 100644 (file)
@@ -80,10 +80,6 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
 acpi_status
 acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info);
 
-acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info);
-
-acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
-
 struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
                                                       u32 gpe_number);
 
index 9070f1fe8f17e73adfdbc91cf0981f857e7b2f09..899d68afc3c5e0bde9be08338ec14399e52c7d32 100644 (file)
@@ -125,6 +125,14 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
  */
 u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE);
 
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+u8 ACPI_INIT_GLOBAL(acpi_gbl_truncate_io_addresses, FALSE);
+
 /* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */
 
 struct acpi_table_fadt acpi_gbl_FADT;
index 5900f135dc6d93e4bd05d0abbf9ce5e4bea82cba..32391588e163c5cb650deaf6c302a97b2efae1fd 100644 (file)
@@ -90,7 +90,11 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);
 /*
  * hwgpe - GPE support
  */
-acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
+u32 acpi_hw_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
+                            struct acpi_gpe_register_info *gpe_register_info);
+
+acpi_status
+acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action);
 
 acpi_status
 acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
index a221ad404167158fe679adc27dd3872156f3b9fd..7c2c336006a1f316e280e990876eb6ffcd2f0e1f 100644 (file)
@@ -69,7 +69,7 @@ acpi_status
 acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info)
 {
        struct acpi_gpe_register_info *gpe_register_info;
-       u8 register_bit;
+       u32 register_bit;
 
        ACPI_FUNCTION_TRACE(ev_update_gpe_enable_masks);
 
@@ -78,9 +78,8 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info)
                return_ACPI_STATUS(AE_NOT_EXIST);
        }
 
-       register_bit = (u8)
-           (1 <<
-            (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));
+       register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
+                                               gpe_register_info);
 
        /* Clear the wake/run bits up front */
 
@@ -100,106 +99,6 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info)
        return_ACPI_STATUS(AE_OK);
 }
 
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ev_enable_gpe
- *
- * PARAMETERS:  gpe_event_info          - GPE to enable
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Hardware-enable a GPE. Always enables the GPE, regardless
- *              of type or number of references.
- *
- * Note: The GPE lock should be already acquired when this function is called.
- *
- ******************************************************************************/
-
-acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
-{
-       acpi_status status;
-
-
-       ACPI_FUNCTION_TRACE(ev_enable_gpe);
-
-
-       /*
-        * We will only allow a GPE to be enabled if it has either an
-        * associated method (_Lxx/_Exx) or a handler. Otherwise, the
-        * GPE will be immediately disabled by acpi_ev_gpe_dispatch the
-        * first time it fires.
-        */
-       if (!(gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)) {
-               return_ACPI_STATUS(AE_NO_HANDLER);
-       }
-
-       /* Ensure the HW enable masks are current */
-
-       status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
-
-       /* Clear the GPE (of stale events) */
-
-       status = acpi_hw_clear_gpe(gpe_event_info);
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
-
-       /* Enable the requested GPE */
-
-       status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-       return_ACPI_STATUS(status);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ev_disable_gpe
- *
- * PARAMETERS:  gpe_event_info          - GPE to disable
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Hardware-disable a GPE. Always disables the requested GPE,
- *              regardless of the type or number of references.
- *
- * Note: The GPE lock should be already acquired when this function is called.
- *
- ******************************************************************************/
-
-acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
-{
-       acpi_status status;
-
-       ACPI_FUNCTION_TRACE(ev_disable_gpe);
-
-
-       /*
-        * Note: Always disable the GPE, even if we think that that it is already
-        * disabled. It is possible that the AML or some other code has enabled
-        * the GPE behind our back.
-        */
-
-       /* Ensure the HW enable masks are current */
-
-       status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
-       if (ACPI_FAILURE(status)) {
-               return_ACPI_STATUS(status);
-       }
-
-       /*
-        * Always H/W disable this GPE, even if we don't know the GPE type.
-        * Simply clear the enable bit for this particular GPE, but do not
-        * write out the current GPE enable mask since this may inadvertently
-        * enable GPEs too early. An example is a rogue GPE that has arrived
-        * during ACPICA initialization - possibly because AML or other code
-        * has enabled the GPE.
-        */
-       status = acpi_hw_low_disable_gpe(gpe_event_info);
-       return_ACPI_STATUS(status);
-}
-
 
 /*******************************************************************************
  *
@@ -451,10 +350,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
                return_VOID;
        }
 
-       /* Update the GPE register masks for return to enabled state */
-
-       (void)acpi_ev_update_gpe_enable_masks(gpe_event_info);
-
        /*
         * Take a snapshot of the GPE info for this level - we copy the info to
         * prevent a race condition with remove_handler/remove_block.
@@ -607,7 +502,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
                 * Disable the GPE, so it doesn't keep firing before the method has a
                 * chance to run (it runs asynchronously with interrupts enabled).
                 */
-               status = acpi_ev_disable_gpe(gpe_event_info);
+               status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
                if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, status,
                                        "Unable to disable GPE[0x%2X]",
@@ -644,7 +539,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
                 * Disable the GPE. The GPE will remain disabled a handler
                 * is installed or ACPICA is restarted.
                 */
-               status = acpi_ev_disable_gpe(gpe_event_info);
+               status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
                if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, status,
                                        "Unable to disable GPE[0x%2X]",
index 7c28f2d9fd35015189de8e13f54579b10814ec2f..341a38ce8aa6ce34e2e5a6c8653d6067ba9921d9 100644 (file)
@@ -500,6 +500,19 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
 
                        gpe_index = (i * ACPI_GPE_REGISTER_WIDTH) + j;
                        gpe_event_info = &gpe_block->event_info[gpe_index];
+                       gpe_number = gpe_index + gpe_block->block_base_number;
+
+                       /*
+                        * If the GPE has already been enabled for runtime
+                        * signaling, make sure it remains enabled, but do not
+                        * increment its reference counter.
+                        */
+                       if (gpe_event_info->runtime_count) {
+                               acpi_set_gpe(gpe_device, gpe_number,
+                                               ACPI_GPE_ENABLE);
+                               gpe_enabled_count++;
+                               continue;
+                       }
 
                        if (gpe_event_info->flags & ACPI_GPE_CAN_WAKE) {
                                wake_gpe_count++;
@@ -516,7 +529,6 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
 
                        /* Enable this GPE */
 
-                       gpe_number = gpe_index + gpe_block->block_base_number;
                        status = acpi_enable_gpe(gpe_device, gpe_number,
                                                 ACPI_GPE_TYPE_RUNTIME);
                        if (ACPI_FAILURE(status)) {
index cc825023012a6b2a3f715b96337e4fbab8742645..4a531cdf79423e7f9328318fc3cbd8f4b17a4f08 100644 (file)
@@ -719,13 +719,6 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        handler->context = context;
        handler->method_node = gpe_event_info->dispatch.method_node;
 
-       /* Disable the GPE before installing the handler */
-
-       status = acpi_ev_disable_gpe(gpe_event_info);
-       if (ACPI_FAILURE (status)) {
-               goto unlock_and_exit;
-       }
-
        /* Install the handler */
 
        flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
index d5a5efc043bf7a43ac446c815370576deaa5b096..d97b8dce16681ba90886a3b0e5546cf5b7060ce8 100644 (file)
@@ -208,6 +208,44 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
 
 ACPI_EXPORT_SYMBOL(acpi_enable_event)
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_clear_and_enable_gpe
+ *
+ * PARAMETERS:  gpe_event_info  - GPE to enable
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Clear the given GPE from stale events and enable it.
+ *
+ ******************************************************************************/
+static acpi_status
+acpi_clear_and_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
+{
+       acpi_status status;
+
+       /*
+        * We will only allow a GPE to be enabled if it has either an
+        * associated method (_Lxx/_Exx) or a handler. Otherwise, the
+        * GPE will be immediately disabled by acpi_ev_gpe_dispatch the
+        * first time it fires.
+        */
+       if (!(gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)) {
+               return_ACPI_STATUS(AE_NO_HANDLER);
+       }
+
+       /* Clear the GPE (of stale events) */
+       status = acpi_hw_clear_gpe(gpe_event_info);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       /* Enable the requested GPE */
+       status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
+
+       return_ACPI_STATUS(status);
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_set_gpe
@@ -249,11 +287,11 @@ acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action)
 
        switch (action) {
        case ACPI_GPE_ENABLE:
-               status = acpi_ev_enable_gpe(gpe_event_info);
+               status = acpi_clear_and_enable_gpe(gpe_event_info);
                break;
 
        case ACPI_GPE_DISABLE:
-               status = acpi_ev_disable_gpe(gpe_event_info);
+               status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
                break;
 
        default:
@@ -316,7 +354,11 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type)
 
                gpe_event_info->runtime_count++;
                if (gpe_event_info->runtime_count == 1) {
-                       status = acpi_ev_enable_gpe(gpe_event_info);
+                       status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
+                       if (ACPI_SUCCESS(status)) {
+                               status = acpi_clear_and_enable_gpe(gpe_event_info);
+                       }
+
                        if (ACPI_FAILURE(status)) {
                                gpe_event_info->runtime_count--;
                                goto unlock_and_exit;
@@ -343,7 +385,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type)
                 */
                gpe_event_info->wakeup_count++;
                if (gpe_event_info->wakeup_count == 1) {
-                       (void)acpi_ev_update_gpe_enable_masks(gpe_event_info);
+                       status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
                }
        }
 
@@ -403,7 +445,12 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type
 
                gpe_event_info->runtime_count--;
                if (!gpe_event_info->runtime_count) {
-                       status = acpi_ev_disable_gpe(gpe_event_info);
+                       status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
+                       if (ACPI_SUCCESS(status)) {
+                               status = acpi_hw_low_set_gpe(gpe_event_info,
+                                                            ACPI_GPE_DISABLE);
+                       }
+
                        if (ACPI_FAILURE(status)) {
                                gpe_event_info->runtime_count++;
                                goto unlock_and_exit;
@@ -424,7 +471,7 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type
 
                gpe_event_info->wakeup_count--;
                if (!gpe_event_info->wakeup_count) {
-                       (void)acpi_ev_update_gpe_enable_masks(gpe_event_info);
+                       status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
                }
        }
 
index 6d32e09327f17e35724839fa81dee69707867f1d..675aaa91a770f2a78d3e0f9e9ae134ccf95ae446 100644 (file)
@@ -201,6 +201,14 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long)
 
        acpi_ex_relinquish_interpreter();
 
+       /*
+        * For compatibility with other ACPI implementations and to prevent
+        * accidental deep sleeps, limit the sleep time to something reasonable.
+        */
+       if (how_long > ACPI_MAX_SLEEP) {
+               how_long = ACPI_MAX_SLEEP;
+       }
+
        acpi_os_sleep(how_long);
 
        /* And now we must get the interpreter again */
index bd72319a38f00fa9357bf76a01976b792e574a01..3450309c2786ca490d47eb6952059f8ae2eb89f8 100644 (file)
@@ -57,21 +57,47 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 
 /******************************************************************************
  *
- * FUNCTION:   acpi_hw_low_disable_gpe
+ * FUNCTION:   acpi_hw_gpe_register_bit
+ *
+ * PARAMETERS: gpe_event_info      - Info block for the GPE
+ *             gpe_register_info   - Info block for the GPE register
+ *
+ * RETURN:     Status
+ *
+ * DESCRIPTION:        Compute GPE enable mask with one bit corresponding to the given
+ *             GPE set.
+ *
+ ******************************************************************************/
+
+u32 acpi_hw_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
+                            struct acpi_gpe_register_info *gpe_register_info)
+{
+       return (u32)1 << (gpe_event_info->gpe_number -
+                               gpe_register_info->base_gpe_number);
+}
+
+/******************************************************************************
+ *
+ * FUNCTION:   acpi_hw_low_set_gpe
  *
  * PARAMETERS: gpe_event_info      - Info block for the GPE to be disabled
+ *             action              - Enable or disable
  *
  * RETURN:     Status
  *
- * DESCRIPTION: Disable a single GPE in the enable register.
+ * DESCRIPTION: Enable or disable a single GPE in its enable register.
  *
  ******************************************************************************/
 
-acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
+acpi_status
+acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action)
 {
        struct acpi_gpe_register_info *gpe_register_info;
        acpi_status status;
        u32 enable_mask;
+       u32 register_bit;
+
+       ACPI_FUNCTION_ENTRY();
 
        /* Get the info block for the entire GPE register */
 
@@ -87,11 +113,27 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
                return (status);
        }
 
-       /* Clear just the bit that corresponds to this GPE */
+       /* Set ot clear just the bit that corresponds to this GPE */
 
-       ACPI_CLEAR_BIT(enable_mask, ((u32)1 <<
-                                    (gpe_event_info->gpe_number -
-                                     gpe_register_info->base_gpe_number)));
+       register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
+                                               gpe_register_info);
+       switch (action) {
+       case ACPI_GPE_COND_ENABLE:
+               if (!(register_bit & gpe_register_info->enable_for_run))
+                       return (AE_BAD_PARAMETER);
+
+       case ACPI_GPE_ENABLE:
+               ACPI_SET_BIT(enable_mask, register_bit);
+               break;
+
+       case ACPI_GPE_DISABLE:
+               ACPI_CLEAR_BIT(enable_mask, register_bit);
+               break;
+
+       default:
+               ACPI_ERROR((AE_INFO, "Invalid action\n"));
+               return (AE_BAD_PARAMETER);
+       }
 
        /* Write the updated enable mask */
 
@@ -116,23 +158,11 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
 acpi_status
 acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info)
 {
-       struct acpi_gpe_register_info *gpe_register_info;
        acpi_status status;
 
        ACPI_FUNCTION_ENTRY();
 
-       /* Get the info block for the entire GPE register */
-
-       gpe_register_info = gpe_event_info->register_info;
-       if (!gpe_register_info) {
-               return (AE_NOT_EXIST);
-       }
-
-       /* Write the entire GPE (runtime) enable register */
-
-       status = acpi_hw_write(gpe_register_info->enable_for_run,
-                              &gpe_register_info->enable_address);
-
+       status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_COND_ENABLE);
        return (status);
 }
 
@@ -150,21 +180,28 @@ acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info)
 
 acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
 {
+       struct acpi_gpe_register_info *gpe_register_info;
        acpi_status status;
-       u8 register_bit;
+       u32 register_bit;
 
        ACPI_FUNCTION_ENTRY();
 
-       register_bit = (u8)(1 <<
-                           (gpe_event_info->gpe_number -
-                            gpe_event_info->register_info->base_gpe_number));
+       /* Get the info block for the entire GPE register */
+
+       gpe_register_info = gpe_event_info->register_info;
+       if (!gpe_register_info) {
+               return (AE_NOT_EXIST);
+       }
+
+       register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
+                                               gpe_register_info);
 
        /*
         * Write a one to the appropriate bit in the status register to
         * clear this GPE.
         */
        status = acpi_hw_write(register_bit,
-                              &gpe_event_info->register_info->status_address);
+                              &gpe_register_info->status_address);
 
        return (status);
 }
@@ -187,7 +224,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
                       acpi_event_status * event_status)
 {
        u32 in_byte;
-       u8 register_bit;
+       u32 register_bit;
        struct acpi_gpe_register_info *gpe_register_info;
        acpi_status status;
        acpi_event_status local_event_status = 0;
@@ -204,9 +241,8 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
 
        /* Get the register bitmask for this GPE */
 
-       register_bit = (u8)(1 <<
-                           (gpe_event_info->gpe_number -
-                            gpe_event_info->register_info->base_gpe_number));
+       register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
+                                               gpe_register_info);
 
        /* GPE currently enabled? (enabled for runtime?) */
 
index c10d587c16418ae00b801fc6ca5a63997d30e3ab..e1d9c777b213a3f70b90e8a20f9dd5868a425c29 100644 (file)
@@ -222,6 +222,12 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
        u32 one_byte;
        u32 i;
 
+       /* Truncate address to 16 bits if requested */
+
+       if (acpi_gbl_truncate_io_addresses) {
+               address &= ACPI_UINT16_MAX;
+       }
+
        /* Validate the entire request and perform the I/O */
 
        status = acpi_hw_validate_io_request(address, width);
@@ -279,6 +285,12 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
        acpi_status status;
        u32 i;
 
+       /* Truncate address to 16 bits if requested */
+
+       if (acpi_gbl_truncate_io_addresses) {
+               address &= ACPI_UINT16_MAX;
+       }
+
        /* Validate the entire request and perform the I/O */
 
        status = acpi_hw_validate_io_request(address, width);
index 9bd6f050f299ef55b545dac56a890d8f3219bc18..4e5272c313e0ce5be2d4ead501cb3f41bf9a3e07 100644 (file)
@@ -193,6 +193,15 @@ acpi_status acpi_ns_initialize_devices(void)
                                        acpi_ns_init_one_device, NULL, &info,
                                        NULL);
 
+       /*
+        * Any _OSI requests should be completed by now. If the BIOS has
+        * requested any Windows OSI strings, we will always truncate
+        * I/O addresses to 16 bits -- for Windows compatibility.
+        */
+       if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
+               acpi_gbl_truncate_io_addresses = TRUE;
+       }
+
        ACPI_FREE(info.evaluate_info);
        if (ACPI_FAILURE(status)) {
                goto error_exit;
index 2815df66f6f7354f433a370a0819a91103bd50d4..01381be05e96b3dda60b1d753b81ecf5dc610dcd 100644 (file)
@@ -218,6 +218,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
                },
        },
        {
+       .callback = dmi_disable_osi_vista,
+       .ident = "VGN-NS50B_L",
+       .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS50B_L"),
+               },
+       },
+       {
        .callback = dmi_disable_osi_win7,
        .ident = "ASUS K50IJ",
        .matches = {
index fd51c4ab4829dee0f37446f32a15a4679065675c..7d857dabdde44ad8085737591be907c49b3fbf4e 100644 (file)
@@ -425,7 +425,7 @@ static int acpi_button_add(struct acpi_device *device)
                /* Button's GPE is run-wake GPE */
                acpi_enable_gpe(device->wakeup.gpe_device,
                                device->wakeup.gpe_number,
-                               ACPI_GPE_TYPE_WAKE_RUN);
+                               ACPI_GPE_TYPE_RUNTIME);
                device->wakeup.run_wake_count++;
                device->wakeup.state.enabled = 1;
        }
@@ -449,7 +449,7 @@ static int acpi_button_remove(struct acpi_device *device, int type)
        if (device->wakeup.flags.valid) {
                acpi_disable_gpe(device->wakeup.gpe_device,
                                device->wakeup.gpe_number,
-                               ACPI_GPE_TYPE_WAKE_RUN);
+                               ACPI_GPE_TYPE_RUNTIME);
                device->wakeup.run_wake_count--;
                device->wakeup.state.enabled = 0;
        }
index acf2ab24984263d7990239a395e73862cf914c5c..8a3b840c0bb268d0580cd5550c41986bf3c09662 100644 (file)
@@ -347,7 +347,6 @@ static int __init acpi_fan_init(void)
 {
        int result = 0;
 
-
 #ifdef CONFIG_ACPI_PROCFS
        acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
        if (!acpi_fan_dir)
@@ -356,7 +355,9 @@ static int __init acpi_fan_init(void)
 
        result = acpi_bus_register_driver(&acpi_fan_driver);
        if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS
                remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
+#endif
                return -ENODEV;
        }
 
index b1034a9ada4e74da88970cbdc65dd9c1959d9988..38ea0cc6dc49aba88b53a503107d144fcebe992b 100644 (file)
@@ -581,6 +581,11 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
                return 0;
        }
 
+#ifdef CONFIG_SMP
+       if (pr->id >= setup_max_cpus && pr->id != 0)
+               return 0;
+#endif
+
        BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
 
        /*
index 3fb4bdea7e06e59edcd5591897179895ce12807c..5b7c52e4a00f09001becab5df101e7e5fa4dabc8 100644 (file)
@@ -114,6 +114,8 @@ static int __acpi_pm_prepare(void)
 {
        int error = acpi_sleep_prepare(acpi_target_sleep_state);
 
+       suspend_nvs_save();
+
        if (error)
                acpi_target_sleep_state = ACPI_STATE_S0;
        return error;
@@ -143,6 +145,9 @@ static void acpi_pm_finish(void)
 {
        u32 acpi_state = acpi_target_sleep_state;
 
+       suspend_nvs_free();
+       acpi_ec_unblock_transactions();
+
        if (acpi_state == ACPI_STATE_S0)
                return;
 
@@ -192,6 +197,11 @@ static int acpi_suspend_begin(suspend_state_t pm_state)
        u32 acpi_state = acpi_suspend_states[pm_state];
        int error = 0;
 
+       error = suspend_nvs_alloc();
+
+       if (error)
+               return error;
+
        if (sleep_states[acpi_state]) {
                acpi_target_sleep_state = acpi_state;
                acpi_sleep_tts_switch(acpi_target_sleep_state);
@@ -269,12 +279,13 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
        if (acpi_state == ACPI_STATE_S3)
                acpi_restore_state_mem();
 
+       suspend_nvs_restore();
+
        return ACPI_SUCCESS(status) ? 0 : -EFAULT;
 }
 
 static void acpi_suspend_finish(void)
 {
-       acpi_ec_unblock_transactions();
        acpi_pm_finish();
 }
 
@@ -404,7 +415,7 @@ static int acpi_hibernation_begin(void)
 {
        int error;
 
-       error = s4_no_nvs ? 0 : hibernate_nvs_alloc();
+       error = s4_no_nvs ? 0 : suspend_nvs_alloc();
        if (!error) {
                acpi_target_sleep_state = ACPI_STATE_S4;
                acpi_sleep_tts_switch(acpi_target_sleep_state);
@@ -418,7 +429,7 @@ static int acpi_hibernation_pre_snapshot(void)
        int error = acpi_pm_prepare();
 
        if (!error)
-               hibernate_nvs_save();
+               suspend_nvs_save();
 
        return error;
 }
@@ -441,13 +452,6 @@ static int acpi_hibernation_enter(void)
        return ACPI_SUCCESS(status) ? 0 : -EFAULT;
 }
 
-static void acpi_hibernation_finish(void)
-{
-       hibernate_nvs_free();
-       acpi_ec_unblock_transactions();
-       acpi_pm_finish();
-}
-
 static void acpi_hibernation_leave(void)
 {
        /*
@@ -464,7 +468,7 @@ static void acpi_hibernation_leave(void)
                panic("ACPI S4 hardware signature mismatch");
        }
        /* Restore the NVS memory area */
-       hibernate_nvs_restore();
+       suspend_nvs_restore();
        /* Allow EC transactions to happen. */
        acpi_ec_unblock_transactions_early();
 }
@@ -479,7 +483,7 @@ static struct platform_hibernation_ops acpi_hibernation_ops = {
        .begin = acpi_hibernation_begin,
        .end = acpi_pm_end,
        .pre_snapshot = acpi_hibernation_pre_snapshot,
-       .finish = acpi_hibernation_finish,
+       .finish = acpi_pm_finish,
        .prepare = acpi_pm_prepare,
        .enter = acpi_hibernation_enter,
        .leave = acpi_hibernation_leave,
@@ -507,7 +511,7 @@ static int acpi_hibernation_begin_old(void)
 
        if (!error) {
                if (!s4_no_nvs)
-                       error = hibernate_nvs_alloc();
+                       error = suspend_nvs_alloc();
                if (!error)
                        acpi_target_sleep_state = ACPI_STATE_S4;
        }
@@ -517,7 +521,7 @@ static int acpi_hibernation_begin_old(void)
 static int acpi_hibernation_pre_snapshot_old(void)
 {
        acpi_pm_freeze();
-       hibernate_nvs_save();
+       suspend_nvs_save();
        return 0;
 }
 
@@ -529,8 +533,8 @@ static struct platform_hibernation_ops acpi_hibernation_ops_old = {
        .begin = acpi_hibernation_begin_old,
        .end = acpi_pm_end,
        .pre_snapshot = acpi_hibernation_pre_snapshot_old,
-       .finish = acpi_hibernation_finish,
        .prepare = acpi_pm_freeze,
+       .finish = acpi_pm_finish,
        .enter = acpi_hibernation_enter,
        .leave = acpi_hibernation_leave,
        .pre_restore = acpi_pm_freeze,
index c79e789ed03ae39a1c771e80586a1460546672a5..f8db50a0941c286eaba3466869ab4ed4fea23452 100644 (file)
@@ -388,10 +388,12 @@ static ssize_t counter_set(struct kobject *kobj,
        if (index < num_gpes) {
                if (!strcmp(buf, "disable\n") &&
                                (status & ACPI_EVENT_FLAG_ENABLED))
-                       result = acpi_set_gpe(handle, index, ACPI_GPE_DISABLE);
+                       result = acpi_disable_gpe(handle, index,
+                                               ACPI_GPE_TYPE_RUNTIME);
                else if (!strcmp(buf, "enable\n") &&
                                !(status & ACPI_EVENT_FLAG_ENABLED))
-                       result = acpi_set_gpe(handle, index, ACPI_GPE_ENABLE);
+                       result = acpi_enable_gpe(handle, index,
+                                               ACPI_GPE_TYPE_RUNTIME);
                else if (!strcmp(buf, "clear\n") &&
                                (status & ACPI_EVENT_FLAG_SET))
                        result = acpi_clear_gpe(handle, index);
index 4b9d339a6e28875e7eb7eaa942859bc7207d799b..388747a7ef4fc261b4e09db7866bc86bb9b17570 100644 (file)
@@ -64,16 +64,13 @@ void acpi_enable_wakeup_device(u8 sleep_state)
                struct acpi_device *dev =
                        container_of(node, struct acpi_device, wakeup_list);
 
-               if (!dev->wakeup.flags.valid)
-                       continue;
-
-               if ((!dev->wakeup.state.enabled && !dev->wakeup.prepare_count)
+               if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled
                    || sleep_state > (u32) dev->wakeup.sleep_state)
                        continue;
 
                /* The wake-up power should have been enabled already. */
-               acpi_set_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
-                               ACPI_GPE_ENABLE);
+               acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
+                               ACPI_GPE_TYPE_WAKE);
        }
 }
 
@@ -96,6 +93,8 @@ void acpi_disable_wakeup_device(u8 sleep_state)
                    || (sleep_state > (u32) dev->wakeup.sleep_state))
                        continue;
 
+               acpi_disable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
+                               ACPI_GPE_TYPE_WAKE);
                acpi_disable_wakeup_device_power(dev);
        }
 }
@@ -109,13 +108,8 @@ int __init acpi_wakeup_device_init(void)
                struct acpi_device *dev = container_of(node,
                                                       struct acpi_device,
                                                       wakeup_list);
-               /* In case user doesn't load button driver */
-               if (!dev->wakeup.flags.always_enabled ||
-                   dev->wakeup.state.enabled)
-                       continue;
-               acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
-                               ACPI_GPE_TYPE_WAKE);
-               dev->wakeup.state.enabled = 1;
+               if (dev->wakeup.flags.always_enabled)
+                       dev->wakeup.state.enabled = 1;
        }
        mutex_unlock(&acpi_device_lock);
        return 0;
index 1984a6e89e84450b55c7798b83a7232f2f16e6a8..261f86d102e8ba520105dfd10efac3930a9d7a12 100644 (file)
@@ -541,29 +541,11 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
        return -EINVAL;
 }
 
-static int ahci_is_device_present(void __iomem *port_mmio)
-{
-       u8 status = readl(port_mmio + PORT_TFDATA) & 0xff;
-
-       /* Make sure PxTFD.STS.BSY and PxTFD.STS.DRQ are 0 */
-       if (status & (ATA_BUSY | ATA_DRQ))
-               return 0;
-
-       /* Make sure PxSSTS.DET is 3h */
-       status = readl(port_mmio + PORT_SCR_STAT) & 0xf;
-       if (status != 3)
-               return 0;
-       return 1;
-}
-
 void ahci_start_engine(struct ata_port *ap)
 {
        void __iomem *port_mmio = ahci_port_base(ap);
        u32 tmp;
 
-       if (!ahci_is_device_present(port_mmio))
-               return;
-
        /* start DMA */
        tmp = readl(port_mmio + PORT_CMD);
        tmp |= PORT_CMD_START;
@@ -1892,6 +1874,9 @@ static void ahci_error_handler(struct ata_port *ap)
        }
 
        sata_pmp_error_handler(ap);
+
+       if (!ata_dev_enabled(ap->link.device))
+               ahci_stop_engine(ap);
 }
 
 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
index e9250514734b14d77591187e65c7a062cc917117..be7726d7686dd1b11368948ff2cd8645a5368dbd 100644 (file)
@@ -539,12 +539,12 @@ static void sil24_config_port(struct ata_port *ap)
                writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_CLR);
 
        /* zero error counters. */
-       writel(0x8000, port + PORT_DECODE_ERR_THRESH);
-       writel(0x8000, port + PORT_CRC_ERR_THRESH);
-       writel(0x8000, port + PORT_HSHK_ERR_THRESH);
-       writel(0x0000, port + PORT_DECODE_ERR_CNT);
-       writel(0x0000, port + PORT_CRC_ERR_CNT);
-       writel(0x0000, port + PORT_HSHK_ERR_CNT);
+       writew(0x8000, port + PORT_DECODE_ERR_THRESH);
+       writew(0x8000, port + PORT_CRC_ERR_THRESH);
+       writew(0x8000, port + PORT_HSHK_ERR_THRESH);
+       writew(0x0000, port + PORT_DECODE_ERR_CNT);
+       writew(0x0000, port + PORT_CRC_ERR_CNT);
+       writew(0x0000, port + PORT_HSHK_ERR_CNT);
 
        /* always use 64bit activation */
        writel(PORT_CS_32BIT_ACTV, port + PORT_CTRL_CLR);
@@ -622,6 +622,11 @@ static int sil24_exec_polled_cmd(struct ata_port *ap, int pmp,
        irq_enabled = readl(port + PORT_IRQ_ENABLE_SET);
        writel(PORT_IRQ_COMPLETE | PORT_IRQ_ERROR, port + PORT_IRQ_ENABLE_CLR);
 
+       /*
+        * The barrier is required to ensure that writes to cmd_block reach
+        * the memory before the write to PORT_CMD_ACTIVATE.
+        */
+       wmb();
        writel((u32)paddr, port + PORT_CMD_ACTIVATE);
        writel((u64)paddr >> 32, port + PORT_CMD_ACTIVATE + 4);
 
@@ -865,7 +870,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
        } else {
                prb = &cb->atapi.prb;
                sge = cb->atapi.sge;
-               memset(cb->atapi.cdb, 0, 32);
+               memset(cb->atapi.cdb, 0, sizeof(cb->atapi.cdb));
                memcpy(cb->atapi.cdb, qc->cdb, qc->dev->cdb_len);
 
                if (ata_is_data(qc->tf.protocol)) {
@@ -895,6 +900,11 @@ static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc)
        paddr = pp->cmd_block_dma + tag * sizeof(*pp->cmd_block);
        activate = port + PORT_CMD_ACTIVATE + tag * 8;
 
+       /*
+        * The barrier is required to ensure that writes to cmd_block reach
+        * the memory before the write to PORT_CMD_ACTIVATE.
+        */
+       wmb();
        writel((u32)paddr, activate);
        writel((u64)paddr >> 32, activate + 4);
 
index 0ecd0f6aa2c068865996588ceafab8c95d23ddb8..4730c42a5ee58c54a295dc6a72e493f7b91cd411 100644 (file)
@@ -578,10 +578,24 @@ static void svia_configure(struct pci_dev *pdev)
 
        /*
         * vt6421 has problems talking to some drives.  The following
-        * is the magic fix from Joseph Chan <JosephChan@via.com.tw>.
-        * Please add proper documentation if possible.
+        * is the fix from Joseph Chan <JosephChan@via.com.tw>.
+        *
+        * When host issues HOLD, device may send up to 20DW of data
+        * before acknowledging it with HOLDA and the host should be
+        * able to buffer them in FIFO.  Unfortunately, some WD drives
+        * send upto 40DW before acknowledging HOLD and, in the
+        * default configuration, this ends up overflowing vt6421's
+        * FIFO, making the controller abort the transaction with
+        * R_ERR.
+        *
+        * Rx52[2] is the internal 128DW FIFO Flow control watermark
+        * adjusting mechanism enable bit and the default value 0
+        * means host will issue HOLD to device when the left FIFO
+        * size goes below 32DW.  Setting it to 1 makes the watermark
+        * 64DW.
         *
         * https://bugzilla.kernel.org/show_bug.cgi?id=15173
+        * http://article.gmane.org/gmane.linux.ide/46352
         */
        if (pdev->device == 0x3249) {
                pci_read_config_byte(pdev, 0x52, &tmp8);
index 8e00b4ddd0830699bca8bab65c3e855657b21978..792868d24f2a0f2ad6bc21a4967ace01a2f84d92 100644 (file)
@@ -224,6 +224,7 @@ struct      tpm_readpubek_params_out {
        u8      algorithm[4];
        u8      encscheme[2];
        u8      sigscheme[2];
+       __be32  paramsize;
        u8      parameters[12]; /*assuming RSA*/
        __be32  keysize;
        u8      modulus[256];
index 1296c42ed5c627d876adf3bc75e4e1a665cc8a1d..7cdb6ee569cd7ca592bedfea458f0b676ec937af 100644 (file)
@@ -304,7 +304,7 @@ static void scrup(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
        d = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t);
        s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * (t + nr));
        scr_memmovew(d, s, (b - t - nr) * vc->vc_size_row);
-       scr_memsetw(d + (b - t - nr) * vc->vc_size_row, vc->vc_video_erase_char,
+       scr_memsetw(d + (b - t - nr) * vc->vc_cols, vc->vc_video_erase_char,
                    vc->vc_size_row * nr);
 }
 
index 9dcb30466ec0a22a11092decb65474e7bdcc5191..371713ff02660e0c0ab08bf86a3d496f90a6e718 100644 (file)
@@ -231,7 +231,7 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
 static void fw_card_bm_work(struct work_struct *work)
 {
        struct fw_card *card = container_of(work, struct fw_card, work.work);
-       struct fw_device *root_device;
+       struct fw_device *root_device, *irm_device;
        struct fw_node *root_node;
        unsigned long flags;
        int root_id, new_root_id, irm_id, local_id;
@@ -239,6 +239,7 @@ static void fw_card_bm_work(struct work_struct *work)
        bool do_reset = false;
        bool root_device_is_running;
        bool root_device_is_cmc;
+       bool irm_is_1394_1995_only;
 
        spin_lock_irqsave(&card->lock, flags);
 
@@ -248,12 +249,18 @@ static void fw_card_bm_work(struct work_struct *work)
        }
 
        generation = card->generation;
+
        root_node = card->root_node;
        fw_node_get(root_node);
        root_device = root_node->data;
        root_device_is_running = root_device &&
                        atomic_read(&root_device->state) == FW_DEVICE_RUNNING;
        root_device_is_cmc = root_device && root_device->cmc;
+
+       irm_device = card->irm_node->data;
+       irm_is_1394_1995_only = irm_device && irm_device->config_rom &&
+                       (irm_device->config_rom[2] & 0x000000f0) == 0;
+
        root_id  = root_node->node_id;
        irm_id   = card->irm_node->node_id;
        local_id = card->local_node->node_id;
@@ -276,8 +283,15 @@ static void fw_card_bm_work(struct work_struct *work)
 
                if (!card->irm_node->link_on) {
                        new_root_id = local_id;
-                       fw_notify("IRM has link off, making local node (%02x) root.\n",
-                                 new_root_id);
+                       fw_notify("%s, making local node (%02x) root.\n",
+                                 "IRM has link off", new_root_id);
+                       goto pick_me;
+               }
+
+               if (irm_is_1394_1995_only) {
+                       new_root_id = local_id;
+                       fw_notify("%s, making local node (%02x) root.\n",
+                                 "IRM is not 1394a compliant", new_root_id);
                        goto pick_me;
                }
 
@@ -316,8 +330,8 @@ static void fw_card_bm_work(struct work_struct *work)
                         * root, and thus, IRM.
                         */
                        new_root_id = local_id;
-                       fw_notify("BM lock failed, making local node (%02x) root.\n",
-                                 new_root_id);
+                       fw_notify("%s, making local node (%02x) root.\n",
+                                 "BM lock failed", new_root_id);
                        goto pick_me;
                }
        } else if (card->bm_generation != generation) {
index 994d23beeb1d68dce7032abf5cc347c4f3027c44..57cea01c4ffb25cb62b7b46007853c506a5c15a3 100644 (file)
@@ -1840,8 +1840,10 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
 
                ret = copy_from_user(clips, clips_ptr,
                                     num_clips * sizeof(*clips));
-               if (ret)
+               if (ret) {
+                       ret = -EFAULT;
                        goto out_err2;
+               }
        }
 
        if (fb->funcs->dirty) {
index b3779d243aefc30f48768c67c2f5a261dd825ce2..08c4c926e65f58e1b28fabcb1bb30c3ac183f7b5 100644 (file)
@@ -264,7 +264,7 @@ bool drm_fb_helper_force_kernel_mode(void)
 int drm_fb_helper_panic(struct notifier_block *n, unsigned long ununsed,
                        void *panic_str)
 {
-       DRM_ERROR("panic occurred, switching back to text console\n");
+       printk(KERN_ERR "panic occurred, switching back to text console\n");
        return drm_fb_helper_force_kernel_mode();
        return 0;
 }
index b2ebf02e4f8a738a00bf9089c212db8d3fc468ee..59a2bf8592ece73672c403ef3744c4bdeb715c04 100644 (file)
@@ -1402,19 +1402,19 @@ static int i915_load_modeset_init(struct drm_device *dev,
        /* if we have > 1 VGA cards, then disable the radeon VGA resources */
        ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode);
        if (ret)
-               goto destroy_ringbuffer;
+               goto cleanup_ringbuffer;
 
        ret = vga_switcheroo_register_client(dev->pdev,
                                             i915_switcheroo_set_state,
                                             i915_switcheroo_can_switch);
        if (ret)
-               goto destroy_ringbuffer;
+               goto cleanup_vga_client;
 
        intel_modeset_init(dev);
 
        ret = drm_irq_install(dev);
        if (ret)
-               goto destroy_ringbuffer;
+               goto cleanup_vga_switcheroo;
 
        /* Always safe in the mode setting case. */
        /* FIXME: do pre/post-mode set stuff in core KMS code */
@@ -1426,11 +1426,20 @@ static int i915_load_modeset_init(struct drm_device *dev,
 
        I915_WRITE(INSTPM, (1 << 5) | (1 << 21));
 
-       intel_fbdev_init(dev);
+       ret = intel_fbdev_init(dev);
+       if (ret)
+               goto cleanup_irq;
+
        drm_kms_helper_poll_init(dev);
        return 0;
 
-destroy_ringbuffer:
+cleanup_irq:
+       drm_irq_uninstall(dev);
+cleanup_vga_switcheroo:
+       vga_switcheroo_unregister_client(dev->pdev);
+cleanup_vga_client:
+       vga_client_register(dev->pdev, NULL, NULL, NULL);
+cleanup_ringbuffer:
        mutex_lock(&dev->struct_mutex);
        i915_gem_cleanup_ringbuffer(dev);
        mutex_unlock(&dev->struct_mutex);
index 9ed8ecd95801e94734716a2c64ba62d540d4600c..2765831598479b8d9e0bb72712d3ca71ce9a95e2 100644 (file)
@@ -278,6 +278,7 @@ typedef struct drm_i915_private {
        struct mem_block *agp_heap;
        unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds;
        int vblank_pipe;
+       int num_pipe;
 
        /* For hangcheck timer */
 #define DRM_I915_HANGCHECK_PERIOD 75 /* in jiffies */
index 04e1bb499ff8019bc2e1f9d9d6864bdb673b8448..cc8131ff319f3f0d243a15c0ddd924c1a93b8147 100644 (file)
@@ -3653,6 +3653,11 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
                        pipeconf &= ~PIPEACONF_DOUBLE_WIDE;
        }
 
+       dspcntr |= DISPLAY_PLANE_ENABLE;
+       pipeconf |= PIPEACONF_ENABLE;
+       dpll |= DPLL_VCO_ENABLE;
+
+
        /* Disable the panel fitter if it was on our pipe */
        if (!HAS_PCH_SPLIT(dev) && intel_panel_fitter_pipe(dev) == pipe)
                I915_WRITE(PFIT_CONTROL, 0);
@@ -5470,7 +5475,6 @@ static void intel_init_display(struct drm_device *dev)
 void intel_modeset_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
-       int num_pipe;
        int i;
 
        drm_mode_config_init(dev);
@@ -5500,13 +5504,13 @@ void intel_modeset_init(struct drm_device *dev)
                dev->mode_config.fb_base = pci_resource_start(dev->pdev, 0);
 
        if (IS_MOBILE(dev) || IS_I9XX(dev))
-               num_pipe = 2;
+               dev_priv->num_pipe = 2;
        else
-               num_pipe = 1;
+               dev_priv->num_pipe = 1;
        DRM_DEBUG_KMS("%d display pipe%s available.\n",
-                 num_pipe, num_pipe > 1 ? "s" : "");
+                     dev_priv->num_pipe, dev_priv->num_pipe > 1 ? "s" : "");
 
-       for (i = 0; i < num_pipe; i++) {
+       for (i = 0; i < dev_priv->num_pipe; i++) {
                intel_crtc_init(dev, i);
        }
 
index f8c76e64bb77e4a189e450b606ecb3684fbcb017..c3c505244e07367c3a8a3cb17698d60ef5ce5407 100644 (file)
@@ -245,6 +245,7 @@ int intel_fbdev_init(struct drm_device *dev)
 {
        struct intel_fbdev *ifbdev;
        drm_i915_private_t *dev_priv = dev->dev_private;
+       int ret;
 
        ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
        if (!ifbdev)
@@ -253,8 +254,13 @@ int intel_fbdev_init(struct drm_device *dev)
        dev_priv->fbdev = ifbdev;
        ifbdev->helper.funcs = &intel_fb_helper_funcs;
 
-       drm_fb_helper_init(dev, &ifbdev->helper, 2,
-                          INTELFB_CONN_LIMIT);
+       ret = drm_fb_helper_init(dev, &ifbdev->helper,
+                                dev_priv->num_pipe,
+                                INTELFB_CONN_LIMIT);
+       if (ret) {
+               kfree(ifbdev);
+               return ret;
+       }
 
        drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
        drm_fb_helper_initial_config(&ifbdev->helper, 32);
index 9ba2deaadcc7d38b833ff63fc99f4b76cc144ac1..fc924b64919529cfccc14a85c3eb28ae0ab8f50d 100644 (file)
@@ -834,7 +834,7 @@ init_i2c_device_find(struct drm_device *dev, int i2c_index)
        if (i2c_index == 0x81)
                i2c_index = (dcb->i2c_default_indices & 0xf0) >> 4;
 
-       if (i2c_index > DCB_MAX_NUM_I2C_ENTRIES) {
+       if (i2c_index >= DCB_MAX_NUM_I2C_ENTRIES) {
                NV_ERROR(dev, "invalid i2c_index 0x%x\n", i2c_index);
                return NULL;
        }
@@ -3920,7 +3920,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
 
 static uint8_t *
 bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent,
-                        uint16_t record, int record_len, int record_nr)
+                        uint16_t record, int record_len, int record_nr,
+                        bool match_link)
 {
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct nvbios *bios = &dev_priv->vbios;
@@ -3928,12 +3929,28 @@ bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent,
        uint16_t table;
        int i, v;
 
+       switch (dcbent->type) {
+       case OUTPUT_TMDS:
+       case OUTPUT_LVDS:
+       case OUTPUT_DP:
+               break;
+       default:
+               match_link = false;
+               break;
+       }
+
        for (i = 0; i < record_nr; i++, record += record_len) {
                table = ROM16(bios->data[record]);
                if (!table)
                        continue;
                entry = ROM32(bios->data[table]);
 
+               if (match_link) {
+                       v = (entry & 0x00c00000) >> 22;
+                       if (!(v & dcbent->sorconf.link))
+                               continue;
+               }
+
                v = (entry & 0x000f0000) >> 16;
                if (!(v & dcbent->or))
                        continue;
@@ -3975,7 +3992,7 @@ nouveau_bios_dp_table(struct drm_device *dev, struct dcb_entry *dcbent,
        *length = table[4];
        return bios_output_config_match(dev, dcbent,
                                        bios->display.dp_table_ptr + table[1],
-                                       table[2], table[3]);
+                                       table[2], table[3], table[0] >= 0x21);
 }
 
 int
@@ -4064,7 +4081,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent,
                        dcbent->type, dcbent->location, dcbent->or);
        otable = bios_output_config_match(dev, dcbent, table[1] +
                                          bios->display.script_table_ptr,
-                                         table[2], table[3]);
+                                         table[2], table[3], table[0] >= 0x21);
        if (!otable) {
                NV_ERROR(dev, "Couldn't find matching output script table\n");
                return 1;
index fd4a2df715e96d40bd28c2cfea428ad6fae03cd2..c9a4a0d2a11593a0d2010bdd979352c4d5cd6003 100644 (file)
@@ -377,6 +377,7 @@ int nouveau_fbcon_init(struct drm_device *dev)
 {
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct nouveau_fbdev *nfbdev;
+       int ret;
 
        nfbdev = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
        if (!nfbdev)
@@ -386,7 +387,12 @@ int nouveau_fbcon_init(struct drm_device *dev)
        dev_priv->nfbdev = nfbdev;
        nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs;
 
-       drm_fb_helper_init(dev, &nfbdev->helper, 2, 4);
+       ret = drm_fb_helper_init(dev, &nfbdev->helper, 2, 4);
+       if (ret) {
+               kfree(nfbdev);
+               return ret;
+       }
+
        drm_fb_helper_single_add_all_connectors(&nfbdev->helper);
        drm_fb_helper_initial_config(&nfbdev->helper, 32);
        return 0;
index 147e59c4015148e4b645648346b2e959370d3dcf..b02a231d6937489fe972bfc813dc72d5d421aa70 100644 (file)
@@ -779,29 +779,24 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
                        return ret;
        }
 
-       /* map larger RAMIN aperture on NV40 cards */
-       dev_priv->ramin  = NULL;
+       /* Map PRAMIN BAR, or on older cards, the aperture withing BAR0 */
        if (dev_priv->card_type >= NV_40) {
                int ramin_bar = 2;
                if (pci_resource_len(dev->pdev, ramin_bar) == 0)
                        ramin_bar = 3;
 
                dev_priv->ramin_size = pci_resource_len(dev->pdev, ramin_bar);
-               dev_priv->ramin = ioremap(
-                               pci_resource_start(dev->pdev, ramin_bar),
+               dev_priv->ramin =
+                       ioremap(pci_resource_start(dev->pdev, ramin_bar),
                                dev_priv->ramin_size);
                if (!dev_priv->ramin) {
-                       NV_ERROR(dev, "Failed to init RAMIN mapping, "
-                                     "limited instance memory available\n");
+                       NV_ERROR(dev, "Failed to PRAMIN BAR");
+                       return -ENOMEM;
                }
-       }
-
-       /* On older cards (or if the above failed), create a map covering
-        * the BAR0 PRAMIN aperture */
-       if (!dev_priv->ramin) {
+       } else {
                dev_priv->ramin_size = 1 * 1024 * 1024;
                dev_priv->ramin = ioremap(mmio_start_offs + NV_RAMIN,
-                                                       dev_priv->ramin_size);
+                                         dev_priv->ramin_size);
                if (!dev_priv->ramin) {
                        NV_ERROR(dev, "Failed to map BAR0 PRAMIN.\n");
                        return -ENOMEM;
index a95e6941ba884b37f041667a4644fea56c5b57b8..32611bd30e6db6524a44588f06602c33266fb4bc 100644 (file)
@@ -6,10 +6,16 @@
 int
 nv50_fb_init(struct drm_device *dev)
 {
-       /* This is needed to get meaningful information from 100c90
-        * on traps. No idea what these values mean exactly. */
        struct drm_nouveau_private *dev_priv = dev->dev_private;
 
+       /* Not a clue what this is exactly.  Without pointing it at a
+        * scratch page, VRAM->GART blits with M2MF (as in DDX DFS)
+        * cause IOMMU "read from address 0" errors (rh#561267)
+        */
+       nv_wr32(dev, 0x100c08, dev_priv->gart_info.sg_dummy_bus >> 8);
+
+       /* This is needed to get meaningful information from 100c90
+        * on traps. No idea what these values mean exactly. */
        switch (dev_priv->chipset) {
        case 0x50:
                nv_wr32(dev, 0x100c90, 0x0707ff);
index c61782b314e799c59c2fc25972eaf8965169cbae..bb47ad737267a07ecfdc1071a6ebf7f2fdb6f9ec 100644 (file)
@@ -31,7 +31,7 @@ nv50_gpio_location(struct dcb_gpio_entry *gpio, uint32_t *reg, uint32_t *shift)
 {
        const uint32_t nv50_gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 };
 
-       if (gpio->line > 32)
+       if (gpio->line >= 32)
                return -EINVAL;
 
        *reg = nv50_gpio_reg[gpio->line >> 3];
index 0440c0939bdd00e4efc71f09b0b02de16b3788da..4b6623df3b964fde76723aa8fb0f69bbdaef30a6 100644 (file)
@@ -41,12 +41,18 @@ void evergreen_fini(struct radeon_device *rdev);
 
 void evergreen_pm_misc(struct radeon_device *rdev)
 {
-       int requested_index = rdev->pm.requested_power_state_index;
-       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
-       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
-
-       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
-               radeon_atom_set_voltage(rdev, voltage->voltage);
+       int req_ps_idx = rdev->pm.requested_power_state_index;
+       int req_cm_idx = rdev->pm.requested_clock_mode_index;
+       struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
+       struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
+
+       if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
+               if (voltage->voltage != rdev->pm.current_vddc) {
+                       radeon_atom_set_voltage(rdev, voltage->voltage);
+                       rdev->pm.current_vddc = voltage->voltage;
+                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+               }
+       }
 }
 
 void evergreen_pm_prepare(struct radeon_device *rdev)
@@ -2153,7 +2159,7 @@ int evergreen_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       rdev->accel_working = false;
+       rdev->accel_working = true;
        r = evergreen_startup(rdev);
        if (r) {
                dev_err(rdev->dev, "disabling GPU acceleration\n");
index cc004b05d63e7ff7153b6f2f87b75f34c7062161..cf89aa2eb28c07cb61054f43db647c5ec4ff9f59 100644 (file)
@@ -162,6 +162,11 @@ void r100_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+       /* mid sh */
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
        /* high sh */
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -172,6 +177,11 @@ void r100_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+       /* mid mh */
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
        /* high mh */
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
index 4415a5ee5871df1e353c947dd31a1dd65181cd45..e6c89142bb4d24323920636cf0e2499c5e17cf59 100644 (file)
@@ -45,9 +45,14 @@ void r420_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_DEFAULT_IDX].dpms_on_cm_idx = 0;
        /* low sh */
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_ps_idx = 0;
-       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 1;
+       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+       /* mid sh */
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 1;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
        /* high sh */
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -58,6 +63,11 @@ void r420_pm_init_profile(struct radeon_device *rdev)
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+       /* mid mh */
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
        /* high mh */
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 0;
        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
index e14f59748e65212f628ed7b1a5ed427fa89f7aec..0e91871f45be0a213a9a67ff25c18fd0244088e8 100644 (file)
@@ -291,6 +291,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 1;
@@ -301,6 +306,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 1;
@@ -317,6 +327,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 2;
@@ -327,6 +342,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 1;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 1;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 2;
@@ -343,6 +363,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 2;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 2;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 2;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 2;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 3;
@@ -353,6 +378,11 @@ void rs780_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 2;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 2;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 3;
@@ -375,6 +405,11 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+               /* mid sh */
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 0;
                /* high sh */
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -385,6 +420,11 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+               /* mid mh */
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 0;
                /* high mh */
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = rdev->pm.default_power_state_index;
                rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = rdev->pm.default_power_state_index;
@@ -401,7 +441,12 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_ps_idx = 1;
                        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx = 1;
                        rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
-                       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+                       /* mid sh */
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+                       rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 1;
                        /* high sh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx = 1;
                        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_on_ps_idx = 1;
@@ -411,7 +456,12 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_ps_idx = 2;
                        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx = 2;
                        rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
-                       rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 1;
+                       rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+                       /* low mh */
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx = 2;
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx = 2;
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+                       rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 1;
                        /* high mh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx = 2;
                        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_ps_idx = 2;
@@ -430,14 +480,30 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 0);
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 1;
+                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
                        } else {
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
                                rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 1;
+                               rdev->pm.profiles[PM_PROFILE_LOW_SH_IDX].dpms_on_cm_idx = 0;
+                       }
+                       /* mid sh */
+                       if (rdev->flags & RADEON_IS_MOBILITY) {
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 1;
+                       } else {
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 0);
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_SH_IDX].dpms_on_cm_idx = 1;
                        }
                        /* high sh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_SH_IDX].dpms_off_ps_idx =
@@ -453,14 +519,30 @@ void r600_pm_init_profile(struct radeon_device *rdev)
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 1);
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 2;
+                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
                        } else {
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_ps_idx =
                                        r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
                                rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_off_cm_idx = 0;
-                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 1;
+                               rdev->pm.profiles[PM_PROFILE_LOW_MH_IDX].dpms_on_cm_idx = 0;
+                       }
+                       /* mid mh */
+                       if (rdev->flags & RADEON_IS_MOBILITY) {
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_BATTERY, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 1;
+                       } else {
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_ps_idx =
+                                       r600_pm_get_type_index(rdev, POWER_STATE_TYPE_PERFORMANCE, 1);
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_off_cm_idx = 0;
+                               rdev->pm.profiles[PM_PROFILE_MID_MH_IDX].dpms_on_cm_idx = 1;
                        }
                        /* high mh */
                        rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_off_ps_idx =
@@ -475,13 +557,18 @@ void r600_pm_init_profile(struct radeon_device *rdev)
 
 void r600_pm_misc(struct radeon_device *rdev)
 {
-       int requested_index = rdev->pm.requested_power_state_index;
-       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
-       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
-
-       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
-               radeon_atom_set_voltage(rdev, voltage->voltage);
+       int req_ps_idx = rdev->pm.requested_power_state_index;
+       int req_cm_idx = rdev->pm.requested_clock_mode_index;
+       struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
+       struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
 
+       if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
+               if (voltage->voltage != rdev->pm.current_vddc) {
+                       radeon_atom_set_voltage(rdev, voltage->voltage);
+                       rdev->pm.current_vddc = voltage->voltage;
+                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+               }
+       }
 }
 
 bool r600_gui_idle(struct radeon_device *rdev)
index 5f96fe871b3fdeb13c89c2e8438958c06651ab60..8e1d44ca26ec420eb062c8f21b836cab73aaf845 100644 (file)
@@ -648,15 +648,18 @@ enum radeon_pm_profile_type {
        PM_PROFILE_DEFAULT,
        PM_PROFILE_AUTO,
        PM_PROFILE_LOW,
+       PM_PROFILE_MID,
        PM_PROFILE_HIGH,
 };
 
 #define PM_PROFILE_DEFAULT_IDX 0
 #define PM_PROFILE_LOW_SH_IDX  1
-#define PM_PROFILE_HIGH_SH_IDX 2
-#define PM_PROFILE_LOW_MH_IDX  3
-#define PM_PROFILE_HIGH_MH_IDX 4
-#define PM_PROFILE_MAX         5
+#define PM_PROFILE_MID_SH_IDX  2
+#define PM_PROFILE_HIGH_SH_IDX 3
+#define PM_PROFILE_LOW_MH_IDX  4
+#define PM_PROFILE_MID_MH_IDX  5
+#define PM_PROFILE_HIGH_MH_IDX 6
+#define PM_PROFILE_MAX         7
 
 struct radeon_pm_profile {
        int dpms_off_ps_idx;
@@ -745,6 +748,7 @@ struct radeon_pm {
        int                     default_power_state_index;
        u32                     current_sclk;
        u32                     current_mclk;
+       u32                     current_vddc;
        struct radeon_i2c_chan *i2c_bus;
        /* selected pm method */
        enum radeon_pm_method     pm_method;
index 4305cd55d0acf6976c54f17e93e860031e74abfe..99bd8a9c56b38f8431510bf3cde781345510feb1 100644 (file)
@@ -1833,10 +1833,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
                                                /* skip invalid modes */
                                                if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
                                                        continue;
-                                               rdev->pm.power_state[state_index].clock_info[mode_index].voltage.type =
-                                                       VOLTAGE_SW;
-                                               rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
-                                                       clock_info->usVDDC;
+                                               /* voltage works differently on IGPs */
                                                mode_index++;
                                        } else if (ASIC_IS_DCE4(rdev)) {
                                                struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO *clock_info =
@@ -1969,6 +1966,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
 
        rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
        rdev->pm.current_clock_mode_index = 0;
+       rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
 }
 
 void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)
index 102c744eaf5a14a7ee093c96db24bc2d40c6072d..1bee2f9e24a5ab1fee85e05f14a656ed24b8b94e 100644 (file)
@@ -2026,6 +2026,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                                        combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC);
                                break;
                        default:
+                               ddc_i2c.valid = false;
                                break;
                        }
 
@@ -2339,6 +2340,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
                        if (RBIOS8(tv_info + 6) == 'T') {
                                if (radeon_apply_legacy_tv_quirks(dev)) {
                                        hpd.hpd = RADEON_HPD_NONE;
+                                       ddc_i2c.valid = false;
                                        radeon_add_legacy_encoder(dev,
                                                                  radeon_get_encoder_id
                                                                  (dev,
@@ -2455,7 +2457,7 @@ default_mode:
        rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk;
        rdev->pm.power_state[state_index].default_clock_mode = &rdev->pm.power_state[state_index].clock_info[0];
        if ((state_index > 0) &&
-           (rdev->pm.power_state[0].clock_info[0].voltage.type = VOLTAGE_GPIO))
+           (rdev->pm.power_state[0].clock_info[0].voltage.type == VOLTAGE_GPIO))
                rdev->pm.power_state[state_index].clock_info[0].voltage =
                        rdev->pm.power_state[0].clock_info[0].voltage;
        else
index 1006549d157029bcb129129f417e1dd5195cc5ed..8154cdf796e4a752a0a33d6983852cabee7acf4a 100644 (file)
@@ -284,8 +284,7 @@ static const char *connector_names[15] = {
        "eDP",
 };
 
-static const char *hpd_names[7] = {
-       "NONE",
+static const char *hpd_names[6] = {
        "HPD1",
        "HPD2",
        "HPD3",
index 902d1731a652757b16f90b3056d3b1c8f6b7d3b8..e166fe4d7c308f55ab451a710687a679dcf8720f 100644 (file)
  * - 2.2.0 - add r6xx/r7xx const buffer support
  * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
  * - 2.4.0 - add crtc id query
+ * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
  */
 #define KMS_DRIVER_MAJOR       2
-#define KMS_DRIVER_MINOR       4
+#define KMS_DRIVER_MINOR       5
 #define KMS_DRIVER_PATCHLEVEL  0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
index e192acfbf0cdc4c098535b88e8d8216187b65bb3..dc1634bb0c11e7f0bdcda150e330fa5fa1523c2c 100644 (file)
@@ -363,6 +363,7 @@ int radeon_fbdev_init(struct radeon_device *rdev)
 {
        struct radeon_fbdev *rfbdev;
        int bpp_sel = 32;
+       int ret;
 
        /* select 8 bpp console on RN50 or 16MB cards */
        if (ASIC_IS_RN50(rdev) || rdev->mc.real_vram_size <= (32*1024*1024))
@@ -376,9 +377,14 @@ int radeon_fbdev_init(struct radeon_device *rdev)
        rdev->mode_info.rfbdev = rfbdev;
        rfbdev->helper.funcs = &radeon_fb_helper_funcs;
 
-       drm_fb_helper_init(rdev->ddev, &rfbdev->helper,
-                          rdev->num_crtc,
-                          RADEONFB_CONN_LIMIT);
+       ret = drm_fb_helper_init(rdev->ddev, &rfbdev->helper,
+                                rdev->num_crtc,
+                                RADEONFB_CONN_LIMIT);
+       if (ret) {
+               kfree(rfbdev);
+               return ret;
+       }
+
        drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
        drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
        return 0;
index 04068352ccd208a0641317a81c805c2c6dd47d29..6a70c0dc7f92dbb74cdf2e24ac986b14555ef177 100644 (file)
@@ -118,7 +118,11 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                value = rdev->num_z_pipes;
                break;
        case RADEON_INFO_ACCEL_WORKING:
-               value = rdev->accel_working;
+               /* xf86-video-ati 6.13.0 relies on this being false for evergreen */
+               if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK))
+                       value = false;
+               else
+                       value = rdev->accel_working;
                break;
        case RADEON_INFO_CRTC_FROM_ID:
                for (i = 0, found = 0; i < rdev->num_crtc; i++) {
@@ -134,6 +138,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        return -EINVAL;
                }
                break;
+       case RADEON_INFO_ACCEL_WORKING2:
+               value = rdev->accel_working;
+               break;
        default:
                DRM_DEBUG("Invalid request %d\n", info->request);
                return -EINVAL;
index 5a13b3eeef1927f2cdeeb36ca3d70de8bf69f049..5b07b8848e09b22fbeeda3b802af280ba852af1b 100644 (file)
@@ -1168,6 +1168,17 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv;
        bool color = true;
+       struct drm_crtc *crtc;
+
+       /* find out if crtc2 is in use or if this encoder is using it */
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
+               if ((radeon_crtc->crtc_id == 1) && crtc->enabled) {
+                       if (encoder->crtc != crtc) {
+                               return connector_status_disconnected;
+                       }
+               }
+       }
 
        if (connector->connector_type == DRM_MODE_CONNECTOR_SVIDEO ||
            connector->connector_type == DRM_MODE_CONNECTOR_Composite ||
index 02281269a88153d4d04b9054233bf7c8320b8e51..63f679a04b25a2a87997e1ea5e35e1adc0fed64a 100644 (file)
 #define RADEON_WAIT_VBLANK_TIMEOUT 200
 #define RADEON_WAIT_IDLE_TIMEOUT 200
 
+static const char *radeon_pm_state_type_name[5] = {
+       "Default",
+       "Powersave",
+       "Battery",
+       "Balanced",
+       "Performance",
+};
+
 static void radeon_dynpm_idle_work_handler(struct work_struct *work);
 static int radeon_debugfs_pm_init(struct radeon_device *rdev);
 static bool radeon_pm_in_vbl(struct radeon_device *rdev);
@@ -84,9 +92,9 @@ static void radeon_pm_update_profile(struct radeon_device *rdev)
                                rdev->pm.profile_index = PM_PROFILE_HIGH_SH_IDX;
                } else {
                        if (rdev->pm.active_crtc_count > 1)
-                               rdev->pm.profile_index = PM_PROFILE_LOW_MH_IDX;
+                               rdev->pm.profile_index = PM_PROFILE_MID_MH_IDX;
                        else
-                               rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX;
+                               rdev->pm.profile_index = PM_PROFILE_MID_SH_IDX;
                }
                break;
        case PM_PROFILE_LOW:
@@ -95,6 +103,12 @@ static void radeon_pm_update_profile(struct radeon_device *rdev)
                else
                        rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX;
                break;
+       case PM_PROFILE_MID:
+               if (rdev->pm.active_crtc_count > 1)
+                       rdev->pm.profile_index = PM_PROFILE_MID_MH_IDX;
+               else
+                       rdev->pm.profile_index = PM_PROFILE_MID_SH_IDX;
+               break;
        case PM_PROFILE_HIGH:
                if (rdev->pm.active_crtc_count > 1)
                        rdev->pm.profile_index = PM_PROFILE_HIGH_MH_IDX;
@@ -127,15 +141,6 @@ static void radeon_unmap_vram_bos(struct radeon_device *rdev)
                if (bo->tbo.mem.mem_type == TTM_PL_VRAM)
                        ttm_bo_unmap_virtual(&bo->tbo);
        }
-
-       if (rdev->gart.table.vram.robj)
-               ttm_bo_unmap_virtual(&rdev->gart.table.vram.robj->tbo);
-
-       if (rdev->stollen_vga_memory)
-               ttm_bo_unmap_virtual(&rdev->stollen_vga_memory->tbo);
-
-       if (rdev->r600_blit.shader_obj)
-               ttm_bo_unmap_virtual(&rdev->r600_blit.shader_obj->tbo);
 }
 
 static void radeon_sync_with_vblank(struct radeon_device *rdev)
@@ -281,6 +286,42 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
        mutex_unlock(&rdev->ddev->struct_mutex);
 }
 
+static void radeon_pm_print_states(struct radeon_device *rdev)
+{
+       int i, j;
+       struct radeon_power_state *power_state;
+       struct radeon_pm_clock_info *clock_info;
+
+       DRM_DEBUG("%d Power State(s)\n", rdev->pm.num_power_states);
+       for (i = 0; i < rdev->pm.num_power_states; i++) {
+               power_state = &rdev->pm.power_state[i];
+               DRM_DEBUG("State %d: %s\n", i,
+                       radeon_pm_state_type_name[power_state->type]);
+               if (i == rdev->pm.default_power_state_index)
+                       DRM_DEBUG("\tDefault");
+               if ((rdev->flags & RADEON_IS_PCIE) && !(rdev->flags & RADEON_IS_IGP))
+                       DRM_DEBUG("\t%d PCIE Lanes\n", power_state->pcie_lanes);
+               if (power_state->flags & RADEON_PM_STATE_SINGLE_DISPLAY_ONLY)
+                       DRM_DEBUG("\tSingle display only\n");
+               DRM_DEBUG("\t%d Clock Mode(s)\n", power_state->num_clock_modes);
+               for (j = 0; j < power_state->num_clock_modes; j++) {
+                       clock_info = &(power_state->clock_info[j]);
+                       if (rdev->flags & RADEON_IS_IGP)
+                               DRM_DEBUG("\t\t%d e: %d%s\n",
+                                       j,
+                                       clock_info->sclk * 10,
+                                       clock_info->flags & RADEON_PM_MODE_NO_DISPLAY ? "\tNo display only" : "");
+                       else
+                               DRM_DEBUG("\t\t%d e: %d\tm: %d\tv: %d%s\n",
+                                       j,
+                                       clock_info->sclk * 10,
+                                       clock_info->mclk * 10,
+                                       clock_info->voltage.voltage,
+                                       clock_info->flags & RADEON_PM_MODE_NO_DISPLAY ? "\tNo display only" : "");
+               }
+       }
+}
+
 static ssize_t radeon_get_pm_profile(struct device *dev,
                                     struct device_attribute *attr,
                                     char *buf)
@@ -311,6 +352,8 @@ static ssize_t radeon_set_pm_profile(struct device *dev,
                        rdev->pm.profile = PM_PROFILE_AUTO;
                else if (strncmp("low", buf, strlen("low")) == 0)
                        rdev->pm.profile = PM_PROFILE_LOW;
+               else if (strncmp("mid", buf, strlen("mid")) == 0)
+                       rdev->pm.profile = PM_PROFILE_MID;
                else if (strncmp("high", buf, strlen("high")) == 0)
                        rdev->pm.profile = PM_PROFILE_HIGH;
                else {
@@ -377,15 +420,19 @@ void radeon_pm_suspend(struct radeon_device *rdev)
 {
        mutex_lock(&rdev->pm.mutex);
        cancel_delayed_work(&rdev->pm.dynpm_idle_work);
-       rdev->pm.current_power_state_index = -1;
-       rdev->pm.current_clock_mode_index = -1;
-       rdev->pm.current_sclk = 0;
-       rdev->pm.current_mclk = 0;
        mutex_unlock(&rdev->pm.mutex);
 }
 
 void radeon_pm_resume(struct radeon_device *rdev)
 {
+       /* asic init will reset the default power state */
+       mutex_lock(&rdev->pm.mutex);
+       rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
+       rdev->pm.current_clock_mode_index = 0;
+       rdev->pm.current_sclk = rdev->clock.default_sclk;
+       rdev->pm.current_mclk = rdev->clock.default_mclk;
+       rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
+       mutex_unlock(&rdev->pm.mutex);
        radeon_pm_compute_clocks(rdev);
 }
 
@@ -394,32 +441,24 @@ int radeon_pm_init(struct radeon_device *rdev)
        int ret;
        /* default to profile method */
        rdev->pm.pm_method = PM_METHOD_PROFILE;
+       rdev->pm.profile = PM_PROFILE_DEFAULT;
        rdev->pm.dynpm_state = DYNPM_STATE_DISABLED;
        rdev->pm.dynpm_planned_action = DYNPM_ACTION_NONE;
        rdev->pm.dynpm_can_upclock = true;
        rdev->pm.dynpm_can_downclock = true;
-       rdev->pm.current_sclk = 0;
-       rdev->pm.current_mclk = 0;
+       rdev->pm.current_sclk = rdev->clock.default_sclk;
+       rdev->pm.current_mclk = rdev->clock.default_mclk;
 
        if (rdev->bios) {
                if (rdev->is_atom_bios)
                        radeon_atombios_get_power_modes(rdev);
                else
                        radeon_combios_get_power_modes(rdev);
+               radeon_pm_print_states(rdev);
                radeon_pm_init_profile(rdev);
-               rdev->pm.current_power_state_index = -1;
-               rdev->pm.current_clock_mode_index = -1;
        }
 
        if (rdev->pm.num_power_states > 1) {
-               if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
-                       mutex_lock(&rdev->pm.mutex);
-                       rdev->pm.profile = PM_PROFILE_DEFAULT;
-                       radeon_pm_update_profile(rdev);
-                       radeon_pm_set_clocks(rdev);
-                       mutex_unlock(&rdev->pm.mutex);
-               }
-
                /* where's the best place to put these? */
                ret = device_create_file(rdev->dev, &dev_attr_power_profile);
                if (ret)
@@ -705,6 +744,8 @@ static int radeon_debugfs_pm_info(struct seq_file *m, void *data)
        seq_printf(m, "default memory clock: %u0 kHz\n", rdev->clock.default_mclk);
        if (rdev->asic->get_memory_clock)
                seq_printf(m, "current memory clock: %u0 kHz\n", radeon_get_memory_clock(rdev));
+       if (rdev->pm.current_vddc)
+               seq_printf(m, "voltage: %u mV\n", rdev->pm.current_vddc);
        if (rdev->asic->get_pcie_lanes)
                seq_printf(m, "PCIE lanes: %d\n", radeon_get_pcie_lanes(rdev));
 
index 33952da65340503ad3e07bbb428bf4487b027737..cec536c222c5314e696b1ca3acb6789dfdc8924e 100644 (file)
@@ -44,12 +44,18 @@ void rv770_fini(struct radeon_device *rdev);
 
 void rv770_pm_misc(struct radeon_device *rdev)
 {
-       int requested_index = rdev->pm.requested_power_state_index;
-       struct radeon_power_state *ps = &rdev->pm.power_state[requested_index];
-       struct radeon_voltage *voltage = &ps->clock_info[0].voltage;
-
-       if ((voltage->type == VOLTAGE_SW) && voltage->voltage)
-               radeon_atom_set_voltage(rdev, voltage->voltage);
+       int req_ps_idx = rdev->pm.requested_power_state_index;
+       int req_cm_idx = rdev->pm.requested_clock_mode_index;
+       struct radeon_power_state *ps = &rdev->pm.power_state[req_ps_idx];
+       struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
+
+       if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
+               if (voltage->voltage != rdev->pm.current_vddc) {
+                       radeon_atom_set_voltage(rdev, voltage->voltage);
+                       rdev->pm.current_vddc = voltage->voltage;
+                       DRM_DEBUG("Setting: v: %d\n", voltage->voltage);
+               }
+       }
 }
 
 /*
index bdd67cf83315f590165fbf6b40437454d4e29186..8e396850513cab2b6abebf3858227a7463001121 100644 (file)
@@ -644,6 +644,7 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
        ret = copy_from_user(cmd, user_cmd, arg->command_size);
 
        if (unlikely(ret != 0)) {
+               ret = -EFAULT;
                DRM_ERROR("Failed copying commands.\n");
                goto out_commit;
        }
index f8fbbc67a40675d29418f0cd6ed7f99213c9fb1c..8612378b131edba7589099226d51e594863e5c42 100644 (file)
@@ -597,8 +597,10 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
 
        ret = copy_from_user(srf->sizes, user_sizes,
                             srf->num_sizes * sizeof(*srf->sizes));
-       if (unlikely(ret != 0))
+       if (unlikely(ret != 0)) {
+               ret = -EFAULT;
                goto out_err1;
+       }
 
        if (srf->scanout &&
            srf->num_sizes == 1 &&
@@ -697,9 +699,11 @@ int vmw_surface_reference_ioctl(struct drm_device *dev, void *data,
        if (user_sizes)
                ret = copy_to_user(user_sizes, srf->sizes,
                                   srf->num_sizes * sizeof(*srf->sizes));
-       if (unlikely(ret != 0))
+       if (unlikely(ret != 0)) {
                DRM_ERROR("copy_to_user failed %p %u\n",
                          user_sizes, srf->num_sizes);
+               ret = -EFAULT;
+       }
 out_bad_resource:
 out_no_reference:
        ttm_base_object_unref(&base);
index e880e2c3871d0e2098913c7b130c3a35de7e4f65..937983407e2a47b12569d9ca4305af174e78f405 100644 (file)
@@ -289,6 +289,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
                        iattr->s_attr.dev_attr.show = show_label;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -303,6 +304,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
                        iattr->s_attr.dev_attr.show = show_amb_temp;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -318,6 +320,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.show = show_amb_min;
                        iattr->s_attr.dev_attr.store = store_amb_min;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -333,6 +336,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.show = show_amb_mid;
                        iattr->s_attr.dev_attr.store = store_amb_mid;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -348,6 +352,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.show = show_amb_max;
                        iattr->s_attr.dev_attr.store = store_amb_max;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -362,6 +367,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
                        iattr->s_attr.dev_attr.show = show_amb_alarm;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
index 099a2138cdf6ff739eda8826996a691b9f6ec0c0..da5a2404cd3eafe88584924ad82b7683e398502a 100644 (file)
@@ -112,11 +112,21 @@ static bool __devinit has_erratum_319(struct pci_dev *pdev)
        if (pkg_type != CPUID_PKGTYPE_AM2R2_AM3)
                return false;
 
-       /* Differentiate between AM2+ (bad) and AM3 (good) */
+       /* DDR3 memory implies socket AM3, which is good */
        pci_bus_read_config_dword(pdev->bus,
                                  PCI_DEVFN(PCI_SLOT(pdev->devfn), 2),
                                  REG_DCT0_CONFIG_HIGH, &reg_dram_cfg);
-       return !(reg_dram_cfg & DDR3_MODE);
+       if (reg_dram_cfg & DDR3_MODE)
+               return false;
+
+       /*
+        * Unfortunately it is possible to run a socket AM3 CPU with DDR2
+        * memory. We blacklist all the cores which do exist in socket AM2+
+        * format. It still isn't perfect, as RB-C2 cores exist in both AM2+
+        * and AM3 formats, but that's the best we can do.
+        */
+       return boot_cpu_data.x86_model < 4 ||
+              (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask <= 2);
 }
 
 static int __devinit k10temp_probe(struct pci_dev *pdev,
index 0ceb6d6200a313b5e1ea5ef488f221ac929cdf80..f26acdb116819896c4e1e6bcb22eed2f364982ae 100644 (file)
@@ -120,7 +120,7 @@ static ssize_t show_temp(struct device *dev,
        int temp;
        struct k8temp_data *data = k8temp_update_device(dev);
 
-       if (data->swap_core_select)
+       if (data->swap_core_select && (data->sensorsp & SEL_CORE))
                core = core ? 0 : 1;
 
        temp = TEMP_FROM_REG(data->temp[core][place]) + data->temp_offset;
index e00a1cc79c0a448d5b344612ee9c7354b86c342c..c19066479057ff3567d7168c38922e0fd0b84da3 100644 (file)
@@ -678,7 +678,7 @@ static const struct file_operations hp_sdc_rtc_fops = {
         .llseek =              no_llseek,
         .read =                        hp_sdc_rtc_read,
         .poll =                        hp_sdc_rtc_poll,
-        .unlocked_ioctl =      hp_sdc_rtc_ioctl,
+        .unlocked_ioctl =      hp_sdc_rtc_unlocked_ioctl,
         .open =                        hp_sdc_rtc_open,
         .fasync =              hp_sdc_rtc_fasync,
 };
index e171e77f6129d8b80829099fabe0bdd1a8e25f71..f06d06e7fdfa06683d883f26397ace3d9f63970e 100644 (file)
@@ -249,7 +249,7 @@ config MMC_IMX
 
 config MMC_MSM7X00A
        tristate "Qualcomm MSM 7X00A SDCC Controller Support"
-       depends on MMC && ARCH_MSM
+       depends on MMC && ARCH_MSM && !ARCH_MSM7X30
        help
          This provides support for the SD/MMC cell found in the
           MSM 7X00A controllers from Qualcomm.
index 000d65ea55a42bf495ba773dca6c66f99f0d3136..91c8013cf0d9b8b818d8587ef036e1229e7c3396 100644 (file)
@@ -404,14 +404,9 @@ static int mtd_do_writeoob(struct file *file, struct mtd_info *mtd,
        if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
                return -EINVAL;
 
-       ops.oobbuf = kmalloc(length, GFP_KERNEL);
-       if (!ops.oobbuf)
-               return -ENOMEM;
-
-       if (copy_from_user(ops.oobbuf, ptr, length)) {
-               kfree(ops.oobbuf);
-               return -EFAULT;
-       }
+       ops.oobbuf = memdup_user(ptr, length);
+       if (IS_ERR(ops.oobbuf))
+               return PTR_ERR(ops.oobbuf);
 
        start &= ~((uint64_t)mtd->oobsize - 1);
        ret = mtd->write_oob(mtd, start, &ops);
index 98a04b3c9526e4bbd6a711b24846c98482fb01d6..ffc3720929f10efaca858758902e891220423ee3 100644 (file)
@@ -1,13 +1,3 @@
-menuconfig MTD_NAND
-       tristate "NAND Device Support"
-       depends on MTD
-       select MTD_NAND_IDS
-       select MTD_NAND_ECC
-       help
-         This enables support for accessing all type of NAND flash
-         devices. For further information see
-         <http://www.linux-mtd.infradead.org/doc/nand.html>.
-
 config MTD_NAND_ECC
        tristate
 
@@ -19,6 +9,17 @@ config MTD_NAND_ECC_SMC
          Software ECC according to the Smart Media Specification.
          The original Linux implementation had byte 0 and 1 swapped.
 
+
+menuconfig MTD_NAND
+       tristate "NAND Device Support"
+       depends on MTD
+       select MTD_NAND_IDS
+       select MTD_NAND_ECC
+       help
+         This enables support for accessing all type of NAND flash
+         devices. For further information see
+         <http://www.linux-mtd.infradead.org/doc/nand.html>.
+
 if MTD_NAND
 
 config MTD_NAND_VERIFY_WRITE
index 78a4232954748641e7fcd655056d83404b3d87a1..bcfc851fe55069bc93ffb38b28f8985a4b87f704 100644 (file)
@@ -150,7 +150,6 @@ static void r852_dma_done(struct r852_device *dev, int error)
        if (dev->phys_dma_addr && dev->phys_dma_addr != dev->phys_bounce_buffer)
                pci_unmap_single(dev->pci_dev, dev->phys_dma_addr, R852_DMA_LEN,
                        dev->dma_dir ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
-       complete(&dev->dma_done);
 }
 
 /*
@@ -182,6 +181,7 @@ static void r852_do_dma(struct r852_device *dev, uint8_t *buf, int do_read)
        /* Set dma direction */
        dev->dma_dir = do_read;
        dev->dma_stage = 1;
+       INIT_COMPLETION(dev->dma_done);
 
        dbg_verbose("doing dma %s ", do_read ? "read" : "write");
 
@@ -494,6 +494,11 @@ int r852_ecc_correct(struct mtd_info *mtd, uint8_t *dat,
        if (dev->card_unstable)
                return 0;
 
+       if (dev->dma_error) {
+               dev->dma_error = 0;
+               return -1;
+       }
+
        r852_write_reg(dev, R852_CTL, dev->ctlreg | R852_CTL_ECC_ACCESS);
        ecc_reg = r852_read_reg_dword(dev, R852_DATALINE);
        r852_write_reg(dev, R852_CTL, dev->ctlreg);
@@ -707,6 +712,7 @@ void r852_card_detect_work(struct work_struct *work)
                container_of(work, struct r852_device, card_detect_work.work);
 
        r852_card_update_present(dev);
+       r852_update_card_detect(dev);
        dev->card_unstable = 0;
 
        /* False alarm */
@@ -722,7 +728,6 @@ void r852_card_detect_work(struct work_struct *work)
        else
                r852_unregister_nand_device(dev);
 exit:
-       /* Update detection logic */
        r852_update_card_detect(dev);
 }
 
@@ -796,6 +801,7 @@ static irqreturn_t r852_irq(int irq, void *data)
                if (dma_status & R852_DMA_IRQ_ERROR) {
                        dbg("recieved dma error IRQ");
                        r852_dma_done(dev, -EIO);
+                       complete(&dev->dma_done);
                        goto out;
                }
 
@@ -825,8 +831,10 @@ static irqreturn_t r852_irq(int irq, void *data)
                        r852_dma_enable(dev);
 
                /* Operation done */
-               if (dev->dma_stage == 3)
+               if (dev->dma_stage == 3) {
                        r852_dma_done(dev, 0);
+                       complete(&dev->dma_done);
+               }
                goto out;
        }
 
@@ -940,18 +948,19 @@ int  r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
 
        r852_dma_test(dev);
 
+       dev->irq = pci_dev->irq;
+       spin_lock_init(&dev->irqlock);
+
+       dev->card_detected = 0;
+       r852_card_update_present(dev);
+
        /*register irq handler*/
        error = -ENODEV;
        if (request_irq(pci_dev->irq, &r852_irq, IRQF_SHARED,
                          DRV_NAME, dev))
                goto error10;
 
-       dev->irq = pci_dev->irq;
-       spin_lock_init(&dev->irqlock);
-
        /* kick initial present test */
-       dev->card_detected = 0;
-       r852_card_update_present(dev);
        queue_delayed_work(dev->card_workqueue,
                &dev->card_detect_work, 0);
 
@@ -1081,7 +1090,7 @@ int r852_resume(struct device *device)
                        dev->card_detected ? "added" : "removed");
 
                queue_delayed_work(dev->card_workqueue,
-               &dev->card_detect_work, 1000);
+               &dev->card_detect_work, msecs_to_jiffies(1000));
                return 0;
        }
 
index 9c149750e2bf9754518941e9233e94800d45b889..284a5f4a63ac8a48c955125c64e67ae8b89e16f9 100644 (file)
@@ -598,8 +598,8 @@ rx_next:
                        goto rx_status_loop;
 
                spin_lock_irqsave(&cp->lock, flags);
-               cpw16_f(IntrMask, cp_intr_mask);
                __napi_complete(napi);
+               cpw16_f(IntrMask, cp_intr_mask);
                spin_unlock_irqrestore(&cp->lock, flags);
        }
 
index 4ba72933f0da57b72f069e4d95a29fc1ad8da1f1..97d8068b372b228d6764055ad1d0529439c940af 100644 (file)
@@ -860,6 +860,7 @@ retry:
                }
 
        /* if unknown chip, assume array element #0, original RTL-8139 in this case */
+       i = 0;
        dev_dbg(&pdev->dev, "unknown chip version, assuming RTL-8139\n");
        dev_dbg(&pdev->dev, "TxConfig = 0x%lx\n", RTL_R32 (TxConfig));
        tp->chipset = 0;
@@ -2088,8 +2089,8 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
                 * again when we think we are done.
                 */
                spin_lock_irqsave(&tp->lock, flags);
-               RTL_W16_F(IntrMask, rtl8139_intr_mask);
                __napi_complete(napi);
+               RTL_W16_F(IntrMask, rtl8139_intr_mask);
                spin_unlock_irqrestore(&tp->lock, flags);
        }
        spin_unlock(&tp->rx_lock);
index 1830f3199cb523080b1a880dd5e834ad9fb8d99a..46c69cd0655358a74c726d9b0ae56fd1d2c7d0fd 100644 (file)
@@ -747,8 +747,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
                        FSL_GIANFAR_DEV_HAS_CSUM |
                        FSL_GIANFAR_DEV_HAS_VLAN |
                        FSL_GIANFAR_DEV_HAS_MAGIC_PACKET |
-                       FSL_GIANFAR_DEV_HAS_EXTENDED_HASH |
-                       FSL_GIANFAR_DEV_HAS_TIMER;
+                       FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
 
        ctype = of_get_property(np, "phy-connection-type", NULL);
 
index 7b6fe89f9db0aa4c3f5373a25465efaf8d658ad3..64e6a84bbbbee840c0258a5d29736a033f34ab81 100644 (file)
@@ -322,6 +322,7 @@ static int smc91c92_probe(struct pcmcia_device *link)
        return -ENOMEM;
     smc = netdev_priv(dev);
     smc->p_dev = link;
+    link->priv = dev;
 
     spin_lock_init(&smc->lock);
     link->io.NumPorts1 = 16;
index 8ee929b796d848e5440271f92b103ff32f5c9c8d..dbd0034537371c85a20db95daed608d553bf02b7 100644 (file)
@@ -53,6 +53,9 @@
 
 #define MII_LXT971_ISR         19  /* Interrupt Status Register */
 
+/* register definitions for the 973 */
+#define MII_LXT973_PCR 16 /* Port Configuration Register */
+#define PCR_FIBER_SELECT 1
 
 MODULE_DESCRIPTION("Intel LXT PHY driver");
 MODULE_AUTHOR("Andy Fleming");
@@ -119,6 +122,33 @@ static int lxt971_config_intr(struct phy_device *phydev)
        return err;
 }
 
+static int lxt973_probe(struct phy_device *phydev)
+{
+       int val = phy_read(phydev, MII_LXT973_PCR);
+
+       if (val & PCR_FIBER_SELECT) {
+               /*
+                * If fiber is selected, then the only correct setting
+                * is 100Mbps, full duplex, and auto negotiation off.
+                */
+               val = phy_read(phydev, MII_BMCR);
+               val |= (BMCR_SPEED100 | BMCR_FULLDPLX);
+               val &= ~BMCR_ANENABLE;
+               phy_write(phydev, MII_BMCR, val);
+               /* Remember that the port is in fiber mode. */
+               phydev->priv = lxt973_probe;
+       } else {
+               phydev->priv = NULL;
+       }
+       return 0;
+}
+
+static int lxt973_config_aneg(struct phy_device *phydev)
+{
+       /* Do nothing if port is in fiber mode. */
+       return phydev->priv ? 0 : genphy_config_aneg(phydev);
+}
+
 static struct phy_driver lxt970_driver = {
        .phy_id         = 0x78100000,
        .name           = "LXT970",
@@ -146,6 +176,18 @@ static struct phy_driver lxt971_driver = {
        .driver         = { .owner = THIS_MODULE,},
 };
 
+static struct phy_driver lxt973_driver = {
+       .phy_id         = 0x00137a10,
+       .name           = "LXT973",
+       .phy_id_mask    = 0xfffffff0,
+       .features       = PHY_BASIC_FEATURES,
+       .flags          = 0,
+       .probe          = lxt973_probe,
+       .config_aneg    = lxt973_config_aneg,
+       .read_status    = genphy_read_status,
+       .driver         = { .owner = THIS_MODULE,},
+};
+
 static int __init lxt_init(void)
 {
        int ret;
@@ -157,9 +199,15 @@ static int __init lxt_init(void)
        ret = phy_driver_register(&lxt971_driver);
        if (ret)
                goto err2;
+
+       ret = phy_driver_register(&lxt973_driver);
+       if (ret)
+               goto err3;
        return 0;
 
- err2: 
+ err3:
+       phy_driver_unregister(&lxt971_driver);
+ err2:
        phy_driver_unregister(&lxt970_driver);
  err1:
        return ret;
@@ -169,6 +217,7 @@ static void __exit lxt_exit(void)
 {
        phy_driver_unregister(&lxt970_driver);
        phy_driver_unregister(&lxt971_driver);
+       phy_driver_unregister(&lxt973_driver);
 }
 
 module_init(lxt_init);
index 217e709bda3ede440478bf2eb73c5646dd96e903..96b6cfbf0a3a682b14216fa23a9e737a48973aaa 100644 (file)
@@ -559,6 +559,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
                        break;
                udelay(25);
        }
+       /*
+        * According to hardware specs a 20us delay is required after write
+        * complete indication, but before sending next command.
+        */
+       udelay(20);
 }
 
 static int mdio_read(void __iomem *ioaddr, int reg_addr)
@@ -578,6 +583,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
                }
                udelay(25);
        }
+       /*
+        * According to hardware specs a 20us delay is required after read
+        * complete indication, but before sending next command.
+        */
+       udelay(20);
+
        return value;
 }
 
index c0e70006374e826930f8797b1c1c2a65710ea78c..06b552fca63d7724b2c382fa4d2280dbaba8b0fe 100644 (file)
@@ -367,8 +367,8 @@ static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
 static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
 
 
-#define dr32(reg)              readl(de->regs + (reg))
-#define dw32(reg,val)          writel((val), de->regs + (reg))
+#define dr32(reg)      ioread32(de->regs + (reg))
+#define dw32(reg, val) iowrite32((val), de->regs + (reg))
 
 
 static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
@@ -1706,6 +1706,7 @@ static void __devinit de21040_get_mac_address (struct de_private *de)
                int value, boguscnt = 100000;
                do {
                        value = dr32(ROMCmd);
+                       rmb();
                } while (value < 0 && --boguscnt > 0);
                de->dev->dev_addr[i] = value;
                udelay(1);
index 1f802e90474c3ccd342a70fb8b7352cadedf6bcd..9516f382a6baf76dfdafe63afdd3b22380a2595f 100644 (file)
@@ -344,7 +344,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                        return 2;
                }
 
-               if (size > ETH_FRAME_LEN) {
+               if (size > dev->net->mtu + ETH_HLEN) {
                        netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n",
                                   size);
                        return 0;
index 3f283bff0ff7146447419ea714ef7cdd78884b12..11491354e5b5bf3de80d0b91ee13d7a203a0e914 100644 (file)
@@ -1192,7 +1192,7 @@ int i2400m_fw_hdr_check(struct i2400m *i2400m,
        unsigned module_type, header_len, major_version, minor_version,
                module_id, module_vendor, date, size;
 
-       module_type = bcf_hdr->module_type;
+       module_type = le32_to_cpu(bcf_hdr->module_type);
        header_len = sizeof(u32) * le32_to_cpu(bcf_hdr->header_len);
        major_version = (le32_to_cpu(bcf_hdr->header_version) & 0xffff0000)
                >> 16;
index 2978359c4366f18860c247bed40a33fd08217574..648972df369d849fa8d2e6a1ba836953787aef63 100644 (file)
@@ -195,7 +195,7 @@ static const struct ieee80211_rate ath5k_rates[] = {
 static int __devinit   ath5k_pci_probe(struct pci_dev *pdev,
                                const struct pci_device_id *id);
 static void __devexit  ath5k_pci_remove(struct pci_dev *pdev);
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int             ath5k_pci_suspend(struct device *dev);
 static int             ath5k_pci_resume(struct device *dev);
 
@@ -203,7 +203,7 @@ static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
 #define ATH5K_PM_OPS   (&ath5k_pm_ops)
 #else
 #define ATH5K_PM_OPS   NULL
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
 
 static struct pci_driver ath5k_pci_driver = {
        .name           = KBUILD_MODNAME,
@@ -708,7 +708,7 @@ ath5k_pci_remove(struct pci_dev *pdev)
        ieee80211_free_hw(hw);
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int ath5k_pci_suspend(struct device *dev)
 {
        struct ieee80211_hw *hw = pci_get_drvdata(to_pci_dev(dev));
@@ -734,7 +734,7 @@ static int ath5k_pci_resume(struct device *dev)
        ath5k_led_enable(sc);
        return 0;
 }
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
 
 
 /***********************\
@@ -3140,13 +3140,15 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
 
        if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) {
                if (*new_flags & FIF_PROMISC_IN_BSS) {
-                       rfilt |= AR5K_RX_FILTER_PROM;
                        __set_bit(ATH_STAT_PROMISC, sc->status);
                } else {
                        __clear_bit(ATH_STAT_PROMISC, sc->status);
                }
        }
 
+       if (test_bit(ATH_STAT_PROMISC, sc->status))
+               rfilt |= AR5K_RX_FILTER_PROM;
+
        /* Note, AR5K_RX_FILTER_MCAST is already enabled */
        if (*new_flags & FIF_ALLMULTI) {
                mfilt[0] =  ~0;
index 1b81c4778800f62222eec48bc88c61ff993e9a69..492cbb15720d2076667681a8860a7ed866a2df5f 100644 (file)
@@ -1814,6 +1814,13 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
        u8 def_ant, tx_ant, ee_mode;
        u32 sta_id1 = 0;
 
+       /* if channel is not initialized yet we can't set the antennas
+        * so just store the mode. it will be set on the next reset */
+       if (channel == NULL) {
+               ah->ah_ant_mode = ant_mode;
+               return;
+       }
+
        def_ant = ah->ah_def_ant;
 
        ATH5K_TRACE(ah->ah_sc);
index d70732819423d25d09627fa0bc371be5f6976896..ff9b5c882184a00e58316166a62fd5514ead0ae6 100644 (file)
@@ -2618,15 +2618,6 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
        int events = 0;
        u16 ev;
 
-       /* Detect early interrupt before driver is fully configued */
-       if (!dev->base_addr) {
-               if (net_ratelimit()) {
-                       printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n",
-                              dev->name);
-               }
-               return IRQ_HANDLED;
-       }
-
        iface = netdev_priv(dev);
        local = iface->local;
 
index 068f7f8435c5d98c63626062a98f46f1853c6e2e..c44a303e62ed45c2bdc9ea9b77db020eb927c39c 100644 (file)
@@ -2852,6 +2852,7 @@ static struct iwl_lib_ops iwl3945_lib = {
        .isr = iwl_isr_legacy,
        .config_ap = iwl3945_config_ap,
        .manage_ibss_station = iwl3945_manage_ibss_station,
+       .recover_from_tx_stall = iwl_bg_monitor_recover,
        .check_plcp_health = iwl3945_good_plcp_health,
 
        .debugfs_ops = {
index 1004cfc403b1a3d8316243a58cd16dcc273f93ee..0f292a210ed92d1a67153234b56045647807f3f9 100644 (file)
@@ -1119,10 +1119,9 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
                                           struct iwl_scan_channel *scan_ch)
 {
        const struct ieee80211_supported_band *sband;
-       const struct iwl_channel_info *ch_info;
        u16 passive_dwell = 0;
        u16 active_dwell = 0;
-       int i, added = 0;
+       int added = 0;
        u16 channel = 0;
 
        sband = iwl_get_hw_mode(priv, band);
@@ -1137,32 +1136,7 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
        if (passive_dwell <= active_dwell)
                passive_dwell = active_dwell + 1;
 
-       /* only scan single channel, good enough to reset the RF */
-       /* pick the first valid not in-use channel */
-       if (band == IEEE80211_BAND_5GHZ) {
-               for (i = 14; i < priv->channel_count; i++) {
-                       if (priv->channel_info[i].channel !=
-                           le16_to_cpu(priv->staging_rxon.channel)) {
-                               channel = priv->channel_info[i].channel;
-                               ch_info = iwl_get_channel_info(priv,
-                                       band, channel);
-                               if (is_channel_valid(ch_info))
-                                       break;
-                       }
-               }
-       } else {
-               for (i = 0; i < 14; i++) {
-                       if (priv->channel_info[i].channel !=
-                           le16_to_cpu(priv->staging_rxon.channel)) {
-                                       channel =
-                                               priv->channel_info[i].channel;
-                                       ch_info = iwl_get_channel_info(priv,
-                                               band, channel);
-                                       if (is_channel_valid(ch_info))
-                                               break;
-                       }
-               }
-       }
+       channel = iwl_get_single_channel_number(priv, band);
        if (channel) {
                scan_ch->channel = cpu_to_le16(channel);
                scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
index c402bfc83f36360358ebeef3ab1fe4cbeeb863e4..a732f1094e5d3a983a102d7afe3038eddc2eb6a2 100644 (file)
@@ -1125,6 +1125,7 @@ static void iwlagn_tx_status(struct iwl_priv *priv, struct sk_buff *skb)
        struct ieee80211_sta *sta;
        struct iwl_station_priv *sta_priv;
 
+       rcu_read_lock();
        sta = ieee80211_find_sta(priv->vif, hdr->addr1);
        if (sta) {
                sta_priv = (void *)sta->drv_priv;
@@ -1133,6 +1134,7 @@ static void iwlagn_tx_status(struct iwl_priv *priv, struct sk_buff *skb)
                    atomic_dec_return(&sta_priv->pending_frames) == 0)
                        ieee80211_sta_block_awake(priv->hw, sta, false);
        }
+       rcu_read_unlock();
 
        ieee80211_tx_status_irqsafe(priv->hw, skb);
 }
index aef4f71f1981c3e31461932228bbdb9f3aedf15b..7726e67044c08b91a36d41759b2dfd22c19ae263 100644 (file)
@@ -1484,6 +1484,156 @@ bool iwl_good_ack_health(struct iwl_priv *priv,
 }
 
 
+/*****************************************************************************
+ *
+ * sysfs attributes
+ *
+ *****************************************************************************/
+
+#ifdef CONFIG_IWLWIFI_DEBUG
+
+/*
+ * The following adds a new attribute to the sysfs representation
+ * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/)
+ * used for controlling the debug level.
+ *
+ * See the level definitions in iwl for details.
+ *
+ * The debug_level being managed using sysfs below is a per device debug
+ * level that is used instead of the global debug level if it (the per
+ * device debug level) is set.
+ */
+static ssize_t show_debug_level(struct device *d,
+                               struct device_attribute *attr, char *buf)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+       return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv));
+}
+static ssize_t store_debug_level(struct device *d,
+                               struct device_attribute *attr,
+                                const char *buf, size_t count)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+       unsigned long val;
+       int ret;
+
+       ret = strict_strtoul(buf, 0, &val);
+       if (ret)
+               IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf);
+       else {
+               priv->debug_level = val;
+               if (iwl_alloc_traffic_mem(priv))
+                       IWL_ERR(priv,
+                               "Not enough memory to generate traffic log\n");
+       }
+       return strnlen(buf, count);
+}
+
+static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
+                       show_debug_level, store_debug_level);
+
+
+#endif /* CONFIG_IWLWIFI_DEBUG */
+
+
+static ssize_t show_temperature(struct device *d,
+                               struct device_attribute *attr, char *buf)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+
+       if (!iwl_is_alive(priv))
+               return -EAGAIN;
+
+       return sprintf(buf, "%d\n", priv->temperature);
+}
+
+static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
+
+static ssize_t show_tx_power(struct device *d,
+                            struct device_attribute *attr, char *buf)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+
+       if (!iwl_is_ready_rf(priv))
+               return sprintf(buf, "off\n");
+       else
+               return sprintf(buf, "%d\n", priv->tx_power_user_lmt);
+}
+
+static ssize_t store_tx_power(struct device *d,
+                             struct device_attribute *attr,
+                             const char *buf, size_t count)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+       unsigned long val;
+       int ret;
+
+       ret = strict_strtoul(buf, 10, &val);
+       if (ret)
+               IWL_INFO(priv, "%s is not in decimal form.\n", buf);
+       else {
+               ret = iwl_set_tx_power(priv, val, false);
+               if (ret)
+                       IWL_ERR(priv, "failed setting tx power (0x%d).\n",
+                               ret);
+               else
+                       ret = count;
+       }
+       return ret;
+}
+
+static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
+
+static ssize_t show_rts_ht_protection(struct device *d,
+                            struct device_attribute *attr, char *buf)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+
+       return sprintf(buf, "%s\n",
+               priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self");
+}
+
+static ssize_t store_rts_ht_protection(struct device *d,
+                             struct device_attribute *attr,
+                             const char *buf, size_t count)
+{
+       struct iwl_priv *priv = dev_get_drvdata(d);
+       unsigned long val;
+       int ret;
+
+       ret = strict_strtoul(buf, 10, &val);
+       if (ret)
+               IWL_INFO(priv, "Input is not in decimal form.\n");
+       else {
+               if (!iwl_is_associated(priv))
+                       priv->cfg->use_rts_for_ht = val ? true : false;
+               else
+                       IWL_ERR(priv, "Sta associated with AP - "
+                               "Change protection mechanism is not allowed\n");
+               ret = count;
+       }
+       return ret;
+}
+
+static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO,
+                       show_rts_ht_protection, store_rts_ht_protection);
+
+
+static struct attribute *iwl_sysfs_entries[] = {
+       &dev_attr_temperature.attr,
+       &dev_attr_tx_power.attr,
+       &dev_attr_rts_ht_protection.attr,
+#ifdef CONFIG_IWLWIFI_DEBUG
+       &dev_attr_debug_level.attr,
+#endif
+       NULL
+};
+
+static struct attribute_group iwl_attribute_group = {
+       .name = NULL,           /* put in device directory */
+       .attrs = iwl_sysfs_entries,
+};
+
 /******************************************************************************
  *
  * uCode download functions
@@ -1965,6 +2115,13 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
        if (err)
                IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err);
 
+       err = sysfs_create_group(&priv->pci_dev->dev.kobj,
+                                       &iwl_attribute_group);
+       if (err) {
+               IWL_ERR(priv, "failed to create sysfs device attributes\n");
+               goto out_unbind;
+       }
+
        /* We have our copies now, allow OS release its copies */
        release_firmware(ucode_raw);
        complete(&priv->_agn.firmware_loading_complete);
@@ -3262,141 +3419,6 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
        return 0;
 }
 
-/*****************************************************************************
- *
- * sysfs attributes
- *
- *****************************************************************************/
-
-#ifdef CONFIG_IWLWIFI_DEBUG
-
-/*
- * The following adds a new attribute to the sysfs representation
- * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/)
- * used for controlling the debug level.
- *
- * See the level definitions in iwl for details.
- *
- * The debug_level being managed using sysfs below is a per device debug
- * level that is used instead of the global debug level if it (the per
- * device debug level) is set.
- */
-static ssize_t show_debug_level(struct device *d,
-                               struct device_attribute *attr, char *buf)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv));
-}
-static ssize_t store_debug_level(struct device *d,
-                               struct device_attribute *attr,
-                                const char *buf, size_t count)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       unsigned long val;
-       int ret;
-
-       ret = strict_strtoul(buf, 0, &val);
-       if (ret)
-               IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf);
-       else {
-               priv->debug_level = val;
-               if (iwl_alloc_traffic_mem(priv))
-                       IWL_ERR(priv,
-                               "Not enough memory to generate traffic log\n");
-       }
-       return strnlen(buf, count);
-}
-
-static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
-                       show_debug_level, store_debug_level);
-
-
-#endif /* CONFIG_IWLWIFI_DEBUG */
-
-
-static ssize_t show_temperature(struct device *d,
-                               struct device_attribute *attr, char *buf)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-
-       if (!iwl_is_alive(priv))
-               return -EAGAIN;
-
-       return sprintf(buf, "%d\n", priv->temperature);
-}
-
-static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
-
-static ssize_t show_tx_power(struct device *d,
-                            struct device_attribute *attr, char *buf)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-
-       if (!iwl_is_ready_rf(priv))
-               return sprintf(buf, "off\n");
-       else
-               return sprintf(buf, "%d\n", priv->tx_power_user_lmt);
-}
-
-static ssize_t store_tx_power(struct device *d,
-                             struct device_attribute *attr,
-                             const char *buf, size_t count)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       unsigned long val;
-       int ret;
-
-       ret = strict_strtoul(buf, 10, &val);
-       if (ret)
-               IWL_INFO(priv, "%s is not in decimal form.\n", buf);
-       else {
-               ret = iwl_set_tx_power(priv, val, false);
-               if (ret)
-                       IWL_ERR(priv, "failed setting tx power (0x%d).\n",
-                               ret);
-               else
-                       ret = count;
-       }
-       return ret;
-}
-
-static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
-
-static ssize_t show_rts_ht_protection(struct device *d,
-                            struct device_attribute *attr, char *buf)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-
-       return sprintf(buf, "%s\n",
-               priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self");
-}
-
-static ssize_t store_rts_ht_protection(struct device *d,
-                             struct device_attribute *attr,
-                             const char *buf, size_t count)
-{
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       unsigned long val;
-       int ret;
-
-       ret = strict_strtoul(buf, 10, &val);
-       if (ret)
-               IWL_INFO(priv, "Input is not in decimal form.\n");
-       else {
-               if (!iwl_is_associated(priv))
-                       priv->cfg->use_rts_for_ht = val ? true : false;
-               else
-                       IWL_ERR(priv, "Sta associated with AP - "
-                               "Change protection mechanism is not allowed\n");
-               ret = count;
-       }
-       return ret;
-}
-
-static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO,
-                       show_rts_ht_protection, store_rts_ht_protection);
-
-
 /*****************************************************************************
  *
  * driver setup and teardown
@@ -3550,21 +3572,6 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
        kfree(priv->scan_cmd);
 }
 
-static struct attribute *iwl_sysfs_entries[] = {
-       &dev_attr_temperature.attr,
-       &dev_attr_tx_power.attr,
-       &dev_attr_rts_ht_protection.attr,
-#ifdef CONFIG_IWLWIFI_DEBUG
-       &dev_attr_debug_level.attr,
-#endif
-       NULL
-};
-
-static struct attribute_group iwl_attribute_group = {
-       .name = NULL,           /* put in device directory */
-       .attrs = iwl_sysfs_entries,
-};
-
 static struct ieee80211_ops iwl_hw_ops = {
        .tx = iwl_mac_tx,
        .start = iwl_mac_start,
@@ -3750,11 +3757,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq);
                goto out_disable_msi;
        }
-       err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group);
-       if (err) {
-               IWL_ERR(priv, "failed to create sysfs device attributes\n");
-               goto out_free_irq;
-       }
 
        iwl_setup_deferred_work(priv);
        iwl_setup_rx_handlers(priv);
@@ -3788,15 +3790,13 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        err = iwl_request_firmware(priv, true);
        if (err)
-               goto out_remove_sysfs;
+               goto out_destroy_workqueue;
 
        return 0;
 
- out_remove_sysfs:
+ out_destroy_workqueue:
        destroy_workqueue(priv->workqueue);
        priv->workqueue = NULL;
-       sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
- out_free_irq:
        free_irq(priv->pci_dev->irq, priv);
        iwl_free_isr_ict(priv);
  out_disable_msi:
index 5a7eca8fb789621f69d15a6b79e5bae143386664..426e95567de388619dc120fe08178cab038667d9 100644 (file)
@@ -854,6 +854,45 @@ void iwl_set_rxon_chain(struct iwl_priv *priv)
 }
 EXPORT_SYMBOL(iwl_set_rxon_chain);
 
+/* Return valid channel */
+u8 iwl_get_single_channel_number(struct iwl_priv *priv,
+                                 enum ieee80211_band band)
+{
+       const struct iwl_channel_info *ch_info;
+       int i;
+       u8 channel = 0;
+
+       /* only scan single channel, good enough to reset the RF */
+       /* pick the first valid not in-use channel */
+       if (band == IEEE80211_BAND_5GHZ) {
+               for (i = 14; i < priv->channel_count; i++) {
+                       if (priv->channel_info[i].channel !=
+                           le16_to_cpu(priv->staging_rxon.channel)) {
+                               channel = priv->channel_info[i].channel;
+                               ch_info = iwl_get_channel_info(priv,
+                                       band, channel);
+                               if (is_channel_valid(ch_info))
+                                       break;
+                       }
+               }
+       } else {
+               for (i = 0; i < 14; i++) {
+                       if (priv->channel_info[i].channel !=
+                           le16_to_cpu(priv->staging_rxon.channel)) {
+                                       channel =
+                                               priv->channel_info[i].channel;
+                                       ch_info = iwl_get_channel_info(priv,
+                                               band, channel);
+                                       if (is_channel_valid(ch_info))
+                                               break;
+                       }
+               }
+       }
+
+       return channel;
+}
+EXPORT_SYMBOL(iwl_get_single_channel_number);
+
 /**
  * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON
  * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz
index 7e5a5ba41fd210e492655a5248d39bd7d4c7beb1..31775bd9c36170faa839da119456fd4cf747a385 100644 (file)
@@ -343,6 +343,8 @@ int iwl_check_rxon_cmd(struct iwl_priv *priv);
 int iwl_full_rxon_required(struct iwl_priv *priv);
 void iwl_set_rxon_chain(struct iwl_priv *priv);
 int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch);
+u8 iwl_get_single_channel_number(struct iwl_priv *priv,
+                                 enum ieee80211_band band);
 void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf);
 u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
                         struct ieee80211_sta_ht_cap *sta_ht_inf);
index 3e5bffb6034f47bad2d69ed89b7b38ae0f25be30..6c353cacc8d663f43d1a19c4b4bebcb697d61e45 100644 (file)
@@ -1844,6 +1844,49 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
 #endif
 }
 
+static int iwl3945_get_single_channel_for_scan(struct iwl_priv *priv,
+                                              struct ieee80211_vif *vif,
+                                              enum ieee80211_band band,
+                                              struct iwl3945_scan_channel *scan_ch)
+{
+       const struct ieee80211_supported_band *sband;
+       u16 passive_dwell = 0;
+       u16 active_dwell = 0;
+       int added = 0;
+       u8 channel = 0;
+
+       sband = iwl_get_hw_mode(priv, band);
+       if (!sband) {
+               IWL_ERR(priv, "invalid band\n");
+               return added;
+       }
+
+       active_dwell = iwl_get_active_dwell_time(priv, band, 0);
+       passive_dwell = iwl_get_passive_dwell_time(priv, band, vif);
+
+       if (passive_dwell <= active_dwell)
+               passive_dwell = active_dwell + 1;
+
+
+       channel = iwl_get_single_channel_number(priv, band);
+
+       if (channel) {
+               scan_ch->channel = channel;
+               scan_ch->type = 0;      /* passive */
+               scan_ch->active_dwell = cpu_to_le16(active_dwell);
+               scan_ch->passive_dwell = cpu_to_le16(passive_dwell);
+               /* Set txpower levels to defaults */
+               scan_ch->tpc.dsp_atten = 110;
+               if (band == IEEE80211_BAND_5GHZ)
+                       scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3;
+               else
+                       scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3));
+               added++;
+       } else
+               IWL_ERR(priv, "no valid channel found\n");
+       return added;
+}
+
 static int iwl3945_get_channels_for_scan(struct iwl_priv *priv,
                                         enum ieee80211_band band,
                                     u8 is_active, u8 n_probes,
@@ -2992,9 +3035,16 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
        /* select Rx antennas */
        scan->flags |= iwl3945_get_antenna_flags(priv);
 
-       scan->channel_count =
-               iwl3945_get_channels_for_scan(priv, band, is_active, n_probes,
-                       (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif);
+       if (priv->is_internal_short_scan) {
+               scan->channel_count =
+                       iwl3945_get_single_channel_for_scan(priv, vif, band,
+                               (void *)&scan->data[le16_to_cpu(
+                               scan->tx_cmd.len)]);
+       } else {
+               scan->channel_count =
+                       iwl3945_get_channels_for_scan(priv, band, is_active, n_probes,
+                               (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif);
+       }
 
        if (scan->channel_count == 0) {
                IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count);
index d5b197b4d5bb492ac70c8e2a98297a2e82e5e356..73073259f50814b36ab947e4fd58fc6293e6f459 100644 (file)
@@ -80,6 +80,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
        {USB_DEVICE(0x1413, 0x5400)},   /* Telsey 802.11g USB2.0 Adapter */
        {USB_DEVICE(0x1435, 0x0427)},   /* Inventel UR054G */
        {USB_DEVICE(0x2001, 0x3704)},   /* DLink DWL-G122 rev A2 */
+       {USB_DEVICE(0x413c, 0x5513)},   /* Dell WLA3310 USB Wireless Adapter */
        {USB_DEVICE(0x413c, 0x8102)},   /* Spinnaker DUT */
        {USB_DEVICE(0x413c, 0x8104)},   /* Cohiba Proto board */
        {}
index d234285c2c81186fc096044dcfa309236e7e2d51..c561332e70092b18280fff1843f948b13603289a 100644 (file)
@@ -259,6 +259,7 @@ disable:
        sdio_disable_func(func);
 release:
        sdio_release_host(func);
+       wl1251_free_hw(wl);
        return ret;
 }
 
index b3e5580c837b782ed3cf86108b82ee3e4c5473e6..4952c3b9379dcddcbb8f2c7b1f340009f0cba15c 100644 (file)
@@ -828,7 +828,14 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                        pci_name(pdev), err);
                return err;
        }
+
        bus = pdev->subordinate;
+       if (!bus) {
+               dev_notice(&pdev->dev, "the device is not a bridge, "
+                               "skipping\n");
+               rc = -ENODEV;
+               goto err_disable_device;
+       }
 
        /* Need to read VID early b/c it's used to differentiate CPQ and INTC
         * discovery
index 796828fce34cb5b918a485de903d3af18971ed38..c9171be74564b684ba41108fd15a566187910023 100644 (file)
@@ -340,7 +340,7 @@ int dmar_disabled = 0;
 int dmar_disabled = 1;
 #endif /*CONFIG_DMAR_DEFAULT_ON*/
 
-static int __initdata dmar_map_gfx = 1;
+static int dmar_map_gfx = 1;
 static int dmar_forcedac;
 static int intel_iommu_strict;
 
@@ -1874,14 +1874,15 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw)
                        }
                }
                if (found) {
+                       spin_unlock_irqrestore(&device_domain_lock, flags);
                        free_devinfo_mem(info);
                        domain_exit(domain);
                        domain = found;
                } else {
                        list_add(&info->link, &domain->devices);
                        list_add(&info->global, &device_domain_list);
+                       spin_unlock_irqrestore(&device_domain_lock, flags);
                }
-               spin_unlock_irqrestore(&device_domain_lock, flags);
        }
 
 found_domain:
@@ -3603,7 +3604,8 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
                pte = dmar_domain->pgd;
                if (dma_pte_present(pte)) {
                        free_pgtable_page(dmar_domain->pgd);
-                       dmar_domain->pgd = (struct dma_pte *)dma_pte_addr(pte);
+                       dmar_domain->pgd = (struct dma_pte *)
+                               phys_to_virt(dma_pte_addr(pte));
                }
                dmar_domain->agaw--;
        }
@@ -3719,6 +3721,12 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
         */
        printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
        rwbf_quirk = 1;
+
+       /* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */
+       if (dev->revision == 0x07) {
+               printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n");
+               dmar_map_gfx = 0;
+       }
 }
 
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
index afd2fbf7d797185f9e645ff85f7450edc7039889..c9957f68ac9bd574964271b363012aa62c8c8bc3 100644 (file)
@@ -1035,39 +1035,6 @@ error:
        return retval;
 }
 
-static void pci_remove_slot_links(struct pci_dev *dev)
-{
-       char func[10];
-       struct pci_slot *slot;
-
-       sysfs_remove_link(&dev->dev.kobj, "slot");
-       list_for_each_entry(slot, &dev->bus->slots, list) {
-               if (slot->number != PCI_SLOT(dev->devfn))
-                       continue;
-               snprintf(func, 10, "function%d", PCI_FUNC(dev->devfn));
-               sysfs_remove_link(&slot->kobj, func);
-       }
-}
-
-static int pci_create_slot_links(struct pci_dev *dev)
-{
-       int result = 0;
-       char func[10];
-       struct pci_slot *slot;
-
-       list_for_each_entry(slot, &dev->bus->slots, list) {
-               if (slot->number != PCI_SLOT(dev->devfn))
-                       continue;
-               result = sysfs_create_link(&dev->dev.kobj, &slot->kobj, "slot");
-               if (result)
-                       goto out;
-               snprintf(func, 10, "function%d", PCI_FUNC(dev->devfn));
-               result = sysfs_create_link(&slot->kobj, &dev->dev.kobj, func);
-       }
-out:
-       return result;
-}
-
 int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
 {
        int retval;
@@ -1130,8 +1097,6 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
        if (retval)
                goto err_vga_file;
 
-       pci_create_slot_links(pdev);
-
        return 0;
 
 err_vga_file:
@@ -1181,8 +1146,6 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
        if (!sysfs_initialized)
                return;
 
-       pci_remove_slot_links(pdev);
-
        pci_remove_capabilities_sysfs(pdev);
 
        if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
index b7512cf08c58ea665c2b4afce6aaac7ca9ddf13a..477345d416417c58662ea8386a0841ba65d0dd72 100644 (file)
@@ -1457,7 +1457,8 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
        conf5 &= ~(1 << 24);  /* Clear bit 24 */
 
        switch (pdev->device) {
-       case PCI_DEVICE_ID_JMICRON_JMB360:
+       case PCI_DEVICE_ID_JMICRON_JMB360: /* SATA single port */
+       case PCI_DEVICE_ID_JMICRON_JMB362: /* SATA dual ports */
                /* The controller should be in single function ahci mode */
                conf1 |= 0x0002A100; /* Set 8, 13, 15, 17 */
                break;
@@ -1493,12 +1494,14 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
index 17bed18d24ad10eb021e7d3148f8456ff5fe2277..92379e2d37e77ed4797dba23b7402f795dec80e2 100644 (file)
@@ -97,16 +97,16 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
 
        root = pci_find_parent_resource(dev, res);
        if (!root) {
-               dev_err(&dev->dev, "no compatible bridge window for %pR\n",
-                       res);
+               dev_info(&dev->dev, "no compatible bridge window for %pR\n",
+                        res);
                return -EINVAL;
        }
 
        conflict = request_resource_conflict(root, res);
        if (conflict) {
-               dev_err(&dev->dev,
-                       "address space collision: %pR conflicts with %s %pR\n",
-                       res, conflict->name, conflict);
+               dev_info(&dev->dev,
+                        "address space collision: %pR conflicts with %s %pR\n",
+                        res, conflict->name, conflict);
                return -EBUSY;
        }
 
index e0189cf7c5587ac2d182e7e55a20892c272631b4..659eaa0fc48facf81dad9c0b5c430498e01398e3 100644 (file)
@@ -97,50 +97,6 @@ static ssize_t cur_speed_read_file(struct pci_slot *slot, char *buf)
        return bus_speed_read(slot->bus->cur_bus_speed, buf);
 }
 
-static void remove_sysfs_files(struct pci_slot *slot)
-{
-       char func[10];
-       struct list_head *tmp;
-
-       list_for_each(tmp, &slot->bus->devices) {
-               struct pci_dev *dev = pci_dev_b(tmp);
-               if (PCI_SLOT(dev->devfn) != slot->number)
-                       continue;
-               sysfs_remove_link(&dev->dev.kobj, "slot");
-
-               snprintf(func, 10, "function%d", PCI_FUNC(dev->devfn));
-               sysfs_remove_link(&slot->kobj, func);
-       }
-}
-
-static int create_sysfs_files(struct pci_slot *slot)
-{
-       int result;
-       char func[10];
-       struct list_head *tmp;
-
-       list_for_each(tmp, &slot->bus->devices) {
-               struct pci_dev *dev = pci_dev_b(tmp);
-               if (PCI_SLOT(dev->devfn) != slot->number)
-                       continue;
-
-               result = sysfs_create_link(&dev->dev.kobj, &slot->kobj, "slot");
-               if (result)
-                       goto fail;
-
-               snprintf(func, 10, "function%d", PCI_FUNC(dev->devfn));
-               result = sysfs_create_link(&slot->kobj, &dev->dev.kobj, func);
-               if (result)
-                       goto fail;
-       }
-
-       return 0;
-
-fail:
-       remove_sysfs_files(slot);
-       return result;
-}
-
 static void pci_slot_release(struct kobject *kobj)
 {
        struct pci_dev *dev;
@@ -153,8 +109,6 @@ static void pci_slot_release(struct kobject *kobj)
                if (PCI_SLOT(dev->devfn) == slot->number)
                        dev->slot = NULL;
 
-       remove_sysfs_files(slot);
-
        list_del(&slot->list);
 
        kfree(slot);
@@ -346,8 +300,6 @@ placeholder:
        INIT_LIST_HEAD(&slot->list);
        list_add(&slot->list, &parent->slots);
 
-       create_sysfs_files(slot);
-
        list_for_each_entry(dev, &parent->devices, bus_list)
                if (PCI_SLOT(dev->devfn) == slot_nr)
                        dev->slot = slot;
index 7ef7adee5e4f1c2f22b6ff27658950d3139dd0d0..9fc3398455388d04159ca1f43ac2524d3c143c01 100644 (file)
@@ -671,6 +671,7 @@ static void pcmcia_requery(struct pcmcia_socket *s)
                if (old_funcs != new_funcs) {
                        /* we need to re-start */
                        pcmcia_card_remove(s, NULL);
+                       s->functions = 0;
                        pcmcia_card_add(s);
                }
        }
index 424e576f3acba7a2b7c626f52e48e7454125fc00..f1d41374eea7a32426e8acfeadc903b1901bee22 100644 (file)
@@ -880,6 +880,12 @@ static struct cardbus_type cardbus_type[] = {
                .restore_state  = ti_restore_state,
                .sock_init      = ti_init,
        },
+       [CARDBUS_TYPE_ENE]      = {
+               .override       = ene_override,
+               .save_state     = ti_save_state,
+               .restore_state  = ti_restore_state,
+               .sock_init      = ti_init,
+       },
 #endif
 #ifdef CONFIG_YENTA_RICOH
        [CARDBUS_TYPE_RICOH]    = {
@@ -902,14 +908,6 @@ static struct cardbus_type cardbus_type[] = {
                .restore_state  = o2micro_restore_state,
        },
 #endif
-#ifdef CONFIG_YENTA_TI
-       [CARDBUS_TYPE_ENE]      = {
-               .override       = ene_override,
-               .save_state     = ti_save_state,
-               .restore_state  = ti_restore_state,
-               .sock_init      = ti_init,
-       },
-#endif
 };
 
 
@@ -975,7 +973,7 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id)
 /* probes the PCI interrupt, use only on override functions */
 static int yenta_probe_cb_irq(struct yenta_socket *socket)
 {
-       u8 reg;
+       u8 reg = 0;
 
        if (!socket->cb_irq)
                return -1;
@@ -989,7 +987,8 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
        }
 
        /* generate interrupt, wait */
-       reg = exca_readb(socket, I365_CSCINT);
+       if (!socket->dev->irq)
+               reg = exca_readb(socket, I365_CSCINT);
        exca_writeb(socket, I365_CSCINT, reg | I365_CSC_STSCHG);
        cb_writel(socket, CB_SOCKET_EVENT, -1);
        cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
index 17da9ab932ed55d664f5f3bdbcab81447e83423e..a0ae29564774c7267654138e7a32beab87201f44 100644 (file)
@@ -42,7 +42,7 @@
  * size_t size;
  *
  * size = itcw_calc_size(1, 2, 0);
- * buffer = kmalloc(size, GFP_DMA);
+ * buffer = kmalloc(size, GFP_KERNEL | GFP_DMA);
  * if (!buffer)
  *     return -ENOMEM;
  * itcw = itcw_init(buffer, size, ITCW_OP_READ, 1, 2, 0);
index 0f41c9195e9bb9942adc2e6e15a43af4a34393e2..df5b6b971f2633954c3233ead3bb1b648532c507 100644 (file)
@@ -637,7 +637,7 @@ const static struct file_operations vhost_net_fops = {
 };
 
 static struct miscdevice vhost_net_misc = {
-       VHOST_NET_MINOR,
+       MISC_DYNAMIC_MINOR,
        "vhost-net",
        &vhost_net_fops,
 };
index 43ab7d8b66b2bf9e32d2e687747a8e6427daa6d5..7767338f8b14028fe4ff409eed4717e99296f0ba 100644 (file)
@@ -572,22 +572,12 @@ static enum omapfb_update_mode omap_lcdc_get_update_mode(void)
 /* PM code called only in internal controller mode */
 static void omap_lcdc_suspend(void)
 {
-       if (lcdc.update_mode == OMAPFB_AUTO_UPDATE) {
-               disable_controller();
-               omap_stop_lcd_dma();
-       }
+       omap_lcdc_set_update_mode(OMAPFB_UPDATE_DISABLED);
 }
 
 static void omap_lcdc_resume(void)
 {
-       if (lcdc.update_mode == OMAPFB_AUTO_UPDATE) {
-               setup_regs();
-               load_palette();
-               setup_lcd_dma();
-               set_load_mode(OMAP_LCDC_LOAD_FRAME);
-               enable_irqs(OMAP_LCDC_IRQ_DONE);
-               enable_controller();
-       }
+       omap_lcdc_set_update_mode(OMAPFB_AUTO_UPDATE);
 }
 
 static void omap_lcdc_get_caps(int plane, struct omapfb_caps *caps)
index 1162603c72e5ff8557ab25b2122c201078f76b47..eada9f12efc767908c1c17f401e1ca0b925a1d37 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 
 #include "omapfb.h"
 #include "dispc.h"
@@ -83,13 +84,13 @@ static inline u32 rfbi_read_reg(int idx)
 
 static int rfbi_get_clocks(void)
 {
-       rfbi.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick");
+       rfbi.dss_ick = clk_get(&rfbi.fbdev->dssdev->dev, "ick");
        if (IS_ERR(rfbi.dss_ick)) {
                dev_err(rfbi.fbdev->dev, "can't get ick\n");
                return PTR_ERR(rfbi.dss_ick);
        }
 
-       rfbi.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
+       rfbi.dss1_fck = clk_get(&rfbi.fbdev->dssdev->dev, "dss1_fck");
        if (IS_ERR(rfbi.dss1_fck)) {
                dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
                clk_put(rfbi.dss_ick);
index 1cddf92cb9a604f8afd43312af0b46ef4d145bd8..750bc5281d79d18ec7c3fca85e31254aae412251 100644 (file)
@@ -346,9 +346,13 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
        } else {
                wdt->users = 0;
        }
-       wdt->miscdev.minor = WATCHDOG_MINOR;
-       wdt->miscdev.name = "watchdog";
-       wdt->miscdev.fops = &at32_wdt_fops;
+
+       wdt->miscdev.minor      = WATCHDOG_MINOR;
+       wdt->miscdev.name       = "watchdog";
+       wdt->miscdev.fops       = &at32_wdt_fops;
+       wdt->miscdev.parent     = &pdev->dev;
+
+       platform_set_drvdata(pdev, wdt);
 
        if (at32_wdt_settimeout(timeout)) {
                at32_wdt_settimeout(TIMEOUT_DEFAULT);
@@ -360,17 +364,17 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
        ret = misc_register(&wdt->miscdev);
        if (ret) {
                dev_dbg(&pdev->dev, "failed to register wdt miscdev\n");
-               goto err_iounmap;
+               goto err_register;
        }
 
-       platform_set_drvdata(pdev, wdt);
-       wdt->miscdev.parent = &pdev->dev;
        dev_info(&pdev->dev,
                "AT32AP700X WDT at 0x%p, timeout %d sec (nowayout=%d)\n",
                wdt->regs, wdt->timeout, nowayout);
 
        return 0;
 
+err_register:
+       platform_set_drvdata(pdev, NULL);
 err_iounmap:
        iounmap(wdt->regs);
 err_free:
index ea25885781bba0f6902e2d0de30a82f7f104ec8c..2ee7dac55a3c454fb010c662e8dc9d11a7199f7b 100644 (file)
@@ -330,7 +330,6 @@ static void imx2_wdt_shutdown(struct platform_device *pdev)
 }
 
 static struct platform_driver imx2_wdt_driver = {
-       .probe          = imx2_wdt_probe,
        .remove         = __exit_p(imx2_wdt_remove),
        .shutdown       = imx2_wdt_shutdown,
        .driver         = {
index 89dd7b03529520df645e719e73e3d2e5f96c8477..b68d928c8f90fcf259c141b22f4fb7fa84729f84 100644 (file)
@@ -284,7 +284,7 @@ static int __devinit wm8350_wdt_probe(struct platform_device *pdev)
        struct wm8350 *wm8350 = platform_get_drvdata(pdev);
 
        if (!wm8350) {
-               dev_err(wm8350->dev, "No driver data supplied\n");
+               pr_err("No driver data supplied\n");
                return -ENODEV;
        }
 
index 7346c96308a581546b7f5773fd94d41f9a3c7345..99d6af8117473b661a64a5f05e58a024570d4fe0 100644 (file)
@@ -706,8 +706,13 @@ retry:
  * @bdev is about to be opened exclusively.  Check @bdev can be opened
  * exclusively and mark that an exclusive open is in progress.  Each
  * successful call to this function must be matched with a call to
- * either bd_claim() or bd_abort_claiming().  If this function
- * succeeds, the matching bd_claim() is guaranteed to succeed.
+ * either bd_finish_claiming() or bd_abort_claiming() (which do not
+ * fail).
+ *
+ * This function is used to gain exclusive access to the block device
+ * without actually causing other exclusive open attempts to fail. It
+ * should be used when the open sequence itself requires exclusive
+ * access but may subsequently fail.
  *
  * CONTEXT:
  * Might sleep.
@@ -734,6 +739,7 @@ static struct block_device *bd_start_claiming(struct block_device *bdev,
                return ERR_PTR(-ENXIO);
 
        whole = bdget_disk(disk, 0);
+       module_put(disk->fops->owner);
        put_disk(disk);
        if (!whole)
                return ERR_PTR(-ENOMEM);
@@ -782,15 +788,46 @@ static void bd_abort_claiming(struct block_device *whole, void *holder)
        __bd_abort_claiming(whole, holder);             /* releases bdev_lock */
 }
 
+/* increment holders when we have a legitimate claim. requires bdev_lock */
+static void __bd_claim(struct block_device *bdev, struct block_device *whole,
+                                       void *holder)
+{
+       /* note that for a whole device bd_holders
+        * will be incremented twice, and bd_holder will
+        * be set to bd_claim before being set to holder
+        */
+       whole->bd_holders++;
+       whole->bd_holder = bd_claim;
+       bdev->bd_holders++;
+       bdev->bd_holder = holder;
+}
+
+/**
+ * bd_finish_claiming - finish claiming a block device
+ * @bdev: block device of interest (passed to bd_start_claiming())
+ * @whole: whole block device returned by bd_start_claiming()
+ * @holder: holder trying to claim @bdev
+ *
+ * Finish a claiming block started by bd_start_claiming().
+ *
+ * CONTEXT:
+ * Grabs and releases bdev_lock.
+ */
+static void bd_finish_claiming(struct block_device *bdev,
+                               struct block_device *whole, void *holder)
+{
+       spin_lock(&bdev_lock);
+       BUG_ON(!bd_may_claim(bdev, whole, holder));
+       __bd_claim(bdev, whole, holder);
+       __bd_abort_claiming(whole, holder); /* not actually an abort */
+}
+
 /**
  * bd_claim - claim a block device
  * @bdev: block device to claim
  * @holder: holder trying to claim @bdev
  *
- * Try to claim @bdev which must have been opened successfully.  This
- * function may be called with or without preceding
- * blk_start_claiming().  In the former case, this function is always
- * successful and terminates the claiming block.
+ * Try to claim @bdev which must have been opened successfully.
  *
  * CONTEXT:
  * Might sleep.
@@ -806,23 +843,10 @@ int bd_claim(struct block_device *bdev, void *holder)
        might_sleep();
 
        spin_lock(&bdev_lock);
-
        res = bd_prepare_to_claim(bdev, whole, holder);
-       if (res == 0) {
-               /* note that for a whole device bd_holders
-                * will be incremented twice, and bd_holder will
-                * be set to bd_claim before being set to holder
-                */
-               whole->bd_holders++;
-               whole->bd_holder = bd_claim;
-               bdev->bd_holders++;
-               bdev->bd_holder = holder;
-       }
-
-       if (whole->bd_claiming)
-               __bd_abort_claiming(whole, holder);     /* releases bdev_lock */
-       else
-               spin_unlock(&bdev_lock);
+       if (res == 0)
+               __bd_claim(bdev, whole, holder);
+       spin_unlock(&bdev_lock);
 
        return res;
 }
@@ -1476,7 +1500,7 @@ static int blkdev_open(struct inode * inode, struct file * filp)
 
        if (whole) {
                if (res == 0)
-                       BUG_ON(bd_claim(bdev, filp) != 0);
+                       bd_finish_claiming(bdev, whole, filp);
                else
                        bd_abort_claiming(whole, filp);
        }
@@ -1712,7 +1736,7 @@ struct block_device *open_bdev_exclusive(const char *path, fmode_t mode, void *h
        if ((mode & FMODE_WRITE) && bdev_read_only(bdev))
                goto out_blkdev_put;
 
-       BUG_ON(bd_claim(bdev, holder) != 0);
+       bd_finish_claiming(bdev, whole, holder);
        return bdev;
 
 out_blkdev_put:
index 8d432cd9d580d39ed2e94bf3be99c17667a8b0dd..2222d161c7b68111431031e007b019d7de629d3e 100644 (file)
@@ -60,6 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
                size = __btrfs_getxattr(inode, name, value, size);
                if (size > 0) {
                        acl = posix_acl_from_xattr(value, size);
+                       if (IS_ERR(acl))
+                               return acl;
                        set_cached_acl(inode, type, acl);
                }
                kfree(value);
@@ -160,6 +162,12 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
        int ret;
        struct posix_acl *acl = NULL;
 
+       if (!is_owner_or_cap(dentry->d_inode))
+               return -EPERM;
+
+       if (!IS_POSIXACL(dentry->d_inode))
+               return -EOPNOTSUPP;
+
        if (value) {
                acl = posix_acl_from_xattr(value, size);
                if (acl == NULL) {
index f3b287c22caf2e6855cf89bf780cf0b4b675c902..34f7c375567e38eef3f83843baf0bf2272282008 100644 (file)
@@ -1941,8 +1941,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
                     btrfs_level_size(tree_root,
                                      btrfs_super_log_root_level(disk_super));
 
-               log_tree_root = kzalloc(sizeof(struct btrfs_root),
-                                                     GFP_NOFS);
+               log_tree_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
+               if (!log_tree_root) {
+                       err = -ENOMEM;
+                       goto fail_trans_kthread;
+               }
 
                __setup_root(nodesize, leafsize, sectorsize, stripesize,
                             log_tree_root, fs_info, BTRFS_TREE_LOG_OBJECTID);
@@ -1982,6 +1985,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
        fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
        if (!fs_info->fs_root)
                goto fail_trans_kthread;
+       if (IS_ERR(fs_info->fs_root)) {
+               err = PTR_ERR(fs_info->fs_root);
+               goto fail_trans_kthread;
+       }
 
        if (!(sb->s_flags & MS_RDONLY)) {
                down_read(&fs_info->cleanup_work_sem);
index b9080d71991a35cea63d2620d1534234cde6e0a9..32d094002a57132b2113e9e8f02303f6a8b16052 100644 (file)
@@ -4360,7 +4360,8 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans,
 
        block_rsv = get_block_rsv(trans, root);
        cache = btrfs_lookup_block_group(root->fs_info, buf->start);
-       BUG_ON(block_rsv->space_info != cache->space_info);
+       if (block_rsv->space_info != cache->space_info)
+               goto out;
 
        if (btrfs_header_generation(buf) == trans->transid) {
                if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
index 787b50a16a146eea9bb4ec4202fcdab1f3f4bec0..e354c33df0824592bb9356be4987fd0ddfbbdc71 100644 (file)
@@ -1140,7 +1140,7 @@ int btrfs_sync_file(struct file *file, int datasync)
        /*
         * ok we haven't committed the transaction yet, lets do a commit
         */
-       if (file && file->private_data)
+       if (file->private_data)
                btrfs_ioctl_trans_end(file);
 
        trans = btrfs_start_transaction(root, 0);
@@ -1190,14 +1190,22 @@ static const struct vm_operations_struct btrfs_file_vm_ops = {
 
 static int btrfs_file_mmap(struct file *filp, struct vm_area_struct *vma)
 {
-       vma->vm_ops = &btrfs_file_vm_ops;
+       struct address_space *mapping = filp->f_mapping;
+
+       if (!mapping->a_ops->readpage)
+               return -ENOEXEC;
+
        file_accessed(filp);
+       vma->vm_ops = &btrfs_file_vm_ops;
+       vma->vm_flags |= VM_CAN_NONLINEAR;
+
        return 0;
 }
 
 const struct file_operations btrfs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = do_sync_read,
+       .write          = do_sync_write,
        .aio_read       = generic_file_aio_read,
        .splice_read    = generic_file_splice_read,
        .aio_write      = btrfs_file_aio_write,
index fa6ccc1bfe2a9a73e2de97ed04cac8708efa99f9..1bff92ad474434a535b711abebb14d7a692cabca 100644 (file)
@@ -2673,7 +2673,7 @@ static int check_path_shared(struct btrfs_root *root,
        struct extent_buffer *eb;
        int level;
        int ret;
-       u64 refs;
+       u64 refs = 1;
 
        for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
                if (!path->nodes[level])
@@ -6884,7 +6884,7 @@ static long btrfs_fallocate(struct inode *inode, int mode,
                if (em->block_start == EXTENT_MAP_HOLE ||
                    (cur_offset >= inode->i_size &&
                     !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) {
-                       ret = btrfs_prealloc_file_range(inode, 0, cur_offset,
+                       ret = btrfs_prealloc_file_range(inode, mode, cur_offset,
                                                        last_byte - cur_offset,
                                                        1 << inode->i_blkbits,
                                                        offset + len,
index 4cdb98cf26de174e644e7d74e2a97e2fe037f08b..4dbaf89b1337632ac7800b84b183d6cd0ab14242 100644 (file)
@@ -1280,7 +1280,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
        trans = btrfs_start_transaction(root, 0);
        if (IS_ERR(trans)) {
                err = PTR_ERR(trans);
-               goto out;
+               goto out_up_write;
        }
        trans->block_rsv = &root->fs_info->global_block_rsv;
 
@@ -1845,7 +1845,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
        dir_id = btrfs_super_root_dir(&root->fs_info->super_copy);
        di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path,
                                   dir_id, "default", 7, 1);
-       if (!di) {
+       if (IS_ERR_OR_NULL(di)) {
                btrfs_free_path(path);
                btrfs_end_transaction(trans, root);
                printk(KERN_ERR "Umm, you don't have the default dir item, "
index 05d41e569236330cc8ed8e5e0f8b17566080791c..b37d723b9d4a8a137b05256a85788074b5f03c5e 100644 (file)
@@ -784,16 +784,17 @@ again:
                                struct btrfs_extent_ref_v0 *ref0;
                                ref0 = btrfs_item_ptr(eb, path1->slots[0],
                                                struct btrfs_extent_ref_v0);
-                               root = find_tree_root(rc, eb, ref0);
-                               if (!root->ref_cows)
-                                       cur->cowonly = 1;
                                if (key.objectid == key.offset) {
+                                       root = find_tree_root(rc, eb, ref0);
                                        if (root && !should_ignore_root(root))
                                                cur->root = root;
                                        else
                                                list_add(&cur->list, &useless);
                                        break;
                                }
+                               if (is_cowonly_root(btrfs_ref_root_v0(eb,
+                                                                     ref0)))
+                                       cur->cowonly = 1;
                        }
 #else
                BUG_ON(key.type == BTRFS_EXTENT_REF_V0_KEY);
index b91ccd972644b48048329806044ebc3c62d1b550..2d958be761c84556b39c60afa39999b0f3fd75d6 100644 (file)
@@ -330,7 +330,6 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 {
        struct btrfs_path *path;
        int ret;
-       u32 refs;
        struct btrfs_root_item *ri;
        struct extent_buffer *leaf;
 
@@ -344,8 +343,6 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
        leaf = path->nodes[0];
        ri = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_item);
 
-       refs = btrfs_disk_root_refs(leaf, ri);
-       BUG_ON(refs != 0);
        ret = btrfs_del_item(trans, root, path);
 out:
        btrfs_free_path(path);
index d34b2dfc9628cde65f6181b5ed4043cf8603541c..f2393b39031812c178fd98cb79eb614f3ba6c65a 100644 (file)
@@ -360,6 +360,8 @@ static struct dentry *get_default_root(struct super_block *sb,
         */
        dir_id = btrfs_super_root_dir(&root->fs_info->super_copy);
        di = btrfs_lookup_dir_item(NULL, root, path, dir_id, "default", 7, 0);
+       if (IS_ERR(di))
+               return ERR_CAST(di);
        if (!di) {
                /*
                 * Ok the default dir item isn't there.  This is weird since
@@ -390,8 +392,8 @@ setup_root:
        location.offset = 0;
 
        inode = btrfs_iget(sb, &location, new_root, &new);
-       if (!inode)
-               return ERR_PTR(-ENOMEM);
+       if (IS_ERR(inode))
+               return ERR_CAST(inode);
 
        /*
         * If we're just mounting the root most subvol put the inode and return
index ae3e3a3064451f7b49fedaa3931120ff1af6d169..619b61655ee5dd4496ca4ec6374849c09f892817 100644 (file)
@@ -981,6 +981,46 @@ static int send_cap_msg(struct ceph_mds_session *session,
        return 0;
 }
 
+static void __queue_cap_release(struct ceph_mds_session *session,
+                               u64 ino, u64 cap_id, u32 migrate_seq,
+                               u32 issue_seq)
+{
+       struct ceph_msg *msg;
+       struct ceph_mds_cap_release *head;
+       struct ceph_mds_cap_item *item;
+
+       spin_lock(&session->s_cap_lock);
+       BUG_ON(!session->s_num_cap_releases);
+       msg = list_first_entry(&session->s_cap_releases,
+                              struct ceph_msg, list_head);
+
+       dout(" adding %llx release to mds%d msg %p (%d left)\n",
+            ino, session->s_mds, msg, session->s_num_cap_releases);
+
+       BUG_ON(msg->front.iov_len + sizeof(*item) > PAGE_CACHE_SIZE);
+       head = msg->front.iov_base;
+       head->num = cpu_to_le32(le32_to_cpu(head->num) + 1);
+       item = msg->front.iov_base + msg->front.iov_len;
+       item->ino = cpu_to_le64(ino);
+       item->cap_id = cpu_to_le64(cap_id);
+       item->migrate_seq = cpu_to_le32(migrate_seq);
+       item->seq = cpu_to_le32(issue_seq);
+
+       session->s_num_cap_releases--;
+
+       msg->front.iov_len += sizeof(*item);
+       if (le32_to_cpu(head->num) == CEPH_CAPS_PER_RELEASE) {
+               dout(" release msg %p full\n", msg);
+               list_move_tail(&msg->list_head, &session->s_cap_releases_done);
+       } else {
+               dout(" release msg %p at %d/%d (%d)\n", msg,
+                    (int)le32_to_cpu(head->num),
+                    (int)CEPH_CAPS_PER_RELEASE,
+                    (int)msg->front.iov_len);
+       }
+       spin_unlock(&session->s_cap_lock);
+}
+
 /*
  * Queue cap releases when an inode is dropped from our cache.  Since
  * inode is about to be destroyed, there is no need for i_lock.
@@ -994,41 +1034,9 @@ void ceph_queue_caps_release(struct inode *inode)
        while (p) {
                struct ceph_cap *cap = rb_entry(p, struct ceph_cap, ci_node);
                struct ceph_mds_session *session = cap->session;
-               struct ceph_msg *msg;
-               struct ceph_mds_cap_release *head;
-               struct ceph_mds_cap_item *item;
 
-               spin_lock(&session->s_cap_lock);
-               BUG_ON(!session->s_num_cap_releases);
-               msg = list_first_entry(&session->s_cap_releases,
-                                      struct ceph_msg, list_head);
-
-               dout(" adding %p release to mds%d msg %p (%d left)\n",
-                    inode, session->s_mds, msg, session->s_num_cap_releases);
-
-               BUG_ON(msg->front.iov_len + sizeof(*item) > PAGE_CACHE_SIZE);
-               head = msg->front.iov_base;
-               head->num = cpu_to_le32(le32_to_cpu(head->num) + 1);
-               item = msg->front.iov_base + msg->front.iov_len;
-               item->ino = cpu_to_le64(ceph_ino(inode));
-               item->cap_id = cpu_to_le64(cap->cap_id);
-               item->migrate_seq = cpu_to_le32(cap->mseq);
-               item->seq = cpu_to_le32(cap->issue_seq);
-
-               session->s_num_cap_releases--;
-
-               msg->front.iov_len += sizeof(*item);
-               if (le32_to_cpu(head->num) == CEPH_CAPS_PER_RELEASE) {
-                       dout(" release msg %p full\n", msg);
-                       list_move_tail(&msg->list_head,
-                                      &session->s_cap_releases_done);
-               } else {
-                       dout(" release msg %p at %d/%d (%d)\n", msg,
-                            (int)le32_to_cpu(head->num),
-                            (int)CEPH_CAPS_PER_RELEASE,
-                            (int)msg->front.iov_len);
-               }
-               spin_unlock(&session->s_cap_lock);
+               __queue_cap_release(session, ceph_ino(inode), cap->cap_id,
+                                   cap->mseq, cap->issue_seq);
                p = rb_next(p);
                __ceph_remove_cap(cap);
        }
@@ -2655,7 +2663,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
        struct ceph_mds_caps *h;
        int mds = session->s_mds;
        int op;
-       u32 seq;
+       u32 seq, mseq;
        struct ceph_vino vino;
        u64 cap_id;
        u64 size, max_size;
@@ -2675,6 +2683,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
        vino.snap = CEPH_NOSNAP;
        cap_id = le64_to_cpu(h->cap_id);
        seq = le32_to_cpu(h->seq);
+       mseq = le32_to_cpu(h->migrate_seq);
        size = le64_to_cpu(h->size);
        max_size = le64_to_cpu(h->max_size);
 
@@ -2689,6 +2698,18 @@ void ceph_handle_caps(struct ceph_mds_session *session,
             vino.snap, inode);
        if (!inode) {
                dout(" i don't have ino %llx\n", vino.ino);
+
+               if (op == CEPH_CAP_OP_IMPORT)
+                       __queue_cap_release(session, vino.ino, cap_id,
+                                           mseq, seq);
+
+               /*
+                * send any full release message to try to move things
+                * along for the mds (who clearly thinks we still have this
+                * cap).
+                */
+               ceph_add_cap_releases(mdsc, session, -1);
+               ceph_send_cap_releases(mdsc, session);
                goto done;
        }
 
@@ -2714,7 +2735,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
        spin_lock(&inode->i_lock);
        cap = __get_cap_for_mds(ceph_inode(inode), mds);
        if (!cap) {
-               dout("no cap on %p ino %llx.%llx from mds%d, releasing\n",
+               dout(" no cap on %p ino %llx.%llx from mds%d\n",
                     inode, ceph_ino(inode), ceph_snap(inode), mds);
                spin_unlock(&inode->i_lock);
                goto done;
index 226f5a50d36294163e44de833c6949967c04348d..ab47f46ca28285b179f4e307375a88555c17ef21 100644 (file)
@@ -827,7 +827,7 @@ static void ceph_set_dentry_offset(struct dentry *dn)
 
        spin_lock(&dcache_lock);
        spin_lock(&dn->d_lock);
-       list_move_tail(&dir->d_subdirs, &dn->d_u.d_child);
+       list_move(&dn->d_u.d_child, &dir->d_subdirs);
        dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset,
             dn->d_u.d_child.prev, dn->d_u.d_child.next);
        spin_unlock(&dn->d_lock);
index b49f12822cbcb77b1dab660f4d1aa602df5effb9..1766947fc07ab0892027fd5a3fc042e552310275 100644 (file)
@@ -1066,9 +1066,9 @@ static int trim_caps(struct ceph_mds_client *mdsc,
  *
  * Called under s_mutex.
  */
-static int add_cap_releases(struct ceph_mds_client *mdsc,
-                           struct ceph_mds_session *session,
-                           int extra)
+int ceph_add_cap_releases(struct ceph_mds_client *mdsc,
+                         struct ceph_mds_session *session,
+                         int extra)
 {
        struct ceph_msg *msg;
        struct ceph_mds_cap_release *head;
@@ -1176,8 +1176,8 @@ static int check_cap_flush(struct ceph_mds_client *mdsc, u64 want_flush_seq)
 /*
  * called under s_mutex
  */
-static void send_cap_releases(struct ceph_mds_client *mdsc,
-                      struct ceph_mds_session *session)
+void ceph_send_cap_releases(struct ceph_mds_client *mdsc,
+                           struct ceph_mds_session *session)
 {
        struct ceph_msg *msg;
 
@@ -1980,7 +1980,7 @@ out_err:
        }
        mutex_unlock(&mdsc->mutex);
 
-       add_cap_releases(mdsc, req->r_session, -1);
+       ceph_add_cap_releases(mdsc, req->r_session, -1);
        mutex_unlock(&session->s_mutex);
 
        /* kick calling process */
@@ -2433,6 +2433,7 @@ static void handle_lease(struct ceph_mds_client *mdsc,
        struct ceph_dentry_info *di;
        int mds = session->s_mds;
        struct ceph_mds_lease *h = msg->front.iov_base;
+       u32 seq;
        struct ceph_vino vino;
        int mask;
        struct qstr dname;
@@ -2446,6 +2447,7 @@ static void handle_lease(struct ceph_mds_client *mdsc,
        vino.ino = le64_to_cpu(h->ino);
        vino.snap = CEPH_NOSNAP;
        mask = le16_to_cpu(h->mask);
+       seq = le32_to_cpu(h->seq);
        dname.name = (void *)h + sizeof(*h) + sizeof(u32);
        dname.len = msg->front.iov_len - sizeof(*h) - sizeof(u32);
        if (dname.len != get_unaligned_le32(h+1))
@@ -2456,8 +2458,9 @@ static void handle_lease(struct ceph_mds_client *mdsc,
 
        /* lookup inode */
        inode = ceph_find_inode(sb, vino);
-       dout("handle_lease '%s', mask %d, ino %llx %p\n",
-            ceph_lease_op_name(h->action), mask, vino.ino, inode);
+       dout("handle_lease %s, mask %d, ino %llx %p %.*s\n",
+            ceph_lease_op_name(h->action), mask, vino.ino, inode,
+            dname.len, dname.name);
        if (inode == NULL) {
                dout("handle_lease no inode %llx\n", vino.ino);
                goto release;
@@ -2482,7 +2485,8 @@ static void handle_lease(struct ceph_mds_client *mdsc,
        switch (h->action) {
        case CEPH_MDS_LEASE_REVOKE:
                if (di && di->lease_session == session) {
-                       h->seq = cpu_to_le32(di->lease_seq);
+                       if (ceph_seq_cmp(di->lease_seq, seq) > 0)
+                               h->seq = cpu_to_le32(di->lease_seq);
                        __ceph_mdsc_drop_dentry_lease(dentry);
                }
                release = 1;
@@ -2496,7 +2500,7 @@ static void handle_lease(struct ceph_mds_client *mdsc,
                        unsigned long duration =
                                le32_to_cpu(h->duration_ms) * HZ / 1000;
 
-                       di->lease_seq = le32_to_cpu(h->seq);
+                       di->lease_seq = seq;
                        dentry->d_time = di->lease_renew_from + duration;
                        di->lease_renew_after = di->lease_renew_from +
                                (duration >> 1);
@@ -2686,10 +2690,10 @@ static void delayed_work(struct work_struct *work)
                        send_renew_caps(mdsc, s);
                else
                        ceph_con_keepalive(&s->s_con);
-               add_cap_releases(mdsc, s, -1);
+               ceph_add_cap_releases(mdsc, s, -1);
                if (s->s_state == CEPH_MDS_SESSION_OPEN ||
                    s->s_state == CEPH_MDS_SESSION_HUNG)
-                       send_cap_releases(mdsc, s);
+                       ceph_send_cap_releases(mdsc, s);
                mutex_unlock(&s->s_mutex);
                ceph_put_mds_session(s);
 
index d9936c4f12122a6a670a198a8a50249d06c27543..b292fa42a66d8026b49a0217ffc0b4e89f381497 100644 (file)
@@ -322,6 +322,12 @@ static inline void ceph_mdsc_put_request(struct ceph_mds_request *req)
        kref_put(&req->r_kref, ceph_mdsc_release_request);
 }
 
+extern int ceph_add_cap_releases(struct ceph_mds_client *mdsc,
+                                struct ceph_mds_session *session,
+                                int extra);
+extern void ceph_send_cap_releases(struct ceph_mds_client *mdsc,
+                                  struct ceph_mds_session *session);
+
 extern void ceph_mdsc_pre_umount(struct ceph_mds_client *mdsc);
 
 extern char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
index 21c62e9b7d1d6d4c816d252a3155706d25752ccf..07a539906e67c821a2db3e0c6717c0957d3bbecf 100644 (file)
@@ -400,6 +400,8 @@ static void release_generic_request(struct kref *kref)
                ceph_msg_put(req->reply);
        if (req->request)
                ceph_msg_put(req->request);
+
+       kfree(req);
 }
 
 static void put_generic_request(struct ceph_mon_generic_request *req)
index 4e0bee240b9dbf10c9a14e9c13ac6a4867d1d0c2..fa87f51e38e112a38f8a95d87ac4c96e02e7d7ef 100644 (file)
@@ -89,7 +89,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
 
        buf->f_files = le64_to_cpu(st.num_objects);
        buf->f_ffree = -1;
-       buf->f_namelen = PATH_MAX;
+       buf->f_namelen = NAME_MAX;
        buf->f_frsize = PAGE_CACHE_SIZE;
 
        /* leave fsid little-endian, regardless of host endianness */
@@ -926,7 +926,7 @@ static int ceph_compare_super(struct super_block *sb, void *data)
 /*
  * construct our own bdi so we can control readahead, etc.
  */
-static atomic_long_t bdi_seq = ATOMIC_INIT(0);
+static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0);
 
 static int ceph_register_bdi(struct super_block *sb, struct ceph_client *client)
 {
index 78c02eb4cb1f107f6c2503acc4f6d56f7e1b1524..484e52bb40bb20436956167a511567147b6136c5 100644 (file)
@@ -473,14 +473,24 @@ static int cifs_remount(struct super_block *sb, int *flags, char *data)
        return 0;
 }
 
+void cifs_drop_inode(struct inode *inode)
+{
+       struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
+
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
+               return generic_drop_inode(inode);
+
+       return generic_delete_inode(inode);
+}
+
 static const struct super_operations cifs_super_ops = {
        .put_super = cifs_put_super,
        .statfs = cifs_statfs,
        .alloc_inode = cifs_alloc_inode,
        .destroy_inode = cifs_destroy_inode,
-/*     .drop_inode         = generic_delete_inode,
-       .delete_inode   = cifs_delete_inode,  */  /* Do not need above two
-       functions unless later we add lazy close of inodes or unless the
+       .drop_inode     = cifs_drop_inode,
+/*     .delete_inode   = cifs_delete_inode,  */  /* Do not need above
+       function unless later we add lazy close of inodes or unless the
        kernel forgets to call us with the same number of releases (closes)
        as opens */
        .show_options = cifs_show_options,
index fb1657e0fdb812d204b3a9309e3e245e3032e985..fb6318b81509801a218d8a2248542e427b9516ce 100644 (file)
@@ -106,7 +106,6 @@ extern struct cifsFileInfo *cifs_new_fileinfo(struct inode *newinode,
                                __u16 fileHandle, struct file *file,
                                struct vfsmount *mnt, unsigned int oflags);
 extern int cifs_posix_open(char *full_path, struct inode **pinode,
-                               struct vfsmount *mnt,
                                struct super_block *sb,
                                int mode, int oflags,
                                __u32 *poplock, __u16 *pnetfid, int xid);
index 391816b461ca1872328cec6e9d3ec3abbd7502e0..e7ae78b66fa15b89162b18a12d76c90f48b8b508 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/slab.h>
 #include <linux/namei.h>
 #include <linux/mount.h>
+#include <linux/file.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
 #include "cifsglob.h"
@@ -184,12 +185,13 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
        }
        write_unlock(&GlobalSMBSeslock);
 
+       file->private_data = pCifsFile;
+
        return pCifsFile;
 }
 
 int cifs_posix_open(char *full_path, struct inode **pinode,
-                       struct vfsmount *mnt, struct super_block *sb,
-                       int mode, int oflags,
+                       struct super_block *sb, int mode, int oflags,
                        __u32 *poplock, __u16 *pnetfid, int xid)
 {
        int rc;
@@ -258,19 +260,6 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
                cifs_fattr_to_inode(*pinode, &fattr);
        }
 
-       /*
-        * cifs_fill_filedata() takes care of setting cifsFileInfo pointer to
-        * file->private_data.
-        */
-       if (mnt) {
-               struct cifsFileInfo *pfile_info;
-
-               pfile_info = cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt,
-                                              oflags);
-               if (pfile_info == NULL)
-                       rc = -ENOMEM;
-       }
-
 posix_open_ret:
        kfree(presp_data);
        return rc;
@@ -298,7 +287,6 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
        int create_options = CREATE_NOT_DIR;
        __u32 oplock = 0;
        int oflags;
-       bool posix_create = false;
        /*
         * BB below access is probably too much for mknod to request
         *    but we have to do query and setpathinfo so requesting
@@ -339,7 +327,6 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
            (CIFS_UNIX_POSIX_PATH_OPS_CAP &
                        le64_to_cpu(tcon->fsUnixInfo.Capability))) {
                rc = cifs_posix_open(full_path, &newinode,
-                       nd ? nd->path.mnt : NULL,
                        inode->i_sb, mode, oflags, &oplock, &fileHandle, xid);
                /* EIO could indicate that (posix open) operation is not
                   supported, despite what server claimed in capability
@@ -347,7 +334,6 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                   handled in posix open */
 
                if (rc == 0) {
-                       posix_create = true;
                        if (newinode == NULL) /* query inode info */
                                goto cifs_create_get_file_info;
                        else /* success, no need to query */
@@ -478,21 +464,28 @@ cifs_create_set_dentry:
        else
                cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
 
-       /* nfsd case - nfs srv does not set nd */
-       if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) {
-               /* mknod case - do not leave file open */
-               CIFSSMBClose(xid, tcon, fileHandle);
-       } else if (!(posix_create) && (newinode)) {
+       if (newinode && nd && (nd->flags & LOOKUP_OPEN)) {
                struct cifsFileInfo *pfile_info;
-               /*
-                * cifs_fill_filedata() takes care of setting cifsFileInfo
-                * pointer to file->private_data.
-                */
-               pfile_info = cifs_new_fileinfo(newinode, fileHandle, NULL,
+               struct file *filp;
+
+               filp = lookup_instantiate_filp(nd, direntry, generic_file_open);
+               if (IS_ERR(filp)) {
+                       rc = PTR_ERR(filp);
+                       CIFSSMBClose(xid, tcon, fileHandle);
+                       goto cifs_create_out;
+               }
+
+               pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp,
                                               nd->path.mnt, oflags);
-               if (pfile_info == NULL)
+               if (pfile_info == NULL) {
+                       fput(filp);
+                       CIFSSMBClose(xid, tcon, fileHandle);
                        rc = -ENOMEM;
+               }
+       } else {
+               CIFSSMBClose(xid, tcon, fileHandle);
        }
+
 cifs_create_out:
        kfree(buf);
        kfree(full_path);
@@ -636,6 +629,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
        bool posix_open = false;
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *pTcon;
+       struct cifsFileInfo *cfile;
        struct inode *newInode = NULL;
        char *full_path = NULL;
        struct file *filp;
@@ -703,7 +697,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
                if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) &&
                     (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open &&
                     (nd->intent.open.flags & O_CREAT)) {
-                       rc = cifs_posix_open(full_path, &newInode, nd->path.mnt,
+                       rc = cifs_posix_open(full_path, &newInode,
                                        parent_dir_inode->i_sb,
                                        nd->intent.open.create_mode,
                                        nd->intent.open.flags, &oplock,
@@ -733,8 +727,25 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
                else
                        direntry->d_op = &cifs_dentry_ops;
                d_add(direntry, newInode);
-               if (posix_open)
-                       filp = lookup_instantiate_filp(nd, direntry, NULL);
+               if (posix_open) {
+                       filp = lookup_instantiate_filp(nd, direntry,
+                                                      generic_file_open);
+                       if (IS_ERR(filp)) {
+                               rc = PTR_ERR(filp);
+                               CIFSSMBClose(xid, pTcon, fileHandle);
+                               goto lookup_out;
+                       }
+
+                       cfile = cifs_new_fileinfo(newInode, fileHandle, filp,
+                                                 nd->path.mnt,
+                                                 nd->intent.open.flags);
+                       if (cfile == NULL) {
+                               fput(filp);
+                               CIFSSMBClose(xid, pTcon, fileHandle);
+                               rc = -ENOMEM;
+                               goto lookup_out;
+                       }
+               }
                /* since paths are not looked up by component - the parent
                   directories are presumed to be good here */
                renew_parental_timestamps(direntry);
@@ -755,6 +766,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
                is a common return code */
        }
 
+lookup_out:
        kfree(full_path);
        FreeXid(xid);
        return ERR_PTR(rc);
index 75541af4b3db1395ecfab6fd318144b88b959fd8..409e4f523e61e56aae0e1b892c2a9021ebe3728d 100644 (file)
@@ -162,44 +162,12 @@ psx_client_can_cache:
        return 0;
 }
 
-static struct cifsFileInfo *
-cifs_fill_filedata(struct file *file)
-{
-       struct list_head *tmp;
-       struct cifsFileInfo *pCifsFile = NULL;
-       struct cifsInodeInfo *pCifsInode = NULL;
-
-       /* search inode for this file and fill in file->private_data */
-       pCifsInode = CIFS_I(file->f_path.dentry->d_inode);
-       read_lock(&GlobalSMBSeslock);
-       list_for_each(tmp, &pCifsInode->openFileList) {
-               pCifsFile = list_entry(tmp, struct cifsFileInfo, flist);
-               if ((pCifsFile->pfile == NULL) &&
-                   (pCifsFile->pid == current->tgid)) {
-                       /* mode set in cifs_create */
-
-                       /* needed for writepage */
-                       pCifsFile->pfile = file;
-                       file->private_data = pCifsFile;
-                       break;
-               }
-       }
-       read_unlock(&GlobalSMBSeslock);
-
-       if (file->private_data != NULL) {
-               return pCifsFile;
-       } else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))
-                       cERROR(1, "could not find file instance for "
-                                  "new file %p", file);
-       return NULL;
-}
-
 /* all arguments to this function must be checked for validity in caller */
-static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
-       struct cifsInodeInfo *pCifsInode, struct cifsFileInfo *pCifsFile,
+static inline int cifs_open_inode_helper(struct inode *inode,
        struct cifsTconInfo *pTcon, int *oplock, FILE_ALL_INFO *buf,
        char *full_path, int xid)
 {
+       struct cifsInodeInfo *pCifsInode = CIFS_I(inode);
        struct timespec temp;
        int rc;
 
@@ -213,36 +181,35 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
        /* if not oplocked, invalidate inode pages if mtime or file
           size changed */
        temp = cifs_NTtimeToUnix(buf->LastWriteTime);
-       if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) &&
-                          (file->f_path.dentry->d_inode->i_size ==
+       if (timespec_equal(&inode->i_mtime, &temp) &&
+                          (inode->i_size ==
                            (loff_t)le64_to_cpu(buf->EndOfFile))) {
                cFYI(1, "inode unchanged on server");
        } else {
-               if (file->f_path.dentry->d_inode->i_mapping) {
+               if (inode->i_mapping) {
                        /* BB no need to lock inode until after invalidate
                        since namei code should already have it locked? */
-                       rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping);
+                       rc = filemap_write_and_wait(inode->i_mapping);
                        if (rc != 0)
-                               CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc;
+                               pCifsInode->write_behind_rc = rc;
                }
                cFYI(1, "invalidating remote inode since open detected it "
                         "changed");
-               invalidate_remote_inode(file->f_path.dentry->d_inode);
+               invalidate_remote_inode(inode);
        }
 
 client_can_cache:
        if (pTcon->unix_ext)
-               rc = cifs_get_inode_info_unix(&file->f_path.dentry->d_inode,
-                       full_path, inode->i_sb, xid);
+               rc = cifs_get_inode_info_unix(&inode, full_path, inode->i_sb,
+                                             xid);
        else
-               rc = cifs_get_inode_info(&file->f_path.dentry->d_inode,
-                       full_path, buf, inode->i_sb, xid, NULL);
+               rc = cifs_get_inode_info(&inode, full_path, buf, inode->i_sb,
+                                        xid, NULL);
 
        if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
                pCifsInode->clientCanCacheAll = true;
                pCifsInode->clientCanCacheRead = true;
-               cFYI(1, "Exclusive Oplock granted on inode %p",
-                        file->f_path.dentry->d_inode);
+               cFYI(1, "Exclusive Oplock granted on inode %p", inode);
        } else if ((*oplock & 0xF) == OPLOCK_READ)
                pCifsInode->clientCanCacheRead = true;
 
@@ -256,7 +223,7 @@ int cifs_open(struct inode *inode, struct file *file)
        __u32 oplock;
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *tcon;
-       struct cifsFileInfo *pCifsFile;
+       struct cifsFileInfo *pCifsFile = NULL;
        struct cifsInodeInfo *pCifsInode;
        char *full_path = NULL;
        int desiredAccess;
@@ -270,12 +237,6 @@ int cifs_open(struct inode *inode, struct file *file)
        tcon = cifs_sb->tcon;
 
        pCifsInode = CIFS_I(file->f_path.dentry->d_inode);
-       pCifsFile = cifs_fill_filedata(file);
-       if (pCifsFile) {
-               rc = 0;
-               FreeXid(xid);
-               return rc;
-       }
 
        full_path = build_path_from_dentry(file->f_path.dentry);
        if (full_path == NULL) {
@@ -299,8 +260,7 @@ int cifs_open(struct inode *inode, struct file *file)
                int oflags = (int) cifs_posix_convert_flags(file->f_flags);
                oflags |= SMB_O_CREAT;
                /* can not refresh inode info since size could be stale */
-               rc = cifs_posix_open(full_path, &inode, file->f_path.mnt,
-                               inode->i_sb,
+               rc = cifs_posix_open(full_path, &inode, inode->i_sb,
                                cifs_sb->mnt_file_mode /* ignored */,
                                oflags, &oplock, &netfid, xid);
                if (rc == 0) {
@@ -308,9 +268,20 @@ int cifs_open(struct inode *inode, struct file *file)
                        /* no need for special case handling of setting mode
                           on read only files needed here */
 
-                       pCifsFile = cifs_fill_filedata(file);
-                       cifs_posix_open_inode_helper(inode, file, pCifsInode,
-                                                    oplock, netfid);
+                       rc = cifs_posix_open_inode_helper(inode, file,
+                                       pCifsInode, oplock, netfid);
+                       if (rc != 0) {
+                               CIFSSMBClose(xid, tcon, netfid);
+                               goto out;
+                       }
+
+                       pCifsFile = cifs_new_fileinfo(inode, netfid, file,
+                                                       file->f_path.mnt,
+                                                       oflags);
+                       if (pCifsFile == NULL) {
+                               CIFSSMBClose(xid, tcon, netfid);
+                               rc = -ENOMEM;
+                       }
                        goto out;
                } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
                        if (tcon->ses->serverNOS)
@@ -391,17 +362,17 @@ int cifs_open(struct inode *inode, struct file *file)
                goto out;
        }
 
+       rc = cifs_open_inode_helper(inode, tcon, &oplock, buf, full_path, xid);
+       if (rc != 0)
+               goto out;
+
        pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt,
                                        file->f_flags);
-       file->private_data = pCifsFile;
-       if (file->private_data == NULL) {
+       if (pCifsFile == NULL) {
                rc = -ENOMEM;
                goto out;
        }
 
-       rc = cifs_open_inode_helper(inode, file, pCifsInode, pCifsFile, tcon,
-                                   &oplock, buf, full_path, xid);
-
        if (oplock & CIFS_CREATE_ACTION) {
                /* time to set mode which we can not set earlier due to
                   problems creating new read-only files */
@@ -513,8 +484,7 @@ reopen_error_exit:
                        le64_to_cpu(tcon->fsUnixInfo.Capability))) {
                int oflags = (int) cifs_posix_convert_flags(file->f_flags);
                /* can not refresh inode info since size could be stale */
-               rc = cifs_posix_open(full_path, NULL, file->f_path.mnt,
-                               inode->i_sb,
+               rc = cifs_posix_open(full_path, NULL, inode->i_sb,
                                cifs_sb->mnt_file_mode /* ignored */,
                                oflags, &oplock, &netfid, xid);
                if (rc == 0) {
index 62b324f26a565b112b59d6cdd7f688dbf735e715..6f0683c689523894cb6fae3edd79181876084d42 100644 (file)
@@ -1401,6 +1401,10 @@ cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath,
        if (rc == 0 || rc != -ETXTBSY)
                return rc;
 
+       /* open-file renames don't work across directories */
+       if (to_dentry->d_parent != from_dentry->d_parent)
+               return rc;
+
        /* open the file to be renamed -- we need DELETE perms */
        rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE,
                         CREATE_NOT_DIR, &srcfid, &oplock, NULL,
index 7707389bdf2c21643e5ad979e44a24ac59057f30..0a57cb7db5dd7554030e599cd111379e343083df 100644 (file)
@@ -730,15 +730,7 @@ ssetup_ntlmssp_authenticate:
 
                /* calculate session key */
                setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp);
-               if (first_time) /* should this be moved into common code
-                                  with similar ntlmv2 path? */
-               /*   cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key,
-                               response BB FIXME, v2_sess_key); */
-
-               /* copy session key */
-
-       /*      memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
-               bcc_ptr += LM2_SESS_KEY_SIZE; */
+               /* FIXME: calculate MAC key */
                memcpy(bcc_ptr, (char *)v2_sess_key,
                       sizeof(struct ntlmv2_resp));
                bcc_ptr += sizeof(struct ntlmv2_resp);
index a33aab6b5e683cf988932fdd9f732f5381751541..54a92fd02bbd63b2d75543f59bd816b4d738e2e4 100644 (file)
@@ -234,8 +234,9 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
                        if (inode->i_mode != mode) {
                                struct iattr attr;
 
-                               attr.ia_valid = ATTR_MODE;
+                               attr.ia_valid = ATTR_MODE | ATTR_CTIME;
                                attr.ia_mode = mode;
+                               attr.ia_ctime = CURRENT_TIME_SEC;
                                rc = jffs2_do_setattr(inode, &attr);
                                if (rc < 0)
                                        return rc;
index 7aa4417e085f2870acd84598c2a5bd0c3654b20c..166062a682304be3361b93ffe5efffa3456fdc96 100644 (file)
@@ -222,15 +222,18 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode,
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime));
 
        jffs2_free_raw_inode(ri);
-       d_instantiate(dentry, inode);
 
        D1(printk(KERN_DEBUG "jffs2_create: Created ino #%lu with mode %o, nlink %d(%d). nrpages %ld\n",
                  inode->i_ino, inode->i_mode, inode->i_nlink,
                  f->inocache->pino_nlink, inode->i_mapping->nrpages));
+
+       d_instantiate(dentry, inode);
+       unlock_new_inode(inode);
        return 0;
 
  fail:
        make_bad_inode(inode);
+       unlock_new_inode(inode);
        iput(inode);
        jffs2_free_raw_inode(ri);
        return ret;
@@ -360,8 +363,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
                /* Eeek. Wave bye bye */
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fn);
+               ret = PTR_ERR(fn);
+               goto fail;
        }
 
        /* We use f->target field to store the target path. */
@@ -370,8 +373,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
                printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1);
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        memcpy(f->target, target, targetlen + 1);
@@ -386,30 +389,24 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
        jffs2_complete_reservation(c);
 
        ret = jffs2_init_security(inode, dir_i);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
+
        ret = jffs2_init_acl_post(inode);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
                                  ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
-       if (ret) {
-               /* Eep. */
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        rd = jffs2_alloc_raw_dirent();
        if (!rd) {
                /* Argh. Now we treat it like a normal delete */
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        dir_f = JFFS2_INODE_INFO(dir_i);
@@ -437,8 +434,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
                jffs2_complete_reservation(c);
                jffs2_free_raw_dirent(rd);
                mutex_unlock(&dir_f->sem);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fd);
+               ret = PTR_ERR(fd);
+               goto fail;
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
@@ -453,7 +450,14 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
        jffs2_complete_reservation(c);
 
        d_instantiate(dentry, inode);
+       unlock_new_inode(inode);
        return 0;
+
+ fail:
+       make_bad_inode(inode);
+       unlock_new_inode(inode);
+       iput(inode);
+       return ret;
 }
 
 
@@ -519,8 +523,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
                /* Eeek. Wave bye bye */
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fn);
+               ret = PTR_ERR(fn);
+               goto fail;
        }
        /* No data here. Only a metadata node, which will be
           obsoleted by the first data write
@@ -531,30 +535,24 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
        jffs2_complete_reservation(c);
 
        ret = jffs2_init_security(inode, dir_i);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
+
        ret = jffs2_init_acl_post(inode);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
                                  ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
-       if (ret) {
-               /* Eep. */
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        rd = jffs2_alloc_raw_dirent();
        if (!rd) {
                /* Argh. Now we treat it like a normal delete */
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        dir_f = JFFS2_INODE_INFO(dir_i);
@@ -582,8 +580,8 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
                jffs2_complete_reservation(c);
                jffs2_free_raw_dirent(rd);
                mutex_unlock(&dir_f->sem);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fd);
+               ret = PTR_ERR(fd);
+               goto fail;
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
@@ -599,7 +597,14 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
        jffs2_complete_reservation(c);
 
        d_instantiate(dentry, inode);
+       unlock_new_inode(inode);
        return 0;
+
+ fail:
+       make_bad_inode(inode);
+       unlock_new_inode(inode);
+       iput(inode);
+       return ret;
 }
 
 static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
@@ -693,8 +698,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
                /* Eeek. Wave bye bye */
                mutex_unlock(&f->sem);
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fn);
+               ret = PTR_ERR(fn);
+               goto fail;
        }
        /* No data here. Only a metadata node, which will be
           obsoleted by the first data write
@@ -705,30 +710,24 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
        jffs2_complete_reservation(c);
 
        ret = jffs2_init_security(inode, dir_i);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
+
        ret = jffs2_init_acl_post(inode);
-       if (ret) {
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &alloclen,
                                  ALLOC_NORMAL, JFFS2_SUMMARY_DIRENT_SIZE(namelen));
-       if (ret) {
-               /* Eep. */
-               jffs2_clear_inode(inode);
-               return ret;
-       }
+       if (ret)
+               goto fail;
 
        rd = jffs2_alloc_raw_dirent();
        if (!rd) {
                /* Argh. Now we treat it like a normal delete */
                jffs2_complete_reservation(c);
-               jffs2_clear_inode(inode);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
        dir_f = JFFS2_INODE_INFO(dir_i);
@@ -759,8 +758,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
                jffs2_complete_reservation(c);
                jffs2_free_raw_dirent(rd);
                mutex_unlock(&dir_f->sem);
-               jffs2_clear_inode(inode);
-               return PTR_ERR(fd);
+               ret = PTR_ERR(fd);
+               goto fail;
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
@@ -775,8 +774,14 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de
        jffs2_complete_reservation(c);
 
        d_instantiate(dentry, inode);
-
+       unlock_new_inode(inode);
        return 0;
+
+ fail:
+       make_bad_inode(inode);
+       unlock_new_inode(inode);
+       iput(inode);
+       return ret;
 }
 
 static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
index 8bc2c80ab159592dbcf8f43050566ac64de009b0..459d39d1ea0be8ad487903321a8e77fba82d30c6 100644 (file)
@@ -465,7 +465,12 @@ struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_i
        inode->i_blocks = 0;
        inode->i_size = 0;
 
-       insert_inode_hash(inode);
+       if (insert_inode_locked(inode) < 0) {
+               make_bad_inode(inode);
+               unlock_new_inode(inode);
+               iput(inode);
+               return ERR_PTR(-EINVAL);
+       }
 
        return inode;
 }
index 12f7109720c235cc92cd2464621f7cbff893848e..4a2734758778117a92a16163644a11606cb7d602 100644 (file)
@@ -4122,8 +4122,8 @@ nfs4_state_shutdown(void)
        nfs4_lock_state();
        nfs4_release_reclaim();
        __nfs4_state_shutdown();
-       nfsd4_destroy_callback_queue();
        nfs4_unlock_state();
+       nfsd4_destroy_callback_queue();
 }
 
 /*
index ebbf3b6b24577128c3182072d34933770d56e644..3c111120b619ff20c7b74a81e081801d4965b08e 100644 (file)
@@ -443,8 +443,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
        if (size_change)
                put_write_access(inode);
        if (!err)
-               if (EX_ISSYNC(fhp->fh_export))
-                       write_inode_now(inode, 1);
+               commit_metadata(fhp);
 out:
        return err;
 
index 69c4c7c13ea910db965d68a1c892a91791303119..279eef96c51cdf28a81d4f0c3d0d702a71dc5a1c 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1145,13 +1145,20 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
         * and adjust the indexes.
         */
        if (pipe->nrbufs) {
-               const unsigned int tail = pipe->nrbufs & (pipe->buffers - 1);
-               const unsigned int head = pipe->nrbufs - tail;
+               unsigned int tail;
+               unsigned int head;
 
+               tail = pipe->curbuf + pipe->nrbufs;
+               if (tail < pipe->buffers)
+                       tail = 0;
+               else
+                       tail &= (pipe->buffers - 1);
+
+               head = pipe->nrbufs - tail;
                if (head)
                        memcpy(bufs, pipe->bufs + pipe->curbuf, head * sizeof(struct pipe_buffer));
                if (tail)
-                       memcpy(bufs + head, pipe->bufs + pipe->curbuf, tail * sizeof(struct pipe_buffer));
+                       memcpy(bufs + head, pipe->bufs, tail * sizeof(struct pipe_buffer));
        }
 
        pipe->curbuf = 0;
@@ -1208,12 +1215,13 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
                size = round_pipe_size(arg);
                nr_pages = size >> PAGE_SHIFT;
 
+               ret = -EINVAL;
+               if (!nr_pages)
+                       goto out;
+
                if (!capable(CAP_SYS_RESOURCE) && size > pipe_max_size) {
                        ret = -EPERM;
                        goto out;
-               } else if (nr_pages < PAGE_SIZE) {
-                       ret = -EINVAL;
-                       goto out;
                }
                ret = pipe_set_size(pipe, nr_pages);
                break;
index ce94801f48cafefce01dcc37da6f0037b77de3e5..d9396a4fc7ff2dc209269e70fe7170d07eb1f5bb 100644 (file)
@@ -209,6 +209,9 @@ void proc_device_tree_add_node(struct device_node *np,
        for (pp = np->properties; pp != NULL; pp = pp->next) {
                p = pp->name;
 
+               if (strchr(p, '/'))
+                       continue;
+
                if (duplicate_name(de, p))
                        p = fixup_name(np, de, p);
 
index a0fa3bf0d1bbb438c4259daf8bf7bcf9068751e8..34640d6dbdcb8e6d5879c50a3acafed0cc819708 100644 (file)
@@ -1381,14 +1381,6 @@ xfs_vm_writepage(
        if (!page_has_buffers(page))
                create_empty_buffers(page, 1 << inode->i_blkbits, 0);
 
-
-       /*
-        *  VM calculation for nr_to_write seems off.  Bump it way
-        *  up, this gets simple streaming writes zippy again.
-        *  To be reviewed again after Jens' writeback changes.
-        */
-       wbc->nr_to_write *= 4;
-
        /*
         * Convert delayed allocate, unwritten or unmapped space
         * to real space and flush out to disk.
index 5958d7845bd5ac86397506bd54e872a262ef6135..17714beb868ef5d17f57fc25323fea915e894ffc 100644 (file)
@@ -212,7 +212,7 @@ char const *acpi_gbl_exception_names_env[] = {
        "AE_NO_GLOBAL_LOCK",
        "AE_ABORT_METHOD",
        "AE_SAME_HANDLER",
-       "AE_WAKE_ONLY_GPE",
+       "AE_NO_HANDLER",
        "AE_OWNER_ID_LIMIT"
 };
 
index 0e4ab1fe5966e09897d51b85e710f784a990c6d8..1371cc997393a83224beb5ff8809e0a22e968b67 100644 (file)
@@ -69,6 +69,7 @@ extern acpi_name acpi_gbl_trace_method_name;
 extern u32 acpi_gbl_trace_flags;
 extern u8 acpi_gbl_enable_aml_debug_object;
 extern u8 acpi_gbl_copy_dsdt_locally;
+extern u8 acpi_gbl_truncate_io_addresses;
 
 extern u32 acpi_current_gpe_count;
 extern struct acpi_table_fadt acpi_gbl_FADT;
index bade172cad47699882db544e7e057e3b35add502..d55f4a7b824db550d3ce2bfbd2c7235859eb08a4 100644 (file)
@@ -663,10 +663,11 @@ typedef u32 acpi_event_status;
 #define ACPI_GPE_MAX                    0xFF
 #define ACPI_NUM_GPE                    256
 
-/* Actions for acpi_set_gpe */
+/* Actions for acpi_set_gpe and acpi_hw_low_set_gpe */
 
 #define ACPI_GPE_ENABLE                 0
 #define ACPI_GPE_DISABLE                1
+#define ACPI_GPE_COND_ENABLE            2
 
 /* gpe_types for acpi_enable_gpe and acpi_disable_gpe */
 
index 3ff9fc071dfee1eff45bda07e5ba208af3666c46..5347063e9d5a52b6896c135af389f6fcf8425ff3 100644 (file)
@@ -903,6 +903,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_NUM_Z_PIPES        0x02
 #define RADEON_INFO_ACCEL_WORKING      0x03
 #define RADEON_INFO_CRTC_FROM_ID       0x04
+#define RADEON_INFO_ACCEL_WORKING2     0x05
 
 struct drm_radeon_info {
        uint32_t                request;
index b631c46cffd9c4fe52cf7c5bb5a5db7c88223d0a..f6c9b7dcb9fdd77ccf7410e07fb5d89960d26453 100644 (file)
@@ -3,6 +3,12 @@
 #include <linux/module.h>
 #include <linux/major.h>
 
+/*
+ *     These allocations are managed by device@lanana.org. If you use an
+ *     entry that is not in assigned your entry may well be moved and
+ *     reassigned, or set dynamic if a fixed value is not justified.
+ */
+
 #define PSMOUSE_MINOR          1
 #define MS_BUSMOUSE_MINOR      2
 #define ATIXL_BUSMOUSE_MINOR   3
@@ -30,7 +36,6 @@
 #define HPET_MINOR             228
 #define FUSE_MINOR             229
 #define KVM_MINOR              232
-#define VHOST_NET_MINOR                233
 #define BTRFS_MINOR            234
 #define AUTOFS_MINOR           235
 #define MISC_DYNAMIC_MINOR     255
index f149dd10908ba3a5d38df5a6252ef1100aa4243e..4eb467910a45a34e2638c9fddb8a92cc09b50177 100644 (file)
 #define PCI_VENDOR_ID_JMICRON          0x197B
 #define PCI_DEVICE_ID_JMICRON_JMB360   0x2360
 #define PCI_DEVICE_ID_JMICRON_JMB361   0x2361
+#define PCI_DEVICE_ID_JMICRON_JMB362   0x2362
 #define PCI_DEVICE_ID_JMICRON_JMB363   0x2363
 #define PCI_DEVICE_ID_JMICRON_JMB365   0x2365
 #define PCI_DEVICE_ID_JMICRON_JMB366   0x2366
index bf243fc54959098e49d6a77dac955aea8cf9d4b6..f89e7fd59a4c4029a5e301b30c14df0ee7ae2699 100644 (file)
@@ -380,7 +380,10 @@ struct sk_buff {
        kmemcheck_bitfield_begin(flags2);
        __u16                   queue_mapping:16;
 #ifdef CONFIG_IPV6_NDISC_NODETYPE
-       __u8                    ndisc_nodetype:2;
+       __u8                    ndisc_nodetype:2,
+                               deliver_no_wcard:1;
+#else
+       __u8                    deliver_no_wcard:1;
 #endif
        kmemcheck_bitfield_end(flags2);
 
index 5e781d824e6d1680466479bdd6d726195203c55a..bc7d6bb4cd8ed261c4d7fe9acc2c91a2fa20e543 100644 (file)
@@ -256,22 +256,22 @@ static inline int hibernate(void) { return -ENOSYS; }
 static inline bool system_entering_hibernation(void) { return false; }
 #endif /* CONFIG_HIBERNATION */
 
-#ifdef CONFIG_HIBERNATION_NVS
-extern int hibernate_nvs_register(unsigned long start, unsigned long size);
-extern int hibernate_nvs_alloc(void);
-extern void hibernate_nvs_free(void);
-extern void hibernate_nvs_save(void);
-extern void hibernate_nvs_restore(void);
-#else /* CONFIG_HIBERNATION_NVS */
-static inline int hibernate_nvs_register(unsigned long a, unsigned long b)
+#ifdef CONFIG_SUSPEND_NVS
+extern int suspend_nvs_register(unsigned long start, unsigned long size);
+extern int suspend_nvs_alloc(void);
+extern void suspend_nvs_free(void);
+extern void suspend_nvs_save(void);
+extern void suspend_nvs_restore(void);
+#else /* CONFIG_SUSPEND_NVS */
+static inline int suspend_nvs_register(unsigned long a, unsigned long b)
 {
        return 0;
 }
-static inline int hibernate_nvs_alloc(void) { return 0; }
-static inline void hibernate_nvs_free(void) {}
-static inline void hibernate_nvs_save(void) {}
-static inline void hibernate_nvs_restore(void) {}
-#endif /* CONFIG_HIBERNATION_NVS */
+static inline int suspend_nvs_alloc(void) { return 0; }
+static inline void suspend_nvs_free(void) {}
+static inline void suspend_nvs_save(void) {}
+static inline void suspend_nvs_restore(void) {}
+#endif /* CONFIG_SUSPEND_NVS */
 
 #ifdef CONFIG_PM_SLEEP
 void save_processor_state(void);
index f64134653a8c782caf9211c88a784d818b4c1e5b..d63ef8f9609fde16ee9bbbcfea4d9c30818c0dd6 100644 (file)
@@ -56,15 +56,6 @@ struct writeback_control {
        unsigned for_reclaim:1;         /* Invoked from the page allocator */
        unsigned range_cyclic:1;        /* range_start is cyclic */
        unsigned more_io:1;             /* more io to be dispatched */
-       /*
-        * write_cache_pages() won't update wbc->nr_to_write and
-        * mapping->writeback_index if no_nrwrite_index_update
-        * is set.  write_cache_pages() may write more than we
-        * requested and we want to make sure nr_to_write and
-        * writeback_index are updated in a consistent manner
-        * so we use a single control to update them
-        */
-       unsigned no_nrwrite_index_update:1;
 };
 
 /*
index f5b1ba90e952f71535d13b8c0a7d9a68782d5a07..f3865c7b4166e315da77d9c342b977b9d4338915 100644 (file)
@@ -306,7 +306,6 @@ TRACE_EVENT(ext4_da_writepages_result,
                __field(        int,    pages_written           )
                __field(        long,   pages_skipped           )
                __field(        char,   more_io                 )       
-               __field(        char,   no_nrwrite_index_update )
                __field(       pgoff_t, writeback_index         )
        ),
 
@@ -317,16 +316,14 @@ TRACE_EVENT(ext4_da_writepages_result,
                __entry->pages_written  = pages_written;
                __entry->pages_skipped  = wbc->pages_skipped;
                __entry->more_io        = wbc->more_io;
-               __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
                __entry->writeback_index = inode->i_mapping->writeback_index;
        ),
 
-       TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d no_nrwrite_index_update %d writeback_index %lu",
+       TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
                  jbd2_dev_to_name(__entry->dev),
                  (unsigned long) __entry->ino, __entry->ret,
                  __entry->pages_written, __entry->pages_skipped,
                  __entry->more_io,
-                 __entry->no_nrwrite_index_update,
                  (unsigned long) __entry->writeback_index)
 );
 
index 814566c99d29eaf53b0410375c5306c1f6997c58..17df43464df0828e91114e2ffc9dbf9076d6d949 100644 (file)
@@ -10,7 +10,8 @@
 
 #define TP_STORE_SIGINFO(__entry, info)                                \
        do {                                                    \
-               if (info == SEND_SIG_NOINFO) {                  \
+               if (info == SEND_SIG_NOINFO ||                  \
+                   info == SEND_SIG_FORCED) {                  \
                        __entry->errno  = 0;                    \
                        __entry->code   = SI_USER;              \
                } else if (info == SEND_SIG_PRIV) {             \
index 3bdb152f412f32b8edeeb1036a24f934988b5be2..ac2e4a5f59ee7088acfe5621d0c1ba6bbc7c0f22 100644 (file)
@@ -125,7 +125,9 @@ static char *ramdisk_execute_command;
 
 #ifdef CONFIG_SMP
 /* Setup configured maximum number of CPUs to activate */
-unsigned int __initdata setup_max_cpus = NR_CPUS;
+unsigned int setup_max_cpus = NR_CPUS;
+EXPORT_SYMBOL(setup_max_cpus);
+
 
 /*
  * Setup routine for controlling SMP activation
index 31d6afe9259412025f02e20bddcc37fa3bf4d62b..ff86c558af4c28dd4c9a7ea92cc592b70bee6d7d 100644 (file)
@@ -1507,6 +1507,9 @@ do {                                      \
                divisor = nsec * frequency;
        }
 
+       if (!divisor)
+               return dividend;
+
        return div64_u64(dividend, divisor);
 }
 
@@ -1529,7 +1532,7 @@ static int perf_event_start(struct perf_event *event)
 static void perf_adjust_period(struct perf_event *event, u64 nsec, u64 count)
 {
        struct hw_perf_event *hwc = &event->hw;
-       u64 period, sample_period;
+       s64 period, sample_period;
        s64 delta;
 
        period = perf_calculate_period(event, nsec, count);
index 5c36ea9d55d22ccf5a27d542b262968a13489d57..ca6066a6952e792421c8aff49b57afec5ae2415b 100644 (file)
@@ -99,9 +99,13 @@ config PM_SLEEP_ADVANCED_DEBUG
        depends on PM_ADVANCED_DEBUG
        default n
 
+config SUSPEND_NVS
+       bool
+
 config SUSPEND
        bool "Suspend to RAM and standby"
        depends on PM && ARCH_SUSPEND_POSSIBLE
+       select SUSPEND_NVS if HAS_IOMEM
        default y
        ---help---
          Allow the system to enter sleep states in which main memory is
@@ -130,13 +134,10 @@ config SUSPEND_FREEZER
 
          Turning OFF this setting is NOT recommended! If in doubt, say Y.
 
-config HIBERNATION_NVS
-       bool
-
 config HIBERNATION
        bool "Hibernation (aka 'suspend to disk')"
        depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
-       select HIBERNATION_NVS if HAS_IOMEM
+       select SUSPEND_NVS if HAS_IOMEM
        ---help---
          Enable the suspend to disk (STD) functionality, which is usually
          called "hibernation" in user interfaces.  STD checkpoints the
index 524e058dcf060b4f1acb845a71206082ad80f1a3..f9063c6b185d2917124f06350753ad96e0b184d1 100644 (file)
@@ -10,6 +10,6 @@ obj-$(CONFIG_SUSPEND)         += suspend.o
 obj-$(CONFIG_PM_TEST_SUSPEND)  += suspend_test.o
 obj-$(CONFIG_HIBERNATION)      += hibernate.o snapshot.o swap.o user.o \
                                   block_io.o
-obj-$(CONFIG_HIBERNATION_NVS)  += hibernate_nvs.o
+obj-$(CONFIG_SUSPEND_NVS)      += nvs.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)      += poweroff.o
similarity index 80%
rename from kernel/power/hibernate_nvs.c
rename to kernel/power/nvs.c
index fdcad9ed5a7b00bc0de3ca4a54b1cdd0b6759a1b..1836db60bbb6d56c2ba06f6a0b01b35bc2183fa2 100644 (file)
@@ -15,7 +15,7 @@
 
 /*
  * Platforms, like ACPI, may want us to save some memory used by them during
- * hibernation and to restore the contents of this memory during the subsequent
+ * suspend and to restore the contents of this memory during the subsequent
  * resume.  The code below implements a mechanism allowing us to do that.
  */
 
@@ -30,7 +30,7 @@ struct nvs_page {
 static LIST_HEAD(nvs_list);
 
 /**
- *     hibernate_nvs_register - register platform NVS memory region to save
+ *     suspend_nvs_register - register platform NVS memory region to save
  *     @start - physical address of the region
  *     @size - size of the region
  *
@@ -38,7 +38,7 @@ static LIST_HEAD(nvs_list);
  *     things so that the data from page-aligned addresses in this region will
  *     be copied into separate RAM pages.
  */
-int hibernate_nvs_register(unsigned long start, unsigned long size)
+int suspend_nvs_register(unsigned long start, unsigned long size)
 {
        struct nvs_page *entry, *next;
 
@@ -68,9 +68,9 @@ int hibernate_nvs_register(unsigned long start, unsigned long size)
 }
 
 /**
- *     hibernate_nvs_free - free data pages allocated for saving NVS regions
+ *     suspend_nvs_free - free data pages allocated for saving NVS regions
  */
-void hibernate_nvs_free(void)
+void suspend_nvs_free(void)
 {
        struct nvs_page *entry;
 
@@ -86,16 +86,16 @@ void hibernate_nvs_free(void)
 }
 
 /**
- *     hibernate_nvs_alloc - allocate memory necessary for saving NVS regions
+ *     suspend_nvs_alloc - allocate memory necessary for saving NVS regions
  */
-int hibernate_nvs_alloc(void)
+int suspend_nvs_alloc(void)
 {
        struct nvs_page *entry;
 
        list_for_each_entry(entry, &nvs_list, node) {
                entry->data = (void *)__get_free_page(GFP_KERNEL);
                if (!entry->data) {
-                       hibernate_nvs_free();
+                       suspend_nvs_free();
                        return -ENOMEM;
                }
        }
@@ -103,9 +103,9 @@ int hibernate_nvs_alloc(void)
 }
 
 /**
- *     hibernate_nvs_save - save NVS memory regions
+ *     suspend_nvs_save - save NVS memory regions
  */
-void hibernate_nvs_save(void)
+void suspend_nvs_save(void)
 {
        struct nvs_page *entry;
 
@@ -119,12 +119,12 @@ void hibernate_nvs_save(void)
 }
 
 /**
- *     hibernate_nvs_restore - restore NVS memory regions
+ *     suspend_nvs_restore - restore NVS memory regions
  *
  *     This function is going to be called with interrupts disabled, so it
  *     cannot iounmap the virtual addresses used to access the NVS region.
  */
-void hibernate_nvs_restore(void)
+void suspend_nvs_restore(void)
 {
        struct nvs_page *entry;
 
index 56e7dbb8b996db295b4fc7cdf1b5f11a0409cb0c..f37cb7dd44025ebbe6bcee2f9fc62ef5aeb8974f 100644 (file)
 #include <linux/cpu.h>
 #include <linux/syscalls.h>
 #include <linux/gfp.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/suspend.h>
 
 #include "power.h"
 
index 5fa63bdf52e491990dd89f0ec4348fb0b0d0ca00..bbd396ac9546f5b0625c34facbc0b6d33fe2163a 100644 (file)
@@ -835,7 +835,6 @@ int write_cache_pages(struct address_space *mapping,
        pgoff_t done_index;
        int cycled;
        int range_whole = 0;
-       long nr_to_write = wbc->nr_to_write;
 
        pagevec_init(&pvec, 0);
        if (wbc->range_cyclic) {
@@ -852,7 +851,22 @@ int write_cache_pages(struct address_space *mapping,
                if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
                        range_whole = 1;
                cycled = 1; /* ignore range_cyclic tests */
+
+               /*
+                * If this is a data integrity sync, cap the writeback to the
+                * current end of file. Any extension to the file that occurs
+                * after this is a new write and we don't need to write those
+                * pages out to fulfil our data integrity requirements. If we
+                * try to write them out, we can get stuck in this scan until
+                * the concurrent writer stops adding dirty pages and extending
+                * EOF.
+                */
+               if (wbc->sync_mode == WB_SYNC_ALL &&
+                   wbc->range_end == LLONG_MAX) {
+                       end = i_size_read(mapping->host) >> PAGE_CACHE_SHIFT;
+               }
        }
+
 retry:
        done_index = index;
        while (!done && (index <= end)) {
@@ -935,11 +949,10 @@ continue_unlock:
                                        done = 1;
                                        break;
                                }
-                       }
+                       }
 
-                       if (nr_to_write > 0) {
-                               nr_to_write--;
-                               if (nr_to_write == 0 &&
+                       if (wbc->nr_to_write > 0) {
+                               if (--wbc->nr_to_write == 0 &&
                                    wbc->sync_mode == WB_SYNC_NONE) {
                                        /*
                                         * We stop writing back only if we are
@@ -970,11 +983,8 @@ continue_unlock:
                end = writeback_index - 1;
                goto retry;
        }
-       if (!wbc->no_nrwrite_index_update) {
-               if (wbc->range_cyclic || (range_whole && nr_to_write > 0))
-                       mapping->writeback_index = done_index;
-               wbc->nr_to_write = nr_to_write;
-       }
+       if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
+               mapping->writeback_index = done_index;
 
        return ret;
 }
index bd537fc10254c9fbb6cf3872e8488bba1809781b..50f58f5f1c3491f775a5ac6c97ea32c5c5b23674 100644 (file)
@@ -12,7 +12,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
                return NET_RX_DROP;
 
        if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master)))
-               goto drop;
+               skb->deliver_no_wcard = 1;
 
        skb->skb_iif = skb->dev->ifindex;
        __vlan_hwaccel_put_tag(skb, vlan_tci);
@@ -84,7 +84,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
        struct sk_buff *p;
 
        if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master)))
-               goto drop;
+               skb->deliver_no_wcard = 1;
 
        skb->skb_iif = skb->dev->ifindex;
        __vlan_hwaccel_put_tag(skb, vlan_tci);
index cd2830fec9351322156e941c9d7043418ea549a4..fd27b172fb5d444ffdf5664312f0b0c86b4836cd 100644 (file)
@@ -83,7 +83,7 @@ static int cfrfml_transmit(struct cflayer *layr, struct cfpkt *pkt)
        if (!cfsrvl_ready(service, &ret))
                return ret;
 
-       if (!cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) {
+       if (cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) {
                pr_err("CAIF: %s():Packet too large - size=%d\n",
                        __func__, cfpkt_getlen(pkt));
                return -EOVERFLOW;
index 0fd827f494919caa44926264baa885ea409df776..e04f7d964e83ea8d0c88308bb0fcd2e3dd9dfbd6 100644 (file)
@@ -84,7 +84,7 @@ static int cfvei_transmit(struct cflayer *layr, struct cfpkt *pkt)
                return ret;
        caif_assert(layr->dn != NULL);
        caif_assert(layr->dn->transmit != NULL);
-       if (!cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) {
+       if (cfpkt_getlen(pkt) > CAIF_MAX_PAYLOAD_SIZE) {
                pr_warning("CAIF: %s(): Packet too large - size=%d\n",
                           __func__, cfpkt_getlen(pkt));
                return -EOVERFLOW;
index d03470f5260ae530f9945b50a6a1722466d07d60..2b3bf53bc687aab3c9cfb32cce902eaebb3c18da 100644 (file)
@@ -2253,11 +2253,9 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
        if (skb_rx_queue_recorded(skb)) {
                u16 index = skb_get_rx_queue(skb);
                if (unlikely(index >= dev->num_rx_queues)) {
-                       if (net_ratelimit()) {
-                               pr_warning("%s received packet on queue "
-                                       "%u, but number of RX queues is %u\n",
-                                       dev->name, index, dev->num_rx_queues);
-                       }
+                       WARN_ONCE(dev->num_rx_queues > 1, "%s received packet "
+                               "on queue %u, but number of RX queues is %u\n",
+                               dev->name, index, dev->num_rx_queues);
                        goto done;
                }
                rxqueue = dev->_rx + index;
@@ -2812,13 +2810,24 @@ static int __netif_receive_skb(struct sk_buff *skb)
        if (!skb->skb_iif)
                skb->skb_iif = skb->dev->ifindex;
 
+       /*
+        * bonding note: skbs received on inactive slaves should only
+        * be delivered to pkt handlers that are exact matches.  Also
+        * the deliver_no_wcard flag will be set.  If packet handlers
+        * are sensitive to duplicate packets these skbs will need to
+        * be dropped at the handler.  The vlan accel path may have
+        * already set the deliver_no_wcard flag.
+        */
        null_or_orig = NULL;
        orig_dev = skb->dev;
        master = ACCESS_ONCE(orig_dev->master);
-       if (master) {
-               if (skb_bond_should_drop(skb, master))
+       if (skb->deliver_no_wcard)
+               null_or_orig = orig_dev;
+       else if (master) {
+               if (skb_bond_should_drop(skb, master)) {
+                       skb->deliver_no_wcard = 1;
                        null_or_orig = orig_dev; /* deliver only exact match */
-               else
+               else
                        skb->dev = master;
        }
 
index cf8e70392fe0938acb4b8b88fa8bc74dbeaed584..785e5276a300e6f14c634e785eb1be8e0633c18e 100644 (file)
@@ -107,6 +107,7 @@ static DEFINE_RWLOCK(est_lock);
 
 /* Protects against soft lockup during large deletion */
 static struct rb_root est_root = RB_ROOT;
+static DEFINE_SPINLOCK(est_tree_lock);
 
 static void est_timer(unsigned long arg)
 {
@@ -201,7 +202,6 @@ struct gen_estimator *gen_find_node(const struct gnet_stats_basic_packed *bstats
  *
  * Returns 0 on success or a negative error code.
  *
- * NOTE: Called under rtnl_mutex
  */
 int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
                      struct gnet_stats_rate_est *rate_est,
@@ -232,6 +232,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
        est->last_packets = bstats->packets;
        est->avpps = rate_est->pps<<10;
 
+       spin_lock(&est_tree_lock);
        if (!elist[idx].timer.function) {
                INIT_LIST_HEAD(&elist[idx].list);
                setup_timer(&elist[idx].timer, est_timer, idx);
@@ -242,6 +243,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
 
        list_add_rcu(&est->list, &elist[idx].list);
        gen_add_node(est);
+       spin_unlock(&est_tree_lock);
 
        return 0;
 }
@@ -261,13 +263,13 @@ static void __gen_kill_estimator(struct rcu_head *head)
  *
  * Removes the rate estimator specified by &bstats and &rate_est.
  *
- * NOTE: Called under rtnl_mutex
  */
 void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
                        struct gnet_stats_rate_est *rate_est)
 {
        struct gen_estimator *e;
 
+       spin_lock(&est_tree_lock);
        while ((e = gen_find_node(bstats, rate_est))) {
                rb_erase(&e->node, &est_root);
 
@@ -278,6 +280,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
                list_del_rcu(&e->list);
                call_rcu(&e->e_rcu, __gen_kill_estimator);
        }
+       spin_unlock(&est_tree_lock);
 }
 EXPORT_SYMBOL(gen_kill_estimator);
 
@@ -312,8 +315,14 @@ EXPORT_SYMBOL(gen_replace_estimator);
 bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats,
                          const struct gnet_stats_rate_est *rate_est)
 {
+       bool res;
+
        ASSERT_RTNL();
 
-       return gen_find_node(bstats, rate_est) != NULL;
+       spin_lock(&est_tree_lock);
+       res = gen_find_node(bstats, rate_est) != NULL;
+       spin_unlock(&est_tree_lock);
+
+       return res;
 }
 EXPORT_SYMBOL(gen_estimator_active);
index 2ad68da418df6a6d6d4ae81db9e78d4a8f6ae981..1dacd7ba8dbb1d4c2e5e6e9f623b3806e202f0ee 100644 (file)
@@ -2170,7 +2170,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
        end_time = ktime_now();
 
        pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time));
-       pkt_dev->next_tx = ktime_add_ns(end_time, pkt_dev->delay);
+       pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
 }
 
 static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)
index 856123fe32f98c97e3364a322fe9899d4b8d1359..757f25eb9b4b2404ebebc6c4422b4ad1693ea227 100644 (file)
@@ -267,8 +267,10 @@ static void __net_exit ipmr_rules_exit(struct net *net)
 {
        struct mr_table *mrt, *next;
 
-       list_for_each_entry_safe(mrt, next, &net->ipv4.mr_tables, list)
+       list_for_each_entry_safe(mrt, next, &net->ipv4.mr_tables, list) {
+               list_del(&mrt->list);
                kfree(mrt);
+       }
        fib_rules_unregister(net->ipv4.mr_rules_ops);
 }
 #else
index ce7992982557d8cc28037bbb6388ede8f0e62d46..03e62f94ff8efb35a5c865322d72e623b539eeef 100644 (file)
@@ -483,7 +483,7 @@ route_done:
                              np->tclass, NULL, &fl, (struct rt6_info*)dst,
                              MSG_DONTWAIT, np->dontfrag);
        if (err) {
-               ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS);
+               ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTERRORS);
                ip6_flush_pending_frames(sk);
                goto out_put;
        }
@@ -565,7 +565,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
                                np->dontfrag);
 
        if (err) {
-               ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS);
+               ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTERRORS);
                ip6_flush_pending_frames(sk);
                goto out_put;
        }
index 073071f2b75b500207a9c14f823d1d50f56b2aec..66078dad7fe8c353bd4de83115dc4eee73ba978f 100644 (file)
@@ -120,7 +120,7 @@ static void mroute_clean_tables(struct mr6_table *mrt);
 static void ipmr_expire_process(unsigned long arg);
 
 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
-#define ip6mr_for_each_table(mrt, met) \
+#define ip6mr_for_each_table(mrt, net) \
        list_for_each_entry_rcu(mrt, &net->ipv6.mr6_tables, list)
 
 static struct mr6_table *ip6mr_get_table(struct net *net, u32 id)
@@ -254,8 +254,10 @@ static void __net_exit ip6mr_rules_exit(struct net *net)
 {
        struct mr6_table *mrt, *next;
 
-       list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list)
+       list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) {
+               list_del(&mrt->list);
                ip6mr_free_table(mrt);
+       }
        fib_rules_unregister(net->ipv6.mr6_rules_ops);
 }
 #else
index 59f1881968c70aad15b0296cf6400c6b0b3e49cb..ab1622d7d409f0a853a956ee06db49aad930050a 100644 (file)
@@ -1356,7 +1356,10 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
                     IPV6_TLV_PADN, 0 };
 
        /* we assume size > sizeof(ra) here */
-       skb = sock_alloc_send_skb(sk, size + LL_ALLOCATED_SPACE(dev), 1, &err);
+       size += LL_ALLOCATED_SPACE(dev);
+       /* limit our allocations to order-0 page */
+       size = min_t(int, size, SKB_MAX_ORDER(0, 0));
+       skb = sock_alloc_send_skb(sk, size, 1, &err);
 
        if (!skb)
                return NULL;
index 4f2271316650d98f08de2f1c460b4b8fb283d752..9c1da0809160215c4178358f8f17be8c6d774e27 100644 (file)
@@ -349,7 +349,7 @@ static inline int drv_get_survey(struct ieee80211_local *local, int idx,
                                struct survey_info *survey)
 {
        int ret = -EOPNOTSUPP;
-       if (local->ops->conf_tx)
+       if (local->ops->get_survey)
                ret = local->ops->get_survey(&local->hw, idx, survey);
        /* trace_drv_get_survey(local, idx, survey, ret); */
        return ret;
index 0839c4e8fd2e35b2042e968a9eddebb1e49dc99e..f803f8b72a930dd58b60ae362ea1b7117f1247b2 100644 (file)
@@ -1692,14 +1692,52 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
                        rma = ieee80211_rx_mgmt_disassoc(sdata, mgmt, skb->len);
                        break;
                case IEEE80211_STYPE_ACTION:
-                       if (mgmt->u.action.category != WLAN_CATEGORY_SPECTRUM_MGMT)
+                       switch (mgmt->u.action.category) {
+                       case WLAN_CATEGORY_BACK: {
+                               struct ieee80211_local *local = sdata->local;
+                               int len = skb->len;
+                               struct sta_info *sta;
+
+                               rcu_read_lock();
+                               sta = sta_info_get(sdata, mgmt->sa);
+                               if (!sta) {
+                                       rcu_read_unlock();
+                                       break;
+                               }
+
+                               local_bh_disable();
+
+                               switch (mgmt->u.action.u.addba_req.action_code) {
+                               case WLAN_ACTION_ADDBA_REQ:
+                                       if (len < (IEEE80211_MIN_ACTION_SIZE +
+                                                  sizeof(mgmt->u.action.u.addba_req)))
+                                               break;
+                                       ieee80211_process_addba_request(local, sta, mgmt, len);
+                                       break;
+                               case WLAN_ACTION_ADDBA_RESP:
+                                       if (len < (IEEE80211_MIN_ACTION_SIZE +
+                                                  sizeof(mgmt->u.action.u.addba_resp)))
+                                               break;
+                                       ieee80211_process_addba_resp(local, sta, mgmt, len);
+                                       break;
+                               case WLAN_ACTION_DELBA:
+                                       if (len < (IEEE80211_MIN_ACTION_SIZE +
+                                                  sizeof(mgmt->u.action.u.delba)))
+                                               break;
+                                       ieee80211_process_delba(sdata, sta, mgmt, len);
+                                       break;
+                               }
+                               local_bh_enable();
+                               rcu_read_unlock();
                                break;
-
-                       ieee80211_sta_process_chanswitch(sdata,
-                                       &mgmt->u.action.u.chan_switch.sw_elem,
-                                       (void *)ifmgd->associated->priv,
-                                       rx_status->mactime);
-                       break;
+                               }
+                       case WLAN_CATEGORY_SPECTRUM_MGMT:
+                               ieee80211_sta_process_chanswitch(sdata,
+                                               &mgmt->u.action.u.chan_switch.sw_elem,
+                                               (void *)ifmgd->associated->priv,
+                                               rx_status->mactime);
+                               break;
+                       }
                }
                mutex_unlock(&ifmgd->mtx);
 
@@ -1722,9 +1760,45 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
        mutex_unlock(&ifmgd->mtx);
 
        if (skb->len >= 24 + 2 /* mgmt + deauth reason */ &&
-           (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DEAUTH)
-               cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len);
+           (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_DEAUTH) {
+               struct ieee80211_local *local = sdata->local;
+               struct ieee80211_work *wk;
+
+               mutex_lock(&local->work_mtx);
+               list_for_each_entry(wk, &local->work_list, list) {
+                       if (wk->sdata != sdata)
+                               continue;
+
+                       if (wk->type != IEEE80211_WORK_ASSOC)
+                               continue;
+
+                       if (memcmp(mgmt->bssid, wk->filter_ta, ETH_ALEN))
+                               continue;
+                       if (memcmp(mgmt->sa, wk->filter_ta, ETH_ALEN))
+                               continue;
 
+                       /*
+                        * Printing the message only here means we can't
+                        * spuriously print it, but it also means that it
+                        * won't be printed when the frame comes in before
+                        * we even tried to associate or in similar cases.
+                        *
+                        * Ultimately, I suspect cfg80211 should print the
+                        * messages instead.
+                        */
+                       printk(KERN_DEBUG
+                              "%s: deauthenticated from %pM (Reason: %u)\n",
+                              sdata->name, mgmt->bssid,
+                              le16_to_cpu(mgmt->u.deauth.reason_code));
+
+                       list_del_rcu(&wk->list);
+                       free_work(wk);
+                       break;
+               }
+               mutex_unlock(&local->work_mtx);
+
+               cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len);
+       }
  out:
        kfree_skb(skb);
 }
index 5e0b65406c44a6787c6fbc5f5720d3c0337ad5b6..be9abc2e6348943753aab8daae864b561adce82f 100644 (file)
@@ -1944,6 +1944,9 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
                if (len < IEEE80211_MIN_ACTION_SIZE + 1)
                        break;
 
+               if (sdata->vif.type == NL80211_IFTYPE_STATION)
+                       return ieee80211_sta_rx_mgmt(sdata, rx->skb);
+
                switch (mgmt->u.action.u.addba_req.action_code) {
                case WLAN_ACTION_ADDBA_REQ:
                        if (len < (IEEE80211_MIN_ACTION_SIZE +
index 102a276f6eeac9c4a1f71da4235b4e1496242659..1adb974e6950efb80943f82b1c4ca416b09b5417 100644 (file)
@@ -14,6 +14,11 @@ __modbuiltin:
 
 include scripts/Kbuild.include
 
+ifneq ($(KBUILD_SRC),)
+# Create output directory if not already present
+_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
+endif
+
 # The filename Kbuild has precedence over Makefile
 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
index 3318692e4e761ffecaf1849693e376291b5a7655..f8779006986d16a2e39341a7aa66ebf7b8825162 100644 (file)
@@ -1342,7 +1342,7 @@ static unsigned int *reloc_location(struct elf_info *elf,
        int section = sechdr->sh_info;
 
        return (void *)elf->hdr + sechdrs[section].sh_offset +
-               (r->r_offset - sechdrs[section].sh_addr);
+               r->r_offset - sechdrs[section].sh_addr;
 }
 
 static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
index 13074b4547433ab20929fa493114b507c9e4389f..6261745e44591acd65bb47e18e9f65b9e842bfe5 100644 (file)
@@ -33,7 +33,7 @@ static int key_get_type_from_user(char *type,
        ret = strncpy_from_user(type, _type, len);
 
        if (ret < 0)
-               return -EFAULT;
+               return ret;
 
        if (ret == 0 || ret >= len)
                return -EINVAL;
@@ -1080,7 +1080,7 @@ set:
        return old_setting;
 error:
        abort_creds(new);
-       return -EINVAL;
+       return ret;
 
 } /* end keyctl_set_reqkey_keyring() */
 
index 22208b373fb90fd64bd294d4f8eeb6a90ab841b1..e1ec6d91ea3829dfc1d44d4d5995d2a562d54fce 100644 (file)
@@ -73,7 +73,7 @@ struct psc_dma {
 };
 
 /* Utility for retrieving psc_dma_stream structure from a substream */
-inline struct psc_dma_stream *
+static inline struct psc_dma_stream *
 to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma)
 {
        if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE)
index 1941a357e8c4f69fddf94a9a682d2fa0ebaf7d61..d256f5f313b5a0e10ac5158dc422741f08ec6cd3 100644 (file)
@@ -328,38 +328,6 @@ static struct snd_soc_device spitz_snd_devdata = {
        .codec_dev = &soc_codec_dev_wm8750,
 };
 
-/*
- * FIXME: This is a temporary bodge to avoid cross-tree merge issues.
- * New drivers should register the wm8750 I2C device in the machine
- * setup code (under arch/arm for ARM systems).
- */
-static int wm8750_i2c_register(void)
-{
-       struct i2c_board_info info;
-       struct i2c_adapter *adapter;
-       struct i2c_client *client;
-
-       memset(&info, 0, sizeof(struct i2c_board_info));
-       info.addr = 0x1b;
-       strlcpy(info.type, "wm8750", I2C_NAME_SIZE);
-
-       adapter = i2c_get_adapter(0);
-       if (!adapter) {
-               printk(KERN_ERR "can't get i2c adapter 0\n");
-               return -ENODEV;
-       }
-
-       client = i2c_new_device(adapter, &info);
-       i2c_put_adapter(adapter);
-       if (!client) {
-               printk(KERN_ERR "can't add i2c device at 0x%x\n",
-               (unsigned int)info.addr);
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
 static struct platform_device *spitz_snd_device;
 
 static int __init spitz_init(void)
@@ -369,10 +337,6 @@ static int __init spitz_init(void)
        if (!(machine_is_spitz() || machine_is_borzoi() || machine_is_akita()))
                return -ENODEV;
 
-       ret = wm8750_i2c_setup();
-       if (ret != 0)
-               return ret;
-
        spitz_snd_device = platform_device_alloc("soc-audio", -1);
        if (!spitz_snd_device)
                return -ENOMEM;
index 7fd6b151feb52d47ba521f6ce724a10d35ea5a8f..b63e5713849f3abfa25bf8160e8b458e7adf913e 100644 (file)
@@ -1745,7 +1745,12 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
        if (symbol_conf.vmlinux_name != NULL) {
                err = dso__load_vmlinux(self, map,
                                        symbol_conf.vmlinux_name, filter);
-               goto out_try_fixup;
+               if (err > 0) {
+                       dso__set_long_name(self,
+                                          strdup(symbol_conf.vmlinux_name));
+                       goto out_fixup;
+               }
+               return err;
        }
 
        if (vmlinux_path != NULL) {
@@ -1806,7 +1811,6 @@ do_kallsyms:
                pr_debug("Using %s for symbols\n", kallsyms_filename);
        free(kallsyms_allocated_filename);
 
-out_try_fixup:
        if (err > 0) {
 out_fixup:
                if (kallsyms_filename != NULL)
index 7c79c1d76d0c13e72463fcddc00cf845ad63ca87..3500dee9cf2b24e7a6965f67d198d6e290798f9e 100644 (file)
@@ -192,12 +192,13 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
 
 int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)
 {
-       u32 old_irr = ioapic->irr;
+       u32 old_irr;
        u32 mask = 1 << irq;
        union kvm_ioapic_redirect_entry entry;
        int ret = 1;
 
        spin_lock(&ioapic->lock);
+       old_irr = ioapic->irr;
        if (irq >= 0 && irq < IOAPIC_NUM_PINS) {
                entry = ioapic->redirtbl[irq];
                level ^= entry.fields.polarity;
index d2f06be63354b1b43555f3e491bf61ce6cac8c6c..96048ee9e39e8f57d068f558cd4888961c46aa42 100644 (file)
@@ -271,7 +271,7 @@ static void kvm_iommu_put_pages(struct kvm *kvm,
                pfn  = phys >> PAGE_SHIFT;
 
                /* Unmap address from IO address space */
-               order       = iommu_unmap(domain, gfn_to_gpa(gfn), PAGE_SIZE);
+               order       = iommu_unmap(domain, gfn_to_gpa(gfn), 0);
                unmap_pages = 1ULL << order;
 
                /* Unpin all pages we just unmapped to not leak any memory */