]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'asoc/topic/jz4740', 'asoc/topic/kirkwood', 'asoc...
authorMark Brown <broonie@kernel.org>
Wed, 23 Sep 2015 18:01:22 +0000 (11:01 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 23 Sep 2015 18:01:22 +0000 (11:01 -0700)
520 files changed:
Documentation/devicetree/bindings/sound/ak4613.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/ak4642.txt
Documentation/gpio/board.txt
Documentation/gpio/consumer.txt
Documentation/hwmon/nct6775
Documentation/static-keys.txt
MAINTAINERS
Makefile
arch/alpha/include/asm/io.h
arch/alpha/kernel/irq.c
arch/alpha/lib/udelay.c
arch/arc/kernel/mcip.c
arch/arm/Makefile
arch/arm/common/it8152.c
arch/arm/common/locomo.c
arch/arm/common/sa1111.c
arch/arm/include/asm/assembler.h
arch/arm/include/asm/bug.h
arch/arm/include/asm/domain.h
arch/arm/include/asm/hardware/it8152.h
arch/arm/include/asm/hw_irq.h
arch/arm/include/asm/kvm_host.h
arch/arm/include/asm/mach/irq.h
arch/arm/include/asm/thread_info.h
arch/arm/kernel/irq.c
arch/arm/kernel/kgdb.c
arch/arm/kernel/process.c
arch/arm/kernel/signal.c
arch/arm/kvm/Kconfig
arch/arm/kvm/arm.c
arch/arm/kvm/interrupts_head.S
arch/arm/kvm/mmu.c
arch/arm/kvm/psci.c
arch/arm/mach-dove/irq.c
arch/arm/mach-footbridge/isa-irq.c
arch/arm/mach-gemini/gpio.c
arch/arm/mach-imx/3ds_debugboard.c
arch/arm/mach-imx/mach-mx31ads.c
arch/arm/mach-iop13xx/msi.c
arch/arm/mach-lpc32xx/irq.c
arch/arm/mach-netx/generic.c
arch/arm/mach-omap1/fpga.c
arch/arm/mach-omap2/prm_common.c
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/cm-x2xx-pci.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/viper.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-rpc/ecard.c
arch/arm/mach-s3c24xx/bast-irq.c
arch/arm/mach-s3c64xx/common.c
arch/arm/mach-sa1100/neponset.c
arch/arm/mm/dma-mapping.c
arch/arm/nwfpe/entry.S
arch/arm/plat-orion/gpio.c
arch/arm/xen/hypercall.S
arch/arm64/Kconfig
arch/arm64/Makefile
arch/arm64/include/asm/hardirq.h
arch/arm64/include/asm/kvm_arm.h
arch/arm64/include/asm/kvm_asm.h
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/pgtable.h
arch/arm64/kernel/debug-monitors.c
arch/arm64/kernel/head.S
arch/arm64/kernel/hw_breakpoint.c
arch/arm64/kernel/module.c
arch/arm64/kernel/signal32.c
arch/arm64/kvm/Kconfig
arch/arm64/kvm/hyp.S
arch/arm64/kvm/sys_regs.c
arch/arm64/mm/dma-mapping.c
arch/avr32/mach-at32ap/extint.c
arch/avr32/mach-at32ap/pio.c
arch/blackfin/include/asm/irq_handler.h
arch/blackfin/kernel/irqchip.c
arch/blackfin/mach-bf537/ints-priority.c
arch/blackfin/mach-common/ints-priority.c
arch/c6x/platforms/megamod-pic.c
arch/ia64/include/asm/unistd.h
arch/ia64/include/uapi/asm/unistd.h
arch/ia64/kernel/entry.S
arch/m68k/amiga/amiints.c
arch/m68k/coldfire/intc-5272.c
arch/m68k/include/asm/irq.h
arch/m68k/include/asm/mac_via.h
arch/m68k/mac/baboon.c
arch/m68k/mac/oss.c
arch/m68k/mac/psc.c
arch/m68k/mac/via.c
arch/metag/kernel/irq.c
arch/mips/alchemy/common/irq.c
arch/mips/alchemy/devboards/bcsr.c
arch/mips/ath25/ar2315.c
arch/mips/ath25/ar5312.c
arch/mips/ath79/irq.c
arch/mips/cavium-octeon/octeon-irq.c
arch/mips/include/asm/kvm_host.h
arch/mips/include/asm/netlogic/common.h
arch/mips/jz4740/gpio.c
arch/mips/kvm/mips.c
arch/mips/netlogic/common/smp.c
arch/mips/pci/pci-ar2315.c
arch/mips/pci/pci-ar71xx.c
arch/mips/pci/pci-ar724x.c
arch/mips/pci/pci-rt3883.c
arch/mips/ralink/irq.c
arch/powerpc/boot/Makefile
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/include/asm/qe_ic.h
arch/powerpc/include/asm/systbl.h
arch/powerpc/include/asm/tsi108_pci.h
arch/powerpc/include/asm/unistd.h
arch/powerpc/include/uapi/asm/unistd.h
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kvm/book3s.c
arch/powerpc/kvm/booke.c
arch/powerpc/lib/copy_32.S
arch/powerpc/mm/hugepage-hash64.c
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
arch/powerpc/platforms/52xx/media5200.c
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
arch/powerpc/platforms/52xx/mpc52xx_pic.c
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
arch/powerpc/platforms/85xx/common.c
arch/powerpc/platforms/85xx/mpc85xx_cds.c
arch/powerpc/platforms/85xx/mpc85xx_ds.c
arch/powerpc/platforms/85xx/socrates_fpga_pic.c
arch/powerpc/platforms/86xx/pic.c
arch/powerpc/platforms/8xx/m8xx_setup.c
arch/powerpc/platforms/cell/axon_msi.c
arch/powerpc/platforms/cell/interrupt.c
arch/powerpc/platforms/cell/spider-pic.c
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/embedded6xx/hlwd-pic.c
arch/powerpc/platforms/embedded6xx/mvme5100.c
arch/powerpc/platforms/pasemi/msi.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/pseries/dlpar.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/sysdev/cpm2_pic.c
arch/powerpc/sysdev/fsl_msi.c
arch/powerpc/sysdev/ge/ge_pic.c
arch/powerpc/sysdev/ge/ge_pic.h
arch/powerpc/sysdev/ipic.c
arch/powerpc/sysdev/mpc8xx_pic.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/mpic_u3msi.c
arch/powerpc/sysdev/ppc4xx_msi.c
arch/powerpc/sysdev/qe_lib/qe_ic.c
arch/powerpc/sysdev/tsi108_pci.c
arch/powerpc/sysdev/uic.c
arch/powerpc/sysdev/xics/ics-opal.c
arch/powerpc/sysdev/xics/ics-rtas.c
arch/powerpc/sysdev/xilinx_intc.c
arch/s390/include/asm/kvm_host.h
arch/s390/kvm/kvm-s390.c
arch/sh/boards/mach-se/7343/irq.c
arch/sh/boards/mach-se/7722/irq.c
arch/sh/boards/mach-se/7724/irq.c
arch/sh/boards/mach-x3proto/gpio.c
arch/sh/cchips/hd6446x/hd64461.c
arch/sparc/kernel/leon_kernel.c
arch/sparc/kernel/leon_pci_grpci1.c
arch/sparc/kernel/leon_pci_grpci2.c
arch/tile/kernel/pci_gx.c
arch/unicore32/kernel/irq.c
arch/x86/Kconfig
arch/x86/include/asm/cpufeature.h
arch/x86/include/asm/kvm_host.h
arch/x86/include/asm/paravirt_types.h
arch/x86/include/asm/qspinlock.h
arch/x86/kernel/alternative.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/apic/vector.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/perf_event_intel.c
arch/x86/kernel/cpu/perf_event_intel_bts.c
arch/x86/kernel/irq_32.c
arch/x86/kernel/irq_64.c
arch/x86/kernel/ldt.c
arch/x86/kernel/pci-dma.c
arch/x86/kernel/tsc.c
arch/x86/kernel/vm86_32.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c
arch/x86/lguest/boot.c
arch/x86/mm/srat.c
block/bio-integrity.c
block/blk-cgroup.c
block/blk-integrity.c
block/blk-map.c
block/blk-merge.c
block/bounce.c
crypto/testmgr.c
drivers/acpi/bus.c
drivers/acpi/int340x_thermal.c
drivers/base/platform-msi.c
drivers/block/null_blk.c
drivers/block/zram/zcomp.c
drivers/clk/clk.c
drivers/clk/h8300/clk-h8s2678.c
drivers/clk/hisilicon/Kconfig
drivers/clk/hisilicon/Makefile
drivers/clk/rockchip/clk-rk3188.c
drivers/clk/rockchip/clk-rk3368.c
drivers/clk/st/clkgen-fsyn.c
drivers/clk/st/clkgen-pll.c
drivers/clk/tegra/clk-dfll.c
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/cpufreq.c
drivers/crypto/Kconfig
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
drivers/devfreq/devfreq.c
drivers/devfreq/event/exynos-ppmu.c
drivers/devfreq/governor_simpleondemand.c
drivers/devfreq/tegra-devfreq.c
drivers/dma/ipu/ipu_irq.c
drivers/gpio/Kconfig
drivers/gpio/gpio-altera.c
drivers/gpio/gpio-bcm-kona.c
drivers/gpio/gpio-brcmstb.c
drivers/gpio/gpio-davinci.c
drivers/gpio/gpio-dwapb.c
drivers/gpio/gpio-ep93xx.c
drivers/gpio/gpio-intel-mid.c
drivers/gpio/gpio-lynxpoint.c
drivers/gpio/gpio-mpc8xxx.c
drivers/gpio/gpio-msic.c
drivers/gpio/gpio-msm-v2.c
drivers/gpio/gpio-mvebu.c
drivers/gpio/gpio-mxc.c
drivers/gpio/gpio-mxs.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-pl061.c
drivers/gpio/gpio-pxa.c
drivers/gpio/gpio-sa1100.c
drivers/gpio/gpio-sx150x.c
drivers/gpio/gpio-tegra.c
drivers/gpio/gpio-timberdale.c
drivers/gpio/gpio-tz1090.c
drivers/gpio/gpio-vf610.c
drivers/gpio/gpio-zx.c
drivers/gpio/gpio-zynq.c
drivers/gpio/gpiolib.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c
drivers/gpu/ipu-v3/ipu-common.c
drivers/hwmon/Kconfig
drivers/hwmon/nct6775.c
drivers/infiniband/Kconfig
drivers/infiniband/hw/Makefile
drivers/irqchip/exynos-combiner.c
drivers/irqchip/irq-armada-370-xp.c
drivers/irqchip/irq-bcm2835.c
drivers/irqchip/irq-bcm7038-l1.c
drivers/irqchip/irq-bcm7120-l2.c
drivers/irqchip/irq-brcmstb-l2.c
drivers/irqchip/irq-clps711x.c
drivers/irqchip/irq-dw-apb-ictl.c
drivers/irqchip/irq-gic-v2m.c
drivers/irqchip/irq-gic-v3-its.c
drivers/irqchip/irq-gic-v3.c
drivers/irqchip/irq-gic.c
drivers/irqchip/irq-hip04.c
drivers/irqchip/irq-i8259.c
drivers/irqchip/irq-imgpdc.c
drivers/irqchip/irq-keystone.c
drivers/irqchip/irq-metag-ext.c
drivers/irqchip/irq-metag.c
drivers/irqchip/irq-mips-gic.c
drivers/irqchip/irq-mmp.c
drivers/irqchip/irq-mxs.c
drivers/irqchip/irq-orion.c
drivers/irqchip/irq-renesas-intc-irqpin.c
drivers/irqchip/irq-renesas-irqc.c
drivers/irqchip/irq-s3c24xx.c
drivers/irqchip/irq-sun4i.c
drivers/irqchip/irq-sunxi-nmi.c
drivers/irqchip/irq-tb10x.c
drivers/irqchip/irq-versatile-fpga.c
drivers/irqchip/irq-vic.c
drivers/irqchip/irq-vt8500.c
drivers/irqchip/spear-shirq.c
drivers/leds/Kconfig
drivers/leds/leds-aat1290.c
drivers/leds/leds-bcm6328.c
drivers/leds/leds-bcm6358.c
drivers/leds/leds-ktd2692.c
drivers/leds/leds-max77693.c
drivers/leds/leds-ns2.c
drivers/mfd/asic3.c
drivers/mfd/ezx-pcap.c
drivers/mfd/htc-egpio.c
drivers/mfd/jz4740-adc.c
drivers/mfd/pm8921-core.c
drivers/mfd/t7l66xb.c
drivers/mfd/tc6393xb.c
drivers/mfd/ucb1x00-core.c
drivers/misc/cxl/Makefile
drivers/misc/cxl/pci.c
drivers/misc/cxl/vphb.c
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/nvdimm/btt_devs.c
drivers/nvdimm/pfn_devs.c
drivers/nvdimm/pmem.c
drivers/pci/host/pci-keystone.c
drivers/pci/host/pci-xgene-msi.c
drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c
drivers/pinctrl/core.c
drivers/pinctrl/intel/pinctrl-baytrail.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/pinctrl/intel/pinctrl-intel.c
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
drivers/pinctrl/nomadik/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-adi2.c
drivers/pinctrl/pinctrl-amd.c
drivers/pinctrl/pinctrl-at91.c
drivers/pinctrl/pinctrl-coh901.c
drivers/pinctrl/pinctrl-digicolor.c
drivers/pinctrl/pinctrl-pistachio.c
drivers/pinctrl/pinctrl-rockchip.c
drivers/pinctrl/pinctrl-single.c
drivers/pinctrl/pinctrl-st.c
drivers/pinctrl/pinmux.c
drivers/pinctrl/qcom/pinctrl-msm.c
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
drivers/pinctrl/samsung/pinctrl-exynos.c
drivers/pinctrl/samsung/pinctrl-s3c24xx.c
drivers/pinctrl/samsung/pinctrl-s3c64xx.c
drivers/pinctrl/sirf/pinctrl-atlas7.c
drivers/pinctrl/sirf/pinctrl-sirf.c
drivers/pinctrl/spear/pinctrl-plgpio.c
drivers/pinctrl/sunxi/pinctrl-sunxi.c
drivers/platform/x86/asus-nb-wmi.c
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/toshiba_acpi.c
drivers/platform/x86/wmi.c
drivers/power/twl4030_charger.c
drivers/s390/virtio/virtio_ccw.c
drivers/sh/intc/core.c
drivers/sh/intc/internals.h
drivers/sh/intc/virq.c
drivers/soc/dove/pmu.c
drivers/spi/spi-atmel.c
drivers/spmi/spmi-pmic-arb.c
drivers/staging/rdma/Kconfig
drivers/staging/rdma/Makefile
drivers/staging/rdma/ehca/Kconfig [moved from drivers/infiniband/hw/ehca/Kconfig with 69% similarity]
drivers/staging/rdma/ehca/Makefile [moved from drivers/infiniband/hw/ehca/Makefile with 100% similarity]
drivers/staging/rdma/ehca/TODO [new file with mode: 0644]
drivers/staging/rdma/ehca/ehca_av.c [moved from drivers/infiniband/hw/ehca/ehca_av.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_classes.h [moved from drivers/infiniband/hw/ehca/ehca_classes.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_classes_pSeries.h [moved from drivers/infiniband/hw/ehca/ehca_classes_pSeries.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_cq.c [moved from drivers/infiniband/hw/ehca/ehca_cq.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_eq.c [moved from drivers/infiniband/hw/ehca/ehca_eq.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_hca.c [moved from drivers/infiniband/hw/ehca/ehca_hca.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_irq.c [moved from drivers/infiniband/hw/ehca/ehca_irq.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_irq.h [moved from drivers/infiniband/hw/ehca/ehca_irq.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_iverbs.h [moved from drivers/infiniband/hw/ehca/ehca_iverbs.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_main.c [moved from drivers/infiniband/hw/ehca/ehca_main.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_mcast.c [moved from drivers/infiniband/hw/ehca/ehca_mcast.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_mrmw.c [moved from drivers/infiniband/hw/ehca/ehca_mrmw.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_mrmw.h [moved from drivers/infiniband/hw/ehca/ehca_mrmw.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_pd.c [moved from drivers/infiniband/hw/ehca/ehca_pd.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_qes.h [moved from drivers/infiniband/hw/ehca/ehca_qes.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_qp.c [moved from drivers/infiniband/hw/ehca/ehca_qp.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_reqs.c [moved from drivers/infiniband/hw/ehca/ehca_reqs.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_sqp.c [moved from drivers/infiniband/hw/ehca/ehca_sqp.c with 100% similarity]
drivers/staging/rdma/ehca/ehca_tools.h [moved from drivers/infiniband/hw/ehca/ehca_tools.h with 100% similarity]
drivers/staging/rdma/ehca/ehca_uverbs.c [moved from drivers/infiniband/hw/ehca/ehca_uverbs.c with 100% similarity]
drivers/staging/rdma/ehca/hcp_if.c [moved from drivers/infiniband/hw/ehca/hcp_if.c with 100% similarity]
drivers/staging/rdma/ehca/hcp_if.h [moved from drivers/infiniband/hw/ehca/hcp_if.h with 100% similarity]
drivers/staging/rdma/ehca/hcp_phyp.c [moved from drivers/infiniband/hw/ehca/hcp_phyp.c with 100% similarity]
drivers/staging/rdma/ehca/hcp_phyp.h [moved from drivers/infiniband/hw/ehca/hcp_phyp.h with 100% similarity]
drivers/staging/rdma/ehca/hipz_fns.h [moved from drivers/infiniband/hw/ehca/hipz_fns.h with 100% similarity]
drivers/staging/rdma/ehca/hipz_fns_core.h [moved from drivers/infiniband/hw/ehca/hipz_fns_core.h with 100% similarity]
drivers/staging/rdma/ehca/hipz_hw.h [moved from drivers/infiniband/hw/ehca/hipz_hw.h with 100% similarity]
drivers/staging/rdma/ehca/ipz_pt_fn.c [moved from drivers/infiniband/hw/ehca/ipz_pt_fn.c with 100% similarity]
drivers/staging/rdma/ehca/ipz_pt_fn.h [moved from drivers/infiniband/hw/ehca/ipz_pt_fn.h with 100% similarity]
drivers/staging/rdma/hfi1/chip.c
drivers/staging/rdma/hfi1/device.c
drivers/staging/rdma/hfi1/device.h
drivers/staging/rdma/hfi1/diag.c
drivers/staging/rdma/hfi1/file_ops.c
drivers/staging/rdma/hfi1/mad.c
drivers/staging/rdma/hfi1/sdma.c
drivers/staging/rdma/hfi1/sdma.h
drivers/staging/rdma/hfi1/verbs.c
drivers/vhost/net.c
drivers/vhost/scsi.c
drivers/vhost/test.c
drivers/vhost/vhost.h
fs/block_dev.c
fs/cifs/cifsfs.c
fs/cifs/ioctl.c
fs/dax.c
fs/fs-writeback.c
fs/userfaultfd.c
include/acpi/button.h
include/acpi/video.h
include/asm-generic/memory_model.h
include/asm-generic/qspinlock.h
include/kvm/arm_vgic.h
include/linux/blkdev.h
include/linux/ceph/ceph_features.h
include/linux/ceph/messenger.h
include/linux/clockchips.h
include/linux/cpufreq.h
include/linux/devfreq.h
include/linux/irq.h
include/linux/irqdesc.h
include/linux/irqhandler.h
include/linux/jump_label.h
include/linux/tick.h
include/rdma/opa_port_info.h
include/sound/rt5645.h
include/sound/soc.h
kernel/irq/chip.c
kernel/irq/handle.c
kernel/irq/internals.h
kernel/irq/irqdesc.c
kernel/irq/irqdomain.c
kernel/irq/manage.c
kernel/irq/proc.c
kernel/irq/resend.c
kernel/locking/qspinlock.c
kernel/sched/core.c
kernel/time/clockevents.c
kernel/time/tick-common.c
kernel/time/tick-sched.c
kernel/time/timekeeping.c
kernel/time/timer_list.c
lib/string_helpers.c
mm/kasan/kasan.c
mm/mmap.c
net/ceph/messenger.c
scripts/extract-cert.c
scripts/sign-file.c
security/device_cgroup.c
sound/arm/Kconfig
sound/soc/atmel/atmel_wm8904.c
sound/soc/au1x/db1000.c
sound/soc/au1x/db1200.c
sound/soc/au1x/psc-i2s.c
sound/soc/blackfin/bf5xx-ad1836.c
sound/soc/blackfin/bfin-eval-adau1373.c
sound/soc/blackfin/bfin-eval-adau1701.c
sound/soc/blackfin/bfin-eval-adav80x.c
sound/soc/codecs/Kconfig
sound/soc/codecs/Makefile
sound/soc/codecs/ak4613.c [new file with mode: 0644]
sound/soc/codecs/ak4642.c
sound/soc/codecs/arizona.c
sound/soc/codecs/arizona.h
sound/soc/codecs/hdmi.c [deleted file]
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5645.h
sound/soc/codecs/wm0010.c
sound/soc/codecs/wm5110.c
sound/soc/codecs/wm8960.c
sound/soc/codecs/wm8962.c
sound/soc/davinci/davinci-mcasp.c
sound/soc/fsl/fsl-asoc-card.c
sound/soc/fsl/fsl_sai.c
sound/soc/fsl/fsl_ssi.c
sound/soc/intel/atom/sst-mfld-platform-pcm.c
sound/soc/intel/boards/broadwell.c
sound/soc/intel/haswell/sst-haswell-ipc.c
sound/soc/intel/skylake/skl-pcm.c
sound/soc/jz4740/jz4740-i2s.c
sound/soc/mediatek/mt8173-max98090.c
sound/soc/mediatek/mt8173-rt5650-rt5676.c
sound/soc/mediatek/mtk-afe-pcm.c
sound/soc/mxs/mxs-sgtl5000.c
sound/soc/pxa/Kconfig
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/soc-dapm.c
sound/soc/soc-pcm.c
sound/soc/soc-utils.c
sound/soc/spear/Kconfig
sound/soc/sti/uniperif_player.c
sound/soc/sti/uniperif_reader.c
tools/perf/builtin-script.c
tools/perf/tests/sw-clock.c
tools/perf/tests/task-exit.c
tools/perf/ui/browsers/hists.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h
tools/perf/util/evsel.c
tools/perf/util/evsel.h
tools/perf/util/header.c
tools/perf/util/intel-bts.c
tools/perf/util/intel-pt.c
tools/perf/util/parse-events.c
tools/perf/util/parse-events.y
tools/testing/selftests/Makefile
tools/testing/selftests/exec/Makefile
tools/testing/selftests/ftrace/Makefile
tools/testing/selftests/lib.mk
tools/testing/selftests/mqueue/Makefile
tools/testing/selftests/seccomp/seccomp_bpf.c
tools/testing/selftests/seccomp/test_harness.h
tools/testing/selftests/x86/entry_from_vm86.c
tools/testing/selftests/zram/zram.sh
tools/testing/selftests/zram/zram_lib.sh
tools/virtio/Makefile
tools/virtio/asm/barrier.h
tools/virtio/linux/export.h [new file with mode: 0644]
tools/virtio/linux/kernel.h
virt/kvm/arm/arch_timer.c
virt/kvm/arm/vgic-v3.c
virt/kvm/arm/vgic.c
virt/kvm/coalesced_mmio.h
virt/kvm/eventfd.c
virt/kvm/kvm_main.c

diff --git a/Documentation/devicetree/bindings/sound/ak4613.txt b/Documentation/devicetree/bindings/sound/ak4613.txt
new file mode 100644 (file)
index 0000000..15a9195
--- /dev/null
@@ -0,0 +1,17 @@
+AK4613 I2C transmitter
+
+This device supports I2C mode only.
+
+Required properties:
+
+- compatible : "asahi-kasei,ak4613"
+- reg : The chip select number on the I2C bus
+
+Example:
+
+&i2c {
+       ak4613: ak4613@0x10 {
+               compatible = "asahi-kasei,ak4613";
+               reg = <0x10>;
+       };
+};
index 623d4e70ae11d9ef5ee6231c09f0e8293fb32680..340784db6808809eecf4ae0e310023550713e2c6 100644 (file)
@@ -7,7 +7,14 @@ Required properties:
   - compatible : "asahi-kasei,ak4642" or "asahi-kasei,ak4643" or "asahi-kasei,ak4648"
   - reg : The chip select number on the I2C bus
 
-Example:
+Optional properties:
+
+  - #clock-cells :             common clock binding; shall be set to 0
+  - clocks :                   common clock binding; MCKI clock
+  - clock-frequency :          common clock binding; frequency of MCKO
+  - clock-output-names :       common clock binding; MCKO clock name
+
+Example 1:
 
 &i2c {
        ak4648: ak4648@0x12 {
@@ -15,3 +22,16 @@ Example:
                reg = <0x12>;
        };
 };
+
+Example 2:
+
+&i2c {
+       ak4643: codec@12 {
+               compatible = "asahi-kasei,ak4643";
+               reg = <0x12>;
+               #clock-cells = <0>;
+               clocks = <&audio_clock>;
+               clock-frequency = <12288000>;
+               clock-output-names = "ak4643_mcko";
+       };
+};
index b80606de545ad809fb147688060b26b51af4d5e1..f59c43b6411b7d1b51b48c9acc1dd4b5f2338337 100644 (file)
@@ -21,8 +21,8 @@ exact way to do it depends on the GPIO controller providing the GPIOs, see the
 device tree bindings for your controller.
 
 GPIOs mappings are defined in the consumer device's node, in a property named
-<function>-gpios, where <function> is the function the driver will request
-through gpiod_get(). For example:
+either <function>-gpios or <function>-gpio, where <function> is the function
+the driver will request through gpiod_get(). For example:
 
        foo_device {
                compatible = "acme,foo";
@@ -31,7 +31,7 @@ through gpiod_get(). For example:
                            <&gpio 16 GPIO_ACTIVE_HIGH>, /* green */
                            <&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */
 
-               power-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+               power-gpio = <&gpio 1 GPIO_ACTIVE_LOW>;
        };
 
 This property will make GPIOs 15, 16 and 17 available to the driver under the
@@ -39,15 +39,24 @@ This property will make GPIOs 15, 16 and 17 available to the driver under the
 
        struct gpio_desc *red, *green, *blue, *power;
 
-       red = gpiod_get_index(dev, "led", 0);
-       green = gpiod_get_index(dev, "led", 1);
-       blue = gpiod_get_index(dev, "led", 2);
+       red = gpiod_get_index(dev, "led", 0, GPIOD_OUT_HIGH);
+       green = gpiod_get_index(dev, "led", 1, GPIOD_OUT_HIGH);
+       blue = gpiod_get_index(dev, "led", 2, GPIOD_OUT_HIGH);
 
-       power = gpiod_get(dev, "power");
+       power = gpiod_get(dev, "power", GPIOD_OUT_HIGH);
 
 The led GPIOs will be active-high, while the power GPIO will be active-low (i.e.
 gpiod_is_active_low(power) will be true).
 
+The second parameter of the gpiod_get() functions, the con_id string, has to be
+the <function>-prefix of the GPIO suffixes ("gpios" or "gpio", automatically
+looked up by the gpiod functions internally) used in the device tree. With above
+"led-gpios" example, use the prefix without the "-" as con_id parameter: "led".
+
+Internally, the GPIO subsystem prefixes the GPIO suffix ("gpios" or "gpio")
+with the string passed in con_id to get the resulting string
+(snprintf(... "%s-%s", con_id, gpio_suffixes[]).
+
 ACPI
 ----
 ACPI also supports function names for GPIOs in a similar fashion to DT.
@@ -142,13 +151,14 @@ The driver controlling "foo.0" will then be able to obtain its GPIOs as follows:
 
        struct gpio_desc *red, *green, *blue, *power;
 
-       red = gpiod_get_index(dev, "led", 0);
-       green = gpiod_get_index(dev, "led", 1);
-       blue = gpiod_get_index(dev, "led", 2);
+       red = gpiod_get_index(dev, "led", 0, GPIOD_OUT_HIGH);
+       green = gpiod_get_index(dev, "led", 1, GPIOD_OUT_HIGH);
+       blue = gpiod_get_index(dev, "led", 2, GPIOD_OUT_HIGH);
 
-       power = gpiod_get(dev, "power");
-       gpiod_direction_output(power, 1);
+       power = gpiod_get(dev, "power", GPIOD_OUT_HIGH);
 
-Since the "power" GPIO is mapped as active-low, its actual signal will be 0
-after this code. Contrary to the legacy integer GPIO interface, the active-low
-property is handled during mapping and is thus transparent to GPIO consumers.
+Since the "led" GPIOs are mapped as active-high, this example will switch their
+signals to 1, i.e. enabling the LEDs. And for the "power" GPIO, which is mapped
+as active-low, its actual signal will be 0 after this code. Contrary to the legacy
+integer GPIO interface, the active-low property is handled during mapping and is
+thus transparent to GPIO consumers.
index a206639454ab7acdbf797c2598d818d2dc372544..e000502fde2006aa958a01e5c4fd357c5a6a21f9 100644 (file)
@@ -39,6 +39,9 @@ device that displays digits), an additional index argument can be specified:
                                          const char *con_id, unsigned int idx,
                                          enum gpiod_flags flags)
 
+For a more detailed description of the con_id parameter in the DeviceTree case
+see Documentation/gpio/board.txt
+
 The flags parameter is used to optionally specify a direction and initial value
 for the GPIO. Values can be:
 
index f0dd3d2fec96da61b56d010c19a83755d320f52f..76add4c9cd6893f4aa6aeaae427bf6becec6b4a3 100644 (file)
@@ -32,6 +32,10 @@ Supported chips:
     Prefix: 'nct6792'
     Addresses scanned: ISA address retrieved from Super I/O registers
     Datasheet: Available from Nuvoton upon request
+  * Nuvoton NCT6793D
+    Prefix: 'nct6793'
+    Addresses scanned: ISA address retrieved from Super I/O registers
+    Datasheet: Available from Nuvoton upon request
 
 Authors:
         Guenter Roeck <linux@roeck-us.net>
index f4cb0b2d5cd79048c51cf7b89f803561c2070e28..477927becacba69ee4bdea2203dd796979d14449 100644 (file)
@@ -15,8 +15,8 @@ The updated API replacements are:
 
 DEFINE_STATIC_KEY_TRUE(key);
 DEFINE_STATIC_KEY_FALSE(key);
-static_key_likely()
-statick_key_unlikely()
+static_branch_likely()
+static_branch_unlikely()
 
 0) Abstract
 
index 7ba7ab749c853a7691dff808d85b2a8f80973fe6..0581f47e959b8706d3ab6f038fa5ecd928ce8527 100644 (file)
@@ -6452,11 +6452,11 @@ F:      drivers/hwmon/ltc4261.c
 LTP (Linux Test Project)
 M:     Mike Frysinger <vapier@gentoo.org>
 M:     Cyril Hrubis <chrubis@suse.cz>
-M:     Wanlong Gao <gaowanlong@cn.fujitsu.com>
+M:     Wanlong Gao <wanlong.gao@gmail.com>
 M:     Jan Stancek <jstancek@redhat.com>
 M:     Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
 M:     Alexey Kodanev <alexey.kodanev@oracle.com>
-L:     ltp-list@lists.sourceforge.net (subscribers-only)
+L:     ltp@lists.linux.it (subscribers-only)
 W:     http://linux-test-project.github.io/
 T:     git git://github.com/linux-test-project/ltp.git
 S:     Maintained
@@ -11239,7 +11239,6 @@ VOLTAGE AND CURRENT REGULATOR FRAMEWORK
 M:     Liam Girdwood <lgirdwood@gmail.com>
 M:     Mark Brown <broonie@kernel.org>
 L:     linux-kernel@vger.kernel.org
-W:     http://opensource.wolfsonmicro.com/node/15
 W:     http://www.slimlogic.co.uk/?p=48
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
 S:     Supported
@@ -11368,17 +11367,15 @@ WM97XX TOUCHSCREEN DRIVERS
 M:     Mark Brown <broonie@kernel.org>
 M:     Liam Girdwood <lrg@slimlogic.co.uk>
 L:     linux-input@vger.kernel.org
-T:     git git://opensource.wolfsonmicro.com/linux-2.6-touch
-W:     http://opensource.wolfsonmicro.com/node/7
+W:     https://github.com/CirrusLogic/linux-drivers/wiki
 S:     Supported
 F:     drivers/input/touchscreen/*wm97*
 F:     include/linux/wm97xx.h
 
 WOLFSON MICROELECTRONICS DRIVERS
 L:     patches@opensource.wolfsonmicro.com
-T:     git git://opensource.wolfsonmicro.com/linux-2.6-asoc
-T:     git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
-W:     http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
+T:     git https://github.com/CirrusLogic/linux-drivers.git
+W:     https://github.com/CirrusLogic/linux-drivers/wiki
 S:     Supported
 F:     Documentation/hwmon/wm83??
 F:     arch/arm/mach-s3c64xx/mach-crag6410*
index 1a132ea43ca52588909bb054624177c8f8f63095..84f4b31e3c6eaa14411812ec3617e1b894175f26 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 4
 PATCHLEVEL = 3
 SUBLEVEL = 0
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 NAME = Hurr durr I'ma sheep
 
 # *DOCUMENTATION*
index f05bdb4b1cb97ee8f0d3bbec58fbc7285522c852..ff4049155c840c2fc4bc9e8015b5282dadb57469 100644 (file)
@@ -297,7 +297,9 @@ static inline void __iomem * ioremap_nocache(unsigned long offset,
                                             unsigned long size)
 {
        return ioremap(offset, size);
-} 
+}
+
+#define ioremap_uc ioremap_nocache
 
 static inline void iounmap(volatile void __iomem *addr)
 {
index 2804648c8ff4008d15761145b92167e721212935..2d6efcff3bf35cf1c11ebf180d2912d4033059b7 100644 (file)
@@ -117,6 +117,6 @@ handle_irq(int irq)
        }
 
        irq_enter();
-       generic_handle_irq_desc(irq, desc);
+       generic_handle_irq_desc(desc);
        irq_exit();
 }
index 69d52aa37bae2c27ddf568b10b28e43d14af4084..f2d81ff38aa6474f6443412889443cfb4904b3e0 100644 (file)
@@ -30,6 +30,7 @@ __delay(int loops)
                "       bgt %0,1b"
                : "=&r" (tmp), "=r" (loops) : "1"(loops));
 }
+EXPORT_SYMBOL(__delay);
 
 #ifdef CONFIG_SMP
 #define LPJ     cpu_data[smp_processor_id()].loops_per_jiffy
index d9e44b62df05d81a31305048aa91290784980e9d..4ffd1855f1bdc586c5f258f376a109ea11646a30 100644 (file)
@@ -252,7 +252,7 @@ static struct irq_chip idu_irq_chip = {
 
 static int idu_first_irq;
 
-static void idu_cascade_isr(unsigned int __core_irq, struct irq_desc *desc)
+static void idu_cascade_isr(struct irq_desc *desc)
 {
        struct irq_domain *domain = irq_desc_get_handler_data(desc);
        unsigned int core_irq = irq_desc_get_irq(desc);
index 7451b447cc2d2cb8cc68a9bf59f125f2dd2ce347..2c2b28ee48119771dfa92f353124795d456d770a 100644 (file)
@@ -54,6 +54,14 @@ AS           += -EL
 LD             += -EL
 endif
 
+#
+# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and
+# later may result in code being generated that handles signed short and signed
+# char struct members incorrectly. So disable it.
+# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932)
+#
+KBUILD_CFLAGS  += $(call cc-option,-fno-ipa-sra)
+
 # This selects which instruction set is used.
 # Note that GCC does not numerically define an architecture version
 # macro, but instead defines a whole series of macros which makes
index 96dabcb6c62107f5675fde3c78dd2f86b4588cf2..996aed3b4eee69883045bc3bc2f4500d085316ac 100644 (file)
@@ -95,7 +95,7 @@ void it8152_init_irq(void)
        }
 }
 
-void it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
+void it8152_irq_demux(struct irq_desc *desc)
 {
        int bits_pd, bits_lp, bits_ld;
        int i;
index 304adea4bc52f4b8e32157dcd0f64d530ccb3a4c..0e97b4b871f9b045fb8b01d4e9a8cd686f775fd6 100644 (file)
@@ -138,7 +138,7 @@ static struct locomo_dev_info locomo_devices[] = {
        },
 };
 
-static void locomo_handler(unsigned int __irq, struct irq_desc *desc)
+static void locomo_handler(struct irq_desc *desc)
 {
        struct locomo *lchip = irq_desc_get_chip_data(desc);
        int req, i;
index 4f290250fa9328f2bc00c6d701267c4e6e4f21c4..3d224941b5419e88a25aae2ae70632dba047606c 100644 (file)
@@ -196,10 +196,8 @@ static struct sa1111_dev_info sa1111_devices[] = {
  * active IRQs causes the interrupt output to pulse, the upper levels
  * will call us again if there are more interrupts to process.
  */
-static void
-sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void sa1111_irq_handler(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
        unsigned int stat0, stat1, i;
        struct sa1111 *sachip = irq_desc_get_handler_data(desc);
        void __iomem *mapbase = sachip->base + SA1111_INTC;
@@ -214,7 +212,7 @@ sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc)
        sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1);
 
        if (stat0 == 0 && stat1 == 0) {
-               do_bad_IRQ(irq, desc);
+               do_bad_IRQ(desc);
                return;
        }
 
index 7bbf325a4f31f12c9d867381853579a495590f89..b2bc8e11471d3ee3e4fcd5f207406222ffa04bf1 100644 (file)
@@ -491,11 +491,6 @@ THUMB(     orr     \reg , \reg , #PSR_T_BIT        )
 #endif
        .endm
 
-       .macro  uaccess_save_and_disable, tmp
-       uaccess_save \tmp
-       uaccess_disable \tmp
-       .endm
-
        .irp    c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
        .macro  ret\c, reg
 #if __LINUX_ARM_ARCH__ < 6
index b274bde24905a7503f60d38672346636d093854b..e7335a92144ef1d20d296ebdf26798148b2fa711 100644 (file)
@@ -40,6 +40,7 @@ do {                                                          \
                "2:\t.asciz " #__file "\n"                      \
                ".popsection\n"                                 \
                ".pushsection __bug_table,\"a\"\n"              \
+               ".align 2\n"                                    \
                "3:\t.word 1b, 2b\n"                            \
                "\t.hword " #__line ", 0\n"                     \
                ".popsection");                                 \
index e878129f2fee5dfec3d36bec2e9fcb7d8ef046e4..fc8ba1663601e0743a05b7cda52703df9f9bc07a 100644 (file)
@@ -12,6 +12,7 @@
 
 #ifndef __ASSEMBLY__
 #include <asm/barrier.h>
+#include <asm/thread_info.h>
 #endif
 
 /*
@@ -89,7 +90,8 @@ static inline unsigned int get_domain(void)
 
        asm(
        "mrc    p15, 0, %0, c3, c0      @ get domain"
-        : "=r" (domain));
+        : "=r" (domain)
+        : "m" (current_thread_info()->cpu_domain));
 
        return domain;
 }
@@ -98,7 +100,7 @@ static inline void set_domain(unsigned val)
 {
        asm volatile(
        "mcr    p15, 0, %0, c3, c0      @ set domain"
-         : : "r" (val));
+         : : "r" (val) : "memory");
        isb();
 }
 
index d36a73d7c0e8d956253f3a66c783cf4a33f24221..076777ff3daa3c5db361ee481c8b8ba15aa00718 100644 (file)
@@ -106,7 +106,7 @@ extern void __iomem *it8152_base_address;
 struct pci_dev;
 struct pci_sys_data;
 
-extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc);
+extern void it8152_irq_demux(struct irq_desc *desc);
 extern void it8152_init_irq(void);
 extern int it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
 extern int it8152_pci_setup(int nr, struct pci_sys_data *sys);
index af79da40af2a1b949e94de520d867dd08c5c628d..9beb92914f4df4313f2bd4fba410fb6f720b9a24 100644 (file)
@@ -11,12 +11,6 @@ static inline void ack_bad_irq(int irq)
        pr_crit("unexpected IRQ trap at vector %02x\n", irq);
 }
 
-void set_irq_flags(unsigned int irq, unsigned int flags);
-
-#define IRQF_VALID     (1 << 0)
-#define IRQF_PROBE     (1 << 1)
-#define IRQF_NOAUTOEN  (1 << 2)
-
 #define ARCH_IRQ_INIT_FLAGS    (IRQ_NOREQUEST | IRQ_NOPROBE)
 
 #endif
index dcba0fa5176e990f8a23333f08e34e192351b407..3df1e975f72aa57af59c19f3f564f0de9388b535 100644 (file)
 
 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
 
-#if defined(CONFIG_KVM_ARM_MAX_VCPUS)
-#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS
-#else
-#define KVM_MAX_VCPUS 0
-#endif
-
 #define KVM_USER_MEM_SLOTS 32
 #define KVM_PRIVATE_MEM_SLOTS 4
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -44,6 +38,8 @@
 
 #include <kvm/arm_vgic.h>
 
+#define KVM_MAX_VCPUS VGIC_V2_MAX_CPUS
+
 u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode);
 int __attribute_const__ kvm_target_cpu(void);
 int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
@@ -148,6 +144,7 @@ struct kvm_vm_stat {
 
 struct kvm_vcpu_stat {
        u32 halt_successful_poll;
+       u32 halt_attempted_poll;
        u32 halt_wakeup;
 };
 
index 2092ee1e1300075c628b9e4cf89b0045cb118a04..de4634b514563387b54f884e3e3e83c41fbae110 100644 (file)
@@ -23,10 +23,10 @@ extern int show_fiq_list(struct seq_file *, int);
 /*
  * This is for easy migration, but should be changed in the source
  */
-#define do_bad_IRQ(irq,desc)                           \
+#define do_bad_IRQ(desc)                               \
 do {                                                   \
        raw_spin_lock(&desc->lock);                     \
-       handle_bad_irq(irq, desc);                      \
+       handle_bad_irq(desc);                           \
        raw_spin_unlock(&desc->lock);                   \
 } while(0)
 
index d0a1119dcaf38ba92d99354aaeba18bbf0452004..776757d1604ab3901996bb24bb02748e54c2aee7 100644 (file)
@@ -25,7 +25,6 @@
 struct task_struct;
 
 #include <asm/types.h>
-#include <asm/domain.h>
 
 typedef unsigned long mm_segment_t;
 
index 5ff4826cb154b0b646e281f4903a4e45a1c69ae9..2766183e69df255371f0586ff96b7112ec3dc643 100644 (file)
@@ -79,26 +79,6 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
        handle_IRQ(irq, regs);
 }
 
-void set_irq_flags(unsigned int irq, unsigned int iflags)
-{
-       unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
-
-       if (irq >= nr_irqs) {
-               pr_err("Trying to set irq flags for IRQ%d\n", irq);
-               return;
-       }
-
-       if (iflags & IRQF_VALID)
-               clr |= IRQ_NOREQUEST;
-       if (iflags & IRQF_PROBE)
-               clr |= IRQ_NOPROBE;
-       if (!(iflags & IRQF_NOAUTOEN))
-               clr |= IRQ_NOAUTOEN;
-       /* Order is clear bits in "clr" then set bits in "set" */
-       irq_modify_status(irq, clr, set & ~clr);
-}
-EXPORT_SYMBOL_GPL(set_irq_flags);
-
 void __init init_IRQ(void)
 {
        int ret;
index a6ad93c9bce35ea33185bbb5abb2e61867a09173..fd9eefce0a7b8d66e019b048e4ee24753da7acc0 100644 (file)
@@ -259,15 +259,17 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
        if (err)
                return err;
 
-       patch_text((void *)bpt->bpt_addr,
-                  *(unsigned int *)arch_kgdb_ops.gdb_bpt_instr);
+       /* Machine is already stopped, so we can use __patch_text() directly */
+       __patch_text((void *)bpt->bpt_addr,
+                    *(unsigned int *)arch_kgdb_ops.gdb_bpt_instr);
 
        return err;
 }
 
 int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
 {
-       patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr);
+       /* Machine is already stopped, so we can use __patch_text() directly */
+       __patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr);
 
        return 0;
 }
index a3089bacb8d822ded284b432f1cb37ecd8b0ff66..7a7c4cea55231b1c793982ab63d6c5598004b14b 100644 (file)
@@ -226,6 +226,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
 
        memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
 
+#ifdef CONFIG_CPU_USE_DOMAINS
        /*
         * Copy the initial value of the domain access control register
         * from the current thread: thread->addr_limit will have been
@@ -233,6 +234,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
         * kernel/fork.c
         */
        thread->cpu_domain = get_domain();
+#endif
 
        if (likely(!(p->flags & PF_KTHREAD))) {
                *childregs = *current_pt_regs();
index b6cda06b455fc6e3b6fcde6313a93ad052bb3ada..7b8f2141427bda172899bfe8ae5113367163af47 100644 (file)
@@ -343,15 +343,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
                 */
                thumb = handler & 1;
 
-#if __LINUX_ARM_ARCH__ >= 7
                /*
-                * Clear the If-Then Thumb-2 execution state
-                * ARM spec requires this to be all 000s in ARM mode
-                * Snapdragon S4/Krait misbehaves on a Thumb=>ARM
-                * signal transition without this.
+                * Clear the If-Then Thumb-2 execution state.  ARM spec
+                * requires this to be all 000s in ARM mode.  Snapdragon
+                * S4/Krait misbehaves on a Thumb=>ARM signal transition
+                * without this.
+                *
+                * We must do this whenever we are running on a Thumb-2
+                * capable CPU, which includes ARMv6T2.  However, we elect
+                * to always do this to simplify the code; this field is
+                * marked UNK/SBZP for older architectures.
                 */
                cpsr &= ~PSR_IT_MASK;
-#endif
 
                if (thumb) {
                        cpsr |= PSR_T_BIT;
index bfb915d0566566978b8e51c5ae7c93adfad04d0f..210eccadb69a9770ba1b51beb077bb071f565261 100644 (file)
@@ -45,15 +45,4 @@ config KVM_ARM_HOST
        ---help---
          Provides host support for ARM processors.
 
-config KVM_ARM_MAX_VCPUS
-       int "Number maximum supported virtual CPUs per VM"
-       depends on KVM_ARM_HOST
-       default 4
-       help
-         Static number of max supported virtual CPUs per VM.
-
-         If you choose a high number, the vcpu structures will be quite
-         large, so only choose a reasonable number that you expect to
-         actually use.
-
 endif # VIRTUALIZATION
index ce404a5c30628c72533a62e430c6150a54032fea..dc017adfddc8b83698fa8486e2b9b6dbc1e189a0 100644 (file)
@@ -446,7 +446,7 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
         * Map the VGIC hardware resources before running a vcpu the first
         * time on this VM.
         */
-       if (unlikely(!vgic_ready(kvm))) {
+       if (unlikely(irqchip_in_kernel(kvm) && !vgic_ready(kvm))) {
                ret = kvm_vgic_map_resources(kvm);
                if (ret)
                        return ret;
index 702740d37465c31299b24ccd4b9fed7184267689..51a59504bef4096708c1c4c481fb9ab753a1d8d2 100644 (file)
@@ -515,8 +515,7 @@ ARM_BE8(rev r6, r6  )
 
        mrc     p15, 0, r2, c14, c3, 1  @ CNTV_CTL
        str     r2, [vcpu, #VCPU_TIMER_CNTV_CTL]
-       bic     r2, #1                  @ Clear ENABLE
-       mcr     p15, 0, r2, c14, c3, 1  @ CNTV_CTL
+
        isb
 
        mrrc    p15, 3, rr_lo_hi(r2, r3), c14   @ CNTV_CVAL
@@ -529,6 +528,9 @@ ARM_BE8(rev r6, r6  )
        mcrr    p15, 4, r2, r2, c14     @ CNTVOFF
 
 1:
+       mov     r2, #0                  @ Clear ENABLE
+       mcr     p15, 0, r2, c14, c3, 1  @ CNTV_CTL
+
        @ Allow physical timer/counter access for the host
        mrc     p15, 4, r2, c14, c1, 0  @ CNTHCTL
        orr     r2, r2, #(CNTHCTL_PL1PCEN | CNTHCTL_PL1PCTEN)
index 7b42012941872155dfc9dc0678cf7a653e9f3c64..6984342da13d09fd0194563f4b598cfb913ec6c1 100644 (file)
@@ -1792,8 +1792,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
                if (vma->vm_flags & VM_PFNMAP) {
                        gpa_t gpa = mem->guest_phys_addr +
                                    (vm_start - mem->userspace_addr);
-                       phys_addr_t pa = (vma->vm_pgoff << PAGE_SHIFT) +
-                                        vm_start - vma->vm_start;
+                       phys_addr_t pa;
+
+                       pa = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;
+                       pa += vm_start - vma->vm_start;
 
                        /* IO region dirty page logging not allowed */
                        if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES)
index 4b94b513168da4ae52f517e7bb4937652308b427..ad6f6424f1d1b3aac2b94792178bd2d41fed3f97 100644 (file)
@@ -126,7 +126,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu)
 
 static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu)
 {
-       int i;
+       int i, matching_cpus = 0;
        unsigned long mpidr;
        unsigned long target_affinity;
        unsigned long target_affinity_mask;
@@ -151,12 +151,16 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu)
         */
        kvm_for_each_vcpu(i, tmp, kvm) {
                mpidr = kvm_vcpu_get_mpidr_aff(tmp);
-               if (((mpidr & target_affinity_mask) == target_affinity) &&
-                   !tmp->arch.pause) {
-                       return PSCI_0_2_AFFINITY_LEVEL_ON;
+               if ((mpidr & target_affinity_mask) == target_affinity) {
+                       matching_cpus++;
+                       if (!tmp->arch.pause)
+                               return PSCI_0_2_AFFINITY_LEVEL_ON;
                }
        }
 
+       if (!matching_cpus)
+               return PSCI_RET_INVALID_PARAMS;
+
        return PSCI_0_2_AFFINITY_LEVEL_OFF;
 }
 
index 305d7c6242bb50ba488e4b2132ebeb54b4d3858f..bfb3703357c55aba72674827527e0fba68650b3e 100644 (file)
@@ -69,14 +69,14 @@ static struct irq_chip pmu_irq_chip = {
        .irq_ack        = pmu_irq_ack,
 };
 
-static void pmu_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void pmu_irq_handler(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
        unsigned long cause = readl(PMU_INTERRUPT_CAUSE);
+       unsigned int irq;
 
        cause &= readl(PMU_INTERRUPT_MASK);
        if (cause == 0) {
-               do_bad_IRQ(irq, desc);
+               do_bad_IRQ(desc);
                return;
        }
 
index fcd79bc3a3e1d86639fd8b3d859133017e2deb99..c01fca11b224cfbc78f3038f581f9d95f56b3f35 100644 (file)
@@ -87,13 +87,12 @@ static struct irq_chip isa_hi_chip = {
        .irq_unmask     = isa_unmask_pic_hi_irq,
 };
 
-static void
-isa_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void isa_irq_handler(struct irq_desc *desc)
 {
        unsigned int isa_irq = *(unsigned char *)PCIIACK_BASE;
 
        if (isa_irq < _ISA_IRQ(0) || isa_irq >= _ISA_IRQ(16)) {
-               do_bad_IRQ(isa_irq, desc);
+               do_bad_IRQ(desc);
                return;
        }
 
index 220333ed741db064e066d79d6ea57503b694ac4e..2478d9f4d92dc7c75cec60267dfffd747b7f4120 100644 (file)
@@ -126,7 +126,7 @@ static int gpio_set_irq_type(struct irq_data *d, unsigned int type)
        return 0;
 }
 
-static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void gpio_irq_handler(struct irq_desc *desc)
 {
        unsigned int port = (unsigned int)irq_desc_get_handler_data(desc);
        unsigned int gpio_irq_no, irq_stat;
index 45903be6e7b3d7efd01656f21d24ea94cdaf74bf..16496a071ecb8c3174639a15fbc3d6fe092d3e3b 100644 (file)
@@ -85,7 +85,7 @@ static struct platform_device smsc_lan9217_device = {
        .resource = smsc911x_resources,
 };
 
-static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mxc_expio_irq_handler(struct irq_desc *desc)
 {
        u32 imr_val;
        u32 int_valid;
index 2c0853560bd2f6777144005e2ff5a83d975fc0f3..2b147e4bf9c91297deb0522bcfb14150b61f5b11 100644 (file)
@@ -154,7 +154,7 @@ static inline void mxc_init_imx_uart(void)
        imx31_add_imx_uart0(&uart_pdata);
 }
 
-static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mx31ads_expio_irq_handler(struct irq_desc *desc)
 {
        u32 imr_val;
        u32 int_valid;
index 9f89e76dfbb94a6ad27e4769545049726ae4c99b..f6235b28578c2fcaec332d9d091dd732ca861090 100644 (file)
@@ -91,7 +91,7 @@ static void (*write_imipr[])(u32) = {
        write_imipr_3,
 };
 
-static void iop13xx_msi_handler(unsigned int irq, struct irq_desc *desc)
+static void iop13xx_msi_handler(struct irq_desc *desc)
 {
        int i, j;
        unsigned long status;
index cce4cef12b6eefa7ddc7fd4e4d204b635b9e5934..2ae431e8bc1bd6236c9fcdfbafff707156a1e51d 100644 (file)
@@ -370,7 +370,7 @@ static struct irq_chip lpc32xx_irq_chip = {
        .irq_set_wake = lpc32xx_irq_wake
 };
 
-static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc)
+static void lpc32xx_sic1_handler(struct irq_desc *desc)
 {
        unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC1_BASE));
 
@@ -383,7 +383,7 @@ static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc)
        }
 }
 
-static void lpc32xx_sic2_handler(unsigned int irq, struct irq_desc *desc)
+static void lpc32xx_sic2_handler(struct irq_desc *desc)
 {
        unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC2_BASE));
 
index 6373e2bff203e609bdc6eff4b55bdd014f11f436..842302df99c1bfdcdf0a0c00fa8131e30206562d 100644 (file)
@@ -69,8 +69,7 @@ static struct platform_device *devices[] __initdata = {
 #define DEBUG_IRQ(fmt...)      while (0) {}
 #endif
 
-static void
-netx_hif_demux_handler(unsigned int irq_unused, struct irq_desc *desc)
+static void netx_hif_demux_handler(struct irq_desc *desc)
 {
        unsigned int irq = NETX_IRQ_HIF_CHAINED(0);
        unsigned int stat;
index dfec671b1639427ae65f8f57773bbf56ba301803..39e20d0ead084ec60ed42c11dacfae891cb63f4d 100644 (file)
@@ -87,7 +87,7 @@ static void fpga_mask_ack_irq(struct irq_data *d)
        fpga_ack_irq(d);
 }
 
-static void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
+static void innovator_fpga_IRQ_demux(struct irq_desc *desc)
 {
        u32 stat;
        int fpga_irq;
index 257e98c266188c395f6ee135afb2ea60ba85a565..3fc2cbe52113b4c1b2f12a6f3cc4c33d874f4e30 100644 (file)
@@ -102,7 +102,7 @@ static void omap_prcm_events_filter_priority(unsigned long *events,
  * dispatched accordingly. Clearing of the wakeup events should be
  * done by the SoC specific individual handlers.
  */
-static void omap_prcm_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void omap_prcm_irq_handler(struct irq_desc *desc)
 {
        unsigned long pending[OMAP_PRCM_MAX_NR_PENDING_REG];
        unsigned long priority_pending[OMAP_PRCM_MAX_NR_PENDING_REG];
index 70366b35d299bad321aefcd020220bd81fe5332b..a3ebb517cca1af2941f7a8118cd30c9cc4d15b83 100644 (file)
@@ -496,7 +496,7 @@ static struct irq_chip balloon3_irq_chip = {
        .irq_unmask     = balloon3_unmask_irq,
 };
 
-static void balloon3_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void balloon3_irq_handler(struct irq_desc *desc)
 {
        unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) &
                                        balloon3_irq_enabled;
index 1fa79f1f832deeacf04529f6772ceaab1f6eed15..3221ae15bef761b6a8548ac20b0a77fff70d9aee 100644 (file)
 void __iomem *it8152_base_address;
 static int cmx2xx_it8152_irq_gpio;
 
-static void cmx2xx_it8152_irq_demux(unsigned int __irq, struct irq_desc *desc)
+static void cmx2xx_it8152_irq_demux(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
        /* clear our parent irq */
        desc->irq_data.chip->irq_ack(&desc->irq_data);
 
-       it8152_irq_demux(irq, desc);
+       it8152_irq_demux(desc);
 }
 
 void __cmx2xx_pci_init_irq(int irq_gpio)
index b070167deef278e9859f3b86e929073ba8f5a43a..4823d972e64745dd4ae10dbfed0138eb46d10311 100644 (file)
@@ -120,7 +120,7 @@ static struct irq_chip lpd270_irq_chip = {
        .irq_unmask     = lpd270_unmask_irq,
 };
 
-static void lpd270_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void lpd270_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq;
        unsigned long pending;
index 9a0c8affdadb635ad5c1b5684812fdd0eba5640e..d8319b54299a571d223321a53cd7776aa71ccece 100644 (file)
@@ -284,7 +284,7 @@ static struct irq_chip pcm990_irq_chip = {
        .irq_unmask     = pcm990_unmask_irq,
 };
 
-static void pcm990_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void pcm990_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq;
        unsigned long pending;
index 4841d6cefe76affc01d8bdf1b82d97f67909c7af..8ab26370107ea5d0df2742b1ac0ab31aa18eb425 100644 (file)
@@ -276,7 +276,7 @@ static inline unsigned long viper_irq_pending(void)
                        viper_irq_enabled_mask;
 }
 
-static void viper_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void viper_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq;
        unsigned long pending;
index 6f94dd7b4dee0135307df00576d6a6be176577ca..30e62a3f0701a5884ca0835cf7c5db47aeab2330 100644 (file)
@@ -105,7 +105,7 @@ static inline unsigned long zeus_irq_pending(void)
        return __raw_readw(ZEUS_CPLD_ISA_IRQ) & zeus_irq_enabled_mask;
 }
 
-static void zeus_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void zeus_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq;
        unsigned long pending;
index f726d4c4e6dd8caf6ab5966a8bd63a02183e5057..dc67a7fb383199ba26657d7ab9e5611031c9e20c 100644 (file)
@@ -551,8 +551,7 @@ static void ecard_check_lockup(struct irq_desc *desc)
        }
 }
 
-static void
-ecard_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ecard_irq_handler(struct irq_desc *desc)
 {
        ecard_t *ec;
        int called = 0;
index ced1ab86ac83a7037edd2727ba54234c8b90867b..2bb08961e934ca91c704e32b6f0a324516157e17 100644 (file)
@@ -100,9 +100,7 @@ static struct irq_chip  bast_pc104_chip = {
        .irq_ack        = bast_pc104_maskack
 };
 
-static void
-bast_irq_pc104_demux(unsigned int irq,
-                    struct irq_desc *desc)
+static void bast_irq_pc104_demux(struct irq_desc *desc)
 {
        unsigned int stat;
        unsigned int irqno;
index fd63ecfb2f81f37d38e41d6eb06cdbf365efee4d..ddb30b8434c539588afaebef7d08ce086e5b6726 100644 (file)
@@ -388,22 +388,22 @@ static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end)
        }
 }
 
-static void s3c_irq_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c_irq_demux_eint0_3(struct irq_desc *desc)
 {
        s3c_irq_demux_eint(0, 3);
 }
 
-static void s3c_irq_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
+static void s3c_irq_demux_eint4_11(struct irq_desc *desc)
 {
        s3c_irq_demux_eint(4, 11);
 }
 
-static void s3c_irq_demux_eint12_19(unsigned int irq, struct irq_desc *desc)
+static void s3c_irq_demux_eint12_19(struct irq_desc *desc)
 {
        s3c_irq_demux_eint(12, 19);
 }
 
-static void s3c_irq_demux_eint20_27(unsigned int irq, struct irq_desc *desc)
+static void s3c_irq_demux_eint20_27(struct irq_desc *desc)
 {
        s3c_irq_demux_eint(20, 27);
 }
index 6d237b4f7a8ef226acb57bb196f066183a754fb6..8411985af9ff89addd5ae0cc04ff365842961c5d 100644 (file)
@@ -166,7 +166,7 @@ static struct sa1100_port_fns neponset_port_fns = {
  * ensure that the IRQ signal is deasserted before returning.  This
  * is rather unfortunate.
  */
-static void neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void neponset_irq_handler(struct irq_desc *desc)
 {
        struct neponset_drvdata *d = irq_desc_get_handler_data(desc);
        unsigned int irr;
index e62604384945e513a9b1ed14a2a5a2e3d8950630..1a7815e5421b6b1d3ad774b28915b84b52726136 100644 (file)
@@ -1249,7 +1249,7 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)
        struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
        unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
        dma_addr_t dma_addr, iova;
-       int i, ret = DMA_ERROR_CODE;
+       int i;
 
        dma_addr = __alloc_iova(mapping, size);
        if (dma_addr == DMA_ERROR_CODE)
@@ -1257,6 +1257,8 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)
 
        iova = dma_addr;
        for (i = 0; i < count; ) {
+               int ret;
+
                unsigned int next_pfn = page_to_pfn(pages[i]) + 1;
                phys_addr_t phys = page_to_phys(pages[i]);
                unsigned int len, j;
index 71df4354765927da922606db930c6665cbd0c7f9..39c20afad7ed9ed3b4b967a54d3a435e07eccf9e 100644 (file)
@@ -95,9 +95,10 @@ emulate:
        reteq   r4                      @ no, return failure
 
 next:
+       uaccess_enable r3
 .Lx1:  ldrt    r6, [r5], #4            @ get the next instruction and
                                        @ increment PC
-
+       uaccess_disable r3
        and     r2, r6, #0x0F000000     @ test for FP insns
        teq     r2, #0x0C000000
        teqne   r2, #0x0D000000
index 79c33eca09a352ea1563670aaf7f68ecbe74d7c9..7bd22d8e5b11bd31847ff0504b615d4639b64a5b 100644 (file)
@@ -407,7 +407,7 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type)
        return 0;
 }
 
-static void gpio_irq_handler(unsigned __irq, struct irq_desc *desc)
+static void gpio_irq_handler(struct irq_desc *desc)
 {
        struct orion_gpio_chip *ochip = irq_desc_get_handler_data(desc);
        u32 cause, type;
index f00e080759384afd300398be488c5740f55f1091..10fd99c568c62a9296b4ad7d2cc3584360b1b8a0 100644 (file)
@@ -98,8 +98,23 @@ ENTRY(privcmd_call)
        mov r1, r2
        mov r2, r3
        ldr r3, [sp, #8]
+       /*
+        * Privcmd calls are issued by the userspace. We need to allow the
+        * kernel to access the userspace memory before issuing the hypercall.
+        */
+       uaccess_enable r4
+
+       /* r4 is loaded now as we use it as scratch register before */
        ldr r4, [sp, #4]
        __HVC(XEN_IMM)
+
+       /*
+        * Disable userspace access from kernel. This is fine to do it
+        * unconditionally as no set_fs(KERNEL_DS)/set_fs(get_ds()) is
+        * called before.
+        */
+       uaccess_disable r4
+
        ldm sp!, {r4}
        ret lr
 ENDPROC(privcmd_call);
index 7d95663c0160bd2575199e3836570e46fb4a158d..07d1811aa03fcd1ecd5ee7c260688a59f7ab97e4 100644 (file)
@@ -32,6 +32,7 @@ config ARM64
        select GENERIC_CLOCKEVENTS_BROADCAST
        select GENERIC_CPU_AUTOPROBE
        select GENERIC_EARLY_IOREMAP
+       select GENERIC_IDLE_POLL_SETUP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
        select GENERIC_IRQ_SHOW_LEVEL
@@ -331,6 +332,22 @@ config ARM64_ERRATUM_845719
 
          If unsure, say Y.
 
+config ARM64_ERRATUM_843419
+       bool "Cortex-A53: 843419: A load or store might access an incorrect address"
+       depends on MODULES
+       default y
+       help
+         This option builds kernel modules using the large memory model in
+         order to avoid the use of the ADRP instruction, which can cause
+         a subsequent memory access to use an incorrect address on Cortex-A53
+         parts up to r0p4.
+
+         Note that the kernel itself must be linked with a version of ld
+         which fixes potentially affected ADRP instructions through the
+         use of veneers.
+
+         If unsure, say Y.
+
 endmenu
 
 
index 15ff5b4156fd74a041f3ad926efbeae05ba382dc..f9914d7c1bb00b5c4cbe7a19c0f62c8eca54cf81 100644 (file)
@@ -41,6 +41,10 @@ endif
 
 CHECKFLAGS     += -D__aarch64__
 
+ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
+CFLAGS_MODULE  += -mcmodel=large
+endif
+
 # Default value
 head-y         := arch/arm64/kernel/head.o
 
index 2bb7009bdac721f96973b679a585e875425b73d4..a57601f9d17cdffb1122e2864ae5353273eb59ee 100644 (file)
@@ -43,9 +43,4 @@ static inline void ack_bad_irq(unsigned int irq)
        irq_err_count++;
 }
 
-/*
- * No arch-specific IRQ flags.
- */
-#define set_irq_flags(irq, flags)
-
 #endif /* __ASM_HARDIRQ_H */
index 7605e095217f7c2434594327ae4b3453cb758f42..9694f26545930bf5cf282cde42d41035914d89b7 100644 (file)
@@ -95,6 +95,7 @@
                         SCTLR_EL2_SA | SCTLR_EL2_I)
 
 /* TCR_EL2 Registers bits */
+#define TCR_EL2_RES1   ((1 << 31) | (1 << 23))
 #define TCR_EL2_TBI    (1 << 20)
 #define TCR_EL2_PS     (7 << 16)
 #define TCR_EL2_PS_40B (2 << 16)
 #define TCR_EL2_MASK   (TCR_EL2_TG0 | TCR_EL2_SH0 | \
                         TCR_EL2_ORGN0 | TCR_EL2_IRGN0 | TCR_EL2_T0SZ)
 
-#define TCR_EL2_FLAGS  (TCR_EL2_PS_40B)
+#define TCR_EL2_FLAGS  (TCR_EL2_RES1 | TCR_EL2_PS_40B)
 
 /* VTCR_EL2 Registers bits */
+#define VTCR_EL2_RES1          (1 << 31)
 #define VTCR_EL2_PS_MASK       (7 << 16)
 #define VTCR_EL2_TG0_MASK      (1 << 14)
 #define VTCR_EL2_TG0_4K                (0 << 14)
  */
 #define VTCR_EL2_FLAGS         (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \
                                 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \
-                                VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B)
+                                VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \
+                                VTCR_EL2_RES1)
 #define VTTBR_X                (38 - VTCR_EL2_T0SZ_40B)
 #else
 /*
  */
 #define VTCR_EL2_FLAGS         (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \
                                 VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \
-                                VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B)
+                                VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \
+                                VTCR_EL2_RES1)
 #define VTTBR_X                (37 - VTCR_EL2_T0SZ_40B)
 #endif
 
 #define VTTBR_VMID_MASK          (UL(0xFF) << VTTBR_VMID_SHIFT)
 
 /* Hyp System Trap Register */
-#define HSTR_EL2_TTEE  (1 << 16)
 #define HSTR_EL2_T(x)  (1 << x)
 
 /* Hyp Coproccessor Trap Register Shifts */
index 67fa0de3d48324cc19a06871904f619189ed27da..5e377101f91948f9ee711bea3f7659c86010301c 100644 (file)
@@ -53,9 +53,7 @@
 #define        IFSR32_EL2      25      /* Instruction Fault Status Register */
 #define        FPEXC32_EL2     26      /* Floating-Point Exception Control Register */
 #define        DBGVCR32_EL2    27      /* Debug Vector Catch Register */
-#define        TEECR32_EL1     28      /* ThumbEE Configuration Register */
-#define        TEEHBR32_EL1    29      /* ThumbEE Handler Base Register */
-#define        NR_SYS_REGS     30
+#define        NR_SYS_REGS     28
 
 /* 32bit mapping */
 #define c0_MPIDR       (MPIDR_EL1 * 2) /* MultiProcessor ID Register */
index 415938dc45cff94600625963b71011882f3a3ae4..4562459456a62c68e08d3480dc135eb1831dca1f 100644 (file)
 
 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
 
-#if defined(CONFIG_KVM_ARM_MAX_VCPUS)
-#define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS
-#else
-#define KVM_MAX_VCPUS 0
-#endif
-
 #define KVM_USER_MEM_SLOTS 32
 #define KVM_PRIVATE_MEM_SLOTS 4
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -43,6 +37,8 @@
 #include <kvm/arm_vgic.h>
 #include <kvm/arm_arch_timer.h>
 
+#define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS
+
 #define KVM_VCPU_MAX_FEATURES 3
 
 int __attribute_const__ kvm_target_cpu(void);
@@ -195,6 +191,7 @@ struct kvm_vm_stat {
 
 struct kvm_vcpu_stat {
        u32 halt_successful_poll;
+       u32 halt_attempted_poll;
        u32 halt_wakeup;
 };
 
index 6900b2d953717c721fb2318ef877428542baef17..b0329be95cb129f3b283f3d75e4dfeff64214bff 100644 (file)
  * Software defined PTE bits definition.
  */
 #define PTE_VALID              (_AT(pteval_t, 1) << 0)
+#define PTE_WRITE              (PTE_DBM)                /* same as DBM (51) */
 #define PTE_DIRTY              (_AT(pteval_t, 1) << 55)
 #define PTE_SPECIAL            (_AT(pteval_t, 1) << 56)
-#ifdef CONFIG_ARM64_HW_AFDBM
-#define PTE_WRITE              (PTE_DBM)                /* same as DBM */
-#else
-#define PTE_WRITE              (_AT(pteval_t, 1) << 57)
-#endif
 #define PTE_PROT_NONE          (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */
 
 /*
@@ -146,7 +142,7 @@ extern struct page *empty_zero_page;
 #define pte_exec(pte)          (!(pte_val(pte) & PTE_UXN))
 
 #ifdef CONFIG_ARM64_HW_AFDBM
-#define pte_hw_dirty(pte)      (!(pte_val(pte) & PTE_RDONLY))
+#define pte_hw_dirty(pte)      (pte_write(pte) && !(pte_val(pte) & PTE_RDONLY))
 #else
 #define pte_hw_dirty(pte)      (0)
 #endif
@@ -238,7 +234,7 @@ extern void __sync_icache_dcache(pte_t pteval, unsigned long addr);
  * When hardware DBM is not present, the sofware PTE_DIRTY bit is updated via
  * the page fault mechanism. Checking the dirty status of a pte becomes:
  *
- *   PTE_DIRTY || !PTE_RDONLY
+ *   PTE_DIRTY || (PTE_WRITE && !PTE_RDONLY)
  */
 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
                              pte_t *ptep, pte_t pte)
@@ -503,7 +499,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
                              PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK;
        /* preserve the hardware dirty information */
        if (pte_hw_dirty(pte))
-               newprot |= PTE_DIRTY;
+               pte = pte_mkdirty(pte);
        pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
        return pte;
 }
index 9b3b62ac9c244ba91b9f7020ac7fe0dbb141c5ec..cebf78661a553775003bfee8ec89f65e33e3ec55 100644 (file)
@@ -134,7 +134,7 @@ static int os_lock_notify(struct notifier_block *self,
                                    unsigned long action, void *data)
 {
        int cpu = (unsigned long)data;
-       if (action == CPU_ONLINE)
+       if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
                smp_call_function_single(cpu, clear_os_lock, NULL, 1);
        return NOTIFY_OK;
 }
index a055be6125cf592d06e957df0b1125d409c9a5cf..90d09eddd5b27368e358efd44ab552db8330d39c 100644 (file)
@@ -523,6 +523,11 @@ CPU_LE(    movk    x0, #0x30d0, lsl #16    )       // Clear EE and E0E on LE systems
        msr     hstr_el2, xzr                   // Disable CP15 traps to EL2
 #endif
 
+       /* EL2 debug */
+       mrs     x0, pmcr_el0                    // Disable debug access traps
+       ubfx    x0, x0, #11, #5                 // to EL2 and allow access to
+       msr     mdcr_el2, x0                    // all PMU counters from EL1
+
        /* Stage-2 translation */
        msr     vttbr_el2, xzr
 
index c97040ecf838096069e1ebd0fdd50f2d0050b5ad..bba85c8f80373937ef9fe746e1a2ed4fc39f58ee 100644 (file)
@@ -872,7 +872,7 @@ static int hw_breakpoint_reset_notify(struct notifier_block *self,
                                                void *hcpu)
 {
        int cpu = (long)hcpu;
-       if (action == CPU_ONLINE)
+       if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
                smp_call_function_single(cpu, hw_breakpoint_reset, NULL, 1);
        return NOTIFY_OK;
 }
index 67bf4107f6efe8401e1df29ad471ff8aac8cb01d..876eb8df50bf3355ac8432a2ddf2a5c46810a5de 100644 (file)
@@ -332,12 +332,14 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
                        ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21,
                                             AARCH64_INSN_IMM_ADR);
                        break;
+#ifndef CONFIG_ARM64_ERRATUM_843419
                case R_AARCH64_ADR_PREL_PG_HI21_NC:
                        overflow_check = false;
                case R_AARCH64_ADR_PREL_PG_HI21:
                        ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21,
                                             AARCH64_INSN_IMM_ADR);
                        break;
+#endif
                case R_AARCH64_ADD_ABS_LO12_NC:
                case R_AARCH64_LDST8_ABS_LO12_NC:
                        overflow_check = false;
index 948f0ad2de231b5e3f5efa62e204162cadf26503..71ef6dc89ae509cd299eab3f1959ffe4e8f96a33 100644 (file)
@@ -212,14 +212,32 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
 
 /*
  * VFP save/restore code.
+ *
+ * We have to be careful with endianness, since the fpsimd context-switch
+ * code operates on 128-bit (Q) register values whereas the compat ABI
+ * uses an array of 64-bit (D) registers. Consequently, we need to swap
+ * the two halves of each Q register when running on a big-endian CPU.
  */
+union __fpsimd_vreg {
+       __uint128_t     raw;
+       struct {
+#ifdef __AARCH64EB__
+               u64     hi;
+               u64     lo;
+#else
+               u64     lo;
+               u64     hi;
+#endif
+       };
+};
+
 static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame)
 {
        struct fpsimd_state *fpsimd = &current->thread.fpsimd_state;
        compat_ulong_t magic = VFP_MAGIC;
        compat_ulong_t size = VFP_STORAGE_SIZE;
        compat_ulong_t fpscr, fpexc;
-       int err = 0;
+       int i, err = 0;
 
        /*
         * Save the hardware registers to the fpsimd_state structure.
@@ -235,10 +253,15 @@ static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame)
        /*
         * Now copy the FP registers. Since the registers are packed,
         * we can copy the prefix we want (V0-V15) as it is.
-        * FIXME: Won't work if big endian.
         */
-       err |= __copy_to_user(&frame->ufp.fpregs, fpsimd->vregs,
-                             sizeof(frame->ufp.fpregs));
+       for (i = 0; i < ARRAY_SIZE(frame->ufp.fpregs); i += 2) {
+               union __fpsimd_vreg vreg = {
+                       .raw = fpsimd->vregs[i >> 1],
+               };
+
+               __put_user_error(vreg.lo, &frame->ufp.fpregs[i], err);
+               __put_user_error(vreg.hi, &frame->ufp.fpregs[i + 1], err);
+       }
 
        /* Create an AArch32 fpscr from the fpsr and the fpcr. */
        fpscr = (fpsimd->fpsr & VFP_FPSCR_STAT_MASK) |
@@ -263,7 +286,7 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame)
        compat_ulong_t magic = VFP_MAGIC;
        compat_ulong_t size = VFP_STORAGE_SIZE;
        compat_ulong_t fpscr;
-       int err = 0;
+       int i, err = 0;
 
        __get_user_error(magic, &frame->magic, err);
        __get_user_error(size, &frame->size, err);
@@ -273,12 +296,14 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame)
        if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
                return -EINVAL;
 
-       /*
-        * Copy the FP registers into the start of the fpsimd_state.
-        * FIXME: Won't work if big endian.
-        */
-       err |= __copy_from_user(fpsimd.vregs, frame->ufp.fpregs,
-                               sizeof(frame->ufp.fpregs));
+       /* Copy the FP registers into the start of the fpsimd_state. */
+       for (i = 0; i < ARRAY_SIZE(frame->ufp.fpregs); i += 2) {
+               union __fpsimd_vreg vreg;
+
+               __get_user_error(vreg.lo, &frame->ufp.fpregs[i], err);
+               __get_user_error(vreg.hi, &frame->ufp.fpregs[i + 1], err);
+               fpsimd.vregs[i >> 1] = vreg.raw;
+       }
 
        /* Extract the fpsr and the fpcr from the fpscr */
        __get_user_error(fpscr, &frame->ufp.fpscr, err);
index bfffe8f4bd53ef0ac9314acb79dbad197b953e53..5c7e920e486132c5257255ff843d81a6616670b1 100644 (file)
@@ -41,15 +41,4 @@ config KVM_ARM_HOST
        ---help---
          Provides host support for ARM processors.
 
-config KVM_ARM_MAX_VCPUS
-       int "Number maximum supported virtual CPUs per VM"
-       depends on KVM_ARM_HOST
-       default 4
-       help
-         Static number of max supported virtual CPUs per VM.
-
-         If you choose a high number, the vcpu structures will be quite
-         large, so only choose a reasonable number that you expect to
-         actually use.
-
 endif # VIRTUALIZATION
index 37c89ea2c572ed858c0425344b45e0897a89b74f..e5836138ec42a58841e7003bbb14f2b4a2126297 100644 (file)
        mrs     x5, ifsr32_el2
        stp     x4, x5, [x3]
 
-       skip_fpsimd_state x8, 3f
+       skip_fpsimd_state x8, 2f
        mrs     x6, fpexc32_el2
        str     x6, [x3, #16]
-3:
-       skip_debug_state x8, 2f
+2:
+       skip_debug_state x8, 1f
        mrs     x7, dbgvcr32_el2
        str     x7, [x3, #24]
-2:
-       skip_tee_state x8, 1f
-
-       add     x3, x2, #CPU_SYSREG_OFFSET(TEECR32_EL1)
-       mrs     x4, teecr32_el1
-       mrs     x5, teehbr32_el1
-       stp     x4, x5, [x3]
 1:
 .endm
 
        msr     dacr32_el2, x4
        msr     ifsr32_el2, x5
 
-       skip_debug_state x8, 2f
+       skip_debug_state x8, 1f
        ldr     x7, [x3, #24]
        msr     dbgvcr32_el2, x7
-2:
-       skip_tee_state x8, 1f
-
-       add     x3, x2, #CPU_SYSREG_OFFSET(TEECR32_EL1)
-       ldp     x4, x5, [x3]
-       msr     teecr32_el1, x4
-       msr     teehbr32_el1, x5
 1:
 .endm
 
@@ -570,8 +556,6 @@ alternative_endif
        mrs     x3, cntv_ctl_el0
        and     x3, x3, #3
        str     w3, [x0, #VCPU_TIMER_CNTV_CTL]
-       bic     x3, x3, #1              // Clear Enable
-       msr     cntv_ctl_el0, x3
 
        isb
 
@@ -579,6 +563,9 @@ alternative_endif
        str     x3, [x0, #VCPU_TIMER_CNTV_CVAL]
 
 1:
+       // Disable the virtual timer
+       msr     cntv_ctl_el0, xzr
+
        // Allow physical timer/counter access for the host
        mrs     x2, cnthctl_el2
        orr     x2, x2, #3
@@ -753,6 +740,9 @@ ENTRY(__kvm_vcpu_run)
        // Guest context
        add     x2, x0, #VCPU_CONTEXT
 
+       // We must restore the 32-bit state before the sysregs, thanks
+       // to Cortex-A57 erratum #852523.
+       restore_guest_32bit_state
        bl __restore_sysregs
 
        skip_debug_state x3, 1f
@@ -760,7 +750,6 @@ ENTRY(__kvm_vcpu_run)
        kern_hyp_va x3
        bl      __restore_debug
 1:
-       restore_guest_32bit_state
        restore_guest_regs
 
        // That's it, no more messing around.
index b41607d270ac83ebd1413a185753bf0b9e2af7f0..d03d3af17e7eef784d528479e2f4fed305ee5f75 100644 (file)
@@ -272,7 +272,7 @@ static int set_bvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
 {
        __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg];
 
-       if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
+       if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
                return -EFAULT;
        return 0;
 }
@@ -314,7 +314,7 @@ static int set_bcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
 {
        __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg];
 
-       if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
+       if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
                return -EFAULT;
 
        return 0;
@@ -358,7 +358,7 @@ static int set_wvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
 {
        __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg];
 
-       if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
+       if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
                return -EFAULT;
        return 0;
 }
@@ -400,7 +400,7 @@ static int set_wcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
 {
        __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg];
 
-       if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
+       if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
                return -EFAULT;
        return 0;
 }
@@ -539,13 +539,6 @@ static const struct sys_reg_desc sys_reg_descs[] = {
        { Op0(0b10), Op1(0b000), CRn(0b0111), CRm(0b1110), Op2(0b110),
          trap_dbgauthstatus_el1 },
 
-       /* TEECR32_EL1 */
-       { Op0(0b10), Op1(0b010), CRn(0b0000), CRm(0b0000), Op2(0b000),
-         NULL, reset_val, TEECR32_EL1, 0 },
-       /* TEEHBR32_EL1 */
-       { Op0(0b10), Op1(0b010), CRn(0b0001), CRm(0b0000), Op2(0b000),
-         NULL, reset_val, TEEHBR32_EL1, 0 },
-
        /* MDCCSR_EL1 */
        { Op0(0b10), Op1(0b011), CRn(0b0000), CRm(0b0001), Op2(0b000),
          trap_raz_wi },
index 0bcc4bc94b4ad3b4d72d735dc7e88a190c2e5cbe..99224dcebdc51d40cb2dff423280727ec44bacd3 100644 (file)
@@ -100,7 +100,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
        if (IS_ENABLED(CONFIG_ZONE_DMA) &&
            dev->coherent_dma_mask <= DMA_BIT_MASK(32))
                flags |= GFP_DMA;
-       if (IS_ENABLED(CONFIG_DMA_CMA) && (flags & __GFP_WAIT)) {
+       if (dev_get_cma_area(dev) && (flags & __GFP_WAIT)) {
                struct page *page;
                void *addr;
 
index d51ff8f1c541dd8cded2935f6890ce5c48dcb85e..96cabad68489fc888edfb807508abc62ec72d1ce 100644 (file)
@@ -144,7 +144,7 @@ static struct irq_chip eic_chip = {
        .irq_set_type   = eic_set_irq_type,
 };
 
-static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
+static void demux_eic_irq(struct irq_desc *desc)
 {
        struct eic *eic = irq_desc_get_handler_data(desc);
        unsigned long status, pending;
index 157a5e0e789f6744d62672dd0a03ca066d960079..4f61378c3453792af416dae65ffa1e9a8c70f4ff 100644 (file)
@@ -281,7 +281,7 @@ static struct irq_chip gpio_irqchip = {
        .irq_set_type   = gpio_irq_type,
 };
 
-static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void gpio_irq_handler(struct irq_desc *desc)
 {
        struct pio_device       *pio = irq_desc_get_chip_data(desc);
        unsigned                gpio_irq;
index 4b2a992794d77b187c657ad515d9db17bf4002ed..d2f90c72378eef684d04544ae401c41a047897a4 100644 (file)
@@ -60,7 +60,7 @@ extern void bfin_internal_mask_irq(unsigned int irq);
 extern void bfin_internal_unmask_irq(unsigned int irq);
 
 struct irq_desc;
-extern void bfin_demux_mac_status_irq(unsigned int, struct irq_desc *);
-extern void bfin_demux_gpio_irq(unsigned int, struct irq_desc *);
+extern void bfin_demux_mac_status_irq(struct irq_desc *);
+extern void bfin_demux_gpio_irq(struct irq_desc *);
 
 #endif
index 0ba25764b8c0472ccd01959b1300c9b2efe9fa34..052cde5ed2e403111fd8a1639dd29835177d7496 100644 (file)
@@ -107,7 +107,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
         * than crashing, do something sensible.
         */
        if (irq >= NR_IRQS)
-               handle_bad_irq(irq, &bad_irq_desc);
+               handle_bad_irq(&bad_irq_desc);
        else
                generic_handle_irq(irq);
 
index 14b2f74554dc6de142955b98482cbd8c4ff3e76b..a48baae4384dd3697e42eb07dcd95dbe197d7cab 100644 (file)
@@ -89,8 +89,7 @@ static struct irq_chip bf537_generic_error_irqchip = {
        .irq_unmask = bf537_generic_error_unmask_irq,
 };
 
-static void bf537_demux_error_irq(unsigned int int_err_irq,
-                                 struct irq_desc *inta_desc)
+static void bf537_demux_error_irq(struct irq_desc *inta_desc)
 {
        int irq = 0;
 
@@ -182,15 +181,12 @@ static struct irq_chip bf537_mac_rx_irqchip = {
        .irq_unmask = bf537_mac_rx_unmask_irq,
 };
 
-static void bf537_demux_mac_rx_irq(unsigned int __int_irq,
-                                  struct irq_desc *desc)
+static void bf537_demux_mac_rx_irq(struct irq_desc *desc)
 {
-       unsigned int int_irq = irq_desc_get_irq(desc);
-
        if (bfin_read_DMA1_IRQ_STATUS() & (DMA_DONE | DMA_ERR))
                bfin_handle_irq(IRQ_MAC_RX);
        else
-               bfin_demux_gpio_irq(int_irq, desc);
+               bfin_demux_gpio_irq(desc);
 }
 #endif
 
index a6d1b03cdf3693d2905e27ff113f6bbe34c7c056..e8d4d748d0fd759222bbc4d0e07f59dbb90d4a70 100644 (file)
@@ -656,8 +656,7 @@ static struct irq_chip bfin_mac_status_irqchip = {
        .irq_set_wake = bfin_mac_status_set_wake,
 };
 
-void bfin_demux_mac_status_irq(unsigned int int_err_irq,
-                              struct irq_desc *inta_desc)
+void bfin_demux_mac_status_irq(struct irq_desc *inta_desc)
 {
        int i, irq = 0;
        u32 status = bfin_read_EMAC_SYSTAT();
@@ -825,7 +824,7 @@ static void bfin_demux_gpio_block(unsigned int irq)
        }
 }
 
-void bfin_demux_gpio_irq(unsigned int __inta_irq, struct irq_desc *desc)
+void bfin_demux_gpio_irq(struct irq_desc *desc)
 {
        unsigned int inta_irq = irq_desc_get_irq(desc);
        unsigned int irq;
index d487698e978a16411cf27b98ea02253ed84c4f44..ddcb45d7dfa7dcb4f16408ec8eaca6eeae03566d 100644 (file)
@@ -93,7 +93,7 @@ static struct irq_chip megamod_chip = {
        .irq_unmask     = unmask_megamod,
 };
 
-static void megamod_irq_cascade(unsigned int __irq, struct irq_desc *desc)
+static void megamod_irq_cascade(struct irq_desc *desc)
 {
        struct megamod_cascade_data *cascade;
        struct megamod_pic *pic;
index 95c39b95e97e24f1ed3d7a58cf56dbbefc2ff419..99c96a5e6016b50a951ba8dfccf609cb06962232 100644 (file)
@@ -11,7 +11,7 @@
 
 
 
-#define NR_syscalls                    319 /* length of syscall table */
+#define NR_syscalls                    321 /* length of syscall table */
 
 /*
  * The following defines stop scripts/checksyscalls.sh from complaining about
index 461079560c78728848b7631de5efbe700d146620..98e94e19a5a0870fc71b34f85310f475de85697b 100644 (file)
 #define __NR_memfd_create              1340
 #define __NR_bpf                       1341
 #define __NR_execveat                  1342
+#define __NR_userfaultfd               1343
+#define __NR_membarrier                        1344
 
 #endif /* _UAPI_ASM_IA64_UNISTD_H */
index ae0de7bf55257682dc11a1cc1fa31bc6cffa3112..37cc7a65cd3ee1fc3304d862776f438db4158b4d 100644 (file)
@@ -1768,5 +1768,7 @@ sys_call_table:
        data8 sys_memfd_create                  // 1340
        data8 sys_bpf
        data8 sys_execveat
+       data8 sys_userfaultfd
+       data8 sys_membarrier
 
        .org sys_call_table + 8*NR_syscalls     // guard against failures to increase NR_syscalls
index 47b5f90002abe3c69bbc66ffee7a82f5cee4f6cb..7ff739e9489688a1bd81cd48bfa6ac49104ac5d9 100644 (file)
@@ -46,7 +46,7 @@ static struct irq_chip amiga_irq_chip = {
  * The builtin Amiga hardware interrupt handlers.
  */
 
-static void ami_int1(unsigned int irq, struct irq_desc *desc)
+static void ami_int1(struct irq_desc *desc)
 {
        unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 
@@ -69,7 +69,7 @@ static void ami_int1(unsigned int irq, struct irq_desc *desc)
        }
 }
 
-static void ami_int3(unsigned int irq, struct irq_desc *desc)
+static void ami_int3(struct irq_desc *desc)
 {
        unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 
@@ -92,7 +92,7 @@ static void ami_int3(unsigned int irq, struct irq_desc *desc)
        }
 }
 
-static void ami_int4(unsigned int irq, struct irq_desc *desc)
+static void ami_int4(struct irq_desc *desc)
 {
        unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 
@@ -121,7 +121,7 @@ static void ami_int4(unsigned int irq, struct irq_desc *desc)
        }
 }
 
-static void ami_int5(unsigned int irq, struct irq_desc *desc)
+static void ami_int5(struct irq_desc *desc)
 {
        unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
 
index 47371de60427bd61b4d8c0f6abb6f5de95978c80..b0a19e207a636cba22f64ab154a765e7e9b03b1e 100644 (file)
@@ -143,12 +143,10 @@ static int intc_irq_set_type(struct irq_data *d, unsigned int type)
  * We need to be careful with the masking/acking due to the side effects
  * of masking an interrupt.
  */
-static void intc_external_irq(unsigned int __irq, struct irq_desc *desc)
+static void intc_external_irq(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
-
        irq_desc_get_chip(desc)->irq_ack(&desc->irq_data);
-       handle_simple_irq(irq, desc);
+       handle_simple_irq(desc);
 }
 
 static struct irq_chip intc_irq_chip = {
index 81ca118d58af90da793a8038225c6ec605c2d63a..a644f4a53b94d73fce835168f49ee75e6c10fbc7 100644 (file)
@@ -64,8 +64,7 @@ extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int,
                                                      struct pt_regs *));
 extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt);
 extern void m68k_setup_irq_controller(struct irq_chip *,
-                                     void (*handle)(unsigned int irq,
-                                                    struct irq_desc *desc),
+                                     void (*handle)(struct irq_desc *desc),
                                      unsigned int irq, unsigned int cnt);
 
 extern unsigned int irq_canonicalize(unsigned int irq);
index fe3fc9ae1b69d0163805c0265c862c1125d53f8e..53c632c85b0377ac9bc07cf9bc09d4dbf6b8941c 100644 (file)
@@ -261,7 +261,7 @@ extern void via_irq_enable(int);
 extern void via_irq_disable(int);
 extern void via_nubus_irq_startup(int irq);
 extern void via_nubus_irq_shutdown(int irq);
-extern void via1_irq(unsigned int irq, struct irq_desc *desc);
+extern void via1_irq(struct irq_desc *desc);
 extern void via1_set_head(int);
 extern int via2_scsi_drq_pending(void);
 
index 3fe0e43d44f630dafea61dcdaa44835e0e84bbcd..f6f7d42713ec8b95ad7aa19a4be08156cf261697 100644 (file)
@@ -45,7 +45,7 @@ void __init baboon_init(void)
  * Baboon interrupt handler. This works a lot like a VIA.
  */
 
-static void baboon_irq(unsigned int irq, struct irq_desc *desc)
+static void baboon_irq(struct irq_desc *desc)
 {
        int irq_bit, irq_num;
        unsigned char events;
index 191610d97689932ba8413af2ccc27b77e3addc9f..55d6592783f55710d0b23cae075f657252826650 100644 (file)
@@ -63,7 +63,7 @@ void __init oss_nubus_init(void)
  * Handle miscellaneous OSS interrupts.
  */
 
-static void oss_irq(unsigned int __irq, struct irq_desc *desc)
+static void oss_irq(struct irq_desc *desc)
 {
        int events = oss->irq_pending &
                (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM);
@@ -99,7 +99,7 @@ static void oss_irq(unsigned int __irq, struct irq_desc *desc)
  * Unlike the VIA/RBV this is on its own autovector interrupt level.
  */
 
-static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc)
+static void oss_nubus_irq(struct irq_desc *desc)
 {
        int events, irq_bit, i;
 
index 3b9e302e7a37f5fa80336bca8f5af07e131b5fbc..cd38f29955c87421e8142c8d4ca9e065111b57c3 100644 (file)
@@ -113,7 +113,7 @@ void __init psc_init(void)
  * PSC interrupt handler. It's a lot like the VIA interrupt handler.
  */
 
-static void psc_irq(unsigned int __irq, struct irq_desc *desc)
+static void psc_irq(struct irq_desc *desc)
 {
        unsigned int offset = (unsigned int)irq_desc_get_handler_data(desc);
        unsigned int irq = irq_desc_get_irq(desc);
index e198dec868e472e802768c5a9459e498e7623b00..ce56e04386e707350568fd5850a4f44259f033b0 100644 (file)
@@ -446,7 +446,7 @@ void via_nubus_irq_shutdown(int irq)
  * via6522.c :-), disable/pending masks added.
  */
 
-void via1_irq(unsigned int irq, struct irq_desc *desc)
+void via1_irq(struct irq_desc *desc)
 {
        int irq_num;
        unsigned char irq_bit, events;
@@ -467,7 +467,7 @@ void via1_irq(unsigned int irq, struct irq_desc *desc)
        } while (events >= irq_bit);
 }
 
-static void via2_irq(unsigned int irq, struct irq_desc *desc)
+static void via2_irq(struct irq_desc *desc)
 {
        int irq_num;
        unsigned char irq_bit, events;
@@ -493,7 +493,7 @@ static void via2_irq(unsigned int irq, struct irq_desc *desc)
  * VIA2 dispatcher as a fast interrupt handler.
  */
 
-void via_nubus_irq(unsigned int irq, struct irq_desc *desc)
+static void via_nubus_irq(struct irq_desc *desc)
 {
        int slot_irq;
        unsigned char slot_bit, events;
index a336094a7a6c943b43dda144b44054d83bb4f54e..3074b64793e6fc9b57e8ac772c8e26274c36d8b6 100644 (file)
@@ -94,13 +94,11 @@ void do_IRQ(int irq, struct pt_regs *regs)
                        "MOV   D0.5,%0\n"
                        "MOV   D1Ar1,%1\n"
                        "MOV   D1RtP,%2\n"
-                       "MOV   D0Ar2,%3\n"
                        "SWAP  A0StP,D0.5\n"
                        "SWAP  PC,D1RtP\n"
                        "MOV   A0StP,D0.5\n"
                        :
-                       : "r" (isp), "r" (irq), "r" (desc->handle_irq),
-                         "r" (desc)
+                       : "r" (isp), "r" (desc), "r" (desc->handle_irq)
                        : "memory", "cc", "D1Ar1", "D0Ar2", "D1Ar3", "D0Ar4",
                          "D1Ar5", "D0Ar6", "D0Re0", "D1Re0", "D0.4", "D1RtP",
                          "D0.5"
index 4c496c50edf699a6ed426f4f3d658bd2919cf6db..da9f9220048fceeafe755057c58905ae74e5abd2 100644 (file)
@@ -851,7 +851,7 @@ static struct syscore_ops alchemy_gpic_pmops = {
 
 /* create chained handlers for the 4 IC requests to the MIPS IRQ ctrl */
 #define DISP(name, base, addr)                                               \
-static void au1000_##name##_dispatch(unsigned int irq, struct irq_desc *d)    \
+static void au1000_##name##_dispatch(struct irq_desc *d)                     \
 {                                                                            \
        unsigned long r = __raw_readl((void __iomem *)KSEG1ADDR(addr));       \
        if (likely(r))                                                        \
@@ -865,7 +865,7 @@ DISP(ic0r1, AU1000_INTC0_INT_BASE, AU1000_IC0_PHYS_ADDR + IC_REQ1INT)
 DISP(ic1r0, AU1000_INTC1_INT_BASE, AU1000_IC1_PHYS_ADDR + IC_REQ0INT)
 DISP(ic1r1, AU1000_INTC1_INT_BASE, AU1000_IC1_PHYS_ADDR + IC_REQ1INT)
 
-static void alchemy_gpic_dispatch(unsigned int irq, struct irq_desc *d)
+static void alchemy_gpic_dispatch(struct irq_desc *d)
 {
        int i = __raw_readl(AU1300_GPIC_ADDR + AU1300_GPIC_PRIENC);
        generic_handle_irq(ALCHEMY_GPIC_INT_BASE + i);
index 324ad72d7c3622414280af50ab579e5dd107f3eb..faeddf119fd4247ea4ad5b0c87c611b466ef58a1 100644 (file)
@@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(bcsr_mod);
 /*
  * DB1200/PB1200 CPLD IRQ muxer
  */
-static void bcsr_csc_handler(unsigned int irq, struct irq_desc *d)
+static void bcsr_csc_handler(struct irq_desc *d)
 {
        unsigned short bisr = __raw_readw(bcsr_virt + BCSR_REG_INTSTAT);
        struct irq_chip *chip = irq_desc_get_chip(d);
index ec9a371f1e62c49b823bdac3b86d101804796da3..8da996142d6a04c5336549c65a8b578142dbd783 100644 (file)
@@ -69,7 +69,7 @@ static struct irqaction ar2315_ahb_err_interrupt  = {
        .name           = "ar2315-ahb-error",
 };
 
-static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc)
+static void ar2315_misc_irq_handler(struct irq_desc *desc)
 {
        u32 pending = ar2315_rst_reg_read(AR2315_ISR) &
                      ar2315_rst_reg_read(AR2315_IMR);
index e63e38fa488033499cdf005df028d15e9b616139..acd55a9cffe3ecce5a7c6b03dab67c8adcc8b8d1 100644 (file)
@@ -73,7 +73,7 @@ static struct irqaction ar5312_ahb_err_interrupt  = {
        .name    = "ar5312-ahb-error",
 };
 
-static void ar5312_misc_irq_handler(unsigned irq, struct irq_desc *desc)
+static void ar5312_misc_irq_handler(struct irq_desc *desc)
 {
        u32 pending = ar5312_rst_reg_read(AR5312_ISR) &
                      ar5312_rst_reg_read(AR5312_IMR);
index 807132b838b24914d072c6ed81a0f86b2e57d56a..15ecb4831e125838477a4805810381e1f1bb6725 100644 (file)
@@ -26,7 +26,7 @@
 #include "common.h"
 #include "machtypes.h"
 
-static void ath79_misc_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ath79_misc_irq_handler(struct irq_desc *desc)
 {
        void __iomem *base = ath79_reset_base;
        u32 pending;
@@ -119,7 +119,7 @@ static void __init ath79_misc_irq_init(void)
        irq_set_chained_handler(ATH79_CPU_IRQ(6), ath79_misc_irq_handler);
 }
 
-static void ar934x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+static void ar934x_ip2_irq_dispatch(struct irq_desc *desc)
 {
        u32 status;
 
@@ -148,7 +148,7 @@ static void ar934x_ip2_irq_init(void)
        irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
 }
 
-static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+static void qca955x_ip2_irq_dispatch(struct irq_desc *desc)
 {
        u32 status;
 
@@ -171,7 +171,7 @@ static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
        }
 }
 
-static void qca955x_ip3_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+static void qca955x_ip3_irq_dispatch(struct irq_desc *desc)
 {
        u32 status;
 
index f26c3c661cca9eae9051f2f822a8ef61fd8c63a0..0352bc8d56b316588dbca209462700c4ffa03aa3 100644 (file)
@@ -2221,7 +2221,7 @@ static irqreturn_t octeon_irq_cib_handler(int my_irq, void *data)
                        if (irqd_get_trigger_type(irq_data) &
                                IRQ_TYPE_EDGE_BOTH)
                                cvmx_write_csr(host_data->raw_reg, 1ull << i);
-                       generic_handle_irq_desc(irq, desc);
+                       generic_handle_irq_desc(desc);
                }
        }
 
index e8c8d9d0c45fe7c3600ba39a44e7090ba0827a04..3a54dbca9f7e0b9d0ab11d0a65aad59ddb9bc29b 100644 (file)
@@ -128,6 +128,7 @@ struct kvm_vcpu_stat {
        u32 msa_disabled_exits;
        u32 flush_dcache_exits;
        u32 halt_successful_poll;
+       u32 halt_attempted_poll;
        u32 halt_wakeup;
 };
 
index 2a4c128277e45400fa4061bff15a17a1e10fc442..be52c2125d7101e37b805aef738ffa252c03d341 100644 (file)
@@ -57,8 +57,8 @@
 #include <asm/mach-netlogic/multi-node.h>
 
 struct irq_desc;
-void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc);
-void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc);
+void nlm_smp_function_ipi_handler(struct irq_desc *desc);
+void nlm_smp_resched_ipi_handler(struct irq_desc *desc);
 void nlm_smp_irq_init(int hwcpuid);
 void nlm_boot_secondary_cpus(void);
 int nlm_wakeup_secondary_cpus(void);
index 6cd69fdaa1c5f95f9ce06ab31b1177c73a7f650f..a74e181058b0fc8ce001fffc68bce8f95bc7f02d 100644 (file)
@@ -291,7 +291,7 @@ static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int i
        writel(mask, reg);
 }
 
-static void jz_gpio_irq_demux_handler(unsigned int irq, struct irq_desc *desc)
+static void jz_gpio_irq_demux_handler(struct irq_desc *desc)
 {
        uint32_t flag;
        unsigned int gpio_irq;
index cd4c129ce7434d60fc6af74bb6b764b536de4dda..49ff3bfc007e534529d0f61d21b6fddd6578d145 100644 (file)
@@ -55,6 +55,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "msa_disabled", VCPU_STAT(msa_disabled_exits), KVM_STAT_VCPU },
        { "flush_dcache", VCPU_STAT(flush_dcache_exits), KVM_STAT_VCPU },
        { "halt_successful_poll", VCPU_STAT(halt_successful_poll), KVM_STAT_VCPU },
+       { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll), KVM_STAT_VCPU },
        { "halt_wakeup",  VCPU_STAT(halt_wakeup),        KVM_STAT_VCPU },
        {NULL}
 };
index 0136b4f9c9cde0e4cfa95c8a58d441093d3e8009..10d86d54880ab8541eecf01f8d1f0dd2b3d6ee18 100644 (file)
@@ -82,7 +82,7 @@ void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action)
 }
 
 /* IRQ_IPI_SMP_FUNCTION Handler */
-void nlm_smp_function_ipi_handler(unsigned int __irq, struct irq_desc *desc)
+void nlm_smp_function_ipi_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        clear_c0_eimr(irq);
@@ -92,7 +92,7 @@ void nlm_smp_function_ipi_handler(unsigned int __irq, struct irq_desc *desc)
 }
 
 /* IRQ_IPI_SMP_RESCHEDULE  handler */
-void nlm_smp_resched_ipi_handler(unsigned int __irq, struct irq_desc *desc)
+void nlm_smp_resched_ipi_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        clear_c0_eimr(irq);
index f8d0acb4f973635ff323585ce4e5a2166c081a3a..b4fa6413c4e52fbdf71c3ec62126577f1ff8f67a 100644 (file)
@@ -318,7 +318,7 @@ static int ar2315_pci_host_setup(struct ar2315_pci_ctrl *apc)
        return 0;
 }
 
-static void ar2315_pci_irq_handler(unsigned irq, struct irq_desc *desc)
+static void ar2315_pci_irq_handler(struct irq_desc *desc)
 {
        struct ar2315_pci_ctrl *apc = irq_desc_get_handler_data(desc);
        u32 pending = ar2315_pci_reg_read(apc, AR2315_PCI_ISR) &
index ad35a5e6a56c5b4ca978f702a8786b1dcd998fa3..7db963deec737747de9f2e7dedcdf049a93a6115 100644 (file)
@@ -226,7 +226,7 @@ static struct pci_ops ar71xx_pci_ops = {
        .write  = ar71xx_pci_write_config,
 };
 
-static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ar71xx_pci_irq_handler(struct irq_desc *desc)
 {
        struct ar71xx_pci_controller *apc;
        void __iomem *base = ath79_reset_base;
index 907d11dd921b3da9b2f540b4ae14eab897a70588..2013dad700dfa9c38c7618067c8fb78fbd0f7350 100644 (file)
@@ -225,7 +225,7 @@ static struct pci_ops ar724x_pci_ops = {
        .write  = ar724x_pci_write,
 };
 
-static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ar724x_pci_irq_handler(struct irq_desc *desc)
 {
        struct ar724x_pci_controller *apc;
        void __iomem *base;
index 53c8efaf15723c882952a0bcc5572c18f7a9e049..ed6732f9aa874c2557a93de78e9cb1c816320af1 100644 (file)
@@ -129,7 +129,7 @@ static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc,
        rt3883_pci_w32(rpc, val, RT3883_PCI_REG_CFGDATA);
 }
 
-static void rt3883_pci_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void rt3883_pci_irq_handler(struct irq_desc *desc)
 {
        struct rt3883_pci_controller *rpc;
        u32 pending;
index 8c624a8b9ea29f5611abceb531de09c865e46b7c..4cf77f358395d4bd92d6527ab41578fefa3691d6 100644 (file)
@@ -96,7 +96,7 @@ unsigned int get_c0_compare_int(void)
        return CP0_LEGACY_COMPARE_IRQ;
 }
 
-static void ralink_intc_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ralink_intc_irq_handler(struct irq_desc *desc)
 {
        u32 pending = rt_intc_r32(INTC_REG_STATUS0);
 
index 73eddda53b8ed014369d1576a5d8ddb7bbeabaab..4eec430d8fa86d7c197c2230285986c692198115 100644 (file)
@@ -28,6 +28,9 @@ BOOTCFLAGS    += -m64
 endif
 ifdef CONFIG_CPU_BIG_ENDIAN
 BOOTCFLAGS     += -mbig-endian
+else
+BOOTCFLAGS     += -mlittle-endian
+BOOTCFLAGS     += $(call cc-option,-mabi=elfv2)
 endif
 
 BOOTAFLAGS     := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
index 98eebbf663405c59ebcc3174d8619773f9813ac1..195886a583bab5c3d4dbc88782785cff95d309a9 100644 (file)
@@ -108,6 +108,7 @@ struct kvm_vcpu_stat {
        u32 dec_exits;
        u32 ext_intr_exits;
        u32 halt_successful_poll;
+       u32 halt_attempted_poll;
        u32 halt_wakeup;
        u32 dbell_exits;
        u32 gdbell_exits;
index 25784cc959a072a9dc50d0b596f28d0d3f56cc59..1e155ca6d33cf906affd34bf05e6be6409356892 100644 (file)
@@ -59,14 +59,14 @@ enum qe_ic_grp_id {
 
 #ifdef CONFIG_QUICC_ENGINE
 void qe_ic_init(struct device_node *node, unsigned int flags,
-               void (*low_handler)(unsigned int irq, struct irq_desc *desc),
-               void (*high_handler)(unsigned int irq, struct irq_desc *desc));
+               void (*low_handler)(struct irq_desc *desc),
+               void (*high_handler)(struct irq_desc *desc));
 unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic);
 unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic);
 #else
 static inline void qe_ic_init(struct device_node *node, unsigned int flags,
-               void (*low_handler)(unsigned int irq, struct irq_desc *desc),
-               void (*high_handler)(unsigned int irq, struct irq_desc *desc))
+               void (*low_handler)(struct irq_desc *desc),
+               void (*high_handler)(struct irq_desc *desc))
 {}
 static inline unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic)
 { return 0; }
@@ -78,8 +78,7 @@ void qe_ic_set_highest_priority(unsigned int virq, int high);
 int qe_ic_set_priority(unsigned int virq, unsigned int priority);
 int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high);
 
-static inline void qe_ic_cascade_low_ipic(unsigned int irq,
-                                         struct irq_desc *desc)
+static inline void qe_ic_cascade_low_ipic(struct irq_desc *desc)
 {
        struct qe_ic *qe_ic = irq_desc_get_handler_data(desc);
        unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
@@ -88,8 +87,7 @@ static inline void qe_ic_cascade_low_ipic(unsigned int irq,
                generic_handle_irq(cascade_irq);
 }
 
-static inline void qe_ic_cascade_high_ipic(unsigned int irq,
-                                          struct irq_desc *desc)
+static inline void qe_ic_cascade_high_ipic(struct irq_desc *desc)
 {
        struct qe_ic *qe_ic = irq_desc_get_handler_data(desc);
        unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
@@ -98,8 +96,7 @@ static inline void qe_ic_cascade_high_ipic(unsigned int irq,
                generic_handle_irq(cascade_irq);
 }
 
-static inline void qe_ic_cascade_low_mpic(unsigned int irq,
-                                         struct irq_desc *desc)
+static inline void qe_ic_cascade_low_mpic(struct irq_desc *desc)
 {
        struct qe_ic *qe_ic = irq_desc_get_handler_data(desc);
        unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
@@ -111,8 +108,7 @@ static inline void qe_ic_cascade_low_mpic(unsigned int irq,
        chip->irq_eoi(&desc->irq_data);
 }
 
-static inline void qe_ic_cascade_high_mpic(unsigned int irq,
-                                          struct irq_desc *desc)
+static inline void qe_ic_cascade_high_mpic(struct irq_desc *desc)
 {
        struct qe_ic *qe_ic = irq_desc_get_handler_data(desc);
        unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
@@ -124,8 +120,7 @@ static inline void qe_ic_cascade_high_mpic(unsigned int irq,
        chip->irq_eoi(&desc->irq_data);
 }
 
-static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
-                                           struct irq_desc *desc)
+static inline void qe_ic_cascade_muxed_mpic(struct irq_desc *desc)
 {
        struct qe_ic *qe_ic = irq_desc_get_handler_data(desc);
        unsigned int cascade_irq;
index 71f2b3f02cf8848425b26d92e6bd6f650ce726f8..4d65499ee1c115b32193dea7a9015c9e03e82e9c 100644 (file)
@@ -368,3 +368,4 @@ SYSCALL_SPU(memfd_create)
 SYSCALL_SPU(bpf)
 COMPAT_SYS(execveat)
 PPC64ONLY(switch_endian)
+SYSCALL_SPU(userfaultfd)
index 5653d7cc3e2404f35443682e6252b46e66103f09..ae59d5b672b0b9f8f9b8c6907e19ea5d14fd11e7 100644 (file)
@@ -39,7 +39,7 @@
 
 extern int tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary);
 extern void tsi108_pci_int_init(struct device_node *node);
-extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
+extern void tsi108_irq_cascade(struct irq_desc *desc);
 extern void tsi108_clear_pci_cfg_error(void);
 
 #endif                         /*  _ASM_POWERPC_TSI108_PCI_H */
index f4f8b667d75be5614bd8f706b5573e21cdd9a685..4a055b6c2a64f0f4153a1c2dea557289d2e56941 100644 (file)
@@ -12,7 +12,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define __NR_syscalls          364
+#define __NR_syscalls          365
 
 #define __NR__exit __NR_exit
 #define NR_syscalls    __NR_syscalls
index e4aa173dae62361e3823f3eda242b2802cdd5da1..6ad58d4c879bf6a1018420540d73dc2efc5fc7da 100644 (file)
 #define __NR_bpf               361
 #define __NR_execveat          362
 #define __NR_switch_endian     363
+#define __NR_userfaultfd       364
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
index 45096033d37bf7082bfe80dd7a25c782a4b1943a..290559df1e8b305d941ab52d7022a818b92ee8b8 100644 (file)
@@ -441,7 +441,7 @@ void migrate_irqs(void)
 
                chip = irq_data_get_irq_chip(data);
 
-               cpumask_and(mask, data->affinity, map);
+               cpumask_and(mask, irq_data_get_affinity_mask(data), map);
                if (cpumask_any(mask) >= nr_cpu_ids) {
                        pr_warn("Breaking affinity for irq %i\n", irq);
                        cpumask_copy(mask, map);
index bb02e9f6944e264f52e13d3f4cc1ea51beaccce2..ad8c9db61237223c3b807e3a9afed1487c44af1e 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/udbg.h>
 #include <asm/mmu_context.h>
 #include <asm/epapr_hcalls.h>
+#include <asm/code-patching.h>
 
 #define DBG(fmt...)
 
@@ -109,6 +110,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
  * This is called very early on the boot process, after a minimal
  * MMU environment has been set up but before MMU_init is called.
  */
+extern unsigned int memset_nocache_branch; /* Insn to be replaced by NOP */
+
 notrace void __init machine_init(u64 dt_ptr)
 {
        lockdep_init();
@@ -116,6 +119,9 @@ notrace void __init machine_init(u64 dt_ptr)
        /* Enable early debugging if any specified (see udbg.h) */
        udbg_early_init();
 
+       patch_instruction((unsigned int *)&memcpy, PPC_INST_NOP);
+       patch_instruction(&memset_nocache_branch, PPC_INST_NOP);
+
        /* Do some early initialization based on the flat device tree */
        early_init_devtree(__va(dt_ptr));
 
index d75bf325f54a17ebf4e19dda7a85eed271e4f3ed..cf009167d208db3ebf3d74a2e1f29b3bfb091d26 100644 (file)
@@ -53,6 +53,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "ext_intr",    VCPU_STAT(ext_intr_exits) },
        { "queue_intr",  VCPU_STAT(queue_intr) },
        { "halt_successful_poll", VCPU_STAT(halt_successful_poll), },
+       { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll), },
        { "halt_wakeup", VCPU_STAT(halt_wakeup) },
        { "pf_storage",  VCPU_STAT(pf_storage) },
        { "sp_storage",  VCPU_STAT(sp_storage) },
index ae458f0fd061efea7cdd569c1bdb32970503659c..fd5875179e5c0e6738a1e7867a75f05cbe1fa0c8 100644 (file)
@@ -63,6 +63,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "dec",        VCPU_STAT(dec_exits) },
        { "ext_intr",   VCPU_STAT(ext_intr_exits) },
        { "halt_successful_poll", VCPU_STAT(halt_successful_poll) },
+       { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll) },
        { "halt_wakeup", VCPU_STAT(halt_wakeup) },
        { "doorbell", VCPU_STAT(dbell_exits) },
        { "guest doorbell", VCPU_STAT(gdbell_exits) },
index 2ef50c6294709674ad69167b14ac8a5bede4631e..c44df2dbedd52f5a2726443afe5a9296326b3778 100644 (file)
@@ -73,6 +73,10 @@ CACHELINE_MASK = (L1_CACHE_BYTES-1)
  * Use dcbz on the complete cache lines in the destination
  * to set them to zero.  This requires that the destination
  * area is cacheable.  -- paulus
+ *
+ * During early init, cache might not be active yet, so dcbz cannot be used.
+ * We therefore skip the optimised bloc that uses dcbz. This jump is
+ * replaced by a nop once cache is active. This is done in machine_init()
  */
 _GLOBAL(memset)
        rlwimi  r4,r4,8,16,23
@@ -88,6 +92,8 @@ _GLOBAL(memset)
        subf    r6,r0,r6
        cmplwi  0,r4,0
        bne     2f      /* Use normal procedure if r4 is not zero */
+_GLOBAL(memset_nocache_branch)
+       b       2f      /* Skip optimised bloc until cache is enabled */
 
        clrlwi  r7,r6,32-LG_CACHELINE_BYTES
        add     r8,r7,r5
@@ -128,6 +134,10 @@ _GLOBAL(memset)
  * the destination area is cacheable.
  * We only use this version if the source and dest don't overlap.
  * -- paulus.
+ *
+ * During early init, cache might not be active yet, so dcbz cannot be used.
+ * We therefore jump to generic_memcpy which doesn't use dcbz. This jump is
+ * replaced by a nop once cache is active. This is done in machine_init()
  */
 _GLOBAL(memmove)
        cmplw   0,r3,r4
@@ -135,6 +145,7 @@ _GLOBAL(memmove)
        /* fall through */
 
 _GLOBAL(memcpy)
+       b       generic_memcpy
        add     r7,r3,r5                /* test if the src & dst overlap */
        add     r8,r4,r5
        cmplw   0,r4,r7
index 43dafb9d6a46f6c75bb4e4095426c3a1d8a824bd..4d87122cf6a725805d3de6bdf46cc44b9d3f91ef 100644 (file)
@@ -85,7 +85,6 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
        BUG_ON(index >= 4096);
 
        vpn = hpt_vpn(ea, vsid, ssize);
-       hash = hpt_hash(vpn, shift, ssize);
        hpte_slot_array = get_hpte_slot_array(pmdp);
        if (psize == MMU_PAGE_4K) {
                /*
@@ -101,6 +100,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
        valid = hpte_valid(hpte_slot_array, index);
        if (valid) {
                /* update the hpte bits */
+               hash = hpt_hash(vpn, shift, ssize);
                hidx =  hpte_hash_index(hpte_slot_array, index);
                if (hidx & _PTEIDX_SECONDARY)
                        hash = ~hash;
@@ -126,6 +126,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
        if (!valid) {
                unsigned long hpte_group;
 
+               hash = hpt_hash(vpn, shift, ssize);
                /* insert new entry */
                pa = pmd_pfn(__pmd(old_pmd)) << PAGE_SHIFT;
                new_pmd |= _PAGE_HASHPTE;
index 11090ab4bf59a38f2b78074fd8b7a9e10467656d..0035d146df73a2e2d2ed23c89d0a6b2f36cc667a 100644 (file)
@@ -104,9 +104,10 @@ cpld_pic_get_irq(int offset, u8 ignore, u8 __iomem *statusp,
        return irq_linear_revmap(cpld_pic_host, cpld_irq);
 }
 
-static void
-cpld_pic_cascade(unsigned int irq, struct irq_desc *desc)
+static void cpld_pic_cascade(struct irq_desc *desc)
 {
+       unsigned int irq;
+
        irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status,
                &cpld_regs->pci_mask);
        if (irq != NO_IRQ) {
index 32cae33c4266b990d2dc88d89cc6d6df8ae9a9df..8fb95480fd733c1dbe9fed18612fc999833356c5 100644 (file)
@@ -80,7 +80,7 @@ static struct irq_chip media5200_irq_chip = {
        .irq_mask_ack = media5200_irq_mask,
 };
 
-void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc)
+static void media5200_irq_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        int sub_virq, val;
index 63016621aff8af4807b37ed7af2a7ee078755e4b..78ac19aefa4dd27ac9495d1649bd7ad401107db4 100644 (file)
@@ -191,7 +191,7 @@ static struct irq_chip mpc52xx_gpt_irq_chip = {
        .irq_set_type = mpc52xx_gpt_irq_set_type,
 };
 
-void mpc52xx_gpt_irq_cascade(unsigned int virq, struct irq_desc *desc)
+static void mpc52xx_gpt_irq_cascade(struct irq_desc *desc)
 {
        struct mpc52xx_gpt_priv *gpt = irq_desc_get_handler_data(desc);
        int sub_virq;
index 2944bc84b9d6fc790bc2b3ece7878cdf1ff208ba..4fe2074c88cb94bbb67927a485ec6c17ea27277a 100644 (file)
@@ -196,7 +196,7 @@ static int mpc52xx_extirq_set_type(struct irq_data *d, unsigned int flow_type)
        ctrl_reg |= (type << (22 - (l2irq * 2)));
        out_be32(&intr->ctrl, ctrl_reg);
 
-       __irq_set_handler_locked(d->irq, handler);
+       irq_set_handler_locked(d, handler);
 
        return 0;
 }
index 74861a7fb807d8c2441f3cce86c5921e8c4787f5..60e89fc9c753549e01648cbd95a45a7889221428 100644 (file)
@@ -78,7 +78,7 @@ static struct irq_chip pq2ads_pci_ic = {
        .irq_disable = pq2ads_pci_mask_irq
 };
 
-static void pq2ads_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void pq2ads_pci_irq_demux(struct irq_desc *desc)
 {
        struct pq2ads_pci_pic *priv = irq_desc_get_handler_data(desc);
        u32 stat, mask, pend;
index 7bfb9b184dd4bbc87670fe84a7d34e5fd14bff87..23791de7b688f91aa4b87770a1c5ae40931137a4 100644 (file)
@@ -49,7 +49,7 @@ int __init mpc85xx_common_publish_devices(void)
        return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
 }
 #ifdef CONFIG_CPM2
-static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
+static void cpm2_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        int cascade_irq;
index b0753e2220862cb1585fefa23aee64889390b4d3..5ac70de3e48ace4d756f4f84157f909fa4f9aa7c 100644 (file)
@@ -192,8 +192,7 @@ void mpc85xx_cds_fixup_bus(struct pci_bus *bus)
 }
 
 #ifdef CONFIG_PPC_I8259
-static void mpc85xx_8259_cascade_handler(unsigned int irq,
-                                        struct irq_desc *desc)
+static void mpc85xx_8259_cascade_handler(struct irq_desc *desc)
 {
        unsigned int cascade_irq = i8259_irq();
 
@@ -202,7 +201,7 @@ static void mpc85xx_8259_cascade_handler(unsigned int irq,
                generic_handle_irq(cascade_irq);
 
        /* check for any interrupts from the shared IRQ line */
-       handle_fasteoi_irq(irq, desc);
+       handle_fasteoi_irq(desc);
 }
 
 static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id)
index ffdf02121a7cb9ecf51d888cf26126a621faa4c4..f858306dba6aa517f3078f26cbd6b62861b3886c 100644 (file)
@@ -46,7 +46,7 @@
 #endif
 
 #ifdef CONFIG_PPC_I8259
-static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpc85xx_8259_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = i8259_irq();
index 55a9682b9529168a56e949779646ef8208693c89..b02d6a5bb03574a6f1967439d13e2ab4aa70b692 100644 (file)
@@ -91,9 +91,10 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq)
                        (irq_hw_number_t)i);
 }
 
-void socrates_fpga_pic_cascade(unsigned int irq, struct irq_desc *desc)
+static void socrates_fpga_pic_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
+       unsigned int irq = irq_desc_get_irq(desc);
        unsigned int cascade_irq;
 
        /*
index d5b98c0f958aed8c65a112b53f91effc329d5125..845defa1fd19d7e991b1d9ebe30e4fb893763d93 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/i8259.h>
 
 #ifdef CONFIG_PPC_I8259
-static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpc86xx_8259_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = i8259_irq();
index d3037747031d6f55b46da885ec2b173d84a1a276..c289fc77b4ba6c979b3a46b2776b4dc5bbc8bc87 100644 (file)
@@ -214,7 +214,7 @@ void mpc8xx_restart(char *cmd)
        panic("Restart failed\n");
 }
 
-static void cpm_cascade(unsigned int irq, struct irq_desc *desc)
+static void cpm_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        int cascade_irq = cpm_get_irq();
index 306888acb737a0d94a11fc70497b93e7c173e55d..e0e68a1c0d3c20dd5d618e62cdccba2e429af475 100644 (file)
@@ -93,7 +93,7 @@ static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
        dcr_write(msic->dcr_host, dcr_n, val);
 }
 
-static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
+static void axon_msi_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct axon_msic *msic = irq_desc_get_handler_data(desc);
index a15f1efc295f936d3de64bb17a62d76c86778a1c..9f609fc8d331fc1579216a6283ee281d181fb0b9 100644 (file)
@@ -99,11 +99,12 @@ static void iic_ioexc_eoi(struct irq_data *d)
 {
 }
 
-static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc)
+static void iic_ioexc_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct cbe_iic_regs __iomem *node_iic =
                (void __iomem *)irq_desc_get_handler_data(desc);
+       unsigned int irq = irq_desc_get_irq(desc);
        unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC;
        unsigned long bits, ack;
        int cascade;
index 1f72f4ab6353cdcee1c2cae3d2f7d01a694a903d..9d27de62dc62755c4800d46bcc8b4409a81a5115 100644 (file)
@@ -199,7 +199,7 @@ static const struct irq_domain_ops spider_host_ops = {
        .xlate = spider_host_xlate,
 };
 
-static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc)
+static void spider_irq_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct spider_pic *pic = irq_desc_get_handler_data(desc);
index 15ebc4e8a151695d6b8dbc6130fd82e4d5860b0d..987d1b8d68e3dba186bbceda54631ecdd4c48136 100644 (file)
@@ -363,7 +363,7 @@ void __init chrp_setup_arch(void)
        if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
 }
 
-static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void chrp_8259_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = i8259_irq();
index 9dd154d6f89a9205aa33eff33930e2cb0efc3397..9b7975706bfc7a5538ac24a9ae74ed661ff390f9 100644 (file)
@@ -120,8 +120,7 @@ static unsigned int __hlwd_pic_get_irq(struct irq_domain *h)
        return irq_linear_revmap(h, irq);
 }
 
-static void hlwd_pic_irq_cascade(unsigned int cascade_virq,
-                                     struct irq_desc *desc)
+static void hlwd_pic_irq_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct irq_domain *irq_domain = irq_desc_get_handler_data(desc);
index 1613303177e64e6b3b60830c90b6be50a56e01a7..8f65aa3747f5afefbc91c558884b10ad282c3ab3 100644 (file)
@@ -42,7 +42,7 @@
 static phys_addr_t pci_membase;
 static u_char *restart;
 
-static void mvme5100_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void mvme5100_8259_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = i8259_irq();
index e66ef19433387854820e91a2b515d737fd7fd270..b304a9fe55cc410e2bcbd9693a84bce1d2bf5365 100644 (file)
@@ -63,6 +63,7 @@ static struct irq_chip mpic_pasemi_msi_chip = {
 static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
 {
        struct msi_desc *entry;
+       irq_hw_number_t hwirq;
 
        pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
 
@@ -70,10 +71,10 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
                if (entry->irq == NO_IRQ)
                        continue;
 
+               hwirq = virq_to_hw(entry->irq);
                irq_set_msi_desc(entry->irq, NULL);
-               msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
-                                      virq_to_hw(entry->irq), ALLOC_CHUNK);
                irq_dispose_mapping(entry->irq);
+               msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK);
        }
 
        return;
index 2927cd5c830309fed2b5d2a696b5a83767f0f444..414fd1a00fda85b243dcb2839a4929b09be4a52c 100644 (file)
@@ -2049,9 +2049,23 @@ static long pnv_pci_ioda2_setup_default_config(struct pnv_ioda_pe *pe)
        struct iommu_table *tbl = NULL;
        long rc;
 
+       /*
+        * crashkernel= specifies the kdump kernel's maximum memory at
+        * some offset and there is no guaranteed the result is a power
+        * of 2, which will cause errors later.
+        */
+       const u64 max_memory = __rounddown_pow_of_two(memory_hotplug_max());
+
+       /*
+        * In memory constrained environments, e.g. kdump kernel, the
+        * DMA window can be larger than available memory, which will
+        * cause errors later.
+        */
+       const u64 window_size = min((u64)pe->table_group.tce32_size, max_memory);
+
        rc = pnv_pci_ioda2_create_table(&pe->table_group, 0,
                        IOMMU_PAGE_SHIFT_4K,
-                       pe->table_group.tce32_size,
+                       window_size,
                        POWERNV_IOMMU_DEFAULT_LEVELS, &tbl);
        if (rc) {
                pe_err(pe, "Failed to create 32-bit TCE table, err %ld",
index 9b2480b265c00b59e9290b8e5979ac4c9cb7aa0a..f2dd7723424034a0626c28ca2cc9762f79123984 100644 (file)
@@ -99,6 +99,7 @@ void pnv_teardown_msi_irqs(struct pci_dev *pdev)
        struct pci_controller *hose = pci_bus_to_host(pdev->bus);
        struct pnv_phb *phb = hose->private_data;
        struct msi_desc *entry;
+       irq_hw_number_t hwirq;
 
        if (WARN_ON(!phb))
                return;
@@ -106,10 +107,10 @@ void pnv_teardown_msi_irqs(struct pci_dev *pdev)
        for_each_pci_msi_entry(entry, pdev) {
                if (entry->irq == NO_IRQ)
                        continue;
+               hwirq = virq_to_hw(entry->irq);
                irq_set_msi_desc(entry->irq, NULL);
-               msi_bitmap_free_hwirqs(&phb->msi_bmp,
-                       virq_to_hw(entry->irq) - phb->msi_base, 1);
                irq_dispose_mapping(entry->irq);
+               msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq - phb->msi_base, 1);
        }
 }
 #endif /* CONFIG_PCI_MSI */
index 47d9cebe7159edb2d5d72a3167a89d928dbaa5dc..db17827eb7465a38a3dee939a7a1e68ce13a1c58 100644 (file)
@@ -422,8 +422,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
 
        dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
        of_node_put(parent);
-       if (!dn)
+       if (!dn) {
+               dlpar_release_drc(drc_index);
                return -EINVAL;
+       }
 
        rc = dlpar_attach_node(dn);
        if (rc) {
index 39a74fad3e04526eb73222d51a6bf4812c64b034..9a83eb71b0300adb44f99aee93c0f9f790a4471a 100644 (file)
@@ -111,7 +111,7 @@ static void __init fwnmi_init(void)
                fwnmi_active = 1;
 }
 
-static void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void pseries_8259_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = i8259_irq();
index a11bd1d433adf7e749ad7e3008f7327bdff29110..9e86074719a96e2f3c47b4a1f69f453483e61f8f 100644 (file)
@@ -155,9 +155,9 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type)
 
        irqd_set_trigger_type(d, flow_type);
        if (flow_type & IRQ_TYPE_LEVEL_LOW)
-               __irq_set_handler_locked(d->irq, handle_level_irq);
+               irq_set_handler_locked(d, handle_level_irq);
        else
-               __irq_set_handler_locked(d->irq, handle_edge_irq);
+               irq_set_handler_locked(d, handle_edge_irq);
 
        /* internal IRQ senses are LEVEL_LOW
         * EXT IRQ and Port C IRQ senses are programmable
index 5916da1856a78d924230ede7353ed84a8b1fa8a0..48a576aa47b92455e97a3f437b5cc18b6007f91a 100644 (file)
@@ -128,15 +128,16 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev)
 {
        struct msi_desc *entry;
        struct fsl_msi *msi_data;
+       irq_hw_number_t hwirq;
 
        for_each_pci_msi_entry(entry, pdev) {
                if (entry->irq == NO_IRQ)
                        continue;
+               hwirq = virq_to_hw(entry->irq);
                msi_data = irq_get_chip_data(entry->irq);
                irq_set_msi_desc(entry->irq, NULL);
-               msi_bitmap_free_hwirqs(&msi_data->bitmap,
-                                      virq_to_hw(entry->irq), 1);
                irq_dispose_mapping(entry->irq);
+               msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
        }
 
        return;
index 2bcb78bb3a15b4ea8043b78b892224d01ef2050f..d57b77573068aa7ca966a27334422a3c7ba00be9 100644 (file)
@@ -91,7 +91,7 @@ static int gef_pic_cascade_irq;
  * should be masked out.
  */
 
-void gef_pic_cascade(unsigned int irq, struct irq_desc *desc)
+static void gef_pic_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq;
index 908dbd9826b6e15bf0fa8e916116ea0c568a44c7..5bf7e4b81e36c9edf60f0c9f8edae47a47f80179 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef __GEF_PIC_H__
 #define __GEF_PIC_H__
 
-
-void gef_pic_cascade(unsigned int, struct irq_desc *);
 unsigned int gef_pic_get_irq(void);
 void gef_pic_init(struct device_node *);
 
index 6b2b689148104a25003fba7380af676f2a85e055..b1297ab1599b46ef24457ec890b28b69ba4dc0bf 100644 (file)
@@ -624,10 +624,10 @@ static int ipic_set_irq_type(struct irq_data *d, unsigned int flow_type)
 
        irqd_set_trigger_type(d, flow_type);
        if (flow_type & IRQ_TYPE_LEVEL_LOW)  {
-               __irq_set_handler_locked(d->irq, handle_level_irq);
+               irq_set_handler_locked(d, handle_level_irq);
                d->chip = &ipic_level_irq_chip;
        } else {
-               __irq_set_handler_locked(d->irq, handle_edge_irq);
+               irq_set_handler_locked(d, handle_edge_irq);
                d->chip = &ipic_edge_irq_chip;
        }
 
index d93a78be43469cfe5fe7f481bdf5ceb99114e11b..9a423975853ae36a3f60b452a9bbef4dc1060985 100644 (file)
@@ -55,7 +55,7 @@ static int mpc8xx_set_irq_type(struct irq_data *d, unsigned int flow_type)
                unsigned int siel = in_be32(&siu_reg->sc_siel);
                siel |= mpc8xx_irqd_to_bit(d);
                out_be32(&siu_reg->sc_siel, siel);
-               __irq_set_handler_locked(d->irq, handle_edge_irq);
+               irq_set_handler_locked(d, handle_edge_irq);
        }
        return 0;
 }
index 97a8ae8f94dd5d3fe77753c4546c6c7ab6329a49..537e5db85a060518928ee812cdab8dd00a311b06 100644 (file)
@@ -1181,7 +1181,7 @@ static int mpic_host_xlate(struct irq_domain *h, struct device_node *ct,
 }
 
 /* IRQ handler for a secondary MPIC cascaded from another IRQ controller */
-static void mpic_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpic_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct mpic *mpic = irq_desc_get_handler_data(desc);
index 70fbd5694a8bcd3c171bc9615edf14e86cdde7b1..2cbc7e29b85ff1301360ab3f9c379837a471d122 100644 (file)
@@ -107,15 +107,16 @@ static u64 find_u4_magic_addr(struct pci_dev *pdev, unsigned int hwirq)
 static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
 {
        struct msi_desc *entry;
+       irq_hw_number_t hwirq;
 
        for_each_pci_msi_entry(entry, pdev) {
                if (entry->irq == NO_IRQ)
                        continue;
 
+               hwirq = virq_to_hw(entry->irq);
                irq_set_msi_desc(entry->irq, NULL);
-               msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
-                                      virq_to_hw(entry->irq), 1);
                irq_dispose_mapping(entry->irq);
+               msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
        }
 
        return;
index 24d0470c1698fb2bbbe81008e575ca54a35c33ce..8fb8061350431ad8bea7b17df85a530f3c006e53 100644 (file)
@@ -124,16 +124,17 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev)
 {
        struct msi_desc *entry;
        struct ppc4xx_msi *msi_data = &ppc4xx_msi;
+       irq_hw_number_t hwirq;
 
        dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n");
 
        for_each_pci_msi_entry(entry, dev) {
                if (entry->irq == NO_IRQ)
                        continue;
+               hwirq = virq_to_hw(entry->irq);
                irq_set_msi_desc(entry->irq, NULL);
-               msi_bitmap_free_hwirqs(&msi_data->bitmap,
-                               virq_to_hw(entry->irq), 1);
                irq_dispose_mapping(entry->irq);
+               msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
        }
 }
 
index 47b352e4bc743f532aa637d9d18daf7319207f92..fbcc1f855a7f2ea15937d02f0b0cb4305af5034a 100644 (file)
@@ -311,8 +311,8 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic)
 }
 
 void __init qe_ic_init(struct device_node *node, unsigned int flags,
-               void (*low_handler)(unsigned int irq, struct irq_desc *desc),
-               void (*high_handler)(unsigned int irq, struct irq_desc *desc))
+                      void (*low_handler)(struct irq_desc *desc),
+                      void (*high_handler)(struct irq_desc *desc))
 {
        struct qe_ic *qe_ic;
        struct resource res;
index 57b54476e74721eabccf3f15f130c6e2f40c81eb..379de955aae378441b2220d5b329e8b00d881ef4 100644 (file)
@@ -428,7 +428,7 @@ void __init tsi108_pci_int_init(struct device_node *node)
        init_pci_source();
 }
 
-void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc)
+void tsi108_irq_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = get_pci_source();
index d77345338671c1d63b5a98d3258885d9d3aa2b98..6893d8f236df8903120cf8331d9a33f3444f051f 100644 (file)
@@ -194,7 +194,7 @@ static const struct irq_domain_ops uic_host_ops = {
        .xlate  = irq_domain_xlate_twocell,
 };
 
-void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
+static void uic_irq_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct irq_data *idata = irq_desc_get_irq_data(desc);
index 11ac964d51752f3ce4c55a9953b02e0ee9936e08..27c936c080a66ffb5523931ac74d6c4c3a01849d 100644 (file)
@@ -54,7 +54,7 @@ static void ics_opal_unmask_irq(struct irq_data *d)
        if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)
                return;
 
-       server = xics_get_irq_server(d->irq, d->affinity, 0);
+       server = xics_get_irq_server(d->irq, irq_data_get_affinity_mask(d), 0);
        server = ics_opal_mangle_server(server);
 
        rc = opal_set_xive(hw_irq, server, DEFAULT_PRIORITY);
index d1c625c4cc5a4081686f2c83f7d2f0a51dbdd53e..3854dd41558d2697e73f9d72f9dffb27327952a8 100644 (file)
@@ -47,7 +47,7 @@ static void ics_rtas_unmask_irq(struct irq_data *d)
        if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)
                return;
 
-       server = xics_get_irq_server(d->irq, d->affinity, 0);
+       server = xics_get_irq_server(d->irq, irq_data_get_affinity_mask(d), 0);
 
        call_status = rtas_call(ibm_set_xive, 3, 1, NULL, hw_irq, server,
                                DEFAULT_PRIORITY);
index 43b8b275bc5c50e778e79f9695f9ffb85a266328..0f52d79557967c85cb5510be3cd4fea5ad3dc6db 100644 (file)
@@ -222,7 +222,7 @@ int xilinx_intc_get_irq(void)
 /*
  * Support code for cascading to 8259 interrupt controllers
  */
-static void xilinx_i8259_cascade(unsigned int irq, struct irq_desc *desc)
+static void xilinx_i8259_cascade(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned int cascade_irq = i8259_irq();
index 3d012e071647970ce14ee2eb566649ada4b000e6..6ce4a0b7e8dafb7bed2fec0a824e0aeb886e6066 100644 (file)
@@ -210,6 +210,7 @@ struct kvm_vcpu_stat {
        u32 exit_validity;
        u32 exit_instruction;
        u32 halt_successful_poll;
+       u32 halt_attempted_poll;
        u32 halt_wakeup;
        u32 instruction_lctl;
        u32 instruction_lctlg;
index c91eb941b444ee7cad8c5a9ea2523495e71e8f2d..0a67c40eece9b0f7bc74a350221975d2c7393cb0 100644 (file)
@@ -63,6 +63,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "exit_program_interruption", VCPU_STAT(exit_program_interruption) },
        { "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) },
        { "halt_successful_poll", VCPU_STAT(halt_successful_poll) },
+       { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll) },
        { "halt_wakeup", VCPU_STAT(halt_wakeup) },
        { "instruction_lctlg", VCPU_STAT(instruction_lctlg) },
        { "instruction_lctl", VCPU_STAT(instruction_lctl) },
@@ -1574,7 +1575,7 @@ static void kvm_s390_vcpu_request(struct kvm_vcpu *vcpu)
 
 static void kvm_s390_vcpu_request_handled(struct kvm_vcpu *vcpu)
 {
-       atomic_or(PROG_REQUEST, &vcpu->arch.sie_block->prog20);
+       atomic_andnot(PROG_REQUEST, &vcpu->arch.sie_block->prog20);
 }
 
 /*
index 6f97a8f0d0d65718c09282fd146e8ca2d3a0c96e..6129aef6db766366dd5628aa760f1a70d6ce2707 100644 (file)
@@ -29,7 +29,7 @@
 static void __iomem *se7343_irq_regs;
 struct irq_domain *se7343_irq_domain;
 
-static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void se7343_irq_demux(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct irq_chip *chip = irq_data_get_irq_chip(data);
index 60aebd14ccf8c5cd44e287d0ec958a78a136ca4f..24c74a88290c6559ef59108e4a478805c6bfd1b2 100644 (file)
@@ -28,7 +28,7 @@
 static void __iomem *se7722_irq_regs;
 struct irq_domain *se7722_irq_domain;
 
-static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void se7722_irq_demux(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct irq_chip *chip = irq_data_get_irq_chip(data);
index 9f20338986521ba2d81b89a5a2f3b3c9d3fdfcd8..64e681e66c5797c68b5d3f59929b5c17960a825a 100644 (file)
@@ -92,7 +92,7 @@ static struct irq_chip se7724_irq_chip __read_mostly = {
        .irq_unmask     = enable_se7724_irq,
 };
 
-static void se7724_irq_demux(unsigned int __irq, struct irq_desc *desc)
+static void se7724_irq_demux(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct fpga_irq set = get_fpga_irq(irq);
index 24555c364d5bccfd0ff4e8ffa737d757a421aa3f..1fb2cbee25f2c5108ef8e8ba49b010ad6730006d 100644 (file)
@@ -60,7 +60,7 @@ static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
        return virq;
 }
 
-static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void x3proto_gpio_irq_handler(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct irq_chip *chip = irq_data_get_irq_chip(data);
index e9735616bdc8ac96bb5fee14923ba53a0d5f12dd..8180092502f7040c4a0d94a1040d4629aab7dfa2 100644 (file)
@@ -56,7 +56,7 @@ static struct irq_chip hd64461_irq_chip = {
        .irq_unmask     = hd64461_unmask_irq,
 };
 
-static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void hd64461_irq_demux(struct irq_desc *desc)
 {
        unsigned short intv = __raw_readw(HD64461_NIRR);
        unsigned int ext_irq = HD64461_IRQBASE;
index 0299f052a2efc0a2f67321a51fa46094d0cf0fed..42efcf85f721b17196f88810fa52f82b0d24bf0d 100644 (file)
@@ -53,7 +53,7 @@ static inline unsigned int leon_eirq_get(int cpu)
 }
 
 /* Handle one or multiple IRQs from the extended interrupt controller */
-static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc)
+static void leon_handle_ext_irq(struct irq_desc *desc)
 {
        unsigned int eirq;
        struct irq_bucket *p;
index 3382f7b3eeef2d9a5c74dece68e983501af955c0..1e77128a8f881b9670342d17f7f67d44d38b8698 100644 (file)
@@ -357,7 +357,7 @@ static struct irq_chip grpci1_irq = {
 };
 
 /* Handle one or multiple IRQs from the PCI core */
-static void grpci1_pci_flow_irq(unsigned int irq, struct irq_desc *desc)
+static void grpci1_pci_flow_irq(struct irq_desc *desc)
 {
        struct grpci1_priv *priv = grpci1priv;
        int i, ack = 0;
index 814fb1729b120bdeccbe2aacea958e7ae8add28d..f727c4de1316578505ed37aee52e39f9e9626ea5 100644 (file)
@@ -498,7 +498,7 @@ static struct irq_chip grpci2_irq = {
 };
 
 /* Handle one or multiple IRQs from the PCI core */
-static void grpci2_pci_flow_irq(unsigned int irq, struct irq_desc *desc)
+static void grpci2_pci_flow_irq(struct irq_desc *desc)
 {
        struct grpci2_priv *priv = grpci2priv;
        int i, ack = 0;
index b3f73fd764a35b60002b507ea029c732363d4a6f..4c017d0d2de8c193f14f301138a45134bd587c5e 100644 (file)
@@ -304,17 +304,16 @@ static struct irq_chip tilegx_legacy_irq_chip = {
  * to Linux which just calls handle_level_irq() after clearing the
  * MAC INTx Assert status bit associated with this interrupt.
  */
-static void trio_handle_level_irq(unsigned int __irq, struct irq_desc *desc)
+static void trio_handle_level_irq(struct irq_desc *desc)
 {
        struct pci_controller *controller = irq_desc_get_handler_data(desc);
        gxio_trio_context_t *trio_context = controller->trio;
        uint64_t intx = (uint64_t)irq_desc_get_chip_data(desc);
-       unsigned int irq = irq_desc_get_irq(desc);
        int mac = controller->mac;
        unsigned int reg_offset;
        uint64_t level_mask;
 
-       handle_level_irq(irq, desc);
+       handle_level_irq(desc);
 
        /*
         * Clear the INTx Level status, otherwise future interrupts are
index c53729d92e8df72529e5370f100a5b51b84977ce..eb1fd00303598bfcbdc0136e2656a2fb265bbd31 100644 (file)
@@ -112,7 +112,7 @@ static struct irq_chip puv3_low_gpio_chip = {
  * irq_controller_lock held, and IRQs disabled.  Decode the IRQ
  * and call the handler.
  */
-static void puv3_gpio_handler(unsigned int __irq, struct irq_desc *desc)
+static void puv3_gpio_handler(struct irq_desc *desc)
 {
        unsigned int mask, irq;
 
index 7aef2d52daa0d8ea8b55a683a11eb2c2e204eaef..328c8352480c5dcfd34d72a70d01d6a57e5bb515 100644 (file)
@@ -1006,7 +1006,7 @@ config X86_THERMAL_VECTOR
        depends on X86_MCE_INTEL
 
 config X86_LEGACY_VM86
-       bool "Legacy VM86 support (obsolete)"
+       bool "Legacy VM86 support"
        default n
        depends on X86_32
        ---help---
@@ -1018,19 +1018,20 @@ config X86_LEGACY_VM86
          available to accelerate real mode DOS programs.  However, any
          recent version of DOSEMU, X, or vbetool should be fully
          functional even without kernel VM86 support, as they will all
-         fall back to (pretty well performing) software emulation.
+         fall back to software emulation. Nevertheless, if you are using
+         a 16-bit DOS program where 16-bit performance matters, vm86
+         mode might be faster than emulation and you might want to
+         enable this option.
 
-         Anything that works on a 64-bit kernel is unlikely to need
-         this option, as 64-bit kernels don't, and can't, support V8086
-         mode.  This option is also unrelated to 16-bit protected mode
-         and is not needed to run most 16-bit programs under Wine.
+         Note that any app that works on a 64-bit kernel is unlikely to
+         need this option, as 64-bit kernels don't, and can't, support
+         V8086 mode. This option is also unrelated to 16-bit protected
+         mode and is not needed to run most 16-bit programs under Wine.
 
-         Enabling this option adds considerable attack surface to the
-         kernel and slows down system calls and exception handling.
+         Enabling this option increases the complexity of the kernel
+         and slows down exception handling a tiny bit.
 
-         Unless you use very old userspace or need the last drop of
-         performance in your real mode DOS games and can't use KVM,
-         say N here.
+         If unsure, say N here.
 
 config VM86
        bool
index 477fc28050e447681e957a470d756205fef81eca..e6cf2ad350d15a8e6ca207a2618c77d820aacc22 100644 (file)
 #define X86_FEATURE_AVX512PF   ( 9*32+26) /* AVX-512 Prefetch */
 #define X86_FEATURE_AVX512ER   ( 9*32+27) /* AVX-512 Exponential and Reciprocal */
 #define X86_FEATURE_AVX512CD   ( 9*32+28) /* AVX-512 Conflict Detection */
+#define X86_FEATURE_SHA_NI     ( 9*32+29) /* SHA1/SHA256 Instruction Extensions */
 
 /* Extended state features, CPUID level 0x0000000d:1 (eax), word 10 */
 #define X86_FEATURE_XSAVEOPT   (10*32+ 0) /* XSAVEOPT */
index c12e845f59e6b40c5afb62d8ecf1e08f22dce4db..349f80a82b8207411f3e377f8fa924bb19d060f0 100644 (file)
@@ -711,6 +711,7 @@ struct kvm_vcpu_stat {
        u32 nmi_window_exits;
        u32 halt_exits;
        u32 halt_successful_poll;
+       u32 halt_attempted_poll;
        u32 halt_wakeup;
        u32 request_irq_exits;
        u32 irq_exits;
index ce029e4fa7c62bc2bf969ed8df9f2330af2abb28..31247b5bff7c8ff86d893851dc9073b72a647cc2 100644 (file)
@@ -97,7 +97,6 @@ struct pv_lazy_ops {
 struct pv_time_ops {
        unsigned long long (*sched_clock)(void);
        unsigned long long (*steal_clock)(int cpu);
-       unsigned long (*get_tsc_khz)(void);
 };
 
 struct pv_cpu_ops {
index 9d51fae1cba345e5cf01387a6c16207a6b5be872..eaba0807603009e6ed1612a7049bb35bafeaf31e 100644 (file)
@@ -39,18 +39,27 @@ static inline void queued_spin_unlock(struct qspinlock *lock)
 }
 #endif
 
-#define virt_queued_spin_lock virt_queued_spin_lock
-
-static inline bool virt_queued_spin_lock(struct qspinlock *lock)
+#ifdef CONFIG_PARAVIRT
+#define virt_spin_lock virt_spin_lock
+static inline bool virt_spin_lock(struct qspinlock *lock)
 {
        if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
                return false;
 
-       while (atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL) != 0)
-               cpu_relax();
+       /*
+        * On hypervisors without PARAVIRT_SPINLOCKS support we fall
+        * back to a Test-and-Set spinlock, because fair locks have
+        * horrible lock 'holder' preemption issues.
+        */
+
+       do {
+               while (atomic_read(&lock->val) != 0)
+                       cpu_relax();
+       } while (atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL) != 0);
 
        return true;
 }
+#endif /* CONFIG_PARAVIRT */
 
 #include <asm-generic/qspinlock.h>
 
index c42827eb86cf0c52c36389d0c26dc937776b03bf..25f909362b7a89c42f32c8ebe74fb91239df3ca8 100644 (file)
@@ -338,10 +338,15 @@ done:
 
 static void __init_or_module optimize_nops(struct alt_instr *a, u8 *instr)
 {
+       unsigned long flags;
+
        if (instr[0] != 0x90)
                return;
 
+       local_irq_save(flags);
        add_nops(instr + (a->instrlen - a->padlen), a->padlen);
+       sync_core();
+       local_irq_restore(flags);
 
        DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ",
                   instr, a->instrlen - a->padlen, a->padlen);
index 3ca3e46aa405ff606c205e849e9470735405f4cf..24e94ce454e2363e6ad14ae2e4cff6c4ac492ab4 100644 (file)
@@ -336,6 +336,13 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
        apic_write(APIC_LVTT, lvtt_value);
 
        if (lvtt_value & APIC_LVT_TIMER_TSCDEADLINE) {
+               /*
+                * See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode,
+                * writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized.
+                * According to Intel, MFENCE can do the serialization here.
+                */
+               asm volatile("mfence" : : : "memory");
+
                printk_once(KERN_DEBUG "TSC deadline timer enabled\n");
                return;
        }
index 38a76f826530358c898ae781cebea72069e3277c..5c60bb16262203ab63720ee349384180e9e7d8fb 100644 (file)
@@ -2522,6 +2522,7 @@ void __init setup_ioapic_dest(void)
        int pin, ioapic, irq, irq_entry;
        const struct cpumask *mask;
        struct irq_data *idata;
+       struct irq_chip *chip;
 
        if (skip_ioapic_setup == 1)
                return;
@@ -2545,9 +2546,9 @@ void __init setup_ioapic_dest(void)
                else
                        mask = apic->target_cpus();
 
-               irq_set_affinity(irq, mask);
+               chip = irq_data_get_irq_chip(idata);
+               chip->irq_set_affinity(idata, mask, false);
        }
-
 }
 #endif
 
index 1bbd0fe2c8062f35f795d2ed23f75373f5a6b872..836d11b92811ce73446a6081f02a38231fdb9429 100644 (file)
@@ -489,10 +489,8 @@ static int apic_set_affinity(struct irq_data *irq_data,
 
        err = assign_irq_vector(irq, data, dest);
        if (err) {
-               struct irq_data *top = irq_get_irq_data(irq);
-
                if (assign_irq_vector(irq, data,
-                                     irq_data_get_affinity_mask(top)))
+                                     irq_data_get_affinity_mask(irq_data)))
                        pr_err("Failed to recover vector for irq %d\n", irq);
                return err;
        }
index 07ce52c22ec843b72177307942bb5785e31458ef..de22ea7ff82f93ea1a8d4a204f10a7c6e8fdef76 100644 (file)
@@ -1110,10 +1110,10 @@ void print_cpu_info(struct cpuinfo_x86 *c)
        else
                printk(KERN_CONT "%d86", c->x86);
 
-       printk(KERN_CONT " (fam: %02x, model: %02x", c->x86, c->x86_model);
+       printk(KERN_CONT " (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
 
        if (c->x86_mask || c->cpuid_level >= 0)
-               printk(KERN_CONT ", stepping: %02x)\n", c->x86_mask);
+               printk(KERN_CONT ", stepping: 0x%x)\n", c->x86_mask);
        else
                printk(KERN_CONT ")\n");
 
index cd9b6d0b10bf408d04956e45c1a2d77bd3f99b07..3fefebfbdf4bb4f68e5a5bf1647550ad0cd71a75 100644 (file)
@@ -2316,9 +2316,12 @@ static struct event_constraint *
 intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
                            struct perf_event *event)
 {
-       struct event_constraint *c1 = cpuc->event_constraint[idx];
+       struct event_constraint *c1 = NULL;
        struct event_constraint *c2;
 
+       if (idx >= 0) /* fake does < 0 */
+               c1 = cpuc->event_constraint[idx];
+
        /*
         * first time only
         * - static constraint: no change across incremental scheduling calls
index 54690e885759dd7b89711d3568e8916495e7b34f..d1c0f254afbeefe61fcfaeeb7625664d7d352918 100644 (file)
@@ -222,6 +222,7 @@ static void __bts_event_start(struct perf_event *event)
        if (!buf || bts_buffer_is_full(buf, bts))
                return;
 
+       event->hw.itrace_started = 1;
        event->hw.state = 0;
 
        if (!buf->snapshot)
index c80cf66996785bd5309eaf8c1831ee0fcf7ec9b3..38da8f29a9c81f075d4b91fc6982e28ae2f28eee 100644 (file)
@@ -68,11 +68,10 @@ static inline void *current_stack(void)
        return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1));
 }
 
-static inline int
-execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
+static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc)
 {
        struct irq_stack *curstk, *irqstk;
-       u32 *isp, *prev_esp, arg1, arg2;
+       u32 *isp, *prev_esp, arg1;
 
        curstk = (struct irq_stack *) current_stack();
        irqstk = __this_cpu_read(hardirq_stack);
@@ -98,8 +97,8 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
        asm volatile("xchgl     %%ebx,%%esp     \n"
                     "call      *%%edi          \n"
                     "movl      %%ebx,%%esp     \n"
-                    : "=a" (arg1), "=d" (arg2), "=b" (isp)
-                    :  "0" (irq),   "1" (desc),  "2" (isp),
+                    : "=a" (arg1), "=b" (isp)
+                    :  "0" (desc),   "1" (isp),
                        "D" (desc->handle_irq)
                     : "memory", "cc", "ecx");
        return 1;
@@ -150,19 +149,15 @@ void do_softirq_own_stack(void)
 
 bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
 {
-       unsigned int irq;
-       int overflow;
-
-       overflow = check_stack_overflow();
+       int overflow = check_stack_overflow();
 
        if (IS_ERR_OR_NULL(desc))
                return false;
 
-       irq = irq_desc_get_irq(desc);
-       if (user_mode(regs) || !execute_on_irq_stack(overflow, desc, irq)) {
+       if (user_mode(regs) || !execute_on_irq_stack(overflow, desc)) {
                if (unlikely(overflow))
                        print_stack_overflow();
-               generic_handle_irq_desc(irq, desc);
+               generic_handle_irq_desc(desc);
        }
 
        return true;
index ff16ccb918f20c08527e95cd8073dd8b9b68f113..c767cf2bc80a0b8f44be521f6171c3d8d4fa7b7d 100644 (file)
@@ -75,6 +75,6 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
        if (unlikely(IS_ERR_OR_NULL(desc)))
                return false;
 
-       generic_handle_irq_desc(irq_desc_get_irq(desc), desc);
+       generic_handle_irq_desc(desc);
        return true;
 }
index 2bcc0525f1c10e80b3db33df075b3189c4a68239..6acc9dd91f368a1fada3f2d6dd2a0755f1d7b46d 100644 (file)
@@ -58,7 +58,7 @@ static struct ldt_struct *alloc_ldt_struct(int size)
        if (alloc_size > PAGE_SIZE)
                new_ldt->entries = vzalloc(alloc_size);
        else
-               new_ldt->entries = kzalloc(PAGE_SIZE, GFP_KERNEL);
+               new_ldt->entries = (void *)get_zeroed_page(GFP_KERNEL);
 
        if (!new_ldt->entries) {
                kfree(new_ldt);
@@ -95,7 +95,7 @@ static void free_ldt_struct(struct ldt_struct *ldt)
        if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE)
                vfree(ldt->entries);
        else
-               kfree(ldt->entries);
+               free_page((unsigned long)ldt->entries);
        kfree(ldt);
 }
 
index 84b8ef82a159bc7756914b40518d7fa00ed968ff..1b55de1267cfc4f3032b37c72c14239533fbdbcf 100644 (file)
@@ -131,8 +131,8 @@ void dma_generic_free_coherent(struct device *dev, size_t size, void *vaddr,
 
 bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp)
 {
-       *gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp);
        *gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
+       *gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp);
 
        if (!*dev)
                *dev = &x86_dma_fallback_dev;
index c8d52cb4cb6e8b9ee9d81cfc9c0fa3603284ce0e..c3f7602cd0386b2fb0a1a7437263f9c71f27d03c 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/hypervisor.h>
 #include <asm/nmi.h>
 #include <asm/x86_init.h>
+#include <asm/geode.h>
 
 unsigned int __read_mostly cpu_khz;    /* TSC clocks / usec, not used here */
 EXPORT_SYMBOL(cpu_khz);
@@ -1013,15 +1014,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
 
 static void __init check_system_tsc_reliable(void)
 {
-#ifdef CONFIG_MGEODE_LX
-       /* RTSC counts during suspend */
+#if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC)
+       if (is_geode_lx()) {
+               /* RTSC counts during suspend */
 #define RTSC_SUSP 0x100
-       unsigned long res_low, res_high;
+               unsigned long res_low, res_high;
 
-       rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
-       /* Geode_LX - the OLPC CPU has a very reliable TSC */
-       if (res_low & RTSC_SUSP)
-               tsc_clocksource_reliable = 1;
+               rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
+               /* Geode_LX - the OLPC CPU has a very reliable TSC */
+               if (res_low & RTSC_SUSP)
+                       tsc_clocksource_reliable = 1;
+       }
 #endif
        if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
                tsc_clocksource_reliable = 1;
index abd8b856bd2b50af307caa2eaad953dc80c4ed00..5246193519614dbd8d3a602544e8117376df05f7 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/audit.h>
 #include <linux/stddef.h>
 #include <linux/slab.h>
+#include <linux/security.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -232,6 +233,32 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
        struct pt_regs *regs = current_pt_regs();
        unsigned long err = 0;
 
+       err = security_mmap_addr(0);
+       if (err) {
+               /*
+                * vm86 cannot virtualize the address space, so vm86 users
+                * need to manage the low 1MB themselves using mmap.  Given
+                * that BIOS places important data in the first page, vm86
+                * is essentially useless if mmap_min_addr != 0.  DOSEMU,
+                * for example, won't even bother trying to use vm86 if it
+                * can't map a page at virtual address 0.
+                *
+                * To reduce the available kernel attack surface, simply
+                * disallow vm86(old) for users who cannot mmap at va 0.
+                *
+                * The implementation of security_mmap_addr will allow
+                * suitably privileged users to map va 0 even if
+                * vm.mmap_min_addr is set above 0, and we want this
+                * behavior for vm86 as well, as it ensures that legacy
+                * tools like vbetool will not fail just because of
+                * vm.mmap_min_addr.
+                */
+               pr_info_once("Denied a call to vm86(old) from %s[%d] (uid: %d).  Set the vm.mmap_min_addr sysctl to 0 and/or adjust LSM mmap_min_addr policy to enable vm86 if you are using a vm86-based DOS emulator.\n",
+                            current->comm, task_pid_nr(current),
+                            from_kuid_munged(&init_user_ns, current_uid()));
+               return -EPERM;
+       }
+
        if (!vm86) {
                if (!(vm86 = kzalloc(sizeof(*vm86), GFP_KERNEL)))
                        return -ENOMEM;
index d01986832afc28ed225b2f414ccb2742e528169c..64076740251e7f3b8197fe87eeff262891ac995a 100644 (file)
@@ -6064,6 +6064,8 @@ static __init int hardware_setup(void)
        memcpy(vmx_msr_bitmap_longmode_x2apic,
                        vmx_msr_bitmap_longmode, PAGE_SIZE);
 
+       set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */
+
        if (enable_apicv) {
                for (msr = 0x800; msr <= 0x8ff; msr++)
                        vmx_disable_intercept_msr_read_x2apic(msr);
index a60bdbccff5189b5a98b9a7fcc6a3b9f7ff5eeec..6bbb0dfb99d0a5e222131c9b2f8e0fb38e990cb3 100644 (file)
@@ -149,6 +149,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "nmi_window", VCPU_STAT(nmi_window_exits) },
        { "halt_exits", VCPU_STAT(halt_exits) },
        { "halt_successful_poll", VCPU_STAT(halt_successful_poll) },
+       { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll) },
        { "halt_wakeup", VCPU_STAT(halt_wakeup) },
        { "hypercalls", VCPU_STAT(hypercalls) },
        { "request_irq", VCPU_STAT(request_irq_exits) },
index 161804de124ac4b224e1bd328905fc99c959f73a..a0d09f6c65337fc381353783639f45251bf28d78 100644 (file)
@@ -1015,7 +1015,7 @@ static struct clock_event_device lguest_clockevent = {
  * This is the Guest timer interrupt handler (hardware interrupt 0).  We just
  * call the clockevent infrastructure and it does whatever needs doing.
  */
-static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
+static void lguest_time_irq(struct irq_desc *desc)
 {
        unsigned long flags;
 
index 66338a60aa6ef961c6017731b6fd6d9d169736e1..c2aea63bee2085fdb08c9d4ea8f3accaf4ae2e5e 100644 (file)
@@ -192,10 +192,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 
        node_set(node, numa_nodes_parsed);
 
-       pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s\n",
+       pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n",
                node, pxm,
                (unsigned long long) start, (unsigned long long) end - 1,
-               hotpluggable ? " hotplug" : "");
+               hotpluggable ? " hotplug" : "",
+               ma->flags & ACPI_SRAT_MEM_NON_VOLATILE ? " non-volatile" : "");
 
        /* Mark hotplug range in memblock. */
        if (hotpluggable && memblock_mark_hotplug(start, ma->length))
index 4aecca79374adefb7d9496957788f9f376aa095f..14b8faf8b09d48937985713e10ed25745aad2dc2 100644 (file)
@@ -140,6 +140,11 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
 
        iv = bip->bip_vec + bip->bip_vcnt;
 
+       if (bip->bip_vcnt &&
+           bvec_gap_to_prev(bdev_get_queue(bio->bi_bdev),
+                            &bip->bip_vec[bip->bip_vcnt - 1], offset))
+               return 0;
+
        iv->bv_page = page;
        iv->bv_len = len;
        iv->bv_offset = offset;
index ac8370cb25157d2ed1cd215f8b95edde0735e3de..55512dd626336eae49b758def08d601bc3515b74 100644 (file)
@@ -370,6 +370,9 @@ static void blkg_destroy_all(struct request_queue *q)
                blkg_destroy(blkg);
                spin_unlock(&blkcg->lock);
        }
+
+       q->root_blkg = NULL;
+       q->root_rl.blkg = NULL;
 }
 
 /*
index f548b64be09242a77f7db6ac7cedd5f68ee397b7..75f29cf701889a5711cad9e63f041bd98c74022f 100644 (file)
@@ -204,6 +204,9 @@ bool blk_integrity_merge_rq(struct request_queue *q, struct request *req,
            q->limits.max_integrity_segments)
                return false;
 
+       if (integrity_req_gap_back_merge(req, next->bio))
+               return false;
+
        return true;
 }
 EXPORT_SYMBOL(blk_integrity_merge_rq);
index 233841644c9d3ab31c6b388db5fd74cb4976c270..f565e11f465aa145120973bce58ef7ecc192f349 100644 (file)
@@ -9,6 +9,24 @@
 
 #include "blk.h"
 
+static bool iovec_gap_to_prv(struct request_queue *q,
+                            struct iovec *prv, struct iovec *cur)
+{
+       unsigned long prev_end;
+
+       if (!queue_virt_boundary(q))
+               return false;
+
+       if (prv->iov_base == NULL && prv->iov_len == 0)
+               /* prv is not set - don't check */
+               return false;
+
+       prev_end = (unsigned long)(prv->iov_base + prv->iov_len);
+
+       return (((unsigned long)cur->iov_base & queue_virt_boundary(q)) ||
+               prev_end & queue_virt_boundary(q));
+}
+
 int blk_rq_append_bio(struct request_queue *q, struct request *rq,
                      struct bio *bio)
 {
@@ -67,7 +85,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
        struct bio *bio;
        int unaligned = 0;
        struct iov_iter i;
-       struct iovec iov;
+       struct iovec iov, prv = {.iov_base = NULL, .iov_len = 0};
 
        if (!iter || !iter->count)
                return -EINVAL;
@@ -81,8 +99,12 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
                /*
                 * Keep going so we check length of all segments
                 */
-               if (uaddr & queue_dma_alignment(q))
+               if ((uaddr & queue_dma_alignment(q)) ||
+                   iovec_gap_to_prv(q, &prv, &iov))
                        unaligned = 1;
+
+               prv.iov_base = iov.iov_base;
+               prv.iov_len = iov.iov_len;
        }
 
        if (unaligned || (q->dma_pad_mask & iter->count) || map_data)
index d088cffb810508a5e55f7543bc134537329d00ec..c4e9c37f3e38122e5125502d62ab1ddd2e887408 100644 (file)
@@ -66,36 +66,33 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
                                         struct bio *bio,
                                         struct bio_set *bs)
 {
-       struct bio *split;
-       struct bio_vec bv, bvprv;
+       struct bio_vec bv, bvprv, *bvprvp = NULL;
        struct bvec_iter iter;
        unsigned seg_size = 0, nsegs = 0, sectors = 0;
-       int prev = 0;
 
        bio_for_each_segment(bv, bio, iter) {
-               sectors += bv.bv_len >> 9;
-
-               if (sectors > queue_max_sectors(q))
+               if (sectors + (bv.bv_len >> 9) > queue_max_sectors(q))
                        goto split;
 
                /*
                 * If the queue doesn't support SG gaps and adding this
                 * offset would create a gap, disallow it.
                 */
-               if (prev && bvec_gap_to_prev(q, &bvprv, bv.bv_offset))
+               if (bvprvp && bvec_gap_to_prev(q, bvprvp, bv.bv_offset))
                        goto split;
 
-               if (prev && blk_queue_cluster(q)) {
+               if (bvprvp && blk_queue_cluster(q)) {
                        if (seg_size + bv.bv_len > queue_max_segment_size(q))
                                goto new_segment;
-                       if (!BIOVEC_PHYS_MERGEABLE(&bvprv, &bv))
+                       if (!BIOVEC_PHYS_MERGEABLE(bvprvp, &bv))
                                goto new_segment;
-                       if (!BIOVEC_SEG_BOUNDARY(q, &bvprv, &bv))
+                       if (!BIOVEC_SEG_BOUNDARY(q, bvprvp, &bv))
                                goto new_segment;
 
                        seg_size += bv.bv_len;
                        bvprv = bv;
-                       prev = 1;
+                       bvprvp = &bv;
+                       sectors += bv.bv_len >> 9;
                        continue;
                }
 new_segment:
@@ -104,23 +101,14 @@ new_segment:
 
                nsegs++;
                bvprv = bv;
-               prev = 1;
+               bvprvp = &bv;
                seg_size = bv.bv_len;
+               sectors += bv.bv_len >> 9;
        }
 
        return NULL;
 split:
-       split = bio_clone_bioset(bio, GFP_NOIO, bs);
-
-       split->bi_iter.bi_size -= iter.bi_size;
-       bio->bi_iter = iter;
-
-       if (bio_integrity(bio)) {
-               bio_integrity_advance(bio, split->bi_iter.bi_size);
-               bio_integrity_trim(split, 0, bio_sectors(split));
-       }
-
-       return split;
+       return bio_split(bio, sectors, GFP_NOIO, bs);
 }
 
 void blk_queue_split(struct request_queue *q, struct bio **bio,
@@ -439,6 +427,11 @@ no_merge:
 int ll_back_merge_fn(struct request_queue *q, struct request *req,
                     struct bio *bio)
 {
+       if (req_gap_back_merge(req, bio))
+               return 0;
+       if (blk_integrity_rq(req) &&
+           integrity_req_gap_back_merge(req, bio))
+               return 0;
        if (blk_rq_sectors(req) + bio_sectors(bio) >
            blk_rq_get_max_sectors(req)) {
                req->cmd_flags |= REQ_NOMERGE;
@@ -457,6 +450,12 @@ int ll_back_merge_fn(struct request_queue *q, struct request *req,
 int ll_front_merge_fn(struct request_queue *q, struct request *req,
                      struct bio *bio)
 {
+
+       if (req_gap_front_merge(req, bio))
+               return 0;
+       if (blk_integrity_rq(req) &&
+           integrity_req_gap_front_merge(req, bio))
+               return 0;
        if (blk_rq_sectors(req) + bio_sectors(bio) >
            blk_rq_get_max_sectors(req)) {
                req->cmd_flags |= REQ_NOMERGE;
@@ -483,14 +482,6 @@ static bool req_no_special_merge(struct request *req)
        return !q->mq_ops && req->special;
 }
 
-static int req_gap_to_prev(struct request *req, struct bio *next)
-{
-       struct bio *prev = req->biotail;
-
-       return bvec_gap_to_prev(req->q, &prev->bi_io_vec[prev->bi_vcnt - 1],
-                       next->bi_io_vec[0].bv_offset);
-}
-
 static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
                                struct request *next)
 {
@@ -505,7 +496,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
        if (req_no_special_merge(req) || req_no_special_merge(next))
                return 0;
 
-       if (req_gap_to_prev(req, next->bio))
+       if (req_gap_back_merge(req, next->bio))
                return 0;
 
        /*
@@ -713,10 +704,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
            !blk_write_same_mergeable(rq->bio, bio))
                return false;
 
-       /* Only check gaps if the bio carries data */
-       if (bio_has_data(bio) && req_gap_to_prev(rq, bio))
-               return false;
-
        return true;
 }
 
index 0611aea1cfe9f0310c08043b3a281fee10835c9d..1cb5dd3a5da1e7bf834f229d2c8776bbcb65a3d4 100644 (file)
@@ -128,12 +128,14 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool)
        struct bio *bio_orig = bio->bi_private;
        struct bio_vec *bvec, *org_vec;
        int i;
+       int start = bio_orig->bi_iter.bi_idx;
 
        /*
         * free up bounce indirect pages used
         */
        bio_for_each_segment_all(bvec, bio, i) {
-               org_vec = bio_orig->bi_io_vec + i;
+               org_vec = bio_orig->bi_io_vec + i + start;
+
                if (bvec->bv_page == org_vec->bv_page)
                        continue;
 
index 35c2de13697182ba22190ea6d0c05d46c6b905be..fa18753f5c344de0eba58d9c9c1296255f4178c7 100644 (file)
@@ -940,6 +940,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
        char *xbuf[XBUFSIZE];
        char *xoutbuf[XBUFSIZE];
        int ret = -ENOMEM;
+       unsigned int ivsize = crypto_skcipher_ivsize(tfm);
 
        if (testmgr_alloc_buf(xbuf))
                goto out_nobuf;
@@ -975,7 +976,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
                        continue;
 
                if (template[i].iv)
-                       memcpy(iv, template[i].iv, MAX_IVLEN);
+                       memcpy(iv, template[i].iv, ivsize);
                else
                        memset(iv, 0, MAX_IVLEN);
 
@@ -1051,7 +1052,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
                        continue;
 
                if (template[i].iv)
-                       memcpy(iv, template[i].iv, MAX_IVLEN);
+                       memcpy(iv, template[i].iv, ivsize);
                else
                        memset(iv, 0, MAX_IVLEN);
 
index 46506e7687cd11b5e3a4918a170c7bdd1214fee9..a212cefae524f8d2daaa2b4161ee16c2fae90cf8 100644 (file)
@@ -315,14 +315,10 @@ static void acpi_bus_osc_support(void)
 
        capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
        capbuf[OSC_SUPPORT_DWORD] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */
-#if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) ||\
-                       defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
-       capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PAD_SUPPORT;
-#endif
-
-#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
-       capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PPC_OST_SUPPORT;
-#endif
+       if (IS_ENABLED(CONFIG_ACPI_PROCESSOR_AGGREGATOR))
+               capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PAD_SUPPORT;
+       if (IS_ENABLED(CONFIG_ACPI_PROCESSOR))
+               capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PPC_OST_SUPPORT;
 
        capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT;
 
index 9dcf83682e367e889db67cd5ae44670878893459..33505c651f62792e136cedc73a8b022c10f2ba21 100644 (file)
@@ -33,13 +33,12 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = {
 static int int340x_thermal_handler_attach(struct acpi_device *adev,
                                        const struct acpi_device_id *id)
 {
-#if defined(CONFIG_INT340X_THERMAL) || defined(CONFIG_INT340X_THERMAL_MODULE)
-       acpi_create_platform_device(adev);
-#elif defined(INTEL_SOC_DTS_THERMAL) || defined(INTEL_SOC_DTS_THERMAL_MODULE)
+       if (IS_ENABLED(CONFIG_INT340X_THERMAL))
+               acpi_create_platform_device(adev);
        /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */
-       if (id->driver_data == INT3401_DEVICE)
+       else if (IS_ENABLED(CONFIG_INTEL_SOC_DTS_THERMAL) &&
+                id->driver_data == INT3401_DEVICE)
                acpi_create_platform_device(adev);
-#endif
        return 1;
 }
 
index 1857a5dd08165584457efa044958e3ba84522847..134483daac25e6627234a5dac90a60687d4810dd 100644 (file)
@@ -63,20 +63,8 @@ static int platform_msi_init(struct irq_domain *domain,
                             unsigned int virq, irq_hw_number_t hwirq,
                             msi_alloc_info_t *arg)
 {
-       struct irq_data *data;
-
-       irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
-                                     info->chip, info->chip_data);
-
-       /*
-        * Save the MSI descriptor in handler_data so that the
-        * irq_write_msi_msg callback can retrieve it (and the
-        * associated device).
-        */
-       data = irq_domain_get_irq_data(domain, virq);
-       data->handler_data = arg->desc;
-
-       return 0;
+       return irq_domain_set_hwirq_and_chip(domain, virq, hwirq,
+                                            info->chip, info->chip_data);
 }
 #else
 #define platform_msi_set_desc          NULL
@@ -97,7 +85,7 @@ static void platform_msi_update_dom_ops(struct msi_domain_info *info)
 
 static void platform_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
 {
-       struct msi_desc *desc = irq_data_get_irq_handler_data(data);
+       struct msi_desc *desc = irq_data_get_msi_desc(data);
        struct platform_msi_priv_data *priv_data;
 
        priv_data = desc->platform.msi_priv_data;
index 17269a3b85f282fd33df0c1f750559ea6c749ad7..a295b98c6baed2df8bdd9484a62e44ca9bbfdc7a 100644 (file)
@@ -406,6 +406,22 @@ static struct blk_mq_ops null_mq_ops = {
        .complete       = null_softirq_done_fn,
 };
 
+static void cleanup_queue(struct nullb_queue *nq)
+{
+       kfree(nq->tag_map);
+       kfree(nq->cmds);
+}
+
+static void cleanup_queues(struct nullb *nullb)
+{
+       int i;
+
+       for (i = 0; i < nullb->nr_queues; i++)
+               cleanup_queue(&nullb->queues[i]);
+
+       kfree(nullb->queues);
+}
+
 static void null_del_dev(struct nullb *nullb)
 {
        list_del_init(&nullb->list);
@@ -415,6 +431,7 @@ static void null_del_dev(struct nullb *nullb)
        if (queue_mode == NULL_Q_MQ)
                blk_mq_free_tag_set(&nullb->tag_set);
        put_disk(nullb->disk);
+       cleanup_queues(nullb);
        kfree(nullb);
 }
 
@@ -459,22 +476,6 @@ static int setup_commands(struct nullb_queue *nq)
        return 0;
 }
 
-static void cleanup_queue(struct nullb_queue *nq)
-{
-       kfree(nq->tag_map);
-       kfree(nq->cmds);
-}
-
-static void cleanup_queues(struct nullb *nullb)
-{
-       int i;
-
-       for (i = 0; i < nullb->nr_queues; i++)
-               cleanup_queue(&nullb->queues[i]);
-
-       kfree(nullb->queues);
-}
-
 static int setup_queues(struct nullb *nullb)
 {
        nullb->queues = kzalloc(submit_queues * sizeof(struct nullb_queue),
@@ -588,8 +589,7 @@ static int null_add_dev(void)
        blk_queue_physical_block_size(nullb->q, bs);
 
        size = gb * 1024 * 1024 * 1024ULL;
-       sector_div(size, bs);
-       set_capacity(disk, size);
+       set_capacity(disk, size >> 9);
 
        disk->flags |= GENHD_FL_EXT_DEVT | GENHD_FL_SUPPRESS_PARTITION_INFO;
        disk->major             = null_major;
index 965d1afb0eaa72558a1c6c36869e791733ec7350..5cb13ca3a3acac2aa16a104e9731770066ff03de 100644 (file)
@@ -330,12 +330,14 @@ void zcomp_destroy(struct zcomp *comp)
  * allocate new zcomp and initialize it. return compressing
  * backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL)
  * if requested algorithm is not supported, ERR_PTR(-ENOMEM) in
- * case of allocation error.
+ * case of allocation error, or any other error potentially
+ * returned by functions zcomp_strm_{multi,single}_create.
  */
 struct zcomp *zcomp_create(const char *compress, int max_strm)
 {
        struct zcomp *comp;
        struct zcomp_backend *backend;
+       int error;
 
        backend = find_backend(compress);
        if (!backend)
@@ -347,12 +349,12 @@ struct zcomp *zcomp_create(const char *compress, int max_strm)
 
        comp->backend = backend;
        if (max_strm > 1)
-               zcomp_strm_multi_create(comp, max_strm);
+               error = zcomp_strm_multi_create(comp, max_strm);
        else
-               zcomp_strm_single_create(comp);
-       if (!comp->stream) {
+               error = zcomp_strm_single_create(comp);
+       if (error) {
                kfree(comp);
-               return ERR_PTR(-ENOMEM);
+               return ERR_PTR(error);
        }
        return comp;
 }
index 43e2c3ad6c3111ae6d0a83f027b75344c087f5f2..0ebcf449778abc18e9956733ebb55db2e5dc77f9 100644 (file)
@@ -2437,7 +2437,8 @@ static int __clk_init(struct device *dev, struct clk *clk_user)
        hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
                if (orphan->num_parents && orphan->ops->get_parent) {
                        i = orphan->ops->get_parent(orphan->hw);
-                       if (!strcmp(core->name, orphan->parent_names[i]))
+                       if (i >= 0 && i < orphan->num_parents &&
+                           !strcmp(core->name, orphan->parent_names[i]))
                                clk_core_reparent(orphan, core);
                        continue;
                }
index 2a38eb4a25527604ec0cbd867ab5d6fbfbc4b648..6cf38dc1c9291e843f140e187b5dd0f0aadf6d4b 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/err.h>
 #include <linux/device.h>
 #include <linux/of_address.h>
+#include <linux/slab.h>
 
 static DEFINE_SPINLOCK(clklock);
 
index 2c16807341dce86b386cb662aa1a52418d311665..e434854486127a5287fd7b73f92fa3dc7c5151cc 100644 (file)
@@ -1,6 +1,12 @@
 config COMMON_CLK_HI6220
        bool "Hi6220 Clock Driver"
-       depends on (ARCH_HISI || COMPILE_TEST) && MAILBOX
+       depends on ARCH_HISI || COMPILE_TEST
        default ARCH_HISI
        help
          Build the Hisilicon Hi6220 clock driver based on the common clock framework.
+
+config STUB_CLK_HI6220
+       bool "Hi6220 Stub Clock Driver"
+       depends on COMMON_CLK_HI6220 && MAILBOX
+       help
+         Build the Hisilicon Hi6220 stub clock driver.
index 4a1001a11f04502d1b0b003ec5a7b3785946f313..74dba31590f9a39e122b1aa589cb869b685d3e18 100644 (file)
@@ -7,4 +7,5 @@ obj-y   += clk.o clkgate-separated.o clkdivider-hi6220.o
 obj-$(CONFIG_ARCH_HI3xxx)      += clk-hi3620.o
 obj-$(CONFIG_ARCH_HIP04)       += clk-hip04.o
 obj-$(CONFIG_ARCH_HIX5HD2)     += clk-hix5hd2.o
-obj-$(CONFIG_COMMON_CLK_HI6220)        += clk-hi6220.o clk-hi6220-stub.o
+obj-$(CONFIG_COMMON_CLK_HI6220)        += clk-hi6220.o
+obj-$(CONFIG_STUB_CLK_HI6220)  += clk-hi6220-stub.o
index ed02bbc7b11f303a3d265003074ef022e545ddcf..abb47608713bc39a8fddbdf915f29955b10a497f 100644 (file)
@@ -716,6 +716,8 @@ static const char *const rk3188_critical_clocks[] __initconst = {
        "aclk_cpu",
        "aclk_peri",
        "hclk_peri",
+       "pclk_cpu",
+       "pclk_peri",
 };
 
 static void __init rk3188_common_clk_init(struct device_node *np)
@@ -744,8 +746,6 @@ static void __init rk3188_common_clk_init(struct device_node *np)
 
        rockchip_clk_register_branches(common_clk_branches,
                                  ARRAY_SIZE(common_clk_branches));
-       rockchip_clk_protect_critical(rk3188_critical_clocks,
-                                     ARRAY_SIZE(rk3188_critical_clocks));
 
        rockchip_register_softrst(np, 9, reg_base + RK2928_SOFTRST_CON(0),
                                  ROCKCHIP_SOFTRST_HIWORD_MASK);
@@ -765,6 +765,8 @@ static void __init rk3066a_clk_init(struct device_node *np)
                        mux_armclk_p, ARRAY_SIZE(mux_armclk_p),
                        &rk3066_cpuclk_data, rk3066_cpuclk_rates,
                        ARRAY_SIZE(rk3066_cpuclk_rates));
+       rockchip_clk_protect_critical(rk3188_critical_clocks,
+                                     ARRAY_SIZE(rk3188_critical_clocks));
 }
 CLK_OF_DECLARE(rk3066a_cru, "rockchip,rk3066a-cru", rk3066a_clk_init);
 
@@ -801,6 +803,9 @@ static void __init rk3188a_clk_init(struct device_node *np)
                pr_warn("%s: missing clocks to reparent aclk_cpu_pre to gpll\n",
                        __func__);
        }
+
+       rockchip_clk_protect_critical(rk3188_critical_clocks,
+                                     ARRAY_SIZE(rk3188_critical_clocks));
 }
 CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init);
 
index 9c5d61e698ef027fc129ab38a05d868e083b9407..7e6b783e6eee54c0fa53a85d664b5d2ddae6f819 100644 (file)
@@ -818,6 +818,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
        GATE(0, "sclk_timer00", "xin24m", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(24), 0, GFLAGS),
 };
 
+static const char *const rk3368_critical_clocks[] __initconst = {
+       "pclk_pd_pmu",
+};
+
 static void __init rk3368_clk_init(struct device_node *np)
 {
        void __iomem *reg_base;
@@ -862,6 +866,8 @@ static void __init rk3368_clk_init(struct device_node *np)
                                   RK3368_GRF_SOC_STATUS0);
        rockchip_clk_register_branches(rk3368_clk_branches,
                                  ARRAY_SIZE(rk3368_clk_branches));
+       rockchip_clk_protect_critical(rk3368_critical_clocks,
+                                     ARRAY_SIZE(rk3368_critical_clocks));
 
        rockchip_clk_register_armclk(ARMCLKB, "armclkb",
                        mux_armclkb_p, ARRAY_SIZE(mux_armclkb_p),
index 83ccf142ff2acaea7b5d4f3cf9d8f6475d1f6093..576cd0354d48237b807cb884f0ab64905641b1af 100644 (file)
@@ -307,7 +307,7 @@ static const struct clkgen_quadfs_data st_fs660c32_F_416 = {
        .get_rate       = clk_fs660c32_dig_get_rate,
 };
 
-static const struct clkgen_quadfs_data st_fs660c32_C_407 = {
+static const struct clkgen_quadfs_data st_fs660c32_C = {
        .nrst_present = true,
        .nrst   = { CLKGEN_FIELD(0x2f0, 0x1, 0),
                    CLKGEN_FIELD(0x2f0, 0x1, 1),
@@ -350,7 +350,7 @@ static const struct clkgen_quadfs_data st_fs660c32_C_407 = {
        .get_rate       = clk_fs660c32_dig_get_rate,
 };
 
-static const struct clkgen_quadfs_data st_fs660c32_D_407 = {
+static const struct clkgen_quadfs_data st_fs660c32_D = {
        .nrst_present = true,
        .nrst   = { CLKGEN_FIELD(0x2a0, 0x1, 0),
                    CLKGEN_FIELD(0x2a0, 0x1, 1),
@@ -1077,11 +1077,11 @@ static const struct of_device_id quadfs_of_match[] = {
        },
        {
                .compatible = "st,stih407-quadfs660-C",
-               .data = &st_fs660c32_C_407
+               .data = &st_fs660c32_C
        },
        {
                .compatible = "st,stih407-quadfs660-D",
-               .data = &st_fs660c32_D_407
+               .data = &st_fs660c32_D
        },
        {}
 };
index 47a38a994cac7a29113c086cb928e7957180e1fd..b2a332cf8985706574f89acc4d46d8fe17f2166c 100644 (file)
@@ -193,7 +193,7 @@ static const struct clkgen_pll_data st_pll3200c32_407_a0 = {
        .ops            = &stm_pll3200c32_ops,
 };
 
-static const struct clkgen_pll_data st_pll3200c32_407_c0_0 = {
+static const struct clkgen_pll_data st_pll3200c32_cx_0 = {
        /* 407 C0 PLL0 */
        .pdn_status     = CLKGEN_FIELD(0x2a0,   0x1,                    8),
        .locked_status  = CLKGEN_FIELD(0x2a0,   0x1,                    24),
@@ -205,7 +205,7 @@ static const struct clkgen_pll_data st_pll3200c32_407_c0_0 = {
        .ops            = &stm_pll3200c32_ops,
 };
 
-static const struct clkgen_pll_data st_pll3200c32_407_c0_1 = {
+static const struct clkgen_pll_data st_pll3200c32_cx_1 = {
        /* 407 C0 PLL1 */
        .pdn_status     = CLKGEN_FIELD(0x2c8,   0x1,                    8),
        .locked_status  = CLKGEN_FIELD(0x2c8,   0x1,                    24),
@@ -624,12 +624,12 @@ static const struct of_device_id c32_pll_of_match[] = {
                .data = &st_pll3200c32_407_a0,
        },
        {
-               .compatible = "st,stih407-plls-c32-c0_0",
-               .data = &st_pll3200c32_407_c0_0,
+               .compatible = "st,plls-c32-cx_0",
+               .data = &st_pll3200c32_cx_0,
        },
        {
-               .compatible = "st,stih407-plls-c32-c0_1",
-               .data = &st_pll3200c32_407_c0_1,
+               .compatible = "st,plls-c32-cx_1",
+               .data = &st_pll3200c32_cx_1,
        },
        {
                .compatible = "st,stih407-plls-c32-a9",
index c2ff859ee0e8be75ead40cdd0af59f331b79d7c8..c4e3a52e225bcea0583d3eed0308a523b12ebec3 100644 (file)
@@ -682,11 +682,17 @@ static int find_lut_index_for_rate(struct tegra_dfll *td, unsigned long rate)
        struct dev_pm_opp *opp;
        int i, uv;
 
+       rcu_read_lock();
+
        opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate);
-       if (IS_ERR(opp))
+       if (IS_ERR(opp)) {
+               rcu_read_unlock();
                return PTR_ERR(opp);
+       }
        uv = dev_pm_opp_get_voltage(opp);
 
+       rcu_read_unlock();
+
        for (i = 0; i < td->i2c_lut_size; i++) {
                if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv)
                        return i;
index 15b921a9248c8f7b0e90bb01fe41d06c32e898bc..798277227de7f3a897a4ad79fcaabe787412fcfb 100644 (file)
@@ -375,12 +375,11 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
 
        pr_debug("get_cur_freq_on_cpu (%d)\n", cpu);
 
-       policy = cpufreq_cpu_get(cpu);
+       policy = cpufreq_cpu_get_raw(cpu);
        if (unlikely(!policy))
                return 0;
 
        data = policy->driver_data;
-       cpufreq_cpu_put(policy);
        if (unlikely(!data || !data->freq_table))
                return 0;
 
index 6633b3fa996e06091089297f05e5bb710b995134..ef5ed9470de9a59d371e34e7db24a434d1f11a9f 100644 (file)
@@ -238,13 +238,13 @@ int cpufreq_generic_init(struct cpufreq_policy *policy,
 }
 EXPORT_SYMBOL_GPL(cpufreq_generic_init);
 
-/* Only for cpufreq core internal use */
-static struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
+struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
 {
        struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
 
        return policy && cpumask_test_cpu(cpu, policy->cpus) ? policy : NULL;
 }
+EXPORT_SYMBOL_GPL(cpufreq_cpu_get_raw);
 
 unsigned int cpufreq_generic_get(unsigned int cpu)
 {
index 07bc7aa6b224aeeb7ada29b08aec61966d3b3b2e..d234719065a5f2e39c3e81681dc0bd184e803033 100644 (file)
@@ -461,7 +461,7 @@ config CRYPTO_DEV_QCE
 
 config CRYPTO_DEV_VMX
        bool "Support for VMX cryptographic acceleration instructions"
-       depends on PPC64
+       depends on PPC64 && VSX
        help
          Support for VMX cryptographic acceleration instructions.
 
index e070c316e8b76a7384efa33a6a34ec99fb9a8849..a19ee127edcafd3c70ad9e6ee8a86b1823f020f7 100644 (file)
@@ -104,7 +104,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq)
                        sg_miter_next(&mo);
                        oo = 0;
                }
-       } while (mo.length > 0);
+       } while (oleft > 0);
 
        if (areq->info) {
                for (i = 0; i < 4 && i < ivsize / 4; i++) {
index ca1b362d77e2329c9b6c0d511f754fdf839da095..3927ed9fdbd51f16d765aede8fef14418994ab55 100644 (file)
@@ -53,7 +53,7 @@ static struct devfreq *find_device_devfreq(struct device *dev)
 {
        struct devfreq *tmp_devfreq;
 
-       if (unlikely(IS_ERR_OR_NULL(dev))) {
+       if (IS_ERR_OR_NULL(dev)) {
                pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
                return ERR_PTR(-EINVAL);
        }
@@ -133,7 +133,7 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)
 {
        struct devfreq_governor *tmp_governor;
 
-       if (unlikely(IS_ERR_OR_NULL(name))) {
+       if (IS_ERR_OR_NULL(name)) {
                pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
                return ERR_PTR(-EINVAL);
        }
@@ -177,10 +177,10 @@ int update_devfreq(struct devfreq *devfreq)
                return err;
 
        /*
-        * Adjust the freuqency with user freq and QoS.
+        * Adjust the frequency with user freq and QoS.
         *
-        * List from the highest proiority
-        * max_freq (probably called by thermal when it's too hot)
+        * List from the highest priority
+        * max_freq
         * min_freq
         */
 
@@ -482,7 +482,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
                                                devfreq->profile->max_state *
                                                devfreq->profile->max_state,
                                                GFP_KERNEL);
-       devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) *
+       devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) *
                                                devfreq->profile->max_state,
                                                GFP_KERNEL);
        devfreq->last_stat_updated = jiffies;
index f9901f52a225ca40e8d87056c1021c134838efe3..f312485f145110ab31537f9df3225e8ac1021cf8 100644 (file)
@@ -319,7 +319,8 @@ static int exynos_ppmu_v2_get_event(struct devfreq_event_dev *edev,
        case PPMU_PMNCNT3:
                pmcnt_high = __raw_readl(info->ppmu.base + PPMU_V2_PMCNT3_HIGH);
                pmcnt_low = __raw_readl(info->ppmu.base + PPMU_V2_PMCNT3_LOW);
-               load_count = (u64)((pmcnt_high & 0xff) << 32) + (u64)pmcnt_low;
+               load_count = ((u64)((pmcnt_high & 0xff)) << 32)
+                          + (u64)pmcnt_low;
                break;
        }
        edata->load_count = load_count;
index 0720ba84ca9277df895168a788cae9d3d41bc40b..ae72ba5e78dfce046804a7dc5b7a08017d8a25c7 100644 (file)
 static int devfreq_simple_ondemand_func(struct devfreq *df,
                                        unsigned long *freq)
 {
-       struct devfreq_dev_status stat;
-       int err = df->profile->get_dev_status(df->dev.parent, &stat);
+       int err;
+       struct devfreq_dev_status *stat;
        unsigned long long a, b;
        unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD;
        unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL;
        struct devfreq_simple_ondemand_data *data = df->data;
        unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX;
 
+       err = devfreq_update_stats(df);
        if (err)
                return err;
 
+       stat = &df->last_status;
+
        if (data) {
                if (data->upthreshold)
                        dfso_upthreshold = data->upthreshold;
@@ -43,41 +46,41 @@ static int devfreq_simple_ondemand_func(struct devfreq *df,
                return -EINVAL;
 
        /* Assume MAX if it is going to be divided by zero */
-       if (stat.total_time == 0) {
+       if (stat->total_time == 0) {
                *freq = max;
                return 0;
        }
 
        /* Prevent overflow */
-       if (stat.busy_time >= (1 << 24) || stat.total_time >= (1 << 24)) {
-               stat.busy_time >>= 7;
-               stat.total_time >>= 7;
+       if (stat->busy_time >= (1 << 24) || stat->total_time >= (1 << 24)) {
+               stat->busy_time >>= 7;
+               stat->total_time >>= 7;
        }
 
        /* Set MAX if it's busy enough */
-       if (stat.busy_time * 100 >
-           stat.total_time * dfso_upthreshold) {
+       if (stat->busy_time * 100 >
+           stat->total_time * dfso_upthreshold) {
                *freq = max;
                return 0;
        }
 
        /* Set MAX if we do not know the initial frequency */
-       if (stat.current_frequency == 0) {
+       if (stat->current_frequency == 0) {
                *freq = max;
                return 0;
        }
 
        /* Keep the current frequency */
-       if (stat.busy_time * 100 >
-           stat.total_time * (dfso_upthreshold - dfso_downdifferential)) {
-               *freq = stat.current_frequency;
+       if (stat->busy_time * 100 >
+           stat->total_time * (dfso_upthreshold - dfso_downdifferential)) {
+               *freq = stat->current_frequency;
                return 0;
        }
 
        /* Set the desired frequency based on the load */
-       a = stat.busy_time;
-       a *= stat.current_frequency;
-       b = div_u64(a, stat.total_time);
+       a = stat->busy_time;
+       a *= stat->current_frequency;
+       b = div_u64(a, stat->total_time);
        b *= 100;
        b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2));
        *freq = (unsigned long) b;
index 13a1a6e8108c87e5b8c7653118c1d7798b4c6ac8..848b93ee930fd8ec204a332755c57b18457bfede 100644 (file)
@@ -541,18 +541,20 @@ static struct devfreq_dev_profile tegra_devfreq_profile = {
 static int tegra_governor_get_target(struct devfreq *devfreq,
                                     unsigned long *freq)
 {
-       struct devfreq_dev_status stat;
+       struct devfreq_dev_status *stat;
        struct tegra_devfreq *tegra;
        struct tegra_devfreq_device *dev;
        unsigned long target_freq = 0;
        unsigned int i;
        int err;
 
-       err = devfreq->profile->get_dev_status(devfreq->dev.parent, &stat);
+       err = devfreq_update_stats(devfreq);
        if (err)
                return err;
 
-       tegra = stat.private_data;
+       stat = &devfreq->last_status;
+
+       tegra = stat->private_data;
 
        for (i = 0; i < ARRAY_SIZE(tegra->devices); i++) {
                dev = &tegra->devices[i];
index 4768a829253a5438a38e00b5be2eedc02af71fea..2bf37e68ad0f1529e472a141031d56586ac21e21 100644 (file)
@@ -266,7 +266,7 @@ int ipu_irq_unmap(unsigned int source)
 }
 
 /* Chained IRQ handler for IPU function and error interrupt */
-static void ipu_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void ipu_irq_handler(struct irq_desc *desc)
 {
        struct ipu *ipu = irq_desc_get_handler_data(desc);
        u32 status;
index b4fc9e4d24c6b15857e2a2cd3c1000e0473af8f9..8949b3f6f74d207f0bc935af11dd76cf956b49ba 100644 (file)
@@ -356,7 +356,7 @@ config GPIO_PXA
 
 config GPIO_RCAR
        tristate "Renesas R-Car GPIO"
-       depends on ARM && (ARCH_SHMOBILE || COMPILE_TEST)
+       depends on ARCH_SHMOBILE || COMPILE_TEST
        select GPIOLIB_IRQCHIP
        help
          Say yes here to support GPIO on Renesas R-Car SoCs.
index 9b7e0b3db387218865004332c8313616026d7ae4..1b44941574fa6965d68e474b9197907e71473692 100644 (file)
@@ -201,8 +201,7 @@ static int altera_gpio_direction_output(struct gpio_chip *gc,
        return 0;
 }
 
-static void altera_gpio_irq_edge_handler(unsigned int irq,
-                                       struct irq_desc *desc)
+static void altera_gpio_irq_edge_handler(struct irq_desc *desc)
 {
        struct altera_gpio_chip *altera_gc;
        struct irq_chip *chip;
@@ -231,8 +230,7 @@ static void altera_gpio_irq_edge_handler(unsigned int irq,
 }
 
 
-static void altera_gpio_irq_leveL_high_handler(unsigned int irq,
-                                             struct irq_desc *desc)
+static void altera_gpio_irq_leveL_high_handler(struct irq_desc *desc)
 {
        struct altera_gpio_chip *altera_gc;
        struct irq_chip *chip;
index 31b90ac15204b9bf987f0cfc5e454ff90637dc78..33a1f9779b86bb1e422d3144f69c600409e9221d 100644 (file)
@@ -433,7 +433,7 @@ static int bcm_kona_gpio_irq_set_type(struct irq_data *d, unsigned int type)
        return 0;
 }
 
-static void bcm_kona_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void bcm_kona_gpio_irq_handler(struct irq_desc *desc)
 {
        void __iomem *reg_base;
        int bit, bank_id;
index 9ea86d2ac05462bb832f5fe14cae4c2b9132c2c1..4c64627c6bb5db745a3efff6d64eef9d8416e331 100644 (file)
@@ -236,7 +236,7 @@ static void brcmstb_gpio_irq_bank_handler(struct brcmstb_gpio_bank *bank)
 }
 
 /* Each UPG GIO block has one IRQ for all banks */
-static void brcmstb_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void brcmstb_gpio_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct brcmstb_gpio_priv *priv = brcmstb_gpio_gc_to_priv(gc);
index 94b0ab7097216560c5b867663425bd1f5ad04d92..5e715388803db555d7180fc9b6c3b24f1c7f48dc 100644 (file)
@@ -326,8 +326,7 @@ static struct irq_chip gpio_irqchip = {
        .flags          = IRQCHIP_SET_TYPE_MASKED,
 };
 
-static void
-gpio_irq_handler(unsigned __irq, struct irq_desc *desc)
+static void gpio_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct davinci_gpio_regs __iomem *g;
index c5be4b9b8baf7330ba8a87c99332b23e534fe135..fcd5b0acfc7286af365f163fe647e13263dd4606 100644 (file)
@@ -147,7 +147,7 @@ static u32 dwapb_do_irq(struct dwapb_gpio *gpio)
        return ret;
 }
 
-static void dwapb_irq_handler(u32 irq, struct irq_desc *desc)
+static void dwapb_irq_handler(struct irq_desc *desc)
 {
        struct dwapb_gpio *gpio = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index 9d90366ea2599920f64556caa38cc225b3296b83..3e3947b35c8378fac9e6f485e8c89895f5c84d97 100644 (file)
@@ -78,7 +78,7 @@ static void ep93xx_gpio_int_debounce(unsigned int irq, bool enable)
                EP93XX_GPIO_REG(int_debounce_register_offset[port]));
 }
 
-static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc)
 {
        unsigned char status;
        int i;
@@ -100,8 +100,7 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
        }
 }
 
-static void ep93xx_gpio_f_irq_handler(unsigned int __irq,
-                                     struct irq_desc *desc)
+static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc)
 {
        /*
         * map discontiguous hw irq range to continuous sw irq range:
index aa28c65eb6b4f3a98e7aa6d5a1a1eac28d1c0c06..70097472b02cc7cb9332f9e59cac750720e21c54 100644 (file)
@@ -301,7 +301,7 @@ static const struct pci_device_id intel_gpio_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, intel_gpio_ids);
 
-static void intel_mid_irq_handler(unsigned irq, struct irq_desc *desc)
+static void intel_mid_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct intel_mid_gpio *priv = to_intel_gpio_priv(gc);
index 153af464c7a780e7ef57c8ba15e3e7d7b5307ede..127c37b380ae21c1d8ff85a3913ab11e1b76613f 100644 (file)
@@ -234,7 +234,7 @@ static int lp_gpio_direction_output(struct gpio_chip *chip,
        return 0;
 }
 
-static void lp_gpio_irq_handler(unsigned hwirq, struct irq_desc *desc)
+static void lp_gpio_irq_handler(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
index 8ef7a12de98375e1dcb285799a6213b93a78551f..48ef368347ab2cd63cdb1d4f922572c608af9e89 100644 (file)
@@ -194,7 +194,7 @@ static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
                return -ENXIO;
 }
 
-static void mpc8xxx_gpio_irq_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpc8xxx_gpio_irq_cascade(struct irq_desc *desc)
 {
        struct mpc8xxx_gpio_chip *mpc8xxx_gc = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index 7bcfb87a5fa6812a51465d5c510a4c8a61c5d7d4..22523aae8abe597b0dacee0d63b7197288d2bd9d 100644 (file)
@@ -232,7 +232,7 @@ static struct irq_chip msic_irqchip = {
        .irq_bus_sync_unlock    = msic_bus_sync_unlock,
 };
 
-static void msic_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void msic_gpio_irq_handler(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct msic_gpio *mg = irq_data_get_irq_handler_data(data);
index d2012cfb5571819f6b6e4526c40625e9e94d8076..4b4222145f1029fb6c706517f43547f292d66613 100644 (file)
@@ -305,7 +305,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type)
  * which have been set as summary IRQ lines and which are triggered,
  * and to call their interrupt handlers.
  */
-static void msm_summary_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void msm_summary_irq_handler(struct irq_desc *desc)
 {
        unsigned long i;
        struct irq_chip *chip = irq_desc_get_chip(desc);
index b396bf3bf29464c210e5ab0add53d95a9f134eb4..df418b81456dfdc5f7a876221cc6c9a2ef80c380 100644 (file)
@@ -458,7 +458,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
        return 0;
 }
 
-static void mvebu_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void mvebu_gpio_irq_handler(struct irq_desc *desc)
 {
        struct mvebu_gpio_chip *mvchip = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index b752b560126e71c0066fd66f659641155b39ad71..b8dd847443c50750429a0d2a4b00407351490fd7 100644 (file)
@@ -272,7 +272,7 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
 }
 
 /* MX1 and MX3 has one interrupt *per* gpio port */
-static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mx3_gpio_irq_handler(struct irq_desc *desc)
 {
        u32 irq_stat;
        struct mxc_gpio_port *port = irq_desc_get_handler_data(desc);
@@ -288,7 +288,7 @@ static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 }
 
 /* MX2 has one interrupt *for all* gpio ports */
-static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mx2_gpio_irq_handler(struct irq_desc *desc)
 {
        u32 irq_msk, irq_stat;
        struct mxc_gpio_port *port;
@@ -339,13 +339,15 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
        return 0;
 }
 
-static void mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
+static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
 {
        struct irq_chip_generic *gc;
        struct irq_chip_type *ct;
 
        gc = irq_alloc_generic_chip("gpio-mxc", 1, irq_base,
                                    port->base, handle_level_irq);
+       if (!gc)
+               return -ENOMEM;
        gc->private = port;
 
        ct = gc->chip_types;
@@ -360,6 +362,8 @@ static void mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
 
        irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
                               IRQ_NOREQUEST, 0);
+
+       return 0;
 }
 
 static void mxc_gpio_get_hw(struct platform_device *pdev)
@@ -477,12 +481,16 @@ static int mxc_gpio_probe(struct platform_device *pdev)
        }
 
        /* gpio-mxc can be a generic irq chip */
-       mxc_gpio_init_gc(port, irq_base);
+       err = mxc_gpio_init_gc(port, irq_base);
+       if (err < 0)
+               goto out_irqdomain_remove;
 
        list_add_tail(&port->node, &mxc_gpio_ports);
 
        return 0;
 
+out_irqdomain_remove:
+       irq_domain_remove(port->domain);
 out_irqdesc_free:
        irq_free_descs(irq_base, 32);
 out_gpiochip_remove:
index b7f383eb18d91e2f82831e4813b987d74d18d77b..a4288f428819a3175d2e74cb2feec138ffacb4dc 100644 (file)
@@ -154,7 +154,7 @@ static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio)
 }
 
 /* MXS has one interrupt *per* gpio port */
-static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mxs_gpio_irq_handler(struct irq_desc *desc)
 {
        u32 irq_stat;
        struct mxs_gpio_port *port = irq_desc_get_handler_data(desc);
@@ -196,13 +196,16 @@ static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable)
        return 0;
 }
 
-static void __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
+static int __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
 {
        struct irq_chip_generic *gc;
        struct irq_chip_type *ct;
 
        gc = irq_alloc_generic_chip("gpio-mxs", 1, irq_base,
                                    port->base, handle_level_irq);
+       if (!gc)
+               return -ENOMEM;
+
        gc->private = port;
 
        ct = gc->chip_types;
@@ -216,6 +219,8 @@ static void __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
 
        irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
                               IRQ_NOREQUEST, 0);
+
+       return 0;
 }
 
 static int mxs_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
@@ -317,7 +322,9 @@ static int mxs_gpio_probe(struct platform_device *pdev)
        }
 
        /* gpio-mxs can be a generic irq chip */
-       mxs_gpio_init_gc(port, irq_base);
+       err = mxs_gpio_init_gc(port, irq_base);
+       if (err < 0)
+               goto out_irqdomain_remove;
 
        /* setup one handler for each entry */
        irq_set_chained_handler_and_data(port->irq, mxs_gpio_irq_handler,
@@ -343,6 +350,8 @@ static int mxs_gpio_probe(struct platform_device *pdev)
 
 out_bgpio_remove:
        bgpio_remove(&port->bgc);
+out_irqdomain_remove:
+       irq_domain_remove(port->domain);
 out_irqdesc_free:
        irq_free_descs(irq_base, 32);
        return err;
index 2ae0d47e955443f7f1aec2f51c522466aa54ce30..5236db161e76047db31bf8c8e5ae7299f12fd06d 100644 (file)
@@ -709,7 +709,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
  * line's interrupt handler has been run, we may miss some nested
  * interrupts.
  */
-static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void omap_gpio_irq_handler(struct irq_desc *desc)
 {
        void __iomem *isr_reg = NULL;
        u32 isr;
@@ -1098,7 +1098,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
        } else {
                bank->chip.label = "gpio";
                bank->chip.base = gpio;
-               gpio += bank->width;
        }
        bank->chip.ngpio = bank->width;
 
@@ -1108,6 +1107,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
                return ret;
        }
 
+       if (!bank->is_mpuio)
+               gpio += bank->width;
+
 #ifdef CONFIG_ARCH_OMAP1
        /*
         * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
@@ -1253,8 +1255,11 @@ static int omap_gpio_probe(struct platform_device *pdev)
        omap_gpio_mod_init(bank);
 
        ret = omap_gpio_chip_init(bank, irqc);
-       if (ret)
+       if (ret) {
+               pm_runtime_put_sync(bank->dev);
+               pm_runtime_disable(bank->dev);
                return ret;
+       }
 
        omap_gpio_show_rev(bank);
 
index 04756130437f193c12e6e6033ed5b6fff6be6b43..229ef653e0f8f631172e1956ad4c9f9c74c50b02 100644 (file)
@@ -187,7 +187,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
        return 0;
 }
 
-static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)
+static void pl061_irq_handler(struct irq_desc *desc)
 {
        unsigned long pending;
        int offset;
index 55a11de3d5b741f1038fd4b50fb9300cc8be7813..df2ce550f30929c1a20d1aca81e538a367f8f97b 100644 (file)
@@ -401,7 +401,7 @@ static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type)
        return 0;
 }
 
-static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
+static void pxa_gpio_demux_handler(struct irq_desc *desc)
 {
        struct pxa_gpio_chip *c;
        int loop, gpio, gpio_base, n;
index 67bd2f5d89e8f3d67efab99b8f3799351c263987..990fa9023e2228a82d1138cb8f25bfeb75dab23d 100644 (file)
@@ -172,8 +172,7 @@ static struct irq_domain *sa1100_gpio_irqdomain;
  * irq_controller_lock held, and IRQs disabled.  Decode the IRQ
  * and call the handler.
  */
-static void
-sa1100_gpio_handler(unsigned int __irq, struct irq_desc *desc)
+static void sa1100_gpio_handler(struct irq_desc *desc)
 {
        unsigned int irq, mask;
 
index 458d9d7952b840af2d7d2666ef3567dac8244403..9c6b96707c9f286a9bbf13c756beab7d4cedbace 100644 (file)
@@ -706,4 +706,3 @@ module_exit(sx150x_exit);
 MODULE_AUTHOR("Gregory Bean <gbean@codeaurora.org>");
 MODULE_DESCRIPTION("Driver for Semtech SX150X I2C GPIO Expanders");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("i2c:sx150x");
index 9b14aafb576da8dc664cd75679379fe04ff4ace7..027e5f47dd28738f04e6347f1807c6b28b34e618 100644 (file)
@@ -266,7 +266,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
        gpiochip_unlock_as_irq(&tegra_gpio_chip, gpio);
 }
 
-static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void tegra_gpio_irq_handler(struct irq_desc *desc)
 {
        int port;
        int pin;
index 5a492054589fa472c41f4f7ae7fc8b33b38843ce..30653e6319e9899cd2bd2e36ff5e00b0261dda62 100644 (file)
@@ -192,7 +192,7 @@ out:
        return ret;
 }
 
-static void timbgpio_irq(unsigned int irq, struct irq_desc *desc)
+static void timbgpio_irq(struct irq_desc *desc)
 {
        struct timbgpio *tgpio = irq_desc_get_handler_data(desc);
        struct irq_data *data = irq_desc_get_irq_data(desc);
index bbac92ae4c328ab96eef76785e4189e7b3de08a5..87bb1b1eee8deacaa4f9cdb9ccc81166025393e5 100644 (file)
@@ -375,7 +375,7 @@ static int gpio_set_irq_wake(struct irq_data *data, unsigned int on)
 #define gpio_set_irq_wake NULL
 #endif
 
-static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void tz1090_gpio_irq_handler(struct irq_desc *desc)
 {
        irq_hw_number_t hw;
        unsigned int irq_stat, irq_no;
@@ -400,7 +400,7 @@ static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
                                == IRQ_TYPE_EDGE_BOTH)
                        tz1090_gpio_irq_next_edge(bank, hw);
 
-               generic_handle_irq_desc(irq_no, child_desc);
+               generic_handle_irq_desc(child_desc);
        }
 }
 
index 3d5714d4f405dd50731da6a11d8f24398d7c36d8..069f9e4b7daae0b5afe7bef0543b822191de22f3 100644 (file)
@@ -120,7 +120,7 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
        return pinctrl_gpio_direction_output(chip->base + gpio);
 }
 
-static void vf610_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void vf610_gpio_irq_handler(struct irq_desc *desc)
 {
        struct vf610_gpio_port *port = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -176,9 +176,9 @@ static int vf610_gpio_irq_set_type(struct irq_data *d, u32 type)
        port->irqc[d->hwirq] = irqc;
 
        if (type & IRQ_TYPE_LEVEL_MASK)
-               __irq_set_handler_locked(d->irq, handle_level_irq);
+               irq_set_handler_locked(d, handle_level_irq);
        else
-               __irq_set_handler_locked(d->irq, handle_edge_irq);
+               irq_set_handler_locked(d, handle_edge_irq);
 
        return 0;
 }
index 12ee1969298cc1bb82eb9438ed148f1f41cda9d8..4b8a2691070537cde2affdce5ff7624d032ce193 100644 (file)
@@ -177,7 +177,7 @@ static int zx_irq_type(struct irq_data *d, unsigned trigger)
        return 0;
 }
 
-static void zx_irq_handler(unsigned irq, struct irq_desc *desc)
+static void zx_irq_handler(struct irq_desc *desc)
 {
        unsigned long pending;
        int offset;
index 27348e7cb705909adafa01b4490b2866e125caae..1d1a5865ede90449d8e2b4abba88f14f6c225b82 100644 (file)
@@ -514,7 +514,7 @@ static void zynq_gpio_handle_bank_irq(struct zynq_gpio *gpio,
  * application for that pin.
  * Note: A bug is reported if no handler is set for the gpio pin.
  */
-static void zynq_gpio_irqhandler(unsigned int irq, struct irq_desc *desc)
+static void zynq_gpio_irqhandler(struct irq_desc *desc)
 {
        u32 int_sts, int_enb;
        unsigned int bank_num;
index 980c1f87866ac268b3dc8046faec602e57ca32c9..5db3445552b176d2c11ca8b225ef88b4b80d22eb 100644 (file)
@@ -1174,15 +1174,16 @@ EXPORT_SYMBOL_GPL(gpiod_is_active_low);
  * that the GPIO was actually requested.
  */
 
-static bool _gpiod_get_raw_value(const struct gpio_desc *desc)
+static int _gpiod_get_raw_value(const struct gpio_desc *desc)
 {
        struct gpio_chip        *chip;
-       bool value;
        int offset;
+       int value;
 
        chip = desc->chip;
        offset = gpio_chip_hwgpio(desc);
-       value = chip->get ? chip->get(chip, offset) : false;
+       value = chip->get ? chip->get(chip, offset) : -EIO;
+       value = value < 0 ? value : !!value;
        trace_gpio_value(desc_to_gpio(desc), 1, value);
        return value;
 }
@@ -1192,7 +1193,7 @@ static bool _gpiod_get_raw_value(const struct gpio_desc *desc)
  * @desc: gpio whose value will be returned
  *
  * Return the GPIO's raw value, i.e. the value of the physical line disregarding
- * its ACTIVE_LOW status.
+ * its ACTIVE_LOW status, or negative errno on failure.
  *
  * This function should be called from contexts where we cannot sleep, and will
  * complain if the GPIO chip functions potentially sleep.
@@ -1212,7 +1213,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_raw_value);
  * @desc: gpio whose value will be returned
  *
  * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into
- * account.
+ * account, or negative errno on failure.
  *
  * This function should be called from contexts where we cannot sleep, and will
  * complain if the GPIO chip functions potentially sleep.
@@ -1226,6 +1227,9 @@ int gpiod_get_value(const struct gpio_desc *desc)
        WARN_ON(desc->chip->can_sleep);
 
        value = _gpiod_get_raw_value(desc);
+       if (value < 0)
+               return value;
+
        if (test_bit(FLAG_ACTIVE_LOW, &desc->flags))
                value = !value;
 
@@ -1548,7 +1552,7 @@ EXPORT_SYMBOL_GPL(gpiochip_unlock_as_irq);
  * @desc: gpio whose value will be returned
  *
  * Return the GPIO's raw value, i.e. the value of the physical line disregarding
- * its ACTIVE_LOW status.
+ * its ACTIVE_LOW status, or negative errno on failure.
  *
  * This function is to be called from contexts that can sleep.
  */
@@ -1566,7 +1570,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_raw_value_cansleep);
  * @desc: gpio whose value will be returned
  *
  * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into
- * account.
+ * account, or negative errno on failure.
  *
  * This function is to be called from contexts that can sleep.
  */
@@ -1579,6 +1583,9 @@ int gpiod_get_value_cansleep(const struct gpio_desc *desc)
                return 0;
 
        value = _gpiod_get_raw_value(desc);
+       if (value < 0)
+               return value;
+
        if (test_bit(FLAG_ACTIVE_LOW, &desc->flags))
                value = !value;
 
index b1f73bee13682a29e1bc68a84f991e55fa170723..b0d4b53b97f4c2f045e37c17324b58b5984042f0 100644 (file)
@@ -178,7 +178,6 @@ static int mdp5_hw_irqdomain_map(struct irq_domain *d,
 
        irq_set_chip_and_handler(irq, &mdp5_hw_irq_chip, handle_level_irq);
        irq_set_chip_data(irq, mdp5_kms);
-       set_irq_flags(irq, IRQF_VALID);
 
        return 0;
 }
index 243f99a802535cd7ab9e876c439a206846b20d22..e5a38d202a21134f12e51061ef503afa29b81d73 100644 (file)
@@ -912,7 +912,7 @@ static void ipu_irq_handle(struct ipu_soc *ipu, const int *regs, int num_regs)
        }
 }
 
-static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_handler(struct irq_desc *desc)
 {
        struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -925,7 +925,7 @@ static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc)
        chained_irq_exit(chip, desc);
 }
 
-static void ipu_err_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ipu_err_irq_handler(struct irq_desc *desc)
 {
        struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -1099,8 +1099,7 @@ static int ipu_irq_init(struct ipu_soc *ipu)
        }
 
        ret = irq_alloc_domain_generic_chips(ipu->domain, 32, 1, "IPU",
-                                            handle_level_irq, 0,
-                                            IRQF_VALID, 0);
+                                            handle_level_irq, 0, 0, 0);
        if (ret < 0) {
                dev_err(ipu->dev, "failed to alloc generic irq chips\n");
                irq_domain_remove(ipu->domain);
index 500b262b89bb15ee9859caa097fdb2b2f6977849..e13c902e8966977581f1959155b3f83774e94aa5 100644 (file)
@@ -1140,8 +1140,8 @@ config SENSORS_NCT6775
        help
          If you say yes here you get support for the hardware monitoring
          functionality of the Nuvoton NCT6106D, NCT6775F, NCT6776F, NCT6779D,
-         NCT6791D, NCT6792D and compatible Super-I/O chips. This driver
-         replaces the w83627ehf driver for NCT6775F and NCT6776F.
+         NCT6791D, NCT6792D, NCT6793D, and compatible Super-I/O chips. This
+         driver replaces the w83627ehf driver for NCT6775F and NCT6776F.
 
          This driver can also be built as a module.  If so, the module
          will be called nct6775.
index bd1c99deac71b73dadf15615c1e8442027bccee9..8b4fa55e46c6afceb3895515bc0df0cb3b8a4b85 100644 (file)
@@ -39,6 +39,7 @@
  * nct6779d    15      5       5       2+6    0xc560 0xc1    0x5ca3
  * nct6791d    15      6       6       2+6    0xc800 0xc1    0x5ca3
  * nct6792d    15      6       6       2+6    0xc910 0xc1    0x5ca3
+ * nct6793d    15      6       6       2+6    0xd120 0xc1    0x5ca3
  *
  * #temp lists the number of monitored temperature sources (first value) plus
  * the number of directly connectable temperature sensors (second value).
@@ -63,7 +64,7 @@
 
 #define USE_ALTERNATE
 
-enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792 };
+enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793 };
 
 /* used to set data->name = nct6775_device_names[data->sio_kind] */
 static const char * const nct6775_device_names[] = {
@@ -73,6 +74,17 @@ static const char * const nct6775_device_names[] = {
        "nct6779",
        "nct6791",
        "nct6792",
+       "nct6793",
+};
+
+static const char * const nct6775_sio_names[] __initconst = {
+       "NCT6106D",
+       "NCT6775F",
+       "NCT6776D/F",
+       "NCT6779D",
+       "NCT6791D",
+       "NCT6792D",
+       "NCT6793D",
 };
 
 static unsigned short force_id;
@@ -104,6 +116,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");
 #define SIO_NCT6779_ID         0xc560
 #define SIO_NCT6791_ID         0xc800
 #define SIO_NCT6792_ID         0xc910
+#define SIO_NCT6793_ID         0xd120
 #define SIO_ID_MASK            0xFFF0
 
 enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 };
@@ -354,6 +367,10 @@ static const u16 NCT6775_REG_TEMP_CRIT[ARRAY_SIZE(nct6775_temp_label) - 1]
 
 /* NCT6776 specific data */
 
+/* STEP_UP_TIME and STEP_DOWN_TIME regs are swapped for all chips but NCT6775 */
+#define NCT6776_REG_FAN_STEP_UP_TIME NCT6775_REG_FAN_STEP_DOWN_TIME
+#define NCT6776_REG_FAN_STEP_DOWN_TIME NCT6775_REG_FAN_STEP_UP_TIME
+
 static const s8 NCT6776_ALARM_BITS[] = {
        0, 1, 2, 3, 8, 21, 20, 16,      /* in0.. in7 */
        17, -1, -1, -1, -1, -1, -1,     /* in8..in14 */
@@ -533,7 +550,7 @@ static const s8 NCT6791_ALARM_BITS[] = {
        4, 5, 13, -1, -1, -1,           /* temp1..temp6 */
        12, 9 };                        /* intrusion0, intrusion1 */
 
-/* NCT6792 specific data */
+/* NCT6792/NCT6793 specific data */
 
 static const u16 NCT6792_REG_TEMP_MON[] = {
        0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d };
@@ -1056,6 +1073,7 @@ static bool is_word_sized(struct nct6775_data *data, u16 reg)
        case nct6779:
        case nct6791:
        case nct6792:
+       case nct6793:
                return reg == 0x150 || reg == 0x153 || reg == 0x155 ||
                  ((reg & 0xfff0) == 0x4b0 && (reg & 0x000f) < 0x0b) ||
                  reg == 0x402 ||
@@ -1407,6 +1425,7 @@ static void nct6775_update_pwm_limits(struct device *dev)
                case nct6779:
                case nct6791:
                case nct6792:
+               case nct6793:
                        reg = nct6775_read_value(data,
                                        data->REG_CRITICAL_PWM_ENABLE[i]);
                        if (reg & data->CRITICAL_PWM_ENABLE_MASK)
@@ -2822,6 +2841,7 @@ store_auto_pwm(struct device *dev, struct device_attribute *attr,
                case nct6779:
                case nct6791:
                case nct6792:
+               case nct6793:
                        nct6775_write_value(data, data->REG_CRITICAL_PWM[nr],
                                            val);
                        reg = nct6775_read_value(data,
@@ -3256,7 +3276,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data)
                pwm4pin = false;
                pwm5pin = false;
                pwm6pin = false;
-       } else {        /* NCT6779D, NCT6791D, or NCT6792D */
+       } else {        /* NCT6779D, NCT6791D, NCT6792D, or NCT6793D */
                regval = superio_inb(sioreg, 0x1c);
 
                fan3pin = !(regval & (1 << 5));
@@ -3269,7 +3289,8 @@ nct6775_check_fan_inputs(struct nct6775_data *data)
 
                fan4min = fan4pin;
 
-               if (data->kind == nct6791 || data->kind == nct6792) {
+               if (data->kind == nct6791 || data->kind == nct6792 ||
+                   data->kind == nct6793) {
                        regval = superio_inb(sioreg, 0x2d);
                        fan6pin = (regval & (1 << 1));
                        pwm6pin = (regval & (1 << 0));
@@ -3528,8 +3549,8 @@ static int nct6775_probe(struct platform_device *pdev)
                data->REG_FAN_PULSES = NCT6776_REG_FAN_PULSES;
                data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT;
                data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME;
-               data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME;
-               data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME;
+               data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME;
+               data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME;
                data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H;
                data->REG_PWM[0] = NCT6775_REG_PWM;
                data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT;
@@ -3600,8 +3621,8 @@ static int nct6775_probe(struct platform_device *pdev)
                data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES;
                data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT;
                data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME;
-               data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME;
-               data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME;
+               data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME;
+               data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME;
                data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H;
                data->REG_PWM[0] = NCT6775_REG_PWM;
                data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT;
@@ -3643,6 +3664,7 @@ static int nct6775_probe(struct platform_device *pdev)
                break;
        case nct6791:
        case nct6792:
+       case nct6793:
                data->in_num = 15;
                data->pwm_num = 6;
                data->auto_pwm_num = 4;
@@ -3677,8 +3699,8 @@ static int nct6775_probe(struct platform_device *pdev)
                data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES;
                data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT;
                data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME;
-               data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME;
-               data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME;
+               data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME;
+               data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME;
                data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H;
                data->REG_PWM[0] = NCT6775_REG_PWM;
                data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT;
@@ -3918,6 +3940,7 @@ static int nct6775_probe(struct platform_device *pdev)
        case nct6779:
        case nct6791:
        case nct6792:
+       case nct6793:
                break;
        }
 
@@ -3950,6 +3973,7 @@ static int nct6775_probe(struct platform_device *pdev)
                        break;
                case nct6791:
                case nct6792:
+               case nct6793:
                        tmp |= 0x7e;
                        break;
                }
@@ -4047,7 +4071,8 @@ static int __maybe_unused nct6775_resume(struct device *dev)
        if (reg != data->sio_reg_enable)
                superio_outb(sioreg, SIO_REG_ENABLE, data->sio_reg_enable);
 
-       if (data->kind == nct6791 || data->kind == nct6792)
+       if (data->kind == nct6791 || data->kind == nct6792 ||
+           data->kind == nct6793)
                nct6791_enable_io_mapping(sioreg);
 
        superio_exit(sioreg);
@@ -4106,15 +4131,6 @@ static struct platform_driver nct6775_driver = {
        .probe          = nct6775_probe,
 };
 
-static const char * const nct6775_sio_names[] __initconst = {
-       "NCT6106D",
-       "NCT6775F",
-       "NCT6776D/F",
-       "NCT6779D",
-       "NCT6791D",
-       "NCT6792D",
-};
-
 /* nct6775_find() looks for a '627 in the Super-I/O config space */
 static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
 {
@@ -4150,6 +4166,9 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
        case SIO_NCT6792_ID:
                sio_data->kind = nct6792;
                break;
+       case SIO_NCT6793_ID:
+               sio_data->kind = nct6793;
+               break;
        default:
                if (val != 0xffff)
                        pr_debug("unsupported chip ID: 0x%04x\n", val);
@@ -4175,7 +4194,8 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
                superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01);
        }
 
-       if (sio_data->kind == nct6791 || sio_data->kind == nct6792)
+       if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
+           sio_data->kind == nct6793)
                nct6791_enable_io_mapping(sioaddr);
 
        superio_exit(sioaddr);
@@ -4285,7 +4305,7 @@ static void __exit sensors_nct6775_exit(void)
 }
 
 MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
-MODULE_DESCRIPTION("NCT6106D/NCT6775F/NCT6776F/NCT6779D/NCT6791D/NCT6792D driver");
+MODULE_DESCRIPTION("Driver for NCT6775F and compatible chips");
 MODULE_LICENSE("GPL");
 
 module_init(sensors_nct6775_init);
index da4c6979fbb8ed310e41e7e585aab421af9deb3d..aa26f3c3416bbbcd04dac1ec5381fcb081105d5e 100644 (file)
@@ -56,7 +56,6 @@ config INFINIBAND_ADDR_TRANS
 
 source "drivers/infiniband/hw/mthca/Kconfig"
 source "drivers/infiniband/hw/qib/Kconfig"
-source "drivers/infiniband/hw/ehca/Kconfig"
 source "drivers/infiniband/hw/cxgb3/Kconfig"
 source "drivers/infiniband/hw/cxgb4/Kconfig"
 source "drivers/infiniband/hw/mlx4/Kconfig"
index 1bdb9996d371b5e3eefbb57958f265e71e3743f7..aded2a5cc2d5d677cabe42707704119e68116c5d 100644 (file)
@@ -1,6 +1,5 @@
 obj-$(CONFIG_INFINIBAND_MTHCA)         += mthca/
 obj-$(CONFIG_INFINIBAND_QIB)           += qib/
-obj-$(CONFIG_INFINIBAND_EHCA)          += ehca/
 obj-$(CONFIG_INFINIBAND_CXGB3)         += cxgb3/
 obj-$(CONFIG_INFINIBAND_CXGB4)         += cxgb4/
 obj-$(CONFIG_MLX4_INFINIBAND)          += mlx4/
index e9c6f2a5b52de0958ec334f0a011f3883edf6bf3..cd7d3bc78e345c49b733b9120c5a5bed2540583b 100644 (file)
@@ -65,12 +65,10 @@ static void combiner_unmask_irq(struct irq_data *data)
        __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
 }
 
-static void combiner_handle_cascade_irq(unsigned int __irq,
-                                       struct irq_desc *desc)
+static void combiner_handle_cascade_irq(struct irq_desc *desc)
 {
        struct combiner_chip_data *chip_data = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
-       unsigned int irq = irq_desc_get_irq(desc);
        unsigned int cascade_irq, combiner_irq;
        unsigned long status;
 
@@ -88,7 +86,7 @@ static void combiner_handle_cascade_irq(unsigned int __irq,
        cascade_irq = irq_find_mapping(combiner_irq_domain, combiner_irq);
 
        if (unlikely(!cascade_irq))
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
        else
                generic_handle_irq(cascade_irq);
 
@@ -165,7 +163,7 @@ static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
 
        irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq);
        irq_set_chip_data(irq, &combiner_data[hw >> 3]);
-       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       irq_set_probe(irq);
 
        return 0;
 }
index 39b72da0c1437fc4caf658a85c0e2ba62dc70694..655cb967a1f2fe0b9c41f5d3484dbebe6be7331d 100644 (file)
@@ -200,7 +200,6 @@ static int armada_370_xp_msi_map(struct irq_domain *domain, unsigned int virq,
 {
        irq_set_chip_and_handler(virq, &armada_370_xp_msi_irq_chip,
                                 handle_simple_irq);
-       set_irq_flags(virq, IRQF_VALID);
 
        return 0;
 }
@@ -317,7 +316,7 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
                irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
                                        handle_level_irq);
        }
-       set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+       irq_set_probe(virq);
 
        return 0;
 }
@@ -447,8 +446,7 @@ static void armada_370_xp_handle_msi_irq(struct pt_regs *regs, bool is_chained)
 static void armada_370_xp_handle_msi_irq(struct pt_regs *r, bool b) {}
 #endif
 
-static void armada_370_xp_mpic_handle_cascade_irq(unsigned int irq,
-                                                 struct irq_desc *desc)
+static void armada_370_xp_mpic_handle_cascade_irq(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned long irqmap, irqn, irqsrc, cpuid;
index ed4ca9deca7030bf202b02a1034f71b229a3c2ff..bf9cc5f2e839e845fe1ce65caa672b6212d3ffbc 100644 (file)
@@ -96,7 +96,7 @@ struct armctrl_ic {
 static struct armctrl_ic intc __read_mostly;
 static void __exception_irq_entry bcm2835_handle_irq(
        struct pt_regs *regs);
-static void bcm2836_chained_handle_irq(unsigned int irq, struct irq_desc *desc);
+static void bcm2836_chained_handle_irq(struct irq_desc *desc);
 
 static void armctrl_mask_irq(struct irq_data *d)
 {
@@ -166,7 +166,7 @@ static int __init armctrl_of_init(struct device_node *node,
                        BUG_ON(irq <= 0);
                        irq_set_chip_and_handler(irq, &armctrl_chip,
                                handle_level_irq);
-                       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+                       irq_set_probe(irq);
                }
        }
 
@@ -245,7 +245,7 @@ static void __exception_irq_entry bcm2835_handle_irq(
                handle_IRQ(irq_linear_revmap(intc.domain, hwirq), regs);
 }
 
-static void bcm2836_chained_handle_irq(unsigned int irq, struct irq_desc *desc)
+static void bcm2836_chained_handle_irq(struct irq_desc *desc)
 {
        u32 hwirq;
 
index 409bdc6366c20a3ba909aae5b770dfe71dac08d9..0fea985ef1dc2da87d0cc7b0fe83ccf57a85aed2 100644 (file)
@@ -115,7 +115,7 @@ static inline void l1_writel(u32 val, void __iomem *reg)
                writel(val, reg);
 }
 
-static void bcm7038_l1_irq_handle(unsigned int irq, struct irq_desc *desc)
+static void bcm7038_l1_irq_handle(struct irq_desc *desc)
 {
        struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc);
        struct bcm7038_l1_cpu *cpu;
index d3f976913a6fbd9bb2af3ff4c4b1e906f5bae61e..61b18ab33ad9d0ec25e7fcf58fa69645cc521d17 100644 (file)
@@ -56,7 +56,7 @@ struct bcm7120_l2_intc_data {
        const __be32 *map_mask_prop;
 };
 
-static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)
+static void bcm7120_l2_intc_irq_handle(struct irq_desc *desc)
 {
        struct bcm7120_l1_intc_data *data = irq_desc_get_handler_data(desc);
        struct bcm7120_l2_intc_data *b = data->b;
index aedda06191eb08cdf0a688a9a7fbe63959e021f1..65cd341f331a5e5ae73f8404ce4d2b4cb19e796c 100644 (file)
@@ -49,13 +49,12 @@ struct brcmstb_l2_intc_data {
        u32 saved_mask; /* for suspend/resume */
 };
 
-static void brcmstb_l2_intc_irq_handle(unsigned int __irq,
-                                      struct irq_desc *desc)
+static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc)
 {
        struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc);
        struct irq_chip_generic *gc = irq_get_domain_generic_chip(b->domain, 0);
        struct irq_chip *chip = irq_desc_get_chip(desc);
-       unsigned int irq = irq_desc_get_irq(desc);
+       unsigned int irq;
        u32 status;
 
        chained_irq_enter(chip, desc);
@@ -65,7 +64,7 @@ static void brcmstb_l2_intc_irq_handle(unsigned int __irq,
 
        if (status == 0) {
                raw_spin_lock(&desc->lock);
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
                raw_spin_unlock(&desc->lock);
                goto out;
        }
index 2dd929eed9e0516fca48845f83720578622609be..eb5eb0cd414d21a78e6bbc59704c809287dffdd0 100644 (file)
@@ -132,14 +132,14 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq,
                                        irq_hw_number_t hw)
 {
        irq_flow_handler_t handler = handle_level_irq;
-       unsigned int flags = IRQF_VALID | IRQF_PROBE;
+       unsigned int flags = 0;
 
        if (!clps711x_irqs[hw].flags)
                return 0;
 
        if (clps711x_irqs[hw].flags & CLPS711X_FLAG_FIQ) {
                handler = handle_bad_irq;
-               flags |= IRQF_NOAUTOEN;
+               flags |= IRQ_NOAUTOEN;
        } else if (clps711x_irqs[hw].eoi) {
                handler = handle_fasteoi_irq;
        }
@@ -149,7 +149,7 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq,
                writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hw].eoi);
 
        irq_set_chip_and_handler(virq, &clps711x_intc_chip, handler);
-       set_irq_flags(virq, flags);
+       irq_modify_status(virq, IRQ_NOPROBE, flags);
 
        return 0;
 }
index efd95d9955e7e3b5a0be532f36fa64c8a7c4da47..052f266364c0cd1a3af91511a0eb87f11d8b43ec 100644 (file)
@@ -26,7 +26,7 @@
 #define APB_INT_FINALSTATUS_H  0x34
 #define APB_INT_BASE_OFFSET    0x04
 
-static void dw_apb_ictl_handler(unsigned int irq, struct irq_desc *desc)
+static void dw_apb_ictl_handler(struct irq_desc *desc)
 {
        struct irq_domain *d = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index db04fc1f56b2578203964a13c48548376af8a7fb..12985daa66ab31c9c7981e65ea0926938e5662fa 100644 (file)
@@ -95,8 +95,8 @@ static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
        struct v2m_data *v2m = irq_data_get_irq_chip_data(data);
        phys_addr_t addr = v2m->res.start + V2M_MSI_SETSPI_NS;
 
-       msg->address_hi = (u32) (addr >> 32);
-       msg->address_lo = (u32) (addr);
+       msg->address_hi = upper_32_bits(addr);
+       msg->address_lo = lower_32_bits(addr);
        msg->data = data->hwirq;
 }
 
index 26b55c53755f0db82c5b4cbcd1c16a9beb5c5109..ac7ae2b3cb83726e336ce310d95e2b890da8224d 100644 (file)
@@ -898,8 +898,10 @@ retry_baser:
                         * non-cacheable as well.
                         */
                        shr = tmp & GITS_BASER_SHAREABILITY_MASK;
-                       if (!shr)
+                       if (!shr) {
                                cache = GITS_BASER_nC;
+                               __flush_dcache_area(base, alloc_size);
+                       }
                        goto retry_baser;
                }
 
@@ -1140,6 +1142,8 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
                return NULL;
        }
 
+       __flush_dcache_area(itt, sz);
+
        dev->its = its;
        dev->itt = itt;
        dev->nr_ites = nr_ites;
index 7deed6ef54c2eaf048538e46ecbcb3ec6d5ff91c..36ecfc870e5a6cb86698cb218ac00cccc491e299 100644 (file)
@@ -70,11 +70,6 @@ static inline int gic_irq_in_rdist(struct irq_data *d)
        return gic_irq(d) < 32;
 }
 
-static inline bool forwarded_irq(struct irq_data *d)
-{
-       return d->handler_data != NULL;
-}
-
 static inline void __iomem *gic_dist_base(struct irq_data *d)
 {
        if (gic_irq_in_rdist(d))        /* SGI+PPI -> SGI_base for this CPU */
@@ -249,7 +244,7 @@ static void gic_eoimode1_mask_irq(struct irq_data *d)
         * disabled/masked will not get "stuck", because there is
         * noone to deactivate it (guest is being terminated).
         */
-       if (forwarded_irq(d))
+       if (irqd_is_forwarded_to_vcpu(d))
                gic_poke_irq(d, GICD_ICACTIVER);
 }
 
@@ -324,7 +319,7 @@ static void gic_eoimode1_eoi_irq(struct irq_data *d)
         * No need to deactivate an LPI, or an interrupt that
         * is is getting forwarded to a vcpu.
         */
-       if (gic_irq(d) >= 8192 || forwarded_irq(d))
+       if (gic_irq(d) >= 8192 || irqd_is_forwarded_to_vcpu(d))
                return;
        gic_write_dir(gic_irq(d));
 }
@@ -357,7 +352,10 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
 
 static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu)
 {
-       d->handler_data = vcpu;
+       if (vcpu)
+               irqd_set_forwarded_to_vcpu(d);
+       else
+               irqd_clr_forwarded_to_vcpu(d);
        return 0;
 }
 
@@ -754,13 +752,13 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
                irq_set_percpu_devid(irq);
                irq_domain_set_info(d, irq, hw, chip, d->host_data,
                                    handle_percpu_devid_irq, NULL, NULL);
-               set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+               irq_set_status_flags(irq, IRQ_NOAUTOEN);
        }
        /* SPIs */
        if (hw >= 32 && hw < gic_data.irq_nr) {
                irq_domain_set_info(d, irq, hw, chip, d->host_data,
                                    handle_fasteoi_irq, NULL, NULL);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               irq_set_probe(irq);
        }
        /* LPIs */
        if (hw >= 8192 && hw < GIC_ID_NR) {
@@ -768,7 +766,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
                        return -EPERM;
                irq_domain_set_info(d, irq, hw, chip, d->host_data,
                                    handle_fasteoi_irq, NULL, NULL);
-               set_irq_flags(irq, IRQF_VALID);
        }
 
        return 0;
index e6b7ed537952949eedb43105bcdd555209b62711..982c09c2d79171d21355c75153b4de87f4a1bee2 100644 (file)
@@ -145,29 +145,10 @@ static inline bool cascading_gic_irq(struct irq_data *d)
        void *data = irq_data_get_irq_handler_data(d);
 
        /*
-        * If handler_data pointing to one of the secondary GICs, then
-        * this is a cascading interrupt, and it cannot possibly be
-        * forwarded.
+        * If handler_data is set, this is a cascading interrupt, and
+        * it cannot possibly be forwarded.
         */
-       if (data >= (void *)(gic_data + 1) &&
-           data <  (void *)(gic_data + MAX_GIC_NR))
-               return true;
-
-       return false;
-}
-
-static inline bool forwarded_irq(struct irq_data *d)
-{
-       /*
-        * A forwarded interrupt:
-        * - is on the primary GIC
-        * - has its handler_data set to a value
-        * - that isn't a secondary GIC
-        */
-       if (d->handler_data && !cascading_gic_irq(d))
-               return true;
-
-       return false;
+       return data != NULL;
 }
 
 /*
@@ -201,7 +182,7 @@ static void gic_eoimode1_mask_irq(struct irq_data *d)
         * disabled/masked will not get "stuck", because there is
         * noone to deactivate it (guest is being terminated).
         */
-       if (forwarded_irq(d))
+       if (irqd_is_forwarded_to_vcpu(d))
                gic_poke_irq(d, GIC_DIST_ACTIVE_CLEAR);
 }
 
@@ -218,7 +199,7 @@ static void gic_eoi_irq(struct irq_data *d)
 static void gic_eoimode1_eoi_irq(struct irq_data *d)
 {
        /* Do not deactivate an IRQ forwarded to a vcpu. */
-       if (forwarded_irq(d))
+       if (irqd_is_forwarded_to_vcpu(d))
                return;
 
        writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_DEACTIVATE);
@@ -296,7 +277,10 @@ static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu)
        if (cascading_gic_irq(d))
                return -EINVAL;
 
-       d->handler_data = vcpu;
+       if (vcpu)
+               irqd_set_forwarded_to_vcpu(d);
+       else
+               irqd_clr_forwarded_to_vcpu(d);
        return 0;
 }
 
@@ -357,7 +341,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
        } while (1);
 }
 
-static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
+static void gic_handle_cascade_irq(struct irq_desc *desc)
 {
        struct gic_chip_data *chip_data = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -376,7 +360,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
 
        cascade_irq = irq_find_mapping(chip_data->domain, gic_irq);
        if (unlikely(gic_irq < 32 || gic_irq > 1020))
-               handle_bad_irq(cascade_irq, desc);
+               handle_bad_irq(desc);
        else
                generic_handle_irq(cascade_irq);
 
@@ -906,11 +890,11 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
                irq_set_percpu_devid(irq);
                irq_domain_set_info(d, irq, hw, chip, d->host_data,
                                    handle_percpu_devid_irq, NULL, NULL);
-               set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+               irq_set_status_flags(irq, IRQ_NOAUTOEN);
        } else {
                irq_domain_set_info(d, irq, hw, chip, d->host_data,
                                    handle_fasteoi_irq, NULL, NULL);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               irq_set_probe(irq);
        }
        return 0;
 }
@@ -1119,12 +1103,49 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
 #ifdef CONFIG_OF
 static int gic_cnt __initdata;
 
+static bool gic_check_eoimode(struct device_node *node, void __iomem **base)
+{
+       struct resource cpuif_res;
+
+       of_address_to_resource(node, 1, &cpuif_res);
+
+       if (!is_hyp_mode_available())
+               return false;
+       if (resource_size(&cpuif_res) < SZ_8K)
+               return false;
+       if (resource_size(&cpuif_res) == SZ_128K) {
+               u32 val_low, val_high;
+
+               /*
+                * Verify that we have the first 4kB of a GIC400
+                * aliased over the first 64kB by checking the
+                * GICC_IIDR register on both ends.
+                */
+               val_low = readl_relaxed(*base + GIC_CPU_IDENT);
+               val_high = readl_relaxed(*base + GIC_CPU_IDENT + 0xf000);
+               if ((val_low & 0xffff0fff) != 0x0202043B ||
+                   val_low != val_high)
+                       return false;
+
+               /*
+                * Move the base up by 60kB, so that we have a 8kB
+                * contiguous region, which allows us to use GICC_DIR
+                * at its normal offset. Please pass me that bucket.
+                */
+               *base += 0xf000;
+               cpuif_res.start += 0xf000;
+               pr_warn("GIC: Adjusting CPU interface base to %pa",
+                       &cpuif_res.start);
+       }
+
+       return true;
+}
+
 static int __init
 gic_of_init(struct device_node *node, struct device_node *parent)
 {
        void __iomem *cpu_base;
        void __iomem *dist_base;
-       struct resource cpu_res;
        u32 percpu_offset;
        int irq;
 
@@ -1137,14 +1158,11 @@ gic_of_init(struct device_node *node, struct device_node *parent)
        cpu_base = of_iomap(node, 1);
        WARN(!cpu_base, "unable to map gic cpu registers\n");
 
-       of_address_to_resource(node, 1, &cpu_res);
-
        /*
         * Disable split EOI/Deactivate if either HYP is not available
         * or the CPU interface is too small.
         */
-       if (gic_cnt == 0 && (!is_hyp_mode_available() ||
-                            resource_size(&cpu_res) < SZ_8K))
+       if (gic_cnt == 0 && !gic_check_eoimode(node, &cpu_base))
                static_key_slow_dec(&supports_deactivate);
 
        if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
index a0128c7c98dd5d6e62335894b3369a2709856248..8f3ca8f3a62b615b2d670851dd8afe1d75904bee 100644 (file)
@@ -307,11 +307,11 @@ static int hip04_irq_domain_map(struct irq_domain *d, unsigned int irq,
                irq_set_percpu_devid(irq);
                irq_set_chip_and_handler(irq, &hip04_irq_chip,
                                         handle_percpu_devid_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+               irq_set_status_flags(irq, IRQ_NOAUTOEN);
        } else {
                irq_set_chip_and_handler(irq, &hip04_irq_chip,
                                         handle_fasteoi_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               irq_set_probe(irq);
        }
        irq_set_chip_data(irq, d->host_data);
        return 0;
index 4836102ba31205ddc5643e1bfacc24e4cd81eacb..e484fd2553210f55fd0eb72375f4ada1511c7fec 100644 (file)
@@ -352,7 +352,7 @@ void __init init_i8259_irqs(void)
        __init_i8259_irqs(NULL);
 }
 
-static void i8259_irq_dispatch(unsigned int __irq, struct irq_desc *desc)
+static void i8259_irq_dispatch(struct irq_desc *desc)
 {
        struct irq_domain *domain = irq_desc_get_handler_data(desc);
        int hwirq = i8259_irq();
index 841604b81004f415473a91f970ae74a02d3a8052..c02d29c9dc05b77aa4ed62083ef22fbdf5feaea8 100644 (file)
@@ -218,7 +218,7 @@ static int pdc_irq_set_wake(struct irq_data *data, unsigned int on)
        return 0;
 }
 
-static void pdc_intc_perip_isr(unsigned int __irq, struct irq_desc *desc)
+static void pdc_intc_perip_isr(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct pdc_intc_priv *priv;
@@ -240,7 +240,7 @@ found:
        generic_handle_irq(irq_no);
 }
 
-static void pdc_intc_syswake_isr(unsigned int irq, struct irq_desc *desc)
+static void pdc_intc_syswake_isr(struct irq_desc *desc)
 {
        struct pdc_intc_priv *priv;
        unsigned int syswake, irq_no;
index c1517267b5dbcf48aac50c9930db4c54cec762ae..deb89d63a728d214bfbb3470eb25b1227164acac 100644 (file)
@@ -83,7 +83,7 @@ static void keystone_irq_ack(struct irq_data *d)
        /* nothing to do here */
 }
 
-static void keystone_irq_handler(unsigned __irq, struct irq_desc *desc)
+static void keystone_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);
@@ -127,7 +127,7 @@ static int keystone_irq_map(struct irq_domain *h, unsigned int virq,
 
        irq_set_chip_data(virq, kirq);
        irq_set_chip_and_handler(virq, &kirq->chip, handle_level_irq);
-       set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+       irq_set_probe(virq);
        return 0;
 }
 
index 5f4c52928d1671b99cfc759552562bd5b8d09691..8c38b3d92e1cdb4a101a4abae331c2d9eaae3391 100644 (file)
@@ -446,7 +446,7 @@ static int meta_intc_irq_set_type(struct irq_data *data, unsigned int flow_type)
  * Whilst using TR2 to detect external interrupts is a software convention it is
  * (hopefully) unlikely to change.
  */
-static void meta_intc_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void meta_intc_irq_demux(struct irq_desc *desc)
 {
        struct meta_intc_priv *priv = &meta_intc_priv;
        irq_hw_number_t hw;
index 3d23ce3edb5cccc8b50073af72633e0b3b3ed11f..a5f053bd2f443301a3bf62a9c30c523cded309cd 100644 (file)
@@ -220,7 +220,7 @@ static int metag_internal_irq_set_affinity(struct irq_data *data,
  *     occurred. It is this function's job to demux this irq and
  *     figure out exactly which trigger needs servicing.
  */
-static void metag_internal_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void metag_internal_irq_demux(struct irq_desc *desc)
 {
        struct metag_internal_irq_priv *priv = irq_desc_get_handler_data(desc);
        irq_hw_number_t hw;
index 1764bcf8ee6bedc5619abec9f319b9ba5ca5f441..af2f16bb8a94d3912787b1893431c97e541fc0ec 100644 (file)
@@ -546,7 +546,7 @@ static void __gic_irq_dispatch(void)
        gic_handle_shared_int(false);
 }
 
-static void gic_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+static void gic_irq_dispatch(struct irq_desc *desc)
 {
        gic_handle_local_int(true);
        gic_handle_shared_int(true);
index 781ed6e71dbb3d1343440229b725db4e5eca3e1b..013fc9659a842ba04ee8e238b9958a283108ece5 100644 (file)
@@ -129,7 +129,7 @@ struct irq_chip icu_irq_chip = {
        .irq_unmask     = icu_unmask_irq,
 };
 
-static void icu_mux_irq_demux(unsigned int __irq, struct irq_desc *desc)
+static void icu_mux_irq_demux(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct irq_domain *domain;
@@ -164,7 +164,6 @@ static int mmp_irq_domain_map(struct irq_domain *d, unsigned int irq,
                              irq_hw_number_t hw)
 {
        irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq);
-       set_irq_flags(irq, IRQF_VALID);
        return 0;
 }
 
@@ -234,7 +233,6 @@ void __init icu_init_irq(void)
        for (irq = 0; irq < 64; irq++) {
                icu_mask_irq(irq_get_irq_data(irq));
                irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq);
-               set_irq_flags(irq, IRQF_VALID);
        }
        irq_set_default_host(icu_data[0].domain);
        set_handle_irq(mmp_handle_irq);
@@ -337,7 +335,6 @@ void __init mmp2_init_icu(void)
                        irq_set_chip_and_handler(irq, &icu_irq_chip,
                                                 handle_level_irq);
                }
-               set_irq_flags(irq, IRQF_VALID);
        }
        irq_set_default_host(icu_data[0].domain);
        set_handle_irq(mmp2_handle_irq);
index 1faf812f3dc8e4a8da4e8d9a2b4f214216705041..604df63e2edf6f9706db28d08bf559a0347e8bd8 100644 (file)
@@ -84,7 +84,6 @@ static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq,
                                irq_hw_number_t hw)
 {
        irq_set_chip_and_handler(virq, &mxs_icoll_chip, handle_level_irq);
-       set_irq_flags(virq, IRQF_VALID);
 
        return 0;
 }
index 5ea999a724b5db93ade94d5a8daa57f7b19da55b..be4c5a8c96593ac6c218f05283811e5cfee1a158 100644 (file)
@@ -106,7 +106,7 @@ IRQCHIP_DECLARE(orion_intc, "marvell,orion-intc", orion_irq_init);
 #define ORION_BRIDGE_IRQ_CAUSE 0x00
 #define ORION_BRIDGE_IRQ_MASK  0x04
 
-static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void orion_bridge_irq_handler(struct irq_desc *desc)
 {
        struct irq_domain *d = irq_desc_get_handler_data(desc);
 
index 0670ab4e3897bf612eb9e932a31ebc378cd3b803..9525335723f68f7e4c408d81a6538dc8e72a2b5f 100644 (file)
@@ -283,6 +283,9 @@ static int intc_irqpin_irq_set_type(struct irq_data *d, unsigned int type)
 static int intc_irqpin_irq_set_wake(struct irq_data *d, unsigned int on)
 {
        struct intc_irqpin_priv *p = irq_data_get_irq_chip_data(d);
+       int hw_irq = irqd_to_hwirq(d);
+
+       irq_set_irq_wake(p->irq[hw_irq].requested_irq, on);
 
        if (!p->clk)
                return 0;
@@ -332,6 +335,12 @@ static irqreturn_t intc_irqpin_shared_irq_handler(int irq, void *dev_id)
        return status;
 }
 
+/*
+ * This lock class tells lockdep that INTC External IRQ Pin irqs are in a
+ * different category than their parents, so it won't report false recursion.
+ */
+static struct lock_class_key intc_irqpin_irq_lock_class;
+
 static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq,
                                      irq_hw_number_t hw)
 {
@@ -342,8 +351,8 @@ static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq,
 
        intc_irqpin_dbg(&p->irq[hw], "map");
        irq_set_chip_data(virq, h->host_data);
+       irq_set_lockdep_class(virq, &intc_irqpin_irq_lock_class);
        irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
-       set_irq_flags(virq, IRQF_VALID); /* kill me now */
        return 0;
 }
 
index 2aa3add711a6612af6c1653c976a043e743d9058..35bf97ba4a3d196db74ff5835dc9c59fb056c2af 100644 (file)
@@ -121,6 +121,9 @@ static int irqc_irq_set_type(struct irq_data *d, unsigned int type)
 static int irqc_irq_set_wake(struct irq_data *d, unsigned int on)
 {
        struct irqc_priv *p = irq_data_get_irq_chip_data(d);
+       int hw_irq = irqd_to_hwirq(d);
+
+       irq_set_irq_wake(p->irq[hw_irq].requested_irq, on);
 
        if (!p->clk)
                return 0;
@@ -150,6 +153,12 @@ static irqreturn_t irqc_irq_handler(int irq, void *dev_id)
        return IRQ_NONE;
 }
 
+/*
+ * This lock class tells lockdep that IRQC irqs are in a different
+ * category than their parents, so it won't report false recursion.
+ */
+static struct lock_class_key irqc_irq_lock_class;
+
 static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,
                               irq_hw_number_t hw)
 {
@@ -157,6 +166,7 @@ static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq,
 
        irqc_dbg(&p->irq[hw], "map");
        irq_set_chip_data(virq, h->host_data);
+       irq_set_lockdep_class(virq, &irqc_irq_lock_class);
        irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq);
        return 0;
 }
index 506d9f20ca51950e481148c4b3d91c49e1766173..7154b011ddd2f65a65f7079bfe88783c50d0d373 100644 (file)
@@ -298,7 +298,7 @@ static struct irq_chip s3c_irq_eint0t4 = {
        .irq_set_type   = s3c_irqext0_type,
 };
 
-static void s3c_irq_demux(unsigned int __irq, struct irq_desc *desc)
+static void s3c_irq_demux(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc);
@@ -466,13 +466,11 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
 
        irq_set_chip_data(virq, irq_data);
 
-       set_irq_flags(virq, IRQF_VALID);
-
        if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) {
                if (irq_data->parent_irq > 31) {
                        pr_err("irq-s3c24xx: parent irq %lu is out of range\n",
                               irq_data->parent_irq);
-                       goto err;
+                       return -EINVAL;
                }
 
                parent_irq_data = &parent_intc->irqs[irq_data->parent_irq];
@@ -485,18 +483,12 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq,
                if (!irqno) {
                        pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n",
                               irq_data->parent_irq);
-                       goto err;
+                       return -EINVAL;
                }
                irq_set_chained_handler(irqno, s3c_irq_demux);
        }
 
        return 0;
-
-err:
-       set_irq_flags(virq, 0);
-
-       /* the only error can result from bad mapping data*/
-       return -EINVAL;
 }
 
 static const struct irq_domain_ops s3c24xx_irq_ops = {
@@ -1174,8 +1166,6 @@ static int s3c24xx_irq_map_of(struct irq_domain *h, unsigned int virq,
 
        irq_set_chip_data(virq, irq_data);
 
-       set_irq_flags(virq, IRQF_VALID);
-
        return 0;
 }
 
index 4ad3e7c69aa779e2f53b039fb1138807ce9f1ae2..0704362f4c824c6ba2b87e42353f0481bcff36e5 100644 (file)
@@ -83,7 +83,7 @@ static int sun4i_irq_map(struct irq_domain *d, unsigned int virq,
                         irq_hw_number_t hw)
 {
        irq_set_chip_and_handler(virq, &sun4i_irq_chip, handle_fasteoi_irq);
-       set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+       irq_set_probe(virq);
 
        return 0;
 }
index 772a82cacbf7a7b2cbb37b263327f86848413d88..c143dd58410c64cc97d5afcc5442a45d5b60ebf9 100644 (file)
@@ -58,7 +58,7 @@ static inline u32 sunxi_sc_nmi_read(struct irq_chip_generic *gc, u32 off)
        return irq_reg_readl(gc, off);
 }
 
-static void sunxi_sc_nmi_handle_irq(unsigned int irq, struct irq_desc *desc)
+static void sunxi_sc_nmi_handle_irq(struct irq_desc *desc)
 {
        struct irq_domain *domain = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index 3318296613669c1c489f848ac36e399760a0d312..848d782a2a3bdc6a7d3d3c66732da1f205cc8581 100644 (file)
@@ -97,7 +97,7 @@ static int tb10x_irq_set_type(struct irq_data *data, unsigned int flow_type)
        return IRQ_SET_MASK_OK;
 }
 
-static void tb10x_irq_cascade(unsigned int __irq, struct irq_desc *desc)
+static void tb10x_irq_cascade(struct irq_desc *desc)
 {
        struct irq_domain *domain = irq_desc_get_handler_data(desc);
        unsigned int irq = irq_desc_get_irq(desc);
index 16123f688768f24585653171b87de1785b764400..598ab3f0e0ac54b79f1438c2193f8bc112949975 100644 (file)
@@ -65,19 +65,19 @@ static void fpga_irq_unmask(struct irq_data *d)
        writel(mask, f->base + IRQ_ENABLE_SET);
 }
 
-static void fpga_irq_handle(unsigned int __irq, struct irq_desc *desc)
+static void fpga_irq_handle(struct irq_desc *desc)
 {
        struct fpga_irq_data *f = irq_desc_get_handler_data(desc);
-       unsigned int irq = irq_desc_get_irq(desc);
        u32 status = readl(f->base + IRQ_STATUS);
 
        if (status == 0) {
-               do_bad_IRQ(irq, desc);
+               do_bad_IRQ(desc);
                return;
        }
 
        do {
-               irq = ffs(status) - 1;
+               unsigned int irq = ffs(status) - 1;
+
                status &= ~(1 << irq);
                generic_handle_irq(irq_find_mapping(f->domain, irq));
        } while (status);
@@ -128,7 +128,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
        irq_set_chip_data(irq, f);
        irq_set_chip_and_handler(irq, &f->chip,
                                handle_level_irq);
-       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       irq_set_probe(irq);
        return 0;
 }
 
index 03846dff42123c96079489f998ed18e7623ff576..b956dfffe78ca1b64a469aac808223718090f3a7 100644 (file)
@@ -201,7 +201,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
                return -EPERM;
        irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
        irq_set_chip_data(irq, v->base);
-       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       irq_set_probe(irq);
        return 0;
 }
 
@@ -225,7 +225,7 @@ static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
        return handled;
 }
 
-static void vic_handle_irq_cascaded(unsigned int irq, struct irq_desc *desc)
+static void vic_handle_irq_cascaded(struct irq_desc *desc)
 {
        u32 stat, hwirq;
        struct irq_chip *host_chip = irq_desc_get_chip(desc);
index 8371d9978d31d9db5550ed1cdbf5cb28936b4fbd..f9af0af21751d8cad3a03256e375ae464723fd26 100644 (file)
@@ -167,7 +167,6 @@ static int vt8500_irq_map(struct irq_domain *h, unsigned int virq,
                                                        irq_hw_number_t hw)
 {
        irq_set_chip_and_handler(virq, &vt8500_irq_chip, handle_level_irq);
-       set_irq_flags(virq, IRQF_VALID);
 
        return 0;
 }
index 4cbd9c5dc1e6fc1e65810c28c61c3a780942a8a1..1ccd2abed65f5348d0beaa114a2d1326c8cc1b67 100644 (file)
@@ -182,7 +182,7 @@ static struct spear_shirq *spear320_shirq_blocks[] = {
        &spear320_shirq_intrcomm_ras,
 };
 
-static void shirq_handler(unsigned __irq, struct irq_desc *desc)
+static void shirq_handler(struct irq_desc *desc)
 {
        struct spear_shirq *shirq = irq_desc_get_handler_data(desc);
        u32 pend;
@@ -211,7 +211,6 @@ static void __init spear_shirq_register(struct spear_shirq *shirq,
        for (i = 0; i < shirq->nr_irqs; i++) {
                irq_set_chip_and_handler(shirq->virq_base + i,
                                         shirq->irq_chip, handle_simple_irq);
-               set_irq_flags(shirq->virq_base + i, IRQF_VALID);
                irq_set_chip_data(shirq->virq_base + i, shirq);
        }
 }
index 70f4255ff291044dfd0d9b526168c24c7ffa6ea8..42990f2d03178885d6021bce5ef3a9315d70f447 100644 (file)
@@ -170,6 +170,7 @@ config LEDS_SUNFIRE
 
 config LEDS_IPAQ_MICRO
        tristate "LED Support for the Compaq iPAQ h3xxx"
+       depends on LEDS_CLASS
        depends on MFD_IPAQ_MICRO
        help
          Choose this option if you want to use the notification LED on
@@ -229,7 +230,7 @@ config LEDS_LP55XX_COMMON
        tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501"
        depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || LEDS_LP8501
        select FW_LOADER
-       select FW_LOADER_USER_HELPER_FALLBACK
+       select FW_LOADER_USER_HELPER
        help
          This option supports common operations for LP5521/5523/55231/5562/8501
          devices.
index fd7c25fd29c112dffd7337bb279de20740fd1eed..ac77d36b630cda0b32dbcd312e97d461192b8ecc 100644 (file)
@@ -331,7 +331,7 @@ static void aat1290_led_validate_mm_current(struct aat1290_led *led,
        cfg->max_brightness = b + 1;
 }
 
-int init_mm_current_scale(struct aat1290_led *led,
+static int init_mm_current_scale(struct aat1290_led *led,
                        struct aat1290_led_config_data *cfg)
 {
        int max_mm_current_percent[] = { 20, 22, 25, 28, 32, 36, 40, 45, 50, 56,
@@ -559,6 +559,7 @@ static const struct of_device_id aat1290_led_dt_match[] = {
        { .compatible = "skyworks,aat1290" },
        {},
 };
+MODULE_DEVICE_TABLE(of, aat1290_led_dt_match);
 
 static struct platform_driver aat1290_led_driver = {
        .probe          = aat1290_led_probe,
index 986fe1e28f842b0199e49cc284529b8a12ac2b75..1793727bc9ae5f6c64467a68b4646b92e0963e1b 100644 (file)
@@ -395,6 +395,7 @@ static const struct of_device_id bcm6328_leds_of_match[] = {
        { .compatible = "brcm,bcm6328-leds", },
        { },
 };
+MODULE_DEVICE_TABLE(of, bcm6328_leds_of_match);
 
 static struct platform_driver bcm6328_leds_driver = {
        .probe = bcm6328_leds_probe,
index 21f96930b3be3a35a07142e204c449e843c643a3..7ea3526702e0c56b2a841e0bf2d2dccbe3f606f6 100644 (file)
@@ -226,6 +226,7 @@ static const struct of_device_id bcm6358_leds_of_match[] = {
        { .compatible = "brcm,bcm6358-leds", },
        { },
 };
+MODULE_DEVICE_TABLE(of, bcm6358_leds_of_match);
 
 static struct platform_driver bcm6358_leds_driver = {
        .probe = bcm6358_leds_probe,
index 2ae8c4d17ff8e0c2e971102a5844170c2e734ec2..feca07be85f590c09f4b12a69835e59e44ecff9b 100644 (file)
@@ -426,6 +426,7 @@ static const struct of_device_id ktd2692_match[] = {
        { .compatible = "kinetic,ktd2692", },
        { /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(of, ktd2692_match);
 
 static struct platform_driver ktd2692_driver = {
        .driver = {
index df348a06d8c71faa60d80530f29bec8a050469dc..afbb1409b2e24a1a5c6636409e9cf874f84955e4 100644 (file)
@@ -1080,6 +1080,7 @@ static const struct of_device_id max77693_led_dt_match[] = {
        { .compatible = "maxim,max77693-led" },
        {},
 };
+MODULE_DEVICE_TABLE(of, max77693_led_dt_match);
 
 static struct platform_driver max77693_led_driver = {
        .probe          = max77693_led_probe,
index b33514d9f427e279bf091abab4126f55e0d48182..a95a61220169ddc8099ba127d01cdb0db3a5adcb 100644 (file)
@@ -337,6 +337,7 @@ static const struct of_device_id of_ns2_leds_match[] = {
        { .compatible = "lacie,ns2-leds", },
        {},
 };
+MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
 #endif /* CONFIG_OF_GPIO */
 
 struct ns2_led_priv {
index 4b54128bc78ed35f07c6d974a4aa420ff5377699..a726f01e3b026931bdf782dd8e00f2838c8d66a3 100644 (file)
@@ -138,7 +138,7 @@ static void asic3_irq_flip_edge(struct asic3 *asic,
        spin_unlock_irqrestore(&asic->lock, flags);
 }
 
-static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void asic3_irq_demux(struct irq_desc *desc)
 {
        struct asic3 *asic = irq_desc_get_handler_data(desc);
        struct irq_data *data = irq_desc_get_irq_data(desc);
index a76eb6ef47a042980871be48257d92e1e72c1208..b279205659a4280b3ab2c578b4b7825e2cfb47d4 100644 (file)
@@ -205,7 +205,7 @@ static void pcap_isr_work(struct work_struct *work)
        } while (gpio_get_value(pdata->gpio));
 }
 
-static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pcap_irq_handler(struct irq_desc *desc)
 {
        struct pcap_chip *pcap = irq_desc_get_handler_data(desc);
 
index 9131cdcdc64a4a30ed09dfa2697436e53a7cd14a..6ccaf90d98fd6e1020da79583c076591d683342b 100644 (file)
@@ -98,7 +98,7 @@ static struct irq_chip egpio_muxed_chip = {
        .irq_unmask     = egpio_unmask,
 };
 
-static void egpio_handler(unsigned int irq, struct irq_desc *desc)
+static void egpio_handler(struct irq_desc *desc)
 {
        struct egpio_info *ei = irq_desc_get_handler_data(desc);
        int irqpin;
index 5bb49f08955d03dc4e646d17c1f8e4f026a18170..798e44306382e1bb12dc37a3727d74a912846631 100644 (file)
@@ -65,7 +65,7 @@ struct jz4740_adc {
        spinlock_t lock;
 };
 
-static void jz4740_adc_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void jz4740_adc_irq_demux(struct irq_desc *desc)
 {
        struct irq_chip_generic *gc = irq_desc_get_handler_data(desc);
        uint8_t status;
index 59502d02cd158f3492492ccf96c0451bd7ee19e6..1b7ec0870c2a8e0a8e772bcf93f15d701fa1a1e0 100644 (file)
@@ -156,7 +156,7 @@ static int pm8xxx_irq_master_handler(struct pm_irq_chip *chip, int master)
        return ret;
 }
 
-static void pm8xxx_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pm8xxx_irq_handler(struct irq_desc *desc)
 {
        struct pm_irq_chip *chip = irq_desc_get_handler_data(desc);
        struct irq_chip *irq_chip = irq_desc_get_chip(desc);
index 16fc1adc4fa36b12b941f6cdd69be0b42ff4ddea..94bd89cb1f0618581d3f190f2decb1e6b8a0ef7e 100644 (file)
@@ -185,7 +185,7 @@ static struct mfd_cell t7l66xb_cells[] = {
 /*--------------------------------------------------------------------------*/
 
 /* Handle the T7L66XB interrupt mux */
-static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc)
+static void t7l66xb_irq(struct irq_desc *desc)
 {
        struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc);
        unsigned int isr;
index 775b9aca871a30c12403644ac213a5718d0e81aa..8c84a513016b6869e6cb03e0324d5729c18ba16d 100644 (file)
@@ -522,8 +522,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base)
 
 /*--------------------------------------------------------------------------*/
 
-static void
-tc6393xb_irq(unsigned int irq, struct irq_desc *desc)
+static void tc6393xb_irq(struct irq_desc *desc)
 {
        struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc);
        unsigned int isr;
index 9a2302129711f92e42c5b030272f15a3aef44997..f691d7ecad526c7acf07272e49a9cc001737bf58 100644 (file)
@@ -282,7 +282,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb)
  * SIBCLK to talk to the chip.  We leave the clock running until
  * we have finished processing all interrupts from the chip.
  */
-static void ucb1x00_irq(unsigned int __irq, struct irq_desc *desc)
+static void ucb1x00_irq(struct irq_desc *desc)
 {
        struct ucb1x00 *ucb = irq_desc_get_handler_data(desc);
        unsigned int isr, i;
index 6f484dfe78f937ce2248b5d9761271d59b258fd2..6982f603fadc51a20154f38cbf1f82d95125f8df 100644 (file)
@@ -1,4 +1,4 @@
-ccflags-y := -Werror
+ccflags-y := -Werror -Wno-unused-const-variable
 
 cxl-y                          += main.o file.o irq.o fault.o native.o
 cxl-y                          += context.o sysfs.o debugfs.o pci.o trace.o
index 02c85160bfe9f63400d62435b48721804edf3496..a5e977192b61f97bfbace09aa93f0b577be67bb7 100644 (file)
@@ -1249,8 +1249,6 @@ static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id)
        int slice;
        int rc;
 
-       pci_dev_get(dev);
-
        if (cxl_verbose)
                dump_cxl_config_space(dev);
 
index 6dd16a6d153f0e55f0f4f7d122b4b27012a3b329..94b520896b18350fdf3c7d59c5789718bc75a58e 100644 (file)
@@ -48,6 +48,12 @@ static bool cxl_pci_enable_device_hook(struct pci_dev *dev)
 
        phb = pci_bus_to_host(dev->bus);
        afu = (struct cxl_afu *)phb->private_data;
+
+       if (!cxl_adapter_link_ok(afu->adapter)) {
+               dev_warn(&dev->dev, "%s: Device link is down, refusing to enable AFU\n", __func__);
+               return false;
+       }
+
        set_dma_ops(&dev->dev, &dma_direct_ops);
        set_dma_offset(&dev->dev, PAGE_OFFSET);
 
index 4402a1e48c9bb9d8153df9e9f9378d5e4ece38b3..4c7de8c446599f5b0198fb3d4d015d9540f9f962 100644 (file)
@@ -1047,13 +1047,15 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget)
 
        /* If we used up all the quota - we're probably not done yet... */
        if (done == budget) {
-               int cpu_curr;
                const struct cpumask *aff;
+               struct irq_data *idata;
+               int cpu_curr;
 
                INC_PERF_COUNTER(priv->pstats.napi_quota);
 
                cpu_curr = smp_processor_id();
-               aff = irq_desc_get_irq_data(cq->irq_desc)->affinity;
+               idata = irq_desc_get_irq_data(cq->irq_desc);
+               aff = irq_data_get_affinity_mask(idata);
 
                if (likely(cpumask_test_cpu(cpu_curr, aff)))
                        return budget;
index 59ad54a63d9fa98fcd584a68c7dbb8a4aa863d18..cb477518dd0e4d397ede8ccc83ffe2f29ceb02a6 100644 (file)
@@ -128,13 +128,13 @@ static ssize_t namespace_store(struct device *dev,
        struct nd_btt *nd_btt = to_nd_btt(dev);
        ssize_t rc;
 
-       nvdimm_bus_lock(dev);
        device_lock(dev);
+       nvdimm_bus_lock(dev);
        rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len);
        dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__,
                        rc, buf, buf[len - 1] == '\n' ? "" : "\n");
-       device_unlock(dev);
        nvdimm_bus_unlock(dev);
+       device_unlock(dev);
 
        return rc;
 }
index 3fd7d0d81a470b4cff54b093b0c24c6d14c376b5..71805a1aa0f3e5f002ee5d26339c53d49aadf951 100644 (file)
@@ -148,13 +148,13 @@ static ssize_t namespace_store(struct device *dev,
        struct nd_pfn *nd_pfn = to_nd_pfn(dev);
        ssize_t rc;
 
-       nvdimm_bus_lock(dev);
        device_lock(dev);
+       nvdimm_bus_lock(dev);
        rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len);
        dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__,
                        rc, buf, buf[len - 1] == '\n' ? "" : "\n");
-       device_unlock(dev);
        nvdimm_bus_unlock(dev);
+       device_unlock(dev);
 
        return rc;
 }
index b9525385c0dc35532ceaed6087c3f36ea2697ae0..0ba6a978f227e76a4b0c27046e2736d43cf37e45 100644 (file)
@@ -92,6 +92,8 @@ static int pmem_rw_page(struct block_device *bdev, sector_t sector,
        struct pmem_device *pmem = bdev->bd_disk->private_data;
 
        pmem_do_bvec(pmem, page, PAGE_CACHE_SIZE, 0, rw, sector);
+       if (rw & WRITE)
+               wmb_pmem();
        page_endio(page, rw & WRITE, 0);
 
        return 0;
index 81253e70b1c5441b41544a58f682caa73f84dbc8..0aa81bd3de12d8eca876851e6f019a87f9b88f64 100644 (file)
@@ -110,7 +110,7 @@ static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie)
        return -EINVAL;
 }
 
-static void ks_pcie_msi_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void ks_pcie_msi_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc);
@@ -138,8 +138,7 @@ static void ks_pcie_msi_irq_handler(unsigned int __irq, struct irq_desc *desc)
  * Traverse through pending legacy interrupts and invoke handler for each. Also
  * takes care of interrupt controller level mask/ack operation.
  */
-static void ks_pcie_legacy_irq_handler(unsigned int __irq,
-                                      struct irq_desc *desc)
+static void ks_pcie_legacy_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc);
index 996327cfa1e1945e47449f1a33dd941ef143b372..e491681daf22681c7bd541ad75d078edfa32ea1c 100644 (file)
@@ -295,7 +295,7 @@ static int xgene_msi_init_allocator(struct xgene_msi *xgene_msi)
        return 0;
 }
 
-static void xgene_msi_isr(unsigned int irq, struct irq_desc *desc)
+static void xgene_msi_isr(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct xgene_msi_group *msi_groups;
index 7d9482bf825271d52e7205fe9c67f330a64f0ffe..1ca783098e47463bd3c9a5f267f5fb00eb68ef88 100644 (file)
@@ -143,7 +143,7 @@ static inline bool cygnus_get_bit(struct cygnus_gpio *chip, unsigned int reg,
        return !!(readl(chip->base + offset) & BIT(shift));
 }
 
-static void cygnus_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void cygnus_gpio_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct cygnus_gpio *chip = to_cygnus_gpio(gc);
index 69723e07036bafbd29c6d6deb66e2f7bd7f0133e..9638a00c67c2bd9a3735a632c99d01e9c2625e5d 100644 (file)
@@ -349,6 +349,9 @@ static bool pinctrl_ready_for_gpio_range(unsigned gpio)
        struct pinctrl_gpio_range *range = NULL;
        struct gpio_chip *chip = gpio_to_chip(gpio);
 
+       if (WARN(!chip, "no gpio_chip for gpio%i?", gpio))
+               return false;
+
        mutex_lock(&pinctrldev_list_mutex);
 
        /* Loop over the pin controllers */
index dac4865f3203d1750653d644caabffb1fcdbf853..f79ea430f651996a2f148e141319861e285c2d28 100644 (file)
@@ -425,7 +425,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
        }
 }
 
-static void byt_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void byt_gpio_irq_handler(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct byt_gpio *vg = to_byt_gpio(irq_desc_get_handler_data(desc));
index 2d5d3ddc36e5b36702771fb217967a6a3268a1f2..270c127e03ea72f759d74758d3d81b00d60e52bb 100644 (file)
@@ -1414,7 +1414,7 @@ static struct irq_chip chv_gpio_irqchip = {
        .flags = IRQCHIP_SKIP_SET_WAKE,
 };
 
-static void chv_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void chv_gpio_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc);
index bb377c110541b34d09a65867765706cb278cb9c9..54848b8decef7735d8b009c6431a970f94204488 100644 (file)
@@ -836,7 +836,7 @@ static void intel_gpio_community_irq_handler(struct gpio_chip *gc,
        }
 }
 
-static void intel_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void intel_gpio_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(gc);
index 7726c6caaf8350f7832ecb81ff26c074022b77a9..1b22f96ba839af38d920d40f0f63309d2141a2b5 100644 (file)
@@ -1190,7 +1190,7 @@ mtk_eint_debounce_process(struct mtk_pinctrl *pctl, int index)
        }
 }
 
-static void mtk_eint_irq_handler(unsigned irq, struct irq_desc *desc)
+static void mtk_eint_irq_handler(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct mtk_pinctrl *pctl = irq_desc_get_handler_data(desc);
index 352ede13a9e9a33ab40868810ac4eef723c46035..96cf03908e93cc1462435b1aebc6c178c4a620f5 100644 (file)
@@ -860,7 +860,7 @@ static void __nmk_gpio_irq_handler(struct irq_desc *desc, u32 status)
        chained_irq_exit(host_chip, desc);
 }
 
-static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void nmk_gpio_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *chip = irq_desc_get_handler_data(desc);
        struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip);
@@ -873,7 +873,7 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
        __nmk_gpio_irq_handler(desc, status);
 }
 
-static void nmk_gpio_latent_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void nmk_gpio_latent_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *chip = irq_desc_get_handler_data(desc);
        struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip);
index a5976ebc4482633514e7b8b6259b528b2bb2c0ed..f6be68518c87d78195d3a9505b8eab5377804227 100644 (file)
@@ -530,8 +530,7 @@ static inline void preflow_handler(struct irq_desc *desc)
 static inline void preflow_handler(struct irq_desc *desc) { }
 #endif
 
-static void adi_gpio_handle_pint_irq(unsigned int inta_irq,
-                       struct irq_desc *desc)
+static void adi_gpio_handle_pint_irq(struct irq_desc *desc)
 {
        u32 request;
        u32 level_mask, hwirq;
index 5e86bb8ca80e68c0f48372483b7eea6001d6e816..3318f1d6193c8a49f1ca8f4348dd25010fe18758 100644 (file)
@@ -492,15 +492,15 @@ static struct irq_chip amd_gpio_irqchip = {
        .irq_set_type = amd_gpio_irq_set_type,
 };
 
-static void amd_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void amd_gpio_irq_handler(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
        u32 i;
        u32 off;
        u32 reg;
        u32 pin_reg;
        u64 reg64;
        int handled = 0;
+       unsigned int irq;
        unsigned long flags;
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
@@ -541,7 +541,7 @@ static void amd_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc)
        }
 
        if (handled == 0)
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
 
        spin_lock_irqsave(&gpio_dev->lock, flags);
        reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG);
index bae0012ee356011c037fb1403eb88dce26268450..b0fde0f385e6864c4fd962751fab9bb51dfbfa13 100644 (file)
@@ -1585,7 +1585,7 @@ static struct irq_chip gpio_irqchip = {
        .irq_set_wake   = gpio_irq_set_wake,
 };
 
-static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void gpio_irq_handler(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct gpio_chip *gpio_chip = irq_desc_get_handler_data(desc);
index 3731cc67a88bf84a0651de1d4fc73db0281f6cad..9c9b88934bcc904de8b63f20778ef12985ad7ed5 100644 (file)
@@ -519,7 +519,7 @@ static struct irq_chip u300_gpio_irqchip = {
        .irq_set_type           = u300_gpio_irq_type,
 };
 
-static void u300_gpio_irq_handler(unsigned __irq, struct irq_desc *desc)
+static void u300_gpio_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct irq_chip *parent_chip = irq_desc_get_chip(desc);
index 461fffc4c62ae8b3661b930e244c51267ca81406..11f8b835d3b64f61fde81bc77c2b5ecf931fd351 100644 (file)
@@ -337,9 +337,9 @@ static int dc_pinctrl_probe(struct platform_device *pdev)
        pmap->dev = &pdev->dev;
 
        pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap);
-       if (!pmap->pctl) {
+       if (IS_ERR(pmap->pctl)) {
                dev_err(&pdev->dev, "pinctrl driver registration failed\n");
-               return -EINVAL;
+               return PTR_ERR(pmap->pctl);
        }
 
        ret = dc_gpiochip_add(pmap, pdev->dev.of_node);
index 3dc2ae15f3a10f723813f78d34420ea1fb4650e9..952b1c62388773eb5594b03c7b0a639061c8f4b9 100644 (file)
@@ -1303,20 +1303,18 @@ static int pistachio_gpio_irq_set_type(struct irq_data *data, unsigned int type)
        }
 
        if (type & IRQ_TYPE_LEVEL_MASK)
-               __irq_set_handler_locked(data->irq, handle_level_irq);
+               irq_set_handler_locked(data, handle_level_irq);
        else
-               __irq_set_handler_locked(data->irq, handle_edge_irq);
+               irq_set_handler_locked(data, handle_edge_irq);
 
        return 0;
 }
 
-static void pistachio_gpio_irq_handler(unsigned int __irq,
-                                      struct irq_desc *desc)
+static void pistachio_gpio_irq_handler(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct pistachio_gpio_bank *bank = gc_to_bank(gc);
-       struct irq_chip *chip = irq_get_chip(irq);
+       struct irq_chip *chip = irq_desc_get_chip(desc);
        unsigned long pending;
        unsigned int pin;
 
index c5246c05f70cc77f70982f7d5540edec92d5e784..88bb707e107ad8d9b8f14832d5edd4788a8b5cf6 100644 (file)
@@ -1475,7 +1475,7 @@ static const struct gpio_chip rockchip_gpiolib_chip = {
  * Interrupt handling
  */
 
-static void rockchip_irq_demux(unsigned int __irq, struct irq_desc *desc)
+static void rockchip_irq_demux(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct rockchip_pin_bank *bank = irq_desc_get_handler_data(desc);
index bf548c2a7a9d83d7d447756d2d84d39caa5918e5..ef04b962c3d51992ba41080b893829d2d4102b56 100644 (file)
@@ -1679,7 +1679,7 @@ static irqreturn_t pcs_irq_handler(int irq, void *d)
  * Use this if you have a separate interrupt for each
  * pinctrl-single instance.
  */
-static void pcs_irq_chain_handler(unsigned int irq, struct irq_desc *desc)
+static void pcs_irq_chain_handler(struct irq_desc *desc)
 {
        struct pcs_soc_data *pcs_soc = irq_desc_get_handler_data(desc);
        struct irq_chip *chip;
index f8338d2e6b6b91d53bf531abd0a522ac99d75c1b..389526e704fb0eb68125e31cee1363d78c3caf8b 100644 (file)
@@ -1460,7 +1460,7 @@ static void __gpio_irq_handler(struct st_gpio_bank *bank)
        }
 }
 
-static void st_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void st_gpio_irq_handler(struct irq_desc *desc)
 {
        /* interrupt dedicated per bank */
        struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -1472,7 +1472,7 @@ static void st_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
        chained_irq_exit(chip, desc);
 }
 
-static void st_gpio_irqmux_handler(unsigned irq, struct irq_desc *desc)
+static void st_gpio_irqmux_handler(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct st_pinctrl *info = irq_desc_get_handler_data(desc);
index 67e08cb315c47e67329f8c4090ef2a1f503b9873..29984b36926aef871bb8e5ce93fa6308ddec37b5 100644 (file)
@@ -313,8 +313,7 @@ static int pinmux_func_name_to_selector(struct pinctrl_dev *pctldev,
 
        /* See if this pctldev has this function */
        while (selector < nfuncs) {
-               const char *fname = ops->get_function_name(pctldev,
-                                                          selector);
+               const char *fname = ops->get_function_name(pctldev, selector);
 
                if (!strcmp(function, fname))
                        return selector;
index 492cdd51dc5c718d3063a3f59269ee24bd5d1034..a0c7407c1cac486b8609283f0b06350e124468da 100644 (file)
@@ -765,9 +765,8 @@ static struct irq_chip msm_gpio_irq_chip = {
        .irq_set_wake   = msm_gpio_irq_set_wake,
 };
 
-static void msm_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc)
+static void msm_gpio_irq_handler(struct irq_desc *desc)
 {
-       unsigned int irq = irq_desc_get_irq(desc);
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        const struct msm_pingroup *g;
        struct msm_pinctrl *pctrl = to_msm_pinctrl(gc);
@@ -795,7 +794,7 @@ static void msm_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc)
 
        /* No interrupts were flagged */
        if (handled == 0)
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
 
        chained_irq_exit(chip, desc);
 }
index c978b311031b52a0f999f6fda52d0f9c34e0a7b0..e1a3721bc8e5814fbef5a39184170407436cb193 100644 (file)
@@ -723,9 +723,9 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
 #endif
 
        pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl);
-       if (!pctrl->pctrl) {
+       if (IS_ERR(pctrl->pctrl)) {
                dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n");
-               return -ENODEV;
+               return PTR_ERR(pctrl->pctrl);
        }
 
        pctrl->chip = pm8xxx_gpio_template;
index 2d1b69f171be7c4dcffeba6199536f65075b604e..6652b8d7f707aefc5656edd348f95e0d139c21da 100644 (file)
@@ -814,9 +814,9 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
 #endif
 
        pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl);
-       if (!pctrl->pctrl) {
+       if (IS_ERR(pctrl->pctrl)) {
                dev_err(&pdev->dev, "couldn't register pm8xxx mpp driver\n");
-               return -ENODEV;
+               return PTR_ERR(pctrl->pctrl);
        }
 
        pctrl->chip = pm8xxx_mpp_template;
index 5f45caaef46d6828bbfd1ea2b4f40ce445419357..71ccf6a90b222d14a02f771862d8c227cc115b80 100644 (file)
@@ -419,7 +419,7 @@ static const struct of_device_id exynos_wkup_irq_ids[] = {
 };
 
 /* interrupt handler for wakeup interrupts 0..15 */
-static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
+static void exynos_irq_eint0_15(struct irq_desc *desc)
 {
        struct exynos_weint_data *eintd = irq_desc_get_handler_data(desc);
        struct samsung_pin_bank *bank = eintd->bank;
@@ -451,7 +451,7 @@ static inline void exynos_irq_demux_eint(unsigned long pend,
 }
 
 /* interrupt handler for wakeup interrupt 16 */
-static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
+static void exynos_irq_demux_eint16_31(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc);
index 019844d479bb5c2b1bd63ebc840f796d5c684965..3d92f827da7a83fc08a0d24e86347004ff01ba0b 100644 (file)
@@ -240,7 +240,7 @@ static struct irq_chip s3c2410_eint0_3_chip = {
        .irq_set_type   = s3c24xx_eint_type,
 };
 
-static void s3c2410_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c2410_demux_eint0_3(struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
        struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc);
@@ -295,7 +295,7 @@ static struct irq_chip s3c2412_eint0_3_chip = {
        .irq_set_type   = s3c24xx_eint_type,
 };
 
-static void s3c2412_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c2412_demux_eint0_3(struct irq_desc *desc)
 {
        struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc);
        struct irq_data *data = irq_desc_get_irq_data(desc);
@@ -361,7 +361,7 @@ static inline void s3c24xx_demux_eint(struct irq_desc *desc,
                                      u32 offset, u32 range)
 {
        struct s3c24xx_eint_data *data = irq_desc_get_handler_data(desc);
-       struct irq_chip *chip = irq_desc_get_irq_chip(desc);
+       struct irq_chip *chip = irq_desc_get_chip(desc);
        struct samsung_pinctrl_drv_data *d = data->drvdata;
        unsigned int pend, mask;
 
@@ -388,12 +388,12 @@ static inline void s3c24xx_demux_eint(struct irq_desc *desc,
        chained_irq_exit(chip, desc);
 }
 
-static void s3c24xx_demux_eint4_7(unsigned int irq, struct irq_desc *desc)
+static void s3c24xx_demux_eint4_7(struct irq_desc *desc)
 {
        s3c24xx_demux_eint(desc, 0, 0xf0);
 }
 
-static void s3c24xx_demux_eint8_23(unsigned int irq, struct irq_desc *desc)
+static void s3c24xx_demux_eint8_23(struct irq_desc *desc)
 {
        s3c24xx_demux_eint(desc, 8, 0xffff00);
 }
index f5ea40a69711c01eceaaea391fb6ad365d1d624d..43407ab248f5121d0ca5625112592a32a9f1a968 100644 (file)
@@ -407,7 +407,7 @@ static const struct irq_domain_ops s3c64xx_gpio_irqd_ops = {
        .xlate  = irq_domain_xlate_twocell,
 };
 
-static void s3c64xx_eint_gpio_irq(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_eint_gpio_irq(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc);
@@ -631,22 +631,22 @@ static inline void s3c64xx_irq_demux_eint(struct irq_desc *desc, u32 range)
        chained_irq_exit(chip, desc);
 }
 
-static void s3c64xx_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint0_3(struct irq_desc *desc)
 {
        s3c64xx_irq_demux_eint(desc, 0xf);
 }
 
-static void s3c64xx_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint4_11(struct irq_desc *desc)
 {
        s3c64xx_irq_demux_eint(desc, 0xff0);
 }
 
-static void s3c64xx_demux_eint12_19(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint12_19(struct irq_desc *desc)
 {
        s3c64xx_irq_demux_eint(desc, 0xff000);
 }
 
-static void s3c64xx_demux_eint20_27(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint20_27(struct irq_desc *desc)
 {
        s3c64xx_irq_demux_eint(desc, 0xff00000);
 }
index 9df0c5f25824a2cbac9d3284f27a688345e83687..0d24d9e4b70c9583899d72aa02f072a8a0bdcd0d 100644 (file)
@@ -4489,7 +4489,7 @@ static struct irq_chip atlas7_gpio_irq_chip = {
        .irq_set_type = atlas7_gpio_irq_type,
 };
 
-static void atlas7_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc)
+static void atlas7_gpio_handle_irq(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
@@ -4512,7 +4512,7 @@ static void atlas7_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc)
        if (!status) {
                pr_warn("%s: gpio [%s] status %#x no interrupt is flaged\n",
                        __func__, gc->label, status);
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
                return;
        }
 
index f8bd9fb52033d70ac4704036447b0a7d18bdd938..2a8d69725de81aab6a469faa02558d065f22f7d9 100644 (file)
@@ -545,7 +545,7 @@ static struct irq_chip sirfsoc_irq_chip = {
        .irq_set_type = sirfsoc_gpio_irq_type,
 };
 
-static void sirfsoc_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc)
+static void sirfsoc_gpio_handle_irq(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
@@ -570,7 +570,7 @@ static void sirfsoc_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc)
                printk(KERN_WARNING
                        "%s: gpio id %d status %#x no interrupt is flagged\n",
                        __func__, bank->id, status);
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
                return;
        }
 
index ae8f29fb55361ce53958fc08fbdbd43514336257..1f0af250dbb51362d30fb385fc09011dc16c7275 100644 (file)
@@ -356,7 +356,7 @@ static struct irq_chip plgpio_irqchip = {
        .irq_set_type   = plgpio_irq_set_type,
 };
 
-static void plgpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void plgpio_irq_handler(struct irq_desc *desc)
 {
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct plgpio *plgpio = container_of(gc, struct plgpio, chip);
index fb4669c0ce0e7651e1d9b3dfbcc4d1b4421f4427..38e0c7bdd2ac456362a7e2b845c0250be5e60411 100644 (file)
@@ -617,13 +617,11 @@ static int sunxi_pinctrl_irq_set_type(struct irq_data *d, unsigned int type)
        spin_lock_irqsave(&pctl->lock, flags);
 
        if (type & IRQ_TYPE_LEVEL_MASK)
-               __irq_set_chip_handler_name_locked(d->irq,
-                                                  &sunxi_pinctrl_level_irq_chip,
-                                                  handle_fasteoi_irq, NULL);
+               irq_set_chip_handler_name_locked(d, &sunxi_pinctrl_level_irq_chip,
+                                                handle_fasteoi_irq, NULL);
        else
-               __irq_set_chip_handler_name_locked(d->irq,
-                                                  &sunxi_pinctrl_edge_irq_chip,
-                                                  handle_edge_irq, NULL);
+               irq_set_chip_handler_name_locked(d, &sunxi_pinctrl_edge_irq_chip,
+                                                handle_edge_irq, NULL);
 
        regval = readl(pctl->membase + reg);
        regval &= ~(IRQ_CFG_IRQ_MASK << index);
@@ -742,7 +740,7 @@ static struct irq_domain_ops sunxi_pinctrl_irq_domain_ops = {
        .xlate          = sunxi_pinctrl_irq_of_xlate,
 };
 
-static void sunxi_pinctrl_irq_handler(unsigned __irq, struct irq_desc *desc)
+static void sunxi_pinctrl_irq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index abdaed34c7285116ffb573102880d55fafdfa8c1..131fee2b093eadde86ba6c0b0fc53be458150e82 100644 (file)
@@ -126,6 +126,24 @@ static const struct dmi_system_id asus_quirks[] = {
                },
                .driver_data = &quirk_asus_wapf4,
        },
+       {
+               .callback = dmi_matched,
+               .ident = "ASUSTeK COMPUTER INC. X456UA",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "X456UA"),
+               },
+               .driver_data = &quirk_asus_wapf4,
+       },
+       {
+               .callback = dmi_matched,
+               .ident = "ASUSTeK COMPUTER INC. X456UF",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "X456UF"),
+               },
+               .driver_data = &quirk_asus_wapf4,
+       },
        {
                .callback = dmi_matched,
                .ident = "ASUSTeK COMPUTER INC. X501U",
index 06697315a0887f6493c0f55185b864c12f8bc76e..fb4dd7b3ee711f9ba9b42b4384331c1df9e32fc0 100644 (file)
@@ -54,8 +54,9 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
 #define HPWMI_HARDWARE_QUERY 0x4
 #define HPWMI_WIRELESS_QUERY 0x5
 #define HPWMI_BIOS_QUERY 0x9
+#define HPWMI_FEATURE_QUERY 0xb
 #define HPWMI_HOTKEY_QUERY 0xc
-#define HPWMI_FEATURE_QUERY 0xd
+#define HPWMI_FEATURE2_QUERY 0xd
 #define HPWMI_WIRELESS2_QUERY 0x1b
 #define HPWMI_POSTCODEERROR_QUERY 0x2a
 
@@ -295,25 +296,33 @@ static int hp_wmi_tablet_state(void)
        return (state & 0x4) ? 1 : 0;
 }
 
-static int __init hp_wmi_bios_2009_later(void)
+static int __init hp_wmi_bios_2008_later(void)
 {
        int state = 0;
        int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, 0, &state,
                                       sizeof(state), sizeof(state));
-       if (ret)
-               return ret;
+       if (!ret)
+               return 1;
 
-       return (state & 0x10) ? 1 : 0;
+       return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO;
 }
 
-static int hp_wmi_enable_hotkeys(void)
+static int __init hp_wmi_bios_2009_later(void)
 {
-       int ret;
-       int query = 0x6e;
+       int state = 0;
+       int ret = hp_wmi_perform_query(HPWMI_FEATURE2_QUERY, 0, &state,
+                                      sizeof(state), sizeof(state));
+       if (!ret)
+               return 1;
 
-       ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &query, sizeof(query),
-                                  0);
+       return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO;
+}
 
+static int __init hp_wmi_enable_hotkeys(void)
+{
+       int value = 0x6e;
+       int ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &value,
+                                      sizeof(value), 0);
        if (ret)
                return -EINVAL;
        return 0;
@@ -663,7 +672,7 @@ static int __init hp_wmi_input_setup(void)
                            hp_wmi_tablet_state());
        input_sync(hp_wmi_input_dev);
 
-       if (hp_wmi_bios_2009_later() == 4)
+       if (!hp_wmi_bios_2009_later() && hp_wmi_bios_2008_later())
                hp_wmi_enable_hotkeys();
 
        status = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL);
index 6740c513919cc153f522a0c72e3fd4e183dab16a..f2372f400ddbb406927efc71c843c05a0222c4c4 100644 (file)
@@ -938,7 +938,7 @@ static int toshiba_usb_sleep_music_get(struct toshiba_acpi_dev *dev, u32 *state)
        else if (result == TOS_NOT_SUPPORTED)
                return -ENODEV;
 
-       return result = TOS_SUCCESS ? 0 : -EIO;
+       return result == TOS_SUCCESS ? 0 : -EIO;
 }
 
 static int toshiba_usb_sleep_music_set(struct toshiba_acpi_dev *dev, u32 state)
@@ -2398,11 +2398,9 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
        if (error)
                return error;
 
-       error = toshiba_hotkey_event_type_get(dev, &events_type);
-       if (error) {
-               pr_err("Unable to query Hotkey Event Type\n");
-               return error;
-       }
+       if (toshiba_hotkey_event_type_get(dev, &events_type))
+               pr_notice("Unable to query Hotkey Event Type\n");
+
        dev->hotkey_event_type = events_type;
 
        dev->hotkey_dev = input_allocate_device();
index aac47573f9ed83e4c42ea84aef9c3940644e4db1..eb391a2818330e9423f2030722a041eddedc9130 100644 (file)
@@ -194,34 +194,6 @@ static bool wmi_parse_guid(const u8 *src, u8 *dest)
        return true;
 }
 
-/*
- * Convert a raw GUID to the ACII string representation
- */
-static int wmi_gtoa(const char *in, char *out)
-{
-       int i;
-
-       for (i = 3; i >= 0; i--)
-               out += sprintf(out, "%02X", in[i] & 0xFF);
-
-       out += sprintf(out, "-");
-       out += sprintf(out, "%02X", in[5] & 0xFF);
-       out += sprintf(out, "%02X", in[4] & 0xFF);
-       out += sprintf(out, "-");
-       out += sprintf(out, "%02X", in[7] & 0xFF);
-       out += sprintf(out, "%02X", in[6] & 0xFF);
-       out += sprintf(out, "-");
-       out += sprintf(out, "%02X", in[8] & 0xFF);
-       out += sprintf(out, "%02X", in[9] & 0xFF);
-       out += sprintf(out, "-");
-
-       for (i = 10; i <= 15; i++)
-               out += sprintf(out, "%02X", in[i] & 0xFF);
-
-       *out = '\0';
-       return 0;
-}
-
 static bool find_guid(const char *guid_string, struct wmi_block **out)
 {
        char tmp[16], guid_input[16];
@@ -457,11 +429,7 @@ EXPORT_SYMBOL_GPL(wmi_set_block);
 
 static void wmi_dump_wdg(const struct guid_block *g)
 {
-       char guid_string[37];
-
-       wmi_gtoa(g->guid, guid_string);
-
-       pr_info("%s:\n", guid_string);
+       pr_info("%pUL:\n", g->guid);
        pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]);
        pr_info("\tnotify_id: %02X\n", g->notify_id);
        pr_info("\treserved: %02X\n", g->reserved);
@@ -661,7 +629,6 @@ EXPORT_SYMBOL_GPL(wmi_has_guid);
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
                             char *buf)
 {
-       char guid_string[37];
        struct wmi_block *wblock;
 
        wblock = dev_get_drvdata(dev);
@@ -670,9 +637,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
                return strlen(buf);
        }
 
-       wmi_gtoa(wblock->gblock.guid, guid_string);
-
-       return sprintf(buf, "wmi:%s\n", guid_string);
+       return sprintf(buf, "wmi:%pUL\n", wblock->gblock.guid);
 }
 static DEVICE_ATTR_RO(modalias);
 
@@ -695,7 +660,7 @@ static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
        if (!wblock)
                return -ENOMEM;
 
-       wmi_gtoa(wblock->gblock.guid, guid_string);
+       sprintf(guid_string, "%pUL", wblock->gblock.guid);
 
        strcpy(&env->buf[env->buflen - 1], "wmi:");
        memcpy(&env->buf[env->buflen - 1 + 4], guid_string, 36);
@@ -721,12 +686,9 @@ static struct class wmi_class = {
 static int wmi_create_device(const struct guid_block *gblock,
                             struct wmi_block *wblock, acpi_handle handle)
 {
-       char guid_string[37];
-
        wblock->dev.class = &wmi_class;
 
-       wmi_gtoa(gblock->guid, guid_string);
-       dev_set_name(&wblock->dev, "%s", guid_string);
+       dev_set_name(&wblock->dev, "%pUL", gblock->guid);
 
        dev_set_drvdata(&wblock->dev, wblock);
 
@@ -877,7 +839,6 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event)
        struct guid_block *block;
        struct wmi_block *wblock;
        struct list_head *p;
-       char guid_string[37];
 
        list_for_each(p, &wmi_block_list) {
                wblock = list_entry(p, struct wmi_block, list);
@@ -888,8 +849,8 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event)
                        if (wblock->handler)
                                wblock->handler(event, wblock->handler_data);
                        if (debug_event) {
-                               wmi_gtoa(wblock->gblock.guid, guid_string);
-                               pr_info("DEBUG Event GUID: %s\n", guid_string);
+                               pr_info("DEBUG Event GUID: %pUL\n",
+                                       wblock->gblock.guid);
                        }
 
                        acpi_bus_generate_netlink_event(
index f4f2c1f76c326d9093c9d9ea7587dd189aed5182..74f2d3ff1d7cf4242935974a738f9d1fb2749111 100644 (file)
@@ -91,7 +91,7 @@
 #define TWL4030_MSTATEC_COMPLETE1      0x0b
 #define TWL4030_MSTATEC_COMPLETE4      0x0e
 
-#if IS_ENABLED(CONFIG_TWL4030_MADC)
+#if IS_REACHABLE(CONFIG_TWL4030_MADC)
 /*
  * If AC (Accessory Charger) voltage exceeds 4.5V (MADC 11)
  * then AC is available.
@@ -1057,13 +1057,9 @@ static int twl4030_bci_probe(struct platform_device *pdev)
 
                phynode = of_find_compatible_node(bci->dev->of_node->parent,
                                                  NULL, "ti,twl4030-usb");
-               if (phynode) {
+               if (phynode)
                        bci->transceiver = devm_usb_get_phy_by_node(
                                bci->dev, phynode, &bci->usb_nb);
-                       if (IS_ERR(bci->transceiver) &&
-                           PTR_ERR(bci->transceiver) == -EPROBE_DEFER)
-                               return -EPROBE_DEFER;
-               }
        }
 
        /* Enable interrupts now. */
index f8d8fdb26b72a593260fa67b98337414a684e9b5..e9fae30fafda03d39df228e500d5f70c0a86e048 100644 (file)
@@ -400,12 +400,16 @@ static bool virtio_ccw_kvm_notify(struct virtqueue *vq)
 static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev,
                                   struct ccw1 *ccw, int index)
 {
+       int ret;
+
        vcdev->config_block->index = index;
        ccw->cmd_code = CCW_CMD_READ_VQ_CONF;
        ccw->flags = 0;
        ccw->count = sizeof(struct vq_config_block);
        ccw->cda = (__u32)(unsigned long)(vcdev->config_block);
-       ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_VQ_CONF);
+       ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_VQ_CONF);
+       if (ret)
+               return ret;
        return vcdev->config_block->num;
 }
 
@@ -503,6 +507,10 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
                goto out_err;
        }
        info->num = virtio_ccw_read_vq_conf(vcdev, ccw, i);
+       if (info->num < 0) {
+               err = info->num;
+               goto out_err;
+       }
        size = PAGE_ALIGN(vring_size(info->num, KVM_VIRTIO_CCW_RING_ALIGN));
        info->queue = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
        if (info->queue == NULL) {
index 043419dcee92306eb93c52b6240df0a48071c272..8e72bcbd3d6d4b4da15f716d74cd89be8906b0a3 100644 (file)
@@ -65,7 +65,7 @@ void intc_set_prio_level(unsigned int irq, unsigned int level)
        raw_spin_unlock_irqrestore(&intc_big_lock, flags);
 }
 
-static void intc_redirect_irq(unsigned int irq, struct irq_desc *desc)
+static void intc_redirect_irq(struct irq_desc *desc)
 {
        generic_handle_irq((unsigned int)irq_desc_get_handler_data(desc));
 }
index 7dff08e2a071377a963e4d095952bcd5f8bbd589..6ce7f0d26dcf0ec914b433cec73cf0c2337fb1e8 100644 (file)
@@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
  */
 static inline void activate_irq(int irq)
 {
-#ifdef CONFIG_ARM
-       /* ARM requires an extra step to clear IRQ_NOREQUEST, which it
-        * sets on behalf of every irq_chip.  Also sets IRQ_NOPROBE.
-        */
-       set_irq_flags(irq, IRQF_VALID);
-#else
-       /* same effect on other architectures */
-       irq_set_noprobe(irq);
-#endif
+       irq_modify_status(irq, IRQ_NOREQUEST, IRQ_NOPROBE);
 }
 
 static inline int intc_handle_int_cmp(const void *a, const void *b)
index bafc51c6f0bacbe2fdb99e033d89a46dd07d37ea..e7899624aa0b637d8602aad96fb7e7439590a286 100644 (file)
@@ -109,7 +109,7 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq)
        return 0;
 }
 
-static void intc_virq_handler(unsigned int __irq, struct irq_desc *desc)
+static void intc_virq_handler(struct irq_desc *desc)
 {
        unsigned int irq = irq_desc_get_irq(desc);
        struct irq_data *data = irq_desc_get_irq_data(desc);
@@ -127,7 +127,7 @@ static void intc_virq_handler(unsigned int __irq, struct irq_desc *desc)
                        handle = (unsigned long)irq_desc_get_handler_data(vdesc);
                        addr = INTC_REG(d, _INTC_ADDR_E(handle), 0);
                        if (intc_reg_fns[_INTC_FN(handle)](addr, handle, 0))
-                               generic_handle_irq_desc(entry->irq, vdesc);
+                               generic_handle_irq_desc(vdesc);
                }
        }
 
index 6792aae9e2e5aca50ffb6657a43b4012214d3709..052aecf298935e8420fc5b6df0069992b5dc4e3b 100644 (file)
@@ -222,9 +222,9 @@ static void __pmu_domain_register(struct pmu_domain *domain,
 }
 
 /* PMU IRQ controller */
-static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pmu_irq_handler(struct irq_desc *desc)
 {
-       struct pmu_data *pmu = irq_get_handler_data(irq);
+       struct pmu_data *pmu = irq_desc_get_handler_data(desc);
        struct irq_chip_generic *gc = pmu->irq_gc;
        struct irq_domain *domain = pmu->irq_domain;
        void __iomem *base = gc->reg_base;
@@ -232,7 +232,7 @@ static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
        u32 done = ~0;
 
        if (stat == 0) {
-               handle_bad_irq(irq, desc);
+               handle_bad_irq(desc);
                return;
        }
 
index bf9ed380bb1c0754addbd27aedf7d874cee89ff2..1cc1f1e0d17fd60e88957b807a580d738dc227cc 100644 (file)
@@ -871,14 +871,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,
         * Calculate the lowest divider that satisfies the
         * constraint, assuming div32/fdiv/mbz == 0.
         */
-       if (xfer->speed_hz)
-               scbr = DIV_ROUND_UP(bus_hz, xfer->speed_hz);
-       else
-               /*
-                * This can happend if max_speed is null.
-                * In this case, we set the lowest possible speed
-                */
-               scbr = 0xff;
+       scbr = DIV_ROUND_UP(bus_hz, xfer->speed_hz);
 
        /*
         * If the resulting divider doesn't fit into the
@@ -1300,14 +1293,12 @@ static int atmel_spi_one_transfer(struct spi_master *master,
                return -EINVAL;
        }
 
-       if (xfer->bits_per_word) {
-               asd = spi->controller_state;
-               bits = (asd->csr >> 4) & 0xf;
-               if (bits != xfer->bits_per_word - 8) {
-                       dev_dbg(&spi->dev,
+       asd = spi->controller_state;
+       bits = (asd->csr >> 4) & 0xf;
+       if (bits != xfer->bits_per_word - 8) {
+               dev_dbg(&spi->dev,
                        "you can't yet change bits_per_word in transfers\n");
-                       return -ENOPROTOOPT;
-               }
+               return -ENOPROTOOPT;
        }
 
        /*
index bdfb3c84c3cb43a652dcb36fb449758807f58fa4..4a3cf9ba152f6b8060e3c7709550dfdc7ec9fe17 100644 (file)
@@ -451,7 +451,7 @@ static void periph_interrupt(struct spmi_pmic_arb_dev *pa, u8 apid)
        }
 }
 
-static void pmic_arb_chained_irq(unsigned int irq, struct irq_desc *desc)
+static void pmic_arb_chained_irq(struct irq_desc *desc)
 {
        struct spmi_pmic_arb_dev *pa = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
index cf5fe9bb87a16c8a339ae2a25955352d18c71221..d7f62359d7430fd0933ca84481db701073aee5b1 100644 (file)
@@ -24,6 +24,8 @@ if STAGING_RDMA
 
 source "drivers/staging/rdma/amso1100/Kconfig"
 
+source "drivers/staging/rdma/ehca/Kconfig"
+
 source "drivers/staging/rdma/hfi1/Kconfig"
 
 source "drivers/staging/rdma/ipath/Kconfig"
index cbd915ac7f20a85b8ab9a09d882ba7dffb60e54c..139d78ef2c24388b93ed6a008090190cff6de663 100644 (file)
@@ -1,4 +1,5 @@
 # Entries for RDMA_STAGING tree
 obj-$(CONFIG_INFINIBAND_AMSO1100)      += amso1100/
+obj-$(CONFIG_INFINIBAND_EHCA)  += ehca/
 obj-$(CONFIG_INFINIBAND_HFI1)  += hfi1/
 obj-$(CONFIG_INFINIBAND_IPATH) += ipath/
similarity index 69%
rename from drivers/infiniband/hw/ehca/Kconfig
rename to drivers/staging/rdma/ehca/Kconfig
index 59f807d8d58e5eb043fad41b7182bca53bac8cc5..3fadd2ad64264bd8d4e7f2a5d26a12379f8d234e 100644 (file)
@@ -2,7 +2,8 @@ config INFINIBAND_EHCA
        tristate "eHCA support"
        depends on IBMEBUS
        ---help---
-       This driver supports the IBM pSeries eHCA InfiniBand adapter.
+       This driver supports the deprecated IBM pSeries eHCA InfiniBand
+       adapter.
 
        To compile the driver as a module, choose M here. The module
        will be called ib_ehca.
diff --git a/drivers/staging/rdma/ehca/TODO b/drivers/staging/rdma/ehca/TODO
new file mode 100644 (file)
index 0000000..199a4a6
--- /dev/null
@@ -0,0 +1,4 @@
+9/2015
+
+The ehca driver has been deprecated and moved to drivers/staging/rdma.
+It will be removed in the 4.6 merge window.
index 654eafef1d30857ead08805911ba71797027028b..aa58e597df0698a4dc3e17d04662f565a5bafbbc 100644 (file)
@@ -2710,7 +2710,7 @@ int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok)
        if (sleep_ok) {
                mutex_lock(&ppd->hls_lock);
        } else {
-               while (mutex_trylock(&ppd->hls_lock) == EBUSY)
+               while (!mutex_trylock(&ppd->hls_lock))
                        udelay(1);
        }
 
@@ -2758,7 +2758,7 @@ int release_lcb_access(struct hfi1_devdata *dd, int sleep_ok)
        if (sleep_ok) {
                mutex_lock(&dd->pport->hls_lock);
        } else {
-               while (mutex_trylock(&dd->pport->hls_lock) == EBUSY)
+               while (!mutex_trylock(&dd->pport->hls_lock))
                        udelay(1);
        }
 
index 07c87a87775fd524f497d4478e0ef12b757f8054..bc26a5392712d848ecd6df16676788790a8eb50b 100644 (file)
 #include "device.h"
 
 static struct class *class;
+static struct class *user_class;
 static dev_t hfi1_dev;
 
 int hfi1_cdev_init(int minor, const char *name,
                   const struct file_operations *fops,
-                  struct cdev *cdev, struct device **devp)
+                  struct cdev *cdev, struct device **devp,
+                  bool user_accessible)
 {
        const dev_t dev = MKDEV(MAJOR(hfi1_dev), minor);
        struct device *device = NULL;
@@ -78,7 +80,11 @@ int hfi1_cdev_init(int minor, const char *name,
                goto done;
        }
 
-       device = device_create(class, NULL, dev, NULL, "%s", name);
+       if (user_accessible)
+               device = device_create(user_class, NULL, dev, NULL, "%s", name);
+       else
+               device = device_create(class, NULL, dev, NULL, "%s", name);
+
        if (!IS_ERR(device))
                goto done;
        ret = PTR_ERR(device);
@@ -110,6 +116,26 @@ const char *class_name(void)
        return hfi1_class_name;
 }
 
+static char *hfi1_devnode(struct device *dev, umode_t *mode)
+{
+       if (mode)
+               *mode = 0600;
+       return kasprintf(GFP_KERNEL, "%s", dev_name(dev));
+}
+
+static const char *hfi1_class_name_user = "hfi1_user";
+const char *class_name_user(void)
+{
+       return hfi1_class_name_user;
+}
+
+static char *hfi1_user_devnode(struct device *dev, umode_t *mode)
+{
+       if (mode)
+               *mode = 0666;
+       return kasprintf(GFP_KERNEL, "%s", dev_name(dev));
+}
+
 int __init dev_init(void)
 {
        int ret;
@@ -125,7 +151,22 @@ int __init dev_init(void)
                ret = PTR_ERR(class);
                pr_err("Could not create device class (err %d)\n", -ret);
                unregister_chrdev_region(hfi1_dev, HFI1_NMINORS);
+               goto done;
        }
+       class->devnode = hfi1_devnode;
+
+       user_class = class_create(THIS_MODULE, class_name_user());
+       if (IS_ERR(user_class)) {
+               ret = PTR_ERR(user_class);
+               pr_err("Could not create device class for user accessible files (err %d)\n",
+                      -ret);
+               class_destroy(class);
+               class = NULL;
+               user_class = NULL;
+               unregister_chrdev_region(hfi1_dev, HFI1_NMINORS);
+               goto done;
+       }
+       user_class->devnode = hfi1_user_devnode;
 
 done:
        return ret;
@@ -133,10 +174,11 @@ done:
 
 void dev_cleanup(void)
 {
-       if (class) {
-               class_destroy(class);
-               class = NULL;
-       }
+       class_destroy(class);
+       class = NULL;
+
+       class_destroy(user_class);
+       user_class = NULL;
 
        unregister_chrdev_region(hfi1_dev, HFI1_NMINORS);
 }
index 98caecd3d807eabffc70e01f2c64470a5d14b980..2850ff739d81d354452da2af424f27aa9a0136a3 100644 (file)
@@ -52,7 +52,8 @@
 
 int hfi1_cdev_init(int minor, const char *name,
                   const struct file_operations *fops,
-                  struct cdev *cdev, struct device **devp);
+                  struct cdev *cdev, struct device **devp,
+                  bool user_accessible);
 void hfi1_cdev_cleanup(struct cdev *cdev, struct device **devp);
 const char *class_name(void);
 int __init dev_init(void);
index 6777d6b659cf4e065274061c48fd0551e2115c5e..3e8d5ac4c626901e52b66aa0f3ba27e1c603bc79 100644 (file)
@@ -292,7 +292,7 @@ int hfi1_diag_add(struct hfi1_devdata *dd)
        if (atomic_inc_return(&diagpkt_count) == 1) {
                ret = hfi1_cdev_init(HFI1_DIAGPKT_MINOR, name,
                                     &diagpkt_file_ops, &diagpkt_cdev,
-                                    &diagpkt_device);
+                                    &diagpkt_device, false);
        }
 
        return ret;
@@ -592,7 +592,8 @@ static int hfi1_snoop_add(struct hfi1_devdata *dd, const char *name)
 
        ret = hfi1_cdev_init(HFI1_SNOOP_CAPTURE_BASE + dd->unit, name,
                             &snoop_file_ops,
-                            &dd->hfi1_snoop.cdev, &dd->hfi1_snoop.class_dev);
+                            &dd->hfi1_snoop.cdev, &dd->hfi1_snoop.class_dev,
+                            false);
 
        if (ret) {
                dd_dev_err(dd, "Couldn't create %s device: %d", name, ret);
@@ -1012,11 +1013,10 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
                case HFI1_SNOOP_IOCSETLINKSTATE_EXTRA:
                        memset(&link_info, 0, sizeof(link_info));
 
-                       ret = copy_from_user(&link_info,
+                       if (copy_from_user(&link_info,
                                (struct hfi1_link_info __user *)arg,
-                               sizeof(link_info));
-                       if (ret)
-                               break;
+                               sizeof(link_info)))
+                               ret = -EFAULT;
 
                        value = link_info.port_state;
                        index = link_info.port_number;
@@ -1080,9 +1080,10 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
                case HFI1_SNOOP_IOCGETLINKSTATE_EXTRA:
                        if (cmd == HFI1_SNOOP_IOCGETLINKSTATE_EXTRA) {
                                memset(&link_info, 0, sizeof(link_info));
-                               ret = copy_from_user(&link_info,
+                               if (copy_from_user(&link_info,
                                        (struct hfi1_link_info __user *)arg,
-                                       sizeof(link_info));
+                                       sizeof(link_info)))
+                                       ret = -EFAULT;
                                index = link_info.port_number;
                        } else {
                                ret = __get_user(index, (int __user *) arg);
@@ -1114,9 +1115,10 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
                                                        ppd->link_speed_active;
                                link_info.link_width_active =
                                                        ppd->link_width_active;
-                               ret = copy_to_user(
+                               if (copy_to_user(
                                        (struct hfi1_link_info __user *)arg,
-                                       &link_info, sizeof(link_info));
+                                       &link_info, sizeof(link_info)))
+                                       ret = -EFAULT;
                        } else {
                                ret = __put_user(value, (int __user *)arg);
                        }
@@ -1142,10 +1144,9 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
                        snoop_dbg("Setting filter");
                        /* just copy command structure */
                        argp = (unsigned long *)arg;
-                       ret = copy_from_user(&filter_cmd, (void __user *)argp,
-                                            sizeof(filter_cmd));
-                       if (ret < 0) {
-                               pr_alert("Error copying filter command\n");
+                       if (copy_from_user(&filter_cmd, (void __user *)argp,
+                                            sizeof(filter_cmd))) {
+                               ret = -EFAULT;
                                break;
                        }
                        if (filter_cmd.opcode >= HFI1_MAX_FILTERS) {
@@ -1167,12 +1168,11 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
                                break;
                        }
                        /* copy remaining data from userspace */
-                       ret = copy_from_user((u8 *)filter_value,
+                       if (copy_from_user((u8 *)filter_value,
                                        (void __user *)filter_cmd.value_ptr,
-                                       filter_cmd.length);
-                       if (ret < 0) {
+                                       filter_cmd.length)) {
                                kfree(filter_value);
-                               pr_alert("Error copying filter data\n");
+                               ret = -EFAULT;
                                break;
                        }
                        /* Drain packets first */
index 469861750b762a86960495c03932cb1be964b7de..72d38500d8ce4e544cac1141497cbb46a7a4aa71 100644 (file)
@@ -1181,6 +1181,7 @@ static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len)
        struct hfi1_filedata *fd = fp->private_data;
        int ret = 0;
 
+       memset(&cinfo, 0, sizeof(cinfo));
        ret = hfi1_get_base_kinfo(uctxt, &cinfo);
        if (ret < 0)
                goto done;
@@ -2089,14 +2090,16 @@ static int user_add(struct hfi1_devdata *dd)
 
        if (atomic_inc_return(&user_count) == 1) {
                ret = hfi1_cdev_init(0, class_name(), &hfi1_file_ops,
-                                    &wildcard_cdev, &wildcard_device);
+                                    &wildcard_cdev, &wildcard_device,
+                                    true);
                if (ret)
                        goto done;
        }
 
        snprintf(name, sizeof(name), "%s_%d", class_name(), dd->unit);
        ret = hfi1_cdev_init(dd->unit + 1, name, &hfi1_file_ops,
-                            &dd->user_cdev, &dd->user_device);
+                            &dd->user_cdev, &dd->user_device,
+                            true);
        if (ret)
                goto done;
 
@@ -2104,7 +2107,8 @@ static int user_add(struct hfi1_devdata *dd)
                snprintf(name, sizeof(name),
                         "%s_ui%d", class_name(), dd->unit);
                ret = hfi1_cdev_init(dd->unit + UI_OFFSET, name, &ui_file_ops,
-                                    &dd->ui_cdev, &dd->ui_device);
+                                    &dd->ui_cdev, &dd->ui_device,
+                                    false);
                if (ret)
                        goto done;
        }
index 37269eb90c346caee072df28db613a4d4077ed10..b2c1b72d38ce4621e2e0a334eef24823aeaadf74 100644 (file)
@@ -1717,9 +1717,9 @@ static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data,
        psi->port_states.portphysstate_portstate =
                (hfi1_ibphys_portstate(ppd) << 4) | (lstate & 0xf);
        psi->link_width_downgrade_tx_active =
-         ppd->link_width_downgrade_tx_active;
+               cpu_to_be16(ppd->link_width_downgrade_tx_active);
        psi->link_width_downgrade_rx_active =
-         ppd->link_width_downgrade_rx_active;
+               cpu_to_be16(ppd->link_width_downgrade_rx_active);
        if (resp_len)
                *resp_len += sizeof(struct opa_port_state_info);
 
index a8c903caecce0ce4b3d15edfa29cddf351becd33..aecd1a74741c656897f9f4ba367892c2a214e7fa 100644 (file)
@@ -737,7 +737,7 @@ u16 sdma_get_descq_cnt(void)
         */
        if (!is_power_of_2(count))
                return SDMA_DESCQ_CNT;
-       if (count < 64 && count > 32768)
+       if (count < 64 || count > 32768)
                return SDMA_DESCQ_CNT;
        return count;
 }
@@ -1848,7 +1848,7 @@ static void dump_sdma_state(struct sdma_engine *sde)
                        dd_dev_err(sde->dd,
                                "\taidx: %u amode: %u alen: %u\n",
                                (u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK)
-                                       >> SDMA_DESC1_HEADER_INDEX_MASK),
+                                       >> SDMA_DESC1_HEADER_INDEX_SHIFT),
                                (u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK)
                                        >> SDMA_DESC1_HEADER_MODE_SHIFT),
                                (u8)((desc[1] & SDMA_DESC1_HEADER_DWS_SMASK)
@@ -1926,7 +1926,7 @@ void sdma_seqfile_dump_sde(struct seq_file *s, struct sdma_engine *sde)
                if (desc[0] & SDMA_DESC0_FIRST_DESC_FLAG)
                        seq_printf(s, "\t\tahgidx: %u ahgmode: %u\n",
                                (u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK)
-                                       >> SDMA_DESC1_HEADER_INDEX_MASK),
+                                       >> SDMA_DESC1_HEADER_INDEX_SHIFT),
                                (u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK)
                                        >> SDMA_DESC1_HEADER_MODE_SHIFT));
                head = (head + 1) & sde->sdma_mask;
index 1e613fcd8f4ca905e06d8f2a05012a771ab58d79..49608690389121181195b76c33027436800c7bba 100644 (file)
 /*
  * Bits defined in the send DMA descriptor.
  */
-#define SDMA_DESC0_FIRST_DESC_FLAG      (1ULL<<63)
-#define SDMA_DESC0_LAST_DESC_FLAG       (1ULL<<62)
+#define SDMA_DESC0_FIRST_DESC_FLAG      (1ULL << 63)
+#define SDMA_DESC0_LAST_DESC_FLAG       (1ULL << 62)
 #define SDMA_DESC0_BYTE_COUNT_SHIFT     48
 #define SDMA_DESC0_BYTE_COUNT_WIDTH     14
 #define SDMA_DESC0_BYTE_COUNT_MASK \
-       ((1ULL<<SDMA_DESC0_BYTE_COUNT_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC0_BYTE_COUNT_WIDTH) - 1)
 #define SDMA_DESC0_BYTE_COUNT_SMASK \
-       (SDMA_DESC0_BYTE_COUNT_MASK<<SDMA_DESC0_BYTE_COUNT_SHIFT)
+       (SDMA_DESC0_BYTE_COUNT_MASK << SDMA_DESC0_BYTE_COUNT_SHIFT)
 #define SDMA_DESC0_PHY_ADDR_SHIFT       0
 #define SDMA_DESC0_PHY_ADDR_WIDTH       48
 #define SDMA_DESC0_PHY_ADDR_MASK \
-       ((1ULL<<SDMA_DESC0_PHY_ADDR_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC0_PHY_ADDR_WIDTH) - 1)
 #define SDMA_DESC0_PHY_ADDR_SMASK \
-       (SDMA_DESC0_PHY_ADDR_MASK<<SDMA_DESC0_PHY_ADDR_SHIFT)
+       (SDMA_DESC0_PHY_ADDR_MASK << SDMA_DESC0_PHY_ADDR_SHIFT)
 
 #define SDMA_DESC1_HEADER_UPDATE1_SHIFT 32
 #define SDMA_DESC1_HEADER_UPDATE1_WIDTH 32
 #define SDMA_DESC1_HEADER_UPDATE1_MASK \
-       ((1ULL<<SDMA_DESC1_HEADER_UPDATE1_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC1_HEADER_UPDATE1_WIDTH) - 1)
 #define SDMA_DESC1_HEADER_UPDATE1_SMASK \
-       (SDMA_DESC1_HEADER_UPDATE1_MASK<<SDMA_DESC1_HEADER_UPDATE1_SHIFT)
+       (SDMA_DESC1_HEADER_UPDATE1_MASK << SDMA_DESC1_HEADER_UPDATE1_SHIFT)
 #define SDMA_DESC1_HEADER_MODE_SHIFT    13
 #define SDMA_DESC1_HEADER_MODE_WIDTH    3
 #define SDMA_DESC1_HEADER_MODE_MASK \
-       ((1ULL<<SDMA_DESC1_HEADER_MODE_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC1_HEADER_MODE_WIDTH) - 1)
 #define SDMA_DESC1_HEADER_MODE_SMASK \
-       (SDMA_DESC1_HEADER_MODE_MASK<<SDMA_DESC1_HEADER_MODE_SHIFT)
+       (SDMA_DESC1_HEADER_MODE_MASK << SDMA_DESC1_HEADER_MODE_SHIFT)
 #define SDMA_DESC1_HEADER_INDEX_SHIFT   8
 #define SDMA_DESC1_HEADER_INDEX_WIDTH   5
 #define SDMA_DESC1_HEADER_INDEX_MASK \
-       ((1ULL<<SDMA_DESC1_HEADER_INDEX_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC1_HEADER_INDEX_WIDTH) - 1)
 #define SDMA_DESC1_HEADER_INDEX_SMASK \
-       (SDMA_DESC1_HEADER_INDEX_MASK<<SDMA_DESC1_HEADER_INDEX_SHIFT)
+       (SDMA_DESC1_HEADER_INDEX_MASK << SDMA_DESC1_HEADER_INDEX_SHIFT)
 #define SDMA_DESC1_HEADER_DWS_SHIFT     4
 #define SDMA_DESC1_HEADER_DWS_WIDTH     4
 #define SDMA_DESC1_HEADER_DWS_MASK \
-       ((1ULL<<SDMA_DESC1_HEADER_DWS_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC1_HEADER_DWS_WIDTH) - 1)
 #define SDMA_DESC1_HEADER_DWS_SMASK \
-       (SDMA_DESC1_HEADER_DWS_MASK<<SDMA_DESC1_HEADER_DWS_SHIFT)
+       (SDMA_DESC1_HEADER_DWS_MASK << SDMA_DESC1_HEADER_DWS_SHIFT)
 #define SDMA_DESC1_GENERATION_SHIFT     2
 #define SDMA_DESC1_GENERATION_WIDTH     2
 #define SDMA_DESC1_GENERATION_MASK \
-       ((1ULL<<SDMA_DESC1_GENERATION_WIDTH)-1ULL)
+       ((1ULL << SDMA_DESC1_GENERATION_WIDTH) - 1)
 #define SDMA_DESC1_GENERATION_SMASK \
-       (SDMA_DESC1_GENERATION_MASK<<SDMA_DESC1_GENERATION_SHIFT)
-#define SDMA_DESC1_INT_REQ_FLAG         (1ULL<<1)
-#define SDMA_DESC1_HEAD_TO_HOST_FLAG    (1ULL<<0)
+       (SDMA_DESC1_GENERATION_MASK << SDMA_DESC1_GENERATION_SHIFT)
+#define SDMA_DESC1_INT_REQ_FLAG         (1ULL << 1)
+#define SDMA_DESC1_HEAD_TO_HOST_FLAG    (1ULL << 0)
 
 enum sdma_states {
        sdma_state_s00_hw_down,
index 53ac21431542732a4cd3f2bc8a37a4110fcdeee9..41bb59eb001c72fe214a4114047fdf03156f9007 100644 (file)
@@ -749,11 +749,13 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
        struct verbs_txreq *tx;
 
        tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
-       if (!tx)
+       if (!tx) {
                /* call slow path to get the lock */
                tx =  __get_txreq(dev, qp);
-       if (tx)
-               tx->qp = qp;
+               if (IS_ERR(tx))
+                       return tx;
+       }
+       tx->qp = qp;
        return tx;
 }
 
index 7d137a43cc86842ed98bc27e63d6dfcb2042f177..9eda69e406787a55a347370328cdf07d5375dc0a 100644 (file)
@@ -61,8 +61,7 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;"
 enum {
        VHOST_NET_FEATURES = VHOST_FEATURES |
                         (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
-                        (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
-                        (1ULL << VIRTIO_F_VERSION_1),
+                        (1ULL << VIRTIO_NET_F_MRG_RXBUF)
 };
 
 enum {
index f114a9dbb48f0ea59718da7fe59a02180da07821..e25a23692822c16ce26f7a2b9b9f7f96153a6563 100644 (file)
@@ -166,9 +166,7 @@ enum {
 /* Note: can't set VIRTIO_F_VERSION_1 yet, since that implies ANY_LAYOUT. */
 enum {
        VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL << VIRTIO_SCSI_F_HOTPLUG) |
-                                              (1ULL << VIRTIO_SCSI_F_T10_PI) |
-                                              (1ULL << VIRTIO_F_ANY_LAYOUT) |
-                                              (1ULL << VIRTIO_F_VERSION_1)
+                                              (1ULL << VIRTIO_SCSI_F_T10_PI)
 };
 
 #define VHOST_SCSI_MAX_TARGET  256
index d9c501eaa6c3362b7ea89cdb39d33334f435af47..f2882ac98726447980dda9d1d7c916161b22eac1 100644 (file)
@@ -277,10 +277,13 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
                        return -EFAULT;
                return 0;
        case VHOST_SET_FEATURES:
+               printk(KERN_ERR "1\n");
                if (copy_from_user(&features, featurep, sizeof features))
                        return -EFAULT;
+               printk(KERN_ERR "2\n");
                if (features & ~VHOST_FEATURES)
                        return -EOPNOTSUPP;
+               printk(KERN_ERR "3\n");
                return vhost_test_set_features(n, features);
        case VHOST_RESET_OWNER:
                return vhost_test_reset_owner(n);
index ce6f6da4b09f988bc4ae15268912335fcd1bab18..4772862b71a744091efef2216d9deaeca54567d1 100644 (file)
@@ -173,7 +173,9 @@ enum {
        VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
                         (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
                         (1ULL << VIRTIO_RING_F_EVENT_IDX) |
-                        (1ULL << VHOST_F_LOG_ALL),
+                        (1ULL << VHOST_F_LOG_ALL) |
+                        (1ULL << VIRTIO_F_ANY_LAYOUT) |
+                        (1ULL << VIRTIO_F_VERSION_1)
 };
 
 static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
index 22ea424ee741ea1a967676298e7877332fc324b2..073bb57adab10ce14e55205eddf0e3de5862be1d 100644 (file)
@@ -1242,6 +1242,13 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
                                goto out_clear;
                        }
                        bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);
+                       /*
+                        * If the partition is not aligned on a page
+                        * boundary, we can't do dax I/O to it.
+                        */
+                       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) ||
+                           (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
+                               bdev->bd_inode->i_flags &= ~S_DAX;
                }
        } else {
                if (bdev->bd_contains == bdev) {
index 6a1119e87fbb6fb636e4d76e814574402b7dc139..e739950ca08485543db80bee53f1021384ed0b9a 100644 (file)
@@ -325,8 +325,11 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
 static void
 cifs_show_security(struct seq_file *s, struct cifs_ses *ses)
 {
-       if (ses->sectype == Unspecified)
+       if (ses->sectype == Unspecified) {
+               if (ses->user_name == NULL)
+                       seq_puts(s, ",sec=none");
                return;
+       }
 
        seq_puts(s, ",sec=");
 
index c63f5227b68181ed772d1a999686a852a23d41e9..28a77bf1d55924693d27d1c701571e1b1fef2d49 100644 (file)
@@ -67,6 +67,12 @@ static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file,
                goto out_drop_write;
        }
 
+       if (src_file.file->f_op->unlocked_ioctl != cifs_ioctl) {
+               rc = -EBADF;
+               cifs_dbg(VFS, "src file seems to be from a different filesystem type\n");
+               goto out_fput;
+       }
+
        if ((!src_file.file->private_data) || (!dst_file->private_data)) {
                rc = -EBADF;
                cifs_dbg(VFS, "missing cifsFileInfo on copy range src file\n");
index 93bf2f990ace462b31dba2ee239084e112b1dfd0..7ae6df7ea1d2d04962ef4554a6a2fa1efb977006 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -119,7 +119,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
                size_t len;
                if (pos == max) {
                        unsigned blkbits = inode->i_blkbits;
-                       sector_t block = pos >> blkbits;
+                       long page = pos >> PAGE_SHIFT;
+                       sector_t block = page << (PAGE_SHIFT - blkbits);
                        unsigned first = pos - (block << blkbits);
                        long size;
 
index 587ac08eabb62bcd47c0a90309e0442262eafd39..091a36444972fa0b746118b0cc58ca2a3dcaa97f 100644 (file)
@@ -1481,6 +1481,21 @@ static long writeback_sb_inodes(struct super_block *sb,
                wbc_detach_inode(&wbc);
                work->nr_pages -= write_chunk - wbc.nr_to_write;
                wrote += write_chunk - wbc.nr_to_write;
+
+               if (need_resched()) {
+                       /*
+                        * We're trying to balance between building up a nice
+                        * long list of IOs to improve our merge rate, and
+                        * getting those IOs out quickly for anyone throttling
+                        * in balance_dirty_pages().  cond_resched() doesn't
+                        * unplug, so get our IOs out the door before we
+                        * give up the CPU.
+                        */
+                       blk_flush_plug(current);
+                       cond_resched();
+               }
+
+
                spin_lock(&wb->list_lock);
                spin_lock(&inode->i_lock);
                if (!(inode->i_state & I_DIRTY_ALL))
@@ -1488,7 +1503,7 @@ static long writeback_sb_inodes(struct super_block *sb,
                requeue_inode(inode, wb, &wbc);
                inode_sync_complete(inode);
                spin_unlock(&inode->i_lock);
-               cond_resched_lock(&wb->list_lock);
+
                /*
                 * bail out to wb_writeback() often enough to check
                 * background threshold and other termination conditions.
index 634e676072cb738467b61064beaa5fa4b98cf672..f9aeb40a7197475ec52ba414852ff356129b0aab 100644 (file)
@@ -1287,8 +1287,10 @@ static struct file *userfaultfd_file_create(int flags)
 
        file = anon_inode_getfile("[userfaultfd]", &userfaultfd_fops, ctx,
                                  O_RDWR | (flags & UFFD_SHARED_FCNTL_FLAGS));
-       if (IS_ERR(file))
+       if (IS_ERR(file)) {
+               mmput(ctx->mm);
                kmem_cache_free(userfaultfd_ctx_cachep, ctx);
+       }
 out:
        return file;
 }
index 97eea0e4c01675069557019efc2c0fc2ec2873bb..1cad8b2d460c3eabf9a7cf833fa6ece8785fe6e7 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <linux/notifier.h>
 
-#if defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE)
+#if IS_ENABLED(CONFIG_ACPI_BUTTON)
 extern int acpi_lid_notifier_register(struct notifier_block *nb);
 extern int acpi_lid_notifier_unregister(struct notifier_block *nb);
 extern int acpi_lid_open(void);
@@ -20,6 +20,6 @@ static inline int acpi_lid_open(void)
 {
        return 1;
 }
-#endif /* defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) */
+#endif /* IS_ENABLED(CONFIG_ACPI_BUTTON) */
 
 #endif /* ACPI_BUTTON_H */
index e840b294c6f5beb2f8a178aa0d3bbb8e92040e40..c62392d9b52ad6ee06b98a3fd9e6832c73ebcae1 100644 (file)
@@ -24,7 +24,7 @@ enum acpi_backlight_type {
        acpi_backlight_native,
 };
 
-#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
+#if IS_ENABLED(CONFIG_ACPI_VIDEO)
 extern int acpi_video_register(void);
 extern void acpi_video_unregister(void);
 extern int acpi_video_get_edid(struct acpi_device *device, int type,
index f20f407ce45d29fddcf98bd8fcfe270349fd0b92..4b4b056a6eb00ee844a5af970c2ce0c2e86d87d6 100644 (file)
@@ -73,7 +73,7 @@
  * Convert a physical address to a Page Frame Number and back
  */
 #define        __phys_to_pfn(paddr)    ((unsigned long)((paddr) >> PAGE_SHIFT))
-#define        __pfn_to_phys(pfn)      ((pfn) << PAGE_SHIFT)
+#define        __pfn_to_phys(pfn)      PFN_PHYS(pfn)
 
 #define page_to_pfn __page_to_pfn
 #define pfn_to_page __pfn_to_page
index 83bfb87f5bf18e92ea794dd3ca3afec1b1ba6f11..e2aadbc7151f4cd69b8745e80a0af403257f1678 100644 (file)
@@ -111,8 +111,8 @@ static inline void queued_spin_unlock_wait(struct qspinlock *lock)
                cpu_relax();
 }
 
-#ifndef virt_queued_spin_lock
-static __always_inline bool virt_queued_spin_lock(struct qspinlock *lock)
+#ifndef virt_spin_lock
+static __always_inline bool virt_spin_lock(struct qspinlock *lock)
 {
        return false;
 }
index d901f1a47be6c5e4af71ea7543f7dc7163eca2f9..4e14dac282bb6c963440593090bc060afecf8130 100644 (file)
 #define VGIC_V3_MAX_LRS                16
 #define VGIC_MAX_IRQS          1024
 #define VGIC_V2_MAX_CPUS       8
-
-/* Sanity checks... */
-#if (KVM_MAX_VCPUS > 255)
-#error Too many KVM VCPUs, the VGIC only supports up to 255 VCPUs for now
-#endif
+#define VGIC_V3_MAX_CPUS       255
 
 #if (VGIC_NR_IRQS_LEGACY & 31)
 #error "VGIC_NR_IRQS must be a multiple of 32"
index 38a5ff772a37fbbd841a1152d9f613bb1ffde84c..99da9ebc73776af0a5efb69a73310f522b952b25 100644 (file)
@@ -1368,6 +1368,26 @@ static inline bool bvec_gap_to_prev(struct request_queue *q,
                ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
 }
 
+static inline bool bio_will_gap(struct request_queue *q, struct bio *prev,
+                        struct bio *next)
+{
+       if (!bio_has_data(prev))
+               return false;
+
+       return bvec_gap_to_prev(q, &prev->bi_io_vec[prev->bi_vcnt - 1],
+                               next->bi_io_vec[0].bv_offset);
+}
+
+static inline bool req_gap_back_merge(struct request *req, struct bio *bio)
+{
+       return bio_will_gap(req->q, req->biotail, bio);
+}
+
+static inline bool req_gap_front_merge(struct request *req, struct bio *bio)
+{
+       return bio_will_gap(req->q, bio, req->bio);
+}
+
 struct work_struct;
 int kblockd_schedule_work(struct work_struct *work);
 int kblockd_schedule_delayed_work(struct delayed_work *dwork, unsigned long delay);
@@ -1494,6 +1514,26 @@ queue_max_integrity_segments(struct request_queue *q)
        return q->limits.max_integrity_segments;
 }
 
+static inline bool integrity_req_gap_back_merge(struct request *req,
+                                               struct bio *next)
+{
+       struct bio_integrity_payload *bip = bio_integrity(req->bio);
+       struct bio_integrity_payload *bip_next = bio_integrity(next);
+
+       return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1],
+                               bip_next->bip_vec[0].bv_offset);
+}
+
+static inline bool integrity_req_gap_front_merge(struct request *req,
+                                                struct bio *bio)
+{
+       struct bio_integrity_payload *bip = bio_integrity(bio);
+       struct bio_integrity_payload *bip_next = bio_integrity(req->bio);
+
+       return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1],
+                               bip_next->bip_vec[0].bv_offset);
+}
+
 #else /* CONFIG_BLK_DEV_INTEGRITY */
 
 struct bio;
@@ -1560,6 +1600,16 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g)
 {
        return 0;
 }
+static inline bool integrity_req_gap_back_merge(struct request *req,
+                                               struct bio *next)
+{
+       return false;
+}
+static inline bool integrity_req_gap_front_merge(struct request *req,
+                                                struct bio *bio)
+{
+       return false;
+}
 
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
 
index 4763ad64e832cb07496bbd14a35c4bcf3825a885..f89b31d45cc894814d409a19e161a29c2c41e832 100644 (file)
@@ -107,6 +107,7 @@ static inline u64 ceph_sanitize_features(u64 features)
         CEPH_FEATURE_OSDMAP_ENC |              \
         CEPH_FEATURE_CRUSH_TUNABLES3 |         \
         CEPH_FEATURE_OSD_PRIMARY_AFFINITY |    \
+        CEPH_FEATURE_MSGR_KEEPALIVE2 |         \
         CEPH_FEATURE_CRUSH_V4)
 
 #define CEPH_FEATURES_REQUIRED_DEFAULT   \
index 7e1252e97a30bc92d4065faf4ee5ab38d7839156..b2371d9b51fac6ea69032576ac1c3cddfc104016 100644 (file)
@@ -238,6 +238,8 @@ struct ceph_connection {
        bool out_kvec_is_msg; /* kvec refers to out_msg */
        int out_more;        /* there is more data after the kvecs */
        __le64 out_temp_ack; /* for writing an ack */
+       struct ceph_timespec out_temp_keepalive2; /* for writing keepalive2
+                                                    stamp */
 
        /* message in temps */
        struct ceph_msg_header in_hdr;
@@ -248,7 +250,7 @@ struct ceph_connection {
        int in_base_pos;     /* bytes read */
        __le64 in_temp_ack;  /* for reading an ack */
 
-       struct timespec last_keepalive_ack;
+       struct timespec last_keepalive_ack; /* keepalive2 ack stamp */
 
        struct delayed_work work;           /* send|recv work */
        unsigned long       delay;          /* current delay interval */
index 31ce435981feb962b4f1a9a9494ad97913232dcd..bdcf358dfce2a9d0f5420d9fbde6066b1e2dc73b 100644 (file)
 struct clock_event_device;
 struct module;
 
-/* Clock event mode commands for legacy ->set_mode(): OBSOLETE */
-enum clock_event_mode {
-       CLOCK_EVT_MODE_UNUSED,
-       CLOCK_EVT_MODE_SHUTDOWN,
-       CLOCK_EVT_MODE_PERIODIC,
-       CLOCK_EVT_MODE_ONESHOT,
-       CLOCK_EVT_MODE_RESUME,
-};
-
 /*
  * Possible states of a clock event device.
  *
@@ -86,16 +77,14 @@ enum clock_event_state {
  * @min_delta_ns:      minimum delta value in ns
  * @mult:              nanosecond to cycles multiplier
  * @shift:             nanoseconds to cycles divisor (power of two)
- * @mode:              operating mode, relevant only to ->set_mode(), OBSOLETE
  * @state_use_accessors:current state of the device, assigned by the core code
  * @features:          features
  * @retries:           number of forced programming retries
- * @set_mode:          legacy set mode function, only for modes <= CLOCK_EVT_MODE_RESUME.
- * @set_state_periodic:        switch state to periodic, if !set_mode
- * @set_state_oneshot: switch state to oneshot, if !set_mode
- * @set_state_oneshot_stopped: switch state to oneshot_stopped, if !set_mode
- * @set_state_shutdown:        switch state to shutdown, if !set_mode
- * @tick_resume:       resume clkevt device, if !set_mode
+ * @set_state_periodic:        switch state to periodic
+ * @set_state_oneshot: switch state to oneshot
+ * @set_state_oneshot_stopped: switch state to oneshot_stopped
+ * @set_state_shutdown:        switch state to shutdown
+ * @tick_resume:       resume clkevt device
  * @broadcast:         function to broadcast events
  * @min_delta_ticks:   minimum delta value in ticks stored for reconfiguration
  * @max_delta_ticks:   maximum delta value in ticks stored for reconfiguration
@@ -116,18 +105,10 @@ struct clock_event_device {
        u64                     min_delta_ns;
        u32                     mult;
        u32                     shift;
-       enum clock_event_mode   mode;
        enum clock_event_state  state_use_accessors;
        unsigned int            features;
        unsigned long           retries;
 
-       /*
-        * State transition callback(s): Only one of the two groups should be
-        * defined:
-        * - set_mode(), only for modes <= CLOCK_EVT_MODE_RESUME.
-        * - set_state_{shutdown|periodic|oneshot|oneshot_stopped}(), tick_resume().
-        */
-       void                    (*set_mode)(enum clock_event_mode mode, struct clock_event_device *);
        int                     (*set_state_periodic)(struct clock_event_device *);
        int                     (*set_state_oneshot)(struct clock_event_device *);
        int                     (*set_state_oneshot_stopped)(struct clock_event_device *);
index 430efcbea48e3547d34c76c62e14fe5eb495c6a9..dca22de98d948480141c5806680ef167b35a7555 100644 (file)
@@ -127,9 +127,14 @@ struct cpufreq_policy {
 #define CPUFREQ_SHARED_TYPE_ANY         (3) /* Freq can be set from any dependent CPU*/
 
 #ifdef CONFIG_CPU_FREQ
+struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu);
 struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
 void cpufreq_cpu_put(struct cpufreq_policy *policy);
 #else
+static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
+{
+       return NULL;
+}
 static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
 {
        return NULL;
index ce447f0f1bad49e24351cec2c1ae0e2d2620ad4a..68030e22af3527958ac39006031dd62388228091 100644 (file)
@@ -65,7 +65,10 @@ struct devfreq_dev_status {
  *                     The "flags" parameter's possible values are
  *                     explained above with "DEVFREQ_FLAG_*" macros.
  * @get_dev_status:    The device should provide the current performance
- *                     status to devfreq, which is used by governors.
+ *                     status to devfreq. Governors are recommended not to
+ *                     use this directly. Instead, governors are recommended
+ *                     to use devfreq_update_stats() along with
+ *                     devfreq.last_status.
  * @get_cur_freq:      The device should provide the current frequency
  *                     at which it is operating.
  * @exit:              An optional callback that is called when devfreq
@@ -161,6 +164,7 @@ struct devfreq {
        struct delayed_work work;
 
        unsigned long previous_freq;
+       struct devfreq_dev_status last_status;
 
        void *data; /* private data for governors */
 
@@ -204,6 +208,19 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev,
 extern void devm_devfreq_unregister_opp_notifier(struct device *dev,
                                                struct devfreq *devfreq);
 
+/**
+ * devfreq_update_stats() - update the last_status pointer in struct devfreq
+ * @df:                the devfreq instance whose status needs updating
+ *
+ *  Governors are recommended to use this function along with last_status,
+ * which allows other entities to reuse the last_status without affecting
+ * the values fetched later by governors.
+ */
+static inline int devfreq_update_stats(struct devfreq *df)
+{
+       return df->profile->get_dev_status(df->dev.parent, &df->last_status);
+}
+
 #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
 /**
  * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
@@ -289,6 +306,11 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev,
                                                        struct devfreq *devfreq)
 {
 }
+
+static inline int devfreq_update_stats(struct devfreq *df)
+{
+       return -EINVAL;
+}
 #endif /* CONFIG_PM_DEVFREQ */
 
 #endif /* __LINUX_DEVFREQ_H__ */
index 6f8b340664421bb797fd37488bbd2c97afb6d3d4..11bf09288ddb08ab277b6f213696c1216348155c 100644 (file)
@@ -110,8 +110,8 @@ enum {
 /*
  * Return value for chip->irq_set_affinity()
  *
- * IRQ_SET_MASK_OK     - OK, core updates irq_data.affinity
- * IRQ_SET_MASK_NOCPY  - OK, chip did update irq_data.affinity
+ * IRQ_SET_MASK_OK     - OK, core updates irq_common_data.affinity
+ * IRQ_SET_MASK_NOCPY  - OK, chip did update irq_common_data.affinity
  * IRQ_SET_MASK_OK_DONE        - Same as IRQ_SET_MASK_OK for core. Special code to
  *                       support stacked irqchips, which indicates skipping
  *                       all descendent irqchips.
@@ -129,9 +129,19 @@ struct irq_domain;
  * struct irq_common_data - per irq data shared by all irqchips
  * @state_use_accessors: status information for irq chip functions.
  *                     Use accessor functions to deal with it
+ * @node:              node index useful for balancing
+ * @handler_data:      per-IRQ data for the irq_chip methods
+ * @affinity:          IRQ affinity on SMP
+ * @msi_desc:          MSI descriptor
  */
 struct irq_common_data {
        unsigned int            state_use_accessors;
+#ifdef CONFIG_NUMA
+       unsigned int            node;
+#endif
+       void                    *handler_data;
+       struct msi_desc         *msi_desc;
+       cpumask_var_t           affinity;
 };
 
 /**
@@ -139,38 +149,26 @@ struct irq_common_data {
  * @mask:              precomputed bitmask for accessing the chip registers
  * @irq:               interrupt number
  * @hwirq:             hardware interrupt number, local to the interrupt domain
- * @node:              node index useful for balancing
  * @common:            point to data shared by all irqchips
  * @chip:              low level interrupt hardware access
  * @domain:            Interrupt translation domain; responsible for mapping
  *                     between hwirq number and linux irq number.
  * @parent_data:       pointer to parent struct irq_data to support hierarchy
  *                     irq_domain
- * @handler_data:      per-IRQ data for the irq_chip methods
  * @chip_data:         platform-specific per-chip private data for the chip
  *                     methods, to allow shared chip implementations
- * @msi_desc:          MSI descriptor
- * @affinity:          IRQ affinity on SMP
- *
- * The fields here need to overlay the ones in irq_desc until we
- * cleaned up the direct references and switched everything over to
- * irq_data.
  */
 struct irq_data {
        u32                     mask;
        unsigned int            irq;
        unsigned long           hwirq;
-       unsigned int            node;
        struct irq_common_data  *common;
        struct irq_chip         *chip;
        struct irq_domain       *domain;
 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
        struct irq_data         *parent_data;
 #endif
-       void                    *handler_data;
        void                    *chip_data;
-       struct msi_desc         *msi_desc;
-       cpumask_var_t           affinity;
 };
 
 /*
@@ -190,6 +188,7 @@ struct irq_data {
  * IRQD_IRQ_MASKED             - Masked state of the interrupt
  * IRQD_IRQ_INPROGRESS         - In progress state of the interrupt
  * IRQD_WAKEUP_ARMED           - Wakeup mode armed
+ * IRQD_FORWARDED_TO_VCPU      - The interrupt is forwarded to a VCPU
  */
 enum {
        IRQD_TRIGGER_MASK               = 0xf,
@@ -204,6 +203,7 @@ enum {
        IRQD_IRQ_MASKED                 = (1 << 17),
        IRQD_IRQ_INPROGRESS             = (1 << 18),
        IRQD_WAKEUP_ARMED               = (1 << 19),
+       IRQD_FORWARDED_TO_VCPU          = (1 << 20),
 };
 
 #define __irqd_to_state(d)             ((d)->common->state_use_accessors)
@@ -282,6 +282,20 @@ static inline bool irqd_is_wakeup_armed(struct irq_data *d)
        return __irqd_to_state(d) & IRQD_WAKEUP_ARMED;
 }
 
+static inline bool irqd_is_forwarded_to_vcpu(struct irq_data *d)
+{
+       return __irqd_to_state(d) & IRQD_FORWARDED_TO_VCPU;
+}
+
+static inline void irqd_set_forwarded_to_vcpu(struct irq_data *d)
+{
+       __irqd_to_state(d) |= IRQD_FORWARDED_TO_VCPU;
+}
+
+static inline void irqd_clr_forwarded_to_vcpu(struct irq_data *d)
+{
+       __irqd_to_state(d) &= ~IRQD_FORWARDED_TO_VCPU;
+}
 
 /*
  * Functions for chained handlers which can be enabled/disabled by the
@@ -461,14 +475,14 @@ static inline int irq_set_parent(int irq, int parent_irq)
  * Built-in IRQ handlers for various IRQ types,
  * callable via desc->handle_irq()
  */
-extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
-extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
+extern void handle_level_irq(struct irq_desc *desc);
+extern void handle_fasteoi_irq(struct irq_desc *desc);
+extern void handle_edge_irq(struct irq_desc *desc);
+extern void handle_edge_eoi_irq(struct irq_desc *desc);
+extern void handle_simple_irq(struct irq_desc *desc);
+extern void handle_percpu_irq(struct irq_desc *desc);
+extern void handle_percpu_devid_irq(struct irq_desc *desc);
+extern void handle_bad_irq(struct irq_desc *desc);
 extern void handle_nested_irq(unsigned int irq);
 
 extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
@@ -627,23 +641,23 @@ static inline void *irq_data_get_irq_chip_data(struct irq_data *d)
 static inline void *irq_get_handler_data(unsigned int irq)
 {
        struct irq_data *d = irq_get_irq_data(irq);
-       return d ? d->handler_data : NULL;
+       return d ? d->common->handler_data : NULL;
 }
 
 static inline void *irq_data_get_irq_handler_data(struct irq_data *d)
 {
-       return d->handler_data;
+       return d->common->handler_data;
 }
 
 static inline struct msi_desc *irq_get_msi_desc(unsigned int irq)
 {
        struct irq_data *d = irq_get_irq_data(irq);
-       return d ? d->msi_desc : NULL;
+       return d ? d->common->msi_desc : NULL;
 }
 
 static inline struct msi_desc *irq_data_get_msi_desc(struct irq_data *d)
 {
-       return d->msi_desc;
+       return d->common->msi_desc;
 }
 
 static inline u32 irq_get_trigger_type(unsigned int irq)
@@ -652,21 +666,30 @@ static inline u32 irq_get_trigger_type(unsigned int irq)
        return d ? irqd_get_trigger_type(d) : 0;
 }
 
-static inline int irq_data_get_node(struct irq_data *d)
+static inline int irq_common_data_get_node(struct irq_common_data *d)
 {
+#ifdef CONFIG_NUMA
        return d->node;
+#else
+       return 0;
+#endif
+}
+
+static inline int irq_data_get_node(struct irq_data *d)
+{
+       return irq_common_data_get_node(d->common);
 }
 
 static inline struct cpumask *irq_get_affinity_mask(int irq)
 {
        struct irq_data *d = irq_get_irq_data(irq);
 
-       return d ? d->affinity : NULL;
+       return d ? d->common->affinity : NULL;
 }
 
 static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
 {
-       return d->affinity;
+       return d->common->affinity;
 }
 
 unsigned int arch_dynirq_lower_bound(unsigned int from);
index 5acfa26602e1b5839a1916e5f9da8e947a605271..a587a33363c724a10ae12b471658ed2d1800e827 100644 (file)
@@ -98,11 +98,7 @@ extern struct irq_desc irq_desc[NR_IRQS];
 
 static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
 {
-#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
-       return irq_to_desc(data->irq);
-#else
-       return container_of(data, struct irq_desc, irq_data);
-#endif
+       return container_of(data->common, struct irq_desc, irq_common_data);
 }
 
 static inline unsigned int irq_desc_get_irq(struct irq_desc *desc)
@@ -127,23 +123,21 @@ static inline void *irq_desc_get_chip_data(struct irq_desc *desc)
 
 static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
 {
-       return desc->irq_data.handler_data;
+       return desc->irq_common_data.handler_data;
 }
 
 static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
 {
-       return desc->irq_data.msi_desc;
+       return desc->irq_common_data.msi_desc;
 }
 
 /*
  * Architectures call this to let the generic IRQ layer
- * handle an interrupt. If the descriptor is attached to an
- * irqchip-style controller then we call the ->handle_irq() handler,
- * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
+ * handle an interrupt.
  */
-static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
+static inline void generic_handle_irq_desc(struct irq_desc *desc)
 {
-       desc->handle_irq(irq, desc);
+       desc->handle_irq(desc);
 }
 
 int generic_handle_irq(unsigned int irq);
@@ -176,29 +170,6 @@ static inline int irq_has_action(unsigned int irq)
        return irq_desc_has_action(irq_to_desc(irq));
 }
 
-/* caller has locked the irq_desc and both params are valid */
-static inline void __irq_set_handler_locked(unsigned int irq,
-                                           irq_flow_handler_t handler)
-{
-       struct irq_desc *desc;
-
-       desc = irq_to_desc(irq);
-       desc->handle_irq = handler;
-}
-
-/* caller has locked the irq_desc and both params are valid */
-static inline void
-__irq_set_chip_handler_name_locked(unsigned int irq, struct irq_chip *chip,
-                                  irq_flow_handler_t handler, const char *name)
-{
-       struct irq_desc *desc;
-
-       desc = irq_to_desc(irq);
-       irq_desc_get_irq_data(desc)->chip = chip;
-       desc->handle_irq = handler;
-       desc->name = name;
-}
-
 /**
  * irq_set_handler_locked - Set irq handler from a locked region
  * @data:      Pointer to the irq_data structure which identifies the irq
index 62d5430041970c1ad0904098b9055c653dd4b612..661bed0ed1f3124ca2024559f2613507dd22221f 100644 (file)
@@ -8,7 +8,7 @@
 
 struct irq_desc;
 struct irq_data;
-typedef        void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc);
+typedef        void (*irq_flow_handler_t)(struct irq_desc *desc);
 typedef        void (*irq_preflow_handler_t)(struct irq_data *data);
 
 #endif
index 7f653e8f66900049c358ed4907fab8121047dd91..f1094238ab2a0f0fddeb40e3c7aadde7c2a89015 100644 (file)
@@ -21,8 +21,8 @@
  *
  * DEFINE_STATIC_KEY_TRUE(key);
  * DEFINE_STATIC_KEY_FALSE(key);
- * static_key_likely()
- * statick_key_unlikely()
+ * static_branch_likely()
+ * static_branch_unlikely()
  *
  * Jump labels provide an interface to generate dynamic branches using
  * self-modifying code. Assuming toolchain and architecture support, if we
  * statement, setting the key to true requires us to patch in a jump
  * to the out-of-line of true branch.
  *
- * In addtion to static_branch_{enable,disable}, we can also reference count
+ * In addition to static_branch_{enable,disable}, we can also reference count
  * the key or branch direction via static_branch_{inc,dec}. Thus,
  * static_branch_inc() can be thought of as a 'make more true' and
- * static_branch_dec() as a 'make more false'. The inc()/dec()
- * interface is meant to be used exclusively from the inc()/dec() for a given
- * key.
+ * static_branch_dec() as a 'make more false'.
  *
  * Since this relies on modifying code, the branch modifying functions
  * must be considered absolute slow paths (machine wide synchronization etc.).
index 48d901f83f92e4cf78bc932d94142b4594d65d9d..e312219ff8230bb8a4b8fad60ed4fc0e40a6afd3 100644 (file)
@@ -147,11 +147,20 @@ static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask)
                cpumask_or(mask, mask, tick_nohz_full_mask);
 }
 
+static inline int housekeeping_any_cpu(void)
+{
+       return cpumask_any_and(housekeeping_mask, cpu_online_mask);
+}
+
 extern void tick_nohz_full_kick(void);
 extern void tick_nohz_full_kick_cpu(int cpu);
 extern void tick_nohz_full_kick_all(void);
 extern void __tick_nohz_task_switch(void);
 #else
+static inline int housekeeping_any_cpu(void)
+{
+       return smp_processor_id();
+}
 static inline bool tick_nohz_full_enabled(void) { return false; }
 static inline bool tick_nohz_full_cpu(int cpu) { return false; }
 static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) { }
index 391dae1931c082d85f4023ff83a2f51aa0a7052d..a0fa975cd1c1c94f8e0c77991557a7ed87efb83e 100644 (file)
@@ -294,8 +294,8 @@ struct opa_port_states {
 
 struct opa_port_state_info {
        struct opa_port_states port_states;
-       u16 link_width_downgrade_tx_active;
-       u16 link_width_downgrade_rx_active;
+       __be16 link_width_downgrade_tx_active;
+       __be16 link_width_downgrade_rx_active;
 };
 
 struct opa_port_info {
index 22734bc3ffd4a2e72ec1a1979ec1adf7df8014c6..a5cf6152e778929d572250462b2252a4369b08ca 100644 (file)
@@ -21,6 +21,8 @@ struct rt5645_platform_data {
        /* 0 = IN2P; 1 = GPIO6; 2 = GPIO10; 3 = GPIO12 */
 
        unsigned int jd_mode;
+       /* Invert JD when jack insert */
+       bool jd_invert;
 };
 
 #endif
index 884e728b09d9a57e8a56ac8ea224b3f873cb81c3..9ffa28514fa76556941acb8d4c05e45eea2b673b 100644 (file)
        .info = snd_soc_info_volsw, \
        .get = xhandler_get, .put = xhandler_put, \
        .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
+#define SOC_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, xmax, xinvert, \
+                                xhandler_get, xhandler_put, tlv_array) \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+       .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
+                SNDRV_CTL_ELEM_ACCESS_READWRITE,\
+       .tlv.p = (tlv_array), \
+       .info = snd_soc_info_volsw_range, \
+       .get = xhandler_get, .put = xhandler_put, \
+       .private_value = (unsigned long)&(struct soc_mixer_control) \
+               {.reg = xreg, .rreg = xreg, .shift = xshift, \
+                .rshift = xshift, .min = xmin, .max = xmax, \
+                .platform_max = xmax, .invert = xinvert} }
 #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
         xhandler_get, xhandler_put, tlv_array) \
 {      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
index 6e40a9539763f48efc695c2b780a29f61b760f9f..e28169dd1c36a51f92523208984ec4c7a4b5b251 100644 (file)
@@ -83,7 +83,7 @@ int irq_set_handler_data(unsigned int irq, void *data)
 
        if (!desc)
                return -EINVAL;
-       desc->irq_data.handler_data = data;
+       desc->irq_common_data.handler_data = data;
        irq_put_desc_unlock(desc, flags);
        return 0;
 }
@@ -105,7 +105,7 @@ int irq_set_msi_desc_off(unsigned int irq_base, unsigned int irq_offset,
 
        if (!desc)
                return -EINVAL;
-       desc->irq_data.msi_desc = entry;
+       desc->irq_common_data.msi_desc = entry;
        if (entry && !irq_offset)
                entry->irq = irq_base;
        irq_put_desc_unlock(desc, flags);
@@ -372,7 +372,6 @@ static bool irq_may_run(struct irq_desc *desc)
 
 /**
  *     handle_simple_irq - Simple and software-decoded IRQs.
- *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *
  *     Simple interrupts are either sent from a demultiplexing interrupt
@@ -382,8 +381,7 @@ static bool irq_may_run(struct irq_desc *desc)
  *     Note: The caller is expected to handle the ack, clear, mask and
  *     unmask issues if necessary.
  */
-void
-handle_simple_irq(unsigned int irq, struct irq_desc *desc)
+void handle_simple_irq(struct irq_desc *desc)
 {
        raw_spin_lock(&desc->lock);
 
@@ -425,7 +423,6 @@ static void cond_unmask_irq(struct irq_desc *desc)
 
 /**
  *     handle_level_irq - Level type irq handler
- *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *
  *     Level type interrupts are active as long as the hardware line has
@@ -433,8 +430,7 @@ static void cond_unmask_irq(struct irq_desc *desc)
  *     it after the associated handler has acknowledged the device, so the
  *     interrupt line is back to inactive.
  */
-void
-handle_level_irq(unsigned int irq, struct irq_desc *desc)
+void handle_level_irq(struct irq_desc *desc)
 {
        raw_spin_lock(&desc->lock);
        mask_ack_irq(desc);
@@ -496,7 +492,6 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
 
 /**
  *     handle_fasteoi_irq - irq handler for transparent controllers
- *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *
  *     Only a single callback will be issued to the chip: an ->eoi()
@@ -504,8 +499,7 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
  *     for modern forms of interrupt handlers, which handle the flow
  *     details in hardware, transparently.
  */
-void
-handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
+void handle_fasteoi_irq(struct irq_desc *desc)
 {
        struct irq_chip *chip = desc->irq_data.chip;
 
@@ -546,7 +540,6 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
 
 /**
  *     handle_edge_irq - edge type IRQ handler
- *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *
  *     Interrupt occures on the falling and/or rising edge of a hardware
@@ -560,8 +553,7 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
  *     the handler was running. If all pending interrupts are handled, the
  *     loop is left.
  */
-void
-handle_edge_irq(unsigned int irq, struct irq_desc *desc)
+void handle_edge_irq(struct irq_desc *desc)
 {
        raw_spin_lock(&desc->lock);
 
@@ -618,13 +610,12 @@ EXPORT_SYMBOL(handle_edge_irq);
 #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER
 /**
  *     handle_edge_eoi_irq - edge eoi type IRQ handler
- *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *
  * Similar as the above handle_edge_irq, but using eoi and w/o the
  * mask/unmask logic.
  */
-void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc)
+void handle_edge_eoi_irq(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
 
@@ -665,13 +656,11 @@ out_eoi:
 
 /**
  *     handle_percpu_irq - Per CPU local irq handler
- *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *
  *     Per CPU interrupts on SMP machines without locking requirements
  */
-void
-handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
+void handle_percpu_irq(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
 
@@ -688,7 +677,6 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
 
 /**
  * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids
- * @irq:       the interrupt number
  * @desc:      the interrupt description structure for this irq
  *
  * Per CPU interrupts on SMP machines without locking requirements. Same as
@@ -698,11 +686,12 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
  * contain the real device id for the cpu on which this handler is
  * called
  */
-void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc)
+void handle_percpu_devid_irq(struct irq_desc *desc)
 {
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct irqaction *action = desc->action;
        void *dev_id = raw_cpu_ptr(action->percpu_dev_id);
+       unsigned int irq = irq_desc_get_irq(desc);
        irqreturn_t res;
 
        kstat_incr_irqs_this_cpu(desc);
@@ -796,7 +785,7 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
                return;
 
        __irq_do_set_handler(desc, handle, 1, NULL);
-       desc->irq_data.handler_data = data;
+       desc->irq_common_data.handler_data = data;
 
        irq_put_desc_busunlock(desc, flags);
 }
index b6eeea8a80c5bbb7143b41ebcaa6f1132eedc7b4..de41a68fc038df70b8578e6ec1174fbcf53a1f0f 100644 (file)
  *
  * Handles spurious and unhandled IRQ's. It also prints a debugmessage.
  */
-void handle_bad_irq(unsigned int irq, struct irq_desc *desc)
+void handle_bad_irq(struct irq_desc *desc)
 {
+       unsigned int irq = irq_desc_get_irq(desc);
+
        print_irq_desc(irq, desc);
        kstat_incr_irqs_this_cpu(desc);
        ack_bad_irq(irq);
index eee4b385cffb46f260db19bfd9f9f5fbf7044224..5ef0c2dbe9302a846e724d5106c01a8eec248fda 100644 (file)
@@ -194,7 +194,7 @@ static inline void kstat_incr_irqs_this_cpu(struct irq_desc *desc)
 
 static inline int irq_desc_get_node(struct irq_desc *desc)
 {
-       return irq_data_get_node(&desc->irq_data);
+       return irq_common_data_get_node(&desc->irq_common_data);
 }
 
 #ifdef CONFIG_PM_SLEEP
index 0a2a4b697bcbffcc219b024a04113e1358d109d9..239e2ae2c947df31d26def1d26da430d144165e8 100644 (file)
@@ -38,12 +38,13 @@ static void __init init_irq_default_affinity(void)
 #ifdef CONFIG_SMP
 static int alloc_masks(struct irq_desc *desc, gfp_t gfp, int node)
 {
-       if (!zalloc_cpumask_var_node(&desc->irq_data.affinity, gfp, node))
+       if (!zalloc_cpumask_var_node(&desc->irq_common_data.affinity,
+                                    gfp, node))
                return -ENOMEM;
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
        if (!zalloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
-               free_cpumask_var(desc->irq_data.affinity);
+               free_cpumask_var(desc->irq_common_data.affinity);
                return -ENOMEM;
        }
 #endif
@@ -52,11 +53,13 @@ static int alloc_masks(struct irq_desc *desc, gfp_t gfp, int node)
 
 static void desc_smp_init(struct irq_desc *desc, int node)
 {
-       desc->irq_data.node = node;
-       cpumask_copy(desc->irq_data.affinity, irq_default_affinity);
+       cpumask_copy(desc->irq_common_data.affinity, irq_default_affinity);
 #ifdef CONFIG_GENERIC_PENDING_IRQ
        cpumask_clear(desc->pending_mask);
 #endif
+#ifdef CONFIG_NUMA
+       desc->irq_common_data.node = node;
+#endif
 }
 
 #else
@@ -70,12 +73,13 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node,
 {
        int cpu;
 
+       desc->irq_common_data.handler_data = NULL;
+       desc->irq_common_data.msi_desc = NULL;
+
        desc->irq_data.common = &desc->irq_common_data;
        desc->irq_data.irq = irq;
        desc->irq_data.chip = &no_irq_chip;
        desc->irq_data.chip_data = NULL;
-       desc->irq_data.handler_data = NULL;
-       desc->irq_data.msi_desc = NULL;
        irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS);
        irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED);
        desc->handle_irq = handle_bad_irq;
@@ -121,7 +125,7 @@ static void free_masks(struct irq_desc *desc)
 #ifdef CONFIG_GENERIC_PENDING_IRQ
        free_cpumask_var(desc->pending_mask);
 #endif
-       free_cpumask_var(desc->irq_data.affinity);
+       free_cpumask_var(desc->irq_common_data.affinity);
 }
 #else
 static inline void free_masks(struct irq_desc *desc) { }
@@ -343,7 +347,7 @@ int generic_handle_irq(unsigned int irq)
 
        if (!desc)
                return -EINVAL;
-       generic_handle_irq_desc(irq, desc);
+       generic_handle_irq_desc(desc);
        return 0;
 }
 EXPORT_SYMBOL_GPL(generic_handle_irq);
index 79baaf8a7813a601659d1316becba1fe0fd9807c..dc9d27c0c1589e58bb14a15e3442ed2ff0d091a4 100644 (file)
@@ -844,7 +844,6 @@ static struct irq_data *irq_domain_insert_irq_data(struct irq_domain *domain,
                child->parent_data = irq_data;
                irq_data->irq = child->irq;
                irq_data->common = child->common;
-               irq_data->node = child->node;
                irq_data->domain = domain;
        }
 
index ad1b064f94fee7cf19e1d6c5592832184fcda3ff..f9a59f6cabd2d3a96f8cd9bee179b6ab4214b83e 100644 (file)
@@ -192,7 +192,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
        switch (ret) {
        case IRQ_SET_MASK_OK:
        case IRQ_SET_MASK_OK_DONE:
-               cpumask_copy(data->affinity, mask);
+               cpumask_copy(desc->irq_common_data.affinity, mask);
        case IRQ_SET_MASK_OK_NOCOPY:
                irq_set_thread_affinity(desc);
                ret = 0;
@@ -304,7 +304,7 @@ static void irq_affinity_notify(struct work_struct *work)
        if (irq_move_pending(&desc->irq_data))
                irq_get_pending(cpumask, desc);
        else
-               cpumask_copy(cpumask, desc->irq_data.affinity);
+               cpumask_copy(cpumask, desc->irq_common_data.affinity);
        raw_spin_unlock_irqrestore(&desc->lock, flags);
 
        notify->notify(notify, cpumask);
@@ -375,9 +375,9 @@ static int setup_affinity(struct irq_desc *desc, struct cpumask *mask)
         * one of the targets is online.
         */
        if (irqd_has_set(&desc->irq_data, IRQD_AFFINITY_SET)) {
-               if (cpumask_intersects(desc->irq_data.affinity,
+               if (cpumask_intersects(desc->irq_common_data.affinity,
                                       cpu_online_mask))
-                       set = desc->irq_data.affinity;
+                       set = desc->irq_common_data.affinity;
                else
                        irqd_clear(&desc->irq_data, IRQD_AFFINITY_SET);
        }
@@ -829,8 +829,8 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
         * This code is triggered unconditionally. Check the affinity
         * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
         */
-       if (desc->irq_data.affinity)
-               cpumask_copy(mask, desc->irq_data.affinity);
+       if (desc->irq_common_data.affinity)
+               cpumask_copy(mask, desc->irq_common_data.affinity);
        else
                valid = false;
        raw_spin_unlock_irq(&desc->lock);
index 0e97c142ce402b0492c876b909c40ac10d40c779..e3a8c9577ba641c38747a0925a7896eca7ef4d79 100644 (file)
@@ -39,7 +39,7 @@ static struct proc_dir_entry *root_irq_dir;
 static int show_irq_affinity(int type, struct seq_file *m, void *v)
 {
        struct irq_desc *desc = irq_to_desc((long)m->private);
-       const struct cpumask *mask = desc->irq_data.affinity;
+       const struct cpumask *mask = desc->irq_common_data.affinity;
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
        if (irqd_is_setaffinity_pending(&desc->irq_data))
index dd95f44f99b226d8f44f3a2a3ba5284e2f6ecdf5..b86886beee4f2e21c0f3dacf0aed0370ce79ebcc 100644 (file)
@@ -38,7 +38,7 @@ static void resend_irqs(unsigned long arg)
                clear_bit(irq, irqs_resend);
                desc = irq_to_desc(irq);
                local_irq_disable();
-               desc->handle_irq(irq, desc);
+               desc->handle_irq(desc);
                local_irq_enable();
        }
 }
index 337c8818541d339aac3fd1e3e6af32dac6dff4c9..87e9ce6a63c5d0e78a17977e2e9271ffaf0bb946 100644 (file)
@@ -289,7 +289,7 @@ void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val)
        if (pv_enabled())
                goto queue;
 
-       if (virt_queued_spin_lock(lock))
+       if (virt_spin_lock(lock))
                return;
 
        /*
index 3595403921bd5be10c3e5e591bf04916e654423d..2f9c9288481779c309f31c19dc3b74831ef70b3d 100644 (file)
@@ -621,18 +621,21 @@ int get_nohz_timer_target(void)
        int i, cpu = smp_processor_id();
        struct sched_domain *sd;
 
-       if (!idle_cpu(cpu))
+       if (!idle_cpu(cpu) && is_housekeeping_cpu(cpu))
                return cpu;
 
        rcu_read_lock();
        for_each_domain(cpu, sd) {
                for_each_cpu(i, sched_domain_span(sd)) {
-                       if (!idle_cpu(i)) {
+                       if (!idle_cpu(i) && is_housekeeping_cpu(cpu)) {
                                cpu = i;
                                goto unlock;
                        }
                }
        }
+
+       if (!is_housekeeping_cpu(cpu))
+               cpu = housekeeping_any_cpu();
 unlock:
        rcu_read_unlock();
        return cpu;
@@ -2666,13 +2669,20 @@ unsigned long nr_running(void)
 
 /*
  * Check if only the current task is running on the cpu.
+ *
+ * Caution: this function does not check that the caller has disabled
+ * preemption, thus the result might have a time-of-check-to-time-of-use
+ * race.  The caller is responsible to use it correctly, for example:
+ *
+ * - from a non-preemptable section (of course)
+ *
+ * - from a thread that is bound to a single CPU
+ *
+ * - in a loop with very short iterations (e.g. a polling loop)
  */
 bool single_task_running(void)
 {
-       if (cpu_rq(smp_processor_id())->nr_running == 1)
-               return true;
-       else
-               return false;
+       return raw_rq()->nr_running == 1;
 }
 EXPORT_SYMBOL(single_task_running);
 
@@ -5178,24 +5188,47 @@ static void migrate_tasks(struct rq *dead_rq)
                        break;
 
                /*
-                * Ensure rq->lock covers the entire task selection
-                * until the migration.
+                * pick_next_task assumes pinned rq->lock.
                 */
                lockdep_pin_lock(&rq->lock);
                next = pick_next_task(rq, &fake_task);
                BUG_ON(!next);
                next->sched_class->put_prev_task(rq, next);
 
+               /*
+                * Rules for changing task_struct::cpus_allowed are holding
+                * both pi_lock and rq->lock, such that holding either
+                * stabilizes the mask.
+                *
+                * Drop rq->lock is not quite as disastrous as it usually is
+                * because !cpu_active at this point, which means load-balance
+                * will not interfere. Also, stop-machine.
+                */
+               lockdep_unpin_lock(&rq->lock);
+               raw_spin_unlock(&rq->lock);
+               raw_spin_lock(&next->pi_lock);
+               raw_spin_lock(&rq->lock);
+
+               /*
+                * Since we're inside stop-machine, _nothing_ should have
+                * changed the task, WARN if weird stuff happened, because in
+                * that case the above rq->lock drop is a fail too.
+                */
+               if (WARN_ON(task_rq(next) != rq || !task_on_rq_queued(next))) {
+                       raw_spin_unlock(&next->pi_lock);
+                       continue;
+               }
+
                /* Find suitable destination for @next, with force if needed. */
                dest_cpu = select_fallback_rq(dead_rq->cpu, next);
 
-               lockdep_unpin_lock(&rq->lock);
                rq = __migrate_task(rq, next, dest_cpu);
                if (rq != dead_rq) {
                        raw_spin_unlock(&rq->lock);
                        rq = dead_rq;
                        raw_spin_lock(&rq->lock);
                }
+               raw_spin_unlock(&next->pi_lock);
        }
 
        rq->stop = stop;
index 50eb107f119877ab0762bb671a69cf9c0cd418bc..a9b76a40319e86b5d545621d274c262bc69c7c70 100644 (file)
@@ -97,20 +97,6 @@ EXPORT_SYMBOL_GPL(clockevent_delta2ns);
 static int __clockevents_switch_state(struct clock_event_device *dev,
                                      enum clock_event_state state)
 {
-       /* Transition with legacy set_mode() callback */
-       if (dev->set_mode) {
-               /* Legacy callback doesn't support new modes */
-               if (state > CLOCK_EVT_STATE_ONESHOT)
-                       return -ENOSYS;
-               /*
-                * 'clock_event_state' and 'clock_event_mode' have 1-to-1
-                * mapping until *_ONESHOT, and so a simple cast will work.
-                */
-               dev->set_mode((enum clock_event_mode)state, dev);
-               dev->mode = (enum clock_event_mode)state;
-               return 0;
-       }
-
        if (dev->features & CLOCK_EVT_FEAT_DUMMY)
                return 0;
 
@@ -204,12 +190,8 @@ int clockevents_tick_resume(struct clock_event_device *dev)
 {
        int ret = 0;
 
-       if (dev->set_mode) {
-               dev->set_mode(CLOCK_EVT_MODE_RESUME, dev);
-               dev->mode = CLOCK_EVT_MODE_RESUME;
-       } else if (dev->tick_resume) {
+       if (dev->tick_resume)
                ret = dev->tick_resume(dev);
-       }
 
        return ret;
 }
@@ -460,26 +442,6 @@ int clockevents_unbind_device(struct clock_event_device *ced, int cpu)
 }
 EXPORT_SYMBOL_GPL(clockevents_unbind_device);
 
-/* Sanity check of state transition callbacks */
-static int clockevents_sanity_check(struct clock_event_device *dev)
-{
-       /* Legacy set_mode() callback */
-       if (dev->set_mode) {
-               /* We shouldn't be supporting new modes now */
-               WARN_ON(dev->set_state_periodic || dev->set_state_oneshot ||
-                       dev->set_state_shutdown || dev->tick_resume ||
-                       dev->set_state_oneshot_stopped);
-
-               BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
-               return 0;
-       }
-
-       if (dev->features & CLOCK_EVT_FEAT_DUMMY)
-               return 0;
-
-       return 0;
-}
-
 /**
  * clockevents_register_device - register a clock event device
  * @dev:       device to register
@@ -488,8 +450,6 @@ void clockevents_register_device(struct clock_event_device *dev)
 {
        unsigned long flags;
 
-       BUG_ON(clockevents_sanity_check(dev));
-
        /* Initialize state to DETACHED */
        clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED);
 
index d11c55b6ab7db3585d449ac2a9a5c55ad4a0dd12..4fcd99e12aa01ce3ce0fa24fb219d644a68417a3 100644 (file)
@@ -398,7 +398,6 @@ void tick_shutdown(unsigned int cpu)
                 * the set mode function!
                 */
                clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED);
-               dev->mode = CLOCK_EVT_MODE_UNUSED;
                clockevents_exchange_device(dev, NULL);
                dev->event_handler = clockevents_handle_noop;
                td->evtdev = NULL;
index 3319e16f31e58ed69534ab2fa7e5cd05d7b90d8f..7c7ec45159834a1b25576fbed037c9951f3c076f 100644 (file)
@@ -290,16 +290,17 @@ static int __init tick_nohz_full_setup(char *str)
 __setup("nohz_full=", tick_nohz_full_setup);
 
 static int tick_nohz_cpu_down_callback(struct notifier_block *nfb,
-                                                unsigned long action,
-                                                void *hcpu)
+                                      unsigned long action,
+                                      void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
 
        switch (action & ~CPU_TASKS_FROZEN) {
        case CPU_DOWN_PREPARE:
                /*
-                * If we handle the timekeeping duty for full dynticks CPUs,
-                * we can't safely shutdown that CPU.
+                * The boot CPU handles housekeeping duty (unbound timers,
+                * workqueues, timekeeping, ...) on behalf of full dynticks
+                * CPUs. It must remain online when nohz full is enabled.
                 */
                if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
                        return NOTIFY_BAD;
@@ -370,6 +371,12 @@ void __init tick_nohz_init(void)
        cpu_notifier(tick_nohz_cpu_down_callback, 0);
        pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n",
                cpumask_pr_args(tick_nohz_full_mask));
+
+       /*
+        * We need at least one CPU to handle housekeeping work such
+        * as timekeeping, unbound timers, workqueues, ...
+        */
+       WARN_ON_ONCE(cpumask_empty(housekeeping_mask));
 }
 #endif
 
index f6ee2e6b6f5dcd53a451caf2a9dc83278df481c6..3739ac6aa47355e7234cf0ee2fc60ebc3adce979 100644 (file)
@@ -1614,7 +1614,7 @@ static __always_inline void timekeeping_freqadjust(struct timekeeper *tk,
        negative = (tick_error < 0);
 
        /* Sort out the magnitude of the correction */
-       tick_error = abs(tick_error);
+       tick_error = abs64(tick_error);
        for (adj = 0; tick_error > interval; adj++)
                tick_error >>= 1;
 
index 129c96033e466cea9e804cb2136348f6eb335e7c..f75e35b6014900da71ffa438a507c34f19e36e3a 100644 (file)
@@ -225,7 +225,7 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
                   (unsigned long long) dev->min_delta_ns);
        SEQ_printf(m, " mult:           %u\n", dev->mult);
        SEQ_printf(m, " shift:          %u\n", dev->shift);
-       SEQ_printf(m, " mode:           %d\n", dev->mode);
+       SEQ_printf(m, " mode:           %d\n", clockevent_get_state(dev));
        SEQ_printf(m, " next_event:     %Ld nsecs\n",
                   (unsigned long long) ktime_to_ns(dev->next_event));
 
@@ -233,40 +233,34 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
        print_name_offset(m, dev->set_next_event);
        SEQ_printf(m, "\n");
 
-       if (dev->set_mode) {
-               SEQ_printf(m, " set_mode:       ");
-               print_name_offset(m, dev->set_mode);
+       if (dev->set_state_shutdown) {
+               SEQ_printf(m, " shutdown: ");
+               print_name_offset(m, dev->set_state_shutdown);
                SEQ_printf(m, "\n");
-       } else {
-               if (dev->set_state_shutdown) {
-                       SEQ_printf(m, " shutdown: ");
-                       print_name_offset(m, dev->set_state_shutdown);
-                       SEQ_printf(m, "\n");
-               }
+       }
 
-               if (dev->set_state_periodic) {
-                       SEQ_printf(m, " periodic: ");
-                       print_name_offset(m, dev->set_state_periodic);
-                       SEQ_printf(m, "\n");
-               }
+       if (dev->set_state_periodic) {
+               SEQ_printf(m, " periodic: ");
+               print_name_offset(m, dev->set_state_periodic);
+               SEQ_printf(m, "\n");
+       }
 
-               if (dev->set_state_oneshot) {
-                       SEQ_printf(m, " oneshot:  ");
-                       print_name_offset(m, dev->set_state_oneshot);
-                       SEQ_printf(m, "\n");
-               }
+       if (dev->set_state_oneshot) {
+               SEQ_printf(m, " oneshot:  ");
+               print_name_offset(m, dev->set_state_oneshot);
+               SEQ_printf(m, "\n");
+       }
 
-               if (dev->set_state_oneshot_stopped) {
-                       SEQ_printf(m, " oneshot stopped: ");
-                       print_name_offset(m, dev->set_state_oneshot_stopped);
-                       SEQ_printf(m, "\n");
-               }
+       if (dev->set_state_oneshot_stopped) {
+               SEQ_printf(m, " oneshot stopped: ");
+               print_name_offset(m, dev->set_state_oneshot_stopped);
+               SEQ_printf(m, "\n");
+       }
 
-               if (dev->tick_resume) {
-                       SEQ_printf(m, " resume:   ");
-                       print_name_offset(m, dev->tick_resume);
-                       SEQ_printf(m, "\n");
-               }
+       if (dev->tick_resume) {
+               SEQ_printf(m, " resume:   ");
+               print_name_offset(m, dev->tick_resume);
+               SEQ_printf(m, "\n");
        }
 
        SEQ_printf(m, " event_handler:  ");
index 54036ce2e2dd0a4ab042c9c19b2d54fa41a34115..5939f63d90cde79fe1e09814765539a7e43a3c28 100644 (file)
@@ -59,7 +59,11 @@ void string_get_size(u64 size, u64 blk_size, const enum string_size_units units,
        }
 
        exp = divisor[units] / (u32)blk_size;
-       if (size >= exp) {
+       /*
+        * size must be strictly greater than exp here to ensure that remainder
+        * is greater than divisor[units] coming out of the if below.
+        */
+       if (size > exp) {
                remainder = do_div(size, divisor[units]);
                remainder *= blk_size;
                i++;
index 7b28e9cdf1c7686428fe49802fced44088043555..8da211411b57f1b0db116d8d67401bae30628ec8 100644 (file)
@@ -135,12 +135,11 @@ static __always_inline bool memory_is_poisoned_16(unsigned long addr)
 
        if (unlikely(*shadow_addr)) {
                u16 shadow_first_bytes = *(u16 *)shadow_addr;
-               s8 last_byte = (addr + 15) & KASAN_SHADOW_MASK;
 
                if (unlikely(shadow_first_bytes))
                        return true;
 
-               if (likely(!last_byte))
+               if (likely(IS_ALIGNED(addr, 8)))
                        return false;
 
                return memory_is_poisoned_1(addr + 15);
index 971dd2cb77d227b792f29f0f0cdc5d3d8aa16634..c739d6db7193e854dc2e4495bcaf9ed4678e1e6b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -612,8 +612,6 @@ static unsigned long count_vma_pages_range(struct mm_struct *mm,
 void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
                struct rb_node **rb_link, struct rb_node *rb_parent)
 {
-       WARN_ONCE(vma->vm_file && !vma->vm_ops, "missing vma->vm_ops");
-
        /* Update tracking information for the gap following the new vma. */
        if (vma->vm_next)
                vma_gap_update(vma->vm_next);
@@ -1638,12 +1636,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
                 */
                WARN_ON_ONCE(addr != vma->vm_start);
 
-               /* All file mapping must have ->vm_ops set */
-               if (!vma->vm_ops) {
-                       static const struct vm_operations_struct dummy_ops = {};
-                       vma->vm_ops = &dummy_ops;
-               }
-
                addr = vma->vm_start;
                vm_flags = vma->vm_flags;
        } else if (vm_flags & VM_SHARED) {
index 525f454f753185b216e1dbd3d2bb4d9e89c1dac5..b9b0e3b5da49f84d9fb1775e75aca83f55e80b2d 100644 (file)
@@ -1353,11 +1353,12 @@ static void prepare_write_keepalive(struct ceph_connection *con)
        dout("prepare_write_keepalive %p\n", con);
        con_out_kvec_reset(con);
        if (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2) {
-               struct timespec ts = CURRENT_TIME;
-               struct ceph_timespec ceph_ts;
-               ceph_encode_timespec(&ceph_ts, &ts);
+               struct timespec now = CURRENT_TIME;
+
                con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2);
-               con_out_kvec_add(con, sizeof(ceph_ts), &ceph_ts);
+               ceph_encode_timespec(&con->out_temp_keepalive2, &now);
+               con_out_kvec_add(con, sizeof(con->out_temp_keepalive2),
+                                &con->out_temp_keepalive2);
        } else {
                con_out_kvec_add(con, sizeof(tag_keepalive), &tag_keepalive);
        }
index 10d23ca9f6176c5ec9ea8ac71a909d3c39acee26..6ce5945a0b892e79f2e98e645615cbc37b79f4d1 100644 (file)
@@ -1,15 +1,15 @@
 /* Extract X.509 certificate in DER form from PKCS#11 or PEM.
  *
- * Copyright Â© 2014 Red Hat, Inc. All Rights Reserved.
- * Copyright Â© 2015 Intel Corporation.
+ * Copyright Â© 2014-2015 Red Hat, Inc. All Rights Reserved.
+ * Copyright Â© 2015      Intel Corporation.
  *
  * Authors: David Howells <dhowells@redhat.com>
  *          David Woodhouse <dwmw2@infradead.org>
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the licence, or (at your option) any later version.
  */
 #define _GNU_SOURCE
 #include <stdio.h>
index 058bba3103e2707911cd493f70a1b39015f9d697..c3899ca4811cc2e0add94f8f31e31b93be432fff 100755 (executable)
@@ -1,12 +1,15 @@
 /* Sign a module file using the given key.
  *
- * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
+ * Copyright Â© 2014-2015 Red Hat, Inc. All Rights Reserved.
+ * Copyright Â© 2015      Intel Corporation.
+ *
+ * Authors: David Howells <dhowells@redhat.com>
+ *          David Woodhouse <dwmw2@infradead.org>
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the licence, or (at your option) any later version.
  */
 #define _GNU_SOURCE
 #include <stdio.h>
index 73455089feef3a11af0d88880fa6423070c50ea5..03c1652c9a1f593669b6d9e3a0bd2e65e47da239 100644 (file)
@@ -401,7 +401,7 @@ static bool verify_new_ex(struct dev_cgroup *dev_cgroup,
        bool match = false;
 
        RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&
-                        lockdep_is_held(&devcgroup_mutex),
+                        !lockdep_is_held(&devcgroup_mutex),
                         "device_cgroup:verify_new_ex called without proper synchronization");
 
        if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
index 885683a3b0bdf084985328151d35308d4ebb5afb..e0406211716b003daae37efbc8cdfd73213b31f3 100644 (file)
@@ -9,6 +9,14 @@ menuconfig SND_ARM
          Drivers that are implemented on ASoC can be found in
          "ALSA for SoC audio support" section.
 
+config SND_PXA2XX_LIB
+       tristate
+       select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
+       select SND_DMAENGINE_PCM
+
+config SND_PXA2XX_LIB_AC97
+       bool
+
 if SND_ARM
 
 config SND_ARMAACI
@@ -21,13 +29,6 @@ config SND_PXA2XX_PCM
        tristate
        select SND_PCM
 
-config SND_PXA2XX_LIB
-       tristate
-       select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
-
-config SND_PXA2XX_LIB_AC97
-       bool
-
 config SND_PXA2XX_AC97
        tristate "AC97 driver for the Intel PXA2xx chip"
        depends on ARCH_PXA
index aa354e1c6ff7ce3df7ffd898682c3040817a6a8c..1933bcd46cca043d68db0ecc771124da37416908 100644 (file)
@@ -176,6 +176,7 @@ static const struct of_device_id atmel_asoc_wm8904_dt_ids[] = {
        { .compatible = "atmel,asoc-wm8904", },
        { }
 };
+MODULE_DEVICE_TABLE(of, atmel_asoc_wm8904_dt_ids);
 #endif
 
 static struct platform_driver atmel_asoc_wm8904_driver = {
index 452f404abfd283abe56caaae06de856a47d2b1d9..e97c32798e98a066dba2eaf47883584f7eb04dad 100644 (file)
@@ -38,14 +38,7 @@ static int db1000_audio_probe(struct platform_device *pdev)
 {
        struct snd_soc_card *card = &db1000_ac97;
        card->dev = &pdev->dev;
-       return snd_soc_register_card(card);
-}
-
-static int db1000_audio_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-       snd_soc_unregister_card(card);
-       return 0;
+       return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static struct platform_driver db1000_audio_driver = {
@@ -54,7 +47,6 @@ static struct platform_driver db1000_audio_driver = {
                .pm     = &snd_soc_pm_ops,
        },
        .probe          = db1000_audio_probe,
-       .remove         = db1000_audio_remove,
 };
 
 module_platform_driver(db1000_audio_driver);
index 58c3164802b8ceda545e1469f557a814702694be..638ca0ba7e6efcb4f891564af24f4d8a570b927f 100644 (file)
@@ -174,14 +174,7 @@ static int db1200_audio_probe(struct platform_device *pdev)
 
        card = db1200_cards[pid->driver_data];
        card->dev = &pdev->dev;
-       return snd_soc_register_card(card);
-}
-
-static int db1200_audio_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-       snd_soc_unregister_card(card);
-       return 0;
+       return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static struct platform_driver db1200_audio_driver = {
@@ -191,7 +184,6 @@ static struct platform_driver db1200_audio_driver = {
        },
        .id_table       = db1200_pids,
        .probe          = db1200_audio_probe,
-       .remove         = db1200_audio_remove,
 };
 
 module_platform_driver(db1200_audio_driver);
index 38e853add96ecb4236f50225e6089401a0740e22..0bf9d62b91a07132fa1af21f902bfa257cdfee4b 100644 (file)
@@ -296,7 +296,6 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 {
        struct resource *iores, *dmares;
        unsigned long sel;
-       int ret;
        struct au1xpsc_audio_data *wd;
 
        wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data),
index 5bf1501e5e3c4833cbebf2f5afe4b8fde1cc216f..864df2616e109ae4e2bb70793e6231abe58fd1bc 100644 (file)
@@ -87,27 +87,18 @@ static int bf5xx_ad1836_driver_probe(struct platform_device *pdev)
        card->dev = &pdev->dev;
        platform_set_drvdata(pdev, card);
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret)
                dev_err(&pdev->dev, "Failed to register card\n");
        return ret;
 }
 
-static int bf5xx_ad1836_driver_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static struct platform_driver bf5xx_ad1836_driver = {
        .driver = {
                .name = "bfin-snd-ad1836",
                .pm = &snd_soc_pm_ops,
        },
        .probe = bf5xx_ad1836_driver_probe,
-       .remove = bf5xx_ad1836_driver_remove,
 };
 module_platform_driver(bf5xx_ad1836_driver);
 
index 523baf5820d737113e3ba17536a788026cf62137..72ac789884262bbdc41e63adfcabe1dee3911814 100644 (file)
@@ -154,16 +154,7 @@ static int bfin_eval_adau1373_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       return snd_soc_register_card(&bfin_eval_adau1373);
-}
-
-static int bfin_eval_adau1373_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-
-       return 0;
+       return devm_snd_soc_register_card(&pdev->dev, &bfin_eval_adau1373);
 }
 
 static struct platform_driver bfin_eval_adau1373_driver = {
@@ -172,7 +163,6 @@ static struct platform_driver bfin_eval_adau1373_driver = {
                .pm = &snd_soc_pm_ops,
        },
        .probe = bfin_eval_adau1373_probe,
-       .remove = bfin_eval_adau1373_remove,
 };
 
 module_platform_driver(bfin_eval_adau1373_driver);
index f9e926dfd4ef735af9e84f9e35363a1670e61421..5c67f72cf9a95e521eb070e5e9b1c9a0835873c8 100644 (file)
@@ -94,16 +94,7 @@ static int bfin_eval_adau1701_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       return snd_soc_register_card(&bfin_eval_adau1701);
-}
-
-static int bfin_eval_adau1701_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-
-       return 0;
+       return devm_snd_soc_register_card(&pdev->dev, &bfin_eval_adau1701);
 }
 
 static struct platform_driver bfin_eval_adau1701_driver = {
@@ -112,7 +103,6 @@ static struct platform_driver bfin_eval_adau1701_driver = {
                .pm = &snd_soc_pm_ops,
        },
        .probe = bfin_eval_adau1701_probe,
-       .remove = bfin_eval_adau1701_remove,
 };
 
 module_platform_driver(bfin_eval_adau1701_driver);
index 27eee66afdb26536aeb41d50e1b29e542bf6b0c5..1037477d10b2f962cf6d7ea13844d01539bdeafb 100644 (file)
@@ -119,16 +119,7 @@ static int bfin_eval_adav80x_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       return snd_soc_register_card(&bfin_eval_adav80x);
-}
-
-static int bfin_eval_adav80x_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-
-       return 0;
+       return devm_snd_soc_register_card(&pdev->dev, &bfin_eval_adav80x);
 }
 
 static const struct platform_device_id bfin_eval_adav80x_ids[] = {
@@ -144,7 +135,6 @@ static struct platform_driver bfin_eval_adav80x_driver = {
                .pm = &snd_soc_pm_ops,
        },
        .probe = bfin_eval_adav80x_probe,
-       .remove = bfin_eval_adav80x_remove,
        .id_table = bfin_eval_adav80x_ids,
 };
 
index 0c9733ecd17f29a040ec3f2a4c7dfab8c59007e7..70e5a75901aa20fbde390478e60de4c01ab3df2f 100644 (file)
@@ -36,6 +36,7 @@ config SND_SOC_ALL_CODECS
        select SND_SOC_AK4104 if SPI_MASTER
        select SND_SOC_AK4535 if I2C
        select SND_SOC_AK4554
+       select SND_SOC_AK4613 if I2C
        select SND_SOC_AK4641 if I2C
        select SND_SOC_AK4642 if I2C
        select SND_SOC_AK4671 if I2C
@@ -79,7 +80,6 @@ config SND_SOC_ALL_CODECS
        select SND_SOC_MAX9877 if I2C
        select SND_SOC_MC13783 if MFD_MC13XXX
        select SND_SOC_ML26124 if I2C
-       select SND_SOC_HDMI_CODEC
        select SND_SOC_PCM1681 if I2C
        select SND_SOC_PCM1792A if SPI_MASTER
        select SND_SOC_PCM3008
@@ -319,6 +319,10 @@ config SND_SOC_AK4535
 config SND_SOC_AK4554
        tristate "AKM AK4554 CODEC"
 
+config SND_SOC_AK4613
+       tristate "AKM AK4613 CODEC"
+       depends on I2C
+
 config SND_SOC_AK4641
        tristate
 
@@ -442,9 +446,6 @@ config SND_SOC_BT_SCO
 config SND_SOC_DMIC
        tristate
 
-config SND_SOC_HDMI_CODEC
-       tristate "HDMI stub CODEC"
-
 config SND_SOC_ES8328
        tristate "Everest Semi ES8328 CODEC"
 
index 4a32077954aee6aee2966ced2573991d1673b02a..be1491acb6aea0aeff3df80e7f039d36eef295c4 100644 (file)
@@ -26,6 +26,7 @@ snd-soc-ads117x-objs := ads117x.o
 snd-soc-ak4104-objs := ak4104.o
 snd-soc-ak4535-objs := ak4535.o
 snd-soc-ak4554-objs := ak4554.o
+snd-soc-ak4613-objs := ak4613.o
 snd-soc-ak4641-objs := ak4641.o
 snd-soc-ak4642-objs := ak4642.o
 snd-soc-ak4671-objs := ak4671.o
@@ -72,7 +73,6 @@ snd-soc-max98925-objs := max98925.o
 snd-soc-max9850-objs := max9850.o
 snd-soc-mc13783-objs := mc13783.o
 snd-soc-ml26124-objs := ml26124.o
-snd-soc-hdmi-codec-objs := hdmi.o
 snd-soc-pcm1681-objs := pcm1681.o
 snd-soc-pcm1792a-codec-objs := pcm1792a.o
 snd-soc-pcm3008-objs := pcm3008.o
@@ -216,6 +216,7 @@ obj-$(CONFIG_SND_SOC_ADS117X)       += snd-soc-ads117x.o
 obj-$(CONFIG_SND_SOC_AK4104)   += snd-soc-ak4104.o
 obj-$(CONFIG_SND_SOC_AK4535)   += snd-soc-ak4535.o
 obj-$(CONFIG_SND_SOC_AK4554)   += snd-soc-ak4554.o
+obj-$(CONFIG_SND_SOC_AK4613)   += snd-soc-ak4613.o
 obj-$(CONFIG_SND_SOC_AK4641)   += snd-soc-ak4641.o
 obj-$(CONFIG_SND_SOC_AK4642)   += snd-soc-ak4642.o
 obj-$(CONFIG_SND_SOC_AK4671)   += snd-soc-ak4671.o
@@ -264,7 +265,6 @@ obj-$(CONFIG_SND_SOC_MAX98925)      += snd-soc-max98925.o
 obj-$(CONFIG_SND_SOC_MAX9850)  += snd-soc-max9850.o
 obj-$(CONFIG_SND_SOC_MC13783)  += snd-soc-mc13783.o
 obj-$(CONFIG_SND_SOC_ML26124)  += snd-soc-ml26124.o
-obj-$(CONFIG_SND_SOC_HDMI_CODEC) += snd-soc-hdmi-codec.o
 obj-$(CONFIG_SND_SOC_PCM1681)  += snd-soc-pcm1681.o
 obj-$(CONFIG_SND_SOC_PCM1792A) += snd-soc-pcm1792a-codec.o
 obj-$(CONFIG_SND_SOC_PCM3008)  += snd-soc-pcm3008.o
diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
new file mode 100644 (file)
index 0000000..07a2664
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ * ak4613.c  --  Asahi Kasei ALSA Soc Audio driver
+ *
+ * Copyright (C) 2015 Renesas Electronics Corporation
+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * Based on ak4642.c by Kuninori Morimoto
+ * Based on wm8731.c by Richard Purdie
+ * Based on ak4535.c by Richard Purdie
+ * Based on wm8753.c by Liam Girdwood
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/clk.h>
+#include <linux/i2c.h>
+#include <linux/slab.h>
+#include <linux/of_device.h>
+#include <linux/module.h>
+#include <linux/regmap.h>
+#include <sound/soc.h>
+#include <sound/pcm_params.h>
+#include <sound/tlv.h>
+
+#define PW_MGMT1       0x00 /* Power Management 1 */
+#define PW_MGMT2       0x01 /* Power Management 2 */
+#define PW_MGMT3       0x02 /* Power Management 3 */
+#define CTRL1          0x03 /* Control 1 */
+#define CTRL2          0x04 /* Control 2 */
+#define DEMP1          0x05 /* De-emphasis1 */
+#define DEMP2          0x06 /* De-emphasis2 */
+#define OFD            0x07 /* Overflow Detect */
+#define ZRD            0x08 /* Zero Detect */
+#define ICTRL          0x09 /* Input Control */
+#define OCTRL          0x0a /* Output Control */
+#define LOUT1          0x0b /* LOUT1 Volume Control */
+#define ROUT1          0x0c /* ROUT1 Volume Control */
+#define LOUT2          0x0d /* LOUT2 Volume Control */
+#define ROUT2          0x0e /* ROUT2 Volume Control */
+#define LOUT3          0x0f /* LOUT3 Volume Control */
+#define ROUT3          0x10 /* ROUT3 Volume Control */
+#define LOUT4          0x11 /* LOUT4 Volume Control */
+#define ROUT4          0x12 /* ROUT4 Volume Control */
+#define LOUT5          0x13 /* LOUT5 Volume Control */
+#define ROUT5          0x14 /* ROUT5 Volume Control */
+#define LOUT6          0x15 /* LOUT6 Volume Control */
+#define ROUT6          0x16 /* ROUT6 Volume Control */
+
+/* PW_MGMT1 */
+#define RSTN           BIT(0)
+#define PMDAC          BIT(1)
+#define PMADC          BIT(2)
+#define PMVR           BIT(3)
+
+/* PW_MGMT2 */
+#define PMAD_ALL       0x7
+
+/* PW_MGMT3 */
+#define PMDA_ALL       0x3f
+
+/* CTRL1 */
+#define DIF0           BIT(3)
+#define DIF1           BIT(4)
+#define DIF2           BIT(5)
+#define TDM0           BIT(6)
+#define TDM1           BIT(7)
+#define NO_FMT         (0xff)
+#define FMT_MASK       (0xf8)
+
+/* CTRL2 */
+#define DFS_NORMAL_SPEED       (0 << 2)
+#define DFS_DOUBLE_SPEED       (1 << 2)
+#define DFS_QUAD_SPEED         (2 << 2)
+
+struct ak4613_priv {
+       struct mutex lock;
+
+       unsigned int fmt;
+       u8 fmt_ctrl;
+       int cnt;
+};
+
+struct ak4613_formats {
+       unsigned int width;
+       unsigned int fmt;
+};
+
+struct ak4613_interface {
+       struct ak4613_formats capture;
+       struct ak4613_formats playback;
+};
+
+/*
+ * Playback Volume
+ *
+ * max : 0x00 : 0 dB
+ *       ( 0.5 dB step )
+ * min : 0xFE : -127.0 dB
+ * mute: 0xFF
+ */
+static const DECLARE_TLV_DB_SCALE(out_tlv, -12750, 50, 1);
+
+static const struct snd_kcontrol_new ak4613_snd_controls[] = {
+       SOC_DOUBLE_R_TLV("Digital Playback Volume1", LOUT1, ROUT1,
+                        0, 0xFF, 1, out_tlv),
+       SOC_DOUBLE_R_TLV("Digital Playback Volume2", LOUT2, ROUT2,
+                        0, 0xFF, 1, out_tlv),
+       SOC_DOUBLE_R_TLV("Digital Playback Volume3", LOUT3, ROUT3,
+                        0, 0xFF, 1, out_tlv),
+       SOC_DOUBLE_R_TLV("Digital Playback Volume4", LOUT4, ROUT4,
+                        0, 0xFF, 1, out_tlv),
+       SOC_DOUBLE_R_TLV("Digital Playback Volume5", LOUT5, ROUT5,
+                        0, 0xFF, 1, out_tlv),
+       SOC_DOUBLE_R_TLV("Digital Playback Volume6", LOUT6, ROUT6,
+                        0, 0xFF, 1, out_tlv),
+};
+
+static const struct reg_default ak4613_reg[] = {
+       { 0x0,  0x0f }, { 0x1,  0x07 }, { 0x2,  0x3f }, { 0x3,  0x20 },
+       { 0x4,  0x20 }, { 0x5,  0x55 }, { 0x6,  0x05 }, { 0x7,  0x07 },
+       { 0x8,  0x0f }, { 0x9,  0x07 }, { 0xa,  0x3f }, { 0xb,  0x00 },
+       { 0xc,  0x00 }, { 0xd,  0x00 }, { 0xe,  0x00 }, { 0xf,  0x00 },
+       { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 },
+       { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 },
+};
+
+#define AUDIO_IFACE_IDX_TO_VAL(i) (i << 3)
+#define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt }
+static const struct ak4613_interface ak4613_iface[] = {
+       /* capture */                           /* playback */
+       [0] = { AUDIO_IFACE(24, LEFT_J),        AUDIO_IFACE(16, RIGHT_J) },
+       [1] = { AUDIO_IFACE(24, LEFT_J),        AUDIO_IFACE(20, RIGHT_J) },
+       [2] = { AUDIO_IFACE(24, LEFT_J),        AUDIO_IFACE(24, RIGHT_J) },
+       [3] = { AUDIO_IFACE(24, LEFT_J),        AUDIO_IFACE(24, LEFT_J) },
+       [4] = { AUDIO_IFACE(24, I2S),           AUDIO_IFACE(24, I2S) },
+};
+
+static const struct regmap_config ak4613_regmap_cfg = {
+       .reg_bits               = 8,
+       .val_bits               = 8,
+       .max_register           = 0x16,
+       .reg_defaults           = ak4613_reg,
+       .num_reg_defaults       = ARRAY_SIZE(ak4613_reg),
+};
+
+static const struct of_device_id ak4613_of_match[] = {
+       { .compatible = "asahi-kasei,ak4613",   .data = &ak4613_regmap_cfg },
+       {},
+};
+MODULE_DEVICE_TABLE(of, ak4613_of_match);
+
+static const struct i2c_device_id ak4613_i2c_id[] = {
+       { "ak4613", (kernel_ulong_t)&ak4613_regmap_cfg },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, ak4613_i2c_id);
+
+static const struct snd_soc_dapm_widget ak4613_dapm_widgets[] = {
+
+       /* Outputs */
+       SND_SOC_DAPM_OUTPUT("LOUT1"),
+       SND_SOC_DAPM_OUTPUT("LOUT2"),
+       SND_SOC_DAPM_OUTPUT("LOUT3"),
+       SND_SOC_DAPM_OUTPUT("LOUT4"),
+       SND_SOC_DAPM_OUTPUT("LOUT5"),
+       SND_SOC_DAPM_OUTPUT("LOUT6"),
+
+       SND_SOC_DAPM_OUTPUT("ROUT1"),
+       SND_SOC_DAPM_OUTPUT("ROUT2"),
+       SND_SOC_DAPM_OUTPUT("ROUT3"),
+       SND_SOC_DAPM_OUTPUT("ROUT4"),
+       SND_SOC_DAPM_OUTPUT("ROUT5"),
+       SND_SOC_DAPM_OUTPUT("ROUT6"),
+
+       /* Inputs */
+       SND_SOC_DAPM_INPUT("LIN1"),
+       SND_SOC_DAPM_INPUT("LIN2"),
+
+       SND_SOC_DAPM_INPUT("RIN1"),
+       SND_SOC_DAPM_INPUT("RIN2"),
+
+       /* DAC */
+       SND_SOC_DAPM_DAC("DAC1", NULL, PW_MGMT3, 0, 0),
+       SND_SOC_DAPM_DAC("DAC2", NULL, PW_MGMT3, 1, 0),
+       SND_SOC_DAPM_DAC("DAC3", NULL, PW_MGMT3, 2, 0),
+       SND_SOC_DAPM_DAC("DAC4", NULL, PW_MGMT3, 3, 0),
+       SND_SOC_DAPM_DAC("DAC5", NULL, PW_MGMT3, 4, 0),
+       SND_SOC_DAPM_DAC("DAC6", NULL, PW_MGMT3, 5, 0),
+
+       /* ADC */
+       SND_SOC_DAPM_ADC("ADC1", NULL, PW_MGMT2, 0, 0),
+       SND_SOC_DAPM_ADC("ADC2", NULL, PW_MGMT2, 1, 0),
+};
+
+static const struct snd_soc_dapm_route ak4613_intercon[] = {
+       {"LOUT1", NULL, "DAC1"},
+       {"LOUT2", NULL, "DAC2"},
+       {"LOUT3", NULL, "DAC3"},
+       {"LOUT4", NULL, "DAC4"},
+       {"LOUT5", NULL, "DAC5"},
+       {"LOUT6", NULL, "DAC6"},
+
+       {"ROUT1", NULL, "DAC1"},
+       {"ROUT2", NULL, "DAC2"},
+       {"ROUT3", NULL, "DAC3"},
+       {"ROUT4", NULL, "DAC4"},
+       {"ROUT5", NULL, "DAC5"},
+       {"ROUT6", NULL, "DAC6"},
+
+       {"DAC1", NULL, "Playback"},
+       {"DAC2", NULL, "Playback"},
+       {"DAC3", NULL, "Playback"},
+       {"DAC4", NULL, "Playback"},
+       {"DAC5", NULL, "Playback"},
+       {"DAC6", NULL, "Playback"},
+
+       {"Capture", NULL, "ADC1"},
+       {"Capture", NULL, "ADC2"},
+
+       {"ADC1", NULL, "LIN1"},
+       {"ADC2", NULL, "LIN2"},
+
+       {"ADC1", NULL, "RIN1"},
+       {"ADC2", NULL, "RIN2"},
+};
+
+static void ak4613_dai_shutdown(struct snd_pcm_substream *substream,
+                              struct snd_soc_dai *dai)
+{
+       struct snd_soc_codec *codec = dai->codec;
+       struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
+       struct device *dev = codec->dev;
+
+       mutex_lock(&priv->lock);
+       priv->cnt--;
+       if (priv->cnt < 0) {
+               dev_err(dev, "unexpected counter error\n");
+               priv->cnt = 0;
+       }
+       if (!priv->cnt)
+               priv->fmt_ctrl = NO_FMT;
+       mutex_unlock(&priv->lock);
+}
+
+static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
+{
+       struct snd_soc_codec *codec = dai->codec;
+       struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
+
+       fmt &= SND_SOC_DAIFMT_FORMAT_MASK;
+
+       switch (fmt) {
+       case SND_SOC_DAIFMT_RIGHT_J:
+       case SND_SOC_DAIFMT_LEFT_J:
+       case SND_SOC_DAIFMT_I2S:
+               priv->fmt = fmt;
+
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
+                               struct snd_pcm_hw_params *params,
+                               struct snd_soc_dai *dai)
+{
+       struct snd_soc_codec *codec = dai->codec;
+       struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
+       const struct ak4613_formats *fmts;
+       struct device *dev = codec->dev;
+       unsigned int width = params_width(params);
+       unsigned int fmt = priv->fmt;
+       unsigned int rate;
+       int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+       int i, ret;
+       u8 fmt_ctrl, ctrl2;
+
+       rate = params_rate(params);
+       switch (rate) {
+       case 32000:
+       case 44100:
+       case 48000:
+               ctrl2 = DFS_NORMAL_SPEED;
+               break;
+       case 88200:
+       case 96000:
+               ctrl2 = DFS_DOUBLE_SPEED;
+               break;
+       case 176400:
+       case 192000:
+               ctrl2 = DFS_QUAD_SPEED;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /*
+        * FIXME
+        *
+        * It doesn't support TDM at this point
+        */
+       fmt_ctrl = NO_FMT;
+       for (i = 0; i < ARRAY_SIZE(ak4613_iface); i++) {
+               fmts = (is_play) ?      &ak4613_iface[i].playback :
+                                       &ak4613_iface[i].capture;
+
+               if (fmts->fmt != fmt)
+                       continue;
+
+               if (fmt == SND_SOC_DAIFMT_RIGHT_J) {
+                       if (fmts->width != width)
+                               continue;
+               } else {
+                       if (fmts->width < width)
+                               continue;
+               }
+
+               fmt_ctrl = AUDIO_IFACE_IDX_TO_VAL(i);
+               break;
+       }
+
+       ret = -EINVAL;
+       if (fmt_ctrl == NO_FMT)
+               goto hw_params_end;
+
+       mutex_lock(&priv->lock);
+       if ((priv->fmt_ctrl == NO_FMT) ||
+           (priv->fmt_ctrl == fmt_ctrl)) {
+               priv->fmt_ctrl = fmt_ctrl;
+               priv->cnt++;
+               ret = 0;
+       }
+       mutex_unlock(&priv->lock);
+
+       if (ret < 0)
+               goto hw_params_end;
+
+       snd_soc_update_bits(codec, CTRL1, FMT_MASK, fmt_ctrl);
+       snd_soc_write(codec, CTRL2, ctrl2);
+
+hw_params_end:
+       if (ret < 0)
+               dev_warn(dev, "unsupported data width/format combination\n");
+
+       return ret;
+}
+
+static int ak4613_set_bias_level(struct snd_soc_codec *codec,
+                                enum snd_soc_bias_level level)
+{
+       u8 mgmt1 = 0;
+
+       switch (level) {
+       case SND_SOC_BIAS_ON:
+               mgmt1 |= RSTN;
+               /* fall through */
+       case SND_SOC_BIAS_PREPARE:
+               mgmt1 |= PMADC | PMDAC;
+               /* fall through */
+       case SND_SOC_BIAS_STANDBY:
+               mgmt1 |= PMVR;
+               /* fall through */
+       case SND_SOC_BIAS_OFF:
+       default:
+               break;
+       }
+
+       snd_soc_write(codec, PW_MGMT1, mgmt1);
+
+       return 0;
+}
+
+static const struct snd_soc_dai_ops ak4613_dai_ops = {
+       .shutdown       = ak4613_dai_shutdown,
+       .set_fmt        = ak4613_dai_set_fmt,
+       .hw_params      = ak4613_dai_hw_params,
+};
+
+#define AK4613_PCM_RATE                (SNDRV_PCM_RATE_32000  |\
+                                SNDRV_PCM_RATE_44100  |\
+                                SNDRV_PCM_RATE_48000  |\
+                                SNDRV_PCM_RATE_64000  |\
+                                SNDRV_PCM_RATE_88200  |\
+                                SNDRV_PCM_RATE_96000  |\
+                                SNDRV_PCM_RATE_176400 |\
+                                SNDRV_PCM_RATE_192000)
+#define AK4613_PCM_FMTBIT      (SNDRV_PCM_FMTBIT_S16_LE |\
+                                SNDRV_PCM_FMTBIT_S24_LE)
+
+static struct snd_soc_dai_driver ak4613_dai = {
+       .name = "ak4613-hifi",
+       .playback = {
+               .stream_name    = "Playback",
+               .channels_min   = 2,
+               .channels_max   = 2,
+               .rates          = AK4613_PCM_RATE,
+               .formats        = AK4613_PCM_FMTBIT,
+       },
+       .capture = {
+               .stream_name    = "Capture",
+               .channels_min   = 2,
+               .channels_max   = 2,
+               .rates          = AK4613_PCM_RATE,
+               .formats        = AK4613_PCM_FMTBIT,
+       },
+       .ops = &ak4613_dai_ops,
+       .symmetric_rates = 1,
+};
+
+static int ak4613_resume(struct snd_soc_codec *codec)
+{
+       struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
+
+       regcache_mark_dirty(regmap);
+       return regcache_sync(regmap);
+}
+
+static struct snd_soc_codec_driver soc_codec_dev_ak4613 = {
+       .resume                 = ak4613_resume,
+       .set_bias_level         = ak4613_set_bias_level,
+       .controls               = ak4613_snd_controls,
+       .num_controls           = ARRAY_SIZE(ak4613_snd_controls),
+       .dapm_widgets           = ak4613_dapm_widgets,
+       .num_dapm_widgets       = ARRAY_SIZE(ak4613_dapm_widgets),
+       .dapm_routes            = ak4613_intercon,
+       .num_dapm_routes        = ARRAY_SIZE(ak4613_intercon),
+};
+
+static int ak4613_i2c_probe(struct i2c_client *i2c,
+                           const struct i2c_device_id *id)
+{
+       struct device *dev = &i2c->dev;
+       struct device_node *np = dev->of_node;
+       const struct regmap_config *regmap_cfg;
+       struct regmap *regmap;
+       struct ak4613_priv *priv;
+
+       regmap_cfg = NULL;
+       if (np) {
+               const struct of_device_id *of_id;
+
+               of_id = of_match_device(ak4613_of_match, dev);
+               if (of_id)
+                       regmap_cfg = of_id->data;
+       } else {
+               regmap_cfg = (const struct regmap_config *)id->driver_data;
+       }
+
+       if (!regmap_cfg)
+               return -EINVAL;
+
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       priv->fmt_ctrl          = NO_FMT;
+       priv->cnt               = 0;
+
+       mutex_init(&priv->lock);
+
+       i2c_set_clientdata(i2c, priv);
+
+       regmap = devm_regmap_init_i2c(i2c, regmap_cfg);
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
+
+       return snd_soc_register_codec(dev, &soc_codec_dev_ak4613,
+                                     &ak4613_dai, 1);
+}
+
+static int ak4613_i2c_remove(struct i2c_client *client)
+{
+       snd_soc_unregister_codec(&client->dev);
+       return 0;
+}
+
+static struct i2c_driver ak4613_i2c_driver = {
+       .driver = {
+               .name = "ak4613-codec",
+               .owner = THIS_MODULE,
+               .of_match_table = ak4613_of_match,
+       },
+       .probe          = ak4613_i2c_probe,
+       .remove         = ak4613_i2c_remove,
+       .id_table       = ak4613_i2c_id,
+};
+
+module_i2c_driver(ak4613_i2c_driver);
+
+MODULE_DESCRIPTION("Soc AK4613 driver");
+MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
+MODULE_LICENSE("GPL v2");
index 4a90143d0e907b5034d0f4caa506c97000500f71..cda27c22812a71442dd3d927088c2118aa16dc17 100644 (file)
@@ -23,6 +23,8 @@
  * AK4648 is tested.
  */
 
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #define I2S            (3 << 0)
 
 /* MD_CTL2 */
-#define FS0            (1 << 0)
-#define FS1            (1 << 1)
-#define FS2            (1 << 2)
-#define FS3            (1 << 5)
-#define FS_MASK                (FS0 | FS1 | FS2 | FS3)
+#define FSs(val)       (((val & 0x7) << 0) | ((val & 0x8) << 2))
+#define PSs(val)       ((val & 0x3) << 6)
 
 /* MD_CTL3 */
 #define BST1           (1 << 3)
@@ -147,6 +146,7 @@ struct ak4642_drvdata {
 
 struct ak4642_priv {
        const struct ak4642_drvdata *drvdata;
+       struct clk *mcko;
 };
 
 /*
@@ -430,56 +430,56 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
        return 0;
 }
 
+static int ak4642_set_mcko(struct snd_soc_codec *codec,
+                          u32 frequency)
+{
+       u32 fs_list[] = {
+               [0] = 8000,
+               [1] = 12000,
+               [2] = 16000,
+               [3] = 24000,
+               [4] = 7350,
+               [5] = 11025,
+               [6] = 14700,
+               [7] = 22050,
+               [10] = 32000,
+               [11] = 48000,
+               [14] = 29400,
+               [15] = 44100,
+       };
+       u32 ps_list[] = {
+               [0] = 256,
+               [1] = 128,
+               [2] = 64,
+               [3] = 32
+       };
+       int ps, fs;
+
+       for (ps = 0; ps < ARRAY_SIZE(ps_list); ps++) {
+               for (fs = 0; fs < ARRAY_SIZE(fs_list); fs++) {
+                       if (frequency == ps_list[ps] * fs_list[fs]) {
+                               snd_soc_write(codec, MD_CTL2,
+                                             PSs(ps) | FSs(fs));
+                               return 0;
+                       }
+               }
+       }
+
+       return 0;
+}
+
 static int ak4642_dai_hw_params(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params,
                                struct snd_soc_dai *dai)
 {
        struct snd_soc_codec *codec = dai->codec;
-       u8 rate;
+       struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
+       u32 rate = clk_get_rate(priv->mcko);
 
-       switch (params_rate(params)) {
-       case 7350:
-               rate = FS2;
-               break;
-       case 8000:
-               rate = 0;
-               break;
-       case 11025:
-               rate = FS2 | FS0;
-               break;
-       case 12000:
-               rate = FS0;
-               break;
-       case 14700:
-               rate = FS2 | FS1;
-               break;
-       case 16000:
-               rate = FS1;
-               break;
-       case 22050:
-               rate = FS2 | FS1 | FS0;
-               break;
-       case 24000:
-               rate = FS1 | FS0;
-               break;
-       case 29400:
-               rate = FS3 | FS2 | FS1;
-               break;
-       case 32000:
-               rate = FS3 | FS1;
-               break;
-       case 44100:
-               rate = FS3 | FS2 | FS1 | FS0;
-               break;
-       case 48000:
-               rate = FS3 | FS1 | FS0;
-               break;
-       default:
-               return -EINVAL;
-       }
-       snd_soc_update_bits(codec, MD_CTL2, FS_MASK, rate);
+       if (!rate)
+               rate = params_rate(params) * 256;
 
-       return 0;
+       return ak4642_set_mcko(codec, rate);
 }
 
 static int ak4642_set_bias_level(struct snd_soc_codec *codec,
@@ -532,7 +532,18 @@ static int ak4642_resume(struct snd_soc_codec *codec)
        return 0;
 }
 
+static int ak4642_probe(struct snd_soc_codec *codec)
+{
+       struct ak4642_priv *priv = snd_soc_codec_get_drvdata(codec);
+
+       if (priv->mcko)
+               ak4642_set_mcko(codec, clk_get_rate(priv->mcko));
+
+       return 0;
+}
+
 static struct snd_soc_codec_driver soc_codec_dev_ak4642 = {
+       .probe                  = ak4642_probe,
        .resume                 = ak4642_resume,
        .set_bias_level         = ak4642_set_bias_level,
        .controls               = ak4642_snd_controls,
@@ -580,19 +591,54 @@ static const struct ak4642_drvdata ak4648_drvdata = {
        .extended_frequencies = 1,
 };
 
+#ifdef CONFIG_COMMON_CLK
+static struct clk *ak4642_of_parse_mcko(struct device *dev)
+{
+       struct device_node *np = dev->of_node;
+       struct clk *clk;
+       const char *clk_name = np->name;
+       const char *parent_clk_name = NULL;
+       u32 rate;
+
+       if (of_property_read_u32(np, "clock-frequency", &rate))
+               return NULL;
+
+       if (of_property_read_bool(np, "clocks"))
+               parent_clk_name = of_clk_get_parent_name(np, 0);
+
+       of_property_read_string(np, "clock-output-names", &clk_name);
+
+       clk = clk_register_fixed_rate(dev, clk_name, parent_clk_name,
+                                     (parent_clk_name) ? 0 : CLK_IS_ROOT,
+                                     rate);
+       if (!IS_ERR(clk))
+               of_clk_add_provider(np, of_clk_src_simple_get, clk);
+
+       return clk;
+}
+#else
+#define ak4642_of_parse_mcko(d) 0
+#endif
+
 static const struct of_device_id ak4642_of_match[];
 static int ak4642_i2c_probe(struct i2c_client *i2c,
                            const struct i2c_device_id *id)
 {
-       struct device_node *np = i2c->dev.of_node;
+       struct device *dev = &i2c->dev;
+       struct device_node *np = dev->of_node;
        const struct ak4642_drvdata *drvdata = NULL;
        struct regmap *regmap;
        struct ak4642_priv *priv;
+       struct clk *mcko = NULL;
 
        if (np) {
                const struct of_device_id *of_id;
 
-               of_id = of_match_device(ak4642_of_match, &i2c->dev);
+               mcko = ak4642_of_parse_mcko(dev);
+               if (IS_ERR(mcko))
+                       mcko = NULL;
+
+               of_id = of_match_device(ak4642_of_match, dev);
                if (of_id)
                        drvdata = of_id->data;
        } else {
@@ -600,15 +646,16 @@ static int ak4642_i2c_probe(struct i2c_client *i2c,
        }
 
        if (!drvdata) {
-               dev_err(&i2c->dev, "Unknown device type\n");
+               dev_err(dev, "Unknown device type\n");
                return -EINVAL;
        }
 
-       priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL);
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
        priv->drvdata = drvdata;
+       priv->mcko = mcko;
 
        i2c_set_clientdata(i2c, priv);
 
@@ -616,7 +663,7 @@ static int ak4642_i2c_probe(struct i2c_client *i2c,
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
 
-       return snd_soc_register_codec(&i2c->dev,
+       return snd_soc_register_codec(dev,
                                      &soc_codec_dev_ak4642, &ak4642_dai, 1);
 }
 
index 8a2221ab3d10b97f5f7a97c21251264aa93eaa5b..ac21b85ff75ffb7b3305d8200c8c6a38ed3896bf 100644 (file)
@@ -147,6 +147,8 @@ static int arizona_spk_ev(struct snd_soc_dapm_widget *w,
                                                   0x4f5, 0x0da);
                }
                break;
+       default:
+               break;
        }
 
        return 0;
@@ -689,6 +691,15 @@ static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena)
                                    ARIZONA_IN_VU, val);
 }
 
+bool arizona_input_analog(struct snd_soc_codec *codec, int shift)
+{
+       unsigned int reg = ARIZONA_IN1L_CONTROL + ((shift / 2) * 8);
+       unsigned int val = snd_soc_read(codec, reg);
+
+       return !(val & ARIZONA_IN1_MODE_MASK);
+}
+EXPORT_SYMBOL_GPL(arizona_input_analog);
+
 int arizona_in_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
                  int event)
 {
@@ -725,6 +736,9 @@ int arizona_in_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
                reg = snd_soc_read(codec, ARIZONA_INPUT_ENABLES);
                if (reg == 0)
                        arizona_in_set_vu(codec, 0);
+               break;
+       default:
+               break;
        }
 
        return 0;
@@ -806,6 +820,8 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
                        break;
                }
                break;
+       default:
+               break;
        }
 
        return 0;
index ada0a418ff4b648034841e9b36f4df598d03fac2..7b68d05a0939049efec30f58aafb5aa673df20f3 100644 (file)
@@ -294,4 +294,6 @@ extern int arizona_init_dai(struct arizona_priv *priv, int dai);
 int arizona_set_output_mode(struct snd_soc_codec *codec, int output,
                            bool diff);
 
+extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift);
+
 #endif
diff --git a/sound/soc/codecs/hdmi.c b/sound/soc/codecs/hdmi.c
deleted file mode 100644 (file)
index bd42ad3..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * ALSA SoC codec driver for HDMI audio codecs.
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Ricardo Neri <ricardo.neri@ti.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 published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-#include <linux/module.h>
-#include <sound/soc.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
-
-#define DRV_NAME "hdmi-audio-codec"
-
-static const struct snd_soc_dapm_widget hdmi_widgets[] = {
-       SND_SOC_DAPM_INPUT("RX"),
-       SND_SOC_DAPM_OUTPUT("TX"),
-};
-
-static const struct snd_soc_dapm_route hdmi_routes[] = {
-       { "Capture", NULL, "RX" },
-       { "TX", NULL, "Playback" },
-};
-
-static struct snd_soc_dai_driver hdmi_codec_dai = {
-       .name = "hdmi-hifi",
-       .playback = {
-               .stream_name = "Playback",
-               .channels_min = 2,
-               .channels_max = 8,
-               .rates = SNDRV_PCM_RATE_32000 |
-                       SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
-                       SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
-                       SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE |
-                       SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE,
-               .sig_bits = 24,
-       },
-       .capture = {
-               .stream_name = "Capture",
-               .channels_min = 2,
-               .channels_max = 2,
-               .rates = SNDRV_PCM_RATE_32000 |
-                       SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
-                       SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
-                       SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE |
-                       SNDRV_PCM_FMTBIT_S24_LE,
-       },
-
-};
-
-#ifdef CONFIG_OF
-static const struct of_device_id hdmi_audio_codec_ids[] = {
-       { .compatible = "linux,hdmi-audio", },
-       { }
-};
-MODULE_DEVICE_TABLE(of, hdmi_audio_codec_ids);
-#endif
-
-static struct snd_soc_codec_driver hdmi_codec = {
-       .dapm_widgets = hdmi_widgets,
-       .num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
-       .dapm_routes = hdmi_routes,
-       .num_dapm_routes = ARRAY_SIZE(hdmi_routes),
-       .ignore_pmdown_time = true,
-};
-
-static int hdmi_codec_probe(struct platform_device *pdev)
-{
-       return snd_soc_register_codec(&pdev->dev, &hdmi_codec,
-                       &hdmi_codec_dai, 1);
-}
-
-static int hdmi_codec_remove(struct platform_device *pdev)
-{
-       snd_soc_unregister_codec(&pdev->dev);
-       return 0;
-}
-
-static struct platform_driver hdmi_codec_driver = {
-       .driver         = {
-               .name   = DRV_NAME,
-               .of_match_table = of_match_ptr(hdmi_audio_codec_ids),
-       },
-
-       .probe          = hdmi_codec_probe,
-       .remove         = hdmi_codec_remove,
-};
-
-module_platform_driver(hdmi_codec_driver);
-
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("ASoC generic HDMI codec driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
index 4972bf3efa91c4849928f480bd08ebc3388a53db..3eb184c4abe549ba7c0aa6c81688572462fb5a4d 100644 (file)
@@ -732,14 +732,14 @@ static const struct snd_kcontrol_new rt5645_mono_adc_r_mix[] = {
 static const struct snd_kcontrol_new rt5645_dac_l_mix[] = {
        SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER,
                        RT5645_M_ADCMIX_L_SFT, 1, 1),
-       SOC_DAPM_SINGLE("DAC1 Switch", RT5645_AD_DA_MIXER,
+       SOC_DAPM_SINGLE_AUTODISABLE("DAC1 Switch", RT5645_AD_DA_MIXER,
                        RT5645_M_DAC1_L_SFT, 1, 1),
 };
 
 static const struct snd_kcontrol_new rt5645_dac_r_mix[] = {
        SOC_DAPM_SINGLE("Stereo ADC Switch", RT5645_AD_DA_MIXER,
                        RT5645_M_ADCMIX_R_SFT, 1, 1),
-       SOC_DAPM_SINGLE("DAC1 Switch", RT5645_AD_DA_MIXER,
+       SOC_DAPM_SINGLE_AUTODISABLE("DAC1 Switch", RT5645_AD_DA_MIXER,
                        RT5645_M_DAC1_R_SFT, 1, 1),
 };
 
@@ -1381,7 +1381,7 @@ static void hp_amp_power(struct snd_soc_codec *codec, int on)
                                regmap_write(rt5645->regmap, RT5645_PR_BASE +
                                        RT5645_MAMP_INT_REG2, 0xfc00);
                                snd_soc_write(codec, RT5645_DEPOP_M2, 0x1140);
-                               mdelay(5);
+                               msleep(40);
                                rt5645->hp_on = true;
                        } else {
                                /* depop parameters */
@@ -2829,13 +2829,15 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
                        snd_soc_dapm_sync(dapm);
                        rt5645->jack_type = SND_JACK_HEADPHONE;
                }
-
-               snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
-               snd_soc_write(codec, RT5645_DEPOP_M1, 0x001d);
-               snd_soc_write(codec, RT5645_DEPOP_M1, 0x0001);
+               if (rt5645->pdata.jd_invert)
+                       regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
+                               RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
        } else { /* jack out */
                rt5645->jack_type = 0;
 
+               regmap_update_bits(rt5645->regmap, RT5645_HP_VOL,
+                       RT5645_L_MUTE | RT5645_R_MUTE,
+                       RT5645_L_MUTE | RT5645_R_MUTE);
                regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL2,
                        RT5645_CBJ_MN_JD, RT5645_CBJ_MN_JD);
                regmap_update_bits(rt5645->regmap, RT5645_IN1_CTRL1,
@@ -2848,6 +2850,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
                        snd_soc_dapm_disable_pin(dapm, "LDO2");
                snd_soc_dapm_disable_pin(dapm, "Mic Det Power");
                snd_soc_dapm_sync(dapm);
+               if (rt5645->pdata.jd_invert)
+                       regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
+                               RT5645_JD_1_1_MASK, RT5645_JD_1_1_NOR);
        }
 
        return rt5645->jack_type;
@@ -2880,8 +2885,6 @@ int rt5645_set_jack_detect(struct snd_soc_codec *codec,
                rt5645->en_button_func = true;
                regmap_update_bits(rt5645->regmap, RT5645_GPIO_CTRL1,
                                RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ);
-               regmap_update_bits(rt5645->regmap, RT5645_DEPOP_M1,
-                               RT5645_HP_CB_MASK, RT5645_HP_CB_PU);
                regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1,
                                RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL);
        }
@@ -3205,9 +3208,42 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "Celes"),
                },
        },
+       {
+               .ident = "Google Ultima",
+               .callback = strago_quirk_cb,
+               .matches = {
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Ultima"),
+               },
+       },
+       { }
+};
+
+static struct rt5645_platform_data buddy_platform_data = {
+       .dmic1_data_pin = RT5645_DMIC_DATA_GPIO5,
+       .dmic2_data_pin = RT5645_DMIC_DATA_IN2P,
+       .jd_mode = 3,
+       .jd_invert = true,
+};
+
+static int buddy_quirk_cb(const struct dmi_system_id *id)
+{
+       rt5645_pdata = &buddy_platform_data;
+
+       return 1;
+}
+
+static struct dmi_system_id dmi_platform_intel_broadwell[] __initdata = {
+       {
+               .ident = "Chrome Buddy",
+               .callback = buddy_quirk_cb,
+               .matches = {
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Buddy"),
+               },
+       },
        { }
 };
 
+
 static int rt5645_parse_dt(struct rt5645_priv *rt5645, struct device *dev)
 {
        rt5645->pdata.in2_diff = device_property_read_bool(dev,
@@ -3240,7 +3276,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
 
        if (pdata)
                rt5645->pdata = *pdata;
-       else if (dmi_check_system(dmi_platform_intel_braswell))
+       else if (dmi_check_system(dmi_platform_intel_braswell) ||
+                       dmi_check_system(dmi_platform_intel_broadwell))
                rt5645->pdata = *rt5645_pdata;
        else
                rt5645_parse_dt(rt5645, &i2c->dev);
index 0e4cfc6ac64984acb1bd395a7477b7cf21cfc020..f45861c49ef25af6347d2ea1588b8be425452b55 100644 (file)
 #define RT5645_PWR_CLS_D_R_BIT                 9
 #define RT5645_PWR_CLS_D_L                     (0x1 << 8)
 #define RT5645_PWR_CLS_D_L_BIT                 8
-#define RT5645_PWR_ADC_R                       (0x1 << 1)
-#define RT5645_PWR_ADC_R_BIT                   1
 #define RT5645_PWR_DAC_L2                      (0x1 << 7)
 #define RT5645_PWR_DAC_L2_BIT                  7
 #define RT5645_PWR_DAC_R2                      (0x1 << 6)
 #define RT5645_OT_P_NOR                                (0x0 << 10)
 #define RT5645_OT_P_INV                                (0x1 << 10)
 #define RT5645_IRQ_JD_1_1_EN                   (0x1 << 9)
+#define RT5645_JD_1_1_MASK                     (0x1 << 7)
+#define RT5645_JD_1_1_SFT                      7
+#define RT5645_JD_1_1_NOR                      (0x0 << 7)
+#define RT5645_JD_1_1_INV                      (0x1 << 7)
 
 /* IRQ Control 2 (0xbe) */
 #define RT5645_IRQ_MB1_OC_MASK                 (0x1 << 15)
index f2c6ad4b8fde03f489572e5ce2abf326dd2662b8..581ec1502228ff7d3d367b2582ead6d3af619b21 100644 (file)
@@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
        struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec);
        unsigned long flags;
        int ret;
-       const struct firmware *fw;
        struct spi_message m;
        struct spi_transfer t;
        struct dfw_pllrec pll_rec;
@@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
        wm0010->state = WM0010_OUT_OF_RESET;
        spin_unlock_irqrestore(&wm0010->irq_lock, flags);
 
-       /* First the bootloader */
-       ret = request_firmware(&fw, "wm0010_stage2.bin", codec->dev);
-       if (ret != 0) {
-               dev_err(codec->dev, "Failed to request stage2 loader: %d\n",
-                       ret);
-               goto abort;
-       }
-
        if (!wait_for_completion_timeout(&wm0010->boot_completion,
                                         msecs_to_jiffies(20)))
                dev_err(codec->dev, "Failed to get interrupt from DSP\n");
@@ -673,7 +664,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
 
                img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
                if (!img_swap)
-                       goto abort;
+                       goto abort_out;
 
                /* We need to re-order for 0010 */
                byte_swap_64((u64 *)&pll_rec, img_swap, len);
@@ -688,16 +679,16 @@ static int wm0010_boot(struct snd_soc_codec *codec)
                spi_message_add_tail(&t, &m);
 
                ret = spi_sync(spi, &m);
-               if (ret != 0) {
+               if (ret) {
                        dev_err(codec->dev, "First PLL write failed: %d\n", ret);
-                       goto abort;
+                       goto abort_swap;
                }
 
                /* Use a second send of the message to get the return status */
                ret = spi_sync(spi, &m);
-               if (ret != 0) {
+               if (ret) {
                        dev_err(codec->dev, "Second PLL write failed: %d\n", ret);
-                       goto abort;
+                       goto abort_swap;
                }
 
                p = (u32 *)out;
@@ -730,6 +721,10 @@ static int wm0010_boot(struct snd_soc_codec *codec)
 
        return 0;
 
+abort_swap:
+       kfree(img_swap);
+abort_out:
+       kfree(out);
 abort:
        /* Put the chip back into reset */
        wm0010_halt(codec);
index 9756578fc7526a3182039bad491d3388e297de57..c04c0bc6f58ad434de2bbe5825be1b41182b1c24 100644 (file)
 struct wm5110_priv {
        struct arizona_priv core;
        struct arizona_fll fll[2];
+
+       unsigned int in_value;
+       int in_pre_pending;
+       int in_post_pending;
+
+       unsigned int in_pga_cache[6];
 };
 
 static const struct wm_adsp_region wm5110_dsp1_regions[] = {
@@ -428,6 +434,127 @@ err:
        return ret;
 }
 
+static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol,
+                            struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
+       struct snd_soc_card *card = dapm->card;
+       int ret;
+
+       /*
+        * PGA Volume is also used as part of the enable sequence, so
+        * usage of it should be avoided whilst that is running.
+        */
+       mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
+
+       ret = snd_soc_get_volsw_range(kcontrol, ucontrol);
+
+       mutex_unlock(&card->dapm_mutex);
+
+       return ret;
+}
+
+static int wm5110_in_pga_put(struct snd_kcontrol *kcontrol,
+                            struct snd_ctl_elem_value *ucontrol)
+{
+       struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
+       struct snd_soc_card *card = dapm->card;
+       int ret;
+
+       /*
+        * PGA Volume is also used as part of the enable sequence, so
+        * usage of it should be avoided whilst that is running.
+        */
+       mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
+
+       ret = snd_soc_put_volsw_range(kcontrol, ucontrol);
+
+       mutex_unlock(&card->dapm_mutex);
+
+       return ret;
+}
+
+static int wm5110_in_analog_ev(struct snd_soc_dapm_widget *w,
+                              struct snd_kcontrol *kcontrol, int event)
+{
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+       struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+       struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
+       struct arizona *arizona = priv->arizona;
+       unsigned int reg, mask;
+       struct reg_sequence analog_seq[] = {
+               { 0x80, 0x3 },
+               { 0x35d, 0 },
+               { 0x80, 0x0 },
+       };
+
+       reg = ARIZONA_IN1L_CONTROL + ((w->shift ^ 0x1) * 4);
+       mask = ARIZONA_IN1L_PGA_VOL_MASK;
+
+       switch (event) {
+       case SND_SOC_DAPM_WILL_PMU:
+               wm5110->in_value |= 0x3 << ((w->shift ^ 0x1) * 2);
+               wm5110->in_pre_pending++;
+               wm5110->in_post_pending++;
+               return 0;
+       case SND_SOC_DAPM_PRE_PMU:
+               wm5110->in_pga_cache[w->shift] = snd_soc_read(codec, reg);
+
+               snd_soc_update_bits(codec, reg, mask,
+                                   0x40 << ARIZONA_IN1L_PGA_VOL_SHIFT);
+
+               wm5110->in_pre_pending--;
+               if (wm5110->in_pre_pending == 0) {
+                       analog_seq[1].def = wm5110->in_value;
+                       regmap_multi_reg_write_bypassed(arizona->regmap,
+                                                       analog_seq,
+                                                       ARRAY_SIZE(analog_seq));
+
+                       msleep(55);
+
+                       wm5110->in_value = 0;
+               }
+
+               break;
+       case SND_SOC_DAPM_POST_PMU:
+               snd_soc_update_bits(codec, reg, mask,
+                                   wm5110->in_pga_cache[w->shift]);
+
+               wm5110->in_post_pending--;
+               if (wm5110->in_post_pending == 0)
+                       regmap_multi_reg_write_bypassed(arizona->regmap,
+                                                       analog_seq,
+                                                       ARRAY_SIZE(analog_seq));
+               break;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+static int wm5110_in_ev(struct snd_soc_dapm_widget *w,
+                       struct snd_kcontrol *kcontrol, int event)
+{
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+       struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
+       struct arizona *arizona = priv->arizona;
+
+       switch (arizona->rev) {
+       case 0 ... 4:
+               if (arizona_input_analog(codec, w->shift))
+                       wm5110_in_analog_ev(w, kcontrol, event);
+
+               break;
+       default:
+               break;
+       }
+
+       return arizona_in_ev(w, kcontrol, event);
+}
+
 static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
 static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
 static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
@@ -454,18 +581,24 @@ SOC_ENUM("IN2 OSR", arizona_in_dmic_osr[1]),
 SOC_ENUM("IN3 OSR", arizona_in_dmic_osr[2]),
 SOC_ENUM("IN4 OSR", arizona_in_dmic_osr[3]),
 
-SOC_SINGLE_RANGE_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL,
-                    ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
-SOC_SINGLE_RANGE_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL,
-                    ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
-SOC_SINGLE_RANGE_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL,
-                    ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
-SOC_SINGLE_RANGE_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL,
-                    ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
-SOC_SINGLE_RANGE_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL,
-                    ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
-SOC_SINGLE_RANGE_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL,
-                    ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
+SOC_SINGLE_RANGE_EXT_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL,
+                        ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
+                        wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
+SOC_SINGLE_RANGE_EXT_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL,
+                        ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
+                        wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
+SOC_SINGLE_RANGE_EXT_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL,
+                        ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
+                        wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
+SOC_SINGLE_RANGE_EXT_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL,
+                        ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
+                        wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
+SOC_SINGLE_RANGE_EXT_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL,
+                        ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
+                        wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
+SOC_SINGLE_RANGE_EXT_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL,
+                        ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
+                        wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
 
 SOC_ENUM("IN HPF Cutoff Frequency", arizona_in_hpf_cut_enum),
 
@@ -896,29 +1029,35 @@ SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"),
 SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"),
 
 SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT,
-                  0, NULL, 0, arizona_in_ev,
+                  0, NULL, 0, wm5110_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
-                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
+                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+                  SND_SOC_DAPM_WILL_PMU),
 SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT,
-                  0, NULL, 0, arizona_in_ev,
+                  0, NULL, 0, wm5110_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
-                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
+                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+                  SND_SOC_DAPM_WILL_PMU),
 SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT,
-                  0, NULL, 0, arizona_in_ev,
+                  0, NULL, 0, wm5110_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
-                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
+                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+                  SND_SOC_DAPM_WILL_PMU),
 SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT,
-                  0, NULL, 0, arizona_in_ev,
+                  0, NULL, 0, wm5110_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
-                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
+                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+                  SND_SOC_DAPM_WILL_PMU),
 SND_SOC_DAPM_PGA_E("IN3L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3L_ENA_SHIFT,
-                  0, NULL, 0, arizona_in_ev,
+                  0, NULL, 0, wm5110_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
-                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
+                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+                  SND_SOC_DAPM_WILL_PMU),
 SND_SOC_DAPM_PGA_E("IN3R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3R_ENA_SHIFT,
-                  0, NULL, 0, arizona_in_ev,
+                  0, NULL, 0, wm5110_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
-                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
+                  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+                  SND_SOC_DAPM_WILL_PMU),
 SND_SOC_DAPM_PGA_E("IN4L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4L_ENA_SHIFT,
                   0, NULL, 0, arizona_in_ev,
                   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
index e3b7d0c57411870176c5e1e1398101f5641f77ad..dbd88408861a21af9f3d68ecaf72294b3d47734e 100644 (file)
@@ -211,28 +211,38 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
        return wm8960_set_deemph(codec);
 }
 
-static const DECLARE_TLV_DB_SCALE(adc_tlv, -9700, 50, 0);
-static const DECLARE_TLV_DB_SCALE(dac_tlv, -12700, 50, 1);
+static const DECLARE_TLV_DB_SCALE(adc_tlv, -9750, 50, 1);
+static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1725, 75, 0);
+static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -2100, 300, 0);
 static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
-static const DECLARE_TLV_DB_SCALE(boost_tlv, -1200, 300, 1);
+static const DECLARE_TLV_DB_SCALE(lineinboost_tlv, -1500, 300, 1);
+static const unsigned int micboost_tlv[] = {
+       TLV_DB_RANGE_HEAD(2),
+       0, 1, TLV_DB_SCALE_ITEM(0, 1300, 0),
+       2, 3, TLV_DB_SCALE_ITEM(2000, 900, 0),
+};
 
 static const struct snd_kcontrol_new wm8960_snd_controls[] = {
 SOC_DOUBLE_R_TLV("Capture Volume", WM8960_LINVOL, WM8960_RINVOL,
-                0, 63, 0, adc_tlv),
+                0, 63, 0, inpga_tlv),
 SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
        6, 1, 0),
 SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
        7, 1, 0),
 
 SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT3 Volume",
-              WM8960_INBMIX1, 4, 7, 0, boost_tlv),
+              WM8960_INBMIX1, 4, 7, 0, lineinboost_tlv),
 SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT2 Volume",
-              WM8960_INBMIX1, 1, 7, 0, boost_tlv),
+              WM8960_INBMIX1, 1, 7, 0, lineinboost_tlv),
 SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT3 Volume",
-              WM8960_INBMIX2, 4, 7, 0, boost_tlv),
+              WM8960_INBMIX2, 4, 7, 0, lineinboost_tlv),
 SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT2 Volume",
-              WM8960_INBMIX2, 1, 7, 0, boost_tlv),
+              WM8960_INBMIX2, 1, 7, 0, lineinboost_tlv),
+SOC_SINGLE_TLV("Right Input Boost Mixer RINPUT1 Volume",
+               WM8960_RINPATH, 4, 3, 0, micboost_tlv),
+SOC_SINGLE_TLV("Left Input Boost Mixer LINPUT1 Volume",
+               WM8960_LINPATH, 4, 3, 0, micboost_tlv),
 
 SOC_DOUBLE_R_TLV("Playback Volume", WM8960_LDAC, WM8960_RDAC,
                 0, 255, 0, dac_tlv),
index b4eb975da981a82c66435ddcaf0ee6f656c0b927..293e47a6ff59073af3aaf0bb6c6d76521d1b1d94 100644 (file)
@@ -2944,7 +2944,8 @@ static int wm8962_mute(struct snd_soc_dai *dai, int mute)
                                   WM8962_DAC_MUTE, val);
 }
 
-#define WM8962_RATES SNDRV_PCM_RATE_8000_96000
+#define WM8962_RATES (SNDRV_PCM_RATE_8000_48000 |\
+               SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
 
 #define WM8962_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
index add6bb99661daced09d250eb04af15b37c6ffb44..4495a40a94680600ff324bd035098ff3d73f594b 100644 (file)
@@ -80,12 +80,13 @@ struct davinci_mcasp {
 
        /* McASP specific data */
        int     tdm_slots;
+       u32     tdm_mask[2];
+       int     slot_width;
        u8      op_mode;
        u8      num_serializer;
        u8      *serial_dir;
        u8      version;
        u8      bclk_div;
-       u16     bclk_lrclk_ratio;
        int     streams;
        u32     irq_request[2];
        int     dma_request[2];
@@ -556,8 +557,21 @@ static int __davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id,
                        mcasp->bclk_div = div;
                break;
 
-       case 2:         /* BCLK/LRCLK ratio */
-               mcasp->bclk_lrclk_ratio = div;
+       case 2: /*
+                * BCLK/LRCLK ratio descries how many bit-clock cycles
+                * fit into one frame. The clock ratio is given for a
+                * full period of data (for I2S format both left and
+                * right channels), so it has to be divided by number
+                * of tdm-slots (for I2S - divided by 2).
+                * Instead of storing this ratio, we calculate a new
+                * tdm_slot width by dividing the the ratio by the
+                * number of configured tdm slots.
+                */
+               mcasp->slot_width = div / mcasp->tdm_slots;
+               if (div % mcasp->tdm_slots)
+                       dev_warn(mcasp->dev,
+                                "%s(): BCLK/LRCLK %d is not divisible by %d tdm slots",
+                                __func__, div, mcasp->tdm_slots);
                break;
 
        default:
@@ -596,12 +610,92 @@ static int davinci_mcasp_set_sysclk(struct snd_soc_dai *dai, int clk_id,
        return 0;
 }
 
+/* All serializers must have equal number of channels */
+static int davinci_mcasp_ch_constraint(struct davinci_mcasp *mcasp, int stream,
+                                      int serializers)
+{
+       struct snd_pcm_hw_constraint_list *cl = &mcasp->chconstr[stream];
+       unsigned int *list = (unsigned int *) cl->list;
+       int slots = mcasp->tdm_slots;
+       int i, count = 0;
+
+       if (mcasp->tdm_mask[stream])
+               slots = hweight32(mcasp->tdm_mask[stream]);
+
+       for (i = 2; i <= slots; i++)
+               list[count++] = i;
+
+       for (i = 2; i <= serializers; i++)
+               list[count++] = i*slots;
+
+       cl->count = count;
+
+       return 0;
+}
+
+static int davinci_mcasp_set_ch_constraints(struct davinci_mcasp *mcasp)
+{
+       int rx_serializers = 0, tx_serializers = 0, ret, i;
+
+       for (i = 0; i < mcasp->num_serializer; i++)
+               if (mcasp->serial_dir[i] == TX_MODE)
+                       tx_serializers++;
+               else if (mcasp->serial_dir[i] == RX_MODE)
+                       rx_serializers++;
+
+       ret = davinci_mcasp_ch_constraint(mcasp, SNDRV_PCM_STREAM_PLAYBACK,
+                                         tx_serializers);
+       if (ret)
+               return ret;
+
+       ret = davinci_mcasp_ch_constraint(mcasp, SNDRV_PCM_STREAM_CAPTURE,
+                                         rx_serializers);
+
+       return ret;
+}
+
+
+static int davinci_mcasp_set_tdm_slot(struct snd_soc_dai *dai,
+                                     unsigned int tx_mask,
+                                     unsigned int rx_mask,
+                                     int slots, int slot_width)
+{
+       struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
+
+       dev_dbg(mcasp->dev,
+                "%s() tx_mask 0x%08x rx_mask 0x%08x slots %d width %d\n",
+                __func__, tx_mask, rx_mask, slots, slot_width);
+
+       if (tx_mask >= (1<<slots) || rx_mask >= (1<<slots)) {
+               dev_err(mcasp->dev,
+                       "Bad tdm mask tx: 0x%08x rx: 0x%08x slots %d\n",
+                       tx_mask, rx_mask, slots);
+               return -EINVAL;
+       }
+
+       if (slot_width &&
+           (slot_width < 8 || slot_width > 32 || slot_width % 4 != 0)) {
+               dev_err(mcasp->dev, "%s: Unsupported slot_width %d\n",
+                       __func__, slot_width);
+               return -EINVAL;
+       }
+
+       mcasp->tdm_slots = slots;
+       mcasp->tdm_mask[SNDRV_PCM_STREAM_PLAYBACK] = rx_mask;
+       mcasp->tdm_mask[SNDRV_PCM_STREAM_CAPTURE] = tx_mask;
+       mcasp->slot_width = slot_width;
+
+       return davinci_mcasp_set_ch_constraints(mcasp);
+}
+
 static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
-                                      int word_length)
+                                      int sample_width)
 {
        u32 fmt;
-       u32 tx_rotate = (word_length / 4) & 0x7;
-       u32 mask = (1ULL << word_length) - 1;
+       u32 tx_rotate = (sample_width / 4) & 0x7;
+       u32 mask = (1ULL << sample_width) - 1;
+       u32 slot_width = sample_width;
+
        /*
         * For captured data we should not rotate, inversion and masking is
         * enoguh to get the data to the right position:
@@ -614,28 +708,23 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
        u32 rx_rotate = 0;
 
        /*
-        * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
-        * callback, take it into account here. That allows us to for example
-        * send 32 bits per channel to the codec, while only 16 of them carry
-        * audio payload.
-        * The clock ratio is given for a full period of data (for I2S format
-        * both left and right channels), so it has to be divided by number of
-        * tdm-slots (for I2S - divided by 2).
+        * Setting the tdm slot width either with set_clkdiv() or
+        * set_tdm_slot() allows us to for example send 32 bits per
+        * channel to the codec, while only 16 of them carry audio
+        * payload.
         */
-       if (mcasp->bclk_lrclk_ratio) {
-               u32 slot_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots;
-
+       if (mcasp->slot_width) {
                /*
-                * When we have more bclk then it is needed for the data, we
-                * need to use the rotation to move the received samples to have
-                * correct alignment.
+                * When we have more bclk then it is needed for the
+                * data, we need to use the rotation to move the
+                * received samples to have correct alignment.
                 */
-               rx_rotate = (slot_length - word_length) / 4;
-               word_length = slot_length;
+               slot_width = mcasp->slot_width;
+               rx_rotate = (slot_width - sample_width) / 4;
        }
 
        /* mapping of the XSSZ bit-field as described in the datasheet */
-       fmt = (word_length >> 1) - 1;
+       fmt = (slot_width >> 1) - 1;
 
        if (mcasp->op_mode != DAVINCI_MCASP_DIT_MODE) {
                mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, RXSSZ(fmt),
@@ -663,7 +752,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
        u8 rx_ser = 0;
        u8 slots = mcasp->tdm_slots;
        u8 max_active_serializers = (channels + slots - 1) / slots;
-       int active_serializers, numevt, n;
+       int active_serializers, numevt;
        u32 reg;
        /* Default configuration */
        if (mcasp->version < MCASP_VERSION_3)
@@ -745,9 +834,8 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
         * The number of words for numevt need to be in steps of active
         * serializers.
         */
-       n = numevt % active_serializers;
-       if (n)
-               numevt += (active_serializers - n);
+       numevt = (numevt / active_serializers) * active_serializers;
+
        while (period_words % numevt && numevt > 0)
                numevt -= active_serializers;
        if (numevt <= 0)
@@ -777,33 +865,50 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream,
 
        /*
         * If more than one serializer is needed, then use them with
-        * their specified tdm_slots count. Otherwise, one serializer
-        * can cope with the transaction using as many slots as channels
-        * in the stream, requires channels symmetry
+        * all the specified tdm_slots. Otherwise, one serializer can
+        * cope with the transaction using just as many slots as there
+        * are channels in the stream.
         */
-       active_serializers = (channels + total_slots - 1) / total_slots;
-       if (active_serializers == 1)
-               active_slots = channels;
-       else
-               active_slots = total_slots;
-
-       for (i = 0; i < active_slots; i++)
-               mask |= (1 << i);
+       if (mcasp->tdm_mask[stream]) {
+               active_slots = hweight32(mcasp->tdm_mask[stream]);
+               active_serializers = (channels + active_slots - 1) /
+                       active_slots;
+               if (active_serializers == 1) {
+                       active_slots = channels;
+                       for (i = 0; i < total_slots; i++) {
+                               if ((1 << i) & mcasp->tdm_mask[stream]) {
+                                       mask |= (1 << i);
+                                       if (--active_slots <= 0)
+                                               break;
+                               }
+                       }
+               }
+       } else {
+               active_serializers = (channels + total_slots - 1) / total_slots;
+               if (active_serializers == 1)
+                       active_slots = channels;
+               else
+                       active_slots = total_slots;
 
+               for (i = 0; i < active_slots; i++)
+                       mask |= (1 << i);
+       }
        mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);
 
        if (!mcasp->dat_port)
                busel = TXSEL;
 
-       mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask);
-       mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD);
-       mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG,
-                      FSXMOD(total_slots), FSXMOD(0x1FF));
-
-       mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask);
-       mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
-       mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG,
-                      FSRMOD(total_slots), FSRMOD(0x1FF));
+       if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
+               mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask);
+               mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD);
+               mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG,
+                              FSXMOD(total_slots), FSXMOD(0x1FF));
+       } else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
+               mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask);
+               mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
+               mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG,
+                              FSRMOD(total_slots), FSRMOD(0x1FF));
+       }
 
        return 0;
 }
@@ -923,6 +1028,9 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
                int sbits = params_width(params);
                int ppm, div;
 
+               if (mcasp->slot_width)
+                       sbits = mcasp->slot_width;
+
                div = davinci_mcasp_calc_clk_div(mcasp, rate*sbits*slots,
                                                 &ppm);
                if (ppm)
@@ -1028,6 +1136,9 @@ static int davinci_mcasp_hw_rule_rate(struct snd_pcm_hw_params *params,
        struct snd_interval range;
        int i;
 
+       if (rd->mcasp->slot_width)
+               sbits = rd->mcasp->slot_width;
+
        snd_interval_any(&range);
        range.empty = 1;
 
@@ -1070,10 +1181,14 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params,
 
        for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
                if (snd_mask_test(fmt, i)) {
-                       uint bclk_freq = snd_pcm_format_width(i)*slots*rate;
+                       uint sbits = snd_pcm_format_width(i);
                        int ppm;
 
-                       davinci_mcasp_calc_clk_div(rd->mcasp, bclk_freq, &ppm);
+                       if (rd->mcasp->slot_width)
+                               sbits = rd->mcasp->slot_width;
+
+                       davinci_mcasp_calc_clk_div(rd->mcasp, sbits*slots*rate,
+                                                  &ppm);
                        if (abs(ppm) < DAVINCI_MAX_RATE_ERROR_PPM) {
                                snd_mask_set(&nfmt, i);
                                count++;
@@ -1095,6 +1210,10 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
                                        &mcasp->ruledata[substream->stream];
        u32 max_channels = 0;
        int i, dir;
+       int tdm_slots = mcasp->tdm_slots;
+
+       if (mcasp->tdm_mask[substream->stream])
+               tdm_slots = hweight32(mcasp->tdm_mask[substream->stream]);
 
        mcasp->substreams[substream->stream] = substream;
 
@@ -1115,7 +1234,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
                        max_channels++;
        }
        ruledata->serializers = max_channels;
-       max_channels *= mcasp->tdm_slots;
+       max_channels *= tdm_slots;
        /*
         * If the already active stream has less channels than the calculated
         * limnit based on the seirializers * tdm_slots, we need to use that as
@@ -1125,15 +1244,25 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
         */
        if (mcasp->channels && mcasp->channels < max_channels)
                max_channels = mcasp->channels;
+       /*
+        * But we can always allow channels upto the amount of
+        * the available tdm_slots.
+        */
+       if (max_channels < tdm_slots)
+               max_channels = tdm_slots;
 
        snd_pcm_hw_constraint_minmax(substream->runtime,
                                     SNDRV_PCM_HW_PARAM_CHANNELS,
                                     2, max_channels);
 
-       if (mcasp->chconstr[substream->stream].count)
-               snd_pcm_hw_constraint_list(substream->runtime,
-                                          0, SNDRV_PCM_HW_PARAM_CHANNELS,
-                                          &mcasp->chconstr[substream->stream]);
+       snd_pcm_hw_constraint_list(substream->runtime,
+                                  0, SNDRV_PCM_HW_PARAM_CHANNELS,
+                                  &mcasp->chconstr[substream->stream]);
+
+       if (mcasp->slot_width)
+               snd_pcm_hw_constraint_minmax(substream->runtime,
+                                            SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+                                            8, mcasp->slot_width);
 
        /*
         * If we rely on implicit BCLK divider setting we should
@@ -1185,6 +1314,7 @@ static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
        .set_fmt        = davinci_mcasp_set_dai_fmt,
        .set_clkdiv     = davinci_mcasp_set_clkdiv,
        .set_sysclk     = davinci_mcasp_set_sysclk,
+       .set_tdm_slot   = davinci_mcasp_set_tdm_slot,
 };
 
 static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai)
@@ -1299,6 +1429,7 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
                .ops            = &davinci_mcasp_dai_ops,
 
                .symmetric_samplebits   = 1,
+               .symmetric_rates        = 1,
        },
        {
                .name           = "davinci-mcasp.1",
@@ -1514,59 +1645,6 @@ nodata:
        return  pdata;
 }
 
-/* All serializers must have equal number of channels */
-static int davinci_mcasp_ch_constraint(struct davinci_mcasp *mcasp,
-                                      struct snd_pcm_hw_constraint_list *cl,
-                                      int serializers)
-{
-       unsigned int *list;
-       int i, count = 0;
-
-       if (serializers <= 1)
-               return 0;
-
-       list = devm_kzalloc(mcasp->dev, sizeof(unsigned int) *
-                           (mcasp->tdm_slots + serializers - 2),
-                           GFP_KERNEL);
-       if (!list)
-               return -ENOMEM;
-
-       for (i = 2; i <= mcasp->tdm_slots; i++)
-               list[count++] = i;
-
-       for (i = 2; i <= serializers; i++)
-               list[count++] = i*mcasp->tdm_slots;
-
-       cl->count = count;
-       cl->list = list;
-
-       return 0;
-}
-
-
-static int davinci_mcasp_init_ch_constraints(struct davinci_mcasp *mcasp)
-{
-       int rx_serializers = 0, tx_serializers = 0, ret, i;
-
-       for (i = 0; i < mcasp->num_serializer; i++)
-               if (mcasp->serial_dir[i] == TX_MODE)
-                       tx_serializers++;
-               else if (mcasp->serial_dir[i] == RX_MODE)
-                       rx_serializers++;
-
-       ret = davinci_mcasp_ch_constraint(mcasp, &mcasp->chconstr[
-                                                 SNDRV_PCM_STREAM_PLAYBACK],
-                                         tx_serializers);
-       if (ret)
-               return ret;
-
-       ret = davinci_mcasp_ch_constraint(mcasp, &mcasp->chconstr[
-                                                 SNDRV_PCM_STREAM_CAPTURE],
-                                         rx_serializers);
-
-       return ret;
-}
-
 enum {
        PCM_EDMA,
        PCM_SDMA,
@@ -1685,7 +1763,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 
        irq = platform_get_irq_byname(pdev, "common");
        if (irq >= 0) {
-               irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_common\n",
+               irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_common",
                                          dev_name(&pdev->dev));
                ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                                                davinci_mcasp_common_irq_handler,
@@ -1702,7 +1780,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 
        irq = platform_get_irq_byname(pdev, "rx");
        if (irq >= 0) {
-               irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_rx\n",
+               irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_rx",
                                          dev_name(&pdev->dev));
                ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                                                davinci_mcasp_rx_irq_handler,
@@ -1717,7 +1795,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 
        irq = platform_get_irq_byname(pdev, "tx");
        if (irq >= 0) {
-               irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_tx\n",
+               irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_tx",
                                          dev_name(&pdev->dev));
                ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                                                davinci_mcasp_tx_irq_handler,
@@ -1783,7 +1861,28 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
                mcasp->fifo_base = DAVINCI_MCASP_V3_AFIFO_BASE;
        }
 
-       ret = davinci_mcasp_init_ch_constraints(mcasp);
+       /* Allocate memory for long enough list for all possible
+        * scenarios. Maximum number tdm slots is 32 and there cannot
+        * be more serializers than given in the configuration.  The
+        * serializer directions could be taken into account, but it
+        * would make code much more complex and save only couple of
+        * bytes.
+        */
+       mcasp->chconstr[SNDRV_PCM_STREAM_PLAYBACK].list =
+               devm_kzalloc(mcasp->dev, sizeof(unsigned int) *
+                            (32 + mcasp->num_serializer - 2),
+                            GFP_KERNEL);
+
+       mcasp->chconstr[SNDRV_PCM_STREAM_CAPTURE].list =
+               devm_kzalloc(mcasp->dev, sizeof(unsigned int) *
+                            (32 + mcasp->num_serializer - 2),
+                            GFP_KERNEL);
+
+       if (!mcasp->chconstr[SNDRV_PCM_STREAM_PLAYBACK].list ||
+           !mcasp->chconstr[SNDRV_PCM_STREAM_CAPTURE].list)
+               return -ENOMEM;
+
+       ret = davinci_mcasp_set_ch_constraints(mcasp);
        if (ret)
                goto err;
 
index 5aeb6ed4827e821f0f0ec2cbc866ed1a99a73cc4..0901d5e20df2823c8cd19393007ed0ed946caf7f 100644 (file)
@@ -488,7 +488,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
                priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
        } else {
                dev_err(&pdev->dev, "unknown Device Tree compatible\n");
-               return -EINVAL;
+               ret = -EINVAL;
+               goto asrc_fail;
        }
 
        /* Common settings for corresponding Freescale CPU DAI driver */
@@ -592,6 +593,7 @@ static const struct of_device_id fsl_asoc_card_dt_ids[] = {
        { .compatible = "fsl,imx-audio-wm8960", },
        {}
 };
+MODULE_DEVICE_TABLE(of, fsl_asoc_card_dt_ids);
 
 static struct platform_driver fsl_asoc_card_driver = {
        .probe = fsl_asoc_card_probe,
index a18fd92c4a85c3d67306c544c1af6652789d1467..9366b5a42e1defb9f9d274d142ef9d1fef25104c 100644 (file)
@@ -801,6 +801,7 @@ static const struct of_device_id fsl_sai_ids[] = {
        { .compatible = "fsl,imx6sx-sai", },
        { /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, fsl_sai_ids);
 
 static struct platform_driver fsl_sai_driver = {
        .probe = fsl_sai_probe,
index 8ec6fb208ea073b70bc19b27dab7a12129a035f7..37c5cd4d0e59038ca72c8520bb350de60e42a278 100644 (file)
@@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
 
 static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
 {
-       return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97);
+       return (ssi_private->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) ==
+               SND_SOC_DAIFMT_AC97;
 }
 
 static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)
@@ -947,7 +948,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
                                CCSR_SSI_SCR_TCH_EN);
        }
 
-       if (fmt & SND_SOC_DAIFMT_AC97)
+       if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97)
                fsl_ssi_setup_ac97(ssi_private);
 
        return 0;
index 683e5011615241b026d91c4056ce3cb28e97c537..5e9c316c142aaf9f17b093a03d17f812ba9e06ae 100644 (file)
@@ -368,23 +368,6 @@ static void sst_media_close(struct snd_pcm_substream *substream,
        kfree(stream);
 }
 
-static inline unsigned int get_current_pipe_id(struct snd_soc_dai *dai,
-                                              struct snd_pcm_substream *substream)
-{
-       struct sst_data *sst = snd_soc_dai_get_drvdata(dai);
-       struct sst_dev_stream_map *map = sst->pdata->pdev_strm_map;
-       struct sst_runtime_stream *stream =
-                       substream->runtime->private_data;
-       u32 str_id = stream->stream_info.str_id;
-       unsigned int pipe_id;
-
-       pipe_id = map[str_id].device_id;
-
-       dev_dbg(dai->dev, "got pipe_id = %#x for str_id = %d\n",
-                       pipe_id, str_id);
-       return pipe_id;
-}
-
 static int sst_media_prepare(struct snd_pcm_substream *substream,
                struct snd_soc_dai *dai)
 {
index 8bafaf6ceab1266f6b85a0d6ca1e4ee04bc5046f..3f8a1e10bed02841f6b437d3d4a24615879ca35e 100644 (file)
@@ -266,18 +266,11 @@ static int broadwell_audio_probe(struct platform_device *pdev)
 {
        broadwell_rt286.dev = &pdev->dev;
 
-       return snd_soc_register_card(&broadwell_rt286);
-}
-
-static int broadwell_audio_remove(struct platform_device *pdev)
-{
-       snd_soc_unregister_card(&broadwell_rt286);
-       return 0;
+       return devm_snd_soc_register_card(&pdev->dev, &broadwell_rt286);
 }
 
 static struct platform_driver broadwell_audio = {
        .probe = broadwell_audio_probe,
-       .remove = broadwell_audio_remove,
        .driver = {
                .name = "broadwell-audio",
        },
index f6efa9d4acadd5e056ea0a0494ed51da859fbc3a..b27f25f70730b32717b00105b8a1f090c51ba048 100644 (file)
@@ -302,6 +302,10 @@ struct sst_hsw {
        struct sst_hsw_ipc_dx_reply dx;
        void *dx_context;
        dma_addr_t dx_context_paddr;
+       enum sst_hsw_device_id dx_dev;
+       enum sst_hsw_device_mclk dx_mclk;
+       enum sst_hsw_device_mode dx_mode;
+       u32 dx_clock_divider;
 
        /* boot */
        wait_queue_head_t boot_wait;
@@ -1400,10 +1404,10 @@ int sst_hsw_device_set_config(struct sst_hsw *hsw,
 
        trace_ipc_request("set device config", dev);
 
-       config.ssp_interface = dev;
-       config.clock_frequency = mclk;
-       config.mode = mode;
-       config.clock_divider = clock_divider;
+       hsw->dx_dev = config.ssp_interface = dev;
+       hsw->dx_mclk = config.clock_frequency = mclk;
+       hsw->dx_mode = config.mode = mode;
+       hsw->dx_clock_divider = config.clock_divider = clock_divider;
        if (mode == SST_HSW_DEVICE_TDM_CLOCK_MASTER)
                config.channels = 4;
        else
@@ -1704,10 +1708,10 @@ int sst_hsw_dsp_runtime_resume(struct sst_hsw *hsw)
                return -EIO;
        }
 
-       /* Set ADSP SSP port settings */
-       ret = sst_hsw_device_set_config(hsw, SST_HSW_DEVICE_SSP_0,
-                                       SST_HSW_DEVICE_MCLK_FREQ_24_MHZ,
-                                       SST_HSW_DEVICE_CLOCK_MASTER, 9);
+       /* Set ADSP SSP port settings - sadly the FW does not store SSP port
+          settings as part of the PM context. */
+       ret = sst_hsw_device_set_config(hsw, hsw->dx_dev, hsw->dx_mclk,
+                                       hsw->dx_mode, hsw->dx_clock_divider);
        if (ret < 0)
                dev_err(dev, "error: SSP re-initialization failed\n");
 
index 7d617bf493bc7a1295560d034d76ba161e2eb431..bea26730873c0fffc63c27d4c913da507e71e9ca 100644 (file)
@@ -509,17 +509,6 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
                .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
        },
 },
-{
-       .name = "DMIC23 Pin",
-       .ops = &skl_dmic_dai_ops,
-       .capture = {
-               .stream_name = "DMIC23 Rx",
-               .channels_min = HDA_STEREO,
-               .channels_max = HDA_STEREO,
-               .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_16000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
-       },
-},
 {
        .name = "HD-Codec Pin",
        .ops = &skl_link_dai_ops,
@@ -538,28 +527,6 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
                .formats = SNDRV_PCM_FMTBIT_S16_LE,
        },
 },
-{
-       .name = "HD-Codec-SPK Pin",
-       .ops = &skl_link_dai_ops,
-       .playback = {
-               .stream_name = "HD-Codec-SPK Tx",
-               .channels_min = HDA_STEREO,
-               .channels_max = HDA_STEREO,
-               .rates = SNDRV_PCM_RATE_48000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,
-       },
-},
-{
-       .name = "HD-Codec-AMIC Pin",
-       .ops = &skl_link_dai_ops,
-       .capture = {
-               .stream_name = "HD-Codec-AMIC Rx",
-               .channels_min = HDA_STEREO,
-               .channels_max = HDA_STEREO,
-               .rates = SNDRV_PCM_RATE_48000,
-               .formats = SNDRV_PCM_FMTBIT_S16_LE,
-       },
-},
 };
 
 static int skl_platform_open(struct snd_pcm_substream *substream)
index b05fb1c1a8483e18ea7e5226325563ea82d044c0..794a3499e567c3a907e70b8c1c57aafce6aab207 100644 (file)
@@ -485,6 +485,7 @@ static const struct of_device_id jz4740_of_matches[] = {
        { .compatible = "ingenic,jz4780-i2s", .data = (void *)JZ_I2S_JZ4780 },
        { /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, jz4740_of_matches);
 #endif
 
 static int jz4740_i2s_dev_probe(struct platform_device *pdev)
index 684e8a78bed0640310e0b54e292df725b409fe22..71a1a35047bafd085881efd5369f5275bf9a050f 100644 (file)
@@ -179,21 +179,13 @@ static int mt8173_max98090_dev_probe(struct platform_device *pdev)
        }
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret)
                dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
                        __func__, ret);
        return ret;
 }
 
-static int mt8173_max98090_dev_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static const struct of_device_id mt8173_max98090_dt_match[] = {
        { .compatible = "mediatek,mt8173-max98090", },
        { }
@@ -209,7 +201,6 @@ static struct platform_driver mt8173_max98090_driver = {
 #endif
        },
        .probe = mt8173_max98090_dev_probe,
-       .remove = mt8173_max98090_dev_remove,
 };
 
 module_platform_driver(mt8173_max98090_driver);
index 86cf9752f18a343791eaeeff8ca8ab9c2c4a83e8..50ba538eccb3f771da9c08685d4e33aa0cbfa80b 100644 (file)
@@ -246,21 +246,13 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)
        card->dev = &pdev->dev;
        platform_set_drvdata(pdev, card);
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret)
                dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
                        __func__, ret);
        return ret;
 }
 
-static int mt8173_rt5650_rt5676_dev_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static const struct of_device_id mt8173_rt5650_rt5676_dt_match[] = {
        { .compatible = "mediatek,mt8173-rt5650-rt5676", },
        { }
@@ -276,7 +268,6 @@ static struct platform_driver mt8173_rt5650_rt5676_driver = {
 #endif
        },
        .probe = mt8173_rt5650_rt5676_dev_probe,
-       .remove = mt8173_rt5650_rt5676_dev_remove,
 };
 
 module_platform_driver(mt8173_rt5650_rt5676_driver);
index d190fe017559b6a9ba40baff2f4dd8f05b88cb8e..f5baf3c38863f4eda4e31f2af8c612a6c23f3493 100644 (file)
@@ -549,6 +549,23 @@ static int mtk_afe_dais_startup(struct snd_pcm_substream *substream,
        memif->substream = substream;
 
        snd_soc_set_runtime_hwparams(substream, &mtk_afe_hardware);
+
+       /*
+        * Capture cannot use ping-pong buffer since hw_ptr at IRQ may be
+        * smaller than period_size due to AFE's internal buffer.
+        * This easily leads to overrun when avail_min is period_size.
+        * One more period can hold the possible unread buffer.
+        */
+       if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+               ret = snd_pcm_hw_constraint_minmax(runtime,
+                                                  SNDRV_PCM_HW_PARAM_PERIODS,
+                                                  3,
+                                                  mtk_afe_hardware.periods_max);
+               if (ret < 0) {
+                       dev_err(afe->dev, "hw_constraint_minmax failed\n");
+                       return ret;
+               }
+       }
        ret = snd_pcm_hw_constraint_integer(runtime,
                                            SNDRV_PCM_HW_PARAM_PERIODS);
        if (ret < 0)
index 6e6fce6a14ba6dc1c2ab14d054df8f5b07b2caea..2b23ffbac6b126cdff2674f68133dea77c40f546 100644 (file)
@@ -142,7 +142,7 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
        card->dev = &pdev->dev;
        platform_set_drvdata(pdev, card);
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
                        ret);
@@ -154,12 +154,8 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
 
 static int mxs_sgtl5000_remove(struct platform_device *pdev)
 {
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
        mxs_saif_put_mclk(0);
 
-       snd_soc_unregister_card(card);
-
        return 0;
 }
 
index 39cea80846c313f552a1a39f4ba9e015b9958a5a..f2bf8661dd21f782b1d472a724d69902a56b7b57 100644 (file)
@@ -1,7 +1,6 @@
 config SND_PXA2XX_SOC
        tristate "SoC Audio for the Intel PXA2xx chip"
        depends on ARCH_PXA
-       select SND_ARM
        select SND_PXA2XX_LIB
        help
          Say Y or M if you want to add support for codecs attached to
@@ -25,7 +24,6 @@ config SND_PXA2XX_AC97
 config SND_PXA2XX_SOC_AC97
        tristate
        select AC97_BUS
-       select SND_ARM
        select SND_PXA2XX_LIB_AC97
        select SND_SOC_AC97_BUS
 
index 1f6054650991db5e55484db43e94c68f254b599e..9e4b04e0fbd12b452e270214ed2ee7ce09a31b90 100644 (file)
@@ -49,7 +49,7 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
        .reset  = pxa2xx_ac97_cold_reset,
 };
 
-static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12;
+static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 11;
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
        .addr           = __PREG(PCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
@@ -57,7 +57,7 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
        .filter_data    = &pxa2xx_ac97_pcm_stereo_in_req,
 };
 
-static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11;
+static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 12;
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
        .addr           = __PREG(PCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
index f4bf21a5539b0e0592cc6e622f7714730c22f0ef..ff8bda471b2531fede57ea0dd225bc4081d5ba16 100644 (file)
@@ -3501,7 +3501,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
 
        default:
                WARN(1, "Unknown event %d\n", event);
-               return -EINVAL;
+               ret = -EINVAL;
        }
 
 out:
index 70e4b9d8bdcdfd3fb83f37615a29fae64036d4c0..317395824cd794d093e74b98013a8f2537b89056 100644 (file)
 
 #define DPCM_MAX_BE_USERS      8
 
+/*
+ * snd_soc_dai_stream_valid() - check if a DAI supports the given stream
+ *
+ * Returns true if the DAI supports the indicated stream type.
+ */
+static bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream)
+{
+       struct snd_soc_pcm_stream *codec_stream;
+
+       if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+               codec_stream = &dai->driver->playback;
+       else
+               codec_stream = &dai->driver->capture;
+
+       /* If the codec specifies any rate at all, it supports the stream. */
+       return codec_stream->rates;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -371,6 +389,20 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_substream *substream)
 
        /* first calculate min/max only for CODECs in the DAI link */
        for (i = 0; i < rtd->num_codecs; i++) {
+
+               /*
+                * Skip CODECs which don't support the current stream type.
+                * Otherwise, since the rate, channel, and format values will
+                * zero in that case, we would have no usable settings left,
+                * causing the resulting setup to fail.
+                * At least one CODEC should match, otherwise we should have
+                * bailed out on a higher level, since there would be no
+                * CODEC to support the transfer direction in that case.
+                */
+               if (!snd_soc_dai_stream_valid(rtd->codec_dais[i],
+                                             substream->stream))
+                       continue;
+
                codec_dai_drv = rtd->codec_dais[i]->driver;
                if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                        codec_stream = &codec_dai_drv->playback;
@@ -827,6 +859,23 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
                struct snd_soc_dai *codec_dai = rtd->codec_dais[i];
                struct snd_pcm_hw_params codec_params;
 
+               /*
+                * Skip CODECs which don't support the current stream type,
+                * the idea being that if a CODEC is not used for the currently
+                * set up transfer direction, it should not need to be
+                * configured, especially since the configuration used might
+                * not even be supported by that CODEC. There may be cases
+                * however where a CODEC needs to be set up although it is
+                * actually not being used for the transfer, e.g. if a
+                * capture-only CODEC is acting as an LRCLK and/or BCLK master
+                * for the DAI link including a playback-only CODEC.
+                * If this becomes necessary, we will have to augment the
+                * machine driver setup with information on how to act, so
+                * we can do the right thing here.
+                */
+               if (!snd_soc_dai_stream_valid(codec_dai, substream->stream))
+                       continue;
+
                /* copy params for each codec */
                codec_params = *params;
 
index 362c69ac1d6c7143d1f04c622d4fad0c82811704..53dd085d3ee20fd5db326366db72054990886118 100644 (file)
@@ -101,6 +101,15 @@ static struct snd_soc_codec_driver dummy_codec;
                        SNDRV_PCM_FMTBIT_S32_LE | \
                        SNDRV_PCM_FMTBIT_U32_LE | \
                        SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
+/*
+ * The dummy CODEC is only meant to be used in situations where there is no
+ * actual hardware.
+ *
+ * If there is actual hardware even if it does not have a control bus
+ * the hardware will still have constraints like supported samplerates, etc.
+ * which should be modelled. And the data flow graph also should be modelled
+ * using DAPM.
+ */
 static struct snd_soc_dai_driver dummy_dai = {
        .name = "snd-soc-dummy-dai",
        .playback = {
index 0a53053495f3d39cf6363b2255bfa4ad629c6be0..4fb91412ebec80261adda960d0874225ed2d0192 100644 (file)
@@ -1,6 +1,6 @@
 config SND_SPEAR_SOC
        tristate
-       select SND_DMAENGINE_PCM
+       select SND_SOC_GENERIC_DMAENGINE_PCM
 
 config SND_SPEAR_SPDIF_OUT
        tristate
index f6eefe1b8f8f1c6ad28b8c5ee00ee473d0d833ef..843f037a317da31aecc0b1761ddde2dfa24a1334 100644 (file)
@@ -989,8 +989,8 @@ static int uni_player_parse_dt(struct platform_device *pdev,
        if (!info)
                return -ENOMEM;
 
-       of_property_read_u32(pnode, "version", &player->ver);
-       if (player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
+       if (of_property_read_u32(pnode, "version", &player->ver) ||
+           player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
                dev_err(dev, "Unknown uniperipheral version ");
                return -EINVAL;
        }
@@ -998,10 +998,16 @@ static int uni_player_parse_dt(struct platform_device *pdev,
        if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
                info->underflow_enabled = 1;
 
-       of_property_read_u32(pnode, "uniperiph-id", &info->id);
+       if (of_property_read_u32(pnode, "uniperiph-id", &info->id)) {
+               dev_err(dev, "uniperipheral id not defined");
+               return -EINVAL;
+       }
 
        /* Read the device mode property */
-       of_property_read_string(pnode, "mode", &mode);
+       if (of_property_read_string(pnode, "mode", &mode)) {
+               dev_err(dev, "uniperipheral mode not defined");
+               return -EINVAL;
+       }
 
        if (strcasecmp(mode, "hdmi") == 0)
                info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI;
index c502626f339b8ab27251b8e4571bc6a9e0d925fa..f791239a30872927b4c117f43ec457da6532b037 100644 (file)
@@ -316,7 +316,11 @@ static int uni_reader_parse_dt(struct platform_device *pdev,
        if (!info)
                return -ENOMEM;
 
-       of_property_read_u32(node, "version", &reader->ver);
+       if (of_property_read_u32(node, "version", &reader->ver) ||
+           reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
+               dev_err(&pdev->dev, "Unknown uniperipheral version ");
+               return -EINVAL;
+       }
 
        /* Save the info structure */
        reader->info = info;
index eb51325e8ad99adefa7671a7b511626b7c136d1d..284a76e046284983cd769da89cb45604b114a41a 100644 (file)
@@ -768,8 +768,8 @@ static int process_exit_event(struct perf_tool *tool,
        if (!evsel->attr.sample_id_all) {
                sample->cpu = 0;
                sample->time = 0;
-               sample->tid = event->comm.tid;
-               sample->pid = event->comm.pid;
+               sample->tid = event->fork.tid;
+               sample->pid = event->fork.pid;
        }
        print_sample_start(sample, thread, evsel);
        perf_event__fprintf(event, stdout);
index 1aa21c90731b3eca400d91c2fec5d2b55a127f03..5b83f56a3b6f25928337d3954d2924322d3154ef 100644 (file)
@@ -34,6 +34,8 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
                .disabled = 1,
                .freq = 1,
        };
+       struct cpu_map *cpus;
+       struct thread_map *threads;
 
        attr.sample_freq = 500;
 
@@ -50,14 +52,19 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
        }
        perf_evlist__add(evlist, evsel);
 
-       evlist->cpus = cpu_map__dummy_new();
-       evlist->threads = thread_map__new_by_tid(getpid());
-       if (!evlist->cpus || !evlist->threads) {
+       cpus = cpu_map__dummy_new();
+       threads = thread_map__new_by_tid(getpid());
+       if (!cpus || !threads) {
                err = -ENOMEM;
                pr_debug("Not enough memory to create thread/cpu maps\n");
-               goto out_delete_evlist;
+               goto out_free_maps;
        }
 
+       perf_evlist__set_maps(evlist, cpus, threads);
+
+       cpus    = NULL;
+       threads = NULL;
+
        if (perf_evlist__open(evlist)) {
                const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate";
 
@@ -107,6 +114,9 @@ next_event:
                err = -1;
        }
 
+out_free_maps:
+       cpu_map__put(cpus);
+       thread_map__put(threads);
 out_delete_evlist:
        perf_evlist__delete(evlist);
        return err;
index 3a8fedef83bc086e5328dea03dcf6107d3ff1e39..add16385f13e5bbb750cec83da3f1fe0d28889af 100644 (file)
@@ -43,6 +43,8 @@ int test__task_exit(void)
        };
        const char *argv[] = { "true", NULL };
        char sbuf[STRERR_BUFSIZE];
+       struct cpu_map *cpus;
+       struct thread_map *threads;
 
        signal(SIGCHLD, sig_handler);
 
@@ -58,14 +60,19 @@ int test__task_exit(void)
         * perf_evlist__prepare_workload we'll fill in the only thread
         * we're monitoring, the one forked there.
         */
-       evlist->cpus = cpu_map__dummy_new();
-       evlist->threads = thread_map__new_by_tid(-1);
-       if (!evlist->cpus || !evlist->threads) {
+       cpus = cpu_map__dummy_new();
+       threads = thread_map__new_by_tid(-1);
+       if (!cpus || !threads) {
                err = -ENOMEM;
                pr_debug("Not enough memory to create thread/cpu maps\n");
-               goto out_delete_evlist;
+               goto out_free_maps;
        }
 
+       perf_evlist__set_maps(evlist, cpus, threads);
+
+       cpus    = NULL;
+       threads = NULL;
+
        err = perf_evlist__prepare_workload(evlist, &target, argv, false,
                                            workload_exec_failed_signal);
        if (err < 0) {
@@ -114,6 +121,9 @@ retry:
                err = -1;
        }
 
+out_free_maps:
+       cpu_map__put(cpus);
+       thread_map__put(threads);
 out_delete_evlist:
        perf_evlist__delete(evlist);
        return err;
index cf86f2d3a5e725cb625505283af7ce80ccc13ff6..c04c60d4863ce71a08014c396aa7342c8af2fa16 100644 (file)
@@ -1968,7 +1968,8 @@ skip_annotation:
                                          &options[nr_options], dso);
                nr_options += add_map_opt(browser, &actions[nr_options],
                                          &options[nr_options],
-                                         browser->selection->map);
+                                         browser->selection ?
+                                               browser->selection->map : NULL);
 
                /* perf script support */
                if (browser->he_selection) {
@@ -1976,6 +1977,15 @@ skip_annotation:
                                                     &actions[nr_options],
                                                     &options[nr_options],
                                                     thread, NULL);
+                       /*
+                        * Note that browser->selection != NULL
+                        * when browser->he_selection is not NULL,
+                        * so we don't need to check browser->selection
+                        * before fetching browser->selection->sym like what
+                        * we do before fetching browser->selection->map.
+                        *
+                        * See hist_browser__show_entry.
+                        */
                        nr_options += add_script_opt(browser,
                                                     &actions[nr_options],
                                                     &options[nr_options],
index d51a5200c8af77b76e98c85d55f8acee8db304f0..c8fc8a258f4265c42c636d045b195a612cfae3a4 100644 (file)
@@ -124,6 +124,33 @@ void perf_evlist__delete(struct perf_evlist *evlist)
        free(evlist);
 }
 
+static void __perf_evlist__propagate_maps(struct perf_evlist *evlist,
+                                         struct perf_evsel *evsel)
+{
+       /*
+        * We already have cpus for evsel (via PMU sysfs) so
+        * keep it, if there's no target cpu list defined.
+        */
+       if (!evsel->own_cpus || evlist->has_user_cpus) {
+               cpu_map__put(evsel->cpus);
+               evsel->cpus = cpu_map__get(evlist->cpus);
+       } else if (evsel->cpus != evsel->own_cpus) {
+               cpu_map__put(evsel->cpus);
+               evsel->cpus = cpu_map__get(evsel->own_cpus);
+       }
+
+       thread_map__put(evsel->threads);
+       evsel->threads = thread_map__get(evlist->threads);
+}
+
+static void perf_evlist__propagate_maps(struct perf_evlist *evlist)
+{
+       struct perf_evsel *evsel;
+
+       evlist__for_each(evlist, evsel)
+               __perf_evlist__propagate_maps(evlist, evsel);
+}
+
 void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry)
 {
        entry->evlist = evlist;
@@ -133,18 +160,19 @@ void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry)
 
        if (!evlist->nr_entries++)
                perf_evlist__set_id_pos(evlist);
+
+       __perf_evlist__propagate_maps(evlist, entry);
 }
 
 void perf_evlist__splice_list_tail(struct perf_evlist *evlist,
-                                  struct list_head *list,
-                                  int nr_entries)
+                                  struct list_head *list)
 {
-       bool set_id_pos = !evlist->nr_entries;
+       struct perf_evsel *evsel, *temp;
 
-       list_splice_tail(list, &evlist->entries);
-       evlist->nr_entries += nr_entries;
-       if (set_id_pos)
-               perf_evlist__set_id_pos(evlist);
+       __evlist__for_each_safe(list, temp, evsel) {
+               list_del_init(&evsel->node);
+               perf_evlist__add(evlist, evsel);
+       }
 }
 
 void __perf_evlist__set_leader(struct list_head *list)
@@ -210,7 +238,7 @@ static int perf_evlist__add_attrs(struct perf_evlist *evlist,
                list_add_tail(&evsel->node, &head);
        }
 
-       perf_evlist__splice_list_tail(evlist, &head, nr_attrs);
+       perf_evlist__splice_list_tail(evlist, &head);
 
        return 0;
 
@@ -1103,71 +1131,56 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
        return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false);
 }
 
-static int perf_evlist__propagate_maps(struct perf_evlist *evlist,
-                                      bool has_user_cpus)
-{
-       struct perf_evsel *evsel;
-
-       evlist__for_each(evlist, evsel) {
-               /*
-                * We already have cpus for evsel (via PMU sysfs) so
-                * keep it, if there's no target cpu list defined.
-                */
-               if (evsel->cpus && has_user_cpus)
-                       cpu_map__put(evsel->cpus);
-
-               if (!evsel->cpus || has_user_cpus)
-                       evsel->cpus = cpu_map__get(evlist->cpus);
-
-               evsel->threads = thread_map__get(evlist->threads);
-
-               if ((evlist->cpus && !evsel->cpus) ||
-                   (evlist->threads && !evsel->threads))
-                       return -ENOMEM;
-       }
-
-       return 0;
-}
-
 int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
 {
-       evlist->threads = thread_map__new_str(target->pid, target->tid,
-                                             target->uid);
+       struct cpu_map *cpus;
+       struct thread_map *threads;
+
+       threads = thread_map__new_str(target->pid, target->tid, target->uid);
 
-       if (evlist->threads == NULL)
+       if (!threads)
                return -1;
 
        if (target__uses_dummy_map(target))
-               evlist->cpus = cpu_map__dummy_new();
+               cpus = cpu_map__dummy_new();
        else
-               evlist->cpus = cpu_map__new(target->cpu_list);
+               cpus = cpu_map__new(target->cpu_list);
 
-       if (evlist->cpus == NULL)
+       if (!cpus)
                goto out_delete_threads;
 
-       return perf_evlist__propagate_maps(evlist, !!target->cpu_list);
+       evlist->has_user_cpus = !!target->cpu_list;
+
+       perf_evlist__set_maps(evlist, cpus, threads);
+
+       return 0;
 
 out_delete_threads:
-       thread_map__put(evlist->threads);
-       evlist->threads = NULL;
+       thread_map__put(threads);
        return -1;
 }
 
-int perf_evlist__set_maps(struct perf_evlist *evlist,
-                         struct cpu_map *cpus,
-                         struct thread_map *threads)
+void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus,
+                          struct thread_map *threads)
 {
-       if (evlist->cpus)
+       /*
+        * Allow for the possibility that one or another of the maps isn't being
+        * changed i.e. don't put it.  Note we are assuming the maps that are
+        * being applied are brand new and evlist is taking ownership of the
+        * original reference count of 1.  If that is not the case it is up to
+        * the caller to increase the reference count.
+        */
+       if (cpus != evlist->cpus) {
                cpu_map__put(evlist->cpus);
+               evlist->cpus = cpus;
+       }
 
-       evlist->cpus = cpus;
-
-       if (evlist->threads)
+       if (threads != evlist->threads) {
                thread_map__put(evlist->threads);
+               evlist->threads = threads;
+       }
 
-       evlist->threads = threads;
-
-       return perf_evlist__propagate_maps(evlist, false);
+       perf_evlist__propagate_maps(evlist);
 }
 
 int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel)
@@ -1387,6 +1400,8 @@ void perf_evlist__close(struct perf_evlist *evlist)
 
 static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist)
 {
+       struct cpu_map    *cpus;
+       struct thread_map *threads;
        int err = -ENOMEM;
 
        /*
@@ -1398,20 +1413,19 @@ static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist)
         * error, and we may not want to do that fallback to a
         * default cpu identity map :-\
         */
-       evlist->cpus = cpu_map__new(NULL);
-       if (evlist->cpus == NULL)
+       cpus = cpu_map__new(NULL);
+       if (!cpus)
                goto out;
 
-       evlist->threads = thread_map__new_dummy();
-       if (evlist->threads == NULL)
-               goto out_free_cpus;
+       threads = thread_map__new_dummy();
+       if (!threads)
+               goto out_put;
 
-       err = 0;
+       perf_evlist__set_maps(evlist, cpus, threads);
 out:
        return err;
-out_free_cpus:
-       cpu_map__put(evlist->cpus);
-       evlist->cpus = NULL;
+out_put:
+       cpu_map__put(cpus);
        goto out;
 }
 
index b39a6198f4ac00ae4c30cdfe659667cc84db7780..115d8b53c6010a5a1d466b04535245d9fd8f8579 100644 (file)
@@ -42,6 +42,7 @@ struct perf_evlist {
        int              nr_mmaps;
        bool             overwrite;
        bool             enabled;
+       bool             has_user_cpus;
        size_t           mmap_len;
        int              id_pos;
        int              is_pos;
@@ -155,9 +156,8 @@ int perf_evlist__enable_event_idx(struct perf_evlist *evlist,
 void perf_evlist__set_selected(struct perf_evlist *evlist,
                               struct perf_evsel *evsel);
 
-int perf_evlist__set_maps(struct perf_evlist *evlist,
-                         struct cpu_map *cpus,
-                         struct thread_map *threads);
+void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus,
+                          struct thread_map *threads);
 int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target);
 int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel);
 
@@ -179,8 +179,7 @@ bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist);
 bool perf_evlist__valid_read_format(struct perf_evlist *evlist);
 
 void perf_evlist__splice_list_tail(struct perf_evlist *evlist,
-                                  struct list_head *list,
-                                  int nr_entries);
+                                  struct list_head *list);
 
 static inline struct perf_evsel *perf_evlist__first(struct perf_evlist *evlist)
 {
index c53f79123b37f4ab506f3a914263d59c3122cfb6..5410483d52198c5909ec5a502c61567c5119c8ef 100644 (file)
@@ -1033,6 +1033,7 @@ void perf_evsel__exit(struct perf_evsel *evsel)
        perf_evsel__free_config_terms(evsel);
        close_cgroup(evsel->cgrp);
        cpu_map__put(evsel->cpus);
+       cpu_map__put(evsel->own_cpus);
        thread_map__put(evsel->threads);
        zfree(&evsel->group_name);
        zfree(&evsel->name);
index 298e6bbca200bd4740bddc4e6bb1fce7414d5bf4..ef8925f7211a4a311c927e6919d83817745eb1cf 100644 (file)
@@ -98,6 +98,7 @@ struct perf_evsel {
        struct cgroup_sel       *cgrp;
        void                    *handler;
        struct cpu_map          *cpus;
+       struct cpu_map          *own_cpus;
        struct thread_map       *threads;
        unsigned int            sample_size;
        int                     id_pos;
index 41814547da159a14ac00eca8c774f3a46ae20558..fce6634aebe25d19d126120ec1e6e4dd323be46a 100644 (file)
@@ -1438,7 +1438,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused,
        if (ph->needs_swap)
                nr = bswap_32(nr);
 
-       ph->env.nr_cpus_online = nr;
+       ph->env.nr_cpus_avail = nr;
 
        ret = readn(fd, &nr, sizeof(nr));
        if (ret != sizeof(nr))
@@ -1447,7 +1447,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused,
        if (ph->needs_swap)
                nr = bswap_32(nr);
 
-       ph->env.nr_cpus_avail = nr;
+       ph->env.nr_cpus_online = nr;
        return 0;
 }
 
index ea768625ab5b39eaf8ce59059e10349eb7ecd34a..eb0e7f8bf5158c98c95216d4fb9d3eb96568c50b 100644 (file)
@@ -623,7 +623,7 @@ static int intel_bts_process_event(struct perf_session *session,
        if (err)
                return err;
        if (event->header.type == PERF_RECORD_EXIT) {
-               err = intel_bts_process_tid_exit(bts, event->comm.tid);
+               err = intel_bts_process_tid_exit(bts, event->fork.tid);
                if (err)
                        return err;
        }
index bb41c20e6005e1a2d986656fc94eead62de7a4ee..535d86f8e4d17b802a4c0473a7bf7ff937a10b15 100644 (file)
@@ -1494,7 +1494,7 @@ static int intel_pt_process_event(struct perf_session *session,
        if (pt->timeless_decoding) {
                if (event->header.type == PERF_RECORD_EXIT) {
                        err = intel_pt_process_timeless_queues(pt,
-                                                              event->comm.tid,
+                                                              event->fork.tid,
                                                               sample->time);
                }
        } else if (timestamp) {
index d826e6f515db12a3f75517bf93437eb9d0043829..21ed6ee63da9747d1215ac638f936357c8df2e8c 100644 (file)
@@ -287,8 +287,8 @@ __add_event(struct list_head *list, int *idx,
        if (!evsel)
                return NULL;
 
-       if (cpus)
-               evsel->cpus = cpu_map__get(cpus);
+       evsel->cpus     = cpu_map__get(cpus);
+       evsel->own_cpus = cpu_map__get(cpus);
 
        if (name)
                evsel->name = strdup(name);
@@ -1140,10 +1140,9 @@ int parse_events(struct perf_evlist *evlist, const char *str,
        ret = parse_events__scanner(str, &data, PE_START_EVENTS);
        perf_pmu__parse_cleanup();
        if (!ret) {
-               int entries = data.idx - evlist->nr_entries;
                struct perf_evsel *last;
 
-               perf_evlist__splice_list_tail(evlist, &data.list, entries);
+               perf_evlist__splice_list_tail(evlist, &data.list);
                evlist->nr_groups += data.nr_groups;
                last = perf_evlist__last(evlist);
                last->cmdline_group_boundary = true;
index 591905a02b926b6029447a372f2e5f7b7d34864a..9cd70819c7950e2de1aaae29a17b0f951b593bda 100644 (file)
@@ -255,7 +255,7 @@ PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc
        list_add_tail(&term->list, head);
 
        ALLOC_LIST(list);
-       ABORT_ON(parse_events_add_pmu(list, &data->idx, "cpu", head));
+       ABORT_ON(parse_events_add_pmu(data, list, "cpu", head));
        parse_events__free_terms(head);
        $$ = list;
 }
index 89b05e2222c913ff47e12673e9850616f585dbf9..cfe121353eec3cd5608e43d1c98144591aceae37 100644 (file)
@@ -16,12 +16,12 @@ TARGETS += powerpc
 TARGETS += ptrace
 TARGETS += seccomp
 TARGETS += size
+TARGETS += static_keys
 TARGETS += sysctl
 ifneq (1, $(quicktest))
 TARGETS += timers
 endif
 TARGETS += user
-TARGETS += jumplabel
 TARGETS += vm
 TARGETS += x86
 TARGETS += zram
index 6b76bfdc847ea58879cc52ccfa2b77ebd296150d..4e400eb83657ce5f35dac44300d61e58244af820 100644 (file)
@@ -1,6 +1,6 @@
 CFLAGS = -Wall
 BINARIES = execveat
-DEPS = execveat.symlink execveat.denatured script
+DEPS = execveat.symlink execveat.denatured script subdir
 all: $(BINARIES) $(DEPS)
 
 subdir:
@@ -22,7 +22,5 @@ TEST_FILES := $(DEPS)
 
 include ../lib.mk
 
-override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
-
 clean:
        rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
index 0acbeca472255f01bf6a987739f2b8d32213095f..4e6ed13e7f66150de10a8f645eff508fc0565cff 100644 (file)
@@ -1,7 +1,7 @@
 all:
 
 TEST_PROGS := ftracetest
-TEST_DIRS := test.d/
+TEST_DIRS := test.d
 
 include ../lib.mk
 
index 97f1c6742066352c6fd0a32599ecff93b3896499..50a93f5f13d64d5b0f9b4851d03f955da9b6e1d9 100644 (file)
@@ -12,13 +12,10 @@ run_tests: all
        $(RUN_TESTS)
 
 define INSTALL_RULE
-       @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then                        \
-               mkdir -p $(INSTALL_PATH);                                                               \
-               for TEST_DIR in $(TEST_DIRS); do                                                        \
-                       cp -r $$TEST_DIR $(INSTALL_PATH);                                               \
-               done;                                                                                   \
-               echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";   \
-               install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);          \
+       @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then                                        \
+               mkdir -p ${INSTALL_PATH};                                                                               \
+               echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/";       \
+               rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/;              \
        fi
 endef
 
index 0e3b41eb85cde2cd553bda36ac0b09f43553ceb8..eebac29acbd91fc6d10b6258f006834834e4b243 100644 (file)
@@ -1,8 +1,8 @@
-CFLAGS = -O2
+CFLAGS += -O2
+LDLIBS = -lrt -lpthread -lpopt
+TEST_PROGS := mq_open_tests mq_perf_tests
 
-all:
-       $(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt
-       $(CC) $(CFLAGS) -o mq_perf_tests mq_perf_tests.c -lrt -lpthread -lpopt
+all: $(TEST_PROGS)
 
 include ../lib.mk
 
@@ -11,8 +11,6 @@ override define RUN_TESTS
        @./mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]"
 endef
 
-TEST_PROGS := mq_open_tests mq_perf_tests
-
 override define EMIT_TESTS
        echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\""
        echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\""
index a004b4cce99ef3098005ea4b4607cc825f46b667..770f47adf2958b9970b993d2fee57c489a9cd1e2 100644 (file)
@@ -1210,6 +1210,10 @@ TEST_F(TRACE_poke, getpid_runs_normally)
 # define ARCH_REGS     struct pt_regs
 # define SYSCALL_NUM   gpr[0]
 # define SYSCALL_RET   gpr[3]
+#elif defined(__s390__)
+# define ARCH_REGS     s390_regs
+# define SYSCALL_NUM   gprs[2]
+# define SYSCALL_RET   gprs[2]
 #else
 # error "Do not know how to find your architecture's registers and syscalls"
 #endif
@@ -1243,7 +1247,8 @@ void change_syscall(struct __test_metadata *_metadata,
        ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov);
        EXPECT_EQ(0, ret);
 
-#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || \
+    defined(__powerpc__) || defined(__s390__)
        {
                regs.SYSCALL_NUM = syscall;
        }
@@ -1281,17 +1286,21 @@ void tracer_syscall(struct __test_metadata *_metadata, pid_t tracee,
        ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg);
        EXPECT_EQ(0, ret);
 
+       /* Validate and take action on expected syscalls. */
        switch (msg) {
        case 0x1002:
                /* change getpid to getppid. */
+               EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee));
                change_syscall(_metadata, tracee, __NR_getppid);
                break;
        case 0x1003:
                /* skip gettid. */
+               EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee));
                change_syscall(_metadata, tracee, -1);
                break;
        case 0x1004:
                /* do nothing (allow getppid) */
+               EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee));
                break;
        default:
                EXPECT_EQ(0, msg) {
@@ -1409,6 +1418,8 @@ TEST_F(TRACE_syscall, syscall_dropped)
 #  define __NR_seccomp 277
 # elif defined(__powerpc__)
 #  define __NR_seccomp 358
+# elif defined(__s390__)
+#  define __NR_seccomp 348
 # else
 #  warning "seccomp syscall number unknown for this architecture"
 #  define __NR_seccomp 0xffff
@@ -1453,6 +1464,9 @@ TEST(seccomp_syscall)
 
        /* Reject insane operation. */
        ret = seccomp(-1, 0, &prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        EXPECT_EQ(EINVAL, errno) {
                TH_LOG("Did not reject crazy op value!");
        }
@@ -1501,6 +1515,9 @@ TEST(seccomp_syscall_mode_lock)
        }
 
        ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        EXPECT_EQ(0, ret) {
                TH_LOG("Could not install filter!");
        }
@@ -1535,6 +1552,9 @@ TEST(TSYNC_first)
 
        ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
                      &prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        EXPECT_EQ(0, ret) {
                TH_LOG("Could not install initial filter with TSYNC!");
        }
@@ -1694,6 +1714,9 @@ TEST_F(TSYNC, siblings_fail_prctl)
 
        /* Check prctl failure detection by requesting sib 0 diverge. */
        ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        ASSERT_EQ(0, ret) {
                TH_LOG("setting filter failed");
        }
@@ -1731,6 +1754,9 @@ TEST_F(TSYNC, two_siblings_with_ancestor)
        }
 
        ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        ASSERT_EQ(0, ret) {
                TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
        }
@@ -1805,6 +1831,9 @@ TEST_F(TSYNC, two_siblings_with_no_filter)
 
        ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
                      &self->apply_prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        ASSERT_EQ(0, ret) {
                TH_LOG("Could install filter on all threads!");
        }
@@ -1833,6 +1862,9 @@ TEST_F(TSYNC, two_siblings_with_one_divergence)
        }
 
        ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        ASSERT_EQ(0, ret) {
                TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
        }
@@ -1890,6 +1922,9 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
        }
 
        ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog);
+       ASSERT_NE(ENOSYS, errno) {
+               TH_LOG("Kernel does not support seccomp syscall!");
+       }
        ASSERT_EQ(0, ret) {
                TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
        }
index 977a6afc448921858992bb02249f1855a5730ae7..fb2841601f2fe39b8922c5aa2e163993c9dd5d1f 100644 (file)
        __typeof__(_expected) __exp = (_expected); \
        __typeof__(_seen) __seen = (_seen); \
        if (!(__exp _t __seen)) { \
-               unsigned long long __exp_print = 0; \
-               unsigned long long __seen_print = 0; \
-               /* Avoid casting complaints the scariest way we can. */ \
-               memcpy(&__exp_print, &__exp, sizeof(__exp)); \
-               memcpy(&__seen_print, &__seen, sizeof(__seen)); \
+               unsigned long long __exp_print = (unsigned long long)__exp; \
+               unsigned long long __seen_print = (unsigned long long)__seen; \
                __TH_LOG("Expected %s (%llu) %s %s (%llu)", \
                         #_expected, __exp_print, #_t, \
                         #_seen, __seen_print); \
index 9a43a59a9bb46b2944b20b26f1af6e8e405b5764..421c607a8856887d0f9f6048c2ab26bd9367efdd 100644 (file)
@@ -116,8 +116,9 @@ static bool do_test(struct vm86plus_struct *v86, unsigned long eip,
        v86->regs.eip = eip;
        ret = vm86(VM86_ENTER, v86);
 
-       if (ret == -1 && errno == ENOSYS) {
-               printf("[SKIP]\tvm86 not supported\n");
+       if (ret == -1 && (errno == ENOSYS || errno == EPERM)) {
+               printf("[SKIP]\tvm86 %s\n",
+                      errno == ENOSYS ? "not supported" : "not allowed");
                return false;
        }
 
index 20de9a7612692cc007035055a5b559993b5b8e1d..683a292e329015f3044194e753dd9fa9c62ba48a 100755 (executable)
@@ -1,15 +1,7 @@
 #!/bin/bash
 TCID="zram.sh"
 
-check_prereqs()
-{
-       local msg="skip all tests:"
-
-       if [ $UID != 0 ]; then
-               echo $msg must be run as root >&2
-               exit 0
-       fi
-}
+. ./zram_lib.sh
 
 run_zram () {
 echo "--------------------"
index 424e68ed1487d86cd7d6c62e28348251781f6500..f6a9c73e7a442e7988b0820ebc809a342981df91 100755 (executable)
@@ -23,8 +23,9 @@ trap INT
 check_prereqs()
 {
        local msg="skip all tests:"
+       local uid=$(id -u)
 
-       if [ $UID != 0 ]; then
+       if [ $uid -ne 0 ]; then
                echo $msg must be run as root >&2
                exit 0
        fi
index 505ad51b3b51bec2281fe44dce5786c0fe79088f..39c89a5ea990fab23fbccfd8a6cfa3952502bf98 100644 (file)
@@ -6,7 +6,7 @@ vringh_test: vringh_test.o vringh.o virtio_ring.o
 CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
 vpath %.c ../../drivers/virtio ../../drivers/vhost
 mod:
-       ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
+       ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
 .PHONY: all test mod clean
 clean:
        ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \
index aff61e13306c7bba01f143802a63d6d866f31cf5..26b7926bda8849a8b931fff6750a3ed8217dae89 100644 (file)
@@ -3,6 +3,8 @@
 #define mb() __sync_synchronize()
 
 #define smp_mb()       mb()
+# define dma_rmb()     barrier()
+# define dma_wmb()     barrier()
 # define smp_rmb()     barrier()
 # define smp_wmb()     barrier()
 /* Weak barriers should be used. If not - it's a bug */
diff --git a/tools/virtio/linux/export.h b/tools/virtio/linux/export.h
new file mode 100644 (file)
index 0000000..416875e
--- /dev/null
@@ -0,0 +1,3 @@
+#define EXPORT_SYMBOL_GPL(sym) extern typeof(sym) sym
+#define EXPORT_SYMBOL(sym) extern typeof(sym) sym
+
index 1e8ce6979c1e5e0bd30b5424a1a1cf8b3063bf12..0a3da64638ceda0e94df98f9651fc241ae1f34c1 100644 (file)
@@ -22,6 +22,7 @@
 
 typedef unsigned long long dma_addr_t;
 typedef size_t __kernel_size_t;
+typedef unsigned int __wsum;
 
 struct page {
        unsigned long long dummy;
@@ -47,6 +48,13 @@ static inline void *kmalloc(size_t s, gfp_t gfp)
                return __kmalloc_fake;
        return malloc(s);
 }
+static inline void *kzalloc(size_t s, gfp_t gfp)
+{
+       void *p = kmalloc(s, gfp);
+
+       memset(p, 0, s);
+       return p;
+}
 
 static inline void kfree(void *p)
 {
index 76e38d231e9959d085673b4eda7e4065f4a7fbb7..48c6e1ac6827f14be7eaede56bfd1ae3d185d217 100644 (file)
@@ -199,6 +199,14 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
         */
        timer->irq = irq;
 
+       /*
+        * The bits in CNTV_CTL are architecturally reset to UNKNOWN for ARMv8
+        * and to 0 for ARMv7.  We provide an implementation that always
+        * resets the timer to be disabled and unmasked and is compliant with
+        * the ARMv7 architecture.
+        */
+       timer->cntv_ctl = 0;
+
        /*
         * Tell the VGIC that the virtual interrupt is tied to a
         * physical interrupt. We do that once per VCPU.
index afbf925b00f4ff079ea28925174e1998e54c44d1..7dd5d62f10a196a4b2fe4bb8f4bc340bf69484bc 100644 (file)
@@ -288,7 +288,7 @@ int vgic_v3_probe(struct device_node *vgic_node,
 
        vgic->vctrl_base = NULL;
        vgic->type = VGIC_V3;
-       vgic->max_gic_vcpus = KVM_MAX_VCPUS;
+       vgic->max_gic_vcpus = VGIC_V3_MAX_CPUS;
 
        kvm_info("%s@%llx IRQ%d\n", vgic_node->name,
                 vcpu_res.start, vgic->maint_irq);
index 9eb489a2c94c2b5ef07146a01ec9ac943034065c..6bd1c9bf7ae71504d042f455bce8ad9ca6abf6fc 100644 (file)
@@ -1144,26 +1144,11 @@ static void vgic_queue_irq_to_lr(struct kvm_vcpu *vcpu, int irq,
                struct irq_phys_map *map;
                map = vgic_irq_map_search(vcpu, irq);
 
-               /*
-                * If we have a mapping, and the virtual interrupt is
-                * being injected, then we must set the state to
-                * active in the physical world. Otherwise the
-                * physical interrupt will fire and the guest will
-                * exit before processing the virtual interrupt.
-                */
                if (map) {
-                       int ret;
-
-                       BUG_ON(!map->active);
                        vlr.hwirq = map->phys_irq;
                        vlr.state |= LR_HW;
                        vlr.state &= ~LR_EOI_INT;
 
-                       ret = irq_set_irqchip_state(map->irq,
-                                                   IRQCHIP_STATE_ACTIVE,
-                                                   true);
-                       WARN_ON(ret);
-
                        /*
                         * Make sure we're not going to sample this
                         * again, as a HW-backed interrupt cannot be
@@ -1255,7 +1240,7 @@ static void __kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu)
        struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
        struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
        unsigned long *pa_percpu, *pa_shared;
-       int i, vcpu_id;
+       int i, vcpu_id, lr, ret;
        int overflow = 0;
        int nr_shared = vgic_nr_shared_irqs(dist);
 
@@ -1310,6 +1295,31 @@ epilog:
                 */
                clear_bit(vcpu_id, dist->irq_pending_on_cpu);
        }
+
+       for (lr = 0; lr < vgic->nr_lr; lr++) {
+               struct vgic_lr vlr;
+
+               if (!test_bit(lr, vgic_cpu->lr_used))
+                       continue;
+
+               vlr = vgic_get_lr(vcpu, lr);
+
+               /*
+                * If we have a mapping, and the virtual interrupt is
+                * presented to the guest (as pending or active), then we must
+                * set the state to active in the physical world. See
+                * Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt.
+                */
+               if (vlr.state & LR_HW) {
+                       struct irq_phys_map *map;
+                       map = vgic_irq_map_search(vcpu, vlr.irq);
+
+                       ret = irq_set_irqchip_state(map->irq,
+                                                   IRQCHIP_STATE_ACTIVE,
+                                                   true);
+                       WARN_ON(ret);
+               }
+       }
 }
 
 static bool vgic_process_maintenance(struct kvm_vcpu *vcpu)
index 5cbf190d238cd083e128ae9ec78da52b745d6338..6bca74ca533109a5e23ec40b045286095400ebad 100644 (file)
@@ -24,9 +24,9 @@ struct kvm_coalesced_mmio_dev {
 int kvm_coalesced_mmio_init(struct kvm *kvm);
 void kvm_coalesced_mmio_free(struct kvm *kvm);
 int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm,
-                                                                                                                                                               struct kvm_coalesced_mmio_zone *zone);
+                                       struct kvm_coalesced_mmio_zone *zone);
 int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
-                                                                                                                                                               struct kvm_coalesced_mmio_zone *zone);
+                                       struct kvm_coalesced_mmio_zone *zone);
 
 #else
 
index 9ff4193dfa493c3e226c3fd554061b171ca7b9c5..79db45336e3a25cb15696ca8659a87572e168585 100644 (file)
@@ -771,40 +771,14 @@ static enum kvm_bus ioeventfd_bus_from_flags(__u32 flags)
        return KVM_MMIO_BUS;
 }
 
-static int
-kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
+static int kvm_assign_ioeventfd_idx(struct kvm *kvm,
+                               enum kvm_bus bus_idx,
+                               struct kvm_ioeventfd *args)
 {
-       enum kvm_bus              bus_idx;
-       struct _ioeventfd        *p;
-       struct eventfd_ctx       *eventfd;
-       int                       ret;
-
-       bus_idx = ioeventfd_bus_from_flags(args->flags);
-       /* must be natural-word sized, or 0 to ignore length */
-       switch (args->len) {
-       case 0:
-       case 1:
-       case 2:
-       case 4:
-       case 8:
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       /* check for range overflow */
-       if (args->addr + args->len < args->addr)
-               return -EINVAL;
 
-       /* check for extra flags that we don't understand */
-       if (args->flags & ~KVM_IOEVENTFD_VALID_FLAG_MASK)
-               return -EINVAL;
-
-       /* ioeventfd with no length can't be combined with DATAMATCH */
-       if (!args->len &&
-           args->flags & (KVM_IOEVENTFD_FLAG_PIO |
-                          KVM_IOEVENTFD_FLAG_DATAMATCH))
-               return -EINVAL;
+       struct eventfd_ctx *eventfd;
+       struct _ioeventfd *p;
+       int ret;
 
        eventfd = eventfd_ctx_fdget(args->fd);
        if (IS_ERR(eventfd))
@@ -843,16 +817,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
        if (ret < 0)
                goto unlock_fail;
 
-       /* When length is ignored, MMIO is also put on a separate bus, for
-        * faster lookups.
-        */
-       if (!args->len && !(args->flags & KVM_IOEVENTFD_FLAG_PIO)) {
-               ret = kvm_io_bus_register_dev(kvm, KVM_FAST_MMIO_BUS,
-                                             p->addr, 0, &p->dev);
-               if (ret < 0)
-                       goto register_fail;
-       }
-
        kvm->buses[bus_idx]->ioeventfd_count++;
        list_add_tail(&p->list, &kvm->ioeventfds);
 
@@ -860,8 +824,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
 
        return 0;
 
-register_fail:
-       kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev);
 unlock_fail:
        mutex_unlock(&kvm->slots_lock);
 
@@ -873,14 +835,13 @@ fail:
 }
 
 static int
-kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
+kvm_deassign_ioeventfd_idx(struct kvm *kvm, enum kvm_bus bus_idx,
+                          struct kvm_ioeventfd *args)
 {
-       enum kvm_bus              bus_idx;
        struct _ioeventfd        *p, *tmp;
        struct eventfd_ctx       *eventfd;
        int                       ret = -ENOENT;
 
-       bus_idx = ioeventfd_bus_from_flags(args->flags);
        eventfd = eventfd_ctx_fdget(args->fd);
        if (IS_ERR(eventfd))
                return PTR_ERR(eventfd);
@@ -901,10 +862,6 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
                        continue;
 
                kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev);
-               if (!p->length) {
-                       kvm_io_bus_unregister_dev(kvm, KVM_FAST_MMIO_BUS,
-                                                 &p->dev);
-               }
                kvm->buses[bus_idx]->ioeventfd_count--;
                ioeventfd_release(p);
                ret = 0;
@@ -918,6 +875,71 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
        return ret;
 }
 
+static int kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
+{
+       enum kvm_bus bus_idx = ioeventfd_bus_from_flags(args->flags);
+       int ret = kvm_deassign_ioeventfd_idx(kvm, bus_idx, args);
+
+       if (!args->len && bus_idx == KVM_MMIO_BUS)
+               kvm_deassign_ioeventfd_idx(kvm, KVM_FAST_MMIO_BUS, args);
+
+       return ret;
+}
+
+static int
+kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
+{
+       enum kvm_bus              bus_idx;
+       int ret;
+
+       bus_idx = ioeventfd_bus_from_flags(args->flags);
+       /* must be natural-word sized, or 0 to ignore length */
+       switch (args->len) {
+       case 0:
+       case 1:
+       case 2:
+       case 4:
+       case 8:
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* check for range overflow */
+       if (args->addr + args->len < args->addr)
+               return -EINVAL;
+
+       /* check for extra flags that we don't understand */
+       if (args->flags & ~KVM_IOEVENTFD_VALID_FLAG_MASK)
+               return -EINVAL;
+
+       /* ioeventfd with no length can't be combined with DATAMATCH */
+       if (!args->len &&
+           args->flags & (KVM_IOEVENTFD_FLAG_PIO |
+                          KVM_IOEVENTFD_FLAG_DATAMATCH))
+               return -EINVAL;
+
+       ret = kvm_assign_ioeventfd_idx(kvm, bus_idx, args);
+       if (ret)
+               goto fail;
+
+       /* When length is ignored, MMIO is also put on a separate bus, for
+        * faster lookups.
+        */
+       if (!args->len && bus_idx == KVM_MMIO_BUS) {
+               ret = kvm_assign_ioeventfd_idx(kvm, KVM_FAST_MMIO_BUS, args);
+               if (ret < 0)
+                       goto fast_fail;
+       }
+
+       return 0;
+
+fast_fail:
+       kvm_deassign_ioeventfd_idx(kvm, bus_idx, args);
+fail:
+       return ret;
+}
+
 int
 kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
 {
index a25a73147f714458dd6c55fe7426649f9dd5baa2..04146a2e1d8191e3e152954824594555884f5f6d 100644 (file)
@@ -2004,6 +2004,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
        if (vcpu->halt_poll_ns) {
                ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);
 
+               ++vcpu->stat.halt_attempted_poll;
                do {
                        /*
                         * This sets KVM_REQ_UNHALT if an interrupt
@@ -2043,7 +2044,8 @@ out:
                else if (vcpu->halt_poll_ns < halt_poll_ns &&
                        block_ns < halt_poll_ns)
                        grow_halt_poll_ns(vcpu);
-       }
+       } else
+               vcpu->halt_poll_ns = 0;
 
        trace_kvm_vcpu_wakeup(block_ns, waited);
 }
@@ -3156,10 +3158,25 @@ static void kvm_io_bus_destroy(struct kvm_io_bus *bus)
 static inline int kvm_io_bus_cmp(const struct kvm_io_range *r1,
                                 const struct kvm_io_range *r2)
 {
-       if (r1->addr < r2->addr)
+       gpa_t addr1 = r1->addr;
+       gpa_t addr2 = r2->addr;
+
+       if (addr1 < addr2)
                return -1;
-       if (r1->addr + r1->len > r2->addr + r2->len)
+
+       /* If r2->len == 0, match the exact address.  If r2->len != 0,
+        * accept any overlapping write.  Any order is acceptable for
+        * overlapping ranges, because kvm_io_bus_get_first_dev ensures
+        * we process all of them.
+        */
+       if (r2->len) {
+               addr1 += r1->len;
+               addr2 += r2->len;
+       }
+
+       if (addr1 > addr2)
                return 1;
+
        return 0;
 }