Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Mar 2012 16:33:03 +0000 (08:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Mar 2012 16:33:03 +0000 (08:33 -0800)
Pull ARM updates from Russell King.

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
  ARM: 7358/1: perf: add PMU hotplug notifier
  ARM: 7357/1: perf: fix overflow handling for xscale2 PMUs
  ARM: 7356/1: perf: check that we have an event in the PMU IRQ handlers
  ARM: 7355/1: perf: clear overflow flag when disabling counter on ARMv7 PMU
  ARM: 7354/1: perf: limit sample_period to half max_period in non-sampling mode
  ARM: ecard: ensure fake vma vm_flags is setup
  ARM: 7346/1: errata: fix PL310 erratum #753970 workaround selection
  ARM: 7345/1: errata: update workaround for A9 erratum #743622
  ARM: 7348/1: arm/spear600: fix one-shot timer
  ARM: 7339/1: amba/serial.h: Include types.h for resolving dependency of type bool

620 files changed:
Documentation/input/alps.txt
Documentation/kernel-parameters.txt
MAINTAINERS
Makefile
arch/alpha/include/asm/futex.h
arch/arm/boot/dts/exynos4210.dtsi
arch/arm/boot/dts/tegra-paz00.dts
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/include/mach/at91sam9_smc.h
arch/arm/mach-at91/sam9_smc.c
arch/arm/mach-at91/sam9_smc.h
arch/arm/mach-dove/common.c
arch/arm/mach-ep93xx/vision_ep9307.c
arch/arm/mach-exynos/clock-exynos4210.c
arch/arm/mach-exynos/clock-exynos4212.c
arch/arm/mach-exynos/clock.c
arch/arm/mach-exynos/mach-exynos4-dt.c
arch/arm/mach-exynos/mach-nuri.c
arch/arm/mach-exynos/mach-universal_c210.c
arch/arm/mach-exynos/pm.c
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/mpp.h
arch/arm/mach-lpc32xx/include/mach/irqs.h
arch/arm/mach-lpc32xx/irq.c
arch/arm/mach-lpc32xx/serial.c
arch/arm/mach-mmp/aspenite.c
arch/arm/mach-mmp/pxa168.c
arch/arm/mach-mmp/tavorevb.c
arch/arm/mach-mv78xx0/common.c
arch/arm/mach-mv78xx0/mpp.h
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/cpuidle44xx.c
arch/arm/mach-omap2/gpmc-smsc911x.c
arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/mailbox.c
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/usb-host.c
arch/arm/mach-orion5x/common.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/mfp-pxa2xx.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/pxa95x.c
arch/arm/mach-pxa/saarb.c
arch/arm/mach-pxa/sharpsl_pm.c
arch/arm/mach-pxa/spitz_pm.c
arch/arm/mach-s3c2410/cpu-freq.c
arch/arm/mach-s3c2410/dma.c
arch/arm/mach-s3c2410/pll.c
arch/arm/mach-s3c2410/pm.c
arch/arm/mach-s3c2412/cpu-freq.c
arch/arm/mach-s3c2412/dma.c
arch/arm/mach-s3c2412/irq.c
arch/arm/mach-s3c2412/pm.c
arch/arm/mach-s3c2416/irq.c
arch/arm/mach-s3c2416/pm.c
arch/arm/mach-s3c2440/clock.c
arch/arm/mach-s3c2440/common.h
arch/arm/mach-s3c2440/dma.c
arch/arm/mach-s3c2440/irq.c
arch/arm/mach-s3c2440/mach-anubis.c
arch/arm/mach-s3c2440/mach-at2440evb.c
arch/arm/mach-s3c2440/mach-gta02.c
arch/arm/mach-s3c2440/mach-mini2440.c
arch/arm/mach-s3c2440/mach-nexcoder.c
arch/arm/mach-s3c2440/mach-osiris.c
arch/arm/mach-s3c2440/mach-rx1950.c
arch/arm/mach-s3c2440/mach-rx3715.c
arch/arm/mach-s3c2440/mach-smdk2440.c
arch/arm/mach-s3c2440/s3c2440-cpufreq.c
arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
arch/arm/mach-s3c2440/s3c2440.c
arch/arm/mach-s3c2440/s3c2442.c
arch/arm/mach-s3c2440/s3c244x-clock.c
arch/arm/mach-s3c2440/s3c244x-irq.c
arch/arm/mach-s3c2440/s3c244x.c
arch/arm/mach-s3c2443/dma.c
arch/arm/mach-s3c2443/irq.c
arch/arm/mach-s3c64xx/clock.c
arch/arm/mach-s3c64xx/common.c
arch/arm/mach-s5p64x0/pm.c
arch/arm/mach-s5pv210/clock.c
arch/arm/mach-s5pv210/pm.c
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-kota2.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/clock-sh73a0.c
arch/arm/mach-shmobile/include/mach/sh73a0.h
arch/arm/mach-shmobile/intc-sh73a0.c
arch/arm/mach-shmobile/pfc-r8a7779.c
arch/arm/mach-shmobile/pfc-sh7372.c
arch/arm/mach-shmobile/smp-sh73a0.c
arch/arm/mach-tegra/board-paz00.c
arch/arm/mach-tegra/board-paz00.h
arch/arm/mach-tegra/include/mach/dma.h
arch/arm/plat-omap/common.c
arch/arm/plat-omap/include/plat/omap-secure.h
arch/arm/plat-orion/common.c
arch/arm/plat-orion/include/plat/common.h
arch/arm/plat-orion/mpp.c
arch/arm/plat-s3c24xx/dma.c
arch/arm/plat-samsung/devs.c
arch/c6x/boot/Makefile
arch/m68k/include/asm/mcf_pgtable.h
arch/m68k/mm/mcfmmu.c
arch/m68k/platform/coldfire/entry.S
arch/mips/alchemy/common/time.c
arch/mips/ath79/dev-wmac.c
arch/mips/configs/nlm_xlp_defconfig
arch/mips/configs/nlm_xlr_defconfig
arch/mips/configs/powertv_defconfig
arch/mips/include/asm/mach-au1x00/gpio-au1300.h
arch/mips/include/asm/page.h
arch/mips/kernel/smp-bmips.c
arch/mips/kernel/traps.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/mm/fault.c
arch/mips/pci/pci.c
arch/mips/pmc-sierra/yosemite/ht-irq.c
arch/mips/txx9/generic/7segled.c
arch/openrisc/include/asm/ptrace.h
arch/openrisc/kernel/init_task.c
arch/openrisc/kernel/irq.c
arch/openrisc/kernel/ptrace.c
arch/parisc/Makefile
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/perf_event.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/signal.c
arch/powerpc/kernel/signal.h
arch/powerpc/platforms/wsp/smp.c
arch/powerpc/sysdev/fsl_pci.c
arch/s390/Kconfig
arch/s390/include/asm/compat.h
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/crash_dump.c
arch/s390/kernel/process.c
arch/s390/kernel/ptrace.c
arch/s390/kernel/setup.c
arch/s390/kernel/signal.c
arch/s390/kernel/time.c
arch/s390/mm/fault.c
arch/s390/mm/init.c
arch/s390/mm/mmap.c
arch/s390/mm/pgtable.c
arch/sh/boards/board-sh7757lcr.c
arch/sh/boards/mach-ap325rxa/setup.c
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/boards/mach-kfr2r09/setup.c
arch/sh/boards/mach-migor/setup.c
arch/sh/boards/mach-se/7724/setup.c
arch/sh/drivers/pci/pci-sh7780.c
arch/sh/include/asm/device.h
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
arch/sh/kernel/smp.c
arch/sh/kernel/topology.c
arch/sh/mm/cache-sh2a.c
arch/x86/ia32/ia32_aout.c
arch/x86/include/asm/i387.h
arch/x86/include/asm/perf_event.h
arch/x86/include/asm/processor.h
arch/x86/include/asm/thread_info.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mcheck/mce_amd.c
arch/x86/kernel/cpu/perf_event.h
arch/x86/kernel/cpu/perf_event_amd.c
arch/x86/kernel/entry_64.S
arch/x86/kernel/microcode_amd.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/kernel/traps.c
arch/x86/kernel/xsave.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/mm/hugetlbpage.c
arch/x86/pci/acpi.c
arch/x86/xen/enlighten.c
arch/x86/xen/mmu.c
block/partitions/ldm.c
crypto/sha512_generic.c
drivers/ata/pata_at91.c
drivers/atm/solos-pci.c
drivers/base/regmap/regcache.c
drivers/block/floppy.c
drivers/block/nvme.c
drivers/bluetooth/btusb.c
drivers/cpuidle/Kconfig
drivers/crypto/mv_cesa.c
drivers/edac/i3200_edac.c
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_core.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_encoder.h
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_mixer.c
drivers/gpu/drm/gma500/cdv_device.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/gtt.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/r520.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600_cs.c
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_fence.c
drivers/gpu/drm/radeon/radeon_gart.c
drivers/gpu/drm/radeon/radeon_ring.c
drivers/gpu/drm/radeon/rs400.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv515.c
drivers/gpu/drm/radeon/rv770.c
drivers/hid/hid-ids.h
drivers/hid/hid-input.c
drivers/hid/usbhid/hid-quirks.c
drivers/hwmon/ads1015.c
drivers/hwmon/f75375s.c
drivers/hwmon/max6639.c
drivers/hwmon/pmbus/max34440.c
drivers/i2c/busses/i2c-mxs.c
drivers/i2c/busses/i2c-tegra.c
drivers/ide/Makefile
drivers/ide/at91_ide.c [deleted file]
drivers/input/evdev.c
drivers/input/misc/twl4030-vibra.c
drivers/input/mouse/alps.c
drivers/input/tablet/Kconfig
drivers/input/tablet/wacom_wac.c
drivers/iommu/omap-iommu-debug.c
drivers/iommu/omap-iommu.c
drivers/macintosh/adb.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/media/radio/wl128x/Kconfig
drivers/media/rc/imon.c
drivers/media/video/hdpvr/hdpvr-core.c
drivers/media/video/hdpvr/hdpvr-video.c
drivers/media/video/hdpvr/hdpvr.h
drivers/media/video/omap3isp/ispccdc.c
drivers/mfd/ab8500-core.c
drivers/mfd/mfd-core.c
drivers/mfd/s5m-core.c
drivers/mfd/tps65910.c
drivers/mfd/tps65912-core.c
drivers/mfd/wm8350-irq.c
drivers/mfd/wm8994-core.c
drivers/mfd/wm8994-regmap.c
drivers/misc/c2port/core.c
drivers/mmc/core/core.c
drivers/mmc/core/host.c
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c
drivers/mmc/core/sdio.c
drivers/mmc/host/atmel-mci.c
drivers/mmc/host/mmci.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/net/caif/caif_hsi.c
drivers/net/can/sja1000/sja1000.c
drivers/net/ethernet/3com/3c59x.c
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
drivers/net/ethernet/broadcom/b44.c
drivers/net/ethernet/broadcom/bcm63xx_enet.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
drivers/net/ethernet/broadcom/cnic.c
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
drivers/net/ethernet/cisco/enic/cq_enet_desc.h
drivers/net/ethernet/cisco/enic/enic.h
drivers/net/ethernet/cisco/enic/enic_main.c
drivers/net/ethernet/cisco/enic/enic_pp.c
drivers/net/ethernet/freescale/fec.c
drivers/net/ethernet/jme.c
drivers/net/ethernet/jme.h
drivers/net/ethernet/mellanox/mlx4/eq.c
drivers/net/ethernet/mellanox/mlx4/fw.c
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h
drivers/net/ethernet/mellanox/mlx4/mr.c
drivers/net/ethernet/mellanox/mlx4/qp.c
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
drivers/net/ethernet/micrel/ks8851.c
drivers/net/ethernet/micrel/ks8851_mll.c
drivers/net/ethernet/octeon/octeon_mgmt.c
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c
drivers/net/ethernet/packetengines/Kconfig
drivers/net/ethernet/qlogic/qla3xxx.c
drivers/net/ethernet/realtek/r8169.c
drivers/net/ethernet/sfc/rx.c
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/enh_desc.c
drivers/net/ethernet/stmicro/stmmac/norm_desc.c
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
drivers/net/ethernet/ti/cpmac.c
drivers/net/ethernet/ti/davinci_emac.c
drivers/net/ethernet/xscale/ixp4xx_eth.c
drivers/net/phy/icplus.c
drivers/net/ppp/ppp_generic.c
drivers/net/usb/cdc_ether.c
drivers/net/usb/hso.c
drivers/net/usb/ipheth.c
drivers/net/usb/zaurus.c
drivers/net/veth.c
drivers/net/vmxnet3/vmxnet3_drv.c
drivers/net/vmxnet3/vmxnet3_int.h
drivers/net/wireless/ath/ath9k/ar5008_phy.c
drivers/net/wireless/ath/ath9k/ar9002_hw.c
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/brcm80211/brcmsmac/ampdu.c
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rtlwifi/pci.c
drivers/parisc/iommu-helpers.h
drivers/pci/iov.c
drivers/pci/probe.c
drivers/pci/remove.c
drivers/pcmcia/pxa2xx_base.c
drivers/pinctrl/core.c
drivers/platform/x86/ibm_rtl.c
drivers/platform/x86/intel_ips.c
drivers/pps/pps.c
drivers/rapidio/devices/tsi721.c
drivers/regulator/88pm8607.c
drivers/regulator/da9052-regulator.c
drivers/rtc/rtc-at91sam9.c
drivers/rtc/rtc-r9701.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/char/con3215.c
drivers/s390/char/fs3270.c
drivers/s390/char/vmcp.c
drivers/s390/cio/chsc_sch.c
drivers/s390/cio/qdio_main.c
drivers/s390/scsi/zfcp_cfdc.c
drivers/scsi/device_handler/scsi_dh_rdac.c
drivers/scsi/ipr.c
drivers/scsi/isci/host.c
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/osd/osd_uld.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_inline.h
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla4xxx/ql4_nx.c
drivers/scsi/scsi_pm.c
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_scan.c
drivers/scsi/sd_dif.c
drivers/sh/clk/cpg.c
drivers/tty/Kconfig
drivers/usb/core/hcd-pci.c
drivers/usb/core/hcd.c
drivers/usb/core/hub.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-fsl.h
drivers/usb/host/pci-quirks.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci.c
drivers/usb/serial/cp210x.c
drivers/usb/serial/option.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/ti_usb_3410_5052.h
drivers/usb/storage/usb.c
drivers/usb/storage/usb.h
drivers/video/omap2/displays/Kconfig
drivers/video/omap2/dss/apply.c
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
drivers/video/pvr2fb.c
drivers/video/via/hw.c
drivers/virtio/virtio_balloon.c
drivers/watchdog/Kconfig
drivers/watchdog/booke_wdt.c
drivers/watchdog/hpwdt.c
drivers/watchdog/pnx4008_wdt.c
drivers/watchdog/s3c2410_wdt.c
fs/aio.c
fs/autofs4/autofs_i.h
fs/autofs4/dev-ioctl.c
fs/autofs4/expire.c
fs/autofs4/inode.c
fs/autofs4/waitq.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/btrfs/backref.c
fs/btrfs/check-integrity.c
fs/btrfs/compression.c
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/extent_map.h
fs/btrfs/file.c
fs/btrfs/free-space-cache.c
fs/btrfs/inode-map.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/scrub.c
fs/btrfs/transaction.c
fs/btrfs/volumes.c
fs/cifs/dir.c
fs/cifs/inode.c
fs/compat.c
fs/dcache.c
fs/direct-io.c
fs/ecryptfs/crypto.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/inode.c
fs/ecryptfs/keystore.c
fs/ecryptfs/miscdev.c
fs/ecryptfs/mmap.c
fs/ecryptfs/read_write.c
fs/ecryptfs/super.c
fs/eventpoll.c
fs/exec.c
fs/gfs2/glock.c
fs/gfs2/inode.c
fs/gfs2/ops_fstype.c
fs/gfs2/rgrp.c
fs/inode.c
fs/namei.c
fs/nfs/nfs4proc.c
fs/nfs/nfs4state.c
fs/nfs/nfs4xdr.c
fs/ntfs/attrib.c
fs/ntfs/mft.c
fs/ntfs/super.c
fs/ocfs2/namei.c
fs/quota/quota.c
fs/select.c
fs/signalfd.c
fs/super.c
fs/xfs/xfs_dquot.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_qm_syscalls.c
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans_dquot.c
include/asm-generic/io-64-nonatomic-hi-lo.h [new file with mode: 0644]
include/asm-generic/io-64-nonatomic-lo-hi.h [new file with mode: 0644]
include/asm-generic/iomap.h
include/asm-generic/pci_iomap.h
include/asm-generic/poll.h
include/drm/Kbuild
include/drm/exynos_drm.h
include/linux/bitops.h
include/linux/compat.h
include/linux/dcache.h
include/linux/digsig.h
include/linux/fs.h
include/linux/if_link.h
include/linux/kmsg_dump.h
include/linux/memcontrol.h
include/linux/netfilter_bridge/ebtables.h
include/linux/nfs_xdr.h
include/linux/percpu.h
include/linux/regset.h
include/linux/rtnetlink.h
include/linux/sched.h
include/linux/signalfd.h
include/linux/skbuff.h
include/linux/syscalls.h
include/linux/tcp.h
include/linux/usb/ch11.h
include/net/bluetooth/bluetooth.h
include/net/bluetooth/hci_core.h
include/net/bluetooth/l2cap.h
include/net/netfilter/nf_conntrack.h
include/net/rtnetlink.h
include/net/tcp.h
include/trace/events/sched.h
kernel/events/hw_breakpoint.c
kernel/fork.c
kernel/hung_task.c
kernel/irq/autoprobe.c
kernel/irq/chip.c
kernel/irq/internals.h
kernel/irq/manage.c
kernel/kprobes.c
kernel/pid.c
kernel/printk.c
kernel/sched/core.c
kernel/sched/fair.c
lib/debugobjects.c
lib/vsprintf.c
mm/huge_memory.c
mm/hugetlb.c
mm/ksm.c
mm/memblock.c
mm/memcontrol.c
mm/mempolicy.c
mm/migrate.c
mm/mlock.c
mm/mmap.c
mm/mprotect.c
mm/nommu.c
mm/page_alloc.c
mm/page_cgroup.c
mm/percpu-vm.c
mm/swap.c
mm/swap_state.c
net/atm/clip.c
net/bluetooth/af_bluetooth.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/sock.c
net/bridge/br_multicast.c
net/bridge/br_netfilter.c
net/bridge/br_stp.c
net/bridge/netfilter/ebtables.c
net/core/neighbour.c
net/core/netpoll.c
net/core/rtnetlink.c
net/ipv4/ip_gre.c
net/ipv4/ping.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/xfrm4_mode_beet.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/addrconf.c
net/ipv6/ip6mr.c
net/ipv6/ndisc.c
net/ipv6/xfrm6_mode_beet.c
net/ipv6/xfrm6_mode_tunnel.c
net/mac80211/debugfs_sta.c
net/mac80211/iface.c
net/mac80211/main.c
net/mac80211/rate.c
net/mac80211/rate.h
net/mac80211/sta_info.h
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_queue.c
net/netfilter/xt_TEE.c
net/rxrpc/ar-key.c
net/sched/sch_netem.c
scripts/coccicheck
scripts/depmod.sh
scripts/mod/file2alias.c
scripts/package/builddeb
sound/pci/azt3328.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/patch_cirrus.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/soc/codecs/ak4642.c
sound/soc/codecs/wm8962.c
sound/soc/imx/imx-ssi.c
sound/soc/soc-dapm.c
sound/usb/caiaq/audio.c
sound/usb/card.h
sound/usb/format.c
sound/usb/quirks.c
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/perf.h
tools/perf/util/event.c
tools/perf/util/evlist.c
tools/perf/util/probe-event.c
tools/perf/util/probe-finder.c
tools/perf/util/top.h
tools/perf/util/util.c
tools/testing/ktest/ktest.pl

index f274c28b510355dde7c2bfca3c9fc5a4ecd0b400..2f95308251d4162ac21d4ccd3fc9454c371cb217 100644 (file)
@@ -13,7 +13,8 @@ Detection
 
 All ALPS touchpads should respond to the "E6 report" command sequence:
 E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or
-00-00-64.
+00-00-64 if no buttons are pressed. The bits 0-2 of the first byte will be 1s
+if some buttons are pressed.
 
 If the E6 report is successful, the touchpad model is identified using the "E7
 report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is
index 033d4e69b43b107d9780ec959105823e6cefd07c..d99fd9c0ec0e16900663e1378eac9911d4afc845 100644 (file)
@@ -2211,6 +2211,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
                        default: off.
 
+       printk.always_kmsg_dump=
+                       Trigger kmsg_dump for cases other than kernel oops or
+                       panics
+                       Format: <bool>  (1/Y/y=enable, 0/N/n=disable)
+                       default: disabled
+
        printk.time=    Show timing data prefixed to each printk message line
                        Format: <bool>  (1/Y/y=enable, 0/N/n=disable)
 
index 9a648eb8e2130fa6b2fb5b3362c8fb106b00e6ba..b087b3bca2901b5df233b805a5fb037bcfa9c74c 100644 (file)
@@ -269,7 +269,6 @@ S:  Orphan
 F:     drivers/platform/x86/wmi.c
 
 AD1889 ALSA SOUND DRIVER
-M:     Kyle McMartin <kyle@mcmartin.ca>
 M:     Thibaut Varene <T-Bone@parisc-linux.org>
 W:     http://wiki.parisc-linux.org/AD1889
 L:     linux-parisc@vger.kernel.org
@@ -1311,7 +1310,7 @@ F:        drivers/atm/
 F:     include/linux/atm*
 
 ATMEL AT91 MCI DRIVER
-M:     Nicolas Ferre <nicolas.ferre@atmel.com>
+M:     Ludovic Desroches <ludovic.desroches@atmel.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 W:     http://www.atmel.com/products/AT91/
 W:     http://www.at91.com/
@@ -1319,7 +1318,7 @@ S:        Maintained
 F:     drivers/mmc/host/at91_mci.c
 
 ATMEL AT91 / AT32 MCI DRIVER
-M:     Nicolas Ferre <nicolas.ferre@atmel.com>
+M:     Ludovic Desroches <ludovic.desroches@atmel.com>
 S:     Maintained
 F:     drivers/mmc/host/atmel-mci.c
 F:     drivers/mmc/host/atmel-mci-regs.h
@@ -3047,7 +3046,6 @@ F:        drivers/hwspinlock/hwspinlock_*
 F:     include/linux/hwspinlock.h
 
 HARMONY SOUND DRIVER
-M:     Kyle McMartin <kyle@mcmartin.ca>
 L:     linux-parisc@vger.kernel.org
 S:     Maintained
 F:     sound/parisc/harmony.*
@@ -3782,7 +3780,7 @@ F:        Documentation/kdump/
 
 KERNEL AUTOMOUNTER v4 (AUTOFS4)
 M:     Ian Kent <raven@themaw.net>
-L:     autofs@linux.kernel.org
+L:     autofs@vger.kernel.org
 S:     Maintained
 F:     fs/autofs4/
 
@@ -4687,7 +4685,7 @@ NTFS FILESYSTEM
 M:     Anton Altaparmakov <anton@tuxera.com>
 L:     linux-ntfs-dev@lists.sourceforge.net
 W:     http://www.tuxera.com/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs.git
 S:     Supported
 F:     Documentation/filesystems/ntfs.txt
 F:     fs/ntfs/
@@ -5000,9 +4998,8 @@ F:        Documentation/blockdev/paride.txt
 F:     drivers/block/paride/
 
 PARISC ARCHITECTURE
-M:     Kyle McMartin <kyle@mcmartin.ca>
-M:     Helge Deller <deller@gmx.de>
 M:     "James E.J. Bottomley" <jejb@parisc-linux.org>
+M:     Helge Deller <deller@gmx.de>
 L:     linux-parisc@vger.kernel.org
 W:     http://www.parisc-linux.org/
 Q:     http://patchwork.kernel.org/project/linux-parisc/list/
@@ -5861,7 +5858,7 @@ S:        Maintained
 F:     drivers/mmc/host/sdhci-spear.c
 
 SECURITY SUBSYSTEM
-M:     James Morris <jmorris@namei.org>
+M:     James Morris <james.l.morris@oracle.com>
 L:     linux-security-module@vger.kernel.org (suggested Cc:)
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git
 W:     http://security.wiki.kernel.org/
@@ -5874,7 +5871,7 @@ S:        Supported
 
 SELINUX SECURITY MODULE
 M:     Stephen Smalley <sds@tycho.nsa.gov>
-M:     James Morris <jmorris@namei.org>
+M:     James Morris <james.l.morris@oracle.com>
 M:     Eric Paris <eparis@parisplace.org>
 L:     selinux@tycho.nsa.gov (subscribers-only, general discussion)
 W:     http://selinuxproject.org
@@ -7274,7 +7271,7 @@ WATCHDOG DEVICE DRIVERS
 M:     Wim Van Sebroeck <wim@iguana.be>
 L:     linux-watchdog@vger.kernel.org
 W:     http://www.linux-watchdog.org/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
+T:     git git://www.linux-watchdog.org/linux-watchdog.git
 S:     Maintained
 F:     Documentation/watchdog/
 F:     drivers/watchdog/
index 7c44b676b77a95739a700036173e3addb2946336..66d13c917bc7db231daa3d084a6eded9bd764f10 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 3
 PATCHLEVEL = 3
 SUBLEVEL = 0
-EXTRAVERSION = -rc3
+EXTRAVERSION = -rc6
 NAME = Saber-toothed Squirrel
 
 # *DOCUMENTATION*
index e8a761aee088a9bc5a8d2ce62d6bf1fde2183a92..f939794363ac6f94ad82a192ede6b9410f7bc002 100644 (file)
@@ -108,7 +108,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
        "       lda     $31,3b-2b(%0)\n"
        "       .previous\n"
        :       "+r"(ret), "=&r"(prev), "=&r"(cmp)
-       :       "r"(uaddr), "r"((long)oldval), "r"(newval)
+       :       "r"(uaddr), "r"((long)(int)oldval), "r"(newval)
        :       "memory");
 
        *uval = prev;
index 63d7578856c13d987d234e648f1065ced58a5174..a1dd2ee83753d0740c4d774dd03b556b2614f309 100644 (file)
@@ -29,6 +29,7 @@
                compatible = "arm,cortex-a9-gic";
                #interrupt-cells = <3>;
                interrupt-controller;
+               cpu-offset = <0x8000>;
                reg = <0x10490000 0x1000>, <0x10480000 0x100>;
        };
 
index 1a1d7023b69b427bda55a11b0dff61e8849e001b..825d2957da0b819a8ac9204df02dff60fee9dbbc 100644 (file)
        };
 
        serial@70006200 {
-               status = "disable";
+               clock-frequency = <216000000>;
        };
 
        serial@70006300 {
-               clock-frequency = <216000000>;
+               status = "disable";
        };
 
        serial@70006400 {
@@ -60,7 +60,7 @@
        sdhci@c8000000 {
                cd-gpios = <&gpio 173 0>; /* gpio PV5 */
                wp-gpios = <&gpio 57 0>;  /* gpio PH1 */
-               power-gpios = <&gpio 155 0>; /* gpio PT3 */
+               power-gpios = <&gpio 169 0>; /* gpio PV1 */
        };
 
        sdhci@c8000200 {
index 18bacec2b094c202bc9dd60be5b69be0c56a683f..97676bdae9983c98b79f77cb85dd88e833756789 100644 (file)
@@ -83,7 +83,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
  *  USB Device (Gadget)
  * -------------------------------------------------------------------- */
 
-#ifdef CONFIG_USB_AT91
+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
 static struct at91_udc_data udc_data;
 
 static struct resource udc_resources[] = {
index 642ccb6d26b256f284388080f71b68e5494e8070..5a24f0b4554db2b7e4ea50e620b464e2e9b9363a 100644 (file)
@@ -84,7 +84,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
  *  USB Device (Gadget)
  * -------------------------------------------------------------------- */
 
-#ifdef CONFIG_USB_AT91
+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
 static struct at91_udc_data udc_data;
 
 static struct resource udc_resources[] = {
@@ -1215,8 +1215,7 @@ void __init at91_add_device_serial(void) {}
  *  CF/IDE
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE) || \
-       defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE) || \
+#if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE) || \
        defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
 
 static struct at91_cf_data cf0_data;
@@ -1313,10 +1312,8 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        if (data->flags & AT91_CF_TRUE_IDE)
 #if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE)
                pdev->name = "pata_at91";
-#elif defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE)
-               pdev->name = "at91_ide";
 #else
-#warning "board requires AT91_CF_TRUE_IDE: enable either at91_ide or pata_at91"
+#warning "board requires AT91_CF_TRUE_IDE: enable pata_at91"
 #endif
        else
                pdev->name = "at91_cf";
index fc59cbdb0e3cfcc777e3fe231bf8c525c2457198..1e28bed8f425063e99af8ac417035e5e6d01900f 100644 (file)
@@ -87,7 +87,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
  *  USB Device (Gadget)
  * -------------------------------------------------------------------- */
 
-#ifdef CONFIG_USB_AT91
+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
 static struct at91_udc_data udc_data;
 
 static struct resource udc_resources[] = {
index 7b46b2787022e85729e4d39ade77d667c5110e66..366a7765635b380538c103e3c0027519550521d0 100644 (file)
@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
  *  USB Device (Gadget)
  * -------------------------------------------------------------------- */
 
-#ifdef CONFIG_USB_AT91
+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
 static struct at91_udc_data udc_data;
 
 static struct resource udc_resources[] = {
@@ -355,8 +355,8 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  *  Compact Flash (PCMCIA or IDE)
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) || \
-    defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE)
+#if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE) || \
+       defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
 
 static struct at91_cf_data cf0_data;
 
@@ -450,7 +450,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        at91_set_A_periph(AT91_PIN_PD9, 0);  /* CFCE2 */
        at91_set_A_periph(AT91_PIN_PD14, 0); /* CFNRW */
 
-       pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "at91_ide" : "at91_cf";
+       pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "pata_at91" : "at91_cf";
        platform_device_register(pdev);
 }
 #else
index b7582dd10dc3bd86c577a59b5ef3c1be3269dd23..96e2adcd5a841907be15beda7bdbb67dd87b5259 100644 (file)
 #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
 static u64 hdmac_dmamask = DMA_BIT_MASK(32);
 
-static struct at_dma_platform_data atdma_pdata = {
-       .nr_channels    = 8,
-};
-
 static struct resource hdmac_resources[] = {
        [0] = {
                .start  = AT91SAM9G45_BASE_DMA,
@@ -56,12 +52,11 @@ static struct resource hdmac_resources[] = {
 };
 
 static struct platform_device at_hdmac_device = {
-       .name           = "at_hdmac",
+       .name           = "at91sam9g45_dma",
        .id             = -1,
        .dev            = {
                                .dma_mask               = &hdmac_dmamask,
                                .coherent_dma_mask      = DMA_BIT_MASK(32),
-                               .platform_data          = &atdma_pdata,
        },
        .resource       = hdmac_resources,
        .num_resources  = ARRAY_SIZE(hdmac_resources),
@@ -69,9 +64,15 @@ static struct platform_device at_hdmac_device = {
 
 void __init at91_add_device_hdmac(void)
 {
-       dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
-       dma_cap_set(DMA_SLAVE, atdma_pdata.cap_mask);
-       platform_device_register(&at_hdmac_device);
+#if defined(CONFIG_OF)
+       struct device_node *of_node =
+               of_find_node_by_name(NULL, "dma-controller");
+
+       if (of_node)
+               of_node_put(of_node);
+       else
+#endif
+               platform_device_register(&at_hdmac_device);
 }
 #else
 void __init at91_add_device_hdmac(void) {}
index 61908dce978447156f557866055fe93da689fe52..9be71c11d0f098ddaadf4528cc2cdc1d17b52a3c 100644 (file)
 #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
 static u64 hdmac_dmamask = DMA_BIT_MASK(32);
 
-static struct at_dma_platform_data atdma_pdata = {
-       .nr_channels    = 2,
-};
-
 static struct resource hdmac_resources[] = {
        [0] = {
                .start  = AT91SAM9RL_BASE_DMA,
@@ -51,12 +47,11 @@ static struct resource hdmac_resources[] = {
 };
 
 static struct platform_device at_hdmac_device = {
-       .name           = "at_hdmac",
+       .name           = "at91sam9rl_dma",
        .id             = -1,
        .dev            = {
                                .dma_mask               = &hdmac_dmamask,
                                .coherent_dma_mask      = DMA_BIT_MASK(32),
-                               .platform_data          = &atdma_pdata,
        },
        .resource       = hdmac_resources,
        .num_resources  = ARRAY_SIZE(hdmac_resources),
@@ -64,7 +59,6 @@ static struct platform_device at_hdmac_device = {
 
 void __init at91_add_device_hdmac(void)
 {
-       dma_cap_set(DMA_MEMCPY, atdma_pdata.cap_mask);
        platform_device_register(&at_hdmac_device);
 }
 #else
index eb18a70fa6472d32881af288909d144d988f39ce..175e1fdd9fe8ade33846f2ff42441d61053bc928 100644 (file)
 
 #include <mach/cpu.h>
 
+#ifndef __ASSEMBLY__
+struct sam9_smc_config {
+       /* Setup register */
+       u8 ncs_read_setup;
+       u8 nrd_setup;
+       u8 ncs_write_setup;
+       u8 nwe_setup;
+
+       /* Pulse register */
+       u8 ncs_read_pulse;
+       u8 nrd_pulse;
+       u8 ncs_write_pulse;
+       u8 nwe_pulse;
+
+       /* Cycle register */
+       u16 read_cycle;
+       u16 write_cycle;
+
+       /* Mode register */
+       u32 mode;
+       u8 tdf_cycles:4;
+};
+
+extern void sam9_smc_configure(int id, int cs, struct sam9_smc_config *config);
+extern void sam9_smc_read(int id, int cs, struct sam9_smc_config *config);
+extern void sam9_smc_read_mode(int id, int cs, struct sam9_smc_config *config);
+extern void sam9_smc_write_mode(int id, int cs, struct sam9_smc_config *config);
+#endif
+
 #define AT91_SMC_SETUP         0x00                            /* Setup Register for CS n */
 #define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
 #define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
index 8294783b679d8aa58579a9d0a149a1a79bb1af6a..99a0a1d2b7dce8503d303c7af2dc022f06738d74 100644 (file)
@@ -2,6 +2,7 @@
  * linux/arch/arm/mach-at91/sam9_smc.c
  *
  * Copyright (C) 2008 Andrew Victor
+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
 
 static void __iomem *smc_base_addr[2];
 
-static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_config* config)
+static void sam9_smc_cs_write_mode(void __iomem *base,
+                                       struct sam9_smc_config *config)
+{
+       __raw_writel(config->mode
+                  | AT91_SMC_TDF_(config->tdf_cycles),
+                  base + AT91_SMC_MODE);
+}
+
+void sam9_smc_write_mode(int id, int cs,
+                                       struct sam9_smc_config *config)
+{
+       sam9_smc_cs_write_mode(AT91_SMC_CS(id, cs), config);
+}
+
+static void sam9_smc_cs_configure(void __iomem *base,
+                                       struct sam9_smc_config *config)
 {
 
        /* Setup register */
@@ -45,16 +61,66 @@ static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_con
                   base + AT91_SMC_CYCLE);
 
        /* Mode register */
-       __raw_writel(config->mode
-                  | AT91_SMC_TDF_(config->tdf_cycles),
-                  base + AT91_SMC_MODE);
+       sam9_smc_cs_write_mode(base, config);
 }
 
-void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config)
+void sam9_smc_configure(int id, int cs,
+                                       struct sam9_smc_config *config)
 {
        sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config);
 }
 
+static void sam9_smc_cs_read_mode(void __iomem *base,
+                                       struct sam9_smc_config *config)
+{
+       u32 val = __raw_readl(base + AT91_SMC_MODE);
+
+       config->mode = (val & ~AT91_SMC_NWECYCLE);
+       config->tdf_cycles = (val & AT91_SMC_NWECYCLE) >> 16 ;
+}
+
+void sam9_smc_read_mode(int id, int cs,
+                                       struct sam9_smc_config *config)
+{
+       sam9_smc_cs_read_mode(AT91_SMC_CS(id, cs), config);
+}
+
+static void sam9_smc_cs_read(void __iomem *base,
+                                       struct sam9_smc_config *config)
+{
+       u32 val;
+
+       /* Setup register */
+       val = __raw_readl(base + AT91_SMC_SETUP);
+
+       config->nwe_setup = val & AT91_SMC_NWESETUP;
+       config->ncs_write_setup = (val & AT91_SMC_NCS_WRSETUP) >> 8;
+       config->nrd_setup = (val & AT91_SMC_NRDSETUP) >> 16;
+       config->ncs_read_setup = (val & AT91_SMC_NCS_RDSETUP) >> 24;
+
+       /* Pulse register */
+       val = __raw_readl(base + AT91_SMC_PULSE);
+
+       config->nwe_setup = val & AT91_SMC_NWEPULSE;
+       config->ncs_write_pulse = (val & AT91_SMC_NCS_WRPULSE) >> 8;
+       config->nrd_pulse = (val & AT91_SMC_NRDPULSE) >> 16;
+       config->ncs_read_pulse = (val & AT91_SMC_NCS_RDPULSE) >> 24;
+
+       /* Cycle register */
+       val = __raw_readl(base + AT91_SMC_CYCLE);
+
+       config->write_cycle = val & AT91_SMC_NWECYCLE;
+       config->read_cycle = (val & AT91_SMC_NRDCYCLE) >> 16;
+
+       /* Mode register */
+       sam9_smc_cs_read_mode(base, config);
+}
+
+void sam9_smc_read(int id, int cs, struct sam9_smc_config *config)
+{
+       sam9_smc_cs_read(AT91_SMC_CS(id, cs), config);
+}
+
 void __init at91sam9_ioremap_smc(int id, u32 addr)
 {
        if (id > 1) {
index 039c5ce17aec5cb2c8b01625041b7924f5bc7e3c..3e52dcd4a59febc19418194892f8ed4b5ec58c01 100644 (file)
@@ -8,27 +8,4 @@
  * published by the Free Software Foundation.
  */
 
-struct sam9_smc_config {
-       /* Setup register */
-       u8 ncs_read_setup;
-       u8 nrd_setup;
-       u8 ncs_write_setup;
-       u8 nwe_setup;
-
-       /* Pulse register */
-       u8 ncs_read_pulse;
-       u8 nrd_pulse;
-       u8 ncs_write_pulse;
-       u8 nwe_pulse;
-
-       /* Cycle register */
-       u16 read_cycle;
-       u16 write_cycle;
-
-       /* Mode register */
-       u32 mode;
-       u8 tdf_cycles:4;
-};
-
-extern void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config);
 extern void __init at91sam9_ioremap_smc(int id, u32 addr);
index dd1429ae6405e3e3c7f48280df66b6992d916b31..bda7aca04ca0dbc504643b30f5b2082bee58420c 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/mach/arch.h>
 #include <linux/irq.h>
 #include <plat/time.h>
+#include <plat/ehci-orion.h>
 #include <plat/common.h>
 #include <plat/addr-map.h>
 #include "common.h"
@@ -71,7 +72,7 @@ void __init dove_map_io(void)
  ****************************************************************************/
 void __init dove_ehci0_init(void)
 {
-       orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0);
+       orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0, EHCI_PHY_NA);
 }
 
 /*****************************************************************************
index 03dd4012043eb29a39b7abcf9e0d8bee92c77562..d67d0b4feb6f3fa2266e66cb878444724d97c069 100644 (file)
@@ -32,7 +32,9 @@
 #include <mach/hardware.h>
 #include <mach/fb.h>
 #include <mach/ep93xx_spi.h>
+#include <mach/gpio-ep93xx.h>
 
+#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
@@ -153,7 +155,6 @@ static struct i2c_board_info vision_i2c_info[] __initdata = {
        }, {
                I2C_BOARD_INFO("pca9539", 0x74),
                .platform_data  = &pca953x_74_gpio_data,
-               .irq            = gpio_to_irq(EP93XX_GPIO_LINE_F(7)),
        }, {
                I2C_BOARD_INFO("pca9539", 0x75),
                .platform_data  = &pca953x_75_gpio_data,
@@ -348,6 +349,8 @@ static void __init vision_init_machine(void)
                                "pca9539:74"))
                pr_warn("cannot request interrupt gpio for pca9539:74\n");
 
+       vision_i2c_info[1].irq = gpio_to_irq(EP93XX_GPIO_LINE_F(7));
+
        ep93xx_register_i2c(&vision_i2c_gpio_data, vision_i2c_info,
                                ARRAY_SIZE(vision_i2c_info));
        ep93xx_register_spi(&vision_spi_master, vision_spi_board_info,
@@ -359,6 +362,7 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
        .atag_offset    = 0x100,
        .map_io         = vision_map_io,
        .init_irq       = ep93xx_init_irq,
+       .handle_irq     = vic_handle_irq,
        .timer          = &ep93xx_timer,
        .init_machine   = vision_init_machine,
        .restart        = ep93xx_restart,
index a5823a7f249e0b06f1e1ba3b7a43ec0a7e95aaec..13312ccb2d9366f30e1295d403e0212c4f6b3e24 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "common.h"
 
+#ifdef CONFIG_PM_SLEEP
 static struct sleep_save exynos4210_clock_save[] = {
        SAVE_ITEM(S5P_CLKSRC_IMAGE),
        SAVE_ITEM(S5P_CLKSRC_LCD1),
@@ -42,6 +43,7 @@ static struct sleep_save exynos4210_clock_save[] = {
        SAVE_ITEM(S5P_CLKGATE_IP_LCD1),
        SAVE_ITEM(S5P_CLKGATE_IP_PERIR_4210),
 };
+#endif
 
 static struct clksrc_clk *sysclks[] = {
        /* nothing here yet */
index 26a668b0d101becc1ea09ab11c6edc7dc23719e1..48af28566fa168703083ed900c7fc8a2a9701998 100644 (file)
 
 #include "common.h"
 
+#ifdef CONFIG_PM_SLEEP
 static struct sleep_save exynos4212_clock_save[] = {
        SAVE_ITEM(S5P_CLKSRC_IMAGE),
        SAVE_ITEM(S5P_CLKDIV_IMAGE),
        SAVE_ITEM(S5P_CLKGATE_IP_IMAGE_4212),
        SAVE_ITEM(S5P_CLKGATE_IP_PERIR_4212),
 };
+#endif
 
 static struct clk *clk_src_mpll_user_list[] = {
        [0] = &clk_fin_mpll,
index 5a8c42e90005c6fb3a92599671afefed6909fda3..187287aa57ab9154fbe7808bbd26ec895348ddd8 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "common.h"
 
+#ifdef CONFIG_PM_SLEEP
 static struct sleep_save exynos4_clock_save[] = {
        SAVE_ITEM(S5P_CLKDIV_LEFTBUS),
        SAVE_ITEM(S5P_CLKGATE_IP_LEFTBUS),
@@ -93,6 +94,7 @@ static struct sleep_save exynos4_clock_save[] = {
        SAVE_ITEM(S5P_CLKGATE_SCLKCPU),
        SAVE_ITEM(S5P_CLKGATE_IP_CPU),
 };
+#endif
 
 struct clk clk_sclk_hdmi27m = {
        .name           = "sclk_hdmi27m",
index 85fa02767d67d7acc4cbed6a0b05dea0998060d0..e6b02fdf1b090ea75f7c5b9c2f14d13fc4c4ebcb 100644 (file)
 #include <linux/serial_core.h>
 
 #include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
 #include <mach/map.h>
 
 #include <plat/cpu.h>
 #include <plat/regs-serial.h>
-#include <plat/exynos4.h>
+
+#include "common.h"
 
 /*
  * The following lookup table is used to override device names when devices
@@ -60,7 +62,7 @@ static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = {
 
 static void __init exynos4210_dt_map_io(void)
 {
-       s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+       exynos_init_io(NULL, 0);
        s3c24xx_init_clocks(24000000);
 }
 
@@ -79,7 +81,9 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
        /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
        .init_irq       = exynos4_init_irq,
        .map_io         = exynos4210_dt_map_io,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = exynos4210_dt_machine_init,
        .timer          = &exynos4_timer,
        .dt_compat      = exynos4210_dt_compat,
+       .restart        = exynos4_restart,
 MACHINE_END
index b895ec0311057698dab4883c4d77099971af7a14..435261f83f46d5d8ada440e17bdc65a0b1e19a1f 100644 (file)
@@ -220,14 +220,14 @@ static struct s3c_fb_pd_win nuri_fb_win0 = {
                .lower_margin   = 1,
                .hsync_len      = 48,
                .vsync_len      = 3,
-               .xres           = 1280,
-               .yres           = 800,
+               .xres           = 1024,
+               .yres           = 600,
                .refresh        = 60,
        },
        .max_bpp        = 24,
        .default_bpp    = 16,
-       .virtual_x      = 1280,
-       .virtual_y      = 800,
+       .virtual_x      = 1024,
+       .virtual_y      = 2 * 600,
 };
 
 static struct s3c_fb_platdata nuri_fb_pdata __initdata = {
index 37ac93e8d6d9ef44940dabb5f1d916301012ee54..38939956c34f7097958eda9fcd8690feac4e84ba 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/i2c.h>
 #include <linux/gpio_keys.h>
 #include <linux/gpio.h>
+#include <linux/interrupt.h>
 #include <linux/fb.h>
 #include <linux/mfd/max8998.h>
 #include <linux/regulator/machine.h>
@@ -595,6 +596,7 @@ static struct mxt_platform_data qt602240_platform_data = {
        .threshold      = 0x28,
        .voltage        = 2800000,              /* 2.8V */
        .orient         = MXT_DIAGONAL,
+       .irqflags       = IRQF_TRIGGER_FALLING,
 };
 
 static struct i2c_board_info i2c3_devs[] __initdata = {
@@ -910,7 +912,7 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = {
                .bus_type       = FIMC_MIPI_CSI2,
                .board_info     = &m5mols_board_info,
                .i2c_bus_num    = 0,
-               .clk_frequency  = 21600000UL,
+               .clk_frequency  = 24000000UL,
                .csi_data_align = 32,
        },
 };
index a4f61a43c7bae9a9f3141ef6ecd396c0ee3ed7c5..e190130517727ea9bcdfb9541496922093a9d672 100644 (file)
@@ -206,7 +206,7 @@ static void exynos4_pm_prepare(void)
 
 }
 
-static int exynos4_pm_add(struct device *dev)
+static int exynos4_pm_add(struct device *dev, struct subsys_interface *sif)
 {
        pm_cpu_prep = exynos4_pm_prepare;
        pm_cpu_sleep = exynos4_cpu_suspend;
@@ -384,7 +384,9 @@ static void exynos4_pm_resume(void)
 
        exynos4_restore_pll();
 
+#ifdef CONFIG_SMP
        scu_enable(S5P_VA_SCU);
+#endif
 
 #ifdef CONFIG_CACHE_L2X0
        s3c_pm_do_restore_core(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
index cc15426787b15531de64868f50ff782244e1218b..77d4852e19f283e3b06f1fd63e9ff61707f99146 100644 (file)
@@ -27,6 +27,7 @@
 #include <plat/cache-feroceon-l2.h>
 #include <plat/mvsdio.h>
 #include <plat/orion_nand.h>
+#include <plat/ehci-orion.h>
 #include <plat/common.h>
 #include <plat/time.h>
 #include <plat/addr-map.h>
@@ -73,7 +74,7 @@ unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED;
 void __init kirkwood_ehci_init(void)
 {
        kirkwood_clk_ctrl |= CGC_USB0;
-       orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB);
+       orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB, EHCI_PHY_NA);
 }
 
 
index e8fda45c0736a866ead683af59f9b8a4d59d68f3..d5a0d1da2e0eb42b1f0e6f47172587d58e18e0d9 100644 (file)
 #define MPP_F6282_MASK         MPP(  0, 0x0, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP0_GPIO              MPP(  0, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP0_NF_IO2            MPP(  0, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP0_SPI_SCn           MPP(  0, 0x2, 0, 1, 1,   1,   1,   1,   1 )
+#define MPP0_NF_IO2            MPP(  0, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP0_SPI_SCn           MPP(  0, 0x2, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP1_GPO               MPP(  1, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP1_NF_IO3            MPP(  1, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP1_SPI_MOSI          MPP(  1, 0x2, 0, 1, 1,   1,   1,   1,   1 )
+#define MPP1_NF_IO3            MPP(  1, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP1_SPI_MOSI          MPP(  1, 0x2, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP2_GPO               MPP(  2, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP2_NF_IO4            MPP(  2, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP2_SPI_SCK           MPP(  2, 0x2, 0, 1, 1,   1,   1,   1,   1 )
+#define MPP2_NF_IO4            MPP(  2, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP2_SPI_SCK           MPP(  2, 0x2, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP3_GPO               MPP(  3, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP3_NF_IO5            MPP(  3, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP3_SPI_MISO          MPP(  3, 0x2, 1, 0, 1,   1,   1,   1,   1 )
+#define MPP3_NF_IO5            MPP(  3, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP3_SPI_MISO          MPP(  3, 0x2, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP4_GPIO              MPP(  4, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP4_NF_IO6            MPP(  4, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP4_UART0_RXD         MPP(  4, 0x2, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP4_SATA1_ACTn                MPP(  4, 0x5, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP4_NF_IO6            MPP(  4, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP4_UART0_RXD         MPP(  4, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP4_SATA1_ACTn                MPP(  4, 0x5, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP4_LCD_VGA_HSYNC     MPP(  4, 0xb, 0, 0, 0,   0,   0,   0,   1 )
-#define MPP4_PTP_CLK           MPP(  4, 0xd, 1, 0, 1,   1,   1,   1,   0 )
+#define MPP4_PTP_CLK           MPP(  4, 0xd, 0, 0, 1,   1,   1,   1,   0 )
 
 #define MPP5_GPO               MPP(  5, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP5_NF_IO7            MPP(  5, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP5_UART0_TXD         MPP(  5, 0x2, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP5_PTP_TRIG_GEN      MPP(  5, 0x4, 0, 1, 1,   1,   1,   1,   0 )
-#define MPP5_SATA0_ACTn                MPP(  5, 0x5, 0, 1, 0,   1,   1,   1,   1 )
+#define MPP5_NF_IO7            MPP(  5, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP5_UART0_TXD         MPP(  5, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP5_PTP_TRIG_GEN      MPP(  5, 0x4, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP5_SATA0_ACTn                MPP(  5, 0x5, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP5_LCD_VGA_VSYNC     MPP(  5, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
-#define MPP6_SYSRST_OUTn       MPP(  6, 0x1, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP6_SPI_MOSI          MPP(  6, 0x2, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP6_PTP_TRIG_GEN      MPP(  6, 0x3, 0, 1, 1,   1,   1,   1,   0 )
+#define MPP6_SYSRST_OUTn       MPP(  6, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP6_SPI_MOSI          MPP(  6, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP6_PTP_TRIG_GEN      MPP(  6, 0x3, 0, 0, 1,   1,   1,   1,   0 )
 
 #define MPP7_GPO               MPP(  7, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP7_PEX_RST_OUTn      MPP(  7, 0x1, 0, 1, 1,   1,   1,   1,   0 )
-#define MPP7_SPI_SCn           MPP(  7, 0x2, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP7_PTP_TRIG_GEN      MPP(  7, 0x3, 0, 1, 1,   1,   1,   1,   0 )
-#define MPP7_LCD_PWM           MPP(  7, 0xb, 0, 1, 0,   0,   0,   0,   1 )
+#define MPP7_PEX_RST_OUTn      MPP(  7, 0x1, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP7_SPI_SCn           MPP(  7, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP7_PTP_TRIG_GEN      MPP(  7, 0x3, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP7_LCD_PWM           MPP(  7, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP8_GPIO              MPP(  8, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP8_TW0_SDA           MPP(  8, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP8_UART0_RTS         MPP(  8, 0x2, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP8_UART1_RTS         MPP(  8, 0x3, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP8_MII0_RXERR                MPP(  8, 0x4, 1, 0, 0,   1,   1,   1,   1 )
-#define MPP8_SATA1_PRESENTn    MPP(  8, 0x5, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP8_PTP_CLK           MPP(  8, 0xc, 1, 0, 1,   1,   1,   1,   0 )
-#define MPP8_MII0_COL          MPP(  8, 0xd, 1, 0, 1,   1,   1,   1,   1 )
+#define MPP8_TW0_SDA           MPP(  8, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP8_UART0_RTS         MPP(  8, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP8_UART1_RTS         MPP(  8, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP8_MII0_RXERR                MPP(  8, 0x4, 0, 0, 0,   1,   1,   1,   1 )
+#define MPP8_SATA1_PRESENTn    MPP(  8, 0x5, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP8_PTP_CLK           MPP(  8, 0xc, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP8_MII0_COL          MPP(  8, 0xd, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP9_GPIO              MPP(  9, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP9_TW0_SCK           MPP(  9, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP9_UART0_CTS         MPP(  9, 0x2, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP9_UART1_CTS         MPP(  9, 0x3, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP9_SATA0_PRESENTn    MPP(  9, 0x5, 0, 1, 0,   1,   1,   1,   1 )
-#define MPP9_PTP_EVENT_REQ     MPP(  9, 0xc, 1, 0, 1,   1,   1,   1,   0 )
-#define MPP9_MII0_CRS          MPP(  9, 0xd, 1, 0, 1,   1,   1,   1,   1 )
+#define MPP9_TW0_SCK           MPP(  9, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP9_UART0_CTS         MPP(  9, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP9_UART1_CTS         MPP(  9, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP9_SATA0_PRESENTn    MPP(  9, 0x5, 0, 0, 0,   1,   1,   1,   1 )
+#define MPP9_PTP_EVENT_REQ     MPP(  9, 0xc, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP9_MII0_CRS          MPP(  9, 0xd, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP10_GPO              MPP( 10, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP10_SPI_SCK          MPP( 10, 0x2, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP10_UART0_TXD                MPP( 10, 0X3, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP10_SATA1_ACTn       MPP( 10, 0x5, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP10_PTP_TRIG_GEN     MPP( 10, 0xc, 0, 1, 1,   1,   1,   1,   0 )
+#define MPP10_SPI_SCK          MPP( 10, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP10_UART0_TXD                MPP( 10, 0X3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP10_SATA1_ACTn       MPP( 10, 0x5, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP10_PTP_TRIG_GEN     MPP( 10, 0xc, 0, 0, 1,   1,   1,   1,   0 )
 
 #define MPP11_GPIO             MPP( 11, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP11_SPI_MISO         MPP( 11, 0x2, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP11_UART0_RXD                MPP( 11, 0x3, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP11_PTP_EVENT_REQ    MPP( 11, 0x4, 1, 0, 1,   1,   1,   1,   0 )
-#define MPP11_PTP_TRIG_GEN     MPP( 11, 0xc, 0, 1, 1,   1,   1,   1,   0 )
-#define MPP11_PTP_CLK          MPP( 11, 0xd, 1, 0, 1,   1,   1,   1,   0 )
-#define MPP11_SATA0_ACTn       MPP( 11, 0x5, 0, 1, 0,   1,   1,   1,   1 )
+#define MPP11_SPI_MISO         MPP( 11, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP11_UART0_RXD                MPP( 11, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP11_PTP_EVENT_REQ    MPP( 11, 0x4, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP11_PTP_TRIG_GEN     MPP( 11, 0xc, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP11_PTP_CLK          MPP( 11, 0xd, 0, 0, 1,   1,   1,   1,   0 )
+#define MPP11_SATA0_ACTn       MPP( 11, 0x5, 0, 0, 0,   1,   1,   1,   1 )
 
 #define MPP12_GPO              MPP( 12, 0x0, 0, 1, 1,   1,   1,   1,   1 )
 #define MPP12_GPIO             MPP( 12, 0x0, 1, 1, 0,   0,   0,   1,   0 )
-#define MPP12_SD_CLK           MPP( 12, 0x1, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP12_AU_SPDIF0                MPP( 12, 0xa, 0, 1, 0,   0,   0,   0,   1 )
-#define MPP12_SPI_MOSI         MPP( 12, 0xb, 0, 1, 0,   0,   0,   0,   1 )
-#define MPP12_TW1_SDA          MPP( 12, 0xd, 1, 0, 0,   0,   0,   0,   1 )
+#define MPP12_SD_CLK           MPP( 12, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP12_AU_SPDIF0                MPP( 12, 0xa, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP12_SPI_MOSI         MPP( 12, 0xb, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP12_TW1_SDA          MPP( 12, 0xd, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP13_GPIO             MPP( 13, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP13_SD_CMD           MPP( 13, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP13_UART1_TXD                MPP( 13, 0x3, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP13_AU_SPDIFRMCLK    MPP( 13, 0xa, 0, 1, 0,   0,   0,   0,   1 )
-#define MPP13_LCDPWM           MPP( 13, 0xb, 0, 1, 0,   0,   0,   0,   1 )
+#define MPP13_SD_CMD           MPP( 13, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP13_UART1_TXD                MPP( 13, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP13_AU_SPDIFRMCLK    MPP( 13, 0xa, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP13_LCDPWM           MPP( 13, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP14_GPIO             MPP( 14, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP14_SD_D0            MPP( 14, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP14_UART1_RXD                MPP( 14, 0x3, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP14_SATA1_PRESENTn   MPP( 14, 0x4, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP14_AU_SPDIFI                MPP( 14, 0xa, 1, 0, 0,   0,   0,   0,   1 )
-#define MPP14_AU_I2SDI         MPP( 14, 0xb, 1, 0, 0,   0,   0,   0,   1 )
-#define MPP14_MII0_COL         MPP( 14, 0xd, 1, 0, 1,   1,   1,   1,   1 )
+#define MPP14_SD_D0            MPP( 14, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP14_UART1_RXD                MPP( 14, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP14_SATA1_PRESENTn   MPP( 14, 0x4, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP14_AU_SPDIFI                MPP( 14, 0xa, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP14_AU_I2SDI         MPP( 14, 0xb, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP14_MII0_COL         MPP( 14, 0xd, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP15_GPIO             MPP( 15, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP15_SD_D1            MPP( 15, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP15_UART0_RTS                MPP( 15, 0x2, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP15_UART1_TXD                MPP( 15, 0x3, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP15_SATA0_ACTn       MPP( 15, 0x4, 0, 1, 0,   1,   1,   1,   1 )
-#define MPP15_SPI_CSn          MPP( 15, 0xb, 0, 1, 0,   0,   0,   0,   1 )
+#define MPP15_SD_D1            MPP( 15, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP15_UART0_RTS                MPP( 15, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP15_UART1_TXD                MPP( 15, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP15_SATA0_ACTn       MPP( 15, 0x4, 0, 0, 0,   1,   1,   1,   1 )
+#define MPP15_SPI_CSn          MPP( 15, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP16_GPIO             MPP( 16, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP16_SD_D2            MPP( 16, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP16_UART0_CTS                MPP( 16, 0x2, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP16_UART1_RXD                MPP( 16, 0x3, 1, 0, 1,   1,   1,   1,   1 )
-#define MPP16_SATA1_ACTn       MPP( 16, 0x4, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP16_LCD_EXT_REF_CLK  MPP( 16, 0xb, 1, 0, 0,   0,   0,   0,   1 )
-#define MPP16_MII0_CRS         MPP( 16, 0xd, 1, 0, 1,   1,   1,   1,   1 )
+#define MPP16_SD_D2            MPP( 16, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP16_UART0_CTS                MPP( 16, 0x2, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP16_UART1_RXD                MPP( 16, 0x3, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP16_SATA1_ACTn       MPP( 16, 0x4, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP16_LCD_EXT_REF_CLK  MPP( 16, 0xb, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP16_MII0_CRS         MPP( 16, 0xd, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP17_GPIO             MPP( 17, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP17_SD_D3            MPP( 17, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP17_SATA0_PRESENTn   MPP( 17, 0x4, 0, 1, 0,   1,   1,   1,   1 )
-#define MPP17_SATA1_ACTn       MPP( 17, 0xa, 0, 1, 0,   0,   0,   0,   1 )
-#define MPP17_TW1_SCK          MPP( 17, 0xd, 1, 1, 0,   0,   0,   0,   1 )
+#define MPP17_SD_D3            MPP( 17, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP17_SATA0_PRESENTn   MPP( 17, 0x4, 0, 0, 0,   1,   1,   1,   1 )
+#define MPP17_SATA1_ACTn       MPP( 17, 0xa, 0, 0, 0,   0,   0,   0,   1 )
+#define MPP17_TW1_SCK          MPP( 17, 0xd, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP18_GPO              MPP( 18, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP18_NF_IO0           MPP( 18, 0x1, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP18_PEX0_CLKREQ      MPP( 18, 0x2, 0, 1, 0,   0,   0,   0,   1 )
+#define MPP18_NF_IO0           MPP( 18, 0x1, 0, 0, 1,   1,   1,   1,   1 )
+#define MPP18_PEX0_CLKREQ      MPP( 18, 0x2, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP19_GPO              MPP( 19, 0x0, 0, 1, 1,   1,   1,   1,   1 )
-#define MPP19_NF_IO1           MPP( 19, 0x1, 1, 1, 1,   1,   1,   1,   1 )
+#define MPP19_NF_IO1           MPP( 19, 0x1, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP20_GPIO             MPP( 20, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP20_TSMP0            MPP( 20, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP20_TDM_CH0_TX_QL    MPP( 20, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP20_TSMP0            MPP( 20, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP20_TDM_CH0_TX_QL    MPP( 20, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP20_GE1_TXD0         MPP( 20, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP20_AU_SPDIFI                MPP( 20, 0x4, 1, 0, 0,   0,   1,   1,   1 )
-#define MPP20_SATA1_ACTn       MPP( 20, 0x5, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP20_AU_SPDIFI                MPP( 20, 0x4, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP20_SATA1_ACTn       MPP( 20, 0x5, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP20_LCD_D0           MPP( 20, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP21_GPIO             MPP( 21, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP21_TSMP1            MPP( 21, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP21_TDM_CH0_RX_QL    MPP( 21, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP21_TSMP1            MPP( 21, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP21_TDM_CH0_RX_QL    MPP( 21, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP21_GE1_TXD1         MPP( 21, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP21_AU_SPDIFO                MPP( 21, 0x4, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP21_SATA0_ACTn       MPP( 21, 0x5, 0, 1, 0,   1,   1,   1,   1 )
+#define MPP21_AU_SPDIFO                MPP( 21, 0x4, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP21_SATA0_ACTn       MPP( 21, 0x5, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP21_LCD_D1           MPP( 21, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP22_GPIO             MPP( 22, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP22_TSMP2            MPP( 22, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP22_TDM_CH2_TX_QL    MPP( 22, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP22_TSMP2            MPP( 22, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP22_TDM_CH2_TX_QL    MPP( 22, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP22_GE1_TXD2         MPP( 22, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP22_AU_SPDIFRMKCLK   MPP( 22, 0x4, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP22_SATA1_PRESENTn   MPP( 22, 0x5, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP22_AU_SPDIFRMKCLK   MPP( 22, 0x4, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP22_SATA1_PRESENTn   MPP( 22, 0x5, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP22_LCD_D2           MPP( 22, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP23_GPIO             MPP( 23, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP23_TSMP3            MPP( 23, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP23_TDM_CH2_RX_QL    MPP( 23, 0x2, 1, 0, 0,   0,   1,   1,   1 )
+#define MPP23_TSMP3            MPP( 23, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP23_TDM_CH2_RX_QL    MPP( 23, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP23_GE1_TXD3         MPP( 23, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP23_AU_I2SBCLK       MPP( 23, 0x4, 0, 1, 0,   0,   1,   1,   1 )
-#define MPP23_SATA0_PRESENTn   MPP( 23, 0x5, 0, 1, 0,   1,   1,   1,   1 )
+#define MPP23_AU_I2SBCLK       MPP( 23, 0x4, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP23_SATA0_PRESENTn   MPP( 23, 0x5, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP23_LCD_D3           MPP( 23, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP24_GPIO             MPP( 24, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP24_TSMP4            MPP( 24, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP24_TDM_SPI_CS0      MPP( 24, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP24_TSMP4            MPP( 24, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP24_TDM_SPI_CS0      MPP( 24, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP24_GE1_RXD0         MPP( 24, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP24_AU_I2SDO         MPP( 24, 0x4, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP24_AU_I2SDO         MPP( 24, 0x4, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP24_LCD_D4           MPP( 24, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP25_GPIO             MPP( 25, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP25_TSMP5            MPP( 25, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP25_TDM_SPI_SCK      MPP( 25, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP25_TSMP5            MPP( 25, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP25_TDM_SPI_SCK      MPP( 25, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP25_GE1_RXD1         MPP( 25, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP25_AU_I2SLRCLK      MPP( 25, 0x4, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP25_AU_I2SLRCLK      MPP( 25, 0x4, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP25_LCD_D5           MPP( 25, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP26_GPIO             MPP( 26, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP26_TSMP6            MPP( 26, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP26_TDM_SPI_MISO     MPP( 26, 0x2, 1, 0, 0,   0,   1,   1,   1 )
+#define MPP26_TSMP6            MPP( 26, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP26_TDM_SPI_MISO     MPP( 26, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP26_GE1_RXD2         MPP( 26, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP26_AU_I2SMCLK       MPP( 26, 0x4, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP26_AU_I2SMCLK       MPP( 26, 0x4, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP26_LCD_D6           MPP( 26, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP27_GPIO             MPP( 27, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP27_TSMP7            MPP( 27, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP27_TDM_SPI_MOSI     MPP( 27, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP27_TSMP7            MPP( 27, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP27_TDM_SPI_MOSI     MPP( 27, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP27_GE1_RXD3         MPP( 27, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP27_AU_I2SDI         MPP( 27, 0x4, 1, 0, 0,   0,   1,   1,   1 )
+#define MPP27_AU_I2SDI         MPP( 27, 0x4, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP27_LCD_D7           MPP( 27, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP28_GPIO             MPP( 28, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP28_TSMP8            MPP( 28, 0x1, 1, 1, 0,   0,   1,   1,   1 )
+#define MPP28_TSMP8            MPP( 28, 0x1, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP28_TDM_CODEC_INTn   MPP( 28, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP28_GE1_COL          MPP( 28, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP28_AU_EXTCLK                MPP( 28, 0x4, 1, 0, 0,   0,   1,   1,   1 )
+#define MPP28_AU_EXTCLK                MPP( 28, 0x4, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP28_LCD_D8           MPP( 28, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP29_GPIO             MPP( 29, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP29_TSMP9            MPP( 29, 0x1, 1, 1, 0,   0,   1,   1,   1 )
+#define MPP29_TSMP9            MPP( 29, 0x1, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP29_TDM_CODEC_RSTn   MPP( 29, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP29_GE1_TCLK         MPP( 29, 0x3, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP29_LCD_D9           MPP( 29, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP30_GPIO             MPP( 30, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP30_TSMP10           MPP( 30, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP30_TDM_PCLK         MPP( 30, 0x2, 1, 1, 0,   0,   1,   1,   1 )
+#define MPP30_TSMP10           MPP( 30, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP30_TDM_PCLK         MPP( 30, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP30_GE1_RXCTL                MPP( 30, 0x3, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP30_LCD_D10          MPP( 30, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP31_GPIO             MPP( 31, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP31_TSMP11           MPP( 31, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP31_TDM_FS           MPP( 31, 0x2, 1, 1, 0,   0,   1,   1,   1 )
+#define MPP31_TSMP11           MPP( 31, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP31_TDM_FS           MPP( 31, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP31_GE1_RXCLK                MPP( 31, 0x3, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP31_LCD_D11          MPP( 31, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP32_GPIO             MPP( 32, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP32_TSMP12           MPP( 32, 0x1, 1, 1, 0,   0,   1,   1,   1 )
-#define MPP32_TDM_DRX          MPP( 32, 0x2, 1, 0, 0,   0,   1,   1,   1 )
+#define MPP32_TSMP12           MPP( 32, 0x1, 0, 0, 0,   0,   1,   1,   1 )
+#define MPP32_TDM_DRX          MPP( 32, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP32_GE1_TCLKOUT      MPP( 32, 0x3, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP32_LCD_D12          MPP( 32, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP33_GPO              MPP( 33, 0x0, 0, 1, 0,   1,   1,   1,   1 )
-#define MPP33_TDM_DTX          MPP( 33, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP33_TDM_DTX          MPP( 33, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP33_GE1_TXCTL                MPP( 33, 0x3, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP33_LCD_D13          MPP( 33, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP34_GPIO             MPP( 34, 0x0, 1, 1, 0,   1,   1,   1,   1 )
-#define MPP34_TDM_SPI_CS1      MPP( 34, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP34_TDM_SPI_CS1      MPP( 34, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP34_GE1_TXEN         MPP( 34, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP34_SATA1_ACTn       MPP( 34, 0x5, 0, 1, 0,   0,   0,   1,   1 )
+#define MPP34_SATA1_ACTn       MPP( 34, 0x5, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP34_LCD_D14          MPP( 34, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP35_GPIO             MPP( 35, 0x0, 1, 1, 1,   1,   1,   1,   1 )
-#define MPP35_TDM_CH0_TX_QL    MPP( 35, 0x2, 0, 1, 0,   0,   1,   1,   1 )
+#define MPP35_TDM_CH0_TX_QL    MPP( 35, 0x2, 0, 0, 0,   0,   1,   1,   1 )
 #define MPP35_GE1_RXERR                MPP( 35, 0x3, 0, 0, 0,   1,   1,   1,   1 )
-#define MPP35_SATA0_ACTn       MPP( 35, 0x5, 0, 1, 0,   1,   1,   1,   1 )
+#define MPP35_SATA0_ACTn       MPP( 35, 0x5, 0, 0, 0,   1,   1,   1,   1 )
 #define MPP35_LCD_D15          MPP( 22, 0xb, 0, 0, 0,   0,   0,   0,   1 )
-#define MPP35_MII0_RXERR       MPP( 35, 0xc, 1, 0, 1,   1,   1,   1,   1 )
+#define MPP35_MII0_RXERR       MPP( 35, 0xc, 0, 0, 1,   1,   1,   1,   1 )
 
 #define MPP36_GPIO             MPP( 36, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP36_TSMP0            MPP( 36, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP36_TDM_SPI_CS1      MPP( 36, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP36_AU_SPDIFI                MPP( 36, 0x4, 1, 0, 1,   0,   0,   1,   1 )
-#define MPP36_TW1_SDA          MPP( 36, 0xb, 1, 1, 0,   0,   0,   0,   1 )
+#define MPP36_TSMP0            MPP( 36, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP36_TDM_SPI_CS1      MPP( 36, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP36_AU_SPDIFI                MPP( 36, 0x4, 0, 0, 1,   0,   0,   1,   1 )
+#define MPP36_TW1_SDA          MPP( 36, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP37_GPIO             MPP( 37, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP37_TSMP1            MPP( 37, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP37_TDM_CH2_TX_QL    MPP( 37, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP37_AU_SPDIFO                MPP( 37, 0x4, 0, 1, 1,   0,   0,   1,   1 )
-#define MPP37_TW1_SCK          MPP( 37, 0xb, 1, 1, 0,   0,   0,   0,   1 )
+#define MPP37_TSMP1            MPP( 37, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP37_TDM_CH2_TX_QL    MPP( 37, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP37_AU_SPDIFO                MPP( 37, 0x4, 0, 0, 1,   0,   0,   1,   1 )
+#define MPP37_TW1_SCK          MPP( 37, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP38_GPIO             MPP( 38, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP38_TSMP2            MPP( 38, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP38_TDM_CH2_RX_QL    MPP( 38, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP38_AU_SPDIFRMLCLK   MPP( 38, 0x4, 0, 1, 1,   0,   0,   1,   1 )
+#define MPP38_TSMP2            MPP( 38, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP38_TDM_CH2_RX_QL    MPP( 38, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP38_AU_SPDIFRMLCLK   MPP( 38, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP38_LCD_D18          MPP( 38, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP39_GPIO             MPP( 39, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP39_TSMP3            MPP( 39, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP39_TDM_SPI_CS0      MPP( 39, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP39_AU_I2SBCLK       MPP( 39, 0x4, 0, 1, 1,   0,   0,   1,   1 )
+#define MPP39_TSMP3            MPP( 39, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP39_TDM_SPI_CS0      MPP( 39, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP39_AU_I2SBCLK       MPP( 39, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP39_LCD_D19          MPP( 39, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP40_GPIO             MPP( 40, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP40_TSMP4            MPP( 40, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP40_TDM_SPI_SCK      MPP( 40, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP40_AU_I2SDO         MPP( 40, 0x4, 0, 1, 1,   0,   0,   1,   1 )
+#define MPP40_TSMP4            MPP( 40, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP40_TDM_SPI_SCK      MPP( 40, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP40_AU_I2SDO         MPP( 40, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP40_LCD_D20          MPP( 40, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP41_GPIO             MPP( 41, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP41_TSMP5            MPP( 41, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP41_TDM_SPI_MISO     MPP( 41, 0x2, 1, 0, 0,   0,   0,   1,   1 )
-#define MPP41_AU_I2SLRCLK      MPP( 41, 0x4, 0, 1, 1,   0,   0,   1,   1 )
+#define MPP41_TSMP5            MPP( 41, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP41_TDM_SPI_MISO     MPP( 41, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP41_AU_I2SLRCLK      MPP( 41, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP41_LCD_D21          MPP( 41, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP42_GPIO             MPP( 42, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP42_TSMP6            MPP( 42, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP42_TDM_SPI_MOSI     MPP( 42, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP42_AU_I2SMCLK       MPP( 42, 0x4, 0, 1, 1,   0,   0,   1,   1 )
+#define MPP42_TSMP6            MPP( 42, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP42_TDM_SPI_MOSI     MPP( 42, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP42_AU_I2SMCLK       MPP( 42, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP42_LCD_D22          MPP( 42, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP43_GPIO             MPP( 43, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP43_TSMP7            MPP( 43, 0x1, 1, 1, 0,   0,   0,   1,   1 )
+#define MPP43_TSMP7            MPP( 43, 0x1, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP43_TDM_CODEC_INTn   MPP( 43, 0x2, 0, 0, 0,   0,   0,   1,   1 )
-#define MPP43_AU_I2SDI         MPP( 43, 0x4, 1, 0, 1,   0,   0,   1,   1 )
+#define MPP43_AU_I2SDI         MPP( 43, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP43_LCD_D23          MPP( 22, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP44_GPIO             MPP( 44, 0x0, 1, 1, 1,   0,   0,   1,   1 )
-#define MPP44_TSMP8            MPP( 44, 0x1, 1, 1, 0,   0,   0,   1,   1 )
+#define MPP44_TSMP8            MPP( 44, 0x1, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP44_TDM_CODEC_RSTn   MPP( 44, 0x2, 0, 0, 0,   0,   0,   1,   1 )
-#define MPP44_AU_EXTCLK                MPP( 44, 0x4, 1, 0, 1,   0,   0,   1,   1 )
+#define MPP44_AU_EXTCLK                MPP( 44, 0x4, 0, 0, 1,   0,   0,   1,   1 )
 #define MPP44_LCD_CLK          MPP( 44, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP45_GPIO             MPP( 45, 0x0, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP45_TSMP9            MPP( 45, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP45_TDM_PCLK         MPP( 45, 0x2, 1, 1, 0,   0,   0,   1,   1 )
+#define MPP45_TSMP9            MPP( 45, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP45_TDM_PCLK         MPP( 45, 0x2, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP245_LCD_E           MPP( 45, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP46_GPIO             MPP( 46, 0x0, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP46_TSMP10           MPP( 46, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP46_TDM_FS           MPP( 46, 0x2, 1, 1, 0,   0,   0,   1,   1 )
+#define MPP46_TSMP10           MPP( 46, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP46_TDM_FS           MPP( 46, 0x2, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP46_LCD_HSYNC                MPP( 46, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP47_GPIO             MPP( 47, 0x0, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP47_TSMP11           MPP( 47, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP47_TDM_DRX          MPP( 47, 0x2, 1, 0, 0,   0,   0,   1,   1 )
+#define MPP47_TSMP11           MPP( 47, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP47_TDM_DRX          MPP( 47, 0x2, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP47_LCD_VSYNC                MPP( 47, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP48_GPIO             MPP( 48, 0x0, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP48_TSMP12           MPP( 48, 0x1, 1, 1, 0,   0,   0,   1,   1 )
-#define MPP48_TDM_DTX          MPP( 48, 0x2, 0, 1, 0,   0,   0,   1,   1 )
+#define MPP48_TSMP12           MPP( 48, 0x1, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP48_TDM_DTX          MPP( 48, 0x2, 0, 0, 0,   0,   0,   1,   1 )
 #define MPP48_LCD_D16          MPP( 22, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP49_GPIO             MPP( 49, 0x0, 1, 1, 0,   0,   0,   1,   0 )
 #define MPP49_GPO              MPP( 49, 0x0, 0, 1, 0,   0,   0,   0,   1 )
-#define MPP49_TSMP9            MPP( 49, 0x1, 1, 1, 0,   0,   0,   1,   0 )
-#define MPP49_TDM_CH0_RX_QL    MPP( 49, 0x2, 0, 1, 0,   0,   0,   1,   1 )
-#define MPP49_PTP_CLK          MPP( 49, 0x5, 1, 0, 0,   0,   0,   1,   0 )
-#define MPP49_PEX0_CLKREQ      MPP( 49, 0xa, 0, 1, 0,   0,   0,   0,   1 )
+#define MPP49_TSMP9            MPP( 49, 0x1, 0, 0, 0,   0,   0,   1,   0 )
+#define MPP49_TDM_CH0_RX_QL    MPP( 49, 0x2, 0, 0, 0,   0,   0,   1,   1 )
+#define MPP49_PTP_CLK          MPP( 49, 0x5, 0, 0, 0,   0,   0,   1,   0 )
+#define MPP49_PEX0_CLKREQ      MPP( 49, 0xa, 0, 0, 0,   0,   0,   0,   1 )
 #define MPP49_LCD_D17          MPP( 49, 0xb, 0, 0, 0,   0,   0,   0,   1 )
 
 #define MPP_MAX                        49
index 2667f52e3b04da128e9ab7feef4c2fdb13b45fb1..9e3b90df32e1626c3858367910a2b446369d279d 100644 (file)
@@ -61,7 +61,7 @@
  */
 #define IRQ_LPC32XX_JTAG_COMM_TX       LPC32XX_SIC1_IRQ(1)
 #define IRQ_LPC32XX_JTAG_COMM_RX       LPC32XX_SIC1_IRQ(2)
-#define IRQ_LPC32XX_GPI_11             LPC32XX_SIC1_IRQ(4)
+#define IRQ_LPC32XX_GPI_28             LPC32XX_SIC1_IRQ(4)
 #define IRQ_LPC32XX_TS_P               LPC32XX_SIC1_IRQ(6)
 #define IRQ_LPC32XX_TS_IRQ             LPC32XX_SIC1_IRQ(7)
 #define IRQ_LPC32XX_TS_AUX             LPC32XX_SIC1_IRQ(8)
index 4eae566dfdc710934e7e834cabd7b2e83c1184cd..c74de01ab5b61bf2cd95dbdb6559545ab85e8f96 100644 (file)
@@ -118,6 +118,10 @@ static const struct lpc32xx_event_info lpc32xx_events[NR_IRQS] = {
                .event_group = &lpc32xx_event_pin_regs,
                .mask = LPC32XX_CLKPWR_EXTSRC_GPI_06_BIT,
        },
+       [IRQ_LPC32XX_GPI_28] = {
+               .event_group = &lpc32xx_event_pin_regs,
+               .mask = LPC32XX_CLKPWR_EXTSRC_GPI_28_BIT,
+       },
        [IRQ_LPC32XX_GPIO_00] = {
                .event_group = &lpc32xx_event_int_regs,
                .mask = LPC32XX_CLKPWR_INTSRC_GPIO_00_BIT,
@@ -305,9 +309,18 @@ static int lpc32xx_irq_wake(struct irq_data *d, unsigned int state)
 
                if (state)
                        eventreg |= lpc32xx_events[d->irq].mask;
-               else
+               else {
                        eventreg &= ~lpc32xx_events[d->irq].mask;
 
+                       /*
+                        * When disabling the wakeup, clear the latched
+                        * event
+                        */
+                       __raw_writel(lpc32xx_events[d->irq].mask,
+                               lpc32xx_events[d->irq].
+                               event_group->rawstat_reg);
+               }
+
                __raw_writel(eventreg,
                        lpc32xx_events[d->irq].event_group->enab_reg);
 
@@ -380,13 +393,15 @@ void __init lpc32xx_init_irq(void)
 
        /* Setup SIC1 */
        __raw_writel(0, LPC32XX_INTC_MASK(LPC32XX_SIC1_BASE));
-       __raw_writel(MIC_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC1_BASE));
-       __raw_writel(MIC_ATR_DEFAULT, LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC1_BASE));
+       __raw_writel(SIC1_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC1_BASE));
+       __raw_writel(SIC1_ATR_DEFAULT,
+                               LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC1_BASE));
 
        /* Setup SIC2 */
        __raw_writel(0, LPC32XX_INTC_MASK(LPC32XX_SIC2_BASE));
-       __raw_writel(MIC_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC2_BASE));
-       __raw_writel(MIC_ATR_DEFAULT, LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC2_BASE));
+       __raw_writel(SIC2_APR_DEFAULT, LPC32XX_INTC_POLAR(LPC32XX_SIC2_BASE));
+       __raw_writel(SIC2_ATR_DEFAULT,
+                               LPC32XX_INTC_ACT_TYPE(LPC32XX_SIC2_BASE));
 
        /* Configure supported IRQ's */
        for (i = 0; i < NR_IRQS; i++) {
index 429cfdbb2b3d60c29f4c3fc12d4a5001aa2dd219..f2735281616a1d8a9e008c09d7483fa637a314cf 100644 (file)
@@ -88,6 +88,7 @@ struct uartinit {
        char *uart_ck_name;
        u32 ck_mode_mask;
        void __iomem *pdiv_clk_reg;
+       resource_size_t mapbase;
 };
 
 static struct uartinit uartinit_data[] __initdata = {
@@ -97,6 +98,7 @@ static struct uartinit uartinit_data[] __initdata = {
                .ck_mode_mask =
                        LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 5),
                .pdiv_clk_reg = LPC32XX_CLKPWR_UART5_CLK_CTRL,
+               .mapbase = LPC32XX_UART5_BASE,
        },
 #endif
 #ifdef CONFIG_ARCH_LPC32XX_UART3_SELECT
@@ -105,6 +107,7 @@ static struct uartinit uartinit_data[] __initdata = {
                .ck_mode_mask =
                        LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 3),
                .pdiv_clk_reg = LPC32XX_CLKPWR_UART3_CLK_CTRL,
+               .mapbase = LPC32XX_UART3_BASE,
        },
 #endif
 #ifdef CONFIG_ARCH_LPC32XX_UART4_SELECT
@@ -113,6 +116,7 @@ static struct uartinit uartinit_data[] __initdata = {
                .ck_mode_mask =
                        LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 4),
                .pdiv_clk_reg = LPC32XX_CLKPWR_UART4_CLK_CTRL,
+               .mapbase = LPC32XX_UART4_BASE,
        },
 #endif
 #ifdef CONFIG_ARCH_LPC32XX_UART6_SELECT
@@ -121,6 +125,7 @@ static struct uartinit uartinit_data[] __initdata = {
                .ck_mode_mask =
                        LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 6),
                .pdiv_clk_reg = LPC32XX_CLKPWR_UART6_CLK_CTRL,
+               .mapbase = LPC32XX_UART6_BASE,
        },
 #endif
 };
@@ -165,11 +170,24 @@ void __init lpc32xx_serial_init(void)
 
                /* pre-UART clock divider set to 1 */
                __raw_writel(0x0101, uartinit_data[i].pdiv_clk_reg);
+
+               /*
+                * Force a flush of the RX FIFOs to work around a
+                * HW bug
+                */
+               puart = uartinit_data[i].mapbase;
+               __raw_writel(0xC1, LPC32XX_UART_IIR_FCR(puart));
+               __raw_writel(0x00, LPC32XX_UART_DLL_FIFO(puart));
+               j = LPC32XX_SUART_FIFO_SIZE;
+               while (j--)
+                       tmp = __raw_readl(
+                               LPC32XX_UART_DLL_FIFO(puart));
+               __raw_writel(0, LPC32XX_UART_IIR_FCR(puart));
        }
 
        /* This needs to be done after all UART clocks are setup */
        __raw_writel(clkmodes, LPC32XX_UARTCTL_CLKMODE);
-       for (i = 0; i < ARRAY_SIZE(uartinit_data) - 1; i++) {
+       for (i = 0; i < ARRAY_SIZE(uartinit_data); i++) {
                /* Force a flush of the RX FIFOs to work around a HW bug */
                puart = serial_std_platform_data[i].mapbase;
                __raw_writel(0xC1, LPC32XX_UART_IIR_FCR(puart));
index 17cb76060125ef0be126d5cc7f8d8c843e390f38..3588a55841532f4dc0c6c5268ec87b0e0c40319a 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/interrupt.h>
-#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
index 7bc17eaa12eba3835392554aa893aff71641fdac..ada1213982b4a6da1d3abae4235385a724c3e235 100644 (file)
@@ -24,7 +24,6 @@
 #include <mach/dma.h>
 #include <mach/devices.h>
 #include <mach/mfp.h>
-#include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <mach/pxa168.h>
 
index 8e3b5af04a57127aafbc7ee8f892828905835ddb..bc97170125bf6b410d04af230c2961d9739d2714 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/smc91x.h>
-#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
index 0cdd41004ad05d1001b80adf04a2a32bd164eaaf..a5dcf766a3f9ca53a050c8f4be1ec2823ac98145 100644 (file)
@@ -19,6 +19,7 @@
 #include <mach/mv78xx0.h>
 #include <mach/bridge-regs.h>
 #include <plat/cache-feroceon-l2.h>
+#include <plat/ehci-orion.h>
 #include <plat/orion_nand.h>
 #include <plat/time.h>
 #include <plat/common.h>
@@ -169,7 +170,7 @@ void __init mv78xx0_map_io(void)
  ****************************************************************************/
 void __init mv78xx0_ehci0_init(void)
 {
-       orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0);
+       orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0, EHCI_PHY_NA);
 }
 
 
index b61b50927123f3178320f084de9fe19910eb1862..3752302ae2ee3e3dc049cfe7cab40d5af7cb8af9 100644 (file)
 #define MPP_78100_A0_MASK    MPP(0, 0x0, 0, 0, 1)
 
 #define MPP0_GPIO        MPP(0, 0x0, 1, 1, 1)
-#define MPP0_GE0_COL        MPP(0, 0x1, 1, 0, 1)
-#define MPP0_GE1_TXCLK        MPP(0, 0x2, 0, 1, 1)
+#define MPP0_GE0_COL        MPP(0, 0x1, 0, 0, 1)
+#define MPP0_GE1_TXCLK        MPP(0, 0x2, 0, 0, 1)
 #define MPP0_UNUSED        MPP(0, 0x3, 0, 0, 1)
 
 #define MPP1_GPIO        MPP(1, 0x0, 1, 1, 1)
-#define MPP1_GE0_RXERR        MPP(1, 0x1, 1, 0, 1)
-#define MPP1_GE1_TXCTL        MPP(1, 0x2, 0, 1, 1)
+#define MPP1_GE0_RXERR        MPP(1, 0x1, 0, 0, 1)
+#define MPP1_GE1_TXCTL        MPP(1, 0x2, 0, 0, 1)
 #define MPP1_UNUSED        MPP(1, 0x3, 0, 0, 1)
 
 #define MPP2_GPIO        MPP(2, 0x0, 1, 1, 1)
-#define MPP2_GE0_CRS        MPP(2, 0x1, 1, 0, 1)
-#define MPP2_GE1_RXCTL        MPP(2, 0x2, 1, 0, 1)
+#define MPP2_GE0_CRS        MPP(2, 0x1, 0, 0, 1)
+#define MPP2_GE1_RXCTL        MPP(2, 0x2, 0, 0, 1)
 #define MPP2_UNUSED        MPP(2, 0x3, 0, 0, 1)
 
 #define MPP3_GPIO        MPP(3, 0x0, 1, 1, 1)
-#define MPP3_GE0_TXERR        MPP(3, 0x1, 0, 1, 1)
-#define MPP3_GE1_RXCLK        MPP(3, 0x2, 1, 0, 1)
+#define MPP3_GE0_TXERR        MPP(3, 0x1, 0, 0, 1)
+#define MPP3_GE1_RXCLK        MPP(3, 0x2, 0, 0, 1)
 #define MPP3_UNUSED        MPP(3, 0x3, 0, 0, 1)
 
 #define MPP4_GPIO        MPP(4, 0x0, 1, 1, 1)
-#define MPP4_GE0_TXD4        MPP(4, 0x1, 0, 1, 1)
-#define MPP4_GE1_TXD0        MPP(4, 0x2, 0, 1, 1)
+#define MPP4_GE0_TXD4        MPP(4, 0x1, 0, 0, 1)
+#define MPP4_GE1_TXD0        MPP(4, 0x2, 0, 0, 1)
 #define MPP4_UNUSED        MPP(4, 0x3, 0, 0, 1)
 
 #define MPP5_GPIO        MPP(5, 0x0, 1, 1, 1)
-#define MPP5_GE0_TXD5        MPP(5, 0x1, 0, 1, 1)
-#define MPP5_GE1_TXD1        MPP(5, 0x2, 0, 1, 1)
+#define MPP5_GE0_TXD5        MPP(5, 0x1, 0, 0, 1)
+#define MPP5_GE1_TXD1        MPP(5, 0x2, 0, 0, 1)
 #define MPP5_UNUSED        MPP(5, 0x3, 0, 0, 1)
 
 #define MPP6_GPIO        MPP(6, 0x0, 1, 1, 1)
-#define MPP6_GE0_TXD6        MPP(6, 0x1, 0, 1, 1)
-#define MPP6_GE1_TXD2        MPP(6, 0x2, 0, 1, 1)
+#define MPP6_GE0_TXD6        MPP(6, 0x1, 0, 0, 1)
+#define MPP6_GE1_TXD2        MPP(6, 0x2, 0, 0, 1)
 #define MPP6_UNUSED        MPP(6, 0x3, 0, 0, 1)
 
 #define MPP7_GPIO        MPP(7, 0x0, 1, 1, 1)
-#define MPP7_GE0_TXD7        MPP(7, 0x1, 0, 1, 1)
-#define MPP7_GE1_TXD3        MPP(7, 0x2, 0, 1, 1)
+#define MPP7_GE0_TXD7        MPP(7, 0x1, 0, 0, 1)
+#define MPP7_GE1_TXD3        MPP(7, 0x2, 0, 0, 1)
 #define MPP7_UNUSED        MPP(7, 0x3, 0, 0, 1)
 
 #define MPP8_GPIO        MPP(8, 0x0, 1, 1, 1)
-#define MPP8_GE0_RXD4        MPP(8, 0x1, 1, 0, 1)
-#define MPP8_GE1_RXD0        MPP(8, 0x2, 1, 0, 1)
+#define MPP8_GE0_RXD4        MPP(8, 0x1, 0, 0, 1)
+#define MPP8_GE1_RXD0        MPP(8, 0x2, 0, 0, 1)
 #define MPP8_UNUSED        MPP(8, 0x3, 0, 0, 1)
 
 #define MPP9_GPIO        MPP(9, 0x0, 1, 1, 1)
-#define MPP9_GE0_RXD5        MPP(9, 0x1, 1, 0, 1)
-#define MPP9_GE1_RXD1        MPP(9, 0x2, 1, 0, 1)
+#define MPP9_GE0_RXD5        MPP(9, 0x1, 0, 0, 1)
+#define MPP9_GE1_RXD1        MPP(9, 0x2, 0, 0, 1)
 #define MPP9_UNUSED        MPP(9, 0x3, 0, 0, 1)
 
 #define MPP10_GPIO        MPP(10, 0x0, 1, 1, 1)
-#define MPP10_GE0_RXD6        MPP(10, 0x1, 1, 0, 1)
-#define MPP10_GE1_RXD2        MPP(10, 0x2, 1, 0, 1)
+#define MPP10_GE0_RXD6        MPP(10, 0x1, 0, 0, 1)
+#define MPP10_GE1_RXD2        MPP(10, 0x2, 0, 0, 1)
 #define MPP10_UNUSED        MPP(10, 0x3, 0, 0, 1)
 
 #define MPP11_GPIO        MPP(11, 0x0, 1, 1, 1)
-#define MPP11_GE0_RXD7        MPP(11, 0x1, 1, 0, 1)
-#define MPP11_GE1_RXD3        MPP(11, 0x2, 1, 0, 1)
+#define MPP11_GE0_RXD7        MPP(11, 0x1, 0, 0, 1)
+#define MPP11_GE1_RXD3        MPP(11, 0x2, 0, 0, 1)
 #define MPP11_UNUSED        MPP(11, 0x3, 0, 0, 1)
 
 #define MPP12_GPIO        MPP(12, 0x0, 1, 1, 1)
-#define MPP12_M_BB        MPP(12, 0x3, 1, 0, 1)
-#define MPP12_UA0_CTSn        MPP(12, 0x4, 1, 0, 1)
-#define MPP12_NAND_FLASH_REn0    MPP(12, 0x5, 0, 1, 1)
-#define MPP12_TDM0_SCSn        MPP(12, 0X6, 0, 1, 1)
+#define MPP12_M_BB        MPP(12, 0x3, 0, 0, 1)
+#define MPP12_UA0_CTSn        MPP(12, 0x4, 0, 0, 1)
+#define MPP12_NAND_FLASH_REn0    MPP(12, 0x5, 0, 0, 1)
+#define MPP12_TDM0_SCSn        MPP(12, 0X6, 0, 0, 1)
 #define MPP12_UNUSED        MPP(12, 0x1, 0, 0, 1)
 
 #define MPP13_GPIO        MPP(13, 0x0, 1, 1, 1)
-#define MPP13_SYSRST_OUTn    MPP(13, 0x3, 0, 1, 1)
-#define MPP13_UA0_RTSn        MPP(13, 0x4, 0, 1, 1)
-#define MPP13_NAN_FLASH_WEn0    MPP(13, 0x5, 0, 1, 1)
-#define MPP13_TDM_SCLK        MPP(13, 0x6, 0, 1, 1)
+#define MPP13_SYSRST_OUTn    MPP(13, 0x3, 0, 0, 1)
+#define MPP13_UA0_RTSn        MPP(13, 0x4, 0, 0, 1)
+#define MPP13_NAN_FLASH_WEn0    MPP(13, 0x5, 0, 0, 1)
+#define MPP13_TDM_SCLK        MPP(13, 0x6, 0, 0, 1)
 #define MPP13_UNUSED        MPP(13, 0x1, 0, 0, 1)
 
 #define MPP14_GPIO        MPP(14, 0x0, 1, 1, 1)
-#define MPP14_SATA1_ACTn    MPP(14, 0x3, 0, 1, 1)
-#define MPP14_UA1_CTSn        MPP(14, 0x4, 1, 0, 1)
-#define MPP14_NAND_FLASH_REn1    MPP(14, 0x5, 0, 1, 1)
-#define MPP14_TDM_SMOSI        MPP(14, 0x6, 0, 1, 1)
+#define MPP14_SATA1_ACTn    MPP(14, 0x3, 0, 0, 1)
+#define MPP14_UA1_CTSn        MPP(14, 0x4, 0, 0, 1)
+#define MPP14_NAND_FLASH_REn1    MPP(14, 0x5, 0, 0, 1)
+#define MPP14_TDM_SMOSI        MPP(14, 0x6, 0, 0, 1)
 #define MPP14_UNUSED        MPP(14, 0x1, 0, 0, 1)
 
 #define MPP15_GPIO        MPP(15, 0x0, 1, 1, 1)
-#define MPP15_SATA0_ACTn    MPP(15, 0x3, 0, 1, 1)
-#define MPP15_UA1_RTSn        MPP(15, 0x4, 0, 1, 1)
-#define MPP15_NAND_FLASH_WEn1    MPP(15, 0x5, 0, 1, 1)
-#define MPP15_TDM_SMISO        MPP(15, 0x6, 1, 0, 1)
+#define MPP15_SATA0_ACTn    MPP(15, 0x3, 0, 0, 1)
+#define MPP15_UA1_RTSn        MPP(15, 0x4, 0, 0, 1)
+#define MPP15_NAND_FLASH_WEn1    MPP(15, 0x5, 0, 0, 1)
+#define MPP15_TDM_SMISO        MPP(15, 0x6, 0, 0, 1)
 #define MPP15_UNUSED        MPP(15, 0x1, 0, 0, 1)
 
 #define MPP16_GPIO        MPP(16, 0x0, 1, 1, 1)
-#define MPP16_SATA1_PRESENTn    MPP(16, 0x3, 0, 1, 1)
-#define MPP16_UA2_TXD        MPP(16, 0x4, 0, 1, 1)
-#define MPP16_NAND_FLASH_REn3    MPP(16, 0x5, 0, 1, 1)
-#define MPP16_TDM_INTn        MPP(16, 0x6, 1, 0, 1)
+#define MPP16_SATA1_PRESENTn    MPP(16, 0x3, 0, 0, 1)
+#define MPP16_UA2_TXD        MPP(16, 0x4, 0, 0, 1)
+#define MPP16_NAND_FLASH_REn3    MPP(16, 0x5, 0, 0, 1)
+#define MPP16_TDM_INTn        MPP(16, 0x6, 0, 0, 1)
 #define MPP16_UNUSED        MPP(16, 0x1, 0, 0, 1)
 
 
 #define MPP17_GPIO        MPP(17, 0x0, 1, 1, 1)
-#define MPP17_SATA0_PRESENTn    MPP(17, 0x3, 0, 1, 1)
-#define MPP17_UA2_RXD        MPP(17, 0x4, 1, 0, 1)
-#define MPP17_NAND_FLASH_WEn3    MPP(17, 0x5, 0, 1, 1)
-#define MPP17_TDM_RSTn        MPP(17, 0x6, 0, 1, 1)
+#define MPP17_SATA0_PRESENTn    MPP(17, 0x3, 0, 0, 1)
+#define MPP17_UA2_RXD        MPP(17, 0x4, 0, 0, 1)
+#define MPP17_NAND_FLASH_WEn3    MPP(17, 0x5, 0, 0, 1)
+#define MPP17_TDM_RSTn        MPP(17, 0x6, 0, 0, 1)
 #define MPP17_UNUSED        MPP(17, 0x1, 0, 0, 1)
 
 
 #define MPP18_GPIO        MPP(18, 0x0, 1, 1, 1)
-#define MPP18_UA0_CTSn        MPP(18, 0x4, 1, 0, 1)
-#define MPP18_BOOT_FLASH_REn    MPP(18, 0x5, 0, 1, 1)
+#define MPP18_UA0_CTSn        MPP(18, 0x4, 0, 0, 1)
+#define MPP18_BOOT_FLASH_REn    MPP(18, 0x5, 0, 0, 1)
 #define MPP18_UNUSED        MPP(18, 0x1, 0, 0, 1)
 
 
 
 #define MPP19_GPIO        MPP(19, 0x0, 1, 1, 1)
-#define MPP19_UA0_CTSn        MPP(19, 0x4, 0, 1, 1)
-#define MPP19_BOOT_FLASH_WEn    MPP(19, 0x5, 0, 1, 1)
+#define MPP19_UA0_CTSn        MPP(19, 0x4, 0, 0, 1)
+#define MPP19_BOOT_FLASH_WEn    MPP(19, 0x5, 0, 0, 1)
 #define MPP19_UNUSED        MPP(19, 0x1, 0, 0, 1)
 
 
 #define MPP20_GPIO        MPP(20, 0x0, 1, 1, 1)
-#define MPP20_UA1_CTSs        MPP(20, 0x4, 1, 0, 1)
-#define MPP20_TDM_PCLK        MPP(20, 0x6, 1, 1, 0)
+#define MPP20_UA1_CTSs        MPP(20, 0x4, 0, 0, 1)
+#define MPP20_TDM_PCLK        MPP(20, 0x6, 0, 0, 0)
 #define MPP20_UNUSED        MPP(20, 0x1, 0, 0, 1)
 
 
 
 #define MPP21_GPIO        MPP(21, 0x0, 1, 1, 1)
-#define MPP21_UA1_CTSs        MPP(21, 0x4, 0, 1, 1)
-#define MPP21_TDM_FSYNC        MPP(21, 0x6, 1, 1, 0)
+#define MPP21_UA1_CTSs        MPP(21, 0x4, 0, 0, 1)
+#define MPP21_TDM_FSYNC        MPP(21, 0x6, 0, 0, 0)
 #define MPP21_UNUSED        MPP(21, 0x1, 0, 0, 1)
 
 
 
 #define MPP22_GPIO        MPP(22, 0x0, 1, 1, 1)
-#define MPP22_UA3_TDX        MPP(22, 0x4, 0, 1, 1)
-#define MPP22_NAND_FLASH_REn2    MPP(22, 0x5, 0, 1, 1)
-#define MPP22_TDM_DRX        MPP(22, 0x6, 1, 0, 1)
+#define MPP22_UA3_TDX        MPP(22, 0x4, 0, 0, 1)
+#define MPP22_NAND_FLASH_REn2    MPP(22, 0x5, 0, 0, 1)
+#define MPP22_TDM_DRX        MPP(22, 0x6, 0, 0, 1)
 #define MPP22_UNUSED        MPP(22, 0x1, 0, 0, 1)
 
 
 
 #define MPP23_GPIO        MPP(23, 0x0, 1, 1, 1)
-#define MPP23_UA3_RDX        MPP(23, 0x4, 1, 0, 1)
-#define MPP23_NAND_FLASH_WEn2    MPP(23, 0x5, 0, 1, 1)
-#define MPP23_TDM_DTX        MPP(23, 0x6, 0, 1, 1)
+#define MPP23_UA3_RDX        MPP(23, 0x4, 0, 0, 1)
+#define MPP23_NAND_FLASH_WEn2    MPP(23, 0x5, 0, 0, 1)
+#define MPP23_TDM_DTX        MPP(23, 0x6, 0, 0, 1)
 #define MPP23_UNUSED        MPP(23, 0x1, 0, 0, 1)
 
 
 #define MPP24_GPIO        MPP(24, 0x0, 1, 1, 1)
-#define MPP24_UA2_TXD        MPP(24, 0x4, 0, 1, 1)
-#define MPP24_TDM_INTn        MPP(24, 0x6, 1, 0, 1)
+#define MPP24_UA2_TXD        MPP(24, 0x4, 0, 0, 1)
+#define MPP24_TDM_INTn        MPP(24, 0x6, 0, 0, 1)
 #define MPP24_UNUSED        MPP(24, 0x1, 0, 0, 1)
 
 
 #define MPP25_GPIO        MPP(25, 0x0, 1, 1, 1)
-#define MPP25_UA2_RXD        MPP(25, 0x4, 1, 0, 1)
-#define MPP25_TDM_RSTn        MPP(25, 0x6, 0, 1, 1)
+#define MPP25_UA2_RXD        MPP(25, 0x4, 0, 0, 1)
+#define MPP25_TDM_RSTn        MPP(25, 0x6, 0, 0, 1)
 #define MPP25_UNUSED        MPP(25, 0x1, 0, 0, 1)
 
 
 #define MPP26_GPIO        MPP(26, 0x0, 1, 1, 1)
-#define MPP26_UA2_CTSn        MPP(26, 0x4, 1, 0, 1)
-#define MPP26_TDM_PCLK        MPP(26, 0x6, 1, 1, 1)
+#define MPP26_UA2_CTSn        MPP(26, 0x4, 0, 0, 1)
+#define MPP26_TDM_PCLK        MPP(26, 0x6, 0, 0, 1)
 #define MPP26_UNUSED        MPP(26, 0x1, 0, 0, 1)
 
 
 #define MPP27_GPIO        MPP(27, 0x0, 1, 1, 1)
-#define MPP27_UA2_RTSn        MPP(27, 0x4, 0, 1, 1)
-#define MPP27_TDM_FSYNC        MPP(27, 0x6, 1, 1, 1)
+#define MPP27_UA2_RTSn        MPP(27, 0x4, 0, 0, 1)
+#define MPP27_TDM_FSYNC        MPP(27, 0x6, 0, 0, 1)
 #define MPP27_UNUSED        MPP(27, 0x1, 0, 0, 1)
 
 
 #define MPP28_GPIO        MPP(28, 0x0, 1, 1, 1)
-#define MPP28_UA3_TXD        MPP(28, 0x4, 0, 1, 1)
-#define MPP28_TDM_DRX        MPP(28, 0x6, 1, 0, 1)
+#define MPP28_UA3_TXD        MPP(28, 0x4, 0, 0, 1)
+#define MPP28_TDM_DRX        MPP(28, 0x6, 0, 0, 1)
 #define MPP28_UNUSED        MPP(28, 0x1, 0, 0, 1)
 
 #define MPP29_GPIO        MPP(29, 0x0, 1, 1, 1)
-#define MPP29_UA3_RXD        MPP(29, 0x4, 1, 0, 1)
-#define MPP29_SYSRST_OUTn    MPP(29, 0x5, 0, 1, 1)
-#define MPP29_TDM_DTX        MPP(29, 0x6, 0, 1, 1)
+#define MPP29_UA3_RXD        MPP(29, 0x4, 0, 0, 1)
+#define MPP29_SYSRST_OUTn    MPP(29, 0x5, 0, 0, 1)
+#define MPP29_TDM_DTX        MPP(29, 0x6, 0, 0, 1)
 #define MPP29_UNUSED        MPP(29, 0x1, 0, 0, 1)
 
 #define MPP30_GPIO        MPP(30, 0x0, 1, 1, 1)
-#define MPP30_UA3_CTSn        MPP(30, 0x4, 1, 0, 1)
+#define MPP30_UA3_CTSn        MPP(30, 0x4, 0, 0, 1)
 #define MPP30_UNUSED        MPP(30, 0x1, 0, 0, 1)
 
 #define MPP31_GPIO        MPP(31, 0x0, 1, 1, 1)
-#define MPP31_UA3_RTSn        MPP(31, 0x4, 0, 1, 1)
-#define MPP31_TDM1_SCSn        MPP(31, 0x6, 0, 1, 1)
+#define MPP31_UA3_RTSn        MPP(31, 0x4, 0, 0, 1)
+#define MPP31_TDM1_SCSn        MPP(31, 0x6, 0, 0, 1)
 #define MPP31_UNUSED        MPP(31, 0x1, 0, 0, 1)
 
 
 #define MPP32_GPIO        MPP(32, 0x1, 1, 1, 1)
-#define MPP32_UA3_TDX        MPP(32, 0x4, 0, 1, 1)
-#define MPP32_SYSRST_OUTn    MPP(32, 0x5, 0, 1, 1)
-#define MPP32_TDM0_RXQ        MPP(32, 0x6, 0, 1, 1)
+#define MPP32_UA3_TDX        MPP(32, 0x4, 0, 0, 1)
+#define MPP32_SYSRST_OUTn    MPP(32, 0x5, 0, 0, 1)
+#define MPP32_TDM0_RXQ        MPP(32, 0x6, 0, 0, 1)
 #define MPP32_UNUSED        MPP(32, 0x3, 0, 0, 1)
 
 
 #define MPP33_GPIO        MPP(33, 0x1, 1, 1, 1)
-#define MPP33_UA3_RDX        MPP(33, 0x4, 1, 0, 1)
-#define MPP33_TDM0_TXQ        MPP(33, 0x6, 0, 1, 1)
+#define MPP33_UA3_RDX        MPP(33, 0x4, 0, 0, 1)
+#define MPP33_TDM0_TXQ        MPP(33, 0x6, 0, 0, 1)
 #define MPP33_UNUSED        MPP(33, 0x3, 0, 0, 1)
 
 
 
 #define MPP34_GPIO        MPP(34, 0x1, 1, 1, 1)
-#define MPP34_UA2_TDX        MPP(34, 0x4, 0, 1, 1)
-#define MPP34_TDM1_RXQ        MPP(34, 0x6, 0, 1, 1)
+#define MPP34_UA2_TDX        MPP(34, 0x4, 0, 0, 1)
+#define MPP34_TDM1_RXQ        MPP(34, 0x6, 0, 0, 1)
 #define MPP34_UNUSED        MPP(34, 0x3, 0, 0, 1)
 
 
 
 #define MPP35_GPIO        MPP(35, 0x1, 1, 1, 1)
-#define MPP35_UA2_RDX        MPP(35, 0x4, 1, 0, 1)
-#define MPP35_TDM1_TXQ        MPP(35, 0x6, 0, 1, 1)
+#define MPP35_UA2_RDX        MPP(35, 0x4, 0, 0, 1)
+#define MPP35_TDM1_TXQ        MPP(35, 0x6, 0, 0, 1)
 #define MPP35_UNUSED        MPP(35, 0x3, 0, 0, 1)
 
 #define MPP36_GPIO        MPP(36, 0x1, 1, 1, 1)
-#define MPP36_UA0_CTSn        MPP(36, 0x2, 1, 0, 1)
-#define MPP36_UA2_TDX        MPP(36, 0x4, 0, 1, 1)
-#define MPP36_TDM0_SCSn        MPP(36, 0x6, 0, 1, 1)
+#define MPP36_UA0_CTSn        MPP(36, 0x2, 0, 0, 1)
+#define MPP36_UA2_TDX        MPP(36, 0x4, 0, 0, 1)
+#define MPP36_TDM0_SCSn        MPP(36, 0x6, 0, 0, 1)
 #define MPP36_UNUSED        MPP(36, 0x3, 0, 0, 1)
 
 
 #define MPP37_GPIO        MPP(37, 0x1, 1, 1, 1)
-#define MPP37_UA0_RTSn        MPP(37, 0x2, 0, 1, 1)
-#define MPP37_UA2_RXD        MPP(37, 0x4, 1, 0, 1)
-#define MPP37_SYSRST_OUTn    MPP(37, 0x5, 0, 1, 1)
-#define MPP37_TDM_SCLK        MPP(37, 0x6, 0, 1, 1)
+#define MPP37_UA0_RTSn        MPP(37, 0x2, 0, 0, 1)
+#define MPP37_UA2_RXD        MPP(37, 0x4, 0, 0, 1)
+#define MPP37_SYSRST_OUTn    MPP(37, 0x5, 0, 0, 1)
+#define MPP37_TDM_SCLK        MPP(37, 0x6, 0, 0, 1)
 #define MPP37_UNUSED        MPP(37, 0x3, 0, 0, 1)
 
 
 
 
 #define MPP38_GPIO        MPP(38, 0x1, 1, 1, 1)
-#define MPP38_UA1_CTSn        MPP(38, 0x2, 1, 0, 1)
-#define MPP38_UA3_TXD        MPP(38, 0x4, 0, 1, 1)
-#define MPP38_SYSRST_OUTn    MPP(38, 0x5, 0, 1, 1)
-#define MPP38_TDM_SMOSI        MPP(38, 0x6, 0, 1, 1)
+#define MPP38_UA1_CTSn        MPP(38, 0x2, 0, 0, 1)
+#define MPP38_UA3_TXD        MPP(38, 0x4, 0, 0, 1)
+#define MPP38_SYSRST_OUTn    MPP(38, 0x5, 0, 0, 1)
+#define MPP38_TDM_SMOSI        MPP(38, 0x6, 0, 0, 1)
 #define MPP38_UNUSED        MPP(38, 0x3, 0, 0, 1)
 
 
 
 
 #define MPP39_GPIO        MPP(39, 0x1, 1, 1, 1)
-#define MPP39_UA1_RTSn        MPP(39, 0x2, 0, 1, 1)
-#define MPP39_UA3_RXD        MPP(39, 0x4, 1, 0, 1)
-#define MPP39_SYSRST_OUTn    MPP(39, 0x5, 0, 1, 1)
-#define MPP39_TDM_SMISO        MPP(39, 0x6, 1, 0, 1)
+#define MPP39_UA1_RTSn        MPP(39, 0x2, 0, 0, 1)
+#define MPP39_UA3_RXD        MPP(39, 0x4, 0, 0, 1)
+#define MPP39_SYSRST_OUTn    MPP(39, 0x5, 0, 0, 1)
+#define MPP39_TDM_SMISO        MPP(39, 0x6, 0, 0, 1)
 #define MPP39_UNUSED        MPP(39, 0x3, 0, 0, 1)
 
 
 
 #define MPP40_GPIO        MPP(40, 0x1, 1, 1, 1)
-#define MPP40_TDM_INTn        MPP(40, 0x6, 1, 0, 1)
+#define MPP40_TDM_INTn        MPP(40, 0x6, 0, 0, 1)
 #define MPP40_UNUSED        MPP(40, 0x0, 0, 0, 1)
 
 
 
 #define MPP41_GPIO        MPP(41, 0x1, 1, 1, 1)
-#define MPP41_TDM_RSTn        MPP(41, 0x6, 0, 1, 1)
+#define MPP41_TDM_RSTn        MPP(41, 0x6, 0, 0, 1)
 #define MPP41_UNUSED        MPP(41, 0x0, 0, 0, 1)
 
 
 
 #define MPP42_GPIO        MPP(42, 0x1, 1, 1, 1)
-#define MPP42_TDM_PCLK        MPP(42, 0x6, 1, 1, 1)
+#define MPP42_TDM_PCLK        MPP(42, 0x6, 0, 0, 1)
 #define MPP42_UNUSED        MPP(42, 0x0, 0, 0, 1)
 
 
 
 #define MPP43_GPIO        MPP(43, 0x1, 1, 1, 1)
-#define MPP43_TDM_FSYNC        MPP(43, 0x6, 1, 1, 1)
+#define MPP43_TDM_FSYNC        MPP(43, 0x6, 0, 0, 1)
 #define MPP43_UNUSED        MPP(43, 0x0, 0, 0, 1)
 
 
 
 #define MPP44_GPIO        MPP(44, 0x1, 1, 1, 1)
-#define MPP44_TDM_DRX        MPP(44, 0x6, 1, 0, 1)
+#define MPP44_TDM_DRX        MPP(44, 0x6, 0, 0, 1)
 #define MPP44_UNUSED        MPP(44, 0x0, 0, 0, 1)
 
 
 
 #define MPP45_GPIO        MPP(45, 0x1, 1, 1, 1)
-#define MPP45_SATA0_ACTn    MPP(45, 0x3, 0, 1, 1)
-#define MPP45_TDM_DRX        MPP(45, 0x6, 0, 1, 1)
+#define MPP45_SATA0_ACTn    MPP(45, 0x3, 0, 0, 1)
+#define MPP45_TDM_DRX        MPP(45, 0x6, 0, 0, 1)
 #define MPP45_UNUSED        MPP(45, 0x0, 0, 0, 1)
 
 
 #define MPP46_GPIO        MPP(46, 0x1, 1, 1, 1)
-#define MPP46_TDM_SCSn        MPP(46, 0x6, 0, 1, 1)
+#define MPP46_TDM_SCSn        MPP(46, 0x6, 0, 0, 1)
 #define MPP46_UNUSED        MPP(46, 0x0, 0, 0, 1)
 
 
 
 
 #define MPP48_GPIO        MPP(48, 0x1, 1, 1, 1)
-#define MPP48_SATA1_ACTn    MPP(48, 0x3, 0, 1, 1)
+#define MPP48_SATA1_ACTn    MPP(48, 0x3, 0, 0, 1)
 #define MPP48_UNUSED        MPP(48, 0x2, 0, 0, 1)
 
 
 
 #define MPP49_GPIO        MPP(49, 0x1, 1, 1, 1)
-#define MPP49_SATA0_ACTn    MPP(49, 0x3, 0, 1, 1)
-#define MPP49_M_BB        MPP(49, 0x4, 1, 0, 1)
+#define MPP49_SATA0_ACTn    MPP(49, 0x3, 0, 0, 1)
+#define MPP49_M_BB        MPP(49, 0x4, 0, 0, 1)
 #define MPP49_UNUSED        MPP(49, 0x2, 0, 0, 1)
 
 
index 309369ea6978e59367e7e884875706b52f85478d..be2002f42dea61fec5ba1c1285c995266b42cdee 100644 (file)
@@ -416,13 +416,13 @@ static void __init innovator_init(void)
 #ifdef CONFIG_ARCH_OMAP15XX
        if (cpu_is_omap1510()) {
                omap1_usb_init(&innovator1510_usb_config);
-               innovator_config[1].data = &innovator1510_lcd_config;
+               innovator_config[0].data = &innovator1510_lcd_config;
        }
 #endif
 #ifdef CONFIG_ARCH_OMAP16XX
        if (cpu_is_omap1610()) {
                omap1_usb_init(&h2_usb_config);
-               innovator_config[1].data = &innovator1610_lcd_config;
+               innovator_config[0].data = &innovator1610_lcd_config;
        }
 #endif
        omap_board_config = innovator_config;
index d965da45160e67c4e03056a7d8c0d72178575042..e20c8ab80b0e189e4960599a1b7ee79875815a9f 100644 (file)
@@ -364,8 +364,8 @@ config OMAP3_SDRC_AC_TIMING
          going on could result in system crashes;
 
 config OMAP4_ERRATA_I688
-       bool "OMAP4 errata: Async Bridge Corruption (BROKEN)"
-       depends on ARCH_OMAP4 && BROKEN
+       bool "OMAP4 errata: Async Bridge Corruption"
+       depends on ARCH_OMAP4
        select ARCH_HAS_BARRIERS
        help
          If a data is stalled inside asynchronous bridge because of back
index fc9b238cbc190c1e657d07552131c7c767fa1104..bd76394ccaf8c90de32b824dc5dc65675a73fb18 100644 (file)
@@ -11,9 +11,9 @@ hwmod-common                          = omap_hwmod.o \
                                          omap_hwmod_common_data.o
 clock-common                           = clock.o clock_common_data.o \
                                          clkt_dpll.o clkt_clksel.o
-secure-common                          = omap-smc.o omap-secure.o
+secure-common                          = omap-smc.o omap-secure.o
 
-obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
 obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
 
index e921e3be24a4575d5bc4ea908f9fe8bc19c78355..d73316ed4207c600378cb538b73ae0daf04dcb2e 100644 (file)
@@ -437,7 +437,7 @@ static struct usbhs_omap_board_data usbhs_bdata __initdata = {
        .reset_gpio_port[2]  = -EINVAL
 };
 
-static void cm_t35_init_usbh(void)
+static void  __init cm_t35_init_usbh(void)
 {
        int err;
 
index d587560604836f5d7ee836b773f37798c17cdf41..ad497620539bccdada5a0907a19fab8f7da36813 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/i2c/twl.h>
 
 #include <mach/hardware.h>
+#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 
 #include <plat/board.h>
@@ -102,6 +103,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
+       .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap2_timer,
        .dt_compat      = omap242x_boards_compat,
@@ -141,6 +143,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
        .map_io         = omap3_map_io,
        .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_init,
        .timer          = &omap3_timer,
        .dt_compat      = omap3_boards_compat,
@@ -160,6 +163,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
        .map_io         = omap4_map_io,
        .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
+       .handle_irq     = gic_handle_irq,
        .init_machine   = omap4_init,
        .timer          = &omap4_timer,
        .dt_compat      = omap4_boards_compat,
index 42a4d11fad23de92c36cec7a87fe5ebfd34e4bbe..672262717601e012affe2a2f7e952c917ec22871 100644 (file)
@@ -371,7 +371,11 @@ static void n8x0_mmc_callback(void *data, u8 card_mask)
        else
                *openp = 0;
 
+#ifdef CONFIG_MMC_OMAP
        omap_mmc_notify_cover_event(mmc_device, index, *openp);
+#else
+       pr_warn("MMC: notify cover event not available\n");
+#endif
 }
 
 static int n8x0_mmc_late_init(struct device *dev)
index c775bead1497c3f487e22696bee4b59c6c46eeed..c877236a8442d235a4803c0903eb913d69ca3096 100644 (file)
@@ -381,7 +381,7 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
        gpio_request_one(gpio + 7, GPIOF_OUT_INIT_LOW, "EN_DVI");
 
        /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
-       gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+       gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
        platform_device_register(&leds_gpio);
 
index febffde2ff109ed4682fe0e311f93ee23aee2cbd..7e9338e8d684c7ff442a517be55de218ba34e8c7 100644 (file)
@@ -132,6 +132,7 @@ void omap3_map_io(void);
 void am33xx_map_io(void);
 void omap4_map_io(void);
 void ti81xx_map_io(void);
+void omap_barriers_init(void);
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
index cfdbb86bc84e5aae04357abce9b46d690ab0ccd7..72e018b9b260db422108f7d70084c7ae8d41ba2b 100644 (file)
@@ -65,7 +65,6 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
        struct timespec ts_preidle, ts_postidle, ts_idle;
        u32 cpu1_state;
        int idle_time;
-       int new_state_idx;
        int cpu_id = smp_processor_id();
 
        /* Used to keep track of the total time in idle */
@@ -84,8 +83,8 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
         */
        cpu1_state = pwrdm_read_pwrst(cpu1_pd);
        if (cpu1_state != PWRDM_POWER_OFF) {
-               new_state_idx = drv->safe_state_index;
-               cx = cpuidle_get_statedata(&dev->states_usage[new_state_idx]);
+               index = drv->safe_state_index;
+               cx = cpuidle_get_statedata(&dev->states_usage[index]);
        }
 
        if (index > 0)
index 997033129d2642fc022702c316c71e4376679fb1..bbb870c04a5e3ed3aa4f61777c187f3e33358ee9 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/smsc911x.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
 
 #include <plat/board.h>
 #include <plat/gpmc.h>
@@ -42,6 +44,50 @@ static struct smsc911x_platform_config gpmc_smsc911x_config = {
        .flags          = SMSC911X_USE_16BIT,
 };
 
+static struct regulator_consumer_supply gpmc_smsc911x_supply[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
+/* Generic regulator definition to satisfy smsc911x */
+static struct regulator_init_data gpmc_smsc911x_reg_init_data = {
+       .constraints = {
+               .min_uV                 = 3300000,
+               .max_uV                 = 3300000,
+               .valid_modes_mask       = REGULATOR_MODE_NORMAL
+                                       | REGULATOR_MODE_STANDBY,
+               .valid_ops_mask         = REGULATOR_CHANGE_MODE
+                                       | REGULATOR_CHANGE_STATUS,
+       },
+       .num_consumer_supplies  = ARRAY_SIZE(gpmc_smsc911x_supply),
+       .consumer_supplies      = gpmc_smsc911x_supply,
+};
+
+static struct fixed_voltage_config gpmc_smsc911x_fixed_reg_data = {
+       .supply_name            = "gpmc_smsc911x",
+       .microvolts             = 3300000,
+       .gpio                   = -EINVAL,
+       .startup_delay          = 0,
+       .enable_high            = 0,
+       .enabled_at_boot        = 1,
+       .init_data              = &gpmc_smsc911x_reg_init_data,
+};
+
+/*
+ * Platform device id of 42 is a temporary fix to avoid conflicts
+ * with other reg-fixed-voltage devices. The real fix should
+ * involve the driver core providing a way of dynamically
+ * assigning a unique id on registration for platform devices
+ * in the same name space.
+ */
+static struct platform_device gpmc_smsc911x_regulator = {
+       .name           = "reg-fixed-voltage",
+       .id             = 42,
+       .dev = {
+               .platform_data  = &gpmc_smsc911x_fixed_reg_data,
+       },
+};
+
 /*
  * Initialize smsc911x device connected to the GPMC. Note that we
  * assume that pin multiplexing is done in the board-*.c file,
@@ -55,6 +101,12 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data)
 
        gpmc_cfg = board_data;
 
+       ret = platform_device_register(&gpmc_smsc911x_regulator);
+       if (ret < 0) {
+               pr_err("Unable to register smsc911x regulators: %d\n", ret);
+               return;
+       }
+
        if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) {
                pr_err("Failed to request GPMC mem region\n");
                return;
index b40c288952987a2327d950abbfe374193f8f59e7..19dd1657245c58634dc3ac1e8005e823e7360dd5 100644 (file)
@@ -428,6 +428,7 @@ static int omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
        return 0;
 }
 
+static int omap_hsmmc_done;
 #define MAX_OMAP_MMC_HWMOD_NAME_LEN            16
 
 void omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
@@ -491,6 +492,11 @@ void omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 {
        u32 reg;
 
+       if (omap_hsmmc_done)
+               return;
+
+       omap_hsmmc_done = 1;
+
        if (!cpu_is_omap44xx()) {
                if (cpu_is_omap2430()) {
                        control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
index eb50c29fb6448e1404eef693e8f74c5e10641aed..fb11b44fbdecc77d6c8b5ce41e5da4f0aeecc1fc 100644 (file)
@@ -307,6 +307,7 @@ void __init omapam33xx_map_common_io(void)
 void __init omap44xx_map_common_io(void)
 {
        iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
+       omap_barriers_init();
 }
 #endif
 
index 609ea2ded7e388a22ed9c9d59ba888672ebb13ab..2cc1aa004b9457a92d26175c2770d1653ec355e4 100644 (file)
@@ -281,8 +281,16 @@ static struct omap_mbox mbox_iva_info = {
        .ops    = &omap2_mbox_ops,
        .priv   = &omap2_mbox_iva_priv,
 };
+#endif
 
-struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL };
+#ifdef CONFIG_ARCH_OMAP2
+struct omap_mbox *omap2_mboxes[] = {
+       &mbox_dsp_info,
+#ifdef CONFIG_SOC_OMAP2420
+       &mbox_iva_info,
+#endif
+       NULL
+};
 #endif
 
 #if defined(CONFIG_ARCH_OMAP4)
@@ -412,7 +420,8 @@ static void __exit omap2_mbox_exit(void)
        platform_driver_unregister(&omap2_mbox_driver);
 }
 
-module_init(omap2_mbox_init);
+/* must be ready before omap3isp is probed */
+subsys_initcall(omap2_mbox_init);
 module_exit(omap2_mbox_exit);
 
 MODULE_LICENSE("GPL v2");
index fb8bc9fa43b140fbfd5050ebc478833877b8066f..611a0e3d54ca34c47f8180faed43932191df26cf 100644 (file)
@@ -218,7 +218,7 @@ static int _omap_mux_get_by_name(struct omap_mux_partition *partition,
        return -ENODEV;
 }
 
-static int __init
+static int
 omap_mux_get_by_name(const char *muxname,
                        struct omap_mux_partition **found_partition,
                        struct omap_mux **found_mux)
index 40a8fbc07e4b766717b35e8b69f88794c1335df7..ebc595091312f325cff5638263dd72a09de9962e 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <plat/irqs.h>
 #include <plat/sram.h>
+#include <plat/omap-secure.h>
 
 #include <mach/hardware.h>
 #include <mach/omap-wakeupgen.h>
@@ -43,6 +44,9 @@ static void __iomem *sar_ram_base;
 
 void __iomem *dram_sync, *sram_sync;
 
+static phys_addr_t paddr;
+static u32 size;
+
 void omap_bus_sync(void)
 {
        if (dram_sync && sram_sync) {
@@ -52,18 +56,20 @@ void omap_bus_sync(void)
        }
 }
 
-static int __init omap_barriers_init(void)
+/* Steal one page physical memory for barrier implementation */
+int __init omap_barrier_reserve_memblock(void)
 {
-       struct map_desc dram_io_desc[1];
-       phys_addr_t paddr;
-       u32 size;
-
-       if (!cpu_is_omap44xx())
-               return -ENODEV;
 
        size = ALIGN(PAGE_SIZE, SZ_1M);
        paddr = arm_memblock_steal(size, SZ_1M);
 
+       return 0;
+}
+
+void __init omap_barriers_init(void)
+{
+       struct map_desc dram_io_desc[1];
+
        dram_io_desc[0].virtual = OMAP4_DRAM_BARRIER_VA;
        dram_io_desc[0].pfn = __phys_to_pfn(paddr);
        dram_io_desc[0].length = size;
@@ -75,9 +81,10 @@ static int __init omap_barriers_init(void)
        pr_info("OMAP4: Map 0x%08llx to 0x%08lx for dram barrier\n",
                (long long) paddr, dram_io_desc[0].virtual);
 
-       return 0;
 }
-core_initcall(omap_barriers_init);
+#else
+void __init omap_barriers_init(void)
+{}
 #endif
 
 void __init gic_init_irq(void)
index 1881fe9151495ba4fd542146fcee7c208565cb63..5a65dd04aa38ba8298168a5cb80e1d50766f1136 100644 (file)
@@ -174,14 +174,17 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
        freq = clk->rate;
        clk_put(clk);
 
+       rcu_read_lock();
        opp = opp_find_freq_ceil(dev, &freq);
        if (IS_ERR(opp)) {
+               rcu_read_unlock();
                pr_err("%s: unable to find boot up OPP for vdd_%s\n",
                        __func__, vdd_name);
                goto exit;
        }
 
        bootup_volt = opp_get_voltage(opp);
+       rcu_read_unlock();
        if (!bootup_volt) {
                pr_err("%s: unable to find voltage corresponding "
                        "to the bootup OPP for vdd_%s\n", __func__, vdd_name);
index b8822f8b289184c46332732bc20ebe2ea5605cb3..23de98d0384151b76274f67a99a10a005d4b3541 100644 (file)
@@ -82,13 +82,7 @@ static int omap2_fclks_active(void)
        f1 = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
        f2 = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
 
-       /* Ignore UART clocks.  These are handled by UART core (serial.c) */
-       f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK);
-       f2 &= ~OMAP24XX_EN_UART3_MASK;
-
-       if (f1 | f2)
-               return 1;
-       return 0;
+       return (f1 | f2) ? 1 : 0;
 }
 
 static void omap2_enter_full_retention(void)
index 771dc781b746377707c23f01b2cff2516711f6ec..f51348dafafdfb8ec85f48af6740fef8629f42b4 100644 (file)
@@ -486,7 +486,7 @@ static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
 void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
 {
        struct omap_hwmod       *oh[2];
-       struct omap_device      *od;
+       struct platform_device  *pdev;
        int                     bus_id = -1;
        int                     i;
 
@@ -522,11 +522,11 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
                return;
        }
 
-       od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,
+       pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,
                                (void *)&usbhs_data, sizeof(usbhs_data),
                                omap_uhhtll_latency,
                                ARRAY_SIZE(omap_uhhtll_latency), false);
-       if (IS_ERR(od)) {
+       if (IS_ERR(pdev)) {
                pr_err("Could not build hwmod devices %s,%s\n",
                        USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME);
                return;
index 0e28bae20bd4dfe88d57de429f54631f89d298a8..5dad38ec00ea1422c618d455e14cc3bd4c364d04 100644 (file)
@@ -29,6 +29,7 @@
 #include <mach/hardware.h>
 #include <mach/orion5x.h>
 #include <plat/orion_nand.h>
+#include <plat/ehci-orion.h>
 #include <plat/time.h>
 #include <plat/common.h>
 #include <plat/addr-map.h>
@@ -72,7 +73,8 @@ void __init orion5x_map_io(void)
  ****************************************************************************/
 void __init orion5x_ehci0_init(void)
 {
-       orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL);
+       orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL,
+                       EHCI_PHY_ORION);
 }
 
 
index 0d729e6619dfb411c6b4a5e875cc4e75a1928731..42d5cca66257bd1be97cb0c0b37c8569476d0795 100644 (file)
@@ -49,7 +49,6 @@ extern unsigned pxa3xx_get_clk_frequency_khz(int);
 #endif
 
 extern struct syscore_ops pxa_irq_syscore_ops;
-extern struct syscore_ops pxa_gpio_syscore_ops;
 extern struct syscore_ops pxa2xx_mfp_syscore_ops;
 extern struct syscore_ops pxa3xx_mfp_syscore_ops;
 
index fb9b62dcf4ca44099bbbca6cc02f750cd451384c..208eef1c04858a8ec76c40adcaddc131e5b5fb7f 100644 (file)
@@ -45,6 +45,7 @@
 #include <mach/hx4700.h>
 #include <mach/irda.h>
 
+#include <sound/ak4641.h>
 #include <video/platform_lcd.h>
 #include <video/w100fb.h>
 
@@ -764,6 +765,28 @@ static struct i2c_board_info __initdata pi2c_board_info[] = {
        },
 };
 
+/*
+ * Asahi Kasei AK4641 on I2C
+ */
+
+static struct ak4641_platform_data ak4641_info = {
+       .gpio_power = GPIO27_HX4700_CODEC_ON,
+       .gpio_npdn  = GPIO109_HX4700_CODEC_nPDN,
+};
+
+static struct i2c_board_info i2c_board_info[] __initdata = {
+       {
+               I2C_BOARD_INFO("ak4641", 0x12),
+               .platform_data = &ak4641_info,
+       },
+};
+
+static struct platform_device audio = {
+       .name   = "hx4700-audio",
+       .id     = -1,
+};
+
+
 /*
  * PCMCIA
  */
@@ -790,6 +813,7 @@ static struct platform_device *devices[] __initdata = {
        &gpio_vbus,
        &power_supply,
        &strataflash,
+       &audio,
        &pcmcia,
 };
 
@@ -827,6 +851,7 @@ static void __init hx4700_init(void)
        pxa_set_ficp_info(&ficp_info);
        pxa27x_set_i2c_power_info(NULL);
        pxa_set_i2c_info(NULL);
+       i2c_register_board_info(0, ARRAY_AND_SIZE(i2c_board_info));
        i2c_register_board_info(1, ARRAY_AND_SIZE(pi2c_board_info));
        pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
        spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
index f14775536b8385172e929791a627c3a689fb94ac..29b62afc6f7ca3d219b4f4498c4b62b3a6fee223 100644 (file)
@@ -226,6 +226,12 @@ static void __init pxa25x_mfp_init(void)
 {
        int i;
 
+       /* running before pxa_gpio_probe() */
+#ifdef CONFIG_CPU_PXA26x
+       pxa_last_gpio = 89;
+#else
+       pxa_last_gpio = 84;
+#endif
        for (i = 0; i <= pxa_last_gpio; i++)
                gpio_desc[i].valid = 1;
 
@@ -295,6 +301,7 @@ static void __init pxa27x_mfp_init(void)
 {
        int i, gpio;
 
+       pxa_last_gpio = 120;    /* running before pxa_gpio_probe() */
        for (i = 0; i <= pxa_last_gpio; i++) {
                /* skip GPIO2, 5, 6, 7, 8, they are not
                 * valid pins allow configuration
index 91e4f6c037661420e5f3e02e30af9174eef9edfd..3352b37b60cf8218025ab54df4af1358ed62ae1f 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/suspend.h>
 #include <linux/syscore_ops.h>
 #include <linux/irq.h>
-#include <linux/gpio.h>
 
 #include <asm/mach/map.h>
 #include <asm/suspend.h>
@@ -209,6 +208,7 @@ static struct clk_lookup pxa25x_clkregs[] = {
        INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"),
        INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"),
        INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL),
+       INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL),
 };
 
 static struct clk_lookup pxa25x_hwuart_clkreg =
@@ -368,7 +368,6 @@ static int __init pxa25x_init(void)
 
                register_syscore_ops(&pxa_irq_syscore_ops);
                register_syscore_ops(&pxa2xx_mfp_syscore_ops);
-               register_syscore_ops(&pxa_gpio_syscore_ops);
                register_syscore_ops(&pxa2xx_clock_syscore_ops);
 
                ret = platform_add_devices(pxa25x_devices,
index aed6cbcf386641e45147d67cb036301e9a6a54e6..6bce78edce7a3c070b197b57f1fcb16197c3ba7f 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/i2c/pxa-i2c.h>
-#include <linux/gpio.h>
 
 #include <asm/mach/map.h>
 #include <mach/hardware.h>
@@ -230,6 +229,7 @@ static struct clk_lookup pxa27x_clkregs[] = {
        INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
        INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
        INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL),
+       INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL),
 };
 
 #ifdef CONFIG_PM
@@ -456,7 +456,6 @@ static int __init pxa27x_init(void)
 
                register_syscore_ops(&pxa_irq_syscore_ops);
                register_syscore_ops(&pxa2xx_mfp_syscore_ops);
-               register_syscore_ops(&pxa_gpio_syscore_ops);
                register_syscore_ops(&pxa2xx_clock_syscore_ops);
 
                ret = platform_add_devices(devices, ARRAY_SIZE(devices));
index 4f402afa6609c0ed584100d951347ec1272f8531..3918a672238e4a368f0474c699ebc1c2cb680bb7 100644 (file)
@@ -462,7 +462,6 @@ static int __init pxa3xx_init(void)
 
                register_syscore_ops(&pxa_irq_syscore_ops);
                register_syscore_ops(&pxa3xx_mfp_syscore_ops);
-               register_syscore_ops(&pxa_gpio_syscore_ops);
                register_syscore_ops(&pxa3xx_clock_syscore_ops);
 
                ret = platform_add_devices(devices, ARRAY_SIZE(devices));
index d082a583df78a14c0bc4074db270bb8ce2393ca1..5ce434b95e87a52941f38ca8e023753b940802e5 100644 (file)
@@ -283,7 +283,6 @@ static int __init pxa95x_init(void)
                        return ret;
 
                register_syscore_ops(&pxa_irq_syscore_ops);
-               register_syscore_ops(&pxa_gpio_syscore_ops);
                register_syscore_ops(&pxa3xx_clock_syscore_ops);
 
                ret = platform_add_devices(devices, ARRAY_SIZE(devices));
index febc809ed5a6bd0657054bb78f59804e2a354f0a..5aded5e6148f55927f426d7abc46dcbacb372d38 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
 #include <linux/mfd/88pm860x.h>
-#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
index 8d5168d253a9c8829b54c2b09ea6b4e57b8c5fe5..30989baf7f2aa93a9cc0bd3e60c909a4b9f17e80 100644 (file)
@@ -168,6 +168,7 @@ struct battery_thresh sharpsl_battery_levels_noac[] = {
 #define MAXCTRL_SEL_SH   4
 #define MAXCTRL_STR      (1u << 7)
 
+extern int max1111_read_channel(int);
 /*
  * Read MAX1111 ADC
  */
@@ -177,8 +178,6 @@ int sharpsl_pm_pxa_read_max1111(int channel)
        if (machine_is_tosa())
            return 0;
 
-       extern int max1111_read_channel(int);
-
        /* max1111 accepts channels from 0-3, however,
         * it is encoded from 0-7 here in the code.
         */
index 34cbdac51525524517bbedd355df413e9b9c89a1..438f02fe122a6d1d727671675af53b7564b99ae4 100644 (file)
@@ -172,10 +172,9 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm)
 static unsigned long spitz_charger_wakeup(void)
 {
        unsigned long ret;
-       ret = (!gpio_get_value(SPITZ_GPIO_KEY_INT)
+       ret = ((!gpio_get_value(SPITZ_GPIO_KEY_INT)
                << GPIO_bit(SPITZ_GPIO_KEY_INT))
-               | (!gpio_get_value(SPITZ_GPIO_SYNC)
-               << GPIO_bit(SPITZ_GPIO_SYNC));
+               | gpio_get_value(SPITZ_GPIO_SYNC));
        return ret;
 }
 
index 7dc6c46b5e2ba4171b204f94513d190cbf855095..5404535da1a5863f8e2a471a1a1c968f2996943d 100644 (file)
@@ -115,7 +115,8 @@ static struct s3c_cpufreq_info s3c2410_cpufreq_info = {
        .debug_io_show  = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
 };
 
-static int s3c2410_cpufreq_add(struct device *dev)
+static int s3c2410_cpufreq_add(struct device *dev,
+                              struct subsys_interface *sif)
 {
        return s3c_cpufreq_register(&s3c2410_cpufreq_info);
 }
@@ -133,7 +134,8 @@ static int __init s3c2410_cpufreq_init(void)
 
 arch_initcall(s3c2410_cpufreq_init);
 
-static int s3c2410a_cpufreq_add(struct device *dev)
+static int s3c2410a_cpufreq_add(struct device *dev,
+                               struct subsys_interface *sif)
 {
        /* alter the maximum freq settings for S3C2410A. If a board knows
         * it only has a maximum of 200, then it should register its own
@@ -144,7 +146,7 @@ static int s3c2410a_cpufreq_add(struct device *dev)
        s3c2410_cpufreq_info.max.pclk =  66500000;
        s3c2410_cpufreq_info.name = "s3c2410a";
 
-       return s3c2410_cpufreq_add(dev);
+       return s3c2410_cpufreq_add(dev, sif);
 }
 
 static struct subsys_interface s3c2410a_cpufreq_interface = {
index 2afd00014a77f0aa05db8368a689794f0ed172e5..4803338cf56e07960dec40f97603dbd2d34e3072 100644 (file)
@@ -132,7 +132,8 @@ static struct s3c24xx_dma_order __initdata s3c2410_dma_order = {
        },
 };
 
-static int __init s3c2410_dma_add(struct device *dev)
+static int __init s3c2410_dma_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        s3c2410_dma_init();
        s3c24xx_dma_order_set(&s3c2410_dma_order);
@@ -148,7 +149,7 @@ static struct subsys_interface s3c2410_dma_interface = {
 
 static int __init s3c2410_dma_drvinit(void)
 {
-       return subsys_interface_register(&s3c2410_interface);
+       return subsys_interface_register(&s3c2410_dma_interface);
 }
 
 arch_initcall(s3c2410_dma_drvinit);
index c07438bfc99f4da3a4df64989c01ffca7aef8a5c..e0b3b347da82c38f1699ba279644e5d6a1da2bdf 100644 (file)
@@ -66,7 +66,7 @@ static struct cpufreq_frequency_table pll_vals_12MHz[] = {
     { .frequency = 270000000, .index = PLLVAL(127, 1, 1),  },
 };
 
-static int s3c2410_plls_add(struct device *dev)
+static int s3c2410_plls_add(struct device *dev, struct subsys_interface *sif)
 {
        return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz));
 }
index fda5385deff6f7e90800fa91006f472726705b86..03f706dd6009a2f21b5910991c4e228351529ba7 100644 (file)
@@ -111,7 +111,7 @@ struct syscore_ops s3c2410_pm_syscore_ops = {
        .resume         = s3c2410_pm_resume,
 };
 
-static int s3c2410_pm_add(struct device *dev)
+static int s3c2410_pm_add(struct device *dev, struct subsys_interface *sif)
 {
        pm_cpu_prep = s3c2410_pm_prepare;
        pm_cpu_sleep = s3c2410_cpu_suspend;
index d8664b7652ce3301bdc3e1317afd9f18b8133d3b..125be7d5fa601eefa2c911d2642589bbae24b550 100644 (file)
@@ -194,7 +194,8 @@ static struct s3c_cpufreq_info s3c2412_cpufreq_info = {
        .debug_io_show  = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs),
 };
 
-static int s3c2412_cpufreq_add(struct device *dev)
+static int s3c2412_cpufreq_add(struct device *dev,
+                              struct subsys_interface *sif)
 {
        unsigned long fclk_rate;
 
index 142acd3b5e1558280a4b574e9bdadebc4e230a2f..38472ac920ff16b13b2ae21c0e82e010dd4311a6 100644 (file)
@@ -159,7 +159,8 @@ static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
        .map_size       = ARRAY_SIZE(s3c2412_dma_mappings),
 };
 
-static int __init s3c2412_dma_add(struct device *dev)
+static int __init s3c2412_dma_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        s3c2410_dma_init();
        return s3c24xx_dma_init_map(&s3c2412_dma_sel);
index a8a46c1644f460040bf50cf1cf2a1aed78c1d1c2..e65619ddbccc3c1398a427b4bfb7d26689a68799 100644 (file)
@@ -170,7 +170,7 @@ static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state)
 
 static struct irq_chip s3c2412_irq_rtc_chip;
 
-static int s3c2412_irq_add(struct device *dev)
+static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
 {
        unsigned int irqno;
 
index d1adfa65f66da97ca0bd356d391644aa1801c607..d04588506ec401a99f7eddae63b2d1932d47d47c 100644 (file)
@@ -56,7 +56,7 @@ static void s3c2412_pm_prepare(void)
 {
 }
 
-static int s3c2412_pm_add(struct device *dev)
+static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif)
 {
        pm_cpu_prep = s3c2412_pm_prepare;
        pm_cpu_sleep = s3c2412_cpu_suspend;
index 36df761061deffcea6f04c73cc584f169d062c2e..fd49f35e448ec7090098a4293493df7ee8a32f86 100644 (file)
@@ -213,7 +213,8 @@ static int __init s3c2416_add_sub(unsigned int base,
        return 0;
 }
 
-static int __init s3c2416_irq_add(struct device *dev)
+static int __init s3c2416_irq_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        printk(KERN_INFO "S3C2416: IRQ Support\n");
 
index 3bdb15a0d419ce805c8bb7819b2adb534a0bce17..1bd4817b8eb8bef37a762e9fa870a1b8900522d5 100644 (file)
@@ -48,7 +48,7 @@ static void s3c2416_pm_prepare(void)
        __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
 }
 
-static int s3c2416_pm_add(struct device *dev)
+static int s3c2416_pm_add(struct device *dev, struct subsys_interface *sif)
 {
        pm_cpu_prep = s3c2416_pm_prepare;
        pm_cpu_sleep = s3c2416_cpu_suspend;
index bedbc87a3426fb2b9f6c1c83126bf1b021ce4289..414364eb426cf70d58a439b7e99b15e26c91a0c7 100644 (file)
@@ -149,7 +149,7 @@ static struct clk_lookup s3c2440_clk_lookup[] = {
        CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n),
 };
 
-static int s3c2440_clk_add(struct device *dev)
+static int s3c2440_clk_add(struct device *dev, struct subsys_interface *sif)
 {
        struct clk *clock_upll;
        struct clk *clock_h;
index db8a98ac68c54dea4e51e526fa0f7ed809e4e8c7..0c1eb1dfc534ac3d564d660d855d8ab32bea4a73 100644 (file)
@@ -12,6 +12,6 @@
 #ifndef __ARCH_ARM_MACH_S3C2440_COMMON_H
 #define __ARCH_ARM_MACH_S3C2440_COMMON_H
 
-void s3c2440_restart(char mode, const char *cmd);
+void s3c244x_restart(char mode, const char *cmd);
 
 #endif /* __ARCH_ARM_MACH_S3C2440_COMMON_H */
index 15b1ddf8f6266177099f757499d045b575b8eb7f..5f0a0c8ef84fdbc8066aab37898db9ebbf4c4024 100644 (file)
@@ -174,7 +174,8 @@ static struct s3c24xx_dma_order __initdata s3c2440_dma_order = {
        },
 };
 
-static int __init s3c2440_dma_add(struct device *dev)
+static int __init s3c2440_dma_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        s3c2410_dma_init();
        s3c24xx_dma_order_set(&s3c2440_dma_order);
index 4fee9bc6bcb51e5f0d025fb34912b8a455ceeb93..4a18cde439cc1d54854d73524b12f75b60beca72 100644 (file)
@@ -92,7 +92,7 @@ static struct irq_chip s3c_irq_wdtac97 = {
        .irq_ack        = s3c_irq_wdtac97_ack,
 };
 
-static int s3c2440_irq_add(struct device *dev)
+static int s3c2440_irq_add(struct device *dev, struct subsys_interface *sif)
 {
        unsigned int irqno;
 
index 24569550de1aa4967d9c2748310496c7425500b6..19b577bc09b80cbc3789c511c9f0c9d19c618c1e 100644 (file)
@@ -487,5 +487,5 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
        .init_machine   = anubis_init,
        .init_irq       = s3c24xx_init_irq,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index d6a9763110cdccaa22e543eeea09d1d8faa6a321..d7ae49c90118443cf0cc218f04a687945b6d1ab4 100644 (file)
@@ -222,5 +222,5 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
        .init_machine   = at2440evb_init,
        .init_irq       = s3c24xx_init_irq,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index 5859e609d28c51382009a01a9ced278054985987..9a4a5bc008e66149433ca0edc9147f14cfdc96f6 100644 (file)
@@ -601,5 +601,5 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = gta02_machine_init,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index adbbb85bc4cdd636f4196c4bf50468a21d7f0974..5d66fb218a41bcb121c5845e201009ffe0a0bbab 100644 (file)
@@ -701,5 +701,5 @@ MACHINE_START(MINI2440, "MINI2440")
        .init_machine   = mini2440_init,
        .init_irq       = s3c24xx_init_irq,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index 40eaf844bc1f61aa92b4dd33250850025bf380e8..5198e3e1c5bedb1fcf5d60820d6ffd4ef30675a1 100644 (file)
@@ -158,5 +158,5 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
        .init_machine   = nexcoder_init,
        .init_irq       = s3c24xx_init_irq,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index 4c480ef734f64ed97d5a8953f632ceb877464147..c5daeb612a88a35235c0f879e6789e0a94f0c1c1 100644 (file)
@@ -436,5 +436,5 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = osiris_init,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index 80077f6472ee7d7d4acfc1084a10ca94a85b0bbf..6f68abf44fab75156f6be5b69f7b32ba07582780 100644 (file)
@@ -822,5 +822,5 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
        .init_irq = s3c24xx_init_irq,
        .init_machine = rx1950_init_machine,
        .timer = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index 20103bafbd4bfa34b2e6d58e14b0d10d4486b3cd..56af354475984edf7af488359991fb6041baef9b 100644 (file)
@@ -213,5 +213,5 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
        .init_irq       = rx3715_init_irq,
        .init_machine   = rx3715_init_machine,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index 1deb60d12a60612284c3e1c0e6c141f5509dd9e4..83a1036d7dcbe5a7d329ba1f12856ccf4d657795 100644 (file)
@@ -183,5 +183,5 @@ MACHINE_START(S3C2440, "SMDK2440")
        .map_io         = smdk2440_map_io,
        .init_machine   = smdk2440_machine_init,
        .timer          = &s3c24xx_timer,
-       .restart        = s3c2440_restart,
+       .restart        = s3c244x_restart,
 MACHINE_END
index cf7596694efe07ec37eead10bc1e2932a92342f2..61776764d9f49eb3e0222fff76a8db387e51b4ed 100644 (file)
@@ -270,7 +270,8 @@ struct s3c_cpufreq_info s3c2440_cpufreq_info = {
        .debug_io_show  = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
 };
 
-static int s3c2440_cpufreq_add(struct device *dev)
+static int s3c2440_cpufreq_add(struct device *dev,
+                              struct subsys_interface *sif)
 {
        xtal = s3c_cpufreq_clk_get(NULL, "xtal");
        hclk = s3c_cpufreq_clk_get(NULL, "hclk");
index b5368ae8d7fe2e7a5b98ccb44f1045d9dfa6faa2..551fb433be871379af8a8db64d29657757bc05d8 100644 (file)
@@ -51,7 +51,7 @@ static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = {
        { .frequency = 400000000,       .index = PLLVAL(0x5c, 1, 1),  },        /* FVco 800.000000 */
 };
 
-static int s3c2440_plls12_add(struct device *dev)
+static int s3c2440_plls12_add(struct device *dev, struct subsys_interface *sif)
 {
        struct clk *xtal_clk;
        unsigned long xtal;
index 42f2b5cd23998bb27243485d3ebd60ac4d0304ae..3f15bcf642900c4a83f39ca11c4bd945974d24f7 100644 (file)
@@ -79,7 +79,8 @@ static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = {
        { .frequency = 402192000,       .index = PLLVAL(87, 2, 1),      },      /* FVco 804.384000 */
 };
 
-static int s3c2440_plls169344_add(struct device *dev)
+static int s3c2440_plls169344_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        struct clk *xtal_clk;
        unsigned long xtal;
index 517623a09fc5464f9c7209baa7ef3d8e0aa9fcce..2b3dddb49af75939d397d1f395cf2cc068ded504 100644 (file)
@@ -35,7 +35,6 @@
 #include <plat/cpu.h>
 #include <plat/s3c244x.h>
 #include <plat/pm.h>
-#include <plat/watchdog-reset.h>
 
 #include <plat/gpio-core.h>
 #include <plat/gpio-cfg.h>
@@ -74,15 +73,3 @@ void __init s3c2440_map_io(void)
        s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
        s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
 }
-
-void s3c2440_restart(char mode, const char *cmd)
-{
-       if (mode == 's') {
-               soft_restart(0);
-       }
-
-       arch_wdt_reset();
-
-       /* we'll take a jump through zero as a poor second */
-       soft_restart(0);
-}
index 8004e0497bf4e262cc52cf903b0bf49fcb026f9b..22cb7c94a8c8880d81b987f132acca9b39352bef 100644 (file)
@@ -122,7 +122,7 @@ static struct clk s3c2442_clk_cam_upll = {
        },
 };
 
-static int s3c2442_clk_add(struct device *dev)
+static int s3c2442_clk_add(struct device *dev, struct subsys_interface *sif)
 {
        struct clk *clock_upll;
        struct clk *clock_h;
index b3fdbdda3d5f368fe44e74b4a1c2f476b76c6622..6d9b688c442bd649f81bf93ef897cb295fc0f091 100644 (file)
@@ -72,7 +72,7 @@ static struct clk clk_arm = {
        },
 };
 
-static int s3c244x_clk_add(struct device *dev)
+static int s3c244x_clk_add(struct device *dev, struct subsys_interface *sif)
 {
        unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
        unsigned long clkdivn;
index 74d3dcf46a48ca30613cca2a06ef7c964d45f6c8..5fe8e58d3afdb5a5c6f7d1d40e621ed383b0dd42 100644 (file)
@@ -91,7 +91,7 @@ static struct irq_chip s3c_irq_cam = {
        .irq_ack        = s3c_irq_cam_ack,
 };
 
-static int s3c244x_irq_add(struct device *dev)
+static int s3c244x_irq_add(struct device *dev, struct subsys_interface *sif)
 {
        unsigned int irqno;
 
index 36bc60f61d0a46b9dfa9d74fd4a91d5be0425485..744930a870ebef2260dbe6fc85e152fd6947a85f 100644 (file)
@@ -46,6 +46,7 @@
 #include <plat/pm.h>
 #include <plat/pll.h>
 #include <plat/nand-core.h>
+#include <plat/watchdog-reset.h>
 
 static struct map_desc s3c244x_iodesc[] __initdata = {
        IODESC_ENT(CLKPWR),
@@ -196,3 +197,13 @@ struct syscore_ops s3c244x_pm_syscore_ops = {
        .suspend        = s3c244x_suspend,
        .resume         = s3c244x_resume,
 };
+
+void s3c244x_restart(char mode, const char *cmd)
+{
+       if (mode == 's')
+               soft_restart(0);
+
+       arch_wdt_reset();
+
+       /* we'll take a jump through zero as a poor second */
+       soft_restart(0);
index de6b4a23c9edb02b839ef53f01c7f0facf5a6320..14224517e6210d3010789ad45e7716116d8c015a 100644 (file)
@@ -135,7 +135,8 @@ static struct s3c24xx_dma_selection __initdata s3c2443_dma_sel = {
        .map_size       = ARRAY_SIZE(s3c2443_dma_mappings),
 };
 
-static int __init s3c2443_dma_add(struct device *dev)
+static int __init s3c2443_dma_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100);
        return s3c24xx_dma_init_map(&s3c2443_dma_sel);
index 35e4ff24fb43f89c9cc5c162efd9df04572d0c30..ac2829f56d1277d3437b2c85a1043097c766282b 100644 (file)
@@ -241,7 +241,8 @@ static int __init s3c2443_add_sub(unsigned int base,
        return 0;
 }
 
-static int __init s3c2443_irq_add(struct device *dev)
+static int __init s3c2443_irq_add(struct device *dev,
+                                 struct subsys_interface *sif)
 {
        printk("S3C2443: IRQ Support\n");
 
index 31bb27dc4aeba8ace23ad4a8bdb80df742657085..aebbcc291b4e2ae35c5d8dee6035002fa038bd49 100644 (file)
@@ -138,6 +138,11 @@ static struct clk init_clocks_off[] = {
                .ctrlbit        = S3C_CLKCON_PCLK_TSADC,
        }, {
                .name           = "i2c",
+#ifdef CONFIG_S3C_DEV_I2C1
+               .devname        = "s3c2440-i2c.0",
+#else
+               .devname        = "s3c2440-i2c",
+#endif
                .parent         = &clk_p,
                .enable         = s3c64xx_pclk_ctrl,
                .ctrlbit        = S3C_CLKCON_PCLK_IIC,
index 4a7394d4bd9ea0e2f79fbb2af25a19c862cf7257..bee7dcd4df7c34ad8fb381173d1a7250a80b418a 100644 (file)
@@ -49,7 +49,7 @@
 
 /* uart registration process */
 
-void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+static void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
        s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
 }
index 23f9b22439c955863430198cb32b2f66c6a52854..9cba18bfe47bbd56bc197518fdd48496f5980664 100644 (file)
@@ -160,7 +160,7 @@ static void s5p64x0_pm_prepare(void)
 
 }
 
-static int s5p64x0_pm_add(struct device *dev)
+static int s5p64x0_pm_add(struct device *dev, struct subsys_interface *sif)
 {
        pm_cpu_prep = s5p64x0_pm_prepare;
        pm_cpu_sleep = s5p64x0_cpu_suspend;
index c78dfddd77fd374f0377e1c6694ce594ebe5bd98..b9ec0c35379f572ebf63fc9dd4d2af97c5a0d377 100644 (file)
@@ -175,7 +175,7 @@ static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable)
        return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable);
 }
 
-static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
+static int s5pv210_clk_hdmiphy_ctrl(struct clk *clk, int enable)
 {
        return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
 }
@@ -372,7 +372,7 @@ static struct clk init_clocks_off[] = {
        }, {
                .name           = "hdmiphy",
                .devname        = "s5pv210-hdmi",
-               .enable         = exynos4_clk_hdmiphy_ctrl,
+               .enable         = s5pv210_clk_hdmiphy_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "dacphy",
index 677c71c41e50fc1830b99556ea8d429e24db31ef..736bfb103cbc4acc3e38f057bd018cc841e2b420 100644 (file)
@@ -133,7 +133,7 @@ static void s5pv210_pm_prepare(void)
        s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
 }
 
-static int s5pv210_pm_add(struct device *dev)
+static int s5pv210_pm_add(struct device *dev, struct subsys_interface *sif)
 {
        pm_cpu_prep = s5pv210_pm_prepare;
        pm_cpu_sleep = s5pv210_cpu_suspend;
index eff8a96c75ee558298827e5c15a34fbf7af56ae9..068b754bc348ff20f1c091264cb80e3a09edf134 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/serial_sci.h>
 #include <linux/smsc911x.h>
 #include <linux/gpio.h>
+#include <linux/videodev2.h>
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/mmc/host.h>
@@ -37,7 +38,6 @@
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/sh_clk.h>
-#include <linux/dma-mapping.h>
 #include <video/sh_mobile_lcdc.h>
 #include <video/sh_mipi_dsi.h>
 #include <sound/sh_fsi.h>
@@ -159,19 +159,12 @@ static struct resource sh_mmcif_resources[] = {
        },
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-       .chan_priv_rx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_RX,
-       },
-       .chan_priv_tx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_TX,
-       },
-};
 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
        .sup_pclk       = 0,
        .ocr            = MMC_VDD_165_195,
        .caps           = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
-       .dma            = &sh_mmcif_dma,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device mmc_device = {
@@ -321,12 +314,11 @@ static struct resource mipidsi0_resources[] = {
        },
 };
 
-#define DSI0PHYCR      0xe615006c
 static int sh_mipi_set_dot_clock(struct platform_device *pdev,
                                 void __iomem *base,
                                 int enable)
 {
-       struct clk *pck;
+       struct clk *pck, *phy;
        int ret;
 
        pck = clk_get(&pdev->dev, "dsip_clk");
@@ -335,18 +327,27 @@ static int sh_mipi_set_dot_clock(struct platform_device *pdev,
                goto sh_mipi_set_dot_clock_pck_err;
        }
 
+       phy = clk_get(&pdev->dev, "dsiphy_clk");
+       if (IS_ERR(phy)) {
+               ret = PTR_ERR(phy);
+               goto sh_mipi_set_dot_clock_phy_err;
+       }
+
        if (enable) {
                clk_set_rate(pck, clk_round_rate(pck,  24000000));
-               __raw_writel(0x2a809010, DSI0PHYCR);
+               clk_set_rate(phy, clk_round_rate(pck, 510000000));
                clk_enable(pck);
+               clk_enable(phy);
        } else {
                clk_disable(pck);
+               clk_disable(phy);
        }
 
        ret = 0;
 
+       clk_put(phy);
+sh_mipi_set_dot_clock_phy_err:
        clk_put(pck);
-
 sh_mipi_set_dot_clock_pck_err:
        return ret;
 }
index aab0a349f759baaa6469373270539cab35b9cee4..eeb4d96645845dbaa974e138d6903ce331329cb9 100644 (file)
@@ -295,15 +295,6 @@ static struct resource sh_mmcif_resources[] = {
        },
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-       .chan_priv_rx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_RX,
-       },
-       .chan_priv_tx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_TX,
-       },
-};
-
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
        .sup_pclk       = 0,
        .ocr            = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -311,7 +302,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
                          MMC_CAP_8_BIT_DATA |
                          MMC_CAP_NEEDS_POLL,
        .get_cd         = slot_cn7_get_cd,
-       .dma            = &sh_mmcif_dma,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device sh_mmcif_device = {
index 857ceeec1bb0e9975eb589deb82fbde7a9be856a..c8e7ca23fc06f57794feca6900bf89a1445e41c4 100644 (file)
@@ -143,11 +143,10 @@ static struct gpio_keys_button gpio_buttons[] = {
 static struct gpio_keys_platform_data gpio_key_info = {
        .buttons        = gpio_buttons,
        .nbuttons       = ARRAY_SIZE(gpio_buttons),
-       .poll_interval  = 250, /* polled for now */
 };
 
 static struct platform_device gpio_keys_device = {
-       .name   = "gpio-keys-polled", /* polled for now */
+       .name   = "gpio-keys",
        .id     = -1,
        .dev    = {
                .platform_data  = &gpio_key_info,
index 9b42fbd10f8edf2873dbfba0bf6399305c8603db..a2813247b4558d540682c391c0ca07e5ffbc261b 100644 (file)
@@ -43,7 +43,6 @@
 #include <linux/smsc911x.h>
 #include <linux/sh_intc.h>
 #include <linux/tca6416_keypad.h>
-#include <linux/usb/r8a66597.h>
 #include <linux/usb/renesas_usbhs.h>
 #include <linux/dma-mapping.h>
 
  * 1-2 short | VBUS 5V       | Host
  * open      | external VBUS | Function
  *
- * *1
- * CN31 is used as
- * CONFIG_USB_R8A66597_HCD     Host
- * CONFIG_USB_RENESAS_USBHS    Function
- *
  * CAUTION
  *
  * renesas_usbhs driver can use external interrupt mode
  * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0",
  * because Touchscreen is using IRQ7-PORT40.
  * It is impossible to use IRQ7 demux on this board.
- *
- * We can use external interrupt mode USB-Function on "USB1".
- * USB1 can become Host by r8a66597, and become Function by renesas_usbhs.
- * But don't select both drivers in same time.
- * These uses same IRQ number for request_irq(), and aren't supporting
- * IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE.
- *
- * Actually these are old/new version of USB driver.
- * This mean its register will be broken if it supports shared IRQ,
  */
 
 /*
  *
  */
 
+/*
+ * FSI - AK4642
+ *
+ * it needs amixer settings for playing
+ *
+ * amixer set "Headphone" on
+ * amixer set "HPOUTL Mixer DACH" on
+ * amixer set "HPOUTR Mixer DACH" on
+ */
+
 /*
  * FIXME !!
  *
@@ -676,51 +671,16 @@ static struct platform_device usbhs0_device = {
  * Use J30 to select between Host and Function. This setting
  * can however not be detected by software. Hotplug of USBHS1
  * is provided via IRQ8.
+ *
+ * Current USB1 works as "USB Host".
+ *  - set J30 "short"
+ *
+ * If you want to use it as "USB gadget",
+ *  - J30 "open"
+ *  - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
+ *  - add .get_vbus = usbhs_get_vbus in usbhs1_private
  */
 #define IRQ8 evt2irq(0x0300)
-
-/* USBHS1 USB Host support via r8a66597_hcd */
-static void usb1_host_port_power(int port, int power)
-{
-       if (!power) /* only power-on is supported for now */
-               return;
-
-       /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
-       __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
-}
-
-static struct r8a66597_platdata usb1_host_data = {
-       .on_chip        = 1,
-       .port_power     = usb1_host_port_power,
-};
-
-static struct resource usb1_host_resources[] = {
-       [0] = {
-               .name   = "USBHS1",
-               .start  = 0xe68b0000,
-               .end    = 0xe68b00e6 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x1ce0) /* USB1_USB1I0 */,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device usb1_host_device = {
-       .name   = "r8a66597_hcd",
-       .id     = 1,
-       .dev = {
-               .dma_mask               = NULL,         /*  not use dma */
-               .coherent_dma_mask      = 0xffffffff,
-               .platform_data          = &usb1_host_data,
-       },
-       .num_resources  = ARRAY_SIZE(usb1_host_resources),
-       .resource       = usb1_host_resources,
-};
-
-/* USBHS1 USB Function support via renesas_usbhs */
-
 #define USB_PHY_MODE           (1 << 4)
 #define USB_PHY_INT_EN         ((1 << 3) | (1 << 2))
 #define USB_PHY_ON             (1 << 1)
@@ -776,7 +736,7 @@ static void usbhs1_hardware_exit(struct platform_device *pdev)
 
 static int usbhs1_get_id(struct platform_device *pdev)
 {
-       return USBHS_GADGET;
+       return USBHS_HOST;
 }
 
 static u32 usbhs1_pipe_cfg[] = {
@@ -807,7 +767,6 @@ static struct usbhs_private usbhs1_private = {
                        .hardware_exit  = usbhs1_hardware_exit,
                        .get_id         = usbhs1_get_id,
                        .phy_reset      = usbhs_phy_reset,
-                       .get_vbus       = usbhs_get_vbus,
                },
                .driver_param = {
                        .buswait_bwait  = 4,
@@ -1184,15 +1143,6 @@ static struct resource sh_mmcif_resources[] = {
        },
 };
 
-static struct sh_mmcif_dma sh_mmcif_dma = {
-       .chan_priv_rx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_RX,
-       },
-       .chan_priv_tx   = {
-               .slave_id       = SHDMA_SLAVE_MMCIF_TX,
-       },
-};
-
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
        .sup_pclk       = 0,
        .ocr            = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -1200,7 +1150,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
                          MMC_CAP_8_BIT_DATA |
                          MMC_CAP_NEEDS_POLL,
        .get_cd         = slot_cn7_get_cd,
-       .dma            = &sh_mmcif_dma,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device sh_mmcif_device = {
@@ -1311,7 +1262,6 @@ static struct platform_device *mackerel_devices[] __initdata = {
        &nor_flash_device,
        &smc911x_device,
        &lcdc_device,
-       &usb1_host_device,
        &usbhs1_device,
        &usbhs0_device,
        &leds_device,
@@ -1473,9 +1423,6 @@ static void __init mackerel_init(void)
        gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */
        gpio_request(GPIO_FN_IDIN_1_113, NULL);
 
-       /* USB phy tweak to make the r8a66597_hcd host driver work */
-       __raw_writew(0x8a0a, 0xe6058130);       /* USBCR4 */
-
        /* enable FSI2 port A (ak4643) */
        gpio_request(GPIO_FN_FSIAIBT,   NULL);
        gpio_request(GPIO_FN_FSIAILR,   NULL);
index afbead6a6e1728d51a653f8bca52dcdc01276fbe..7727cca6136cf716a30e0d9be75241566fc6087c 100644 (file)
@@ -365,6 +365,114 @@ static struct clk div6_clks[DIV6_NR] = {
                        dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
 };
 
+/* DSI DIV */
+static unsigned long dsiphy_recalc(struct clk *clk)
+{
+       u32 value;
+
+       value = __raw_readl(clk->mapping->base);
+
+       /* FIXME */
+       if (!(value & 0x000B8000))
+               return clk->parent->rate;
+
+       value &= 0x3f;
+       value += 1;
+
+       if ((value < 12) ||
+           (value > 33)) {
+               pr_err("DSIPHY has wrong value (%d)", value);
+               return 0;
+       }
+
+       return clk->parent->rate / value;
+}
+
+static long dsiphy_round_rate(struct clk *clk, unsigned long rate)
+{
+       return clk_rate_mult_range_round(clk, 12, 33, rate);
+}
+
+static void dsiphy_disable(struct clk *clk)
+{
+       u32 value;
+
+       value = __raw_readl(clk->mapping->base);
+       value &= ~0x000B8000;
+
+       __raw_writel(value , clk->mapping->base);
+}
+
+static int dsiphy_enable(struct clk *clk)
+{
+       u32 value;
+       int multi;
+
+       value = __raw_readl(clk->mapping->base);
+       multi = (value & 0x3f) + 1;
+
+       if ((multi < 12) || (multi > 33))
+               return -EIO;
+
+       __raw_writel(value | 0x000B8000, clk->mapping->base);
+
+       return 0;
+}
+
+static int dsiphy_set_rate(struct clk *clk, unsigned long rate)
+{
+       u32 value;
+       int idx;
+
+       idx = rate / clk->parent->rate;
+       if ((idx < 12) || (idx > 33))
+               return -EINVAL;
+
+       idx += -1;
+
+       value = __raw_readl(clk->mapping->base);
+       value = (value & ~0x3f) + idx;
+
+       __raw_writel(value, clk->mapping->base);
+
+       return 0;
+}
+
+static struct clk_ops dsiphy_clk_ops = {
+       .recalc         = dsiphy_recalc,
+       .round_rate     = dsiphy_round_rate,
+       .set_rate       = dsiphy_set_rate,
+       .enable         = dsiphy_enable,
+       .disable        = dsiphy_disable,
+};
+
+static struct clk_mapping dsi0phy_clk_mapping = {
+       .phys   = DSI0PHYCR,
+       .len    = 4,
+};
+
+static struct clk_mapping dsi1phy_clk_mapping = {
+       .phys   = DSI1PHYCR,
+       .len    = 4,
+};
+
+static struct clk dsi0phy_clk = {
+       .ops            = &dsiphy_clk_ops,
+       .parent         = &div6_clks[DIV6_DSI0P], /* late install */
+       .mapping        = &dsi0phy_clk_mapping,
+};
+
+static struct clk dsi1phy_clk = {
+       .ops            = &dsiphy_clk_ops,
+       .parent         = &div6_clks[DIV6_DSI1P], /* late install */
+       .mapping        = &dsi1phy_clk_mapping,
+};
+
+static struct clk *late_main_clks[] = {
+       &dsi0phy_clk,
+       &dsi1phy_clk,
+};
+
 enum { MSTP001,
        MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
        MSTP219,
@@ -429,6 +537,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
        CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
        CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
+       CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
+       CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
 
        /* MSTP32 clocks */
        CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
@@ -504,6 +614,9 @@ void __init sh73a0_clock_init(void)
        if (!ret)
                ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
 
+       for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
+               ret = clk_register(late_main_clks[k]);
+
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
        if (!ret)
index 881d515a9686f3786179003b2f5d4c5816fe6ac7..cad57578ceedd6bc6d83b53222bc7d74a1f6b113 100644 (file)
@@ -515,8 +515,8 @@ enum {
        SHDMA_SLAVE_MMCIF_RX,
 };
 
-/* PINT interrupts are located at Linux IRQ 768 and up */
-#define SH73A0_PINT0_IRQ(irq) ((irq) + 768)
-#define SH73A0_PINT1_IRQ(irq) ((irq) + 800)
+/* PINT interrupts are located at Linux IRQ 800 and up */
+#define SH73A0_PINT0_IRQ(irq) ((irq) + 800)
+#define SH73A0_PINT1_IRQ(irq) ((irq) + 832)
 
 #endif /* __ASM_SH73A0_H__ */
index 1eda6b0b69e308d24df75285cf10ba07d1f8e4b3..9857595eaa7925186f73664277c0ddf9a57a481b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/sh_intc.h>
@@ -445,6 +446,7 @@ void __init sh73a0_init_irq(void)
                setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]);
 
                n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k)));
+               WARN_ON(irq_alloc_desc_at(n, numa_node_id()) != n);
                irq_set_chip_and_handler_name(n, &intca_gic_irq_chip,
                                              handle_level_irq, "level");
                set_irq_flags(n, IRQF_VALID); /* yuck */
index 963532f2b2c46b0fb98727728b33fdc9e11d695f..d14c9b048077b855d45740efae7c82dc28d8b261 100644 (file)
@@ -2120,7 +2120,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
            FN_AUDATA3, 0, 0, 0 }
        },
        { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32,
-                            3, 1, 1, 1, 1, 1, 1, 3, 3, 1,
+                            3, 1, 1, 1, 1, 1, 1, 3, 3,
                             1, 1, 1, 1, 1, 1, 3, 3, 3, 2) {
            /* IP4_31_29 [3] */
            FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0,
index 1bd6585a6acffd23a3094c90487a723fca5beb09..336093f9210ac7cfab8eb4f48c4b4061da8fef91 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/gpio.h>
+#include <mach/irqs.h>
 #include <mach/sh7372.h>
 
 #define CPU_ALL_PORT(fn, pfx, sfx) \
@@ -1594,6 +1595,43 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
        { },
 };
 
+#define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5))
+#define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5))
+static struct pinmux_irq pinmux_irqs[] = {
+       PINMUX_IRQ(EXT_IRQ16L(0), PORT6_FN0, PORT162_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(1), PORT12_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(2), PORT4_FN0, PORT5_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(3), PORT8_FN0, PORT16_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(4), PORT17_FN0, PORT163_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(5), PORT18_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(6), PORT39_FN0, PORT164_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(7), PORT40_FN0, PORT167_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(8), PORT41_FN0, PORT168_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(9), PORT42_FN0, PORT169_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(10), PORT65_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(11), PORT67_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(12), PORT80_FN0, PORT137_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(13), PORT81_FN0, PORT145_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(14), PORT82_FN0, PORT146_FN0),
+       PINMUX_IRQ(EXT_IRQ16L(15), PORT83_FN0, PORT147_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(16), PORT84_FN0, PORT170_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(17), PORT85_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(18), PORT86_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(19), PORT87_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(20), PORT92_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(21), PORT93_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(22), PORT94_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(23), PORT95_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(24), PORT112_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(25), PORT119_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(26), PORT121_FN0, PORT172_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(27), PORT122_FN0, PORT180_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(28), PORT123_FN0, PORT181_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(29), PORT129_FN0, PORT182_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(30), PORT130_FN0, PORT183_FN0),
+       PINMUX_IRQ(EXT_IRQ16H(31), PORT138_FN0, PORT184_FN0),
+};
+
 static struct pinmux_info sh7372_pinmux_info = {
        .name = "sh7372_pfc",
        .reserved_id = PINMUX_RESERVED,
@@ -1614,6 +1652,9 @@ static struct pinmux_info sh7372_pinmux_info = {
 
        .gpio_data = pinmux_data,
        .gpio_data_size = ARRAY_SIZE(pinmux_data),
+
+       .gpio_irq = pinmux_irqs,
+       .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
 };
 
 void sh7372_pinmux_init(void)
index 0d159d64a34521a90b6b5f16ba14a8d294c5264f..2d0d4212be41b9bc5112ba9ae57e02bd798927a9 100644 (file)
@@ -80,7 +80,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
        /* enable cache coherency */
        modify_scu_cpu_psr(0, 3 << (cpu * 8));
 
-       if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
+       if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
                __raw_writel(1 << cpu, __io(WUPCR));    /* wake up */
        else
                __raw_writel(1 << cpu, __io(SRESCR));   /* reset */
index fcf4f377b1dcf0e99d11fdf62f228a1f05b1dda1..330afdfa24754ae773238f45f855db0407c7dd57 100644 (file)
@@ -60,9 +60,9 @@ static struct plat_serial8250_port debug_uart_platform_data[] = {
                .uartclk        = 216000000,
        }, {
                /* serial port on mini-pcie */
-               .membase        = IO_ADDRESS(TEGRA_UARTD_BASE),
-               .mapbase        = TEGRA_UARTD_BASE,
-               .irq            = INT_UARTD,
+               .membase        = IO_ADDRESS(TEGRA_UARTC_BASE),
+               .mapbase        = TEGRA_UARTC_BASE,
+               .irq            = INT_UARTC,
                .flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
                .type           = PORT_TEGRA,
                .iotype         = UPIO_MEM,
@@ -174,7 +174,7 @@ static void __init tegra_paz00_fixup(struct tag *tags, char **cmdline,
 static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
        /* name         parent          rate            enabled */
        { "uarta",      "pll_p",        216000000,      true },
-       { "uartd",      "pll_p",        216000000,      true },
+       { "uartc",      "pll_p",        216000000,      true },
 
        { "pll_p_out4", "pll_p",        24000000,       true },
        { "usbd",       "clk_m",        12000000,       false },
index ffa83f580db6740289fe0ee00ef1a77a1cf8910b..3c9f8da37ea3ce16de68b760bf87223585e15cff 100644 (file)
@@ -22,7 +22,7 @@
 /* SDCARD */
 #define TEGRA_GPIO_SD1_CD              TEGRA_GPIO_PV5
 #define TEGRA_GPIO_SD1_WP              TEGRA_GPIO_PH1
-#define TEGRA_GPIO_SD1_POWER           TEGRA_GPIO_PT3
+#define TEGRA_GPIO_SD1_POWER           TEGRA_GPIO_PV1
 
 /* ULPI */
 #define TEGRA_ULPI_RST                 TEGRA_GPIO_PV0
index d0132e8031a1fca5e874403d5343fc05ce293a9b..3c9339058bec1bdcb7435f30e137870e059e1469 100644 (file)
 
 #include <linux/list.h>
 
-#if defined(CONFIG_TEGRA_SYSTEM_DMA)
-
-struct tegra_dma_req;
-struct tegra_dma_channel;
-
 #define TEGRA_DMA_REQ_SEL_CNTR                 0
 #define TEGRA_DMA_REQ_SEL_I2S_2                        1
 #define TEGRA_DMA_REQ_SEL_I2S_1                        2
@@ -56,6 +51,11 @@ struct tegra_dma_channel;
 #define TEGRA_DMA_REQ_SEL_OWR                  25
 #define TEGRA_DMA_REQ_SEL_INVALID              31
 
+#if defined(CONFIG_TEGRA_SYSTEM_DMA)
+
+struct tegra_dma_req;
+struct tegra_dma_channel;
+
 enum tegra_dma_mode {
        TEGRA_DMA_SHARED = 1,
        TEGRA_DMA_MODE_CONTINOUS = 2,
index 06383b51e6553b0aab931cab4f700972e9e52514..4de7d1e79e73d68615ccb8cc4d6c0c91b10f685e 100644 (file)
@@ -69,6 +69,7 @@ void __init omap_reserve(void)
        omap_vram_reserve_sdram_memblock();
        omap_dsp_reserve_sdram_memblock();
        omap_secure_ram_reserve_memblock();
+       omap_barrier_reserve_memblock();
 }
 
 void __init omap_init_consistent_dma_size(void)
index 64f9d1c7f1bb10787cb556adbf05f693d9b84a88..8c7994ce9869a98fc7b673d6ebfcc0b4d63187c0 100644 (file)
@@ -3,11 +3,17 @@
 
 #include <linux/types.h>
 
-#ifdef CONFIG_ARCH_OMAP2PLUS
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 extern int omap_secure_ram_reserve_memblock(void);
 #else
 static inline void omap_secure_ram_reserve_memblock(void)
 { }
 #endif
 
+#ifdef CONFIG_OMAP4_ERRATA_I688
+extern int omap_barrier_reserve_memblock(void);
+#else
+static inline void omap_barrier_reserve_memblock(void)
+{ }
+#endif
 #endif /* __OMAP_SECURE_H__ */
index e5a2fde29b190f41c7384c7e135fc48728fec836..089899a7db724e7d5d09cc5d7bfa568e484a64a4 100644 (file)
@@ -789,10 +789,7 @@ void __init orion_xor1_init(unsigned long mapbase_low,
 /*****************************************************************************
  * EHCI
  ****************************************************************************/
-static struct orion_ehci_data orion_ehci_data = {
-       .phy_version    = EHCI_PHY_NA,
-};
-
+static struct orion_ehci_data orion_ehci_data;
 static u64 ehci_dmamask = DMA_BIT_MASK(32);
 
 
@@ -812,8 +809,10 @@ static struct platform_device orion_ehci = {
 };
 
 void __init orion_ehci_init(unsigned long mapbase,
-                           unsigned long irq)
+                           unsigned long irq,
+                           enum orion_ehci_phy_ver phy_version)
 {
+       orion_ehci_data.phy_version = phy_version;
        fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
                       irq);
 
index 0fe08d77e835a47d05ce81265bea44823e55db24..a7fa005a5a0eb335e6b0267a090664a5a9d86ae7 100644 (file)
@@ -89,7 +89,8 @@ void __init orion_xor1_init(unsigned long mapbase_low,
                            unsigned long irq_1);
 
 void __init orion_ehci_init(unsigned long mapbase,
-                           unsigned long irq);
+                           unsigned long irq,
+                           enum orion_ehci_phy_ver phy_version);
 
 void __init orion_ehci_1_init(unsigned long mapbase,
                              unsigned long irq);
index 91553432711d0eb079110512f9246feafa7a2a4b..3b1e17bd3d17ddbffaf3be9e7b11631b20dfbd29 100644 (file)
@@ -64,8 +64,7 @@ void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask,
                        gpio_mode |= GPIO_INPUT_OK;
                if (*mpp_list & MPP_OUTPUT_MASK)
                        gpio_mode |= GPIO_OUTPUT_OK;
-               if (sel != 0)
-                       gpio_mode = 0;
+
                orion_gpio_set_valid(num, gpio_mode);
        }
 
index 9fe35348e03b433d5294cfcd02c1742c268f3391..2bab4c99a2342218fff937cbe5bc701149f76d0c 100644 (file)
@@ -1249,7 +1249,7 @@ static void s3c2410_dma_resume(void)
        struct s3c2410_dma_chan *cp = s3c2410_chans + dma_channels - 1;
        int channel;
 
-       for (channel = dma_channels - 1; channel >= 0; cp++, channel--)
+       for (channel = dma_channels - 1; channel >= 0; cp--, channel--)
                s3c2410_dma_resume_chan(cp);
 }
 
index 32a6e394db24db39b7192519cee91667600c887a..d21d744e4d99d9d9623bb9d26cfb628e87c82a63 100644 (file)
@@ -468,8 +468,10 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
 {
        struct s3c2410_platform_i2c *npd;
 
-       if (!pd)
+       if (!pd) {
                pd = &default_i2c_data;
+               pd->bus_num = 0;
+       }
 
        npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
                               &s3c_device_i2c0);
@@ -1407,7 +1409,7 @@ void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
 
 #ifdef CONFIG_S3C_DEV_USB_HSOTG
 static struct resource s3c_usb_hsotg_resources[] = {
-       [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG, SZ_16K),
+       [0] = DEFINE_RES_MEM(S3C_PA_USB_HSOTG, SZ_128K),
        [1] = DEFINE_RES_IRQ(IRQ_OTG),
 };
 
index ecca820e60419fd70341ba7c4a544723c7963529..6891257d514c39c540978508a9088343f9b6e740 100644 (file)
@@ -13,7 +13,7 @@ obj-y += linked_dtb.o
 endif
 
 $(obj)/%.dtb: $(src)/dts/%.dts FORCE
-       $(call cmd,dtc)
+       $(call if_changed_dep,dtc)
 
 quiet_cmd_cp = CP      $< $@$2
        cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
index 756bde4fb4f83005cb52592249c11754ebc4ff56..3c793682e5d99a078b485fd4358bf27e163448f2 100644 (file)
@@ -78,7 +78,8 @@
                                 | CF_PAGE_READABLE \
                                 | CF_PAGE_WRITABLE \
                                 | CF_PAGE_EXEC \
-                                | CF_PAGE_SYSTEM)
+                                | CF_PAGE_SYSTEM \
+                                | CF_PAGE_SHARED)
 
 #define PAGE_COPY      __pgprot(CF_PAGE_VALID \
                                 | CF_PAGE_ACCESSED \
index babd5a97cdcb6fd9f63dd075b554693b17d2fd7e..875b800ef0ddb765d9785ecb9d179eb919526c92 100644 (file)
@@ -87,7 +87,7 @@ void __init paging_init(void)
 
 int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
 {
-       unsigned long flags, mmuar;
+       unsigned long flags, mmuar, mmutr;
        struct mm_struct *mm;
        pgd_t *pgd;
        pmd_t *pmd;
@@ -137,9 +137,10 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
        if (!pte_dirty(*pte) && !KMAPAREA(mmuar))
                set_pte(pte, pte_wrprotect(*pte));
 
-       mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) |
-               (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK)
-               >> CF_PAGE_MMUTR_SHIFT) | MMUTR_V);
+       mmutr = (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | MMUTR_V;
+       if ((mmuar < TASK_UNMAPPED_BASE) || (mmuar >= TASK_SIZE))
+               mmutr |= (pte->pte & CF_PAGE_MMUTR_MASK) >> CF_PAGE_MMUTR_SHIFT;
+       mmu_write(MMUTR, mmutr);
 
        mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
                ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
index 863889fc31c9c1fe2b0ad7a9b460a8627a14a56c..281e38c2b6c74976c1c5da0ee061b51ce9335a4c 100644 (file)
@@ -136,7 +136,7 @@ Luser_return:
        movel   %sp,%d1                 /* get thread_info pointer */
        andl    #-THREAD_SIZE,%d1       /* at base of kernel stack */
        movel   %d1,%a0
-       movel   %a0@(TINFO_FLAGS),%d1   /* get thread_info->flags */
+       moveb   %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */
        jne     Lwork_to_do             /* still work to do */
 
 Lreturn:
@@ -148,8 +148,6 @@ Lwork_to_do:
        btst    #TIF_NEED_RESCHED,%d1
        jne     reschedule
 
-       /* GERG: do we need something here for TRACEing?? */
-
 Lsignal_return:
        subql   #4,%sp                  /* dummy return address */
        SAVE_SWITCH_STACK
index 7da4d0081487b73f341cd4a51f6ef5efe33141ae..a7193ae13a5d2d6ab8df643a76c6b33cd9621421 100644 (file)
@@ -146,7 +146,7 @@ static int __init alchemy_time_init(unsigned int m2int)
        cd->shift = 32;
        cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift);
        cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd);
-       cd->min_delta_ns = clockevent_delta2ns(8, cd);  /* ~0.25ms */
+       cd->min_delta_ns = clockevent_delta2ns(9, cd);  /* ~0.28ms */
        clockevents_register_device(cd);
        setup_irq(m2int, &au1x_rtcmatch2_irqaction);
 
index 24f546985b69b5b572e60dfc60be97a92a726483..e21507052066fbfe5aaec7185286376f2eaf4d02 100644 (file)
@@ -96,7 +96,7 @@ void __init ath79_register_wmac(u8 *cal_data)
 {
        if (soc_is_ar913x())
                ar913x_wmac_setup();
-       if (soc_is_ar933x())
+       else if (soc_is_ar933x())
                ar933x_wmac_setup();
        else
                BUG();
index 4479fd669ac1877a4d84a65284c714bd68310633..28c6b276c21624a4550c2411042065936464d19c 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_HIGH_RES_TIMERS=y
 # CONFIG_SECCOMP is not set
 CONFIG_USE_OF=y
 CONFIG_EXPERIMENTAL=y
-CONFIG_CROSS_COMPILE="mips-linux-gnu-"
+CONFIG_CROSS_COMPILE=""
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
@@ -22,7 +22,7 @@ CONFIG_AUDIT=y
 CONFIG_CGROUPS=y
 CONFIG_NAMESPACES=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="usr/dev_file_list usr/rootfs.xlp"
+CONFIG_INITRAMFS_SOURCE=""
 CONFIG_RD_BZIP2=y
 CONFIG_RD_LZMA=y
 CONFIG_INITRAMFS_COMPRESSION_LZMA=y
index 7c68666fdd646c3354f872ffc91eeeecfa4785d3..d0b857d98c91703b01950f9d1a705c1048cd7ac0 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_HIGH_RES_TIMERS=y
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_KEXEC=y
 CONFIG_EXPERIMENTAL=y
-CONFIG_CROSS_COMPILE="mips-linux-gnu-"
+CONFIG_CROSS_COMPILE=""
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
@@ -22,7 +22,7 @@ CONFIG_AUDIT=y
 CONFIG_NAMESPACES=y
 CONFIG_SCHED_AUTOGROUP=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="usr/dev_file_list usr/rootfs.xlr"
+CONFIG_INITRAMFS_SOURCE=""
 CONFIG_RD_BZIP2=y
 CONFIG_RD_LZMA=y
 CONFIG_INITRAMFS_COMPRESSION_GZIP=y
index 3b0b6e8c85334d610099d554f5a7a72b941ffee9..7fda0ce5f692cd51ed8b06f788bffc6a14f866f7 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_HZ_1000=y
 CONFIG_PREEMPT=y
 # CONFIG_SECCOMP is not set
 CONFIG_EXPERIMENTAL=y
-CONFIG_CROSS_COMPILE="mips-linux-"
+CONFIG_CROSS_COMPILE=""
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=16
index 556e1be20bf63862bacf3fcb464b6b87418c50eb..fb9975c74c571a01526f42667a8f0d7cbedf235e 100644 (file)
@@ -11,6 +11,9 @@
 #include <asm/io.h>
 #include <asm/mach-au1x00/au1000.h>
 
+struct gpio;
+struct gpio_chip;
+
 /* with the current GPIC design, up to 128 GPIOs are possible.
  * The only implementation so far is in the Au1300, which has 75 externally
  * available GPIOs.
@@ -203,7 +206,22 @@ static inline int gpio_request(unsigned int gpio, const char *label)
        return 0;
 }
 
-static inline void gpio_free(unsigned int gpio)
+static inline int gpio_request_one(unsigned gpio,
+                                       unsigned long flags, const char *label)
+{
+       return 0;
+}
+
+static inline int gpio_request_array(struct gpio *array, size_t num)
+{
+       return 0;
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+}
+
+static inline void gpio_free_array(struct gpio *array, size_t num)
 {
 }
 
index d41790928c648de70fb02a7404517f1fc7a94fba..da9bd7d270d18a761f74f6168653d2eb16da7118 100644 (file)
@@ -39,9 +39,6 @@
 #define HPAGE_MASK     (~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER     (HPAGE_SHIFT - PAGE_SHIFT)
 #else /* !CONFIG_HUGETLB_PAGE */
-# ifndef BUILD_BUG
-#  define BUILD_BUG() do { extern void __build_bug(void); __build_bug(); } while (0)
-# endif
 #define HPAGE_SHIFT    ({BUILD_BUG(); 0; })
 #define HPAGE_SIZE     ({BUILD_BUG(); 0; })
 #define HPAGE_MASK     ({BUILD_BUG(); 0; })
index 58fe71afd8797dd37e1cf0442f1b360082af63a2..d5e950ab852792b15c2226f193f55061719f0e20 100644 (file)
@@ -8,7 +8,6 @@
  * SMP support for BMIPS
  */
 
-#include <linux/version.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
index cc4a3f120f54d6f036e66812cf47e5c35e7dbff9..d79ae5437b5871efda13f052c5f7511ccf9587b9 100644 (file)
@@ -1135,7 +1135,7 @@ asmlinkage void do_mt(struct pt_regs *regs)
                printk(KERN_DEBUG "YIELD Scheduler Exception\n");
                break;
        case 5:
-               printk(KERN_DEBUG "Gating Storage Schedulier Exception\n");
+               printk(KERN_DEBUG "Gating Storage Scheduler Exception\n");
                break;
        default:
                printk(KERN_DEBUG "*** UNKNOWN THREAD EXCEPTION %d ***\n",
index a81176f44c74d4e39be2eaf8d939ccdf1aa5157b..924da5eb7031498ea93dc050a7492aa78f5bb0ec 100644 (file)
@@ -69,7 +69,6 @@ SECTIONS
        RODATA
 
        /* writeable */
-       _sdata = .;                             /* Start of data section */
        .data : {       /* Data */
                . = . + DATAOFFSET;             /* for CONFIG_MAPPED_KERNEL */
 
index 937cf3368164c6f6d4a6db4b1867ca5866a36ed7..69ebd586d7ffbef5029b8540ae3d021135035295 100644 (file)
@@ -42,6 +42,8 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long writ
        const int field = sizeof(unsigned long) * 2;
        siginfo_t info;
        int fault;
+       unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
+                                                (write ? FAULT_FLAG_WRITE : 0);
 
 #if 0
        printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", raw_smp_processor_id(),
@@ -91,6 +93,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, unsigned long writ
        if (in_atomic() || !mm)
                goto bad_area_nosemaphore;
 
+retry:
        down_read(&mm->mmap_sem);
        vma = find_vma(mm, address);
        if (!vma)
@@ -144,7 +147,11 @@ good_area:
         * make sure we exit gracefully rather than endlessly redo
         * the fault.
         */
-       fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
+       fault = handle_mm_fault(mm, vma, address, flags);
+
+       if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
+               return;
+
        perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
        if (unlikely(fault & VM_FAULT_ERROR)) {
                if (fault & VM_FAULT_OOM)
@@ -153,12 +160,27 @@ good_area:
                        goto do_sigbus;
                BUG();
        }
-       if (fault & VM_FAULT_MAJOR) {
-               perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address);
-               tsk->maj_flt++;
-       } else {
-               perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address);
-               tsk->min_flt++;
+       if (flags & FAULT_FLAG_ALLOW_RETRY) {
+               if (fault & VM_FAULT_MAJOR) {
+                       perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1,
+                                                 regs, address);
+                       tsk->maj_flt++;
+               } else {
+                       perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1,
+                                                 regs, address);
+                       tsk->min_flt++;
+               }
+               if (fault & VM_FAULT_RETRY) {
+                       flags &= ~FAULT_FLAG_ALLOW_RETRY;
+
+                       /*
+                        * No need to up_read(&mm->mmap_sem) as we would
+                        * have already released it in __lock_page_or_retry
+                        * in mm/filemap.c.
+                        */
+
+                       goto retry;
+               }
        }
 
        up_read(&mm->mmap_sem);
index aec2b111d35b0131f805e736bd80c2ca19d59cbf..15521505ebe80a4a6975f11905e4694111474a08 100644 (file)
@@ -279,7 +279,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 {
        /* Propagate hose info into the subordinate devices.  */
 
-       struct list_head *ln;
        struct pci_dev *dev = bus->self;
 
        if (pci_probe_only && dev &&
@@ -288,9 +287,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
                pcibios_fixup_device_resources(dev, bus);
        }
 
-       for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
-               dev = pci_dev_b(ln);
-
+       list_for_each_entry(dev, &bus->devices, bus_list) {
                if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
                        pcibios_fixup_device_resources(dev, bus);
        }
index 86b98e98fb4f2f09906a8ee271550e1ab9b961c9..62ead6601c69437aeaafe5dcd3bc7c895fcee5f1 100644 (file)
  */
 void __init titan_ht_pcibios_fixup_bus(struct pci_bus *bus)
 {
-       struct pci_bus *current_bus = bus;
-       struct pci_dev *devices;
-       struct list_head *devices_link;
-
-       list_for_each(devices_link, &(current_bus->devices)) {
-               devices = pci_dev_b(devices_link);
-               if (devices == NULL)
-                       continue;
-       }
-
        /*
         * PLX and SPKT related changes go here
         */
index 8e93b21225249fe489b8666b94a4ac407b43406b..4642f56e70e54c38aca1d98df27fee53b7761402 100644 (file)
@@ -102,7 +102,7 @@ static int __init tx_7segled_init_sysfs(void)
                        break;
                }
                dev->id = i;
-               dev->dev = &tx_7segled_subsys;
+               dev->bus = &tx_7segled_subsys;
                error = device_register(dev);
                if (!error) {
                        device_create_file(dev, &dev_attr_ascii);
index 054537c5f9c9c002a29ed1808b21f66b9a102fad..e612ce4512c73db468d6597673d87fa729b24226 100644 (file)
@@ -77,7 +77,6 @@ struct pt_regs {
        long  syscallno;        /* Syscall number (used by strace) */
        long dummy;             /* Cheap alignment fix */
 };
-#endif /* __ASSEMBLY__ */
 
 /* TODO: Rename this to REDZONE because that's what it is */
 #define STACK_FRAME_OVERHEAD  128  /* size of minimum stack frame */
@@ -87,6 +86,13 @@ struct pt_regs {
 #define user_stack_pointer(regs)       ((unsigned long)(regs)->sp)
 #define profile_pc(regs)               instruction_pointer(regs)
 
+static inline long regs_return_value(struct pt_regs *regs)
+{
+       return regs->gpr[11];
+}
+
+#endif /* __ASSEMBLY__ */
+
 /*
  * Offsets used by 'ptrace' system call interface.
  */
index 45744a384927976998c77c876077ad3c6559e7e6..ca534082d5f317566e5958c3337321852e1c72ca 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <linux/init_task.h>
 #include <linux/mqueue.h>
+#include <linux/export.h>
 
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
index 59b302338331395f568c22b81486b09bacfcf1b8..4bfead220956e2be70146f6a209a1c6cebd1b125 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/kernel_stat.h>
+#include <linux/export.h>
 
 #include <linux/irqflags.h>
 
index 656b94beab891ecd982ceb4e4e8a2c68cf907354..7259047d5f9dbd21cc8529119dfc21f61cd2b840 100644 (file)
@@ -188,11 +188,9 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
                 */
                ret = -1L;
 
-       /* Are these regs right??? */
-       if (unlikely(current->audit_context))
-               audit_syscall_entry(audit_arch(), regs->syscallno,
-                                   regs->gpr[3], regs->gpr[4],
-                                   regs->gpr[5], regs->gpr[6]);
+       audit_syscall_entry(audit_arch(), regs->syscallno,
+                           regs->gpr[3], regs->gpr[4],
+                           regs->gpr[5], regs->gpr[6]);
 
        return ret ? : regs->syscallno;
 }
@@ -201,9 +199,7 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
 {
        int step;
 
-       if (unlikely(current->audit_context))
-               audit_syscall_exit(AUDITSC_RESULT(regs->gpr[11]),
-                                  regs->gpr[11]);
+       audit_syscall_exit(regs);
 
        step = test_thread_flag(TIF_SINGLESTEP);
        if (step || test_thread_flag(TIF_SYSCALL_TRACE))
index 55cca1dac431bc80c1e9ea5f34274be2022e4494..19ab7b2ea1cd6b899531bc528cbf4d91b7fc11f4 100644 (file)
@@ -31,7 +31,11 @@ ifdef CONFIG_64BIT
 UTS_MACHINE    := parisc64
 CHECKFLAGS     += -D__LP64__=1 -m64
 WIDTH          := 64
+
+# FIXME: if no default set, should really try to locate dynamically
+ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE  := hppa64-linux-gnu-
+endif
 else # 32-bit
 WIDTH          :=
 endif
index 2156e077859b9bee6285bfb87677b72f64c77311..1acf65026773a6b6336d21e5b3b07f06bf6e84a7 100644 (file)
@@ -24,10 +24,6 @@ CONFIG_PPC_SPLPAR=y
 CONFIG_SCANLOG=m
 CONFIG_PPC_SMLPAR=y
 CONFIG_DTL=y
-CONFIG_PPC_ISERIES=y
-CONFIG_VIODASD=y
-CONFIG_VIOCD=m
-CONFIG_VIOTAPE=m
 CONFIG_PPC_MAPLE=y
 CONFIG_PPC_PASEMI=y
 CONFIG_PPC_PASEMI_IOMMU=y
@@ -259,7 +255,6 @@ CONFIG_PASEMI_MAC=y
 CONFIG_MLX4_EN=m
 CONFIG_QLGE=m
 CONFIG_BE2NET=m
-CONFIG_ISERIES_VETH=m
 CONFIG_PPP=m
 CONFIG_PPP_ASYNC=m
 CONFIG_PPP_SYNC_TTY=m
index 4f80cf1ce77b84c30e905bcb8cb8d660c005c22b..3e57a00b8cba784633d1b0465fd3b47f1b85baf0 100644 (file)
@@ -1213,7 +1213,7 @@ do_user_signal:                   /* r10 contains MSR_KERNEL here */
        stw     r3,_TRAP(r1)
 2:     addi    r3,r1,STACK_FRAME_OVERHEAD
        mr      r4,r9
-       bl      do_signal
+       bl      do_notify_resume
        REST_NVGPRS(r1)
        b       recheck
 
index d834425186aeaa7fae6905bd8bffb50d0d99354d..866462cbe2d832341d2cbf5b89d32be7986ec815 100644 (file)
@@ -751,12 +751,16 @@ user_work:
 
        andi.   r0,r4,_TIF_NEED_RESCHED
        beq     1f
+       li      r5,1
+       TRACE_AND_RESTORE_IRQ(r5);
        bl      .schedule
        b       .ret_from_except_lite
 
 1:     bl      .save_nvgprs
+       li      r5,1
+       TRACE_AND_RESTORE_IRQ(r5);
        addi    r3,r1,STACK_FRAME_OVERHEAD
-       bl      .do_signal
+       bl      .do_notify_resume
        b       .ret_from_except
 
 unrecov_restore:
index d4be7bb3dbdfdffd5d62d76aa96860392040a305..15c5a4f6de0105b410de25643b22a7b9409bba22 100644 (file)
@@ -774,8 +774,8 @@ alignment_common:
 program_check_common:
        EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
        bl      .save_nvgprs
+       DISABLE_INTS
        addi    r3,r1,STACK_FRAME_OVERHEAD
-       ENABLE_INTS
        bl      .program_check_exception
        b       .ret_from_except
 
index 10a140f82cb87db296859f57ce18edfbb10f2ace..64483fde95c62cfa0cc5411e2c2cc6fce5cab453 100644 (file)
@@ -865,6 +865,7 @@ static void power_pmu_start(struct perf_event *event, int ef_flags)
 {
        unsigned long flags;
        s64 left;
+       unsigned long val;
 
        if (!event->hw.idx || !event->hw.sample_period)
                return;
@@ -880,7 +881,12 @@ static void power_pmu_start(struct perf_event *event, int ef_flags)
 
        event->hw.state = 0;
        left = local64_read(&event->hw.period_left);
-       write_pmc(event->hw.idx, left);
+
+       val = 0;
+       if (left < 0x80000000L)
+               val = 0x80000000L - left;
+
+       write_pmc(event->hw.idx, val);
 
        perf_event_update_userpage(event);
        perf_pmu_enable(event->pmu);
index ebe5766781aa8c9eca7d96849ca034233e043308..d817ab018486d71b8c06bb9b6275bd0f533d8c89 100644 (file)
@@ -566,12 +566,12 @@ static void show_instructions(struct pt_regs *regs)
                 */
                if (!__kernel_text_address(pc) ||
                     __get_user(instr, (unsigned int __user *)pc)) {
-                       printk("XXXXXXXX ");
+                       printk(KERN_CONT "XXXXXXXX ");
                } else {
                        if (regs->nip == pc)
-                               printk("<%08x> ", instr);
+                               printk(KERN_CONT "<%08x> ", instr);
                        else
-                               printk("%08x ", instr);
+                               printk(KERN_CONT "%08x ", instr);
                }
 
                pc += sizeof(int);
index 2300426e531a096239b0620f9ec29f71e70b6daf..ac6e437b10214d47b6d6525cc9d23b8b3e37dabe 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/tracehook.h>
 #include <linux/signal.h>
+#include <linux/key.h>
 #include <asm/hw_breakpoint.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -113,8 +114,9 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
        }
 }
 
-static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
+static int do_signal(struct pt_regs *regs)
 {
+       sigset_t *oldset;
        siginfo_t info;
        int signr;
        struct k_sigaction ka;
@@ -123,7 +125,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
 
        if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK)
                oldset = &current->saved_sigmask;
-       else if (!oldset)
+       else
                oldset = &current->blocked;
 
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -191,14 +193,16 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
        return ret;
 }
 
-void do_signal(struct pt_regs *regs, unsigned long thread_info_flags)
+void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
 {
        if (thread_info_flags & _TIF_SIGPENDING)
-               do_signal_pending(NULL, regs);
+               do_signal(regs);
 
        if (thread_info_flags & _TIF_NOTIFY_RESUME) {
                clear_thread_flag(TIF_NOTIFY_RESUME);
                tracehook_notify_resume(regs);
+               if (current->replacement_session_keyring)
+                       key_replace_session_keyring();
        }
 }
 
index 6c0ddfc0603e80fa29c5a4b3408fa393d90e8f62..8dde973aaaf513ffd4c39a41f0f3bf2bead0d7db 100644 (file)
@@ -12,7 +12,7 @@
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
-extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags);
+extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags);
 
 extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
                                  size_t frame_size, int is_32);
index 71bd105f38636b0435fae0590deec38cd02ddf1e..0ba103ae83a53c5218c5517227e942bf800753ba 100644 (file)
@@ -71,7 +71,7 @@ int __devinit smp_a2_kick_cpu(int nr)
 
 static int __init smp_a2_probe(void)
 {
-       return cpus_weight(cpu_possible_map);
+       return num_possible_cpus();
 }
 
 static struct smp_ops_t a2_smp_ops = {
index 30eb17ecad493f8d459beb2d6c60ed882c86a326..6073288fed29889399bb640bc22f709043363f72 100644 (file)
@@ -385,26 +385,36 @@ static void __init setup_pci_cmd(struct pci_controller *hose)
 void fsl_pcibios_fixup_bus(struct pci_bus *bus)
 {
        struct pci_controller *hose = pci_bus_to_host(bus);
-       int i;
-
-       if ((bus->parent == hose->bus) &&
-           ((fsl_pcie_bus_fixup &&
-             early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) ||
-            (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)))
-       {
-               for (i = 0; i < 4; ++i) {
+       int i, is_pcie = 0, no_link;
+
+       /* The root complex bridge comes up with bogus resources,
+        * we copy the PHB ones in.
+        *
+        * With the current generic PCI code, the PHB bus no longer
+        * has bus->resource[0..4] set, so things are a bit more
+        * tricky.
+        */
+
+       if (fsl_pcie_bus_fixup)
+               is_pcie = early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP);
+       no_link = !!(hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK);
+
+       if (bus->parent == hose->bus && (is_pcie || no_link)) {
+               for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; ++i) {
                        struct resource *res = bus->resource[i];
-                       struct resource *par = bus->parent->resource[i];
-                       if (res) {
-                               res->start = 0;
-                               res->end   = 0;
-                               res->flags = 0;
-                       }
-                       if (res && par) {
-                               res->start = par->start;
-                               res->end   = par->end;
-                               res->flags = par->flags;
-                       }
+                       struct resource *par;
+
+                       if (!res)
+                               continue;
+                       if (i == 0)
+                               par = &hose->io_resource;
+                       else if (i < 4)
+                               par = &hose->mem_resources[i-1];
+                       else par = NULL;
+
+                       res->start = par ? par->start : 0;
+                       res->end   = par ? par->end   : 0;
+                       res->flags = par ? par->flags : 0;
                }
        }
 }
index d1727584230a66b504ae1e9e0beed8f3522c5b23..6d99a5fcc09030114dd8d475e6fe54184fc59814 100644 (file)
@@ -227,6 +227,9 @@ config COMPAT
 config SYSVIPC_COMPAT
        def_bool y if COMPAT && SYSVIPC
 
+config KEYS_COMPAT
+       def_bool y if COMPAT && KEYS
+
 config AUDIT_ARCH
        def_bool y
 
index 2e49748b27dab5ca3e62c2b4f63909c50058a593..234f1d859cea07c4f0cd31be401448fc8fe0870e 100644 (file)
@@ -172,13 +172,6 @@ static inline int is_compat_task(void)
        return is_32bit_task();
 }
 
-#else
-
-static inline int is_compat_task(void)
-{
-       return 0;
-}
-
 #endif
 
 static inline void __user *arch_compat_alloc_user_space(long len)
index 18c51df9fe06c5ed98f785fb6af86655c025e887..ff605a39cf435661a6ba6ab5dee05544239fae6b 100644 (file)
@@ -662,7 +662,7 @@ ENTRY(sys32_getresuid16_wrapper)
 ENTRY(sys32_poll_wrapper)
        llgtr   %r2,%r2                 # struct pollfd *
        llgfr   %r3,%r3                 # unsigned int
-       lgfr    %r4,%r4                 # long
+       lgfr    %r4,%r4                 # int
        jg      sys_poll                # branch to system call
 
 ENTRY(sys32_setresgid16_wrapper)
index 39f8fd4438fc8a3810333a6e659e60dce4ea04aa..c383ce440d99952149895b0094d6794a22af2d5c 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/gfp.h>
 #include <linux/slab.h>
-#include <linux/crash_dump.h>
 #include <linux/bootmem.h>
 #include <linux/elf.h>
 #include <asm/ipl.h>
index 3201ae447990c50052d7536d079e39286a77120d..e795933eb2cbaaf446d5ea62c0b43976d38479f0 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/irq.h>
 #include <asm/timer.h>
 #include <asm/nmi.h>
-#include <asm/compat.h>
 #include <asm/smp.h>
 #include "entry.h"
 
@@ -76,7 +75,6 @@ static void default_idle(void)
        if (test_thread_flag(TIF_MCCK_PENDING)) {
                local_mcck_enable();
                local_irq_enable();
-               s390_handle_mcck();
                return;
        }
        trace_hardirqs_on();
@@ -93,10 +91,12 @@ void cpu_idle(void)
        for (;;) {
                tick_nohz_idle_enter();
                rcu_idle_enter();
-               while (!need_resched())
+               while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
                        default_idle();
                rcu_idle_exit();
                tick_nohz_idle_exit();
+               if (test_thread_flag(TIF_MCCK_PENDING))
+                       s390_handle_mcck();
                preempt_enable_no_resched();
                schedule();
                preempt_disable();
index 9d82ed4bcb273a91bd6c4875d204218da2d420a2..61f95489d70c2539068a6cfc2dc3acc55d4a3cac 100644 (file)
@@ -20,8 +20,8 @@
 #include <linux/regset.h>
 #include <linux/tracehook.h>
 #include <linux/seccomp.h>
+#include <linux/compat.h>
 #include <trace/syscall.h>
-#include <asm/compat.h>
 #include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
index 354de0763efff361972fae399064b4f786cc5a0c..3b2efc81f34e849f0a00bf464c133a5e4add9ade 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/kexec.h>
 #include <linux/crash_dump.h>
 #include <linux/memory.h>
+#include <linux/compat.h>
 
 #include <asm/ipl.h>
 #include <asm/uaccess.h>
@@ -59,7 +60,6 @@
 #include <asm/ptrace.h>
 #include <asm/sections.h>
 #include <asm/ebcdic.h>
-#include <asm/compat.h>
 #include <asm/kvm_virtio.h>
 #include <asm/diag.h>
 
index a8ba840294ff0524c66262bc1f438a1ac995d7bc..2d421d90fada708248c8e678be34d92b08c0cef0 100644 (file)
@@ -30,7 +30,6 @@
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
 #include <asm/lowcore.h>
-#include <asm/compat.h>
 #include "entry.h"
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
index fa02f443f5f65dfa70c5804c9b411d9b357d7dd1..14da278febbfa89c2a20ea797fa9a4c6ff1a1de1 100644 (file)
@@ -113,11 +113,14 @@ static void fixup_clock_comparator(unsigned long long delta)
 static int s390_next_ktime(ktime_t expires,
                           struct clock_event_device *evt)
 {
+       struct timespec ts;
        u64 nsecs;
 
-       nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset()));
+       ts.tv_sec = ts.tv_nsec = 0;
+       monotonic_to_bootbased(&ts);
+       nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
        do_div(nsecs, 125);
-       S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9);
+       S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
        set_clock_comparator(S390_lowcore.clock_comparator);
        return 0;
 }
index 354dd39073efec6c1a1bf034ab63c4e82dcc824c..e8fcd928dc78005599f0b07aad6142052193f16d 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
-#include <asm/compat.h>
 #include "../kernel/entry.h"
 
 #ifndef CONFIG_64BIT
index 5d633019d8f3f86fb4da43a1c04ad060a6f2e83f..50236610de83cc0cb8d76ca34bbd2cd0f5c0e0aa 100644 (file)
@@ -223,16 +223,38 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 #ifdef CONFIG_MEMORY_HOTPLUG
 int arch_add_memory(int nid, u64 start, u64 size)
 {
-       struct pglist_data *pgdat;
+       unsigned long zone_start_pfn, zone_end_pfn, nr_pages;
+       unsigned long start_pfn = PFN_DOWN(start);
+       unsigned long size_pages = PFN_DOWN(size);
        struct zone *zone;
        int rc;
 
-       pgdat = NODE_DATA(nid);
-       zone = pgdat->node_zones + ZONE_MOVABLE;
        rc = vmem_add_mapping(start, size);
        if (rc)
                return rc;
-       rc = __add_pages(nid, zone, PFN_DOWN(start), PFN_DOWN(size));
+       for_each_zone(zone) {
+               if (zone_idx(zone) != ZONE_MOVABLE) {
+                       /* Add range within existing zone limits */
+                       zone_start_pfn = zone->zone_start_pfn;
+                       zone_end_pfn = zone->zone_start_pfn +
+                                      zone->spanned_pages;
+               } else {
+                       /* Add remaining range to ZONE_MOVABLE */
+                       zone_start_pfn = start_pfn;
+                       zone_end_pfn = start_pfn + size_pages;
+               }
+               if (start_pfn < zone_start_pfn || start_pfn >= zone_end_pfn)
+                       continue;
+               nr_pages = (start_pfn + size_pages > zone_end_pfn) ?
+                          zone_end_pfn - start_pfn : size_pages;
+               rc = __add_pages(nid, zone, start_pfn, nr_pages);
+               if (rc)
+                       break;
+               start_pfn += nr_pages;
+               size_pages -= nr_pages;
+               if (!size_pages)
+                       break;
+       }
        if (rc)
                vmem_remove_mapping(start, size);
        return rc;
index f09c74881b7e5b2c12d323265f289e0681eec66b..a0155c02e324900ae54745ae4024c3b384b51740 100644 (file)
@@ -29,8 +29,8 @@
 #include <linux/mman.h>
 #include <linux/module.h>
 #include <linux/random.h>
+#include <linux/compat.h>
 #include <asm/pgalloc.h>
-#include <asm/compat.h>
 
 static unsigned long stack_maxrandom_size(void)
 {
index 9a4d02f64f16e6af778555e89925ac71c9f76ce4..51b0738e13d12ef21ae05b68aa4ccc17d2862c9a 100644 (file)
@@ -574,7 +574,7 @@ static inline void page_table_free_pgste(unsigned long *table)
        page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
        mp = (struct gmap_pgtable *) page->index;
        BUG_ON(!list_empty(&mp->mapper));
-       pgtable_page_ctor(page);
+       pgtable_page_dtor(page);
        atomic_set(&page->_mapcount, -1);
        kfree(mp);
        __free_page(page);
index 0838154dd2168bdd2d51b0fe3ebb33e590eca70f..24b1ee410daaccd74eff9ee601ef8c87a077d0d7 100644 (file)
@@ -168,6 +168,11 @@ static struct resource sh_eth_giga1_resources[] = {
                .start  = 0xfee00800,
                .end    = 0xfee00fff,
                .flags  = IORESOURCE_MEM,
+       }, {
+               /* TSU */
+               .start  = 0xfee01800,
+               .end    = 0xfee01fff,
+               .flags  = IORESOURCE_MEM,
        }, {
                .start  = 316,
                .end    = 316,
@@ -210,20 +215,13 @@ static struct resource sh_mmcif_resources[] = {
        },
 };
 
-static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
-       .chan_priv_tx   = {
-               .slave_id = SHDMA_SLAVE_MMCIF_TX,
-       },
-       .chan_priv_rx   = {
-               .slave_id = SHDMA_SLAVE_MMCIF_RX,
-       }
-};
-
 static struct sh_mmcif_plat_data sh_mmcif_plat = {
-       .dma            = &sh7757lcr_mmcif_dma,
        .sup_pclk       = 0x0f,
-       .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
+       .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
+                         MMC_CAP_NONREMOVABLE,
        .ocr            = MMC_VDD_32_33 | MMC_VDD_33_34,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct platform_device sh_mmcif_device = {
index 6418e95c2b6b87f3350cc735e20d7e3bcfab484c..ebd0f818a25f93994419bd1bcea8ed0710e45bc0 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/i2c.h>
 #include <linux/smsc911x.h>
 #include <linux/gpio.h>
+#include <linux/videodev2.h>
 #include <media/ov772x.h>
 #include <media/soc_camera.h>
 #include <media/soc_camera_platform.h>
index 033ef2ba621f008c5c92ac0dace7808a5b21035b..cde7c0085cedf4b239e79cddaee05d5dcc9e81b7 100644 (file)
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/sh_eth.h>
+#include <linux/videodev2.h>
 #include <video/sh_mobile_lcdc.h>
 #include <sound/sh_fsi.h>
 #include <media/sh_mobile_ceu.h>
+#include <media/soc_camera.h>
 #include <media/tw9910.h>
 #include <media/mt9t112.h>
 #include <asm/heartbeat.h>
index 2a18b06abdafcd8220cfc99c03fac52e98ca2efd..5b382e1afaea6afe7a5de762c08a136b1363adfd 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/input/sh_keysc.h>
 #include <linux/i2c.h>
 #include <linux/usb/r8a66597.h>
+#include <linux/videodev2.h>
 #include <media/rj54n1cb0c.h>
 #include <media/soc_camera.h>
 #include <media/sh_mobile_ceu.h>
index 68c3d6f4289665f5c4b7e38265d7f1ce5db6c81b..d37ba2720527ad22f0c0c3209cf756cb9cfe9fd3 100644 (file)
 #include <linux/delay.h>
 #include <linux/clk.h>
 #include <linux/gpio.h>
+#include <linux/videodev2.h>
 #include <video/sh_mobile_lcdc.h>
 #include <media/sh_mobile_ceu.h>
 #include <media/ov772x.h>
+#include <media/soc_camera.h>
 #include <media/tw9910.h>
 #include <asm/clock.h>
 #include <asm/machvec.h>
index 036fe1adaef17b4367259a71d59e3ba642f9f64a..2b07fc0169500aab4405b18e9e2a6f024def3f3f 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/input/sh_keysc.h>
 #include <linux/usb/r8a66597.h>
 #include <linux/sh_eth.h>
+#include <linux/videodev2.h>
 #include <video/sh_mobile_lcdc.h>
 #include <media/sh_mobile_ceu.h>
 #include <sound/sh_fsi.h>
index fa7b978cc7278212c18bb7059ee937a9d17c9445..fb8f149907433498d183dda7a7ae9170305f2b14 100644 (file)
@@ -74,7 +74,7 @@ struct pci_errors {
        { SH4_PCIINT_MLCK,      "master lock error" },
        { SH4_PCIINT_TABT,      "target-target abort" },
        { SH4_PCIINT_TRET,      "target retry time out" },
-       { SH4_PCIINT_MFDE,      "master function disable erorr" },
+       { SH4_PCIINT_MFDE,      "master function disable error" },
        { SH4_PCIINT_PRTY,      "address parity error" },
        { SH4_PCIINT_SERR,      "SERR" },
        { SH4_PCIINT_TWDP,      "data parity error for target write" },
index a1c9c0daec109c694184d03da5d0701d049b8c40..071bcb4d4bfd12576f78e2c99e57d8df05bf4410 100644 (file)
@@ -3,9 +3,10 @@
  *
  * This file is released under the GPLv2
  */
+#ifndef __ASM_SH_DEVICE_H
+#define __ASM_SH_DEVICE_H
 
-struct dev_archdata {
-};
+#include <asm-generic/device.h>
 
 struct platform_device;
 /* allocate contiguous memory chunk and fill in struct resource */
@@ -14,5 +15,4 @@ int platform_resource_setup_memory(struct platform_device *pdev,
 
 void plat_early_device_setup(void);
 
-struct pdev_archdata {
-};
+#endif /* __ASM_SH_DEVICE_H */
index b3c039a5064a43756c5a0704f3073e223a091fba..70bd96646f422641b223aeed33adc533561e4112 100644 (file)
@@ -343,7 +343,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]),
        CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
        CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
-       CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]),
+       CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]),
        CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
        CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]),
        CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
index a7b2da6b3a1a359953f7043d498288de59b7df55..2875e8be4f7268242f4390d3a02a5dd3311c54a5 100644 (file)
@@ -133,7 +133,7 @@ static struct resource spi0_resources[] = {
        [0] = {
                .start  = 0xfe002000,
                .end    = 0xfe0020ff,
-               .flags  = IORESOURCE_MEM,
+               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
        },
        [1] = {
                .start  = 86,
@@ -661,6 +661,25 @@ static struct platform_device spi0_device = {
        .resource       = spi0_resources,
 };
 
+static struct resource spi1_resources[] = {
+       {
+               .start  = 0xffd8ee70,
+               .end    = 0xffd8eeff,
+               .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
+       },
+       {
+               .start  = 54,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device spi1_device = {
+       .name   = "sh_spi",
+       .id     = 1,
+       .num_resources  = ARRAY_SIZE(spi1_resources),
+       .resource       = spi1_resources,
+};
+
 static struct resource usb_ehci_resources[] = {
        [0] = {
                .start  = 0xfe4f1000,
@@ -720,6 +739,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
        &dma2_device,
        &dma3_device,
        &spi0_device,
+       &spi1_device,
        &usb_ehci_device,
        &usb_ohci_device,
 };
index 3147a9a6fb8b4a93e5d04d29b364762e3d432f4f..f624174bf239c6164da323353c15986963e63829 100644 (file)
@@ -63,7 +63,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
        mp_ops->prepare_cpus(max_cpus);
 
 #ifndef CONFIG_HOTPLUG_CPU
-       init_cpu_present(&cpu_possible_map);
+       init_cpu_present(cpu_possible_mask);
 #endif
 }
 
index 4649a6ff0cfefa1f64e7ce91dd2105f15ac8eccd..772caffba22fb644a077bfe8707148f75a1dc14a 100644 (file)
@@ -27,7 +27,7 @@ static cpumask_t cpu_coregroup_map(unsigned int cpu)
         * Presently all SH-X3 SMP cores are multi-cores, so just keep it
         * simple until we have a method for determining topology..
         */
-       return cpu_possible_map;
+       return *cpu_possible_mask;
 }
 
 const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
index ae08cbbfa5697559cfcb5e669086d9ddbe244d20..949e2d3138a0ca24ffe07e6228a68eeeb72321e9 100644 (file)
@@ -23,6 +23,7 @@
 #define MAX_OCACHE_PAGES       32
 #define MAX_ICACHE_PAGES       32
 
+#ifdef CONFIG_CACHE_WRITEBACK
 static void sh2a_flush_oc_line(unsigned long v, int way)
 {
        unsigned long addr = (v & 0x000007f0) | (way << 11);
@@ -34,6 +35,7 @@ static void sh2a_flush_oc_line(unsigned long v, int way)
                __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr);
        }
 }
+#endif
 
 static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v)
 {
index fd843877e84152d87d437fca5173b858336a104a..39e49091f64841873ee1d79d768aa677832c500f 100644 (file)
@@ -315,6 +315,13 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        current->mm->free_area_cache = TASK_UNMAPPED_BASE;
        current->mm->cached_hole_size = 0;
 
+       retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT);
+       if (retval < 0) {
+               /* Someone check-me: is this error path enough? */
+               send_sig(SIGKILL, current, 0);
+               return retval;
+       }
+
        install_exec_creds(bprm);
        current->flags &= ~PF_FORKNOEXEC;
 
@@ -410,13 +417,6 @@ beyond_if:
 
        set_brk(current->mm->start_brk, current->mm->brk);
 
-       retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT);
-       if (retval < 0) {
-               /* Someone check-me: is this error path enough? */
-               send_sig(SIGKILL, current, 0);
-               return retval;
-       }
-
        current->mm->start_stack =
                (unsigned long)create_aout_tables((char __user *)bprm->p, bprm);
        /* start thread */
index a29571821b99aac4fb437690983e18a7c02fb3e9..247904945d3f3055dccf6e9fd0c05474167f98d7 100644 (file)
@@ -30,9 +30,10 @@ extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
 extern int init_fpu(struct task_struct *child);
 extern void math_state_restore(void);
-extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
+DECLARE_PER_CPU(struct task_struct *, fpu_owner_task);
+
 extern user_regset_active_fn fpregs_active, xfpregs_active;
 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
                                xstateregs_get;
@@ -212,19 +213,11 @@ static inline void fpu_fxsave(struct fpu *fpu)
 
 #endif /* CONFIG_X86_64 */
 
-/* We need a safe address that is cheap to find and that is already
-   in L1 during context switch. The best choices are unfortunately
-   different for UP and SMP */
-#ifdef CONFIG_SMP
-#define safe_address (__per_cpu_offset[0])
-#else
-#define safe_address (__get_cpu_var(kernel_cpustat).cpustat[CPUTIME_USER])
-#endif
-
 /*
- * These must be called with preempt disabled
+ * These must be called with preempt disabled. Returns
+ * 'true' if the FPU state is still intact.
  */
-static inline void fpu_save_init(struct fpu *fpu)
+static inline int fpu_save_init(struct fpu *fpu)
 {
        if (use_xsave()) {
                fpu_xsave(fpu);
@@ -233,33 +226,33 @@ static inline void fpu_save_init(struct fpu *fpu)
                 * xsave header may indicate the init state of the FP.
                 */
                if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
-                       return;
+                       return 1;
        } else if (use_fxsr()) {
                fpu_fxsave(fpu);
        } else {
                asm volatile("fnsave %[fx]; fwait"
                             : [fx] "=m" (fpu->state->fsave));
-               return;
+               return 0;
        }
 
-       if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
+       /*
+        * If exceptions are pending, we need to clear them so
+        * that we don't randomly get exceptions later.
+        *
+        * FIXME! Is this perhaps only true for the old-style
+        * irq13 case? Maybe we could leave the x87 state
+        * intact otherwise?
+        */
+       if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) {
                asm volatile("fnclex");
-
-       /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
-          is pending.  Clear the x87 state here by setting it to fixed
-          values. safe_address is a random variable that should be in L1 */
-       alternative_input(
-               ASM_NOP8 ASM_NOP2,
-               "emms\n\t"              /* clear stack tags */
-               "fildl %P[addr]",       /* set F?P to defined value */
-               X86_FEATURE_FXSAVE_LEAK,
-               [addr] "m" (safe_address));
+               return 0;
+       }
+       return 1;
 }
 
-static inline void __save_init_fpu(struct task_struct *tsk)
+static inline int __save_init_fpu(struct task_struct *tsk)
 {
-       fpu_save_init(&tsk->thread.fpu);
-       task_thread_info(tsk)->status &= ~TS_USEDFPU;
+       return fpu_save_init(&tsk->thread.fpu);
 }
 
 static inline int fpu_fxrstor_checking(struct fpu *fpu)
@@ -277,33 +270,152 @@ static inline int fpu_restore_checking(struct fpu *fpu)
 
 static inline int restore_fpu_checking(struct task_struct *tsk)
 {
+       /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
+          is pending.  Clear the x87 state here by setting it to fixed
+          values. "m" is a random variable that should be in L1 */
+       alternative_input(
+               ASM_NOP8 ASM_NOP2,
+               "emms\n\t"              /* clear stack tags */
+               "fildl %P[addr]",       /* set F?P to defined value */
+               X86_FEATURE_FXSAVE_LEAK,
+               [addr] "m" (tsk->thread.fpu.has_fpu));
+
        return fpu_restore_checking(&tsk->thread.fpu);
 }
 
 /*
- * Signal frame handlers...
+ * Software FPU state helpers. Careful: these need to
+ * be preemption protection *and* they need to be
+ * properly paired with the CR0.TS changes!
  */
-extern int save_i387_xstate(void __user *buf);
-extern int restore_i387_xstate(void __user *buf);
+static inline int __thread_has_fpu(struct task_struct *tsk)
+{
+       return tsk->thread.fpu.has_fpu;
+}
 
-static inline void __unlazy_fpu(struct task_struct *tsk)
+/* Must be paired with an 'stts' after! */
+static inline void __thread_clear_has_fpu(struct task_struct *tsk)
 {
-       if (task_thread_info(tsk)->status & TS_USEDFPU) {
-               __save_init_fpu(tsk);
-               stts();
-       } else
-               tsk->fpu_counter = 0;
+       tsk->thread.fpu.has_fpu = 0;
+       percpu_write(fpu_owner_task, NULL);
+}
+
+/* Must be paired with a 'clts' before! */
+static inline void __thread_set_has_fpu(struct task_struct *tsk)
+{
+       tsk->thread.fpu.has_fpu = 1;
+       percpu_write(fpu_owner_task, tsk);
+}
+
+/*
+ * Encapsulate the CR0.TS handling together with the
+ * software flag.
+ *
+ * These generally need preemption protection to work,
+ * do try to avoid using these on their own.
+ */
+static inline void __thread_fpu_end(struct task_struct *tsk)
+{
+       __thread_clear_has_fpu(tsk);
+       stts();
 }
 
+static inline void __thread_fpu_begin(struct task_struct *tsk)
+{
+       clts();
+       __thread_set_has_fpu(tsk);
+}
+
+/*
+ * FPU state switching for scheduling.
+ *
+ * This is a two-stage process:
+ *
+ *  - switch_fpu_prepare() saves the old state and
+ *    sets the new state of the CR0.TS bit. This is
+ *    done within the context of the old process.
+ *
+ *  - switch_fpu_finish() restores the new state as
+ *    necessary.
+ */
+typedef struct { int preload; } fpu_switch_t;
+
+/*
+ * FIXME! We could do a totally lazy restore, but we need to
+ * add a per-cpu "this was the task that last touched the FPU
+ * on this CPU" variable, and the task needs to have a "I last
+ * touched the FPU on this CPU" and check them.
+ *
+ * We don't do that yet, so "fpu_lazy_restore()" always returns
+ * false, but some day..
+ */
+static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
+{
+       return new == percpu_read_stable(fpu_owner_task) &&
+               cpu == new->thread.fpu.last_cpu;
+}
+
+static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new, int cpu)
+{
+       fpu_switch_t fpu;
+
+       fpu.preload = tsk_used_math(new) && new->fpu_counter > 5;
+       if (__thread_has_fpu(old)) {
+               if (!__save_init_fpu(old))
+                       cpu = ~0;
+               old->thread.fpu.last_cpu = cpu;
+               old->thread.fpu.has_fpu = 0;    /* But leave fpu_owner_task! */
+
+               /* Don't change CR0.TS if we just switch! */
+               if (fpu.preload) {
+                       new->fpu_counter++;
+                       __thread_set_has_fpu(new);
+                       prefetch(new->thread.fpu.state);
+               } else
+                       stts();
+       } else {
+               old->fpu_counter = 0;
+               old->thread.fpu.last_cpu = ~0;
+               if (fpu.preload) {
+                       new->fpu_counter++;
+                       if (fpu_lazy_restore(new, cpu))
+                               fpu.preload = 0;
+                       else
+                               prefetch(new->thread.fpu.state);
+                       __thread_fpu_begin(new);
+               }
+       }
+       return fpu;
+}
+
+/*
+ * By the time this gets called, we've already cleared CR0.TS and
+ * given the process the FPU if we are going to preload the FPU
+ * state - all we need to do is to conditionally restore the register
+ * state itself.
+ */
+static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu)
+{
+       if (fpu.preload) {
+               if (unlikely(restore_fpu_checking(new)))
+                       __thread_fpu_end(new);
+       }
+}
+
+/*
+ * Signal frame handlers...
+ */
+extern int save_i387_xstate(void __user *buf);
+extern int restore_i387_xstate(void __user *buf);
+
 static inline void __clear_fpu(struct task_struct *tsk)
 {
-       if (task_thread_info(tsk)->status & TS_USEDFPU) {
+       if (__thread_has_fpu(tsk)) {
                /* Ignore delayed exceptions from user space */
                asm volatile("1: fwait\n"
                             "2:\n"
                             _ASM_EXTABLE(1b, 2b));
-               task_thread_info(tsk)->status &= ~TS_USEDFPU;
-               stts();
+               __thread_fpu_end(tsk);
        }
 }
 
@@ -311,14 +423,14 @@ static inline void __clear_fpu(struct task_struct *tsk)
  * Were we in an interrupt that interrupted kernel mode?
  *
  * We can do a kernel_fpu_begin/end() pair *ONLY* if that
- * pair does nothing at all: TS_USEDFPU must be clear (so
+ * pair does nothing at all: the thread must not have fpu (so
  * that we don't try to save the FPU state), and TS must
  * be set (so that the clts/stts pair does nothing that is
  * visible in the interrupted kernel thread).
  */
 static inline bool interrupted_kernel_fpu_idle(void)
 {
-       return !(current_thread_info()->status & TS_USEDFPU) &&
+       return !__thread_has_fpu(current) &&
                (read_cr0() & X86_CR0_TS);
 }
 
@@ -352,14 +464,18 @@ static inline bool irq_fpu_usable(void)
 
 static inline void kernel_fpu_begin(void)
 {
-       struct thread_info *me = current_thread_info();
+       struct task_struct *me = current;
 
        WARN_ON_ONCE(!irq_fpu_usable());
        preempt_disable();
-       if (me->status & TS_USEDFPU)
-               __save_init_fpu(me->task);
-       else
+       if (__thread_has_fpu(me)) {
+               __save_init_fpu(me);
+               __thread_clear_has_fpu(me);
+               /* We do 'stts()' in kernel_fpu_end() */
+       } else {
+               percpu_write(fpu_owner_task, NULL);
                clts();
+       }
 }
 
 static inline void kernel_fpu_end(void)
@@ -399,22 +515,65 @@ static inline void irq_ts_restore(int TS_state)
                stts();
 }
 
+/*
+ * The question "does this thread have fpu access?"
+ * is slightly racy, since preemption could come in
+ * and revoke it immediately after the test.
+ *
+ * However, even in that very unlikely scenario,
+ * we can just assume we have FPU access - typically
+ * to save the FP state - we'll just take a #NM
+ * fault and get the FPU access back.
+ *
+ * The actual user_fpu_begin/end() functions
+ * need to be preemption-safe, though.
+ *
+ * NOTE! user_fpu_end() must be used only after you
+ * have saved the FP state, and user_fpu_begin() must
+ * be used only immediately before restoring it.
+ * These functions do not do any save/restore on
+ * their own.
+ */
+static inline int user_has_fpu(void)
+{
+       return __thread_has_fpu(current);
+}
+
+static inline void user_fpu_end(void)
+{
+       preempt_disable();
+       __thread_fpu_end(current);
+       preempt_enable();
+}
+
+static inline void user_fpu_begin(void)
+{
+       preempt_disable();
+       if (!user_has_fpu())
+               __thread_fpu_begin(current);
+       preempt_enable();
+}
+
 /*
  * These disable preemption on their own and are safe
  */
 static inline void save_init_fpu(struct task_struct *tsk)
 {
-       WARN_ON_ONCE(task_thread_info(tsk)->status & TS_USEDFPU);
+       WARN_ON_ONCE(!__thread_has_fpu(tsk));
        preempt_disable();
        __save_init_fpu(tsk);
-       stts();
+       __thread_fpu_end(tsk);
        preempt_enable();
 }
 
 static inline void unlazy_fpu(struct task_struct *tsk)
 {
        preempt_disable();
-       __unlazy_fpu(tsk);
+       if (__thread_has_fpu(tsk)) {
+               __save_init_fpu(tsk);
+               __thread_fpu_end(tsk);
+       } else
+               tsk->fpu_counter = 0;
        preempt_enable();
 }
 
index 096c975e099fee9ed2578b9ca4d9f77d9ef56006..461ce432b1c2755c6d0f70e00e3ac9f3993ecba1 100644 (file)
@@ -242,4 +242,12 @@ static inline void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
 static inline void perf_events_lapic_init(void)        { }
 #endif
 
+#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_AMD)
+ extern void amd_pmu_enable_virt(void);
+ extern void amd_pmu_disable_virt(void);
+#else
+ static inline void amd_pmu_enable_virt(void) { }
+ static inline void amd_pmu_disable_virt(void) { }
+#endif
+
 #endif /* _ASM_X86_PERF_EVENT_H */
index aa9088c26931ae349c0bc6fbfece5fe0b10edfb9..58545c97d071c84dba4a05b59bad7be5d0b69b01 100644 (file)
@@ -374,6 +374,8 @@ union thread_xstate {
 };
 
 struct fpu {
+       unsigned int last_cpu;
+       unsigned int has_fpu;
        union thread_xstate *state;
 };
 
index bc817cd8b44359b615e34f9b08aa67a61425cf29..cfd8144d552742bcd12ac1b42f0d7b45adc5c2fb 100644 (file)
@@ -247,8 +247,6 @@ static inline struct thread_info *current_thread_info(void)
  * ever touches our thread-synchronous status, so we don't
  * have to worry about atomic accesses.
  */
-#define TS_USEDFPU             0x0001  /* FPU was used by this task
-                                          this quantum (SMP) */
 #define TS_COMPAT              0x0002  /* 32bit syscall active (64BIT)*/
 #define TS_POLLING             0x0004  /* idle task polling need_resched,
                                           skip sending interrupt */
index d43cad74f1661c2180cc1f9277b9553b3de7cf63..c0f7d68d318f1b7a8a6a27f798250b53c778d50f 100644 (file)
@@ -1044,6 +1044,9 @@ DEFINE_PER_CPU(char *, irq_stack_ptr) =
 
 DEFINE_PER_CPU(unsigned int, irq_count) = -1;
 
+DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);
+EXPORT_PER_CPU_SYMBOL(fpu_owner_task);
+
 /*
  * Special IST stacks which the CPU switches to when it calls
  * an IST-marked descriptor entry. Up to 7 stacks (hardware
@@ -1111,6 +1114,8 @@ void debug_stack_reset(void)
 
 DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
 EXPORT_PER_CPU_SYMBOL(current_task);
+DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);
+EXPORT_PER_CPU_SYMBOL(fpu_owner_task);
 
 #ifdef CONFIG_CC_STACKPROTECTOR
 DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary);
index 6b45e5e7a9015203085c5d09b4de04e6918b46eb..73d08ed98a64fc8beafb3c2e6768d19f02c09f89 100644 (file)
@@ -326,8 +326,7 @@ static void __cpuinit amd_calc_l3_indices(struct amd_northbridge *nb)
        l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1;
 }
 
-static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf,
-                                       int index)
+static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index)
 {
        int node;
 
@@ -725,14 +724,16 @@ static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info);
 #define CPUID4_INFO_IDX(x, y)  (&((per_cpu(ici_cpuid4_info, x))[y]))
 
 #ifdef CONFIG_SMP
-static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
+
+static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index)
 {
-       struct _cpuid4_info     *this_leaf, *sibling_leaf;
-       unsigned long num_threads_sharing;
-       int index_msb, i, sibling;
+       struct _cpuid4_info *this_leaf;
+       int ret, i, sibling;
        struct cpuinfo_x86 *c = &cpu_data(cpu);
 
-       if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) {
+       ret = 0;
+       if (index == 3) {
+               ret = 1;
                for_each_cpu(i, cpu_llc_shared_mask(cpu)) {
                        if (!per_cpu(ici_cpuid4_info, i))
                                continue;
@@ -743,8 +744,35 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
                                set_bit(sibling, this_leaf->shared_cpu_map);
                        }
                }
-               return;
+       } else if ((c->x86 == 0x15) && ((index == 1) || (index == 2))) {
+               ret = 1;
+               for_each_cpu(i, cpu_sibling_mask(cpu)) {
+                       if (!per_cpu(ici_cpuid4_info, i))
+                               continue;
+                       this_leaf = CPUID4_INFO_IDX(i, index);
+                       for_each_cpu(sibling, cpu_sibling_mask(cpu)) {
+                               if (!cpu_online(sibling))
+                                       continue;
+                               set_bit(sibling, this_leaf->shared_cpu_map);
+                       }
+               }
        }
+
+       return ret;
+}
+
+static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
+{
+       struct _cpuid4_info *this_leaf, *sibling_leaf;
+       unsigned long num_threads_sharing;
+       int index_msb, i;
+       struct cpuinfo_x86 *c = &cpu_data(cpu);
+
+       if (c->x86_vendor == X86_VENDOR_AMD) {
+               if (cache_shared_amd_cpu_map_setup(cpu, index))
+                       return;
+       }
+
        this_leaf = CPUID4_INFO_IDX(cpu, index);
        num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing;
 
index 786e76a86322c99ffd67a6fd9ebf03f85b1d36a3..e4eeaaf58a470a841d612724b5ef8f523fb3adb6 100644 (file)
@@ -528,6 +528,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
 
        sprintf(name, "threshold_bank%i", bank);
 
+#ifdef CONFIG_SMP
        if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) {   /* symlink */
                i = cpumask_first(cpu_llc_shared_mask(cpu));
 
@@ -553,6 +554,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
 
                goto out;
        }
+#endif
 
        b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL);
        if (!b) {
index 8944062f46e284faaa65ec043403352ea7c5f14c..c30c807ddc7236e444508357e8186bd4d504bd6f 100644 (file)
@@ -147,7 +147,9 @@ struct cpu_hw_events {
        /*
         * AMD specific bits
         */
-       struct amd_nb           *amd_nb;
+       struct amd_nb                   *amd_nb;
+       /* Inverted mask of bits to clear in the perf_ctr ctrl registers */
+       u64                             perf_ctr_virt_mask;
 
        void                            *kfree_on_online;
 };
@@ -417,9 +419,11 @@ void x86_pmu_disable_all(void);
 static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,
                                          u64 enable_mask)
 {
+       u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);
+
        if (hwc->extra_reg.reg)
                wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);
-       wrmsrl(hwc->config_base, hwc->config | enable_mask);
+       wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);
 }
 
 void x86_pmu_enable_all(int added);
index 0397b23be8e9006c0171bb092b2e5a8f7249e709..67250a52430bfd9a3d0cf89fa38408d0e8cd793a 100644 (file)
@@ -1,4 +1,5 @@
 #include <linux/perf_event.h>
+#include <linux/export.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -357,7 +358,9 @@ static void amd_pmu_cpu_starting(int cpu)
        struct amd_nb *nb;
        int i, nb_id;
 
-       if (boot_cpu_data.x86_max_cores < 2)
+       cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
+
+       if (boot_cpu_data.x86_max_cores < 2 || boot_cpu_data.x86 == 0x15)
                return;
 
        nb_id = amd_get_nb_id(cpu);
@@ -587,9 +590,9 @@ static __initconst const struct x86_pmu amd_pmu_f15h = {
        .put_event_constraints  = amd_put_event_constraints,
 
        .cpu_prepare            = amd_pmu_cpu_prepare,
-       .cpu_starting           = amd_pmu_cpu_starting,
        .cpu_dead               = amd_pmu_cpu_dead,
 #endif
+       .cpu_starting           = amd_pmu_cpu_starting,
 };
 
 __init int amd_pmu_init(void)
@@ -621,3 +624,33 @@ __init int amd_pmu_init(void)
 
        return 0;
 }
+
+void amd_pmu_enable_virt(void)
+{
+       struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
+
+       cpuc->perf_ctr_virt_mask = 0;
+
+       /* Reload all events */
+       x86_pmu_disable_all();
+       x86_pmu_enable_all(0);
+}
+EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);
+
+void amd_pmu_disable_virt(void)
+{
+       struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
+
+       /*
+        * We only mask out the Host-only bit so that host-only counting works
+        * when SVM is disabled. If someone sets up a guest-only counter when
+        * SVM is disabled the Guest-only bits still gets set and the counter
+        * will not count anything.
+        */
+       cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
+
+       /* Reload all events */
+       x86_pmu_disable_all();
+       x86_pmu_enable_all(0);
+}
+EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
index 3fe8239fd8fbd8ef692f57517d0d1dbd37f284ae..1333d9851778ab282c3cc7a282ec9368c1e26035 100644 (file)
@@ -1531,11 +1531,18 @@ ENTRY(nmi)
        /* Use %rdx as out temp variable throughout */
        pushq_cfi %rdx
 
+       /*
+        * If %cs was not the kernel segment, then the NMI triggered in user
+        * space, which means it is definitely not nested.
+        */
+       cmpl $__KERNEL_CS, 16(%rsp)
+       jne first_nmi
+
        /*
         * Check the special variable on the stack to see if NMIs are
         * executing.
         */
-       cmp $1, -8(%rsp)
+       cmpl $1, -8(%rsp)
        je nested_nmi
 
        /*
index ac0417be9131a8d59cd834a61b629dd36ddec5b5..73465aab28f87c09b5313e81e79d54a31afff1f1 100644 (file)
@@ -360,7 +360,6 @@ out:
 static enum ucode_state
 request_microcode_user(int cpu, const void __user *buf, size_t size)
 {
-       pr_info("AMD microcode update via /dev/cpu/microcode not supported\n");
        return UCODE_ERROR;
 }
 
index 485204f58cdaaf7e8306198375a7dce17450b025..c08d1ff12b7c4087dd01ad6f2ba8ea5bcc8ba04a 100644 (file)
@@ -214,6 +214,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 
        task_user_gs(p) = get_user_gs(regs);
 
+       p->fpu_counter = 0;
        p->thread.io_bitmap_ptr = NULL;
        tsk = current;
        err = -ENOMEM;
@@ -299,22 +300,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
                                 *next = &next_p->thread;
        int cpu = smp_processor_id();
        struct tss_struct *tss = &per_cpu(init_tss, cpu);
-       bool preload_fpu;
+       fpu_switch_t fpu;
 
        /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
 
-       /*
-        * If the task has used fpu the last 5 timeslices, just do a full
-        * restore of the math state immediately to avoid the trap; the
-        * chances of needing FPU soon are obviously high now
-        */
-       preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
-
-       __unlazy_fpu(prev_p);
-
-       /* we're going to use this soon, after a few expensive things */
-       if (preload_fpu)
-               prefetch(next->fpu.state);
+       fpu = switch_fpu_prepare(prev_p, next_p, cpu);
 
        /*
         * Reload esp0.
@@ -354,11 +344,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
                     task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
                __switch_to_xtra(prev_p, next_p, tss);
 
-       /* If we're going to preload the fpu context, make sure clts
-          is run while we're batching the cpu state updates. */
-       if (preload_fpu)
-               clts();
-
        /*
         * Leave lazy mode, flushing any hypercalls made here.
         * This must be done before restoring TLS segments so
@@ -368,15 +353,14 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
         */
        arch_end_context_switch(next_p);
 
-       if (preload_fpu)
-               __math_state_restore();
-
        /*
         * Restore %gs if needed (which is common)
         */
        if (prev->gs | next->gs)
                lazy_load_gs(next->gs);
 
+       switch_fpu_finish(next_p, fpu);
+
        percpu_write(current_task, next_p);
 
        return prev_p;
index 9b9fe4a85c87fcebcd370c1e4a33d235f67140ec..cfa5c90c01dbe0c170587ae8891a1fa419aa2e36 100644 (file)
@@ -286,6 +286,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
 
        set_tsk_thread_flag(p, TIF_FORK);
 
+       p->fpu_counter = 0;
        p->thread.io_bitmap_ptr = NULL;
 
        savesegment(gs, p->thread.gsindex);
@@ -386,18 +387,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        int cpu = smp_processor_id();
        struct tss_struct *tss = &per_cpu(init_tss, cpu);
        unsigned fsindex, gsindex;
-       bool preload_fpu;
+       fpu_switch_t fpu;
 
-       /*
-        * If the task has used fpu the last 5 timeslices, just do a full
-        * restore of the math state immediately to avoid the trap; the
-        * chances of needing FPU soon are obviously high now
-        */
-       preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
-
-       /* we're going to use this soon, after a few expensive things */
-       if (preload_fpu)
-               prefetch(next->fpu.state);
+       fpu = switch_fpu_prepare(prev_p, next_p, cpu);
 
        /*
         * Reload esp0, LDT and the page table pointer:
@@ -427,13 +419,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 
        load_TLS(next, cpu);
 
-       /* Must be after DS reload */
-       __unlazy_fpu(prev_p);
-
-       /* Make sure cpu is ready for new context */
-       if (preload_fpu)
-               clts();
-
        /*
         * Leave lazy mode, flushing any hypercalls made here.
         * This must be done before restoring TLS segments so
@@ -474,6 +459,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
                wrmsrl(MSR_KERNEL_GS_BASE, next->gs);
        prev->gsindex = gsindex;
 
+       switch_fpu_finish(next_p, fpu);
+
        /*
         * Switch the PDA and FPU contexts.
         */
@@ -492,13 +479,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
                     task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))
                __switch_to_xtra(prev_p, next_p, tss);
 
-       /*
-        * Preload the FPU context, now that we've determined that the
-        * task is likely to be using it. 
-        */
-       if (preload_fpu)
-               __math_state_restore();
-
        return prev_p;
 }
 
index 8ba27dbc107a1ccdf88f7da3a08f11aee1c1625e..4bbe04d967441196c3c0a3f3390f9e6826f156a0 100644 (file)
@@ -570,28 +570,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
 {
 }
 
-/*
- * __math_state_restore assumes that cr0.TS is already clear and the
- * fpu state is all ready for use.  Used during context switch.
- */
-void __math_state_restore(void)
-{
-       struct thread_info *thread = current_thread_info();
-       struct task_struct *tsk = thread->task;
-
-       /*
-        * Paranoid restore. send a SIGSEGV if we fail to restore the state.
-        */
-       if (unlikely(restore_fpu_checking(tsk))) {
-               stts();
-               force_sig(SIGSEGV, tsk);
-               return;
-       }
-
-       thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
-       tsk->fpu_counter++;
-}
-
 /*
  * 'math_state_restore()' saves the current math information in the
  * old math state array, and gets the new ones from the current task
@@ -604,8 +582,7 @@ void __math_state_restore(void)
  */
 void math_state_restore(void)
 {
-       struct thread_info *thread = current_thread_info();
-       struct task_struct *tsk = thread->task;
+       struct task_struct *tsk = current;
 
        if (!tsk_used_math(tsk)) {
                local_irq_enable();
@@ -622,16 +599,23 @@ void math_state_restore(void)
                local_irq_disable();
        }
 
-       clts();                         /* Allow maths ops (or we recurse) */
+       __thread_fpu_begin(tsk);
+       /*
+        * Paranoid restore. send a SIGSEGV if we fail to restore the state.
+        */
+       if (unlikely(restore_fpu_checking(tsk))) {
+               __thread_fpu_end(tsk);
+               force_sig(SIGSEGV, tsk);
+               return;
+       }
 
-       __math_state_restore();
+       tsk->fpu_counter++;
 }
 EXPORT_SYMBOL_GPL(math_state_restore);
 
 dotraplinkage void __kprobes
 do_device_not_available(struct pt_regs *regs, long error_code)
 {
-       WARN_ON_ONCE(!user_mode_vm(regs));
 #ifdef CONFIG_MATH_EMULATION
        if (read_cr0() & X86_CR0_EM) {
                struct math_emu_info info = { };
index a3911343976b8ae50040228b7993d5d90773002f..711091114119532a1c9d2dff819da9c41e8a39b9 100644 (file)
@@ -47,7 +47,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
        if (!fx)
                return;
 
-       BUG_ON(task_thread_info(tsk)->status & TS_USEDFPU);
+       BUG_ON(__thread_has_fpu(tsk));
 
        xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
 
@@ -168,7 +168,7 @@ int save_i387_xstate(void __user *buf)
        if (!used_math())
                return 0;
 
-       if (task_thread_info(tsk)->status & TS_USEDFPU) {
+       if (user_has_fpu()) {
                if (use_xsave())
                        err = xsave_user(buf);
                else
@@ -176,8 +176,7 @@ int save_i387_xstate(void __user *buf)
 
                if (err)
                        return err;
-               task_thread_info(tsk)->status &= ~TS_USEDFPU;
-               stts();
+               user_fpu_end();
        } else {
                sanitize_i387_state(tsk);
                if (__copy_to_user(buf, &tsk->thread.fpu.state->fxsave,
@@ -292,10 +291,7 @@ int restore_i387_xstate(void __user *buf)
                        return err;
        }
 
-       if (!(task_thread_info(current)->status & TS_USEDFPU)) {
-               clts();
-               task_thread_info(current)->status |= TS_USEDFPU;
-       }
+       user_fpu_begin();
        if (use_xsave())
                err = restore_user_xstate(buf);
        else
index 5fa553babe566876d70115d1d259bd2d1a4925a6..e385214711cbcf005846c1d0e335502a6c7d9709 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/ftrace_event.h>
 #include <linux/slab.h>
 
+#include <asm/perf_event.h>
 #include <asm/tlbflush.h>
 #include <asm/desc.h>
 #include <asm/kvm_para.h>
@@ -575,6 +576,8 @@ static void svm_hardware_disable(void *garbage)
                wrmsrl(MSR_AMD64_TSC_RATIO, TSC_RATIO_DEFAULT);
 
        cpu_svm_disable();
+
+       amd_pmu_disable_virt();
 }
 
 static int svm_hardware_enable(void *garbage)
@@ -622,6 +625,8 @@ static int svm_hardware_enable(void *garbage)
 
        svm_init_erratum_383();
 
+       amd_pmu_enable_virt();
+
        return 0;
 }
 
index d29216c462b3ce56e33c3bf0ecf7595258b9705a..3b4c8d8ad906917070e2ef730090903860f49276 100644 (file)
@@ -1457,7 +1457,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
 #ifdef CONFIG_X86_64
        wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
 #endif
-       if (current_thread_info()->status & TS_USEDFPU)
+       if (__thread_has_fpu(current))
                clts();
        load_gdt(&__get_cpu_var(host_gdt));
 }
index f581a18c0d4d7d07aac5cdfa8fb443106e3d5e92..8ecbb4bba4b3b44241b64b46079476ad90f7aad4 100644 (file)
@@ -333,13 +333,15 @@ try_again:
                 * Lookup failure means no vma is above this address,
                 * i.e. return with success:
                 */
-               if (!(vma = find_vma_prev(mm, addr, &prev_vma)))
+               vma = find_vma(mm, addr);
+               if (!vma)
                        return addr;
 
                /*
                 * new region fits between prev_vma->vm_end and
                 * vma->vm_start, use it:
                 */
+               prev_vma = vma->vm_prev;
                if (addr + len <= vma->vm_start &&
                            (!prev_vma || (addr >= prev_vma->vm_end))) {
                        /* remember the address as a hint for next time */
index a312e76063a7c4b1320eb80718cf81c33e7361dc..49a5cb55429b6ae51696f43c5a05c63a07df5566 100644 (file)
@@ -60,6 +60,16 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
                        DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
                },
        },
+       /* https://bugzilla.kernel.org/show_bug.cgi?id=42619 */
+       {
+               .callback = set_use_crs,
+               .ident = "MSI MS-7253",
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
+                       DMI_MATCH(DMI_BOARD_NAME, "MS-7253"),
+                       DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
+               },
+       },
 
        /* Now for the blacklist.. */
 
@@ -282,9 +292,6 @@ static void add_resources(struct pci_root_info *info)
        int i;
        struct resource *res, *root, *conflict;
 
-       if (!pci_use_crs)
-               return;
-
        coalesce_windows(info, IORESOURCE_MEM);
        coalesce_windows(info, IORESOURCE_IO);
 
@@ -336,8 +343,13 @@ get_current_resources(struct acpi_device *device, int busnum,
        acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
                                &info);
 
-       add_resources(&info);
-       return;
+       if (pci_use_crs) {
+               add_resources(&info);
+
+               return;
+       }
+
+       kfree(info.name);
 
 name_alloc_fail:
        kfree(info.res);
index 12eb07bfb267ee6747abbd4192fab3f9f5c1f44e..4172af8ceeb363d06912af15bf89e8508752b794 100644 (file)
@@ -1141,7 +1141,9 @@ asmlinkage void __init xen_start_kernel(void)
 
        /* Prevent unwanted bits from being set in PTEs. */
        __supported_pte_mask &= ~_PAGE_GLOBAL;
+#if 0
        if (!xen_initial_domain())
+#endif
                __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
 
        __supported_pte_mask |= _PAGE_IOMAP;
@@ -1204,10 +1206,6 @@ asmlinkage void __init xen_start_kernel(void)
 
        pgd = (pgd_t *)xen_start_info->pt_base;
 
-       if (!xen_initial_domain())
-               __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
-
-       __supported_pte_mask |= _PAGE_IOMAP;
        /* Don't do the full vcpu_info placement stuff until we have a
           possible map and a non-dummy shared_info. */
        per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
index 58a0e46c404dc417c9af3cf9a08856096ebc99cf..95c1cf60c6694a0ff569e47012b9b30f2a73c97a 100644 (file)
@@ -415,13 +415,13 @@ static pteval_t iomap_pte(pteval_t val)
 static pteval_t xen_pte_val(pte_t pte)
 {
        pteval_t pteval = pte.pte;
-
+#if 0
        /* If this is a WC pte, convert back from Xen WC to Linux WC */
        if ((pteval & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) == _PAGE_PAT) {
                WARN_ON(!pat_enabled);
                pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT;
        }
-
+#endif
        if (xen_initial_domain() && (pteval & _PAGE_IOMAP))
                return pteval;
 
@@ -463,7 +463,7 @@ void xen_set_pat(u64 pat)
 static pte_t xen_make_pte(pteval_t pte)
 {
        phys_addr_t addr = (pte & PTE_PFN_MASK);
-
+#if 0
        /* If Linux is trying to set a WC pte, then map to the Xen WC.
         * If _PAGE_PAT is set, then it probably means it is really
         * _PAGE_PSE, so avoid fiddling with the PAT mapping and hope
@@ -476,7 +476,7 @@ static pte_t xen_make_pte(pteval_t pte)
                if ((pte & (_PAGE_PCD | _PAGE_PWT)) == _PAGE_PWT)
                        pte = (pte & ~(_PAGE_PCD | _PAGE_PWT)) | _PAGE_PAT;
        }
-
+#endif
        /*
         * Unprivileged domains are allowed to do IOMAPpings for
         * PCI passthrough, but not map ISA space.  The ISA
index bd8ae788f689129a1ae6cc75c4687655031a868d..e507cfbd044e6b864f09baf10c192aa53689b087 100644 (file)
@@ -2,7 +2,7 @@
  * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
  *
  * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
- * Copyright (c) 2001-2007 Anton Altaparmakov
+ * Copyright (c) 2001-2012 Anton Altaparmakov
  * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
  *
  * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads 
@@ -1341,20 +1341,17 @@ found:
                ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);
                return false;
        }
-
        if (f->map & (1 << rec)) {
                ldm_error ("Duplicate VBLK, part %d.", rec);
                f->map &= 0x7F;                 /* Mark the group as broken */
                return false;
        }
-
        f->map |= (1 << rec);
-
+       if (!rec)
+               memcpy(f->data, data, VBLK_SIZE_HEAD);
        data += VBLK_SIZE_HEAD;
        size -= VBLK_SIZE_HEAD;
-
-       memcpy (f->data+rec*(size-VBLK_SIZE_HEAD)+VBLK_SIZE_HEAD, data, size);
-
+       memcpy(f->data + VBLK_SIZE_HEAD + rec * size, data, size);
        return true;
 }
 
index f04af931a6821d1a45f009a086f8de7ce1be1a7b..107f6f7be5e139129a1666f1f20aa3a6967c1ef0 100644 (file)
@@ -31,11 +31,6 @@ static inline u64 Maj(u64 x, u64 y, u64 z)
         return (x & y) | (z & (x | y));
 }
 
-static inline u64 RORu64(u64 x, u64 y)
-{
-        return (x >> y) | (x << (64 - y));
-}
-
 static const u64 sha512_K[80] = {
         0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
         0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
@@ -66,10 +61,10 @@ static const u64 sha512_K[80] = {
         0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
 };
 
-#define e0(x)       (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39))
-#define e1(x)       (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41))
-#define s0(x)       (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7))
-#define s1(x)       (RORu64(x,19) ^ RORu64(x,61) ^ (x >> 6))
+#define e0(x)       (ror64(x,28) ^ ror64(x,34) ^ ror64(x,39))
+#define e1(x)       (ror64(x,14) ^ ror64(x,18) ^ ror64(x,41))
+#define s0(x)       (ror64(x, 1) ^ ror64(x, 8) ^ (x >> 7))
+#define s1(x)       (ror64(x,19) ^ ror64(x,61) ^ (x >> 6))
 
 static inline void LOAD_OP(int I, u64 *W, const u8 *input)
 {
index a7d91a72ee352b45ca71cf1bd2ccb738890f1075..53d3770a0b1b8b3e101a10d221fef1d202ddf4d4 100644 (file)
@@ -207,11 +207,11 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev,
 {
        int ret = 0;
        int use_iordy;
+       struct sam9_smc_config smc;
        unsigned int t6z;         /* data tristate time in ns */
        unsigned int cycle;       /* SMC Cycle width in MCK ticks */
        unsigned int setup;       /* SMC Setup width in MCK ticks */
        unsigned int pulse;       /* CFIOR and CFIOW pulse width in MCK ticks */
-       unsigned int cs_setup = 0;/* CS4 or CS5 setup width in MCK ticks */
        unsigned int cs_pulse;    /* CS4 or CS5 pulse width in MCK ticks*/
        unsigned int tdf_cycles;  /* SMC TDF MCK ticks */
        unsigned long mck_hz;     /* MCK frequency in Hz */
@@ -244,26 +244,20 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev,
        }
 
        dev_dbg(dev, "Use IORDY=%u, TDF Cycles=%u\n", use_iordy, tdf_cycles);
-       info->mode |= AT91_SMC_TDF_(tdf_cycles);
-
-       /* write SMC Setup Register */
-       at91_sys_write(AT91_SMC_SETUP(info->cs),
-                       AT91_SMC_NWESETUP_(setup) |
-                       AT91_SMC_NRDSETUP_(setup) |
-                       AT91_SMC_NCS_WRSETUP_(cs_setup) |
-                       AT91_SMC_NCS_RDSETUP_(cs_setup));
-       /* write SMC Pulse Register */
-       at91_sys_write(AT91_SMC_PULSE(info->cs),
-                       AT91_SMC_NWEPULSE_(pulse) |
-                       AT91_SMC_NRDPULSE_(pulse) |
-                       AT91_SMC_NCS_WRPULSE_(cs_pulse) |
-                       AT91_SMC_NCS_RDPULSE_(cs_pulse));
-       /* write SMC Cycle Register */
-       at91_sys_write(AT91_SMC_CYCLE(info->cs),
-                       AT91_SMC_NWECYCLE_(cycle) |
-                       AT91_SMC_NRDCYCLE_(cycle));
-       /* write SMC Mode Register*/
-       at91_sys_write(AT91_SMC_MODE(info->cs), info->mode);
+
+       /* SMC Setup Register */
+       smc.nwe_setup = smc.nrd_setup = setup;
+       smc.ncs_write_setup = smc.ncs_read_setup = 0;
+       /* SMC Pulse Register */
+       smc.nwe_pulse = smc.nrd_pulse = pulse;
+       smc.ncs_write_pulse = smc.ncs_read_pulse = cs_pulse;
+       /* SMC Cycle Register */
+       smc.write_cycle = smc.read_cycle = cycle;
+       /* SMC Mode Register*/
+       smc.tdf_cycles = tdf_cycles;
+       smc.mode = info->mode;
+
+       sam9_smc_configure(0, info->cs, &smc);
 }
 
 static void pata_at91_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -288,20 +282,20 @@ static unsigned int pata_at91_data_xfer_noirq(struct ata_device *dev,
        struct at91_ide_info *info = dev->link->ap->host->private_data;
        unsigned int consumed;
        unsigned long flags;
-       unsigned int mode;
+       struct sam9_smc_config smc;
 
        local_irq_save(flags);
-       mode = at91_sys_read(AT91_SMC_MODE(info->cs));
+       sam9_smc_read_mode(0, info->cs, &smc);
 
        /* set 16bit mode before writing data */
-       at91_sys_write(AT91_SMC_MODE(info->cs),
-                       (mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16);
+       smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16;
+       sam9_smc_write_mode(0, info->cs, &smc);
 
        consumed = ata_sff_data_xfer(dev, buf, buflen, rw);
 
        /* restore 8bit mode after data is written */
-       at91_sys_write(AT91_SMC_MODE(info->cs),
-                       (mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8);
+       smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8;
+       sam9_smc_write_mode(0, info->cs, &smc);
 
        local_irq_restore(flags);
        return consumed;
index 5d1d07645132bdce10dfdbe2590a7cb2da8179d3..e8cd652d20178c7c3ff8465aac997f1f65e20f63 100644 (file)
@@ -1206,9 +1206,9 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
        
  out_unmap_both:
        pci_set_drvdata(dev, NULL);
-       pci_iounmap(dev, card->config_regs);
- out_unmap_config:
        pci_iounmap(dev, card->buffers);
+ out_unmap_config:
+       pci_iounmap(dev, card->config_regs);
  out_release_regions:
        pci_release_regions(dev);
  out:
index 1ead66186b7c0a90586f223b0b9bc23d3770a3ed..d1daa5e9fadf322b4a6e4d9e7f5d60e71eea0e40 100644 (file)
@@ -53,7 +53,7 @@ static int regcache_hw_init(struct regmap *map)
        for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++) {
                val = regcache_get_val(map->reg_defaults_raw,
                                       i, map->cache_word_size);
-               if (!val)
+               if (regmap_volatile(map, i))
                        continue;
                count++;
        }
@@ -70,7 +70,7 @@ static int regcache_hw_init(struct regmap *map)
        for (i = 0, j = 0; i < map->num_reg_defaults_raw; i++) {
                val = regcache_get_val(map->reg_defaults_raw,
                                       i, map->cache_word_size);
-               if (!val)
+               if (regmap_volatile(map, i))
                        continue;
                map->reg_defaults[j].reg = i;
                map->reg_defaults[j].def = val;
index 9baf11e8636205c413bd5c00498baab628657b44..744f078f4dd8311caed330939afbcdc29c2da913 100644 (file)
@@ -3832,7 +3832,7 @@ static int __floppy_read_block_0(struct block_device *bdev)
        bio.bi_size = size;
        bio.bi_bdev = bdev;
        bio.bi_sector = 0;
-       bio.bi_flags = BIO_QUIET;
+       bio.bi_flags = (1 << BIO_QUIET);
        init_completion(&complete);
        bio.bi_private = &complete;
        bio.bi_end_io = floppy_rb0_complete;
index c1dc4d86c22122f4b34abd35880cfcbb0896215d..1f3c1a7d132a59ded61f1859fb83febc5e19609a 100644 (file)
@@ -41,6 +41,8 @@
 #include <linux/types.h>
 #include <linux/version.h>
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #define NVME_Q_DEPTH 1024
 #define SQ_SIZE(depth)         (depth * sizeof(struct nvme_command))
 #define CQ_SIZE(depth)         (depth * sizeof(struct nvme_completion))
index f00f596c102997c8b32c48d4e41007eeae9a99a4..789c9b579aea5bac7e0b2abfe3d14b377917a9c4 100644 (file)
@@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = {
 
        /* Broadcom BCM20702A0 */
        { USB_DEVICE(0x0a5c, 0x21e3) },
+       { USB_DEVICE(0x0a5c, 0x21f3) },
        { USB_DEVICE(0x413c, 0x8197) },
 
        { }     /* Terminating entry */
@@ -726,9 +727,6 @@ static int btusb_send_frame(struct sk_buff *skb)
                usb_fill_bulk_urb(urb, data->udev, pipe,
                                skb->data, skb->len, btusb_tx_complete, skb);
 
-               if (skb->priority >= HCI_PRIO_MAX - 1)
-                       urb->transfer_flags  = URB_ISO_ASAP;
-
                hdev->stat.acl_tx++;
                break;
 
index 7dbc4a83c45c481cdf743fb531c95a4b67a8bb5a..78a666d1e5f589892620edc200b24c4b254ec273 100644 (file)
@@ -1,7 +1,7 @@
 
 config CPU_IDLE
        bool "CPU idle PM support"
-       default ACPI
+       default y if ACPI || PPC_PSERIES
        help
          CPU idle is a generic framework for supporting software-controlled
          idle processor power management.  It includes modular cross-platform
index 597235a2f8f908bbc69fffc596ffc20d71a16c5b..0d40cf66b3cc55111182515fd4d695101d200fa0 100644 (file)
@@ -714,6 +714,7 @@ static int mv_hash_final(struct ahash_request *req)
 {
        struct mv_req_hash_ctx *ctx = ahash_request_ctx(req);
 
+       ahash_request_set_crypt(req, NULL, req->result, 0);
        mv_update_hash_req_ctx(ctx, 1, 0);
        return mv_handle_req(&req->base);
 }
index aa08497a075a70d1e33ee0de9dcdc9a64c9221ea..73f55e2008c2dcec72259b235d3304e84d663c8a 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/io.h>
 #include "edac_core.h"
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #define I3200_REVISION        "1.1"
 
 #define EDAC_MOD_STR        "i3200_edac"
@@ -101,19 +103,6 @@ struct i3200_priv {
 
 static int nr_channels;
 
-#ifndef readq
-static inline __u64 readq(const volatile void __iomem *addr)
-{
-       const volatile u32 __iomem *p = addr;
-       u32 low, high;
-
-       low = readl(p);
-       high = readl(p + 1);
-
-       return low + ((u64)high << 32);
-}
-#endif
-
 static int how_many_channels(struct pci_dev *pdev)
 {
        unsigned char capid0_8b; /* 8th byte of CAPID0 */
index d620b0784257f05cab7c52b121a460c99f6f7daf..618bd4d87d286171a87da2fdbdfc2d251eae63f2 100644 (file)
@@ -28,6 +28,7 @@
 #include "drmP.h"
 #include "drm_crtc_helper.h"
 
+#include <drm/exynos_drm.h>
 #include "exynos_drm_drv.h"
 #include "exynos_drm_encoder.h"
 
@@ -44,8 +45,9 @@ struct exynos_drm_connector {
 /* convert exynos_video_timings to drm_display_mode */
 static inline void
 convert_to_display_mode(struct drm_display_mode *mode,
-                       struct fb_videomode *timing)
+                       struct exynos_drm_panel_info *panel)
 {
+       struct fb_videomode *timing = &panel->timing;
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
        mode->clock = timing->pixclock / 1000;
@@ -60,6 +62,8 @@ convert_to_display_mode(struct drm_display_mode *mode,
        mode->vsync_start = mode->vdisplay + timing->upper_margin;
        mode->vsync_end = mode->vsync_start + timing->vsync_len;
        mode->vtotal = mode->vsync_end + timing->lower_margin;
+       mode->width_mm = panel->width_mm;
+       mode->height_mm = panel->height_mm;
 
        if (timing->vmode & FB_VMODE_INTERLACED)
                mode->flags |= DRM_MODE_FLAG_INTERLACE;
@@ -148,16 +152,18 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
                connector->display_info.raw_edid = edid;
        } else {
                struct drm_display_mode *mode = drm_mode_create(connector->dev);
-               struct fb_videomode *timing;
+               struct exynos_drm_panel_info *panel;
 
-               if (display_ops->get_timing)
-                       timing = display_ops->get_timing(manager->dev);
+               if (display_ops->get_panel)
+                       panel = display_ops->get_panel(manager->dev);
                else {
                        drm_mode_destroy(connector->dev, mode);
                        return 0;
                }
 
-               convert_to_display_mode(mode, timing);
+               convert_to_display_mode(mode, panel);
+               connector->display_info.width_mm = mode->width_mm;
+               connector->display_info.height_mm = mode->height_mm;
 
                mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
                drm_mode_set_name(mode);
index 661a03571d0c6ba672ea28b8fae172c2a7681a57..d08a55896d50adce1345902bbe8072c399179378 100644 (file)
@@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
                        return err;
                }
 
+               /* setup possible_clones. */
+               exynos_drm_encoder_setup(drm_dev);
+
                /*
                 * if any specific driver such as fimd or hdmi driver called
                 * exynos_drm_subdrv_register() later than drm_load(),
index e3861ac492950b97773ceacbdc86557c2a914e08..de818831a51144393a6f237feb5d81077a1776bc 100644 (file)
@@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
                 */
                event->pipe = exynos_crtc->pipe;
 
-               list_add_tail(&event->base.link,
-                               &dev_priv->pageflip_event_list);
-
                ret = drm_vblank_get(dev, exynos_crtc->pipe);
                if (ret) {
                        DRM_DEBUG("failed to acquire vblank counter\n");
@@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
                        goto out;
                }
 
+               list_add_tail(&event->base.link,
+                               &dev_priv->pageflip_event_list);
+
                crtc->fb = fb;
                ret = exynos_drm_crtc_update(crtc);
                if (ret) {
index 35889ca255e93996f6cc37094a44147f756051f8..58820ebd35588f8b1e493234022b0e2132996369 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
+#include "exynos_drm_encoder.h"
 #include "exynos_drm_fbdev.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
@@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
        if (ret)
                goto err_vblank;
 
+       /* setup possible_clones. */
+       exynos_drm_encoder_setup(dev);
+
        /*
         * create and configure fb helper and also exynos specific
         * fbdev object.
@@ -141,16 +145,21 @@ static int exynos_drm_unload(struct drm_device *dev)
 }
 
 static void exynos_drm_preclose(struct drm_device *dev,
-                                       struct drm_file *file_priv)
+                                       struct drm_file *file)
 {
-       struct exynos_drm_private *dev_priv = dev->dev_private;
+       DRM_DEBUG_DRIVER("%s\n", __FILE__);
 
-       /*
-        * drm framework frees all events at release time,
-        * so private event list should be cleared.
-        */
-       if (!list_empty(&dev_priv->pageflip_event_list))
-               INIT_LIST_HEAD(&dev_priv->pageflip_event_list);
+}
+
+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
+{
+       DRM_DEBUG_DRIVER("%s\n", __FILE__);
+
+       if (!file->driver_priv)
+               return;
+
+       kfree(file->driver_priv);
+       file->driver_priv = NULL;
 }
 
 static void exynos_drm_lastclose(struct drm_device *dev)
@@ -195,6 +204,7 @@ static struct drm_driver exynos_drm_driver = {
        .unload                 = exynos_drm_unload,
        .preclose               = exynos_drm_preclose,
        .lastclose              = exynos_drm_lastclose,
+       .postclose              = exynos_drm_postclose,
        .get_vblank_counter     = drm_vblank_count,
        .enable_vblank          = exynos_drm_crtc_enable_vblank,
        .disable_vblank         = exynos_drm_crtc_disable_vblank,
index e685e1e33055fd21e08446da5215e368c46c02cc..13540de90bfc428101afe15c39258ee9623868a1 100644 (file)
@@ -136,7 +136,7 @@ struct exynos_drm_overlay {
  * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.
  * @is_connected: check for that display is connected or not.
  * @get_edid: get edid modes from display driver.
- * @get_timing: get timing object from display driver.
+ * @get_panel: get panel object from display driver.
  * @check_timing: check if timing is valid or not.
  * @power_on: display device on or off.
  */
@@ -145,7 +145,7 @@ struct exynos_drm_display_ops {
        bool (*is_connected)(struct device *dev);
        int (*get_edid)(struct device *dev, struct drm_connector *connector,
                                u8 *edid, int len);
-       void *(*get_timing)(struct device *dev);
+       void *(*get_panel)(struct device *dev);
        int (*check_timing)(struct device *dev, void *timing);
        int (*power_on)(struct device *dev, int mode);
 };
index 86b93dde219a51a3a4e224fa800841ab76dcc92b..ef4754f1519bfbb4334b71c1372cc8d594526bd9 100644 (file)
@@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = {
        .destroy = exynos_drm_encoder_destroy,
 };
 
+static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)
+{
+       struct drm_encoder *clone;
+       struct drm_device *dev = encoder->dev;
+       struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
+       struct exynos_drm_display_ops *display_ops =
+                               exynos_encoder->manager->display_ops;
+       unsigned int clone_mask = 0;
+       int cnt = 0;
+
+       list_for_each_entry(clone, &dev->mode_config.encoder_list, head) {
+               switch (display_ops->type) {
+               case EXYNOS_DISPLAY_TYPE_LCD:
+               case EXYNOS_DISPLAY_TYPE_HDMI:
+                       clone_mask |= (1 << (cnt++));
+                       break;
+               default:
+                       continue;
+               }
+       }
+
+       return clone_mask;
+}
+
+void exynos_drm_encoder_setup(struct drm_device *dev)
+{
+       struct drm_encoder *encoder;
+
+       DRM_DEBUG_KMS("%s\n", __FILE__);
+
+       list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
+               encoder->possible_clones = exynos_drm_encoder_clones(encoder);
+}
+
 struct drm_encoder *
 exynos_drm_encoder_create(struct drm_device *dev,
                           struct exynos_drm_manager *manager,
index 97b087a51cb6033a473716b687149c2e063e13e1..eb7d2316847edff9e4faa2940f241e9a19f8739c 100644 (file)
@@ -30,6 +30,7 @@
 
 struct exynos_drm_manager;
 
+void exynos_drm_encoder_setup(struct drm_device *dev);
 struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev,
                                               struct exynos_drm_manager *mgr,
                                               unsigned int possible_crtcs);
index d7ae29d2f3d68b0668f0979ade06e244e7ddf07c..3508700e529bbcd3c92c49a45be915ab885458d7 100644 (file)
@@ -195,66 +195,6 @@ out:
        return ret;
 }
 
-static bool
-exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb,
-                           struct drm_fb_helper_surface_size *sizes)
-{
-       if (fb->width != sizes->surface_width)
-               return false;
-       if (fb->height != sizes->surface_height)
-               return false;
-       if (fb->bits_per_pixel != sizes->surface_bpp)
-               return false;
-       if (fb->depth != sizes->surface_depth)
-               return false;
-
-       return true;
-}
-
-static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper,
-                                     struct drm_fb_helper_surface_size *sizes)
-{
-       struct drm_device *dev = helper->dev;
-       struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper);
-       struct exynos_drm_gem_obj *exynos_gem_obj;
-       struct drm_framebuffer *fb = helper->fb;
-       struct drm_mode_fb_cmd2 mode_cmd = { 0 };
-       unsigned long size;
-
-       DRM_DEBUG_KMS("%s\n", __FILE__);
-
-       if (exynos_drm_fbdev_is_samefb(fb, sizes))
-               return 0;
-
-       mode_cmd.width = sizes->surface_width;
-       mode_cmd.height = sizes->surface_height;
-       mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3);
-       mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
-                                                         sizes->surface_depth);
-
-       if (exynos_fbdev->exynos_gem_obj)
-               exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj);
-
-       if (fb->funcs->destroy)
-               fb->funcs->destroy(fb);
-
-       size = mode_cmd.pitches[0] * mode_cmd.height;
-       exynos_gem_obj = exynos_drm_gem_create(dev, size);
-       if (IS_ERR(exynos_gem_obj))
-               return PTR_ERR(exynos_gem_obj);
-
-       exynos_fbdev->exynos_gem_obj = exynos_gem_obj;
-
-       helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd,
-                       &exynos_gem_obj->base);
-       if (IS_ERR_OR_NULL(helper->fb)) {
-               DRM_ERROR("failed to create drm framebuffer.\n");
-               return PTR_ERR(helper->fb);
-       }
-
-       return exynos_drm_fbdev_update(helper, helper->fb);
-}
-
 static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
                                   struct drm_fb_helper_surface_size *sizes)
 {
@@ -262,6 +202,10 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
+       /*
+        * with !helper->fb, it means that this funcion is called first time
+        * and after that, the helper->fb would be used as clone mode.
+        */
        if (!helper->fb) {
                ret = exynos_drm_fbdev_create(helper, sizes);
                if (ret < 0) {
@@ -274,12 +218,6 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
                 * because register_framebuffer() should be called.
                 */
                ret = 1;
-       } else {
-               ret = exynos_drm_fbdev_recreate(helper, sizes);
-               if (ret < 0) {
-                       DRM_ERROR("failed to reconfigure fbdev\n");
-                       return ret;
-               }
        }
 
        return ret;
index b6a737d196ae556c6b038ad8243540a76f2271af..360adf2bba047bb9c60177bc1a7dff8965ba3fd1 100644 (file)
@@ -89,7 +89,7 @@ struct fimd_context {
        bool                            suspended;
        struct mutex                    lock;
 
-       struct fb_videomode             *timing;
+       struct exynos_drm_panel_info *panel;
 };
 
 static bool fimd_display_is_connected(struct device *dev)
@@ -101,13 +101,13 @@ static bool fimd_display_is_connected(struct device *dev)
        return true;
 }
 
-static void *fimd_get_timing(struct device *dev)
+static void *fimd_get_panel(struct device *dev)
 {
        struct fimd_context *ctx = get_fimd_context(dev);
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
-       return ctx->timing;
+       return ctx->panel;
 }
 
 static int fimd_check_timing(struct device *dev, void *timing)
@@ -131,7 +131,7 @@ static int fimd_display_power_on(struct device *dev, int mode)
 static struct exynos_drm_display_ops fimd_display_ops = {
        .type = EXYNOS_DISPLAY_TYPE_LCD,
        .is_connected = fimd_display_is_connected,
-       .get_timing = fimd_get_timing,
+       .get_panel = fimd_get_panel,
        .check_timing = fimd_check_timing,
        .power_on = fimd_display_power_on,
 };
@@ -193,7 +193,8 @@ static void fimd_apply(struct device *subdrv_dev)
 static void fimd_commit(struct device *dev)
 {
        struct fimd_context *ctx = get_fimd_context(dev);
-       struct fb_videomode *timing = ctx->timing;
+       struct exynos_drm_panel_info *panel = ctx->panel;
+       struct fb_videomode *timing = &panel->timing;
        u32 val;
 
        if (ctx->suspended)
@@ -604,7 +605,12 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
        }
 
        if (is_checked) {
-               drm_vblank_put(drm_dev, crtc);
+               /*
+                * call drm_vblank_put only in case that drm_vblank_get was
+                * called.
+                */
+               if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
+                       drm_vblank_put(drm_dev, crtc);
 
                /*
                 * don't off vblank if vblank_disable_allowed is 1,
@@ -781,7 +787,7 @@ static int __devinit fimd_probe(struct platform_device *pdev)
        struct fimd_context *ctx;
        struct exynos_drm_subdrv *subdrv;
        struct exynos_drm_fimd_pdata *pdata;
-       struct fb_videomode *timing;
+       struct exynos_drm_panel_info *panel;
        struct resource *res;
        int win;
        int ret = -EINVAL;
@@ -794,9 +800,9 @@ static int __devinit fimd_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       timing = &pdata->timing;
-       if (!timing) {
-               dev_err(dev, "timing is null.\n");
+       panel = &pdata->panel;
+       if (!panel) {
+               dev_err(dev, "panel is null.\n");
                return -EINVAL;
        }
 
@@ -858,16 +864,16 @@ static int __devinit fimd_probe(struct platform_device *pdev)
                goto err_req_irq;
        }
 
-       ctx->clkdiv = fimd_calc_clkdiv(ctx, timing);
+       ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing);
        ctx->vidcon0 = pdata->vidcon0;
        ctx->vidcon1 = pdata->vidcon1;
        ctx->default_win = pdata->default_win;
-       ctx->timing = timing;
+       ctx->panel = panel;
 
-       timing->pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv;
+       panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv;
 
        DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n",
-                       timing->pixclock, ctx->clkdiv);
+                       panel->timing.pixclock, ctx->clkdiv);
 
        subdrv = &ctx->subdrv;
 
index ac24cff3977552694fe60ca59bf4382ee48520c2..93846e810e38c85c45f4a06d92e0f5306a89396e 100644 (file)
@@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)
        }
 
        if (is_checked)
-               drm_vblank_put(drm_dev, crtc);
+               /*
+                * call drm_vblank_put only in case that drm_vblank_get was
+                * called.
+                */
+               if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
+                       drm_vblank_put(drm_dev, crtc);
 
        spin_unlock_irqrestore(&drm_dev->event_lock, flags);
 }
@@ -779,15 +784,15 @@ static void mixer_win_reset(struct mixer_context *ctx)
        mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST,
                MXR_STATUS_BURST_MASK);
 
-       /* setting default layer priority: layer1 > video > layer0
+       /* setting default layer priority: layer1 > layer0 > video
         * because typical usage scenario would be
+        * layer1 - OSD
         * layer0 - framebuffer
         * video - video overlay
-        * layer1 - OSD
         */
-       val  = MXR_LAYER_CFG_GRP0_VAL(1);
-       val |= MXR_LAYER_CFG_VP_VAL(2);
-       val |= MXR_LAYER_CFG_GRP1_VAL(3);
+       val = MXR_LAYER_CFG_GRP1_VAL(3);
+       val |= MXR_LAYER_CFG_GRP0_VAL(2);
+       val |= MXR_LAYER_CFG_VP_VAL(1);
        mixer_reg_write(res, MXR_LAYER_CFG, val);
 
        /* setting background color */
@@ -1044,7 +1049,7 @@ static int mixer_remove(struct platform_device *pdev)
                                        platform_get_drvdata(pdev);
        struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx;
 
-       dev_info(dev, "remove sucessful\n");
+       dev_info(dev, "remove successful\n");
 
        mixer_resource_poweroff(ctx);
        mixer_resources_cleanup(ctx);
index 4a5b099c3bc5ac9430c9b24a651f326f0295c748..53404af2e748b74a6801f5d5f70079e4ce556a88 100644 (file)
@@ -321,6 +321,8 @@ static int cdv_chip_setup(struct drm_device *dev)
        cdv_get_core_freq(dev);
        gma_intel_opregion_init(dev);
        psb_intel_init_bios(dev);
+       REG_WRITE(PORT_HOTPLUG_EN, 0);
+       REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
        return 0;
 }
 
index 830dfdd6bf154a473e15357654cf4d19be8d6b81..be616735ec918502238df831ad59510513358996 100644 (file)
@@ -247,7 +247,6 @@ static struct fb_ops psbfb_roll_ops = {
        .fb_imageblit = cfb_imageblit,
        .fb_pan_display = psbfb_pan,
        .fb_mmap = psbfb_mmap,
-       .fb_sync = psbfb_sync,
        .fb_ioctl = psbfb_ioctl,
 };
 
index 5d5330f667f14031512c022e12ed3d8eb61bc530..aff194fbe9f3ee00c627e012f8d364af3caa2f8d 100644 (file)
@@ -446,10 +446,9 @@ int psb_gtt_init(struct drm_device *dev, int resume)
        pg->gtt_start = pci_resource_start(dev->pdev, PSB_GTT_RESOURCE);
        gtt_pages = pci_resource_len(dev->pdev, PSB_GTT_RESOURCE)
                                                                >> PAGE_SHIFT;
-       /* Some CDV firmware doesn't report this currently. In which case the
-          system has 64 gtt pages */
+       /* CDV doesn't report this. In which case the system has 64 gtt pages */
        if (pg->gtt_start == 0 || gtt_pages == 0) {
-               dev_err(dev->dev, "GTT PCI BAR not initialized.\n");
+               dev_dbg(dev->dev, "GTT PCI BAR not initialized.\n");
                gtt_pages = 64;
                pg->gtt_start = dev_priv->pge_ctl;
        }
@@ -461,10 +460,10 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 
        if (pg->gatt_pages == 0 || pg->gatt_start == 0) {
                static struct resource fudge;   /* Preferably peppermint */
-               /* This can occur on CDV SDV systems. Fudge it in this case.
+               /* This can occur on CDV systems. Fudge it in this case.
                   We really don't care what imaginary space is being allocated
                   at this point */
-               dev_err(dev->dev, "GATT PCI BAR not initialized.\n");
+               dev_dbg(dev->dev, "GATT PCI BAR not initialized.\n");
                pg->gatt_start = 0x40000000;
                pg->gatt_pages = (128 * 1024 * 1024) >> PAGE_SHIFT;
                /* This is a little confusing but in fact the GTT is providing
index c3afb783cb9d93bf7c79dd32a18d8627ed6bfd0d..03c53fcf86536ba110033931b8b979f3e4fd35f0 100644 (file)
 #define  DISP_TILE_SURFACE_SWIZZLING   (1<<13)
 #define  DISP_FBC_WM_DIS               (1<<15)
 
+/* GEN7 chicken */
+#define GEN7_COMMON_SLICE_CHICKEN1             0x7010
+# define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC     ((1<<10) | (1<<26))
+
+#define GEN7_L3CNTLREG1                                0xB01C
+#define  GEN7_WA_FOR_GEN7_L3_CONTROL                   0x3C4FFF8C
+
+#define GEN7_L3_CHICKEN_MODE_REGISTER          0xB030
+#define  GEN7_WA_L3_CHICKEN_MODE                               0x20000000
+
+/* WaCatErrorRejectionIssue */
+#define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG         0x9030
+#define  GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB      (1<<11)
+
 /* PCH */
 
 /* south display engine interrupt */
 #define    GT_FIFO_NUM_RESERVED_ENTRIES                20
 
 #define GEN6_UCGCTL2                           0x9404
+# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE               (1 << 13)
 # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE              (1 << 12)
 # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE               (1 << 11)
 
index 00fbff5ddd814b3ae73a4f7abf936274f3b06111..f851db7be2cc20ccc279b794bf78e65d566d1573 100644 (file)
@@ -4680,8 +4680,17 @@ sandybridge_compute_sprite_srwm(struct drm_device *dev, int plane,
 
        crtc = intel_get_crtc_for_plane(dev, plane);
        clock = crtc->mode.clock;
+       if (!clock) {
+               *sprite_wm = 0;
+               return false;
+       }
 
        line_time_us = (sprite_width * 1000) / clock;
+       if (!line_time_us) {
+               *sprite_wm = 0;
+               return false;
+       }
+
        line_count = (latency_ns / line_time_us + 1000) / 1000;
        line_size = sprite_width * pixel_size;
 
@@ -6175,7 +6184,7 @@ void intel_crtc_load_lut(struct drm_crtc *crtc)
        int i;
 
        /* The clocks have to be on to load the palette. */
-       if (!crtc->enabled)
+       if (!crtc->enabled || !intel_crtc->active)
                return;
 
        /* use legacy palette for Ironlake */
@@ -6561,7 +6570,7 @@ intel_framebuffer_create_for_mode(struct drm_device *dev,
        mode_cmd.height = mode->vdisplay;
        mode_cmd.pitches[0] = intel_framebuffer_pitch_for_width(mode_cmd.width,
                                                                bpp);
-       mode_cmd.pixel_format = 0;
+       mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth);
 
        return intel_framebuffer_create(dev, &mode_cmd, obj);
 }
@@ -8184,8 +8193,8 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)
        I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */
 
        if (intel_enable_rc6(dev_priv->dev))
-               rc6_mask = GEN6_RC_CTL_RC6p_ENABLE |
-                       GEN6_RC_CTL_RC6_ENABLE;
+               rc6_mask = GEN6_RC_CTL_RC6_ENABLE |
+                       ((IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0);
 
        I915_WRITE(GEN6_RC_CONTROL,
                   rc6_mask |
@@ -8463,12 +8472,32 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
        I915_WRITE(WM2_LP_ILK, 0);
        I915_WRITE(WM1_LP_ILK, 0);
 
+       /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
+        * This implements the WaDisableRCZUnitClockGating workaround.
+        */
+       I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
+
        I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
 
        I915_WRITE(IVB_CHICKEN3,
                   CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
                   CHICKEN3_DGMG_DONE_FIX_DISABLE);
 
+       /* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */
+       I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
+                  GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
+
+       /* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */
+       I915_WRITE(GEN7_L3CNTLREG1,
+                       GEN7_WA_FOR_GEN7_L3_CONTROL);
+       I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
+                       GEN7_WA_L3_CHICKEN_MODE);
+
+       /* This is required by WaCatErrorRejectionIssue */
+       I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
+                       I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
+                       GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
+
        for_each_pipe(pipe) {
                I915_WRITE(DSPCNTR(pipe),
                           I915_READ(DSPCNTR(pipe)) |
index 1ab842c6032e949a37855a3995aa161d9f276977..536191540b0399bf8aa04f7c05f5129bb9a13d03 100644 (file)
@@ -301,7 +301,7 @@ static int init_ring_common(struct intel_ring_buffer *ring)
 
        I915_WRITE_CTL(ring,
                        ((ring->size - PAGE_SIZE) & RING_NR_PAGES)
-                       | RING_REPORT_64K | RING_VALID);
+                       | RING_VALID);
 
        /* If the head is still not zero, the ring is dead */
        if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
@@ -1132,18 +1132,6 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
        struct drm_device *dev = ring->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long end;
-       u32 head;
-
-       /* If the reported head position has wrapped or hasn't advanced,
-        * fallback to the slow and accurate path.
-        */
-       head = intel_read_status_page(ring, 4);
-       if (head > ring->head) {
-               ring->head = head;
-               ring->space = ring_space(ring);
-               if (ring->space >= n)
-                       return 0;
-       }
 
        trace_i915_ring_wait_begin(ring);
        if (drm_core_check_feature(dev, DRIVER_GEM))
index 9be353b894cc56eef6958b109ab06145ab2a0843..f58254a3fb01cd23e5ec6c86d7eb09a11cf3bf15 100644 (file)
@@ -3223,6 +3223,7 @@ int evergreen_resume(struct radeon_device *rdev)
        r = evergreen_startup(rdev);
        if (r) {
                DRM_ERROR("evergreen startup failed on resume\n");
+               rdev->accel_working = false;
                return r;
        }
 
index db09065e68fd60ee488da280199a382c5b19efb8..2509c505acb896a51e370f3078ee660b61cabe1d 100644 (file)
@@ -1547,6 +1547,7 @@ int cayman_resume(struct radeon_device *rdev)
        r = cayman_startup(rdev);
        if (r) {
                DRM_ERROR("cayman startup failed on resume\n");
+               rdev->accel_working = false;
                return r;
        }
        return r;
index bfd36ab643a68a5dea2b43d24283d08a0a2eb703..333cde9d4e7b7621ab1713ee54e1a418017d7786 100644 (file)
@@ -789,9 +789,7 @@ int r100_irq_process(struct radeon_device *rdev)
                        WREG32(RADEON_AIC_CNTL, msi_rearm | RS400_MSI_REARM);
                        break;
                default:
-                       msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
-                       WREG32(RADEON_MSI_REARM_EN, msi_rearm);
-                       WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
+                       WREG32(RADEON_MSI_REARM_EN, RV370_MSI_REARM_EN);
                        break;
                }
        }
@@ -3930,6 +3928,8 @@ static int r100_startup(struct radeon_device *rdev)
 
 int r100_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        if (rdev->flags & RADEON_IS_PCI)
                r100_pci_gart_disable(rdev);
@@ -3949,7 +3949,11 @@ int r100_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return r100_startup(rdev);
+       r = r100_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int r100_suspend(struct radeon_device *rdev)
index 3fc0d29a5f39e439e398a0f1e693a0e19b705c73..6829638cca4032810822d5eb766d61f0f7658ee3 100644 (file)
@@ -1431,6 +1431,8 @@ static int r300_startup(struct radeon_device *rdev)
 
 int r300_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        if (rdev->flags & RADEON_IS_PCIE)
                rv370_pcie_gart_disable(rdev);
@@ -1452,7 +1454,11 @@ int r300_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return r300_startup(rdev);
+       r = r300_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int r300_suspend(struct radeon_device *rdev)
index 666e28fe509c4fb44293af49555a29ab974f9098..b14323053badc282696834413b0f521ff3d84445 100644 (file)
@@ -291,6 +291,8 @@ static int r420_startup(struct radeon_device *rdev)
 
 int r420_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        if (rdev->flags & RADEON_IS_PCIE)
                rv370_pcie_gart_disable(rdev);
@@ -316,7 +318,11 @@ int r420_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return r420_startup(rdev);
+       r = r420_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int r420_suspend(struct radeon_device *rdev)
index 4ae1615e752ff8f6c5ecbfdc5eb83e3dbd120934..25084e824dbc3c95873fb3b297c9a257b0985bee 100644 (file)
@@ -218,6 +218,8 @@ static int r520_startup(struct radeon_device *rdev)
 
 int r520_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        if (rdev->flags & RADEON_IS_PCIE)
                rv370_pcie_gart_disable(rdev);
@@ -237,7 +239,11 @@ int r520_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return r520_startup(rdev);
+       r = r520_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int r520_init(struct radeon_device *rdev)
index 4f08e5e6ee9d346c2b432cbf5349b0df07ff05fb..fbcd84803b60375b74c87b8e88df4caabf92b333 100644 (file)
@@ -2529,6 +2529,7 @@ int r600_resume(struct radeon_device *rdev)
        r = r600_startup(rdev);
        if (r) {
                DRM_ERROR("r600 startup failed on resume\n");
+               rdev->accel_working = false;
                return r;
        }
 
index 38ce5d0427e34a4bf8388da339864c01ad1bf470..387fcc9f03ef242011fe7dba4dbb447902db3583 100644 (file)
@@ -1304,6 +1304,7 @@ static int r600_check_texture_resource(struct radeon_cs_parser *p,  u32 idx,
        h0 = G_038004_TEX_HEIGHT(word1) + 1;
        d0 = G_038004_TEX_DEPTH(word1);
        nfaces = 1;
+       array = 0;
        switch (G_038000_DIM(word0)) {
        case V_038000_SQ_TEX_DIM_1D:
        case V_038000_SQ_TEX_DIM_2D:
index 5082d17d14dcda9733ca6d79b8d70513a7bd9944..1f53ae74ada1c7ea4e527060fb9b71a368461418 100644 (file)
@@ -2931,6 +2931,20 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector,
                        bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP5;
                }
        }
+       if ((radeon_encoder->devices & ATOM_DEVICE_DFP6_SUPPORT) &&
+           (radeon_connector->devices & ATOM_DEVICE_DFP6_SUPPORT)) {
+               if (connected) {
+                       DRM_DEBUG_KMS("DFP6 connected\n");
+                       bios_0_scratch |= ATOM_S0_DFP6;
+                       bios_3_scratch |= ATOM_S3_DFP6_ACTIVE;
+                       bios_6_scratch |= ATOM_S6_ACC_REQ_DFP6;
+               } else {
+                       DRM_DEBUG_KMS("DFP6 disconnected\n");
+                       bios_0_scratch &= ~ATOM_S0_DFP6;
+                       bios_3_scratch &= ~ATOM_S3_DFP6_ACTIVE;
+                       bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP6;
+               }
+       }
 
        if (rdev->family >= CHIP_R600) {
                WREG32(R600_BIOS_0_SCRATCH, bios_0_scratch);
@@ -2951,6 +2965,9 @@ radeon_atombios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc)
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        uint32_t bios_3_scratch;
 
+       if (ASIC_IS_DCE4(rdev))
+               return;
+
        if (rdev->family >= CHIP_R600)
                bios_3_scratch = RREG32(R600_BIOS_3_SCRATCH);
        else
@@ -3003,6 +3020,9 @@ radeon_atombios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on)
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
        uint32_t bios_2_scratch;
 
+       if (ASIC_IS_DCE4(rdev))
+               return;
+
        if (rdev->family >= CHIP_R600)
                bios_2_scratch = RREG32(R600_BIOS_2_SCRATCH);
        else
index e7cb3ab09243165c57d261944cd30b489703e149..8b3d8ed52ff66051e11b4edaa29d9d1e2bc6df1e 100644 (file)
@@ -1117,13 +1117,23 @@ static int radeon_dp_get_modes(struct drm_connector *connector)
            (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) {
                struct drm_display_mode *mode;
 
-               if (!radeon_dig_connector->edp_on)
-                       atombios_set_edp_panel_power(connector,
-                                                    ATOM_TRANSMITTER_ACTION_POWER_ON);
-               ret = radeon_ddc_get_modes(radeon_connector);
-               if (!radeon_dig_connector->edp_on)
-                       atombios_set_edp_panel_power(connector,
-                                                    ATOM_TRANSMITTER_ACTION_POWER_OFF);
+               if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
+                       if (!radeon_dig_connector->edp_on)
+                               atombios_set_edp_panel_power(connector,
+                                                            ATOM_TRANSMITTER_ACTION_POWER_ON);
+                       ret = radeon_ddc_get_modes(radeon_connector);
+                       if (!radeon_dig_connector->edp_on)
+                               atombios_set_edp_panel_power(connector,
+                                                            ATOM_TRANSMITTER_ACTION_POWER_OFF);
+               } else {
+                       /* need to setup ddc on the bridge */
+                       if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) !=
+                           ENCODER_OBJECT_ID_NONE) {
+                               if (encoder)
+                                       radeon_atom_ext_encoder_setup_ddc(encoder);
+                       }
+                       ret = radeon_ddc_get_modes(radeon_connector);
+               }
 
                if (ret > 0) {
                        if (encoder) {
@@ -1134,7 +1144,6 @@ static int radeon_dp_get_modes(struct drm_connector *connector)
                        return ret;
                }
 
-               encoder = radeon_best_single_encoder(connector);
                if (!encoder)
                        return 0;
 
index 435a3d970ab8b0ef39c45f45ea8c22bdec05abf4..e64bec488ed8eb7479d9ff07efb8f0e213f62b80 100644 (file)
@@ -453,6 +453,10 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
        int r;
 
        radeon_mutex_lock(&rdev->cs_mutex);
+       if (!rdev->accel_working) {
+               radeon_mutex_unlock(&rdev->cs_mutex);
+               return -EBUSY;
+       }
        /* initialize parser */
        memset(&parser, 0, sizeof(struct radeon_cs_parser));
        parser.filp = filp;
index 64ea3dd9e6ff2ab58ed36476693a9dde4cff6f5a..4bd36a354fbef7d473dd321d92c96f828611d815 100644 (file)
@@ -364,8 +364,10 @@ int radeon_fence_count_emitted(struct radeon_device *rdev, int ring)
        int not_processed = 0;
 
        read_lock_irqsave(&rdev->fence_lock, irq_flags);
-       if (!rdev->fence_drv[ring].initialized)
+       if (!rdev->fence_drv[ring].initialized) {
+               read_unlock_irqrestore(&rdev->fence_lock, irq_flags);
                return 0;
+       }
 
        if (!list_empty(&rdev->fence_drv[ring].emitted)) {
                struct list_head *ptr;
index 010dad8b66ae98902f3b7c4ffb61d426103ef07f..c58a036233fb4409b3b4b656a1aba1c103b1b40a 100644 (file)
@@ -597,13 +597,13 @@ int radeon_vm_bo_rmv(struct radeon_device *rdev,
        if (bo_va == NULL)
                return 0;
 
-       list_del(&bo_va->bo_list);
        mutex_lock(&vm->mutex);
        radeon_mutex_lock(&rdev->cs_mutex);
        radeon_vm_bo_update_pte(rdev, vm, bo, NULL);
        radeon_mutex_unlock(&rdev->cs_mutex);
        list_del(&bo_va->vm_list);
        mutex_unlock(&vm->mutex);
+       list_del(&bo_va->bo_list);
 
        kfree(bo_va);
        return 0;
index 30a4c5014c8b3f6a19f2e5e6d3102c488ac013e2..92c9ea4751fbd7b409a6b88437bc16ed547734f6 100644 (file)
@@ -500,8 +500,11 @@ static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32];
 int radeon_debugfs_ring_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-       return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list,
-                                       ARRAY_SIZE(radeon_debugfs_ring_info_list));
+       if (rdev->family >= CHIP_CAYMAN)
+               return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list,
+                                               ARRAY_SIZE(radeon_debugfs_ring_info_list));
+       else
+               return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, 1);
 #else
        return 0;
 #endif
index b0ce84a20a68faf628ea3b72171a41b38e78dfaf..866a05be75f2b104a6a91385087ec9c700bd503c 100644 (file)
@@ -442,6 +442,8 @@ static int rs400_startup(struct radeon_device *rdev)
 
 int rs400_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        rs400_gart_disable(rdev);
        /* Resume clock before doing reset */
@@ -462,7 +464,11 @@ int rs400_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return rs400_startup(rdev);
+       r = rs400_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int rs400_suspend(struct radeon_device *rdev)
index ec46eb45e34cd8b7534deb5f75353496424756f7..4fc700684dcd0dfd1fae0362bf3b2307d5e2cab7 100644 (file)
@@ -684,9 +684,7 @@ int rs600_irq_process(struct radeon_device *rdev)
                        WREG32(RADEON_BUS_CNTL, msi_rearm | RS600_MSI_REARM);
                        break;
                default:
-                       msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
-                       WREG32(RADEON_MSI_REARM_EN, msi_rearm);
-                       WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
+                       WREG32(RADEON_MSI_REARM_EN, RV370_MSI_REARM_EN);
                        break;
                }
        }
@@ -878,6 +876,8 @@ static int rs600_startup(struct radeon_device *rdev)
 
 int rs600_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        rs600_gart_disable(rdev);
        /* Resume clock before doing reset */
@@ -896,7 +896,11 @@ int rs600_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return rs600_startup(rdev);
+       r = rs600_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int rs600_suspend(struct radeon_device *rdev)
index 4f24a0fa8c82f1c4b9ac790073be0a3e69fb00eb..f68dff2fadcb4e97dbafc8b6ff588ceaf831ac4f 100644 (file)
@@ -659,6 +659,8 @@ static int rs690_startup(struct radeon_device *rdev)
 
 int rs690_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        rs400_gart_disable(rdev);
        /* Resume clock before doing reset */
@@ -677,7 +679,11 @@ int rs690_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return rs690_startup(rdev);
+       r = rs690_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int rs690_suspend(struct radeon_device *rdev)
index 880637fd1946c5b7f717487fca8dad37eddb0b42..959bf4483beab43766d795ba75002f40c3d04558 100644 (file)
@@ -424,6 +424,8 @@ static int rv515_startup(struct radeon_device *rdev)
 
 int rv515_resume(struct radeon_device *rdev)
 {
+       int r;
+
        /* Make sur GART are not working */
        if (rdev->flags & RADEON_IS_PCIE)
                rv370_pcie_gart_disable(rdev);
@@ -443,7 +445,11 @@ int rv515_resume(struct radeon_device *rdev)
        radeon_surface_init(rdev);
 
        rdev->accel_working = true;
-       return rv515_startup(rdev);
+       r =  rv515_startup(rdev);
+       if (r) {
+               rdev->accel_working = false;
+       }
+       return r;
 }
 
 int rv515_suspend(struct radeon_device *rdev)
index a1668b659ddd3e3f8ee94c97de6474468c71d3dd..c049c0c51841f865d578e384ab61d568c6c288f4 100644 (file)
@@ -1139,6 +1139,7 @@ int rv770_resume(struct radeon_device *rdev)
        r = rv770_startup(rdev);
        if (r) {
                DRM_ERROR("r600 startup failed on resume\n");
+               rdev->accel_working = false;
                return r;
        }
 
index b8574cddd95352a360ef7ff67200527185b3c1fb..63552e30d0c38986308ad2a385bccd8ab6bb9218 100644 (file)
@@ -59,6 +59,9 @@
 #define USB_VENDOR_ID_AIRCABLE         0x16CA
 #define USB_DEVICE_ID_AIRCABLE1                0x1502
 
+#define USB_VENDOR_ID_AIREN            0x1a2c
+#define USB_DEVICE_ID_AIREN_SLIMPLUS   0x0002
+
 #define USB_VENDOR_ID_ALCOR            0x058f
 #define USB_DEVICE_ID_ALCOR_USBRS232   0x9720
 
index 9333d692a786b03df115ebe87d920e748b607dc6..627850a54d34ecd6da97f281324b1eff98a368fc 100644 (file)
@@ -986,8 +986,13 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
                return;
        }
 
-       /* Ignore out-of-range values as per HID specification, section 5.10 */
-       if (value < field->logical_minimum || value > field->logical_maximum) {
+       /*
+        * Ignore out-of-range values as per HID specification,
+        * section 5.10 and 6.2.25
+        */
+       if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
+           (value < field->logical_minimum ||
+            value > field->logical_maximum)) {
                dbg_hid("Ignoring out-of-range value %x\n", value);
                return;
        }
index c831af937481c66123965743f62aaf5f8a634b3c..57d4e1e1df48df061461681449f5e98f49c20a1e 100644 (file)
@@ -54,6 +54,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT },
        { USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS, HID_QUIRK_MULTI_INPUT },
 
+       { USB_VENDOR_ID_AIREN, USB_DEVICE_ID_AIREN_SLIMPLUS, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
index eedca3cf996889e5b9633c05656d58343f13a427..dd87ae96c2625cb8a93329fcfa672d5678f9e3a8 100644 (file)
@@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client,
                        continue;
                err = device_create_file(&client->dev, &ads1015_in[k].dev_attr);
                if (err)
-                       goto exit_free;
+                       goto exit_remove;
        }
 
        data->hwmon_dev = hwmon_device_register(&client->dev);
@@ -285,7 +285,6 @@ static int ads1015_probe(struct i2c_client *client,
 exit_remove:
        for (k = 0; k < ADS1015_CHANNELS; ++k)
                device_remove_file(&client->dev, &ads1015_in[k].dev_attr);
-exit_free:
        kfree(data);
 exit:
        return err;
index f609b5727ba9047f8ba0f4eb96bfdbae4183b7c4..6aa5a9fad87930800649fd4e0d17087325539530 100644 (file)
@@ -178,6 +178,16 @@ static inline void f75375_write16(struct i2c_client *client, u8 reg,
        i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
 }
 
+static void f75375_write_pwm(struct i2c_client *client, int nr)
+{
+       struct f75375_data *data = i2c_get_clientdata(client);
+       if (data->kind == f75387)
+               f75375_write16(client, F75375_REG_FAN_EXP(nr), data->pwm[nr]);
+       else
+               f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
+                             data->pwm[nr]);
+}
+
 static struct f75375_data *f75375_update_device(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -254,6 +264,36 @@ static inline u16 rpm_to_reg(int rpm)
        return 1500000 / rpm;
 }
 
+static bool duty_mode_enabled(u8 pwm_enable)
+{
+       switch (pwm_enable) {
+       case 0: /* Manual, duty mode (full speed) */
+       case 1: /* Manual, duty mode */
+       case 4: /* Auto, duty mode */
+               return true;
+       case 2: /* Auto, speed mode */
+       case 3: /* Manual, speed mode */
+               return false;
+       default:
+               BUG();
+       }
+}
+
+static bool auto_mode_enabled(u8 pwm_enable)
+{
+       switch (pwm_enable) {
+       case 0: /* Manual, duty mode (full speed) */
+       case 1: /* Manual, duty mode */
+       case 3: /* Manual, speed mode */
+               return false;
+       case 2: /* Auto, speed mode */
+       case 4: /* Auto, duty mode */
+               return true;
+       default:
+               BUG();
+       }
+}
+
 static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
                const char *buf, size_t count)
 {
@@ -287,6 +327,11 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *attr,
        if (err < 0)
                return err;
 
+       if (auto_mode_enabled(data->pwm_enable[nr]))
+               return -EINVAL;
+       if (data->kind == f75387 && duty_mode_enabled(data->pwm_enable[nr]))
+               return -EINVAL;
+
        mutex_lock(&data->update_lock);
        data->fan_target[nr] = rpm_to_reg(val);
        f75375_write16(client, F75375_REG_FAN_EXP(nr), data->fan_target[nr]);
@@ -307,9 +352,13 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
        if (err < 0)
                return err;
 
+       if (auto_mode_enabled(data->pwm_enable[nr]) ||
+           !duty_mode_enabled(data->pwm_enable[nr]))
+               return -EINVAL;
+
        mutex_lock(&data->update_lock);
        data->pwm[nr] = SENSORS_LIMIT(val, 0, 255);
-       f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), data->pwm[nr]);
+       f75375_write_pwm(client, nr);
        mutex_unlock(&data->update_lock);
        return count;
 }
@@ -327,11 +376,15 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
        struct f75375_data *data = i2c_get_clientdata(client);
        u8 fanmode;
 
-       if (val < 0 || val > 3)
+       if (val < 0 || val > 4)
                return -EINVAL;
 
        fanmode = f75375_read8(client, F75375_REG_FAN_TIMER);
        if (data->kind == f75387) {
+               /* For now, deny dangerous toggling of duty mode */
+               if (duty_mode_enabled(data->pwm_enable[nr]) !=
+                               duty_mode_enabled(val))
+                       return -EOPNOTSUPP;
                /* clear each fanX_mode bit before setting them properly */
                fanmode &= ~(1 << F75387_FAN_DUTY_MODE(nr));
                fanmode &= ~(1 << F75387_FAN_MANU_MODE(nr));
@@ -340,19 +393,19 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
                        fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
                        fanmode |= (1 << F75387_FAN_DUTY_MODE(nr));
                        data->pwm[nr] = 255;
-                       f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
-                                       data->pwm[nr]);
                        break;
                case 1: /* PWM */
                        fanmode  |= (1 << F75387_FAN_MANU_MODE(nr));
                        fanmode  |= (1 << F75387_FAN_DUTY_MODE(nr));
                        break;
-               case 2: /* AUTOMATIC*/
-                       fanmode  |=  (1 << F75387_FAN_DUTY_MODE(nr));
+               case 2: /* Automatic, speed mode */
                        break;
                case 3: /* fan speed */
                        fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
                        break;
+               case 4: /* Automatic, pwm */
+                       fanmode |= (1 << F75387_FAN_DUTY_MODE(nr));
+                       break;
                }
        } else {
                /* clear each fanX_mode bit before setting them properly */
@@ -361,8 +414,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
                case 0: /* full speed */
                        fanmode  |= (3 << FAN_CTRL_MODE(nr));
                        data->pwm[nr] = 255;
-                       f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
-                                       data->pwm[nr]);
                        break;
                case 1: /* PWM */
                        fanmode  |= (3 << FAN_CTRL_MODE(nr));
@@ -372,11 +423,15 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
                        break;
                case 3: /* fan speed */
                        break;
+               case 4: /* Automatic pwm */
+                       return -EINVAL;
                }
        }
 
        f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
        data->pwm_enable[nr] = val;
+       if (val == 0)
+               f75375_write_pwm(client, nr);
        return 0;
 }
 
@@ -727,14 +782,17 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data,
 
                                manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1);
                                duty = ((mode >> F75387_FAN_DUTY_MODE(nr)) & 1);
-                               if (manu && duty)
-                                       /* speed */
+                               if (!manu && duty)
+                                       /* auto, pwm */
+                                       data->pwm_enable[nr] = 4;
+                               else if (manu && !duty)
+                                       /* manual, speed */
                                        data->pwm_enable[nr] = 3;
-                               else if (!manu && duty)
-                                       /* automatic */
+                               else if (!manu && !duty)
+                                       /* automatic, speed */
                                        data->pwm_enable[nr] = 2;
                                else
-                                       /* manual */
+                                       /* manual, pwm */
                                        data->pwm_enable[nr] = 1;
                        } else {
                                if (!(conf & (1 << F75375_FAN_CTRL_LINEAR(nr))))
@@ -759,9 +817,11 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data,
        set_pwm_enable_direct(client, 0, f75375s_pdata->pwm_enable[0]);
        set_pwm_enable_direct(client, 1, f75375s_pdata->pwm_enable[1]);
        for (nr = 0; nr < 2; nr++) {
+               if (auto_mode_enabled(f75375s_pdata->pwm_enable[nr]) ||
+                   !duty_mode_enabled(f75375s_pdata->pwm_enable[nr]))
+                       continue;
                data->pwm[nr] = SENSORS_LIMIT(f75375s_pdata->pwm[nr], 0, 255);
-               f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
-                       data->pwm[nr]);
+               f75375_write_pwm(client, nr);
        }
 
 }
@@ -788,7 +848,7 @@ static int f75375_probe(struct i2c_client *client,
        if (err)
                goto exit_free;
 
-       if (data->kind == f75375) {
+       if (data->kind != f75373) {
                err = sysfs_chmod_file(&client->dev.kobj,
                        &sensor_dev_attr_pwm1_mode.dev_attr.attr,
                        S_IRUGO | S_IWUSR);
index e10a092c603c0b55d4c5245d0a411eb10733f60c..a6760bacd915e435bcc0125948cb46daaad5d807 100644 (file)
@@ -72,8 +72,8 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2e, 0x2f, I2C_CLIENT_END };
 
 static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 };
 
-#define FAN_FROM_REG(val, div, rpm_range)      ((val) == 0 ? -1 : \
-       (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val)))
+#define FAN_FROM_REG(val, rpm_range)   ((val) == 0 || (val) == 255 ? \
+                               0 : (rpm_ranges[rpm_range] * 30) / (val))
 #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255)
 
 /*
@@ -333,7 +333,7 @@ static ssize_t show_fan_input(struct device *dev,
                return PTR_ERR(data);
 
        return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index],
-                      data->ppr, data->rpm_range));
+                      data->rpm_range));
 }
 
 static ssize_t show_alarm(struct device *dev,
@@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client)
        struct max6639_data *data = i2c_get_clientdata(client);
        struct max6639_platform_data *max6639_info =
                client->dev.platform_data;
-       int i = 0;
+       int i;
        int rpm_range = 1; /* default: 4000 RPM */
-       int err = 0;
+       int err;
 
        /* Reset chip to default values, see below for GCONFIG setup */
        err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,
@@ -446,11 +446,6 @@ static int max6639_init_client(struct i2c_client *client)
        else
                data->ppr = 2;
        data->ppr -= 1;
-       err = i2c_smbus_write_byte_data(client,
-                       MAX6639_REG_FAN_PPR(i),
-                       data->ppr << 5);
-       if (err)
-               goto exit;
 
        if (max6639_info)
                rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
@@ -458,6 +453,13 @@ static int max6639_init_client(struct i2c_client *client)
 
        for (i = 0; i < 2; i++) {
 
+               /* Set Fan pulse per revolution */
+               err = i2c_smbus_write_byte_data(client,
+                               MAX6639_REG_FAN_PPR(i),
+                               data->ppr << 6);
+               if (err)
+                       goto exit;
+
                /* Fans config PWM, RPM */
                err = i2c_smbus_write_byte_data(client,
                        MAX6639_REG_FAN_CONFIG1(i),
index beaf5a8d9c45063e08a9ee22ee0b6f23a97e51b5..9b97a5b3cf3df7420df79c86ce83adc247e687c1 100644 (file)
@@ -82,7 +82,7 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
        case PMBUS_VIRT_RESET_TEMP_HISTORY:
                ret = pmbus_write_word_data(client, page,
                                            MAX34440_MFR_TEMPERATURE_PEAK,
-                                           0xffff);
+                                           0x8000);
                break;
        default:
                ret = -ENODATA;
index 7e78f7c87857c7f0d7af5417064f19e822b4a5f4..3d471d56bf15d1faf295f606c31f19d90f384e79 100644 (file)
@@ -72,6 +72,7 @@
 
 #define MXS_I2C_QUEUESTAT      (0x70)
 #define MXS_I2C_QUEUESTAT_RD_QUEUE_EMPTY        0x00002000
+#define MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK 0x0000001F
 
 #define MXS_I2C_QUEUECMD       (0x80)
 
@@ -219,14 +220,14 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
        int ret;
        int flags;
 
-       init_completion(&i2c->cmd_complete);
-
        dev_dbg(i2c->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n",
                msg->addr, msg->len, msg->flags, stop);
 
        if (msg->len == 0)
                return -EINVAL;
 
+       init_completion(&i2c->cmd_complete);
+
        flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0;
 
        if (msg->flags & I2C_M_RD)
@@ -286,6 +287,7 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id)
 {
        struct mxs_i2c_dev *i2c = dev_id;
        u32 stat = readl(i2c->regs + MXS_I2C_CTRL1) & MXS_I2C_IRQ_MASK;
+       bool is_last_cmd;
 
        if (!stat)
                return IRQ_NONE;
@@ -300,9 +302,14 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id)
        else
                i2c->cmd_err = 0;
 
-       complete(&i2c->cmd_complete);
+       is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) &
+               MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0;
+
+       if (is_last_cmd || i2c->cmd_err)
+               complete(&i2c->cmd_complete);
 
        writel(stat, i2c->regs + MXS_I2C_CTRL1_CLR);
+
        return IRQ_HANDLED;
 }
 
index 6381604696d304a0508b23778ac04fe7ee05ef08..0ab4a9548745015cfae6633376527663e6a79708 100644 (file)
@@ -755,7 +755,7 @@ MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);
 
 static struct platform_driver tegra_i2c_driver = {
        .probe   = tegra_i2c_probe,
-       .remove  = tegra_i2c_remove,
+       .remove  = __devexit_p(tegra_i2c_remove),
 #ifdef CONFIG_PM
        .suspend = tegra_i2c_suspend,
        .resume  = tegra_i2c_resume,
index 7f879b2397b0e35a535449a3e0dcca8b36f48f10..af8d016c37eaae0dc4f5c97b9aecce840d6fec57 100644 (file)
@@ -116,4 +116,3 @@ obj-$(CONFIG_BLK_DEV_IDE_AU1XXX)    += au1xxx-ide.o
 
 obj-$(CONFIG_BLK_DEV_IDE_TX4938)       += tx4938ide.o
 obj-$(CONFIG_BLK_DEV_IDE_TX4939)       += tx4939ide.o
-obj-$(CONFIG_BLK_DEV_IDE_AT91)         += at91_ide.o
diff --git a/drivers/ide/at91_ide.c b/drivers/ide/at91_ide.c
deleted file mode 100644 (file)
index 41d4155..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * IDE host driver for AT91 (SAM9, CAP9, AT572D940HF) Static Memory Controller
- * with Compact Flash True IDE logic
- *
- * Copyright (c) 2008, 2009 Kelvatek Ltd.
- *
- *  This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/ide.h>
-#include <linux/platform_device.h>
-
-#include <mach/board.h>
-#include <asm/gpio.h>
-#include <mach/at91sam9_smc.h>
-
-#define DRV_NAME "at91_ide"
-
-#define perr(fmt, args...) pr_err(DRV_NAME ": " fmt, ##args)
-#define pdbg(fmt, args...) pr_debug("%s " fmt, __func__, ##args)
-
-/*
- * Access to IDE device is possible through EBI Static Memory Controller
- * with Compact Flash logic. For details see EBI and SMC datasheet sections
- * of any microcontroller from AT91SAM9 family.
- *
- * Within SMC chip select address space, lines A[23:21] distinguish Compact
- * Flash modes (I/O, common memory, attribute memory, True IDE). IDE modes are:
- *   0x00c0000 - True IDE
- *   0x00e0000 - Alternate True IDE (Alt Status Register)
- *
- * On True IDE mode Task File and Data Register are mapped at the same address.
- * To distinguish access between these two different bus data width is used:
- * 8Bit for Task File, 16Bit for Data I/O.
- *
- * After initialization we do 8/16 bit flipping (changes in SMC MODE register)
- * only inside IDE callback routines which are serialized by IDE layer,
- * so no additional locking needed.
- */
-
-#define TASK_FILE      0x00c00000
-#define ALT_MODE       0x00e00000
-#define REGS_SIZE      8
-
-#define enter_16bit(cs, mode) do {                                     \
-       mode = at91_sys_read(AT91_SMC_MODE(cs));                        \
-       at91_sys_write(AT91_SMC_MODE(cs), mode | AT91_SMC_DBW_16);      \
-} while (0)
-
-#define leave_16bit(cs, mode) at91_sys_write(AT91_SMC_MODE(cs), mode);
-
-static void set_smc_timings(const u8 chipselect, const u16 cycle,
-                           const u16 setup, const u16 pulse,
-                           const u16 data_float, int use_iordy)
-{
-       unsigned long mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-                            AT91_SMC_BAT_SELECT;
-
-       /* disable or enable waiting for IORDY signal */
-       if (use_iordy)
-               mode |= AT91_SMC_EXNWMODE_READY;
-
-       /* add data float cycles if needed */
-       if (data_float)
-               mode |= AT91_SMC_TDF_(data_float);
-
-       at91_sys_write(AT91_SMC_MODE(chipselect), mode);
-
-       /* setup timings in SMC */
-       at91_sys_write(AT91_SMC_SETUP(chipselect), AT91_SMC_NWESETUP_(setup) |
-                                                  AT91_SMC_NCS_WRSETUP_(0) |
-                                                  AT91_SMC_NRDSETUP_(setup) |
-                                                  AT91_SMC_NCS_RDSETUP_(0));
-       at91_sys_write(AT91_SMC_PULSE(chipselect), AT91_SMC_NWEPULSE_(pulse) |
-                                                  AT91_SMC_NCS_WRPULSE_(cycle) |
-                                                  AT91_SMC_NRDPULSE_(pulse) |
-                                                  AT91_SMC_NCS_RDPULSE_(cycle));
-       at91_sys_write(AT91_SMC_CYCLE(chipselect), AT91_SMC_NWECYCLE_(cycle) |
-                                                  AT91_SMC_NRDCYCLE_(cycle));
-}
-
-static unsigned int calc_mck_cycles(unsigned int ns, unsigned int mck_hz)
-{
-       u64 tmp = ns;
-
-       tmp *= mck_hz;
-       tmp += 1000*1000*1000 - 1; /* round up */
-       do_div(tmp, 1000*1000*1000);
-       return (unsigned int) tmp;
-}
-
-static void apply_timings(const u8 chipselect, const u8 pio,
-                         const struct ide_timing *timing, int use_iordy)
-{
-       unsigned int t0, t1, t2, t6z;
-       unsigned int cycle, setup, pulse, data_float;
-       unsigned int mck_hz;
-       struct clk *mck;
-
-       /* see table 22 of Compact Flash standard 4.1 for the meaning,
-        * we do not stretch active (t2) time, so setup (t1) + hold time (th)
-        * assure at least minimal recovery (t2i) time */
-       t0 = timing->cyc8b;
-       t1 = timing->setup;
-       t2 = timing->act8b;
-       t6z = (pio < 5) ? 30 : 20;
-
-       pdbg("t0=%u t1=%u t2=%u t6z=%u\n", t0, t1, t2, t6z);
-
-       mck = clk_get(NULL, "mck");
-       BUG_ON(IS_ERR(mck));
-       mck_hz = clk_get_rate(mck);
-       pdbg("mck_hz=%u\n", mck_hz);
-
-       cycle = calc_mck_cycles(t0, mck_hz);
-       setup = calc_mck_cycles(t1, mck_hz);
-       pulse = calc_mck_cycles(t2, mck_hz);
-       data_float = calc_mck_cycles(t6z, mck_hz);
-
-       pdbg("cycle=%u setup=%u pulse=%u data_float=%u\n",
-            cycle, setup, pulse, data_float);
-
-       set_smc_timings(chipselect, cycle, setup, pulse, data_float, use_iordy);
-}
-
-static void at91_ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
-                               void *buf, unsigned int len)
-{
-       ide_hwif_t *hwif = drive->hwif;
-       struct ide_io_ports *io_ports = &hwif->io_ports;
-       u8 chipselect = hwif->select_data;
-       unsigned long mode;
-
-       pdbg("cs %u buf %p len %d\n", chipselect, buf, len);
-
-       len++;
-
-       enter_16bit(chipselect, mode);
-       readsw((void __iomem *)io_ports->data_addr, buf, len / 2);
-       leave_16bit(chipselect, mode);
-}
-
-static void at91_ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
-                                void *buf, unsigned int len)
-{
-       ide_hwif_t *hwif = drive->hwif;
-       struct ide_io_ports *io_ports = &hwif->io_ports;
-       u8 chipselect = hwif->select_data;
-       unsigned long mode;
-
-       pdbg("cs %u buf %p len %d\n", chipselect,  buf, len);
-
-       enter_16bit(chipselect, mode);
-       writesw((void __iomem *)io_ports->data_addr, buf, len / 2);
-       leave_16bit(chipselect, mode);
-}
-
-static void at91_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
-{
-       struct ide_timing *timing;
-       u8 chipselect = hwif->select_data;
-       int use_iordy = 0;
-       const u8 pio = drive->pio_mode - XFER_PIO_0;
-
-       pdbg("chipselect %u pio %u\n", chipselect, pio);
-
-       timing = ide_timing_find_mode(XFER_PIO_0 + pio);
-       BUG_ON(!timing);
-
-       if (ide_pio_need_iordy(drive, pio))
-               use_iordy = 1;
-
-       apply_timings(chipselect, pio, timing, use_iordy);
-}
-
-static const struct ide_tp_ops at91_ide_tp_ops = {
-       .exec_command   = ide_exec_command,
-       .read_status    = ide_read_status,
-       .read_altstatus = ide_read_altstatus,
-       .write_devctl   = ide_write_devctl,
-
-       .dev_select     = ide_dev_select,
-       .tf_load        = ide_tf_load,
-       .tf_read        = ide_tf_read,
-
-       .input_data     = at91_ide_input_data,
-       .output_data    = at91_ide_output_data,
-};
-
-static const struct ide_port_ops at91_ide_port_ops = {
-       .set_pio_mode   = at91_ide_set_pio_mode,
-};
-
-static const struct ide_port_info at91_ide_port_info __initdata = {
-       .port_ops       = &at91_ide_port_ops,
-       .tp_ops         = &at91_ide_tp_ops,
-       .host_flags     = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE |
-                         IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_UNMASK_IRQS,
-       .pio_mask       = ATA_PIO6,
-       .chipset        = ide_generic,
-};
-
-/*
- * If interrupt is delivered through GPIO, IRQ are triggered on falling
- * and rising edge of signal. Whereas IDE device request interrupt on high
- * level (rising edge in our case). This mean we have fake interrupts, so
- * we need to check interrupt pin and exit instantly from ISR when line
- * is on low level.
- */
-
-irqreturn_t at91_irq_handler(int irq, void *dev_id)
-{
-       int ntries = 8;
-       int pin_val1, pin_val2;
-
-       /* additional deglitch, line can be noisy in badly designed PCB */
-       do {
-               pin_val1 = at91_get_gpio_value(irq);
-               pin_val2 = at91_get_gpio_value(irq);
-       } while (pin_val1 != pin_val2 && --ntries > 0);
-
-       if (pin_val1 == 0 || ntries <= 0)
-               return IRQ_HANDLED;
-
-       return ide_intr(irq, dev_id);
-}
-
-static int __init at91_ide_probe(struct platform_device *pdev)
-{
-       int ret;
-       struct ide_hw hw, *hws[] = { &hw };
-       struct ide_host *host;
-       struct resource *res;
-       unsigned long tf_base = 0, ctl_base = 0;
-       struct at91_cf_data *board = pdev->dev.platform_data;
-
-       if (!board)
-               return -ENODEV;
-
-       if (board->det_pin && at91_get_gpio_value(board->det_pin) != 0) {
-               perr("no device detected\n");
-               return -ENODEV;
-       }
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               perr("can't get memory resource\n");
-               return -ENODEV;
-       }
-
-       if (!devm_request_mem_region(&pdev->dev, res->start + TASK_FILE,
-                                    REGS_SIZE, "ide") ||
-           !devm_request_mem_region(&pdev->dev, res->start + ALT_MODE,
-                                    REGS_SIZE, "alt")) {
-               perr("memory resources in use\n");
-               return -EBUSY;
-       }
-
-       pdbg("chipselect %u irq %u res %08lx\n", board->chipselect,
-            board->irq_pin, (unsigned long) res->start);
-
-       tf_base = (unsigned long) devm_ioremap(&pdev->dev, res->start + TASK_FILE,
-                                              REGS_SIZE);
-       ctl_base = (unsigned long) devm_ioremap(&pdev->dev, res->start + ALT_MODE,
-                                               REGS_SIZE);
-       if (!tf_base || !ctl_base) {
-               perr("can't map memory regions\n");
-               return -EBUSY;
-       }
-
-       memset(&hw, 0, sizeof(hw));
-
-       if (board->flags & AT91_IDE_SWAP_A0_A2) {
-               /* workaround for stupid hardware bug */
-               hw.io_ports.data_addr   = tf_base + 0;
-               hw.io_ports.error_addr  = tf_base + 4;
-               hw.io_ports.nsect_addr  = tf_base + 2;
-               hw.io_ports.lbal_addr   = tf_base + 6;
-               hw.io_ports.lbam_addr   = tf_base + 1;
-               hw.io_ports.lbah_addr   = tf_base + 5;
-               hw.io_ports.device_addr = tf_base + 3;
-               hw.io_ports.command_addr = tf_base + 7;
-               hw.io_ports.ctl_addr    = ctl_base + 3;
-       } else
-               ide_std_init_ports(&hw, tf_base, ctl_base + 6);
-
-       hw.irq = board->irq_pin;
-       hw.dev = &pdev->dev;
-
-       host = ide_host_alloc(&at91_ide_port_info, hws, 1);
-       if (!host) {
-               perr("failed to allocate ide host\n");
-               return -ENOMEM;
-       }
-
-       /* setup Static Memory Controller - PIO 0 as default */
-       apply_timings(board->chipselect, 0, ide_timing_find_mode(XFER_PIO_0), 0);
-
-       /* with GPIO interrupt we have to do quirks in handler */
-       if (gpio_is_valid(board->irq_pin))
-               host->irq_handler = at91_irq_handler;
-
-       host->ports[0]->select_data = board->chipselect;
-
-       ret = ide_host_register(host, &at91_ide_port_info, hws);
-       if (ret) {
-               perr("failed to register ide host\n");
-               goto err_free_host;
-       }
-       platform_set_drvdata(pdev, host);
-       return 0;
-
-err_free_host:
-       ide_host_free(host);
-       return ret;
-}
-
-static int __exit at91_ide_remove(struct platform_device *pdev)
-{
-       struct ide_host *host = platform_get_drvdata(pdev);
-
-       ide_host_remove(host);
-       return 0;
-}
-
-static struct platform_driver at91_ide_driver = {
-       .driver = {
-               .name = DRV_NAME,
-               .owner = THIS_MODULE,
-       },
-       .remove = __exit_p(at91_ide_remove),
-};
-
-static int __init at91_ide_init(void)
-{
-       return platform_driver_probe(&at91_ide_driver, at91_ide_probe);
-}
-
-static void __exit at91_ide_exit(void)
-{
-       platform_driver_unregister(&at91_ide_driver);
-}
-
-module_init(at91_ide_init);
-module_exit(at91_ide_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Stanislaw Gruszka <stf_xl@wp.pl>");
-
index afc166fcc3d9c41ad6654bae17d5c893382c3705..7df5bfef2624d5c1e49bd39208135c29aaed8653 100644 (file)
@@ -332,7 +332,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
        struct evdev_client *client = file->private_data;
        struct evdev *evdev = client->evdev;
        struct input_event event;
-       int retval;
+       int retval = 0;
 
        if (count < input_event_size())
                return -EINVAL;
index 37651373a95b0ebb19d25ca32cfcd62599ee4a9b..f3bc4189a7ba136154d418b49028cccb680fb970 100644 (file)
@@ -172,7 +172,7 @@ static void twl4030_vibra_close(struct input_dev *input)
 }
 
 /*** Module ***/
-#if CONFIG_PM
+#if CONFIG_PM_SLEEP
 static int twl4030_vibra_suspend(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
@@ -189,10 +189,10 @@ static int twl4030_vibra_resume(struct device *dev)
        vibra_disable_leds();
        return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
                         twl4030_vibra_suspend, twl4030_vibra_resume);
-#endif
 
 static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
 {
@@ -273,9 +273,7 @@ static struct platform_driver twl4030_vibra_driver = {
        .driver         = {
                .name   = "twl4030-vibra",
                .owner  = THIS_MODULE,
-#ifdef CONFIG_PM
                .pm     = &twl4030_vibra_pm_ops,
-#endif
        },
 };
 module_platform_driver(twl4030_vibra_driver);
index bd87380bd879edcfd9a278d53c887c444a14b9d6..4c6a72d3d48c33c875efe6b969652d0f45961270 100644 (file)
@@ -952,7 +952,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
 
        /*
         * First try "E6 report".
-        * ALPS should return 0,0,10 or 0,0,100
+        * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
+        * The bits 0-2 of the first byte will be 1s if some buttons are
+        * pressed.
         */
        param[0] = 0;
        if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
@@ -968,7 +970,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
        psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
                    param[0], param[1], param[2]);
 
-       if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100))
+       if ((param[0] & 0xf8) != 0 || param[1] != 0 ||
+           (param[2] != 10 && param[2] != 100))
                return NULL;
 
        /*
index 58a87755b936eee386811396b9ba0ae418a3e0ea..e53f4081a586956974bea8731d366366515ff6f8 100644 (file)
@@ -77,6 +77,8 @@ config TABLET_USB_WACOM
        tristate "Wacom Intuos/Graphire tablet support (USB)"
        depends on USB_ARCH_HAS_HCD
        select USB
+       select NEW_LEDS
+       select LEDS_CLASS
        help
          Say Y here if you want to use the USB version of the Wacom Intuos
          or Graphire tablet.  Make sure to say Y to "Mouse support"
index 88672ec296c116e10d7340c7f07397e10e09afe1..cd3ed29e0801347f20fb9b5da9e2fbbddfbd14b5 100644 (file)
@@ -926,7 +926,7 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
 {
        struct input_dev *input = wacom->input;
        unsigned char *data = wacom->data;
-       int count = data[1] & 0x03;
+       int count = data[1] & 0x07;
        int i;
 
        if (data[0] != 0x02)
index 288da5c1499d5432c14b2410136dfc05f82d18ff..103dbd92e2563ac55116b335fa35cb84f73fe7a8 100644 (file)
@@ -44,7 +44,8 @@ static ssize_t debug_read_ver(struct file *file, char __user *userbuf,
 static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
                               size_t count, loff_t *ppos)
 {
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
+       struct omap_iommu *obj = dev_to_omap_iommu(dev);
        char *p, *buf;
        ssize_t bytes;
 
@@ -67,7 +68,8 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
 static ssize_t debug_read_tlb(struct file *file, char __user *userbuf,
                              size_t count, loff_t *ppos)
 {
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
+       struct omap_iommu *obj = dev_to_omap_iommu(dev);
        char *p, *buf;
        ssize_t bytes, rest;
 
@@ -97,7 +99,8 @@ static ssize_t debug_write_pagetable(struct file *file,
        struct iotlb_entry e;
        struct cr_regs cr;
        int err;
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
+       struct omap_iommu *obj = dev_to_omap_iommu(dev);
        char buf[MAXCOLUMN], *p = buf;
 
        count = min(count, sizeof(buf));
@@ -184,7 +187,8 @@ out:
 static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf,
                                    size_t count, loff_t *ppos)
 {
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
+       struct omap_iommu *obj = dev_to_omap_iommu(dev);
        char *p, *buf;
        size_t bytes;
 
@@ -212,7 +216,8 @@ static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf,
 static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,
                               size_t count, loff_t *ppos)
 {
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
+       struct omap_iommu *obj = dev_to_omap_iommu(dev);
        char *p, *buf;
        struct iovm_struct *tmp;
        int uninitialized_var(i);
@@ -254,7 +259,7 @@ static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,
 static ssize_t debug_read_mem(struct file *file, char __user *userbuf,
                              size_t count, loff_t *ppos)
 {
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
        char *p, *buf;
        struct iovm_struct *area;
        ssize_t bytes;
@@ -268,8 +273,8 @@ static ssize_t debug_read_mem(struct file *file, char __user *userbuf,
 
        mutex_lock(&iommu_debug_lock);
 
-       area = omap_find_iovm_area(obj, (u32)ppos);
-       if (IS_ERR(area)) {
+       area = omap_find_iovm_area(dev, (u32)ppos);
+       if (!area) {
                bytes = -EINVAL;
                goto err_out;
        }
@@ -287,7 +292,7 @@ err_out:
 static ssize_t debug_write_mem(struct file *file, const char __user *userbuf,
                               size_t count, loff_t *ppos)
 {
-       struct omap_iommu *obj = file->private_data;
+       struct device *dev = file->private_data;
        struct iovm_struct *area;
        char *p, *buf;
 
@@ -305,8 +310,8 @@ static ssize_t debug_write_mem(struct file *file, const char __user *userbuf,
                goto err_out;
        }
 
-       area = omap_find_iovm_area(obj, (u32)ppos);
-       if (IS_ERR(area)) {
+       area = omap_find_iovm_area(dev, (u32)ppos);
+       if (!area) {
                count = -EINVAL;
                goto err_out;
        }
@@ -350,7 +355,7 @@ DEBUG_FOPS(mem);
        {                                                               \
                struct dentry *dent;                                    \
                dent = debugfs_create_file(#attr, mode, parent,         \
-                                          obj, &debug_##attr##_fops);  \
+                                          dev, &debug_##attr##_fops);  \
                if (!dent)                                              \
                        return -ENOMEM;                                 \
        }
@@ -362,20 +367,29 @@ static int iommu_debug_register(struct device *dev, void *data)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct omap_iommu *obj = platform_get_drvdata(pdev);
+       struct omap_iommu_arch_data *arch_data;
        struct dentry *d, *parent;
 
        if (!obj || !obj->dev)
                return -EINVAL;
 
+       arch_data = kzalloc(sizeof(*arch_data), GFP_KERNEL);
+       if (!arch_data)
+               return -ENOMEM;
+
+       arch_data->iommu_dev = obj;
+
+       dev->archdata.iommu = arch_data;
+
        d = debugfs_create_dir(obj->name, iommu_debug_root);
        if (!d)
-               return -ENOMEM;
+               goto nomem;
        parent = d;
 
        d = debugfs_create_u8("nr_tlb_entries", 400, parent,
                              (u8 *)&obj->nr_tlb_entries);
        if (!d)
-               return -ENOMEM;
+               goto nomem;
 
        DEBUG_ADD_FILE_RO(ver);
        DEBUG_ADD_FILE_RO(regs);
@@ -384,6 +398,22 @@ static int iommu_debug_register(struct device *dev, void *data)
        DEBUG_ADD_FILE_RO(mmap);
        DEBUG_ADD_FILE(mem);
 
+       return 0;
+
+nomem:
+       kfree(arch_data);
+       return -ENOMEM;
+}
+
+static int iommu_debug_unregister(struct device *dev, void *data)
+{
+       if (!dev->archdata.iommu)
+               return 0;
+
+       kfree(dev->archdata.iommu);
+
+       dev->archdata.iommu = NULL;
+
        return 0;
 }
 
@@ -411,6 +441,7 @@ module_init(iommu_debug_init)
 static void __exit iommu_debugfs_exit(void)
 {
        debugfs_remove_recursive(iommu_debug_root);
+       omap_foreach_iommu_device(NULL, iommu_debug_unregister);
 }
 module_exit(iommu_debugfs_exit)
 
index d8edd979d01b2c3d84ffb49a9d2c3c53829518d9..6899dcd02dfa0e35df014c42651ba4c5b4f6bb67 100644 (file)
@@ -1223,7 +1223,8 @@ static int __init omap_iommu_init(void)
 
        return platform_driver_register(&omap_iommu_driver);
 }
-module_init(omap_iommu_init);
+/* must be ready before omap3isp is probed */
+subsys_initcall(omap_iommu_init);
 
 static void __exit omap_iommu_exit(void)
 {
index 75049e765191eb6a75ec44b1670304785cba3a9e..b026896206ca4fb1ee66df1df93036dcc7b72f9b 100644 (file)
@@ -710,7 +710,7 @@ static ssize_t adb_read(struct file *file, char __user *buf,
        req = NULL;
        spin_lock_irqsave(&state->lock, flags);
        add_wait_queue(&state->wait_queue, &wait);
-       current->state = TASK_INTERRUPTIBLE;
+       set_current_state(TASK_INTERRUPTIBLE);
 
        for (;;) {
                req = state->completed;
@@ -734,7 +734,7 @@ static ssize_t adb_read(struct file *file, char __user *buf,
                spin_lock_irqsave(&state->lock, flags);
        }
 
-       current->state = TASK_RUNNING;
+       set_current_state(TASK_RUNNING);
        remove_wait_queue(&state->wait_queue, &wait);
        spin_unlock_irqrestore(&state->lock, flags);
        
index a368db2431a596020a98a3e64f67685ccef9c6cc..a0b225eb4ac449b0ae4b74349be9dbb1e0874fa7 100644 (file)
@@ -624,7 +624,7 @@ int md_raid1_congested(struct mddev *mddev, int bits)
                return 1;
 
        rcu_read_lock();
-       for (i = 0; i < conf->raid_disks; i++) {
+       for (i = 0; i < conf->raid_disks * 2; i++) {
                struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
                if (rdev && !test_bit(Faulty, &rdev->flags)) {
                        struct request_queue *q = bdev_get_queue(rdev->bdev);
index 6e8aa213f0d5208d917b8222a56980ab3582b4d6..58c44d6453a0bfa0fb40f155c0357e4392731999 100644 (file)
@@ -67,6 +67,7 @@ static int max_queued_requests = 1024;
 
 static void allow_barrier(struct r10conf *conf);
 static void lower_barrier(struct r10conf *conf);
+static int enough(struct r10conf *conf, int ignore);
 
 static void * r10bio_pool_alloc(gfp_t gfp_flags, void *data)
 {
@@ -347,6 +348,19 @@ static void raid10_end_read_request(struct bio *bio, int error)
                 * wait for the 'master' bio.
                 */
                set_bit(R10BIO_Uptodate, &r10_bio->state);
+       } else {
+               /* If all other devices that store this block have
+                * failed, we want to return the error upwards rather
+                * than fail the last device.  Here we redefine
+                * "uptodate" to mean "Don't want to retry"
+                */
+               unsigned long flags;
+               spin_lock_irqsave(&conf->device_lock, flags);
+               if (!enough(conf, rdev->raid_disk))
+                       uptodate = 1;
+               spin_unlock_irqrestore(&conf->device_lock, flags);
+       }
+       if (uptodate) {
                raid_end_bio_io(r10_bio);
                rdev_dec_pending(rdev, conf->mddev);
        } else {
@@ -2052,6 +2066,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
                       "md/raid10:%s: %s: Failing raid device\n",
                       mdname(mddev), b);
                md_error(mddev, conf->mirrors[d].rdev);
+               r10_bio->devs[r10_bio->read_slot].bio = IO_BLOCKED;
                return;
        }
 
@@ -2105,8 +2120,11 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
                                    rdev,
                                    r10_bio->devs[r10_bio->read_slot].addr
                                    + sect,
-                                   s, 0))
+                                   s, 0)) {
                                md_error(mddev, rdev);
+                               r10_bio->devs[r10_bio->read_slot].bio
+                                       = IO_BLOCKED;
+                       }
                        break;
                }
 
@@ -2299,17 +2317,20 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
         * This is all done synchronously while the array is
         * frozen.
         */
+       bio = r10_bio->devs[slot].bio;
+       bdevname(bio->bi_bdev, b);
+       bio_put(bio);
+       r10_bio->devs[slot].bio = NULL;
+
        if (mddev->ro == 0) {
                freeze_array(conf);
                fix_read_error(conf, mddev, r10_bio);
                unfreeze_array(conf);
-       }
+       } else
+               r10_bio->devs[slot].bio = IO_BLOCKED;
+
        rdev_dec_pending(rdev, mddev);
 
-       bio = r10_bio->devs[slot].bio;
-       bdevname(bio->bi_bdev, b);
-       r10_bio->devs[slot].bio =
-               mddev->ro ? IO_BLOCKED : NULL;
 read_more:
        rdev = read_balance(conf, r10_bio, &max_sectors);
        if (rdev == NULL) {
@@ -2318,13 +2339,10 @@ read_more:
                       mdname(mddev), b,
                       (unsigned long long)r10_bio->sector);
                raid_end_bio_io(r10_bio);
-               bio_put(bio);
                return;
        }
 
        do_sync = (r10_bio->master_bio->bi_rw & REQ_SYNC);
-       if (bio)
-               bio_put(bio);
        slot = r10_bio->read_slot;
        printk_ratelimited(
                KERN_ERR
@@ -2360,7 +2378,6 @@ read_more:
                        mbio->bi_phys_segments++;
                spin_unlock_irq(&conf->device_lock);
                generic_make_request(bio);
-               bio = NULL;
 
                r10_bio = mempool_alloc(conf->r10bio_pool,
                                        GFP_NOIO);
@@ -3243,7 +3260,6 @@ static int run(struct mddev *mddev)
                        disk->rdev = rdev;
                }
 
-               disk->rdev = rdev;
                disk_stack_limits(mddev->gendisk, rdev->bdev,
                                  rdev->data_offset << 9);
                /* as we don't honour merge_bvec_fn, we must never risk
index 86b28579f0c745a4e257b00aecb26ce320a3339f..ea1e6545df3691f142e88237d21565c517f7dd3e 100644 (file)
@@ -4,8 +4,8 @@
 menu "Texas Instruments WL128x FM driver (ST based)"
 config RADIO_WL128X
        tristate "Texas Instruments WL128x FM Radio"
-       depends on VIDEO_V4L2 && RFKILL
-       select TI_ST if NET && GPIOLIB
+       depends on VIDEO_V4L2 && RFKILL && GPIOLIB
+       select TI_ST if NET
        help
        Choose Y here if you have this FM radio chip.
 
index 3aeb29a7ce113205683f524d2f016c2121a2225c..7f26fdf2e54e4a9498264f7b92155fb146887d9c 100644 (file)
@@ -47,7 +47,7 @@
 #define MOD_AUTHOR     "Jarod Wilson <jarod@wilsonet.com>"
 #define MOD_DESC       "Driver for SoundGraph iMON MultiMedia IR/Display"
 #define MOD_NAME       "imon"
-#define MOD_VERSION    "0.9.3"
+#define MOD_VERSION    "0.9.4"
 
 #define DISPLAY_MINOR_BASE     144
 #define DEVICE_NAME    "lcd%d"
@@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb)
                return;
 
        ictx = (struct imon_context *)urb->context;
-       if (!ictx || !ictx->dev_present_intf0)
+       if (!ictx)
                return;
 
+       /*
+        * if we get a callback before we're done configuring the hardware, we
+        * can't yet process the data, as there's nowhere to send it, but we
+        * still need to submit a new rx URB to avoid wedging the hardware
+        */
+       if (!ictx->dev_present_intf0)
+               goto out;
+
        switch (urb->status) {
        case -ENOENT:           /* usbcore unlink successful! */
                return;
@@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb)
                break;
        }
 
+out:
        usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);
 }
 
@@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb)
                return;
 
        ictx = (struct imon_context *)urb->context;
-       if (!ictx || !ictx->dev_present_intf1)
+       if (!ictx)
                return;
 
+       /*
+        * if we get a callback before we're done configuring the hardware, we
+        * can't yet process the data, as there's nowhere to send it, but we
+        * still need to submit a new rx URB to avoid wedging the hardware
+        */
+       if (!ictx->dev_present_intf1)
+               goto out;
+
        switch (urb->status) {
        case -ENOENT:           /* usbcore unlink successful! */
                return;
@@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb)
                break;
        }
 
+out:
        usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);
 }
 
@@ -2242,7 +2260,7 @@ find_endpoint_failed:
        mutex_unlock(&ictx->lock);
        usb_free_urb(rx_urb);
 rx_urb_alloc_failed:
-       dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret);
+       dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);
 
        return NULL;
 }
index e5eb56a5b6180cd80e43d25812cc406bdda06921..6510110f53d0d6754af0b74a8eec7ce0820fa725 100644 (file)
@@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev)
        }
 #endif
 
+       dev->fw_ver = dev->usbc_buf[1];
+
        v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",
-                         dev->usbc_buf[1], &dev->usbc_buf[2]);
+                         dev->fw_ver, &dev->usbc_buf[2]);
+
+       if (dev->fw_ver > 0x15) {
+               dev->options.brightness = 0x80;
+               dev->options.contrast   = 0x40;
+               dev->options.hue        = 0xf;
+               dev->options.saturation = 0x40;
+               dev->options.sharpness  = 0x80;
+       }
 
-       switch (dev->usbc_buf[1]) {
+       switch (dev->fw_ver) {
        case HDPVR_FIRMWARE_VERSION:
                dev->flags &= ~HDPVR_FLAG_AC3_CAP;
                break;
@@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev)
        default:
                v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
                          " not work.\n");
-               if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)
+               if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
                        dev->flags |= HDPVR_FLAG_AC3_CAP;
                else
                        dev->flags &= ~HDPVR_FLAG_AC3_CAP;
@@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = {
        .bitrate_mode   = HDPVR_CONSTANT,
        .gop_mode       = HDPVR_SIMPLE_IDR_GOP,
        .audio_codec    = V4L2_MPEG_AUDIO_ENCODING_AAC,
+       /* original picture controls for firmware version <= 0x15 */
+       /* updated in device_authorization() for newer firmware */
        .brightness     = 0x86,
        .contrast       = 0x80,
        .hue            = 0x80,
index 087f7c08cb851ee50485dd2a50e80f30d9a82674..11ffe9cc178065b222517871e8a567a379ff1ac3 100644 (file)
@@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev)
 
                hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);
 
+               dev->status = STATUS_STREAMING;
+
                INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
                queue_work(dev->workqueue, &dev->worker);
 
                v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
                         "streaming started\n");
-               dev->status = STATUS_STREAMING;
 
                return 0;
        }
@@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = {
 };
 
 static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,
-                         int ac3)
+                         int ac3, int fw_ver)
 {
        int err;
 
+       if (fw_ver > 0x15) {
+               switch (qc->id) {
+               case V4L2_CID_BRIGHTNESS:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
+               case V4L2_CID_CONTRAST:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);
+               case V4L2_CID_SATURATION:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);
+               case V4L2_CID_HUE:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf);
+               case V4L2_CID_SHARPNESS:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
+               }
+       } else {
+               switch (qc->id) {
+               case V4L2_CID_BRIGHTNESS:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);
+               case V4L2_CID_CONTRAST:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
+               case V4L2_CID_SATURATION:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
+               case V4L2_CID_HUE:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
+               case V4L2_CID_SHARPNESS:
+                       return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
+               }
+       }
+
        switch (qc->id) {
-       case V4L2_CID_BRIGHTNESS:
-               return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);
-       case V4L2_CID_CONTRAST:
-               return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
-       case V4L2_CID_SATURATION:
-               return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
-       case V4L2_CID_HUE:
-               return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
-       case V4L2_CID_SHARPNESS:
-               return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
        case V4L2_CID_MPEG_AUDIO_ENCODING:
                return v4l2_ctrl_query_fill(
                        qc, V4L2_MPEG_AUDIO_ENCODING_AAC,
@@ -794,7 +813,8 @@ static int vidioc_queryctrl(struct file *file, void *private_data,
 
                if (qc->id == supported_v4l2_ctrls[i])
                        return fill_queryctrl(&dev->options, qc,
-                                             dev->flags & HDPVR_FLAG_AC3_CAP);
+                                             dev->flags & HDPVR_FLAG_AC3_CAP,
+                                             dev->fw_ver);
 
                if (qc->id < supported_v4l2_ctrls[i])
                        break;
index d6439db1d18beb1d10b745a303149316016236e6..fea3c6926997cea844c4d136c6814c4b72aafbb1 100644 (file)
@@ -113,6 +113,7 @@ struct hdpvr_device {
        /* usb control transfer buffer and lock */
        struct mutex            usbc_mutex;
        u8                      *usbc_buf;
+       u8                      fw_ver;
 };
 
 static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
index a74a79701d346786fb8f3b91a7823694a6c74bdb..eaabc27f0fa2936b8de8b1bf0a143e49a9fc7916 100644 (file)
@@ -1407,7 +1407,7 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event)
 static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
 {
        struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity);
-       struct video_device *vdev = &ccdc->subdev.devnode;
+       struct video_device *vdev = ccdc->subdev.devnode;
        struct v4l2_event event;
 
        memset(&event, 0, sizeof(event));
index 53e2a80f42facb931f56c4adcde9221f5b5c69e1..d295941c9a3db63ab75408470ac8edfefbdb2cb2 100644 (file)
@@ -956,11 +956,12 @@ int __devinit ab8500_init(struct ab8500 *ab8500)
        return ret;
 
 out_freeirq:
-       if (ab8500->irq_base) {
+       if (ab8500->irq_base)
                free_irq(ab8500->irq, ab8500);
 out_removeirq:
+       if (ab8500->irq_base)
                ab8500_irq_remove(ab8500);
-       }
+
        return ret;
 }
 
index 0f5922812bffdee8e3e892cab978052548d92114..411f523d4878bd1cec6f8783ca6c99d6b57b669e 100644 (file)
@@ -123,7 +123,7 @@ static int mfd_add_device(struct device *parent, int id,
                }
 
                if (!cell->ignore_resource_conflicts) {
-                       ret = acpi_check_resource_conflict(res);
+                       ret = acpi_check_resource_conflict(&res[r]);
                        if (ret)
                                goto fail_res;
                }
index e075c113eec6f7d77a67b5ca1eb145abe8eebbdf..caadabeed8e94d59ae55fd8dbde84b37014769bb 100644 (file)
@@ -105,7 +105,7 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
        s5m87xx->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
        i2c_set_clientdata(s5m87xx->rtc, s5m87xx);
 
-       if (pdata->cfg_pmic_irq)
+       if (pdata && pdata->cfg_pmic_irq)
                pdata->cfg_pmic_irq();
 
        s5m_irq_init(s5m87xx);
index 01cf5012a08fb26c3b561fde99341d6ab84749e2..4392f6bca156e20a71d7acb8cce0b9316db42753 100644 (file)
@@ -168,7 +168,7 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
                goto err;
 
        init_data->irq = pmic_plat_data->irq;
-       init_data->irq_base = pmic_plat_data->irq;
+       init_data->irq_base = pmic_plat_data->irq_base;
 
        tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base);
 
index 5fec23a9ac039f34eaf6cf902acbfb6521aa7ab4..74fd8cb5f37224e576f58398c20fda9f4884d9e7 100644 (file)
@@ -151,7 +151,7 @@ int tps65912_device_init(struct tps65912 *tps65912)
                goto err;
 
        init_data->irq = pmic_plat_data->irq;
-       init_data->irq_base = pmic_plat_data->irq;
+       init_data->irq_base = pmic_plat_data->irq_base;
        ret = tps65912_irq_init(tps65912, init_data->irq, init_data);
        if (ret < 0)
                goto err;
index 8a1fafd0bf7d129184e8910b73a0848954dcf42c..9fd01bf63c510eafab2c1efc987728576aa54f5e 100644 (file)
@@ -496,7 +496,6 @@ int wm8350_irq_init(struct wm8350 *wm8350, int irq,
 
        mutex_init(&wm8350->irq_lock);
        wm8350->chip_irq = irq;
-       wm8350->irq_base = pdata->irq_base;
 
        if (pdata && pdata->irq_base > 0)
                irq_base = pdata->irq_base;
index f117e7fb932194fc174ed52439dadcd57e81684c..a04b3c108c8ca38a06f54ac946f77ce4ec920f0c 100644 (file)
@@ -256,6 +256,20 @@ static int wm8994_suspend(struct device *dev)
                break;
        }
 
+       switch (wm8994->type) {
+       case WM1811:
+               ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2);
+               if (ret < 0) {
+                       dev_err(dev, "Failed to read jackdet: %d\n", ret);
+               } else if (ret & WM1811_JACKDET_MODE_MASK) {
+                       dev_dbg(dev, "CODEC still active, ignoring suspend\n");
+                       return 0;
+               }
+               break;
+       default:
+               break;
+       }
+
        /* Disable LDO pulldowns while the device is suspended if we
         * don't know that something will be driving them. */
        if (!wm8994->ldo_ena_always_driven)
index c598ae69b8ff052584c94e75b44db9f07ea8d694..bc0c5096539a5bdbd874ef99babdd60dbf17a0c0 100644 (file)
@@ -806,6 +806,7 @@ static bool wm1811_readable_register(struct device *dev, unsigned int reg)
        case WM8994_DC_SERVO_2:
        case WM8994_DC_SERVO_READBACK:
        case WM8994_DC_SERVO_4:
+       case WM8994_DC_SERVO_4E:
        case WM8994_ANALOGUE_HP_1:
        case WM8958_MIC_DETECT_1:
        case WM8958_MIC_DETECT_2:
index 19fc7c1cb428c47f822254c2d748b7fe572b2da3..f428d86bfc103256ccd48f50436d23d6bd4d48a7 100644 (file)
@@ -984,9 +984,9 @@ static int __init c2port_init(void)
                " - (C) 2007 Rodolfo Giometti\n");
 
        c2port_class = class_create(THIS_MODULE, "c2port");
-       if (!c2port_class) {
+       if (IS_ERR(c2port_class)) {
                printk(KERN_ERR "c2port: failed to allocate class\n");
-               return -ENOMEM;
+               return PTR_ERR(c2port_class);
        }
        c2port_class->dev_attrs = c2port_attrs;
 
index 690255c7d4dcc8c407e7b0852216edab75f4ef31..132378b89d76a0072fe31b7f436975525d04e353 100644 (file)
@@ -2068,6 +2068,9 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
         */
        mmc_hw_reset_for_init(host);
 
+       /* Initialization should be done at 3.3 V I/O voltage. */
+       mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
+
        /*
         * sdio_reset sends CMD52 to reset card.  Since we do not know
         * if the card is being re-initialized, just send it.  CMD52
index 30055f2b0d445b3e0c08ed131f939146fef68626..c3704e293a7b30d52c9cc1893da88a0e4844131b 100644 (file)
@@ -238,10 +238,10 @@ static inline void mmc_host_clk_init(struct mmc_host *host)
        /* Hold MCI clock for 8 cycles by default */
        host->clk_delay = 8;
        /*
-        * Default clock gating delay is 200ms.
+        * Default clock gating delay is 0ms to avoid wasting power.
         * This value can be tuned by writing into sysfs entry.
         */
-       host->clkgate_delay = 200;
+       host->clkgate_delay = 0;
        host->clk_gated = false;
        INIT_DELAYED_WORK(&host->clk_gate_work, mmc_host_clk_gate_work);
        spin_lock_init(&host->clk_lock);
index a48066344fa87316997b0bcca501d0842ea7e8a1..2b9ed1401dc439bf1dd29e4aa751f74e0175bc93 100644 (file)
@@ -816,6 +816,9 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
        if (!mmc_host_is_spi(host))
                mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN);
 
+       /* Initialization should be done at 3.3 V I/O voltage. */
+       mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
+
        /*
         * Since we're changing the OCR value, we seem to
         * need to tell some cards to go back to the idle
index 5017f9354ce28af6a67418d1ce0a2c438ed07edd..c272c6868ecf6d11a39c3cf2be99f1257fccd026 100644 (file)
@@ -911,6 +911,9 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
        BUG_ON(!host);
        WARN_ON(!host->claimed);
 
+       /* The initialization should be done at 3.3 V I/O voltage. */
+       mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
+
        err = mmc_sd_get_cid(host, ocr, cid, &rocr);
        if (err)
                return err;
@@ -1156,11 +1159,6 @@ int mmc_attach_sd(struct mmc_host *host)
        BUG_ON(!host);
        WARN_ON(!host->claimed);
 
-       /* Make sure we are at 3.3V signalling voltage */
-       err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, false);
-       if (err)
-               return err;
-
        /* Disable preset value enable if already set since last time */
        if (host->ops->enable_preset_value) {
                mmc_host_clk_hold(host);
index 12cde6ee17f50732ac5cd05f6843928abf87d0c9..2c7c83f832d289c25eaf83cf4d7ef32d420fb002 100644 (file)
@@ -585,6 +585,9 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
         * Inform the card of the voltage
         */
        if (!powered_resume) {
+               /* The initialization should be done at 3.3 V I/O voltage. */
+               mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
+
                err = mmc_send_io_op_cond(host, host->ocr, &ocr);
                if (err)
                        goto err;
@@ -996,6 +999,11 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
         * With these steps taken, mmc_select_voltage() is also required to
         * restore the correct voltage setting of the card.
         */
+
+       /* The initialization should be done at 3.3 V I/O voltage. */
+       if (!mmc_card_keep_power(host))
+               mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
+
        sdio_reset(host);
        mmc_go_idle(host);
        mmc_send_if_cond(host, host->ocr_avail);
index 6985cdb0bb26e641fb340c0218d331e48844614a..e4449a54ae8f9fc68c3d9f719fe3a09e3e028adf 100644 (file)
@@ -1948,12 +1948,12 @@ static bool atmci_filter(struct dma_chan *chan, void *slave)
        }
 }
 
-static void atmci_configure_dma(struct atmel_mci *host)
+static bool atmci_configure_dma(struct atmel_mci *host)
 {
        struct mci_platform_data        *pdata;
 
        if (host == NULL)
-               return;
+               return false;
 
        pdata = host->pdev->dev.platform_data;
 
@@ -1970,12 +1970,15 @@ static void atmci_configure_dma(struct atmel_mci *host)
                host->dma.chan =
                        dma_request_channel(mask, atmci_filter, pdata->dma_slave);
        }
-       if (!host->dma.chan)
-               dev_notice(&host->pdev->dev, "DMA not available, using PIO\n");
-       else
+       if (!host->dma.chan) {
+               dev_warn(&host->pdev->dev, "no DMA channel available\n");
+               return false;
+       } else {
                dev_info(&host->pdev->dev,
                                        "Using %s for DMA transfers\n",
                                        dma_chan_name(host->dma.chan));
+               return true;
+       }
 }
 
 static inline unsigned int atmci_get_version(struct atmel_mci *host)
@@ -2085,8 +2088,7 @@ static int __init atmci_probe(struct platform_device *pdev)
 
        /* Get MCI capabilities and set operations according to it */
        atmci_get_cap(host);
-       if (host->caps.has_dma) {
-               dev_info(&pdev->dev, "using DMA\n");
+       if (host->caps.has_dma && atmci_configure_dma(host)) {
                host->prepare_data = &atmci_prepare_data_dma;
                host->submit_data = &atmci_submit_data_dma;
                host->stop_transfer = &atmci_stop_transfer_dma;
@@ -2096,15 +2098,12 @@ static int __init atmci_probe(struct platform_device *pdev)
                host->submit_data = &atmci_submit_data_pdc;
                host->stop_transfer = &atmci_stop_transfer_pdc;
        } else {
-               dev_info(&pdev->dev, "no DMA, no PDC\n");
+               dev_info(&pdev->dev, "using PIO\n");
                host->prepare_data = &atmci_prepare_data;
                host->submit_data = &atmci_submit_data;
                host->stop_transfer = &atmci_stop_transfer;
        }
 
-       if (host->caps.has_dma)
-               atmci_configure_dma(host);
-
        platform_set_drvdata(pdev, host);
 
        /* We need at least one slot to succeed */
index 0d955ffaf44e2c3ec5961f966687da3e675819d9..11e589cd8233e5f7438f7240d14c8f7897fbf8d7 100644 (file)
@@ -1271,12 +1271,13 @@ static int __devinit mmci_probe(struct amba_device *dev,
        /*
         * Block size can be up to 2048 bytes, but must be a power of two.
         */
-       mmc->max_blk_size = 2048;
+       mmc->max_blk_size = 1 << 11;
 
        /*
-        * No limit on the number of blocks transferred.
+        * Limit the number of blocks transferred so that we don't overflow
+        * the maximum request size.
         */
-       mmc->max_blk_count = mmc->max_req_size;
+       mmc->max_blk_count = mmc->max_req_size >> 11;
 
        spin_lock_init(&host->lock);
 
index d601e41af282105ad5c3a86d30d569dfef3def8c..0be4e2013632f97ce4dddc489212c2ed6f7c4985 100644 (file)
@@ -269,8 +269,9 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg)
                imx_data->scratchpad = val;
                return;
        case SDHCI_COMMAND:
-               if ((host->cmd->opcode == MMC_STOP_TRANSMISSION)
-                       && (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT))
+               if ((host->cmd->opcode == MMC_STOP_TRANSMISSION ||
+                    host->cmd->opcode == MMC_SET_BLOCK_COUNT) &&
+                   (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT))
                        val |= SDHCI_CMD_ABORTCMD;
 
                if (is_imx6q_usdhc(imx_data)) {
index 0a4fc62a381dfb80652220e896f973e1618a5901..c998e1afebc6831be282088a379d98ee8978c491 100644 (file)
@@ -978,7 +978,7 @@ static void cfhsi_setup(struct net_device *dev)
        dev->netdev_ops = &cfhsi_ops;
        dev->type = ARPHRD_CAIF;
        dev->flags = IFF_POINTOPOINT | IFF_NOARP;
-       dev->mtu = CFHSI_MAX_PAYLOAD_SZ;
+       dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ;
        dev->tx_queue_len = 0;
        dev->destructor = free_netdev;
        skb_queue_head_init(&cfhsi->qhead);
index 04a3f1b756a8ad78f24c887959e6a51b1cb4d778..192b0d118df46d4136c5bd5bab872f35d51bcbc7 100644 (file)
@@ -95,11 +95,16 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val)
        spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
 }
 
+static int sja1000_is_absent(struct sja1000_priv *priv)
+{
+       return (priv->read_reg(priv, REG_MOD) == 0xFF);
+}
+
 static int sja1000_probe_chip(struct net_device *dev)
 {
        struct sja1000_priv *priv = netdev_priv(dev);
 
-       if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) {
+       if (priv->reg_base && sja1000_is_absent(priv)) {
                printk(KERN_INFO "%s: probing @0x%lX failed\n",
                       DRV_NAME, dev->base_addr);
                return 0;
@@ -493,6 +498,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
        while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
                n++;
                status = priv->read_reg(priv, REG_SR);
+               /* check for absent controller due to hw unplug */
+               if (status == 0xFF && sja1000_is_absent(priv))
+                       return IRQ_NONE;
 
                if (isrc & IRQ_WUI)
                        dev_warn(dev->dev.parent, "wakeup interrupt\n");
@@ -509,6 +517,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
                        while (status & SR_RBS) {
                                sja1000_rx(dev);
                                status = priv->read_reg(priv, REG_SR);
+                               /* check for absent controller */
+                               if (status == 0xFF && sja1000_is_absent(priv))
+                                       return IRQ_NONE;
                        }
                }
                if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
index 8153a3e0a1a4457a5c156508d7c605362bc76e37..f9b74c0a84926eb0cfb93dea482719a4be797202 100644 (file)
@@ -1842,7 +1842,7 @@ vortex_timer(unsigned long data)
                ok = 1;
        }
 
-       if (!netif_carrier_ok(dev))
+       if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev))
                next_tick = 5*HZ;
 
        if (vp->medialock)
index b8591246eb4c35b9a12b53254ba4853381238ee7..1ff3c6df35a21a5f03b66b8316839466a3655e31 100644 (file)
@@ -2244,10 +2244,6 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb,
                        dev_info(&adapter->pdev->dev, "tx locked\n");
                return NETDEV_TX_LOCKED;
        }
-       if (skb->mark == 0x01)
-               type = atl1c_trans_high;
-       else
-               type = atl1c_trans_normal;
 
        if (atl1c_tpd_avail(adapter, type) < tpd_req) {
                /* no enough descriptor, just stop queue */
index 3fb66d09ece59e463c81eb20b77ba7cfa7df9fd0..cab87456a34a33a54a328d48fefd9086eb936b6d 100644 (file)
@@ -2339,7 +2339,7 @@ static inline int __init b44_pci_init(void)
        return err;
 }
 
-static inline void __exit b44_pci_exit(void)
+static inline void b44_pci_exit(void)
 {
 #ifdef CONFIG_B44_PCI
        ssb_pcihost_unregister(&b44_pci_driver);
index 986019b2c8490726f74ad31770aeece308117168..c7ca7ec065eeea7dfe164f96384ec3aaf464809d 100644 (file)
@@ -797,7 +797,7 @@ static int bcm_enet_open(struct net_device *dev)
        if (priv->has_phy) {
                /* connect to PHY */
                snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
-                        priv->mac_id ? "1" : "0", priv->phy_id);
+                        priv->mii_bus->id, priv->phy_id);
 
                phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0,
                                     PHY_INTERFACE_MODE_MII);
index 1e3f978ee6daffea0107268f77c3a1eec0ee664b..254521319150e5cb74541a3973434497900dc8d5 100644 (file)
@@ -117,10 +117,6 @@ static int dropless_fc;
 module_param(dropless_fc, int, 0);
 MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring");
 
-static int poll;
-module_param(poll, int, 0);
-MODULE_PARM_DESC(poll, " Use polling (for debug)");
-
 static int mrrs = -1;
 module_param(mrrs, int, 0);
 MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)");
@@ -4834,20 +4830,11 @@ void bnx2x_drv_pulse(struct bnx2x *bp)
 
 static void bnx2x_timer(unsigned long data)
 {
-       u8 cos;
        struct bnx2x *bp = (struct bnx2x *) data;
 
        if (!netif_running(bp->dev))
                return;
 
-       if (poll) {
-               struct bnx2x_fastpath *fp = &bp->fp[0];
-
-               for_each_cos_in_tx_queue(fp, cos)
-                       bnx2x_tx_int(bp, &fp->txdata[cos]);
-               bnx2x_rx_int(fp, 1000);
-       }
-
        if (!BP_NOMCP(bp)) {
                int mb_idx = BP_FW_MB_IDX(bp);
                u32 drv_pulse;
@@ -10063,7 +10050,6 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp)
 static int __devinit bnx2x_init_bp(struct bnx2x *bp)
 {
        int func;
-       int timer_interval;
        int rc;
 
        mutex_init(&bp->port.phy_mutex);
@@ -10139,8 +10125,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
        bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR;
        bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR;
 
-       timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ);
-       bp->current_interval = (poll ? poll : timer_interval);
+       bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ;
 
        init_timer(&bp->timer);
        bp->timer.expires = jiffies + bp->current_interval;
index bc0121ac291e249f0f21876dc01127fc46c256d4..1adef266fcd50252deb5f8684d6708656a577765 100644 (file)
@@ -1081,17 +1081,17 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
               estats->rx_stat_ifhcinbadoctets_lo);
 
        ADD_64(fstats->total_bytes_received_hi,
-              tfunc->rcv_error_bytes.hi,
+              le32_to_cpu(tfunc->rcv_error_bytes.hi),
               fstats->total_bytes_received_lo,
-              tfunc->rcv_error_bytes.lo);
+              le32_to_cpu(tfunc->rcv_error_bytes.lo));
 
        memcpy(estats, &(fstats->total_bytes_received_hi),
               sizeof(struct host_func_stats) - 2*sizeof(u32));
 
        ADD_64(estats->error_bytes_received_hi,
-              tfunc->rcv_error_bytes.hi,
+              le32_to_cpu(tfunc->rcv_error_bytes.hi),
               estats->error_bytes_received_lo,
-              tfunc->rcv_error_bytes.lo);
+              le32_to_cpu(tfunc->rcv_error_bytes.lo));
 
        ADD_64(estats->etherstatsoverrsizepkts_hi,
               estats->rx_stat_dot3statsframestoolong_hi,
index dd3a0a232ea068a2970dec4054ad759ce6950704..818a573669e6b0b4cdd27fda3ca111ff6c133931 100644 (file)
@@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr,
                fl6.flowi6_oif = dst_addr->sin6_scope_id;
 
        *dst = ip6_route_output(&init_net, NULL, &fl6);
-       if (*dst)
+       if ((*dst)->error) {
+               dst_release(*dst);
+               *dst = NULL;
+               return -ENETUNREACH;
+       } else
                return 0;
 #endif
 
index a1f2e0fed78bc2b23b7caa2c1457255e6eae9b89..35c2a202d67aa643a452e245293d5e7fdd748e39 100644 (file)
@@ -5352,7 +5352,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
                }
        }
 
-       netdev_completed_queue(tp->dev, pkts_compl, bytes_compl);
+       netdev_tx_completed_queue(txq, pkts_compl, bytes_compl);
 
        tnapi->tx_cons = sw_idx;
 
@@ -6793,7 +6793,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        skb_tx_timestamp(skb);
-       netdev_sent_queue(tp->dev, skb->len);
+       netdev_tx_sent_queue(txq, skb->len);
 
        /* Packets are ready, update Tx producer idx local and on card. */
        tw32_tx_mbox(tnapi->prodmbox, entry);
@@ -7275,8 +7275,8 @@ static void tg3_free_rings(struct tg3 *tp)
 
                        dev_kfree_skb_any(skb);
                }
+               netdev_tx_reset_queue(netdev_get_tx_queue(tp->dev, j));
        }
-       netdev_reset_queue(tp->dev);
 }
 
 /* Initialize tx/rx rings for packet processing.
@@ -7886,10 +7886,8 @@ static int tg3_chip_reset(struct tg3 *tp)
        return 0;
 }
 
-static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *,
-                                                struct rtnl_link_stats64 *);
-static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *,
-                                               struct tg3_ethtool_stats *);
+static void tg3_get_nstats(struct tg3 *, struct rtnl_link_stats64 *);
+static void tg3_get_estats(struct tg3 *, struct tg3_ethtool_stats *);
 
 /* tp->lock is held. */
 static int tg3_halt(struct tg3 *tp, int kind, int silent)
@@ -7910,7 +7908,7 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent)
 
        if (tp->hw_stats) {
                /* Save the stats across chip resets... */
-               tg3_get_stats64(tp->dev, &tp->net_stats_prev),
+               tg3_get_nstats(tp, &tp->net_stats_prev),
                tg3_get_estats(tp, &tp->estats_prev);
 
                /* And make sure the next sample is new data */
@@ -9847,7 +9845,7 @@ static inline u64 get_stat64(tg3_stat64_t *val)
        return ((u64)val->high << 32) | ((u64)val->low);
 }
 
-static u64 calc_crc_errors(struct tg3 *tp)
+static u64 tg3_calc_crc_errors(struct tg3 *tp)
 {
        struct tg3_hw_stats *hw_stats = tp->hw_stats;
 
@@ -9856,14 +9854,12 @@ static u64 calc_crc_errors(struct tg3 *tp)
             GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) {
                u32 val;
 
-               spin_lock_bh(&tp->lock);
                if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) {
                        tg3_writephy(tp, MII_TG3_TEST1,
                                     val | MII_TG3_TEST1_CRC_EN);
                        tg3_readphy(tp, MII_TG3_RXR_COUNTERS, &val);
                } else
                        val = 0;
-               spin_unlock_bh(&tp->lock);
 
                tp->phy_crc_errors += val;
 
@@ -9877,14 +9873,13 @@ static u64 calc_crc_errors(struct tg3 *tp)
        estats->member =        old_estats->member + \
                                get_stat64(&hw_stats->member)
 
-static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp,
-                                              struct tg3_ethtool_stats *estats)
+static void tg3_get_estats(struct tg3 *tp, struct tg3_ethtool_stats *estats)
 {
        struct tg3_ethtool_stats *old_estats = &tp->estats_prev;
        struct tg3_hw_stats *hw_stats = tp->hw_stats;
 
        if (!hw_stats)
-               return old_estats;
+               return;
 
        ESTAT_ADD(rx_octets);
        ESTAT_ADD(rx_fragments);
@@ -9963,20 +9958,13 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *tp,
        ESTAT_ADD(nic_tx_threshold_hit);
 
        ESTAT_ADD(mbuf_lwm_thresh_hit);
-
-       return estats;
 }
 
-static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
-                                                struct rtnl_link_stats64 *stats)
+static void tg3_get_nstats(struct tg3 *tp, struct rtnl_link_stats64 *stats)
 {
-       struct tg3 *tp = netdev_priv(dev);
        struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev;
        struct tg3_hw_stats *hw_stats = tp->hw_stats;
 
-       if (!hw_stats)
-               return old_stats;
-
        stats->rx_packets = old_stats->rx_packets +
                get_stat64(&hw_stats->rx_ucast_packets) +
                get_stat64(&hw_stats->rx_mcast_packets) +
@@ -10019,15 +10007,13 @@ static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
                get_stat64(&hw_stats->tx_carrier_sense_errors);
 
        stats->rx_crc_errors = old_stats->rx_crc_errors +
-               calc_crc_errors(tp);
+               tg3_calc_crc_errors(tp);
 
        stats->rx_missed_errors = old_stats->rx_missed_errors +
                get_stat64(&hw_stats->rx_discards);
 
        stats->rx_dropped = tp->rx_dropped;
        stats->tx_dropped = tp->tx_dropped;
-
-       return stats;
 }
 
 static inline u32 calc_crc(unsigned char *buf, int len)
@@ -15409,6 +15395,21 @@ static void __devinit tg3_init_coal(struct tg3 *tp)
        }
 }
 
+static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev,
+                                               struct rtnl_link_stats64 *stats)
+{
+       struct tg3 *tp = netdev_priv(dev);
+
+       if (!tp->hw_stats)
+               return &tp->net_stats_prev;
+
+       spin_lock_bh(&tp->lock);
+       tg3_get_nstats(tp, stats);
+       spin_unlock_bh(&tp->lock);
+
+       return stats;
+}
+
 static const struct net_device_ops tg3_netdev_ops = {
        .ndo_open               = tg3_open,
        .ndo_stop               = tg3_close,
index e83d12c7bf20cde0b1c2becba254329b0955b2aa..9d76e59d9526164ca9cfc247769315d04b8c4fca 100644 (file)
@@ -196,6 +196,8 @@ static DEFINE_PCI_DEVICE_TABLE(cxgb4_pci_tbl) = {
        CH_DEVICE(0x4408, 4),
        CH_DEVICE(0x4409, 4),
        CH_DEVICE(0x440a, 4),
+       CH_DEVICE(0x440d, 4),
+       CH_DEVICE(0x440e, 4),
        { 0, }
 };
 
index e53365a71484baabc0f9251ef100eea7f12f027d..d963c1d57f71590afef3aabc94b81a686c8ed061 100644 (file)
@@ -2892,6 +2892,8 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = {
        CH_DEVICE(0x4808, 0),   /* T420-cx */
        CH_DEVICE(0x4809, 0),   /* T420-bt */
        CH_DEVICE(0x480a, 0),   /* T404-bt */
+       CH_DEVICE(0x480d, 0),   /* T480-cr */
+       CH_DEVICE(0x480e, 0),   /* T440-lp-cr */
        { 0, }
 };
 
index c2c0680a1146793c2bf4393dbd746835f6395aa9..ac37cacc6136723e132eb872adf88c46801de17f 100644 (file)
@@ -157,7 +157,7 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc,
                        CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0;
                *fcoe_enc_error = (desc->flags &
                        CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0;
-               *fcoe_eof = (u8)((desc->checksum_fcoe >>
+               *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >>
                        CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) &
                        CQ_ENET_RQ_DESC_FCOE_EOF_MASK);
                *checksum = 0;
index ee93a2087fe6c0cfd116dcf3f4536185480ba362..c52295cd05ef009b368555e8b716bc082ad6caf5 100644 (file)
@@ -94,7 +94,7 @@ struct enic {
        u32 rx_coalesce_usecs;
        u32 tx_coalesce_usecs;
 #ifdef CONFIG_PCI_IOV
-       u32 num_vfs;
+       u16 num_vfs;
 #endif
        struct enic_port_profile *pp;
 
index ab3f67f980d8c3f7554d19bf3fdbaf275deefed3..0e4edd3b6bee0275cf3ca0c01ffd1f1f60ec9d49 100644 (file)
@@ -2370,7 +2370,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
        if (pos) {
                pci_read_config_word(pdev, pos + PCI_SRIOV_TOTAL_VF,
-                       (u16 *)&enic->num_vfs);
+                       &enic->num_vfs);
                if (enic->num_vfs) {
                        err = pci_enable_sriov(pdev, enic->num_vfs);
                        if (err) {
index 22bf03a1829e190e66928da74d52f5392c11772f..c347b6236f8fb90f0169e70e293fb2b8ce0ccc39 100644 (file)
@@ -72,7 +72,7 @@ static int enic_set_port_profile(struct enic *enic, int vf)
        struct enic_port_profile *pp;
        struct vic_provinfo *vp;
        const u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
-       const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX);
+       const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX);
        char uuid_str[38];
        char client_mac_str[18];
        u8 *client_mac;
index 1c7aad8fa19c80cbdbe5a61fdd2c677f555f559f..e92ef1bd732a4fe9cf4f0ad8569117bb711eea31 100644 (file)
@@ -986,7 +986,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
                printk(KERN_INFO
                        "%s: no PHY, assuming direct connection to switch\n",
                        ndev->name);
-               strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE);
+               strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
                phy_id = 0;
        }
 
index 27d651a80f3f32f6458645ad2fc6a778537a859c..55cbf65512c3bafb4780f6166e6d05ba5f314603 100644 (file)
@@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu)
                ((new_mtu) < IPV6_MIN_MTU))
                return -EINVAL;
 
-       if (new_mtu > 4000) {
-               jme->reg_rxcs &= ~RXCS_FIFOTHNP;
-               jme->reg_rxcs |= RXCS_FIFOTHNP_64QW;
-               jme_restart_rx_engine(jme);
-       } else {
-               jme->reg_rxcs &= ~RXCS_FIFOTHNP;
-               jme->reg_rxcs |= RXCS_FIFOTHNP_128QW;
-               jme_restart_rx_engine(jme);
-       }
 
        netdev->mtu = new_mtu;
        netdev_update_features(netdev);
 
+       jme_restart_rx_engine(jme);
        jme_reset_link(jme);
 
        return 0;
index 4304072bd3c536e852a38cf6c37716df8500ed66..3efc897c991310c637353aaed01c9516575a02d9 100644 (file)
@@ -730,7 +730,7 @@ enum jme_rxcs_values {
        RXCS_RETRYCNT_60        = 0x00000F00,
 
        RXCS_DEFAULT            = RXCS_FIFOTHTP_128T |
-                                 RXCS_FIFOTHNP_128QW |
+                                 RXCS_FIFOTHNP_16QW |
                                  RXCS_DMAREQSZ_128B |
                                  RXCS_RETRYGAP_256ns |
                                  RXCS_RETRYCNT_32,
index 55d7bd4e210aadd6ffa0cb5dd81f012a0b71a498..9129ace02560adaf07c1f92b1164a7c9f79b881a 100644 (file)
@@ -815,8 +815,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
        int err;
        int i;
 
-       priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map,
-                                        mlx4_num_eq_uar(dev), GFP_KERNEL);
+       priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev),
+                                        sizeof *priv->eq_table.uar_map,
+                                        GFP_KERNEL);
        if (!priv->eq_table.uar_map) {
                err = -ENOMEM;
                goto err_out_free;
@@ -1035,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
        struct mlx4_priv *priv = mlx4_priv(dev);
        int vec = 0, err = 0, i;
 
-       spin_lock(&priv->msix_ctl.pool_lock);
+       mutex_lock(&priv->msix_ctl.pool_lock);
        for (i = 0; !vec && i < dev->caps.comp_pool; i++) {
                if (~priv->msix_ctl.pool_bm & 1ULL << i) {
                        priv->msix_ctl.pool_bm |= 1ULL << i;
@@ -1057,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
                        eq_set_ci(&priv->eq_table.eq[vec], 1);
                }
        }
-       spin_unlock(&priv->msix_ctl.pool_lock);
+       mutex_unlock(&priv->msix_ctl.pool_lock);
 
        if (vec) {
                *vector = vec;
@@ -1078,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec)
        if (likely(i >= 0)) {
                /*sanity check , making sure were not trying to free irq's
                  Belonging to a legacy EQ*/
-               spin_lock(&priv->msix_ctl.pool_lock);
+               mutex_lock(&priv->msix_ctl.pool_lock);
                if (priv->msix_ctl.pool_bm & 1ULL << i) {
                        free_irq(priv->eq_table.eq[vec].irq,
                                 &priv->eq_table.eq[vec]);
                        priv->msix_ctl.pool_bm &= ~(1ULL << i);
                }
-               spin_unlock(&priv->msix_ctl.pool_lock);
+               mutex_unlock(&priv->msix_ctl.pool_lock);
        }
 
 }
index 8a21e10952ea23260ad503cee702ed31437ff1e1..9ea7cabcaf3c8839d86f96a9ee4ad68c102caf66 100644 (file)
@@ -685,7 +685,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
        return err;
 }
 
-static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port)
+int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port)
 {
        struct mlx4_cmd_mailbox *outbox = ptr;
 
index 678558b502fc31e506633e0713805f58c8676108..d498f049c74ecfa6578f02f1257e1063291bbe0d 100644 (file)
@@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev,
        for (port = 0; port <  dev->caps.num_ports; port++) {
                /* Change the port type only if the new type is different
                 * from the current, and not set to Auto */
-               if (port_types[port] != dev->caps.port_type[port + 1]) {
+               if (port_types[port] != dev->caps.port_type[port + 1])
                        change = 1;
-                       dev->caps.port_type[port + 1] = port_types[port];
-               }
        }
        if (change) {
                mlx4_unregister_device(dev);
                for (port = 1; port <= dev->caps.num_ports; port++) {
                        mlx4_CLOSE_PORT(dev, port);
+                       dev->caps.port_type[port] = port_types[port - 1];
                        err = mlx4_SET_PORT(dev, port);
                        if (err) {
                                mlx4_err(dev, "Failed to set port %d, "
@@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev)
        resource_size_t bf_len;
        int err = 0;
 
+       if (!dev->caps.bf_reg_size)
+               return -ENXIO;
+
        bf_start = pci_resource_start(dev->pdev, 2) +
                        (dev->caps.num_uars << PAGE_SHIFT);
        bf_len = pci_resource_len(dev->pdev, 2) -
@@ -1825,7 +1827,7 @@ slave_start:
                goto err_master_mfunc;
 
        priv->msix_ctl.pool_bm = 0;
-       spin_lock_init(&priv->msix_ctl.pool_lock);
+       mutex_init(&priv->msix_ctl.pool_lock);
 
        mlx4_enable_msi_x(dev);
        if ((mlx4_is_mfunc(dev)) &&
index c92269f8c0570a5b7e6d374beb7ffb9f48e79877..28f8251561f4a24d67697f538d4e25834aeaa5d6 100644 (file)
@@ -697,7 +697,7 @@ struct mlx4_sense {
 
 struct mlx4_msix_ctl {
        u64             pool_bm;
-       spinlock_t      pool_lock;
+       struct mutex    pool_lock;
 };
 
 struct mlx4_steer {
index 8deeef98280c9a31358c9c0f8343c32f3d78329f..25a80d71fb2ab476df010be63a6f597f0b917319 100644 (file)
@@ -304,7 +304,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
                            MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED);
 }
 
-static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
+int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
                          u32 *base_mridx)
 {
        struct mlx4_priv *priv = mlx4_priv(dev);
@@ -320,14 +320,14 @@ static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
 }
 EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range);
 
-static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt)
+void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt)
 {
        struct mlx4_priv *priv = mlx4_priv(dev);
        mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt);
 }
 EXPORT_SYMBOL_GPL(mlx4_mr_release_range);
 
-static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd,
+int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd,
                           u64 iova, u64 size, u32 access, int npages,
                           int page_shift, struct mlx4_mr *mr)
 {
@@ -457,7 +457,7 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access,
 }
 EXPORT_SYMBOL_GPL(mlx4_mr_alloc);
 
-static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr)
+void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr)
 {
        int err;
 
@@ -852,7 +852,7 @@ err_free:
 }
 EXPORT_SYMBOL_GPL(mlx4_fmr_alloc);
 
-static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx,
+int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx,
                            u32 pd, u32 access, int max_pages,
                            int max_maps, u8 page_shift, struct mlx4_fmr *fmr)
 {
@@ -954,7 +954,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
 }
 EXPORT_SYMBOL_GPL(mlx4_fmr_free);
 
-static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
+int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
 {
        if (fmr->maps)
                return -EBUSY;
index 738f950a1ce59e69c6297517882913d90f22f784..fb2b36759cbf657d66dfa7c245d49306d5a06c58 100644 (file)
@@ -151,11 +151,6 @@ static int __mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
                context->log_page_size   = mtt->page_shift - MLX4_ICM_PAGE_SHIFT;
        }
 
-       port = ((context->pri_path.sched_queue >> 6) & 1) + 1;
-       if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH)
-               context->pri_path.sched_queue = (context->pri_path.sched_queue &
-                                               0xc3);
-
        *(__be32 *) mailbox->buf = cpu_to_be32(optpar);
        memcpy(mailbox->buf + 8, context, sizeof *context);
 
index dcd819bfb2f05968d1d567bc36d43938c2a4fc91..bfdb7af19e496285bdeff3ada8a302b71e746865 100644 (file)
@@ -73,6 +73,7 @@ struct res_gid {
        struct list_head        list;
        u8                      gid[16];
        enum mlx4_protocol      prot;
+       enum mlx4_steer_type    steer;
 };
 
 enum res_qp_states {
@@ -374,6 +375,7 @@ static struct res_common *alloc_qp_tr(int id)
 
        ret->com.res_id = id;
        ret->com.state = RES_QP_RESERVED;
+       ret->local_qpn = id;
        INIT_LIST_HEAD(&ret->mcg_list);
        spin_lock_init(&ret->mcg_spl);
 
@@ -2479,7 +2481,8 @@ static struct res_gid *find_gid(struct mlx4_dev *dev, int slave,
 }
 
 static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
-                      u8 *gid, enum mlx4_protocol prot)
+                      u8 *gid, enum mlx4_protocol prot,
+                      enum mlx4_steer_type steer)
 {
        struct res_gid *res;
        int err;
@@ -2495,6 +2498,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
        } else {
                memcpy(res->gid, gid, 16);
                res->prot = prot;
+               res->steer = steer;
                list_add_tail(&res->list, &rqp->mcg_list);
                err = 0;
        }
@@ -2504,14 +2508,15 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
 }
 
 static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
-                      u8 *gid, enum mlx4_protocol prot)
+                      u8 *gid, enum mlx4_protocol prot,
+                      enum mlx4_steer_type steer)
 {
        struct res_gid *res;
        int err;
 
        spin_lock_irq(&rqp->mcg_spl);
        res = find_gid(dev, slave, rqp, gid);
-       if (!res || res->prot != prot)
+       if (!res || res->prot != prot || res->steer != steer)
                err = -EINVAL;
        else {
                list_del(&res->list);
@@ -2538,7 +2543,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
        int attach = vhcr->op_modifier;
        int block_loopback = vhcr->in_modifier >> 31;
        u8 steer_type_mask = 2;
-       enum mlx4_steer_type type = gid[7] & steer_type_mask;
+       enum mlx4_steer_type type = (gid[7] & steer_type_mask) >> 1;
 
        qpn = vhcr->in_modifier & 0xffffff;
        err = get_res(dev, slave, qpn, RES_QP, &rqp);
@@ -2547,7 +2552,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
 
        qp.qpn = qpn;
        if (attach) {
-               err = add_mcg_res(dev, slave, rqp, gid, prot);
+               err = add_mcg_res(dev, slave, rqp, gid, prot, type);
                if (err)
                        goto ex_put;
 
@@ -2556,7 +2561,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
                if (err)
                        goto ex_rem;
        } else {
-               err = rem_mcg_res(dev, slave, rqp, gid, prot);
+               err = rem_mcg_res(dev, slave, rqp, gid, prot, type);
                if (err)
                        goto ex_put;
                err = mlx4_qp_detach_common(dev, &qp, gid, prot, type);
@@ -2567,7 +2572,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
 
 ex_rem:
        /* ignore error return below, already in error */
-       err1 = rem_mcg_res(dev, slave, rqp, gid, prot);
+       err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type);
 ex_put:
        put_res(dev, slave, qpn, RES_QP);
 
@@ -2606,7 +2611,7 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
        list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
                qp.qpn = rqp->local_qpn;
                err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
-                                           MLX4_MC_STEER);
+                                           rgid->steer);
                list_del(&rgid->list);
                kfree(rgid);
        }
index 6b35e7da9a9c7a094f27ff725787865b7bd034e6..0c3e4005224d446d181c2656c3a04a95fceded28 100644 (file)
@@ -583,7 +583,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
                                        ks8851_dbg_dumpkkt(ks, rxpkt);
 
                                skb->protocol = eth_type_trans(skb, ks->netdev);
-                               netif_rx(skb);
+                               netif_rx_ni(skb);
 
                                ks->netdev->stats.rx_packets++;
                                ks->netdev->stats.rx_bytes += rxlen;
index e58e78e5c930048d0dccf4202478b7da4d227b91..2784bc706f1e2cd4cca9ed6289f09105ece35bf3 100644 (file)
@@ -394,7 +394,6 @@ union ks_tx_hdr {
  * @msg_enable : The message flags controlling driver output (see ethtool).
  * @frame_cnt          : number of frames received.
  * @bus_width          : i/o bus width.
- * @irq        : irq number assigned to this device.
  * @rc_rxqcr   : Cached copy of KS_RXQCR.
  * @rc_txcr    : Cached copy of KS_TXCR.
  * @rc_ier     : Cached copy of KS_IER.
@@ -441,7 +440,6 @@ struct ks_net {
        u32                     msg_enable;
        u32                     frame_cnt;
        int                     bus_width;
-       int                     irq;
 
        u16                     rc_rxqcr;
        u16                     rc_txcr;
@@ -907,10 +905,10 @@ static int ks_net_open(struct net_device *netdev)
        netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__);
 
        /* reset the HW */
-       err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
+       err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
 
        if (err) {
-               pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err);
+               pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err);
                return err;
        }
 
@@ -955,7 +953,7 @@ static int ks_net_stop(struct net_device *netdev)
 
        /* set powermode to soft power down to save power */
        ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
-       free_irq(ks->irq, netdev);
+       free_irq(netdev->irq, netdev);
        mutex_unlock(&ks->lock);
        return 0;
 }
@@ -1545,10 +1543,10 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
        if (!ks->hw_addr_cmd)
                goto err_ioremap1;
 
-       ks->irq = platform_get_irq(pdev, 0);
+       netdev->irq = platform_get_irq(pdev, 0);
 
-       if (ks->irq < 0) {
-               err = ks->irq;
+       if ((int)netdev->irq < 0) {
+               err = netdev->irq;
                goto err_get_irq;
        }
 
index 212f43b308a3c27ed411b21768e160e0d899a571..cd827ff4a021f74284574f75cc27de97b4c3e7fe 100644 (file)
@@ -670,7 +670,7 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev)
 static int octeon_mgmt_init_phy(struct net_device *netdev)
 {
        struct octeon_mgmt *p = netdev_priv(netdev);
-       char phy_id[20];
+       char phy_id[MII_BUS_ID_SIZE + 3];
 
        if (octeon_is_simulation()) {
                /* No PHYs in the simulator. */
@@ -678,7 +678,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
                return 0;
        }
 
-       snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port);
+       snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port);
 
        p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0,
                                PHY_INTERFACE_MODE_MII);
index 9cb5f912e4891f5b832bb941bce6916c5248bdb6..29e23bec809c495104b08d009943ba2b10155660 100644 (file)
@@ -321,10 +321,10 @@ static void pch_gbe_check_copper_options(struct pch_gbe_adapter *adapter)
                        pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n");
                        hw->phy.autoneg_advertised = opt.def;
                } else {
-                       hw->phy.autoneg_advertised = AutoNeg;
-                       pch_gbe_validate_option(
-                               (int *)(&hw->phy.autoneg_advertised),
-                               &opt, adapter);
+                       int tmp = AutoNeg;
+
+                       pch_gbe_validate_option(&tmp, &opt, adapter);
+                       hw->phy.autoneg_advertised = tmp;
                }
        }
 
@@ -495,9 +495,10 @@ void pch_gbe_check_options(struct pch_gbe_adapter *adapter)
                        .arg  = { .l = { .nr = (int)ARRAY_SIZE(fc_list),
                                         .p = fc_list } }
                };
-               hw->mac.fc = FlowControl;
-               pch_gbe_validate_option((int *)(&hw->mac.fc),
-                                               &opt, adapter);
+               int tmp = FlowControl;
+
+               pch_gbe_validate_option(&tmp, &opt, adapter);
+               hw->mac.fc = tmp;
        }
 
        pch_gbe_check_copper_options(adapter);
index b97132d9dff0c09fdd804ad63335e10a8225343d..8f29feb35548273c56d6ea2247031214eb820a22 100644 (file)
@@ -4,6 +4,7 @@
 
 config NET_PACKET_ENGINE
        bool "Packet Engine devices"
+       default y
        depends on PCI
        ---help---
          If you have a network (Ethernet) card belonging to this class, say Y
index 7931531c3a40be12f1d4f838fd854878c16b9470..e61560e16385e855164a2062aa56ae254212721d 100644 (file)
@@ -3017,7 +3017,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
                (void __iomem *)port_regs;
        u32 delay = 10;
        int status = 0;
-       unsigned long hw_flags = 0;
 
        if (ql_mii_setup(qdev))
                return -1;
@@ -3228,9 +3227,9 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
                value = ql_read_page0_reg(qdev, &port_regs->portStatus);
                if (value & PORT_STATUS_IC)
                        break;
-               spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
+               spin_unlock_irq(&qdev->hw_lock);
                msleep(500);
-               spin_lock_irqsave(&qdev->hw_lock, hw_flags);
+               spin_lock_irq(&qdev->hw_lock);
        } while (--delay);
 
        if (delay == 0) {
index 7a0c800b50adc90051ed008548a754f1af6b5695..bbacb3741ec029e3c4fbc9f74c616955f56e4fc8 100644 (file)
@@ -3781,12 +3781,20 @@ static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)
 
 static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)
 {
+       void __iomem *ioaddr = tp->mmio_addr;
+
+       RTL_W8(Cfg9346, Cfg9346_Unlock);
        rtl_generic_op(tp, tp->jumbo_ops.enable);
+       RTL_W8(Cfg9346, Cfg9346_Lock);
 }
 
 static void rtl_hw_jumbo_disable(struct rtl8169_private *tp)
 {
+       void __iomem *ioaddr = tp->mmio_addr;
+
+       RTL_W8(Cfg9346, Cfg9346_Unlock);
        rtl_generic_op(tp, tp->jumbo_ops.disable);
+       RTL_W8(Cfg9346, Cfg9346_Lock);
 }
 
 static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp)
@@ -6186,6 +6194,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rtl8169_private *tp = netdev_priv(dev);
+       struct device *d = &pdev->dev;
+
+       pm_runtime_get_sync(d);
 
        rtl8169_net_suspend(dev);
 
@@ -6207,6 +6218,8 @@ static void rtl_shutdown(struct pci_dev *pdev)
                pci_wake_from_d3(pdev, true);
                pci_set_power_state(pdev, PCI_D3hot);
        }
+
+       pm_runtime_put_noidle(d);
 }
 
 static struct pci_driver rtl8169_pci_driver = {
index aca349861767fb793b5ba2251f88e87a743fe70c..fc52fca7419338676a8810a6dd97d8b0c137a39a 100644 (file)
@@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue)
                if (unlikely(!skb))
                        return -ENOMEM;
 
-               /* Adjust the SKB for padding and checksum */
+               /* Adjust the SKB for padding */
                skb_reserve(skb, NET_IP_ALIGN);
                rx_buf->len = skb_len - NET_IP_ALIGN;
                rx_buf->is_page = false;
-               skb->ip_summed = CHECKSUM_UNNECESSARY;
 
                rx_buf->dma_addr = pci_map_single(efx->pci_dev,
                                                  skb->data, rx_buf->len,
@@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel,
 
                EFX_BUG_ON_PARANOID(!checksummed);
                rx_buf->u.skb = NULL;
+               skb->ip_summed = CHECKSUM_UNNECESSARY;
 
                gro_result = napi_gro_receive(napi, skb);
        }
index d0b814ef0675396d56a1c5771f87ebe37689c09e..0319d640f72839cd47ad331718bc2ed2c6972539 100644 (file)
@@ -67,6 +67,7 @@ struct stmmac_extra_stats {
        unsigned long ipc_csum_error;
        unsigned long rx_collision;
        unsigned long rx_crc;
+       unsigned long dribbling_bit;
        unsigned long rx_length;
        unsigned long rx_mii;
        unsigned long rx_multicast;
index d87976364ec5a6a7a3bb1c4017917134abd1e74d..ad1b627f8ec2fe83607b6ef489f668825be645df 100644 (file)
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
 
        if (unlikely(p->des01.erx.dribbling)) {
                CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n");
-               ret = discard_frame;
+               x->dribbling_bit++;
        }
        if (unlikely(p->des01.erx.sa_filter_fail)) {
                CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
index fda5d2b31d3ac5b139e9f5f2caf3b0c7d09123bb..25953bb45a736acdd517859b98c52850715765b8 100644 (file)
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
                ret = discard_frame;
        }
        if (unlikely(p->des01.rx.dribbling))
-               ret = discard_frame;
+               x->dribbling_bit++;
 
        if (unlikely(p->des01.rx.length_error)) {
                x->rx_length++;
index 120740020e2ca4c68d304629bf5652dd7913ff0b..b4b095fdcf2964f87bdb433b223b940dcb683687 100644 (file)
@@ -21,7 +21,7 @@
 *******************************************************************************/
 
 #define STMMAC_RESOURCE_NAME   "stmmaceth"
-#define DRV_MODULE_VERSION     "Dec_2011"
+#define DRV_MODULE_VERSION     "Feb_2012"
 #include <linux/stmmac.h>
 #include <linux/phy.h>
 #include "common.h"
@@ -97,4 +97,5 @@ int stmmac_resume(struct net_device *ndev);
 int stmmac_suspend(struct net_device *ndev);
 int stmmac_dvr_remove(struct net_device *ndev);
 struct stmmac_priv *stmmac_dvr_probe(struct device *device,
-                               struct plat_stmmacenet_data *plat_dat);
+                                    struct plat_stmmacenet_data *plat_dat,
+                                    void __iomem *addr);
index 9573303a706b6ce882fac870ac50a4954dc2bad6..f98e1511660fe7c2136d345d7efa0bb12e05dec2 100644 (file)
@@ -47,23 +47,25 @@ struct stmmac_stats {
        offsetof(struct stmmac_priv, xstats.m)}
 
 static const struct stmmac_stats stmmac_gstrings_stats[] = {
+       /* Transmit errors */
        STMMAC_STAT(tx_underflow),
        STMMAC_STAT(tx_carrier),
        STMMAC_STAT(tx_losscarrier),
        STMMAC_STAT(vlan_tag),
        STMMAC_STAT(tx_deferred),
        STMMAC_STAT(tx_vlan),
-       STMMAC_STAT(rx_vlan),
        STMMAC_STAT(tx_jabber),
        STMMAC_STAT(tx_frame_flushed),
        STMMAC_STAT(tx_payload_error),
        STMMAC_STAT(tx_ip_header_error),
+       /* Receive errors */
        STMMAC_STAT(rx_desc),
        STMMAC_STAT(sa_filter_fail),
        STMMAC_STAT(overflow_error),
        STMMAC_STAT(ipc_csum_error),
        STMMAC_STAT(rx_collision),
        STMMAC_STAT(rx_crc),
+       STMMAC_STAT(dribbling_bit),
        STMMAC_STAT(rx_length),
        STMMAC_STAT(rx_mii),
        STMMAC_STAT(rx_multicast),
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
        STMMAC_STAT(sa_rx_filter_fail),
        STMMAC_STAT(rx_missed_cntr),
        STMMAC_STAT(rx_overflow_cntr),
+       STMMAC_STAT(rx_vlan),
+       /* Tx/Rx IRQ errors */
        STMMAC_STAT(tx_undeflow_irq),
        STMMAC_STAT(tx_process_stopped_irq),
        STMMAC_STAT(tx_jabber_irq),
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
        STMMAC_STAT(rx_watchdog_irq),
        STMMAC_STAT(tx_early_irq),
        STMMAC_STAT(fatal_bus_error_irq),
+       /* Extra info */
        STMMAC_STAT(threshold),
        STMMAC_STAT(tx_pkt_n),
        STMMAC_STAT(rx_pkt_n),
index 96fa2da307630f1e46df75441af10c91f0fd4c79..6ee593a55a64d9eabbf3238bfba28102257b8cc5 100644 (file)
@@ -241,7 +241,7 @@ static void stmmac_adjust_link(struct net_device *dev)
                        case 1000:
                                if (likely(priv->plat->has_gmac))
                                        ctrl &= ~priv->hw->link.port;
-                               stmmac_hw_fix_mac_speed(priv);
+                                       stmmac_hw_fix_mac_speed(priv);
                                break;
                        case 100:
                        case 10:
@@ -785,7 +785,7 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv)
                u32 uid = ((hwid & 0x0000ff00) >> 8);
                u32 synid = (hwid & 0x000000ff);
 
-               pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n",
+               pr_info("stmmac - user ID: 0x%x, Synopsys ID: 0x%x\n",
                        uid, synid);
 
                return synid;
@@ -869,38 +869,6 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv)
        return hw_cap;
 }
 
-/**
- * stmmac_mac_device_setup
- * @dev : device pointer
- * Description: this is to attach the GMAC or MAC 10/100
- * main core structures that will be completed during the
- * open step.
- */
-static int stmmac_mac_device_setup(struct net_device *dev)
-{
-       struct stmmac_priv *priv = netdev_priv(dev);
-
-       struct mac_device_info *device;
-
-       if (priv->plat->has_gmac)
-               device = dwmac1000_setup(priv->ioaddr);
-       else
-               device = dwmac100_setup(priv->ioaddr);
-
-       if (!device)
-               return -ENOMEM;
-
-       priv->hw = device;
-       priv->hw->ring = &ring_mode_ops;
-
-       if (device_can_wakeup(priv->device)) {
-               priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */
-               enable_irq_wake(priv->wol_irq);
-       }
-
-       return 0;
-}
-
 static void stmmac_check_ether_addr(struct stmmac_priv *priv)
 {
        /* verify if the MAC address is valid, in case of failures it
@@ -930,20 +898,8 @@ static int stmmac_open(struct net_device *dev)
        struct stmmac_priv *priv = netdev_priv(dev);
        int ret;
 
-       /* MAC HW device setup */
-       ret = stmmac_mac_device_setup(dev);
-       if (ret < 0)
-               return ret;
-
        stmmac_check_ether_addr(priv);
 
-       stmmac_verify_args();
-
-       /* Override with kernel parameters if supplied XXX CRS XXX
-        * this needs to have multiple instances */
-       if ((phyaddr >= 0) && (phyaddr <= 31))
-               priv->plat->phy_addr = phyaddr;
-
        /* MDIO bus Registration */
        ret = stmmac_mdio_register(dev);
        if (ret < 0) {
@@ -976,44 +932,6 @@ static int stmmac_open(struct net_device *dev)
                goto open_error;
        }
 
-       stmmac_get_synopsys_id(priv);
-
-       priv->hw_cap_support = stmmac_get_hw_features(priv);
-
-       if (priv->hw_cap_support) {
-               pr_info(" Support DMA HW capability register");
-
-               /* We can override some gmac/dma configuration fields: e.g.
-                * enh_desc, tx_coe (e.g. that are passed through the
-                * platform) with the values from the HW capability
-                * register (if supported).
-                */
-               priv->plat->enh_desc = priv->dma_cap.enh_desc;
-               priv->plat->tx_coe = priv->dma_cap.tx_coe;
-               priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
-
-               /* By default disable wol on magic frame if not supported */
-               if (!priv->dma_cap.pmt_magic_frame)
-                       priv->wolopts &= ~WAKE_MAGIC;
-
-       } else
-               pr_info(" No HW DMA feature register supported");
-
-       /* Select the enhnaced/normal descriptor structures */
-       stmmac_selec_desc_mode(priv);
-
-       /* PMT module is not integrated in all the MAC devices. */
-       if (priv->plat->pmt) {
-               pr_info(" Remote wake-up capable\n");
-               device_set_wakeup_capable(priv->device, 1);
-       }
-
-       priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
-       if (priv->rx_coe)
-               pr_info(" Checksum Offload Engine supported\n");
-       if (priv->plat->tx_coe)
-               pr_info(" Checksum insertion supported\n");
-
        /* Create and initialize the TX/RX descriptors chains. */
        priv->dma_tx_size = STMMAC_ALIGN(dma_txsize);
        priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
@@ -1030,14 +948,14 @@ static int stmmac_open(struct net_device *dev)
 
        /* Copy the MAC addr into the HW  */
        priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0);
+
        /* If required, perform hw setup of the bus. */
        if (priv->plat->bus_setup)
                priv->plat->bus_setup(priv->ioaddr);
+
        /* Initialize the MAC Core */
        priv->hw->mac->core_init(priv->ioaddr);
 
-       netdev_update_features(dev);
-
        /* Request the IRQ lines */
        ret = request_irq(dev->irq, stmmac_interrupt,
                         IRQF_SHARED, dev->name, dev);
@@ -1047,6 +965,17 @@ static int stmmac_open(struct net_device *dev)
                goto open_error;
        }
 
+       /* Request the Wake IRQ in case of another line is used for WoL */
+       if (priv->wol_irq != dev->irq) {
+               ret = request_irq(priv->wol_irq, stmmac_interrupt,
+                                 IRQF_SHARED, dev->name, dev);
+               if (unlikely(ret < 0)) {
+                       pr_err("%s: ERROR: allocating the ext WoL IRQ %d "
+                              "(error: %d)\n", __func__, priv->wol_irq, ret);
+                       goto open_error_wolirq;
+               }
+       }
+
        /* Enable the MAC Rx/Tx */
        stmmac_set_mac(priv->ioaddr, true);
 
@@ -1062,7 +991,7 @@ static int stmmac_open(struct net_device *dev)
 #ifdef CONFIG_STMMAC_DEBUG_FS
        ret = stmmac_init_fs(dev);
        if (ret < 0)
-               pr_warning("\tFailed debugFS registration");
+               pr_warning("%s: failed debugFS registration\n", __func__);
 #endif
        /* Start the ball rolling... */
        DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name);
@@ -1072,6 +1001,7 @@ static int stmmac_open(struct net_device *dev)
 #ifdef CONFIG_STMMAC_TIMER
        priv->tm->timer_start(tmrate);
 #endif
+
        /* Dump DMA/MAC registers */
        if (netif_msg_hw(priv)) {
                priv->hw->mac->dump_regs(priv->ioaddr);
@@ -1087,6 +1017,9 @@ static int stmmac_open(struct net_device *dev)
 
        return 0;
 
+open_error_wolirq:
+       free_irq(dev->irq, dev);
+
 open_error:
 #ifdef CONFIG_STMMAC_TIMER
        kfree(priv->tm);
@@ -1127,6 +1060,8 @@ static int stmmac_release(struct net_device *dev)
 
        /* Free the IRQ lines */
        free_irq(dev->irq, dev);
+       if (priv->wol_irq != dev->irq)
+               free_irq(priv->wol_irq, dev);
 
        /* Stop TX/RX DMA and clear the descriptors */
        priv->hw->dma->stop_tx(priv->ioaddr);
@@ -1788,6 +1723,69 @@ static const struct net_device_ops stmmac_netdev_ops = {
        .ndo_set_mac_address = eth_mac_addr,
 };
 
+/**
+ *  stmmac_hw_init - Init the MAC device
+ *  @priv : pointer to the private device structure.
+ *  Description: this function detects which MAC device
+ *  (GMAC/MAC10-100) has to attached, checks the HW capability
+ *  (if supported) and sets the driver's features (for example
+ *  to use the ring or chaine mode or support the normal/enh
+ *  descriptor structure).
+ */
+static int stmmac_hw_init(struct stmmac_priv *priv)
+{
+       int ret = 0;
+       struct mac_device_info *mac;
+
+       /* Identify the MAC HW device */
+       if (priv->plat->has_gmac)
+               mac = dwmac1000_setup(priv->ioaddr);
+       else
+               mac = dwmac100_setup(priv->ioaddr);
+       if (!mac)
+               return -ENOMEM;
+
+       priv->hw = mac;
+
+       /* To use the chained or ring mode */
+       priv->hw->ring = &ring_mode_ops;
+
+       /* Get and dump the chip ID */
+       stmmac_get_synopsys_id(priv);
+
+       /* Get the HW capability (new GMAC newer than 3.50a) */
+       priv->hw_cap_support = stmmac_get_hw_features(priv);
+       if (priv->hw_cap_support) {
+               pr_info(" DMA HW capability register supported");
+
+               /* We can override some gmac/dma configuration fields: e.g.
+                * enh_desc, tx_coe (e.g. that are passed through the
+                * platform) with the values from the HW capability
+                * register (if supported).
+                */
+               priv->plat->enh_desc = priv->dma_cap.enh_desc;
+               priv->plat->tx_coe = priv->dma_cap.tx_coe;
+               priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
+       } else
+               pr_info(" No HW DMA feature register supported");
+
+       /* Select the enhnaced/normal descriptor structures */
+       stmmac_selec_desc_mode(priv);
+
+       priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
+       if (priv->rx_coe)
+               pr_info(" RX Checksum Offload Engine supported\n");
+       if (priv->plat->tx_coe)
+               pr_info(" TX Checksum insertion supported\n");
+
+       if (priv->plat->pmt) {
+               pr_info(" Wake-Up On Lan supported\n");
+               device_set_wakeup_capable(priv->device, 1);
+       }
+
+       return ret;
+}
+
 /**
  * stmmac_dvr_probe
  * @device: device pointer
@@ -1795,7 +1793,8 @@ static const struct net_device_ops stmmac_netdev_ops = {
  * call the alloc_etherdev, allocate the priv structure.
  */
 struct stmmac_priv *stmmac_dvr_probe(struct device *device,
-                                       struct plat_stmmacenet_data *plat_dat)
+                                    struct plat_stmmacenet_data *plat_dat,
+                                    void __iomem *addr)
 {
        int ret = 0;
        struct net_device *ndev = NULL;
@@ -1815,10 +1814,27 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 
        ether_setup(ndev);
 
-       ndev->netdev_ops = &stmmac_netdev_ops;
        stmmac_set_ethtool_ops(ndev);
+       priv->pause = pause;
+       priv->plat = plat_dat;
+       priv->ioaddr = addr;
+       priv->dev->base_addr = (unsigned long)addr;
+
+       /* Verify driver arguments */
+       stmmac_verify_args();
+
+       /* Override with kernel parameters if supplied XXX CRS XXX
+        * this needs to have multiple instances */
+       if ((phyaddr >= 0) && (phyaddr <= 31))
+               priv->plat->phy_addr = phyaddr;
+
+       /* Init MAC and get the capabilities */
+       stmmac_hw_init(priv);
+
+       ndev->netdev_ops = &stmmac_netdev_ops;
 
-       ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+       ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+                           NETIF_F_RXCSUM;
        ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
        ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
 #ifdef STMMAC_VLAN_TAG_USED
@@ -1830,8 +1846,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
        if (flow_ctrl)
                priv->flow_ctrl = FLOW_AUTO;    /* RX/TX pause on */
 
-       priv->pause = pause;
-       priv->plat = plat_dat;
        netif_napi_add(ndev, &priv->napi, stmmac_poll, 64);
 
        spin_lock_init(&priv->lock);
@@ -1839,15 +1853,10 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 
        ret = register_netdev(ndev);
        if (ret) {
-               pr_err("%s: ERROR %i registering the device\n",
-                      __func__, ret);
+               pr_err("%s: ERROR %i registering the device\n", __func__, ret);
                goto error;
        }
 
-       DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n",
-           ndev->name, (ndev->features & NETIF_F_SG) ? "on" : "off",
-           (ndev->features & NETIF_F_IP_CSUM) ? "on" : "off");
-
        return priv;
 
 error:
index c796de9eed7226886ec67b453181c20fb129f111..50ad5b80cfaf1885ae71c148543e5cf2c4f1ae36 100644 (file)
@@ -96,13 +96,11 @@ static int __devinit stmmac_pci_probe(struct pci_dev *pdev,
 
        stmmac_default_data();
 
-       priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat);
+       priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr);
        if (!priv) {
-               pr_err("%s: main drivr probe failed", __func__);
+               pr_err("%s: main driver probe failed", __func__);
                goto err_out;
        }
-       priv->ioaddr = addr;
-       priv->dev->base_addr = (unsigned long)addr;
        priv->dev->irq = pdev->irq;
        priv->wol_irq = pdev->irq;
 
index 1ac83243649a2d4c44ad4efa7fd0393c6869fbce..3aad9810237c0dedb8c23f39324f2db646009f1a 100644 (file)
@@ -59,16 +59,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
                goto out_release_region;
        }
        plat_dat = pdev->dev.platform_data;
-       priv = stmmac_dvr_probe(&(pdev->dev), plat_dat);
+
+       /* Custom initialisation (if needed)*/
+       if (plat_dat->init) {
+               ret = plat_dat->init(pdev);
+               if (unlikely(ret))
+                       goto out_unmap;
+       }
+
+       priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr);
        if (!priv) {
-               pr_err("%s: main drivr probe failed", __func__);
+               pr_err("%s: main driver probe failed", __func__);
                goto out_unmap;
        }
 
-       priv->ioaddr = addr;
-       /* Set the I/O base addr */
-       priv->dev->base_addr = (unsigned long)addr;
-
        /* Get the MAC information */
        priv->dev->irq = platform_get_irq_byname(pdev, "macirq");
        if (priv->dev->irq == -ENXIO) {
@@ -92,13 +96,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, priv->dev);
 
-       /* Custom initialisation */
-       if (priv->plat->init) {
-               ret = priv->plat->init(pdev);
-               if (unlikely(ret))
-                       goto out_unmap;
-       }
-
        pr_debug("STMMAC platform driver registration completed");
 
        return 0;
index 4d9a28ffd3c3ac20d2764ea72ada7e70cadc04f0..cbc8df78d84bf65ab45668b5b585bf1bd5d11d7f 100644 (file)
@@ -1122,7 +1122,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
        pdata = pdev->dev.platform_data;
 
        if (external_switch || dumb_switch) {
-               strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+               strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
                phy_id = pdev->id;
        } else {
                for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
@@ -1138,7 +1138,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
        if (phy_id == PHY_MAX_ADDR) {
                dev_err(&pdev->dev, "no PHY present, falling back "
                                        "to switch on MDIO bus 0\n");
-               strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
+               strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
                phy_id = pdev->id;
        }
 
index 4fa0bcb25dfc0d5dadeb175a4c36ada14c0f680d..4b2f54565f64adece3f69b5a89b7997666ce16e5 100644 (file)
@@ -1009,7 +1009,7 @@ static void emac_rx_handler(void *token, int len, int status)
        int                     ret;
 
        /* free and bail if we are shutting down */
-       if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) {
+       if (unlikely(!netif_running(ndev))) {
                dev_kfree_skb_any(skb);
                return;
        }
@@ -1038,7 +1038,9 @@ static void emac_rx_handler(void *token, int len, int status)
 recycle:
        ret = cpdma_chan_submit(priv->rxchan, skb, skb->data,
                        skb_tailroom(skb), GFP_KERNEL);
-       if (WARN_ON(ret < 0))
+
+       WARN_ON(ret == -ENOMEM);
+       if (unlikely(ret < 0))
                dev_kfree_skb_any(skb);
 }
 
index 72a854f05bb8042cf8392c518377652e8af62daf..41a8b5a9849e00f8e03cfa1c541f2134e3af6557 100644 (file)
@@ -1416,7 +1416,8 @@ static int __devinit eth_init_one(struct platform_device *pdev)
        __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control);
        udelay(50);
 
-       snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy);
+       snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
+               mdio_bus->id, plat->phy);
        port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
                                   PHY_INTERFACE_MODE_MII);
        if (IS_ERR(port->phydev)) {
index c81f136ae670f1c616ac0fee867b9c2ed08351e0..0856e1b7a849ad5d6e32cf7fe91e4b5bee861e30 100644 (file)
 #include <asm/irq.h>
 #include <asm/uaccess.h>
 
-MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers");
+MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers");
 MODULE_AUTHOR("Michael Barkowski");
 MODULE_LICENSE("GPL");
 
-/* IP101A/IP1001 */
-#define IP10XX_SPEC_CTRL_STATUS                16  /* Spec. Control Register */
-#define IP1001_SPEC_CTRL_STATUS_2      20  /* IP1001 Spec. Control Reg 2 */
-#define IP1001_PHASE_SEL_MASK          3 /* IP1001 RX/TXPHASE_SEL */
-#define IP1001_APS_ON                  11  /* IP1001 APS Mode  bit */
-#define IP101A_APS_ON                  2   /* IP101A APS Mode bit */
+/* IP101A/G - IP1001 */
+#define IP10XX_SPEC_CTRL_STATUS                16      /* Spec. Control Register */
+#define IP1001_SPEC_CTRL_STATUS_2      20      /* IP1001 Spec. Control Reg 2 */
+#define IP1001_PHASE_SEL_MASK          3       /* IP1001 RX/TXPHASE_SEL */
+#define IP1001_APS_ON                  11      /* IP1001 APS Mode  bit */
+#define IP101A_G_APS_ON                        2       /* IP101A/G APS Mode bit */
 
 static int ip175c_config_init(struct phy_device *phydev)
 {
@@ -98,20 +98,24 @@ static int ip175c_config_init(struct phy_device *phydev)
 
 static int ip1xx_reset(struct phy_device *phydev)
 {
-       int err, bmcr;
+       int bmcr;
 
        /* Software Reset PHY */
        bmcr = phy_read(phydev, MII_BMCR);
+       if (bmcr < 0)
+               return bmcr;
        bmcr |= BMCR_RESET;
-       err = phy_write(phydev, MII_BMCR, bmcr);
-       if (err < 0)
-               return err;
+       bmcr = phy_write(phydev, MII_BMCR, bmcr);
+       if (bmcr < 0)
+               return bmcr;
 
        do {
                bmcr = phy_read(phydev, MII_BMCR);
+               if (bmcr < 0)
+                       return bmcr;
        } while (bmcr & BMCR_RESET);
 
-       return err;
+       return 0;
 }
 
 static int ip1001_config_init(struct phy_device *phydev)
@@ -124,7 +128,10 @@ static int ip1001_config_init(struct phy_device *phydev)
 
        /* Enable Auto Power Saving mode */
        c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);
+       if (c < 0)
+               return c;
        c |= IP1001_APS_ON;
+       c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c);
        if (c < 0)
                return c;
 
@@ -132,14 +139,19 @@ static int ip1001_config_init(struct phy_device *phydev)
                /* Additional delay (2ns) used to adjust RX clock phase
                 * at RGMII interface */
                c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
+               if (c < 0)
+                       return c;
+
                c |= IP1001_PHASE_SEL_MASK;
                c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
+               if (c < 0)
+                       return c;
        }
 
-       return c;
+       return 0;
 }
 
-static int ip101a_config_init(struct phy_device *phydev)
+static int ip101a_g_config_init(struct phy_device *phydev)
 {
        int c;
 
@@ -149,7 +161,7 @@ static int ip101a_config_init(struct phy_device *phydev)
 
        /* Enable Auto Power Saving mode */
        c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
-       c |= IP101A_APS_ON;
+       c |= IP101A_G_APS_ON;
        return c;
 }
 
@@ -191,6 +203,7 @@ static struct phy_driver ip1001_driver = {
        .phy_id_mask    = 0x0ffffff0,
        .features       = PHY_GBIT_FEATURES | SUPPORTED_Pause |
                          SUPPORTED_Asym_Pause,
+       .flags          = PHY_HAS_INTERRUPT,
        .config_init    = &ip1001_config_init,
        .config_aneg    = &genphy_config_aneg,
        .read_status    = &genphy_read_status,
@@ -199,13 +212,14 @@ static struct phy_driver ip1001_driver = {
        .driver         = { .owner = THIS_MODULE,},
 };
 
-static struct phy_driver ip101a_driver = {
+static struct phy_driver ip101a_g_driver = {
        .phy_id         = 0x02430c54,
-       .name           = "ICPlus IP101A",
+       .name           = "ICPlus IP101A/G",
        .phy_id_mask    = 0x0ffffff0,
        .features       = PHY_BASIC_FEATURES | SUPPORTED_Pause |
                          SUPPORTED_Asym_Pause,
-       .config_init    = &ip101a_config_init,
+       .flags          = PHY_HAS_INTERRUPT,
+       .config_init    = &ip101a_g_config_init,
        .config_aneg    = &genphy_config_aneg,
        .read_status    = &genphy_read_status,
        .suspend        = genphy_suspend,
@@ -221,7 +235,7 @@ static int __init icplus_init(void)
        if (ret < 0)
                return -ENODEV;
 
-       ret = phy_driver_register(&ip101a_driver);
+       ret = phy_driver_register(&ip101a_g_driver);
        if (ret < 0)
                return -ENODEV;
 
@@ -231,7 +245,7 @@ static int __init icplus_init(void)
 static void __exit icplus_exit(void)
 {
        phy_driver_unregister(&ip1001_driver);
-       phy_driver_unregister(&ip101a_driver);
+       phy_driver_unregister(&ip101a_g_driver);
        phy_driver_unregister(&ip175c_driver);
 }
 
@@ -241,6 +255,7 @@ module_exit(icplus_exit);
 static struct mdio_device_id __maybe_unused icplus_tbl[] = {
        { 0x02430d80, 0x0ffffff0 },
        { 0x02430d90, 0x0ffffff0 },
+       { 0x02430c54, 0x0ffffff0 },
        { }
 };
 
index edfa15d2e79501deabe2e3c3481378d1a8ac7bb7..486b4048850df8afca33d4183b436965b6a23137 100644 (file)
@@ -2024,14 +2024,22 @@ ppp_mp_reconstruct(struct ppp *ppp)
                        continue;
                }
                if (PPP_MP_CB(p)->sequence != seq) {
+                       u32 oldseq;
                        /* Fragment `seq' is missing.  If it is after
                           minseq, it might arrive later, so stop here. */
                        if (seq_after(seq, minseq))
                                break;
                        /* Fragment `seq' is lost, keep going. */
                        lost = 1;
+                       oldseq = seq;
                        seq = seq_before(minseq, PPP_MP_CB(p)->sequence)?
                                minseq + 1: PPP_MP_CB(p)->sequence;
+
+                       if (ppp->debug & 1)
+                               netdev_printk(KERN_DEBUG, ppp->dev,
+                                             "lost frag %u..%u\n",
+                                             oldseq, seq-1);
+
                        goto again;
                }
 
@@ -2076,6 +2084,10 @@ ppp_mp_reconstruct(struct ppp *ppp)
                        struct sk_buff *tmp2;
 
                        skb_queue_reverse_walk_from_safe(list, p, tmp2) {
+                               if (ppp->debug & 1)
+                                       netdev_printk(KERN_DEBUG, ppp->dev,
+                                                     "discarding frag %u\n",
+                                                     PPP_MP_CB(p)->sequence);
                                __skb_unlink(p, list);
                                kfree_skb(p);
                        }
@@ -2091,6 +2103,17 @@ ppp_mp_reconstruct(struct ppp *ppp)
                /* If we have discarded any fragments,
                   signal a receive error. */
                if (PPP_MP_CB(head)->sequence != ppp->nextseq) {
+                       skb_queue_walk_safe(list, p, tmp) {
+                               if (p == head)
+                                       break;
+                               if (ppp->debug & 1)
+                                       netdev_printk(KERN_DEBUG, ppp->dev,
+                                                     "discarding frag %u\n",
+                                                     PPP_MP_CB(p)->sequence);
+                               __skb_unlink(p, list);
+                               kfree_skb(p);
+                       }
+
                        if (ppp->debug & 1)
                                netdev_printk(KERN_DEBUG, ppp->dev,
                                              "  missed pkts %u..%u\n",
index 41a61efc331ef9f206979f1e2477503d3a8ed289..90a30026a9315d59d3341d0148ac477b51675bdc 100644 (file)
@@ -573,6 +573,13 @@ static const struct usb_device_id  products [] = {
        .driver_info = 0,
 },
 
+/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
+{
+       USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
+                       USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
+       .driver_info            = 0,
+},
+
 /*
  * WHITELIST!!!
  *
index 304fe78ff60e3b287b608fb4b19bafacb915e315..e1324b4a0f66b42ac9cbf65eb7034a7db3ef9b47 100644 (file)
@@ -1632,7 +1632,7 @@ static int hso_get_count(struct tty_struct *tty,
        struct hso_serial *serial = get_serial_by_tty(tty);
        struct hso_tiocmget  *tiocmget = serial->tiocmget;
 
-       memset(&icount, 0, sizeof(struct serial_icounter_struct));
+       memset(icount, 0, sizeof(struct serial_icounter_struct));
 
        if (!tiocmget)
                 return -ENOENT;
index e84662db51ccd139d9fe7086ecd4f4a06513d203..dd78c4cbd45972a0bb7c342cefd08498ea827dfb 100644 (file)
@@ -60,6 +60,7 @@
 #define USB_PRODUCT_IPHONE_3GS  0x1294
 #define USB_PRODUCT_IPHONE_4   0x1297
 #define USB_PRODUCT_IPHONE_4_VZW 0x129c
+#define USB_PRODUCT_IPHONE_4S  0x12a0
 
 #define IPHETH_USBINTF_CLASS    255
 #define IPHETH_USBINTF_SUBCLASS 253
@@ -103,6 +104,10 @@ static struct usb_device_id ipheth_table[] = {
                USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
                IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
                IPHETH_USBINTF_PROTO) },
+       { USB_DEVICE_AND_INTERFACE_INFO(
+               USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
+               IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
+               IPHETH_USBINTF_PROTO) },
        { }
 };
 MODULE_DEVICE_TABLE(usb, ipheth_table);
index f701d412708717b8d27810846760c5806e2a4727..c3197ce0e2ad33be4e23358f4c3a25f74caffff8 100644 (file)
@@ -315,6 +315,11 @@ static const struct usb_device_id  products [] = {
        .idProduct              = 0x9031,       /* C-750 C-760 */
        ZAURUS_MASTER_INTERFACE,
        .driver_info = ZAURUS_PXA_INFO,
+}, {
+       /* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */
+       USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM,
+                       USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
+       .driver_info = (unsigned long) &bogus_mdlm_info,
 }, {
        .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
                 | USB_DEVICE_ID_MATCH_DEVICE,
@@ -349,6 +354,13 @@ static const struct usb_device_id  products [] = {
        ZAURUS_MASTER_INTERFACE,
        .driver_info = OLYMPUS_MXL_INFO,
 },
+
+/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
+{
+       USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
+                       USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
+       .driver_info = (unsigned long) &bogus_mdlm_info,
+},
        { },            // END
 };
 MODULE_DEVICE_TABLE(usb, products);
index 49f4667e1fa3c20342b1ca18240a93ece55f9016..4a3402898f2a1100fdae0b38d65d172a8c160da9 100644 (file)
@@ -422,7 +422,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
        unregister_netdevice_queue(peer, head);
 }
 
-static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
+static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = {
+       [VETH_INFO_PEER]        = { .len = sizeof(struct ifinfomsg) },
+};
 
 static struct rtnl_link_ops veth_link_ops = {
        .kind           = DRV_NAME,
index de7fc345148a889a772c9b208dd56137519fe7e1..756c0f5565a5b185250668c5617b93ee357ff335 100644 (file)
@@ -830,21 +830,16 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
                                        ctx->l4_hdr_size = ((struct tcphdr *)
                                           skb_transport_header(skb))->doff * 4;
                                else if (iph->protocol == IPPROTO_UDP)
-                                       /*
-                                        * Use tcp header size so that bytes to
-                                        * be copied are more than required by
-                                        * the device.
-                                        */
                                        ctx->l4_hdr_size =
-                                                       sizeof(struct tcphdr);
+                                                       sizeof(struct udphdr);
                                else
                                        ctx->l4_hdr_size = 0;
                        } else {
                                /* for simplicity, don't copy L4 headers */
                                ctx->l4_hdr_size = 0;
                        }
-                       ctx->copy_size = ctx->eth_ip_hdr_size +
-                                        ctx->l4_hdr_size;
+                       ctx->copy_size = min(ctx->eth_ip_hdr_size +
+                                        ctx->l4_hdr_size, skb->len);
                } else {
                        ctx->eth_ip_hdr_size = 0;
                        ctx->l4_hdr_size = 0;
index ed54797db1916d717fe3141559bf95bca2013547..fc46a81ad5384969b1670114765e3df12799a256 100644 (file)
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.1.18.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.1.29.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01011200
+#define VMXNET3_DRIVER_VERSION_NUM      0x01011D00
 
 #if defined(CONFIG_PCI_MSI)
        /* RSS only makes sense if MSI-X is supported. */
index f901a17f76baf6da3a2ad3e55880a8aa25df35e8..86a891f93fc9dc70939088e70080af874343f4b4 100644 (file)
@@ -489,8 +489,6 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)
        ATH_ALLOC_BANK(ah->analogBank6Data, ah->iniBank6.ia_rows);
        ATH_ALLOC_BANK(ah->analogBank6TPCData, ah->iniBank6TPC.ia_rows);
        ATH_ALLOC_BANK(ah->analogBank7Data, ah->iniBank7.ia_rows);
-       ATH_ALLOC_BANK(ah->addac5416_21,
-                      ah->iniAddac.ia_rows * ah->iniAddac.ia_columns);
        ATH_ALLOC_BANK(ah->bank6Temp, ah->iniBank6.ia_rows);
 
        return 0;
@@ -519,7 +517,6 @@ static void ar5008_hw_rf_free_ext_banks(struct ath_hw *ah)
        ATH_FREE_BANK(ah->analogBank6Data);
        ATH_FREE_BANK(ah->analogBank6TPCData);
        ATH_FREE_BANK(ah->analogBank7Data);
-       ATH_FREE_BANK(ah->addac5416_21);
        ATH_FREE_BANK(ah->bank6Temp);
 
 #undef ATH_FREE_BANK
@@ -805,27 +802,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
        if (ah->eep_ops->set_addac)
                ah->eep_ops->set_addac(ah, chan);
 
-       if (AR_SREV_5416_22_OR_LATER(ah)) {
-               REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites);
-       } else {
-               struct ar5416IniArray temp;
-               u32 addacSize =
-                       sizeof(u32) * ah->iniAddac.ia_rows *
-                       ah->iniAddac.ia_columns;
-
-               /* For AR5416 2.0/2.1 */
-               memcpy(ah->addac5416_21,
-                      ah->iniAddac.ia_array, addacSize);
-
-               /* override CLKDRV value at [row, column] = [31, 1] */
-               (ah->addac5416_21)[31 * ah->iniAddac.ia_columns + 1] = 0;
-
-               temp.ia_array = ah->addac5416_21;
-               temp.ia_columns = ah->iniAddac.ia_columns;
-               temp.ia_rows = ah->iniAddac.ia_rows;
-               REG_WRITE_ARRAY(&temp, 1, regWrites);
-       }
-
+       REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites);
        REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_INTERNAL_ADDAC);
 
        ENABLE_REGWRITE_BUFFER(ah);
index 11f192a1ceb72d332ccde32cf98f0ef7c3ff41c3..d190411ac8f51e5003fb2c639b7818be8df34b4c 100644 (file)
@@ -180,6 +180,25 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
                INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac,
                               ARRAY_SIZE(ar5416Addac), 2);
        }
+
+       /* iniAddac needs to be modified for these chips */
+       if (AR_SREV_9160(ah) || !AR_SREV_5416_22_OR_LATER(ah)) {
+               struct ar5416IniArray *addac = &ah->iniAddac;
+               u32 size = sizeof(u32) * addac->ia_rows * addac->ia_columns;
+               u32 *data;
+
+               data = kmalloc(size, GFP_KERNEL);
+               if (!data)
+                       return;
+
+               memcpy(data, addac->ia_array, size);
+               addac->ia_array = data;
+
+               if (!AR_SREV_5416_22_OR_LATER(ah)) {
+                       /* override CLKDRV value */
+                       INI_RA(addac, 31,1) = 0;
+               }
+       }
 }
 
 /* Support for Japan ch.14 (2484) spread */
index 6a29004a71b0864afe06f6c5a4b82b77f8c3d050..c8261d4fc780aa3b4db12586e2738a1065376604 100644 (file)
@@ -940,7 +940,6 @@ struct ath_hw {
        u32 *analogBank6Data;
        u32 *analogBank6TPCData;
        u32 *analogBank7Data;
-       u32 *addac5416_21;
        u32 *bank6Temp;
 
        u8 txpower_limit;
index 635b592ad96181478af45cb2697ea05dbd823077..a427a16bb739be2b97cbeb2c430fec41bd689774 100644 (file)
@@ -1346,7 +1346,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
        fc = hdr->frame_control;
        for (i = 0; i < sc->hw->max_rates; i++) {
                struct ieee80211_tx_rate *rate = &tx_info->status.rates[i];
-               if (!rate->count)
+               if (rate->idx < 0 || !rate->count)
                        break;
 
                final_ts_idx = i;
index 90911eec0cf55948fddecffb225eb1543412cc6a..30b58870b1b68455b09adecfd127b354dbcc975c 100644 (file)
@@ -1051,17 +1051,13 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
                }
                /* either retransmit or send bar if ack not recd */
                if (!ack_recd) {
-                       struct ieee80211_tx_rate *txrate =
-                           tx_info->status.rates;
-                       if (retry && (txrate[0].count < (int)retry_limit)) {
+                       if (retry && (ini->txretry[index] < (int)retry_limit)) {
                                ini->txretry[index]++;
                                ini->tx_in_transit--;
                                /*
                                 * Use high prededence for retransmit to
                                 * give some punch
                                 */
-                               /* brcms_c_txq_enq(wlc, scb, p,
-                                * BRCMS_PRIO_TO_PREC(tid)); */
                                brcms_c_txq_enq(wlc, scb, p,
                                                BRCMS_PRIO_TO_HI_PREC(tid));
                        } else {
@@ -1074,9 +1070,9 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
                                    IEEE80211_TX_STAT_AMPDU_NO_BACK;
                                skb_pull(p, D11_PHY_HDR_LEN);
                                skb_pull(p, D11_TXH_LEN);
-                               wiphy_err(wiphy, "%s: BA Timeout, seq %d, in_"
-                                       "transit %d\n", "AMPDU status", seq,
-                                       ini->tx_in_transit);
+                               BCMMSG(wiphy,
+                                      "BA Timeout, seq %d, in_transit %d\n",
+                                      seq, ini->tx_in_transit);
                                ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw,
                                                            p);
                        }
index 7353826095f110a8766d6c1a4425a71c49ba8a91..e483cfa8d14e175aac3432f77951d3641989f116 100644 (file)
@@ -1187,6 +1187,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
        unsigned long flags;
        struct iwl_addsta_cmd sta_cmd;
        u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta);
+       __le16 key_flags;
 
        /* if station isn't there, neither is the key */
        if (sta_id == IWL_INVALID_STATION)
@@ -1212,7 +1213,14 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
                IWL_ERR(priv, "offset %d not used in uCode key table.\n",
                        keyconf->hw_key_idx);
 
-       sta_cmd.key.key_flags = STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID;
+       key_flags = cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
+       key_flags |= STA_KEY_FLG_MAP_KEY_MSK | STA_KEY_FLG_NO_ENC |
+                    STA_KEY_FLG_INVALID;
+
+       if (!(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE))
+               key_flags |= STA_KEY_MULTICAST_MSK;
+
+       sta_cmd.key.key_flags = key_flags;
        sta_cmd.key.key_offset = WEP_INVALID_OFFSET;
        sta_cmd.sta.modify_mask = STA_MODIFY_KEY_MASK;
        sta_cmd.mode = STA_CONTROL_MODIFY_MSK;
index c3b6c4652cd6cd87d6a5fd8e22506013bcfe1e92..5b2972b43b0e23ee62e94d255146d6be1787634d 100644 (file)
@@ -841,7 +841,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
                ret = mwifiex_set_rf_channel(priv, channel,
                                                priv->adapter->channel_type);
 
-       ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);  /* Disable keys */
+       /* As this is new association, clear locally stored
+        * keys and security related flags */
+       priv->sec_info.wpa_enabled = false;
+       priv->sec_info.wpa2_enabled = false;
+       priv->wep_key_curr_index = 0;
+       ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);
 
        if (mode == NL80211_IFTYPE_ADHOC) {
                /* "privacy" is set only for ad-hoc mode */
@@ -886,6 +891,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
                        dev_dbg(priv->adapter->dev,
                                "info: setting wep encryption"
                                " with key len %d\n", sme->key_len);
+                       priv->wep_key_curr_index = sme->key_idx;
                        ret = mwifiex_set_encode(priv, sme->key, sme->key_len,
                                                        sme->key_idx, 0);
                }
index c3e1aa7c1a8057b7eb19270f8aacb3f718b86577..d2a1ea98d0f23a144653ed7fceefeb62a2191e75 100644 (file)
@@ -1220,7 +1220,8 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
                cancel_work_sync(&rt2x00dev->rxdone_work);
                cancel_work_sync(&rt2x00dev->txdone_work);
        }
-       destroy_workqueue(rt2x00dev->workqueue);
+       if (rt2x00dev->workqueue)
+               destroy_workqueue(rt2x00dev->workqueue);
 
        /*
         * Free the tx status fifo.
index 39e0907a3c4eac8d89a9f682dc53d8471cbec560..9245d882c06a3046dfb3d052456e6174d99d2a97 100644 (file)
@@ -1501,7 +1501,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
                return err;
        }
 
-       return 1;
+       return 0;
 }
 
 static int rtl_pci_start(struct ieee80211_hw *hw)
@@ -1870,7 +1870,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
        }
 
        /* Init PCI sw */
-       err = !rtl_pci_init(hw, pdev);
+       err = rtl_pci_init(hw, pdev);
        if (err) {
                RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
                         ("Failed to init PCI.\n"));
index a9c46cc2db3701157485b8194af83a6c03c7b189..8c33491b21fe75b7b38fddcab4022676d274db43 100644 (file)
@@ -1,3 +1,5 @@
+#include <linux/prefetch.h>
+
 /**
  * iommu_fill_pdir - Insert coalesced scatter/gather chunks into the I/O Pdir.
  * @ioc: The I/O Controller.
index 0321fa3b42268841d9bc9909354a71f8a385dcc5..0dab5ecf61bb26ad1c7b96684f56b52e7442928d 100644 (file)
@@ -347,8 +347,6 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
                        return rc;
        }
 
-       pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
-
        iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
        pci_cfg_access_lock(dev);
        pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
@@ -466,6 +464,7 @@ found:
                return -EIO;
 
        pgsz &= ~(pgsz - 1);
+       pci_write_config_dword(dev, pos + PCI_SRIOV_SYS_PGSIZE, pgsz);
 
        nres = 0;
        for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
index 7cc9e2f0f47cab6c55a214af1d9134e77f1bd0a8..71eac9cd724d7b12c77d68cc0eb68a3b50a9f287 100644 (file)
@@ -651,6 +651,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
        dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n",
                secondary, subordinate, pass);
 
+       if (!primary && (primary != bus->number) && secondary && subordinate) {
+               dev_warn(&dev->dev, "Primary bus is hard wired to 0\n");
+               primary = bus->number;
+       }
+
        /* Check if setup is sensible at all */
        if (!pass &&
            (primary != bus->number || secondary <= bus->number)) {
index 6def3624c688c64f26f1ce981ab9a58e9e235804..ef8b18c48f2641993f56aa643ed8a35579856971 100644 (file)
@@ -77,6 +77,7 @@ void pci_remove_bus(struct pci_bus *pci_bus)
 }
 EXPORT_SYMBOL(pci_remove_bus);
 
+static void __pci_remove_behind_bridge(struct pci_dev *dev);
 /**
  * pci_remove_bus_device - remove a PCI device and any children
  * @dev: the device to remove
@@ -94,7 +95,7 @@ static void __pci_remove_bus_device(struct pci_dev *dev)
        if (dev->subordinate) {
                struct pci_bus *b = dev->subordinate;
 
-               pci_remove_behind_bridge(dev);
+               __pci_remove_behind_bridge(dev);
                pci_remove_bus(b);
                dev->subordinate = NULL;
        }
@@ -107,6 +108,24 @@ void pci_remove_bus_device(struct pci_dev *dev)
        __pci_remove_bus_device(dev);
 }
 
+static void __pci_remove_behind_bridge(struct pci_dev *dev)
+{
+       struct list_head *l, *n;
+
+       if (dev->subordinate)
+               list_for_each_safe(l, n, &dev->subordinate->devices)
+                       __pci_remove_bus_device(pci_dev_b(l));
+}
+
+static void pci_stop_behind_bridge(struct pci_dev *dev)
+{
+       struct list_head *l, *n;
+
+       if (dev->subordinate)
+               list_for_each_safe(l, n, &dev->subordinate->devices)
+                       pci_stop_bus_device(pci_dev_b(l));
+}
+
 /**
  * pci_remove_behind_bridge - remove all devices behind a PCI bridge
  * @dev: PCI bridge device
@@ -117,11 +136,8 @@ void pci_remove_bus_device(struct pci_dev *dev)
  */
 void pci_remove_behind_bridge(struct pci_dev *dev)
 {
-       struct list_head *l, *n;
-
-       if (dev->subordinate)
-               list_for_each_safe(l, n, &dev->subordinate->devices)
-                       __pci_remove_bus_device(pci_dev_b(l));
+       pci_stop_behind_bridge(dev);
+       __pci_remove_behind_bridge(dev);
 }
 
 static void pci_stop_bus_devices(struct pci_bus *bus)
index a87e2728b2c3a19cd50df8b6ae19de643296cceb..64d433ec4fc6f78fb7350fe333831e4e8e35371a 100644 (file)
@@ -328,21 +328,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
                        goto err1;
        }
 
-       if (ret) {
-               while (--i >= 0)
-                       soc_pcmcia_remove_one(&sinfo->skt[i]);
-               kfree(sinfo);
-               clk_put(clk);
-       } else {
-               pxa2xx_configure_sockets(&dev->dev);
-               dev_set_drvdata(&dev->dev, sinfo);
-       }
+       pxa2xx_configure_sockets(&dev->dev);
+       dev_set_drvdata(&dev->dev, sinfo);
 
        return 0;
 
 err1:
        while (--i >= 0)
                soc_pcmcia_remove_one(&sinfo->skt[i]);
+       clk_put(clk);
        kfree(sinfo);
 err0:
        return ret;
index 8fe15cf15ac8f2687234db70509d40210672d3f8..894cd5e103da6225bd660d66b696b44eab6d4a12 100644 (file)
@@ -189,7 +189,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
        pindesc->pctldev = pctldev;
 
        /* Copy basic pin info */
-       if (pindesc->name) {
+       if (name) {
                pindesc->name = name;
        } else {
                pindesc->name = kasprintf(GFP_KERNEL, "PIN%u", number);
index 42a7d603c870bb259a93a1630065de34d5c35a01..7481146a5b473c1cab6745a7d6ac1ae76e66257e 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/mutex.h>
 #include <asm/bios_ebda.h>
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 static bool force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
@@ -83,19 +85,6 @@ static void __iomem *rtl_cmd_addr;
 static u8 rtl_cmd_type;
 static u8 rtl_cmd_width;
 
-#ifndef readq
-static inline __u64 readq(const volatile void __iomem *addr)
-{
-       const volatile u32 __iomem *p = addr;
-       u32 low, high;
-
-       low = readl(p);
-       high = readl(p + 1);
-
-       return low + ((u64)high << 32);
-}
-#endif
-
 static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len)
 {
        if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO)
index 809a3ae943c6997f65a20328f8fe2fb02690cd6c..88a98cff5a44a04e2d69771cc78ec7de3edbce82 100644 (file)
@@ -77,6 +77,8 @@
 #include <asm/processor.h>
 #include "intel_ips.h"
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32
 
 /*
@@ -344,19 +346,6 @@ struct ips_driver {
 static bool
 ips_gpu_turbo_enabled(struct ips_driver *ips);
 
-#ifndef readq
-static inline __u64 readq(const volatile void __iomem *addr)
-{
-       const volatile u32 __iomem *p = addr;
-       u32 low, high;
-
-       low = readl(p);
-       high = readl(p + 1);
-
-       return low + ((u64)high << 32);
-}
-#endif
-
 /**
  * ips_cpu_busy - is CPU busy?
  * @ips: IPS driver struct
index 2baadd21b7a664dea71cce5a237d66b0b8e36a25..98fbe62694d4eddbead50fde0de22fe834ce67a4 100644 (file)
@@ -369,9 +369,9 @@ static int __init pps_init(void)
        int err;
 
        pps_class = class_create(THIS_MODULE, "pps");
-       if (!pps_class) {
+       if (IS_ERR(pps_class)) {
                pr_err("failed to allocate class\n");
-               return -ENOMEM;
+               return PTR_ERR(pps_class);
        }
        pps_class->dev_attrs = pps_attrs;
 
index 691b1ab1a3d0499d85815bd03551e9d22518e494..30d2072f480b72947c74401d5522fbb9d697d313 100644 (file)
@@ -410,13 +410,14 @@ static void tsi721_db_dpc(struct work_struct *work)
         */
        mport = priv->mport;
 
-       wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE));
-       rd_ptr = ioread32(priv->regs + TSI721_IDQ_RP(IDB_QUEUE));
+       wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
+       rd_ptr = ioread32(priv->regs + TSI721_IDQ_RP(IDB_QUEUE)) % IDB_QSIZE;
 
        while (wr_ptr != rd_ptr) {
                idb_entry = (u64 *)(priv->idb_base +
                                        (TSI721_IDB_ENTRY_SIZE * rd_ptr));
                rd_ptr++;
+               rd_ptr %= IDB_QSIZE;
                idb.msg = *idb_entry;
                *idb_entry = 0;
 
index df33530cec4a458d0cf51be33ce60d81943116c3..28b81ae4cf7f32c18e2d752dad185c4926ba62b9 100644 (file)
@@ -196,7 +196,7 @@ static const unsigned int LDO12_suspend_table[] = {
 };
 
 static const unsigned int LDO13_table[] = {
-       1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0, 0,
+       1200000, 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0,
 };
 
 static const unsigned int LDO13_suspend_table[] = {
@@ -389,10 +389,10 @@ static struct pm8607_regulator_info pm8607_regulator_info[] = {
        PM8607_LDO( 7,         LDO7, 0, 3, SUPPLIES_EN12, 1),
        PM8607_LDO( 8,         LDO8, 0, 3, SUPPLIES_EN12, 2),
        PM8607_LDO( 9,         LDO9, 0, 3, SUPPLIES_EN12, 3),
-       PM8607_LDO(10,        LDO10, 0, 3, SUPPLIES_EN12, 4),
+       PM8607_LDO(10,        LDO10, 0, 4, SUPPLIES_EN12, 4),
        PM8607_LDO(12,        LDO12, 0, 4, SUPPLIES_EN12, 5),
        PM8607_LDO(13, VIBRATOR_SET, 1, 3,  VIBRATOR_SET, 0),
-       PM8607_LDO(14,        LDO14, 0, 4, SUPPLIES_EN12, 6),
+       PM8607_LDO(14,        LDO14, 0, 3, SUPPLIES_EN12, 6),
 };
 
 static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
index 3767364452fdd890785da5276f1f9b648be89aea..ea4d8f575ac6524676550789e93beb143cdb7cff 100644 (file)
@@ -260,8 +260,8 @@ static int da9052_set_ldo5_6_voltage(struct regulator_dev *rdev,
         * the LDO activate bit to implment the changes on the
         * LDO output.
        */
-       return da9052_reg_update(regulator->da9052, DA9052_SUPPLY_REG, 0,
-                                info->activate_bit);
+       return da9052_reg_update(regulator->da9052, DA9052_SUPPLY_REG,
+                                info->activate_bit, info->activate_bit);
 }
 
 static int da9052_set_dcdc_voltage(struct regulator_dev *rdev,
@@ -280,8 +280,8 @@ static int da9052_set_dcdc_voltage(struct regulator_dev *rdev,
         * the DCDC activate bit to implment the changes on the
         * DCDC output.
        */
-       return da9052_reg_update(regulator->da9052, DA9052_SUPPLY_REG, 0,
-                                info->activate_bit);
+       return da9052_reg_update(regulator->da9052, DA9052_SUPPLY_REG,
+                                info->activate_bit, info->activate_bit);
 }
 
 static int da9052_get_regulator_voltage_sel(struct regulator_dev *rdev)
index a3ad957507dc9ebce9a360c85330e067d5576f9f..ee3c122c05991e55394f7fca1e677caf4d5a3a0c 100644 (file)
@@ -307,8 +307,12 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
                device_init_wakeup(&pdev->dev, 1);
 
        platform_set_drvdata(pdev, rtc);
-       rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
-       rtc->rtt += r->start;
+       rtc->rtt = ioremap(r->start, resource_size(r));
+       if (!rtc->rtt) {
+               dev_err(&pdev->dev, "failed to map registers, aborting.\n");
+               ret = -ENOMEM;
+               goto fail;
+       }
 
        mr = rtt_readl(rtc, MR);
 
@@ -326,7 +330,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
                                &at91_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc->rtcdev)) {
                ret = PTR_ERR(rtc->rtcdev);
-               goto fail;
+               goto fail_register;
        }
 
        /* register irq handler after we know what name we'll use */
@@ -351,6 +355,8 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
 
        return 0;
 
+fail_register:
+       iounmap(rtc->rtt);
 fail:
        platform_set_drvdata(pdev, NULL);
        kfree(rtc);
@@ -371,6 +377,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
 
        rtc_device_unregister(rtc->rtcdev);
 
+       iounmap(rtc->rtt);
        platform_set_drvdata(pdev, NULL);
        kfree(rtc);
        return 0;
index 9beba49c3c5b48c2abcca65c916eabc0d782a49a..2853c2a6f10f4a055d2aadb8d3fac0380bff7f97 100644 (file)
@@ -125,6 +125,13 @@ static int __devinit r9701_probe(struct spi_device *spi)
        unsigned char tmp;
        int res;
 
+       tmp = R100CNT;
+       res = read_regs(&spi->dev, &tmp, 1);
+       if (res || tmp != 0x20) {
+               dev_err(&spi->dev, "cannot read RTC register\n");
+               return -ENODEV;
+       }
+
        rtc = rtc_device_register("r9701",
                                &spi->dev, &r9701_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc))
@@ -132,13 +139,6 @@ static int __devinit r9701_probe(struct spi_device *spi)
 
        dev_set_drvdata(&spi->dev, rtc);
 
-       tmp = R100CNT;
-       res = read_regs(&spi->dev, &tmp, 1);
-       if (res || tmp != 0x20) {
-               rtc_device_unregister(rtc);
-               return res;
-       }
-
        return 0;
 }
 
index 70880be260151b62dce8ff5724a47bf8a28be7ac..2617b1ed4709bffd1f68971ebe27ea2e61e8f62f 100644 (file)
 #include <linux/hdreg.h>       /* HDIO_GETGEO                      */
 #include <linux/bio.h>
 #include <linux/module.h>
+#include <linux/compat.h>
 #include <linux/init.h>
 
 #include <asm/debug.h>
 #include <asm/idals.h>
 #include <asm/ebcdic.h>
-#include <asm/compat.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/cio.h>
index f1a2016829fc5654335abaea3d7682eae4d33370..792c69e78fe2ae6474635680dba3c9af436b554e 100644 (file)
@@ -13,6 +13,7 @@
 #define KMSG_COMPONENT "dasd"
 
 #include <linux/interrupt.h>
+#include <linux/compat.h>
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/blkpg.h>
index 934458ad55e51782c7b595b48c5f3088393b8495..e71a50d4b2217b22fb262338f31aa1fe98931349 100644 (file)
@@ -87,6 +87,7 @@ struct raw3215_info {
        struct tty_struct *tty;       /* pointer to tty structure if present */
        struct raw3215_req *queued_read; /* pointer to queued read requests */
        struct raw3215_req *queued_write;/* pointer to queued write requests */
+       struct tasklet_struct tlet;   /* tasklet to invoke tty_wakeup */
        wait_queue_head_t empty_wait; /* wait queue for flushing */
        struct timer_list timer;      /* timer for delayed output */
        int line_pos;                 /* position on the line (for tabs) */
@@ -333,20 +334,24 @@ static inline void raw3215_try_io(struct raw3215_info *raw)
        }
 }
 
+/*
+ * Call tty_wakeup from tasklet context
+ */
+static void raw3215_wakeup(unsigned long data)
+{
+       struct raw3215_info *raw = (struct raw3215_info *) data;
+       tty_wakeup(raw->tty);
+}
+
 /*
  * Try to start the next IO and wake up processes waiting on the tty.
  */
 static void raw3215_next_io(struct raw3215_info *raw)
 {
-       struct tty_struct *tty;
-
        raw3215_mk_write_req(raw);
        raw3215_try_io(raw);
-       tty = raw->tty;
-       if (tty != NULL &&
-           RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) {
-               tty_wakeup(tty);
-       }
+       if (raw->tty && RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE)
+               tasklet_schedule(&raw->tlet);
 }
 
 /*
@@ -682,6 +687,7 @@ static int raw3215_probe (struct ccw_device *cdev)
                return -ENOMEM;
        }
        init_waitqueue_head(&raw->empty_wait);
+       tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw);
 
        dev_set_drvdata(&cdev->dev, raw);
        cdev->handler = raw3215_irq;
@@ -901,6 +907,7 @@ static int __init con3215_init(void)
 
        raw->flags |= RAW3215_FIXED;
        init_waitqueue_head(&raw->empty_wait);
+       tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw);
 
        /* Request the console irq */
        if (raw3215_startup(raw) != 0) {
@@ -966,6 +973,7 @@ static void tty3215_close(struct tty_struct *tty, struct file * filp)
        tty->closing = 1;
        /* Shutdown the terminal */
        raw3215_shutdown(raw);
+       tasklet_kill(&raw->tlet);
        tty->closing = 0;
        raw->tty = NULL;
 }
index e71298158f9eaa83a0531269a7da5c83c0c1d14a..911704571b9c1a862f4d8819bb89ad8f0f4c000f 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/console.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/compat.h>
 #include <linux/module.h>
 #include <linux/list.h>
 #include <linux/slab.h>
index 75bde6a8b7dc9277332b40be961bbc4888d1d497..89c03e6b1c0c633d5b3bb8cd051c83ae7aa8d1e4 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/fs.h>
 #include <linux/init.h>
+#include <linux/compat.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
index 0c87b0fc7714b42f3dedec1e1adc1035c2f96877..8f9a1a384496eb396ce2b0cbcec28327ddb48d3f 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <linux/slab.h>
+#include <linux/compat.h>
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/uaccess.h>
index 3ef8d071c64a683316a01b6e12ecd68f3d6f1d9d..770a740a393cd57bd24de3e0e19c1b852d9cd771 100644 (file)
@@ -167,7 +167,7 @@ again:
        DBF_ERROR("%4x EQBS ERROR", SCH_NO(q));
        DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
-                  0, -1, -1, q->irq_ptr->int_parm);
+                  q->nr, q->first_to_kick, count, q->irq_ptr->int_parm);
        return 0;
 }
 
@@ -215,7 +215,7 @@ again:
        DBF_ERROR("%4x SQBS ERROR", SCH_NO(q));
        DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
-                  0, -1, -1, q->irq_ptr->int_parm);
+                  q->nr, q->first_to_kick, count, q->irq_ptr->int_parm);
        return 0;
 }
 
index 303dde09d294944b7ed51ed4eac717b2cbdbc223..fab2c2592a9744e400971b73c264fd9f2c3ab7b9 100644 (file)
@@ -11,6 +11,7 @@
 #define KMSG_COMPONENT "zfcp"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
index 53a31c753cb1e682ead92268901bc966845a1996..20c4557f5abd09c099600571ee417e9ef01e998c 100644 (file)
@@ -364,10 +364,7 @@ static void release_controller(struct kref *kref)
        struct rdac_controller *ctlr;
        ctlr = container_of(kref, struct rdac_controller, kref);
 
-       flush_workqueue(kmpath_rdacd);
-       spin_lock(&list_lock);
        list_del(&ctlr->node);
-       spin_unlock(&list_lock);
        kfree(ctlr);
 }
 
@@ -376,20 +373,17 @@ static struct rdac_controller *get_controller(int index, char *array_name,
 {
        struct rdac_controller *ctlr, *tmp;
 
-       spin_lock(&list_lock);
-
        list_for_each_entry(tmp, &ctlr_list, node) {
                if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) &&
                          (tmp->index == index) &&
                          (tmp->host == sdev->host)) {
                        kref_get(&tmp->kref);
-                       spin_unlock(&list_lock);
                        return tmp;
                }
        }
        ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC);
        if (!ctlr)
-               goto done;
+               return NULL;
 
        /* initialize fields of controller */
        memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN);
@@ -405,8 +399,7 @@ static struct rdac_controller *get_controller(int index, char *array_name,
        INIT_WORK(&ctlr->ms_work, send_mode_select);
        INIT_LIST_HEAD(&ctlr->ms_head);
        list_add(&ctlr->node, &ctlr_list);
-done:
-       spin_unlock(&list_lock);
+
        return ctlr;
 }
 
@@ -517,9 +510,12 @@ static int initialize_controller(struct scsi_device *sdev,
                        index = 0;
                else
                        index = 1;
+
+               spin_lock(&list_lock);
                h->ctlr = get_controller(index, array_name, array_id, sdev);
                if (!h->ctlr)
                        err = SCSI_DH_RES_TEMP_UNAVAIL;
+               spin_unlock(&list_lock);
        }
        return err;
 }
@@ -906,7 +902,9 @@ static int rdac_bus_attach(struct scsi_device *sdev)
        return 0;
 
 clean_ctlr:
+       spin_lock(&list_lock);
        kref_put(&h->ctlr->kref, release_controller);
+       spin_unlock(&list_lock);
 
 failed:
        kfree(scsi_dh_data);
@@ -921,14 +919,19 @@ static void rdac_bus_detach( struct scsi_device *sdev )
        struct rdac_dh_data *h;
        unsigned long flags;
 
-       spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
        scsi_dh_data = sdev->scsi_dh_data;
+       h = (struct rdac_dh_data *) scsi_dh_data->buf;
+       if (h->ctlr && h->ctlr->ms_queued)
+               flush_workqueue(kmpath_rdacd);
+
+       spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
        sdev->scsi_dh_data = NULL;
        spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
 
-       h = (struct rdac_dh_data *) scsi_dh_data->buf;
+       spin_lock(&list_lock);
        if (h->ctlr)
                kref_put(&h->ctlr->kref, release_controller);
+       spin_unlock(&list_lock);
        kfree(scsi_dh_data);
        module_put(THIS_MODULE);
        sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME);
index 67b169b7a5be505e5e5935db55552d2bba13e7a0..b538f0883fd2e2314e76115936b606d38a79bc01 100644 (file)
@@ -4613,11 +4613,13 @@ static int __ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
        ENTER;
        ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
 
-       dev_err(&ioa_cfg->pdev->dev,
-               "Adapter being reset as a result of error recovery.\n");
+       if (!ioa_cfg->in_reset_reload) {
+               dev_err(&ioa_cfg->pdev->dev,
+                       "Adapter being reset as a result of error recovery.\n");
 
-       if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
-               ioa_cfg->sdt_state = GET_DUMP;
+               if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
+                       ioa_cfg->sdt_state = GET_DUMP;
+       }
 
        rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV);
 
@@ -4907,7 +4909,7 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
        struct ipr_ioa_cfg *ioa_cfg;
        struct ipr_resource_entry *res;
        struct ipr_cmd_pkt *cmd_pkt;
-       u32 ioasc;
+       u32 ioasc, int_reg;
        int op_found = 0;
 
        ENTER;
@@ -4920,7 +4922,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
         */
        if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)
                return FAILED;
-       if (!res || !ipr_is_gscsi(res))
+       if (!res)
+               return FAILED;
+
+       /*
+        * If we are aborting a timed out op, chances are that the timeout was caused
+        * by a still not detected EEH error. In such cases, reading a register will
+        * trigger the EEH recovery infrastructure.
+        */
+       int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
+
+       if (!ipr_is_gscsi(res))
                return FAILED;
 
        list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
index 1a65d6514237dd59ac24c8deb89f1afce27a4e3d..418391b1c3616b07f2976467720565d7e9ee4479 100644 (file)
@@ -1848,9 +1848,11 @@ static enum sci_status sci_oem_parameters_set(struct isci_host *ihost)
        if (state == SCIC_RESET ||
            state == SCIC_INITIALIZING ||
            state == SCIC_INITIALIZED) {
+               u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version :
+                       ISCI_ROM_VER_1_0;
 
                if (sci_oem_parameters_validate(&ihost->oem_parameters,
-                                               pci_info->orom->hdr.version))
+                                               oem_version))
                        return SCI_FAILURE_INVALID_PARAMETER_VALUE;
 
                return SCI_SUCCESS;
index 0b2c95583660f67a652217d8b5ca3f25bee24984..a78036f5e1a60565256d2576f02cde3c2343149a 100644 (file)
@@ -4548,7 +4548,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
                printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n",
                    ioc->name, __func__);
                r = 0;
-               goto out;
+               goto out_unlocked;
        }
 
        if (mpt2sas_fwfault_debug)
@@ -4604,6 +4604,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
        spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
        mutex_unlock(&ioc->reset_in_progress_mutex);
 
+ out_unlocked:
        dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name,
            __func__));
        return r;
index b31a8e3841d795154672cad902ec628bafb59c6f..d4ed9eb526572e07814e167eca89f94d22a3f73a 100644 (file)
 #ifndef SCSI_OSD_MAJOR
 #  define SCSI_OSD_MAJOR 260
 #endif
-#define SCSI_OSD_MAX_MINOR 64
+#define SCSI_OSD_MAX_MINOR MINORMASK
 
 static const char osd_name[] = "osd";
-static const char *osd_version_string = "open-osd 0.2.0";
+static const char *osd_version_string = "open-osd 0.2.1";
 
 MODULE_AUTHOR("Boaz Harrosh <bharrosh@panasas.com>");
 MODULE_DESCRIPTION("open-osd Upper-Layer-Driver osd.ko");
index a2f1b3043dfbf88dfb2d3d491c8357aa6fc07d51..9f41b3b4358fd834b4cb708401dad2eb952f50f4 100644 (file)
@@ -1036,8 +1036,7 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr,
            vha->device_flags & DFLG_NO_CABLE)
                len = snprintf(buf, PAGE_SIZE, "Link Down\n");
        else if (atomic_read(&vha->loop_state) != LOOP_READY ||
-           test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-           test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
+           qla2x00_reset_active(vha))
                len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n");
        else {
                len = snprintf(buf, PAGE_SIZE, "Link Up - ");
@@ -1359,8 +1358,7 @@ qla2x00_thermal_temp_show(struct device *dev,
                return snprintf(buf, PAGE_SIZE, "\n");
 
        temp = frac = 0;
-       if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-           test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
+       if (qla2x00_reset_active(vha))
                ql_log(ql_log_warn, vha, 0x707b,
                    "ISP reset active.\n");
        else if (!vha->hw->flags.eeh_busy)
@@ -1379,8 +1377,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr,
        int rval = QLA_FUNCTION_FAILED;
        uint16_t state[5];
 
-       if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-               test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
+       if (qla2x00_reset_active(vha))
                ql_log(ql_log_warn, vha, 0x707c,
                    "ISP reset active.\n");
        else if (!vha->hw->flags.eeh_busy)
@@ -1693,9 +1690,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
        if (IS_FWI2_CAPABLE(ha)) {
                rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma);
        } else if (atomic_read(&base_vha->loop_state) == LOOP_READY &&
-                   !test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) &&
-                   !test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) &&
-                   !ha->dpc_active) {
+           !qla2x00_reset_active(vha) && !ha->dpc_active) {
                /* Must be in a 'READY' state for statistics retrieval. */
                rval = qla2x00_get_link_status(base_vha, base_vha->loop_id,
                                                stats, stats_dma);
index b1d0f936bf2d9530391ec532594a52aee3a154d2..1682e2e4201d9729546cbe43fa5b46889fc7739f 100644 (file)
@@ -108,13 +108,6 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job)
                goto exit_fcp_prio_cfg;
        }
 
-       if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
-               test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-               test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-               ret = -EBUSY;
-               goto exit_fcp_prio_cfg;
-       }
-
        /* Get the sub command */
        oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
 
@@ -646,13 +639,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
        dma_addr_t rsp_data_dma;
        uint32_t rsp_data_len;
 
-       if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
-               test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-               test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-               ql_log(ql_log_warn, vha, 0x7018, "Abort active or needed.\n");
-               return -EBUSY;
-       }
-
        if (!vha->flags.online) {
                ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n");
                return -EIO;
@@ -874,13 +860,6 @@ qla84xx_reset(struct fc_bsg_job *bsg_job)
        int rval = 0;
        uint32_t flag;
 
-       if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
-           test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-           test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-               ql_log(ql_log_warn, vha, 0x702e, "Abort active or needed.\n");
-               return -EBUSY;
-       }
-
        if (!IS_QLA84XX(ha)) {
                ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n");
                return -EINVAL;
@@ -922,11 +901,6 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job)
        uint32_t flag;
        uint32_t fw_ver;
 
-       if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
-               test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-               test_bit(ISP_ABORT_RETRY, &vha->dpc_flags))
-               return -EBUSY;
-
        if (!IS_QLA84XX(ha)) {
                ql_dbg(ql_dbg_user, vha, 0x7032,
                    "Not 84xx, exiting.\n");
@@ -1036,14 +1010,6 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
        uint32_t data_len = 0;
        uint32_t dma_direction = DMA_NONE;
 
-       if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
-               test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-               test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-               ql_log(ql_log_warn, vha, 0x7039,
-                   "Abort active or needed.\n");
-               return -EBUSY;
-       }
-
        if (!IS_QLA84XX(ha)) {
                ql_log(ql_log_warn, vha, 0x703a,
                    "Not 84xx, exiting.\n");
@@ -1246,13 +1212,6 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
 
        bsg_job->reply->reply_payload_rcv_len = 0;
 
-       if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
-               test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
-               test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
-               ql_log(ql_log_warn, vha, 0x7045, "abort active or needed.\n");
-               return -EBUSY;
-       }
-
        if (!IS_IIDMA_CAPABLE(vha->hw)) {
                ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n");
                return -EINVAL;
@@ -1668,6 +1627,15 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
                vha = shost_priv(host);
        }
 
+       if (qla2x00_reset_active(vha)) {
+               ql_dbg(ql_dbg_user, vha, 0x709f,
+                   "BSG: ISP abort active/needed -- cmd=%d.\n",
+                   bsg_job->request->msgcode);
+               bsg_job->reply->result = (DID_ERROR << 16);
+               bsg_job->job_done(bsg_job);
+               return -EBUSY;
+       }
+
        ql_dbg(ql_dbg_user, vha, 0x7000,
            "Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode);
 
index 7c54624b5b1327216c2a7e435a868b91264b7c99..45cbf0ba624dcb6cd66fa5aa3322a35e5eff3d0f 100644 (file)
@@ -19,7 +19,8 @@
  * | DPC Thread                   |       0x401c       |               |
  * | Async Events                 |       0x5057       | 0x5052                |
  * | Timer Routines               |       0x6011       | 0x600e,0x600f  |
- * | User Space Interactions      |       0x709e       |               |
+ * | User Space Interactions      |       0x709e       | 0x7018,0x702e  |
+ * |                              |                    | 0x7039,0x7045  |
  * | Task Management              |       0x803c       | 0x8025-0x8026  |
  * |                              |                    | 0x800b,0x8039  |
  * | AER/EEH                      |       0x900f       |               |
index a6a4eebce4a889c5bfc02c6e5420a469b2517f6f..af1003f9de1e44debaf0dda711e36f6d834b663c 100644 (file)
@@ -44,6 +44,7 @@
  * ISP2100 HBAs.
  */
 #define MAILBOX_REGISTER_COUNT_2100    8
+#define MAILBOX_REGISTER_COUNT_2200    24
 #define MAILBOX_REGISTER_COUNT         32
 
 #define QLA2200A_RISC_ROM_VER  4
index 9902834e0b741f387acfa5a9f9fe2fbc62866847..7cc4f36cd539347a68f3210d0df339c8d6db2416 100644 (file)
@@ -131,3 +131,16 @@ qla2x00_hba_err_chk_enabled(srb_t *sp)
        }
        return 0;
 }
+
+static inline int
+qla2x00_reset_active(scsi_qla_host_t *vha)
+{
+       scsi_qla_host_t *base_vha = pci_get_drvdata(vha->hw->pdev);
+
+       /* Test appropriate base-vha and vha flags. */
+       return test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) ||
+           test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) ||
+           test_bit(ISP_ABORT_RETRY, &base_vha->dpc_flags) ||
+           test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
+           test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
+}
index e804585cc59cf60dc7affc4e45acd47dbecdafff..349843ea32f62333688e2205775e5645a79443d0 100644 (file)
@@ -2090,7 +2090,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
                        break;
                 case CT_IOCB_TYPE:
                        qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE);
-                       clear_bit(MBX_INTERRUPT, &vha->hw->mbx_cmd_flags);
                        break;
                 case ELS_IOCB_TYPE:
                        qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE);
index 34344d3f865832ce963f1091105c4efc753074bf..08f1d01bdc1c7a8650682e8ea8fd63803e156e86 100644 (file)
@@ -342,6 +342,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
 
                                set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
                                clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
+                               /* Allow next mbx cmd to come in. */
+                               complete(&ha->mbx_cmd_comp);
                                if (ha->isp_ops->abort_isp(vha)) {
                                        /* Failed. retry later. */
                                        set_bit(ISP_ABORT_NEEDED,
@@ -350,6 +352,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                                clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
                                ql_dbg(ql_dbg_mbx, base_vha, 0x101f,
                                    "Finished abort_isp.\n");
+                               goto mbx_done;
                        }
                }
        }
@@ -358,6 +361,7 @@ premature_exit:
        /* Allow next mbx cmd to come in. */
        complete(&ha->mbx_cmd_comp);
 
+mbx_done:
        if (rval) {
                ql_dbg(ql_dbg_mbx, base_vha, 0x1020,
                    "**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n",
@@ -2581,7 +2585,8 @@ qla2x00_stop_firmware(scsi_qla_host_t *vha)
        ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__);
 
        mcp->mb[0] = MBC_STOP_FIRMWARE;
-       mcp->out_mb = MBX_0;
+       mcp->mb[1] = 0;
+       mcp->out_mb = MBX_1|MBX_0;
        mcp->in_mb = MBX_0;
        mcp->tov = 5;
        mcp->flags = 0;
index 1cd46cd7ff901de408050541ce8bf8aaeef24853..270ba3130fde94e3bdf359621b298903b5676f58 100644 (file)
@@ -1165,19 +1165,6 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha)
                qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff);
        else
                qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff);
-
-       /* reset ms */
-       val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
-       val |= (1 << 1);
-       qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
-       msleep(20);
-
-       /* unreset ms */
-       val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
-       val &= ~(1 << 1);
-       qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
-       msleep(20);
-
        qla82xx_rom_unlock(ha);
 
        /* Read the signature value from the flash.
@@ -3392,7 +3379,7 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                                            QLA82XX_CRB_PEG_NET_3 + 0x3c),
                                    qla82xx_rd_32(ha,
                                            QLA82XX_CRB_PEG_NET_4 + 0x3c));
-                               if (LSW(MSB(halt_status)) == 0x67)
+                               if (((halt_status & 0x1fffff00) >> 8) == 0x67)
                                        ql_log(ql_log_warn, vha, 0xb052,
                                            "Firmware aborted with "
                                            "error code 0x00006700. Device is "
index 4ed1e4a96b954bf16562ff28dd306f6ab1f79ad2..036030c953392e3fbd57220f5d314770bce769bf 100644 (file)
@@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
                        cmd->result = DID_NO_CONNECT << 16;
                        goto qc24_fail_command;
        }
+
+       if (!fcport) {
+               cmd->result = DID_NO_CONNECT << 16;
+               goto qc24_fail_command;
+       }
+
        if (atomic_read(&fcport->state) != FCS_ONLINE) {
                if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
                        atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
@@ -877,6 +883,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
        if (ha->isp_ops->abort_command(sp)) {
+               ret = FAILED;
                ql_dbg(ql_dbg_taskm, vha, 0x8003,
                    "Abort command mbx failed cmd=%p.\n", cmd);
        } else {
@@ -1124,7 +1131,6 @@ static int
 qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
 {
        scsi_qla_host_t *vha = shost_priv(cmd->device->host);
-       fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
        struct qla_hw_data *ha = vha->hw;
        int ret = FAILED;
        unsigned int id, lun;
@@ -1133,15 +1139,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
        id = cmd->device->id;
        lun = cmd->device->lun;
 
-       if (!fcport) {
-               return ret;
-       }
-
-       ret = fc_block_scsi_eh(cmd);
-       if (ret != 0)
-               return ret;
-       ret = FAILED;
-
        ql_log(ql_log_info, vha, 0x8018,
            "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun);
 
@@ -2047,7 +2044,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
                ha->nvram_data_off = ~0;
                ha->isp_ops = &qla2100_isp_ops;
        } else if (IS_QLA2200(ha)) {
-               ha->mbx_count = MAILBOX_REGISTER_COUNT;
+               ha->mbx_count = MAILBOX_REGISTER_COUNT_2200;
                req_length = REQUEST_ENTRY_CNT_2200;
                rsp_length = RESPONSE_ENTRY_CNT_2100;
                ha->max_loop_id = SNS_LAST_LOOP_ID_2100;
index 23f33a6d52d7278b5cf5d1d42a5bf44330aba183..29d780c3804090fdd169a65619a964a8db49da14 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.03.07.12-k"
+#define QLA2XXX_VERSION      "8.03.07.13-k"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   3
index 78f1111158d75379d4d1c1ef04a139889c280d3d..65253dfbe962b24db546ee83ee8d0ea77a12da83 100644 (file)
@@ -10,6 +10,8 @@
 #include "ql4_def.h"
 #include "ql4_glbl.h"
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #define MASK(n)                DMA_BIT_MASK(n)
 #define MN_WIN(addr)   (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff))
 #define OCM_WIN(addr)  (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff))
@@ -655,27 +657,6 @@ static int qla4_8xxx_pci_is_same_window(struct scsi_qla_host *ha,
        return 0;
 }
 
-#ifndef readq
-static inline __u64 readq(const volatile void __iomem *addr)
-{
-       const volatile u32 __iomem *p = addr;
-       u32 low, high;
-
-       low = readl(p);
-       high = readl(p + 1);
-
-       return low + ((u64)high << 32);
-}
-#endif
-
-#ifndef writeq
-static inline void writeq(__u64 val, volatile void __iomem *addr)
-{
-       writel(val, addr);
-       writel(val >> 32, addr+4);
-}
-#endif
-
 static int qla4_8xxx_pci_mem_read_direct(struct scsi_qla_host *ha,
                u64 off, void *data, int size)
 {
index bf8bf79e6a1f22fe2a9e84f4a2c2bf51abb9ed35..c4670642d023f2fbae4706ad79b9b32d86eb2c0b 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <linux/pm_runtime.h>
 #include <linux/export.h>
+#include <linux/async.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_device.h>
@@ -92,6 +93,19 @@ static int scsi_bus_resume_common(struct device *dev)
        return err;
 }
 
+static int scsi_bus_prepare(struct device *dev)
+{
+       if (scsi_is_sdev_device(dev)) {
+               /* sd probing uses async_schedule.  Wait until it finishes. */
+               async_synchronize_full();
+
+       } else if (scsi_is_host_device(dev)) {
+               /* Wait until async scanning is finished */
+               scsi_complete_async_scans();
+       }
+       return 0;
+}
+
 static int scsi_bus_suspend(struct device *dev)
 {
        return scsi_bus_suspend_common(dev, PMSG_SUSPEND);
@@ -110,6 +124,7 @@ static int scsi_bus_poweroff(struct device *dev)
 #else /* CONFIG_PM_SLEEP */
 
 #define scsi_bus_resume_common         NULL
+#define scsi_bus_prepare               NULL
 #define scsi_bus_suspend               NULL
 #define scsi_bus_freeze                        NULL
 #define scsi_bus_poweroff              NULL
@@ -218,6 +233,7 @@ void scsi_autopm_put_host(struct Scsi_Host *shost)
 #endif /* CONFIG_PM_RUNTIME */
 
 const struct dev_pm_ops scsi_bus_pm_ops = {
+       .prepare =              scsi_bus_prepare,
        .suspend =              scsi_bus_suspend,
        .resume =               scsi_bus_resume_common,
        .freeze =               scsi_bus_freeze,
index 68eadd1c67fd290d0941d357a1cd857389c0e98c..be4fa6d179b123e7cd995eedc4851a31190a6ea9 100644 (file)
@@ -109,6 +109,7 @@ extern void scsi_exit_procfs(void);
 #endif /* CONFIG_PROC_FS */
 
 /* scsi_scan.c */
+extern int scsi_complete_async_scans(void);
 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
                                   unsigned int, unsigned int, int);
 extern void scsi_forget_host(struct Scsi_Host *);
index 89da43f73c00ca209b816ecc68b70a95fbfc0888..29c4c0480976477a314e05abb44d0b9591cb6445 100644 (file)
@@ -1815,6 +1815,7 @@ static void scsi_finish_async_scan(struct async_scan_data *data)
        }
        spin_unlock(&async_scan_lock);
 
+       scsi_autopm_put_host(shost);
        scsi_host_put(shost);
        kfree(data);
 }
@@ -1841,7 +1842,6 @@ static int do_scan_async(void *_data)
 
        do_scsi_scan_host(shost);
        scsi_finish_async_scan(data);
-       scsi_autopm_put_host(shost);
        return 0;
 }
 
@@ -1869,7 +1869,7 @@ void scsi_scan_host(struct Scsi_Host *shost)
        p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
        if (IS_ERR(p))
                do_scan_async(data);
-       /* scsi_autopm_put_host(shost) is called in do_scan_async() */
+       /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */
 }
 EXPORT_SYMBOL(scsi_scan_host);
 
index 0cb39ff21171b323c3df916db675285420822136..f8fb2d691c0a69e6aed9385ba1a81d2cb893967c 100644 (file)
@@ -408,7 +408,7 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s
                        kunmap_atomic(sdt, KM_USER0);
                }
 
-               bio->bi_flags |= BIO_MAPPED_INTEGRITY;
+               bio->bi_flags |= (1 << BIO_MAPPED_INTEGRITY);
        }
 
        return 0;
index 45fee368b0925bec46312dbbe7569c8b5ca2dfc2..92d314a73f69ba0e11d260d4def4a0a5faa4887f 100644 (file)
@@ -190,7 +190,7 @@ static int __init sh_clk_init_parent(struct clk *clk)
                return -EINVAL;
        }
 
-       clk->parent = clk->parent_table[val];
+       clk_reparent(clk, clk->parent_table[val]);
        if (!clk->parent) {
                pr_err("sh_clk_init_parent: unable to set parent");
                return -EINVAL;
index b3d17416d86a393d75bc518b9198fa7277b165d8..830cd62d84925e548cd7480b2d6fb3a4e582a08d 100644 (file)
@@ -365,7 +365,7 @@ config PPC_EPAPR_HV_BYTECHAN
 
 config PPC_EARLY_DEBUG_EHV_BC
        bool "Early console (udbg) support for ePAPR hypervisors"
-       depends on PPC_EPAPR_HV_BYTECHAN
+       depends on PPC_EPAPR_HV_BYTECHAN=y
        help
          Select this option to enable early console (a.k.a. "udbg") support
          via an ePAPR byte channel.  You also need to choose the byte channel
index d136b8f4c8a7635f42b5d580930418d1c938355c..81e2c0d9c17de1a54720ef0b0432208c706a966b 100644 (file)
@@ -187,7 +187,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
                return -ENODEV;
        dev->current_state = PCI_D0;
 
-       if (!dev->irq) {
+       /* The xHCI driver supports MSI and MSI-X,
+        * so don't fail if the BIOS doesn't provide a legacy IRQ.
+        */
+       if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) {
                dev_err(&dev->dev,
                        "Found HC with no IRQ.  Check BIOS/PCI %s setup!\n",
                        pci_name(dev));
index eb19cba34ac9ee0d2c2b078a3c3c3ef7dc42bc49..e1282328fc27f1ef17228ff4ad57747c79e2c927 100644 (file)
@@ -2447,8 +2447,10 @@ int usb_add_hcd(struct usb_hcd *hcd,
                        && device_can_wakeup(&hcd->self.root_hub->dev))
                dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");
 
-       /* enable irqs just before we start the controller */
-       if (usb_hcd_is_primary_hcd(hcd)) {
+       /* enable irqs just before we start the controller,
+        * if the BIOS provides legacy PCI irqs.
+        */
+       if (usb_hcd_is_primary_hcd(hcd) && irqnum) {
                retval = usb_hcd_request_irqs(hcd, irqnum, irqflags);
                if (retval)
                        goto err_request_irq;
index a0613d8f9be785bf0a52827acf2522b109bce1b2..265c2f675d04295e031513fc32506752e7720a99 100644 (file)
@@ -705,10 +705,26 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
        if (type == HUB_INIT3)
                goto init3;
 
-       /* After a resume, port power should still be on.
+       /* The superspeed hub except for root hub has to use Hub Depth
+        * value as an offset into the route string to locate the bits
+        * it uses to determine the downstream port number. So hub driver
+        * should send a set hub depth request to superspeed hub after
+        * the superspeed hub is set configuration in initialization or
+        * reset procedure.
+        *
+        * After a resume, port power should still be on.
         * For any other type of activation, turn it on.
         */
        if (type != HUB_RESUME) {
+               if (hdev->parent && hub_is_superspeed(hdev)) {
+                       ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
+                                       HUB_SET_DEPTH, USB_RT_HUB,
+                                       hdev->level - 1, 0, NULL, 0,
+                                       USB_CTRL_SET_TIMEOUT);
+                       if (ret < 0)
+                               dev_err(hub->intfdev,
+                                               "set hub depth failed\n");
+               }
 
                /* Speed up system boot by using a delayed_work for the
                 * hub's initial power-up delays.  This is pretty awkward
@@ -987,18 +1003,6 @@ static int hub_configure(struct usb_hub *hub,
                goto fail;
        }
 
-       if (hub_is_superspeed(hdev) && (hdev->parent != NULL)) {
-               ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
-                               HUB_SET_DEPTH, USB_RT_HUB,
-                               hdev->level - 1, 0, NULL, 0,
-                               USB_CTRL_SET_TIMEOUT);
-
-               if (ret < 0) {
-                       message = "can't set hub depth";
-                       goto fail;
-               }
-       }
-
        /* Request the entire hub descriptor.
         * hub->descriptor can handle USB_MAXCHILDREN ports,
         * but the hub can/will return fewer bytes here.
index c26a82e83f6e6d11b78f002dc3982df9a3b0a27b..b556a72264d1084b5e6809ea5b4a3f59c5583b82 100644 (file)
@@ -239,7 +239,7 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci,
        ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]);
 }
 
-static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
+static void ehci_fsl_usb_setup(struct ehci_hcd *ehci)
 {
        struct usb_hcd *hcd = ehci_to_hcd(ehci);
        struct fsl_usb2_platform_data *pdata;
@@ -299,19 +299,12 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
 #endif
                out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001);
        }
-
-       if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & CTRL_PHY_CLK_VALID)) {
-               printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n");
-               return -ENODEV;
-       }
-       return 0;
 }
 
 /* called after powerup, by probe or system-pm "wakeup" */
 static int ehci_fsl_reinit(struct ehci_hcd *ehci)
 {
-       if (ehci_fsl_usb_setup(ehci))
-               return -ENODEV;
+       ehci_fsl_usb_setup(ehci);
        ehci_port_power(ehci, 0);
 
        return 0;
index bdf43e2adc51a4fdb4f12ca4e70b1e5c42c62f2c..4918062211656c276f5904cc50d45605076ed026 100644 (file)
@@ -45,6 +45,5 @@
 #define FSL_SOC_USB_PRICTRL    0x40c   /* NOTE: big-endian */
 #define FSL_SOC_USB_SICTRL     0x410   /* NOTE: big-endian */
 #define FSL_SOC_USB_CTRL       0x500   /* NOTE: big-endian */
-#define CTRL_PHY_CLK_VALID     (1 << 17)
 #define SNOOP_SIZE_2GB         0x1e
 #endif                         /* _EHCI_FSL_H */
index ac53a662a6a306cd96b77f69ff154ed8534d6f2f..7732d69e49e012cca439ef21ea6b911cf2942c91 100644 (file)
@@ -872,7 +872,17 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
         */
        if (pdev->vendor == 0x184e)     /* vendor Netlogic */
                return;
+       if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
+                       pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
+                       pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
+                       pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
+               return;
 
+       if (pci_enable_device(pdev) < 0) {
+               dev_warn(&pdev->dev, "Can't enable PCI device, "
+                               "BIOS handoff failed.\n");
+               return;
+       }
        if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
                quirk_usb_handoff_uhci(pdev);
        else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
@@ -881,5 +891,6 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
                quirk_usb_disable_ehci(pdev);
        else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI)
                quirk_usb_handoff_xhci(pdev);
+       pci_disable_device(pdev);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);
index 35e257f79c7b0c7d8565a753e5e5dfb90b128301..557b6f32db86730af004eec3b2ad889bf9457f65 100644 (file)
@@ -93,7 +93,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
         */
        memset(port_removable, 0, sizeof(port_removable));
        for (i = 0; i < ports; i++) {
-               portsc = xhci_readl(xhci, xhci->usb3_ports[i]);
+               portsc = xhci_readl(xhci, xhci->usb2_ports[i]);
                /* If a device is removable, PORTSC reports a 0, same as in the
                 * hub descriptor DeviceRemovable bits.
                 */
index 36cbe2226a44e46b3acd6c8269ede7ab57fc03ad..383fc857491c677fbaf6d0ab56b8cdff9cc415d2 100644 (file)
@@ -1126,26 +1126,42 @@ static unsigned int xhci_parse_exponent_interval(struct usb_device *udev,
 }
 
 /*
- * Convert bInterval expressed in frames (in 1-255 range) to exponent of
+ * Convert bInterval expressed in microframes (in 1-255 range) to exponent of
  * microframes, rounded down to nearest power of 2.
  */
-static unsigned int xhci_parse_frame_interval(struct usb_device *udev,
-               struct usb_host_endpoint *ep)
+static unsigned int xhci_microframes_to_exponent(struct usb_device *udev,
+               struct usb_host_endpoint *ep, unsigned int desc_interval,
+               unsigned int min_exponent, unsigned int max_exponent)
 {
        unsigned int interval;
 
-       interval = fls(8 * ep->desc.bInterval) - 1;
-       interval = clamp_val(interval, 3, 10);
-       if ((1 << interval) != 8 * ep->desc.bInterval)
+       interval = fls(desc_interval) - 1;
+       interval = clamp_val(interval, min_exponent, max_exponent);
+       if ((1 << interval) != desc_interval)
                dev_warn(&udev->dev,
                         "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n",
                         ep->desc.bEndpointAddress,
                         1 << interval,
-                        8 * ep->desc.bInterval);
+                        desc_interval);
 
        return interval;
 }
 
+static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
+               struct usb_host_endpoint *ep)
+{
+       return xhci_microframes_to_exponent(udev, ep,
+                       ep->desc.bInterval, 0, 15);
+}
+
+
+static unsigned int xhci_parse_frame_interval(struct usb_device *udev,
+               struct usb_host_endpoint *ep)
+{
+       return xhci_microframes_to_exponent(udev, ep,
+                       ep->desc.bInterval * 8, 3, 10);
+}
+
 /* Return the polling or NAK interval.
  *
  * The polling interval is expressed in "microframes".  If xHCI's Interval field
@@ -1164,7 +1180,7 @@ static unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
                /* Max NAK rate */
                if (usb_endpoint_xfer_control(&ep->desc) ||
                    usb_endpoint_xfer_bulk(&ep->desc)) {
-                       interval = ep->desc.bInterval;
+                       interval = xhci_parse_microframe_interval(udev, ep);
                        break;
                }
                /* Fall through - SS and HS isoc/int have same decoding */
index 6bbe3c3a71115e61ee7fe663758789088c21d340..c939f5fdef9e2414f61f63cd07776041d5411cf9 100644 (file)
@@ -352,6 +352,11 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
                /* hcd->irq is -1, we have MSI */
                return 0;
 
+       if (!pdev->irq) {
+               xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n");
+               return -EINVAL;
+       }
+
        /* fall back to legacy interrupt*/
        ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
                        hcd->irq_descr, hcd);
index 8dbf51a43c45d2fcaf61cf5f6d26d1b65a4e96cf..08a5575724cd3f12b1a55966db21ac95e8495806 100644 (file)
@@ -136,6 +136,8 @@ static const struct usb_device_id id_table[] = {
        { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
        { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
        { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
+       { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
+       { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
        { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
        { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
        { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
index 39ed1f46cec09a93a4ad809d77b9813d1977db6e..b54afceb9611badc2b3e7cb45c33a12bcefbd0cc 100644 (file)
@@ -788,7 +788,6 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff),
@@ -803,7 +802,6 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
-       /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
@@ -828,7 +826,6 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
-       /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
@@ -836,7 +833,6 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff),
@@ -846,7 +842,6 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
@@ -865,8 +860,6 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0098, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0099, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
@@ -887,28 +880,18 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
@@ -1083,127 +1066,27 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1403, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1404, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1405, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1406, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1407, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1408, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1409, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1410, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1411, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1412, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1413, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1414, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1415, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1416, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1417, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1418, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1419, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1420, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1421, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1422, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1423, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1427, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1429, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1430, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1431, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1432, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1433, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1434, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1435, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1436, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1437, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1438, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1439, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1440, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1441, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1442, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1443, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1444, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1445, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1446, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1447, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1448, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1449, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1450, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1451, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1452, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1453, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1454, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1455, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1456, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1457, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1458, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1459, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1460, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1461, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1462, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1463, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1464, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1465, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1466, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1467, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1468, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1469, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1470, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1471, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1472, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1473, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1474, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1475, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1476, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1477, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1478, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1479, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1480, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1482, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1483, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1484, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1486, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1487, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1488, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1489, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1490, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1491, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1492, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1493, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1494, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1495, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1496, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1497, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1498, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1499, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1500, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1501, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1502, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1503, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1504, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1505, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1506, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1507, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1508, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1509, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1510, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
+         0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
+
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
-         0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
-       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
+
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
index 8468eb769a2919d38316993e670cb2810dfacbd7..75b838eff178ca743a3f53069ef2d515cb6f0b15 100644 (file)
@@ -165,7 +165,7 @@ static unsigned int product_5052_count;
 /* the array dimension is the number of default entries plus */
 /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */
 /* null entry */
-static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = {
+static struct usb_device_id ti_id_table_3410[14+TI_EXTRA_VID_PID_COUNT+1] = {
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
        { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
@@ -179,6 +179,7 @@ static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = {
        { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
        { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
        { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
+       { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) },
 };
 
 static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
@@ -188,7 +189,7 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
        { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
 };
 
-static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] = {
+static struct usb_device_id ti_id_table_combined[18+2*TI_EXTRA_VID_PID_COUNT+1] = {
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
        { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
        { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
@@ -206,6 +207,7 @@ static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1]
        { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
        { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
        { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
+       { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) },
        { }
 };
 
index 2aac1953993b1c9508283a8ecfef303c9fa26f1e..f140f1b9d5c078283a18816d9afd718ca68c5be1 100644 (file)
 #define MTS_MT9234ZBA_PRODUCT_ID       0xF115
 #define MTS_MT9234ZBAOLD_PRODUCT_ID    0x0319
 
+/* Abbott Diabetics vendor and product ids */
+#define ABBOTT_VENDOR_ID               0x1a61
+#define ABBOTT_PRODUCT_ID              0x3410
+
 /* Commands */
 #define TI_GET_VERSION                 0x01
 #define TI_GET_PORT_STATUS             0x02
index 3dd7da9fd5043cad98a00e552ba8c11ebe9ff581..db51ba16dc0755d6b7876c115abd10eba6e876c7 100644 (file)
@@ -788,15 +788,19 @@ static void quiesce_and_remove_host(struct us_data *us)
        struct Scsi_Host *host = us_to_host(us);
 
        /* If the device is really gone, cut short reset delays */
-       if (us->pusb_dev->state == USB_STATE_NOTATTACHED)
+       if (us->pusb_dev->state == USB_STATE_NOTATTACHED) {
                set_bit(US_FLIDX_DISCONNECTING, &us->dflags);
+               wake_up(&us->delay_wait);
+       }
 
-       /* Prevent SCSI-scanning (if it hasn't started yet)
-        * and wait for the SCSI-scanning thread to stop.
+       /* Prevent SCSI scanning (if it hasn't started yet)
+        * or wait for the SCSI-scanning routine to stop.
         */
-       set_bit(US_FLIDX_DONT_SCAN, &us->dflags);
-       wake_up(&us->delay_wait);
-       wait_for_completion(&us->scanning_done);
+       cancel_delayed_work_sync(&us->scan_dwork);
+
+       /* Balance autopm calls if scanning was cancelled */
+       if (test_bit(US_FLIDX_SCAN_PENDING, &us->dflags))
+               usb_autopm_put_interface_no_suspend(us->pusb_intf);
 
        /* Removing the host will perform an orderly shutdown: caches
         * synchronized, disks spun down, etc.
@@ -823,53 +827,28 @@ static void release_everything(struct us_data *us)
        scsi_host_put(us_to_host(us));
 }
 
-/* Thread to carry out delayed SCSI-device scanning */
-static int usb_stor_scan_thread(void * __us)
+/* Delayed-work routine to carry out SCSI-device scanning */
+static void usb_stor_scan_dwork(struct work_struct *work)
 {
-       struct us_data *us = (struct us_data *)__us;
+       struct us_data *us = container_of(work, struct us_data,
+                       scan_dwork.work);
        struct device *dev = &us->pusb_intf->dev;
 
-       dev_dbg(dev, "device found\n");
-
-       set_freezable();
+       dev_dbg(dev, "starting scan\n");
 
-       /*
-        * Wait for the timeout to expire or for a disconnect
-        *
-        * We can't freeze in this thread or we risk causing khubd to
-        * fail to freeze, but we can't be non-freezable either. Nor can
-        * khubd freeze while waiting for scanning to complete as it may
-        * hold the device lock, causing a hang when suspending devices.
-        * So instead of using wait_event_freezable(), explicitly test
-        * for (DONT_SCAN || freezing) in interruptible wait and proceed
-        * if any of DONT_SCAN, freezing or timeout has happened.
-        */
-       if (delay_use > 0) {
-               dev_dbg(dev, "waiting for device to settle "
-                               "before scanning\n");
-               wait_event_interruptible_timeout(us->delay_wait,
-                               test_bit(US_FLIDX_DONT_SCAN, &us->dflags) ||
-                               freezing(current), delay_use * HZ);
+       /* For bulk-only devices, determine the max LUN value */
+       if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN)) {
+               mutex_lock(&us->dev_mutex);
+               us->max_lun = usb_stor_Bulk_max_lun(us);
+               mutex_unlock(&us->dev_mutex);
        }
+       scsi_scan_host(us_to_host(us));
+       dev_dbg(dev, "scan complete\n");
 
-       /* If the device is still connected, perform the scanning */
-       if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags)) {
-
-               /* For bulk-only devices, determine the max LUN value */
-               if (us->protocol == USB_PR_BULK &&
-                               !(us->fflags & US_FL_SINGLE_LUN)) {
-                       mutex_lock(&us->dev_mutex);
-                       us->max_lun = usb_stor_Bulk_max_lun(us);
-                       mutex_unlock(&us->dev_mutex);
-               }
-               scsi_scan_host(us_to_host(us));
-               dev_dbg(dev, "scan complete\n");
-
-               /* Should we unbind if no devices were detected? */
-       }
+       /* Should we unbind if no devices were detected? */
 
        usb_autopm_put_interface(us->pusb_intf);
-       complete_and_exit(&us->scanning_done, 0);
+       clear_bit(US_FLIDX_SCAN_PENDING, &us->dflags);
 }
 
 static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf)
@@ -916,7 +895,7 @@ int usb_stor_probe1(struct us_data **pus,
        init_completion(&us->cmnd_ready);
        init_completion(&(us->notify));
        init_waitqueue_head(&us->delay_wait);
-       init_completion(&us->scanning_done);
+       INIT_DELAYED_WORK(&us->scan_dwork, usb_stor_scan_dwork);
 
        /* Associate the us_data structure with the USB device */
        result = associate_dev(us, intf);
@@ -947,7 +926,6 @@ EXPORT_SYMBOL_GPL(usb_stor_probe1);
 /* Second part of general USB mass-storage probing */
 int usb_stor_probe2(struct us_data *us)
 {
-       struct task_struct *th;
        int result;
        struct device *dev = &us->pusb_intf->dev;
 
@@ -988,20 +966,14 @@ int usb_stor_probe2(struct us_data *us)
                goto BadDevice;
        }
 
-       /* Start up the thread for delayed SCSI-device scanning */
-       th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan");
-       if (IS_ERR(th)) {
-               dev_warn(dev,
-                               "Unable to start the device-scanning thread\n");
-               complete(&us->scanning_done);
-               quiesce_and_remove_host(us);
-               result = PTR_ERR(th);
-               goto BadDevice;
-       }
-
+       /* Submit the delayed_work for SCSI-device scanning */
        usb_autopm_get_interface_no_resume(us->pusb_intf);
-       wake_up_process(th);
+       set_bit(US_FLIDX_SCAN_PENDING, &us->dflags);
 
+       if (delay_use > 0)
+               dev_dbg(dev, "waiting for device to settle before scanning\n");
+       queue_delayed_work(system_freezable_wq, &us->scan_dwork,
+                       delay_use * HZ);
        return 0;
 
        /* We come here if there are any problems */
index 7b0f2113632efb52ada464fc17dd83a74f34ea5a..75f70f04f37b89ba0ee63495298bc995da0024e4 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/blkdev.h>
 #include <linux/completion.h>
 #include <linux/mutex.h>
+#include <linux/workqueue.h>
 #include <scsi/scsi_host.h>
 
 struct us_data;
@@ -72,7 +73,7 @@ struct us_unusual_dev {
 #define US_FLIDX_DISCONNECTING 3       /* disconnect in progress   */
 #define US_FLIDX_RESETTING     4       /* device reset in progress */
 #define US_FLIDX_TIMED_OUT     5       /* SCSI midlayer timed out  */
-#define US_FLIDX_DONT_SCAN     6       /* don't scan (disconnect)  */
+#define US_FLIDX_SCAN_PENDING  6       /* scanning not yet done    */
 #define US_FLIDX_REDO_READ10   7       /* redo READ(10) command    */
 #define US_FLIDX_READ10_WORKED 8       /* previous READ(10) succeeded */
 
@@ -147,8 +148,8 @@ struct us_data {
        /* mutual exclusion and synchronization structures */
        struct completion       cmnd_ready;      /* to sleep thread on      */
        struct completion       notify;          /* thread begin/end        */
-       wait_queue_head_t       delay_wait;      /* wait during scan, reset */
-       struct completion       scanning_done;   /* wait for scan thread    */
+       wait_queue_head_t       delay_wait;      /* wait during reset       */
+       struct delayed_work     scan_dwork;      /* for async scanning      */
 
        /* subdriver information */
        void                    *extra;          /* Any extra data          */
index 74d29b552901e3ee5a6ee1d5b65f86da6eb124ad..408a9927be925159d9dd93d7fddfbf96eb3389c6 100644 (file)
@@ -12,7 +12,7 @@ config PANEL_GENERIC_DPI
 
 config PANEL_DVI
        tristate "DVI output"
-       depends on OMAP2_DSS_DPI
+       depends on OMAP2_DSS_DPI && I2C
        help
          Driver for external monitors, connected via DVI. The driver uses i2c
          to read EDID information from the monitor.
index 052dc874cd3d9e6696c36f9e6e214081433d07e5..87b3e25294cf506f7b70431b0a6fbc7df569a5f0 100644 (file)
@@ -1276,6 +1276,9 @@ int dss_ovl_enable(struct omap_overlay *ovl)
 
        spin_unlock_irqrestore(&data_lock, flags);
 
+       /* wait for overlay to be enabled */
+       wait_pending_extra_info_updates();
+
        mutex_unlock(&apply_lock);
 
        return 0;
@@ -1313,6 +1316,9 @@ int dss_ovl_disable(struct omap_overlay *ovl)
 
        spin_unlock_irqrestore(&data_lock, flags);
 
+       /* wait for the overlay to be disabled */
+       wait_pending_extra_info_updates();
+
        mutex_unlock(&apply_lock);
 
        return 0;
index d7aa3b056529e9469a8e3c0346ebbe421a2df1be..a36b934b2db4f8c5d7a71d67c4849020b54d455f 100644 (file)
@@ -165,9 +165,25 @@ static int hdmi_runtime_get(void)
 
        DSSDBG("hdmi_runtime_get\n");
 
+       /*
+        * HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled.
+        * This should be removed later.
+        */
+       r = dss_runtime_get();
+       if (r < 0)
+               goto err_get_dss;
+
        r = pm_runtime_get_sync(&hdmi.pdev->dev);
        WARN_ON(r < 0);
-       return r < 0 ? r : 0;
+       if (r < 0)
+               goto err_get_hdmi;
+
+       return 0;
+
+err_get_hdmi:
+       dss_runtime_put();
+err_get_dss:
+       return r;
 }
 
 static void hdmi_runtime_put(void)
@@ -178,6 +194,12 @@ static void hdmi_runtime_put(void)
 
        r = pm_runtime_put_sync(&hdmi.pdev->dev);
        WARN_ON(r < 0);
+
+       /*
+        * HACK: This is added to complement the dss_runtime_get() call in
+        * hdmi_runtime_get(). This should be removed later.
+        */
+       dss_runtime_put();
 }
 
 int hdmi_init_display(struct omap_dss_device *dssdev)
index 2d72334ca3da9a7d3bac43fba0c7e1ce6c26621e..6847a478b4598d76138b9a331e92d5d0f0239d5c 100644 (file)
@@ -479,14 +479,7 @@ int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data,
 
 bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data)
 {
-       int r;
-
-       void __iomem *base = hdmi_core_sys_base(ip_data);
-
-       /* HPD */
-       r = REG_GET(base, HDMI_CORE_SYS_SYS_STAT, 1, 1);
-
-       return r == 1;
+       return gpio_get_value(ip_data->hpd_gpio);
 }
 
 static void hdmi_core_init(struct hdmi_core_video_config *video_cfg,
index f9975100d56d3f311e812c71ad4cd8219e0a797f..3a3fdc62c75b354c08f461b4ab92c1f05e0d5f2d 100644 (file)
@@ -1061,7 +1061,7 @@ static struct pvr2_board {
        int (*init)(void);
        void (*exit)(void);
        char name[16];
-} board_driver[] = {
+} board_driver[] __refdata = {
 #ifdef CONFIG_SH_DREAMCAST
        { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" },
 #endif
index d5aaca9cfa7e2b7b6a4e5770b5965cbc199e262a..8497727d66de0d282d158d35a22b938918f3356a 100644 (file)
@@ -1810,7 +1810,11 @@ static void hw_init(void)
                break;
        }
 
+       /* magic required on VX900 for correct modesetting on IGA1 */
+       via_write_reg_mask(VIACR, 0x45, 0x00, 0x01);
+
        /* probably this should go to the scaling code one day */
+       via_write_reg_mask(VIACR, 0xFD, 0, 0x80); /* VX900 hw scale on IGA2 */
        viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters));
 
        /* Fill VPIT Parameters */
index 95aeedf198f8c9b6ee08fa59b8767d66f3ec0cc6..958e5129c6012560746643b9ec2c1de8ee350219 100644 (file)
@@ -367,29 +367,45 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev)
 #ifdef CONFIG_PM
 static int virtballoon_freeze(struct virtio_device *vdev)
 {
+       struct virtio_balloon *vb = vdev->priv;
+
        /*
         * The kthread is already frozen by the PM core before this
         * function is called.
         */
 
+       while (vb->num_pages)
+               leak_balloon(vb, vb->num_pages);
+       update_balloon_size(vb);
+
        /* Ensure we don't get any more requests from the host */
        vdev->config->reset(vdev);
        vdev->config->del_vqs(vdev);
        return 0;
 }
 
+static int restore_common(struct virtio_device *vdev)
+{
+       struct virtio_balloon *vb = vdev->priv;
+       int ret;
+
+       ret = init_vqs(vdev->priv);
+       if (ret)
+               return ret;
+
+       fill_balloon(vb, towards_target(vb));
+       update_balloon_size(vb);
+       return 0;
+}
+
 static int virtballoon_thaw(struct virtio_device *vdev)
 {
-       return init_vqs(vdev->priv);
+       return restore_common(vdev);
 }
 
 static int virtballoon_restore(struct virtio_device *vdev)
 {
        struct virtio_balloon *vb = vdev->priv;
-       struct page *page, *page2;
-
-       /* We're starting from a clean slate */
-       vb->num_pages = 0;
 
        /*
         * If a request wasn't complete at the time of freezing, this
@@ -397,12 +413,7 @@ static int virtballoon_restore(struct virtio_device *vdev)
         */
        vb->need_stats_update = 0;
 
-       /* We don't have these pages in the balloon anymore! */
-       list_for_each_entry_safe(page, page2, &vb->pages, lru) {
-               list_del(&page->lru);
-               totalram_pages++;
-       }
-       return init_vqs(vdev->priv);
+       return restore_common(vdev);
 }
 #endif
 
index 877b107f77a769577111ce5f9eee41742be8fa32..df9e8f0e327d3247e025794a8ce431f9015439d8 100644 (file)
@@ -1098,7 +1098,7 @@ config BOOKE_WDT_DEFAULT_TIMEOUT
          For Freescale Book-E processors, this is a number between 0 and 63.
          For other Book-E processors, this is a number between 0 and 3.
 
-         The value can be overidden by the wdt_period command-line parameter.
+         The value can be overridden by the wdt_period command-line parameter.
 
 # PPC64 Architecture
 
index 337265b47305b7f74d7935f7da1b4c85e7fd99cf..7c0fdfca26469be5643f994a88c950c2855e4768 100644 (file)
@@ -198,9 +198,13 @@ static long booke_wdt_ioctl(struct file *file,
                booke_wdt_period = tmp;
 #endif
                booke_wdt_set();
-               return 0;
+               /* Fall */
        case WDIOC_GETTIMEOUT:
+#ifdef CONFIG_FSL_BOOKE
+               return put_user(period_to_sec(booke_wdt_period), p);
+#else
                return put_user(booke_wdt_period, p);
+#endif
        default:
                return -ENOTTY;
        }
index 8464ea1c36a1080f4c4b4045333a70b963d08b5d..3c166d3f4e558e4d73ef3ccc333a5678cf7654ee 100644 (file)
@@ -231,7 +231,7 @@ static int __devinit cru_detect(unsigned long map_entry,
 
        cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE;
 
-       set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE));
+       set_memory_x((unsigned long)bios32_map, 2);
        asminline_call(&cmn_regs, bios32_entrypoint);
 
        if (cmn_regs.u1.ral != 0) {
@@ -250,7 +250,8 @@ static int __devinit cru_detect(unsigned long map_entry,
                        cru_rom_addr =
                                ioremap(cru_physical_address, cru_length);
                        if (cru_rom_addr) {
-                               set_memory_x((unsigned long)cru_rom_addr, cru_length);
+                               set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK,
+                                       (cru_length + PAGE_SIZE - 1) >> PAGE_SHIFT);
                                retval = 0;
                        }
                }
index 8e210aafdfd05396db165bd32c4f68a07e25e05f..dfae030a7ef2553ee6e2d44b59834bc4e3e57003 100644 (file)
@@ -264,7 +264,7 @@ static int __devinit pnx4008_wdt_probe(struct platform_device *pdev)
        wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (wdt_mem == NULL) {
                printk(KERN_INFO MODULE_NAME
-                       "failed to get memory region resouce\n");
+                       "failed to get memory region resource\n");
                return -ENOENT;
        }
 
index 4bc3744e14e4bf54f80a84585d3626d64635ba21..404172f02c9bea73f2be2b523c979693e69679d1 100644 (file)
@@ -312,18 +312,26 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
        dev = &pdev->dev;
        wdt_dev = &pdev->dev;
 
-       /* get the memory region for the watchdog timer */
-
        wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (wdt_mem == NULL) {
                dev_err(dev, "no memory resource specified\n");
                return -ENOENT;
        }
 
+       wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+       if (wdt_irq == NULL) {
+               dev_err(dev, "no irq resource specified\n");
+               ret = -ENOENT;
+               goto err;
+       }
+
+       /* get the memory region for the watchdog timer */
+
        size = resource_size(wdt_mem);
        if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
                dev_err(dev, "failed to get memory region\n");
-               return -EBUSY;
+               ret = -EBUSY;
+               goto err;
        }
 
        wdt_base = ioremap(wdt_mem->start, size);
@@ -335,29 +343,17 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
 
        DBG("probe: mapped wdt_base=%p\n", wdt_base);
 
-       wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       if (wdt_irq == NULL) {
-               dev_err(dev, "no irq resource specified\n");
-               ret = -ENOENT;
-               goto err_map;
-       }
-
-       ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev);
-       if (ret != 0) {
-               dev_err(dev, "failed to install irq (%d)\n", ret);
-               goto err_map;
-       }
-
        wdt_clock = clk_get(&pdev->dev, "watchdog");
        if (IS_ERR(wdt_clock)) {
                dev_err(dev, "failed to find watchdog clock source\n");
                ret = PTR_ERR(wdt_clock);
-               goto err_irq;
+               goto err_map;
        }
 
        clk_enable(wdt_clock);
 
-       if (s3c2410wdt_cpufreq_register() < 0) {
+       ret = s3c2410wdt_cpufreq_register();
+       if (ret < 0) {
                printk(KERN_ERR PFX "failed to register cpufreq\n");
                goto err_clk;
        }
@@ -378,12 +374,18 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
                                                        "cannot start\n");
        }
 
+       ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev);
+       if (ret != 0) {
+               dev_err(dev, "failed to install irq (%d)\n", ret);
+               goto err_cpufreq;
+       }
+
        watchdog_set_nowayout(&s3c2410_wdd, nowayout);
 
        ret = watchdog_register_device(&s3c2410_wdd);
        if (ret) {
                dev_err(dev, "cannot register watchdog (%d)\n", ret);
-               goto err_cpufreq;
+               goto err_irq;
        }
 
        if (tmr_atboot && started == 0) {
@@ -408,23 +410,26 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
 
        return 0;
 
+ err_irq:
+       free_irq(wdt_irq->start, pdev);
+
  err_cpufreq:
        s3c2410wdt_cpufreq_deregister();
 
  err_clk:
        clk_disable(wdt_clock);
        clk_put(wdt_clock);
-
- err_irq:
-       free_irq(wdt_irq->start, pdev);
+       wdt_clock = NULL;
 
  err_map:
        iounmap(wdt_base);
 
  err_req:
        release_mem_region(wdt_mem->start, size);
-       wdt_mem = NULL;
 
+ err:
+       wdt_irq = NULL;
+       wdt_mem = NULL;
        return ret;
 }
 
@@ -432,18 +437,18 @@ static int __devexit s3c2410wdt_remove(struct platform_device *dev)
 {
        watchdog_unregister_device(&s3c2410_wdd);
 
+       free_irq(wdt_irq->start, dev);
+
        s3c2410wdt_cpufreq_deregister();
 
        clk_disable(wdt_clock);
        clk_put(wdt_clock);
        wdt_clock = NULL;
 
-       free_irq(wdt_irq->start, dev);
-       wdt_irq = NULL;
-
        iounmap(wdt_base);
 
        release_mem_region(wdt_mem->start, resource_size(wdt_mem));
+       wdt_irq = NULL;
        wdt_mem = NULL;
        return 0;
 }
index 969beb0e22311a4f7e7f4155524709d5dd8269bf..67e4b9047cc944eb63beca468f77e1194956f931 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -490,6 +490,8 @@ static void kiocb_batch_free(struct kioctx *ctx, struct kiocb_batch *batch)
                kmem_cache_free(kiocb_cachep, req);
                ctx->reqs_active--;
        }
+       if (unlikely(!ctx->reqs_active && ctx->dead))
+               wake_up_all(&ctx->wait);
        spin_unlock_irq(&ctx->ctx_lock);
 }
 
index d8d8e7ba6a1e1bf52c367a73514aeaa202b8fcea..eb1cc92cd67d26d2966fa1191bb373f646144583 100644 (file)
@@ -110,6 +110,7 @@ struct autofs_sb_info {
        int sub_version;
        int min_proto;
        int max_proto;
+       int compat_daemon;
        unsigned long exp_timeout;
        unsigned int type;
        int reghost_enabled;
index 76741d8d77866496496115312f6831b85cc51570..85f1fcdb30e75b4ad2da3d2dd8c1286664b6a3dd 100644 (file)
@@ -385,6 +385,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
                sbi->pipefd = pipefd;
                sbi->pipe = pipe;
                sbi->catatonic = 0;
+               sbi->compat_daemon = is_compat_task();
        }
 out:
        mutex_unlock(&sbi->wq_mutex);
index 450f529a4eaeb6e6d48bd147548a2ad3fb72f961..1feb68ecef9509dd88a4323f3193845af6a84e15 100644 (file)
@@ -124,6 +124,7 @@ start:
        /* Negative dentry - try next */
        if (!simple_positive(q)) {
                spin_unlock(&p->d_lock);
+               lock_set_subclass(&q->d_lock.dep_map, 0, _RET_IP_);
                p = q;
                goto again;
        }
@@ -186,6 +187,7 @@ again:
        /* Negative dentry - try next */
        if (!simple_positive(ret)) {
                spin_unlock(&p->d_lock);
+               lock_set_subclass(&ret->d_lock.dep_map, 0, _RET_IP_);
                p = ret;
                goto again;
        }
index e16980b00b8d7315dda8d7b92d93fdaf7062e843..06858d955120ed43fab44309f1bc978f11c24124 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/parser.h>
 #include <linux/bitops.h>
 #include <linux/magic.h>
+#include <linux/compat.h>
 #include "autofs_i.h"
 #include <linux/module.h>
 
@@ -224,6 +225,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        set_autofs_type_indirect(&sbi->type);
        sbi->min_proto = 0;
        sbi->max_proto = 0;
+       sbi->compat_daemon = is_compat_task();
        mutex_init(&sbi->wq_mutex);
        mutex_init(&sbi->pipe_mutex);
        spin_lock_init(&sbi->fs_lock);
index da8876d38a7b7e3a50101f02817cbbbc460cec20..9c098db433441a36613dd126b8487ed54036f49e 100644 (file)
@@ -91,7 +91,24 @@ static int autofs4_write(struct autofs_sb_info *sbi,
 
        return (bytes > 0);
 }
-       
+
+/*
+ * The autofs_v5 packet was misdesigned.
+ *
+ * The packets are identical on x86-32 and x86-64, but have different
+ * alignment. Which means that 'sizeof()' will give different results.
+ * Fix it up for the case of running 32-bit user mode on a 64-bit kernel.
+ */
+static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi)
+{
+       size_t pktsz = sizeof(struct autofs_v5_packet);
+#if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT)
+       if (sbi->compat_daemon > 0)
+               pktsz -= 4;
+#endif
+       return pktsz;
+}
+
 static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
                                 struct autofs_wait_queue *wq,
                                 int type)
@@ -155,8 +172,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
        {
                struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
 
-               pktsz = sizeof(*packet);
-
+               pktsz = autofs_v5_packet_size(sbi);
                packet->wait_queue_token = wq->wait_queue_token;
                packet->len = wq->name.len;
                memcpy(packet->name, wq->name.name, wq->name.len);
index a6395bdb26aeb13b7b98c74df4f77780c1c95412..1ff94054d35aba8a5c0748585006641010a322af 100644 (file)
@@ -259,6 +259,13 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        current->mm->free_area_cache = current->mm->mmap_base;
        current->mm->cached_hole_size = 0;
 
+       retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
+       if (retval < 0) {
+               /* Someone check-me: is this error path enough? */
+               send_sig(SIGKILL, current, 0);
+               return retval;
+       }
+
        install_exec_creds(bprm);
        current->flags &= ~PF_FORKNOEXEC;
 
@@ -352,13 +359,6 @@ beyond_if:
                return retval;
        }
 
-       retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
-       if (retval < 0) { 
-               /* Someone check-me: is this error path enough? */ 
-               send_sig(SIGKILL, current, 0); 
-               return retval;
-       }
-
        current->mm->start_stack =
                (unsigned long) create_aout_tables((char __user *) bprm->p, bprm);
 #ifdef __alpha__
index bcb884e2d613e76d94570dd81b99ba27e3906a66..07d096c49920cf21308480da107a6064a889db47 100644 (file)
@@ -1421,7 +1421,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
        for (i = 1; i < view->n; ++i) {
                const struct user_regset *regset = &view->regsets[i];
                do_thread_regset_writeback(t->task, regset);
-               if (regset->core_note_type &&
+               if (regset->core_note_type && regset->get &&
                    (!regset->active || regset->active(t->task, regset))) {
                        int ret;
                        size_t size = regset->n * regset->size;
index 633c701a287d4be0242d5b1706515aad4845ecfb..98f6bf10bbd47d26e79d59e6d629e53b2d230500 100644 (file)
@@ -892,6 +892,8 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
                if (eb != eb_in)
                        free_extent_buffer(eb);
                ret = inode_ref_info(parent, 0, fs_root, path, &found_key);
+               if (ret > 0)
+                       ret = -ENOENT;
                if (ret)
                        break;
                next_inum = found_key.offset;
index b669a7d8e499433c322d6ef49759f4f95e172743..d986824bb2b4f8eacafcda957978f0efe8aa8e25 100644 (file)
@@ -644,7 +644,7 @@ static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(
 static int btrfsic_process_superblock(struct btrfsic_state *state,
                                      struct btrfs_fs_devices *fs_devices)
 {
-       int ret;
+       int ret = 0;
        struct btrfs_super_block *selected_super;
        struct list_head *dev_head = &fs_devices->devices;
        struct btrfs_device *device;
index 14f1c5a0b2d29f187955e9327cac6243715409f0..d02c27cd14c7073e05171150dc9b9d14bf78013c 100644 (file)
@@ -588,6 +588,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
                                   page_offset(bio->bi_io_vec->bv_page),
                                   PAGE_CACHE_SIZE);
        read_unlock(&em_tree->lock);
+       if (!em)
+               return -EIO;
 
        compressed_len = em->block_len;
        cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
index 27ebe61d3cccd0233518d743216dce4b7b8c933f..80b6486fd5e647b6663687cce5aa66b764de3ed0 100644 (file)
@@ -886,7 +886,7 @@ struct btrfs_block_rsv {
        u64 reserved;
        struct btrfs_space_info *space_info;
        spinlock_t lock;
-       unsigned int full:1;
+       unsigned int full;
 };
 
 /*
index 811d9f918b1c2923c1b35a5ae966808b0e3c2fe6..534266fe505f25cf4a89e25036ff7994cb8c28d5 100644 (file)
@@ -2260,6 +2260,12 @@ int open_ctree(struct super_block *sb,
                goto fail_sb_buffer;
        }
 
+       if (sectorsize < PAGE_SIZE) {
+               printk(KERN_WARNING "btrfs: Incompatible sector size "
+                      "found on %s\n", sb->s_id);
+               goto fail_sb_buffer;
+       }
+
        mutex_lock(&fs_info->chunk_mutex);
        ret = btrfs_read_sys_array(tree_root);
        mutex_unlock(&fs_info->chunk_mutex);
@@ -2301,6 +2307,12 @@ int open_ctree(struct super_block *sb,
 
        btrfs_close_extra_devices(fs_devices);
 
+       if (!fs_devices->latest_bdev) {
+               printk(KERN_CRIT "btrfs: failed to read devices on %s\n",
+                      sb->s_id);
+               goto fail_tree_roots;
+       }
+
 retry_root_backup:
        blocksize = btrfs_level_size(tree_root,
                                     btrfs_super_root_level(disk_super));
index 283af7a676a39b4c2f31d7d9b7caf81607eee4ea..37e0a800d34e3a867437a9c1b2072e51a7ccc743 100644 (file)
@@ -3312,7 +3312,8 @@ commit_trans:
        }
        data_sinfo->bytes_may_use += bytes;
        trace_btrfs_space_reservation(root->fs_info, "space_info",
-                                     (u64)data_sinfo, bytes, 1);
+                                     (u64)(unsigned long)data_sinfo,
+                                     bytes, 1);
        spin_unlock(&data_sinfo->lock);
 
        return 0;
@@ -3333,7 +3334,8 @@ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes)
        spin_lock(&data_sinfo->lock);
        data_sinfo->bytes_may_use -= bytes;
        trace_btrfs_space_reservation(root->fs_info, "space_info",
-                                     (u64)data_sinfo, bytes, 0);
+                                     (u64)(unsigned long)data_sinfo,
+                                     bytes, 0);
        spin_unlock(&data_sinfo->lock);
 }
 
@@ -3611,12 +3613,15 @@ static int may_commit_transaction(struct btrfs_root *root,
        if (space_info != delayed_rsv->space_info)
                return -ENOSPC;
 
+       spin_lock(&space_info->lock);
        spin_lock(&delayed_rsv->lock);
-       if (delayed_rsv->size < bytes) {
+       if (space_info->bytes_pinned + delayed_rsv->size < bytes) {
                spin_unlock(&delayed_rsv->lock);
+               spin_unlock(&space_info->lock);
                return -ENOSPC;
        }
        spin_unlock(&delayed_rsv->lock);
+       spin_unlock(&space_info->lock);
 
 commit:
        trans = btrfs_join_transaction(root);
@@ -3695,9 +3700,9 @@ again:
                if (used + orig_bytes <= space_info->total_bytes) {
                        space_info->bytes_may_use += orig_bytes;
                        trace_btrfs_space_reservation(root->fs_info,
-                                                     "space_info",
-                                                     (u64)space_info,
-                                                     orig_bytes, 1);
+                                             "space_info",
+                                             (u64)(unsigned long)space_info,
+                                             orig_bytes, 1);
                        ret = 0;
                } else {
                        /*
@@ -3766,9 +3771,9 @@ again:
                if (used + num_bytes < space_info->total_bytes + avail) {
                        space_info->bytes_may_use += orig_bytes;
                        trace_btrfs_space_reservation(root->fs_info,
-                                                     "space_info",
-                                                     (u64)space_info,
-                                                     orig_bytes, 1);
+                                             "space_info",
+                                             (u64)(unsigned long)space_info,
+                                             orig_bytes, 1);
                        ret = 0;
                } else {
                        wait_ordered = true;
@@ -3913,8 +3918,8 @@ static void block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
                        spin_lock(&space_info->lock);
                        space_info->bytes_may_use -= num_bytes;
                        trace_btrfs_space_reservation(fs_info, "space_info",
-                                                     (u64)space_info,
-                                                     num_bytes, 0);
+                                             (u64)(unsigned long)space_info,
+                                             num_bytes, 0);
                        space_info->reservation_progress++;
                        spin_unlock(&space_info->lock);
                }
@@ -4105,7 +4110,7 @@ static u64 calc_global_metadata_size(struct btrfs_fs_info *fs_info)
        num_bytes += div64_u64(data_used + meta_used, 50);
 
        if (num_bytes * 3 > meta_used)
-               num_bytes = div64_u64(meta_used, 3);
+               num_bytes = div64_u64(meta_used, 3) * 2;
 
        return ALIGN(num_bytes, fs_info->extent_root->leafsize << 10);
 }
@@ -4132,14 +4137,14 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
                block_rsv->reserved += num_bytes;
                sinfo->bytes_may_use += num_bytes;
                trace_btrfs_space_reservation(fs_info, "space_info",
-                                             (u64)sinfo, num_bytes, 1);
+                                     (u64)(unsigned long)sinfo, num_bytes, 1);
        }
 
        if (block_rsv->reserved >= block_rsv->size) {
                num_bytes = block_rsv->reserved - block_rsv->size;
                sinfo->bytes_may_use -= num_bytes;
                trace_btrfs_space_reservation(fs_info, "space_info",
-                                             (u64)sinfo, num_bytes, 0);
+                                     (u64)(unsigned long)sinfo, num_bytes, 0);
                sinfo->reservation_progress++;
                block_rsv->reserved = block_rsv->size;
                block_rsv->full = 1;
@@ -4192,7 +4197,8 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
        if (!trans->bytes_reserved)
                return;
 
-       trace_btrfs_space_reservation(root->fs_info, "transaction", (u64)trans,
+       trace_btrfs_space_reservation(root->fs_info, "transaction",
+                                     (u64)(unsigned long)trans,
                                      trans->bytes_reserved, 0);
        btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
        trans->bytes_reserved = 0;
@@ -4710,9 +4716,9 @@ static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
                        space_info->bytes_reserved += num_bytes;
                        if (reserve == RESERVE_ALLOC) {
                                trace_btrfs_space_reservation(cache->fs_info,
-                                                             "space_info",
-                                                             (u64)space_info,
-                                                             num_bytes, 0);
+                                             "space_info",
+                                             (u64)(unsigned long)space_info,
+                                             num_bytes, 0);
                                space_info->bytes_may_use -= num_bytes;
                        }
                }
@@ -7886,9 +7892,16 @@ int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range)
        u64 start;
        u64 end;
        u64 trimmed = 0;
+       u64 total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
        int ret = 0;
 
-       cache = btrfs_lookup_block_group(fs_info, range->start);
+       /*
+        * try to trim all FS space, our block group may start from non-zero.
+        */
+       if (range->len == total_bytes)
+               cache = btrfs_lookup_first_block_group(fs_info, range->start);
+       else
+               cache = btrfs_lookup_block_group(fs_info, range->start);
 
        while (cache) {
                if (cache->key.objectid >= (range->start + range->len)) {
index fcf77e1ded40e8d47ed8f64742d8139a61295023..a55fbe6252ded4e41d9b76cb3bed1a9f98acd065 100644 (file)
@@ -513,6 +513,15 @@ hit_next:
        WARN_ON(state->end < start);
        last_end = state->end;
 
+       if (state->end < end && !need_resched())
+               next_node = rb_next(&state->rb_node);
+       else
+               next_node = NULL;
+
+       /* the state doesn't have the wanted bits, go ahead */
+       if (!(state->state & bits))
+               goto next;
+
        /*
         *     | ---- desired range ---- |
         *  | state | or
@@ -565,20 +574,15 @@ hit_next:
                goto out;
        }
 
-       if (state->end < end && prealloc && !need_resched())
-               next_node = rb_next(&state->rb_node);
-       else
-               next_node = NULL;
-
        set |= clear_state_bit(tree, state, &bits, wake);
+next:
        if (last_end == (u64)-1)
                goto out;
        start = last_end + 1;
        if (start <= end && next_node) {
                state = rb_entry(next_node, struct extent_state,
                                 rb_node);
-               if (state->start == start)
-                       goto hit_next;
+               goto hit_next;
        }
        goto search_again;
 
@@ -961,8 +965,6 @@ hit_next:
 
                set_state_bits(tree, state, &bits);
                clear_state_bit(tree, state, &clear_bits, 0);
-
-               merge_state(tree, state);
                if (last_end == (u64)-1)
                        goto out;
 
@@ -1007,7 +1009,6 @@ hit_next:
                if (state->end <= end) {
                        set_state_bits(tree, state, &bits);
                        clear_state_bit(tree, state, &clear_bits, 0);
-                       merge_state(tree, state);
                        if (last_end == (u64)-1)
                                goto out;
                        start = last_end + 1;
@@ -1068,8 +1069,6 @@ hit_next:
 
                set_state_bits(tree, prealloc, &bits);
                clear_state_bit(tree, prealloc, &clear_bits, 0);
-
-               merge_state(tree, prealloc);
                prealloc = NULL;
                goto out;
        }
@@ -2154,13 +2153,46 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
                 "this_mirror=%d, num_copies=%d, in_validation=%d\n", read_mode,
                 failrec->this_mirror, num_copies, failrec->in_validation);
 
-       tree->ops->submit_bio_hook(inode, read_mode, bio, failrec->this_mirror,
-                                       failrec->bio_flags, 0);
-       return 0;
+       ret = tree->ops->submit_bio_hook(inode, read_mode, bio,
+                                        failrec->this_mirror,
+                                        failrec->bio_flags, 0);
+       return ret;
 }
 
 /* lots and lots of room for performance fixes in the end_bio funcs */
 
+int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
+{
+       int uptodate = (err == 0);
+       struct extent_io_tree *tree;
+       int ret;
+
+       tree = &BTRFS_I(page->mapping->host)->io_tree;
+
+       if (tree->ops && tree->ops->writepage_end_io_hook) {
+               ret = tree->ops->writepage_end_io_hook(page, start,
+                                              end, NULL, uptodate);
+               if (ret)
+                       uptodate = 0;
+       }
+
+       if (!uptodate && tree->ops &&
+           tree->ops->writepage_io_failed_hook) {
+               ret = tree->ops->writepage_io_failed_hook(NULL, page,
+                                                start, end, NULL);
+               /* Writeback already completed */
+               if (ret == 0)
+                       return 1;
+       }
+
+       if (!uptodate) {
+               clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS);
+               ClearPageUptodate(page);
+               SetPageError(page);
+       }
+       return 0;
+}
+
 /*
  * after a writepage IO is done, we need to:
  * clear the uptodate bits on error
@@ -2172,13 +2204,11 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
  */
 static void end_bio_extent_writepage(struct bio *bio, int err)
 {
-       int uptodate = err == 0;
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
        struct extent_io_tree *tree;
        u64 start;
        u64 end;
        int whole_page;
-       int ret;
 
        do {
                struct page *page = bvec->bv_page;
@@ -2195,28 +2225,9 @@ static void end_bio_extent_writepage(struct bio *bio, int err)
 
                if (--bvec >= bio->bi_io_vec)
                        prefetchw(&bvec->bv_page->flags);
-               if (tree->ops && tree->ops->writepage_end_io_hook) {
-                       ret = tree->ops->writepage_end_io_hook(page, start,
-                                                      end, NULL, uptodate);
-                       if (ret)
-                               uptodate = 0;
-               }
-
-               if (!uptodate && tree->ops &&
-                   tree->ops->writepage_io_failed_hook) {
-                       ret = tree->ops->writepage_io_failed_hook(bio, page,
-                                                        start, end, NULL);
-                       if (ret == 0) {
-                               uptodate = (err == 0);
-                               continue;
-                       }
-               }
 
-               if (!uptodate) {
-                       clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS);
-                       ClearPageUptodate(page);
-                       SetPageError(page);
-               }
+               if (end_extent_writepage(page, err, start, end))
+                       continue;
 
                if (whole_page)
                        end_page_writeback(page);
@@ -2779,9 +2790,12 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
                                delalloc_start = delalloc_end + 1;
                                continue;
                        }
-                       tree->ops->fill_delalloc(inode, page, delalloc_start,
-                                                delalloc_end, &page_started,
-                                                &nr_written);
+                       ret = tree->ops->fill_delalloc(inode, page,
+                                                      delalloc_start,
+                                                      delalloc_end,
+                                                      &page_started,
+                                                      &nr_written);
+                       BUG_ON(ret);
                        /*
                         * delalloc_end is already one less than the total
                         * length, so we don't subtract one from
@@ -2818,8 +2832,12 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
        if (tree->ops && tree->ops->writepage_start_hook) {
                ret = tree->ops->writepage_start_hook(page, start,
                                                      page_end);
-               if (ret == -EAGAIN) {
-                       redirty_page_for_writepage(wbc, page);
+               if (ret) {
+                       /* Fixup worker will requeue */
+                       if (ret == -EBUSY)
+                               wbc->pages_skipped++;
+                       else
+                               redirty_page_for_writepage(wbc, page);
                        update_nr_written(page, wbc, nr_written);
                        unlock_page(page);
                        ret = 0;
@@ -3289,7 +3307,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
                        len = end - start + 1;
                        write_lock(&map->lock);
                        em = lookup_extent_mapping(map, start, len);
-                       if (IS_ERR_OR_NULL(em)) {
+                       if (!em) {
                                write_unlock(&map->lock);
                                break;
                        }
@@ -3853,10 +3871,9 @@ int clear_extent_buffer_uptodate(struct extent_io_tree *tree,
        num_pages = num_extent_pages(eb->start, eb->len);
        clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
 
-       if (eb_straddles_pages(eb)) {
-               clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1,
-                                     cached_state, GFP_NOFS);
-       }
+       clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1,
+                             cached_state, GFP_NOFS);
+
        for (i = 0; i < num_pages; i++) {
                page = extent_buffer_page(eb, i);
                if (page)
index bc6a042cb6fc496e6910d21fb3cdaec000f43b8e..cecc3518c1213abb8704194fa6dff6f7662f5ad0 100644 (file)
@@ -319,4 +319,5 @@ struct btrfs_mapping_tree;
 int repair_io_failure(struct btrfs_mapping_tree *map_tree, u64 start,
                        u64 length, u64 logical, struct page *page,
                        int mirror_num);
+int end_extent_writepage(struct page *page, int err, u64 start, u64 end);
 #endif
index 33a7890b1f4091479df52d7a13c1532ba911ce76..1195f09761fedd2e5c109b74d3000c2973bc75f4 100644 (file)
@@ -26,8 +26,8 @@ struct extent_map {
        unsigned long flags;
        struct block_device *bdev;
        atomic_t refs;
-       unsigned int in_tree:1;
-       unsigned int compress_type:4;
+       unsigned int in_tree;
+       unsigned int compress_type;
 };
 
 struct extent_map_tree {
index 859ba2dd88903ba207c7b0e448e0f5ce7f99e46e..e8d06b6b9194af2839c686d9a651a56852876f96 100644 (file)
@@ -1604,6 +1604,14 @@ static long btrfs_fallocate(struct file *file, int mode,
        if (mode & ~FALLOC_FL_KEEP_SIZE)
                return -EOPNOTSUPP;
 
+       /*
+        * Make sure we have enough space before we do the
+        * allocation.
+        */
+       ret = btrfs_check_data_free_space(inode, len);
+       if (ret)
+               return ret;
+
        /*
         * wait for ordered IO before we have any locks.  We'll loop again
         * below with the locks held.
@@ -1667,27 +1675,12 @@ static long btrfs_fallocate(struct file *file, int mode,
                if (em->block_start == EXTENT_MAP_HOLE ||
                    (cur_offset >= inode->i_size &&
                     !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) {
-
-                       /*
-                        * Make sure we have enough space before we do the
-                        * allocation.
-                        */
-                       ret = btrfs_check_data_free_space(inode, last_byte -
-                                                         cur_offset);
-                       if (ret) {
-                               free_extent_map(em);
-                               break;
-                       }
-
                        ret = btrfs_prealloc_file_range(inode, mode, cur_offset,
                                                        last_byte - cur_offset,
                                                        1 << inode->i_blkbits,
                                                        offset + len,
                                                        &alloc_hint);
 
-                       /* Let go of our reservation. */
-                       btrfs_free_reserved_data_space(inode, last_byte -
-                                                      cur_offset);
                        if (ret < 0) {
                                free_extent_map(em);
                                break;
@@ -1715,6 +1708,8 @@ static long btrfs_fallocate(struct file *file, int mode,
                             &cached_state, GFP_NOFS);
 out:
        mutex_unlock(&inode->i_mutex);
+       /* Let go of our reservation. */
+       btrfs_free_reserved_data_space(inode, len);
        return ret;
 }
 
@@ -1761,7 +1756,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
                                                     start - root->sectorsize,
                                                     root->sectorsize, 0);
                if (IS_ERR(em)) {
-                       ret = -ENXIO;
+                       ret = PTR_ERR(em);
                        goto out;
                }
                last_end = em->start + em->len;
@@ -1773,7 +1768,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
        while (1) {
                em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0);
                if (IS_ERR(em)) {
-                       ret = -ENXIO;
+                       ret = PTR_ERR(em);
                        break;
                }
 
index c2f20594c9f74fde7e97cbdf4dea728b9c5a4bd8..710ea380c7edbdbeb4fbabc1266745f047606909 100644 (file)
@@ -777,6 +777,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
        spin_lock(&block_group->lock);
        if (block_group->disk_cache_state != BTRFS_DC_WRITTEN) {
                spin_unlock(&block_group->lock);
+               btrfs_free_path(path);
                goto out;
        }
        spin_unlock(&block_group->lock);
index 213ffa86ce1b81f30a5f4ad50753c6d2ac6435aa..ee15d88b33d2a3dca65f41a4c5c3f6a36bbe5b48 100644 (file)
@@ -438,7 +438,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
                                          trans->bytes_reserved);
        if (ret)
                goto out;
-       trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans,
+       trace_btrfs_space_reservation(root->fs_info, "ino_cache",
+                                     (u64)(unsigned long)trans,
                                      trans->bytes_reserved, 1);
 again:
        inode = lookup_free_ino_inode(root, path);
@@ -500,7 +501,8 @@ again:
 out_put:
        iput(inode);
 out_release:
-       trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans,
+       trace_btrfs_space_reservation(root->fs_info, "ino_cache",
+                                     (u64)(unsigned long)trans,
                                      trans->bytes_reserved, 0);
        btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
 out:
index 32214fe0f7e32eda73449b0063aecd3874ade562..892b34785ccc2fc2a8a1a2ded9d84a795c1eb1eb 100644 (file)
@@ -1555,6 +1555,7 @@ static void btrfs_writepage_fixup_worker(struct btrfs_work *work)
        struct inode *inode;
        u64 page_start;
        u64 page_end;
+       int ret;
 
        fixup = container_of(work, struct btrfs_writepage_fixup, work);
        page = fixup->page;
@@ -1582,12 +1583,21 @@ again:
                                     page_end, &cached_state, GFP_NOFS);
                unlock_page(page);
                btrfs_start_ordered_extent(inode, ordered, 1);
+               btrfs_put_ordered_extent(ordered);
                goto again;
        }
 
-       BUG();
+       ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE);
+       if (ret) {
+               mapping_set_error(page->mapping, ret);
+               end_extent_writepage(page, ret, page_start, page_end);
+               ClearPageChecked(page);
+               goto out;
+        }
+
        btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state);
        ClearPageChecked(page);
+       set_page_dirty(page);
 out:
        unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end,
                             &cached_state, GFP_NOFS);
@@ -1630,7 +1640,7 @@ static int btrfs_writepage_start_hook(struct page *page, u64 start, u64 end)
        fixup->work.func = btrfs_writepage_fixup_worker;
        fixup->page = page;
        btrfs_queue_worker(&root->fs_info->fixup_workers, &fixup->work);
-       return -EAGAIN;
+       return -EBUSY;
 }
 
 static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
@@ -4575,7 +4585,8 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
                ret = btrfs_insert_dir_item(trans, root, name, name_len,
                                            parent_inode, &key,
                                            btrfs_inode_type(inode), index);
-               BUG_ON(ret);
+               if (ret)
+                       goto fail_dir_item;
 
                btrfs_i_size_write(parent_inode, parent_inode->i_size +
                                   name_len * 2);
@@ -4583,6 +4594,23 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
                ret = btrfs_update_inode(trans, root, parent_inode);
        }
        return ret;
+
+fail_dir_item:
+       if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) {
+               u64 local_index;
+               int err;
+               err = btrfs_del_root_ref(trans, root->fs_info->tree_root,
+                                key.objectid, root->root_key.objectid,
+                                parent_ino, &local_index, name, name_len);
+
+       } else if (add_backref) {
+               u64 local_index;
+               int err;
+
+               err = btrfs_del_inode_ref(trans, root, name, name_len,
+                                         ino, parent_ino, &local_index);
+       }
+       return ret;
 }
 
 static int btrfs_add_nondir(struct btrfs_trans_handle *trans,
@@ -6696,8 +6724,10 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
        int err;
        u64 index = 0;
 
-       inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, new_dirid,
-                               new_dirid, S_IFDIR | 0700, &index);
+       inode = btrfs_new_inode(trans, new_root, NULL, "..", 2,
+                               new_dirid, new_dirid,
+                               S_IFDIR | (~current_umask() & S_IRWXUGO),
+                               &index);
        if (IS_ERR(inode))
                return PTR_ERR(inode);
        inode->i_op = &btrfs_dir_inode_operations;
index 03bb62a9ee24d3e84cef380cda53af10ff673590..d8b54715c2deb655508229a7f4120e1141c8daae 100644 (file)
@@ -861,6 +861,7 @@ static int cluster_pages_for_defrag(struct inode *inode,
        int i_done;
        struct btrfs_ordered_extent *ordered;
        struct extent_state *cached_state = NULL;
+       struct extent_io_tree *tree;
        gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping);
 
        if (isize == 0)
@@ -871,18 +872,34 @@ static int cluster_pages_for_defrag(struct inode *inode,
                                           num_pages << PAGE_CACHE_SHIFT);
        if (ret)
                return ret;
-again:
-       ret = 0;
        i_done = 0;
+       tree = &BTRFS_I(inode)->io_tree;
 
        /* step one, lock all the pages */
        for (i = 0; i < num_pages; i++) {
                struct page *page;
+again:
                page = find_or_create_page(inode->i_mapping,
-                                           start_index + i, mask);
+                                          start_index + i, mask);
                if (!page)
                        break;
 
+               page_start = page_offset(page);
+               page_end = page_start + PAGE_CACHE_SIZE - 1;
+               while (1) {
+                       lock_extent(tree, page_start, page_end, GFP_NOFS);
+                       ordered = btrfs_lookup_ordered_extent(inode,
+                                                             page_start);
+                       unlock_extent(tree, page_start, page_end, GFP_NOFS);
+                       if (!ordered)
+                               break;
+
+                       unlock_page(page);
+                       btrfs_start_ordered_extent(inode, ordered, 1);
+                       btrfs_put_ordered_extent(ordered);
+                       lock_page(page);
+               }
+
                if (!PageUptodate(page)) {
                        btrfs_readpage(NULL, page);
                        lock_page(page);
@@ -893,15 +910,22 @@ again:
                                break;
                        }
                }
+
                isize = i_size_read(inode);
                file_end = (isize - 1) >> PAGE_CACHE_SHIFT;
-               if (!isize || page->index > file_end ||
-                   page->mapping != inode->i_mapping) {
+               if (!isize || page->index > file_end) {
                        /* whoops, we blew past eof, skip this page */
                        unlock_page(page);
                        page_cache_release(page);
                        break;
                }
+
+               if (page->mapping != inode->i_mapping) {
+                       unlock_page(page);
+                       page_cache_release(page);
+                       goto again;
+               }
+
                pages[i] = page;
                i_done++;
        }
@@ -924,25 +948,6 @@ again:
        lock_extent_bits(&BTRFS_I(inode)->io_tree,
                         page_start, page_end - 1, 0, &cached_state,
                         GFP_NOFS);
-       ordered = btrfs_lookup_first_ordered_extent(inode, page_end - 1);
-       if (ordered &&
-           ordered->file_offset + ordered->len > page_start &&
-           ordered->file_offset < page_end) {
-               btrfs_put_ordered_extent(ordered);
-               unlock_extent_cached(&BTRFS_I(inode)->io_tree,
-                                    page_start, page_end - 1,
-                                    &cached_state, GFP_NOFS);
-               for (i = 0; i < i_done; i++) {
-                       unlock_page(pages[i]);
-                       page_cache_release(pages[i]);
-               }
-               btrfs_wait_ordered_range(inode, page_start,
-                                        page_end - page_start);
-               goto again;
-       }
-       if (ordered)
-               btrfs_put_ordered_extent(ordered);
-
        clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start,
                          page_end - 1, EXTENT_DIRTY | EXTENT_DELALLOC |
                          EXTENT_DO_ACCOUNTING, 0, 0, &cached_state,
@@ -1327,6 +1332,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
                goto out;
        }
 
+       if (name[0] == '.' &&
+          (namelen == 1 || (name[1] == '.' && namelen == 2))) {
+               ret = -EEXIST;
+               goto out;
+       }
+
        if (subvol) {
                ret = btrfs_mksubvol(&file->f_path, name, namelen,
                                     NULL, transid, readonly);
index 9770cc5bfb76c6829f96924bb82f9b3b564ca646..abc0fbffa510f67f601dc80e38bfecf091a88153 100644 (file)
@@ -1367,7 +1367,8 @@ out:
 }
 
 static noinline_for_stack int scrub_chunk(struct scrub_dev *sdev,
-       u64 chunk_tree, u64 chunk_objectid, u64 chunk_offset, u64 length)
+       u64 chunk_tree, u64 chunk_objectid, u64 chunk_offset, u64 length,
+       u64 dev_offset)
 {
        struct btrfs_mapping_tree *map_tree =
                &sdev->dev->dev_root->fs_info->mapping_tree;
@@ -1391,7 +1392,8 @@ static noinline_for_stack int scrub_chunk(struct scrub_dev *sdev,
                goto out;
 
        for (i = 0; i < map->num_stripes; ++i) {
-               if (map->stripes[i].dev == sdev->dev) {
+               if (map->stripes[i].dev == sdev->dev &&
+                   map->stripes[i].physical == dev_offset) {
                        ret = scrub_stripe(sdev, map, i, chunk_offset, length);
                        if (ret)
                                goto out;
@@ -1487,7 +1489,7 @@ int scrub_enumerate_chunks(struct scrub_dev *sdev, u64 start, u64 end)
                        break;
                }
                ret = scrub_chunk(sdev, chunk_tree, chunk_objectid,
-                                 chunk_offset, length);
+                                 chunk_offset, length, found_key.offset);
                btrfs_put_block_group(cache);
                if (ret)
                        break;
index 287a6728b1ad6ddc726b64122223bfc71e7e165d..04b77e3ceb7a9783332c33c4ceca006ac9c14482 100644 (file)
@@ -327,7 +327,8 @@ again:
 
        if (num_bytes) {
                trace_btrfs_space_reservation(root->fs_info, "transaction",
-                                             (u64)h, num_bytes, 1);
+                                             (u64)(unsigned long)h,
+                                             num_bytes, 1);
                h->block_rsv = &root->fs_info->trans_block_rsv;
                h->bytes_reserved = num_bytes;
        }
@@ -915,7 +916,11 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
                                dentry->d_name.name, dentry->d_name.len,
                                parent_inode, &key,
                                BTRFS_FT_DIR, index);
-       BUG_ON(ret);
+       if (ret) {
+               pending->error = -EEXIST;
+               dput(parent);
+               goto fail;
+       }
 
        btrfs_i_size_write(parent_inode, parent_inode->i_size +
                                         dentry->d_name.len * 2);
@@ -993,12 +998,9 @@ static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans,
 {
        struct btrfs_pending_snapshot *pending;
        struct list_head *head = &trans->transaction->pending_snapshots;
-       int ret;
 
-       list_for_each_entry(pending, head, list) {
-               ret = create_pending_snapshot(trans, fs_info, pending);
-               BUG_ON(ret);
-       }
+       list_for_each_entry(pending, head, list)
+               create_pending_snapshot(trans, fs_info, pending);
        return 0;
 }
 
index 0b4e2af7954d3c209d8f1e581d4ee26c0cb60c2f..ef41f285a47542bdd0e8f94aec56e18e7d833fba 100644 (file)
@@ -459,12 +459,23 @@ int btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices)
 {
        struct btrfs_device *device, *next;
 
+       struct block_device *latest_bdev = NULL;
+       u64 latest_devid = 0;
+       u64 latest_transid = 0;
+
        mutex_lock(&uuid_mutex);
 again:
        /* This is the initialized path, it is safe to release the devices. */
        list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) {
-               if (device->in_fs_metadata)
+               if (device->in_fs_metadata) {
+                       if (!latest_transid ||
+                           device->generation > latest_transid) {
+                               latest_devid = device->devid;
+                               latest_transid = device->generation;
+                               latest_bdev = device->bdev;
+                       }
                        continue;
+               }
 
                if (device->bdev) {
                        blkdev_put(device->bdev, device->mode);
@@ -487,6 +498,10 @@ again:
                goto again;
        }
 
+       fs_devices->latest_bdev = latest_bdev;
+       fs_devices->latest_devid = latest_devid;
+       fs_devices->latest_trans = latest_transid;
+
        mutex_unlock(&uuid_mutex);
        return 0;
 }
@@ -1953,7 +1968,7 @@ static int btrfs_relocate_chunk(struct btrfs_root *root,
        em = lookup_extent_mapping(em_tree, chunk_offset, 1);
        read_unlock(&em_tree->lock);
 
-       BUG_ON(em->start > chunk_offset ||
+       BUG_ON(!em || em->start > chunk_offset ||
               em->start + em->len < chunk_offset);
        map = (struct map_lookup *)em->bdev;
 
@@ -4356,6 +4371,20 @@ int btrfs_read_sys_array(struct btrfs_root *root)
                return -ENOMEM;
        btrfs_set_buffer_uptodate(sb);
        btrfs_set_buffer_lockdep_class(root->root_key.objectid, sb, 0);
+       /*
+        * The sb extent buffer is artifical and just used to read the system array.
+        * btrfs_set_buffer_uptodate() call does not properly mark all it's
+        * pages up-to-date when the page is larger: extent does not cover the
+        * whole page and consequently check_page_uptodate does not find all
+        * the page's extents up-to-date (the hole beyond sb),
+        * write_extent_buffer then triggers a WARN_ON.
+        *
+        * Regular short extents go through mark_extent_buffer_dirty/writeback cycle,
+        * but sb spans only this function. Add an explicit SetPageUptodate call
+        * to silence the warning eg. on PowerPC 64.
+        */
+       if (PAGE_CACHE_SIZE > BTRFS_SUPER_INFO_SIZE)
+               SetPageUptodate(sb->first_page);
 
        write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE);
        array_size = btrfs_super_sys_array_size(super_copy);
index 63a196b97d5094a02e0f68b4fe5084051e7ad33a..bc7e24420ac0bee0ac2cab03e96224d1edf4adc7 100644 (file)
@@ -584,10 +584,26 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
                         * If either that or op not supported returned, follow
                         * the normal lookup.
                         */
-                       if ((rc == 0) || (rc == -ENOENT))
+                       switch (rc) {
+                       case 0:
+                               /*
+                                * The server may allow us to open things like
+                                * FIFOs, but the client isn't set up to deal
+                                * with that. If it's not a regular file, just
+                                * close it and proceed as if it were a normal
+                                * lookup.
+                                */
+                               if (newInode && !S_ISREG(newInode->i_mode)) {
+                                       CIFSSMBClose(xid, pTcon, fileHandle);
+                                       break;
+                               }
+                       case -ENOENT:
                                posix_open = true;
-                       else if ((rc == -EINVAL) || (rc != -EOPNOTSUPP))
+                       case -EOPNOTSUPP:
+                               break;
+                       default:
                                pTcon->broken_posix_open = true;
+                       }
                }
                if (!posix_open)
                        rc = cifs_get_inode_info_unix(&newInode, full_path,
index a5f54b7d98224dd613efaa3c89edfdebdc8817e6..745da3d0653e38a0f48db4f0741f3414e44d974e 100644 (file)
@@ -534,6 +534,11 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
        if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
                fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
                fattr->cf_dtype = DT_DIR;
+               /*
+                * Server can return wrong NumberOfLinks value for directories
+                * when Unix extensions are disabled - fake it.
+                */
+               fattr->cf_nlink = 2;
        } else {
                fattr->cf_mode = S_IFREG | cifs_sb->mnt_file_mode;
                fattr->cf_dtype = DT_REG;
@@ -541,9 +546,9 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
                /* clear write bits if ATTR_READONLY is set */
                if (fattr->cf_cifsattrs & ATTR_READONLY)
                        fattr->cf_mode &= ~(S_IWUGO);
-       }
 
-       fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+               fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+       }
 
        fattr->cf_uid = cifs_sb->mnt_uid;
        fattr->cf_gid = cifs_sb->mnt_gid;
@@ -1322,7 +1327,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
                        }
 /*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need
        to set uid/gid */
-                       inc_nlink(inode);
 
                        cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb);
                        cifs_fill_uniqueid(inode->i_sb, &fattr);
@@ -1355,7 +1359,6 @@ mkdir_retry_old:
                d_drop(direntry);
        } else {
 mkdir_get_info:
-               inc_nlink(inode);
                if (pTcon->unix_ext)
                        rc = cifs_get_inode_info_unix(&newinode, full_path,
                                                      inode->i_sb, xid);
@@ -1436,6 +1439,11 @@ mkdir_get_info:
                }
        }
 mkdir_out:
+       /*
+        * Force revalidate to get parent dir info when needed since cached
+        * attributes are invalid now.
+        */
+       CIFS_I(inode)->time = 0;
        kfree(full_path);
        FreeXid(xid);
        cifs_put_tlink(tlink);
@@ -1475,7 +1483,6 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
        cifs_put_tlink(tlink);
 
        if (!rc) {
-               drop_nlink(inode);
                spin_lock(&direntry->d_inode->i_lock);
                i_size_write(direntry->d_inode, 0);
                clear_nlink(direntry->d_inode);
@@ -1483,12 +1490,15 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
        }
 
        cifsInode = CIFS_I(direntry->d_inode);
-       cifsInode->time = 0;    /* force revalidate to go get info when
-                                  needed */
+       /* force revalidate to go get info when needed */
+       cifsInode->time = 0;
 
        cifsInode = CIFS_I(inode);
-       cifsInode->time = 0;    /* force revalidate to get parent dir info
-                                  since cached search results now invalid */
+       /*
+        * Force revalidate to get parent dir info when needed since cached
+        * attributes are invalid now.
+        */
+       cifsInode->time = 0;
 
        direntry->d_inode->i_ctime = inode->i_ctime = inode->i_mtime =
                current_fs_time(inode->i_sb);
index fa9d721ecfee57f8f3b4c2f3b37f2b4e52182ffc..07880bae28a9fa2128eb5df60c6193c39e099fb8 100644 (file)
@@ -131,41 +131,35 @@ asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_tim
 
 static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
 {
-       compat_ino_t ino = stat->ino;
-       typeof(ubuf->st_uid) uid = 0;
-       typeof(ubuf->st_gid) gid = 0;
-       int err;
+       struct compat_stat tmp;
 
-       SET_UID(uid, stat->uid);
-       SET_GID(gid, stat->gid);
+       if (!old_valid_dev(stat->dev) || !old_valid_dev(stat->rdev))
+               return -EOVERFLOW;
 
-       if ((u64) stat->size > MAX_NON_LFS ||
-           !old_valid_dev(stat->dev) ||
-           !old_valid_dev(stat->rdev))
+       memset(&tmp, 0, sizeof(tmp));
+       tmp.st_dev = old_encode_dev(stat->dev);
+       tmp.st_ino = stat->ino;
+       if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino)
                return -EOVERFLOW;
-       if (sizeof(ino) < sizeof(stat->ino) && ino != stat->ino)
+       tmp.st_mode = stat->mode;
+       tmp.st_nlink = stat->nlink;
+       if (tmp.st_nlink != stat->nlink)
                return -EOVERFLOW;
-
-       if (clear_user(ubuf, sizeof(*ubuf)))
-               return -EFAULT;
-
-       err  = __put_user(old_encode_dev(stat->dev), &ubuf->st_dev);
-       err |= __put_user(ino, &ubuf->st_ino);
-       err |= __put_user(stat->mode, &ubuf->st_mode);
-       err |= __put_user(stat->nlink, &ubuf->st_nlink);
-       err |= __put_user(uid, &ubuf->st_uid);
-       err |= __put_user(gid, &ubuf->st_gid);
-       err |= __put_user(old_encode_dev(stat->rdev), &ubuf->st_rdev);
-       err |= __put_user(stat->size, &ubuf->st_size);
-       err |= __put_user(stat->atime.tv_sec, &ubuf->st_atime);
-       err |= __put_user(stat->atime.tv_nsec, &ubuf->st_atime_nsec);
-       err |= __put_user(stat->mtime.tv_sec, &ubuf->st_mtime);
-       err |= __put_user(stat->mtime.tv_nsec, &ubuf->st_mtime_nsec);
-       err |= __put_user(stat->ctime.tv_sec, &ubuf->st_ctime);
-       err |= __put_user(stat->ctime.tv_nsec, &ubuf->st_ctime_nsec);
-       err |= __put_user(stat->blksize, &ubuf->st_blksize);
-       err |= __put_user(stat->blocks, &ubuf->st_blocks);
-       return err;
+       SET_UID(tmp.st_uid, stat->uid);
+       SET_GID(tmp.st_gid, stat->gid);
+       tmp.st_rdev = old_encode_dev(stat->rdev);
+       if ((u64) stat->size > MAX_NON_LFS)
+               return -EOVERFLOW;
+       tmp.st_size = stat->size;
+       tmp.st_atime = stat->atime.tv_sec;
+       tmp.st_atime_nsec = stat->atime.tv_nsec;
+       tmp.st_mtime = stat->mtime.tv_sec;
+       tmp.st_mtime_nsec = stat->mtime.tv_nsec;
+       tmp.st_ctime = stat->ctime.tv_sec;
+       tmp.st_ctime_nsec = stat->ctime.tv_nsec;
+       tmp.st_blocks = stat->blocks;
+       tmp.st_blksize = stat->blksize;
+       return copy_to_user(ubuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
 }
 
 asmlinkage long compat_sys_newstat(const char __user * filename,
index 16a53cc2cc02e079554742bfcd95c1f92d3608d4..bcbdb33fcc205aad37110be50752131aae894062 100644 (file)
@@ -104,7 +104,7 @@ static unsigned int d_hash_shift __read_mostly;
 
 static struct hlist_bl_head *dentry_hashtable __read_mostly;
 
-static inline struct hlist_bl_head *d_hash(struct dentry *parent,
+static inline struct hlist_bl_head *d_hash(const struct dentry *parent,
                                        unsigned long hash)
 {
        hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES;
@@ -137,6 +137,26 @@ int proc_nr_dentry(ctl_table *table, int write, void __user *buffer,
 }
 #endif
 
+/*
+ * Compare 2 name strings, return 0 if they match, otherwise non-zero.
+ * The strings are both count bytes long, and count is non-zero.
+ */
+static inline int dentry_cmp(const unsigned char *cs, size_t scount,
+                               const unsigned char *ct, size_t tcount)
+{
+       if (scount != tcount)
+               return 1;
+
+       do {
+               if (*cs != *ct)
+                       return 1;
+               cs++;
+               ct++;
+               tcount--;
+       } while (tcount);
+       return 0;
+}
+
 static void __d_free(struct rcu_head *head)
 {
        struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
@@ -1717,8 +1737,9 @@ EXPORT_SYMBOL(d_add_ci);
  * child is looked up. Thus, an interlocking stepping of sequence lock checks
  * is formed, giving integrity down the path walk.
  */
-struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name,
-                               unsigned *seq, struct inode **inode)
+struct dentry *__d_lookup_rcu(const struct dentry *parent,
+                               const struct qstr *name,
+                               unsigned *seqp, struct inode **inode)
 {
        unsigned int len = name->len;
        unsigned int hash = name->hash;
@@ -1748,6 +1769,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name,
         * See Documentation/filesystems/path-lookup.txt for more details.
         */
        hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) {
+               unsigned seq;
                struct inode *i;
                const char *tname;
                int tlen;
@@ -1756,7 +1778,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name,
                        continue;
 
 seqretry:
-               *seq = read_seqcount_begin(&dentry->d_seq);
+               seq = read_seqcount_begin(&dentry->d_seq);
                if (dentry->d_parent != parent)
                        continue;
                if (d_unhashed(dentry))
@@ -1771,7 +1793,7 @@ seqretry:
                 * edge of memory when walking. If we could load this
                 * atomically some other way, we could drop this check.
                 */
-               if (read_seqcount_retry(&dentry->d_seq, *seq))
+               if (read_seqcount_retry(&dentry->d_seq, seq))
                        goto seqretry;
                if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) {
                        if (parent->d_op->d_compare(parent, *inode,
@@ -1788,6 +1810,7 @@ seqretry:
                 * order to do anything useful with the returned dentry
                 * anyway.
                 */
+               *seqp = seq;
                *inode = i;
                return dentry;
        }
@@ -2968,7 +2991,7 @@ __setup("dhash_entries=", set_dhash_entries);
 
 static void __init dcache_init_early(void)
 {
-       int loop;
+       unsigned int loop;
 
        /* If hashes are distributed across NUMA nodes, defer
         * hash allocation until vmalloc space is available.
@@ -2986,13 +3009,13 @@ static void __init dcache_init_early(void)
                                        &d_hash_mask,
                                        0);
 
-       for (loop = 0; loop < (1 << d_hash_shift); loop++)
+       for (loop = 0; loop < (1U << d_hash_shift); loop++)
                INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
 }
 
 static void __init dcache_init(void)
 {
-       int loop;
+       unsigned int loop;
 
        /* 
         * A constructor could be added for stable state like the lists,
@@ -3016,7 +3039,7 @@ static void __init dcache_init(void)
                                        &d_hash_mask,
                                        0);
 
-       for (loop = 0; loop < (1 << d_hash_shift); loop++)
+       for (loop = 0; loop < (1U << d_hash_shift); loop++)
                INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
 }
 
index 4a588dbd11bfa57926b647e1e66bdd35a446cad4..f4aadd15b61376ee97a4a7bababe2eb659850820 100644 (file)
@@ -173,7 +173,7 @@ void inode_dio_wait(struct inode *inode)
        if (atomic_read(&inode->i_dio_count))
                __inode_dio_wait(inode);
 }
-EXPORT_SYMBOL_GPL(inode_dio_wait);
+EXPORT_SYMBOL(inode_dio_wait);
 
 /*
  * inode_dio_done - signal finish of a direct I/O requests
@@ -187,7 +187,7 @@ void inode_dio_done(struct inode *inode)
        if (atomic_dec_and_test(&inode->i_dio_count))
                wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);
 }
-EXPORT_SYMBOL_GPL(inode_dio_done);
+EXPORT_SYMBOL(inode_dio_done);
 
 /*
  * How many pages are in the queue?
index 63ab24510649cc3a3604e9dd603904d9676a2794..ea9931281557ad8d3ed4049b48c66110df5f0811 100644 (file)
@@ -1990,6 +1990,17 @@ out:
        return;
 }
 
+static size_t ecryptfs_max_decoded_size(size_t encoded_size)
+{
+       /* Not exact; conservatively long. Every block of 4
+        * encoded characters decodes into a block of 3
+        * decoded characters. This segment of code provides
+        * the caller with the maximum amount of allocated
+        * space that @dst will need to point to in a
+        * subsequent call. */
+       return ((encoded_size + 1) * 3) / 4;
+}
+
 /**
  * ecryptfs_decode_from_filename
  * @dst: If NULL, this function only sets @dst_size and returns. If
@@ -2008,13 +2019,7 @@ ecryptfs_decode_from_filename(unsigned char *dst, size_t *dst_size,
        size_t dst_byte_offset = 0;
 
        if (dst == NULL) {
-               /* Not exact; conservatively long. Every block of 4
-                * encoded characters decodes into a block of 3
-                * decoded characters. This segment of code provides
-                * the caller with the maximum amount of allocated
-                * space that @dst will need to point to in a
-                * subsequent call. */
-               (*dst_size) = (((src_size + 1) * 3) / 4);
+               (*dst_size) = ecryptfs_max_decoded_size(src_size);
                goto out;
        }
        while (src_byte_offset < src_size) {
@@ -2239,3 +2244,52 @@ out_free:
 out:
        return rc;
 }
+
+#define ENC_NAME_MAX_BLOCKLEN_8_OR_16  143
+
+int ecryptfs_set_f_namelen(long *namelen, long lower_namelen,
+                          struct ecryptfs_mount_crypt_stat *mount_crypt_stat)
+{
+       struct blkcipher_desc desc;
+       struct mutex *tfm_mutex;
+       size_t cipher_blocksize;
+       int rc;
+
+       if (!(mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) {
+               (*namelen) = lower_namelen;
+               return 0;
+       }
+
+       rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&desc.tfm, &tfm_mutex,
+                       mount_crypt_stat->global_default_fn_cipher_name);
+       if (unlikely(rc)) {
+               (*namelen) = 0;
+               return rc;
+       }
+
+       mutex_lock(tfm_mutex);
+       cipher_blocksize = crypto_blkcipher_blocksize(desc.tfm);
+       mutex_unlock(tfm_mutex);
+
+       /* Return an exact amount for the common cases */
+       if (lower_namelen == NAME_MAX
+           && (cipher_blocksize == 8 || cipher_blocksize == 16)) {
+               (*namelen) = ENC_NAME_MAX_BLOCKLEN_8_OR_16;
+               return 0;
+       }
+
+       /* Return a safe estimate for the uncommon cases */
+       (*namelen) = lower_namelen;
+       (*namelen) -= ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE;
+       /* Since this is the max decoded size, subtract 1 "decoded block" len */
+       (*namelen) = ecryptfs_max_decoded_size(*namelen) - 3;
+       (*namelen) -= ECRYPTFS_TAG_70_MAX_METADATA_SIZE;
+       (*namelen) -= ECRYPTFS_FILENAME_MIN_RANDOM_PREPEND_BYTES;
+       /* Worst case is that the filename is padded nearly a full block size */
+       (*namelen) -= cipher_blocksize - 1;
+
+       if ((*namelen) < 0)
+               (*namelen) = 0;
+
+       return 0;
+}
index a2362df58ae8dfcebd95b78503bbb4f095506678..867b64c5d84f9f2892e182baa89c888224b99418 100644 (file)
@@ -162,6 +162,10 @@ ecryptfs_get_key_payload_data(struct key *key)
 #define ECRYPTFS_NON_NULL 0x42 /* A reasonable substitute for NULL */
 #define MD5_DIGEST_SIZE 16
 #define ECRYPTFS_TAG_70_DIGEST_SIZE MD5_DIGEST_SIZE
+#define ECRYPTFS_TAG_70_MIN_METADATA_SIZE (1 + ECRYPTFS_MIN_PKT_LEN_SIZE \
+                                          + ECRYPTFS_SIG_SIZE + 1 + 1)
+#define ECRYPTFS_TAG_70_MAX_METADATA_SIZE (1 + ECRYPTFS_MAX_PKT_LEN_SIZE \
+                                          + ECRYPTFS_SIG_SIZE + 1 + 1)
 #define ECRYPTFS_FEK_ENCRYPTED_FILENAME_PREFIX "ECRYPTFS_FEK_ENCRYPTED."
 #define ECRYPTFS_FEK_ENCRYPTED_FILENAME_PREFIX_SIZE 23
 #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX "ECRYPTFS_FNEK_ENCRYPTED."
@@ -701,6 +705,8 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
                             size_t *packet_size,
                             struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
                             char *data, size_t max_packet_size);
+int ecryptfs_set_f_namelen(long *namelen, long lower_namelen,
+                          struct ecryptfs_mount_crypt_stat *mount_crypt_stat);
 int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat,
                       loff_t offset);
 
index 19892d7d2ed1122547536d5bee21cff9293e7a8a..ab35b113003b900ad3592217d64e6cef82fe8f9d 100644 (file)
@@ -1085,6 +1085,8 @@ ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value,
        }
 
        rc = vfs_setxattr(lower_dentry, name, value, size, flags);
+       if (!rc)
+               fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode);
 out:
        return rc;
 }
index 8e3b943e330f5b1bd25953d07ba8e9c3d9baaf4c..2333203a120b3b853f71ef011a0755a3be04fd6a 100644 (file)
@@ -679,10 +679,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
         * Octets N3-N4: Block-aligned encrypted filename
         *  - Consists of a minimum number of random characters, a \0
         *    separator, and then the filename */
-       s->max_packet_size = (1                   /* Tag 70 identifier */
-                             + 3                 /* Max Tag 70 packet size */
-                             + ECRYPTFS_SIG_SIZE /* FNEK sig */
-                             + 1                 /* Cipher identifier */
+       s->max_packet_size = (ECRYPTFS_TAG_70_MAX_METADATA_SIZE
                              + s->block_aligned_filename_size);
        if (dest == NULL) {
                (*packet_size) = s->max_packet_size;
@@ -934,10 +931,10 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
                goto out;
        }
        s->desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
-       if (max_packet_size < (1 + 1 + ECRYPTFS_SIG_SIZE + 1 + 1)) {
+       if (max_packet_size < ECRYPTFS_TAG_70_MIN_METADATA_SIZE) {
                printk(KERN_WARNING "%s: max_packet_size is [%zd]; it must be "
                       "at least [%d]\n", __func__, max_packet_size,
-                       (1 + 1 + ECRYPTFS_SIG_SIZE + 1 + 1));
+                      ECRYPTFS_TAG_70_MIN_METADATA_SIZE);
                rc = -EINVAL;
                goto out;
        }
index 349209dc6a9162d18b7da50c891a389aa9c648d8..3a06f4043df42a811add69fd7ede7b582a94c347 100644 (file)
@@ -429,7 +429,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
                goto memdup;
        } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) {
                printk(KERN_WARNING "%s: Acceptable packet size range is "
-                      "[%d-%lu], but amount of data written is [%zu].",
+                      "[%d-%zu], but amount of data written is [%zu].",
                       __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count);
                return -EINVAL;
        }
index 10ec695ccd6832fc1c2293b2e1e83ffe524e9855..a46b3a8fee1ed246703d158c18834cb5cd22eb19 100644 (file)
@@ -150,7 +150,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
                        /* This is a header extent */
                        char *page_virt;
 
-                       page_virt = kmap_atomic(page, KM_USER0);
+                       page_virt = kmap_atomic(page);
                        memset(page_virt, 0, PAGE_CACHE_SIZE);
                        /* TODO: Support more than one header extent */
                        if (view_extent_num == 0) {
@@ -163,7 +163,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
                                                               crypt_stat,
                                                               &written);
                        }
-                       kunmap_atomic(page_virt, KM_USER0);
+                       kunmap_atomic(page_virt);
                        flush_dcache_page(page);
                        if (rc) {
                                printk(KERN_ERR "%s: Error reading xattr "
index 5c0106f757756e95d29fefba0f5d66c702200a29..b2a34a192f4f50f23c6ea8658926afbbb8d2fcb8 100644 (file)
@@ -156,7 +156,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
                               ecryptfs_page_idx, rc);
                        goto out;
                }
-               ecryptfs_page_virt = kmap_atomic(ecryptfs_page, KM_USER0);
+               ecryptfs_page_virt = kmap_atomic(ecryptfs_page);
 
                /*
                 * pos: where we're now writing, offset: where the request was
@@ -179,7 +179,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
                               (data + data_offset), num_bytes);
                        data_offset += num_bytes;
                }
-               kunmap_atomic(ecryptfs_page_virt, KM_USER0);
+               kunmap_atomic(ecryptfs_page_virt);
                flush_dcache_page(ecryptfs_page);
                SetPageUptodate(ecryptfs_page);
                unlock_page(ecryptfs_page);
index 9df7fd6e0c398d91a42c5c5627ea1e88ec868412..cf152823bbf42bcdb17fd6e8fadfdea048641593 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/seq_file.h>
 #include <linux/file.h>
 #include <linux/crypto.h>
+#include <linux/statfs.h>
+#include <linux/magic.h>
 #include "ecryptfs_kernel.h"
 
 struct kmem_cache *ecryptfs_inode_info_cache;
@@ -102,10 +104,20 @@ static void ecryptfs_destroy_inode(struct inode *inode)
 static int ecryptfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
        struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
+       int rc;
 
        if (!lower_dentry->d_sb->s_op->statfs)
                return -ENOSYS;
-       return lower_dentry->d_sb->s_op->statfs(lower_dentry, buf);
+
+       rc = lower_dentry->d_sb->s_op->statfs(lower_dentry, buf);
+       if (rc)
+               return rc;
+
+       buf->f_type = ECRYPTFS_SUPER_MAGIC;
+       rc = ecryptfs_set_f_namelen(&buf->f_namelen, buf->f_namelen,
+              &ecryptfs_superblock_to_private(dentry->d_sb)->mount_crypt_stat);
+
+       return rc;
 }
 
 /**
index aabdfc38cf2499817f150eace1efe8e8f08f1f8f..ea54cdef04ddc94d282c22f8c2b721169ee77293 100644 (file)
@@ -320,6 +320,11 @@ static inline int ep_is_linked(struct list_head *p)
        return !list_empty(p);
 }
 
+static inline struct eppoll_entry *ep_pwq_from_wait(wait_queue_t *p)
+{
+       return container_of(p, struct eppoll_entry, wait);
+}
+
 /* Get the "struct epitem" from a wait queue pointer */
 static inline struct epitem *ep_item_from_wait(wait_queue_t *p)
 {
@@ -467,6 +472,18 @@ static void ep_poll_safewake(wait_queue_head_t *wq)
        put_cpu();
 }
 
+static void ep_remove_wait_queue(struct eppoll_entry *pwq)
+{
+       wait_queue_head_t *whead;
+
+       rcu_read_lock();
+       /* If it is cleared by POLLFREE, it should be rcu-safe */
+       whead = rcu_dereference(pwq->whead);
+       if (whead)
+               remove_wait_queue(whead, &pwq->wait);
+       rcu_read_unlock();
+}
+
 /*
  * This function unregisters poll callbacks from the associated file
  * descriptor.  Must be called with "mtx" held (or "epmutex" if called from
@@ -481,7 +498,7 @@ static void ep_unregister_pollwait(struct eventpoll *ep, struct epitem *epi)
                pwq = list_first_entry(lsthead, struct eppoll_entry, llink);
 
                list_del(&pwq->llink);
-               remove_wait_queue(pwq->whead, &pwq->wait);
+               ep_remove_wait_queue(pwq);
                kmem_cache_free(pwq_cache, pwq);
        }
 }
@@ -842,6 +859,17 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
        struct epitem *epi = ep_item_from_wait(wait);
        struct eventpoll *ep = epi->ep;
 
+       if ((unsigned long)key & POLLFREE) {
+               ep_pwq_from_wait(wait)->whead = NULL;
+               /*
+                * whead = NULL above can race with ep_remove_wait_queue()
+                * which can do another remove_wait_queue() after us, so we
+                * can't use __remove_wait_queue(). whead->lock is held by
+                * the caller.
+                */
+               list_del_init(&wait->task_list);
+       }
+
        spin_lock_irqsave(&ep->lock, flags);
 
        /*
index 92ce83a11e90acbb0bceda45b682a83535089342..153dee14fe559b9180a2f79b4b1f8534e25c76f5 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1915,7 +1915,6 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
 {
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
-       struct completion *vfork_done;
        int core_waiters = -EBUSY;
 
        init_completion(&core_state->startup);
@@ -1927,22 +1926,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
                core_waiters = zap_threads(tsk, mm, core_state, exit_code);
        up_write(&mm->mmap_sem);
 
-       if (unlikely(core_waiters < 0))
-               goto fail;
-
-       /*
-        * Make sure nobody is waiting for us to release the VM,
-        * otherwise we can deadlock when we wait on each other
-        */
-       vfork_done = tsk->vfork_done;
-       if (vfork_done) {
-               tsk->vfork_done = NULL;
-               complete(vfork_done);
-       }
-
-       if (core_waiters)
+       if (core_waiters > 0)
                wait_for_completion(&core_state->startup);
-fail:
+
        return core_waiters;
 }
 
index 376816fcd04084f0cad9ad522aab51d8ce0ff7f1..351a3e797789a802669a084d3eef1c771583c6e3 100644 (file)
@@ -167,14 +167,19 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl)
        spin_unlock(&lru_lock);
 }
 
-static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
+static void __gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
 {
-       spin_lock(&lru_lock);
        if (!list_empty(&gl->gl_lru)) {
                list_del_init(&gl->gl_lru);
                atomic_dec(&lru_count);
                clear_bit(GLF_LRU, &gl->gl_flags);
        }
+}
+
+static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
+{
+       spin_lock(&lru_lock);
+       __gfs2_glock_remove_from_lru(gl);
        spin_unlock(&lru_lock);
 }
 
@@ -217,11 +222,12 @@ void gfs2_glock_put(struct gfs2_glock *gl)
        struct gfs2_sbd *sdp = gl->gl_sbd;
        struct address_space *mapping = gfs2_glock2aspace(gl);
 
-       if (atomic_dec_and_test(&gl->gl_ref)) {
+       if (atomic_dec_and_lock(&gl->gl_ref, &lru_lock)) {
+               __gfs2_glock_remove_from_lru(gl);
+               spin_unlock(&lru_lock);
                spin_lock_bucket(gl->gl_hash);
                hlist_bl_del_rcu(&gl->gl_list);
                spin_unlock_bucket(gl->gl_hash);
-               gfs2_glock_remove_from_lru(gl);
                GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders));
                GLOCK_BUG_ON(gl, mapping && mapping->nrpages);
                trace_gfs2_glock_put(gl);
index a7d611b93f0fca912ce716736df2524cad7b40be..56987460cdae2f2ca075aad642a4cd7f53a0152f 100644 (file)
@@ -391,10 +391,6 @@ static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation)
        int error;
        int dblocks = 1;
 
-       error = gfs2_rindex_update(sdp);
-       if (error)
-               fs_warn(sdp, "rindex update returns %d\n", error);
-
        error = gfs2_inplace_reserve(dip, RES_DINODE);
        if (error)
                goto out;
@@ -1043,6 +1039,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
        rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr);
        if (!rgd)
                goto out_inodes;
+
        gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2);
 
 
index 6aacf3f230a29d934347d2d2b130547769b2004e..24f609c9ef911edb3b3cabc9dc98dc4a78e1b92d 100644 (file)
@@ -800,6 +800,11 @@ static int init_inodes(struct gfs2_sbd *sdp, int undo)
                fs_err(sdp, "can't get quota file inode: %d\n", error);
                goto fail_rindex;
        }
+
+       error = gfs2_rindex_update(sdp);
+       if (error)
+               goto fail_qinode;
+
        return 0;
 
 fail_qinode:
index 981bfa32121a16c11c53fea23f0e734617755bfa..49ada95209d0108e333ddd164b44534edc8fa86b 100644 (file)
@@ -683,16 +683,21 @@ int gfs2_rindex_update(struct gfs2_sbd *sdp)
        struct gfs2_glock *gl = ip->i_gl;
        struct gfs2_holder ri_gh;
        int error = 0;
+       int unlock_required = 0;
 
        /* Read new copy from disk if we don't have the latest */
        if (!sdp->sd_rindex_uptodate) {
                mutex_lock(&sdp->sd_rindex_mutex);
-               error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);
-               if (error)
-                       return error;
+               if (!gfs2_glock_is_locked_by_me(gl)) {
+                       error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);
+                       if (error)
+                               return error;
+                       unlock_required = 1;
+               }
                if (!sdp->sd_rindex_uptodate)
                        error = gfs2_ri_update(ip);
-               gfs2_glock_dq_uninit(&ri_gh);
+               if (unlock_required)
+                       gfs2_glock_dq_uninit(&ri_gh);
                mutex_unlock(&sdp->sd_rindex_mutex);
        }
 
index fb10d86ffad70f8c4ded56ff664470d71f06dc48..d3ebdbe723d0d252358d23a75674d184e639dcb0 100644 (file)
@@ -1651,7 +1651,7 @@ __setup("ihash_entries=", set_ihash_entries);
  */
 void __init inode_init_early(void)
 {
-       int loop;
+       unsigned int loop;
 
        /* If hashes are distributed across NUMA nodes, defer
         * hash allocation until vmalloc space is available.
@@ -1669,13 +1669,13 @@ void __init inode_init_early(void)
                                        &i_hash_mask,
                                        0);
 
-       for (loop = 0; loop < (1 << i_hash_shift); loop++)
+       for (loop = 0; loop < (1U << i_hash_shift); loop++)
                INIT_HLIST_HEAD(&inode_hashtable[loop]);
 }
 
 void __init inode_init(void)
 {
-       int loop;
+       unsigned int loop;
 
        /* inode slab cache */
        inode_cachep = kmem_cache_create("inode_cache",
@@ -1699,7 +1699,7 @@ void __init inode_init(void)
                                        &i_hash_mask,
                                        0);
 
-       for (loop = 0; loop < (1 << i_hash_shift); loop++)
+       for (loop = 0; loop < (1U << i_hash_shift); loop++)
                INIT_HLIST_HEAD(&inode_hashtable[loop]);
 }
 
index 208c6aa4a989dade864a0ca6fcd3bd4b21ba8252..e2ba62820a0f35ee0531a4ad6ac0dc6725ad0b58 100644 (file)
@@ -1095,8 +1095,10 @@ static struct dentry *d_inode_lookup(struct dentry *parent, struct dentry *dentr
        struct dentry *old;
 
        /* Don't create child dentry for a dead directory. */
-       if (unlikely(IS_DEADDIR(inode)))
+       if (unlikely(IS_DEADDIR(inode))) {
+               dput(dentry);
                return ERR_PTR(-ENOENT);
+       }
 
        old = inode->i_op->lookup(inode, dentry, nd);
        if (unlikely(old)) {
@@ -1372,6 +1374,34 @@ static inline int can_lookup(struct inode *inode)
        return 1;
 }
 
+unsigned int full_name_hash(const unsigned char *name, unsigned int len)
+{
+       unsigned long hash = init_name_hash();
+       while (len--)
+               hash = partial_name_hash(*name++, hash);
+       return end_name_hash(hash);
+}
+EXPORT_SYMBOL(full_name_hash);
+
+/*
+ * We know there's a real path component here of at least
+ * one character.
+ */
+static inline unsigned long hash_name(const char *name, unsigned int *hashp)
+{
+       unsigned long hash = init_name_hash();
+       unsigned long len = 0, c;
+
+       c = (unsigned char)*name;
+       do {
+               len++;
+               hash = partial_name_hash(c, hash);
+               c = (unsigned char)name[len];
+       } while (c && c != '/');
+       *hashp = end_name_hash(hash);
+       return len;
+}
+
 /*
  * Name resolution.
  * This is the basic name resolution function, turning a pathname into
@@ -1392,31 +1422,22 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 
        /* At this point we know we have a real path component. */
        for(;;) {
-               unsigned long hash;
                struct qstr this;
-               unsigned int c;
+               long len;
                int type;
 
                err = may_lookup(nd);
                if (err)
                        break;
 
+               len = hash_name(name, &this.hash);
                this.name = name;
-               c = *(const unsigned char *)name;
-
-               hash = init_name_hash();
-               do {
-                       name++;
-                       hash = partial_name_hash(c, hash);
-                       c = *(const unsigned char *)name;
-               } while (c && (c != '/'));
-               this.len = name - (const char *) this.name;
-               this.hash = end_name_hash(hash);
+               this.len = len;
 
                type = LAST_NORM;
-               if (this.name[0] == '.') switch (this.len) {
+               if (name[0] == '.') switch (len) {
                        case 2:
-                               if (this.name[1] == '.') {
+                               if (name[1] == '.') {
                                        type = LAST_DOTDOT;
                                        nd->flags |= LOOKUP_JUMPED;
                                }
@@ -1435,12 +1456,18 @@ static int link_path_walk(const char *name, struct nameidata *nd)
                        }
                }
 
-               /* remove trailing slashes? */
-               if (!c)
+               if (!name[len])
                        goto last_component;
-               while (*++name == '/');
-               if (!*name)
+               /*
+                * If it wasn't NUL, we know it was '/'. Skip that
+                * slash, and continue until no more slashes.
+                */
+               do {
+                       len++;
+               } while (unlikely(name[len] == '/'));
+               if (!name[len])
                        goto last_component;
+               name += len;
 
                err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW);
                if (err < 0)
@@ -1773,24 +1800,21 @@ static struct dentry *lookup_hash(struct nameidata *nd)
 struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
 {
        struct qstr this;
-       unsigned long hash;
        unsigned int c;
 
        WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex));
 
        this.name = name;
        this.len = len;
+       this.hash = full_name_hash(name, len);
        if (!len)
                return ERR_PTR(-EACCES);
 
-       hash = init_name_hash();
        while (len--) {
                c = *(const unsigned char *)name++;
                if (c == '/' || c == '\0')
                        return ERR_PTR(-EACCES);
-               hash = partial_name_hash(c, hash);
        }
-       this.hash = end_name_hash(hash);
        /*
         * See if the low-level filesystem might want
         * to use its own hash..
index f0c849c98fe4bfb49208ed6a34f0714257431e75..ec9f6ef6c5dd596889c8f48f7dd91d3ff8a734e5 100644 (file)
@@ -3575,8 +3575,8 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
        }
        if (npages > 1) {
                /* for decoding across pages */
-               args.acl_scratch = alloc_page(GFP_KERNEL);
-               if (!args.acl_scratch)
+               res.acl_scratch = alloc_page(GFP_KERNEL);
+               if (!res.acl_scratch)
                        goto out_free;
        }
        args.acl_len = npages * PAGE_SIZE;
@@ -3612,8 +3612,8 @@ out_free:
        for (i = 0; i < npages; i++)
                if (pages[i])
                        __free_page(pages[i]);
-       if (args.acl_scratch)
-               __free_page(args.acl_scratch);
+       if (res.acl_scratch)
+               __free_page(res.acl_scratch);
        return ret;
 }
 
@@ -4883,8 +4883,10 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
                                clp->cl_rpcclient->cl_auth->au_flavor);
 
        res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL);
-       if (unlikely(!res.server_scope))
-               return -ENOMEM;
+       if (unlikely(!res.server_scope)) {
+               status = -ENOMEM;
+               goto out;
+       }
 
        status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
        if (!status)
@@ -4901,12 +4903,13 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
                        clp->server_scope = NULL;
                }
 
-               if (!clp->server_scope)
+               if (!clp->server_scope) {
                        clp->server_scope = res.server_scope;
-               else
-                       kfree(res.server_scope);
+                       goto out;
+               }
        }
-
+       kfree(res.server_scope);
+out:
        dprintk("<-- %s status= %d\n", __func__, status);
        return status;
 }
@@ -5008,37 +5011,53 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo)
        return status;
 }
 
+static struct nfs4_slot *nfs4_alloc_slots(u32 max_slots, gfp_t gfp_flags)
+{
+       return kcalloc(max_slots, sizeof(struct nfs4_slot), gfp_flags);
+}
+
+static void nfs4_add_and_init_slots(struct nfs4_slot_table *tbl,
+               struct nfs4_slot *new,
+               u32 max_slots,
+               u32 ivalue)
+{
+       struct nfs4_slot *old = NULL;
+       u32 i;
+
+       spin_lock(&tbl->slot_tbl_lock);
+       if (new) {
+               old = tbl->slots;
+               tbl->slots = new;
+               tbl->max_slots = max_slots;
+       }
+       tbl->highest_used_slotid = -1;  /* no slot is currently used */
+       for (i = 0; i < tbl->max_slots; i++)
+               tbl->slots[i].seq_nr = ivalue;
+       spin_unlock(&tbl->slot_tbl_lock);
+       kfree(old);
+}
+
 /*
- * Reset a slot table
+ * (re)Initialise a slot table
  */
-static int nfs4_reset_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs,
-                                int ivalue)
+static int nfs4_realloc_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs,
+                                u32 ivalue)
 {
        struct nfs4_slot *new = NULL;
-       int i;
-       int ret = 0;
+       int ret = -ENOMEM;
 
        dprintk("--> %s: max_reqs=%u, tbl->max_slots %d\n", __func__,
                max_reqs, tbl->max_slots);
 
        /* Does the newly negotiated max_reqs match the existing slot table? */
        if (max_reqs != tbl->max_slots) {
-               ret = -ENOMEM;
-               new = kmalloc(max_reqs * sizeof(struct nfs4_slot),
-                             GFP_NOFS);
+               new = nfs4_alloc_slots(max_reqs, GFP_NOFS);
                if (!new)
                        goto out;
-               ret = 0;
-               kfree(tbl->slots);
        }
-       spin_lock(&tbl->slot_tbl_lock);
-       if (new) {
-               tbl->slots = new;
-               tbl->max_slots = max_reqs;
-       }
-       for (i = 0; i < tbl->max_slots; ++i)
-               tbl->slots[i].seq_nr = ivalue;
-       spin_unlock(&tbl->slot_tbl_lock);
+       ret = 0;
+
+       nfs4_add_and_init_slots(tbl, new, max_reqs, ivalue);
        dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__,
                tbl, tbl->slots, tbl->max_slots);
 out:
@@ -5060,36 +5079,6 @@ static void nfs4_destroy_slot_tables(struct nfs4_session *session)
        return;
 }
 
-/*
- * Initialize slot table
- */
-static int nfs4_init_slot_table(struct nfs4_slot_table *tbl,
-               int max_slots, int ivalue)
-{
-       struct nfs4_slot *slot;
-       int ret = -ENOMEM;
-
-       BUG_ON(max_slots > NFS4_MAX_SLOT_TABLE);
-
-       dprintk("--> %s: max_reqs=%u\n", __func__, max_slots);
-
-       slot = kcalloc(max_slots, sizeof(struct nfs4_slot), GFP_NOFS);
-       if (!slot)
-               goto out;
-       ret = 0;
-
-       spin_lock(&tbl->slot_tbl_lock);
-       tbl->max_slots = max_slots;
-       tbl->slots = slot;
-       tbl->highest_used_slotid = -1;  /* no slot is currently used */
-       spin_unlock(&tbl->slot_tbl_lock);
-       dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__,
-               tbl, tbl->slots, tbl->max_slots);
-out:
-       dprintk("<-- %s: return %d\n", __func__, ret);
-       return ret;
-}
-
 /*
  * Initialize or reset the forechannel and backchannel tables
  */
@@ -5101,25 +5090,16 @@ static int nfs4_setup_session_slot_tables(struct nfs4_session *ses)
        dprintk("--> %s\n", __func__);
        /* Fore channel */
        tbl = &ses->fc_slot_table;
-       if (tbl->slots == NULL) {
-               status = nfs4_init_slot_table(tbl, ses->fc_attrs.max_reqs, 1);
-               if (status) /* -ENOMEM */
-                       return status;
-       } else {
-               status = nfs4_reset_slot_table(tbl, ses->fc_attrs.max_reqs, 1);
-               if (status)
-                       return status;
-       }
+       status = nfs4_realloc_slot_table(tbl, ses->fc_attrs.max_reqs, 1);
+       if (status) /* -ENOMEM */
+               return status;
        /* Back channel */
        tbl = &ses->bc_slot_table;
-       if (tbl->slots == NULL) {
-               status = nfs4_init_slot_table(tbl, ses->bc_attrs.max_reqs, 0);
-               if (status)
-                       /* Fore and back channel share a connection so get
-                        * both slot tables or neither */
-                       nfs4_destroy_slot_tables(ses);
-       } else
-               status = nfs4_reset_slot_table(tbl, ses->bc_attrs.max_reqs, 0);
+       status = nfs4_realloc_slot_table(tbl, ses->bc_attrs.max_reqs, 0);
+       if (status && tbl->slots == NULL)
+               /* Fore and back channel share a connection so get
+                * both slot tables or neither */
+               nfs4_destroy_slot_tables(ses);
        return status;
 }
 
index a53f33b4ac3a5cf333afe80b358f27fe4130289f..45392032e7bd60b85b00fb74f86ca99a603e31d4 100644 (file)
@@ -1132,6 +1132,8 @@ void nfs4_schedule_stateid_recovery(const struct nfs_server *server, struct nfs4
 {
        struct nfs_client *clp = server->nfs_client;
 
+       if (test_and_clear_bit(NFS_DELEGATED_STATE, &state->flags))
+               nfs_async_inode_return_delegation(state->inode, &state->stateid);
        nfs4_state_mark_reclaim_nograce(clp, state);
        nfs4_schedule_state_manager(clp);
 }
index 95e92e438407c8ea39d2a6a717faeb919dd14819..33bd8d0f745d8baaa11b41fc3fcffde52ee3f02a 100644 (file)
@@ -2522,7 +2522,6 @@ static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr,
 
        xdr_inline_pages(&req->rq_rcv_buf, replen << 2,
                args->acl_pages, args->acl_pgbase, args->acl_len);
-       xdr_set_scratch_buffer(xdr, page_address(args->acl_scratch), PAGE_SIZE);
 
        encode_nops(&hdr);
 }
@@ -6032,6 +6031,10 @@ nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
        struct compound_hdr hdr;
        int status;
 
+       if (res->acl_scratch != NULL) {
+               void *p = page_address(res->acl_scratch);
+               xdr_set_scratch_buffer(xdr, p, PAGE_SIZE);
+       }
        status = decode_compound_hdr(xdr, &hdr);
        if (status)
                goto out;
index f14fde2b03d68f03e38b1aa62580227a5243cc91..e0281992ddc33377bb47287d967336012c2d3d48 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * attrib.c - NTFS attribute operations.  Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2007 Anton Altaparmakov
+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
  * Copyright (c) 2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
@@ -345,10 +345,10 @@ LCN ntfs_attr_vcn_to_lcn_nolock(ntfs_inode *ni, const VCN vcn,
        unsigned long flags;
        bool is_retry = false;
 
+       BUG_ON(!ni);
        ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.",
                        ni->mft_no, (unsigned long long)vcn,
                        write_locked ? "write" : "read");
-       BUG_ON(!ni);
        BUG_ON(!NInoNonResident(ni));
        BUG_ON(vcn < 0);
        if (!ni->runlist.rl) {
@@ -469,9 +469,9 @@ runlist_element *ntfs_attr_find_vcn_nolock(ntfs_inode *ni, const VCN vcn,
        int err = 0;
        bool is_retry = false;
 
+       BUG_ON(!ni);
        ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.",
                        ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out");
-       BUG_ON(!ni);
        BUG_ON(!NInoNonResident(ni));
        BUG_ON(vcn < 0);
        if (!ni->runlist.rl) {
index 382857f9c7db34c0edd3957f9beb65355e02f2a1..3014a36a255b97ddcac0b1852fa0d11c613b7a9d 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc.
+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
  * Copyright (c) 2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
@@ -1367,7 +1367,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)
                        ntfs_error(vol->sb, "Failed to merge runlists for mft "
                                        "bitmap.");
                        if (ntfs_cluster_free_from_rl(vol, rl2)) {
-                               ntfs_error(vol->sb, "Failed to dealocate "
+                               ntfs_error(vol->sb, "Failed to deallocate "
                                                "allocated cluster.%s", es);
                                NVolSetErrors(vol);
                        }
@@ -1805,7 +1805,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
                ntfs_error(vol->sb, "Failed to merge runlists for mft data "
                                "attribute.");
                if (ntfs_cluster_free_from_rl(vol, rl2)) {
-                       ntfs_error(vol->sb, "Failed to dealocate clusters "
+                       ntfs_error(vol->sb, "Failed to deallocate clusters "
                                        "from the mft data attribute.%s", es);
                        NVolSetErrors(vol);
                }
index 5a4a8af5c406a20e51d57807400a572e3bcbf6bc..f907611cca73c2de10ce7645b8afafb3319cf9fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc.
+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
  * Copyright (c) 2001,2002 Richard Russon
  *
  * This program/include file is free software; you can redistribute it and/or
@@ -1239,7 +1239,6 @@ static int check_windows_hibernation_status(ntfs_volume *vol)
 {
        MFT_REF mref;
        struct inode *vi;
-       ntfs_inode *ni;
        struct page *page;
        u32 *kaddr, *kend;
        ntfs_name *name = NULL;
@@ -1290,7 +1289,6 @@ static int check_windows_hibernation_status(ntfs_volume *vol)
                                "is not the system volume.", i_size_read(vi));
                goto iput_out;
        }
-       ni = NTFS_I(vi);
        page = ntfs_map_page(vi->i_mapping, 0);
        if (IS_ERR(page)) {
                ntfs_error(vol->sb, "Failed to read from hiberfil.sys.");
index be244692550db3e18cf05987ff577717e1f33173..a9856e3eaaf09753b4921d56ccdfb172db5cad7b 100644 (file)
@@ -1053,7 +1053,7 @@ static int ocfs2_rename(struct inode *old_dir,
        handle_t *handle = NULL;
        struct buffer_head *old_dir_bh = NULL;
        struct buffer_head *new_dir_bh = NULL;
-       nlink_t old_dir_nlink = old_dir->i_nlink;
+       u32 old_dir_nlink = old_dir->i_nlink;
        struct ocfs2_dinode *old_di;
        struct ocfs2_dir_lookup_result old_inode_dot_dot_res = { NULL, };
        struct ocfs2_dir_lookup_result target_lookup_res = { NULL, };
index 7898cd688a0073b8caf6c193fc3deb1dc8722f5f..fc2c4388d1262a1771d27acb7c55507369cf0dba 100644 (file)
@@ -292,11 +292,26 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
        }
 }
 
+/* Return 1 if 'cmd' will block on frozen filesystem */
+static int quotactl_cmd_write(int cmd)
+{
+       switch (cmd) {
+       case Q_GETFMT:
+       case Q_GETINFO:
+       case Q_SYNC:
+       case Q_XGETQSTAT:
+       case Q_XGETQUOTA:
+       case Q_XQUOTASYNC:
+               return 0;
+       }
+       return 1;
+}
+
 /*
  * look up a superblock on which quota ops will be performed
  * - use the name of a block device to find the superblock thereon
  */
-static struct super_block *quotactl_block(const char __user *special)
+static struct super_block *quotactl_block(const char __user *special, int cmd)
 {
 #ifdef CONFIG_BLOCK
        struct block_device *bdev;
@@ -309,7 +324,10 @@ static struct super_block *quotactl_block(const char __user *special)
        putname(tmp);
        if (IS_ERR(bdev))
                return ERR_CAST(bdev);
-       sb = get_super(bdev);
+       if (quotactl_cmd_write(cmd))
+               sb = get_super_thawed(bdev);
+       else
+               sb = get_super(bdev);
        bdput(bdev);
        if (!sb)
                return ERR_PTR(-ENODEV);
@@ -361,7 +379,7 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
                        pathp = &path;
        }
 
-       sb = quotactl_block(special);
+       sb = quotactl_block(special, cmds);
        if (IS_ERR(sb)) {
                ret = PTR_ERR(sb);
                goto out;
index d33418fdc858fbbe7f929d692dae1533c2e9a271..e782258d0de3cec01c6767aa5cb2b2684e1077ac 100644 (file)
@@ -912,7 +912,7 @@ static long do_restart_poll(struct restart_block *restart_block)
 }
 
 SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
-               long, timeout_msecs)
+               int, timeout_msecs)
 {
        struct timespec end_time, *to = NULL;
        int ret;
index 492465b451ddd34f6f60214fb48224687649faa9..7ae2a574cb25a64902128f53832b317202dbee8f 100644 (file)
 #include <linux/signalfd.h>
 #include <linux/syscalls.h>
 
+void signalfd_cleanup(struct sighand_struct *sighand)
+{
+       wait_queue_head_t *wqh = &sighand->signalfd_wqh;
+       /*
+        * The lockless check can race with remove_wait_queue() in progress,
+        * but in this case its caller should run under rcu_read_lock() and
+        * sighand_cachep is SLAB_DESTROY_BY_RCU, we can safely return.
+        */
+       if (likely(!waitqueue_active(wqh)))
+               return;
+
+       /* wait_queue_t->func(POLLFREE) should do remove_wait_queue() */
+       wake_up_poll(wqh, POLLHUP | POLLFREE);
+}
+
 struct signalfd_ctx {
        sigset_t sigmask;
 };
index 6015c02296b7ad2adba75c7946b8fb4762a62265..6277ec6cb60a65e71b2c590260c67a057a1748ca 100644 (file)
@@ -633,6 +633,28 @@ rescan:
 
 EXPORT_SYMBOL(get_super);
 
+/**
+ *     get_super_thawed - get thawed superblock of a device
+ *     @bdev: device to get the superblock for
+ *
+ *     Scans the superblock list and finds the superblock of the file system
+ *     mounted on the device. The superblock is returned once it is thawed
+ *     (or immediately if it was not frozen). %NULL is returned if no match
+ *     is found.
+ */
+struct super_block *get_super_thawed(struct block_device *bdev)
+{
+       while (1) {
+               struct super_block *s = get_super(bdev);
+               if (!s || s->s_frozen == SB_UNFROZEN)
+                       return s;
+               up_read(&s->s_umount);
+               vfs_check_frozen(s, SB_FREEZE_WRITE);
+               put_super(s);
+       }
+}
+EXPORT_SYMBOL(get_super_thawed);
+
 /**
  * get_active_super - get an active reference to the superblock of a device
  * @bdev: device to get the superblock for
index cbcb7bea38e2acf5198391b41ce92d359a3521df..53db20ee3e774fab3f643f8c280e018086dffa10 100644 (file)
@@ -139,10 +139,10 @@ xfs_qm_adjust_dqtimers(
 
        if (!d->d_btimer) {
                if ((d->d_blk_softlimit &&
-                    (be64_to_cpu(d->d_bcount) >=
+                    (be64_to_cpu(d->d_bcount) >
                      be64_to_cpu(d->d_blk_softlimit))) ||
                    (d->d_blk_hardlimit &&
-                    (be64_to_cpu(d->d_bcount) >=
+                    (be64_to_cpu(d->d_bcount) >
                      be64_to_cpu(d->d_blk_hardlimit)))) {
                        d->d_btimer = cpu_to_be32(get_seconds() +
                                        mp->m_quotainfo->qi_btimelimit);
@@ -151,10 +151,10 @@ xfs_qm_adjust_dqtimers(
                }
        } else {
                if ((!d->d_blk_softlimit ||
-                    (be64_to_cpu(d->d_bcount) <
+                    (be64_to_cpu(d->d_bcount) <=
                      be64_to_cpu(d->d_blk_softlimit))) &&
                    (!d->d_blk_hardlimit ||
-                   (be64_to_cpu(d->d_bcount) <
+                   (be64_to_cpu(d->d_bcount) <=
                     be64_to_cpu(d->d_blk_hardlimit)))) {
                        d->d_btimer = 0;
                }
@@ -162,10 +162,10 @@ xfs_qm_adjust_dqtimers(
 
        if (!d->d_itimer) {
                if ((d->d_ino_softlimit &&
-                    (be64_to_cpu(d->d_icount) >=
+                    (be64_to_cpu(d->d_icount) >
                      be64_to_cpu(d->d_ino_softlimit))) ||
                    (d->d_ino_hardlimit &&
-                    (be64_to_cpu(d->d_icount) >=
+                    (be64_to_cpu(d->d_icount) >
                      be64_to_cpu(d->d_ino_hardlimit)))) {
                        d->d_itimer = cpu_to_be32(get_seconds() +
                                        mp->m_quotainfo->qi_itimelimit);
@@ -174,10 +174,10 @@ xfs_qm_adjust_dqtimers(
                }
        } else {
                if ((!d->d_ino_softlimit ||
-                    (be64_to_cpu(d->d_icount) <
+                    (be64_to_cpu(d->d_icount) <=
                      be64_to_cpu(d->d_ino_softlimit)))  &&
                    (!d->d_ino_hardlimit ||
-                    (be64_to_cpu(d->d_icount) <
+                    (be64_to_cpu(d->d_icount) <=
                      be64_to_cpu(d->d_ino_hardlimit)))) {
                        d->d_itimer = 0;
                }
@@ -185,10 +185,10 @@ xfs_qm_adjust_dqtimers(
 
        if (!d->d_rtbtimer) {
                if ((d->d_rtb_softlimit &&
-                    (be64_to_cpu(d->d_rtbcount) >=
+                    (be64_to_cpu(d->d_rtbcount) >
                      be64_to_cpu(d->d_rtb_softlimit))) ||
                    (d->d_rtb_hardlimit &&
-                    (be64_to_cpu(d->d_rtbcount) >=
+                    (be64_to_cpu(d->d_rtbcount) >
                      be64_to_cpu(d->d_rtb_hardlimit)))) {
                        d->d_rtbtimer = cpu_to_be32(get_seconds() +
                                        mp->m_quotainfo->qi_rtbtimelimit);
@@ -197,10 +197,10 @@ xfs_qm_adjust_dqtimers(
                }
        } else {
                if ((!d->d_rtb_softlimit ||
-                    (be64_to_cpu(d->d_rtbcount) <
+                    (be64_to_cpu(d->d_rtbcount) <=
                      be64_to_cpu(d->d_rtb_softlimit))) &&
                    (!d->d_rtb_hardlimit ||
-                    (be64_to_cpu(d->d_rtbcount) <
+                    (be64_to_cpu(d->d_rtbcount) <=
                      be64_to_cpu(d->d_rtb_hardlimit)))) {
                        d->d_rtbtimer = 0;
                }
index 15ff5392fb65a601c616c7d30df246d211c70c2b..0ed9ee77937c50470fdea8b7573ea738e4a1587c 100644 (file)
@@ -1981,7 +1981,7 @@ xfs_qm_dqcheck(
 
        if (!errs && ddq->d_id) {
                if (ddq->d_blk_softlimit &&
-                   be64_to_cpu(ddq->d_bcount) >=
+                   be64_to_cpu(ddq->d_bcount) >
                                be64_to_cpu(ddq->d_blk_softlimit)) {
                        if (!ddq->d_btimer) {
                                if (flags & XFS_QMOPT_DOWARN)
@@ -1992,7 +1992,7 @@ xfs_qm_dqcheck(
                        }
                }
                if (ddq->d_ino_softlimit &&
-                   be64_to_cpu(ddq->d_icount) >=
+                   be64_to_cpu(ddq->d_icount) >
                                be64_to_cpu(ddq->d_ino_softlimit)) {
                        if (!ddq->d_itimer) {
                                if (flags & XFS_QMOPT_DOWARN)
@@ -2003,7 +2003,7 @@ xfs_qm_dqcheck(
                        }
                }
                if (ddq->d_rtb_softlimit &&
-                   be64_to_cpu(ddq->d_rtbcount) >=
+                   be64_to_cpu(ddq->d_rtbcount) >
                                be64_to_cpu(ddq->d_rtb_softlimit)) {
                        if (!ddq->d_rtbtimer) {
                                if (flags & XFS_QMOPT_DOWARN)
index eafbcff81f3af43c9dae0a73175bc71abba4a7c5..711a86e39ff046d302a5ff14695882b65bcb3e25 100644 (file)
@@ -813,11 +813,11 @@ xfs_qm_export_dquot(
             (XFS_IS_OQUOTA_ENFORCED(mp) &&
                        (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) &&
            dst->d_id != 0) {
-               if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) &&
+               if (((int) dst->d_bcount > (int) dst->d_blk_softlimit) &&
                    (dst->d_blk_softlimit > 0)) {
                        ASSERT(dst->d_btimer != 0);
                }
-               if (((int) dst->d_icount >= (int) dst->d_ino_softlimit) &&
+               if (((int) dst->d_icount > (int) dst->d_ino_softlimit) &&
                    (dst->d_ino_softlimit > 0)) {
                        ASSERT(dst->d_itimer != 0);
                }
index 329b06aba1c2c59ab1b973a3a956a3af23c68abf..7adcdf15ae0ce563b32eb37582fbdd79a8fdba15 100644 (file)
@@ -1151,8 +1151,8 @@ xfs_trans_add_item(
 {
        struct xfs_log_item_desc *lidp;
 
-       ASSERT(lip->li_mountp = tp->t_mountp);
-       ASSERT(lip->li_ailp = tp->t_mountp->m_ail);
+       ASSERT(lip->li_mountp == tp->t_mountp);
+       ASSERT(lip->li_ailp == tp->t_mountp->m_ail);
 
        lidp = kmem_zone_zalloc(xfs_log_item_desc_zone, KM_SLEEP | KM_NOFS);
 
index 4d00ee67792db020ed4cf46fdb5812322f9ec8d2..c4ba366d24e65c8fde43fa7a6ca32b4735bce331 100644 (file)
@@ -649,12 +649,12 @@ xfs_trans_dqresv(
                         * nblks.
                         */
                        if (hardlimit > 0ULL &&
-                           hardlimit <= nblks + *resbcountp) {
+                           hardlimit < nblks + *resbcountp) {
                                xfs_quota_warn(mp, dqp, QUOTA_NL_BHARDWARN);
                                goto error_return;
                        }
                        if (softlimit > 0ULL &&
-                           softlimit <= nblks + *resbcountp) {
+                           softlimit < nblks + *resbcountp) {
                                if ((timer != 0 && get_seconds() > timer) ||
                                    (warns != 0 && warns >= warnlimit)) {
                                        xfs_quota_warn(mp, dqp,
@@ -677,11 +677,13 @@ xfs_trans_dqresv(
                        if (!softlimit)
                                softlimit = q->qi_isoftlimit;
 
-                       if (hardlimit > 0ULL && count >= hardlimit) {
+                       if (hardlimit > 0ULL &&
+                           hardlimit < ninos + count) {
                                xfs_quota_warn(mp, dqp, QUOTA_NL_IHARDWARN);
                                goto error_return;
                        }
-                       if (softlimit > 0ULL && count >= softlimit) {
+                       if (softlimit > 0ULL &&
+                           softlimit < ninos + count) {
                                if  ((timer != 0 && get_seconds() > timer) ||
                                     (warns != 0 && warns >= warnlimit)) {
                                        xfs_quota_warn(mp, dqp,
diff --git a/include/asm-generic/io-64-nonatomic-hi-lo.h b/include/asm-generic/io-64-nonatomic-hi-lo.h
new file mode 100644 (file)
index 0000000..a6806a9
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _ASM_IO_64_NONATOMIC_HI_LO_H_
+#define _ASM_IO_64_NONATOMIC_HI_LO_H_
+
+#include <linux/io.h>
+#include <asm-generic/int-ll64.h>
+
+#ifndef readq
+static inline __u64 readq(const volatile void __iomem *addr)
+{
+       const volatile u32 __iomem *p = addr;
+       u32 low, high;
+
+       high = readl(p + 1);
+       low = readl(p);
+
+       return low + ((u64)high << 32);
+}
+#endif
+
+#ifndef writeq
+static inline void writeq(__u64 val, volatile void __iomem *addr)
+{
+       writel(val >> 32, addr + 4);
+       writel(val, addr);
+}
+#endif
+
+#endif /* _ASM_IO_64_NONATOMIC_HI_LO_H_ */
diff --git a/include/asm-generic/io-64-nonatomic-lo-hi.h b/include/asm-generic/io-64-nonatomic-lo-hi.h
new file mode 100644 (file)
index 0000000..ca546b1
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _ASM_IO_64_NONATOMIC_LO_HI_H_
+#define _ASM_IO_64_NONATOMIC_LO_HI_H_
+
+#include <linux/io.h>
+#include <asm-generic/int-ll64.h>
+
+#ifndef readq
+static inline __u64 readq(const volatile void __iomem *addr)
+{
+       const volatile u32 __iomem *p = addr;
+       u32 low, high;
+
+       low = readl(p);
+       high = readl(p + 1);
+
+       return low + ((u64)high << 32);
+}
+#endif
+
+#ifndef writeq
+static inline void writeq(__u64 val, volatile void __iomem *addr)
+{
+       writel(val, addr);
+       writel(val >> 32, addr + 4);
+}
+#endif
+
+#endif /* _ASM_IO_64_NONATOMIC_LO_HI_H_ */
index 8a3d4fde26040600f7ddb9d7c3e67a4807b265ff..6afd7d6a9899c49fe721a7bb989c947ea5dc9c75 100644 (file)
@@ -70,7 +70,7 @@ extern void ioport_unmap(void __iomem *);
 /* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */
 struct pci_dev;
 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
-#else
+#elif defined(CONFIG_GENERIC_IOMAP)
 struct pci_dev;
 static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 { }
index e58fcf891370e73996a7fe09b510a7b61d7a9fb8..ce37349860fece8cdf991165db8c8849a677e270 100644 (file)
@@ -25,7 +25,7 @@ extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
 #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
 #endif
 
-#else
+#elif defined(CONFIG_GENERIC_PCI_IOMAP)
 static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
 {
        return NULL;
index 44bce836d350a651284b325adc220d0ead84da58..9ce7f44aebd2ab64a91b2f21b436a3377e54f045 100644 (file)
@@ -28,6 +28,8 @@
 #define POLLRDHUP       0x2000
 #endif
 
+#define POLLFREE       0x4000  /* currently only for epoll */
+
 struct pollfd {
        int fd;
        short events;
index a5c0e10fd47d4a93a3bbc49c04bbff4f686b08c9..1e38a19d68f6220d3c89d9f3ffae84b8cbb012a2 100644 (file)
@@ -2,6 +2,7 @@ header-y += drm.h
 header-y += drm_fourcc.h
 header-y += drm_mode.h
 header-y += drm_sarea.h
+header-y += exynos_drm.h
 header-y += i810_drm.h
 header-y += i915_drm.h
 header-y += mga_drm.h
index 5e120f1c5cd927ec154ef1bc5d59ae207f62d92e..1ed3aae893a5b2224554820cdbe3e7c9ad9d6ed4 100644 (file)
@@ -97,15 +97,30 @@ struct drm_exynos_plane_set_zpos {
 #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS        DRM_IOWR(DRM_COMMAND_BASE + \
                DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos)
 
+#ifdef __KERNEL__
+
 /**
- * Platform Specific Structure for DRM based FIMD.
+ * A structure for lcd panel information.
  *
  * @timing: default video mode for initializing
+ * @width_mm: physical size of lcd width.
+ * @height_mm: physical size of lcd height.
+ */
+struct exynos_drm_panel_info {
+       struct fb_videomode timing;
+       u32 width_mm;
+       u32 height_mm;
+};
+
+/**
+ * Platform Specific Structure for DRM based FIMD.
+ *
+ * @panel: default panel info for initializing
  * @default_win: default window layer number to be used for UI.
  * @bpp: default bit per pixel.
  */
 struct exynos_drm_fimd_pdata {
-       struct fb_videomode             timing;
+       struct exynos_drm_panel_info panel;
        u32                             vidcon0;
        u32                             vidcon1;
        unsigned int                    default_win;
@@ -139,4 +154,5 @@ struct exynos_drm_hdmi_pdata {
        unsigned int                    bpp;
 };
 
-#endif
+#endif /* __KERNEL__ */
+#endif /* _EXYNOS_DRM_H_ */
index 3c1063acb2abd6e7db59b0f7de4a756630f7e375..94300fe46ccedd4ca5333fad2b0bac4a74b704b0 100644 (file)
@@ -55,6 +55,26 @@ static inline unsigned long hweight_long(unsigned long w)
        return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
 }
 
+/**
+ * rol64 - rotate a 64-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline __u64 rol64(__u64 word, unsigned int shift)
+{
+       return (word << shift) | (word >> (64 - shift));
+}
+
+/**
+ * ror64 - rotate a 64-bit value right
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline __u64 ror64(__u64 word, unsigned int shift)
+{
+       return (word >> shift) | (word << (64 - shift));
+}
+
 /**
  * rol32 - rotate a 32-bit value left
  * @word: value to rotate
index 41c9f6515f4621f6f20e90e0f5adbb4958829c58..7e05fcee75a158815986fe9477fbbf98bde50052 100644 (file)
@@ -561,5 +561,9 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
                unsigned long liovcnt, const struct compat_iovec __user *rvec,
                unsigned long riovcnt, unsigned long flags);
 
+#else
+
+#define is_compat_task() (0)
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
index d64a55b23afda64f4b490ef475e092edcf3c32b7..ff5f5256d175c8dde1345394f8fedd4e701b03e0 100644 (file)
@@ -47,27 +47,6 @@ struct dentry_stat_t {
 };
 extern struct dentry_stat_t dentry_stat;
 
-/*
- * Compare 2 name strings, return 0 if they match, otherwise non-zero.
- * The strings are both count bytes long, and count is non-zero.
- */
-static inline int dentry_cmp(const unsigned char *cs, size_t scount,
-                               const unsigned char *ct, size_t tcount)
-{
-       int ret;
-       if (scount != tcount)
-               return 1;
-       do {
-               ret = (*cs != *ct);
-               if (ret)
-                       break;
-               cs++;
-               ct++;
-               tcount--;
-       } while (tcount);
-       return ret;
-}
-
 /* Name hashing routines. Initial hash value */
 /* Hash courtesy of the R5 hash in reiserfs modulo sign bits */
 #define init_name_hash()               0
@@ -89,14 +68,7 @@ static inline unsigned long end_name_hash(unsigned long hash)
 }
 
 /* Compute the hash for a name string. */
-static inline unsigned int
-full_name_hash(const unsigned char *name, unsigned int len)
-{
-       unsigned long hash = init_name_hash();
-       while (len--)
-               hash = partial_name_hash(*name++, hash);
-       return end_name_hash(hash);
-}
+extern unsigned int full_name_hash(const unsigned char *, unsigned int);
 
 /*
  * Try to keep struct dentry aligned on 64 byte cachelines (this will
@@ -309,7 +281,8 @@ extern struct dentry *d_ancestor(struct dentry *, struct dentry *);
 extern struct dentry *d_lookup(struct dentry *, struct qstr *);
 extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *);
 extern struct dentry *__d_lookup(struct dentry *, struct qstr *);
-extern struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name,
+extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
+                               const struct qstr *name,
                                unsigned *seq, struct inode **inode);
 
 /**
index b01558b15814f6d94be21272d385df3a1c4d23b5..6f85a070bb45a052334387b9574264656df108cd 100644 (file)
@@ -30,7 +30,7 @@ enum digest_algo {
 
 struct pubkey_hdr {
        uint8_t         version;        /* key format version */
-       time_t          timestamp;      /* key made, always 0 for now */
+       uint32_t        timestamp;      /* key made, always 0 for now */
        uint8_t         algo;
        uint8_t         nmpi;
        char            mpi[0];
@@ -38,7 +38,7 @@ struct pubkey_hdr {
 
 struct signature_hdr {
        uint8_t         version;        /* signature format version */
-       time_t          timestamp;      /* signature made */
+       uint32_t        timestamp;      /* signature made */
        uint8_t         algo;
        uint8_t         hash;
        uint8_t         keyid[8];
index 386da09f229dfad8ff8ef5600c8045f221ae862f..69cd5bb640f5f6f0e4dd13431c34c6f8c760f42b 100644 (file)
@@ -2496,6 +2496,7 @@ extern void get_filesystem(struct file_system_type *fs);
 extern void put_filesystem(struct file_system_type *fs);
 extern struct file_system_type *get_fs_type(const char *name);
 extern struct super_block *get_super(struct block_device *);
+extern struct super_block *get_super_thawed(struct block_device *);
 extern struct super_block *get_active_super(struct block_device *bdev);
 extern void drop_super(struct super_block *sb);
 extern void iterate_supers(void (*)(struct super_block *, void *), void *);
index c52d4b5f872a9b103d4f42b41e5bfbd4235b756b..4b24ff453aee56029a2b2e0b5ee233b9afab6977 100644 (file)
@@ -137,6 +137,7 @@ enum {
        IFLA_AF_SPEC,
        IFLA_GROUP,             /* Group the device belongs to */
        IFLA_NET_NS_FD,
+       IFLA_EXT_MASK,          /* Extended info mask, VFs, etc */
        __IFLA_MAX
 };
 
index fee66317e071547a4a75e0b90b61399b97249ed2..35f7237ec972bef4ce1ba24cd617571a193ce806 100644 (file)
 #include <linux/errno.h>
 #include <linux/list.h>
 
+/*
+ * Keep this list arranged in rough order of priority. Anything listed after
+ * KMSG_DUMP_OOPS will not be logged by default unless printk.always_kmsg_dump
+ * is passed to the kernel.
+ */
 enum kmsg_dump_reason {
-       KMSG_DUMP_OOPS,
        KMSG_DUMP_PANIC,
+       KMSG_DUMP_OOPS,
+       KMSG_DUMP_EMERG,
        KMSG_DUMP_RESTART,
        KMSG_DUMP_HALT,
        KMSG_DUMP_POWEROFF,
-       KMSG_DUMP_EMERG,
 };
 
 /**
index 4d34356fe644ee5dca447071829ae06ab68eeb60..b80de520670b64a67dc2ceb8b4e4e11c1d623071 100644 (file)
@@ -129,7 +129,6 @@ extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
 extern void mem_cgroup_replace_page_cache(struct page *oldpage,
                                        struct page *newpage);
 
-extern void mem_cgroup_reset_owner(struct page *page);
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
 extern int do_swap_account;
 #endif
@@ -392,10 +391,6 @@ static inline void mem_cgroup_replace_page_cache(struct page *oldpage,
                                struct page *newpage)
 {
 }
-
-static inline void mem_cgroup_reset_owner(struct page *page)
-{
-}
 #endif /* CONFIG_CGROUP_MEM_CONT */
 
 #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM)
index 8797ed16feb2c9ff8fec27adbd914c6f38624e0e..4dd5bd6994a8f7397d65f2b6426c9d27a17c1828 100644 (file)
@@ -285,8 +285,8 @@ struct ebt_table {
        struct module *me;
 };
 
-#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \
-                    ~(__alignof__(struct ebt_replace)-1))
+#define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \
+                    ~(__alignof__(struct _xt_align)-1))
 extern struct ebt_table *ebt_register_table(struct net *net,
                                            const struct ebt_table *table);
 extern void ebt_unregister_table(struct net *net, struct ebt_table *table);
index a764cef06b733f34f89ed4a618bfb41e33428258..d6ba9a12591ea464991b1d36157918ee5fc1eebe 100644 (file)
@@ -614,7 +614,6 @@ struct nfs_getaclargs {
        size_t                          acl_len;
        unsigned int                    acl_pgbase;
        struct page **                  acl_pages;
-       struct page *                   acl_scratch;
        struct nfs4_sequence_args       seq_args;
 };
 
@@ -624,6 +623,7 @@ struct nfs_getaclres {
        size_t                          acl_len;
        size_t                          acl_data_offset;
        int                             acl_flags;
+       struct page *                   acl_scratch;
        struct nfs4_sequence_res        seq_res;
 };
 
index 32cd1f67462e9b4a80f602474878c6ff632d6976..21638ae14e07c71a005d6cfcea61958e8cd8f970 100644 (file)
@@ -348,9 +348,9 @@ do {                                                                        \
 #define _this_cpu_generic_to_op(pcp, val, op)                          \
 do {                                                                   \
        unsigned long flags;                                            \
-       local_irq_save(flags);                                          \
+       raw_local_irq_save(flags);                                      \
        *__this_cpu_ptr(&(pcp)) op val;                                 \
-       local_irq_restore(flags);                                       \
+       raw_local_irq_restore(flags);                                   \
 } while (0)
 
 #ifndef this_cpu_write
@@ -449,10 +449,10 @@ do {                                                                      \
 ({                                                                     \
        typeof(pcp) ret__;                                              \
        unsigned long flags;                                            \
-       local_irq_save(flags);                                          \
+       raw_local_irq_save(flags);                                      \
        __this_cpu_add(pcp, val);                                       \
        ret__ = __this_cpu_read(pcp);                                   \
-       local_irq_restore(flags);                                       \
+       raw_local_irq_restore(flags);                                   \
        ret__;                                                          \
 })
 
@@ -479,10 +479,10 @@ do {                                                                      \
 #define _this_cpu_generic_xchg(pcp, nval)                              \
 ({     typeof(pcp) ret__;                                              \
        unsigned long flags;                                            \
-       local_irq_save(flags);                                          \
+       raw_local_irq_save(flags);                                      \
        ret__ = __this_cpu_read(pcp);                                   \
        __this_cpu_write(pcp, nval);                                    \
-       local_irq_restore(flags);                                       \
+       raw_local_irq_restore(flags);                                   \
        ret__;                                                          \
 })
 
@@ -507,11 +507,11 @@ do {                                                                      \
 ({                                                                     \
        typeof(pcp) ret__;                                              \
        unsigned long flags;                                            \
-       local_irq_save(flags);                                          \
+       raw_local_irq_save(flags);                                      \
        ret__ = __this_cpu_read(pcp);                                   \
        if (ret__ == (oval))                                            \
                __this_cpu_write(pcp, nval);                            \
-       local_irq_restore(flags);                                       \
+       raw_local_irq_restore(flags);                                   \
        ret__;                                                          \
 })
 
@@ -544,10 +544,10 @@ do {                                                                      \
 ({                                                                     \
        int ret__;                                                      \
        unsigned long flags;                                            \
-       local_irq_save(flags);                                          \
+       raw_local_irq_save(flags);                                      \
        ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2,           \
                        oval1, oval2, nval1, nval2);                    \
-       local_irq_restore(flags);                                       \
+       raw_local_irq_restore(flags);                                   \
        ret__;                                                          \
 })
 
@@ -718,12 +718,13 @@ do {                                                                      \
 # ifndef __this_cpu_add_return_8
 #  define __this_cpu_add_return_8(pcp, val)    __this_cpu_generic_add_return(pcp, val)
 # endif
-# define __this_cpu_add_return(pcp, val)       __pcpu_size_call_return2(this_cpu_add_return_, pcp, val)
+# define __this_cpu_add_return(pcp, val)       \
+       __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val)
 #endif
 
-#define __this_cpu_sub_return(pcp, val)        this_cpu_add_return(pcp, -(val))
-#define __this_cpu_inc_return(pcp)     this_cpu_add_return(pcp, 1)
-#define __this_cpu_dec_return(pcp)     this_cpu_add_return(pcp, -1)
+#define __this_cpu_sub_return(pcp, val)        __this_cpu_add_return(pcp, -(val))
+#define __this_cpu_inc_return(pcp)     __this_cpu_add_return(pcp, 1)
+#define __this_cpu_dec_return(pcp)     __this_cpu_add_return(pcp, -1)
 
 #define __this_cpu_generic_xchg(pcp, nval)                             \
 ({     typeof(pcp) ret__;                                              \
index 8abee65562230fe05174d2ded6bc8ec50249348b..686f37327a4949f50ad3d02b888f8f445f291ece 100644 (file)
@@ -335,8 +335,11 @@ static inline int copy_regset_to_user(struct task_struct *target,
 {
        const struct user_regset *regset = &view->regsets[setno];
 
+       if (!regset->get)
+               return -EOPNOTSUPP;
+
        if (!access_ok(VERIFY_WRITE, data, size))
-               return -EIO;
+               return -EFAULT;
 
        return regset->get(target, regset, offset, size, NULL, data);
 }
@@ -358,8 +361,11 @@ static inline int copy_regset_from_user(struct task_struct *target,
 {
        const struct user_regset *regset = &view->regsets[setno];
 
+       if (!regset->set)
+               return -EOPNOTSUPP;
+
        if (!access_ok(VERIFY_READ, data, size))
-               return -EIO;
+               return -EFAULT;
 
        return regset->set(target, regset, offset, size, NULL, data);
 }
index 8e872ead88b5544079a9eebcc8946345177e62dc..577592ea0ea02a52b7498512486c923c40517c36 100644 (file)
@@ -602,6 +602,9 @@ struct tcamsg {
 #define TCA_ACT_TAB 1 /* attr type must be >=1 */      
 #define TCAA_MAX 1
 
+/* New extended info filters for IFLA_EXT_MASK */
+#define RTEXT_FILTER_VF                (1 << 0)
+
 /* End of information exported to user level */
 
 #ifdef __KERNEL__
index 7d379a6bfd886679fcfefee2ed90fb636d6cd028..0657368bd78fb9207369b484fa2aa294f90ce5dc 100644 (file)
@@ -1777,7 +1777,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
 /*
  * Per process flags
  */
-#define PF_STARTING    0x00000002      /* being created */
 #define PF_EXITING     0x00000004      /* getting shut down */
 #define PF_EXITPIDONE  0x00000008      /* pi exit done on shut down */
 #define PF_VCPU                0x00000010      /* I'm a virtual CPU */
@@ -2371,7 +2370,7 @@ static inline int thread_group_empty(struct task_struct *p)
  * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
  * subscriptions and synchronises with wait4().  Also used in procfs.  Also
  * pins the final release of task.io_context.  Also protects ->cpuset and
- * ->cgroup.subsys[].
+ * ->cgroup.subsys[]. And ->vfork_done.
  *
  * Nests both inside and outside of read_lock(&tasklist_lock).
  * It must not be nested with write_lock_irq(&tasklist_lock),
index 3ff4961da9b514992cf0edabf07c1b08d2121027..247399b2979a9a331c976e9f413e4dd122ef7711 100644 (file)
@@ -61,13 +61,16 @@ static inline void signalfd_notify(struct task_struct *tsk, int sig)
                wake_up(&tsk->sighand->signalfd_wqh);
 }
 
+extern void signalfd_cleanup(struct sighand_struct *sighand);
+
 #else /* CONFIG_SIGNALFD */
 
 static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
 
+static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
+
 #endif /* CONFIG_SIGNALFD */
 
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_SIGNALFD_H */
-
index 50db9b04a552d5ecca29af92ffa794f80e73483a..ae86adee3746aec6661ef35e2b18cf62e0d17780 100644 (file)
@@ -1465,6 +1465,16 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
 }
 #endif /* NET_SKBUFF_DATA_USES_OFFSET */
 
+static inline void skb_mac_header_rebuild(struct sk_buff *skb)
+{
+       if (skb_mac_header_was_set(skb)) {
+               const unsigned char *old_mac = skb_mac_header(skb);
+
+               skb_set_mac_header(skb, -skb->mac_len);
+               memmove(skb_mac_header(skb), old_mac, skb->mac_len);
+       }
+}
+
 static inline int skb_checksum_start_offset(const struct sk_buff *skb)
 {
        return skb->csum_start - skb_headroom(skb);
index 515669fa3c1d97e0067c6ef404c5263458251810..8ec1153ff57b9c3c4d4b6c7360fd01bbdaebbc2c 100644 (file)
@@ -624,7 +624,7 @@ asmlinkage long sys_socketpair(int, int, int, int __user *);
 asmlinkage long sys_socketcall(int call, unsigned long __user *args);
 asmlinkage long sys_listen(int, int);
 asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
-                               long timeout);
+                               int timeout);
 asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
                        fd_set __user *exp, struct timeval __user *tvp);
 asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
index 46a85c9e1f25bebddd3a1887b30fb182dcf5b5e4..3c7ffdb40dc64ba62cd8f9586fd04d668c4a469c 100644 (file)
@@ -412,7 +412,8 @@ struct tcp_sock {
 
        struct tcp_sack_block recv_sack_cache[4];
 
-       struct sk_buff *highest_sack;   /* highest skb with SACK received
+       struct sk_buff *highest_sack;   /* skb just after the highest
+                                        * skb with SACKed bit set
                                         * (validity guaranteed only if
                                         * sacked_out > 0)
                                         */
index 31fdb4c6ee3dd3d8200596017da81652f3385e41..0b83acd3360a1e52042850fff29ca0b4d1827c5f 100644 (file)
 #define USB_PORT_FEAT_TEST              21
 #define USB_PORT_FEAT_INDICATOR         22
 #define USB_PORT_FEAT_C_PORT_L1         23
-#define USB_PORT_FEAT_C_PORT_LINK_STATE        25
-#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26
-#define USB_PORT_FEAT_PORT_REMOTE_WAKE_MASK 27
-#define USB_PORT_FEAT_BH_PORT_RESET     28
-#define USB_PORT_FEAT_C_BH_PORT_RESET   29
-#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30
 
 /*
  * Port feature selectors added by USB 3.0 spec.
@@ -75,8 +69,8 @@
 #define USB_PORT_FEAT_LINK_STATE               5
 #define USB_PORT_FEAT_U1_TIMEOUT               23
 #define USB_PORT_FEAT_U2_TIMEOUT               24
-#define USB_PORT_FEAT_C_LINK_STATE             25
-#define USB_PORT_FEAT_C_CONFIG_ERR             26
+#define USB_PORT_FEAT_C_PORT_LINK_STATE                25
+#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR      26
 #define USB_PORT_FEAT_REMOTE_WAKE_MASK         27
 #define USB_PORT_FEAT_BH_PORT_RESET            28
 #define USB_PORT_FEAT_C_BH_PORT_RESET          29
index abaad6ed9b83e7b65da14b7a30ae3a175f2992b4..4a82ca0bb0b209a12c65a83b42138098e6572ad1 100644 (file)
@@ -256,4 +256,6 @@ void l2cap_exit(void);
 int sco_init(void);
 void sco_exit(void);
 
+void bt_sock_reclassify_lock(struct sock *sk, int proto);
+
 #endif /* __BLUETOOTH_H */
index ea9231f4935feba9ebd791e4d12287cc24284fd6..453893b3120ef6b81d024047a420802dedcb9247 100644 (file)
@@ -540,7 +540,7 @@ void hci_conn_put_device(struct hci_conn *conn);
 static inline void hci_conn_hold(struct hci_conn *conn)
 {
        atomic_inc(&conn->refcnt);
-       cancel_delayed_work_sync(&conn->disc_work);
+       cancel_delayed_work(&conn->disc_work);
 }
 
 static inline void hci_conn_put(struct hci_conn *conn)
@@ -559,9 +559,9 @@ static inline void hci_conn_put(struct hci_conn *conn)
                } else {
                        timeo = msecs_to_jiffies(10);
                }
-               cancel_delayed_work_sync(&conn->disc_work);
+               cancel_delayed_work(&conn->disc_work);
                queue_delayed_work(conn->hdev->workqueue,
-                                       &conn->disc_work, jiffies + timeo);
+                                       &conn->disc_work, timeo);
        }
 }
 
index 68f5891506925f3101389b2afed34900231291c2..b1664ed884e68c461088217b9d97915e519592f0 100644 (file)
@@ -611,7 +611,7 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
 {
        BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
 
-       if (!__cancel_delayed_work(work))
+       if (!cancel_delayed_work(work))
                l2cap_chan_hold(chan);
        schedule_delayed_work(work, timeout);
 }
@@ -619,20 +619,20 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
 static inline void l2cap_clear_timer(struct l2cap_chan *chan,
                                        struct delayed_work *work)
 {
-       if (__cancel_delayed_work(work))
+       if (cancel_delayed_work(work))
                l2cap_chan_put(chan);
 }
 
 #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
 #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer)
 #define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
-               L2CAP_DEFAULT_RETRANS_TO);
+               msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO));
 #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer)
 #define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \
-               L2CAP_DEFAULT_MONITOR_TO);
+               msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO));
 #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer)
 #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \
-               L2CAP_DEFAULT_ACK_TO);
+               msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO));
 #define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
 
 static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2)
@@ -834,7 +834,7 @@ int l2cap_add_scid(struct l2cap_chan *chan,  __u16 scid);
 struct l2cap_chan *l2cap_chan_create(struct sock *sk);
 void l2cap_chan_close(struct l2cap_chan *chan, int reason);
 void l2cap_chan_destroy(struct l2cap_chan *chan);
-inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
+int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
                                                                bdaddr_t *dst);
 int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,
                                                                u32 priority);
index 8a2b0ae7dbd2bc1aa0a4a71b25a13bee1f8e4235..ab86036bbf0c2807240afde3cf970329107358b8 100644 (file)
@@ -209,7 +209,7 @@ extern struct nf_conntrack_tuple_hash *
 __nf_conntrack_find(struct net *net, u16 zone,
                    const struct nf_conntrack_tuple *tuple);
 
-extern void nf_conntrack_hash_insert(struct nf_conn *ct);
+extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
 extern void nf_ct_delete_from_lists(struct nf_conn *ct);
 extern void nf_ct_insert_dying_list(struct nf_conn *ct);
 
index 678f1ffaf843e108718e4b3162caa246795a048f..370293901971846b70bd805bd9b7b1322e6d8338 100644 (file)
@@ -6,7 +6,7 @@
 
 typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
 typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
-typedef u16 (*rtnl_calcit_func)(struct sk_buff *);
+typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
 
 extern int     __rtnl_register(int protocol, int msgtype,
                                rtnl_doit_func, rtnl_dumpit_func,
index 42c29bfbcee34d8d6ada5d18533850d82973f352..2d80c291fffbad01828648c46df1da0f69763e49 100644 (file)
@@ -1364,8 +1364,9 @@ static inline void tcp_push_pending_frames(struct sock *sk)
        }
 }
 
-/* Start sequence of the highest skb with SACKed bit, valid only if
- * sacked > 0 or when the caller has ensured validity by itself.
+/* Start sequence of the skb just after the highest skb with SACKed
+ * bit, valid only if sacked_out > 0 or when the caller has ensured
+ * validity by itself.
  */
 static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp)
 {
index 6ba596b07a7236ef0c48cd5b910dc6d6844ba508..e33ed1bfa1138bb6200eda7a213db34094cedf49 100644 (file)
@@ -370,56 +370,6 @@ TRACE_EVENT(sched_stat_runtime,
                        (unsigned long long)__entry->vruntime)
 );
 
-#ifdef CREATE_TRACE_POINTS
-static inline u64 trace_get_sleeptime(struct task_struct *tsk)
-{
-#ifdef CONFIG_SCHEDSTATS
-       u64 block, sleep;
-
-       block = tsk->se.statistics.block_start;
-       sleep = tsk->se.statistics.sleep_start;
-       tsk->se.statistics.block_start = 0;
-       tsk->se.statistics.sleep_start = 0;
-
-       return block ? block : sleep ? sleep : 0;
-#else
-       return 0;
-#endif
-}
-#endif
-
-/*
- * Tracepoint for accounting sleeptime (time the task is sleeping
- * or waiting for I/O).
- */
-TRACE_EVENT(sched_stat_sleeptime,
-
-       TP_PROTO(struct task_struct *tsk, u64 now),
-
-       TP_ARGS(tsk, now),
-
-       TP_STRUCT__entry(
-               __array( char,  comm,   TASK_COMM_LEN   )
-               __field( pid_t, pid                     )
-               __field( u64,   sleeptime               )
-       ),
-
-       TP_fast_assign(
-               memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
-               __entry->pid            = tsk->pid;
-               __entry->sleeptime = trace_get_sleeptime(tsk);
-               __entry->sleeptime = __entry->sleeptime ?
-                               now - __entry->sleeptime : 0;
-       )
-       TP_perf_assign(
-               __perf_count(__entry->sleeptime);
-       ),
-
-       TP_printk("comm=%s pid=%d sleeptime=%Lu [ns]",
-                       __entry->comm, __entry->pid,
-                       (unsigned long long)__entry->sleeptime)
-);
-
 /*
  * Tracepoint for showing priority inheritance modifying a tasks
  * priority.
index b7971d6f38bf191d885a821fcce5a0d411869511..ee706ce44aa0232301ae4fbd636f063789689e31 100644 (file)
@@ -651,10 +651,10 @@ int __init init_hw_breakpoint(void)
 
  err_alloc:
        for_each_possible_cpu(err_cpu) {
-               if (err_cpu == cpu)
-                       break;
                for (i = 0; i < TYPE_MAX; i++)
                        kfree(per_cpu(nr_task_bp_pinned[i], cpu));
+               if (err_cpu == cpu)
+                       break;
        }
 
        return -ENOMEM;
index b77fd559c78e6bbe6f92a2dfa26542a0714db083..26a7a6707fa738e181a6b397d8ba9bea47269deb 100644 (file)
@@ -66,6 +66,7 @@
 #include <linux/user-return-notifier.h>
 #include <linux/oom.h>
 #include <linux/khugepaged.h>
+#include <linux/signalfd.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -667,6 +668,38 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
        return mm;
 }
 
+static void complete_vfork_done(struct task_struct *tsk)
+{
+       struct completion *vfork;
+
+       task_lock(tsk);
+       vfork = tsk->vfork_done;
+       if (likely(vfork)) {
+               tsk->vfork_done = NULL;
+               complete(vfork);
+       }
+       task_unlock(tsk);
+}
+
+static int wait_for_vfork_done(struct task_struct *child,
+                               struct completion *vfork)
+{
+       int killed;
+
+       freezer_do_not_count();
+       killed = wait_for_completion_killable(vfork);
+       freezer_count();
+
+       if (killed) {
+               task_lock(child);
+               child->vfork_done = NULL;
+               task_unlock(child);
+       }
+
+       put_task_struct(child);
+       return killed;
+}
+
 /* Please note the differences between mmput and mm_release.
  * mmput is called whenever we stop holding onto a mm_struct,
  * error success whatever.
@@ -682,8 +715,6 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
  */
 void mm_release(struct task_struct *tsk, struct mm_struct *mm)
 {
-       struct completion *vfork_done = tsk->vfork_done;
-
        /* Get rid of any futexes when releasing the mm */
 #ifdef CONFIG_FUTEX
        if (unlikely(tsk->robust_list)) {
@@ -703,17 +734,15 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
        /* Get rid of any cached register state */
        deactivate_mm(tsk, mm);
 
-       /* notify parent sleeping on vfork() */
-       if (vfork_done) {
-               tsk->vfork_done = NULL;
-               complete(vfork_done);
-       }
+       if (tsk->vfork_done)
+               complete_vfork_done(tsk);
 
        /*
         * If we're exiting normally, clear a user-space tid field if
         * requested.  We leave this alone when dying by signal, to leave
         * the value intact in a core dump, and to save the unnecessary
-        * trouble otherwise.  Userland only wants this done for a sys_exit.
+        * trouble, say, a killed vfork parent shouldn't touch this mm.
+        * Userland only wants this done for a sys_exit.
         */
        if (tsk->clear_child_tid) {
                if (!(tsk->flags & PF_SIGNALED) &&
@@ -935,8 +964,10 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
 
 void __cleanup_sighand(struct sighand_struct *sighand)
 {
-       if (atomic_dec_and_test(&sighand->count))
+       if (atomic_dec_and_test(&sighand->count)) {
+               signalfd_cleanup(sighand);
                kmem_cache_free(sighand_cachep, sighand);
+       }
 }
 
 
@@ -1015,7 +1046,6 @@ static void copy_flags(unsigned long clone_flags, struct task_struct *p)
 
        new_flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER);
        new_flags |= PF_FORKNOEXEC;
-       new_flags |= PF_STARTING;
        p->flags = new_flags;
 }
 
@@ -1545,16 +1575,9 @@ long do_fork(unsigned long clone_flags,
                if (clone_flags & CLONE_VFORK) {
                        p->vfork_done = &vfork;
                        init_completion(&vfork);
+                       get_task_struct(p);
                }
 
-               /*
-                * We set PF_STARTING at creation in case tracing wants to
-                * use this to distinguish a fully live task from one that
-                * hasn't finished SIGSTOP raising yet.  Now we clear it
-                * and set the child going.
-                */
-               p->flags &= ~PF_STARTING;
-
                wake_up_new_task(p);
 
                /* forking complete and child started to run, tell ptracer */
@@ -1562,10 +1585,8 @@ long do_fork(unsigned long clone_flags,
                        ptrace_event(trace, nr);
 
                if (clone_flags & CLONE_VFORK) {
-                       freezer_do_not_count();
-                       wait_for_completion(&vfork);
-                       freezer_count();
-                       ptrace_event(PTRACE_EVENT_VFORK_DONE, nr);
+                       if (!wait_for_vfork_done(p, &vfork))
+                               ptrace_event(PTRACE_EVENT_VFORK_DONE, nr);
                }
        } else {
                nr = PTR_ERR(p);
index 2e48ec0c2e91cf099642f8bf43e90476fb6457a3..c21449f85a2a4061bd9a34fc4844b5a3240850b3 100644 (file)
@@ -119,15 +119,20 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
  * For preemptible RCU it is sufficient to call rcu_read_unlock in order
  * to exit the grace period. For classic RCU, a reschedule is required.
  */
-static void rcu_lock_break(struct task_struct *g, struct task_struct *t)
+static bool rcu_lock_break(struct task_struct *g, struct task_struct *t)
 {
+       bool can_cont;
+
        get_task_struct(g);
        get_task_struct(t);
        rcu_read_unlock();
        cond_resched();
        rcu_read_lock();
+       can_cont = pid_alive(g) && pid_alive(t);
        put_task_struct(t);
        put_task_struct(g);
+
+       return can_cont;
 }
 
 /*
@@ -154,9 +159,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
                        goto unlock;
                if (!--batch_count) {
                        batch_count = HUNG_TASK_BATCHING;
-                       rcu_lock_break(g, t);
-                       /* Exit if t or g was unhashed during refresh. */
-                       if (t->state == TASK_DEAD || g->state == TASK_DEAD)
+                       if (!rcu_lock_break(g, t))
                                goto unlock;
                }
                /* use "==" to skip the TASK_KILLABLE tasks waiting on NFS */
index 342d8f44e4010d13cb03f21b89a57d9dc955497e..0119b9d467ae6dd1d53b9f38bcf9c95d63f7ae9d 100644 (file)
@@ -53,7 +53,7 @@ unsigned long probe_irq_on(void)
                        if (desc->irq_data.chip->irq_set_type)
                                desc->irq_data.chip->irq_set_type(&desc->irq_data,
                                                         IRQ_TYPE_PROBE);
-                       irq_startup(desc);
+                       irq_startup(desc, false);
                }
                raw_spin_unlock_irq(&desc->lock);
        }
@@ -70,7 +70,7 @@ unsigned long probe_irq_on(void)
                raw_spin_lock_irq(&desc->lock);
                if (!desc->action && irq_settings_can_probe(desc)) {
                        desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
-                       if (irq_startup(desc))
+                       if (irq_startup(desc, false))
                                desc->istate |= IRQS_PENDING;
                }
                raw_spin_unlock_irq(&desc->lock);
index f7c543a801d97a67a2778e2685fa181739a803ac..fb7db75ee0c87884d40ada2cb88e355cb2ca353c 100644 (file)
@@ -157,19 +157,22 @@ static void irq_state_set_masked(struct irq_desc *desc)
        irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);
 }
 
-int irq_startup(struct irq_desc *desc)
+int irq_startup(struct irq_desc *desc, bool resend)
 {
+       int ret = 0;
+
        irq_state_clr_disabled(desc);
        desc->depth = 0;
 
        if (desc->irq_data.chip->irq_startup) {
-               int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
+               ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
                irq_state_clr_masked(desc);
-               return ret;
+       } else {
+               irq_enable(desc);
        }
-
-       irq_enable(desc);
-       return 0;
+       if (resend)
+               check_irq_resend(desc, desc->irq_data.irq);
+       return ret;
 }
 
 void irq_shutdown(struct irq_desc *desc)
@@ -330,6 +333,24 @@ out_unlock:
 }
 EXPORT_SYMBOL_GPL(handle_simple_irq);
 
+/*
+ * Called unconditionally from handle_level_irq() and only for oneshot
+ * interrupts from handle_fasteoi_irq()
+ */
+static void cond_unmask_irq(struct irq_desc *desc)
+{
+       /*
+        * We need to unmask in the following cases:
+        * - Standard level irq (IRQF_ONESHOT is not set)
+        * - Oneshot irq which did not wake the thread (caused by a
+        *   spurious interrupt or a primary handler handling it
+        *   completely).
+        */
+       if (!irqd_irq_disabled(&desc->irq_data) &&
+           irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot)
+               unmask_irq(desc);
+}
+
 /**
  *     handle_level_irq - Level type irq handler
  *     @irq:   the interrupt number
@@ -362,8 +383,8 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
 
        handle_irq_event(desc);
 
-       if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT))
-               unmask_irq(desc);
+       cond_unmask_irq(desc);
+
 out_unlock:
        raw_spin_unlock(&desc->lock);
 }
@@ -417,6 +438,9 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
        preflow_handler(desc);
        handle_irq_event(desc);
 
+       if (desc->istate & IRQS_ONESHOT)
+               cond_unmask_irq(desc);
+
 out_eoi:
        desc->irq_data.chip->irq_eoi(&desc->irq_data);
 out_unlock:
@@ -625,7 +649,7 @@ __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
                irq_settings_set_noprobe(desc);
                irq_settings_set_norequest(desc);
                irq_settings_set_nothread(desc);
-               irq_startup(desc);
+               irq_startup(desc, true);
        }
 out:
        irq_put_desc_busunlock(desc, flags);
index b7952316016aa8175b6149856ed57eba230007eb..40378ff877e738c53f6c5f478898455ebee3454f 100644 (file)
@@ -67,7 +67,7 @@ extern int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
 extern void __disable_irq(struct irq_desc *desc, unsigned int irq, bool susp);
 extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume);
 
-extern int irq_startup(struct irq_desc *desc);
+extern int irq_startup(struct irq_desc *desc, bool resend);
 extern void irq_shutdown(struct irq_desc *desc);
 extern void irq_enable(struct irq_desc *desc);
 extern void irq_disable(struct irq_desc *desc);
index a9a9dbe49fead98c11aa4ea4aa2d3d38cd187494..0f0d4704ddd8a3865d0926067fbf654d48dabbbc 100644 (file)
@@ -985,6 +985,11 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 
                /* add new interrupt at end of irq queue */
                do {
+                       /*
+                        * Or all existing action->thread_mask bits,
+                        * so we can find the next zero bit for this
+                        * new action.
+                        */
                        thread_mask |= old->thread_mask;
                        old_ptr = &old->next;
                        old = *old_ptr;
@@ -993,14 +998,41 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
        }
 
        /*
-        * Setup the thread mask for this irqaction. Unlikely to have
-        * 32 resp 64 irqs sharing one line, but who knows.
+        * Setup the thread mask for this irqaction for ONESHOT. For
+        * !ONESHOT irqs the thread mask is 0 so we can avoid a
+        * conditional in irq_wake_thread().
         */
-       if (new->flags & IRQF_ONESHOT && thread_mask == ~0UL) {
-               ret = -EBUSY;
-               goto out_mask;
+       if (new->flags & IRQF_ONESHOT) {
+               /*
+                * Unlikely to have 32 resp 64 irqs sharing one line,
+                * but who knows.
+                */
+               if (thread_mask == ~0UL) {
+                       ret = -EBUSY;
+                       goto out_mask;
+               }
+               /*
+                * The thread_mask for the action is or'ed to
+                * desc->thread_active to indicate that the
+                * IRQF_ONESHOT thread handler has been woken, but not
+                * yet finished. The bit is cleared when a thread
+                * completes. When all threads of a shared interrupt
+                * line have completed desc->threads_active becomes
+                * zero and the interrupt line is unmasked. See
+                * handle.c:irq_wake_thread() for further information.
+                *
+                * If no thread is woken by primary (hard irq context)
+                * interrupt handlers, then desc->threads_active is
+                * also checked for zero to unmask the irq line in the
+                * affected hard irq flow handlers
+                * (handle_[fasteoi|level]_irq).
+                *
+                * The new action gets the first zero bit of
+                * thread_mask assigned. See the loop above which or's
+                * all existing action->thread_mask bits.
+                */
+               new->thread_mask = 1 << ffz(thread_mask);
        }
-       new->thread_mask = 1 << ffz(thread_mask);
 
        if (!shared) {
                init_waitqueue_head(&desc->wait_for_threads);
@@ -1027,7 +1059,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
                        desc->istate |= IRQS_ONESHOT;
 
                if (irq_settings_can_autoenable(desc))
-                       irq_startup(desc);
+                       irq_startup(desc, true);
                else
                        /* Undo nested disables: */
                        desc->depth = 1;
index 9788c0ec6f4378f19cd80e873d42a0aec7171548..c62b8546cc90e0b39de0e824b0f7ed7179d8ba92 100644 (file)
@@ -1334,8 +1334,10 @@ int __kprobes register_kprobe(struct kprobe *p)
        if (!kernel_text_address((unsigned long) p->addr) ||
            in_kprobes_functions((unsigned long) p->addr) ||
            ftrace_text_reserved(p->addr, p->addr) ||
-           jump_label_text_reserved(p->addr, p->addr))
-               goto fail_with_jump_label;
+           jump_label_text_reserved(p->addr, p->addr)) {
+               ret = -EINVAL;
+               goto cannot_probe;
+       }
 
        /* User can pass only KPROBE_FLAG_DISABLED to register_kprobe */
        p->flags &= KPROBE_FLAG_DISABLED;
@@ -1352,7 +1354,7 @@ int __kprobes register_kprobe(struct kprobe *p)
                 * its code to prohibit unexpected unloading.
                 */
                if (unlikely(!try_module_get(probed_mod)))
-                       goto fail_with_jump_label;
+                       goto cannot_probe;
 
                /*
                 * If the module freed .init.text, we couldn't insert
@@ -1361,7 +1363,7 @@ int __kprobes register_kprobe(struct kprobe *p)
                if (within_module_init((unsigned long)p->addr, probed_mod) &&
                    probed_mod->state != MODULE_STATE_COMING) {
                        module_put(probed_mod);
-                       goto fail_with_jump_label;
+                       goto cannot_probe;
                }
                /* ret will be updated by following code */
        }
@@ -1409,7 +1411,7 @@ out:
 
        return ret;
 
-fail_with_jump_label:
+cannot_probe:
        preempt_enable();
        jump_label_unlock();
        return ret;
index ce8e00deaccb38452188436438dc942313bd6c44..9f08dfabaf13af1f79a8ae4c5bb87a4434736d18 100644 (file)
@@ -543,12 +543,12 @@ struct pid *find_ge_pid(int nr, struct pid_namespace *ns)
  */
 void __init pidhash_init(void)
 {
-       int i, pidhash_size;
+       unsigned int i, pidhash_size;
 
        pid_hash = alloc_large_system_hash("PID", sizeof(*pid_hash), 0, 18,
                                           HASH_EARLY | HASH_SMALL,
                                           &pidhash_shift, NULL, 4096);
-       pidhash_size = 1 << pidhash_shift;
+       pidhash_size = 1U << pidhash_shift;
 
        for (i = 0; i < pidhash_size; i++)
                INIT_HLIST_HEAD(&pid_hash[i]);
index 13c0a1143f49438f7cc97718e61ecf5bc5b23747..32690a0b7a1838e1bd9b8bcf8473654955807dae 100644 (file)
@@ -702,6 +702,9 @@ static bool printk_time = 0;
 #endif
 module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
 
+static bool always_kmsg_dump;
+module_param_named(always_kmsg_dump, always_kmsg_dump, bool, S_IRUGO | S_IWUSR);
+
 /* Check if we have any console registered that can be called early in boot. */
 static int have_callable_console(void)
 {
@@ -1732,6 +1735,9 @@ void kmsg_dump(enum kmsg_dump_reason reason)
        unsigned long l1, l2;
        unsigned long flags;
 
+       if ((reason > KMSG_DUMP_OOPS) && !always_kmsg_dump)
+               return;
+
        /* Theoretically, the log could move on after we do this, but
           there's not a lot we can do about that. The new messages
           will overwrite the start of what we dump. */
index 5255c9d2e053225173dfea134e7e243ad0e80891..b342f57879e693f54c12a5b15d1e4e7c5bdde7e1 100644 (file)
@@ -1932,7 +1932,6 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
        local_irq_enable();
 #endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */
        finish_lock_switch(rq, prev);
-       trace_sched_stat_sleeptime(current, rq->clock);
 
        fire_sched_in_preempt_notifiers(current);
        if (mm)
index 7c6414fc669de4f09dc03fc763aaddd8040f98bf..aca16b843b7ee463e005996508b098ea44e01b32 100644 (file)
@@ -1003,6 +1003,7 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
                if (unlikely(delta > se->statistics.sleep_max))
                        se->statistics.sleep_max = delta;
 
+               se->statistics.sleep_start = 0;
                se->statistics.sum_sleep_runtime += delta;
 
                if (tsk) {
@@ -1019,6 +1020,7 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
                if (unlikely(delta > se->statistics.block_max))
                        se->statistics.block_max = delta;
 
+               se->statistics.block_start = 0;
                se->statistics.sum_sleep_runtime += delta;
 
                if (tsk) {
index 77cb245f8e7bdee634b98f6c275ae221c7c90715..0ab9ae8057f00e8545deba43ff31fab7873a619c 100644 (file)
@@ -818,17 +818,9 @@ static int __init fixup_activate(void *addr, enum debug_obj_state state)
                if (obj->static_init == 1) {
                        debug_object_init(obj, &descr_type_test);
                        debug_object_activate(obj, &descr_type_test);
-                       /*
-                        * Real code should return 0 here ! This is
-                        * not a fixup of some bad behaviour. We
-                        * merily call the debug_init function to keep
-                        * track of the object.
-                        */
-                       return 1;
-               } else {
-                       /* Real code needs to emit a warning here */
+                       return 0;
                }
-               return 0;
+               return 1;
 
        case ODEBUG_STATE_ACTIVE:
                debug_object_deactivate(obj, &descr_type_test);
@@ -967,7 +959,7 @@ static void __init debug_objects_selftest(void)
 
        obj.static_init = 1;
        debug_object_activate(&obj, &descr_type_test);
-       if (check_results(&obj, ODEBUG_STATE_ACTIVE, ++fixups, warnings))
+       if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
                goto out;
        debug_object_init(&obj, &descr_type_test);
        if (check_results(&obj, ODEBUG_STATE_INIT, ++fixups, ++warnings))
index 8e75003d62f632c52b8c0ea56ca62bdc72e560f0..38e612e66da5993f7b1eb92065ebfec45216d83c 100644 (file)
@@ -891,9 +891,15 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
        case 'U':
                return uuid_string(buf, end, ptr, spec, fmt);
        case 'V':
-               return buf + vsnprintf(buf, end > buf ? end - buf : 0,
-                                      ((struct va_format *)ptr)->fmt,
-                                      *(((struct va_format *)ptr)->va));
+               {
+                       va_list va;
+
+                       va_copy(va, *((struct va_format *)ptr)->va);
+                       buf += vsnprintf(buf, end > buf ? end - buf : 0,
+                                        ((struct va_format *)ptr)->fmt, va);
+                       va_end(va);
+                       return buf;
+               }
        case 'K':
                /*
                 * %pK cannot be used in IRQ context because its test
index 91d3efb25d15472332e1f2d9c382a5732629ce69..8f7fc394f63672954cc4444da0f2158a42470b2c 100644 (file)
@@ -671,6 +671,7 @@ static int __do_huge_pmd_anonymous_page(struct mm_struct *mm,
                set_pmd_at(mm, haddr, pmd, entry);
                prepare_pmd_huge_pte(pgtable, mm);
                add_mm_counter(mm, MM_ANONPAGES, HPAGE_PMD_NR);
+               mm->nr_ptes++;
                spin_unlock(&mm->page_table_lock);
        }
 
@@ -789,6 +790,7 @@ int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
        pmd = pmd_mkold(pmd_wrprotect(pmd));
        set_pmd_at(dst_mm, addr, dst_pmd, pmd);
        prepare_pmd_huge_pte(pgtable, dst_mm);
+       dst_mm->nr_ptes++;
 
        ret = 0;
 out_unlock:
@@ -887,7 +889,6 @@ static int do_huge_pmd_wp_page_fallback(struct mm_struct *mm,
        }
        kfree(pages);
 
-       mm->nr_ptes++;
        smp_wmb(); /* make pte visible before pmd */
        pmd_populate(mm, pmd, pgtable);
        page_remove_rmap(page);
@@ -1047,6 +1048,7 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
                        VM_BUG_ON(page_mapcount(page) < 0);
                        add_mm_counter(tlb->mm, MM_ANONPAGES, -HPAGE_PMD_NR);
                        VM_BUG_ON(!PageHead(page));
+                       tlb->mm->nr_ptes--;
                        spin_unlock(&tlb->mm->page_table_lock);
                        tlb_remove_page(tlb, page);
                        pte_free(tlb->mm, pgtable);
@@ -1375,7 +1377,6 @@ static int __split_huge_page_map(struct page *page,
                        pte_unmap(pte);
                }
 
-               mm->nr_ptes++;
                smp_wmb(); /* make pte visible before pmd */
                /*
                 * Up to this point the pmd is present and huge and
@@ -1988,7 +1989,6 @@ static void collapse_huge_page(struct mm_struct *mm,
        set_pmd_at(mm, address, pmd, _pmd);
        update_mmu_cache(vma, address, _pmd);
        prepare_pmd_huge_pte(pgtable, mm);
-       mm->nr_ptes--;
        spin_unlock(&mm->page_table_lock);
 
 #ifndef CONFIG_NUMA
index 5f34bd8dda34bbc8224303ad080103f224fa5ad6..a876871f6be56d15b06d1da56a9f3dbbd61cda91 100644 (file)
@@ -2277,8 +2277,8 @@ void __unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
                        set_page_dirty(page);
                list_add(&page->lru, &page_list);
        }
-       spin_unlock(&mm->page_table_lock);
        flush_tlb_range(vma, start, end);
+       spin_unlock(&mm->page_table_lock);
        mmu_notifier_invalidate_range_end(mm, start, end);
        list_for_each_entry_safe(page, tmp, &page_list, lru) {
                page_remove_rmap(page);
index 1925ffbfb27f00ac3d3d262ce0ea1c8aaa3a117f..310544a379ae9c7b886b3b50815e5f3d5a991ba8 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -28,7 +28,6 @@
 #include <linux/kthread.h>
 #include <linux/wait.h>
 #include <linux/slab.h>
-#include <linux/memcontrol.h>
 #include <linux/rbtree.h>
 #include <linux/memory.h>
 #include <linux/mmu_notifier.h>
@@ -1572,16 +1571,6 @@ struct page *ksm_does_need_to_copy(struct page *page,
 
        new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address);
        if (new_page) {
-               /*
-                * The memcg-specific accounting when moving
-                * pages around the LRU lists relies on the
-                * page's owner (memcg) to be valid.  Usually,
-                * pages are assigned to a new owner before
-                * being put on the LRU list, but since this
-                * is not the case here, the stale owner from
-                * a previous allocation cycle must be reset.
-                */
-               mem_cgroup_reset_owner(new_page);
                copy_user_highpage(new_page, page, address, vma);
 
                SetPageDirty(new_page);
index 77b5f227e1d86d9228ae6a67f52f18418a2beb98..99f285599501482e8b48c77eb768a62981811cf6 100644 (file)
@@ -99,9 +99,6 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t start,
        phys_addr_t this_start, this_end, cand;
        u64 i;
 
-       /* align @size to avoid excessive fragmentation on reserved array */
-       size = round_up(size, align);
-
        /* pump up @end */
        if (end == MEMBLOCK_ALLOC_ACCESSIBLE)
                end = memblock.current_limit;
@@ -731,6 +728,9 @@ static phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size,
 {
        phys_addr_t found;
 
+       /* align @size to avoid excessive fragmentation on reserved array */
+       size = round_up(size, align);
+
        found = memblock_find_in_range_node(0, max_addr, size, align, nid);
        if (found && !memblock_reserve(found, size))
                return found;
index 6728a7ae6f2d1eb42c8ac183ec69098aa80d2d6c..5585dc3d36466189b0d89adf8e86f424372bdd23 100644 (file)
@@ -1042,6 +1042,19 @@ struct lruvec *mem_cgroup_lru_add_list(struct zone *zone, struct page *page,
 
        pc = lookup_page_cgroup(page);
        memcg = pc->mem_cgroup;
+
+       /*
+        * Surreptitiously switch any uncharged page to root:
+        * an uncharged page off lru does nothing to secure
+        * its former mem_cgroup from sudden removal.
+        *
+        * Our caller holds lru_lock, and PageCgroupUsed is updated
+        * under page_cgroup lock: between them, they make all uses
+        * of pc->mem_cgroup safe.
+        */
+       if (!PageCgroupUsed(pc) && memcg != root_mem_cgroup)
+               pc->mem_cgroup = memcg = root_mem_cgroup;
+
        mz = page_cgroup_zoneinfo(memcg, page);
        /* compound_order() is stabilized through lru_lock */
        MEM_CGROUP_ZSTAT(mz, lru) += 1 << compound_order(page);
@@ -2408,8 +2421,12 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,
                                       struct page *page,
                                       unsigned int nr_pages,
                                       struct page_cgroup *pc,
-                                      enum charge_type ctype)
+                                      enum charge_type ctype,
+                                      bool lrucare)
 {
+       struct zone *uninitialized_var(zone);
+       bool was_on_lru = false;
+
        lock_page_cgroup(pc);
        if (unlikely(PageCgroupUsed(pc))) {
                unlock_page_cgroup(pc);
@@ -2420,6 +2437,21 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,
         * we don't need page_cgroup_lock about tail pages, becase they are not
         * accessed by any other context at this point.
         */
+
+       /*
+        * In some cases, SwapCache and FUSE(splice_buf->radixtree), the page
+        * may already be on some other mem_cgroup's LRU.  Take care of it.
+        */
+       if (lrucare) {
+               zone = page_zone(page);
+               spin_lock_irq(&zone->lru_lock);
+               if (PageLRU(page)) {
+                       ClearPageLRU(page);
+                       del_page_from_lru_list(zone, page, page_lru(page));
+                       was_on_lru = true;
+               }
+       }
+
        pc->mem_cgroup = memcg;
        /*
         * We access a page_cgroup asynchronously without lock_page_cgroup().
@@ -2443,9 +2475,18 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg,
                break;
        }
 
+       if (lrucare) {
+               if (was_on_lru) {
+                       VM_BUG_ON(PageLRU(page));
+                       SetPageLRU(page);
+                       add_page_to_lru_list(zone, page, page_lru(page));
+               }
+               spin_unlock_irq(&zone->lru_lock);
+       }
+
        mem_cgroup_charge_statistics(memcg, PageCgroupCache(pc), nr_pages);
        unlock_page_cgroup(pc);
-       WARN_ON_ONCE(PageLRU(page));
+
        /*
         * "charge_statistics" updated event counter. Then, check it.
         * Insert ancestor (and ancestor's ancestors), to softlimit RB-tree.
@@ -2643,7 +2684,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
        ret = __mem_cgroup_try_charge(mm, gfp_mask, nr_pages, &memcg, oom);
        if (ret == -ENOMEM)
                return ret;
-       __mem_cgroup_commit_charge(memcg, page, nr_pages, pc, ctype);
+       __mem_cgroup_commit_charge(memcg, page, nr_pages, pc, ctype, false);
        return 0;
 }
 
@@ -2663,35 +2704,6 @@ static void
 __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
                                        enum charge_type ctype);
 
-static void
-__mem_cgroup_commit_charge_lrucare(struct page *page, struct mem_cgroup *memcg,
-                                       enum charge_type ctype)
-{
-       struct page_cgroup *pc = lookup_page_cgroup(page);
-       struct zone *zone = page_zone(page);
-       unsigned long flags;
-       bool removed = false;
-
-       /*
-        * In some case, SwapCache, FUSE(splice_buf->radixtree), the page
-        * is already on LRU. It means the page may on some other page_cgroup's
-        * LRU. Take care of it.
-        */
-       spin_lock_irqsave(&zone->lru_lock, flags);
-       if (PageLRU(page)) {
-               del_page_from_lru_list(zone, page, page_lru(page));
-               ClearPageLRU(page);
-               removed = true;
-       }
-       __mem_cgroup_commit_charge(memcg, page, 1, pc, ctype);
-       if (removed) {
-               add_page_to_lru_list(zone, page, page_lru(page));
-               SetPageLRU(page);
-       }
-       spin_unlock_irqrestore(&zone->lru_lock, flags);
-       return;
-}
-
 int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
                                gfp_t gfp_mask)
 {
@@ -2769,13 +2781,16 @@ static void
 __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *memcg,
                                        enum charge_type ctype)
 {
+       struct page_cgroup *pc;
+
        if (mem_cgroup_disabled())
                return;
        if (!memcg)
                return;
        cgroup_exclude_rmdir(&memcg->css);
 
-       __mem_cgroup_commit_charge_lrucare(page, memcg, ctype);
+       pc = lookup_page_cgroup(page);
+       __mem_cgroup_commit_charge(memcg, page, 1, pc, ctype, true);
        /*
         * Now swap is on-memory. This means this page may be
         * counted both as mem and swap....double count.
@@ -3027,23 +3042,6 @@ void mem_cgroup_uncharge_end(void)
        batch->memcg = NULL;
 }
 
-/*
- * A function for resetting pc->mem_cgroup for newly allocated pages.
- * This function should be called if the newpage will be added to LRU
- * before start accounting.
- */
-void mem_cgroup_reset_owner(struct page *newpage)
-{
-       struct page_cgroup *pc;
-
-       if (mem_cgroup_disabled())
-               return;
-
-       pc = lookup_page_cgroup(newpage);
-       VM_BUG_ON(PageCgroupUsed(pc));
-       pc->mem_cgroup = root_mem_cgroup;
-}
-
 #ifdef CONFIG_SWAP
 /*
  * called after __delete_from_swap_cache() and drop "page" account.
@@ -3248,7 +3246,7 @@ int mem_cgroup_prepare_migration(struct page *page,
                ctype = MEM_CGROUP_CHARGE_TYPE_CACHE;
        else
                ctype = MEM_CGROUP_CHARGE_TYPE_SHMEM;
-       __mem_cgroup_commit_charge(memcg, newpage, 1, pc, ctype);
+       __mem_cgroup_commit_charge(memcg, newpage, 1, pc, ctype, false);
        return ret;
 }
 
@@ -3332,7 +3330,7 @@ void mem_cgroup_replace_page_cache(struct page *oldpage,
         * the newpage may be on LRU(or pagevec for LRU) already. We lock
         * LRU while we overwrite pc->mem_cgroup.
         */
-       __mem_cgroup_commit_charge_lrucare(newpage, memcg, type);
+       __mem_cgroup_commit_charge(memcg, newpage, 1, pc, type, true);
 }
 
 #ifdef CONFIG_DEBUG_VM
@@ -4414,6 +4412,9 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
         */
        BUG_ON(!thresholds);
 
+       if (!thresholds->primary)
+               goto unlock;
+
        usage = mem_cgroup_usage(memcg, type == _MEMSWAP);
 
        /* Check if a threshold crossed before removing */
@@ -4462,7 +4463,7 @@ swap_buffers:
 
        /* To be sure that nobody uses thresholds */
        synchronize_rcu();
-
+unlock:
        mutex_unlock(&memcg->thresholds_lock);
 }
 
@@ -5074,7 +5075,7 @@ static struct page *mc_handle_present_pte(struct vm_area_struct *vma,
                return NULL;
        if (PageAnon(page)) {
                /* we don't move shared anon */
-               if (!move_anon() || page_mapcount(page) > 2)
+               if (!move_anon() || page_mapcount(page) > 1)
                        return NULL;
        } else if (!move_file())
                /* we ignore mapcount for file pages */
index 06b145fb64ab59a399344bc73ca277be0e39ed7b..47296fee23dbaa67c3408227d7653037a371bcdf 100644 (file)
@@ -640,10 +640,11 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
        unsigned long vmstart;
        unsigned long vmend;
 
-       vma = find_vma_prev(mm, start, &prev);
+       vma = find_vma(mm, start);
        if (!vma || vma->vm_start > start)
                return -EFAULT;
 
+       prev = vma->vm_prev;
        if (start > vma->vm_start)
                prev = vma;
 
index df141f60289eef61c7d278080e8290c3dfc717b9..1503b6b54ecbd1817e6e92968d40c404a6e90f75 100644 (file)
@@ -839,8 +839,6 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
        if (!newpage)
                return -ENOMEM;
 
-       mem_cgroup_reset_owner(newpage);
-
        if (page_count(page) == 1) {
                /* page was freed from under us. So we are done. */
                goto out;
index 4f4f53bdc65de30d11c637b2bc745aa1333a16bd..ef726e8aa8e9ca56c0713abfa4b621f44a210d4c 100644 (file)
@@ -385,10 +385,11 @@ static int do_mlock(unsigned long start, size_t len, int on)
                return -EINVAL;
        if (end == start)
                return 0;
-       vma = find_vma_prev(current->mm, start, &prev);
+       vma = find_vma(current->mm, start);
        if (!vma || vma->vm_start > start)
                return -ENOMEM;
 
+       prev = vma->vm_prev;
        if (start > vma->vm_start)
                prev = vma;
 
index 3f758c7f4c815c2b0edf494526b2823b41fbc142..da15a79b1441b665b0e4b962eea38a92407018fd 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1266,8 +1266,9 @@ munmap_back:
        vma->vm_pgoff = pgoff;
        INIT_LIST_HEAD(&vma->anon_vma_chain);
 
+       error = -EINVAL;        /* when rejecting VM_GROWSDOWN|VM_GROWSUP */
+
        if (file) {
-               error = -EINVAL;
                if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
                        goto free_vma;
                if (vm_flags & VM_DENYWRITE) {
@@ -1293,6 +1294,8 @@ munmap_back:
                pgoff = vma->vm_pgoff;
                vm_flags = vma->vm_flags;
        } else if (vm_flags & VM_SHARED) {
+               if (unlikely(vm_flags & (VM_GROWSDOWN|VM_GROWSUP)))
+                       goto free_vma;
                error = shmem_zero_setup(vma);
                if (error)
                        goto free_vma;
@@ -1605,7 +1608,6 @@ EXPORT_SYMBOL(find_vma);
 
 /*
  * Same as find_vma, but also return a pointer to the previous VMA in *pprev.
- * Note: pprev is set to NULL when return value is NULL.
  */
 struct vm_area_struct *
 find_vma_prev(struct mm_struct *mm, unsigned long addr,
@@ -1614,7 +1616,16 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
        struct vm_area_struct *vma;
 
        vma = find_vma(mm, addr);
-       *pprev = vma ? vma->vm_prev : NULL;
+       if (vma) {
+               *pprev = vma->vm_prev;
+       } else {
+               struct rb_node *rb_node = mm->mm_rb.rb_node;
+               *pprev = NULL;
+               while (rb_node) {
+                       *pprev = rb_entry(rb_node, struct vm_area_struct, vm_rb);
+                       rb_node = rb_node->rb_right;
+               }
+       }
        return vma;
 }
 
index 5a688a2756bec54435adbd5f3c13a33fbdd2c11e..f437d054c3bf6884fd5ba6f18338fbf7272c43a4 100644 (file)
@@ -262,10 +262,11 @@ SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
 
        down_write(&current->mm->mmap_sem);
 
-       vma = find_vma_prev(current->mm, start, &prev);
+       vma = find_vma(current->mm, start);
        error = -ENOMEM;
        if (!vma)
                goto out;
+       prev = vma->vm_prev;
        if (unlikely(grows & PROT_GROWSDOWN)) {
                if (vma->vm_start >= end)
                        goto out;
index b982290fd962dc2745c423d44e7b92f9c1db247a..f59e170fceb4e01046a339d8878f5030dea8a4f9 100644 (file)
@@ -696,9 +696,11 @@ static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
        if (vma->vm_file) {
                mapping = vma->vm_file->f_mapping;
 
+               mutex_lock(&mapping->i_mmap_mutex);
                flush_dcache_mmap_lock(mapping);
                vma_prio_tree_insert(vma, &mapping->i_mmap);
                flush_dcache_mmap_unlock(mapping);
+               mutex_unlock(&mapping->i_mmap_mutex);
        }
 
        /* add the VMA to the tree */
@@ -760,9 +762,11 @@ static void delete_vma_from_mm(struct vm_area_struct *vma)
        if (vma->vm_file) {
                mapping = vma->vm_file->f_mapping;
 
+               mutex_lock(&mapping->i_mmap_mutex);
                flush_dcache_mmap_lock(mapping);
                vma_prio_tree_remove(vma, &mapping->i_mmap);
                flush_dcache_mmap_unlock(mapping);
+               mutex_unlock(&mapping->i_mmap_mutex);
        }
 
        /* remove from the MM's tree and list */
@@ -775,8 +779,6 @@ static void delete_vma_from_mm(struct vm_area_struct *vma)
 
        if (vma->vm_next)
                vma->vm_next->vm_prev = vma->vm_prev;
-
-       vma->vm_mm = NULL;
 }
 
 /*
@@ -2052,6 +2054,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
        high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
        down_write(&nommu_region_sem);
+       mutex_lock(&inode->i_mapping->i_mmap_mutex);
 
        /* search for VMAs that fall within the dead zone */
        vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap,
@@ -2059,6 +2062,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
                /* found one - only interested if it's shared out of the page
                 * cache */
                if (vma->vm_flags & VM_SHARED) {
+                       mutex_unlock(&inode->i_mapping->i_mmap_mutex);
                        up_write(&nommu_region_sem);
                        return -ETXTBSY; /* not quite true, but near enough */
                }
@@ -2086,6 +2090,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
                }
        }
 
+       mutex_unlock(&inode->i_mapping->i_mmap_mutex);
        up_write(&nommu_region_sem);
        return 0;
 }
index d2186ecb36f7cdfd5fdc75da4bbd10ef798bcbba..a13ded1938f0bacd90a438d983e3d301a649bfe9 100644 (file)
@@ -5236,6 +5236,7 @@ void *__init alloc_large_system_hash(const char *tablename,
                max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4;
                do_div(max, bucketsize);
        }
+       max = min(max, 0x80000000ULL);
 
        if (numentries > max)
                numentries = max;
index de1616aa9b1e2b3fac054ce4077073cbb05a3c62..1ccbd714059cdd7ddb9d90cb3ca92438f2cb5d34 100644 (file)
@@ -379,13 +379,15 @@ static struct swap_cgroup *lookup_swap_cgroup(swp_entry_t ent,
        pgoff_t offset = swp_offset(ent);
        struct swap_cgroup_ctrl *ctrl;
        struct page *mappage;
+       struct swap_cgroup *sc;
 
        ctrl = &swap_cgroup_ctrl[swp_type(ent)];
        if (ctrlp)
                *ctrlp = ctrl;
 
        mappage = ctrl->map[offset / SC_PER_PAGE];
-       return page_address(mappage) + offset % SC_PER_PAGE;
+       sc = page_address(mappage);
+       return sc + offset % SC_PER_PAGE;
 }
 
 /**
index 12a48a88c0d8cb00dd55b2adcea3e536493dee1a..405d331804c3da95c52347878387a807eb5e6c60 100644 (file)
@@ -184,8 +184,7 @@ static void pcpu_unmap_pages(struct pcpu_chunk *chunk,
                                   page_end - page_start);
        }
 
-       for (i = page_start; i < page_end; i++)
-               __clear_bit(i, populated);
+       bitmap_clear(populated, page_start, page_end - page_start);
 }
 
 /**
index fff1ff7fb9ada36fca1be10d33dec593486f50a6..14380e9fbe3380b927cb58d75c5a950a5ec14f77 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -652,7 +652,7 @@ EXPORT_SYMBOL(__pagevec_release);
 void lru_add_page_tail(struct zone* zone,
                       struct page *page, struct page *page_tail)
 {
-       int active;
+       int uninitialized_var(active);
        enum lru_list lru;
        const int file = 0;
 
@@ -672,7 +672,6 @@ void lru_add_page_tail(struct zone* zone,
                        active = 0;
                        lru = LRU_INACTIVE_ANON;
                }
-               update_page_reclaim_stat(zone, page_tail, file, active);
        } else {
                SetPageUnevictable(page_tail);
                lru = LRU_UNEVICTABLE;
@@ -693,6 +692,9 @@ void lru_add_page_tail(struct zone* zone,
                list_head = page_tail->lru.prev;
                list_move_tail(&page_tail->lru, list_head);
        }
+
+       if (!PageUnevictable(page))
+               update_page_reclaim_stat(zone, page_tail, file, active);
 }
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
@@ -710,8 +712,8 @@ static void __pagevec_lru_add_fn(struct page *page, void *arg)
        SetPageLRU(page);
        if (active)
                SetPageActive(page);
-       update_page_reclaim_stat(zone, page, file, active);
        add_page_to_lru_list(zone, page, lru);
+       update_page_reclaim_stat(zone, page, file, active);
 }
 
 /*
index 470038a9187383790751817cda61a07cb50f9512..ea6b32d61873185f59db1eb9ae303488ec6de471 100644 (file)
@@ -300,16 +300,6 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
                        new_page = alloc_page_vma(gfp_mask, vma, addr);
                        if (!new_page)
                                break;          /* Out of memory */
-                       /*
-                        * The memcg-specific accounting when moving
-                        * pages around the LRU lists relies on the
-                        * page's owner (memcg) to be valid.  Usually,
-                        * pages are assigned to a new owner before
-                        * being put on the LRU list, but since this
-                        * is not the case here, the stale owner from
-                        * a previous allocation cycle must be reset.
-                        */
-                       mem_cgroup_reset_owner(new_page);
                }
 
                /*
index c12c2582457cf80cb2844563196a3473a9d17e00..127fe70a1baa3d8ecf937b76367767b9bf46f9e0 100644 (file)
@@ -46,8 +46,8 @@
 
 static struct net_device *clip_devs;
 static struct atm_vcc *atmarpd;
-static struct neigh_table clip_tbl;
 static struct timer_list idle_timer;
+static const struct neigh_ops clip_neigh_ops;
 
 static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
 {
@@ -123,6 +123,8 @@ static int neigh_check_cb(struct neighbour *n)
        struct atmarp_entry *entry = neighbour_priv(n);
        struct clip_vcc *cv;
 
+       if (n->ops != &clip_neigh_ops)
+               return 0;
        for (cv = entry->vccs; cv; cv = cv->next) {
                unsigned long exp = cv->last_use + cv->idle_timeout;
 
@@ -154,10 +156,10 @@ static int neigh_check_cb(struct neighbour *n)
 
 static void idle_timer_check(unsigned long dummy)
 {
-       write_lock(&clip_tbl.lock);
-       __neigh_for_each_release(&clip_tbl, neigh_check_cb);
+       write_lock(&arp_tbl.lock);
+       __neigh_for_each_release(&arp_tbl, neigh_check_cb);
        mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ);
-       write_unlock(&clip_tbl.lock);
+       write_unlock(&arp_tbl.lock);
 }
 
 static int clip_arp_rcv(struct sk_buff *skb)
index ef92864ac6258b32ec600ad5791e19d399d0965b..72eb187a5f605f9835d71c2de9f980e1e52d6a4e 100644 (file)
@@ -71,19 +71,16 @@ static const char *const bt_slock_key_strings[BT_MAX_PROTO] = {
        "slock-AF_BLUETOOTH-BTPROTO_AVDTP",
 };
 
-static inline void bt_sock_reclassify_lock(struct socket *sock, int proto)
+void bt_sock_reclassify_lock(struct sock *sk, int proto)
 {
-       struct sock *sk = sock->sk;
-
-       if (!sk)
-               return;
-
+       BUG_ON(!sk);
        BUG_ON(sock_owned_by_user(sk));
 
        sock_lock_init_class_and_name(sk,
                        bt_slock_key_strings[proto], &bt_slock_key[proto],
                                bt_key_strings[proto], &bt_lock_key[proto]);
 }
+EXPORT_SYMBOL(bt_sock_reclassify_lock);
 
 int bt_sock_register(int proto, const struct net_proto_family *ops)
 {
@@ -145,7 +142,8 @@ static int bt_sock_create(struct net *net, struct socket *sock, int proto,
 
        if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) {
                err = bt_proto[proto]->create(net, sock, proto, kern);
-               bt_sock_reclassify_lock(sock, proto);
+               if (!err)
+                       bt_sock_reclassify_lock(sock->sk, proto);
                module_put(bt_proto[proto]->owner);
        }
 
index 3db432473ad5214efc902f5bbaa36f631114defa..07bc69ed9498c276e272d9215a3189b0df7beb30 100644 (file)
@@ -635,6 +635,10 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
 
        if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
                struct hci_cp_auth_requested cp;
+
+               /* encrypt must be pending if auth is also pending */
+               set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
+
                cp.handle = cpu_to_le16(conn->handle);
                hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
                                                        sizeof(cp), &cp);
index 9de93714213a1be51542af9f8ff94cc6f3ac9fea..5aeb62491198b193b26e7b5e2c46a90b089bf848 100644 (file)
@@ -640,7 +640,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
        /* Reset device */
        skb_queue_purge(&hdev->cmd_q);
        atomic_set(&hdev->cmd_cnt, 1);
-       if (!test_bit(HCI_RAW, &hdev->flags)) {
+       if (!test_bit(HCI_RAW, &hdev->flags) &&
+                               test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) {
                set_bit(HCI_INIT, &hdev->flags);
                __hci_request(hdev, hci_reset_req, 0,
                                        msecs_to_jiffies(250));
index faf0b11ac1d3610805e6d049f4a2e2221c35053a..32d338c30e65a034460652579112fb6c9b61f806 100644 (file)
@@ -1018,10 +1018,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
        hci_chan_del(conn->hchan);
 
        if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
-               __cancel_delayed_work(&conn->info_timer);
+               cancel_delayed_work_sync(&conn->info_timer);
 
        if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) {
-               __cancel_delayed_work(&conn->security_timer);
+               cancel_delayed_work_sync(&conn->security_timer);
                smp_chan_destroy(conn);
        }
 
@@ -1120,7 +1120,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm, bdaddr
        return c1;
 }
 
-inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *dst)
+int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *dst)
 {
        struct sock *sk = chan->sk;
        bdaddr_t *src = &bt_sk(sk)->src;
@@ -2574,7 +2574,7 @@ static inline int l2cap_command_rej(struct l2cap_conn *conn, struct l2cap_cmd_hd
 
        if ((conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) &&
                                        cmd->ident == conn->info_ident) {
-               __cancel_delayed_work(&conn->info_timer);
+               cancel_delayed_work(&conn->info_timer);
 
                conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE;
                conn->info_ident = 0;
@@ -2970,7 +2970,8 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
 
        default:
                sk->sk_err = ECONNRESET;
-               __set_chan_timer(chan, L2CAP_DISC_REJ_TIMEOUT);
+               __set_chan_timer(chan,
+                               msecs_to_jiffies(L2CAP_DISC_REJ_TIMEOUT));
                l2cap_send_disconn_req(conn, chan, ECONNRESET);
                goto done;
        }
@@ -3120,7 +3121,7 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
                        conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE)
                return 0;
 
-       __cancel_delayed_work(&conn->info_timer);
+       cancel_delayed_work(&conn->info_timer);
 
        if (result != L2CAP_IR_SUCCESS) {
                conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE;
@@ -4478,7 +4479,8 @@ static inline void l2cap_check_encryption(struct l2cap_chan *chan, u8 encrypt)
        if (encrypt == 0x00) {
                if (chan->sec_level == BT_SECURITY_MEDIUM) {
                        __clear_chan_timer(chan);
-                       __set_chan_timer(chan, L2CAP_ENC_TIMEOUT);
+                       __set_chan_timer(chan,
+                                       msecs_to_jiffies(L2CAP_ENC_TIMEOUT));
                } else if (chan->sec_level == BT_SECURITY_HIGH)
                        l2cap_chan_close(chan, ECONNREFUSED);
        } else {
@@ -4499,7 +4501,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
 
        if (hcon->type == LE_LINK) {
                smp_distribute_keys(conn, 0);
-               __cancel_delayed_work(&conn->security_timer);
+               cancel_delayed_work(&conn->security_timer);
        }
 
        rcu_read_lock();
@@ -4546,7 +4548,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
                                        L2CAP_CONN_REQ, sizeof(req), &req);
                        } else {
                                __clear_chan_timer(chan);
-                               __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
+                               __set_chan_timer(chan,
+                                       msecs_to_jiffies(L2CAP_DISC_TIMEOUT));
                        }
                } else if (chan->state == BT_CONNECT2) {
                        struct l2cap_conn_rsp rsp;
@@ -4566,7 +4569,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
                                }
                        } else {
                                l2cap_state_change(chan, BT_DISCONN);
-                               __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
+                               __set_chan_timer(chan,
+                                       msecs_to_jiffies(L2CAP_DISC_TIMEOUT));
                                res = L2CAP_CR_SEC_BLOCK;
                                stat = L2CAP_CS_NO_INFO;
                        }
index c61d967012b2008547767dd69cec91be0f97d30d..401d9428ae4c824f6dbe2871d77bb6742ba4688c 100644 (file)
@@ -849,6 +849,8 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(void *data)
        if (!sk)
                return NULL;
 
+       bt_sock_reclassify_lock(sk, BTPROTO_L2CAP);
+
        l2cap_sock_init(sk, parent);
 
        return l2cap_pi(sk)->chan;
@@ -1002,7 +1004,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p
        INIT_LIST_HEAD(&bt_sk(sk)->accept_q);
 
        sk->sk_destruct = l2cap_sock_destruct;
-       sk->sk_sndtimeo = L2CAP_CONN_TIMEOUT;
+       sk->sk_sndtimeo = msecs_to_jiffies(L2CAP_CONN_TIMEOUT);
 
        sock_reset_flag(sk, SOCK_ZAPPED);
 
index 501649bf5596d0373d6b6dd3be791dd1345ad33e..8a602388f1e73c185aa24499e9ff636c9358fcee 100644 (file)
@@ -1164,12 +1164,18 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
                        break;
 
                case BT_DISCONN:
-                       /* When socket is closed and we are not RFCOMM
-                        * initiator rfcomm_process_rx already calls
-                        * rfcomm_session_put() */
-                       if (s->sock->sk->sk_state != BT_CLOSED)
-                               if (list_empty(&s->dlcs))
-                                       rfcomm_session_put(s);
+                       /* rfcomm_session_put is called later so don't do
+                        * anything here otherwise we will mess up the session
+                        * reference counter:
+                        *
+                        * (a) when we are the initiator dlc_unlink will drive
+                        * the reference counter to 0 (there is no initial put
+                        * after session_add)
+                        *
+                        * (b) when we are not the initiator rfcomm_rx_process
+                        * will explicitly call put to balance the initial hold
+                        * done after session add.
+                        */
                        break;
                }
        }
index f066678faeee838efae16243111a1bb51f47c8f3..22169c3f148254c52b991caf64b7c0284a54d7f6 100644 (file)
@@ -956,6 +956,8 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
        if (!sk)
                goto done;
 
+       bt_sock_reclassify_lock(sk, BTPROTO_RFCOMM);
+
        rfcomm_sock_init(sk, parent);
        bacpy(&bt_sk(sk)->src, &src);
        bacpy(&bt_sk(sk)->dst, &dst);
index 568d5bf175341b4f84ef284173b5d6da623ceafb..702a1ae9220b79bd9e60cc25732201fe8750dcd2 100644 (file)
@@ -446,8 +446,11 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
        ip6h->nexthdr = IPPROTO_HOPOPTS;
        ip6h->hop_limit = 1;
        ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1));
-       ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0,
-                          &ip6h->saddr);
+       if (ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0,
+                              &ip6h->saddr)) {
+               kfree_skb(skb);
+               return NULL;
+       }
        ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest);
 
        hopopt = (u8 *)(ip6h + 1);
index 84122472656c3a70f0c0a93020768e81ecb3972a..dec4f3817133c879b524a65f0919b5dabcff46ea 100644 (file)
@@ -62,6 +62,15 @@ static int brnf_filter_pppoe_tagged __read_mostly = 0;
 #define brnf_filter_pppoe_tagged 0
 #endif
 
+#define IS_IP(skb) \
+       (!vlan_tx_tag_present(skb) && skb->protocol == htons(ETH_P_IP))
+
+#define IS_IPV6(skb) \
+       (!vlan_tx_tag_present(skb) && skb->protocol == htons(ETH_P_IPV6))
+
+#define IS_ARP(skb) \
+       (!vlan_tx_tag_present(skb) && skb->protocol == htons(ETH_P_ARP))
+
 static inline __be16 vlan_proto(const struct sk_buff *skb)
 {
        if (vlan_tx_tag_present(skb))
@@ -639,8 +648,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
                return NF_DROP;
        br = p->br;
 
-       if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
-           IS_PPPOE_IPV6(skb)) {
+       if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb)) {
                if (!brnf_call_ip6tables && !br->nf_call_ip6tables)
                        return NF_ACCEPT;
 
@@ -651,8 +659,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
        if (!brnf_call_iptables && !br->nf_call_iptables)
                return NF_ACCEPT;
 
-       if (skb->protocol != htons(ETH_P_IP) && !IS_VLAN_IP(skb) &&
-           !IS_PPPOE_IP(skb))
+       if (!IS_IP(skb) && !IS_VLAN_IP(skb) && !IS_PPPOE_IP(skb))
                return NF_ACCEPT;
 
        nf_bridge_pull_encap_header_rcsum(skb);
@@ -701,7 +708,7 @@ static int br_nf_forward_finish(struct sk_buff *skb)
        struct nf_bridge_info *nf_bridge = skb->nf_bridge;
        struct net_device *in;
 
-       if (skb->protocol != htons(ETH_P_ARP) && !IS_VLAN_ARP(skb)) {
+       if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) {
                in = nf_bridge->physindev;
                if (nf_bridge->mask & BRNF_PKT_TYPE) {
                        skb->pkt_type = PACKET_OTHERHOST;
@@ -718,6 +725,7 @@ static int br_nf_forward_finish(struct sk_buff *skb)
        return 0;
 }
 
+
 /* This is the 'purely bridged' case.  For IP, we pass the packet to
  * netfilter with indev and outdev set to the bridge device,
  * but we are still able to filter on the 'real' indev/outdev
@@ -744,11 +752,9 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
        if (!parent)
                return NF_DROP;
 
-       if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) ||
-           IS_PPPOE_IP(skb))
+       if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb))
                pf = PF_INET;
-       else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
-                IS_PPPOE_IPV6(skb))
+       else if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb))
                pf = PF_INET6;
        else
                return NF_ACCEPT;
@@ -795,7 +801,7 @@ static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff *skb,
        if (!brnf_call_arptables && !br->nf_call_arptables)
                return NF_ACCEPT;
 
-       if (skb->protocol != htons(ETH_P_ARP)) {
+       if (!IS_ARP(skb)) {
                if (!IS_VLAN_ARP(skb))
                        return NF_ACCEPT;
                nf_bridge_pull_encap_header(skb);
@@ -853,11 +859,9 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
        if (!realoutdev)
                return NF_DROP;
 
-       if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) ||
-           IS_PPPOE_IP(skb))
+       if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb))
                pf = PF_INET;
-       else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
-                IS_PPPOE_IPV6(skb))
+       else if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb))
                pf = PF_INET6;
        else
                return NF_ACCEPT;
index dd147d78a5889ab6c2139712199c3672f9e087c6..6751ed4e0c074a8bd0f692ccdf5df0d001e0d3dc 100644 (file)
@@ -17,9 +17,9 @@
 #include "br_private_stp.h"
 
 /* since time values in bpdu are in jiffies and then scaled (1/256)
- * before sending, make sure that is at least one.
+ * before sending, make sure that is at least one STP tick.
  */
-#define MESSAGE_AGE_INCR       ((HZ < 256) ? 1 : (HZ/256))
+#define MESSAGE_AGE_INCR       ((HZ / 256) + 1)
 
 static const char *const br_port_state_names[] = {
        [BR_STATE_DISABLED] = "disabled",
@@ -186,7 +186,7 @@ static void br_record_config_information(struct net_bridge_port *p,
        p->designated_cost = bpdu->root_path_cost;
        p->designated_bridge = bpdu->bridge_id;
        p->designated_port = bpdu->port_id;
-       p->designated_age = jiffies + bpdu->message_age;
+       p->designated_age = jiffies - bpdu->message_age;
 
        mod_timer(&p->message_age_timer, jiffies
                  + (p->br->max_age - bpdu->message_age));
index 5864cc49136993d9de12f4c0f9110ab2dbcf1025..5fe2ff3b01efe44d07292514b814b0ba7b01d4f0 100644 (file)
@@ -1335,7 +1335,12 @@ static inline int ebt_make_matchname(const struct ebt_entry_match *m,
     const char *base, char __user *ubase)
 {
        char __user *hlp = ubase + ((char *)m - base);
-       if (copy_to_user(hlp, m->u.match->name, EBT_FUNCTION_MAXNAMELEN))
+       char name[EBT_FUNCTION_MAXNAMELEN] = {};
+
+       /* ebtables expects 32 bytes long names but xt_match names are 29 bytes
+          long. Copy 29 bytes and fill remaining bytes with zeroes. */
+       strncpy(name, m->u.match->name, sizeof(name));
+       if (copy_to_user(hlp, name, EBT_FUNCTION_MAXNAMELEN))
                return -EFAULT;
        return 0;
 }
@@ -1344,7 +1349,10 @@ static inline int ebt_make_watchername(const struct ebt_entry_watcher *w,
     const char *base, char __user *ubase)
 {
        char __user *hlp = ubase + ((char *)w - base);
-       if (copy_to_user(hlp , w->u.watcher->name, EBT_FUNCTION_MAXNAMELEN))
+       char name[EBT_FUNCTION_MAXNAMELEN] = {};
+
+       strncpy(name, w->u.watcher->name, sizeof(name));
+       if (copy_to_user(hlp , name, EBT_FUNCTION_MAXNAMELEN))
                return -EFAULT;
        return 0;
 }
@@ -1355,6 +1363,7 @@ ebt_make_names(struct ebt_entry *e, const char *base, char __user *ubase)
        int ret;
        char __user *hlp;
        const struct ebt_entry_target *t;
+       char name[EBT_FUNCTION_MAXNAMELEN] = {};
 
        if (e->bitmask == 0)
                return 0;
@@ -1368,7 +1377,8 @@ ebt_make_names(struct ebt_entry *e, const char *base, char __user *ubase)
        ret = EBT_WATCHER_ITERATE(e, ebt_make_watchername, base, ubase);
        if (ret != 0)
                return ret;
-       if (copy_to_user(hlp, t->u.target->name, EBT_FUNCTION_MAXNAMELEN))
+       strncpy(name, t->u.target->name, sizeof(name));
+       if (copy_to_user(hlp, name, EBT_FUNCTION_MAXNAMELEN))
                return -EFAULT;
        return 0;
 }
@@ -1893,10 +1903,7 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
 
        switch (compat_mwt) {
        case EBT_COMPAT_MATCH:
-               match = try_then_request_module(xt_find_match(NFPROTO_BRIDGE,
-                                               name, 0), "ebt_%s", name);
-               if (match == NULL)
-                       return -ENOENT;
+               match = xt_request_find_match(NFPROTO_BRIDGE, name, 0);
                if (IS_ERR(match))
                        return PTR_ERR(match);
 
@@ -1915,10 +1922,7 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
                break;
        case EBT_COMPAT_WATCHER: /* fallthrough */
        case EBT_COMPAT_TARGET:
-               wt = try_then_request_module(xt_find_target(NFPROTO_BRIDGE,
-                                               name, 0), "ebt_%s", name);
-               if (wt == NULL)
-                       return -ENOENT;
+               wt = xt_request_find_target(NFPROTO_BRIDGE, name, 0);
                if (IS_ERR(wt))
                        return PTR_ERR(wt);
                off = xt_compat_target_offset(wt);
index e287346e09343f1f315866fc7e77fb3770d927b0..2a83914b027743fbf047aae18315ab0197bc6e0c 100644 (file)
@@ -826,6 +826,8 @@ next_elt:
                write_unlock_bh(&tbl->lock);
                cond_resched();
                write_lock_bh(&tbl->lock);
+               nht = rcu_dereference_protected(tbl->nht,
+                                               lockdep_is_held(&tbl->lock));
        }
        /* Cycle through all hash buckets every base_reachable_time/2 ticks.
         * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
index 556b082986696d8b80b09c4f687cff23bc540a45..ddefc513b44a6faf99a7878f6fe651147feaa0cc 100644 (file)
@@ -194,7 +194,7 @@ static void netpoll_poll_dev(struct net_device *dev)
 
        poll_napi(dev);
 
-       if (dev->priv_flags & IFF_SLAVE) {
+       if (dev->flags & IFF_SLAVE) {
                if (dev->npinfo) {
                        struct net_device *bond_dev = dev->master;
                        struct sk_buff *skb;
index 65aebd45002786f4c00f6a5b4bc6ac45026f7f86..f965dce6f20f83c404f7133ab6a00a84a938d2b4 100644 (file)
@@ -60,7 +60,6 @@ struct rtnl_link {
 };
 
 static DEFINE_MUTEX(rtnl_mutex);
-static u16 min_ifinfo_dump_size;
 
 void rtnl_lock(void)
 {
@@ -724,10 +723,11 @@ static void copy_rtnl_link_stats64(void *v, const struct rtnl_link_stats64 *b)
 }
 
 /* All VF info */
-static inline int rtnl_vfinfo_size(const struct net_device *dev)
+static inline int rtnl_vfinfo_size(const struct net_device *dev,
+                                  u32 ext_filter_mask)
 {
-       if (dev->dev.parent && dev_is_pci(dev->dev.parent)) {
-
+       if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
+           (ext_filter_mask & RTEXT_FILTER_VF)) {
                int num_vfs = dev_num_vf(dev->dev.parent);
                size_t size = nla_total_size(sizeof(struct nlattr));
                size += nla_total_size(num_vfs * sizeof(struct nlattr));
@@ -766,7 +766,8 @@ static size_t rtnl_port_size(const struct net_device *dev)
                return port_self_size;
 }
 
-static noinline size_t if_nlmsg_size(const struct net_device *dev)
+static noinline size_t if_nlmsg_size(const struct net_device *dev,
+                                    u32 ext_filter_mask)
 {
        return NLMSG_ALIGN(sizeof(struct ifinfomsg))
               + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
@@ -784,8 +785,9 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev)
               + nla_total_size(4) /* IFLA_MASTER */
               + nla_total_size(1) /* IFLA_OPERSTATE */
               + nla_total_size(1) /* IFLA_LINKMODE */
-              + nla_total_size(4) /* IFLA_NUM_VF */
-              + rtnl_vfinfo_size(dev) /* IFLA_VFINFO_LIST */
+              + nla_total_size(ext_filter_mask
+                               & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */
+              + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */
               + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
               + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
               + rtnl_link_get_af_size(dev); /* IFLA_AF_SPEC */
@@ -868,7 +870,7 @@ static int rtnl_port_fill(struct sk_buff *skb, struct net_device *dev)
 
 static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
                            int type, u32 pid, u32 seq, u32 change,
-                           unsigned int flags)
+                           unsigned int flags, u32 ext_filter_mask)
 {
        struct ifinfomsg *ifm;
        struct nlmsghdr *nlh;
@@ -941,10 +943,11 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
                goto nla_put_failure;
        copy_rtnl_link_stats64(nla_data(attr), stats);
 
-       if (dev->dev.parent)
+       if (dev->dev.parent && (ext_filter_mask & RTEXT_FILTER_VF))
                NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
 
-       if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
+       if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent
+           && (ext_filter_mask & RTEXT_FILTER_VF)) {
                int i;
 
                struct nlattr *vfinfo, *vf;
@@ -1048,6 +1051,8 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
        struct net_device *dev;
        struct hlist_head *head;
        struct hlist_node *node;
+       struct nlattr *tb[IFLA_MAX+1];
+       u32 ext_filter_mask = 0;
 
        s_h = cb->args[0];
        s_idx = cb->args[1];
@@ -1055,6 +1060,13 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
        rcu_read_lock();
        cb->seq = net->dev_base_seq;
 
+       if (nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
+                       ifla_policy) >= 0) {
+
+               if (tb[IFLA_EXT_MASK])
+                       ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+       }
+
        for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {
                idx = 0;
                head = &net->dev_index_head[h];
@@ -1064,7 +1076,8 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
                        if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
                                             NETLINK_CB(cb->skb).pid,
                                             cb->nlh->nlmsg_seq, 0,
-                                            NLM_F_MULTI) <= 0)
+                                            NLM_F_MULTI,
+                                            ext_filter_mask) <= 0)
                                goto out;
 
                        nl_dump_check_consistent(cb, nlmsg_hdr(skb));
@@ -1100,6 +1113,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = {
        [IFLA_VF_PORTS]         = { .type = NLA_NESTED },
        [IFLA_PORT_SELF]        = { .type = NLA_NESTED },
        [IFLA_AF_SPEC]          = { .type = NLA_NESTED },
+       [IFLA_EXT_MASK]         = { .type = NLA_U32 },
 };
 EXPORT_SYMBOL(ifla_policy);
 
@@ -1509,8 +1523,6 @@ errout:
 
        if (send_addr_notify)
                call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
-       min_ifinfo_dump_size = max_t(u16, if_nlmsg_size(dev),
-                                    min_ifinfo_dump_size);
 
        return err;
 }
@@ -1842,6 +1854,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
        struct net_device *dev = NULL;
        struct sk_buff *nskb;
        int err;
+       u32 ext_filter_mask = 0;
 
        err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
        if (err < 0)
@@ -1850,6 +1863,9 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
        if (tb[IFLA_IFNAME])
                nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
 
+       if (tb[IFLA_EXT_MASK])
+               ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+
        ifm = nlmsg_data(nlh);
        if (ifm->ifi_index > 0)
                dev = __dev_get_by_index(net, ifm->ifi_index);
@@ -1861,12 +1877,12 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
        if (dev == NULL)
                return -ENODEV;
 
-       nskb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL);
+       nskb = nlmsg_new(if_nlmsg_size(dev, ext_filter_mask), GFP_KERNEL);
        if (nskb == NULL)
                return -ENOBUFS;
 
        err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid,
-                              nlh->nlmsg_seq, 0, 0);
+                              nlh->nlmsg_seq, 0, 0, ext_filter_mask);
        if (err < 0) {
                /* -EMSGSIZE implies BUG in if_nlmsg_size */
                WARN_ON(err == -EMSGSIZE);
@@ -1877,8 +1893,32 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
        return err;
 }
 
-static u16 rtnl_calcit(struct sk_buff *skb)
+static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
 {
+       struct net *net = sock_net(skb->sk);
+       struct net_device *dev;
+       struct nlattr *tb[IFLA_MAX+1];
+       u32 ext_filter_mask = 0;
+       u16 min_ifinfo_dump_size = 0;
+
+       if (nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
+                       ifla_policy) >= 0) {
+               if (tb[IFLA_EXT_MASK])
+                       ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
+       }
+
+       if (!ext_filter_mask)
+               return NLMSG_GOODSIZE;
+       /*
+        * traverse the list of net devices and compute the minimum
+        * buffer size based upon the filter mask.
+        */
+       list_for_each_entry(dev, &net->dev_base_head, dev_list) {
+               min_ifinfo_dump_size = max_t(u16, min_ifinfo_dump_size,
+                                            if_nlmsg_size(dev,
+                                                          ext_filter_mask));
+       }
+
        return min_ifinfo_dump_size;
 }
 
@@ -1913,13 +1953,11 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
        int err = -ENOBUFS;
        size_t if_info_size;
 
-       skb = nlmsg_new((if_info_size = if_nlmsg_size(dev)), GFP_KERNEL);
+       skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), GFP_KERNEL);
        if (skb == NULL)
                goto errout;
 
-       min_ifinfo_dump_size = max_t(u16, if_info_size, min_ifinfo_dump_size);
-
-       err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
+       err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0, 0);
        if (err < 0) {
                /* -EMSGSIZE implies BUG in if_nlmsg_size() */
                WARN_ON(err == -EMSGSIZE);
@@ -1977,7 +2015,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                        return -EOPNOTSUPP;
                calcit = rtnl_get_calcit(family, type);
                if (calcit)
-                       min_dump_alloc = calcit(skb);
+                       min_dump_alloc = calcit(skb, nlh);
 
                __rtnl_unlock();
                rtnl = net->rtnl;
index 6b3ca5ba4450599e15ebe8b3ed5597a51051821f..38673d2860e293404a9109c88ec9b03ab6b810f1 100644 (file)
@@ -65,7 +65,7 @@
    it is infeasible task. The most general solutions would be
    to keep skb->encapsulation counter (sort of local ttl),
    and silently drop packet when it expires. It is a good
-   solution, but it supposes maintaing new variable in ALL
+   solution, but it supposes maintaining new variable in ALL
    skb, even if no tunneling is used.
 
    Current solution: xmit_recursion breaks dead loops. This is a percpu
 
    One of them is to parse packet trying to detect inner encapsulation
    made by our node. It is difficult or even impossible, especially,
-   taking into account fragmentation. TO be short, tt is not solution at all.
+   taking into account fragmentation. TO be short, ttl is not solution at all.
 
    Current solution: The solution was UNEXPECTEDLY SIMPLE.
    We force DF flag on tunnels with preconfigured hop limit,
    that is ALL. :-) Well, it does not remove the problem completely,
    but exponential growth of network traffic is changed to linear
    (branches, that exceed pmtu are pruned) and tunnel mtu
-   fastly degrades to value <68, where looping stops.
+   rapidly degrades to value <68, where looping stops.
    Yes, it is not good if there exists a router in the loop,
    which does not force DF, even when encapsulating packets have DF set.
    But it is not our problem! Nobody could accuse us, we made
@@ -457,8 +457,8 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
    GRE tunnels with enabled checksum. Tell them "thank you".
 
    Well, I wonder, rfc1812 was written by Cisco employee,
-   what the hell these idiots break standrads established
-   by themself???
+   what the hell these idiots break standards established
+   by themselves???
  */
 
        const struct iphdr *iph = (const struct iphdr *)skb->data;
index aea5a199c37a341be3fab08500f1c35a34cbf215..b072386cee218ba508d572d049b2371ba9bf370e 100644 (file)
@@ -630,6 +630,7 @@ static int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 
        pr_debug("ping_recvmsg(sk=%p,sk->num=%u)\n", isk, isk->inet_num);
 
+       err = -EOPNOTSUPP;
        if (flags & MSG_OOB)
                goto out;
 
index 37755ccc0e96d8da1b36e0c43e695b0f0a6431e4..22ef5f9fd2ff2e92dc4955dc9a2ac450d8a435fa 100644 (file)
@@ -3240,7 +3240,8 @@ void __init tcp_init(void)
 {
        struct sk_buff *skb = NULL;
        unsigned long limit;
-       int i, max_share, cnt;
+       int max_share, cnt;
+       unsigned int i;
        unsigned long jiffy = jiffies;
 
        BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb));
@@ -3283,7 +3284,7 @@ void __init tcp_init(void)
                                        &tcp_hashinfo.bhash_size,
                                        NULL,
                                        64 * 1024);
-       tcp_hashinfo.bhash_size = 1 << tcp_hashinfo.bhash_size;
+       tcp_hashinfo.bhash_size = 1U << tcp_hashinfo.bhash_size;
        for (i = 0; i < tcp_hashinfo.bhash_size; i++) {
                spin_lock_init(&tcp_hashinfo.bhash[i].lock);
                INIT_HLIST_HEAD(&tcp_hashinfo.bhash[i].chain);
index 976034f823206fcf92e574f082b55de97421ce81..b5e315f13641d683c2ab9031c0d52969c6c0873a 100644 (file)
@@ -1307,25 +1307,26 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
        return in_sack;
 }
 
-static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
-                         struct tcp_sacktag_state *state,
+/* Mark the given newly-SACKed range as such, adjusting counters and hints. */
+static u8 tcp_sacktag_one(struct sock *sk,
+                         struct tcp_sacktag_state *state, u8 sacked,
+                         u32 start_seq, u32 end_seq,
                          int dup_sack, int pcount)
 {
        struct tcp_sock *tp = tcp_sk(sk);
-       u8 sacked = TCP_SKB_CB(skb)->sacked;
        int fack_count = state->fack_count;
 
        /* Account D-SACK for retransmitted packet. */
        if (dup_sack && (sacked & TCPCB_RETRANS)) {
                if (tp->undo_marker && tp->undo_retrans &&
-                   after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))
+                   after(end_seq, tp->undo_marker))
                        tp->undo_retrans--;
                if (sacked & TCPCB_SACKED_ACKED)
                        state->reord = min(fack_count, state->reord);
        }
 
        /* Nothing to do; acked frame is about to be dropped (was ACKed). */
-       if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
+       if (!after(end_seq, tp->snd_una))
                return sacked;
 
        if (!(sacked & TCPCB_SACKED_ACKED)) {
@@ -1344,13 +1345,13 @@ static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
                                /* New sack for not retransmitted frame,
                                 * which was in hole. It is reordering.
                                 */
-                               if (before(TCP_SKB_CB(skb)->seq,
+                               if (before(start_seq,
                                           tcp_highest_sack_seq(tp)))
                                        state->reord = min(fack_count,
                                                           state->reord);
 
                                /* SACK enhanced F-RTO (RFC4138; Appendix B) */
-                               if (!after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark))
+                               if (!after(end_seq, tp->frto_highmark))
                                        state->flag |= FLAG_ONLY_ORIG_SACKED;
                        }
 
@@ -1368,8 +1369,7 @@ static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
 
                /* Lost marker hint past SACKed? Tweak RFC3517 cnt */
                if (!tcp_is_fack(tp) && (tp->lost_skb_hint != NULL) &&
-                   before(TCP_SKB_CB(skb)->seq,
-                          TCP_SKB_CB(tp->lost_skb_hint)->seq))
+                   before(start_seq, TCP_SKB_CB(tp->lost_skb_hint)->seq))
                        tp->lost_cnt_hint += pcount;
 
                if (fack_count > tp->fackets_out)
@@ -1388,6 +1388,9 @@ static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
        return sacked;
 }
 
+/* Shift newly-SACKed bytes from this skb to the immediately previous
+ * already-SACKed sk_buff. Mark the newly-SACKed bytes as such.
+ */
 static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
                           struct tcp_sacktag_state *state,
                           unsigned int pcount, int shifted, int mss,
@@ -1395,9 +1398,20 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
 {
        struct tcp_sock *tp = tcp_sk(sk);
        struct sk_buff *prev = tcp_write_queue_prev(sk, skb);
+       u32 start_seq = TCP_SKB_CB(skb)->seq;   /* start of newly-SACKed */
+       u32 end_seq = start_seq + shifted;      /* end of newly-SACKed */
 
        BUG_ON(!pcount);
 
+       /* Adjust counters and hints for the newly sacked sequence
+        * range but discard the return value since prev is already
+        * marked. We must tag the range first because the seq
+        * advancement below implicitly advances
+        * tcp_highest_sack_seq() when skb is highest_sack.
+        */
+       tcp_sacktag_one(sk, state, TCP_SKB_CB(skb)->sacked,
+                       start_seq, end_seq, dup_sack, pcount);
+
        if (skb == tp->lost_skb_hint)
                tp->lost_cnt_hint += pcount;
 
@@ -1424,9 +1438,6 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
                skb_shinfo(skb)->gso_type = 0;
        }
 
-       /* We discard results */
-       tcp_sacktag_one(skb, sk, state, dup_sack, pcount);
-
        /* Difference in this won't matter, both ACKed by the same cumul. ACK */
        TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
 
@@ -1574,6 +1585,10 @@ static struct sk_buff *tcp_shift_skb_data(struct sock *sk, struct sk_buff *skb,
                }
        }
 
+       /* tcp_sacktag_one() won't SACK-tag ranges below snd_una */
+       if (!after(TCP_SKB_CB(skb)->seq + len, tp->snd_una))
+               goto fallback;
+
        if (!skb_shift(prev, skb, len))
                goto fallback;
        if (!tcp_shifted_skb(sk, skb, state, pcount, len, mss, dup_sack))
@@ -1664,10 +1679,14 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
                        break;
 
                if (in_sack) {
-                       TCP_SKB_CB(skb)->sacked = tcp_sacktag_one(skb, sk,
-                                                                 state,
-                                                                 dup_sack,
-                                                                 tcp_skb_pcount(skb));
+                       TCP_SKB_CB(skb)->sacked =
+                               tcp_sacktag_one(sk,
+                                               state,
+                                               TCP_SKB_CB(skb)->sacked,
+                                               TCP_SKB_CB(skb)->seq,
+                                               TCP_SKB_CB(skb)->end_seq,
+                                               dup_sack,
+                                               tcp_skb_pcount(skb));
 
                        if (!before(TCP_SKB_CB(skb)->seq,
                                    tcp_highest_sack_seq(tp)))
@@ -2554,6 +2573,7 @@ static void tcp_mark_head_lost(struct sock *sk, int packets, int mark_head)
 
                if (cnt > packets) {
                        if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) ||
+                           (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) ||
                            (oldcnt >= packets))
                                break;
 
index 63418185f5249aaba6a8ae55be365536a56397a1..e3db3f9151146a6d393293e4e75daa63c988df1a 100644 (file)
@@ -110,10 +110,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 
        skb_push(skb, sizeof(*iph));
        skb_reset_network_header(skb);
-
-       memmove(skb->data - skb->mac_len, skb_mac_header(skb),
-               skb->mac_len);
-       skb_set_mac_header(skb, -skb->mac_len);
+       skb_mac_header_rebuild(skb);
 
        xfrm4_beet_make_header(skb);
 
index 534972e114ac1f7cf259cb6b26413081cfdb6e9a..ed4bf11ef9f4709b9418ebeff06789c9b84b77ab 100644 (file)
@@ -66,7 +66,6 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
 
 static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
 {
-       const unsigned char *old_mac;
        int err = -EINVAL;
 
        if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP)
@@ -84,10 +83,9 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
        if (!(x->props.flags & XFRM_STATE_NOECN))
                ipip_ecn_decapsulate(skb);
 
-       old_mac = skb_mac_header(skb);
-       skb_set_mac_header(skb, -skb->mac_len);
-       memmove(skb_mac_header(skb), old_mac, skb->mac_len);
        skb_reset_network_header(skb);
+       skb_mac_header_rebuild(skb);
+
        err = 0;
 
 out:
index c02280a4d126980540daac44a8b541b92c0b16f0..6b8ebc5da0e1344ad58994e327ba42cac44f3ac3 100644 (file)
@@ -434,6 +434,10 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
        /* Join all-node multicast group */
        ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
 
+       /* Join all-router multicast group if forwarding is set */
+       if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
+               ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
+
        return ndev;
 }
 
index c7e95c8c579f6e71848e3857d18392e5983199c3..5aa3981a392273891881ea8defc1d70fff7adde4 100644 (file)
@@ -1926,8 +1926,10 @@ static int ip6mr_forward2(struct net *net, struct mr6_table *mrt,
        };
 
        dst = ip6_route_output(net, NULL, &fl6);
-       if (!dst)
+       if (dst->error) {
+               dst_release(dst);
                goto out_free;
+       }
 
        skb_dst_drop(skb);
        skb_dst_set(skb, dst);
index d8f02ef88e59b265322890025aa22e51815abb3a..c964958ac470f65408c09642814a532205fa497c 100644 (file)
@@ -1545,9 +1545,10 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
                         &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);
 
        dst = ip6_route_output(net, NULL, &fl6);
-       if (dst == NULL)
+       if (dst->error) {
+               dst_release(dst);
                return;
-
+       }
        dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
        if (IS_ERR(dst))
                return;
index a81ce9450750f87a207499e888814a76009c0286..9949a356d62c8f5e1808e3de0957b28a814b5084 100644 (file)
@@ -80,7 +80,6 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb)
 static int xfrm6_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        struct ipv6hdr *ip6h;
-       const unsigned char *old_mac;
        int size = sizeof(struct ipv6hdr);
        int err;
 
@@ -90,10 +89,7 @@ static int xfrm6_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 
        __skb_push(skb, size);
        skb_reset_network_header(skb);
-
-       old_mac = skb_mac_header(skb);
-       skb_set_mac_header(skb, -skb->mac_len);
-       memmove(skb_mac_header(skb), old_mac, skb->mac_len);
+       skb_mac_header_rebuild(skb);
 
        xfrm6_beet_make_header(skb);
 
index 261e6e6f487e818eba1e670bace7f031efd60631..9f2095b19ad09bb4acfed82fd2d1c59652245373 100644 (file)
@@ -63,7 +63,6 @@ static int xfrm6_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
 static int xfrm6_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
 {
        int err = -EINVAL;
-       const unsigned char *old_mac;
 
        if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPV6)
                goto out;
@@ -80,10 +79,9 @@ static int xfrm6_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
        if (!(x->props.flags & XFRM_STATE_NOECN))
                ipip6_ecn_decapsulate(skb);
 
-       old_mac = skb_mac_header(skb);
-       skb_set_mac_header(skb, -skb->mac_len);
-       memmove(skb_mac_header(skb), old_mac, skb->mac_len);
        skb_reset_network_header(skb);
+       skb_mac_header_rebuild(skb);
+
        err = 0;
 
 out:
index 2406b3e7393fb042d8ec82b417c7e985a0801fa2..d86217d56bd703fcb0bc602ff93f14b665c27c5f 100644 (file)
@@ -63,14 +63,14 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
        test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : ""
 
        int res = scnprintf(buf, sizeof(buf),
-                           "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+                           "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
                            TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
                            TEST(PS_DRIVER), TEST(AUTHORIZED),
                            TEST(SHORT_PREAMBLE),
                            TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT),
                            TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL),
                            TEST(UAPSD), TEST(SP), TEST(TDLS_PEER),
-                           TEST(TDLS_PEER_AUTH));
+                           TEST(TDLS_PEER_AUTH), TEST(RATE_CONTROL));
 #undef TEST
        return simple_read_from_buffer(userbuf, count, ppos, buf, res);
 }
index 01a21c2f6ab37df336f5f69c55f33de4e0a698f3..8e2137bd87e2435d45294ffa192f34688ab61097 100644 (file)
@@ -1332,6 +1332,9 @@ u32 __ieee80211_recalc_idle(struct ieee80211_local *local)
                hw_roc = true;
 
        list_for_each_entry(sdata, &local->interfaces, list) {
+               if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
+                   sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+                       continue;
                if (sdata->old_idle == sdata->vif.bss_conf.idle)
                        continue;
                if (!ieee80211_sdata_running(sdata))
index 0a0d94ad9b08374fe90e0f653da4d4b352e8f6c9..b142bd4c239096f51fbf0e79e9b507a2bf35d1d0 100644 (file)
@@ -910,6 +910,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
                wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
                            result);
 
+       ieee80211_led_init(local);
+
        rtnl_lock();
 
        result = ieee80211_init_rate_ctrl_alg(local,
@@ -931,8 +933,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        rtnl_unlock();
 
-       ieee80211_led_init(local);
-
        local->network_latency_notifier.notifier_call =
                ieee80211_max_network_latency;
        result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY,
index 5a5a7767d541c2a952aecbeefca79125dfe17052..f9b8e819ca63c0bfba25028c7d27b8cf42540157 100644 (file)
@@ -336,7 +336,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
        int i;
        u32 mask;
 
-       if (sta) {
+       if (sta && test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) {
                ista = &sta->sta;
                priv_sta = sta->rate_ctrl_priv;
        }
@@ -344,7 +344,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
        for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
                info->control.rates[i].idx = -1;
                info->control.rates[i].flags = 0;
-               info->control.rates[i].count = 1;
+               info->control.rates[i].count = 0;
        }
 
        if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
index 168427b0ffdc97fca6147118518f4593b79770f6..80cfc006dd7408331c753350393c179888b76004 100644 (file)
@@ -41,7 +41,7 @@ static inline void rate_control_tx_status(struct ieee80211_local *local,
        struct ieee80211_sta *ista = &sta->sta;
        void *priv_sta = sta->rate_ctrl_priv;
 
-       if (!ref)
+       if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
                return;
 
        ref->ops->tx_status(ref->priv, sband, ista, priv_sta, skb);
@@ -62,6 +62,7 @@ static inline void rate_control_rate_init(struct sta_info *sta)
        sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
 
        ref->ops->rate_init(ref->priv, sband, ista, priv_sta);
+       set_sta_flag(sta, WLAN_STA_RATE_CONTROL);
 }
 
 static inline void rate_control_rate_update(struct ieee80211_local *local,
index 6f77f12dc3fc313410964a91f318e48f1319d86c..bfed851d0d36f38f8df0904193e29fc47c7bf129 100644 (file)
@@ -52,6 +52,7 @@
  * @WLAN_STA_SP: Station is in a service period, so don't try to
  *     reply to other uAPSD trigger frames or PS-Poll.
  * @WLAN_STA_4ADDR_EVENT: 4-addr event was already sent for this frame.
+ * @WLAN_STA_RATE_CONTROL: rate control was initialized for this station.
  */
 enum ieee80211_sta_info_flags {
        WLAN_STA_AUTH,
@@ -71,6 +72,7 @@ enum ieee80211_sta_info_flags {
        WLAN_STA_UAPSD,
        WLAN_STA_SP,
        WLAN_STA_4ADDR_EVENT,
+       WLAN_STA_RATE_CONTROL,
 };
 
 enum ieee80211_sta_state {
index 611c3359b94d9fcc6336bb456c97d4106f6c7892..2555816e778827250e5aec0d33eaa2fa9512addc 100644 (file)
@@ -232,6 +232,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
        __be16 dport = 0;               /* destination port to forward */
        unsigned int flags;
        struct ip_vs_conn_param param;
+       const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };
        union nf_inet_addr snet;        /* source network of the client,
                                           after masking */
 
@@ -267,7 +268,6 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
        {
                int protocol = iph.protocol;
                const union nf_inet_addr *vaddr = &iph.daddr;
-               const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };
                __be16 vport = 0;
 
                if (dst_port == svc->port) {
index 76613f5a55c0c557920c1f52f2d67a20c0934eda..fa4b82c8ae8078b7a2e94f367987d8bc79ef991c 100644 (file)
@@ -404,19 +404,49 @@ static void __nf_conntrack_hash_insert(struct nf_conn *ct,
                           &net->ct.hash[repl_hash]);
 }
 
-void nf_conntrack_hash_insert(struct nf_conn *ct)
+int
+nf_conntrack_hash_check_insert(struct nf_conn *ct)
 {
        struct net *net = nf_ct_net(ct);
        unsigned int hash, repl_hash;
+       struct nf_conntrack_tuple_hash *h;
+       struct hlist_nulls_node *n;
        u16 zone;
 
        zone = nf_ct_zone(ct);
-       hash = hash_conntrack(net, zone, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-       repl_hash = hash_conntrack(net, zone, &ct->tuplehash[IP_CT_DIR_REPLY].tuple);
+       hash = hash_conntrack(net, zone,
+                             &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+       repl_hash = hash_conntrack(net, zone,
+                                  &ct->tuplehash[IP_CT_DIR_REPLY].tuple);
+
+       spin_lock_bh(&nf_conntrack_lock);
+
+       /* See if there's one in the list already, including reverse */
+       hlist_nulls_for_each_entry(h, n, &net->ct.hash[hash], hnnode)
+               if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
+                                     &h->tuple) &&
+                   zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h)))
+                       goto out;
+       hlist_nulls_for_each_entry(h, n, &net->ct.hash[repl_hash], hnnode)
+               if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_REPLY].tuple,
+                                     &h->tuple) &&
+                   zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h)))
+                       goto out;
 
+       add_timer(&ct->timeout);
+       nf_conntrack_get(&ct->ct_general);
        __nf_conntrack_hash_insert(ct, hash, repl_hash);
+       NF_CT_STAT_INC(net, insert);
+       spin_unlock_bh(&nf_conntrack_lock);
+
+       return 0;
+
+out:
+       NF_CT_STAT_INC(net, insert_failed);
+       spin_unlock_bh(&nf_conntrack_lock);
+       return -EEXIST;
 }
-EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert);
+EXPORT_SYMBOL_GPL(nf_conntrack_hash_check_insert);
 
 /* Confirm a connection given skb; places it in hash table */
 int
@@ -605,8 +635,12 @@ static noinline int early_drop(struct net *net, unsigned int hash)
 
        if (del_timer(&ct->timeout)) {
                death_by_timeout((unsigned long)ct);
-               dropped = 1;
-               NF_CT_STAT_INC_ATOMIC(net, early_drop);
+               /* Check if we indeed killed this entry. Reliable event
+                  delivery may have inserted it into the dying list. */
+               if (test_bit(IPS_DYING_BIT, &ct->status)) {
+                       dropped = 1;
+                       NF_CT_STAT_INC_ATOMIC(net, early_drop);
+               }
        }
        nf_ct_put(ct);
        return dropped;
index 9307b033c0c9d9ff35c60b31755aaceef8d89087..10687692831eb5f5f097568f0d292fa530c796f1 100644 (file)
@@ -1041,16 +1041,13 @@ ctnetlink_parse_nat_setup(struct nf_conn *ct,
        if (!parse_nat_setup) {
 #ifdef CONFIG_MODULES
                rcu_read_unlock();
-               spin_unlock_bh(&nf_conntrack_lock);
                nfnl_unlock();
                if (request_module("nf-nat-ipv4") < 0) {
                        nfnl_lock();
-                       spin_lock_bh(&nf_conntrack_lock);
                        rcu_read_lock();
                        return -EOPNOTSUPP;
                }
                nfnl_lock();
-               spin_lock_bh(&nf_conntrack_lock);
                rcu_read_lock();
                if (nfnetlink_parse_nat_setup_hook)
                        return -EAGAIN;
@@ -1367,15 +1364,12 @@ ctnetlink_create_conntrack(struct net *net, u16 zone,
                                                    nf_ct_protonum(ct));
                if (helper == NULL) {
                        rcu_read_unlock();
-                       spin_unlock_bh(&nf_conntrack_lock);
 #ifdef CONFIG_MODULES
                        if (request_module("nfct-helper-%s", helpname) < 0) {
-                               spin_lock_bh(&nf_conntrack_lock);
                                err = -EOPNOTSUPP;
                                goto err1;
                        }
 
-                       spin_lock_bh(&nf_conntrack_lock);
                        rcu_read_lock();
                        helper = __nf_conntrack_helper_find(helpname,
                                                            nf_ct_l3num(ct),
@@ -1468,8 +1462,10 @@ ctnetlink_create_conntrack(struct net *net, u16 zone,
        if (tstamp)
                tstamp->start = ktime_to_ns(ktime_get_real());
 
-       add_timer(&ct->timeout);
-       nf_conntrack_hash_insert(ct);
+       err = nf_conntrack_hash_check_insert(ct);
+       if (err < 0)
+               goto err2;
+
        rcu_read_unlock();
 
        return ct;
@@ -1490,6 +1486,7 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
        struct nf_conntrack_tuple otuple, rtuple;
        struct nf_conntrack_tuple_hash *h = NULL;
        struct nfgenmsg *nfmsg = nlmsg_data(nlh);
+       struct nf_conn *ct;
        u_int8_t u3 = nfmsg->nfgen_family;
        u16 zone;
        int err;
@@ -1510,27 +1507,22 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
                        return err;
        }
 
-       spin_lock_bh(&nf_conntrack_lock);
        if (cda[CTA_TUPLE_ORIG])
-               h = __nf_conntrack_find(net, zone, &otuple);
+               h = nf_conntrack_find_get(net, zone, &otuple);
        else if (cda[CTA_TUPLE_REPLY])
-               h = __nf_conntrack_find(net, zone, &rtuple);
+               h = nf_conntrack_find_get(net, zone, &rtuple);
 
        if (h == NULL) {
                err = -ENOENT;
                if (nlh->nlmsg_flags & NLM_F_CREATE) {
-                       struct nf_conn *ct;
                        enum ip_conntrack_events events;
 
                        ct = ctnetlink_create_conntrack(net, zone, cda, &otuple,
                                                        &rtuple, u3);
-                       if (IS_ERR(ct)) {
-                               err = PTR_ERR(ct);
-                               goto out_unlock;
-                       }
+                       if (IS_ERR(ct))
+                               return PTR_ERR(ct);
+
                        err = 0;
-                       nf_conntrack_get(&ct->ct_general);
-                       spin_unlock_bh(&nf_conntrack_lock);
                        if (test_bit(IPS_EXPECTED_BIT, &ct->status))
                                events = IPCT_RELATED;
                        else
@@ -1545,23 +1537,19 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
                                                      ct, NETLINK_CB(skb).pid,
                                                      nlmsg_report(nlh));
                        nf_ct_put(ct);
-               } else
-                       spin_unlock_bh(&nf_conntrack_lock);
+               }
 
                return err;
        }
        /* implicit 'else' */
 
-       /* We manipulate the conntrack inside the global conntrack table lock,
-        * so there's no need to increase the refcount */
        err = -EEXIST;
+       ct = nf_ct_tuplehash_to_ctrack(h);
        if (!(nlh->nlmsg_flags & NLM_F_EXCL)) {
-               struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h);
-
+               spin_lock_bh(&nf_conntrack_lock);
                err = ctnetlink_change_conntrack(ct, cda);
+               spin_unlock_bh(&nf_conntrack_lock);
                if (err == 0) {
-                       nf_conntrack_get(&ct->ct_general);
-                       spin_unlock_bh(&nf_conntrack_lock);
                        nf_conntrack_eventmask_report((1 << IPCT_REPLY) |
                                                      (1 << IPCT_ASSURED) |
                                                      (1 << IPCT_HELPER) |
@@ -1570,15 +1558,10 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
                                                      (1 << IPCT_MARK),
                                                      ct, NETLINK_CB(skb).pid,
                                                      nlmsg_report(nlh));
-                       nf_ct_put(ct);
-               } else
-                       spin_unlock_bh(&nf_conntrack_lock);
-
-               return err;
+               }
        }
 
-out_unlock:
-       spin_unlock_bh(&nf_conntrack_lock);
+       nf_ct_put(ct);
        return err;
 }
 
index b3a7db678b8dddf12e9495630e0e051a0b78cfe9..ce60cf0f6c11a49d9d8bc8bf5c8918d10dbfb316 100644 (file)
@@ -203,6 +203,27 @@ err:
        return status;
 }
 
+#ifdef CONFIG_BRIDGE_NETFILTER
+/* When called from bridge netfilter, skb->data must point to MAC header
+ * before calling skb_gso_segment(). Else, original MAC header is lost
+ * and segmented skbs will be sent to wrong destination.
+ */
+static void nf_bridge_adjust_skb_data(struct sk_buff *skb)
+{
+       if (skb->nf_bridge)
+               __skb_push(skb, skb->network_header - skb->mac_header);
+}
+
+static void nf_bridge_adjust_segmented_data(struct sk_buff *skb)
+{
+       if (skb->nf_bridge)
+               __skb_pull(skb, skb->network_header - skb->mac_header);
+}
+#else
+#define nf_bridge_adjust_skb_data(s) do {} while (0)
+#define nf_bridge_adjust_segmented_data(s) do {} while (0)
+#endif
+
 int nf_queue(struct sk_buff *skb,
             struct list_head *elem,
             u_int8_t pf, unsigned int hook,
@@ -212,7 +233,7 @@ int nf_queue(struct sk_buff *skb,
             unsigned int queuenum)
 {
        struct sk_buff *segs;
-       int err;
+       int err = -EINVAL;
        unsigned int queued;
 
        if (!skb_is_gso(skb))
@@ -228,23 +249,25 @@ int nf_queue(struct sk_buff *skb,
                break;
        }
 
+       nf_bridge_adjust_skb_data(skb);
        segs = skb_gso_segment(skb, 0);
        /* Does not use PTR_ERR to limit the number of error codes that can be
         * returned by nf_queue.  For instance, callers rely on -ECANCELED to mean
         * 'ignore this hook'.
         */
        if (IS_ERR(segs))
-               return -EINVAL;
-
+               goto out_err;
        queued = 0;
        err = 0;
        do {
                struct sk_buff *nskb = segs->next;
 
                segs->next = NULL;
-               if (err == 0)
+               if (err == 0) {
+                       nf_bridge_adjust_segmented_data(segs);
                        err = __nf_queue(segs, elem, pf, hook, indev,
                                           outdev, okfn, queuenum);
+               }
                if (err == 0)
                        queued++;
                else
@@ -252,11 +275,12 @@ int nf_queue(struct sk_buff *skb,
                segs = nskb;
        } while (segs);
 
-       /* also free orig skb if only some segments were queued */
-       if (unlikely(err && queued))
-               err = 0;
-       if (err == 0)
+       if (queued) {
                kfree_skb(skb);
+               return 0;
+       }
+  out_err:
+       nf_bridge_adjust_segmented_data(skb);
        return err;
 }
 
index 3aae66facf9f79d8128857a24461127b0e6389b3..4d5057902839888f1fd5afab0c75ebbaab63775b 100644 (file)
@@ -152,9 +152,10 @@ tee_tg_route6(struct sk_buff *skb, const struct xt_tee_tginfo *info)
        fl6.flowlabel = ((iph->flow_lbl[0] & 0xF) << 16) |
                           (iph->flow_lbl[1] << 8) | iph->flow_lbl[2];
        dst = ip6_route_output(net, NULL, &fl6);
-       if (dst == NULL)
+       if (dst->error) {
+               dst_release(dst);
                return false;
-
+       }
        skb_dst_drop(skb);
        skb_dst_set(skb, dst);
        skb->dev      = dst->dev;
index 4cba13e46ffd7e13868526ec5acaee5fdde005e2..ae3a035f53908daea1784fcb5224d16946af5314 100644 (file)
@@ -232,7 +232,7 @@ static int rxrpc_krb5_decode_principal(struct krb5_principal *princ,
        if (toklen <= (n_parts + 1) * 4)
                return -EINVAL;
 
-       princ->name_parts = kcalloc(sizeof(char *), n_parts, GFP_KERNEL);
+       princ->name_parts = kcalloc(n_parts, sizeof(char *), GFP_KERNEL);
        if (!princ->name_parts)
                return -ENOMEM;
 
@@ -355,7 +355,7 @@ static int rxrpc_krb5_decode_tagged_array(struct krb5_tagged_data **_td,
 
                _debug("n_elem %d", n_elem);
 
-               td = kcalloc(sizeof(struct krb5_tagged_data), n_elem,
+               td = kcalloc(n_elem, sizeof(struct krb5_tagged_data),
                             GFP_KERNEL);
                if (!td)
                        return -ENOMEM;
index e83d61ca78cab71c7a54c22b7d09cc94611726a8..5da548fa7ae9d46de78f5b75152e1a84b99ca9a7 100644 (file)
@@ -501,9 +501,8 @@ tfifo_dequeue:
 
                /* if more time remaining? */
                if (cb->time_to_send <= psched_get_time()) {
-                       skb = qdisc_dequeue_tail(sch);
-                       if (unlikely(!skb))
-                               goto qdisc_dequeue;
+                       __skb_unlink(skb, &sch->q);
+                       sch->qstats.backlog -= qdisc_pkt_len(skb);
 
 #ifdef CONFIG_NET_CLS_ACT
                        /*
@@ -539,7 +538,6 @@ deliver:
                qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send);
        }
 
-qdisc_dequeue:
        if (q->qdisc) {
                skb = q->qdisc->ops->dequeue(q->qdisc);
                if (skb)
index 3c2776466d877325d63b1980b798b8b0f9d6f556..823e972149e5487fd09d974e9052c3a4d3d8214f 100755 (executable)
@@ -9,15 +9,10 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
 #    FLAGS="-ignore_unknown_options -very_quiet"
 #    OPTIONS=$*
 
-    if [ "$KBUILD_EXTMOD" = "" ] ; then
-        # Workaround for Coccinelle < 0.2.3
-        FLAGS="-I $srctree/include -very_quiet"
-        shift $(( $# - 1 ))
-        OPTIONS=$1
-    else
-       echo M= is not currently supported when C=1 or C=2
-       exit 1
-    fi
+# Workaround for Coccinelle < 0.2.3
+       FLAGS="-I $srctree/include -very_quiet"
+       shift $(( $# - 1 ))
+       OPTIONS=$1
 else
     ONLINE=0
     FLAGS="-very_quiet"
index a272356859497fec41796a37e750c4dfc891827d..2ae4817031415a87af016a29fe9125bfccc82855 100755 (executable)
@@ -9,12 +9,6 @@ fi
 DEPMOD=$1
 KERNELRELEASE=$2
 
-if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then
-       echo "Warning: you may need to install module-init-tools" >&2
-       echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&2
-       sleep 1
-fi
-
 if ! test -r System.map -a -x "$DEPMOD"; then
        exit 0
 fi
index d0de2a2c3a2de00cacf74ba796f5b02fa5b56a5d..b89efe6e4c85adc59bc9f1c54e49fb1814778901 100644 (file)
@@ -46,11 +46,37 @@ struct devtable {
        void *function;
 };
 
+#define ___cat(a,b) a ## b
+#define __cat(a,b) ___cat(a,b)
+
+/* we need some special handling for this host tool running eventually on
+ * Darwin. The Mach-O section handling is a bit different than ELF section
+ * handling. The differnces in detail are:
+ *  a) we have segments which have sections
+ *  b) we need a API call to get the respective section symbols */
+#if defined(__MACH__)
+#include <mach-o/getsect.h>
+
+#define INIT_SECTION(name)  do {                                       \
+               unsigned long name ## _len;                             \
+               char *__cat(pstart_,name) = getsectdata("__TEXT",       \
+                       #name, &__cat(name,_len));                      \
+               char *__cat(pstop_,name) = __cat(pstart_,name) +        \
+                       __cat(name, _len);                              \
+               __cat(__start_,name) = (void *)__cat(pstart_,name);     \
+               __cat(__stop_,name) = (void *)__cat(pstop_,name);       \
+       } while (0)
+#define SECTION(name)   __attribute__((section("__TEXT, " #name)))
+
+struct devtable **__start___devtable, **__stop___devtable;
+#else
+#define INIT_SECTION(name) /* no-op for ELF */
+#define SECTION(name)   __attribute__((section(#name)))
+
 /* We construct a table of pointers in an ELF section (pointers generally
  * go unpadded by gcc).  ld creates boundary syms for us. */
 extern struct devtable *__start___devtable[], *__stop___devtable[];
-#define ___cat(a,b) a ## b
-#define __cat(a,b) ___cat(a,b)
+#endif /* __MACH__ */
 
 #if __GNUC__ == 3 && __GNUC_MINOR__ < 3
 # define __used                        __attribute__((__unused__))
@@ -65,8 +91,8 @@ extern struct devtable *__start___devtable[], *__stop___devtable[];
                                                (type *)NULL,           \
                                                (char *)NULL)),         \
                sizeof(type), (function) };                             \
-       static struct devtable *__attribute__((section("__devtable"))) \
-               __used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)
+       static struct devtable *SECTION(__devtable) __used \
+               __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)
 
 #define ADD(str, sep, cond, field)                              \
 do {                                                            \
@@ -1080,6 +1106,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
                do_pnp_card_entries(symval, sym->st_size, mod);
        else {
                struct devtable **p;
+               INIT_SECTION(__devtable);
 
                for (p = __start___devtable; p < __stop___devtable; p++) {
                        if (sym_is(name, namelen, (*p)->device_id)) {
index f6cbc3ddb68ba67bd5ecc0f34d77f2908d89a589..3c6c0b14c8073af178f83e238683b23f5e95e12b 100644 (file)
@@ -238,14 +238,14 @@ EOF
 fi
 
 # Build header package
-(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$)
-(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> /tmp/files$$)
-(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
+(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
+(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
+(cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
-(cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
-(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
-rm -f /tmp/files$$ /tmp/objfiles$$
+(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
+(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
+rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
 arch=$(dpkg --print-architecture)
 
 cat <<EOF >> debian/control
index 95ffa6a9db6e7412e3cca49ab6eb175d55b0983d..496f14c1a731e78071d30c814f6f0e08c143d85e 100644 (file)
@@ -2684,10 +2684,9 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
                if (err < 0)
                        goto out_err;
+               opl3->private_data = chip;
        }
 
-       opl3->private_data = chip;
-
        sprintf(card->longname, "%s at 0x%lx, irq %i",
                card->shortname, chip->ctrl_io, chip->irq);
 
index c2c65f63bf068a0d39fbfd271be81d74c22d0459..684307372d73e87535323ecc2e250a2ffab21f8e 100644 (file)
@@ -1759,7 +1759,11 @@ static void put_vol_mute(struct hda_codec *codec, struct hda_amp_info *info,
        parm = ch ? AC_AMP_SET_RIGHT : AC_AMP_SET_LEFT;
        parm |= direction == HDA_OUTPUT ? AC_AMP_SET_OUTPUT : AC_AMP_SET_INPUT;
        parm |= index << AC_AMP_SET_INDEX_SHIFT;
-       parm |= val;
+       if ((val & HDA_AMP_MUTE) && !(info->amp_caps & AC_AMPCAP_MUTE) &&
+           (info->amp_caps & AC_AMPCAP_MIN_MUTE))
+               ; /* set the zero value as a fake mute */
+       else
+               parm |= val;
        snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, parm);
        info->vol[ch] = val;
 }
@@ -2026,7 +2030,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
        val1 = -((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT);
        val1 += ofs;
        val1 = ((int)val1) * ((int)val2);
-       if (min_mute)
+       if (min_mute || (caps & AC_AMPCAP_MIN_MUTE))
                val2 |= TLV_DB_SCALE_MUTE;
        if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv))
                return -EFAULT;
@@ -5114,7 +5118,7 @@ static int fill_audio_out_name(struct hda_codec *codec, hda_nid_t nid,
        const char *pfx = "", *sfx = "";
 
        /* handle as a speaker if it's a fixed line-out */
-       if (!strcmp(name, "Line-Out") && attr == INPUT_PIN_ATTR_INT)
+       if (!strcmp(name, "Line Out") && attr == INPUT_PIN_ATTR_INT)
                name = "Speaker";
        /* check the location */
        switch (attr) {
@@ -5173,7 +5177,7 @@ int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid,
 
        switch (get_defcfg_device(def_conf)) {
        case AC_JACK_LINE_OUT:
-               return fill_audio_out_name(codec, nid, cfg, "Line-Out",
+               return fill_audio_out_name(codec, nid, cfg, "Line Out",
                                           label, maxlen, indexp);
        case AC_JACK_SPEAKER:
                return fill_audio_out_name(codec, nid, cfg, "Speaker",
index e9f71dc0d46415587f7461678d5ae6051aa9b289..f0f1943a4b2c890ce4affe17425de6210e53ea89 100644 (file)
@@ -298,6 +298,9 @@ enum {
 #define AC_AMPCAP_MUTE                 (1<<31)    /* mute capable */
 #define AC_AMPCAP_MUTE_SHIFT           31
 
+/* driver-specific amp-caps: using bits 24-30 */
+#define AC_AMPCAP_MIN_MUTE             (1 << 30) /* min-volume = mute */
+
 /* Connection list */
 #define AC_CLIST_LENGTH                        (0x7f<<0)
 #define AC_CLIST_LONG                  (1<<7)
index bc5a993d11461868a2115d5b81efec25114a9996..c83ccdba1e5afc1dca9715a870eedf68a8961ee8 100644 (file)
@@ -609,7 +609,7 @@ static int add_output(struct hda_codec *codec, hda_nid_t dac, int idx,
                "Front Speaker", "Surround Speaker", "Bass Speaker"
        };
        static const char * const line_outs[] = {
-               "Front Line-Out", "Surround Line-Out", "Bass Line-Out"
+               "Front Line Out", "Surround Line Out", "Bass Line Out"
        };
 
        fix_volume_caps(codec, dac);
@@ -635,7 +635,7 @@ static int add_output(struct hda_codec *codec, hda_nid_t dac, int idx,
                if (num_ctls > 1)
                        name = line_outs[idx];
                else
-                       name = "Line-Out";
+                       name = "Line Out";
                break;
        }
 
index a7a5733aa4d20d2ea25edf104e4568b4e42cab3d..d29d6d37790425924ce818acff4f6402f0fa8e82 100644 (file)
@@ -3482,7 +3482,7 @@ static int cx_automute_mode_info(struct snd_kcontrol *kcontrol,
                "Disabled", "Enabled"
        };
        static const char * const texts3[] = {
-               "Disabled", "Speaker Only", "Line-Out+Speaker"
+               "Disabled", "Speaker Only", "Line Out+Speaker"
        };
        const char * const *texts;
 
@@ -4079,7 +4079,8 @@ static int cx_auto_add_volume_idx(struct hda_codec *codec, const char *basename,
                err = snd_hda_ctl_add(codec, nid, kctl);
                if (err < 0)
                        return err;
-               if (!(query_amp_caps(codec, nid, hda_dir) & AC_AMPCAP_MUTE))
+               if (!(query_amp_caps(codec, nid, hda_dir) &
+                     (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)))
                        break;
        }
        return 0;
@@ -4379,6 +4380,22 @@ static const struct snd_pci_quirk cxt_fixups[] = {
        {}
 };
 
+/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches
+ * can be created (bko#42825)
+ */
+static void add_cx5051_fake_mutes(struct hda_codec *codec)
+{
+       static hda_nid_t out_nids[] = {
+               0x10, 0x11, 0
+       };
+       hda_nid_t *p;
+
+       for (p = out_nids; *p; p++)
+               snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT,
+                                         AC_AMPCAP_MIN_MUTE |
+                                         query_amp_caps(codec, *p, HDA_OUTPUT));
+}
+
 static int patch_conexant_auto(struct hda_codec *codec)
 {
        struct conexant_spec *spec;
@@ -4397,6 +4414,9 @@ static int patch_conexant_auto(struct hda_codec *codec)
        case 0x14f15045:
                spec->single_adc_amp = 1;
                break;
+       case 0x14f15051:
+               add_cx5051_fake_mutes(codec);
+               break;
        }
 
        apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl);
index 1358987c49d8ccf12367687608a63051a8bdc50e..f286bb8fda1375317589949af5da9a9605bea134 100644 (file)
@@ -80,6 +80,8 @@ enum {
        ALC_AUTOMUTE_MIXER,     /* mute/unmute mixer widget AMP */
 };
 
+#define MAX_VOL_NIDS   0x40
+
 struct alc_spec {
        /* codec parameterization */
        const struct snd_kcontrol_new *mixers[5];       /* mixer arrays */
@@ -118,8 +120,8 @@ struct alc_spec {
        const hda_nid_t *capsrc_nids;
        hda_nid_t dig_in_nid;           /* digital-in NID; optional */
        hda_nid_t mixer_nid;            /* analog-mixer NID */
-       DECLARE_BITMAP(vol_ctls, 0x20 << 1);
-       DECLARE_BITMAP(sw_ctls, 0x20 << 1);
+       DECLARE_BITMAP(vol_ctls, MAX_VOL_NIDS << 1);
+       DECLARE_BITMAP(sw_ctls, MAX_VOL_NIDS << 1);
 
        /* capture setup for dynamic dual-adc switch */
        hda_nid_t cur_adc;
@@ -800,7 +802,7 @@ static int alc_automute_mode_info(struct snd_kcontrol *kcontrol,
                "Disabled", "Enabled"
        };
        static const char * const texts3[] = {
-               "Disabled", "Speaker Only", "Line-Out+Speaker"
+               "Disabled", "Speaker Only", "Line Out+Speaker"
        };
        const char * const *texts;
 
@@ -1854,7 +1856,7 @@ static const char * const alc_slave_vols[] = {
        "Headphone Playback Volume",
        "Speaker Playback Volume",
        "Mono Playback Volume",
-       "Line-Out Playback Volume",
+       "Line Out Playback Volume",
        "CLFE Playback Volume",
        "Bass Speaker Playback Volume",
        "PCM Playback Volume",
@@ -1871,7 +1873,7 @@ static const char * const alc_slave_sws[] = {
        "Speaker Playback Switch",
        "Mono Playback Switch",
        "IEC958 Playback Switch",
-       "Line-Out Playback Switch",
+       "Line Out Playback Switch",
        "CLFE Playback Switch",
        "Bass Speaker Playback Switch",
        "PCM Playback Switch",
@@ -3149,7 +3151,10 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec)
 static inline unsigned int get_ctl_pos(unsigned int data)
 {
        hda_nid_t nid = get_amp_nid_(data);
-       unsigned int dir = get_amp_direction_(data);
+       unsigned int dir;
+       if (snd_BUG_ON(nid >= MAX_VOL_NIDS))
+               return 0;
+       dir = get_amp_direction_(data);
        return (nid << 1) | dir;
 }
 
@@ -3792,7 +3797,7 @@ static void alc_auto_init_input_src(struct hda_codec *codec)
        else
                nums = spec->num_adc_nids;
        for (c = 0; c < nums; c++)
-               alc_mux_select(codec, 0, spec->cur_mux[c], true);
+               alc_mux_select(codec, c, spec->cur_mux[c], true);
 }
 
 /* add mic boosts if needed */
@@ -4436,12 +4441,20 @@ static void alc889_fixup_dac_route(struct hda_codec *codec,
                                   const struct alc_fixup *fix, int action)
 {
        if (action == ALC_FIXUP_ACT_PRE_PROBE) {
+               /* fake the connections during parsing the tree */
                hda_nid_t conn1[2] = { 0x0c, 0x0d };
                hda_nid_t conn2[2] = { 0x0e, 0x0f };
                snd_hda_override_conn_list(codec, 0x14, 2, conn1);
                snd_hda_override_conn_list(codec, 0x15, 2, conn1);
                snd_hda_override_conn_list(codec, 0x18, 2, conn2);
                snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
+       } else if (action == ALC_FIXUP_ACT_PROBE) {
+               /* restore the connections */
+               hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
+               snd_hda_override_conn_list(codec, 0x14, 5, conn);
+               snd_hda_override_conn_list(codec, 0x15, 5, conn);
+               snd_hda_override_conn_list(codec, 0x18, 5, conn);
+               snd_hda_override_conn_list(codec, 0x1a, 5, conn);
        }
 }
 
index 6345df131a005a7202b696ccea02fb5dbfeb0898..9dbb5735d778692c81f0010311b2958309a9fa43 100644 (file)
@@ -4629,7 +4629,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec)
                unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN;
                if (no_hp_sensing(spec, i))
                        continue;
-               if (presence)
+               if (1 /*presence*/)
                        stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
 #if 0 /* FIXME */
 /* Resetting the pinctl like below may lead to (a sort of) regressions
index 5ef70b5d27e4eae85f6e4e1a1c310ea273e0eb60..278c0a0575f5596b5fe4249759c34202a3b02be5 100644 (file)
@@ -146,13 +146,10 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
 
        SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC,
                         0, 0xFF, 1, out_tlv),
-
-       SOC_SINGLE("Headphone Switch", PW_MGMT2, 6, 1, 0),
 };
 
-static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = {
-       SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0),
-};
+static const struct snd_kcontrol_new ak4642_headphone_control =
+       SOC_DAPM_SINGLE("Switch", PW_MGMT2, 6, 1, 0);
 
 static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = {
        SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0),
@@ -165,13 +162,12 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
        SND_SOC_DAPM_OUTPUT("HPOUTR"),
        SND_SOC_DAPM_OUTPUT("LINEOUT"),
 
-       SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0,
-                          &ak4642_hpout_mixer_controls[0],
-                          ARRAY_SIZE(ak4642_hpout_mixer_controls)),
+       SND_SOC_DAPM_PGA("HPL Out", PW_MGMT2, 5, 0, NULL, 0),
+       SND_SOC_DAPM_PGA("HPR Out", PW_MGMT2, 4, 0, NULL, 0),
+       SND_SOC_DAPM_SWITCH("Headphone Enable", SND_SOC_NOPM, 0, 0,
+                           &ak4642_headphone_control),
 
-       SND_SOC_DAPM_MIXER("HPOUTR Mixer", PW_MGMT2, 4, 0,
-                          &ak4642_hpout_mixer_controls[0],
-                          ARRAY_SIZE(ak4642_hpout_mixer_controls)),
+       SND_SOC_DAPM_PGA("DACH", MD_CTL4, 0, 0, NULL, 0),
 
        SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0,
                           &ak4642_lout_mixer_controls[0],
@@ -184,12 +180,17 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
 static const struct snd_soc_dapm_route ak4642_intercon[] = {
 
        /* Outputs */
-       {"HPOUTL", NULL, "HPOUTL Mixer"},
-       {"HPOUTR", NULL, "HPOUTR Mixer"},
+       {"HPOUTL", NULL, "HPL Out"},
+       {"HPOUTR", NULL, "HPR Out"},
        {"LINEOUT", NULL, "LINEOUT Mixer"},
 
-       {"HPOUTL Mixer", "DACH", "DAC"},
-       {"HPOUTR Mixer", "DACH", "DAC"},
+       {"HPL Out", NULL, "Headphone Enable"},
+       {"HPR Out", NULL, "Headphone Enable"},
+
+       {"Headphone Enable", "Switch", "DACH"},
+
+       {"DACH", NULL, "DAC"},
+
        {"LINEOUT Mixer", "DACL", "DAC"},
 };
 
index 29c4b02c4790681743ba82e6e3c3d6d87c558b8e..0ac228b7dc049a8d584b7219e3fa844262af3769 100644 (file)
@@ -2564,7 +2564,7 @@ static int dsp2_event(struct snd_soc_dapm_widget *w,
        return 0;
 }
 
-static const char *st_text[] = { "None", "Right", "Left" };
+static const char *st_text[] = { "None", "Left", "Right" };
 
 static const struct soc_enum str_enum =
        SOC_ENUM_SINGLE(WM8962_DAC_DSP_MIXING_1, 2, 3, st_text);
index 01d1f749cf021908ead5cb27e30966a17f144ca6..b6adbed6e506c1585503dff1355b46d4afbaa4cf 100644 (file)
@@ -112,7 +112,7 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
                break;
        case SND_SOC_DAIFMT_DSP_A:
                /* data on rising edge of bclk, frame high 1clk before data */
-               strcr |= SSI_STCR_TFSL | SSI_STCR_TEFS;
+               strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;
                break;
        }
 
index 1f55ded4047f03b9a538af971c01018f0fb5df10..1315663c1c0990787f226c8358700bce5e0d7963 100644 (file)
@@ -3068,9 +3068,13 @@ static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
         * standby.
         */
        if (powerdown) {
-               snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_PREPARE);
+               if (dapm->bias_level == SND_SOC_BIAS_ON)
+                       snd_soc_dapm_set_bias_level(dapm,
+                                                   SND_SOC_BIAS_PREPARE);
                dapm_seq_run(dapm, &down_list, 0, false);
-               snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_STANDBY);
+               if (dapm->bias_level == SND_SOC_BIAS_PREPARE)
+                       snd_soc_dapm_set_bias_level(dapm,
+                                                   SND_SOC_BIAS_STANDBY);
        }
 }
 
@@ -3083,7 +3087,9 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card)
 
        list_for_each_entry(codec, &card->codec_dev_list, list) {
                soc_dapm_shutdown_codec(&codec->dapm);
-               snd_soc_dapm_set_bias_level(&codec->dapm, SND_SOC_BIAS_OFF);
+               if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY)
+                       snd_soc_dapm_set_bias_level(&codec->dapm,
+                                                   SND_SOC_BIAS_OFF);
        }
 }
 
index 2cf87f5afed4e2fbc93cdcdf4d72277b8afae52f..fde9a7a29cb6e670ba2d58e49b8b9e39a5cd7f15 100644 (file)
@@ -311,8 +311,10 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub)
 
        spin_lock(&dev->spinlock);
 
-       if (dev->input_panic || dev->output_panic)
+       if (dev->input_panic || dev->output_panic) {
                ptr = SNDRV_PCM_POS_XRUN;
+               goto unlock;
+       }
 
        if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
                ptr = bytes_to_frames(sub->runtime,
@@ -321,6 +323,7 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub)
                ptr = bytes_to_frames(sub->runtime,
                                        dev->audio_in_buf_pos[index]);
 
+unlock:
        spin_unlock(&dev->spinlock);
        return ptr;
 }
index a39edcc32a93f0986c87498de66ca37206b38915..da5fa1ac4edaf3608c7811dea5194b98a8bab37c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __USBAUDIO_CARD_H
 #define __USBAUDIO_CARD_H
 
+#define MAX_NR_RATES   1024
 #define MAX_PACKS      20
 #define MAX_PACKS_HS   (MAX_PACKS * 8) /* in high speed mode */
 #define MAX_URBS       8
index e09aba19375cf938eafd28aedec9edf2ea55dbbe..ddfef57c4c9fbe93c9551de6af2959051bba4c21 100644 (file)
@@ -209,8 +209,6 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
        return 0;
 }
 
-#define MAX_UAC2_NR_RATES 1024
-
 /*
  * Helper function to walk the array of sample rate triplets reported by
  * the device. The problem is that we need to parse whole array first to
@@ -255,7 +253,7 @@ static int parse_uac2_sample_rate_range(struct audioformat *fp, int nr_triplets,
                        fp->rates |= snd_pcm_rate_to_rate_bit(rate);
 
                        nr_rates++;
-                       if (nr_rates >= MAX_UAC2_NR_RATES) {
+                       if (nr_rates >= MAX_NR_RATES) {
                                snd_printk(KERN_ERR "invalid uac2 rates\n");
                                break;
                        }
index a3ddac0deffd1eba937932a55553466f32308065..27817266867ae2c17b09f4ea85b6522a9d39e4ea 100644 (file)
@@ -132,10 +132,14 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
        unsigned *rate_table = NULL;
 
        fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL);
-       if (! fp) {
+       if (!fp) {
                snd_printk(KERN_ERR "cannot memdup\n");
                return -ENOMEM;
        }
+       if (fp->nr_rates > MAX_NR_RATES) {
+               kfree(fp);
+               return -EINVAL;
+       }
        if (fp->nr_rates > 0) {
                rate_table = kmemdup(fp->rate_table,
                                     sizeof(int) * fp->nr_rates, GFP_KERNEL);
index 0abfb18b911fb93f022f0e6ac1e7b4dda4fb1e4d..227b6ae99785118066a7184cc4cb66f27d38c841 100644 (file)
@@ -204,6 +204,9 @@ static void perf_record__open(struct perf_record *rec)
 
                if (opts->group && pos != first)
                        group_fd = first->fd;
+fallback_missing_features:
+               if (opts->exclude_guest_missing)
+                       attr->exclude_guest = attr->exclude_host = 0;
 retry_sample_id:
                attr->sample_id_all = opts->sample_id_all_avail ? 1 : 0;
 try_again:
@@ -217,15 +220,23 @@ try_again:
                        } else if (err ==  ENODEV && opts->cpu_list) {
                                die("No such device - did you specify"
                                        " an out-of-range profile CPU?\n");
-                       } else if (err == EINVAL && opts->sample_id_all_avail) {
-                               /*
-                                * Old kernel, no attr->sample_id_type_all field
-                                */
-                               opts->sample_id_all_avail = false;
-                               if (!opts->sample_time && !opts->raw_samples && !time_needed)
-                                       attr->sample_type &= ~PERF_SAMPLE_TIME;
-
-                               goto retry_sample_id;
+                       } else if (err == EINVAL) {
+                               if (!opts->exclude_guest_missing &&
+                                   (attr->exclude_guest || attr->exclude_host)) {
+                                       pr_debug("Old kernel, cannot exclude "
+                                                "guest or host samples.\n");
+                                       opts->exclude_guest_missing = true;
+                                       goto fallback_missing_features;
+                               } else if (opts->sample_id_all_avail) {
+                                       /*
+                                        * Old kernel, no attr->sample_id_type_all field
+                                        */
+                                       opts->sample_id_all_avail = false;
+                                       if (!opts->sample_time && !opts->raw_samples && !time_needed)
+                                               attr->sample_type &= ~PERF_SAMPLE_TIME;
+
+                                       goto retry_sample_id;
+                               }
                        }
 
                        /*
@@ -503,9 +514,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
                        return err;
        }
 
-       if (!!rec->no_buildid
+       if (!rec->no_buildid
            && !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
-               pr_err("Couldn't generating buildids. "
+               pr_err("Couldn't generate buildids. "
                       "Use --no-buildid to profile anyway.\n");
                return -1;
        }
index dd162aa24baad2f44c5cbb1b4176fb2b2cc7b26d..ecff31257eb3771cf9db12acc49065e40e2c4d18 100644 (file)
@@ -857,6 +857,9 @@ static void perf_top__start_counters(struct perf_top *top)
                attr->mmap = 1;
                attr->comm = 1;
                attr->inherit = top->inherit;
+fallback_missing_features:
+               if (top->exclude_guest_missing)
+                       attr->exclude_guest = attr->exclude_host = 0;
 retry_sample_id:
                attr->sample_id_all = top->sample_id_all_avail ? 1 : 0;
 try_again:
@@ -868,12 +871,20 @@ try_again:
                        if (err == EPERM || err == EACCES) {
                                ui__error_paranoid();
                                goto out_err;
-                       } else if (err == EINVAL && top->sample_id_all_avail) {
-                               /*
-                                * Old kernel, no attr->sample_id_type_all field
-                                */
-                               top->sample_id_all_avail = false;
-                               goto retry_sample_id;
+                       } else if (err == EINVAL) {
+                               if (!top->exclude_guest_missing &&
+                                   (attr->exclude_guest || attr->exclude_host)) {
+                                       pr_debug("Old kernel, cannot exclude "
+                                                "guest or host samples.\n");
+                                       top->exclude_guest_missing = true;
+                                       goto fallback_missing_features;
+                               } else if (top->sample_id_all_avail) {
+                                       /*
+                                        * Old kernel, no attr->sample_id_type_all field
+                                        */
+                                       top->sample_id_all_avail = false;
+                                       goto retry_sample_id;
+                               }
                        }
                        /*
                         * If it's cycles then fall back to hrtimer
index 64f8bee31ced8d7eb3586788e4a69f872c33e57a..16e7d20eee8321110797f9f77c928c1e15e013ea 100644 (file)
@@ -199,6 +199,7 @@ struct perf_record_opts {
        bool         sample_address;
        bool         sample_time;
        bool         sample_id_all_avail;
+       bool         exclude_guest_missing;
        bool         system_wide;
        bool         period;
        unsigned int freq;
index 2044324b755a51bc9b41536957dce8b35a11a6fd..2a6f33cd888ca7d7e9dbe7d27f6999a552dec7f1 100644 (file)
@@ -74,6 +74,7 @@ static pid_t perf_event__get_comm_tgid(pid_t pid, char *comm, size_t len)
                        if (size >= len)
                                size = len - 1;
                        memcpy(comm, name, size);
+                       comm[size] = '\0';
 
                } else if (memcmp(bf, "Tgid:", 5) == 0) {
                        char *tgids = bf + 5;
index 3f16e08a5c8de740a3149879274dd69af720c97e..ea32a061f1c88e9ee4cf63d9019dc50451a43e0a 100644 (file)
@@ -349,6 +349,10 @@ struct perf_evsel *perf_evlist__id2evsel(struct perf_evlist *evlist, u64 id)
        hlist_for_each_entry(sid, pos, head, node)
                if (sid->id == id)
                        return sid->evsel;
+
+       if (!perf_evlist__sample_id_all(evlist))
+               return list_entry(evlist->entries.next, struct perf_evsel, node);
+
        return NULL;
 }
 
index 29cb654598113a66729a17b9bd00ff21da8c52d8..e33554a562b36fb59c95d935258d525a0e810dac 100644 (file)
@@ -1867,6 +1867,12 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
                           tev->point.symbol);
                ret = -ENOENT;
                goto error;
+       } else if (tev->point.offset > sym->end - sym->start) {
+               pr_warning("Offset specified is greater than size of %s\n",
+                          tev->point.symbol);
+               ret = -ENOENT;
+               goto error;
+
        }
 
        return 1;
index 5d732621a462f31a57d9aa966fe80e23edacf4b8..74bd2e63c4b4a7458989a08cc731c15edfb99c98 100644 (file)
@@ -672,7 +672,7 @@ static int find_variable(Dwarf_Die *sc_die, struct probe_finder *pf)
 static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,
                                  bool retprobe, struct probe_trace_point *tp)
 {
-       Dwarf_Addr eaddr;
+       Dwarf_Addr eaddr, highaddr;
        const char *name;
 
        /* Copy the name of probe point */
@@ -683,6 +683,16 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,
                                   dwarf_diename(sp_die));
                        return -ENOENT;
                }
+               if (dwarf_highpc(sp_die, &highaddr) != 0) {
+                       pr_warning("Failed to get end address of %s\n",
+                                  dwarf_diename(sp_die));
+                       return -ENOENT;
+               }
+               if (paddr > highaddr) {
+                       pr_warning("Offset specified is greater than size of %s\n",
+                                  dwarf_diename(sp_die));
+                       return -EINVAL;
+               }
                tp->symbol = strdup(name);
                if (tp->symbol == NULL)
                        return -ENOMEM;
index a248f3c2c60d9bb730f5603e1b87fcb04160cb6a..f2eab81435ae1b4bf3ffaaedb3734e7e953b492b 100644 (file)
@@ -34,6 +34,7 @@ struct perf_top {
        bool               inherit;
        bool               group;
        bool               sample_id_all_avail;
+       bool               exclude_guest_missing;
        bool               dump_symtab;
        const char         *cpu_list;
        struct hist_entry  *sym_filter_entry;
index 813141047fc22fcfd61ae377444f7ff2a97f06eb..fb25d132921882c3b432ece1bc07bd2700800bc2 100644 (file)
@@ -6,7 +6,7 @@
  * XXX We need to find a better place for these things...
  */
 bool perf_host  = true;
-bool perf_guest = true;
+bool perf_guest = false;
 
 void event_attr_init(struct perf_event_attr *attr)
 {
index 62a134dc421ae37d14307a44f09abc9c0d0c197a..9507c4b251a8e370ae5419ff38f51b9f6ea8d5a0 100755 (executable)
@@ -3244,9 +3244,11 @@ sub make_min_config {
        $in_bisect = 1;
 
        my $failed = 0;
-       build "oldconfig";
-       start_monitor_and_boot or $failed = 1;
-       end_monitor;
+       build "oldconfig" or $failed = 1;
+       if (!$failed) {
+               start_monitor_and_boot or $failed = 1;
+               end_monitor;
+       }
 
        $in_bisect = 0;