All of lore.kernel.org
 help / color / mirror / Atom feed
* [MODERATED] [PATCH v6 00/43] MDSv6
@ 2019-02-24 15:07 Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 01/43] MDSv6 Andi Kleen
                   ` (42 more replies)
  0 siblings, 43 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Here's a new version of flushing CPU buffers for group 4
for single thread.

I would be mainly interested in feedback on the lazy approach,
so please focus on the later patches.

There didn't seem to be much interest in it, so I wonder
if it still makes sense to continue with it? Or could
we just stay with the full approach?

The lazy approach is faster, but not by that much
and may not be worth the short and long term impact
all over the tree.

This version is based on my earlier base patches, with the 
mds=full implementation being at the beginning, and a lazy
implementation building on top of it. The patch can
be rebased on the rewrite once it matures.

Even the base has some features not in Thomas' version which would
need to be ported (e.g. more complete virtualization support
and EBPF mitigation)

This patch implements the "full tree audit" approach that
was suggested by several reviewers. We (me and Mark Gross) 
went through most asynchronous code in the kernel and marked the
functions that touch user or IO data. This leaves most asynchronous
interrupts etc. to not schedule a clear. However this would
need to be continuously enforced for new code too.

It also implements various other review suggestions
and improvements. clearcpu.txt is now clarified in many ways.

Before reviewing please read Documentation/clearcpu.txt

Some performance data for lazy:  

Kernel build: 		~+1%   (slightly faster, but that's within noise)
loopback apache	      	 -1%   (within noise)
ebizzy           	-0.3%  (within noise)
aim7		        -5.0%
netperf rr 	        -0.7%
netperf stream		 0.0%

In comparison an older version of mds=full showed:

kernel build	        -2.4%
ebizzy			-3.3%
apache loopback	       -10.0%

For networking workloads there is practically no regression now.
AIM7 is showing some regression. I assume this is due to the context
switch overhead.

mds=full is a bit slower, but not that much. The only real outlier is
apache loopback, which is probably not too realistic a workload
because it mainly does tight loops over some syscalls.

No changelog against previous versions, too many changes.

Andi Kleen (42):
  x86/speculation/mds: Add basic bug infrastructure for MDS
  x86/speculation/mds: Clear CPU on every kernel exit
  x86/speculation/mds: Clear CPU buffers on entering idle
  x86/speculation/mds: Add command line options to control mds
  x86/speculation/mds: Add sysfs reporting
  mds: Add some administrator documentation
  x86/speculation/mds: Export MD_CLEAR CPUID to KVM guests.
  x86/cpufeatures: Add word 20 for additional features
  x86/speculation/mds: Handle VMENTRY clear for CPUs without l1tf
  mds: Add documentation for clear cpu usage
  x86/speculation/mds: Introduce lazy_clear_cpu
  x86/speculation/mds: Add basic implementation of mds=full
  x86/speculation/mds: Check lazy clear in kernel exit
  x86/speculation/mds: Add tracing for clear_cpu
  x86/speculation/mds: Schedule cpu clear on context switch
  mds: Force clear cpu on kernel preemption
  mds: Clear cpu in memzero_explicit and kzfree
  mds: Support cpu clear in interrupts
  mds: Support cpu clear after tasklets
  mds: Support cpu clearing in timers
  mds: Clear cpu for string io/memcpy_*io in interrupts
  mds: Schedule clear cpu in swiotlb
  mds: Instrument skb functions to clear cpu automatically
  mds: Clear cpu for kmap_atomic in interrupts
  mds: Support cpu clearing for BPF
  mds sweep: Schedule clear cpus in sound core
  mds sweep: Make MPU401 interrupts clear cpu
  mds sweep: Clear cpu on processing input layer data
  mds sweep: Clear cpu for tty input
  mds sweep: Clear cpu for usbmon intercepts
  mds sweep: Clear cpu in some Xen drivers
  mds sweep: Clear cpu in DVB software filters
  mds sweep: Mark all DRM interrupts to clear cpu
  mds sweep: Make all old style IDE driver interrupts clear cpu
  mds sweep: Make Amazon ena driver management interrupt clear cpu
  mds sweep: Make all PCMCIA interrupts clear cpu
  mds sweep: Mark common functions in comedi as clear cpu
  mds sweep: Make usb hcd poll clear cpu
  x86/speculation/mds: Switch mds=auto to lazy
  mds sweep: Mark interrupts that touch user data
  mds sweep: Mark timer handlers that touch user data
  mds sweep: Mark tasklets that touch user data

Mark Gross (1):
  mds sweep: Clear cpu in sg_copy_from_buffer for SCSI

 .../ABI/testing/sysfs-devices-system-cpu      |   1 +
 .../admin-guide/kernel-parameters.txt         |  11 +
 Documentation/admin-guide/mds.rst             |  95 +++++++
 Documentation/clearcpu.txt                    | 261 ++++++++++++++++++
 arch/Kconfig                                  |   3 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/entry/common.c                       |   8 +
 arch/x86/events/intel/uncore.c                |   3 +-
 arch/x86/include/asm/clearbpf.h               |  29 ++
 arch/x86/include/asm/clearcpu.h               |  83 ++++++
 arch/x86/include/asm/cpufeature.h             |   6 +-
 arch/x86/include/asm/cpufeatures.h            |   9 +-
 arch/x86/include/asm/disabled-features.h      |   3 +-
 arch/x86/include/asm/floppy.h                 |   6 +-
 arch/x86/include/asm/io.h                     |   3 +
 arch/x86/include/asm/msr-index.h              |   1 +
 arch/x86/include/asm/required-features.h      |   3 +-
 arch/x86/include/asm/trace/clearcpu.h         |  27 ++
 arch/x86/kernel/acpi/cstate.c                 |   2 +
 arch/x86/kernel/cpu/bugs.c                    |  82 ++++++
 arch/x86/kernel/cpu/common.c                  |  25 ++
 arch/x86/kernel/kvm.c                         |   3 +
 arch/x86/kernel/nmi.c                         |   6 +-
 arch/x86/kernel/process.c                     |   5 +
 arch/x86/kernel/process.h                     |   1 +
 arch/x86/kernel/smpboot.c                     |   3 +
 arch/x86/kvm/cpuid.c                          |   3 +-
 arch/x86/kvm/vmx/vmx.c                        |  20 +-
 arch/x86/mm/highmem_32.c                      |   3 +
 arch/x86/mm/tlb.c                             |  14 +
 drivers/acpi/acpi_pad.c                       |   2 +
 drivers/acpi/processor_idle.c                 |   3 +
 drivers/atm/eni.c                             |   3 +-
 drivers/atm/he.c                              |   3 +-
 drivers/atm/lanai.c                           |   4 +-
 drivers/atm/nicstar.c                         |   4 +-
 drivers/auxdisplay/img-ascii-lcd.c            |   2 +-
 drivers/base/cpu.c                            |   8 +
 drivers/block/xsysace.c                       |   5 +-
 drivers/char/ipmi/ipmi_si_intf.c              |   6 +-
 drivers/char/sonypi.c                         |   3 +-
 drivers/crypto/ixp4xx_crypto.c                |   3 +-
 drivers/crypto/qat/qat_common/adf_isr.c       |   7 +-
 drivers/crypto/qat/qat_common/adf_sriov.c     |   6 +-
 drivers/crypto/qat/qat_common/adf_vf_isr.c    |  10 +-
 drivers/dma/dw/core.c                         |   3 +-
 drivers/dma/ioat/init.c                       |   3 +-
 drivers/dma/virt-dma.c                        |   3 +-
 drivers/firewire/core-transaction.c           |   5 +-
 drivers/firewire/nosy.c                       |   3 +-
 drivers/gpu/drm/drm_irq.c                     |   3 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c    |   3 +-
 drivers/gpu/drm/i915/i915_pmu.c               |   3 +-
 drivers/gpu/drm/i915/intel_lrc.c              |   5 +-
 .../gpu/drm/nouveau/nvkm/subdev/pci/base.c    |   3 +-
 drivers/hv/channel_mgmt.c                     |   4 +-
 drivers/hv/hv.c                               |   4 +-
 drivers/i2c/busses/i2c-emev2.c                |   5 +-
 drivers/i2c/busses/i2c-i801.c                 |   2 +-
 drivers/i2c/busses/i2c-pxa.c                  |   4 +-
 drivers/i2c/busses/i2c-rk3x.c                 |   3 +-
 drivers/ide/ide-probe.c                       |   5 +-
 drivers/idle/intel_idle.c                     |   5 +
 drivers/iio/trigger/iio-trig-hrtimer.c        |   3 +-
 drivers/infiniband/hw/bnxt_re/qplib_fp.c      |   4 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c    |   4 +-
 drivers/infiniband/hw/i40iw/i40iw_main.c      |   9 +-
 drivers/infiniband/hw/mthca/mthca_eq.c        |  14 +-
 drivers/infiniband/hw/qib/qib_sdma.c          |   4 +-
 drivers/infiniband/sw/rxe/rxe_cq.c            |   3 +-
 drivers/input/ff-memless.c                    |   2 +-
 drivers/input/input.c                         |   5 +-
 drivers/input/misc/xen-kbdfront.c             |   3 +-
 drivers/input/serio/hil_mlc.c                 |   2 +-
 drivers/input/serio/i8042.c                   |  13 +-
 drivers/input/serio/serio.c                   |   3 +
 drivers/ipack/carriers/tpci200.c              |   6 +-
 drivers/isdn/capi/capidrv.c                   |   2 +-
 drivers/isdn/gigaset/bas-gigaset.c            |   8 +-
 drivers/isdn/gigaset/common.c                 |   4 +-
 drivers/isdn/gigaset/ser-gigaset.c            |   4 +-
 drivers/isdn/gigaset/usb-gigaset.c            |   4 +-
 drivers/isdn/hardware/avm/b1isa.c             |   4 +-
 drivers/isdn/hardware/avm/b1pci.c             |   6 +-
 drivers/isdn/hardware/avm/b1pcmcia.c          |   3 +-
 drivers/isdn/hardware/avm/c4.c                |   3 +-
 drivers/isdn/hardware/avm/t1isa.c             |   4 +-
 drivers/isdn/hardware/avm/t1pci.c             |   3 +-
 drivers/isdn/hardware/mISDN/avmfritz.c        |   4 +-
 drivers/isdn/hardware/mISDN/hfcmulti.c        |   3 +-
 drivers/isdn/hardware/mISDN/hfcpci.c          |   2 +-
 drivers/isdn/hardware/mISDN/mISDNinfineon.c   |   3 +-
 drivers/isdn/hardware/mISDN/netjet.c          |   2 +-
 drivers/isdn/hardware/mISDN/speedfax.c        |   3 +-
 drivers/isdn/hardware/mISDN/w6692.c           |   2 +-
 drivers/isdn/hisax/config.c                   |   2 +-
 drivers/isdn/hisax/hfc4s8s_l1.c               |   3 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c           |  13 +-
 drivers/isdn/i4l/isdn_common.c                |   2 +-
 drivers/media/cec/cec-pin.c                   |   3 +-
 drivers/media/common/saa7146/saa7146_core.c   |   4 +-
 drivers/media/dvb-core/dvb_demux.c            |   3 +
 drivers/media/pci/b2c2/flexcop-pci.c          |   3 +-
 drivers/media/pci/bt8xx/bttv-driver.c         |   2 +-
 drivers/media/pci/bt8xx/bttv-input.c          |   5 +-
 drivers/media/pci/bt8xx/dvb-bt8xx.c           |   3 +-
 drivers/media/pci/cobalt/cobalt-driver.c      |   3 +-
 drivers/media/pci/cx18/cx18-driver.c          |   3 +-
 drivers/media/pci/cx25821/cx25821-core.c      |   2 +-
 drivers/media/pci/cx88/cx88-alsa.c            |   3 +-
 drivers/media/pci/cx88/cx88-mpeg.c            |   2 +-
 drivers/media/pci/cx88/cx88-video.c           |   2 +-
 drivers/media/pci/dt3155/dt3155.c             |   2 +-
 drivers/media/pci/intel/ipu3/ipu3-cio2.c      |   2 +-
 drivers/media/pci/ivtv/ivtv-driver.c          |   3 +-
 drivers/media/pci/mantis/mantis_dvb.c         |   3 +-
 drivers/media/pci/meye/meye.c                 |   3 +-
 .../pci/netup_unidvb/netup_unidvb_core.c      |   3 +-
 drivers/media/pci/ngene/ngene-core.c          |   5 +-
 drivers/media/pci/pluto2/pluto2.c             |   3 +-
 drivers/media/pci/saa7134/saa7134-alsa.c      |   4 +-
 drivers/media/pci/saa7134/saa7134-core.c      |   2 +-
 drivers/media/pci/saa7134/saa7134-input.c     |   3 +-
 drivers/media/pci/saa7134/saa7134-ts.c        |   3 +-
 drivers/media/pci/saa7134/saa7134-vbi.c       |   3 +-
 drivers/media/pci/saa7134/saa7134-video.c     |   3 +-
 drivers/media/pci/saa7164/saa7164-core.c      |   7 +-
 drivers/media/pci/smipcie/smipcie-main.c      |   3 +-
 drivers/media/pci/solo6x10/solo6x10-core.c    |   4 +-
 drivers/media/pci/sta2x11/sta2x11_vip.c       |   5 +-
 drivers/media/pci/ttpci/av7110.c              |  12 +-
 drivers/media/pci/ttpci/av7110_ir.c           |   3 +-
 drivers/media/pci/ttpci/budget-ci.c           |   9 +-
 drivers/media/pci/ttpci/budget-core.c         |   3 +-
 drivers/media/pci/tw5864/tw5864-video.c       |   4 +-
 drivers/media/pci/tw68/tw68-core.c            |   2 +-
 drivers/media/pci/tw686x/tw686x-core.c        |   4 +-
 drivers/media/platform/aspeed-video.c         |   5 +-
 .../media/platform/marvell-ccic/cafe-driver.c |   3 +-
 .../media/platform/marvell-ccic/mcam-core.c   |   4 +-
 drivers/media/radio/radio-cadet.c             |   2 +-
 drivers/media/radio/wl128x/fmdrv_common.c     |   9 +-
 drivers/media/rc/fintek-cir.c                 |   3 +-
 drivers/media/rc/gpio-ir-recv.c               |   2 +-
 drivers/media/rc/img-ir/img-ir-raw.c          |   2 +-
 drivers/media/rc/ir-hix5hd2.c                 |   3 +-
 drivers/media/rc/ir-rx51.c                    |   3 +-
 drivers/media/rc/ite-cir.c                    |   3 +-
 drivers/media/rc/nuvoton-cir.c                |   3 +-
 drivers/media/rc/serial_ir.c                  |   2 +-
 drivers/media/rc/sir_ir.c                     |   3 +-
 drivers/media/rc/winbond-cir.c                |   2 +-
 drivers/media/usb/au0828/au0828-video.c       |   6 +-
 drivers/media/usb/ttusb-dec/ttusb_dec.c       |   5 +-
 drivers/memstick/host/jmb38x_ms.c             |   6 +-
 drivers/message/fusion/mptbase.c              |   3 +-
 drivers/mfd/ezx-pcap.c                        |   4 +-
 drivers/misc/ibmasm/module.c                  |   4 +-
 drivers/misc/sgi-gru/grufile.c                |   7 +-
 drivers/misc/sgi-xp/xpc_uv.c                  |   3 +-
 drivers/misc/vmw_vmci/vmci_guest.c            |   8 +-
 drivers/mmc/host/mtk-sd.c                     |   3 +-
 drivers/mmc/host/wbsd.c                       |  20 +-
 drivers/net/appletalk/cops.c                  |   2 +-
 drivers/net/arcnet/arc-rimi.c                 |   2 +-
 drivers/net/arcnet/com20020.c                 |   3 +-
 drivers/net/arcnet/com90io.c                  |   3 +-
 drivers/net/arcnet/com90xx.c                  |   2 +-
 drivers/net/caif/caif_hsi.c                   |   9 +-
 drivers/net/can/cc770/cc770.c                 |   4 +-
 drivers/net/can/peak_canfd/peak_pciefd_main.c |   8 +-
 drivers/net/can/sja1000/ems_pcmcia.c          |   4 +-
 drivers/net/can/sja1000/peak_pcmcia.c         |   3 +-
 drivers/net/can/sja1000/sja1000.c             |   5 +-
 drivers/net/ethernet/3com/3c509.c             |   3 +-
 drivers/net/ethernet/3com/3c515.c             |   6 +-
 drivers/net/ethernet/8390/axnet_cs.c          |   3 +-
 drivers/net/ethernet/8390/ne.c                |   3 +-
 drivers/net/ethernet/8390/ne2k-pci.c          |   3 +-
 drivers/net/ethernet/8390/pcnet_cs.c          |   3 +-
 drivers/net/ethernet/8390/smc-ultra.c         |   3 +-
 drivers/net/ethernet/8390/wd.c                |   3 +-
 drivers/net/ethernet/agere/et131x.c           |   4 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.c  |   5 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.h  |   1 +
 drivers/net/ethernet/amd/lance.c              |   2 +-
 drivers/net/ethernet/amd/ni65.c               |   5 +-
 drivers/net/ethernet/atheros/atlx/atl1.c      |   4 +-
 drivers/net/ethernet/atheros/atlx/atl2.c      |   4 +-
 drivers/net/ethernet/broadcom/cnic.c          |   8 +-
 drivers/net/ethernet/cadence/macb_main.c      |   4 +-
 .../net/ethernet/chelsio/cxgb3/cxgb3_main.c   |  16 +-
 drivers/net/ethernet/micrel/ks8842.c          |   7 +-
 drivers/net/ethernet/micrel/ks8851_mll.c      |   3 +-
 drivers/net/ethernet/microchip/lan743x_main.c |   7 +-
 drivers/net/ethernet/realtek/atp.c            |   3 +-
 drivers/net/fddi/skfp/skfddi.c                |   4 +-
 drivers/net/hamradio/6pack.c                  |   4 +-
 drivers/net/hamradio/baycom_ser_fdx.c         |   3 +-
 drivers/net/hamradio/baycom_ser_hdx.c         |   3 +-
 drivers/net/hamradio/scc.c                    |   8 +-
 drivers/net/hamradio/yam.c                    |   6 +-
 drivers/net/hippi/rrunner.c                   |   2 +-
 drivers/net/ieee802154/at86rf230.c            |   6 +-
 drivers/net/ieee802154/ca8210.c               |  10 +-
 drivers/net/ieee802154/mcr20a.c               |   3 +-
 drivers/net/ieee802154/mrf24j40.c             |   3 +-
 drivers/net/ppp/ppp_async.c                   |   3 +-
 drivers/net/ppp/ppp_synctty.c                 |   3 +-
 drivers/net/slip/slip.c                       |   4 +-
 drivers/net/usb/cdc_ncm.c                     |   3 +-
 drivers/net/usb/hso.c                         |   6 +-
 drivers/net/wan/cosa.c                        |   2 +-
 drivers/net/wan/farsync.c                     |   6 +-
 drivers/net/wan/hostess_sv11.c                |   3 +-
 drivers/net/wan/sbni.c                        |   2 +-
 drivers/net/wan/sdla.c                        |   4 +-
 drivers/net/wan/sealevel.c                    |   3 +-
 drivers/net/wireless/ath/ath9k/init.c         |   5 +-
 drivers/net/wireless/ath/carl9170/usb.c       |   4 +-
 .../net/wireless/broadcom/b43legacy/main.c    |   8 +-
 drivers/net/wireless/broadcom/b43legacy/pio.c |   4 +-
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |   7 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |   3 +-
 drivers/net/wireless/cisco/airo.c             |   4 +-
 drivers/net/wireless/intel/ipw2x00/ipw2100.c  |   9 +-
 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |   8 +-
 .../net/wireless/intel/iwlegacy/3945-mac.c    |   9 +-
 .../net/wireless/intel/iwlegacy/4965-mac.c    |   9 +-
 .../net/wireless/intersil/hostap/hostap_ap.c  |   2 +-
 .../net/wireless/intersil/hostap/hostap_pci.c |   3 +-
 .../net/wireless/intersil/hostap/hostap_plx.c |   3 +-
 drivers/net/wireless/intersil/orinoco/main.c  |   4 +-
 .../intersil/orinoco/orinoco_nortel.c         |   4 +-
 .../wireless/intersil/orinoco/orinoco_pci.c   |   4 +-
 .../wireless/intersil/orinoco/orinoco_plx.c   |   4 +-
 .../wireless/intersil/orinoco/orinoco_tmd.c   |   4 +-
 drivers/net/wireless/intersil/p54/p54pci.c    |   2 +-
 drivers/net/wireless/intersil/p54/p54spi.c    |   4 +-
 .../intersil/prism54/islpci_hotplug.c         |   2 +-
 drivers/net/wireless/mac80211_hwsim.c         |   6 +-
 drivers/net/wireless/marvell/libertas/if_cs.c |   2 +-
 .../net/wireless/marvell/libertas/if_spi.c    |   3 +-
 .../wireless/marvell/mwifiex/11n_rxreorder.c  |   3 +-
 drivers/net/wireless/marvell/mwifiex/main.c   |   5 +-
 drivers/net/wireless/marvell/mwifiex/pcie.c   |   8 +-
 drivers/net/wireless/marvell/mwifiex/usb.c    |   2 +-
 drivers/net/wireless/marvell/mwl8k.c          |  10 +-
 .../net/wireless/mediatek/mt76/mt76x0/pci.c   |   3 +-
 .../net/wireless/mediatek/mt76/mt76x2/pci.c   |   3 +-
 .../quantenna/qtnfmac/pcie/pearl_pcie.c       |   3 +-
 .../quantenna/qtnfmac/pcie/topaz_pcie.c       |   3 +-
 .../net/wireless/ralink/rt2x00/rt2x00mmio.c   |   6 +-
 .../wireless/realtek/rtl818x/rtl8180/dev.c    |   6 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c    |  16 +-
 drivers/net/wireless/ti/wl1251/sdio.c         |   4 +-
 drivers/net/wireless/ti/wl1251/spi.c          |   5 +-
 drivers/ntb/hw/amd/ntb_hw_amd.c               |  12 +-
 drivers/ntb/hw/intel/ntb_hw_gen1.c            |  12 +-
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c        |   8 +-
 drivers/parport/parport_ax88796.c             |   3 +-
 drivers/parport/parport_pc.c                  |   3 +-
 drivers/pci/controller/pcie-xilinx.c          |   2 +-
 drivers/pci/controller/vmd.c                  |  11 +-
 drivers/pci/hotplug/cpci_hotplug_core.c       |   6 +-
 drivers/pci/hotplug/cpqphp_core.c             |   3 +-
 drivers/pci/hotplug/shpchp_hpc.c              |   5 +-
 drivers/pci/pcie/pme.c                        |   3 +-
 drivers/pci/switch/switchtec.c                |  10 +-
 drivers/pcmcia/i82092.c                       |   2 +-
 drivers/pcmcia/i82365.c                       |   9 +-
 drivers/pcmcia/pcmcia_resource.c              |   9 +-
 drivers/pcmcia/pd6729.c                       |   8 +-
 drivers/pcmcia/tcic.c                         |   7 +-
 drivers/pcmcia/yenta_socket.c                 |   7 +-
 drivers/pinctrl/intel/pinctrl-intel.c         |   2 +-
 drivers/pinctrl/pinctrl-amd.c                 |   3 +-
 drivers/pinctrl/pinctrl-single.c              |   3 +-
 drivers/platform/goldfish/goldfish_pipe.c     |   6 +-
 drivers/platform/mellanox/mlxreg-hotplug.c    |   5 +-
 drivers/platform/x86/fujitsu-tablet.c         |   3 +-
 drivers/platform/x86/intel_int0002_vgpio.c    |   2 +-
 drivers/platform/x86/intel_ips.c              |   3 +-
 drivers/platform/x86/intel_pmc_ipc.c          |   8 +-
 drivers/platform/x86/intel_punit_ipc.c        |   4 +-
 drivers/platform/x86/intel_scu_ipc.c          |   5 +-
 drivers/platform/x86/sony-laptop.c            |   5 +-
 drivers/pnp/resource.c                        |   3 +-
 drivers/power/reset/ltc2952-poweroff.c        |   6 +-
 drivers/power/supply/act8945a_charger.c       |   6 +-
 drivers/power/supply/goldfish_battery.c       |   5 +-
 .../power/supply/max14656_charger_detector.c  |   2 +-
 drivers/power/supply/pda_power.c              |   6 +-
 drivers/power/supply/wm97xx_battery.c         |   5 +-
 drivers/pps/clients/pps-gpio.c                |   3 +-
 drivers/ptp/ptp_pch.c                         |   3 +-
 drivers/rapidio/devices/tsi721.c              |  25 +-
 drivers/rapidio/devices/tsi721_dma.c          |   8 +-
 drivers/regulator/qcom_spmi-regulator.c       |   5 +-
 drivers/rpmsg/qcom_glink_native.c             |   5 +-
 drivers/rtc/rtc-cmos.c                        |   5 +-
 drivers/rtc/rtc-ds1305.c                      |   3 +-
 drivers/rtc/rtc-ds1374.c                      |   5 +-
 drivers/rtc/rtc-ds1511.c                      |   3 +-
 drivers/rtc/rtc-ds1553.c                      |   4 +-
 drivers/rtc/rtc-ds1685.c                      |   3 +-
 drivers/rtc/rtc-ftrtc010.c                    |   2 +-
 drivers/rtc/rtc-m48t59.c                      |   5 +-
 drivers/rtc/rtc-mrst.c                        |   3 +-
 drivers/rtc/rtc-pcap.c                        |  10 +-
 drivers/rtc/rtc-r7301.c                       |   3 +-
 drivers/rtc/rtc-snvs.c                        |   3 +-
 drivers/rtc/rtc-stk17ta8.c                    |   5 +-
 drivers/rtc/rtc-zynqmp.c                      |   6 +-
 drivers/scsi/3w-9xxx.c                        |   6 +-
 drivers/scsi/3w-sas.c                         |   6 +-
 drivers/scsi/3w-xxxx.c                        |   3 +-
 drivers/scsi/BusLogic.c                       |   3 +-
 drivers/scsi/a100u2w.c                        |   4 +-
 drivers/scsi/aacraid/commsup.c                |   8 +-
 drivers/scsi/aacraid/rx.c                     |   3 +-
 drivers/scsi/aacraid/sa.c                     |   3 +-
 drivers/scsi/aacraid/src.c                    |   3 +-
 drivers/scsi/advansys.c                       |   4 +-
 drivers/scsi/aha152x.c                        |   4 +-
 drivers/scsi/aha1542.c                        |   2 +-
 drivers/scsi/aha1740.c                        |   3 +-
 drivers/scsi/aic7xxx/aic7770_osm.c            |   3 +-
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c        |   2 +-
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c        |   2 +-
 drivers/scsi/aic94xx/aic94xx_hwi.c            |   4 +-
 drivers/scsi/aic94xx/aic94xx_init.c           |   5 +-
 drivers/scsi/am53c974.c                       |   4 +-
 drivers/scsi/arcmsr/arcmsr_hba.c              |   3 +-
 drivers/scsi/atp870u.c                        |   3 +-
 drivers/scsi/be2iscsi/be_main.c               |  12 +-
 drivers/scsi/bfa/bfad.c                       |   9 +-
 drivers/scsi/csiostor/csio_isr.c              |  16 +-
 drivers/scsi/dpt_i2o.c                        |   2 +-
 drivers/scsi/esas2r/esas2r_init.c             |   8 +-
 drivers/scsi/fnic/fnic_isr.c                  |  13 +-
 drivers/scsi/g_NCR5380.c                      |   7 +-
 drivers/scsi/gdth.c                           |   8 +-
 drivers/scsi/hpsa.c                           |  19 +-
 drivers/scsi/hptiop.c                         |   3 +-
 drivers/scsi/initio.c                         |   3 +-
 drivers/scsi/ipr.c                            |  23 +-
 drivers/scsi/ips.c                            |   4 +-
 drivers/scsi/isci/init.c                      |   8 +-
 drivers/scsi/lpfc/lpfc_init.c                 |  35 ++-
 drivers/scsi/megaraid.c                       |   4 +-
 drivers/scsi/megaraid/megaraid_mbox.c         |   3 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     |   8 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c           |   2 +-
 drivers/scsi/mvsas/mv_init.c                  |   4 +-
 drivers/scsi/mvumi.c                          |   8 +-
 drivers/scsi/myrb.c                           |   2 +-
 drivers/scsi/myrs.c                           |   2 +-
 drivers/scsi/nsp32.c                          |   3 +-
 drivers/scsi/pcmcia/qlogic_stub.c             |   2 +-
 drivers/scsi/pcmcia/sym53c500_cs.c            |   2 +-
 drivers/scsi/pm8001/pm8001_init.c             |  10 +-
 drivers/scsi/pmcraid.c                        |   5 +-
 drivers/scsi/qedf/qedf_main.c                 |   4 +-
 drivers/scsi/qedi/qedi_main.c                 |   3 +-
 drivers/scsi/qla1280.c                        |   3 +-
 drivers/scsi/qla2xxx/qla_isr.c                |  22 +-
 drivers/scsi/qla4xxx/ql4_isr.c                |   5 +-
 drivers/scsi/qla4xxx/ql4_nx.c                 |  10 +-
 drivers/scsi/qlogicfas.c                      |   2 +-
 drivers/scsi/sim710.c                         |   2 +-
 drivers/scsi/smartpqi/smartpqi_init.c         |  11 +-
 drivers/scsi/snic/snic_isr.c                  |   5 +-
 drivers/scsi/stex.c                           |   4 +-
 drivers/scsi/sym53c8xx_2/sym_glue.c           |   3 +-
 drivers/scsi/ufs/ufshcd.c                     |   7 +-
 drivers/scsi/vmw_pvscsi.c                     |   9 +-
 drivers/scsi/wd719x.c                         |   4 +-
 drivers/slimbus/qcom-ctrl.c                   |   3 +-
 drivers/spi/spi-altera.c                      |   3 +-
 drivers/spi/spi-axi-spi-engine.c              |   3 +-
 drivers/spi/spi-cadence.c                     |   3 +-
 drivers/spi/spi-dw.c                          |   4 +-
 drivers/spi/spi-fsl-spi.c                     |   3 +-
 drivers/spi/spi-oc-tiny.c                     |   3 +-
 drivers/spi/spi-pxa2xx.c                      |   4 +-
 drivers/spi/spi-topcliff-pch.c                |   5 +-
 drivers/spi/spi-xilinx.c                      |   5 +-
 drivers/spi/spi-zynqmp-gqspi.c                |   3 +-
 drivers/staging/android/vsoc.c                |   3 +-
 drivers/staging/axis-fifo/axis-fifo.c         |   3 +-
 drivers/staging/comedi/comedi_buf.c           |   5 +
 .../staging/comedi/drivers/addi_apci_1032.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_1500.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_1564.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_2032.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_3120.c   |   3 +-
 .../staging/comedi/drivers/addi_apci_3xxx.c   |   3 +-
 drivers/staging/comedi/drivers/adl_pci9111.c  |   3 +-
 drivers/staging/comedi/drivers/adl_pci9118.c  |   3 +-
 drivers/staging/comedi/drivers/adv_pci1710.c  |   3 +-
 drivers/staging/comedi/drivers/aio_iiro_16.c  |   3 +-
 .../comedi/drivers/amplc_dio200_common.c      |   3 +-
 .../comedi/drivers/amplc_pc236_common.c       |   3 +-
 drivers/staging/comedi/drivers/amplc_pci224.c |   3 +-
 drivers/staging/comedi/drivers/amplc_pci230.c |   3 +-
 drivers/staging/comedi/drivers/cb_pcidas.c    |   4 +-
 drivers/staging/comedi/drivers/cb_pcidas64.c  |   5 +-
 .../staging/comedi/drivers/comedi_parport.c   |   3 +-
 drivers/staging/comedi/drivers/comedi_test.c  |   6 +-
 drivers/staging/comedi/drivers/das16m1.c      |   3 +-
 drivers/staging/comedi/drivers/das1800.c      |   3 +-
 drivers/staging/comedi/drivers/das6402.c      |   3 +-
 drivers/staging/comedi/drivers/das800.c       |   5 +-
 drivers/staging/comedi/drivers/dmm32at.c      |   3 +-
 drivers/staging/comedi/drivers/dt2811.c       |   3 +-
 drivers/staging/comedi/drivers/dt2814.c       |   3 +-
 drivers/staging/comedi/drivers/dt282x.c       |   2 +-
 drivers/staging/comedi/drivers/dt3000.c       |   3 +-
 drivers/staging/comedi/drivers/gsc_hpdi.c     |   3 +-
 drivers/staging/comedi/drivers/jr3_pci.c      |   2 +-
 drivers/staging/comedi/drivers/me4000.c       |   3 +-
 drivers/staging/comedi/drivers/ni_6527.c      |   4 +-
 drivers/staging/comedi/drivers/ni_65xx.c      |   3 +-
 drivers/staging/comedi/drivers/ni_660x.c      |   4 +-
 drivers/staging/comedi/drivers/ni_at_a2150.c  |   2 +-
 drivers/staging/comedi/drivers/ni_atmio.c     |   3 +-
 drivers/staging/comedi/drivers/ni_atmio16d.c  |   3 +-
 .../staging/comedi/drivers/ni_labpc_common.c  |   5 +-
 drivers/staging/comedi/drivers/ni_pcidio.c    |   3 +-
 drivers/staging/comedi/drivers/ni_pcimio.c    |   3 +-
 drivers/staging/comedi/drivers/pcl711.c       |   3 +-
 drivers/staging/comedi/drivers/pcl726.c       |   3 +-
 drivers/staging/comedi/drivers/pcl812.c       |   3 +-
 drivers/staging/comedi/drivers/pcl816.c       |   2 +-
 drivers/staging/comedi/drivers/pcl818.c       |   3 +-
 drivers/staging/comedi/drivers/pcmmio.c       |   3 +-
 drivers/staging/comedi/drivers/pcmuio.c       |   6 +-
 drivers/staging/comedi/drivers/rtd520.c       |   3 +-
 drivers/staging/comedi/drivers/s626.c         |   3 +-
 drivers/staging/gasket/gasket_interrupt.c     |   3 +-
 drivers/staging/goldfish/goldfish_audio.c     |   5 +-
 drivers/staging/iio/adc/ad7606.c              |   3 +-
 drivers/staging/ks7010/ks_hostif.c            |   3 +-
 drivers/staging/media/bcm2048/radio-bcm2048.c |   4 +-
 drivers/staging/media/zoran/zoran_card.c      |   2 +-
 drivers/staging/most/dim2/dim2.c              |   6 +-
 drivers/staging/most/i2c/i2c.c                |   3 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c    |   2 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c  |   2 +-
 drivers/staging/pi433/pi433_if.c              |   6 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c     |   2 +-
 .../staging/rtl8188eu/hal/rtl8188eu_recv.c    |   6 +-
 .../staging/rtl8188eu/hal/rtl8188eu_xmit.c    |   6 +-
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c |  17 +-
 drivers/staging/rtl8188eu/os_dep/recv_linux.c |   2 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c  |  20 +-
 drivers/staging/rtl8192e/rtllib_softmac.c     |   6 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |   2 +-
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |   6 +-
 drivers/staging/rtl8712/rtl8712_recv.c        |   6 +-
 drivers/staging/rtl8712/rtl871x_xmit.c        |   6 +-
 .../staging/rtl8723bs/hal/rtl8723bs_recv.c    |   8 +-
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c |  22 +-
 drivers/staging/rtl8723bs/os_dep/recv_linux.c |   2 +-
 drivers/staging/rtlwifi/pci.c                 |   4 +-
 drivers/staging/rts5208/rtsx.c                |   4 +-
 drivers/staging/speakup/main.c                |   2 +-
 drivers/staging/speakup/serialio.c            |   5 +-
 drivers/staging/vt6655/device_main.c          |   2 +-
 drivers/thermal/ti-soc-thermal/ti-bandgap.c   |   6 +-
 drivers/thunderbolt/nhi.c                     |   6 +-
 drivers/tty/cyclades.c                        |   9 +-
 drivers/tty/goldfish.c                        |   4 +-
 drivers/tty/hvc/hvc_irq.c                     |   4 +-
 drivers/tty/ipwireless/hardware.c             |   3 +-
 drivers/tty/isicom.c                          |   4 +-
 drivers/tty/moxa.c                            |   2 +-
 drivers/tty/mxser.c                           |   4 +-
 drivers/tty/n_gsm.c                           |   5 +-
 drivers/tty/n_r3964.c                         |   2 +-
 drivers/tty/rocket.c                          |   2 +-
 drivers/tty/serial/8250/8250_core.c           |   6 +-
 drivers/tty/serial/8250/8250_exar.c           |   2 +-
 drivers/tty/serial/8250/8250_port.c           |   4 +-
 drivers/tty/serial/altera_jtaguart.c          |   4 +-
 drivers/tty/serial/altera_uart.c              |   5 +-
 drivers/tty/serial/arc_uart.c                 |   2 +-
 drivers/tty/serial/digicolor-usart.c          |   3 +-
 drivers/tty/serial/fsl_lpuart.c               |  12 +-
 drivers/tty/serial/ifx6x60.c                  |  11 +-
 drivers/tty/serial/jsm/jsm_driver.c           |   3 +-
 drivers/tty/serial/max3100.c                  |   5 +-
 drivers/tty/serial/men_z135_uart.c            |   4 +-
 drivers/tty/serial/mux.c                      |   2 +-
 drivers/tty/serial/pch_uart.c                 |   4 +-
 drivers/tty/serial/pnx8xxx_uart.c             |   3 +-
 drivers/tty/serial/rp2.c                      |   2 +-
 drivers/tty/serial/sc16is7xx.c                |   2 +-
 drivers/tty/serial/sccnxp.c                   |   2 +-
 drivers/tty/serial/sh-sci.c                   |   9 +-
 drivers/tty/serial/timbuart.c                 |   4 +-
 drivers/tty/serial/uartlite.c                 |   3 +-
 drivers/tty/serial/xilinx_uartps.c            |   4 +-
 drivers/tty/synclink.c                        |   3 +-
 drivers/tty/synclink_gt.c                     |   6 +-
 drivers/tty/synclinkmp.c                      |   7 +-
 drivers/tty/tty_buffer.c                      |   5 +-
 drivers/tty/vcc.c                             |   4 +-
 drivers/tty/vt/keyboard.c                     |   2 +-
 drivers/uio/uio.c                             |   3 +-
 drivers/usb/atm/usbatm.c                      |   6 +-
 drivers/usb/c67x00/c67x00-drv.c               |   3 +-
 drivers/usb/chipidea/core.c                   |   5 +-
 drivers/usb/chipidea/otg_fsm.c                |   3 +-
 drivers/usb/core/hcd.c                        |   8 +-
 drivers/usb/dwc2/gadget.c                     |   3 +-
 drivers/usb/dwc2/hcd_queue.c                  |   6 +-
 drivers/usb/dwc2/platform.c                   |   3 +-
 drivers/usb/gadget/function/f_midi.c          |   3 +-
 drivers/usb/gadget/function/f_ncm.c           |   3 +-
 drivers/usb/gadget/udc/amd5536udc_pci.c       |   2 +-
 drivers/usb/gadget/udc/bdc/bdc_udc.c          |   3 +-
 drivers/usb/gadget/udc/dummy_hcd.c            |   4 +-
 drivers/usb/gadget/udc/fotg210-udc.c          |   4 +-
 drivers/usb/gadget/udc/fusb300_udc.c          |   6 +-
 drivers/usb/gadget/udc/goku_udc.c             |   3 +-
 drivers/usb/gadget/udc/m66592-udc.c           |   6 +-
 drivers/usb/gadget/udc/mv_u3d_core.c          |   3 +-
 drivers/usb/gadget/udc/mv_udc_core.c          |   3 +-
 drivers/usb/gadget/udc/net2272.c              |   3 +-
 drivers/usb/gadget/udc/net2280.c              |   3 +-
 drivers/usb/gadget/udc/pch_udc.c              |   8 +-
 drivers/usb/gadget/udc/pxa27x_udc.c           |   3 +-
 drivers/usb/gadget/udc/r8a66597-udc.c         |   7 +-
 drivers/usb/gadget/udc/snps_udc_plat.c        |   4 +-
 drivers/usb/gadget/udc/udc-xilinx.c           |   3 +-
 drivers/usb/host/max3421-hcd.c                |   3 +-
 drivers/usb/host/xhci.c                       |  12 +-
 drivers/usb/isp1760/isp1760-udc.c             |   3 +-
 drivers/usb/musb/musb_core.c                  |   2 +-
 drivers/usb/phy/phy-gpio-vbus-usb.c           |   4 +-
 drivers/usb/serial/mos7720.c                  |   4 +-
 drivers/usb/usbip/vudc_transfer.c             |   2 +-
 drivers/uwb/neh.c                             |   2 +-
 drivers/uwb/rsv.c                             |   5 +-
 drivers/uwb/whc-rc.c                          |   5 +-
 drivers/vfio/pci/vfio_pci_intrs.c             |   5 +-
 drivers/video/fbdev/arcfb.c                   |   3 +-
 drivers/video/fbdev/aty/atyfb_base.c          |   2 +-
 drivers/video/fbdev/goldfishfb.c              |   4 +-
 drivers/video/fbdev/matrox/matroxfb_base.c    |   3 +-
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c    |   7 +-
 drivers/video/fbdev/via/via-core.c            |   3 +-
 drivers/video/fbdev/xen-fbfront.c             |   2 +
 drivers/virt/vboxguest/vboxguest_linux.c      |   5 +-
 drivers/virtio/virtio_mmio.c                  |   4 +-
 drivers/virtio/virtio_pci_common.c            |  20 +-
 drivers/visorbus/visorbus_main.c              |   2 +-
 drivers/vme/bridges/vme_ca91cx42.c            |   5 +-
 drivers/vme/bridges/vme_tsi148.c              |   7 +-
 drivers/w1/masters/ds1wm.c                    |   3 +-
 drivers/xen/events/events_base.c              |  12 +-
 drivers/xen/platform-pci.c                    |   4 +-
 drivers/xen/pvcalls-front.c                   |   2 +
 drivers/xen/xen-pciback/pciback_ops.c         |   6 +-
 include/asm-generic/io.h                      |   3 +
 include/linux/clearcpu.h                      |  36 +++
 include/linux/filter.h                        |  21 +-
 include/linux/highmem.h                       |   2 +
 include/linux/hrtimer.h                       |   4 +
 include/linux/interrupt.h                     |  18 +-
 include/linux/skbuff.h                        |   2 +
 include/linux/timer.h                         |  14 +-
 include/linux/tty_flip.h                      |   4 +
 include/linux/usb/hcd.h                       |   5 +-
 kernel/bpf/core.c                             |   2 +
 kernel/bpf/cpumap.c                           |   3 +
 kernel/dma/swiotlb.c                          |   2 +
 kernel/irq/handle.c                           |   4 +
 kernel/irq/manage.c                           |   1 +
 kernel/sched/core.c                           |   9 +
 kernel/softirq.c                              |  25 +-
 kernel/time/alarmtimer.c                      |   2 +-
 kernel/time/hrtimer.c                         |   5 +
 kernel/time/timer.c                           |   8 +
 lib/random32.c                                |   2 +-
 lib/scatterlist.c                             |   2 +
 lib/string.c                                  |   6 +
 mm/slab_common.c                              |   5 +-
 net/atm/pppoatm.c                             |   2 +-
 net/core/skbuff.c                             |  32 +++
 net/mac80211/main.c                           |  14 +-
 net/rds/ib_cm.c                               |   8 +-
 net/wireless/lib80211.c                       |   2 +-
 net/xfrm/xfrm_state.c                         |   3 +-
 samples/v4l/v4l2-pci-skeleton.c               |   5 +-
 security/keys/gc.c                            |   2 +-
 sound/core/hrtimer.c                          |   3 +-
 sound/core/pcm_lib.c                          |   3 +
 sound/core/rawmidi.c                          |   3 +
 sound/core/timer.c                            |   7 +-
 sound/drivers/mpu401/mpu401_uart.c            |   8 +-
 sound/drivers/mtpav.c                         |   5 +-
 sound/drivers/pcsp/pcsp.c                     |   3 +-
 sound/drivers/serial-u16550.c                 |   6 +-
 sound/isa/ad1816a/ad1816a_lib.c               |   2 +-
 sound/isa/es1688/es1688_lib.c                 |   4 +-
 sound/isa/es18xx.c                            |   3 +-
 sound/isa/gus/gus_main.c                      |   2 +-
 sound/isa/gus/gusmax.c                        |   2 +-
 sound/isa/gus/interwave.c                     |   3 +-
 sound/isa/msnd/msnd_pinnacle.c                |   3 +-
 sound/isa/opl3sa2.c                           |   4 +-
 sound/isa/opti9xx/opti92x-ad1848.c            |   3 +-
 sound/isa/sb/emu8000_pcm.c                    |   2 +-
 sound/isa/sb/sb8_midi.c                       |   3 +-
 sound/isa/sb/sb_common.c                      |   6 +-
 sound/isa/wavefront/wavefront.c               |   3 +-
 sound/isa/wavefront/wavefront_midi.c          |   4 +-
 sound/isa/wss/wss_lib.c                       |   3 +-
 sound/pci/ad1889.c                            |   3 +-
 sound/pci/ali5451/ali5451.c                   |   3 +-
 sound/pci/als300.c                            |   3 +-
 sound/pci/asihpi/asihpi.c                     |   4 +-
 sound/pci/asihpi/hpioctl.c                    |   3 +-
 sound/pci/atiixp.c                            |   3 +-
 sound/pci/atiixp_modem.c                      |   3 +-
 sound/pci/aw2/aw2-alsa.c                      |   3 +-
 sound/pci/azt3328.c                           |   3 +-
 sound/pci/bt87x.c                             |   4 +-
 sound/pci/ca0106/ca0106_main.c                |   3 +-
 sound/pci/cmipci.c                            |   3 +-
 sound/pci/cs4281.c                            |   3 +-
 sound/pci/cs46xx/cs46xx_lib.c                 |   3 +-
 sound/pci/cs5535audio/cs5535audio.c           |   3 +-
 sound/pci/ctxfi/cthw20k1.c                    |   3 +-
 sound/pci/ctxfi/cthw20k2.c                    |   3 +-
 sound/pci/echoaudio/midi.c                    |   2 +-
 sound/pci/emu10k1/emu10k1_main.c              |   3 +-
 sound/pci/emu10k1/emu10k1x.c                  |   3 +-
 sound/pci/ens1370.c                           |   3 +-
 sound/pci/es1938.c                            |   6 +-
 sound/pci/es1968.c                            |   3 +-
 sound/pci/fm801.c                             |   3 +-
 sound/pci/hda/hda_intel.c                     |   4 +-
 sound/pci/ice1712/ice1712.c                   |   3 +-
 sound/pci/ice1712/ice1724.c                   |   3 +-
 sound/pci/intel8x0.c                          |   6 +-
 sound/pci/intel8x0m.c                         |   6 +-
 sound/pci/korg1212/korg1212.c                 |   4 +-
 sound/pci/lola/lola.c                         |   3 +-
 sound/pci/maestro3.c                          |   3 +-
 sound/pci/nm256/nm256.c                       |   3 +-
 sound/pci/oxygen/oxygen_lib.c                 |   4 +-
 sound/pci/riptide/riptide.c                   |   3 +-
 sound/pci/rme32.c                             |   3 +-
 sound/pci/rme96.c                             |   3 +-
 sound/pci/rme9652/hdsp.c                      |   8 +-
 sound/pci/rme9652/hdspm.c                     |  10 +-
 sound/pci/rme9652/rme9652.c                   |   3 +-
 sound/pci/sis7019.c                           |   7 +-
 sound/pci/sonicvibes.c                        |   3 +-
 sound/pci/trident/trident_main.c              |   3 +-
 sound/pci/via82xx.c                           |   6 +-
 sound/pci/via82xx_modem.c                     |   3 +-
 sound/pci/ymfpci/ymfpci_main.c                |   3 +-
 sound/soc/amd/acp-pcm-dma.c                   |   3 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c           |   3 +-
 sound/soc/codecs/rt5640.c                     |   4 +-
 sound/soc/codecs/rt5651.c                     |   4 +-
 sound/soc/codecs/rt5663.c                     |   4 +-
 sound/soc/dwc/dwc-i2s.c                       |   5 +-
 sound/soc/fsl/fsl_asrc.c                      |   3 +-
 sound/soc/fsl/fsl_esai.c                      |   3 +-
 sound/soc/fsl/fsl_sai.c                       |   3 +-
 sound/soc/fsl/fsl_spdif.c                     |   3 +-
 sound/soc/fsl/fsl_ssi.c                       |   3 +-
 sound/usb/midi.c                              |   6 +-
 sound/usb/misc/ua101.c                        |   4 +-
 sound/x86/intel_hdmi_audio.c                  |   5 +-
 681 files changed, 2457 insertions(+), 1308 deletions(-)
 create mode 100644 Documentation/admin-guide/mds.rst
 create mode 100644 Documentation/clearcpu.txt
 create mode 100644 arch/x86/include/asm/clearbpf.h
 create mode 100644 arch/x86/include/asm/clearcpu.h
 create mode 100644 arch/x86/include/asm/trace/clearcpu.h
 create mode 100644 include/linux/clearcpu.h

-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 01/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 02/43] MDSv6 Andi Kleen
                   ` (41 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Add basic bug infrastructure
 for MDS

MDS is micro architectural data sampling, which is a side channel
attack on internal buffers in Intel CPUs.

MDS consists of multiple sub-vulnerabilities:
Microarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126)
Microarchitectual Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130)
Microarchitectual Load Port Data (MLPDS) (CVE-2018-12127),
with the first leaking store data, and the second loads and sometimes
store data, and the third load data.

They all have the same mitigations for single thread, so we lump them all
together as a single MDS issue.

This patch adds the basic infrastructure to detect if the current
CPU is affected by MDS, and if yes set the right BUG bits.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/include/asm/msr-index.h   |  1 +
 arch/x86/kernel/cpu/common.c       | 13 +++++++++++++
 3 files changed, 15 insertions(+)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 6d6122524711..9ef6c5dc00dc 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -381,5 +381,6 @@
 #define X86_BUG_SPECTRE_V2		X86_BUG(16) /* CPU is affected by Spectre variant 2 attack with indirect branches */
 #define X86_BUG_SPEC_STORE_BYPASS	X86_BUG(17) /* CPU is affected by speculative store bypass attack */
 #define X86_BUG_L1TF			X86_BUG(18) /* CPU is affected by L1 Terminal Fault */
+#define X86_BUG_MDS			X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */
 
 #endif /* _ASM_X86_CPUFEATURES_H */
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 8e40c2446fd1..3e486d9d6e6c 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -77,6 +77,7 @@
 						    * attack, so no Speculative Store Bypass
 						    * control required.
 						    */
+#define ARCH_CAP_MDS_NO			(1 << 5)   /* No Microarchitectural data sampling */
 
 #define MSR_IA32_FLUSH_CMD		0x0000010b
 #define L1D_FLUSH			(1 << 0)   /*
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index cb28e98a0659..bac5a3a38f0d 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -998,6 +998,14 @@ static const __initconst struct x86_cpu_id cpu_no_l1tf[] = {
 	{}
 };
 
+static const __initconst struct x86_cpu_id cpu_no_mds[] = {
+	/* in addition to cpu_no_speculation */
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_GOLDMONT	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_GOLDMONT_X	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_GOLDMONT_PLUS	},
+	{}
+};
+
 static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 {
 	u64 ia32_cap = 0;
@@ -1019,6 +1027,11 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 	if (ia32_cap & ARCH_CAP_IBRS_ALL)
 		setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
 
+	if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+	    !x86_match_cpu(cpu_no_mds)) &&
+	    !(ia32_cap & ARCH_CAP_MDS_NO))
+		setup_force_cpu_bug(X86_BUG_MDS);
+
 	if (x86_match_cpu(cpu_no_meltdown))
 		return;
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 02/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 01/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 03/43] MDSv6 Andi Kleen
                   ` (40 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Add basic code to clear unconditonally on every kernel exit.

The flushing is provided by new microcode as a new side
effect of the otherwise unused VERW instruction.

Future patches will provide more sophisticated policies
on when to clear.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/entry/common.c            |  3 +++
 arch/x86/include/asm/clearcpu.h    | 23 +++++++++++++++++++++++
 arch/x86/include/asm/cpufeatures.h |  1 +
 arch/x86/kernel/nmi.c              |  5 ++++-
 4 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/include/asm/clearcpu.h

diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index 7bc105f47d21..dfd51d97d683 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -29,6 +29,7 @@
 #include <asm/desc.h>
 #include <asm/traps.h>
 #include <asm/vdso.h>
+#include <asm/clearcpu.h>
 #include <linux/uaccess.h>
 #include <asm/cpufeature.h>
 
@@ -211,6 +212,8 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
 	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
 #endif
 
+	clear_cpu();
+
 	user_enter_irqoff();
 }
 
diff --git a/arch/x86/include/asm/clearcpu.h b/arch/x86/include/asm/clearcpu.h
new file mode 100644
index 000000000000..1da885793805
--- /dev/null
+++ b/arch/x86/include/asm/clearcpu.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_CLEARCPU_H
+#define _ASM_CLEARCPU_H 1
+
+#include <linux/jump_label.h>
+#include <linux/sched/smt.h>
+#include <asm/alternative.h>
+#include <linux/thread_info.h>
+
+/*
+ * Clear CPU buffers to avoid side channels.
+ * We use microcode as a side effect of the obsolete VERW instruction
+ */
+
+static inline void clear_cpu(void)
+{
+	unsigned kernel_ds = __KERNEL_DS;
+	/* Has to be memory form, don't modify to use an register */
+	alternative_input("", "verw %[kernelds]", X86_BUG_MDS,
+		[kernelds] "m" (kernel_ds));
+}
+
+#endif
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 9ef6c5dc00dc..233ca598826f 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -344,6 +344,7 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
 #define X86_FEATURE_AVX512_4VNNIW	(18*32+ 2) /* AVX-512 Neural Network Instructions */
 #define X86_FEATURE_AVX512_4FMAPS	(18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
+#define X86_FEATURE_MD_CLEAR		(18*32+10) /* Flush state on VERW */
 #define X86_FEATURE_PCONFIG		(18*32+18) /* Intel PCONFIG */
 #define X86_FEATURE_SPEC_CTRL		(18*32+26) /* "" Speculation Control (IBRS + IBPB) */
 #define X86_FEATURE_INTEL_STIBP		(18*32+27) /* "" Single Thread Indirect Branch Predictors */
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 18bc9b51ac9b..1c5507400089 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -494,7 +494,7 @@ do_nmi(struct pt_regs *regs, long error_code)
 {
 	if (this_cpu_read(nmi_state) != NMI_NOT_RUNNING) {
 		this_cpu_write(nmi_state, NMI_LATCHED);
-		return;
+		goto out;
 	}
 	this_cpu_write(nmi_state, NMI_EXECUTING);
 	this_cpu_write(nmi_cr2, read_cr2());
@@ -533,6 +533,9 @@ do_nmi(struct pt_regs *regs, long error_code)
 		write_cr2(this_cpu_read(nmi_cr2));
 	if (this_cpu_dec_return(nmi_state))
 		goto nmi_restart;
+
+out:
+	clear_cpu();
 }
 NOKPROBE_SYMBOL(do_nmi);
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 03/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 01/43] MDSv6 Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 02/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 04/43] MDSv6 Andi Kleen
                   ` (39 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Clear CPU buffers on entering
 idle

When entering idle the internal state of the current CPU might
become visible to the thread sibling because the CPU "frees" some
internal resources.

To ensure there is no MDS leakage always clear the CPU state
before doing any idling. We only do this if SMT is enabled,
as otherwise there is no leakage possible.

Not needed for idle poll because it does not share resources.

In a Hypervisor we might not know the true SMT state,
but in this case idle does exit, and we assume
the hypervisor takes care of any needed clears
during the next entry.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/clearcpu.h | 18 ++++++++++++++++++
 arch/x86/kernel/acpi/cstate.c   |  2 ++
 arch/x86/kernel/kvm.c           |  3 +++
 arch/x86/kernel/process.c       |  5 +++++
 arch/x86/kernel/smpboot.c       |  3 +++
 drivers/acpi/acpi_pad.c         |  2 ++
 drivers/acpi/processor_idle.c   |  3 +++
 drivers/idle/intel_idle.c       |  5 +++++
 8 files changed, 41 insertions(+)

diff --git a/arch/x86/include/asm/clearcpu.h b/arch/x86/include/asm/clearcpu.h
index 1da885793805..d4a5e43311a8 100644
--- a/arch/x86/include/asm/clearcpu.h
+++ b/arch/x86/include/asm/clearcpu.h
@@ -20,4 +20,22 @@ static inline void clear_cpu(void)
 		[kernelds] "m" (kernel_ds));
 }
 
+/*
+ * Clear CPU buffers before going idle, so that no state is leaked to SMT
+ * siblings taking over thread resources.
+ * Out of line to avoid include hell.
+ *
+ * Assumes that interrupts are disabled and only get reenabled
+ * before idle, otherwise the data from a racing interrupt might not
+ * get cleared. There are some callers who violate this,
+ * but they are only used in unattackable cases, like CPU
+ * offlining.
+ */
+
+static inline void clear_cpu_idle(void)
+{
+	if (sched_smt_active())
+		clear_cpu();
+}
+
 #endif
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index 158ad1483c43..48adea5afacf 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -14,6 +14,7 @@
 #include <acpi/processor.h>
 #include <asm/mwait.h>
 #include <asm/special_insns.h>
+#include <asm/clearcpu.h>
 
 /*
  * Initialize bm_flags based on the CPU cache properties
@@ -157,6 +158,7 @@ void __cpuidle acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cx)
 	unsigned int cpu = smp_processor_id();
 	struct cstate_entry *percpu_entry;
 
+	clear_cpu_idle();
 	percpu_entry = per_cpu_ptr(cpu_cstate_entry, cpu);
 	mwait_idle_with_hints(percpu_entry->states[cx->index].eax,
 	                      percpu_entry->states[cx->index].ecx);
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 5c93a65ee1e5..5352a60a3b9b 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -159,6 +159,7 @@ void kvm_async_pf_task_wait(u32 token, int interrupt_kernel)
 			/*
 			 * We cannot reschedule. So halt.
 			 */
+			clear_cpu_idle();
 			native_safe_halt();
 			local_irq_disable();
 		}
@@ -788,6 +789,8 @@ static void kvm_wait(u8 *ptr, u8 val)
 	if (READ_ONCE(*ptr) != val)
 		goto out;
 
+	clear_cpu_idle();
+
 	/*
 	 * halt until it's our turn and kicked. Note that we do safe halt
 	 * for irq enabled case to avoid hang when lock info is overwritten
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 90ae0ca51083..9d9f2d2b209d 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -42,6 +42,7 @@
 #include <asm/prctl.h>
 #include <asm/spec-ctrl.h>
 #include <asm/proto.h>
+#include <asm/clearcpu.h>
 
 #include "process.h"
 
@@ -589,6 +590,8 @@ void stop_this_cpu(void *dummy)
 	disable_local_APIC();
 	mcheck_cpu_clear(this_cpu_ptr(&cpu_info));
 
+	clear_cpu_idle();
+
 	/*
 	 * Use wbinvd on processors that support SME. This provides support
 	 * for performing a successful kexec when going from SME inactive
@@ -675,6 +678,8 @@ static __cpuidle void mwait_idle(void)
 			mb(); /* quirk */
 		}
 
+		clear_cpu_idle();
+
 		__monitor((void *)&current_thread_info()->flags, 0, 0);
 		if (!need_resched())
 			__sti_mwait(0, 0);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ccd1f2a8e557..c7fff6b09253 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -81,6 +81,7 @@
 #include <asm/cpu_device_id.h>
 #include <asm/spec-ctrl.h>
 #include <asm/hw_irq.h>
+#include <asm/clearcpu.h>
 
 /* representing HT siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map);
@@ -1635,6 +1636,7 @@ static inline void mwait_play_dead(void)
 	wbinvd();
 
 	while (1) {
+		clear_cpu_idle();
 		/*
 		 * The CLFLUSH is a workaround for erratum AAI65 for
 		 * the Xeon 7400 series.  It's not clear it is actually
@@ -1662,6 +1664,7 @@ void hlt_play_dead(void)
 		wbinvd();
 
 	while (1) {
+		clear_cpu_idle();
 		native_halt();
 		/*
 		 * If NMI wants to wake up CPU0, start CPU0.
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index a47676a55b84..a9b24637f1a8 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -26,6 +26,7 @@
 #include <linux/tick.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
+#include <linux/clearcpu.h>
 #include <asm/mwait.h>
 #include <xen/xen.h>
 
@@ -175,6 +176,7 @@ static int power_saving_thread(void *data)
 			tick_broadcast_enable();
 			tick_broadcast_enter();
 			stop_critical_timings();
+			clear_cpu_idle();
 
 			mwait_idle_with_hints(power_saving_mwait_eax, 1);
 
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index b2131c4ea124..b4406ca1dfd7 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -33,6 +33,7 @@
 #include <linux/cpuidle.h>
 #include <linux/cpu.h>
 #include <acpi/processor.h>
+#include <asm/clearcpu.h>
 
 /*
  * Include the apic definitions for x86 to have the APIC timer related defines
@@ -121,6 +122,7 @@ static const struct dmi_system_id processor_power_dmi_table[] = {
 static void __cpuidle acpi_safe_halt(void)
 {
 	if (!tif_need_resched()) {
+		clear_cpu_idle();
 		safe_halt();
 		local_irq_disable();
 	}
@@ -681,6 +683,7 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
 
 	ACPI_FLUSH_CPU_CACHE();
 
+	clear_cpu_idle();
 	while (1) {
 
 		if (cx->entry_method == ACPI_CSTATE_HALT)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 8b5d85c91e9d..ddaa7603d53a 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -65,6 +65,7 @@
 #include <asm/intel-family.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
+#include <asm/clearcpu.h>
 
 #define INTEL_IDLE_VERSION "0.4.1"
 
@@ -933,6 +934,8 @@ static __cpuidle int intel_idle(struct cpuidle_device *dev,
 		}
 	}
 
+	clear_cpu_idle();
+
 	mwait_idle_with_hints(eax, ecx);
 
 	if (!static_cpu_has(X86_FEATURE_ARAT) && tick)
@@ -953,6 +956,8 @@ static void intel_idle_s2idle(struct cpuidle_device *dev,
 	unsigned long ecx = 1; /* break on interrupt flag */
 	unsigned long eax = flg2MWAIT(drv->states[index].flags);
 
+	clear_cpu_idle();
+
 	mwait_idle_with_hints(eax, ecx);
 }
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 04/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (2 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 03/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 05/43] MDSv6 Andi Kleen
                   ` (38 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Parse mds=off / mds=auto / mds=full on the kernel command line.

Only mds=off has an effect, mds=auto is equal to mds=full and
is default currently.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 .../admin-guide/kernel-parameters.txt         | 11 +++++++
 arch/x86/include/asm/clearcpu.h               |  2 +-
 arch/x86/include/asm/cpufeatures.h            |  1 +
 arch/x86/kernel/cpu/bugs.c                    | 31 +++++++++++++++++++
 4 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 858b6c0b9a15..753b8982770e 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2356,6 +2356,17 @@
 			Format: <first>,<last>
 			Specifies range of consoles to be captured by the MDA.
 
+	mds=off		[X86, Intel]
+			Disable workarounds for Micro-architectural Data Sampling.
+
+	mds=auto	[X86, Intel]
+			Automatically select default for MDS mitigation.
+			Currently this always flushes on kernel exit.
+
+	mds=full	[X86, Intel]
+			Always flush cpu buffers when exiting kernel for MDS
+			without any heuristics.
+
 	mem=nn[KMG]	[KNL,BOOT] Force usage of a specific amount of memory
 			Amount of memory to be used when the kernel is not able
 			to see the whole system memory or for test.
diff --git a/arch/x86/include/asm/clearcpu.h b/arch/x86/include/asm/clearcpu.h
index d4a5e43311a8..88ab27694aa6 100644
--- a/arch/x86/include/asm/clearcpu.h
+++ b/arch/x86/include/asm/clearcpu.h
@@ -16,7 +16,7 @@ static inline void clear_cpu(void)
 {
 	unsigned kernel_ds = __KERNEL_DS;
 	/* Has to be memory form, don't modify to use an register */
-	alternative_input("", "verw %[kernelds]", X86_BUG_MDS,
+	alternative_input("", "verw %[kernelds]", X86_FEATURE_VERW,
 		[kernelds] "m" (kernel_ds));
 }
 
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 233ca598826f..27735ae3c3a2 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -221,6 +221,7 @@
 #define X86_FEATURE_ZEN			( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
 #define X86_FEATURE_L1TF_PTEINV		( 7*32+29) /* "" L1TF workaround PTE inversion */
 #define X86_FEATURE_IBRS_ENHANCED	( 7*32+30) /* Enhanced IBRS */
+#define X86_FEATURE_VERW		( 7*32+31) /* "" VERW for MDS on kernel exit */
 
 /* Virtualization flags: Linux defined, word 8 */
 #define X86_FEATURE_TPR_SHADOW		( 8*32+ 0) /* Intel TPR Shadow */
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 01874d54f4fd..b93565ab20b3 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -37,6 +37,7 @@
 static void __init spectre_v2_select_mitigation(void);
 static void __init ssb_select_mitigation(void);
 static void __init l1tf_select_mitigation(void);
+static void __init mds_select_mitigation(void);
 
 /* The base value of the SPEC_CTRL MSR that always has to be preserved. */
 u64 x86_spec_ctrl_base;
@@ -101,6 +102,8 @@ void __init check_bugs(void)
 
 	l1tf_select_mitigation();
 
+	mds_select_mitigation();
+
 #ifdef CONFIG_X86_32
 	/*
 	 * Check whether we are able to run this kernel safely on SMP.
@@ -1058,6 +1061,34 @@ early_param("l1tf", l1tf_cmdline);
 
 #undef pr_fmt
 
+static void mds_select_mitigation(void)
+{
+	if (!boot_cpu_has(X86_BUG_MDS))
+		return;
+
+	/*
+	 * Use VERW even if the CPUID does not report MD_CLEAR,
+	 * in case we're running in a legacy hypervisor that
+	 * doesn't pass through CPUID properly.
+	 *
+	 * This causes some extra overhead on CPUs that don't need
+	 * VERW.
+	 *
+	 * This is supposed to handle the slow release cycle
+	 * of VMware who doesn't update CPUIDs timely in 2019.
+	 * If the year is 2020 and you still see this please
+	 * guard this with
+	 * if (boot_cpu_has(X86_FEATURE_MD_CLEAR)) setup_force ... VERW
+	 */
+	setup_force_cpu_cap(X86_FEATURE_VERW);
+	if (cmdline_find_option_bool(boot_command_line, "mds=off"))
+		setup_clear_cpu_cap(X86_FEATURE_VERW);
+	/* Nop currently because this is default for now. */
+	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
+	     cmdline_find_option_bool(boot_command_line, "mds=auto"))
+		setup_force_cpu_cap(X86_FEATURE_VERW);
+}
+
 #ifdef CONFIG_SYSFS
 
 #define L1TF_DEFAULT_MSG "Mitigation: PTE Inversion"
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 05/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (3 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 04/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 06/43] MDSv6 Andi Kleen
                   ` (37 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Add sysfs reporting

Report mds mitigation state in sysfs vulnerabilities.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 .../ABI/testing/sysfs-devices-system-cpu      |  1 +
 arch/x86/kernel/cpu/bugs.c                    | 24 +++++++++++++++++++
 drivers/base/cpu.c                            |  8 +++++++
 3 files changed, 33 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index 9605dbd4b5b5..2db5c3407fd6 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -484,6 +484,7 @@ What:		/sys/devices/system/cpu/vulnerabilities
 		/sys/devices/system/cpu/vulnerabilities/spectre_v2
 		/sys/devices/system/cpu/vulnerabilities/spec_store_bypass
 		/sys/devices/system/cpu/vulnerabilities/l1tf
+		/sys/devices/system/cpu/vulnerabilities/mds
 Date:		January 2018
 Contact:	Linux kernel mailing list <linux-kernel@vger.kernel.org>
 Description:	Information about CPU vulnerabilities
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index b93565ab20b3..4114b4f94c1d 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1192,6 +1192,24 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
 		if (boot_cpu_has(X86_FEATURE_L1TF_PTEINV))
 			return l1tf_show_state(buf);
 		break;
+
+	case X86_BUG_MDS:
+		if (boot_cpu_has(X86_FEATURE_VERW) &&
+		    boot_cpu_has(X86_FEATURE_MD_CLEAR)) {
+			if (cpu_smt_control != CPU_SMT_ENABLED) {
+				/*
+				 * Avoid lying when a hypervisor didn't export
+				 * the SMT state.
+				 */
+				if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
+					return sprintf(buf,
+						"Mitigation: microcode, SMT potentially vulnerable\n");
+				return sprintf(buf, "Mitigation: microcode\n");
+			}
+			return sprintf(buf, "Mitigation: microcode, SMT vulnerable\n");
+		}
+		return sprintf(buf, "Vulnerable\n");
+
 	default:
 		break;
 	}
@@ -1223,4 +1241,10 @@ ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *b
 {
 	return cpu_show_common(dev, attr, buf, X86_BUG_L1TF);
 }
+
+ssize_t cpu_show_mds(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	return cpu_show_common(dev, attr, buf, X86_BUG_MDS);
+}
+
 #endif
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index eb9443d5bae1..2fd6ca1021c2 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -546,11 +546,18 @@ ssize_t __weak cpu_show_l1tf(struct device *dev,
 	return sprintf(buf, "Not affected\n");
 }
 
+ssize_t __weak cpu_show_mds(struct device *dev,
+			    struct device_attribute *attr, char *buf)
+{
+	return sprintf(buf, "Not affected\n");
+}
+
 static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
 static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
 static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
 static DEVICE_ATTR(spec_store_bypass, 0444, cpu_show_spec_store_bypass, NULL);
 static DEVICE_ATTR(l1tf, 0444, cpu_show_l1tf, NULL);
+static DEVICE_ATTR(mds, 0444, cpu_show_mds, NULL);
 
 static struct attribute *cpu_root_vulnerabilities_attrs[] = {
 	&dev_attr_meltdown.attr,
@@ -558,6 +565,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = {
 	&dev_attr_spectre_v2.attr,
 	&dev_attr_spec_store_bypass.attr,
 	&dev_attr_l1tf.attr,
+	&dev_attr_mds.attr,
 	NULL
 };
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 06/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (4 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 05/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 07/43] MDSv6 Andi Kleen
                   ` (36 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Add a Documentation file for administrators that describes MDS on a
high level.

Needs updates later for public URLs of supporting documentation.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 Documentation/admin-guide/mds.rst | 95 +++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 Documentation/admin-guide/mds.rst

diff --git a/Documentation/admin-guide/mds.rst b/Documentation/admin-guide/mds.rst
new file mode 100644
index 000000000000..045ecf8f37f0
--- /dev/null
+++ b/Documentation/admin-guide/mds.rst
@@ -0,0 +1,95 @@
+MDS - Microarchitectural Data Sampling)
+=======================================
+
+Microarchitectural Data Sampling is a side channel vulnerability that
+allows an attacker to sample data that has been earlier used during
+program execution. Internal buffers in the CPU may keep old data
+for some limited time, which can the later be determined by an attacker
+with side channel analysis. MDS can be used to occasionaly observe
+some values accessed earlier, but it cannot be used to observe values
+not recently touched by other code running on the same core.
+
+It is difficult to target particular data on a system using MDS,
+but attackers may be able to infer secrets by collecting
+and analyzing large amounts of data. MDS does not modify
+memory.
+
+MDS consists of multiple sub-vulnerabilities:
+Microarchitectural Store Buffer Data Sampling (MSBDS) (CVE-2018-12126)
+Microarchitectual Fill Buffer Data Sampling (MFBDS) (CVE-2018-12130)
+Microarchitectual Load Port Data (MLPDS) (CVE-2018-12127),
+with the first leaking store data, and the second loads and sometimes
+store data, and the third load data.
+
+The effects and mitigations are similar for all three, so the Linux
+kernel handles and reports them all as a single vulnerability called
+MDS. This also reduces the number of acronyms in use.
+
+Affected processors
+-------------------
+
+This vulnerability affects a wide range of Intel processors.
+Not all CPUs are affected by all of the sub vulnerabilities,
+however the kernel handles it always the same.
+
+The vulnerability is not present in
+
+    - Some Atoms (Bonnell, Saltwell, Goldmont, GoldmontPlus)
+
+The kernel will automatically detect future CPUs with hardware
+mitigations for these issues and disable any workarounds.
+
+The kernel reports if the current CPU is vulnerable and any
+mitigations used in
+
+/sys/devices/system/cpu/vulnerabilities/mds
+
+Kernel mitigation
+-----------------
+
+The mitigation is automatically enabled, but can be further controlled
+with the command line options documented below.
+
+The kernel clears the CPU buffers at every kernel exit.
+
+The mitigation can be done with microcode support, requiring
+updated microcode.
+
+The microcode should be loaded at early boot using the initrd. Hot
+updating microcode will not enable the mitigations.
+
+Virtual machine mitigation
+--------------------------
+
+The mitigation is enabled by default and controlled by the same options
+as L1TF cache clearing. See l1tf.rst for more details. In the default
+setting MDS for leaking data out of the guest into other processes
+will be mitigated.
+
+Kernel command line options
+---------------------------
+
+Normally the kernel selects reasonable defaults and no special configuration
+is needed. The default behavior can be overriden by the mds= kernel
+command line options.
+
+These options can be specified in the boot loader. Any changes require a reboot.
+
+When the system only runs trusted code, MDS mitigation can be disabled with
+mds=off as a performance optimization.
+
+   - mds=off      Disable workarounds if the CPU is not affected.
+
+   - mds=auto     Automatically select mitigation.
+
+   - mds=full	  Currently equivalent to default.
+
+References
+----------
+
+Fore more details on the kernel internal implementation of the MDS mitigations,
+please see Documentation/clearcpu.txt
+
+TBD Add URL for Intel white paper
+
+TBD add reference to microcodes
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 07/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (5 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 06/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 08/43] MDSv6 Andi Kleen
                   ` (35 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Export MD_CLEAR CPUID to KVM
 guests.

Export the MD_CLEAR CPUID set by new microcode to signal
that VERW implements the clear cpu side effect to KVM guests.

Also requires corresponding qemu patches

Tested-by: Neelima Krishnan <neelima.krishnan@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kvm/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index bbffa6c54697..d61272f50aed 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -409,7 +409,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
 		F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
-		F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP);
+		F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP) |
+		F(MD_CLEAR);
 
 	/* all calls to cpuid_count() should be made on the same cpu */
 	get_cpu();
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 08/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (6 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 07/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 09/43] MDSv6 Andi Kleen
                   ` (34 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/cpufeatures: Add word 20 for additional features

We're running out of bits for Linux CPU features, so add a features word
20 for new features. Used in later patches.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/cpufeature.h        | 6 ++++--
 arch/x86/include/asm/cpufeatures.h       | 2 +-
 arch/x86/include/asm/disabled-features.h | 3 ++-
 arch/x86/include/asm/required-features.h | 3 ++-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index ce95b8cbd229..a9e280782d25 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -81,8 +81,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 16, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 17, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) ||	\
+	   CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 19, feature_bit) ||	\
 	   REQUIRED_MASK_CHECK					  ||	\
-	   BUILD_BUG_ON_ZERO(NCAPINTS != 19))
+	   BUILD_BUG_ON_ZERO(NCAPINTS != 20))
 
 #define DISABLED_MASK_BIT_SET(feature_bit)				\
 	 ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK,  0, feature_bit) ||	\
@@ -104,8 +105,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 16, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 17, feature_bit) ||	\
 	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) ||	\
+	   CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 19, feature_bit) ||	\
 	   DISABLED_MASK_CHECK					  ||	\
-	   BUILD_BUG_ON_ZERO(NCAPINTS != 19))
+	   BUILD_BUG_ON_ZERO(NCAPINTS != 20))
 
 #define cpu_has(c, bit)							\
 	(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 :	\
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 27735ae3c3a2..9e934626ea88 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -13,7 +13,7 @@
 /*
  * Defines x86 CPU feature bits
  */
-#define NCAPINTS			19	   /* N 32-bit words worth of info */
+#define NCAPINTS			20	   /* N 32-bit words worth of info */
 #define NBUGINTS			1	   /* N 32-bit bug flags */
 
 /*
diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h
index a5ea841cc6d2..f0f935f8d917 100644
--- a/arch/x86/include/asm/disabled-features.h
+++ b/arch/x86/include/asm/disabled-features.h
@@ -84,6 +84,7 @@
 #define DISABLED_MASK16	(DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)
 #define DISABLED_MASK17	0
 #define DISABLED_MASK18	0
-#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
+#define DISABLED_MASK19	0
+#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)
 
 #endif /* _ASM_X86_DISABLED_FEATURES_H */
diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index 6847d85400a8..fa5700097f64 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -101,6 +101,7 @@
 #define REQUIRED_MASK16	0
 #define REQUIRED_MASK17	0
 #define REQUIRED_MASK18	0
-#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
+#define REQUIRED_MASK19	0
+#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)
 
 #endif /* _ASM_X86_REQUIRED_FEATURES_H */
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 09/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (7 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 08/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 10/43] MDSv6 Andi Kleen
                   ` (33 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Handle VMENTRY clear for CPUs
 without l1tf

Some Atom CPUs don't have L1TF, but have (parts of) MDS.

Normally we rely on the L1TF L1D clear on vm entry to avoid
leaking data to the guest. But these Atom CPUs don't support
the L1D clear MSR. Add special code to trigger VERW explicitly
on KVM guest entry.

We use similar logic as the conditional l1d flush, which
is default and currently cannot be overriden.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/cpufeatures.h |  4 ++++
 arch/x86/kernel/cpu/bugs.c         |  3 +++
 arch/x86/kernel/cpu/common.c       | 14 +++++++++++++-
 arch/x86/kvm/vmx/vmx.c             | 20 +++++++++++++++-----
 4 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 9e934626ea88..80ab5d026157 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -353,6 +353,9 @@
 #define X86_FEATURE_ARCH_CAPABILITIES	(18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */
 #define X86_FEATURE_SPEC_CTRL_SSBD	(18*32+31) /* "" Speculative Store Bypass Disable */
 
+/* Linux defined features, word 19 */
+#define X86_FEATURE_MDS_VMENTRY_FLUSH	(19*32+0) /* MDS needs extra flush for vmentry */
+
 /*
  * BUG word(s)
  */
@@ -384,5 +387,6 @@
 #define X86_BUG_SPEC_STORE_BYPASS	X86_BUG(17) /* CPU is affected by speculative store bypass attack */
 #define X86_BUG_L1TF			X86_BUG(18) /* CPU is affected by L1 Terminal Fault */
 #define X86_BUG_MDS			X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */
+#define X86_BUG_MDS_NO_L1TF		X86_BUG(20) /* MDS but no L1TF L1D flush */
 
 #endif /* _ASM_X86_CPUFEATURES_H */
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 4114b4f94c1d..26b890f18239 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1087,6 +1087,9 @@ static void mds_select_mitigation(void)
 	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
 	     cmdline_find_option_bool(boot_command_line, "mds=auto"))
 		setup_force_cpu_cap(X86_FEATURE_VERW);
+
+	if (boot_cpu_has(X86_FEATURE_VERW) && boot_cpu_has_bug(X86_BUG_MDS_NO_L1TF))
+		setup_force_cpu_cap(X86_FEATURE_MDS_VMENTRY_FLUSH);
 }
 
 #ifdef CONFIG_SYSFS
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index bac5a3a38f0d..94d0eeb0a94b 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1006,6 +1006,15 @@ static const __initconst struct x86_cpu_id cpu_no_mds[] = {
 	{}
 };
 
+/* CPUs with MDS, but not L1TF, that don't have L1D flush */
+static const __initconst struct x86_cpu_id cpu_mds_no_l1d[] = {
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_AIRMONT		},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_AIRMONT_MID	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_SILVERMONT	},
+	{ X86_VENDOR_INTEL,	6,	INTEL_FAM6_ATOM_SILVERMONT_X	},
+	{}
+};
+
 static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 {
 	u64 ia32_cap = 0;
@@ -1029,8 +1038,11 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 
 	if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
 	    !x86_match_cpu(cpu_no_mds)) &&
-	    !(ia32_cap & ARCH_CAP_MDS_NO))
+	    !(ia32_cap & ARCH_CAP_MDS_NO)) {
 		setup_force_cpu_bug(X86_BUG_MDS);
+		if (x86_match_cpu(cpu_mds_no_l1d))
+			setup_force_cpu_bug(X86_BUG_MDS_NO_L1TF);
+	}
 
 	if (x86_match_cpu(cpu_no_meltdown))
 		return;
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 30a6bcd735ec..fb2be25a4aa6 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5866,27 +5866,36 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
 static void vmx_l1d_flush(struct kvm_vcpu *vcpu)
 {
 	int size = PAGE_SIZE << L1D_CACHE_ORDER;
+	bool flush_l1d = vcpu->arch.l1tf_flush_l1d;
+
+	flush_l1d |= kvm_get_cpu_l1tf_flush_l1d();
+
+	/* CPUs with MDS_VMENTRY_FLUSH never use the L1D flush below. */
+	if (static_cpu_has(X86_FEATURE_MDS_VMENTRY_FLUSH)) {
+		vcpu->arch.l1tf_flush_l1d = false;
+		kvm_clear_cpu_l1tf_flush_l1d();
+		if (!flush_l1d && !static_key_enabled(&force_cpu_clear))
+			return;
+		clear_cpu();
+		return;
+	}
 
 	/*
 	 * This code is only executed when the the flush mode is 'cond' or
 	 * 'always'
 	 */
 	if (static_branch_likely(&vmx_l1d_flush_cond)) {
-		bool flush_l1d;
-
 		/*
 		 * Clear the per-vcpu flush bit, it gets set again
 		 * either from vcpu_run() or from one of the unsafe
 		 * VMEXIT handlers.
 		 */
-		flush_l1d = vcpu->arch.l1tf_flush_l1d;
 		vcpu->arch.l1tf_flush_l1d = false;
 
 		/*
 		 * Clear the per-cpu flush bit, it gets set again from
 		 * the interrupt handlers.
 		 */
-		flush_l1d |= kvm_get_cpu_l1tf_flush_l1d();
 		kvm_clear_cpu_l1tf_flush_l1d();
 
 		if (!flush_l1d)
@@ -6369,7 +6378,8 @@ static void __vmx_vcpu_run(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx)
 	evmcs_rsp = static_branch_unlikely(&enable_evmcs) ?
 		(unsigned long)&current_evmcs->host_rsp : 0;
 
-	if (static_branch_unlikely(&vmx_l1d_should_flush))
+	if (static_branch_unlikely(&vmx_l1d_should_flush) ||
+	    static_cpu_has(X86_FEATURE_MDS_VMENTRY_FLUSH))
 		vmx_l1d_flush(vcpu);
 
 	asm(
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 10/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (8 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 09/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-25 16:11   ` [MODERATED] " Greg KH
                     ` (2 more replies)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 11/43] MDSv6 Andi Kleen
                   ` (32 subsequent siblings)
  42 siblings, 3 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds: Add documentation for clear cpu usage

Including the theory, and some guide lines for subsystem/driver
maintainers.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 Documentation/clearcpu.txt | 261 +++++++++++++++++++++++++++++++++++++
 1 file changed, 261 insertions(+)
 create mode 100644 Documentation/clearcpu.txt

diff --git a/Documentation/clearcpu.txt b/Documentation/clearcpu.txt
new file mode 100644
index 000000000000..a45e5d82868a
--- /dev/null
+++ b/Documentation/clearcpu.txt
@@ -0,0 +1,261 @@
+
+Security model for Microarchitectural Data Sampling
+===================================================
+
+Some CPUs can leave read or written data in internal buffers,
+which then later might be sampled through side effects.
+For more details see CVE-2018-12126 CVE-2018-12130 CVE-2018-12127
+
+This can be avoided by explicitly clearing the CPU state.
+
+We attempt to avoid leaking data between different processes,
+and also some sensitive data, like cryptographic data, to
+user space.
+
+We support three modes:
+
+(1) mitigation off (mds=off)
+(2) clear only when needed (default)
+(3) clear on every kernel exit, or guest entry (mds=full)
+
+(1) and (3) are trivial, the rest of the document discusses (2)
+
+In general option (3) is the most conservative choice. It does
+not make ST assumptions about leaking data.
+
+Basic requirements and assumptions
+----------------------------------
+
+Kernel addresses and kernel temporary data are not sensitive.
+
+User data is sensitive, but only for other processes.
+
+User data is anything in the user address space, or data buffers
+directly copied from/to the user (e.g. read/write). It does not
+include metadata, or flag settings. For example packet headers
+or file names are not sensitive in this model.
+
+Block IO data (but not meta data) is sensitive.
+
+Most data structures in the kernel are not sensitive.
+
+Kernel data is sensitive when it involves cryptographic keys.
+
+We consider data from input devices (such as key presses)
+sensitive. We also consider sound data or terminal
+data sensitive.
+
+We assume that only data actually accessed by the kernel by explicit
+instructions can be leaked.  Note that this may not be always
+true, in theory prefetching or speculation may touch more. The assumption
+is that if any such happens it will be very low bandwidth and hard
+to control due to the existing Spectre and other mitigations,
+such as memory randomization.  If a user is concerned about this they
+need to use mds=full.
+
+Guidance for driver/subsystem developers
+----------------------------------------
+
+[These generally need to be enforced in code review for new code now]
+
+When you touch user supplied data of *other* processes in system call
+context add lazy_clear_cpu().
+
+For the cases below we care only about data from other processes.
+Touching non cryptographic data from the current process is always allowed.
+
+Touching only pointers to user data is always allowed.
+
+When your interrupt does touch user data directly mark it with IRQF_USER_DATA.
+
+When your tasklet does touch user data directly, mark it TASKLET_USER_DATA
+using tasklet_init_flags/or DECLARE_TASKLET_USERDATA*.
+
+When your timer does touch user data mark it with TIMER_USER_DATA
+If it is a hrtimer and touches user data, mark it with HRTIMER_MODE_USER_DATA.
+
+When your irq poll handler does touch user data, mark it lazy_clear_cpu().
+
+For networking code, make sure to only touch user data through
+skb_push/put/copy [add more], unless it is data from the current
+process. If that is not ensured add lazy_clear_cpu or
+lazy_clear_cpu_interrupt.
+
+Any cryptographic code touching key data should use memzero_explicit
+or kzfree to free the data.
+
+If your RCU callback touches user data add lazy_clear_cpu().
+
+These steps are currently only needed for code that runs on MDS affected
+CPUs, which is currently only x86. But might be worth being prepared
+if other architectures become affected too.
+
+Implementation details/assumptions
+----------------------------------
+
+Any buffer clearing is done lazily on next kernel exit. lazy_clear*
+is only a few fast instructions with no cache misses setting
+a flag and can be used frequently even in fast paths.
+
+Protecting process data
+-----------------------
+
+If a system call touches data of its own process, CPU state does not
+need to be cleared, because it has already access to it.
+
+On context switching we clear data, unless the context switch is
+inside a process. We also clear after any context switches from kernel
+threads.
+
+Cryptographic keys inside the kernel should be protected.
+We assume they use kzfree() or memzero_explicit() to clear
+state, so these functions trigger a cpu clear.
+
+Hard Interrupts and tasklets
+----------------------------
+
+Most interrupt handlers for modern devices do not touch
+user data, because they rely on DMA and only manipulate
+pointers. They have been audited.
+
+Some handlers copy data, but often use strategic
+functions which can be marked with a lazy clear.
+For example memcpy_from/to_io, swiotlb (see below
+for a full list)
+
+Some handlers touch user data without using these strategic
+functions, these have to be marked with IRQF_USER_DATA.
+All in tree handlers have been audited.
+
+Softirqs
+--------
+
+Softirqs are handled case by case:
+
+        TIMER: see timers below.
+        NET_*: see networking below.
+        BLOCK: do not touch user data, except
+	for a few using kmap_atomic. We have a lazy_clear_cpu_interrupt()
+	in kmap_atomic for this case.
+
+        IRQ_POLL: generally do not touch user data
+        TASKLET: see tasklets below
+        SCHED:   only touches scheduler metadata
+        RCU:	RCU handlers generally only free.
+
+Networking
+----------
+
+This is only about network code running in hard interrupt
+or softirq or timer context. Per process network code
+generally only touches data for the current process,
+so does not need any changes.
+
+In principle packet data should be encrypted anyways for the wire,
+but we try to avoid leaking it anyways.
+
+For networking code, any skb functions that are likely
+touching non header packet data schedule a clear cpu at next
+kernel exit. This includes skb_copy and related, skb_put/push,
+checksum functions.  We assume that any networking code touching
+packet data uses these functions.
+
+NMIs / machine checks
+---------------------
+
+Assume they don't touch other processes user data. Most NMI
+handlers are fairly simple and trivial and only concerned with
+some non user hardware state. The machine check handlers and perf PMI
+handlers are complicated (e.g. perf can touch user stack), but they
+never touch any data not of the current process.
+
+Other interrupts
+----------------
+
+SMP function interrupt call backs have been audited and don't touch
+any user data.
+
+Clear points
+------------
+
+We schedule clears in some centralized functions to minimize impact
+on the  overall code.
+
+Always clear:
+
+kernel preemption		undefined state, need to always clear
+context switch			protect user / kernel thread data
+VM entry			protect host against guest
+
+Always schedule clear for next kernel exit:
+
+kzfree / memzero_explicit	keys and crypto data
+
+Only schedule clear for next exit when called in interrupts:
+
+kmap_atomic			block drivers touching user process data
+memcpy_from/to_io		drivers copying IO data
+insw*, outs*
+input_event			input drivers touching user IO data
+serio_interrupt
+tty_insert_*			tty drivers touching user input IO data
+swiotlb				bounce buffers touching IO data
+sg_copy_*			scsi drivers touching IO data in interrupts
+skb_put, skb_copy_*		networking code touching IO data
+skb_*csum*
+snd_pcm_period_elapsed,		sound drivers touching IO data
+snd_rawmidi_transmit/receive
+snd_timer_interrupt
+
+Sandboxes
+---------
+
+We don't do anything special for seccomp processes
+
+If there is a sandbox inside the process the process should take care
+itself of clearing its own sensitive data before running sandbox
+code. This would include data touched by system calls.
+
+BPF
+---
+
+Assume BPF execution does not touch other user's data, so does
+not need to schedule a clear for itself.
+
+BPF could attack the rest of the kernel if it can successfully
+measure side channel side effects.
+
+When the BPF program was loaded unprivileged, always clear the CPU
+to prevent any exploits written in BPF using side channels to read
+data leaked from other kernel code
+
+We only do this when running in an interrupt, or if an clear cpu is
+already scheduled (which means for example there was a context
+switch, or crypto operation before)
+
+In process context we assume the code only accesses data of the
+current user and check that the BPF running was loaded by the
+same user so even if data leaked it would not cross privilege
+boundaries.
+
+Technically we would only need to do this if the BPF program
+contains conditional branches and loads dominated by them, but
+let's assume that nearly all do.
+
+This could be further optimized by batching clears for
+many similar EBPF executions in a row (e.g. for packet
+processing). This would need ensuring that no sensitive
+data is touched inbetween the EBPF executions, and also
+that all EBPF scripts are set up by the same uid.
+We could add such optimizations later based on
+profile data.
+
+Virtualization
+--------------
+
+When entering a guest in KVM we clear to avoid any leakage to a guest.
+Normally this is done implicitly as part of the L1TF mitigation,
+except on a few CPUs that are not vulnerable to L1TF and need
+explicit clear. It relies on L1TF being enabled. It also uses the
+"fast exit" optimization that only clears if an interrupt or context switch
+happened during a VMexit, unless mds=full is used.
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 11/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (9 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 10/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 12/43] MDSv6 Andi Kleen
                   ` (31 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Add basic infrastructure for code to request CPU buffer clearing
on the next kernel exit.

We have two functions lazy_clear_cpu to request clearing,
and lazy_clear_cpu_interrupt to request clearing if running
in an interrupt.

Non architecture specific code can include linux/clearcpu.h
and use lazy_clear_cpu / lazy_clear_interrupt. On x86
we provide low level implementations that sets a per cpu
flag to request cpu clearing on the next kernel exit.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/Kconfig                    |  3 +++
 arch/x86/Kconfig                |  1 +
 arch/x86/include/asm/clearcpu.h | 12 +++++++++--
 arch/x86/kernel/cpu/bugs.c      |  3 +++
 include/linux/clearcpu.h        | 36 +++++++++++++++++++++++++++++++++
 5 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 include/linux/clearcpu.h

diff --git a/arch/Kconfig b/arch/Kconfig
index 4cfb6de48f79..e6b7bf9174aa 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -808,6 +808,9 @@ config VMAP_STACK
 	  the stack to map directly to the KASAN shadow map using a formula
 	  that is incorrect if the stack is in vmalloc space.
 
+config ARCH_HAS_CLEAR_CPU
+	def_bool n
+
 config ARCH_OPTIONAL_KERNEL_RWX
 	def_bool n
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 68261430fe6e..1b837b61d07b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -84,6 +84,7 @@ config X86
 	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
 	select ARCH_WANTS_DYNAMIC_TASK_STRUCT
 	select ARCH_WANTS_THP_SWAP		if X86_64
+	select ARCH_HAS_CLEAR_CPU
 	select BUILDTIME_EXTABLE_SORT
 	select CLKEVT_I8253
 	select CLOCKSOURCE_VALIDATE_LAST_CYCLE
diff --git a/arch/x86/include/asm/clearcpu.h b/arch/x86/include/asm/clearcpu.h
index 88ab27694aa6..15d25c2436da 100644
--- a/arch/x86/include/asm/clearcpu.h
+++ b/arch/x86/include/asm/clearcpu.h
@@ -5,7 +5,8 @@
 #include <linux/jump_label.h>
 #include <linux/sched/smt.h>
 #include <asm/alternative.h>
-#include <linux/thread_info.h>
+
+DECLARE_PER_CPU(bool, clear_cpu_flag);
 
 /*
  * Clear CPU buffers to avoid side channels.
@@ -34,8 +35,15 @@ static inline void clear_cpu(void)
 
 static inline void clear_cpu_idle(void)
 {
-	if (sched_smt_active())
+	if (sched_smt_active()) {
+		__this_cpu_write(clear_cpu_flag, false);
 		clear_cpu();
+	}
+}
+
+static inline void lazy_clear_cpu(void)
+{
+	__this_cpu_write(clear_cpu_flag, true);
 }
 
 #endif
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 26b890f18239..067309190a6a 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1061,6 +1061,9 @@ early_param("l1tf", l1tf_cmdline);
 
 #undef pr_fmt
 
+DEFINE_PER_CPU(bool, clear_cpu_flag);
+EXPORT_PER_CPU_SYMBOL(clear_cpu_flag);
+
 static void mds_select_mitigation(void)
 {
 	if (!boot_cpu_has(X86_BUG_MDS))
diff --git a/include/linux/clearcpu.h b/include/linux/clearcpu.h
new file mode 100644
index 000000000000..63a6952b46fa
--- /dev/null
+++ b/include/linux/clearcpu.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_CLEARCPU_H
+#define _LINUX_CLEARCPU_H 1
+
+#include <linux/preempt.h>
+
+#ifdef CONFIG_ARCH_HAS_CLEAR_CPU
+#include <asm/clearcpu.h>
+#else
+static inline void lazy_clear_cpu(void)
+{
+}
+#endif
+
+/*
+ * Use this function when potentially touching (reading or writing)
+ * user data in an interrupt. In this case schedule to clear the
+ * CPU buffers on kernel exit to avoid any potential side channels.
+ *
+ * If not in an interrupt we assume the touched data belongs to the
+ * current process and doesn't need to be cleared.
+ *
+ * This version is for code who might be in an interrupt.
+ * If you know for sure you're in interrupt context call
+ * lazy_clear_cpu directly.
+ *
+ * lazy_clear_cpu is reasonably cheap (just sets a bit) and
+ * can be used in fast paths.
+ */
+static inline void lazy_clear_cpu_interrupt(void)
+{
+	if (in_interrupt())
+		lazy_clear_cpu();
+}
+
+#endif
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 12/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (10 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 11/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 13/43] MDSv6 Andi Kleen
                   ` (30 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Add a static key to guard clear_cpus on kernel exit and vm entry,
so that we can implement a mds=full implementation later, once
we have a new lazy policy.

Right now the static key is enabled by default, so there
is no behavior change.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/entry/common.c         |  3 ++-
 arch/x86/include/asm/clearcpu.h |  2 ++
 arch/x86/kernel/cpu/bugs.c      | 10 ++++++++--
 arch/x86/kernel/nmi.c           |  3 ++-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index dfd51d97d683..ffcc24620ec9 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -212,7 +212,8 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
 	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
 #endif
 
-	clear_cpu();
+	if (static_key_enabled(&force_cpu_clear))
+		clear_cpu();
 
 	user_enter_irqoff();
 }
diff --git a/arch/x86/include/asm/clearcpu.h b/arch/x86/include/asm/clearcpu.h
index 15d25c2436da..30e802bae2ca 100644
--- a/arch/x86/include/asm/clearcpu.h
+++ b/arch/x86/include/asm/clearcpu.h
@@ -46,4 +46,6 @@ static inline void lazy_clear_cpu(void)
 	__this_cpu_write(clear_cpu_flag, true);
 }
 
+DECLARE_STATIC_KEY_FALSE(force_cpu_clear);
+
 #endif
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 067309190a6a..a756c57979be 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1064,6 +1064,9 @@ early_param("l1tf", l1tf_cmdline);
 DEFINE_PER_CPU(bool, clear_cpu_flag);
 EXPORT_PER_CPU_SYMBOL(clear_cpu_flag);
 
+DEFINE_STATIC_KEY_FALSE(force_cpu_clear);
+EXPORT_SYMBOL(force_cpu_clear);
+
 static void mds_select_mitigation(void)
 {
 	if (!boot_cpu_has(X86_BUG_MDS))
@@ -1086,9 +1089,12 @@ static void mds_select_mitigation(void)
 	setup_force_cpu_cap(X86_FEATURE_VERW);
 	if (cmdline_find_option_bool(boot_command_line, "mds=off"))
 		setup_clear_cpu_cap(X86_FEATURE_VERW);
-	/* Nop currently because this is default for now. */
+	/* Default to old behavior for now */
 	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
-	     cmdline_find_option_bool(boot_command_line, "mds=auto"))
+		true)
+		static_branch_enable(&force_cpu_clear);
+	/* Nop currently because this is default for now. */
+	if (cmdline_find_option_bool(boot_command_line, "mds=auto"))
 		setup_force_cpu_cap(X86_FEATURE_VERW);
 
 	if (boot_cpu_has(X86_FEATURE_VERW) && boot_cpu_has_bug(X86_BUG_MDS_NO_L1TF))
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 1c5507400089..eb6e39238d1d 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -535,7 +535,8 @@ do_nmi(struct pt_regs *regs, long error_code)
 		goto nmi_restart;
 
 out:
-	clear_cpu();
+	if (static_key_enabled(&force_cpu_clear))
+		clear_cpu();
 }
 NOKPROBE_SYMBOL(do_nmi);
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 13/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (11 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 12/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 14/43] MDSv6 Andi Kleen
                   ` (29 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Check lazy clear in kernel exit

Add support for only clearing on kernel exit when the per
cpu clear flag is set. This will be the base of lazy
clearing.

Right now this is a nop because mds=full is still default.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/entry/common.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index ffcc24620ec9..cd6e044d6599 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -212,8 +212,12 @@ __visible inline void prepare_exit_to_usermode(struct pt_regs *regs)
 	ti->status &= ~(TS_COMPAT|TS_I386_REGS_POKED);
 #endif
 
-	if (static_key_enabled(&force_cpu_clear))
+	if (static_cpu_has(X86_BUG_MDS) &&
+		(static_key_enabled(&force_cpu_clear) ||
+		 __this_cpu_read(clear_cpu_flag))) {
 		clear_cpu();
+		__this_cpu_write(clear_cpu_flag, false);
+	}
 
 	user_enter_irqoff();
 }
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 14/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (12 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 13/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 15/43] MDSv6 Andi Kleen
                   ` (28 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Add trace points for clear_cpu and lazy_clear_cpu. This is useful
for debugging and performance testing.

The trace points have to be partially out of line to avoid
include loops, but the fast path jump labels are inlined.

The idle case cannot be traced because trace points
don't like idle context.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/clearcpu.h       | 36 +++++++++++++++++++++++++--
 arch/x86/include/asm/trace/clearcpu.h | 27 ++++++++++++++++++++
 arch/x86/kernel/cpu/bugs.c            | 17 +++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/trace/clearcpu.h

diff --git a/arch/x86/include/asm/clearcpu.h b/arch/x86/include/asm/clearcpu.h
index 30e802bae2ca..b6f3a7184531 100644
--- a/arch/x86/include/asm/clearcpu.h
+++ b/arch/x86/include/asm/clearcpu.h
@@ -6,6 +6,29 @@
 #include <linux/sched/smt.h>
 #include <asm/alternative.h>
 
+/*
+ * We cannot directly include the trace point header here
+ * because it leads to include loops with other trace point
+ * files pulling this one in. Define the static
+ * key manually here, which handles noping the fast path,
+ * and the actual tracing is done out of line.
+ */
+#ifdef CONFIG_TRACEPOINTS
+#include <asm/atomic.h>
+#include <linux/tracepoint-defs.h>
+
+extern struct tracepoint __tracepoint_clear_cpu;
+extern struct tracepoint __tracepoint_lazy_clear_cpu;
+#define cc_tracepoint_active(t) static_key_false(&(t).key)
+
+extern void do_trace_clear_cpu(void);
+extern void do_trace_lazy_clear_cpu(void);
+#else
+#define cc_tracepoint_active(t) false
+static inline void do_trace_clear_cpu(void) {}
+static inline void do_trace_lazy_clear_cpu(void) {}
+#endif
+
 DECLARE_PER_CPU(bool, clear_cpu_flag);
 
 /*
@@ -13,7 +36,7 @@ DECLARE_PER_CPU(bool, clear_cpu_flag);
  * We use microcode as a side effect of the obsolete VERW instruction
  */
 
-static inline void clear_cpu(void)
+static inline void __clear_cpu(void)
 {
 	unsigned kernel_ds = __KERNEL_DS;
 	/* Has to be memory form, don't modify to use an register */
@@ -21,6 +44,13 @@ static inline void clear_cpu(void)
 		[kernelds] "m" (kernel_ds));
 }
 
+static inline void clear_cpu(void)
+{
+	if (cc_tracepoint_active(__tracepoint_clear_cpu))
+		do_trace_clear_cpu();
+	__clear_cpu();
+}
+
 /*
  * Clear CPU buffers before going idle, so that no state is leaked to SMT
  * siblings taking over thread resources.
@@ -37,12 +67,14 @@ static inline void clear_cpu_idle(void)
 {
 	if (sched_smt_active()) {
 		__this_cpu_write(clear_cpu_flag, false);
-		clear_cpu();
+		__clear_cpu();
 	}
 }
 
 static inline void lazy_clear_cpu(void)
 {
+	if (cc_tracepoint_active(__tracepoint_lazy_clear_cpu))
+		do_trace_lazy_clear_cpu();
 	__this_cpu_write(clear_cpu_flag, true);
 }
 
diff --git a/arch/x86/include/asm/trace/clearcpu.h b/arch/x86/include/asm/trace/clearcpu.h
new file mode 100644
index 000000000000..e742b5cd8ee9
--- /dev/null
+++ b/arch/x86/include/asm/trace/clearcpu.h
@@ -0,0 +1,27 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM clearcpu
+
+#if !defined(_TRACE_CLEARCPU_H) || defined(TRACE_HEADER_MULTI_READ)
+
+#include <linux/tracepoint.h>
+
+DECLARE_EVENT_CLASS(clear_cpu,
+		    TP_PROTO(int dummy),
+		    TP_ARGS(dummy),
+		    TP_STRUCT__entry(__field(int, dummy)),
+		    TP_fast_assign(),
+		    TP_printk("%d", __entry->dummy));
+
+DEFINE_EVENT(clear_cpu, clear_cpu, TP_PROTO(int dummy), TP_ARGS(dummy));
+DEFINE_EVENT(clear_cpu, lazy_clear_cpu, TP_PROTO(int dummy), TP_ARGS(dummy));
+
+#define _TRACE_CLEARCPU_H
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH asm/trace/
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE clearcpu
+#endif /* _TRACE_CLEARCPU_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index a756c57979be..146f9abc1931 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1061,6 +1061,23 @@ early_param("l1tf", l1tf_cmdline);
 
 #undef pr_fmt
 
+#define CREATE_TRACE_POINTS
+#include <asm/trace/clearcpu.h>
+
+void do_trace_clear_cpu(void)
+{
+	trace_clear_cpu(0);
+}
+EXPORT_SYMBOL(do_trace_clear_cpu);
+EXPORT_TRACEPOINT_SYMBOL(clear_cpu);
+
+void do_trace_lazy_clear_cpu(void)
+{
+	trace_lazy_clear_cpu(0);
+}
+EXPORT_SYMBOL(do_trace_lazy_clear_cpu);
+EXPORT_TRACEPOINT_SYMBOL(lazy_clear_cpu);
+
 DEFINE_PER_CPU(bool, clear_cpu_flag);
 EXPORT_PER_CPU_SYMBOL(clear_cpu_flag);
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 15/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (13 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 14/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 16/43] MDSv6 Andi Kleen
                   ` (27 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  x86/speculation/mds: Schedule cpu clear on context
 switch

On context switch we need to schedule a cpu clear on the next
kernel exit when:

- We're switching between different processes
- We're switching from a kernel thread

For kernel threads like work queue assume they might contain
sensitive (other user's or crypto) data.

switch_mm already distinguishes these cases. We either
schedule a flush when the mm is different, or we
were in lazy mm mode, which means a kernel thread
ran before.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/process.h |  1 +
 arch/x86/mm/tlb.c         | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/arch/x86/kernel/process.h b/arch/x86/kernel/process.h
index 320ab978fb1f..976722d8b537 100644
--- a/arch/x86/kernel/process.h
+++ b/arch/x86/kernel/process.h
@@ -2,6 +2,7 @@
 //
 // Code shared between 32 and 64 bit
 
+#include <linux/clearcpu.h>
 #include <asm/spec-ctrl.h>
 
 void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 999d6d8f0bef..995420034f57 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -342,6 +342,13 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
 				 !cpumask_test_cpu(cpu, mm_cpumask(next))))
 			cpumask_set_cpu(cpu, mm_cpumask(next));
 
+		/*
+		 * We switched through a kernel thread, so schedule
+		 * a cpu clear to protect the thread.
+		 */
+		if (static_cpu_has_bug(X86_BUG_MDS) && was_lazy)
+			lazy_clear_cpu();
+
 		/*
 		 * If the CPU is not in lazy TLB mode, we are just switching
 		 * from one thread in a process to another thread in the same
@@ -376,6 +383,13 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
 		 */
 		cond_ibpb(tsk);
 
+		/*
+		 * We're switching to a different process, so schedule
+		 * a cpu clear.
+		 */
+		if (static_cpu_has_bug(X86_BUG_MDS))
+			lazy_clear_cpu();
+
 		if (IS_ENABLED(CONFIG_VMAP_STACK)) {
 			/*
 			 * If our current stack is in vmalloc space and isn't
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 16/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (14 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 15/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 17/43] MDSv6 Andi Kleen
                   ` (26 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds: Force clear cpu on kernel preemption

When the kernel is preempted we need to force a cpu clear,
because the preemption might happen before the code
has a chance to set TIF_CPU_CLEAR later.

We cannot rely on kernel code setting the flag before
touching sensitive data: the flag setting could
be implicit, like in memzero_explicit, which is always
called later.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 kernel/sched/core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d8d76a65cfdd..38e57235f4b7 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -11,6 +11,8 @@
 
 #include <linux/kcov.h>
 
+#include <linux/clearcpu.h>
+
 #include <asm/switch_to.h>
 #include <asm/tlb.h>
 
@@ -3632,6 +3634,13 @@ asmlinkage __visible void __sched notrace preempt_schedule(void)
 	if (likely(!preemptible()))
 		return;
 
+	/*
+	 * For kernel preemption we need to force a cpu clear
+	 * because it could happen before the code has a chance
+	 * to set TIF_CLEAR_CPU.
+	 */
+	lazy_clear_cpu();
+
 	preempt_schedule_common();
 }
 NOKPROBE_SYMBOL(preempt_schedule);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 17/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (15 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 16/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 18/43] MDSv6 Andi Kleen
                   ` (25 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Assume that any code using these functions is sensitive and shouldn't
leak any data.

This handles clearing for key and cryptographic data used in the kernel.

It also schedules a clear after each get_random_bytes, which while
being slightly overkill, may protect some hash table key secrets.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 lib/string.c     | 6 ++++++
 mm/slab_common.c | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/string.c b/lib/string.c
index 38e4ca08e757..9ce59dd86541 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -28,6 +28,7 @@
 #include <linux/bug.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
+#include <linux/clearcpu.h>
 
 #include <asm/byteorder.h>
 #include <asm/word-at-a-time.h>
@@ -715,12 +716,17 @@ EXPORT_SYMBOL(memset);
  * necessary, memzero_explicit() should be used instead in
  * order to prevent the compiler from optimising away zeroing.
  *
+ * As a side effect this may also trigger extra cleaning
+ * of CPU state before the next kernel exit to avoid
+ * side channels.
+ *
  * memzero_explicit() doesn't need an arch-specific version as
  * it just invokes the one of memset() implicitly.
  */
 void memzero_explicit(void *s, size_t count)
 {
 	memset(s, 0, count);
+	lazy_clear_cpu();
 	barrier_data(s);
 }
 EXPORT_SYMBOL(memzero_explicit);
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 81732d05e74a..7b5e2e1318a2 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -1576,6 +1576,9 @@ EXPORT_SYMBOL(krealloc);
  * Note: this function zeroes the whole allocated buffer which can be a good
  * deal bigger than the requested buffer size passed to kmalloc(). So be
  * careful when using this function in performance sensitive code.
+ *
+ * As a side effect this may also clear CPU state later before the
+ * next kernel exit to avoid side channels.
  */
 void kzfree(const void *p)
 {
@@ -1585,7 +1588,7 @@ void kzfree(const void *p)
 	if (unlikely(ZERO_OR_NULL_PTR(mem)))
 		return;
 	ks = ksize(mem);
-	memset(mem, 0, ks);
+	memzero_explicit(mem, ks);
 	kfree(mem);
 }
 EXPORT_SYMBOL(kzfree);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 18/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (16 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 17/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 19/43] MDSv6 Andi Kleen
                   ` (24 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds: Support cpu clear in interrupts

According to an audit the majority of interrupt handlers
do not touch user data.

But some do. Add a IRQ_F_USER_DATA flag to enable
clearing after an interrupt.

Future patches will add this flag to interrupts
that need it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/interrupt.h | 2 ++
 kernel/irq/handle.c       | 4 ++++
 kernel/irq/manage.c       | 1 +
 3 files changed, 7 insertions(+)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 4a728dba02e2..0f8ddb7ba09b 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -61,6 +61,7 @@
  *                interrupt handler after suspending interrupts. For system
  *                wakeup devices users need to implement wakeup detection in
  *                their interrupt handlers.
+ * IRQF_USER_DATA - Interrupt does touch user data
  */
 #define IRQF_SHARED		0x00000080
 #define IRQF_PROBE_SHARED	0x00000100
@@ -74,6 +75,7 @@
 #define IRQF_NO_THREAD		0x00010000
 #define IRQF_EARLY_RESUME	0x00020000
 #define IRQF_COND_SUSPEND	0x00040000
+#define IRQF_USER_DATA		0x00080000
 
 #define IRQF_TIMER		(__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
 
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 38554bc35375..46895311e849 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
+#include <linux/clearcpu.h>
 
 #include <trace/events/irq.h>
 
@@ -149,6 +150,9 @@ irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc, unsigned int *flags
 		res = action->handler(irq, action->dev_id);
 		trace_irq_handler_exit(irq, action, res);
 
+		if (action->flags & IRQF_USER_DATA)
+			lazy_clear_cpu();
+
 		if (WARN_ONCE(!irqs_disabled(),"irq %u handler %pF enabled interrupts\n",
 			      irq, action->handler))
 			local_irq_disable();
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 84b54a17b95d..d1de8d797fc8 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1796,6 +1796,7 @@ EXPORT_SYMBOL(free_irq);
  *
  *	IRQF_SHARED		Interrupt is shared
  *	IRQF_TRIGGER_*		Specify active edge(s) or level
+ *	IRQF_USER_DATA		Handler touches user data with CPU.
  *
  */
 int request_threaded_irq(unsigned int irq, irq_handler_t handler,
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 19/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (17 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 18/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 20/43] MDSv6 Andi Kleen
                   ` (23 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds: Support cpu clear after tasklets

tasklets run asynchronously to user processes.

Most tasklets don't touch user data, but some do. Add a per
tasklet flag to request CPU clearing after the tasklet executes.

Later patches will use this to mark tasklets that need it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/interrupt.h | 16 +++++++++++++++-
 kernel/softirq.c          | 25 +++++++++++++++++++------
 2 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 0f8ddb7ba09b..df795f2f5f34 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -572,11 +572,22 @@ struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
 #define DECLARE_TASKLET_DISABLED(name, func, data) \
 struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
 
+#define DECLARE_TASKLET_USERDATA(name, func, data) \
+struct tasklet_struct name = { NULL, TASKLET_USER_DATA, ATOMIC_INIT(0), func, data }
+
+#define DECLARE_TASKLET_USERDATA_DISABLED(name, func, data) \
+struct tasklet_struct name = { NULL, TASKLET_USER_DATA, ATOMIC_INIT(1), func, data }
 
 enum
 {
 	TASKLET_STATE_SCHED,	/* Tasklet is scheduled for execution */
-	TASKLET_STATE_RUN	/* Tasklet is running (SMP only) */
+	TASKLET_STATE_RUN,	/* Tasklet is running (SMP only) */
+
+	/*
+	 * Set this flag when the tasklet is known to touch user data,
+	 * so needs extra CPU state clearing.
+	 */
+	TASKLET_USER_DATA	= 1 << 5,
 };
 
 #ifdef CONFIG_SMP
@@ -640,6 +651,9 @@ extern void tasklet_kill(struct tasklet_struct *t);
 extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
 extern void tasklet_init(struct tasklet_struct *t,
 			 void (*func)(unsigned long), unsigned long data);
+extern void tasklet_init_flags(struct tasklet_struct *t,
+			 void (*func)(unsigned long), unsigned long data,
+			 unsigned flags);
 
 struct tasklet_hrtimer {
 	struct hrtimer		timer;
diff --git a/kernel/softirq.c b/kernel/softirq.c
index d28813306b2c..b2d348cc8b2e 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -26,6 +26,7 @@
 #include <linux/smpboot.h>
 #include <linux/tick.h>
 #include <linux/irq.h>
+#include <linux/clearcpu.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/irq.h>
@@ -522,6 +523,8 @@ static void tasklet_action_common(struct softirq_action *a,
 					BUG();
 				t->func(t->data);
 				tasklet_unlock(t);
+				if (t->state & TASKLET_USER_DATA)
+					lazy_clear_cpu();
 				continue;
 			}
 			tasklet_unlock(t);
@@ -546,15 +549,23 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
 	tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
 }
 
-void tasklet_init(struct tasklet_struct *t,
-		  void (*func)(unsigned long), unsigned long data)
+void tasklet_init_flags(struct tasklet_struct *t,
+		  void (*func)(unsigned long), unsigned long data,
+		  unsigned flags)
 {
 	t->next = NULL;
-	t->state = 0;
+	t->state = flags;
 	atomic_set(&t->count, 0);
 	t->func = func;
 	t->data = data;
 }
+EXPORT_SYMBOL(tasklet_init_flags);
+
+void tasklet_init(struct tasklet_struct *t,
+		  void (*func)(unsigned long), unsigned long data)
+{
+	tasklet_init_flags(t, func, data, 0);
+}
 EXPORT_SYMBOL(tasklet_init);
 
 void tasklet_kill(struct tasklet_struct *t)
@@ -609,7 +620,8 @@ static void __tasklet_hrtimer_trampoline(unsigned long data)
  * @ttimer:	 tasklet_hrtimer which is initialized
  * @function:	 hrtimer callback function which gets called from softirq context
  * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME)
- * @mode:	 hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL)
+ * @mode:	 hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL),
+ *		 HRTIMER_MODE_NO_USER
  */
 void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
 			  enum hrtimer_restart (*function)(struct hrtimer *),
@@ -617,8 +629,9 @@ void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
 {
 	hrtimer_init(&ttimer->timer, which_clock, mode);
 	ttimer->timer.function = __hrtimer_tasklet_trampoline;
-	tasklet_init(&ttimer->tasklet, __tasklet_hrtimer_trampoline,
-		     (unsigned long)ttimer);
+	tasklet_init_flags(&ttimer->tasklet, __tasklet_hrtimer_trampoline,
+		     (unsigned long)ttimer,
+		     (mode & HRTIMER_MODE_USER_DATA) ? TASKLET_USER_DATA : 0);
 	ttimer->function = function;
 }
 EXPORT_SYMBOL_GPL(tasklet_hrtimer_init);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 20/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (18 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 19/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 21/43] MDSv6 Andi Kleen
                   ` (22 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Timers run asynchronously to user processes.

According to an audit most timer handlers do not touch user
data, so don't need to clear. But some do.

Add flags to normal and hrtimers to request clearing.

Future patches will use these flags to mark timers
that touch user data.

Note this takes one bit from the timer wheel index field away,
but it seems there are less wheels available anyways, so that
should be ok.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/hrtimer.h |  4 ++++
 include/linux/timer.h   | 14 +++++++++++---
 kernel/time/hrtimer.c   |  5 +++++
 kernel/time/timer.c     |  8 ++++++++
 4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 2e8957eac4d4..c8e3db15e55b 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -32,6 +32,7 @@ struct hrtimer_cpu_base;
  *				  when starting the timer)
  * HRTIMER_MODE_SOFT		- Timer callback function will be executed in
  *				  soft irq context
+ * HRTIMER_MODE_USER_DATA	- Handler does touch user data.
  */
 enum hrtimer_mode {
 	HRTIMER_MODE_ABS	= 0x00,
@@ -48,6 +49,7 @@ enum hrtimer_mode {
 	HRTIMER_MODE_ABS_PINNED_SOFT = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_SOFT,
 	HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT,
 
+	HRTIMER_MODE_USER_DATA	= 0x08,
 };
 
 /*
@@ -101,6 +103,7 @@ enum hrtimer_restart {
  * @state:	state information (See bit values above)
  * @is_rel:	Set if the timer was armed relative
  * @is_soft:	Set if hrtimer will be expired in soft interrupt context.
+ * @user_data:	function does touch user data.
  *
  * The hrtimer structure must be initialized by hrtimer_init()
  */
@@ -112,6 +115,7 @@ struct hrtimer {
 	u8				state;
 	u8				is_rel;
 	u8				is_soft;
+	u8				user_data;
 };
 
 /**
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 7b066fd38248..78ae3602fbcd 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -56,10 +56,13 @@ struct timer_list {
 #define TIMER_DEFERRABLE	0x00080000
 #define TIMER_PINNED		0x00100000
 #define TIMER_IRQSAFE		0x00200000
-#define TIMER_ARRAYSHIFT	22
-#define TIMER_ARRAYMASK		0xFFC00000
+#define TIMER_USER_DATA		0x00400000
+#define TIMER_ARRAYSHIFT	23
+#define TIMER_ARRAYMASK		0xFF800000
 
-#define TIMER_TRACE_FLAGMASK	(TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE)
+#define TIMER_TRACE_FLAGMASK	\
+	(TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE | \
+	 TIMER_USER_DATA)
 
 #define __TIMER_INITIALIZER(_function, _flags) {		\
 		.entry = { .next = TIMER_ENTRY_STATIC },	\
@@ -73,6 +76,11 @@ struct timer_list {
 	struct timer_list _name =				\
 		__TIMER_INITIALIZER(_function, 0)
 
+#define DEFINE_TIMER_USERDATA(_name, _function)			\
+	struct timer_list _name =				\
+		__TIMER_INITIALIZER(_function, TIMER_USER_DATA)
+
+
 /*
  * LOCKDEP and DEBUG timer interfaces.
  */
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index f5cfa1b73d6f..4d8f419ab55f 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -42,6 +42,7 @@
 #include <linux/timer.h>
 #include <linux/freezer.h>
 #include <linux/compat.h>
+#include <linux/clearcpu.h>
 
 #include <linux/uaccess.h>
 
@@ -1276,6 +1277,7 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 		clock_id = CLOCK_MONOTONIC;
 
 	base += hrtimer_clockid_to_base(clock_id);
+	timer->user_data = !!(mode & HRTIMER_MODE_USER_DATA);
 	timer->is_soft = softtimer;
 	timer->base = &cpu_base->clock_base[base];
 	timerqueue_init(&timer->node);
@@ -1390,6 +1392,9 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
 	trace_hrtimer_expire_exit(timer);
 	raw_spin_lock_irq(&cpu_base->lock);
 
+	if (timer->user_data)
+		lazy_clear_cpu();
+
 	/*
 	 * Note: We clear the running state after enqueue_hrtimer and
 	 * we do not reprogram the event hardware. Happens either in
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 444156debfa0..caaa87b91268 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -43,6 +43,7 @@
 #include <linux/sched/debug.h>
 #include <linux/slab.h>
 #include <linux/compat.h>
+#include <linux/clearcpu.h>
 
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
@@ -1338,6 +1339,13 @@ static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list
 		 */
 		preempt_count_set(count);
 	}
+
+	/*
+	 * The timer might have touched user data. Schedule
+	 * a cpu clear on the next kernel exit.
+	 */
+	if (timer->flags & TIMER_USER_DATA)
+		lazy_clear_cpu();
 }
 
 static void expire_timers(struct timer_base *base, struct hlist_head *head)
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 21/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (19 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 20/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 22/43] MDSv6 Andi Kleen
                   ` (21 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Schedule a clear cpu on next kernel exit for string PIO
or memcpy_from/to_io calls, when they are called in
interrupts.

The PIO case is likely already handled by old drivers
not opting in their interrupt handlers to not clear,
but let's do it just to be sure.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/io.h | 3 +++
 include/asm-generic/io.h  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 686247db3106..19e2208eaa94 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -40,6 +40,7 @@
 
 #include <linux/string.h>
 #include <linux/compiler.h>
+#include <linux/clearcpu.h>
 #include <asm/page.h>
 #include <asm/early_ioremap.h>
 #include <asm/pgtable_types.h>
@@ -321,6 +322,7 @@ static inline void outs##bwl(int port, const void *addr, unsigned long count) \
 			     : "+S"(addr), "+c"(count)			\
 			     : "d"(port) : "memory");			\
 	}								\
+	lazy_clear_cpu_interrupt();					\
 }									\
 									\
 static inline void ins##bwl(int port, void *addr, unsigned long count)	\
@@ -337,6 +339,7 @@ static inline void ins##bwl(int port, void *addr, unsigned long count)	\
 			     : "+D"(addr), "+c"(count)			\
 			     : "d"(port) : "memory");			\
 	}								\
+	lazy_clear_cpu_interrupt();					\
 }
 
 BUILDIO(b, b, char)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index d356f802945a..cf58bceea042 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -14,6 +14,7 @@
 #include <asm/page.h> /* I/O is all done through memory accesses */
 #include <linux/string.h> /* for memset() and memcpy() */
 #include <linux/types.h>
+#include <linux/clearcpu.h>
 
 #ifdef CONFIG_GENERIC_IOMAP
 #include <asm-generic/iomap.h>
@@ -1115,6 +1116,7 @@ static inline void memcpy_fromio(void *buffer,
 				 size_t size)
 {
 	memcpy(buffer, __io_virt(addr), size);
+	lazy_clear_cpu_interrupt();
 }
 #endif
 
@@ -1132,6 +1134,7 @@ static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
 			       size_t size)
 {
 	memcpy(__io_virt(addr), buffer, size);
+	lazy_clear_cpu_interrupt();
 }
 #endif
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 22/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (20 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 21/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 23/43] MDSv6 Andi Kleen
                   ` (20 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Schedule a cpu clear on next kernel exit for swiotlb running
in interrupt context, since it touches user data with the CPU.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 kernel/dma/swiotlb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 1fb6fd68b9c7..6123174a5f2c 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -34,6 +34,7 @@
 #include <linux/scatterlist.h>
 #include <linux/mem_encrypt.h>
 #include <linux/set_memory.h>
+#include <linux/clearcpu.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -422,6 +423,7 @@ static void swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr,
 	} else {
 		memcpy(phys_to_virt(orig_addr), vaddr, size);
 	}
+	lazy_clear_cpu_interrupt();
 }
 
 phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 23/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (21 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 22/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 24/43] MDSv6 Andi Kleen
                   ` (19 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Instrument some strategic skbuff functions that either touch
packet data directly, or are likely followed by a user
data touch like a memcpy, to schedule a cpu clear on next
kernel exit. This is only done inside interrupts,
outside we assume it only touches the current processes' data.

In principle network data should be encrypted anyways,
but it's better to not leak it.

This provides protection for the network softirq.

Needs more auditing.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/skbuff.h |  2 ++
 net/core/skbuff.c      | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 95d25b010a25..7cd26e7b15d5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -40,6 +40,7 @@
 #include <linux/in6.h>
 #include <linux/if_packet.h>
 #include <net/flow.h>
+#include <linux/clearcpu.h>
 
 /* The interface for checksum offload between the stack and networking drivers
  * is as follows...
@@ -2093,6 +2094,7 @@ static inline void *__skb_put(struct sk_buff *skb, unsigned int len)
 	SKB_LINEAR_ASSERT(skb);
 	skb->tail += len;
 	skb->len  += len;
+	lazy_clear_cpu_interrupt();
 	return tmp;
 }
 
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 26d848484912..bd30d79b894d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -63,6 +63,7 @@
 #include <linux/errqueue.h>
 #include <linux/prefetch.h>
 #include <linux/if_vlan.h>
+#include <linux/clearcpu.h>
 
 #include <net/protocol.h>
 #include <net/dst.h>
@@ -1189,6 +1190,9 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
 	if (!num_frags)
 		goto release;
 
+	/* Likely to copy user data */
+	lazy_clear_cpu_interrupt();
+
 	new_frags = (__skb_pagelen(skb) + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	for (i = 0; i < new_frags; i++) {
 		page = alloc_page(gfp_mask);
@@ -1353,6 +1357,9 @@ struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
 	if (!n)
 		return NULL;
 
+	/* Copies user data */
+	lazy_clear_cpu_interrupt();
+
 	/* Set the data pointer */
 	skb_reserve(n, headerlen);
 	/* Set the tail pointer and length */
@@ -1460,6 +1467,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 
 	size = SKB_DATA_ALIGN(size);
 
+	lazy_clear_cpu_interrupt();
 	if (skb_pfmemalloc(skb))
 		gfp_mask |= __GFP_MEMALLOC;
 	data = kmalloc_reserve(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
@@ -1524,6 +1532,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 	if (!skb->sk || skb->destructor == sock_edemux)
 		skb->truesize += size - osize;
 
+
 	return 0;
 
 nofrags:
@@ -1588,6 +1597,9 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
 	if (!n)
 		return NULL;
 
+	/* May copy user data */
+	lazy_clear_cpu_interrupt();
+
 	skb_reserve(n, newheadroom);
 
 	/* Set the tail pointer and length */
@@ -1676,6 +1688,8 @@ EXPORT_SYMBOL(__skb_pad);
 
 void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
 {
+	/* Likely to be followed by a user data copy */
+	lazy_clear_cpu_interrupt();
 	if (tail != skb) {
 		skb->data_len += len;
 		skb->len += len;
@@ -1701,6 +1715,8 @@ void *skb_put(struct sk_buff *skb, unsigned int len)
 	skb->len  += len;
 	if (unlikely(skb->tail > skb->end))
 		skb_over_panic(skb, len, __builtin_return_address(0));
+	/* Likely to be followed by a user data copy */
+	lazy_clear_cpu_interrupt();
 	return tmp;
 }
 EXPORT_SYMBOL(skb_put);
@@ -1720,6 +1736,7 @@ void *skb_push(struct sk_buff *skb, unsigned int len)
 	skb->len  += len;
 	if (unlikely(skb->data < skb->head))
 		skb_under_panic(skb, len, __builtin_return_address(0));
+	/* No clear cpu, assume this is only header data */
 	return skb->data;
 }
 EXPORT_SYMBOL(skb_push);
@@ -2026,6 +2043,9 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len)
 	struct sk_buff *frag_iter;
 	int i, copy;
 
+	/* Copies user data */
+	lazy_clear_cpu_interrupt();
+
 	if (offset > (int)skb->len - len)
 		goto fault;
 
@@ -2113,6 +2133,8 @@ static struct page *linear_to_page(struct page *page, unsigned int *len,
 {
 	struct page_frag *pfrag = sk_page_frag(sk);
 
+	lazy_clear_cpu_interrupt();
+
 	if (!sk_page_frag_refill(sk, pfrag))
 		return NULL;
 
@@ -2387,6 +2409,9 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len)
 	struct sk_buff *frag_iter;
 	int i, copy;
 
+	/* Copies user data */
+	lazy_clear_cpu_interrupt();
+
 	if (offset > (int)skb->len - len)
 		goto fault;
 
@@ -2467,6 +2492,9 @@ __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len,
 	struct sk_buff *frag_iter;
 	int pos = 0;
 
+	/* Reads packet data */
+	lazy_clear_cpu_interrupt();
+
 	/* Checksum header. */
 	if (copy > 0) {
 		if (copy > len)
@@ -2559,6 +2587,9 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
 	struct sk_buff *frag_iter;
 	int pos = 0;
 
+	/* Reads packet data */
+	lazy_clear_cpu_interrupt();
+
 	/* Copy header. */
 	if (copy > 0) {
 		if (copy > len)
@@ -3445,6 +3476,7 @@ void *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
 	BUG_ON(len > skb->len);
 	__skb_pull(skb, len);
 	skb_postpull_rcsum(skb, data, len);
+	lazy_clear_cpu_interrupt();
 	return skb->data;
 }
 EXPORT_SYMBOL_GPL(skb_pull_rcsum);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 24/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (22 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 23/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 25/43] MDSv6 Andi Kleen
                   ` (18 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Some block drivers do kmap_atomic to access user data
in interrupts. Add lazy_clear_cpu_interrupt to kmap_atomic
to avoid having to patch these drivers.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/mm/highmem_32.c | 3 +++
 include/linux/highmem.h  | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 0d4bdcb84da5..1a0898fa29a9 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -2,6 +2,7 @@
 #include <linux/export.h>
 #include <linux/swap.h> /* for totalram_pages */
 #include <linux/memblock.h>
+#include <linux/clearcpu.h>
 
 void *kmap(struct page *page)
 {
@@ -38,6 +39,8 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
 	preempt_disable();
 	pagefault_disable();
 
+	lazy_clear_cpu_interrupt();
+
 	if (!PageHighMem(page))
 		return page_address(page);
 
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index ea5cdbd8c2c3..6dd4a719b0c7 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -8,6 +8,7 @@
 #include <linux/mm.h>
 #include <linux/uaccess.h>
 #include <linux/hardirq.h>
+#include <linux/clearcpu.h>
 
 #include <asm/cacheflush.h>
 
@@ -92,6 +93,7 @@ static inline void *kmap_atomic(struct page *page)
 {
 	preempt_disable();
 	pagefault_disable();
+	lazy_clear_cpu_interrupt();
 	return page_address(page);
 }
 #define kmap_atomic_prot(page, prot)	kmap_atomic(page)
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 25/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (23 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 24/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 26/43] MDSv6 Andi Kleen
                   ` (17 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

BPF allows the user to run untrusted code in the kernel.

Normally MDS would allow some information leakage either
from other processes  or sensitive kernel code to the user
controlled BPF code.  We cannot rule out that BPF code contains
an MDS exploit and it is difficult to pattern match
gadgets.

The patch aims to add limited number of clear cpus
before BPF executions to guarantee EBPF executions
cannot leak data.

Assume BPF execution does not touch other user's data, so does
not need to schedule a clear for itself.

For EBPF programs loaded privileged (by root) we never clear,
because we already assume they are trusted.

When the BPF program was loaded unprivileged clear the CPU
before the BPF execution, depending on the context it is running in:

We only do this when running in an interrupt, or if an clear cpu is
already scheduled (which means for example there was a context
switch, or crypto operation before)

In process context we check if the current process context
has the same userns+euid as the process who created the BPF.

This handles the common seccomp filter case without
any extra clears, but still adds clears when e.g. a socket
filter runs on a socket inherited to a process with different user id.
It also handles various other common cases.

Technically we would only need to do this if the BPF program
contains conditional branches and loads dominated by them, but
let's assume that near all do.

For example for running chromium with seccomp filters I see
only 15-18% of all sandbox system calls have a clear, most
are likely caused by context switches

Unprivileged EBPF usages in interrupts currently always clear.

This could be further optimized by allowing callers that do
a lot of individual BPF runs and are sure they don't touch
other user's data (that is not accessible to the EBPF anyways)
inbetween to do the clear only once at the beginning. We can add
such optimizations later based on profile data.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/clearbpf.h | 29 +++++++++++++++++++++++++++++
 include/linux/filter.h          | 21 +++++++++++++++++++--
 kernel/bpf/core.c               |  2 ++
 kernel/bpf/cpumap.c             |  3 +++
 4 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/clearbpf.h

diff --git a/arch/x86/include/asm/clearbpf.h b/arch/x86/include/asm/clearbpf.h
new file mode 100644
index 000000000000..3da885e4eb29
--- /dev/null
+++ b/arch/x86/include/asm/clearbpf.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_CLEARBPF_H
+#define _ASM_CLEARBPF_H 1
+
+#include <linux/clearcpu.h>
+#include <linux/cred.h>
+#include <asm/cpufeatures.h>
+
+/*
+ * When the BPF program was loaded unprivileged, clear the CPU
+ * to prevent any exploits written in BPF using side channels to read
+ * data leaked from other kernel code. In some cases, like
+ * process context with the same uid, we can avoid it.
+ *
+ * See Documentation/clearcpu.txt for more details.
+ */
+static inline void arch_bpf_prepare_nonpriv(kuid_t uid)
+{
+	if (!static_cpu_has(X86_BUG_MDS))
+		return;
+	if (in_interrupt() ||
+	    __this_cpu_read(clear_cpu_flag) ||
+	    !uid_eq(current_euid(), uid)) {
+		clear_cpu();
+		__this_cpu_write(clear_cpu_flag, 0);
+	}
+}
+
+#endif
diff --git a/include/linux/filter.h b/include/linux/filter.h
index e532fcc6e4b5..2c7f62f8047a 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -20,12 +20,21 @@
 #include <linux/set_memory.h>
 #include <linux/kallsyms.h>
 #include <linux/if_vlan.h>
+#include <linux/clearcpu.h>
 
 #include <net/sch_generic.h>
 
 #include <uapi/linux/filter.h>
 #include <uapi/linux/bpf.h>
 
+#ifdef CONFIG_ARCH_HAS_CLEAR_CPU
+#include <asm/clearbpf.h>
+#else
+static inline void arch_bpf_prepare_nonpriv(kuid_t uid)
+{
+}
+#endif
+
 struct sk_buff;
 struct sock;
 struct seccomp_data;
@@ -490,7 +499,9 @@ struct bpf_prog {
 				blinded:1,	/* Was blinded */
 				is_func:1,	/* program is a bpf function */
 				kprobe_override:1, /* Do we override a kprobe? */
-				has_callchain_buf:1; /* callchain buffer allocated? */
+				has_callchain_buf:1, /* callchain buffer allocated? */
+				priv:1;		/* Was loaded privileged */
+	kuid_t			uid;		/* Original uid who created it */
 	enum bpf_prog_type	type;		/* Type of BPF program */
 	enum bpf_attach_type	expected_attach_type; /* For some prog types */
 	u32			len;		/* Number of filter blocks */
@@ -513,7 +524,13 @@ struct sk_filter {
 	struct bpf_prog	*prog;
 };
 
-#define BPF_PROG_RUN(filter, ctx)  (*(filter)->bpf_func)(ctx, (filter)->insnsi)
+static inline unsigned _bpf_prog_run(const struct bpf_prog *bp, const void *ctx)
+{
+	if (!bp->priv)
+		arch_bpf_prepare_nonpriv(bp->uid);
+	return bp->bpf_func(ctx, bp->insnsi);
+}
+#define BPF_PROG_RUN(filter, ctx) _bpf_prog_run(filter, ctx)
 
 #define BPF_SKB_CB_LEN QDISC_CB_PRIV_LEN
 
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index f908b9356025..67d845229d46 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -99,6 +99,8 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
 	fp->aux = aux;
 	fp->aux->prog = fp;
 	fp->jit_requested = ebpf_jit_enabled();
+	fp->priv = !!capable(CAP_SYS_ADMIN);
+	fp->uid = current_euid();
 
 	INIT_LIST_HEAD_RCU(&fp->aux->ksym_lnode);
 
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index 8974b3755670..a5c9764168f9 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -376,6 +376,9 @@ static void __cpu_map_entry_free(struct rcu_head *rcu)
 
 		/* No concurrent bq_enqueue can run at this point */
 		bq_flush_to_queue(rcpu, bq, false);
+
+		/* Do lazy_clear_cpu_interrupt here? */
+
 	}
 	free_percpu(rcpu->bulkq);
 	/* Cannot kthread_stop() here, last put free rcpu resources */
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 26/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (24 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 25/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 27/43] MDSv6 Andi Kleen
                   ` (16 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Mark Gross

Whenever a driver isr touches memory that is likely to go to some user
mode process, there is a slight risk of a speculative exploit leaking
the last read or write to an attacker.  This patch adds a call to set
the flag to clear the exploitable buffer upon return to user mode to
handle drivers using scatter gather DMA processing from their ISR.

Signed-off-by: Mark Gross <mgross@linux.intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 lib/scatterlist.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 9ba349e775ef..8fdcf78efcbe 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -11,6 +11,7 @@
 #include <linux/scatterlist.h>
 #include <linux/highmem.h>
 #include <linux/kmemleak.h>
+#include <linux/clearcpu.h>
 
 /**
  * sg_next - return the next scatterlist entry in a list
@@ -831,6 +832,7 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
 
 		offset += len;
 	}
+	lazy_clear_cpu_interrupt();
 
 	sg_miter_stop(&miter);
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 27/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (25 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 26/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 28/43] MDSv6 Andi Kleen
                   ` (15 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Add lazy_clear_cpu_interrupt() in sound core functions that are
generally associated with touching user data in interrupt handlers.
We consider all actual sound data as user data.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 sound/core/pcm_lib.c | 3 +++
 sound/core/rawmidi.c | 3 +++
 sound/core/timer.c   | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 6c0b30391ba9..d05599a8c660 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -25,6 +25,7 @@
 #include <linux/time.h>
 #include <linux/math64.h>
 #include <linux/export.h>
+#include <linux/clearcpu.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/tlv.h>
@@ -1801,6 +1802,8 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream)
 		return;
 	runtime = substream->runtime;
 
+	lazy_clear_cpu();
+
 	snd_pcm_stream_lock_irqsave(substream, flags);
 	if (!snd_pcm_running(substream) ||
 	    snd_pcm_update_hw_ptr0(substream, 1) < 0)
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index ee601d7f0926..5edd3f0eb114 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/mm.h>
+#include <linux/clearcpu.h>
 #include <sound/rawmidi.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -946,6 +947,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
 			wake_up(&runtime->sleep);
 	}
 	spin_unlock_irqrestore(&runtime->lock, flags);
+	lazy_clear_cpu();
 	return result;
 }
 EXPORT_SYMBOL(snd_rawmidi_receive);
@@ -1232,6 +1234,7 @@ int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
 			result = __snd_rawmidi_transmit_ack(substream, count);
 	}
 	spin_unlock_irqrestore(&runtime->lock, flags);
+	lazy_clear_cpu();
 	return result;
 }
 EXPORT_SYMBOL(snd_rawmidi_transmit);
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 61a0cec6e1f6..c8a39813f609 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -27,6 +27,7 @@
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/string.h>
+#include <linux/clearcpu.h>
 #include <linux/sched/signal.h>
 #include <sound/core.h>
 #include <sound/timer.h>
@@ -863,6 +864,8 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
 
 	if (use_tasklet)
 		tasklet_schedule(&timer->task_queue);
+
+	lazy_clear_cpu();
 }
 EXPORT_SYMBOL(snd_timer_interrupt);
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 28/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (26 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 27/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 29/43] MDSv6 Andi Kleen
                   ` (14 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Make MPU401 interrupts clear cpu

A lot of mpu401 based sound cards use PIO or copying. Make the
common interrupt handler schedule a CPU clear.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 sound/drivers/mpu401/mpu401_uart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index dae26e856b26..85610cdcde9f 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -36,6 +36,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/errno.h>
+#include <linux/clearcpu.h>
 #include <sound/core.h>
 #include <sound/mpu401.h>
 
@@ -139,6 +140,7 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id)
 	if (!mpu)
 		return IRQ_NONE;
 	_snd_mpu401_uart_interrupt(mpu);
+	lazy_clear_cpu();
 	return IRQ_HANDLED;
 }
 
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 29/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (27 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 28/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 30/43] MDSv6 Andi Kleen
                   ` (13 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Clear cpu on processing input layer data

Schedule a clear cpu if input layer data is processed from an interrupt
or timer. User key presses and mouse data is considered sensitive.
We patch some strategic places in the input subsystem
to avoid touching a lot of drivers.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/input/input.c       | 3 +++
 drivers/input/serio/serio.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 3304aaaffe87..c22e8e167025 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -27,6 +27,7 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/rcupdate.h>
+#include <linux/clearcpu.h>
 #include "input-compat.h"
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
@@ -436,6 +437,7 @@ void input_event(struct input_dev *dev,
 		input_handle_event(dev, type, code, value);
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
+	lazy_clear_cpu_interrupt();
 }
 EXPORT_SYMBOL(input_event);
 
@@ -468,6 +470,7 @@ void input_inject_event(struct input_handle *handle,
 
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
+	lazy_clear_cpu_interrupt();
 }
 EXPORT_SYMBOL(input_inject_event);
 
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 2e1fb0649260..9b3af41dc05b 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -32,6 +32,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/mutex.h>
+#include <linux/clearcpu.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Serio abstraction core");
@@ -1017,6 +1018,8 @@ irqreturn_t serio_interrupt(struct serio *serio,
 		ret = IRQ_HANDLED;
 	}
 
+	lazy_clear_cpu_interrupt();
+
 	spin_unlock_irqrestore(&serio->lock, flags);
 
 	return ret;
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 30/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (28 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 29/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 31/43] MDSv6 Andi Kleen
                   ` (12 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Clear cpu for tty input

Schedule a clear cpu when input data is passed to the tty
layer in a interrupt. We consider tty data sensitive.
This avoids patching lots of serial drivers.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/tty/tty_buffer.c | 5 ++++-
 include/linux/tty_flip.h | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index 77070c2d1240..71f6dd698968 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -17,6 +17,7 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/ratelimit.h>
+#include <linux/clearcpu.h>
 
 
 #define MIN_TTYB_SIZE	256
@@ -328,6 +329,7 @@ int tty_insert_flip_string_fixed_flag(struct tty_port *port,
 		/* There is a small chance that we need to split the data over
 		   several buffers. If this is the case we must loop */
 	} while (unlikely(size > copied));
+	lazy_clear_cpu_interrupt();
 	return copied;
 }
 EXPORT_SYMBOL(tty_insert_flip_string_fixed_flag);
@@ -363,6 +365,7 @@ int tty_insert_flip_string_flags(struct tty_port *port,
 		/* There is a small chance that we need to split the data over
 		   several buffers. If this is the case we must loop */
 	} while (unlikely(size > copied));
+	lazy_clear_cpu_interrupt();
 	return copied;
 }
 EXPORT_SYMBOL(tty_insert_flip_string_flags);
@@ -388,7 +391,7 @@ int __tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag)
 	if (~tb->flags & TTYB_NORMAL)
 		*flag_buf_ptr(tb, tb->used) = flag;
 	*char_buf_ptr(tb, tb->used++) = ch;
-
+	lazy_clear_cpu_interrupt();
 	return 1;
 }
 EXPORT_SYMBOL(__tty_insert_flip_char);
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 767f62086bd9..41ae39e339b9 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -2,6 +2,8 @@
 #ifndef _LINUX_TTY_FLIP_H
 #define _LINUX_TTY_FLIP_H
 
+#include <linux/clearcpu.h>
+
 extern int tty_buffer_set_limit(struct tty_port *port, int limit);
 extern int tty_buffer_space_avail(struct tty_port *port);
 extern int tty_buffer_request_room(struct tty_port *port, size_t size);
@@ -21,6 +23,8 @@ static inline int tty_insert_flip_char(struct tty_port *port,
 	struct tty_buffer *tb = port->buf.tail;
 	int change;
 
+	lazy_clear_cpu_interrupt();
+
 	change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL);
 	if (!change && tb->used < tb->size) {
 		if (~tb->flags & TTYB_NORMAL)
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 31/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (29 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 30/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-25 15:19   ` [MODERATED] " Greg KH
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 32/43] MDSv6 Andi Kleen
                   ` (11 subsequent siblings)
  42 siblings, 1 reply; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Clear cpu for usbmon intercepts

usbmon touches user data in interrupts that otherwise don't
touch user data. Automatically schedule a clear cpu if
usbmon is called from an interrupt.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/usb/hcd.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 7dc3a411bece..7f37056fe973 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -25,6 +25,7 @@
 #include <linux/rwsem.h>
 #include <linux/interrupt.h>
 #include <linux/idr.h>
+#include <linux/clearcpu.h>
 
 #define MAX_TOPO_LEVEL		6
 
@@ -688,8 +689,10 @@ static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
 static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
 		int status)
 {
-	if (bus->monitored)
+	if (bus->monitored) {
 		(*mon_ops->urb_complete)(bus, urb, status);
+		lazy_clear_cpu_interrupt();
+	}
 }
 
 int usb_mon_register(const struct usb_mon_operations *ops);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 32/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (30 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 31/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 33/43] MDSv6 Andi Kleen
                   ` (10 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Xen has its own call back system that multiplexes a single interrupt.

Most Xen handlers do not touch user data, but a few non performance
critical ones do. Add explicit clearing to those. The fast paths
for block and network IO are not impacted.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/input/misc/xen-kbdfront.c | 3 ++-
 drivers/video/fbdev/xen-fbfront.c | 2 ++
 drivers/xen/pvcalls-front.c       | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 24bc5c5d876f..e7cf4fffcc8b 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -19,6 +19,7 @@
 #include <linux/input.h>
 #include <linux/input/mt.h>
 #include <linux/slab.h>
+#include <linux/clearcpu.h>
 
 #include <asm/xen/hypervisor.h>
 
@@ -193,7 +194,7 @@ static irqreturn_t input_handler(int rq, void *dev_id)
 	mb();			/* ensure we got ring contents */
 	page->in_cons = cons;
 	notify_remote_via_irq(info->irq);
-
+	lazy_clear_cpu();
 	return IRQ_HANDLED;
 }
 
diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
index 6a4bbc9e1fb0..55c4cefd6a24 100644
--- a/drivers/video/fbdev/xen-fbfront.c
+++ b/drivers/video/fbdev/xen-fbfront.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
+#include <linux/clearcpu.h>
 
 #include <asm/xen/hypervisor.h>
 
@@ -358,6 +359,7 @@ static irqreturn_t xenfb_event_handler(int rq, void *dev_id)
 	/* Flush dirty rectangle: */
 	xenfb_refresh(info, INT_MAX, INT_MAX, -INT_MAX, -INT_MAX);
 
+	lazy_clear_cpu();
 	return IRQ_HANDLED;
 }
 
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 8a249c95c193..e01eb88cddfd 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/net.h>
 #include <linux/socket.h>
+#include <linux/clearcpu.h>
 
 #include <net/sock.h>
 
@@ -219,6 +220,7 @@ static irqreturn_t pvcalls_front_event_handler(int irq, void *dev_id)
 			 */
 			smp_wmb();
 			bedata->rsp[req_id].req_id = req_id;
+			lazy_clear_cpu();
 		}
 
 		done = 1;
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 33/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (31 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 32/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 34/43] MDSv6 Andi Kleen
                   ` (9 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

For DVB we consider image data sensitive.

Most DVB drivers do not touch user data in interrupts / timers, but
when the software filter is active it might. Schedule a clear cpu
from the filter code.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/media/dvb-core/dvb_demux.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c
index 39a2c6ccf31d..7f0d847ca501 100644
--- a/drivers/media/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb-core/dvb_demux.c
@@ -28,6 +28,7 @@
 #include <linux/string.h>
 #include <linux/crc32.h>
 #include <linux/uaccess.h>
+#include <linux/clearcpu.h>
 #include <asm/div64.h>
 
 #include <media/dvb_demux.h>
@@ -515,6 +516,8 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf,
 	}
 
 	spin_unlock_irqrestore(&demux->lock, flags);
+
+	lazy_clear_cpu_interrupt();
 }
 
 EXPORT_SYMBOL(dvb_dmx_swfilter_packets);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 34/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (32 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 33/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 35/43] MDSv6 Andi Kleen
                   ` (8 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

These interrupts are all complicated, and should be not performance
critical, so mark them to clear the CPU.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/gpu/drm/drm_irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 45a07652fa00..e075c3fdb81a 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -128,7 +128,8 @@ int drm_irq_install(struct drm_device *dev, int irq)
 		sh_flags = IRQF_SHARED;
 
 	ret = request_irq(irq, dev->driver->irq_handler,
-			  sh_flags, dev->driver->name, dev);
+			  sh_flags | IRQF_USER_DATA,
+			  dev->driver->name, dev);
 
 	if (ret < 0) {
 		dev->irq_enabled = false;
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 35/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (33 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 34/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [FROZEN] [PATCH v6 36/43] MDSv6 Andi Kleen
                   ` (7 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Old style IDE drivers sometimes do PIO, and are really slow anyways,
so default them all the clear the CPU.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/ide/ide-probe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 5aeaca24a28f..17e9f447472c 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -881,7 +881,8 @@ static int init_irq (ide_hwif_t *hwif)
 		irq_handler = ide_intr;
 
 	if (!host->get_lock)
-		if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
+		if (request_irq(hwif->irq, irq_handler, sa | IRQF_USER_DATA,
+					hwif->name, hwif))
 			goto out_up;
 
 #if !defined(__mc68000__)
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [FROZEN] [PATCH v6 36/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (34 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 35/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 37/43] MDSv6 Andi Kleen
                   ` (6 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Make Amazon ena driver management
 interrupt clear cpu

Most of the Amazon ena interrupt handlers do not touch user data,
but the management interrupt does complicated things and should
not be performance critical. Mark the management interrupt
only as clear cpu. This needs some minor changes to the
table driven interrupt setup.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 +++--
 drivers/net/ethernet/amazon/ena/ena_netdev.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index a6eacf2099c3..b13611a203c6 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1357,6 +1357,7 @@ static void ena_setup_mgmnt_intr(struct ena_adapter *adapter)
 	snprintf(adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].name,
 		 ENA_IRQNAME_SIZE, "ena-mgmnt@pci:%s",
 		 pci_name(adapter->pdev));
+	adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].flags = IRQF_USER_DATA;
 	adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].handler =
 		ena_intr_msix_mgmnt;
 	adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].data = adapter;
@@ -1381,6 +1382,7 @@ static void ena_setup_io_intr(struct ena_adapter *adapter)
 
 		snprintf(adapter->irq_tbl[irq_idx].name, ENA_IRQNAME_SIZE,
 			 "%s-Tx-Rx-%d", netdev->name, i);
+		adapter->irq_tbl[irq_idx].flags = 0;
 		adapter->irq_tbl[irq_idx].handler = ena_intr_msix_io;
 		adapter->irq_tbl[irq_idx].data = &adapter->ena_napi[i];
 		adapter->irq_tbl[irq_idx].vector =
@@ -1394,12 +1396,11 @@ static void ena_setup_io_intr(struct ena_adapter *adapter)
 
 static int ena_request_mgmnt_irq(struct ena_adapter *adapter)
 {
-	unsigned long flags = 0;
 	struct ena_irq *irq;
 	int rc;
 
 	irq = &adapter->irq_tbl[ENA_MGMNT_IRQ_IDX];
-	rc = request_irq(irq->vector, irq->handler, flags, irq->name,
+	rc = request_irq(irq->vector, irq->handler, irq->flags, irq->name,
 			 irq->data);
 	if (rc) {
 		netif_err(adapter, probe, adapter->netdev,
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 63870072cbbd..8e8394553dc7 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -140,6 +140,7 @@
 
 struct ena_irq {
 	irq_handler_t handler;
+	unsigned flags;
 	void *data;
 	int cpu;
 	u32 vector;
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 37/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (35 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [FROZEN] [PATCH v6 36/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 38/43] MDSv6 Andi Kleen
                   ` (5 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

PCMCIA devices are usually slow, and sometimes do PIO, so
mark them all as clearing the cpu.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/pcmcia/pcmcia_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 41ce410f7f97..99a778b022e5 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -702,7 +702,7 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
 	if (!p_dev->irq)
 		return -EINVAL;
 
-	ret = request_irq(p_dev->irq, handler, IRQF_SHARED,
+	ret = request_irq(p_dev->irq, handler, IRQF_SHARED | IRQF_USER_DATA,
 			p_dev->devname, p_dev->priv);
 	if (!ret)
 		p_dev->_irq = 1;
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 38/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (36 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 37/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 39/43] MDSv6 Andi Kleen
                   ` (4 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

The comedi drivers have a lot of interrupt handlers, many of them
touching user data in some form. But they all use common
library functions, so we can schedule a CPU clear in them.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/staging/comedi/comedi_buf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index f693c2c0bec3..a1e94386f940 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -9,6 +9,7 @@
 
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
+#include <linux/clearcpu.h>
 
 #include "comedidev.h"
 #include "comedi_internal.h"
@@ -597,6 +598,8 @@ unsigned int comedi_buf_write_samples(struct comedi_subdevice *s,
 	comedi_inc_scan_progress(s, nbytes);
 	s->async->events |= COMEDI_CB_BLOCK;
 
+	lazy_clear_cpu_interrupt();
+
 	return nbytes;
 }
 EXPORT_SYMBOL_GPL(comedi_buf_write_samples);
@@ -637,6 +640,8 @@ unsigned int comedi_buf_read_samples(struct comedi_subdevice *s,
 	comedi_inc_scan_progress(s, nbytes);
 	s->async->events |= COMEDI_CB_BLOCK;
 
+	lazy_clear_cpu_interrupt();
+
 	return nbytes;
 }
 EXPORT_SYMBOL_GPL(comedi_buf_read_samples);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 39/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (37 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 38/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-25 15:26   ` [MODERATED] " Greg KH
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 40/43] MDSv6 Andi Kleen
                   ` (3 subsequent siblings)
  42 siblings, 1 reply; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Most USB interrupt handlers do not touch user data, except
in some cases hcd poll is called which can copy a user buffer.
Instead of marking all the USB interrupts and timers as clear cpu
only clear it when the user data touching actually happens.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/usb/core/hcd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 015b126ce455..be47f96e810d 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -29,6 +29,7 @@
 #include <linux/workqueue.h>
 #include <linux/pm_runtime.h>
 #include <linux/types.h>
+#include <linux/clearcpu.h>
 
 #include <linux/phy/phy.h>
 #include <linux/usb.h>
@@ -770,6 +771,8 @@ void usb_hcd_poll_rh_status(struct usb_hcd *hcd)
 			urb->actual_length = length;
 			memcpy(urb->transfer_buffer, buffer, length);
 
+			lazy_clear_cpu_interrupt();
+
 			usb_hcd_unlink_urb_from_ep(hcd, urb);
 			usb_hcd_giveback_urb(hcd, urb, 0);
 		} else {
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 40/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (38 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 39/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 41/43] MDSv6 Andi Kleen
                   ` (2 subsequent siblings)
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

Turn on lazy mode as default, make mds=full active as an option.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/bugs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 146f9abc1931..1838f4d0aa72 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1106,9 +1106,7 @@ static void mds_select_mitigation(void)
 	setup_force_cpu_cap(X86_FEATURE_VERW);
 	if (cmdline_find_option_bool(boot_command_line, "mds=off"))
 		setup_clear_cpu_cap(X86_FEATURE_VERW);
-	/* Default to old behavior for now */
-	if (cmdline_find_option_bool(boot_command_line, "mds=full") ||
-		true)
+	if (cmdline_find_option_bool(boot_command_line, "mds=full"))
 		static_branch_enable(&force_cpu_clear);
 	/* Nop currently because this is default for now. */
 	if (cmdline_find_option_bool(boot_command_line, "mds=auto"))
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 41/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (39 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 40/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 42/43] MDSv6 Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 43/43] MDSv6 Andi Kleen
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Mark interrupts that touch user data

Mark interrupt handlers that touch user data or might touch it
with IRQF_USER_DATA to schedule cpu clears.

This has been generated with a tree wide audit and the following
coccinelle script. In general it erred on the conservative.
Either interrupt handlers directly touched user data
(e.g. with PIO), or were too complicated to audit and
for slow devices anyways.

A lot of interrupt handlers are also handled by the
strategic clear cpus added to functions that touch user
data directly. This patch only marks handlers that don't
call any such functions.

Some auditing from Mark Gross.

// request_irq(irq, handler, flags, name, arg) ->
// request_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg;
@@
- request_irq(irq, handler, 0, name, arg)
+ request_irq(irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg;
@@
- request_irq(irq, handler, flags, name, arg)
+ request_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg;
@@
- request_irq(irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ request_irq(irq, handler, IRQF_USER_DATA, name, arg)

// devm_request_irq(dev, irq, handler, flags, name, arg) ->
// devm_request_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg, dev;
@@
- devm_request_irq(dev, irq, handler, 0, name, arg)
+ devm_request_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg, dev;
@@
- devm_request_irq(dev, irq, handler, flags, name, arg)
+ devm_request_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg, dev;
@@
- devm_request_irq(dev, irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ devm_request_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

// request_any_context_irq(irq, handler, flags, name, arg) ->
// request_any_context_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg;
@@
- request_any_context_irq(irq, handler, 0, name, arg)
+ request_any_context_irq(irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg;
@@
- request_any_context_irq(irq, handler, flags, name, arg)
+ request_any_context_irq(irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg;
@@
- request_any_context_irq(irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ request_any_context_irq(irq, handler, IRQF_USER_DATA, name, arg)

// devm_request_any_context_irq(dev, irq, handler, flags, name, arg) ->
// devm_request_any_context_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

@@
expression irq, handler, name, arg, dev;
@@
- devm_request_any_context_irq(dev, irq, handler, 0, name, arg)
+ devm_request_any_context_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

@@
expression irq, handler, flags, name, arg, dev;
@@
- devm_request_any_context_irq(dev, irq, handler, flags, name, arg)
+ devm_request_any_context_irq(dev, irq, handler, flags | IRQF_USER_DATA, name, arg)

// clean up after previous rules combined
// XXX better way to do this?
@@
expression irq, handler, name, arg, dev;
@@
- devm_request_any_context_irq(dev, irq, handler, IRQF_USER_DATA | IRQF_CLEAR_CPU, name, arg)
+ devm_request_any_context_irq(dev, irq, handler, IRQF_USER_DATA, name, arg)

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/floppy.h                 |  6 ++--
 drivers/atm/lanai.c                           |  4 +--
 drivers/atm/nicstar.c                         |  4 +--
 drivers/char/ipmi/ipmi_si_intf.c              |  6 ++--
 drivers/char/sonypi.c                         |  3 +-
 drivers/firewire/nosy.c                       |  3 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c    |  3 +-
 .../gpu/drm/nouveau/nvkm/subdev/pci/base.c    |  3 +-
 drivers/i2c/busses/i2c-emev2.c                |  5 +--
 drivers/i2c/busses/i2c-i801.c                 |  2 +-
 drivers/i2c/busses/i2c-pxa.c                  |  4 +--
 drivers/i2c/busses/i2c-rk3x.c                 |  3 +-
 drivers/ide/ide-probe.c                       |  2 +-
 drivers/infiniband/hw/mthca/mthca_eq.c        | 14 ++++----
 drivers/input/serio/i8042.c                   | 13 +++----
 drivers/ipack/carriers/tpci200.c              |  6 ++--
 drivers/isdn/hardware/avm/b1isa.c             |  4 ++-
 drivers/isdn/hardware/avm/b1pci.c             |  6 ++--
 drivers/isdn/hardware/avm/b1pcmcia.c          |  3 +-
 drivers/isdn/hardware/avm/c4.c                |  3 +-
 drivers/isdn/hardware/avm/t1isa.c             |  4 ++-
 drivers/isdn/hardware/avm/t1pci.c             |  3 +-
 drivers/isdn/hardware/mISDN/avmfritz.c        |  4 +--
 drivers/isdn/hardware/mISDN/hfcmulti.c        |  3 +-
 drivers/isdn/hardware/mISDN/hfcpci.c          |  2 +-
 drivers/isdn/hardware/mISDN/mISDNinfineon.c   |  3 +-
 drivers/isdn/hardware/mISDN/netjet.c          |  2 +-
 drivers/isdn/hardware/mISDN/speedfax.c        |  3 +-
 drivers/isdn/hardware/mISDN/w6692.c           |  2 +-
 drivers/isdn/hisax/config.c                   |  2 +-
 drivers/isdn/hisax/hfc4s8s_l1.c               |  3 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c           | 13 ++++---
 drivers/media/common/saa7146/saa7146_core.c   |  4 +--
 drivers/media/pci/b2c2/flexcop-pci.c          |  3 +-
 drivers/media/pci/cobalt/cobalt-driver.c      |  3 +-
 drivers/media/pci/cx18/cx18-driver.c          |  3 +-
 drivers/media/pci/cx25821/cx25821-core.c      |  2 +-
 drivers/media/pci/cx88/cx88-alsa.c            |  3 +-
 drivers/media/pci/cx88/cx88-mpeg.c            |  2 +-
 drivers/media/pci/cx88/cx88-video.c           |  2 +-
 drivers/media/pci/dt3155/dt3155.c             |  2 +-
 drivers/media/pci/intel/ipu3/ipu3-cio2.c      |  2 +-
 drivers/media/pci/ivtv/ivtv-driver.c          |  3 +-
 drivers/media/pci/meye/meye.c                 |  3 +-
 drivers/media/pci/ngene/ngene-core.c          |  5 ++-
 drivers/media/pci/pluto2/pluto2.c             |  3 +-
 drivers/media/pci/saa7134/saa7134-alsa.c      |  4 +--
 drivers/media/pci/saa7134/saa7134-core.c      |  2 +-
 drivers/media/pci/saa7164/saa7164-core.c      |  7 ++--
 drivers/media/pci/solo6x10/solo6x10-core.c    |  4 +--
 drivers/media/pci/sta2x11/sta2x11_vip.c       |  5 ++-
 drivers/media/pci/tw68/tw68-core.c            |  2 +-
 drivers/media/pci/tw686x/tw686x-core.c        |  4 +--
 drivers/media/platform/aspeed-video.c         |  5 +--
 .../media/platform/marvell-ccic/cafe-driver.c |  3 +-
 drivers/media/rc/fintek-cir.c                 |  3 +-
 drivers/media/rc/gpio-ir-recv.c               |  2 +-
 drivers/media/rc/ir-hix5hd2.c                 |  3 +-
 drivers/media/rc/ite-cir.c                    |  3 +-
 drivers/media/rc/nuvoton-cir.c                |  3 +-
 drivers/media/rc/serial_ir.c                  |  2 +-
 drivers/media/rc/sir_ir.c                     |  3 +-
 drivers/media/rc/winbond-cir.c                |  2 +-
 drivers/memstick/host/jmb38x_ms.c             |  3 +-
 drivers/message/fusion/mptbase.c              |  3 +-
 drivers/mfd/ezx-pcap.c                        |  4 +--
 drivers/misc/ibmasm/module.c                  |  4 ++-
 drivers/misc/sgi-gru/grufile.c                |  7 ++--
 drivers/misc/sgi-xp/xpc_uv.c                  |  3 +-
 drivers/mmc/host/mtk-sd.c                     |  3 +-
 drivers/net/arcnet/arc-rimi.c                 |  2 +-
 drivers/net/arcnet/com20020.c                 |  3 +-
 drivers/net/arcnet/com90io.c                  |  3 +-
 drivers/net/arcnet/com90xx.c                  |  2 +-
 drivers/net/can/cc770/cc770.c                 |  4 +--
 drivers/net/can/peak_canfd/peak_pciefd_main.c |  8 ++---
 drivers/net/can/sja1000/ems_pcmcia.c          |  4 +--
 drivers/net/can/sja1000/peak_pcmcia.c         |  3 +-
 drivers/net/can/sja1000/sja1000.c             |  5 +--
 drivers/net/ethernet/3com/3c509.c             |  3 +-
 drivers/net/ethernet/3com/3c515.c             |  6 ++--
 drivers/net/ethernet/8390/axnet_cs.c          |  3 +-
 drivers/net/ethernet/8390/ne.c                |  3 +-
 drivers/net/ethernet/8390/ne2k-pci.c          |  3 +-
 drivers/net/ethernet/8390/pcnet_cs.c          |  3 +-
 drivers/net/ethernet/8390/smc-ultra.c         |  3 +-
 drivers/net/ethernet/8390/wd.c                |  3 +-
 drivers/net/ethernet/agere/et131x.c           |  4 +--
 drivers/net/ethernet/amd/lance.c              |  2 +-
 drivers/net/ethernet/amd/ni65.c               |  5 +--
 drivers/net/ethernet/atheros/atlx/atl1.c      |  4 +--
 drivers/net/ethernet/atheros/atlx/atl2.c      |  4 +--
 .../net/ethernet/chelsio/cxgb3/cxgb3_main.c   | 16 +++------
 drivers/net/ethernet/micrel/ks8851_mll.c      |  3 +-
 drivers/net/ethernet/microchip/lan743x_main.c |  7 ++--
 drivers/net/ethernet/realtek/atp.c            |  3 +-
 drivers/net/fddi/skfp/skfddi.c                |  4 +--
 drivers/net/hamradio/baycom_ser_fdx.c         |  3 +-
 drivers/net/hamradio/baycom_ser_hdx.c         |  3 +-
 drivers/net/hamradio/scc.c                    |  4 +--
 drivers/net/hamradio/yam.c                    |  2 +-
 drivers/net/ieee802154/at86rf230.c            |  3 +-
 drivers/net/ieee802154/ca8210.c               | 10 ++----
 drivers/net/ieee802154/mcr20a.c               |  3 +-
 drivers/net/ieee802154/mrf24j40.c             |  3 +-
 drivers/net/wan/cosa.c                        |  2 +-
 drivers/net/wan/farsync.c                     |  2 +-
 drivers/net/wan/hostess_sv11.c                |  3 +-
 drivers/net/wan/sbni.c                        |  2 +-
 drivers/net/wan/sdla.c                        |  2 +-
 drivers/net/wan/sealevel.c                    |  3 +-
 .../net/wireless/broadcom/b43legacy/main.c    |  2 +-
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  7 ++--
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |  3 +-
 drivers/net/wireless/cisco/airo.c             |  4 +--
 drivers/net/wireless/intel/ipw2x00/ipw2100.c  |  4 +--
 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |  3 +-
 .../net/wireless/intel/iwlegacy/3945-mac.c    |  3 +-
 .../net/wireless/intel/iwlegacy/4965-mac.c    |  3 +-
 .../net/wireless/intersil/hostap/hostap_pci.c |  3 +-
 .../net/wireless/intersil/hostap/hostap_plx.c |  3 +-
 .../intersil/orinoco/orinoco_nortel.c         |  4 +--
 .../wireless/intersil/orinoco/orinoco_pci.c   |  4 +--
 .../wireless/intersil/orinoco/orinoco_plx.c   |  4 +--
 .../wireless/intersil/orinoco/orinoco_tmd.c   |  4 +--
 drivers/net/wireless/intersil/p54/p54pci.c    |  2 +-
 drivers/net/wireless/intersil/p54/p54spi.c    |  4 +--
 .../intersil/prism54/islpci_hotplug.c         |  2 +-
 drivers/net/wireless/marvell/libertas/if_cs.c |  2 +-
 .../net/wireless/marvell/libertas/if_spi.c    |  3 +-
 drivers/net/wireless/marvell/mwifiex/main.c   |  5 +--
 drivers/net/wireless/marvell/mwifiex/pcie.c   |  8 +++--
 drivers/net/wireless/marvell/mwl8k.c          |  4 +--
 .../net/wireless/mediatek/mt76/mt76x0/pci.c   |  3 +-
 .../net/wireless/mediatek/mt76/mt76x2/pci.c   |  3 +-
 .../quantenna/qtnfmac/pcie/pearl_pcie.c       |  3 +-
 .../quantenna/qtnfmac/pcie/topaz_pcie.c       |  3 +-
 .../net/wireless/ralink/rt2x00/rt2x00mmio.c   |  6 ++--
 .../wireless/realtek/rtl818x/rtl8180/dev.c    |  6 ++--
 drivers/net/wireless/realtek/rtlwifi/pci.c    |  4 +--
 drivers/net/wireless/ti/wl1251/sdio.c         |  4 ++-
 drivers/net/wireless/ti/wl1251/spi.c          |  5 +--
 drivers/ntb/hw/amd/ntb_hw_amd.c               | 12 ++++---
 drivers/ntb/hw/intel/ntb_hw_gen1.c            | 12 ++++---
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c        |  8 ++---
 drivers/parport/parport_ax88796.c             |  3 +-
 drivers/parport/parport_pc.c                  |  3 +-
 drivers/pci/controller/pcie-xilinx.c          |  2 +-
 drivers/pci/controller/vmd.c                  | 11 +++---
 drivers/pci/hotplug/cpci_hotplug_core.c       |  6 +---
 drivers/pci/hotplug/cpqphp_core.c             |  3 +-
 drivers/pci/hotplug/shpchp_hpc.c              |  5 +--
 drivers/pci/pcie/pme.c                        |  3 +-
 drivers/pci/switch/switchtec.c                | 10 +++---
 drivers/pcmcia/i82092.c                       |  2 +-
 drivers/pcmcia/i82365.c                       |  9 ++---
 drivers/pcmcia/pcmcia_resource.c              |  9 ++---
 drivers/pcmcia/pd6729.c                       |  8 +++--
 drivers/pcmcia/tcic.c                         |  7 ++--
 drivers/pcmcia/yenta_socket.c                 |  4 +--
 drivers/pinctrl/intel/pinctrl-intel.c         |  2 +-
 drivers/pinctrl/pinctrl-amd.c                 |  3 +-
 drivers/pinctrl/pinctrl-single.c              |  3 +-
 drivers/platform/goldfish/goldfish_pipe.c     |  6 ++--
 drivers/platform/mellanox/mlxreg-hotplug.c    |  5 +--
 drivers/platform/x86/fujitsu-tablet.c         |  3 +-
 drivers/platform/x86/intel_int0002_vgpio.c    |  2 +-
 drivers/platform/x86/intel_ips.c              |  3 +-
 drivers/platform/x86/intel_pmc_ipc.c          |  8 ++---
 drivers/platform/x86/intel_punit_ipc.c        |  4 +--
 drivers/platform/x86/intel_scu_ipc.c          |  5 +--
 drivers/platform/x86/sony-laptop.c            |  3 +-
 drivers/pnp/resource.c                        |  3 +-
 drivers/power/reset/ltc2952-poweroff.c        |  6 +---
 drivers/power/supply/act8945a_charger.c       |  6 ++--
 drivers/power/supply/goldfish_battery.c       |  5 +--
 .../power/supply/max14656_charger_detector.c  |  2 +-
 drivers/power/supply/pda_power.c              |  6 ++--
 drivers/power/supply/wm97xx_battery.c         |  5 +--
 drivers/pps/clients/pps-gpio.c                |  3 +-
 drivers/ptp/ptp_pch.c                         |  3 +-
 drivers/rapidio/devices/tsi721.c              | 25 +++++++------
 drivers/rapidio/devices/tsi721_dma.c          |  8 +++--
 drivers/regulator/qcom_spmi-regulator.c       |  5 +--
 drivers/rpmsg/qcom_glink_native.c             |  5 ++-
 drivers/rtc/rtc-cmos.c                        |  5 +--
 drivers/rtc/rtc-ds1305.c                      |  3 +-
 drivers/rtc/rtc-ds1374.c                      |  5 +--
 drivers/rtc/rtc-ds1511.c                      |  3 +-
 drivers/rtc/rtc-ds1553.c                      |  4 +--
 drivers/rtc/rtc-ds1685.c                      |  3 +-
 drivers/rtc/rtc-ftrtc010.c                    |  2 +-
 drivers/rtc/rtc-m48t59.c                      |  5 +--
 drivers/rtc/rtc-mrst.c                        |  3 +-
 drivers/rtc/rtc-pcap.c                        | 10 +++---
 drivers/rtc/rtc-r7301.c                       |  3 +-
 drivers/rtc/rtc-snvs.c                        |  3 +-
 drivers/rtc/rtc-stk17ta8.c                    |  5 +--
 drivers/rtc/rtc-zynqmp.c                      |  6 ++--
 drivers/scsi/3w-9xxx.c                        |  6 ++--
 drivers/scsi/3w-sas.c                         |  6 ++--
 drivers/scsi/3w-xxxx.c                        |  3 +-
 drivers/scsi/BusLogic.c                       |  3 +-
 drivers/scsi/a100u2w.c                        |  4 +--
 drivers/scsi/aacraid/commsup.c                |  8 ++---
 drivers/scsi/aacraid/rx.c                     |  3 +-
 drivers/scsi/aacraid/sa.c                     |  3 +-
 drivers/scsi/aacraid/src.c                    |  3 +-
 drivers/scsi/advansys.c                       |  4 +--
 drivers/scsi/aha152x.c                        |  4 +--
 drivers/scsi/aha1542.c                        |  2 +-
 drivers/scsi/aha1740.c                        |  3 +-
 drivers/scsi/aic7xxx/aic7770_osm.c            |  3 +-
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c        |  2 +-
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c        |  2 +-
 drivers/scsi/aic94xx/aic94xx_init.c           |  5 +--
 drivers/scsi/am53c974.c                       |  4 +--
 drivers/scsi/arcmsr/arcmsr_hba.c              |  3 +-
 drivers/scsi/atp870u.c                        |  3 +-
 drivers/scsi/be2iscsi/be_main.c               | 12 ++++---
 drivers/scsi/bfa/bfad.c                       |  9 +++--
 drivers/scsi/csiostor/csio_isr.c              | 16 +++++----
 drivers/scsi/dpt_i2o.c                        |  2 +-
 drivers/scsi/esas2r/esas2r_init.c             |  8 +----
 drivers/scsi/fnic/fnic_isr.c                  | 13 ++++---
 drivers/scsi/g_NCR5380.c                      |  7 ++--
 drivers/scsi/gdth.c                           |  8 +++--
 drivers/scsi/hpsa.c                           | 19 +++++-----
 drivers/scsi/hptiop.c                         |  3 +-
 drivers/scsi/initio.c                         |  3 +-
 drivers/scsi/ipr.c                            | 23 ++++++------
 drivers/scsi/ips.c                            |  4 +--
 drivers/scsi/isci/init.c                      |  8 +++--
 drivers/scsi/lpfc/lpfc_init.c                 | 35 ++++++++++++-------
 drivers/scsi/megaraid.c                       |  4 +--
 drivers/scsi/megaraid/megaraid_mbox.c         |  3 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     |  8 ++---
 drivers/scsi/mpt3sas/mpt3sas_base.c           |  2 +-
 drivers/scsi/mvsas/mv_init.c                  |  4 +--
 drivers/scsi/mvumi.c                          |  8 ++---
 drivers/scsi/myrb.c                           |  2 +-
 drivers/scsi/myrs.c                           |  2 +-
 drivers/scsi/nsp32.c                          |  3 +-
 drivers/scsi/pcmcia/qlogic_stub.c             |  2 +-
 drivers/scsi/pcmcia/sym53c500_cs.c            |  2 +-
 drivers/scsi/pm8001/pm8001_init.c             | 10 +++---
 drivers/scsi/pmcraid.c                        |  5 +--
 drivers/scsi/qedf/qedf_main.c                 |  4 ++-
 drivers/scsi/qedi/qedi_main.c                 |  3 +-
 drivers/scsi/qla1280.c                        |  3 +-
 drivers/scsi/qla2xxx/qla_isr.c                | 22 +++++++-----
 drivers/scsi/qla4xxx/ql4_isr.c                |  5 +--
 drivers/scsi/qla4xxx/ql4_nx.c                 | 10 +++---
 drivers/scsi/qlogicfas.c                      |  2 +-
 drivers/scsi/sim710.c                         |  2 +-
 drivers/scsi/smartpqi/smartpqi_init.c         | 11 +++---
 drivers/scsi/snic/snic_isr.c                  |  5 ++-
 drivers/scsi/stex.c                           |  4 +--
 drivers/scsi/sym53c8xx_2/sym_glue.c           |  3 +-
 drivers/scsi/ufs/ufshcd.c                     |  7 ++--
 drivers/scsi/vmw_pvscsi.c                     |  9 +++--
 drivers/scsi/wd719x.c                         |  4 +--
 drivers/slimbus/qcom-ctrl.c                   |  3 +-
 drivers/spi/spi-altera.c                      |  3 +-
 drivers/spi/spi-axi-spi-engine.c              |  3 +-
 drivers/spi/spi-cadence.c                     |  3 +-
 drivers/spi/spi-dw.c                          |  4 +--
 drivers/spi/spi-fsl-spi.c                     |  3 +-
 drivers/spi/spi-oc-tiny.c                     |  3 +-
 drivers/spi/spi-pxa2xx.c                      |  4 +--
 drivers/spi/spi-topcliff-pch.c                |  5 +--
 drivers/spi/spi-xilinx.c                      |  5 +--
 drivers/spi/spi-zynqmp-gqspi.c                |  3 +-
 drivers/staging/android/vsoc.c                |  3 +-
 drivers/staging/axis-fifo/axis-fifo.c         |  3 +-
 .../staging/comedi/drivers/addi_apci_1032.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_1500.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_1564.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_2032.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_3120.c   |  3 +-
 .../staging/comedi/drivers/addi_apci_3xxx.c   |  3 +-
 drivers/staging/comedi/drivers/adl_pci9111.c  |  3 +-
 drivers/staging/comedi/drivers/adl_pci9118.c  |  3 +-
 drivers/staging/comedi/drivers/adv_pci1710.c  |  3 +-
 drivers/staging/comedi/drivers/aio_iiro_16.c  |  3 +-
 .../comedi/drivers/amplc_dio200_common.c      |  3 +-
 .../comedi/drivers/amplc_pc236_common.c       |  3 +-
 drivers/staging/comedi/drivers/amplc_pci224.c |  3 +-
 drivers/staging/comedi/drivers/amplc_pci230.c |  3 +-
 drivers/staging/comedi/drivers/cb_pcidas.c    |  4 +--
 drivers/staging/comedi/drivers/cb_pcidas64.c  |  5 +--
 .../staging/comedi/drivers/comedi_parport.c   |  3 +-
 drivers/staging/comedi/drivers/das16m1.c      |  3 +-
 drivers/staging/comedi/drivers/das1800.c      |  3 +-
 drivers/staging/comedi/drivers/das6402.c      |  3 +-
 drivers/staging/comedi/drivers/das800.c       |  5 +--
 drivers/staging/comedi/drivers/dmm32at.c      |  3 +-
 drivers/staging/comedi/drivers/dt2811.c       |  3 +-
 drivers/staging/comedi/drivers/dt2814.c       |  3 +-
 drivers/staging/comedi/drivers/dt282x.c       |  2 +-
 drivers/staging/comedi/drivers/dt3000.c       |  3 +-
 drivers/staging/comedi/drivers/gsc_hpdi.c     |  3 +-
 drivers/staging/comedi/drivers/me4000.c       |  3 +-
 drivers/staging/comedi/drivers/ni_6527.c      |  4 +--
 drivers/staging/comedi/drivers/ni_65xx.c      |  3 +-
 drivers/staging/comedi/drivers/ni_660x.c      |  4 +--
 drivers/staging/comedi/drivers/ni_at_a2150.c  |  2 +-
 drivers/staging/comedi/drivers/ni_atmio.c     |  3 +-
 drivers/staging/comedi/drivers/ni_atmio16d.c  |  3 +-
 .../staging/comedi/drivers/ni_labpc_common.c  |  5 +--
 drivers/staging/comedi/drivers/ni_pcidio.c    |  3 +-
 drivers/staging/comedi/drivers/ni_pcimio.c    |  3 +-
 drivers/staging/comedi/drivers/pcl711.c       |  3 +-
 drivers/staging/comedi/drivers/pcl726.c       |  3 +-
 drivers/staging/comedi/drivers/pcl812.c       |  3 +-
 drivers/staging/comedi/drivers/pcl816.c       |  2 +-
 drivers/staging/comedi/drivers/pcl818.c       |  3 +-
 drivers/staging/comedi/drivers/pcmmio.c       |  3 +-
 drivers/staging/comedi/drivers/pcmuio.c       |  6 ++--
 drivers/staging/comedi/drivers/rtd520.c       |  3 +-
 drivers/staging/comedi/drivers/s626.c         |  3 +-
 drivers/staging/gasket/gasket_interrupt.c     |  3 +-
 drivers/staging/goldfish/goldfish_audio.c     |  5 +--
 drivers/staging/iio/adc/ad7606.c              |  3 +-
 drivers/staging/media/bcm2048/radio-bcm2048.c |  4 +--
 drivers/staging/media/zoran/zoran_card.c      |  2 +-
 drivers/staging/most/dim2/dim2.c              |  6 ++--
 drivers/staging/most/i2c/i2c.c                |  3 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c    |  2 +-
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c  |  2 +-
 drivers/staging/pi433/pi433_if.c              |  6 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c  |  2 +-
 drivers/staging/rtlwifi/pci.c                 |  4 +--
 drivers/staging/rts5208/rtsx.c                |  4 +--
 drivers/staging/speakup/serialio.c            |  5 +--
 drivers/staging/vt6655/device_main.c          |  2 +-
 drivers/thermal/ti-soc-thermal/ti-bandgap.c   |  6 ++--
 drivers/thunderbolt/nhi.c                     |  6 ++--
 drivers/tty/cyclades.c                        |  9 ++---
 drivers/tty/goldfish.c                        |  4 +--
 drivers/tty/hvc/hvc_irq.c                     |  4 +--
 drivers/tty/isicom.c                          |  2 +-
 drivers/tty/mxser.c                           |  4 +--
 drivers/tty/serial/8250/8250_core.c           |  3 +-
 drivers/tty/serial/8250/8250_exar.c           |  2 +-
 drivers/tty/serial/altera_jtaguart.c          |  4 +--
 drivers/tty/serial/altera_uart.c              |  5 +--
 drivers/tty/serial/arc_uart.c                 |  2 +-
 drivers/tty/serial/digicolor-usart.c          |  3 +-
 drivers/tty/serial/fsl_lpuart.c               | 12 ++++---
 drivers/tty/serial/ifx6x60.c                  |  7 ++--
 drivers/tty/serial/jsm/jsm_driver.c           |  3 +-
 drivers/tty/serial/max3100.c                  |  3 +-
 drivers/tty/serial/men_z135_uart.c            |  4 +--
 drivers/tty/serial/pch_uart.c                 |  4 +--
 drivers/tty/serial/rp2.c                      |  2 +-
 drivers/tty/serial/sc16is7xx.c                |  2 +-
 drivers/tty/serial/timbuart.c                 |  4 +--
 drivers/tty/serial/uartlite.c                 |  3 +-
 drivers/tty/serial/xilinx_uartps.c            |  4 ++-
 drivers/tty/synclink.c                        |  3 +-
 drivers/tty/synclink_gt.c                     |  6 +---
 drivers/tty/synclinkmp.c                      |  7 ++--
 drivers/uio/uio.c                             |  3 +-
 drivers/usb/c67x00/c67x00-drv.c               |  3 +-
 drivers/usb/chipidea/core.c                   |  5 +--
 drivers/usb/core/hcd.c                        |  5 +--
 drivers/usb/dwc2/gadget.c                     |  3 +-
 drivers/usb/dwc2/platform.c                   |  3 +-
 drivers/usb/gadget/udc/amd5536udc_pci.c       |  2 +-
 drivers/usb/gadget/udc/bdc/bdc_udc.c          |  3 +-
 drivers/usb/gadget/udc/fotg210-udc.c          |  4 +--
 drivers/usb/gadget/udc/fusb300_udc.c          |  6 ++--
 drivers/usb/gadget/udc/goku_udc.c             |  3 +-
 drivers/usb/gadget/udc/m66592-udc.c           |  4 +--
 drivers/usb/gadget/udc/mv_u3d_core.c          |  3 +-
 drivers/usb/gadget/udc/mv_udc_core.c          |  3 +-
 drivers/usb/gadget/udc/net2272.c              |  3 +-
 drivers/usb/gadget/udc/net2280.c              |  3 +-
 drivers/usb/gadget/udc/pch_udc.c              |  8 +++--
 drivers/usb/gadget/udc/pxa27x_udc.c           |  3 +-
 drivers/usb/gadget/udc/r8a66597-udc.c         |  5 +--
 drivers/usb/gadget/udc/snps_udc_plat.c        |  4 +--
 drivers/usb/gadget/udc/udc-xilinx.c           |  3 +-
 drivers/usb/host/max3421-hcd.c                |  3 +-
 drivers/usb/host/xhci.c                       | 12 ++++---
 drivers/usb/isp1760/isp1760-udc.c             |  3 +-
 drivers/usb/musb/musb_core.c                  |  2 +-
 drivers/usb/phy/phy-gpio-vbus-usb.c           |  4 +--
 drivers/uwb/whc-rc.c                          |  5 +--
 drivers/vfio/pci/vfio_pci_intrs.c             |  5 +--
 drivers/video/fbdev/arcfb.c                   |  3 +-
 drivers/video/fbdev/aty/atyfb_base.c          |  2 +-
 drivers/video/fbdev/goldfishfb.c              |  4 +--
 drivers/video/fbdev/matrox/matroxfb_base.c    |  3 +-
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c    |  7 ++--
 drivers/video/fbdev/via/via-core.c            |  3 +-
 drivers/virt/vboxguest/vboxguest_linux.c      |  5 +--
 drivers/virtio/virtio_mmio.c                  |  4 +--
 drivers/virtio/virtio_pci_common.c            | 20 ++++++-----
 drivers/vme/bridges/vme_ca91cx42.c            |  5 +--
 drivers/vme/bridges/vme_tsi148.c              |  7 ++--
 drivers/w1/masters/ds1wm.c                    |  3 +-
 drivers/xen/events/events_base.c              | 12 ++++---
 drivers/xen/platform-pci.c                    |  4 +--
 drivers/xen/xen-pciback/pciback_ops.c         |  6 ++--
 samples/v4l/v4l2-pci-skeleton.c               |  5 +--
 sound/drivers/mpu401/mpu401_uart.c            |  3 +-
 sound/drivers/mtpav.c                         |  2 +-
 sound/drivers/serial-u16550.c                 |  3 +-
 sound/isa/ad1816a/ad1816a_lib.c               |  2 +-
 sound/isa/es1688/es1688_lib.c                 |  4 ++-
 sound/isa/es18xx.c                            |  3 +-
 sound/isa/gus/gus_main.c                      |  2 +-
 sound/isa/gus/gusmax.c                        |  2 +-
 sound/isa/gus/interwave.c                     |  3 +-
 sound/isa/msnd/msnd_pinnacle.c                |  3 +-
 sound/isa/opl3sa2.c                           |  4 +--
 sound/isa/opti9xx/opti92x-ad1848.c            |  3 +-
 sound/isa/sb/sb_common.c                      |  6 +---
 sound/isa/wavefront/wavefront.c               |  3 +-
 sound/isa/wss/wss_lib.c                       |  3 +-
 sound/pci/ad1889.c                            |  3 +-
 sound/pci/ali5451/ali5451.c                   |  3 +-
 sound/pci/als300.c                            |  3 +-
 sound/pci/asihpi/hpioctl.c                    |  3 +-
 sound/pci/atiixp.c                            |  3 +-
 sound/pci/atiixp_modem.c                      |  3 +-
 sound/pci/aw2/aw2-alsa.c                      |  3 +-
 sound/pci/azt3328.c                           |  3 +-
 sound/pci/bt87x.c                             |  4 +--
 sound/pci/ca0106/ca0106_main.c                |  3 +-
 sound/pci/cmipci.c                            |  3 +-
 sound/pci/cs4281.c                            |  3 +-
 sound/pci/cs46xx/cs46xx_lib.c                 |  3 +-
 sound/pci/cs5535audio/cs5535audio.c           |  3 +-
 sound/pci/ctxfi/cthw20k1.c                    |  3 +-
 sound/pci/ctxfi/cthw20k2.c                    |  3 +-
 sound/pci/emu10k1/emu10k1_main.c              |  3 +-
 sound/pci/emu10k1/emu10k1x.c                  |  3 +-
 sound/pci/ens1370.c                           |  3 +-
 sound/pci/es1938.c                            |  6 ++--
 sound/pci/es1968.c                            |  3 +-
 sound/pci/fm801.c                             |  3 +-
 sound/pci/hda/hda_intel.c                     |  4 +--
 sound/pci/ice1712/ice1712.c                   |  3 +-
 sound/pci/ice1712/ice1724.c                   |  3 +-
 sound/pci/intel8x0.c                          |  6 ++--
 sound/pci/intel8x0m.c                         |  6 ++--
 sound/pci/korg1212/korg1212.c                 |  4 +--
 sound/pci/lola/lola.c                         |  3 +-
 sound/pci/maestro3.c                          |  3 +-
 sound/pci/nm256/nm256.c                       |  3 +-
 sound/pci/oxygen/oxygen_lib.c                 |  4 +--
 sound/pci/riptide/riptide.c                   |  3 +-
 sound/pci/rme32.c                             |  3 +-
 sound/pci/rme96.c                             |  3 +-
 sound/pci/rme9652/hdsp.c                      |  3 +-
 sound/pci/rme9652/hdspm.c                     |  3 +-
 sound/pci/rme9652/rme9652.c                   |  3 +-
 sound/pci/sis7019.c                           |  7 ++--
 sound/pci/sonicvibes.c                        |  3 +-
 sound/pci/trident/trident_main.c              |  3 +-
 sound/pci/via82xx.c                           |  6 +---
 sound/pci/via82xx_modem.c                     |  3 +-
 sound/pci/ymfpci/ymfpci_main.c                |  3 +-
 sound/soc/amd/acp-pcm-dma.c                   |  3 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c           |  3 +-
 sound/soc/codecs/rt5640.c                     |  4 +--
 sound/soc/codecs/rt5651.c                     |  4 +--
 sound/soc/codecs/rt5663.c                     |  4 +--
 sound/soc/dwc/dwc-i2s.c                       |  5 +--
 sound/soc/fsl/fsl_asrc.c                      |  3 +-
 sound/soc/fsl/fsl_esai.c                      |  3 +-
 sound/soc/fsl/fsl_sai.c                       |  3 +-
 sound/soc/fsl/fsl_spdif.c                     |  3 +-
 sound/soc/fsl/fsl_ssi.c                       |  3 +-
 sound/x86/intel_hdmi_audio.c                  |  5 +--
 478 files changed, 1084 insertions(+), 966 deletions(-)

diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index 7ec59edde154..4bcdde7e5fb8 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -145,10 +145,12 @@ static int fd_request_irq(void)
 {
 	if (can_use_virtual_dma)
 		return request_irq(FLOPPY_IRQ, floppy_hardint,
-				   0, "floppy", NULL);
+				   IRQF_USER_DATA, "floppy",
+				   NULL);
 	else
 		return request_irq(FLOPPY_IRQ, floppy_interrupt,
-				   0, "floppy", NULL);
+				   IRQF_USER_DATA, "floppy",
+				   NULL);
 }
 
 static unsigned long dma_mem_alloc(unsigned long size)
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 5f8e009b2da1..880dc6af0a36 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -2198,8 +2198,8 @@ static int lanai_dev_open(struct atm_dev *atmdev)
 	conf2_write(lanai);
 	reg_write(lanai, TX_FIFO_DEPTH, TxDepth_Reg);
 	reg_write(lanai, 0, CBR_ICG_Reg);	/* CBR defaults to no limit */
-	if ((result = request_irq(lanai->pci->irq, lanai_int, IRQF_SHARED,
-	    DEV_LABEL, lanai)) != 0) {
+	if ((result = request_irq(lanai->pci->irq, lanai_int,
+				IRQF_SHARED | IRQF_USER_DATA, DEV_LABEL, lanai)) != 0) {
 		printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n");
 		goto error_vcctable;
 	}
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index ae4aa02e4dc6..0d96c52cd217 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -751,8 +751,8 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
 	card->efbie = 1;
 
 	card->intcnt = 0;
-	if (request_irq
-	    (pcidev->irq, &ns_irq_handler, IRQF_SHARED, "nicstar", card) != 0) {
+	if (request_irq(pcidev->irq, &ns_irq_handler,
+				IRQF_SHARED | IRQF_USER_DATA, "nicstar", card) != 0) {
 		printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
 		error = 9;
 		ns_init_card_error(card, error);
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index dc8603d34320..0b4f02a446a7 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1266,10 +1266,8 @@ int ipmi_std_irq_setup(struct si_sm_io *io)
 	if (!io->irq)
 		return 0;
 
-	rv = request_irq(io->irq,
-			 ipmi_si_irq_handler,
-			 IRQF_SHARED,
-			 DEVICE_NAME,
+	rv = request_irq(io->irq, ipmi_si_irq_handler,
+			 IRQF_SHARED | IRQF_USER_DATA, DEVICE_NAME,
 			 io->irq_handler_data);
 	if (rv) {
 		dev_warn(io->dev, "%s unable to claim interrupt %d,"
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 186689833231..b923ce92039c 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1265,8 +1265,7 @@ static int sonypi_setup_irq(struct sonypi_device *dev,
 {
 	while (irq_list->irq) {
 
-		if (!request_irq(irq_list->irq, sonypi_irq,
-				 IRQF_SHARED, "sonypi", sonypi_irq)) {
+		if (!request_irq(irq_list->irq, sonypi_irq, IRQF_SHARED | IRQF_USER_DATA, "sonypi", sonypi_irq)) {
 			dev->irq = irq_list->irq;
 			dev->bits = irq_list->bits;
 			return 0;
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index a128dd1126ae..25c500fb01a2 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -641,8 +641,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
 
 	run_pcl(lynx, lynx->rcv_start_pcl_bus, 0);
 
-	if (request_irq(dev->irq, irq_handler, IRQF_SHARED,
-			driver_name, lynx)) {
+	if (request_irq(dev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, driver_name, lynx)) {
 		dev_err(&dev->dev,
 			"Failed to allocate shared interrupt %d\n", dev->irq);
 		ret = -EIO;
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c b/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c
index e28107061148..e274a60a5887 100644
--- a/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c
+++ b/drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c
@@ -296,7 +296,8 @@ int oaktrail_hdmi_i2c_init(struct pci_dev *dev)
 	oaktrail_hdmi_i2c_gpio_fix();
 
 	/* request irq */
-	ret = request_irq(dev->irq, oaktrail_hdmi_i2c_handler, IRQF_SHARED,
+	ret = request_irq(dev->irq, oaktrail_hdmi_i2c_handler,
+			  IRQF_SHARED | IRQF_USER_DATA,
 			  oaktrail_hdmi_i2c_adapter.name, hdmi_dev);
 	if (ret) {
 		DRM_ERROR("Failed to request IRQ for I2C controller\n");
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
index ee2431a7804e..656fcae19f2b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
@@ -116,7 +116,8 @@ nvkm_pci_oneinit(struct nvkm_subdev *subdev)
 			return ret;
 	}
 
-	ret = request_irq(pdev->irq, nvkm_pci_intr, IRQF_SHARED, "nvkm", pci);
+	ret = request_irq(pdev->irq, nvkm_pci_intr,
+			  IRQF_SHARED | IRQF_USER_DATA, "nvkm", pci);
 	if (ret)
 		return ret;
 
diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c
index 35b302d983e0..f69979d0b7b7 100644
--- a/drivers/i2c/busses/i2c-emev2.c
+++ b/drivers/i2c/busses/i2c-emev2.c
@@ -391,8 +391,9 @@ static int em_i2c_probe(struct platform_device *pdev)
 	em_i2c_reset(&priv->adap);
 
 	irq = platform_get_irq(pdev, 0);
-	ret = devm_request_irq(&pdev->dev, irq, em_i2c_irq_handler, 0,
-				"em_i2c", priv);
+	ret = devm_request_irq(&pdev->dev, irq, em_i2c_irq_handler,
+			       IRQF_USER_DATA, "em_i2c",
+			       priv);
 	if (ret)
 		goto err_clk;
 
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index c91e145ef5a5..2aa88243db79 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1659,7 +1659,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		init_waitqueue_head(&priv->waitq);
 
 		err = devm_request_irq(&dev->dev, dev->irq, i801_isr,
-				       IRQF_SHARED,
+				       IRQF_SHARED | IRQF_USER_DATA,
 				       dev_driver_string(&dev->dev), priv);
 		if (err) {
 			dev_err(&dev->dev, "Failed to allocate irq %d: %d\n",
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index fbf91d383b40..45c4415d67e4 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1297,8 +1297,8 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	} else {
 		i2c->adap.algo = &i2c_pxa_algorithm;
 		ret = devm_request_irq(&dev->dev, irq, i2c_pxa_handler,
-				IRQF_SHARED | IRQF_NO_SUSPEND,
-				dev_name(&dev->dev), i2c);
+				       IRQF_SHARED | IRQF_NO_SUSPEND | IRQF_USER_DATA,
+				       dev_name(&dev->dev), i2c);
 		if (ret) {
 			dev_err(&dev->dev, "failed to request irq: %d\n", ret);
 			goto ereqirq;
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index b8a2728dd4b6..9846859a9b57 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -1271,7 +1271,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, rk3x_i2c_irq,
-			       0, dev_name(&pdev->dev), i2c);
+			       IRQF_USER_DATA,
+			       dev_name(&pdev->dev), i2c);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "cannot request IRQ\n");
 		return ret;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 17e9f447472c..958bf916d096 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -882,7 +882,7 @@ static int init_irq (ide_hwif_t *hwif)
 
 	if (!host->get_lock)
 		if (request_irq(hwif->irq, irq_handler, sa | IRQF_USER_DATA,
-					hwif->name, hwif))
+				hwif->name, hwif))
 			goto out_up;
 
 #if !defined(__mc68000__)
diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c
index 30400ea4808b..e259c148411b 100644
--- a/drivers/infiniband/hw/mthca/mthca_eq.c
+++ b/drivers/infiniband/hw/mthca/mthca_eq.c
@@ -825,10 +825,9 @@ int mthca_init_eq_table(struct mthca_dev *dev)
 				 "%s@pci:%s", eq_name[i],
 				 pci_name(dev->pdev));
 			err = request_irq(dev->eq_table.eq[i].msi_x_vector,
-					  mthca_is_memfree(dev) ?
-					  mthca_arbel_msi_x_interrupt :
-					  mthca_tavor_msi_x_interrupt,
-					  0, dev->eq_table.eq[i].irq_name,
+					  mthca_is_memfree(dev) ? mthca_arbel_msi_x_interrupt : mthca_tavor_msi_x_interrupt,
+					  IRQF_USER_DATA,
+					  dev->eq_table.eq[i].irq_name,
 					  dev->eq_table.eq + i);
 			if (err)
 				goto err_out_cmd;
@@ -838,10 +837,9 @@ int mthca_init_eq_table(struct mthca_dev *dev)
 		snprintf(dev->eq_table.eq[0].irq_name, IB_DEVICE_NAME_MAX,
 			 DRV_NAME "@pci:%s", pci_name(dev->pdev));
 		err = request_irq(dev->pdev->irq,
-				  mthca_is_memfree(dev) ?
-				  mthca_arbel_interrupt :
-				  mthca_tavor_interrupt,
-				  IRQF_SHARED, dev->eq_table.eq[0].irq_name, dev);
+				  mthca_is_memfree(dev) ? mthca_arbel_interrupt : mthca_tavor_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  dev->eq_table.eq[0].irq_name, dev);
 		if (err)
 			goto err_out_cmd;
 		dev->eq_table.have_irq = 1;
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 95a78ccbd847..6aadc878def2 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -865,8 +865,7 @@ static int __init i8042_check_aux(void)
 		goto out;
 	}
 
-	if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED,
-			"i8042", i8042_platform_device))
+	if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED | IRQF_USER_DATA, "i8042", i8042_platform_device))
 		goto out;
 
 	irq_registered = true;
@@ -1463,8 +1462,9 @@ static int __init i8042_setup_aux(void)
 		aux_enable = i8042_enable_mux_ports;
 	}
 
-	error = request_irq(I8042_AUX_IRQ, i8042_interrupt, IRQF_SHARED,
-			    "i8042", i8042_platform_device);
+	error = request_irq(I8042_AUX_IRQ, i8042_interrupt,
+			    IRQF_SHARED | IRQF_USER_DATA, "i8042",
+			    i8042_platform_device);
 	if (error)
 		goto err_free_ports;
 
@@ -1489,8 +1489,9 @@ static int __init i8042_setup_kbd(void)
 	if (error)
 		return error;
 
-	error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
-			    "i8042", i8042_platform_device);
+	error = request_irq(I8042_KBD_IRQ, i8042_interrupt,
+			    IRQF_SHARED | IRQF_USER_DATA, "i8042",
+			    i8042_platform_device);
 	if (error)
 		goto err_free_port;
 
diff --git a/drivers/ipack/carriers/tpci200.c b/drivers/ipack/carriers/tpci200.c
index 8a9c169b6f99..fa0fd1c5a19c 100644
--- a/drivers/ipack/carriers/tpci200.c
+++ b/drivers/ipack/carriers/tpci200.c
@@ -340,9 +340,9 @@ static int tpci200_register(struct tpci200_board *tpci200)
 	for (i = 0; i < TPCI200_NB_SLOT; i++)
 		writew(slot_ctrl, &tpci200->info->interface_regs->control[i]);
 
-	res = request_irq(tpci200->info->pdev->irq,
-			  tpci200_interrupt, IRQF_SHARED,
-			  KBUILD_MODNAME, (void *) tpci200);
+	res = request_irq(tpci200->info->pdev->irq, tpci200_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			  (void *)tpci200);
 	if (res) {
 		dev_err(&tpci200->info->pdev->dev,
 			"(bn 0x%X, sn 0x%X) unable to register IRQ !",
diff --git a/drivers/isdn/hardware/avm/b1isa.c b/drivers/isdn/hardware/avm/b1isa.c
index cdfea72e0ef6..63a724d5fc02 100644
--- a/drivers/isdn/hardware/avm/b1isa.c
+++ b/drivers/isdn/hardware/avm/b1isa.c
@@ -97,7 +97,9 @@ static int b1isa_probe(struct pci_dev *pdev)
 		retval = -EBUSY;
 		goto err_free;
 	}
-	retval = request_irq(card->irq, b1_interrupt, 0, card->name, card);
+	retval = request_irq(card->irq, b1_interrupt,
+			     IRQF_USER_DATA, card->name,
+			     card);
 	if (retval) {
 		printk(KERN_ERR "b1isa: unable to get IRQ %d.\n", card->irq);
 		goto err_release_region;
diff --git a/drivers/isdn/hardware/avm/b1pci.c b/drivers/isdn/hardware/avm/b1pci.c
index b76b57a82c02..0bcc2f8fe1f1 100644
--- a/drivers/isdn/hardware/avm/b1pci.c
+++ b/drivers/isdn/hardware/avm/b1pci.c
@@ -97,7 +97,8 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev)
 	b1_reset(card->port);
 	b1_getrevision(card);
 
-	retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "b1pci: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
@@ -234,7 +235,8 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
 	b1dma_reset(card);
 	b1_getrevision(card);
 
-	retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1dma_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "b1pci: unable to get IRQ %d.\n",
 		       card->irq);
diff --git a/drivers/isdn/hardware/avm/b1pcmcia.c b/drivers/isdn/hardware/avm/b1pcmcia.c
index 3aca16e62902..4421a6a215ec 100644
--- a/drivers/isdn/hardware/avm/b1pcmcia.c
+++ b/drivers/isdn/hardware/avm/b1pcmcia.c
@@ -82,7 +82,8 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
 	card->irq = irq;
 	card->cardtype = cardtype;
 
-	retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "b1pcmcia: unable to get IRQ %d.\n",
 		       card->irq);
diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index ac72cd204c4d..a0ddcf7ae95b 100644
--- a/drivers/isdn/hardware/avm/c4.c
+++ b/drivers/isdn/hardware/avm/c4.c
@@ -1180,7 +1180,8 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev,
 	}
 	c4_reset(card);
 
-	retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, c4_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "c4: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c
index 2153619c5b31..a00ff6646c9d 100644
--- a/drivers/isdn/hardware/avm/t1isa.c
+++ b/drivers/isdn/hardware/avm/t1isa.c
@@ -405,7 +405,9 @@ static int t1isa_probe(struct pci_dev *pdev, int cardnr)
 		retval = -EBUSY;
 		goto err_free;
 	}
-	retval = request_irq(card->irq, t1isa_interrupt, 0, card->name, card);
+	retval = request_irq(card->irq, t1isa_interrupt,
+			     IRQF_USER_DATA, card->name,
+			     card);
 	if (retval) {
 		printk(KERN_INFO "t1isa: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
diff --git a/drivers/isdn/hardware/avm/t1pci.c b/drivers/isdn/hardware/avm/t1pci.c
index f5ed1d5004c9..c43a57b95524 100644
--- a/drivers/isdn/hardware/avm/t1pci.c
+++ b/drivers/isdn/hardware/avm/t1pci.c
@@ -103,7 +103,8 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
 	}
 	b1dma_reset(card);
 
-	retval = request_irq(card->irq, b1dma_interrupt, IRQF_SHARED, card->name, card);
+	retval = request_irq(card->irq, b1dma_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, card->name, card);
 	if (retval) {
 		printk(KERN_ERR "t1pci: unable to get IRQ %d.\n", card->irq);
 		retval = -EBUSY;
diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c
index 8eb28a83832e..12496f0038e5 100644
--- a/drivers/isdn/hardware/mISDN/avmfritz.c
+++ b/drivers/isdn/hardware/mISDN/avmfritz.c
@@ -794,10 +794,10 @@ init_card(struct fritzcard *fc)
 	reset_avm(fc); /* disable IRQ */
 	if (fc->type == AVM_FRITZ_PCIV2)
 		ret = request_irq(fc->irq, avm_fritzv2_interrupt,
-				  IRQF_SHARED, fc->name, fc);
+				  IRQF_SHARED | IRQF_USER_DATA, fc->name, fc);
 	else
 		ret = request_irq(fc->irq, avm_fritz_interrupt,
-				  IRQF_SHARED, fc->name, fc);
+				  IRQF_SHARED | IRQF_USER_DATA, fc->name, fc);
 	if (ret) {
 		pr_info("%s: couldn't get interrupt %d\n",
 			fc->name, fc->irq);
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 4d85645c87f7..c6bdad91ff4e 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -4271,8 +4271,7 @@ init_card(struct hfc_multi *hc)
 	disable_hwirq(hc);
 	spin_unlock_irqrestore(&hc->lock, flags);
 
-	if (request_irq(hc->irq, hfcmulti_interrupt, IRQF_SHARED,
-			"HFC-multi", hc)) {
+	if (request_irq(hc->irq, hfcmulti_interrupt, IRQF_SHARED | IRQF_USER_DATA, "HFC-multi", hc)) {
 		printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n",
 		       hc->irq);
 		hc->irq = 0;
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index ebb3fa2e1d00..3da919c1c29e 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -1738,7 +1738,7 @@ init_card(struct hfc_pci *hc)
 	spin_lock_irqsave(&hc->lock, flags);
 	disable_hwirq(hc);
 	spin_unlock_irqrestore(&hc->lock, flags);
-	if (request_irq(hc->irq, hfcpci_int, IRQF_SHARED, "HFC PCI", hc)) {
+	if (request_irq(hc->irq, hfcpci_int, IRQF_SHARED | IRQF_USER_DATA, "HFC PCI", hc)) {
 		printk(KERN_WARNING
 		       "mISDN: couldn't get interrupt %d\n", hc->irq);
 		return -EIO;
diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
index 3e01012be4ab..631543dfb025 100644
--- a/drivers/isdn/hardware/mISDN/mISDNinfineon.c
+++ b/drivers/isdn/hardware/mISDN/mISDNinfineon.c
@@ -611,7 +611,8 @@ init_irq(struct inf_hw *hw)
 
 	if (!hw->ci->irqfunc)
 		return -EINVAL;
-	ret = request_irq(hw->irq, hw->ci->irqfunc, IRQF_SHARED, hw->name, hw);
+	ret = request_irq(hw->irq, hw->ci->irqfunc,
+			  IRQF_SHARED | IRQF_USER_DATA, hw->name, hw);
 	if (ret) {
 		pr_info("%s: couldn't get interrupt %d\n", hw->name, hw->irq);
 		return ret;
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c
index 2b317cb63d06..3aafe328e919 100644
--- a/drivers/isdn/hardware/mISDN/netjet.c
+++ b/drivers/isdn/hardware/mISDN/netjet.c
@@ -929,7 +929,7 @@ nj_init_card(struct tiger_hw *card)
 	spin_unlock_irqrestore(&card->lock, flags);
 
 	card->irq = card->pdev->irq;
-	if (request_irq(card->irq, nj_irq, IRQF_SHARED, card->name, card)) {
+	if (request_irq(card->irq, nj_irq, IRQF_SHARED | IRQF_USER_DATA, card->name, card)) {
 		pr_info("%s: couldn't get interrupt %d\n",
 			card->name, card->irq);
 		card->irq = -1;
diff --git a/drivers/isdn/hardware/mISDN/speedfax.c b/drivers/isdn/hardware/mISDN/speedfax.c
index 1f1446ed8d5f..378b9ff9711f 100644
--- a/drivers/isdn/hardware/mISDN/speedfax.c
+++ b/drivers/isdn/hardware/mISDN/speedfax.c
@@ -288,7 +288,8 @@ init_card(struct sfax_hw *sf)
 	int	ret, cnt = 3;
 	u_long	flags;
 
-	ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED, sf->name, sf);
+	ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  sf->name, sf);
 	if (ret) {
 		pr_info("%s: couldn't get interrupt %d\n", sf->name, sf->irq);
 		return ret;
diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c
index 6f60aced11c5..5628e9a764b8 100644
--- a/drivers/isdn/hardware/mISDN/w6692.c
+++ b/drivers/isdn/hardware/mISDN/w6692.c
@@ -917,7 +917,7 @@ init_card(struct w6692_hw *card)
 	spin_lock_irqsave(&card->lock, flags);
 	disable_hwirq(card);
 	spin_unlock_irqrestore(&card->lock, flags);
-	if (request_irq(card->irq, w6692_irq, IRQF_SHARED, card->name, card)) {
+	if (request_irq(card->irq, w6692_irq, IRQF_SHARED | IRQF_USER_DATA, card->name, card)) {
 		pr_info("%s: couldn't get interrupt %d\n", card->name,
 			card->irq);
 		return -EIO;
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index b12e6cae26c2..03feb71c82f0 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -822,7 +822,7 @@ static int init_card(struct IsdnCardState *cs)
 	irq_cnt = cs->irq_cnt = 0;
 	printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
 	       cs->irq, irq_cnt);
-	if (request_irq(cs->irq, card_irq, cs->irq_flags, "HiSax", cs)) {
+	if (request_irq(cs->irq, card_irq, cs->irq_flags | IRQF_USER_DATA, "HiSax", cs)) {
 		printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
 		       cs->irq);
 		return 1;
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index e9bb8fb67ad0..be383944e1cb 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -1440,8 +1440,7 @@ setup_instance(hfc4s8s_hw *hw)
 
 	INIT_WORK(&hw->tqueue, hfc4s8s_bh);
 
-	if (request_irq
-	    (hw->irq, hfc4s8s_interrupt, IRQF_SHARED, hw->card_name, hw)) {
+	if (request_irq(hw->irq, hfc4s8s_interrupt, IRQF_SHARED | IRQF_USER_DATA, hw->card_name, hw)) {
 		printk(KERN_INFO
 		       "HFC-4S/8S: unable to alloc irq %d, card ignored\n",
 		       hw->irq);
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index 7a7137d8664b..28f734bb18e4 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -780,15 +780,18 @@ static int fcpcipnp_setup(struct fritz_adapter *adapter)
 
 	switch (adapter->type) {
 	case AVM_FRITZ_PCIV2:
-		retval = request_irq(adapter->irq, fcpci2_irq, IRQF_SHARED,
-				     "fcpcipnp", adapter);
+		retval = request_irq(adapter->irq, fcpci2_irq,
+				     IRQF_SHARED | IRQF_USER_DATA, "fcpcipnp",
+				     adapter);
 		break;
 	case AVM_FRITZ_PCI:
-		retval = request_irq(adapter->irq, fcpci_irq, IRQF_SHARED,
-				     "fcpcipnp", adapter);
+		retval = request_irq(adapter->irq, fcpci_irq,
+				     IRQF_SHARED | IRQF_USER_DATA, "fcpcipnp",
+				     adapter);
 		break;
 	case AVM_FRITZ_PNP:
-		retval = request_irq(adapter->irq, fcpci_irq, 0,
+		retval = request_irq(adapter->irq, fcpci_irq,
+				     IRQF_USER_DATA,
 				     "fcpcipnp", adapter);
 		break;
 	}
diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c
index 9f7c5b0a6b45..67c358d839e0 100644
--- a/drivers/media/common/saa7146/saa7146_core.c
+++ b/drivers/media/common/saa7146/saa7146_core.c
@@ -414,8 +414,8 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
 	saa7146_write(dev, MC2, 0xf8000000);
 
 	/* request an interrupt for the saa7146 */
-	err = request_irq(pci->irq, interrupt_hw, IRQF_SHARED,
-			  dev->name, dev);
+	err = request_irq(pci->irq, interrupt_hw,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		ERR("request_irq() failed\n");
 		goto err_unmap;
diff --git a/drivers/media/pci/b2c2/flexcop-pci.c b/drivers/media/pci/b2c2/flexcop-pci.c
index cc6527e35537..723e9d1266ef 100644
--- a/drivers/media/pci/b2c2/flexcop-pci.c
+++ b/drivers/media/pci/b2c2/flexcop-pci.c
@@ -309,8 +309,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
 
 	pci_set_drvdata(fc_pci->pdev, fc_pci);
 	spin_lock_init(&fc_pci->irq_lock);
-	if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr,
-					IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
+	if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_isr, IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, fc_pci)) != 0)
 		goto err_pci_iounmap;
 
 	fc_pci->init_state |= FC_PCI_INIT;
diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c
index 4885e833c052..77b6b1ec77b9 100644
--- a/drivers/media/pci/cobalt/cobalt-driver.c
+++ b/drivers/media/pci/cobalt/cobalt-driver.c
@@ -383,8 +383,7 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev,
 	msi_config_show(cobalt, pci_dev);
 
 	/* Register IRQ */
-	if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED,
-			cobalt->v4l2_dev.name, (void *)cobalt)) {
+	if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED | IRQF_USER_DATA, cobalt->v4l2_dev.name, (void *)cobalt)) {
 		cobalt_err("Failed to register irq %d\n", pci_dev->irq);
 		ret = -EIO;
 		goto err_msi;
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index a6ba4ca5aa91..fce1d506c9d9 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -1026,7 +1026,8 @@ static int cx18_probe(struct pci_dev *pci_dev,
 
 	/* Register IRQ */
 	retval = request_irq(cx->pci_dev->irq, cx18_irq_handler,
-			     IRQF_SHARED, cx->v4l2_dev.name, (void *)cx);
+			     IRQF_SHARED | IRQF_USER_DATA, cx->v4l2_dev.name,
+			     (void *)cx);
 	if (retval) {
 		CX18_ERR("Failed to register irq %d\n", retval);
 		goto free_i2c;
diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c
index 2f0171134f7e..e0f847d634a0 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
 	}
 
 	err = request_irq(pci_dev->irq, cx25821_irq,
-			IRQF_SHARED, dev->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d\n", dev->name, pci_dev->irq);
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c
index b683cbe13dee..00950fcc3468 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -895,7 +895,8 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
 
 	/* get irq */
 	err = request_irq(chip->pci->irq, cx8801_irq,
-			  IRQF_SHARED, chip->core->name, chip);
+			  IRQF_SHARED | IRQF_USER_DATA, chip->core->name,
+			  chip);
 	if (err < 0) {
 		dprintk(0, "%s: can't get IRQ %d\n",
 			chip->core->name, chip->pci->irq);
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c
index 52ff00ebd4bd..34613db7cedb 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -416,7 +416,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
 
 	/* get irq */
 	err = request_irq(dev->pci->irq, cx8802_irq,
-			  IRQF_SHARED, dev->core->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->core->name, dev);
 	if (err < 0) {
 		pr_err("can't get IRQ %d\n", dev->pci->irq);
 		return err;
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index e1549d352f70..bd2214ce59c5 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1342,7 +1342,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
 
 	/* get irq */
 	err = request_irq(pci_dev->irq, cx8800_irq,
-			  IRQF_SHARED, core->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, core->name, dev);
 	if (err < 0) {
 		pr_err("can't get IRQ %d\n", pci_dev->irq);
 		goto fail_core;
diff --git a/drivers/media/pci/dt3155/dt3155.c b/drivers/media/pci/dt3155/dt3155.c
index 17d69bd5d7f1..dffc0b43fb64 100644
--- a/drivers/media/pci/dt3155/dt3155.c
+++ b/drivers/media/pci/dt3155/dt3155.c
@@ -565,7 +565,7 @@ static int dt3155_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (err)
 		goto err_iounmap;
 	err = request_irq(pd->pdev->irq, dt3155_irq_handler_even,
-					IRQF_SHARED, DT3155_NAME, pd);
+			  IRQF_SHARED | IRQF_USER_DATA, DT3155_NAME, pd);
 	if (err)
 		goto err_iounmap;
 	err = video_register_device(&pd->vdev, VFL_TYPE_GRABBER, -1);
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index cdb79ae2d8dc..d5e80865c2d6 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -1814,7 +1814,7 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
 		goto fail_cio2_queue_exit;
 
 	r = devm_request_irq(&pci_dev->dev, pci_dev->irq, cio2_irq,
-			     IRQF_SHARED, CIO2_NAME, cio2);
+			     IRQF_SHARED | IRQF_USER_DATA, CIO2_NAME, cio2);
 	if (r) {
 		dev_err(&pci_dev->dev, "failed to request IRQ (%d)\n", r);
 		goto fail;
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index dd727098daf4..155ac84fa563 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -1249,7 +1249,8 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
 
 	/* Register IRQ */
 	retval = request_irq(itv->pdev->irq, ivtv_irq_handler,
-	     IRQF_SHARED, itv->v4l2_dev.name, (void *)itv);
+			     IRQF_SHARED | IRQF_USER_DATA, itv->v4l2_dev.name,
+			     (void *)itv);
 	if (retval) {
 		IVTV_ERR("Failed to register irq %d\n", retval);
 		goto free_i2c;
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index bd870e60c32b..7c600673607b 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1674,8 +1674,7 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 	}
 
 	meye.mchip_irq = pcidev->irq;
-	if (request_irq(meye.mchip_irq, meye_irq,
-			IRQF_SHARED, "meye", meye_irq)) {
+	if (request_irq(meye.mchip_irq, meye_irq, IRQF_SHARED | IRQF_USER_DATA, "meye", meye_irq)) {
 		v4l2_err(v4l2_dev, "request_irq failed\n");
 		goto outreqirq;
 	}
diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
index 25f16833a475..515f6fb6ab18 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -1332,8 +1332,7 @@ static int ngene_start(struct ngene *dev)
 	ngene_init(dev);
 
 	stat = request_irq(dev->pci_dev->irq, irq_handler,
-			   IRQF_SHARED, "nGene",
-			   (void *)dev);
+			   IRQF_SHARED | IRQF_USER_DATA, "nGene", (void *)dev);
 	if (stat < 0)
 		return stat;
 
@@ -1372,7 +1371,7 @@ static int ngene_start(struct ngene *dev)
 			dev->msi_enabled = true;
 		}
 		stat = request_irq(dev->pci_dev->irq, irq_handler,
-					flags, "nGene", dev);
+				   flags | IRQF_USER_DATA, "nGene", dev);
 		if (stat < 0)
 			goto fail2;
 		ngwritel(1, NGENE_INT_ENABLE);
diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c
index 872c796621d2..e056ffee8ea6 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -623,7 +623,8 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_set_drvdata(pdev, pluto);
 
-	ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED, DRIVER_NAME, pluto);
+	ret = request_irq(pdev->irq, pluto_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  DRIVER_NAME, pluto);
 	if (ret < 0)
 		goto err_pci_iounmap;
 
diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c
index dc9cdaaee1fb..80adb620e9b4 100644
--- a/drivers/media/pci/saa7134/saa7134-alsa.c
+++ b/drivers/media/pci/saa7134/saa7134-alsa.c
@@ -1157,8 +1157,8 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
 
 
 	err = request_irq(dev->pci->irq, saa7134_alsa_irq,
-				IRQF_SHARED, dev->name,
-				(void*) &dev->dmasound);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name,
+			  (void *)&dev->dmasound);
 
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d for ALSA\n",
diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c
index aa98ea49558c..b582fdd67c2c 100644
--- a/drivers/media/pci/saa7134/saa7134-core.c
+++ b/drivers/media/pci/saa7134/saa7134-core.c
@@ -1158,7 +1158,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
 
 	/* get irq */
 	err = request_irq(pci_dev->irq, saa7134_irq,
-			  IRQF_SHARED, dev->name, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d\n",
 		       dev->name,pci_dev->irq);
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index f33349e16359..d8bcef88c3b2 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1188,8 +1188,8 @@ static bool saa7164_enable_msi(struct pci_dev *pci_dev, struct saa7164_dev *dev)
 	}
 
 	/* no error - so request an msi interrupt */
-	err = request_irq(pci_dev->irq, saa7164_irq, 0,
-						dev->name, dev);
+	err = request_irq(pci_dev->irq, saa7164_irq,
+			  IRQF_USER_DATA, dev->name, dev);
 
 	if (err) {
 		/* fall back to legacy interrupt */
@@ -1256,7 +1256,8 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
 			 or msi is not enabled - fallback to shared interrupt */
 
 		err = request_irq(pci_dev->irq, saa7164_irq,
-				IRQF_SHARED, dev->name, dev);
+				  IRQF_SHARED | IRQF_USER_DATA, dev->name,
+				  dev);
 
 		if (err < 0) {
 			printk(KERN_ERR "%s: can't get IRQ %d\n", dev->name,
diff --git a/drivers/media/pci/solo6x10/solo6x10-core.c b/drivers/media/pci/solo6x10/solo6x10-core.c
index 19ffd2ed3cc7..0c46cde4644d 100644
--- a/drivers/media/pci/solo6x10/solo6x10-core.c
+++ b/drivers/media/pci/solo6x10/solo6x10-core.c
@@ -559,8 +559,8 @@ static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* PLL locking time of 1ms */
 	mdelay(1);
 
-	ret = request_irq(pdev->irq, solo_isr, IRQF_SHARED, SOLO6X10_NAME,
-			  solo_dev);
+	ret = request_irq(pdev->irq, solo_isr, IRQF_SHARED | IRQF_USER_DATA,
+			  SOLO6X10_NAME, solo_dev);
 	if (ret)
 		goto fail_probe;
 
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
index 411177ec4d72..1f869047e940 100644
--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
+++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
@@ -1073,9 +1073,8 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
 
 	spin_lock_init(&vip->slock);
 
-	ret = request_irq(pdev->irq,
-			  (irq_handler_t) vip_irq,
-			  IRQF_SHARED, KBUILD_MODNAME, vip);
+	ret = request_irq(pdev->irq, (irq_handler_t)vip_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, vip);
 	if (ret) {
 		dev_err(&pdev->dev, "request_irq failed\n");
 		ret = -ENODEV;
diff --git a/drivers/media/pci/tw68/tw68-core.c b/drivers/media/pci/tw68/tw68-core.c
index 8474528be91e..034fa832d925 100644
--- a/drivers/media/pci/tw68/tw68-core.c
+++ b/drivers/media/pci/tw68/tw68-core.c
@@ -307,7 +307,7 @@ static int tw68_initdev(struct pci_dev *pci_dev,
 
 	/* get irq */
 	err = devm_request_irq(&pci_dev->dev, pci_dev->irq, tw68_irq,
-			  IRQF_SHARED, dev->name, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		pr_err("%s: can't get IRQ %d\n",
 		       dev->name, pci_dev->irq);
diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c
index 7fb3f07bf022..9d4fb3bfd947 100644
--- a/drivers/media/pci/tw686x/tw686x-core.c
+++ b/drivers/media/pci/tw686x/tw686x-core.c
@@ -318,8 +318,8 @@ static int tw686x_probe(struct pci_dev *pci_dev,
 
 	spin_lock_init(&dev->lock);
 
-	err = request_irq(pci_dev->irq, tw686x_irq, IRQF_SHARED,
-			  dev->name, dev);
+	err = request_irq(pci_dev->irq, tw686x_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err < 0) {
 		dev_err(&pci_dev->dev, "unable to request interrupt\n");
 		goto iounmap;
diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
index dfec813f50a9..e1fe3bee82ab 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -1600,8 +1600,9 @@ static int aspeed_video_init(struct aspeed_video *video)
 		return -ENODEV;
 	}
 
-	rc = devm_request_irq(dev, irq, aspeed_video_irq, IRQF_SHARED,
-			      DEVICE_NAME, video);
+	rc = devm_request_irq(dev, irq, aspeed_video_irq,
+			      IRQF_SHARED | IRQF_USER_DATA, DEVICE_NAME,
+			      video);
 	if (rc < 0) {
 		dev_err(dev, "Unable to request IRQ %d\n", irq);
 		return rc;
diff --git a/drivers/media/platform/marvell-ccic/cafe-driver.c b/drivers/media/platform/marvell-ccic/cafe-driver.c
index 8d00d9d8adff..689a0f1a95ee 100644
--- a/drivers/media/platform/marvell-ccic/cafe-driver.c
+++ b/drivers/media/platform/marvell-ccic/cafe-driver.c
@@ -508,7 +508,8 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 		goto out_disable;
 	}
 	mcam->regs_size = pci_resource_len(pdev, 0);
-	ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED, "cafe-ccic", cam);
+	ret = request_irq(pdev->irq, cafe_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  "cafe-ccic", cam);
 	if (ret)
 		goto out_iounmap;
 
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index 601944666b71..07cd3c28b892 100644
--- a/drivers/media/rc/fintek-cir.c
+++ b/drivers/media/rc/fintek-cir.c
@@ -552,8 +552,7 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
 			    fintek->cir_port_len, FINTEK_DRIVER_NAME))
 		goto exit_free_dev_rdev;
 
-	if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
-			FINTEK_DRIVER_NAME, (void *)fintek))
+	if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED | IRQF_USER_DATA, FINTEK_DRIVER_NAME, (void *)fintek))
 		goto exit_free_cir_addr;
 
 	ret = rc_register_device(rdev);
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index 3d99b51384ac..487157b7a679 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -101,7 +101,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, gpio_dev);
 
 	return devm_request_irq(dev, gpio_dev->irq, gpio_ir_recv_irq,
-				IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+				IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | IRQF_USER_DATA,
 				"gpio-ir-recv-irq", gpio_dev);
 }
 
diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c
index abc4d6c1b323..5fad158e9a39 100644
--- a/drivers/media/rc/ir-hix5hd2.c
+++ b/drivers/media/rc/ir-hix5hd2.c
@@ -275,8 +275,7 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto clkerr;
 
-	if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt,
-			     0, pdev->name, priv) < 0) {
+	if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt, IRQF_USER_DATA, pdev->name, priv) < 0) {
 		dev_err(dev, "IRQ %d register failed\n", priv->irq);
 		ret = -EINVAL;
 		goto regerr;
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index cd3c60ba8519..52d82983521a 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1593,8 +1593,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
 				dev_desc->io_region_size, ITE_DRIVER_NAME))
 		goto exit_unregister_device;
 
-	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
-			ITE_DRIVER_NAME, (void *)itdev))
+	if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED | IRQF_USER_DATA, ITE_DRIVER_NAME, (void *)itdev))
 		goto exit_release_cir_addr;
 
 	ite_pr(KERN_NOTICE, "driver has been successfully loaded\n");
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 5c2cd8d2d155..98d392188b2b 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1049,7 +1049,8 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
 		return -EBUSY;
 
 	ret = devm_request_irq(&pdev->dev, nvt->cir_irq, nvt_cir_isr,
-			       IRQF_SHARED, NVT_DRIVER_NAME, nvt);
+			       IRQF_SHARED | IRQF_USER_DATA, NVT_DRIVER_NAME,
+			       nvt);
 	if (ret)
 		return ret;
 
diff --git a/drivers/media/rc/serial_ir.c b/drivers/media/rc/serial_ir.c
index ffe2c672d105..ffdd1f5cd194 100644
--- a/drivers/media/rc/serial_ir.c
+++ b/drivers/media/rc/serial_ir.c
@@ -543,7 +543,7 @@ static int serial_ir_probe(struct platform_device *dev)
 	timer_setup(&serial_ir.timeout_timer, serial_ir_timeout, 0);
 
 	result = devm_request_irq(&dev->dev, irq, serial_ir_irq_handler,
-				  share_irq ? IRQF_SHARED : 0,
+				  (share_irq ? IRQF_SHARED : 0) | IRQF_USER_DATA,
 				  KBUILD_MODNAME, &hardware);
 	if (result < 0) {
 		if (result == -EBUSY)
diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c
index c8951650a368..952b1d93960e 100644
--- a/drivers/media/rc/sir_ir.c
+++ b/drivers/media/rc/sir_ir.c
@@ -355,7 +355,8 @@ static int sir_ir_probe(struct platform_device *dev)
 		pr_err("i/o port 0x%.4x already in use.\n", io);
 		return -EBUSY;
 	}
-	retval = devm_request_irq(&sir_ir_dev->dev, irq, sir_interrupt, 0,
+	retval = devm_request_irq(&sir_ir_dev->dev, irq, sir_interrupt,
+				  IRQF_USER_DATA,
 				  KBUILD_MODNAME, NULL);
 	if (retval < 0) {
 		pr_err("IRQ %d already in use.\n", irq);
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 0f07a2c384fa..d9876f3d5133 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1123,7 +1123,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
 	}
 
 	err = request_irq(data->irq, wbcir_irq_handler,
-			  0, DRVNAME, device);
+			  IRQF_USER_DATA, DRVNAME, device);
 	if (err) {
 		dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
 		err = -EBUSY;
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
index bcdca9fbef51..13b969c106ff 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -901,8 +901,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt)
 
 	timer_setup(&host->timer, jmb38x_ms_abort, 0);
 
-	if (!request_irq(host->irq, jmb38x_ms_isr, IRQF_SHARED, host->host_id,
-			 msh))
+	if (!request_irq(host->irq, jmb38x_ms_isr, IRQF_SHARED | IRQF_USER_DATA, host->host_id, msh))
 		return msh;
 
 	iounmap(host->addr);
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index ba551d8dfba4..73c43c5e06b4 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -2425,7 +2425,8 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
 			else
 				ioc->msi_enable = 0;
 			rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
-			    IRQF_SHARED, ioc->name, ioc);
+					 IRQF_SHARED | IRQF_USER_DATA,
+					 ioc->name, ioc);
 			if (rc < 0) {
 				printk(MYIOC_s_ERR_FMT "Unable to allocate "
 				    "interrupt %d!\n",
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 542b47c6bcd2..61c36d063792 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -479,8 +479,8 @@ static int ezx_pcap_probe(struct spi_device *spi)
 	adc_irq = pcap_to_irq(pcap, (pdata->config & PCAP_SECOND_PORT) ?
 					PCAP_IRQ_ADCDONE2 : PCAP_IRQ_ADCDONE);
 
-	ret = devm_request_irq(&spi->dev, adc_irq, pcap_adc_irq, 0, "ADC",
-				pcap);
+	ret = devm_request_irq(&spi->dev, adc_irq, pcap_adc_irq,
+			       IRQF_USER_DATA, "ADC", pcap);
 	if (ret)
 		goto free_irqchip;
 
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index e914b8c80943..737bc3f9047b 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -114,7 +114,9 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto error_ioremap;
 	}
 
-	result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp);
+	result = request_irq(sp->irq, ibmasm_interrupt_handler,
+			     IRQF_SHARED | IRQF_USER_DATA, sp->devname,
+			     (void *)sp);
 	if (result) {
 		dev_err(sp->dev, "Failed to register interrupt handler\n");
 		goto error_request_irq;
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index 104a05f6b738..e728978286dd 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -385,7 +385,9 @@ static int gru_chiplet_setup_tlb_irq(int chiplet, char *irq_name,
 			return ret;
 		}
 
-		ret = request_irq(irq, irq_handler, 0, irq_name, NULL);
+		ret = request_irq(irq, irq_handler,
+				  IRQF_USER_DATA, irq_name,
+				  NULL);
 		if (ret) {
 			printk(KERN_ERR "%s: request_irq failed, errno=%d\n",
 			       GRU_DRIVER_ID_STR, -ret);
@@ -433,7 +435,8 @@ static int gru_chiplet_setup_tlb_irq(int chiplet, char *irq_name,
 		return irq;
 	}
 
-	ret = request_irq(irq, irq_handler, 0, irq_name, NULL);
+	ret = request_irq(irq, irq_handler, IRQF_USER_DATA,
+			  irq_name, NULL);
 	if (ret) {
 		uv_teardown_irq(irq);
 		printk(KERN_ERR "%s: request_irq failed, errno=%d\n",
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index 0441abe87880..1563fbac9d5b 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -259,7 +259,8 @@ xpc_create_gru_mq_uv(unsigned int mq_size, int cpu, char *irq_name,
 	if (ret != 0)
 		goto out_4;
 
-	ret = request_irq(mq->irq, irq_handler, 0, irq_name, NULL);
+	ret = request_irq(mq->irq, irq_handler,
+			  IRQF_USER_DATA, irq_name, NULL);
 	if (ret != 0) {
 		dev_err(xpc_part, "request_irq(irq=%d) returned error=%d\n",
 			mq->irq, -ret);
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 833ef0590af8..1e95f419fb92 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2227,7 +2227,8 @@ static int msdc_drv_probe(struct platform_device *pdev)
 	msdc_init_hw(host);
 
 	ret = devm_request_irq(&pdev->dev, host->irq, msdc_irq,
-		IRQF_TRIGGER_LOW | IRQF_ONESHOT, pdev->name, host);
+			       IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_USER_DATA,
+			       pdev->name, host);
 	if (ret)
 		goto release;
 
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c
index 11c5bad95226..fc5b690b12af 100644
--- a/drivers/net/arcnet/arc-rimi.c
+++ b/drivers/net/arcnet/arc-rimi.c
@@ -136,7 +136,7 @@ static int __init arcrimi_found(struct net_device *dev)
 	}
 
 	/* reserve the irq */
-	if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (RIM I)", dev)) {
+	if (request_irq(dev->irq, arcnet_interrupt, IRQF_USER_DATA, "arcnet (RIM I)", dev)) {
 		iounmap(p);
 		release_mem_region(dev->mem_start, MIRROR_SIZE);
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index 78043a9c5981..c9fa16d5d079 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -240,8 +240,7 @@ int com20020_found(struct net_device *dev, int shared)
 	arcnet_outb(dev->dev_addr[0], ioaddr, COM20020_REG_W_XREG);
 
 	/* reserve the irq */
-	if (request_irq(dev->irq, arcnet_interrupt, shared,
-			"arcnet (COM20020)", dev)) {
+	if (request_irq(dev->irq, arcnet_interrupt, shared | IRQF_USER_DATA, "arcnet (COM20020)", dev)) {
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
 		return -ENODEV;
 	}
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c
index 2c546013a980..d7ed122e9e47 100644
--- a/drivers/net/arcnet/com90io.c
+++ b/drivers/net/arcnet/com90io.c
@@ -225,8 +225,7 @@ static int __init com90io_found(struct net_device *dev)
 	int err;
 
 	/* Reserve the irq */
-	if (request_irq(dev->irq, arcnet_interrupt, 0,
-			"arcnet (COM90xx-IO)", dev)) {
+	if (request_irq(dev->irq, arcnet_interrupt, IRQF_USER_DATA, "arcnet (COM90xx-IO)", dev)) {
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
 		return -ENODEV;
 	}
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index ca4a57c30bf8..7d564078022b 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -508,7 +508,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem,
 		goto err_free_dev;
 
 	/* reserve the irq */
-	if (request_irq(airq, arcnet_interrupt, 0, "arcnet (90xx)", dev)) {
+	if (request_irq(airq, arcnet_interrupt, IRQF_USER_DATA, "arcnet (90xx)", dev)) {
 		arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", airq);
 		goto err_release_mem;
 	}
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
index da636a22c542..ffdfc65d0bf0 100644
--- a/drivers/net/can/cc770/cc770.c
+++ b/drivers/net/can/cc770/cc770.c
@@ -782,8 +782,8 @@ static int cc770_open(struct net_device *dev)
 	if (err)
 		return err;
 
-	err = request_irq(dev->irq, &cc770_interrupt, priv->irq_flags,
-			  dev->name, dev);
+	err = request_irq(dev->irq, &cc770_interrupt,
+			  priv->irq_flags | IRQF_USER_DATA, dev->name, dev);
 	if (err) {
 		close_candev(dev);
 		return -EAGAIN;
diff --git a/drivers/net/can/peak_canfd/peak_pciefd_main.c b/drivers/net/can/peak_canfd/peak_pciefd_main.c
index c458d5fdc8d3..844b9c17b40a 100644
--- a/drivers/net/can/peak_canfd/peak_pciefd_main.c
+++ b/drivers/net/can/peak_canfd/peak_pciefd_main.c
@@ -415,11 +415,9 @@ static int pciefd_pre_cmd(struct peak_canfd_priv *ucan)
 			break;
 
 		/* going into operational mode: setup IRQ handler */
-		err = request_irq(priv->ucan.ndev->irq,
-				  pciefd_irq_handler,
-				  IRQF_SHARED,
-				  PCIEFD_DRV_NAME,
-				  priv);
+		err = request_irq(priv->ucan.ndev->irq, pciefd_irq_handler,
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  PCIEFD_DRV_NAME, priv);
 		if (err)
 			return err;
 
diff --git a/drivers/net/can/sja1000/ems_pcmcia.c b/drivers/net/can/sja1000/ems_pcmcia.c
index 381de998d2f1..831b4e962296 100644
--- a/drivers/net/can/sja1000/ems_pcmcia.c
+++ b/drivers/net/can/sja1000/ems_pcmcia.c
@@ -243,8 +243,8 @@ static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base)
 			free_sja1000dev(dev);
 	}
 
-	err = request_irq(dev->irq, &ems_pcmcia_interrupt, IRQF_SHARED,
-			  DRV_NAME, card);
+	err = request_irq(dev->irq, &ems_pcmcia_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, card);
 	if (!err)
 		return 0;
 
diff --git a/drivers/net/can/sja1000/peak_pcmcia.c b/drivers/net/can/sja1000/peak_pcmcia.c
index b8c39ede7cd5..ace929c99393 100644
--- a/drivers/net/can/sja1000/peak_pcmcia.c
+++ b/drivers/net/can/sja1000/peak_pcmcia.c
@@ -695,7 +695,8 @@ static int pcan_probe(struct pcmcia_device *pdev)
 	timer_setup(&card->led_timer, pcan_led_timer, 0);
 
 	/* request the given irq */
-	err = request_irq(pdev->irq, &pcan_isr, IRQF_SHARED, PCC_NAME, card);
+	err = request_irq(pdev->irq, &pcan_isr, IRQF_SHARED | IRQF_USER_DATA,
+			  PCC_NAME, card);
 	if (err) {
 		dev_err(&pdev->dev, "couldn't request irq%d\n", pdev->irq);
 		goto probe_err_5;
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 9f107798f904..82fc8b74c5b9 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -581,8 +581,9 @@ static int sja1000_open(struct net_device *dev)
 
 	/* register interrupt handler, if not done by the device driver */
 	if (!(priv->flags & SJA1000_CUSTOM_IRQ_HANDLER)) {
-		err = request_irq(dev->irq, sja1000_interrupt, priv->irq_flags,
-				  dev->name, (void *)dev);
+		err = request_irq(dev->irq, sja1000_interrupt,
+				  priv->irq_flags | IRQF_USER_DATA, dev->name,
+				  (void *)dev);
 		if (err) {
 			close_candev(dev);
 			return -EAGAIN;
diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c
index b223769d6a5e..0230d2605b0f 100644
--- a/drivers/net/ethernet/3com/3c509.c
+++ b/drivers/net/ethernet/3com/3c509.c
@@ -670,7 +670,8 @@ el3_open(struct net_device *dev)
 	outw(RxReset, ioaddr + EL3_CMD);
 	outw(SetStatusEnb | 0x00, ioaddr + EL3_CMD);
 
-	i = request_irq(dev->irq, el3_interrupt, 0, dev->name, dev);
+	i = request_irq(dev->irq, el3_interrupt,
+			IRQF_USER_DATA, dev->name, dev);
 	if (i)
 		return i;
 
diff --git a/drivers/net/ethernet/3com/3c515.c b/drivers/net/ethernet/3com/3c515.c
index b648e3f95c01..1ff6190b9ae4 100644
--- a/drivers/net/ethernet/3com/3c515.c
+++ b/drivers/net/ethernet/3com/3c515.c
@@ -764,13 +764,11 @@ static int corkscrew_open(struct net_device *dev)
 		/* Corkscrew: Cannot share ISA resources. */
 		if (dev->irq == 0 ||
 		    dev->dma == 0 ||
-		    request_irq(dev->irq, corkscrew_interrupt, 0,
-				vp->product_name, dev))
+		    request_irq(dev->irq, corkscrew_interrupt, IRQF_USER_DATA, vp->product_name, dev))
 			return -EAGAIN;
 		enable_dma(dev->dma);
 		set_dma_mode(dev->dma, DMA_MODE_CASCADE);
-	} else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED,
-			       vp->product_name, dev)) {
+	} else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED | IRQF_USER_DATA, vp->product_name, dev)) {
 		return -EAGAIN;
 	}
 
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index 0b6bbf63f7ca..01e1756458ea 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -474,7 +474,8 @@ static int axnet_open(struct net_device *dev)
 	return -ENODEV;
 
     outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
-    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
+    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED | IRQF_USER_DATA,
+                      "axnet_cs", dev);
     if (ret)
 	    return ret;
 
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index 1c97e39b478e..a1b236fec72e 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -492,7 +492,8 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
 
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
-	ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+	ret = request_irq(dev->irq, eip_interrupt,
+			  IRQF_USER_DATA, name, dev);
 	if (ret) {
 		pr_cont(" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
 		goto err_out;
diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 42985a82321a..67607c6cea12 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -431,7 +431,8 @@ static int ne2k_pci_set_fdx(struct net_device *dev)
 
 static int ne2k_pci_open(struct net_device *dev)
 {
-	int ret = request_irq(dev->irq, ei_interrupt, IRQF_SHARED, dev->name, dev);
+	int ret = request_irq(dev->irq, ei_interrupt,
+			      IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index 61e43802b9a5..cb7ccae4e84d 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -905,7 +905,8 @@ static int pcnet_open(struct net_device *dev)
     set_misc_reg(dev);
 
     outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
-    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev->name, dev);
+    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED | IRQF_USER_DATA,
+                      dev->name, dev);
     if (ret)
 	    return ret;
 
diff --git a/drivers/net/ethernet/8390/smc-ultra.c b/drivers/net/ethernet/8390/smc-ultra.c
index 3fe3b4dfa7c5..0ab0505a10d9 100644
--- a/drivers/net/ethernet/8390/smc-ultra.c
+++ b/drivers/net/ethernet/8390/smc-ultra.c
@@ -390,7 +390,8 @@ ultra_open(struct net_device *dev)
 	unsigned char irq2reg[] = {0, 0, 0x04, 0x08, 0, 0x0C, 0, 0x40,
 				   0, 0x04, 0x44, 0x48, 0, 0, 0, 0x4C, };
 
-	retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, ei_interrupt,
+			     IRQF_USER_DATA, dev->name, dev);
 	if (retval)
 		return retval;
 
diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
index c834123560f1..bcfa77e1ed5c 100644
--- a/drivers/net/ethernet/8390/wd.c
+++ b/drivers/net/ethernet/8390/wd.c
@@ -310,7 +310,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
 
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
-	i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
+	i = request_irq(dev->irq, ei_interrupt,
+			IRQF_USER_DATA, DRV_NAME, dev);
 	if (i) {
 		pr_cont(" unable to get IRQ %d.\n", dev->irq);
 		return i;
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c
index ea34bcb868b5..b143f7b734f8 100644
--- a/drivers/net/ethernet/agere/et131x.c
+++ b/drivers/net/ethernet/agere/et131x.c
@@ -3621,8 +3621,8 @@ static int et131x_open(struct net_device *netdev)
 		msecs_to_jiffies(TX_ERROR_PERIOD);
 	add_timer(&adapter->error_timer);
 
-	result = request_irq(irq, et131x_isr,
-			     IRQF_SHARED, netdev->name, netdev);
+	result = request_irq(irq, et131x_isr, IRQF_SHARED | IRQF_USER_DATA,
+			     netdev->name, netdev);
 	if (result) {
 		dev_err(&pdev->dev, "could not register IRQ %d\n", irq);
 		return result;
diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c
index b56d84c7df46..2761fb2fc6ff 100644
--- a/drivers/net/ethernet/amd/lance.c
+++ b/drivers/net/ethernet/amd/lance.c
@@ -753,7 +753,7 @@ lance_open(struct net_device *dev)
 	int i;
 
 	if (dev->irq == 0 ||
-		request_irq(dev->irq, lance_interrupt, 0, dev->name, dev)) {
+		request_irq(dev->irq, lance_interrupt, IRQF_USER_DATA, dev->name, dev)) {
 		return -EAGAIN;
 	}
 
diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
index 8931ce6bab7b..6285977cce73 100644
--- a/drivers/net/ethernet/amd/ni65.c
+++ b/drivers/net/ethernet/amd/ni65.c
@@ -294,8 +294,9 @@ static void ni65_set_performance(struct priv *p)
 static int ni65_open(struct net_device *dev)
 {
 	struct priv *p = dev->ml_priv;
-	int irqval = request_irq(dev->irq, ni65_interrupt,0,
-                        cards[p->cardno].cardname,dev);
+	int irqval = request_irq(dev->irq, ni65_interrupt,
+				 IRQF_USER_DATA,
+				 cards[p->cardno].cardname, dev);
 	if (irqval) {
 		printk(KERN_ERR "%s: unable to get IRQ %d (irqval=%d).\n",
 		          dev->name,dev->irq, irqval);
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 63edc5706c09..d7fe078569df 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2637,8 +2637,8 @@ static s32 atl1_up(struct atl1_adapter *adapter)
 		irq_flags |= IRQF_SHARED;
 	}
 
-	err = request_irq(adapter->pdev->irq, atl1_intr, irq_flags,
-			netdev->name, netdev);
+	err = request_irq(adapter->pdev->irq, atl1_intr,
+			  irq_flags | IRQF_USER_DATA, netdev->name, netdev);
 	if (unlikely(err))
 		goto err_up;
 
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index bb41becb6609..65b29d484bf1 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -670,8 +670,8 @@ static int atl2_request_irq(struct atl2_adapter *adapter)
 	if (adapter->have_msi)
 		flags &= ~IRQF_SHARED;
 
-	return request_irq(adapter->pdev->irq, atl2_intr, flags, netdev->name,
-		netdev);
+	return request_irq(adapter->pdev->irq, atl2_intr,
+			   flags | IRQF_USER_DATA, netdev->name, netdev);
 }
 
 /**
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 1e82b9efe447..b54e170ca81c 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -407,9 +407,8 @@ static int request_msix_data_irqs(struct adapter *adap)
 
 		for (j = 0; j < nqsets; ++j) {
 			err = request_irq(adap->msix_info[qidx + 1].vec,
-					  t3_intr_handler(adap,
-							  adap->sge.qs[qidx].
-							  rspq.polling), 0,
+					  t3_intr_handler(adap, adap->sge.qs[qidx].rspq.polling),
+					  IRQF_USER_DATA,
 					  adap->msix_info[qidx + 1].desc,
 					  &adap->sge.qs[qidx]);
 			if (err) {
@@ -1264,7 +1263,8 @@ static int cxgb_up(struct adapter *adap)
 	if (adap->flags & USING_MSIX) {
 		name_msix_vecs(adap);
 		err = request_irq(adap->msix_info[0].vec,
-				  t3_async_intr_handler, 0,
+				  t3_async_intr_handler,
+				  IRQF_USER_DATA,
 				  adap->msix_info[0].desc, adap);
 		if (err)
 			goto irq_err;
@@ -1274,13 +1274,7 @@ static int cxgb_up(struct adapter *adap)
 			free_irq(adap->msix_info[0].vec, adap);
 			goto irq_err;
 		}
-	} else if ((err = request_irq(adap->pdev->irq,
-				      t3_intr_handler(adap,
-						      adap->sge.qs[0].rspq.
-						      polling),
-				      (adap->flags & USING_MSI) ?
-				       0 : IRQF_SHARED,
-				      adap->name, adap)))
+	} else if ((err = request_irq(adap->pdev->irq, t3_intr_handler(adap, adap->sge.qs[0].rspq.polling), ((adap->flags & USING_MSI) ? 0 : IRQF_SHARED) | IRQF_USER_DATA, adap->name, adap)))
 		goto irq_err;
 
 	enable_all_napi(adap);
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index 35f8c9ef204d..2343c911276f 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -924,7 +924,8 @@ static int ks_net_open(struct net_device *netdev)
 	netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__);
 
 	/* reset the HW */
-	err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
+	err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS | IRQF_USER_DATA,
+			  DRV_NAME, netdev);
 
 	if (err) {
 		pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err);
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 310807ef328b..4fd1123173e8 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -385,10 +385,9 @@ static int lan743x_intr_register_isr(struct lan743x_adapter *adapter,
 	vector->handler = handler;
 	vector->context = context;
 
-	ret = request_irq(vector->irq,
-			  lan743x_intr_entry_isr,
-			  (flags & LAN743X_VECTOR_FLAG_IRQ_SHARED) ?
-			  IRQF_SHARED : 0, DRIVER_NAME, vector);
+	ret = request_irq(vector->irq, lan743x_intr_entry_isr,
+			  ((flags & LAN743X_VECTOR_FLAG_IRQ_SHARED) ? IRQF_SHARED : 0) | IRQF_USER_DATA,
+			  DRIVER_NAME, vector);
 	if (ret) {
 		vector->handler = NULL;
 		vector->context = NULL;
diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c
index 7e011c1c1e6e..03ab879536b7 100644
--- a/drivers/net/ethernet/realtek/atp.c
+++ b/drivers/net/ethernet/realtek/atp.c
@@ -433,7 +433,8 @@ static int net_open(struct net_device *dev)
 	/* The interrupt line is turned off (tri-stated) when the device isn't in
 	   use.  That's especially important for "attached" interfaces where the
 	   port or interrupt may be shared. */
-	ret = request_irq(dev->irq, atp_interrupt, 0, dev->name, dev);
+	ret = request_irq(dev->irq, atp_interrupt,
+			  IRQF_USER_DATA, dev->name, dev);
 	if (ret)
 		return ret;
 
diff --git a/drivers/net/fddi/skfp/skfddi.c b/drivers/net/fddi/skfp/skfddi.c
index 5d661f60b101..077c3113418c 100644
--- a/drivers/net/fddi/skfp/skfddi.c
+++ b/drivers/net/fddi/skfp/skfddi.c
@@ -486,8 +486,8 @@ static int skfp_open(struct net_device *dev)
 
 	pr_debug("entering skfp_open\n");
 	/* Register IRQ - support shared interrupts by passing device ptr */
-	err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED,
-			  dev->name, dev);
+	err = request_irq(dev->irq, skfp_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 	if (err)
 		return err;
 
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index 190f66c88479..31a59326c141 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -447,8 +447,7 @@ static int ser12_open(struct net_device *dev)
 	outb(0, FCR(dev->base_addr));  /* disable FIFOs */
 	outb(0x0d, MCR(dev->base_addr));
 	outb(0, IER(dev->base_addr));
-	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED,
-			"baycom_ser_fdx", dev)) {
+	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED | IRQF_USER_DATA, "baycom_ser_fdx", dev)) {
 		release_region(dev->base_addr, SER12_EXTENT);
 		return -EBUSY;
 	}
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 3c823c648cf5..2b98365f27da 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -490,8 +490,7 @@ static int ser12_open(struct net_device *dev)
 	outb(0, FCR(dev->base_addr));  /* disable FIFOs */
 	outb(0x0d, MCR(dev->base_addr));
 	outb(0, IER(dev->base_addr));
-	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED,
-			"baycom_ser12", dev)) {
+	if (request_irq(dev->irq, ser12_interrupt, IRQF_SHARED | IRQF_USER_DATA, "baycom_ser12", dev)) {
 		release_region(dev->base_addr, SER12_EXTENT);       
 		return -EBUSY;
 	}
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 6c03932d8a6b..1e7ee07887e1 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1737,9 +1737,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 				
 			if (!Ivec[hwcfg.irq].used && hwcfg.irq)
 			{
-				if (request_irq(hwcfg.irq, scc_isr,
-						0, "AX.25 SCC",
-						(void *)(long) hwcfg.irq))
+				if (request_irq(hwcfg.irq, scc_isr, IRQF_USER_DATA, "AX.25 SCC", (void *)(long)hwcfg.irq))
 					printk(KERN_WARNING "z8530drv: warning, cannot get IRQ %d\n", hwcfg.irq);
 				else
 					Ivec[hwcfg.irq].used = 1;
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index ba9df430fca6..433695ae5e5c 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -877,7 +877,7 @@ static int yam_open(struct net_device *dev)
 		goto out_release_base;
 	}
 	outb(0, IER(dev->base_addr));
-	if (request_irq(dev->irq, yam_interrupt, IRQF_SHARED, dev->name, dev)) {
+	if (request_irq(dev->irq, yam_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq);
 		ret = -EBUSY;
 		goto out_release_base;
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 0253eb502153..50af3e288503 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1749,7 +1749,8 @@ static int at86rf230_probe(struct spi_device *spi)
 		irq_type = IRQF_TRIGGER_HIGH;
 
 	rc = devm_request_irq(&spi->dev, spi->irq, at86rf230_isr,
-			      IRQF_SHARED | irq_type, dev_name(&spi->dev), lp);
+			      IRQF_SHARED | irq_type | IRQF_USER_DATA,
+			      dev_name(&spi->dev), lp);
 	if (rc)
 		goto free_dev;
 
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index b2ff903a9cb6..e4915a6810a3 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -2884,13 +2884,9 @@ static int ca8210_interrupt_init(struct spi_device *spi)
 		return pdata->irq_id;
 	}
 
-	ret = request_irq(
-		pdata->irq_id,
-		ca8210_interrupt_handler,
-		IRQF_TRIGGER_FALLING,
-		"ca8210-irq",
-		spi_get_drvdata(spi)
-	);
+	ret = request_irq(pdata->irq_id, ca8210_interrupt_handler,
+			  IRQF_TRIGGER_FALLING | IRQF_USER_DATA, "ca8210-irq",
+			  spi_get_drvdata(spi));
 	if (ret) {
 		dev_crit(&spi->dev, "request_irq %d failed\n", pdata->irq_id);
 		gpio_unexport(pdata->gpio_irq);
diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
index c589f5ae75bb..2a7e90769ed2 100644
--- a/drivers/net/ieee802154/mcr20a.c
+++ b/drivers/net/ieee802154/mcr20a.c
@@ -1314,7 +1314,8 @@ mcr20a_probe(struct spi_device *spi)
 		irq_type = IRQF_TRIGGER_FALLING;
 
 	ret = devm_request_irq(&spi->dev, spi->irq, mcr20a_irq_isr,
-			       irq_type, dev_name(&spi->dev), lp);
+			       irq_type | IRQF_USER_DATA, dev_name(&spi->dev),
+			       lp);
 	if (ret) {
 		dev_err(&spi->dev, "could not request_irq for mcr20a\n");
 		ret = -ENODEV;
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index cf4788d840bf..31b7d8d544bb 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -1346,7 +1346,8 @@ static int mrf24j40_probe(struct spi_device *spi)
 		irq_type = IRQF_TRIGGER_LOW;
 
 	ret = devm_request_irq(&spi->dev, spi->irq, mrf24j40_isr,
-			       irq_type, dev_name(&spi->dev), devrec);
+			       irq_type | IRQF_USER_DATA, dev_name(&spi->dev),
+			       devrec);
 	if (ret) {
 		dev_err(printdev(devrec), "Unable to get IRQ");
 		goto err_register_device;
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index f6b000ddcd15..d466bb81f2ab 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -541,7 +541,7 @@ static int cosa_probe(int base, int irq, int dma)
 	cosa->usage = 0;
 	cosa->nchannels = 2;	/* FIXME: how to determine this? */
 
-	if (request_irq(cosa->irq, cosa_interrupt, 0, cosa->type, cosa)) {
+	if (request_irq(cosa->irq, cosa_interrupt, IRQF_USER_DATA, cosa->type, cosa)) {
 		err = -1;
 		goto err_out;
 	}
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 2a3f0f1a2b0a..070dee4a1ac6 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2466,7 +2466,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dbg(DBG_PCI, "kernel mem %p, ctlmem %p\n", card->mem, card->ctlmem);
 
 	/* Register the interrupt handler */
-	if (request_irq(pdev->irq, fst_intr, IRQF_SHARED, FST_DEV_NAME, card)) {
+	if (request_irq(pdev->irq, fst_intr, IRQF_SHARED | IRQF_USER_DATA, FST_DEV_NAME, card)) {
 		pr_err("Unable to register interrupt %d\n", card->irq);
 		err = -ENODEV;
 		goto irq_fail;
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index 4de0737fbf8a..e4f5e247072f 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -219,8 +219,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
 	/* We want a fast IRQ for this device. Actually we'd like an even faster
 	   IRQ ;) - This is one driver RtLinux is made for */
 
-	if (request_irq(irq, z8530_interrupt, 0,
-			"Hostess SV11", sv) < 0) {
+	if (request_irq(irq, z8530_interrupt, IRQF_USER_DATA, "Hostess SV11", sv) < 0) {
 		pr_warn("IRQ %d already in use\n", irq);
 		goto err_irq;
 	}
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 8e8c4c0e1b64..4f541c8c3615 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -1175,7 +1175,7 @@ sbni_open( struct net_device  *dev )
 			}
 	}
 
-	if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) {
+	if(request_irq(dev->irq, sbni_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		netdev_err(dev, "unable to get IRQ %d\n", dev->irq);
 		return  -EAGAIN;
 	}
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 57ed259c8208..0a0cff9228e8 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -1452,7 +1452,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
 	}
 
 	err = -EAGAIN;
-	if (request_irq(dev->irq, sdla_isr, 0, dev->name, dev)) 
+	if (request_irq(dev->irq, sdla_isr, IRQF_USER_DATA, dev->name, dev)) 
 		goto fail;
 
 	if (flp->type == SDLA_S507) {
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index c56f2c252113..53687a3b703f 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -265,8 +265,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
 	/* We want a fast IRQ for this device. Actually we'd like an even faster
 	   IRQ ;) - This is one driver RtLinux is made for */
 
-	if (request_irq(irq, z8530_interrupt, 0,
-			"SeaLevel", dev) < 0) {
+	if (request_irq(irq, z8530_interrupt, IRQF_USER_DATA, "SeaLevel", dev) < 0) {
 		pr_warn("IRQ %d already in use\n", irq);
 		goto err_request_irq;
 	}
diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c
index 55f411925960..e61752e584dd 100644
--- a/drivers/net/wireless/broadcom/b43legacy/main.c
+++ b/drivers/net/wireless/broadcom/b43legacy/main.c
@@ -2989,7 +2989,7 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev)
 
 	drain_txstatus_queue(dev);
 	err = request_irq(dev->dev->irq, b43legacy_interrupt_handler,
-			  IRQF_SHARED, KBUILD_MODNAME, dev);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, dev);
 	if (err) {
 		b43legacyerr(dev->wl, "Cannot request IRQ-%d\n",
 		       dev->dev->irq);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index d64bf233b12c..a38d39a52133 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -116,9 +116,10 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
 		spin_lock_init(&sdiodev->irq_en_lock);
 		sdiodev->irq_en = true;
 
-		ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler,
-				  pdata->oob_irq_flags, "brcmf_oob_intr",
-				  &sdiodev->func1->dev);
+		ret = request_irq(pdata->oob_irq_nr,
+				  brcmf_sdiod_oob_irqhandler,
+				  pdata->oob_irq_flags | IRQF_USER_DATA,
+				  "brcmf_oob_intr", &sdiodev->func1->dev);
 		if (ret != 0) {
 			brcmf_err("request_irq failed %d\n", ret);
 			return ret;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
index 6188275b17e5..f81ec32145c3 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
@@ -1167,8 +1167,7 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev)
 	wl->pub->ieee_hw = hw;
 
 	/* register our interrupt handler */
-	if (request_irq(pdev->irq, brcms_isr,
-			IRQF_SHARED, KBUILD_MODNAME, wl)) {
+	if (request_irq(pdev->irq, brcms_isr, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, wl)) {
 		wiphy_err(wl->wiphy, "wl%d: request_irq() failed\n", unit);
 		goto fail;
 	}
diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c
index 3f5a14112c6b..5e85377e1565 100644
--- a/drivers/net/wireless/cisco/airo.c
+++ b/drivers/net/wireless/cisco/airo.c
@@ -1894,8 +1894,8 @@ static int airo_open(struct net_device *dev) {
 		if (IS_ERR(ai->airo_thread_task))
 			return (int)PTR_ERR(ai->airo_thread_task);
 
-		rc = request_irq(dev->irq, airo_interrupt, IRQF_SHARED,
-			dev->name, dev);
+		rc = request_irq(dev->irq, airo_interrupt,
+				 IRQF_SHARED | IRQF_USER_DATA, dev->name, dev);
 		if (rc) {
 			airo_print_err(dev->name,
 				"register interrupt %d failed, rc %d",
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index 52e5ed2d3bc2..0b8c2275ec55 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -6253,8 +6253,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	}
 	ipw2100_queues_initialize(priv);
 
-	err = request_irq(pci_dev->irq,
-			  ipw2100_interrupt, IRQF_SHARED, dev->name, priv);
+	err = request_irq(pci_dev->irq, ipw2100_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->name, priv);
 	if (err) {
 		printk(KERN_WARNING DRV_NAME
 		       "Error calling request_irq: %d.\n", pci_dev->irq);
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index fa400f92d7e2..33931a4435e3 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -11686,7 +11686,8 @@ static int ipw_pci_probe(struct pci_dev *pdev,
 
 	ipw_sw_reset(priv, 1);
 
-	err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED, DRV_NAME, priv);
+	err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED | IRQF_USER_DATA,
+			  DRV_NAME, priv);
 	if (err) {
 		IPW_ERROR("Error allocating IRQ %d\n", pdev->irq);
 		goto out_iounmap;
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index 57e3b6cca234..48cdce4a6ca0 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -3729,7 +3729,8 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_enable_msi(il->pci_dev);
 
-	err = request_irq(il->pci_dev->irq, il_isr, IRQF_SHARED, DRV_NAME, il);
+	err = request_irq(il->pci_dev->irq, il_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, il);
 	if (err) {
 		IL_ERR("Error allocating IRQ %d\n", il->pci_dev->irq);
 		goto out_disable_msi;
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 6b4488a178a7..8132d6964923 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -6642,7 +6642,8 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_enable_msi(il->pci_dev);
 
-	err = request_irq(il->pci_dev->irq, il_isr, IRQF_SHARED, DRV_NAME, il);
+	err = request_irq(il->pci_dev->irq, il_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, il);
 	if (err) {
 		IL_ERR("Error allocating IRQ %d\n", il->pci_dev->irq);
 		goto out_disable_msi;
diff --git a/drivers/net/wireless/intersil/hostap/hostap_pci.c b/drivers/net/wireless/intersil/hostap/hostap_pci.c
index c864ef4b0015..9886b9007da3 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_pci.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_pci.c
@@ -335,8 +335,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, dev);
 
-	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
-			dev)) {
+	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
 		goto fail;
 	} else
diff --git a/drivers/net/wireless/intersil/hostap/hostap_plx.c b/drivers/net/wireless/intersil/hostap/hostap_plx.c
index 4901a99c6c59..f6ba83e95bf3 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_plx.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_plx.c
@@ -549,8 +549,7 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, dev);
 
-	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
-			dev)) {
+	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
 		goto fail;
 	} else
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_nortel.c b/drivers/net/wireless/intersil/orinoco/orinoco_nortel.c
index 048693b6c6c2..d5a5fbd013e7 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_nortel.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_nortel.c
@@ -194,8 +194,8 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_pci.c b/drivers/net/wireless/intersil/orinoco/orinoco_pci.c
index 4938a2208a37..30a5865822eb 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_pci.c
@@ -150,8 +150,8 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_plx.c b/drivers/net/wireless/intersil/orinoco/orinoco_plx.c
index 221352027779..72379f60f7db 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_plx.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_plx.c
@@ -233,8 +233,8 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_tmd.c b/drivers/net/wireless/intersil/orinoco/orinoco_tmd.c
index 20ce569b8a43..0ab170de926a 100644
--- a/drivers/net/wireless/intersil/orinoco/orinoco_tmd.c
+++ b/drivers/net/wireless/intersil/orinoco/orinoco_tmd.c
@@ -136,8 +136,8 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 
 	hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING);
 
-	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
-			  DRIVER_NAME, priv);
+	err = request_irq(pdev->irq, orinoco_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, priv);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
diff --git a/drivers/net/wireless/intersil/p54/p54pci.c b/drivers/net/wireless/intersil/p54/p54pci.c
index 27a49068d32d..5b4af691fb2a 100644
--- a/drivers/net/wireless/intersil/p54/p54pci.c
+++ b/drivers/net/wireless/intersil/p54/p54pci.c
@@ -435,7 +435,7 @@ static int p54p_open(struct ieee80211_hw *dev)
 
 	init_completion(&priv->boot_comp);
 	err = request_irq(priv->pdev->irq, p54p_interrupt,
-			  IRQF_SHARED, "p54pci", dev);
+			  IRQF_SHARED | IRQF_USER_DATA, "p54pci", dev);
 	if (err) {
 		dev_err(&priv->pdev->dev, "failed to register IRQ handler\n");
 		return err;
diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wireless/intersil/p54/p54spi.c
index e41bf042352e..83202723109d 100644
--- a/drivers/net/wireless/intersil/p54/p54spi.c
+++ b/drivers/net/wireless/intersil/p54/p54spi.c
@@ -635,8 +635,8 @@ static int p54spi_probe(struct spi_device *spi)
 	gpio_direction_output(p54spi_gpio_power, 0);
 	gpio_direction_input(p54spi_gpio_irq);
 
-	ret = request_irq(gpio_to_irq(p54spi_gpio_irq),
-			  p54spi_interrupt, 0, "p54spi",
+	ret = request_irq(gpio_to_irq(p54spi_gpio_irq), p54spi_interrupt,
+			  IRQF_USER_DATA, "p54spi",
 			  priv->spi);
 	if (ret < 0) {
 		dev_err(&priv->spi->dev, "request_irq() failed");
diff --git a/drivers/net/wireless/intersil/prism54/islpci_hotplug.c b/drivers/net/wireless/intersil/prism54/islpci_hotplug.c
index 300c846ea087..50ac965c0092 100644
--- a/drivers/net/wireless/intersil/prism54/islpci_hotplug.c
+++ b/drivers/net/wireless/intersil/prism54/islpci_hotplug.c
@@ -182,7 +182,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	/* request for the interrupt before uploading the firmware */
 	rvalue = request_irq(pdev->irq, islpci_interrupt,
-			     IRQF_SHARED, ndev->name, priv);
+			     IRQF_SHARED | IRQF_USER_DATA, ndev->name, priv);
 
 	if (rvalue) {
 		/* error, could not hook the handler to the irq */
diff --git a/drivers/net/wireless/marvell/libertas/if_cs.c b/drivers/net/wireless/marvell/libertas/if_cs.c
index cebf03c6a622..aed7ad507a2b 100644
--- a/drivers/net/wireless/marvell/libertas/if_cs.c
+++ b/drivers/net/wireless/marvell/libertas/if_cs.c
@@ -736,7 +736,7 @@ static void if_cs_prog_firmware(struct lbs_private *priv, int ret,
 
 	/* Now actually get the IRQ */
 	ret = request_irq(card->p_dev->irq, if_cs_interrupt,
-		IRQF_SHARED, DRV_NAME, card);
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, card);
 	if (ret) {
 		pr_err("error in request_irq\n");
 		return;
diff --git a/drivers/net/wireless/marvell/libertas/if_spi.c b/drivers/net/wireless/marvell/libertas/if_spi.c
index 7c3224b83ef7..3b8c174448c8 100644
--- a/drivers/net/wireless/marvell/libertas/if_spi.c
+++ b/drivers/net/wireless/marvell/libertas/if_spi.c
@@ -1167,7 +1167,8 @@ static int if_spi_probe(struct spi_device *spi)
 	INIT_WORK(&card->resume_work, if_spi_resume_worker);
 
 	err = request_irq(spi->irq, if_spi_host_interrupt,
-			IRQF_TRIGGER_FALLING, "libertas_spi", card);
+			  IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+			  "libertas_spi", card);
 	if (err) {
 		pr_err("can't get host irq line-- request_irq failed\n");
 		goto terminate_workqueue;
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 20cee5c397fb..730acbe06c99 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1602,8 +1602,9 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
 	}
 
 	ret = devm_request_irq(dev, adapter->irq_wakeup,
-			       mwifiex_irq_wakeup_handler, IRQF_TRIGGER_LOW,
-			       "wifi_wake", adapter);
+			       mwifiex_irq_wakeup_handler,
+			       IRQF_TRIGGER_LOW | IRQF_USER_DATA, "wifi_wake",
+			       adapter);
 	if (ret) {
 		dev_err(dev, "Failed to request irq_wakeup %d (%d)\n",
 			adapter->irq_wakeup, ret);
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 3fe81b2a929a..f8ee89d5fa81 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -3033,7 +3033,8 @@ static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
 				card->msix_ctx[i].msg_id = i;
 
 				ret = request_irq(card->msix_entries[i].vector,
-						  mwifiex_pcie_interrupt, 0,
+						  mwifiex_pcie_interrupt,
+						  IRQF_USER_DATA,
 						  "MWIFIEX_PCIE_MSIX",
 						  &card->msix_ctx[i]);
 				if (ret)
@@ -3064,8 +3065,9 @@ static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
 
 	card->share_irq_ctx.dev = pdev;
 	card->share_irq_ctx.msg_id = -1;
-	ret = request_irq(pdev->irq, mwifiex_pcie_interrupt, IRQF_SHARED,
-			  "MRVL_PCIE", &card->share_irq_ctx);
+	ret = request_irq(pdev->irq, mwifiex_pcie_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, "MRVL_PCIE",
+			  &card->share_irq_ctx);
 	if (ret) {
 		pr_err("request_irq failed: ret=%d\n", ret);
 		return -1;
diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c
index 8e4e9b6919e0..9a55fe1a2f0d 100644
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
@@ -4696,7 +4696,7 @@ static int mwl8k_start(struct ieee80211_hw *hw)
 	int rc;
 
 	rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
-			 IRQF_SHARED, MWL8K_NAME, hw);
+			 IRQF_SHARED | IRQF_USER_DATA, MWL8K_NAME, hw);
 	if (rc) {
 		priv->irq = -1;
 		wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
@@ -5902,7 +5902,7 @@ static int mwl8k_probe_hw(struct ieee80211_hw *hw)
 		  priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK);
 
 	rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
-			 IRQF_SHARED, MWL8K_NAME, hw);
+			 IRQF_SHARED | IRQF_USER_DATA, MWL8K_NAME, hw);
 	if (rc) {
 		wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
 		goto err_free_queues;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
index d895b6f3dc44..e6f717724f81 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
@@ -191,7 +191,8 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	dev_info(dev->mt76.dev, "ASIC revision: %08x\n", dev->mt76.rev);
 
 	ret = devm_request_irq(dev->mt76.dev, pdev->irq, mt76x02_irq_handler,
-			       IRQF_SHARED, KBUILD_MODNAME, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			       dev);
 	if (ret)
 		goto error;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
index 92432fe97312..3c21e173786a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
@@ -58,7 +58,8 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	dev_info(dev->mt76.dev, "ASIC revision: %08x\n", dev->mt76.rev);
 
 	ret = devm_request_irq(dev->mt76.dev, pdev->irq, mt76x02_irq_handler,
-			       IRQF_SHARED, KBUILD_MODNAME, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			       dev);
 	if (ret)
 		goto error;
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
index 1f5facbb8905..7fd8ee3c14b7 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
@@ -1095,7 +1095,8 @@ static int qtnf_pcie_pearl_probe(struct qtnf_bus *bus, unsigned int tx_bd_size)
 	qtnf_disable_hdp_irqs(ps);
 
 	ret = devm_request_irq(&pdev->dev, pdev->irq,
-			       &qtnf_pcie_pearl_interrupt, 0,
+			       &qtnf_pcie_pearl_interrupt,
+			       IRQF_USER_DATA,
 			       "qtnf_pearl_irq", (void *)bus);
 	if (ret) {
 		pr_err("failed to request pcie irq %d\n", pdev->irq);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
index 598edb814421..2905fa3d7261 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
@@ -1120,7 +1120,8 @@ static int qtnf_pcie_topaz_probe(struct qtnf_bus *bus, unsigned int tx_bd_num)
 
 	ret = devm_request_irq(&pdev->dev, pdev->irq,
 			       &qtnf_pcie_topaz_interrupt,
-			       irqflags, "qtnf_topaz_irq", (void *)bus);
+			       irqflags | IRQF_USER_DATA, "qtnf_topaz_irq",
+			       (void *)bus);
 	if (ret) {
 		pr_err("failed to request pcie irq %d\n", pdev->irq);
 		return ret;
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c
index 4956a54151cb..bd31eb811f19 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mmio.c
@@ -167,9 +167,9 @@ int rt2x00mmio_initialize(struct rt2x00_dev *rt2x00dev)
 	/*
 	 * Register interrupt handler.
 	 */
-	status = request_irq(rt2x00dev->irq,
-			     rt2x00dev->ops->lib->irq_handler,
-			     IRQF_SHARED, rt2x00dev->name, rt2x00dev);
+	status = request_irq(rt2x00dev->irq, rt2x00dev->ops->lib->irq_handler,
+			     IRQF_SHARED | IRQF_USER_DATA, rt2x00dev->name,
+			     rt2x00dev);
 	if (status) {
 		rt2x00_err(rt2x00dev, "IRQ %d allocation failed (error %d)\n",
 			   rt2x00dev->irq, status);
diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c
index 225c1c8851cc..4ae6d1d7bdec 100644
--- a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c
@@ -1134,10 +1134,12 @@ static int rtl8180_start(struct ieee80211_hw *dev)
 
 	if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE) {
 		ret = request_irq(priv->pdev->irq, rtl8187se_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  KBUILD_MODNAME, dev);
 	} else {
 		ret = request_irq(priv->pdev->irq, rtl8180_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  KBUILD_MODNAME, dev);
 	}
 
 	if (ret) {
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 5d1fda16fc8c..58b64849172a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -2108,7 +2108,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw)
 		return ret;
 
 	ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, hw);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hw);
 	if (ret < 0) {
 		pci_disable_msi(rtlpci->pdev);
 		return ret;
@@ -2129,7 +2129,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw)
 	int ret;
 
 	ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, hw);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hw);
 	if (ret < 0)
 		return ret;
 
diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
index b661f896e9fe..f5c3450cf15f 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
@@ -274,7 +274,9 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 
 	if (wl->irq) {
 		irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
-		ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
+		ret = request_irq(wl->irq, wl1251_line_irq,
+				  IRQF_USER_DATA, "wl1251",
+				  wl);
 		if (ret < 0) {
 			wl1251_error("request_irq() failed: %d", ret);
 			goto disable;
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 8de9d4444a6a..1fc0a75d4281 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -307,8 +307,9 @@ static int wl1251_spi_probe(struct spi_device *spi)
 	}
 
 	irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
-	ret = devm_request_irq(&spi->dev, wl->irq, wl1251_irq, 0,
-							DRIVER_NAME, wl);
+	ret = devm_request_irq(&spi->dev, wl->irq, wl1251_irq,
+			       IRQF_USER_DATA, DRIVER_NAME,
+			       wl);
 	if (ret < 0) {
 		wl1251_error("request_irq() failed: %d", ret);
 		goto out_free;
diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c
index efb214fc545a..8de5bd055b66 100644
--- a/drivers/ntb/hw/amd/ntb_hw_amd.c
+++ b/drivers/ntb/hw/amd/ntb_hw_amd.c
@@ -621,7 +621,8 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev,
 	for (i = 0; i < msix_count; ++i) {
 		ndev->vec[i].ndev = ndev;
 		ndev->vec[i].num = i;
-		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr, 0,
+		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr,
+				 IRQF_USER_DATA,
 				 "ndev_vec_isr", &ndev->vec[i]);
 		if (rc)
 			goto err_msix_request;
@@ -649,8 +650,9 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev,
 	if (rc)
 		goto err_msi_enable;
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, 0,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_USER_DATA, "ndev_irq_isr",
+			 ndev);
 	if (rc)
 		goto err_msi_request;
 
@@ -666,8 +668,8 @@ static int ndev_init_isr(struct amd_ntb_dev *ndev,
 	/* Try to set up intx irq */
 	pci_intx(pdev, 1);
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_SHARED | IRQF_USER_DATA, "ndev_irq_isr", ndev);
 	if (rc)
 		goto err_intx_request;
 
diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c
index 2ad263f708da..106f1800c35b 100644
--- a/drivers/ntb/hw/intel/ntb_hw_gen1.c
+++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c
@@ -401,7 +401,8 @@ int ndev_init_isr(struct intel_ntb_dev *ndev,
 	for (i = 0; i < msix_count; ++i) {
 		ndev->vec[i].ndev = ndev;
 		ndev->vec[i].num = i;
-		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr, 0,
+		rc = request_irq(ndev->msix[i].vector, ndev_vec_isr,
+				 IRQF_USER_DATA,
 				 "ndev_vec_isr", &ndev->vec[i]);
 		if (rc)
 			goto err_msix_request;
@@ -430,8 +431,9 @@ int ndev_init_isr(struct intel_ntb_dev *ndev,
 	if (rc)
 		goto err_msi_enable;
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, 0,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_USER_DATA, "ndev_irq_isr",
+			 ndev);
 	if (rc)
 		goto err_msi_request;
 
@@ -448,8 +450,8 @@ int ndev_init_isr(struct intel_ntb_dev *ndev,
 
 	pci_intx(pdev, 1);
 
-	rc = request_irq(pdev->irq, ndev_irq_isr, IRQF_SHARED,
-			 "ndev_irq_isr", ndev);
+	rc = request_irq(pdev->irq, ndev_irq_isr,
+			 IRQF_SHARED | IRQF_USER_DATA, "ndev_irq_isr", ndev);
 	if (rc)
 		goto err_intx_request;
 
diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
index f1eaa3c4d46a..e038a6847ae4 100644
--- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
+++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
@@ -1448,14 +1448,14 @@ static int switchtec_ntb_init_db_msg_irq(struct switchtec_ntb *sndev)
 	sndev->doorbell_irq = pci_irq_vector(sndev->stdev->pdev, doorbell_irq);
 	sndev->message_irq = pci_irq_vector(sndev->stdev->pdev, message_irq);
 
-	rc = request_irq(sndev->doorbell_irq,
-			 switchtec_ntb_doorbell_isr, 0,
+	rc = request_irq(sndev->doorbell_irq, switchtec_ntb_doorbell_isr,
+			 IRQF_USER_DATA,
 			 "switchtec_ntb_doorbell", sndev);
 	if (rc)
 		return rc;
 
-	rc = request_irq(sndev->message_irq,
-			 switchtec_ntb_message_isr, 0,
+	rc = request_irq(sndev->message_irq, switchtec_ntb_message_isr,
+			 IRQF_USER_DATA,
 			 "switchtec_ntb_message", sndev);
 	if (rc) {
 		free_irq(sndev->doorbell_irq, sndev);
diff --git a/drivers/parport/parport_ax88796.c b/drivers/parport/parport_ax88796.c
index bfe97c2a8d4c..5a4a87e73d57 100644
--- a/drivers/parport/parport_ax88796.c
+++ b/drivers/parport/parport_ax88796.c
@@ -336,7 +336,8 @@ static int parport_ax88796_probe(struct platform_device *pdev)
 	if (irq >= 0) {
 		/* request irq */
 		ret = request_irq(irq, parport_irq_handler,
-				  IRQF_TRIGGER_FALLING, pdev->name, pp);
+				  IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+				  pdev->name, pp);
 
 		if (ret < 0)
 			goto exit_port;
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 9c8249f74479..512f98234bdd 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2190,8 +2190,7 @@ struct parport *parport_pc_probe_port(unsigned long int base,
 		EPP_res = NULL;
 	}
 	if (p->irq != PARPORT_IRQ_NONE) {
-		if (request_irq(p->irq, parport_irq_handler,
-				 irqflags, p->name, p)) {
+		if (request_irq(p->irq, parport_irq_handler, irqflags | IRQF_USER_DATA, p->name, p)) {
 			printk(KERN_WARNING "%s: irq %d in use, "
 				"resorting to polled operation\n",
 				p->name, p->irq);
diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c
index 9bd1a35cd5d8..57294e32ab68 100644
--- a/drivers/pci/controller/pcie-xilinx.c
+++ b/drivers/pci/controller/pcie-xilinx.c
@@ -588,7 +588,7 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port)
 
 	port->irq = irq_of_parse_and_map(node, 0);
 	err = devm_request_irq(dev, port->irq, xilinx_pcie_intr_handler,
-			       IRQF_SHARED | IRQF_NO_THREAD,
+			       IRQF_SHARED | IRQF_NO_THREAD | IRQF_USER_DATA,
 			       "xilinx-pcie", port);
 	if (err) {
 		dev_err(dev, "unable to request irq %d\n", port->irq);
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 3890812cdf87..acf4d9942120 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -766,8 +766,9 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 		INIT_LIST_HEAD(&vmd->irqs[i].irq_list);
 		err = devm_request_irq(&dev->dev, pci_irq_vector(dev, i),
-				       vmd_irq, IRQF_NO_THREAD,
-				       "vmd", &vmd->irqs[i]);
+				       vmd_irq,
+				       IRQF_NO_THREAD | IRQF_USER_DATA, "vmd",
+				       &vmd->irqs[i]);
 		if (err)
 			return err;
 	}
@@ -825,9 +826,9 @@ static int vmd_resume(struct device *dev)
 	int err, i;
 
 	for (i = 0; i < vmd->msix_count; i++) {
-		err = devm_request_irq(dev, pci_irq_vector(pdev, i),
-				       vmd_irq, IRQF_NO_THREAD,
-				       "vmd", &vmd->irqs[i]);
+		err = devm_request_irq(dev, pci_irq_vector(pdev, i), vmd_irq,
+				       IRQF_NO_THREAD | IRQF_USER_DATA, "vmd",
+				       &vmd->irqs[i]);
 		if (err)
 			return err;
 	}
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 603eadf3d965..4d45dcc7de58 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -525,11 +525,7 @@ cpci_hp_register_controller(struct cpci_hp_controller *new_controller)
 		if (!(new_controller->ops->enable_irq &&
 		     new_controller->ops->disable_irq))
 			status = -EINVAL;
-		if (request_irq(new_controller->irq,
-			       cpci_hp_intr,
-			       new_controller->irq_flags,
-			       MY_NAME,
-			       new_controller->dev_id)) {
+		if (request_irq(new_controller->irq, cpci_hp_intr, new_controller->irq_flags | IRQF_USER_DATA, MY_NAME, new_controller->dev_id)) {
 			err("Can't get irq %d for the hotplug cPCI controller",
 			    new_controller->irq);
 			status = -ENODEV;
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 16bbb183695a..4fa05ac1a086 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -1139,8 +1139,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* set up the interrupt */
 	dbg("HPC interrupt = %d\n", ctrl->interrupt);
-	if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr,
-			IRQF_SHARED, MY_NAME, ctrl)) {
+	if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, IRQF_SHARED | IRQF_USER_DATA, MY_NAME, ctrl)) {
 		err("Can't get irq %d for the hotplug pci controller\n",
 			ctrl->interrupt);
 		rc = -ENODEV;
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index db047284c291..7f183f687201 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -1049,8 +1049,9 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev)
 			pci_set_master(pdev);
 		}
 
-		rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED,
-				 MY_NAME, (void *)ctrl);
+		rc = request_irq(ctrl->pci_dev->irq, shpc_isr,
+				 IRQF_SHARED | IRQF_USER_DATA, MY_NAME,
+				 (void *)ctrl);
 		ctrl_dbg(ctrl, "request_irq %d (returns %d)\n",
 			 ctrl->pci_dev->irq, rc);
 		if (rc) {
diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 0dbcf429089f..af231bd42113 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -335,7 +335,8 @@ static int pcie_pme_probe(struct pcie_device *srv)
 	pcie_pme_interrupt_enable(port, false);
 	pcie_clear_root_pme_status(port);
 
-	ret = request_irq(srv->irq, pcie_pme_irq, IRQF_SHARED, "PCIe PME", srv);
+	ret = request_irq(srv->irq, pcie_pme_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, "PCIe PME", srv);
 	if (ret) {
 		kfree(data);
 		return ret;
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index e22766c79fe9..55fbaa281a5d 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -1261,8 +1261,9 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
 		return event_irq;
 
 	rc = devm_request_irq(&stdev->pdev->dev, event_irq,
-				switchtec_event_isr, 0,
-				KBUILD_MODNAME, stdev);
+			      switchtec_event_isr,
+			      IRQF_USER_DATA, KBUILD_MODNAME,
+			      stdev);
 
 	if (rc)
 		return rc;
@@ -1279,8 +1280,9 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
 		return dma_mrpc_irq;
 
 	rc = devm_request_irq(&stdev->pdev->dev, dma_mrpc_irq,
-				switchtec_dma_mrpc_isr, 0,
-				KBUILD_MODNAME, stdev);
+			      switchtec_dma_mrpc_isr,
+			      IRQF_USER_DATA, KBUILD_MODNAME,
+			      stdev);
 
 	return rc;
 }
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index aae7e6df99cd..80f763adc42d 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -128,7 +128,7 @@ static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *i
 
 	/* Register the interrupt handler */
 	dprintk(KERN_DEBUG "Requesting interrupt %i \n",dev->irq);
-	if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED, "i82092aa", i82092aa_interrupt))) {
+	if ((ret = request_irq(dev->irq, i82092aa_interrupt, IRQF_SHARED | IRQF_USER_DATA, "i82092aa", i82092aa_interrupt))) {
 		printk(KERN_ERR "i82092aa: Failed to register IRQ %d, aborting\n", dev->irq);
 		goto err_out_free_res;
 	}
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 891ccea2cccb..9002327b582a 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -63,7 +63,7 @@
 static irqreturn_t i365_count_irq(int, void *);
 static inline int _check_irq(int irq, int flags)
 {
-    if (request_irq(irq, i365_count_irq, flags, "x", i365_count_irq) != 0)
+    if (request_irq(irq, i365_count_irq, flags | IRQF_USER_DATA, "x", i365_count_irq) != 0)
 	return -1;
     free_irq(irq, i365_count_irq);
     return 0;
@@ -489,8 +489,7 @@ static irqreturn_t i365_count_irq(int irq, void *dev)
 static u_int __init test_irq(u_short sock, int irq)
 {
     pr_debug("i82365:  testing ISA irq %d\n", irq);
-    if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
-			i365_count_irq) != 0)
+    if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED | IRQF_USER_DATA, "scan", i365_count_irq) != 0)
 	return 1;
     irq_hits = 0; irq_sock = sock;
     msleep(10);
@@ -1270,7 +1269,9 @@ static int __init init_i82365(void)
 
     /* Set up interrupt handler(s) */
     if (grab_irq != 0)
-	ret = request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
+	ret = request_irq(cs_irq, pcic_interrupt,
+                          IRQF_USER_DATA, "i82365",
+                          pcic_interrupt);
 
     if (ret)
 	goto err_socket_release;
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 99a778b022e5..96c292b616fa 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -702,8 +702,9 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
 	if (!p_dev->irq)
 		return -EINVAL;
 
-	ret = request_irq(p_dev->irq, handler, IRQF_SHARED | IRQF_USER_DATA,
-			p_dev->devname, p_dev->priv);
+	ret = request_irq(p_dev->irq, handler,
+			  IRQF_SHARED | IRQF_USER_DATA,
+			  p_dev->devname, p_dev->priv);
 	if (!ret)
 		p_dev->_irq = 1;
 
@@ -752,8 +753,8 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
 		/* register the correct driver, if possible, to check whether
 		 * registering a dummy handle works, i.e. if the IRQ isn't
 		 * marked as used by the kernel resource management core */
-		ret = request_irq(irq, test_action, type, p_dev->devname,
-				  p_dev);
+		ret = request_irq(irq, test_action, type | IRQF_USER_DATA,
+				  p_dev->devname, p_dev);
 		if (!ret) {
 			free_irq(irq, p_dev);
 			p_dev->irq = s->pcmcia_irq = irq;
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index f0af9985ca09..5af3986c642f 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -580,7 +580,8 @@ static int pd6729_check_irq(int irq)
 {
 	int ret;
 
-	ret = request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x",
+	ret = request_irq(irq, pd6729_test,
+			  IRQF_PROBE_SHARED | IRQF_USER_DATA, "x",
 			  pd6729_test);
 	if (ret)
 		return -1;
@@ -698,8 +699,9 @@ static int pd6729_pci_probe(struct pci_dev *dev,
 	pci_set_drvdata(dev, socket);
 	if (irq_mode == 1) {
 		/* Register the interrupt handler */
-		ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
-				  "pd6729", socket);
+		ret = request_irq(dev->irq, pd6729_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA, "pd6729",
+				  socket);
 		if (ret) {
 			dev_err(&dev->dev, "Failed to register irq %d\n",
 				dev->irq);
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 1a0e3f098759..666fae3cdedc 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -210,7 +210,7 @@ static u_int __init try_irq(int irq)
     u_short cfg;
 
     irq_hits = 0;
-    if (request_irq(irq, tcic_irq_count, 0, "irq scan", tcic_irq_count) != 0)
+    if (request_irq(irq, tcic_irq_count, IRQF_USER_DATA, "irq scan", tcic_irq_count) != 0)
 	return -1;
     mdelay(10);
     if (irq_hits) {
@@ -266,7 +266,7 @@ static u_int __init irq_scan(u_int mask0)
 	/* Fallback: just find interrupts that aren't in use */
 	for (i = 0; i < 16; i++)
 	    if ((mask0 & (1 << i)) &&
-		(request_irq(i, tcic_irq_count, 0, "x", tcic_irq_count) == 0)) {
+		(request_irq(i, tcic_irq_count, IRQF_USER_DATA, "x", tcic_irq_count) == 0)) {
 		mask1 |= (1 << i);
 		free_irq(i, tcic_irq_count);
 	    }
@@ -463,8 +463,7 @@ static int __init init_tcic(void)
 	u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
 	for (i = 15; i > 0; i--)
 	    if ((cs_mask & (1 << i)) &&
-		(request_irq(i, tcic_interrupt, 0, "tcic",
-			     tcic_interrupt) == 0))
+		(request_irq(i, tcic_interrupt, IRQF_USER_DATA, "tcic", tcic_interrupt) == 0))
 		break;
 	cs_irq = i;
 	if (cs_irq == 0) poll_interval = HZ;
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index ac6a3f46b1e6..c978a6961578 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -978,7 +978,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
 
 	socket->probe_status = 0;
 
-	if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED, "yenta", socket)) {
+	if (request_irq(socket->cb_irq, yenta_probe_handler, IRQF_SHARED | IRQF_USER_DATA, "yenta", socket)) {
 		dev_warn(&socket->dev->dev,
 			 "request_irq() in yenta_probe_cb_irq() failed!\n");
 		return -1;
@@ -1231,7 +1231,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	/* We must finish initialization here */
 
-	if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED, "yenta", socket)) {
+	if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED | IRQF_USER_DATA, "yenta", socket)) {
 		/* No IRQ or request_irq failed. Poll */
 		socket->cb_irq = 0; /* But zero is a valid IRQ number. */
 		timer_setup(&socket->poll_timer, yenta_interrupt_wrapper, 0);
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 3b1818184207..6e39197be8d8 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1192,7 +1192,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
 	 * controllers share the same interrupt line.
 	 */
 	ret = devm_request_irq(pctrl->dev, irq, intel_gpio_irq,
-			       IRQF_SHARED | IRQF_NO_THREAD,
+			       IRQF_SHARED | IRQF_NO_THREAD | IRQF_USER_DATA,
 			       dev_name(pctrl->dev), pctrl);
 	if (ret) {
 		dev_err(pctrl->dev, "failed to request interrupt\n");
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 2a7d638978d8..fbedf886439d 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -930,7 +930,8 @@ static int amd_gpio_probe(struct platform_device *pdev)
 		goto out2;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler, 0,
+	ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
+			       IRQF_USER_DATA,
 			       KBUILD_MODNAME, gpio_dev);
 	if (ret)
 		goto out2;
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 1e0614daee9b..0d46b75b16b5 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1567,8 +1567,7 @@ static int pcs_irq_init_chained_handler(struct pcs_device *pcs,
 		int res;
 
 		res = request_irq(pcs_soc->irq, pcs_irq_handler,
-				  IRQF_SHARED | IRQF_NO_SUSPEND |
-				  IRQF_NO_THREAD,
+				  IRQF_SHARED | IRQF_NO_SUSPEND | IRQF_NO_THREAD | IRQF_USER_DATA,
 				  name, pcs_soc);
 		if (res) {
 			pcs_soc->irq = -1;
diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index 321bc673c417..35c79464ca98 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -824,9 +824,9 @@ static int goldfish_pipe_device_init(struct platform_device *pdev,
 	tasklet_init(&dev->irq_tasklet, &goldfish_interrupt_task,
 		     (unsigned long)dev);
 
-	err = devm_request_irq(&pdev->dev, dev->irq,
-			       goldfish_pipe_interrupt,
-			       IRQF_SHARED, "goldfish_pipe", dev);
+	err = devm_request_irq(&pdev->dev, dev->irq, goldfish_pipe_interrupt,
+			       IRQF_SHARED | IRQF_USER_DATA, "goldfish_pipe",
+			       dev);
 	if (err) {
 		dev_err(&pdev->dev, "unable to allocate IRQ for v2\n");
 		return err;
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c
index b6d44550d98c..e31a659c6117 100644
--- a/drivers/platform/mellanox/mlxreg-hotplug.c
+++ b/drivers/platform/mellanox/mlxreg-hotplug.c
@@ -632,8 +632,9 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
 	priv->pdev = pdev;
 
 	err = devm_request_irq(&pdev->dev, priv->irq,
-			       mlxreg_hotplug_irq_handler, IRQF_TRIGGER_FALLING
-			       | IRQF_SHARED, "mlxreg-hotplug", priv);
+			       mlxreg_hotplug_irq_handler,
+			       IRQF_TRIGGER_FALLING | IRQF_SHARED | IRQF_USER_DATA,
+			       "mlxreg-hotplug", priv);
 	if (err) {
 		dev_err(&pdev->dev, "Failed to request irq: %d\n", err);
 		return err;
diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c
index baea077a02cc..9795095421a4 100644
--- a/drivers/platform/x86/fujitsu-tablet.c
+++ b/drivers/platform/x86/fujitsu-tablet.c
@@ -486,7 +486,8 @@ static int acpi_fujitsu_add(struct acpi_device *adev)
 	fujitsu_reset();
 
 	error = request_irq(fujitsu.irq, fujitsu_interrupt,
-			IRQF_SHARED, MODULENAME, fujitsu_interrupt);
+			    IRQF_SHARED | IRQF_USER_DATA, MODULENAME,
+			    fujitsu_interrupt);
 	if (error) {
 		release_region(fujitsu.io_base, fujitsu.io_length);
 		input_fujitsu_remove();
diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
index 4b8f7305fc8a..903ccf5f8d59 100644
--- a/drivers/platform/x86/intel_int0002_vgpio.c
+++ b/drivers/platform/x86/intel_int0002_vgpio.c
@@ -189,7 +189,7 @@ static int int0002_probe(struct platform_device *pdev)
 	 * to gpiochip_set_chained_irqchip, because the irq is shared.
 	 */
 	ret = devm_request_irq(dev, irq, int0002_irq,
-			       IRQF_SHARED, "INT0002", chip);
+			       IRQF_SHARED | IRQF_USER_DATA, "INT0002", chip);
 	if (ret) {
 		dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret);
 		return ret;
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index bffe548187ee..3b3847484fa4 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -1528,7 +1528,8 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	ips->irq = pci_irq_vector(dev, 0);
 
-	ret = request_irq(ips->irq, ips_irq_handler, IRQF_SHARED, "ips", ips);
+	ret = request_irq(ips->irq, ips_irq_handler,
+			  IRQF_SHARED | IRQF_USER_DATA, "ips", ips);
 	if (ret) {
 		dev_err(&dev->dev, "request irq failed, aborting\n");
 		return ret;
diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c
index 7964ba22ef8d..fc375bf0e49c 100644
--- a/drivers/platform/x86/intel_pmc_ipc.c
+++ b/drivers/platform/x86/intel_pmc_ipc.c
@@ -529,8 +529,9 @@ static int ipc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	pmc->ipc_base = pcim_iomap_table(pdev)[0];
 
-	ret = devm_request_irq(&pdev->dev, pdev->irq, ioc, 0, "intel_pmc_ipc",
-				pmc);
+	ret = devm_request_irq(&pdev->dev, pdev->irq, ioc,
+			       IRQF_USER_DATA,
+			       "intel_pmc_ipc", pmc);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to request irq\n");
 		return ret;
@@ -951,8 +952,7 @@ static int ipc_plat_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	if (devm_request_irq(&pdev->dev, ipcdev.irq, ioc, IRQF_NO_SUSPEND,
-			     "intel_pmc_ipc", &ipcdev)) {
+	if (devm_request_irq(&pdev->dev, ipcdev.irq, ioc, IRQF_NO_SUSPEND | IRQF_USER_DATA, "intel_pmc_ipc", &ipcdev)) {
 		dev_err(&pdev->dev, "Failed to request irq\n");
 		ret = -EBUSY;
 		goto err_irq;
diff --git a/drivers/platform/x86/intel_punit_ipc.c b/drivers/platform/x86/intel_punit_ipc.c
index 79671927f4ef..756eae04c544 100644
--- a/drivers/platform/x86/intel_punit_ipc.c
+++ b/drivers/platform/x86/intel_punit_ipc.c
@@ -299,8 +299,8 @@ static int intel_punit_ipc_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "Invalid IRQ, using polling mode\n");
 	} else {
 		ret = devm_request_irq(&pdev->dev, irq, intel_punit_ioc,
-				       IRQF_NO_SUSPEND, "intel_punit_ipc",
-				       &punit_ipcdev);
+				       IRQF_NO_SUSPEND | IRQF_USER_DATA,
+				       "intel_punit_ipc", &punit_ipcdev);
 		if (ret) {
 			dev_err(&pdev->dev, "Failed to request irq: %d\n", irq);
 			return ret;
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index cdab916fbf92..a7dd4d9c89cb 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -656,8 +656,9 @@ static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (!scu->i2c_base)
 		return -ENOMEM;
 
-	err = devm_request_irq(&pdev->dev, pdev->irq, ioc, 0, "intel_scu_ipc",
-			       scu);
+	err = devm_request_irq(&pdev->dev, pdev->irq, ioc,
+			       IRQF_USER_DATA,
+			       "intel_scu_ipc", scu);
 	if (err)
 		return err;
 
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index b205b037fd61..c83a8da216ce 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -4772,8 +4772,7 @@ static int sony_pic_add(struct acpi_device *device)
 
 	/* request IRQ */
 	list_for_each_entry_reverse(irq, &spic_dev.interrupts, list) {
-		if (!request_irq(irq->irq.interrupts[0], sony_pic_irq,
-					0, "sony-laptop", &spic_dev)) {
+		if (!request_irq(irq->irq.interrupts[0], sony_pic_irq, IRQF_USER_DATA, "sony-laptop", &spic_dev)) {
 			dprintk("IRQ: %d - triggering: %d - "
 					"polarity: %d - shr: %d\n",
 					irq->irq.interrupts[0],
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 70d4ba95735a..6fec093aa4ca 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -387,8 +387,7 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res)
 	/* check if the resource is already in use, skip if the
 	 * device is active because it itself may be in use */
 	if (!dev->active) {
-		if (request_irq(*irq, pnp_test_handler,
-				IRQF_PROBE_SHARED, "pnp", NULL))
+		if (request_irq(*irq, pnp_test_handler, IRQF_PROBE_SHARED | IRQF_USER_DATA, "pnp", NULL))
 			return 0;
 		free_irq(*irq, NULL);
 	}
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
index c484584745bc..ec581ff897f5 100644
--- a/drivers/power/reset/ltc2952-poweroff.c
+++ b/drivers/power/reset/ltc2952-poweroff.c
@@ -214,11 +214,7 @@ static int ltc2952_poweroff_init(struct platform_device *pdev)
 		data->gpio_trigger = NULL;
 	}
 
-	if (devm_request_irq(&pdev->dev, gpiod_to_irq(data->gpio_trigger),
-			     ltc2952_poweroff_handler,
-			     (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING),
-			     "ltc2952-poweroff",
-			     data)) {
+	if (devm_request_irq(&pdev->dev, gpiod_to_irq(data->gpio_trigger), ltc2952_poweroff_handler, (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING) | IRQF_USER_DATA, "ltc2952-poweroff", data)) {
 		/*
 		 * Some things may have happened:
 		 * - No trigger input was defined
diff --git a/drivers/power/supply/act8945a_charger.c b/drivers/power/supply/act8945a_charger.c
index 8e117b31ba79..b68b9d759667 100644
--- a/drivers/power/supply/act8945a_charger.c
+++ b/drivers/power/supply/act8945a_charger.c
@@ -496,7 +496,7 @@ static int act8945a_charger_config(struct device *dev,
 
 	ret = devm_request_irq(dev, gpiod_to_irq(charger->lbo_gpio),
 			       act8945a_status_changed,
-			       (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING),
+			       (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING) | IRQF_USER_DATA,
 			       "act8945a_lbo_detect", charger);
 	if (ret)
 		dev_info(dev, "failed to request gpio \"lbo\" IRQ\n");
@@ -602,8 +602,8 @@ static int act8945a_charger_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, act8945a_status_changed,
-			       IRQF_TRIGGER_FALLING, "act8945a_interrupt",
-			       charger);
+			       IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+			       "act8945a_interrupt", charger);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request nIRQ pin IRQ\n");
 		return ret;
diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
index f5c525e4482a..643bf6abcd30 100644
--- a/drivers/power/supply/goldfish_battery.c
+++ b/drivers/power/supply/goldfish_battery.c
@@ -193,8 +193,9 @@ static int goldfish_battery_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	ret = devm_request_irq(&pdev->dev, data->irq, goldfish_battery_interrupt,
-						IRQF_SHARED, pdev->name, data);
+	ret = devm_request_irq(&pdev->dev, data->irq,
+			       goldfish_battery_interrupt,
+			       IRQF_SHARED | IRQF_USER_DATA, pdev->name, data);
 	if (ret)
 		return ret;
 
diff --git a/drivers/power/supply/max14656_charger_detector.c b/drivers/power/supply/max14656_charger_detector.c
index b91b1d2999dc..e73ba28edb50 100644
--- a/drivers/power/supply/max14656_charger_detector.c
+++ b/drivers/power/supply/max14656_charger_detector.c
@@ -281,7 +281,7 @@ static int max14656_probe(struct i2c_client *client,
 	INIT_DELAYED_WORK(&chip->irq_work, max14656_irq_worker);
 
 	ret = devm_request_irq(dev, chip->irq, max14656_irq,
-			       IRQF_TRIGGER_FALLING,
+			       IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
 			       MAX14656_NAME, chip);
 	if (ret) {
 		dev_err(dev, "request_irq %d failed\n", chip->irq);
diff --git a/drivers/power/supply/pda_power.c b/drivers/power/supply/pda_power.c
index 922a86787c5c..b7e8d8f5863f 100644
--- a/drivers/power/supply/pda_power.c
+++ b/drivers/power/supply/pda_power.c
@@ -340,8 +340,8 @@ static int pda_power_probe(struct platform_device *pdev)
 
 		if (ac_irq) {
 			ret = request_irq(ac_irq->start, power_changed_isr,
-					  get_irq_flags(ac_irq), ac_irq->name,
-					  pda_psy_ac);
+					  get_irq_flags(ac_irq) | IRQF_USER_DATA,
+					  ac_irq->name, pda_psy_ac);
 			if (ret) {
 				dev_err(dev, "request ac irq failed\n");
 				goto ac_irq_failed;
@@ -364,7 +364,7 @@ static int pda_power_probe(struct platform_device *pdev)
 
 		if (usb_irq) {
 			ret = request_irq(usb_irq->start, power_changed_isr,
-					  get_irq_flags(usb_irq),
+					  get_irq_flags(usb_irq) | IRQF_USER_DATA,
 					  usb_irq->name, pda_psy_usb);
 			if (ret) {
 				dev_err(dev, "request usb irq failed\n");
diff --git a/drivers/power/supply/wm97xx_battery.c b/drivers/power/supply/wm97xx_battery.c
index 6754e761778a..246830c06e3b 100644
--- a/drivers/power/supply/wm97xx_battery.c
+++ b/drivers/power/supply/wm97xx_battery.c
@@ -183,8 +183,9 @@ static int wm97xx_bat_probe(struct platform_device *dev)
 		if (ret)
 			goto err2;
 		ret = request_irq(gpio_to_irq(pdata->charge_gpio),
-				wm97xx_chrg_irq, 0,
-				"AC Detect", dev);
+				  wm97xx_chrg_irq,
+				  IRQF_USER_DATA,
+				  "AC Detect", dev);
 		if (ret)
 			goto err2;
 		props++;	/* POWER_SUPPLY_PROP_STATUS */
diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c
index dd5d1103e02b..a59a6e2545c3 100644
--- a/drivers/pps/clients/pps-gpio.c
+++ b/drivers/pps/clients/pps-gpio.c
@@ -166,7 +166,8 @@ static int pps_gpio_probe(struct platform_device *pdev)
 
 	/* register IRQ interrupt handler */
 	ret = devm_request_irq(&pdev->dev, data->irq, pps_gpio_irq_handler,
-			get_irqf_trigger_flags(data), data->info.name, data);
+			       get_irqf_trigger_flags(data) | IRQF_USER_DATA,
+			       data->info.name, data);
 	if (ret) {
 		pps_unregister_source(data->pps);
 		dev_err(&pdev->dev, "failed to acquire IRQ %d\n", data->irq);
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 78ccf936d356..cf4832a54862 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -633,7 +633,8 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	spin_lock_init(&chip->register_lock);
 
-	ret = request_irq(pdev->irq, &isr, IRQF_SHARED, KBUILD_MODNAME, chip);
+	ret = request_irq(pdev->irq, &isr, IRQF_SHARED | IRQF_USER_DATA,
+			  KBUILD_MODNAME, chip);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "failed to get irq %d\n", pdev->irq);
 		goto err_req_irq;
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index b64c56c33c3b..d22a80107b24 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -708,14 +708,15 @@ static int tsi721_request_msix(struct tsi721_device *priv)
 	int err = 0;
 
 	err = request_irq(priv->msix[TSI721_VECT_IDB].vector,
-			tsi721_sr2pc_ch_msix, 0,
-			priv->msix[TSI721_VECT_IDB].irq_name, (void *)priv);
+			  tsi721_sr2pc_ch_msix,
+			  IRQF_USER_DATA,
+			  priv->msix[TSI721_VECT_IDB].irq_name, (void *)priv);
 	if (err)
 		return err;
 
 	err = request_irq(priv->msix[TSI721_VECT_PWRX].vector,
-			tsi721_srio_msix, 0,
-			priv->msix[TSI721_VECT_PWRX].irq_name, (void *)priv);
+			  tsi721_srio_msix, IRQF_USER_DATA,
+			  priv->msix[TSI721_VECT_PWRX].irq_name, (void *)priv);
 	if (err) {
 		free_irq(priv->msix[TSI721_VECT_IDB].vector, (void *)priv);
 		return err;
@@ -844,8 +845,8 @@ static int tsi721_request_irq(struct tsi721_device *priv)
 	else
 #endif
 		err = request_irq(priv->pdev->irq, tsi721_irqhandler,
-			  (priv->flags & TSI721_USING_MSI) ? 0 : IRQF_SHARED,
-			  DRV_NAME, (void *)priv);
+				  ((priv->flags & TSI721_USING_MSI) ? 0 : IRQF_SHARED) | IRQF_USER_DATA,
+				  DRV_NAME, (void *)priv);
 
 	if (err)
 		tsi_err(&priv->pdev->dev,
@@ -1977,7 +1978,8 @@ static int tsi721_open_outb_mbox(struct rio_mport *mport, void *dev_id,
 		int idx = TSI721_VECT_OMB0_DONE + mbox;
 
 		/* Request interrupt service if we are in MSI-X mode */
-		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc) {
@@ -1988,7 +1990,8 @@ static int tsi721_open_outb_mbox(struct rio_mport *mport, void *dev_id,
 		}
 
 		idx = TSI721_VECT_OMB0_INT + mbox;
-		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_omsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc)	{
@@ -2292,7 +2295,8 @@ static int tsi721_open_inb_mbox(struct rio_mport *mport, void *dev_id,
 		int idx = TSI721_VECT_IMB0_RCV + mbox;
 
 		/* Request interrupt service if we are in MSI-X mode */
-		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc) {
@@ -2303,7 +2307,8 @@ static int tsi721_open_inb_mbox(struct rio_mport *mport, void *dev_id,
 		}
 
 		idx = TSI721_VECT_IMB0_INT + mbox;
-		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_imsg_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)priv);
 
 		if (rc)	{
diff --git a/drivers/rapidio/devices/tsi721_dma.c b/drivers/rapidio/devices/tsi721_dma.c
index 7f5d4436f594..f932701225df 100644
--- a/drivers/rapidio/devices/tsi721_dma.c
+++ b/drivers/rapidio/devices/tsi721_dma.c
@@ -161,7 +161,8 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
 
 		idx = TSI721_VECT_DMA0_DONE + bdma_chan->id;
 
-		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix, 0,
+		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix,
+				 IRQF_USER_DATA,
 				 priv->msix[idx].irq_name, (void *)bdma_chan);
 
 		if (rc) {
@@ -173,8 +174,9 @@ static int tsi721_bdma_ch_init(struct tsi721_bdma_chan *bdma_chan, int bd_num)
 
 		idx = TSI721_VECT_DMA0_INT + bdma_chan->id;
 
-		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix, 0,
-				priv->msix[idx].irq_name, (void *)bdma_chan);
+		rc = request_irq(priv->msix[idx].vector, tsi721_bdma_msix,
+				 IRQF_USER_DATA,
+				 priv->msix[idx].irq_name, (void *)bdma_chan);
 
 		if (rc)	{
 			tsi_debug(DMA, &bdma_chan->dchan.dev->device,
diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 53a61fb65642..28c1b169330e 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -1584,8 +1584,9 @@ static int spmi_regulator_of_parse(struct device_node *node,
 
 	if (vreg->ocp_irq) {
 		ret = devm_request_irq(dev, vreg->ocp_irq,
-			spmi_regulator_vs_ocp_isr, IRQF_TRIGGER_RISING, "ocp",
-			vreg);
+				       spmi_regulator_vs_ocp_isr,
+				       IRQF_TRIGGER_RISING | IRQF_USER_DATA,
+				       "ocp", vreg);
 		if (ret < 0) {
 			dev_err(dev, "failed to request irq %d, ret=%d\n",
 				vreg->ocp_irq, ret);
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index f46c787733e8..c72229a2fc80 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -1588,9 +1588,8 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev,
 	}
 
 	irq = of_irq_get(dev->of_node, 0);
-	ret = devm_request_irq(dev, irq,
-			       qcom_glink_native_intr,
-			       IRQF_NO_SUSPEND | IRQF_SHARED,
+	ret = devm_request_irq(dev, irq, qcom_glink_native_intr,
+			       IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_USER_DATA,
 			       "glink-native", glink);
 	if (ret) {
 		dev_err(dev, "failed to request IRQ\n");
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index a5a19ff10535..81380c3b3fa7 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -854,8 +854,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 			rtc_cmos_int_handler = cmos_interrupt;
 
 		retval = request_irq(rtc_irq, rtc_cmos_int_handler,
-				IRQF_SHARED, dev_name(&cmos_rtc.rtc->dev),
-				cmos_rtc.rtc);
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     dev_name(&cmos_rtc.rtc->dev),
+				     cmos_rtc.rtc);
 		if (retval < 0) {
 			dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq);
 			goto cleanup1;
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c
index 2d502fc85698..5ab3759914e8 100644
--- a/drivers/rtc/rtc-ds1305.c
+++ b/drivers/rtc/rtc-ds1305.c
@@ -719,7 +719,8 @@ static int ds1305_probe(struct spi_device *spi)
 	if (spi->irq) {
 		INIT_WORK(&ds1305->work, ds1305_work);
 		status = devm_request_irq(&spi->dev, spi->irq, ds1305_irq,
-				0, dev_name(&ds1305->rtc->dev), ds1305);
+					  IRQF_USER_DATA,
+					  dev_name(&ds1305->rtc->dev), ds1305);
 		if (status < 0) {
 			dev_err(&spi->dev, "request_irq %d --> %d\n",
 					spi->irq, status);
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 38a2e9e684df..9c5bd44571c2 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -631,8 +631,9 @@ static int ds1374_probe(struct i2c_client *client,
 		return ret;
 
 	if (client->irq > 0) {
-		ret = devm_request_irq(&client->dev, client->irq, ds1374_irq, 0,
-					"ds1374", client);
+		ret = devm_request_irq(&client->dev, client->irq, ds1374_irq,
+				       IRQF_USER_DATA,
+				       "ds1374", client);
 		if (ret) {
 			dev_err(&client->dev, "unable to request IRQ\n");
 			return ret;
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index b8b6e51c0461..c90343e4cc65 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -485,8 +485,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev)
 	 */
 	if (pdata->irq > 0) {
 		rtc_read(RTC_CMD1);
-		if (devm_request_irq(&pdev->dev, pdata->irq, ds1511_interrupt,
-			IRQF_SHARED, pdev->name, pdev) < 0) {
+		if (devm_request_irq(&pdev->dev, pdata->irq, ds1511_interrupt, IRQF_SHARED | IRQF_USER_DATA, pdev->name, pdev) < 0) {
 
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c
index 34af7a802f43..c69b0b48991e 100644
--- a/drivers/rtc/rtc-ds1553.c
+++ b/drivers/rtc/rtc-ds1553.c
@@ -307,9 +307,7 @@ static int ds1553_rtc_probe(struct platform_device *pdev)
 
 	if (pdata->irq > 0) {
 		writeb(0, ioaddr + RTC_INTERRUPTS);
-		if (devm_request_irq(&pdev->dev, pdata->irq,
-				ds1553_rtc_interrupt,
-				0, pdev->name, pdev) < 0) {
+		if (devm_request_irq(&pdev->dev, pdata->irq, ds1553_rtc_interrupt, IRQF_USER_DATA, pdev->name, pdev) < 0) {
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
 		}
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index 2710f2594c42..dc856f4fb7cb 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -1341,7 +1341,8 @@ ds1685_rtc_probe(struct platform_device *pdev)
 			/* Request an IRQ. */
 			ret = devm_request_irq(&pdev->dev, rtc->irq_num,
 					       ds1685_rtc_irq_handler,
-					       IRQF_SHARED, pdev->name, pdev);
+					       IRQF_SHARED | IRQF_USER_DATA,
+					       pdev->name, pdev);
 
 			/* Check to see if something came back. */
 			if (unlikely(ret)) {
diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index 8f1dd88fa827..a7536520d481 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -181,7 +181,7 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
 	rtc->rtc_dev->range_max = U32_MAX + rtc->rtc_dev->range_min;
 
 	ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
-			       IRQF_SHARED, pdev->name, dev);
+			       IRQF_SHARED | IRQF_USER_DATA, pdev->name, dev);
 	if (unlikely(ret))
 		return ret;
 
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index 3c8ad1cdfd7c..5566f0a56d54 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -436,8 +436,9 @@ static int m48t59_rtc_probe(struct platform_device *pdev)
 
 	if (m48t59->irq != NO_IRQ) {
 		ret = devm_request_irq(&pdev->dev, m48t59->irq,
-				m48t59_rtc_interrupt, IRQF_SHARED,
-				"rtc-m48t59", &pdev->dev);
+				       m48t59_rtc_interrupt,
+				       IRQF_SHARED | IRQF_USER_DATA,
+				       "rtc-m48t59", &pdev->dev);
 		if (ret)
 			return ret;
 	}
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index daf354a6a853..01264ed17b08 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -356,7 +356,8 @@ static int vrtc_mrst_do_probe(struct device *dev, struct resource *iomem,
 
 	if (rtc_irq) {
 		retval = devm_request_irq(dev, rtc_irq, mrst_rtc_irq,
-					  0, dev_name(&mrst_rtc.rtc->dev),
+					  IRQF_USER_DATA,
+					  dev_name(&mrst_rtc.rtc->dev),
 					  mrst_rtc.rtc);
 		if (retval < 0) {
 			dev_dbg(dev, "IRQ %d is already in use, err %d\n",
diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c
index f176cb9d0dbc..2dd631d5f5b1 100644
--- a/drivers/rtc/rtc-pcap.c
+++ b/drivers/rtc/rtc-pcap.c
@@ -157,13 +157,15 @@ static int __init pcap_rtc_probe(struct platform_device *pdev)
 	timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ);
 	alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA);
 
-	err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq, 0,
-				"RTC Timer", pcap_rtc);
+	err = devm_request_irq(&pdev->dev, timer_irq, pcap_rtc_irq,
+			       IRQF_USER_DATA, "RTC Timer",
+			       pcap_rtc);
 	if (err)
 		return err;
 
-	err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq, 0,
-				"RTC Alarm", pcap_rtc);
+	err = devm_request_irq(&pdev->dev, alarm_irq, pcap_rtc_irq,
+			       IRQF_USER_DATA, "RTC Alarm",
+			       pcap_rtc);
 	if (err)
 		return err;
 
diff --git a/drivers/rtc/rtc-r7301.c b/drivers/rtc/rtc-r7301.c
index 1943c8151152..f4f87345ecc7 100644
--- a/drivers/rtc/rtc-r7301.c
+++ b/drivers/rtc/rtc-r7301.c
@@ -392,7 +392,8 @@ static int __init rtc7301_rtc_probe(struct platform_device *dev)
 
 	if (priv->irq > 0) {
 		ret = devm_request_irq(&dev->dev, priv->irq,
-				       rtc7301_irq_handler, IRQF_SHARED,
+				       rtc7301_irq_handler,
+				       IRQF_SHARED | IRQF_USER_DATA,
 				       dev_name(&dev->dev), rtc);
 		if (ret) {
 			priv->irq = 0;
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index b2483a749ac4..4bc1edff3c85 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -328,7 +328,8 @@ static int snvs_rtc_probe(struct platform_device *pdev)
 	device_init_wakeup(&pdev->dev, true);
 
 	ret = devm_request_irq(&pdev->dev, data->irq, snvs_rtc_irq_handler,
-			       IRQF_SHARED, "rtc alarm", &pdev->dev);
+			       IRQF_SHARED | IRQF_USER_DATA, "rtc alarm",
+			       &pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request irq %d: %d\n",
 			data->irq, ret);
diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
index fccbecbb2c98..62deb2c871fa 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -302,10 +302,7 @@ static int stk17ta8_rtc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pdata);
 	if (pdata->irq > 0) {
 		writeb(0, ioaddr + RTC_INTERRUPTS);
-		if (devm_request_irq(&pdev->dev, pdata->irq,
-				stk17ta8_rtc_interrupt,
-				IRQF_SHARED,
-				pdev->name, pdev) < 0) {
+		if (devm_request_irq(&pdev->dev, pdata->irq, stk17ta8_rtc_interrupt, IRQF_SHARED | IRQF_USER_DATA, pdev->name, pdev) < 0) {
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
 		}
diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index c532bd13fbe5..e7687aa8ed3a 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -234,7 +234,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
 		return xrtcdev->alarm_irq;
 	}
 	ret = devm_request_irq(&pdev->dev, xrtcdev->alarm_irq,
-			       xlnx_rtc_interrupt, 0,
+			       xlnx_rtc_interrupt,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), xrtcdev);
 	if (ret) {
 		dev_err(&pdev->dev, "request irq failed\n");
@@ -247,7 +248,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
 		return xrtcdev->sec_irq;
 	}
 	ret = devm_request_irq(&pdev->dev, xrtcdev->sec_irq,
-			       xlnx_rtc_interrupt, 0,
+			       xlnx_rtc_interrupt,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), xrtcdev);
 	if (ret) {
 		dev_err(&pdev->dev, "request irq failed\n");
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index a3c20e3a8b7c..73d42056212c 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2116,7 +2116,8 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 		set_bit(TW_USING_MSI, &tw_dev->flags);
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
+	retval = request_irq(pdev->irq, twa_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-9xxx", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x30, "Error requesting IRQ");
 		goto out_remove_host;
@@ -2254,7 +2255,8 @@ static int twa_resume(struct pci_dev *pdev)
 	}
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
+	retval = request_irq(pdev->irq, twa_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-9xxx", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x42, "Error requesting IRQ during resume");
 		retval = -ENODEV;
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index cd096104bcec..11306ca378b5 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -1662,7 +1662,8 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 		set_bit(TW_USING_MSI, &tw_dev->flags);
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twl_interrupt, IRQF_SHARED, "3w-sas", tw_dev);
+	retval = request_irq(pdev->irq, twl_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-sas", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1f, "Error requesting IRQ");
 		goto out_remove_host;
@@ -1819,7 +1820,8 @@ static int twl_resume(struct pci_dev *pdev)
 	}
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, twl_interrupt, IRQF_SHARED, "3w-sas", tw_dev);
+	retval = request_irq(pdev->irq, twl_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-sas", tw_dev);
 	if (retval) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x26, "Error requesting IRQ during resume");
 		retval = -ENODEV;
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 2b1e0d503020..86eca9664b53 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2333,7 +2333,8 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
 	printk(KERN_WARNING "3w-xxxx: scsi%d: Found a 3ware Storage Controller at 0x%x, IRQ: %d.\n", host->host_no, tw_dev->base_addr, pdev->irq);
 
 	/* Now setup the interrupt handler */
-	retval = request_irq(pdev->irq, tw_interrupt, IRQF_SHARED, "3w-xxxx", tw_dev);
+	retval = request_irq(pdev->irq, tw_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "3w-xxxx", tw_dev);
 	if (retval) {
 		printk(KERN_WARNING "3w-xxxx: Error requesting IRQ.");
 		goto out_remove_host;
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index e41e51f1da71..66e8231fb283 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -1994,8 +1994,7 @@ static bool __init blogic_getres(struct blogic_adapter *adapter)
 	/*
 	   Acquire shared access to the IRQ Channel.
 	 */
-	if (request_irq(adapter->irq_ch, blogic_inthandler, IRQF_SHARED,
-				adapter->full_model, adapter) < 0) {
+	if (request_irq(adapter->irq_ch, blogic_inthandler, IRQF_SHARED | IRQF_USER_DATA, adapter->full_model, adapter) < 0) {
 		blogic_err("UNABLE TO ACQUIRE IRQ CHANNEL %d - DETACHING\n",
 				adapter, adapter->irq_ch);
 		return false;
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 66c514310f3c..263408266f10 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -1158,8 +1158,8 @@ static int inia100_probe_one(struct pci_dev *pdev,
 	shost->sg_tablesize = TOTAL_SG_ENTRY;
 
 	/* Initial orc chip           */
-	error = request_irq(pdev->irq, inia100_intr, IRQF_SHARED,
-			"inia100", shost);
+	error = request_irq(pdev->irq, inia100_intr,
+			    IRQF_SHARED | IRQF_USER_DATA, "inia100", shost);
 	if (error < 0) {
 		printk(KERN_WARNING "inia100: unable to get irq %d\n",
 				pdev->irq);
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index d5a6aa9676c8..eadd3bf6119a 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -2553,9 +2553,7 @@ int aac_acquire_irq(struct aac_dev *dev)
 		for (i = 0; i < dev->max_msix; i++) {
 			dev->aac_msix[i].vector_no = i;
 			dev->aac_msix[i].dev = dev;
-			if (request_irq(pci_irq_vector(dev->pdev, i),
-					dev->a_ops.adapter_intr,
-					0, "aacraid", &(dev->aac_msix[i]))) {
+			if (request_irq(pci_irq_vector(dev->pdev, i), dev->a_ops.adapter_intr, IRQF_USER_DATA, "aacraid", &(dev->aac_msix[i]))) {
 				printk(KERN_ERR "%s%d: Failed to register IRQ for vector %d.\n",
 						dev->name, dev->id, i);
 				for (j = 0 ; j < i ; j++)
@@ -2569,9 +2567,7 @@ int aac_acquire_irq(struct aac_dev *dev)
 		dev->aac_msix[0].vector_no = 0;
 		dev->aac_msix[0].dev = dev;
 
-		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid",
-			&(dev->aac_msix[0])) < 0) {
+		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", &(dev->aac_msix[0])) < 0) {
 			if (dev->msi)
 				pci_disable_msi(dev->pdev);
 			printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 576cdf9cc120..6bb11613c7e4 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -649,8 +649,7 @@ int _aac_rx_init(struct aac_dev *dev)
 	aac_adapter_comm(dev, dev->comm_interface);
 	dev->sync_mode = 0;	/* sync. mode not supported */
 	dev->msi = aac_msi && !pci_enable_msi(dev->pdev);
-	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid", dev) < 0) {
+	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", dev) < 0) {
 		if (dev->msi)
 			pci_disable_msi(dev->pdev);
 		printk(KERN_ERR "%s%d: Interrupt unavailable.\n",
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index efa96c1c6aa3..1bc3c4c93852 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -388,8 +388,7 @@ int aac_sa_init(struct aac_dev *dev)
 	if(aac_init_adapter(dev) == NULL)
 		goto error_irq;
 	dev->sync_mode = 0;	/* sync. mode not supported */
-	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid", (void *)dev) < 0) {
+	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", (void *)dev) < 0) {
 		printk(KERN_WARNING "%s%d: Interrupt unavailable.\n",
 			name, instance);
 		goto error_iounmap;
diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 8377aec0649d..113e5e95c507 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -986,8 +986,7 @@ int aac_src_init(struct aac_dev *dev)
 	dev->aac_msix[0].vector_no = 0;
 	dev->aac_msix[0].dev = dev;
 
-	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
-			IRQF_SHARED, "aacraid", &(dev->aac_msix[0]))  < 0) {
+	if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, IRQF_SHARED | IRQF_USER_DATA, "aacraid", &(dev->aac_msix[0]))  < 0) {
 
 		if (dev->msi)
 			pci_disable_msi(dev->pdev);
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index d37584403c33..1dc63c240c0d 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -11298,8 +11298,8 @@ static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop,
 	/* Register IRQ Number. */
 	ASC_DBG(2, "request_irq(%d, %p)\n", boardp->irq, shost);
 
-	ret = request_irq(boardp->irq, advansys_interrupt, share_irq,
-			  DRV_NAME, shost);
+	ret = request_irq(boardp->irq, advansys_interrupt,
+			  share_irq | IRQF_USER_DATA, DRV_NAME, shost);
 
 	if (ret) {
 		if (ret == -EBUSY) {
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 97872838b983..820af5a16dac 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -798,7 +798,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 	SETPORT(SIMODE0, 0);
 	SETPORT(SIMODE1, 0);
 
-	if (request_irq(shpnt->irq, swintr, IRQF_SHARED, "aha152x", shpnt)) {
+	if (request_irq(shpnt->irq, swintr, IRQF_SHARED | IRQF_USER_DATA, "aha152x", shpnt)) {
 		printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq);
 		goto out_host_put;
 	}
@@ -832,7 +832,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 	SETPORT(SSTAT0, 0x7f);
 	SETPORT(SSTAT1, 0xef);
 
-	if (request_irq(shpnt->irq, intr, IRQF_SHARED, "aha152x", shpnt)) {
+	if (request_irq(shpnt->irq, intr, IRQF_SHARED | IRQF_USER_DATA, "aha152x", shpnt)) {
 		printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq);
 		goto out_host_put;
 	}
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index ba7a5725be04..4e2a66982248 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -782,7 +782,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct
 
 	setup_mailboxes(sh);
 
-	if (request_irq(sh->irq, aha1542_interrupt, 0, "aha1542", sh)) {
+	if (request_irq(sh->irq, aha1542_interrupt, IRQF_USER_DATA, "aha1542", sh)) {
 		shost_printk(KERN_ERR, sh, "Unable to allocate IRQ.\n");
 		goto free_ccb;
 	}
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index da4150c17781..06da04ed2b28 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -597,8 +597,7 @@ static int aha1740_probe (struct device *dev)
 	}
 	
 	DEB(printk("aha1740_probe: enable interrupt channel %d\n",irq_level));
-	if (request_irq(irq_level,aha1740_intr_handle,irq_type ? 0 : IRQF_SHARED,
-			"aha1740",shpnt)) {
+	if (request_irq(irq_level, aha1740_intr_handle, (irq_type ? 0 : IRQF_SHARED) | IRQF_USER_DATA, "aha1740", shpnt)) {
 		printk(KERN_ERR "aha1740_probe: Unable to allocate IRQ %d.\n",
 		       irq_level);
 		goto err_unmap;
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c
index 3d401d02c019..5a1190313f68 100644
--- a/drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/drivers/scsi/aic7xxx/aic7770_osm.c
@@ -67,7 +67,8 @@ aic7770_map_int(struct ahc_softc *ahc, u_int irq)
 	if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0)
 		shared = IRQF_SHARED;
 
-	error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc);
+	error = request_irq(irq, ahc_linux_isr, shared | IRQF_USER_DATA,
+			    "aic7xxx", ahc);
 	if (error == 0)
 		ahc->platform_data->irq = irq;
 	
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
index 8466aa784ec1..be821365298d 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
@@ -383,7 +383,7 @@ ahd_pci_map_int(struct ahd_softc *ahd)
 	int error;
 
 	error = request_irq(ahd->dev_softc->irq, ahd_linux_isr,
-			    IRQF_SHARED, "aic79xx", ahd);
+			    IRQF_SHARED | IRQF_USER_DATA, "aic79xx", ahd);
 	if (!error)
 		ahd->platform_data->irq = ahd->dev_softc->irq;
 	
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 0fc14dac7070..867ada06c334 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -461,7 +461,7 @@ ahc_pci_map_int(struct ahc_softc *ahc)
 	int error;
 
 	error = request_irq(ahc->dev_softc->irq, ahc_linux_isr,
-			    IRQF_SHARED, "aic7xxx", ahc);
+			    IRQF_SHARED | IRQF_USER_DATA, "aic7xxx", ahc);
 	if (error == 0)
 		ahc->platform_data->irq = ahc->dev_softc->irq;
 	
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 07efcb9b5b94..f1d5d9b14d2f 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -804,8 +804,9 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (use_msi)
 		pci_enable_msi(asd_ha->pcidev);
 
-	err = request_irq(asd_ha->pcidev->irq, asd_hw_isr, IRQF_SHARED,
-			  ASD_DRIVER_NAME, asd_ha);
+	err = request_irq(asd_ha->pcidev->irq, asd_hw_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, ASD_DRIVER_NAME,
+			  asd_ha);
 	if (err) {
 		asd_printk("couldn't get irq %d for %s\n",
 			   asd_ha->pcidev->irq, pci_name(asd_ha->pcidev));
diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c
index 27c0a4a937d9..b6778db02433 100644
--- a/drivers/scsi/am53c974.c
+++ b/drivers/scsi/am53c974.c
@@ -448,8 +448,8 @@ static int pci_esp_probe_one(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, pep);
 
-	err = request_irq(pdev->irq, scsi_esp_intr, IRQF_SHARED,
-			  DRV_MODULE_NAME, esp);
+	err = request_irq(pdev->irq, scsi_esp_intr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_MODULE_NAME, esp);
 	if (err < 0) {
 		dev_printk(KERN_ERR, &pdev->dev, "failed to register IRQ\n");
 		goto fail_unmap_command_block;
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 57c6fa388bf6..eaf5b63c8023 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -860,8 +860,7 @@ arcmsr_request_irq(struct pci_dev *pdev, struct AdapterControlBlock *acb)
 
 	acb->vector_count = nvec;
 	for (i = 0; i < nvec; i++) {
-		if (request_irq(pci_irq_vector(pdev, i), arcmsr_do_interrupt,
-				flags, "arcmsr", acb)) {
+		if (request_irq(pci_irq_vector(pdev, i), arcmsr_do_interrupt, flags | IRQF_USER_DATA, "arcmsr", acb)) {
 			pr_warn("arcmsr%d: request_irq =%d failed!\n",
 				acb->host->host_no, pci_irq_vector(pdev, i));
 			goto out_free_irq;
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 1267200380f8..9a31e1ad82b7 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -1551,7 +1551,8 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	else
 		atp870_init(shpnt);
 
-	err = request_irq(shpnt->irq, atp870u_intr_handle, IRQF_SHARED, "atp870u", shpnt);
+	err = request_irq(shpnt->irq, atp870u_intr_handle,
+			  IRQF_SHARED | IRQF_USER_DATA, "atp870u", shpnt);
 	if (err) {
 		dev_err(&pdev->dev, "Unable to allocate IRQ %d.\n", shpnt->irq);
 		goto free_tables;
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 74e260027c7d..b2a797b4aac1 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -821,7 +821,9 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
 			}
 
 			ret = request_irq(pci_irq_vector(pcidev, i),
-					  be_isr_msix, 0, phba->msi_name[i],
+					  be_isr_msix,
+					  IRQF_USER_DATA,
+					  phba->msi_name[i],
 					  &phwi_context->be_eq[i]);
 			if (ret) {
 				beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
@@ -838,7 +840,8 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
 			ret = -ENOMEM;
 			goto free_msix_irqs;
 		}
-		ret = request_irq(pci_irq_vector(pcidev, i), be_isr_mcc, 0,
+		ret = request_irq(pci_irq_vector(pcidev, i), be_isr_mcc,
+				  IRQF_USER_DATA,
 				  phba->msi_name[i], &phwi_context->be_eq[i]);
 		if (ret) {
 			beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT ,
@@ -849,8 +852,9 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
 		}
 
 	} else {
-		ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED,
-				  "beiscsi", phba);
+		ret = request_irq(pcidev->irq, be_isr,
+				  IRQF_SHARED | IRQF_USER_DATA, "beiscsi",
+				  phba);
 		if (ret) {
 			beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 				    "BM_%d : beiscsi_init_irqs-"
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 42a0caf6740d..26c1ac916d6c 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1177,8 +1177,10 @@ bfad_install_msix_handler(struct bfad_s *bfad)
 				msix_name_cb[i] : msix_name_ct[i]));
 
 		error = request_irq(bfad->msix_tab[i].msix.vector,
-				    (irq_handler_t) bfad_msix, 0,
-				    bfad->msix_tab[i].name, &bfad->msix_tab[i]);
+				    (irq_handler_t)bfad_msix,
+				    IRQF_USER_DATA,
+				    bfad->msix_tab[i].name,
+				    &bfad->msix_tab[i]);
 		bfa_trc(bfad, i);
 		bfa_trc(bfad, bfad->msix_tab[i].msix.vector);
 		if (error) {
@@ -1261,7 +1263,8 @@ bfad_setup_intr(struct bfad_s *bfad)
 
 line_based:
 	error = request_irq(bfad->pcidev->irq, (irq_handler_t)bfad_intx,
-			    BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
+			    BFAD_IRQ_FLAGS | IRQF_USER_DATA, BFAD_DRIVER_NAME,
+			    bfad);
 	if (error)
 		return error;
 
diff --git a/drivers/scsi/csiostor/csio_isr.c b/drivers/scsi/csiostor/csio_isr.c
index 7c8814715711..2897050f8ee1 100644
--- a/drivers/scsi/csiostor/csio_isr.c
+++ b/drivers/scsi/csiostor/csio_isr.c
@@ -387,8 +387,8 @@ csio_request_irqs(struct csio_hw *hw)
 
 	if (hw->intr_mode != CSIO_IM_MSIX) {
 		rv = request_irq(pci_irq_vector(pdev, 0), csio_fcoe_isr,
-				hw->intr_mode == CSIO_IM_MSI ? 0 : IRQF_SHARED,
-				KBUILD_MODNAME, hw);
+				 (hw->intr_mode == CSIO_IM_MSI ? 0 : IRQF_SHARED) | IRQF_USER_DATA,
+				 KBUILD_MODNAME, hw);
 		if (rv) {
 			csio_err(hw, "Failed to allocate interrupt line.\n");
 			goto out_free_irqs;
@@ -400,8 +400,8 @@ csio_request_irqs(struct csio_hw *hw)
 	/* Add the MSIX vector descriptions */
 	csio_add_msix_desc(hw);
 
-	rv = request_irq(pci_irq_vector(pdev, k), csio_nondata_isr, 0,
-			 entryp[k].desc, hw);
+	rv = request_irq(pci_irq_vector(pdev, k), csio_nondata_isr,
+			 IRQF_USER_DATA, entryp[k].desc, hw);
 	if (rv) {
 		csio_err(hw, "IRQ request failed for vec %d err:%d\n",
 			 pci_irq_vector(pdev, k), rv);
@@ -410,8 +410,8 @@ csio_request_irqs(struct csio_hw *hw)
 
 	entryp[k++].dev_id = hw;
 
-	rv = request_irq(pci_irq_vector(pdev, k), csio_fwevt_isr, 0,
-			 entryp[k].desc, hw);
+	rv = request_irq(pci_irq_vector(pdev, k), csio_fwevt_isr,
+			 IRQF_USER_DATA, entryp[k].desc, hw);
 	if (rv) {
 		csio_err(hw, "IRQ request failed for vec %d err:%d\n",
 			 pci_irq_vector(pdev, k), rv);
@@ -427,7 +427,9 @@ csio_request_irqs(struct csio_hw *hw)
 			struct csio_scsi_qset *sqset = &hw->sqset[i][j];
 			struct csio_q *q = hw->wrm.q_arr[sqset->iq_idx];
 
-			rv = request_irq(pci_irq_vector(pdev, k), csio_scsi_isr, 0,
+			rv = request_irq(pci_irq_vector(pdev, k),
+					 csio_scsi_isr,
+					 IRQF_USER_DATA,
 					 entryp[k].desc, q);
 			if (rv) {
 				csio_err(hw,
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 70d1a18278af..31acc27f2b29 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -1065,7 +1065,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
 		printk(KERN_INFO"     BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size);
 	}
 
-	if (request_irq (pDev->irq, adpt_isr, IRQF_SHARED, pHba->name, pHba)) {
+	if (request_irq(pDev->irq, adpt_isr, IRQF_SHARED | IRQF_USER_DATA, pHba->name, pHba)) {
 		printk(KERN_ERR"%s: Couldn't register IRQ %d\n", pHba->name, pDev->irq);
 		adpt_i2o_delete_hba(pHba);
 		return -EINVAL;
diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c
index 46b2c83ba21f..43e61aaefe9d 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -240,13 +240,7 @@ static void esas2r_claim_interrupts(struct esas2r_adapter *a)
 		   "esas2r_claim_interrupts irq=%d (%p, %s, %lx)",
 		   a->pcid->irq, a, a->name, flags);
 
-	if (request_irq(a->pcid->irq,
-			(a->intr_mode ==
-			 INTR_MODE_LEGACY) ? esas2r_interrupt :
-			esas2r_msi_interrupt,
-			flags,
-			a->name,
-			a)) {
+	if (request_irq(a->pcid->irq, (a->intr_mode == INTR_MODE_LEGACY) ? esas2r_interrupt : esas2r_msi_interrupt, flags | IRQF_USER_DATA, a->name, a)) {
 		esas2r_log(ESAS2R_LOG_CRIT, "unable to request IRQ %02X",
 			   a->pcid->irq);
 		return;
diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c
index 4e3a50202e8c..2f71590be836 100644
--- a/drivers/scsi/fnic/fnic_isr.c
+++ b/drivers/scsi/fnic/fnic_isr.c
@@ -178,12 +178,16 @@ int fnic_request_intr(struct fnic *fnic)
 
 	case VNIC_DEV_INTR_MODE_INTX:
 		err = request_irq(pci_irq_vector(fnic->pdev, 0),
-				&fnic_isr_legacy, IRQF_SHARED, DRV_NAME, fnic);
+				  &fnic_isr_legacy,
+				  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME,
+				  fnic);
 		break;
 
 	case VNIC_DEV_INTR_MODE_MSI:
-		err = request_irq(pci_irq_vector(fnic->pdev, 0), &fnic_isr_msi,
-				  0, fnic->name, fnic);
+		err = request_irq(pci_irq_vector(fnic->pdev, 0),
+				  &fnic_isr_msi,
+				  IRQF_USER_DATA, fnic->name,
+				  fnic);
 		break;
 
 	case VNIC_DEV_INTR_MODE_MSIX:
@@ -211,7 +215,8 @@ int fnic_request_intr(struct fnic *fnic)
 
 		for (i = 0; i < ARRAY_SIZE(fnic->msix); i++) {
 			err = request_irq(pci_irq_vector(fnic->pdev, i),
-					  fnic->msix[i].isr, 0,
+					  fnic->msix[i].isr,
+					  IRQF_USER_DATA,
 					  fnic->msix[i].devname,
 					  fnic->msix[i].devid);
 			if (err) {
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 9cdca0625498..c95a9af1fd4f 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -191,9 +191,7 @@ static irqreturn_t legacy_empty_irq_handler(int irq, void *dev_id)
 static int legacy_find_free_irq(int *irq_table)
 {
 	while (*irq_table != -1) {
-		if (!request_irq(*irq_table, legacy_empty_irq_handler,
-		                 IRQF_PROBE_SHARED, "Test IRQ",
-		                 (void *)irq_table)) {
+		if (!request_irq(*irq_table, legacy_empty_irq_handler, IRQF_PROBE_SHARED | IRQF_USER_DATA, "Test IRQ", (void *)irq_table)) {
 			free_irq(*irq_table, (void *) irq_table);
 			return *irq_table;
 		}
@@ -428,8 +426,7 @@ static int generic_NCR5380_init_one(struct scsi_host_template *tpnt,
 	}
 
 	if (instance->irq != NO_IRQ) {
-		if (request_irq(instance->irq, generic_NCR5380_intr,
-				0, "NCR5380", instance)) {
+		if (request_irq(instance->irq, generic_NCR5380_intr, IRQF_USER_DATA, "NCR5380", instance)) {
 			instance->irq = NO_IRQ;
 			shost_printk(KERN_INFO, instance,
 			             "irq %d denied\n", instance->irq);
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 194c294f9b6c..361f8bd6b863 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -4707,7 +4707,8 @@ static int __init gdth_isa_probe_one(u32 isa_bios)
 	printk("Configuring GDT-ISA HA at BIOS 0x%05X IRQ %u DRQ %u\n",
 		isa_bios, ha->irq, ha->drq);
 
-	error = request_irq(ha->irq, gdth_interrupt, 0, "gdth", ha);
+	error = request_irq(ha->irq, gdth_interrupt,
+			    IRQF_USER_DATA, "gdth", ha);
 	if (error) {
 		printk("GDT-ISA: Unable to allocate IRQ\n");
 		goto out_host_put;
@@ -4839,7 +4840,8 @@ static int __init gdth_eisa_probe_one(u16 eisa_slot)
 	printk("Configuring GDT-EISA HA at Slot %d IRQ %u\n",
 		eisa_slot >> 12, ha->irq);
 
-	error = request_irq(ha->irq, gdth_interrupt, 0, "gdth", ha);
+	error = request_irq(ha->irq, gdth_interrupt,
+			    IRQF_USER_DATA, "gdth", ha);
 	if (error) {
 		printk("GDT-EISA: Unable to allocate IRQ\n");
 		goto out_host_put;
@@ -4975,7 +4977,7 @@ static int gdth_pci_probe_one(gdth_pci_str *pcistr, gdth_ha_str **ha_out)
 		ha->irq);
 
 	error = request_irq(ha->irq, gdth_interrupt,
-				IRQF_SHARED, "gdth", ha);
+			    IRQF_SHARED | IRQF_USER_DATA, "gdth", ha);
 	if (error) {
 		printk("GDT-PCI: Unable to allocate IRQ\n");
 		goto out_host_put;
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ff67ef5d5347..38f68b4b4160 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -7994,9 +7994,10 @@ static int hpsa_request_irqs(struct ctlr_info *h,
 		/* If performant mode and MSI-X, use multiple reply queues */
 		for (i = 0; i < h->msix_vectors; i++) {
 			sprintf(h->intrname[i], "%s-msix%d", h->devname, i);
-			rc = request_irq(pci_irq_vector(h->pdev, i), msixhandler,
-					0, h->intrname[i],
-					&h->q[i]);
+			rc = request_irq(pci_irq_vector(h->pdev, i),
+					 msixhandler,
+					 IRQF_USER_DATA,
+					 h->intrname[i], &h->q[i]);
 			if (rc) {
 				int j;
 
@@ -8018,16 +8019,16 @@ static int hpsa_request_irqs(struct ctlr_info *h,
 			sprintf(h->intrname[0], "%s-msi%s", h->devname,
 				h->msix_vectors ? "x" : "");
 			rc = request_irq(pci_irq_vector(h->pdev, 0),
-				msixhandler, 0,
-				h->intrname[0],
-				&h->q[h->intr_mode]);
+					 msixhandler,
+					 IRQF_USER_DATA,
+					 h->intrname[0], &h->q[h->intr_mode]);
 		} else {
 			sprintf(h->intrname[h->intr_mode],
 				"%s-intx", h->devname);
 			rc = request_irq(pci_irq_vector(h->pdev, 0),
-				intxhandler, IRQF_SHARED,
-				h->intrname[0],
-				&h->q[h->intr_mode]);
+					 intxhandler,
+					 IRQF_SHARED | IRQF_USER_DATA,
+					 h->intrname[0], &h->q[h->intr_mode]);
 		}
 	}
 	if (rc) {
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 3eedfd4f8f57..b6cf8ed9f111 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -1421,8 +1421,7 @@ static int hptiop_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
 
 	pci_set_drvdata(pcidev, host);
 
-	if (request_irq(pcidev->irq, hptiop_intr, IRQF_SHARED,
-					driver_name, hba)) {
+	if (request_irq(pcidev->irq, hptiop_intr, IRQF_SHARED | IRQF_USER_DATA, driver_name, hba)) {
 		printk(KERN_ERR "scsi%d: request irq %d failed\n",
 					hba->host->host_no, pcidev->irq);
 		goto unmap_pci_bar;
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index eb2778b5c81b..33293ed73424 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2913,7 +2913,8 @@ static int initio_probe_one(struct pci_dev *pdev,
 	shost->base = host->addr;
 	shost->sg_tablesize = TOTAL_SG_ENTRY;
 
-	error = request_irq(pdev->irq, i91u_intr, IRQF_SHARED, "i91u", shost);
+	error = request_irq(pdev->irq, i91u_intr,
+			    IRQF_SHARED | IRQF_USER_DATA, "i91u", shost);
 	if (error < 0) {
 		printk(KERN_WARNING "initio: Unable to request IRQ %d\n", pdev->irq);
 		goto out_free_scbs;
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index d1b4025a4503..0a55dd02bc6c 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -10048,11 +10048,10 @@ static int ipr_request_other_msi_irqs(struct ipr_ioa_cfg *ioa_cfg,
 	int i, rc;
 
 	for (i = 1; i < ioa_cfg->nvectors; i++) {
-		rc = request_irq(pci_irq_vector(pdev, i),
-			ipr_isr_mhrrq,
-			0,
-			ioa_cfg->vectors_info[i].desc,
-			&ioa_cfg->hrrq[i]);
+		rc = request_irq(pci_irq_vector(pdev, i), ipr_isr_mhrrq,
+				 IRQF_USER_DATA,
+				 ioa_cfg->vectors_info[i].desc,
+				 &ioa_cfg->hrrq[i]);
 		if (rc) {
 			while (--i >= 0)
 				free_irq(pci_irq_vector(pdev, i),
@@ -10117,7 +10116,8 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
 	int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
 	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
 
-	rc = request_irq(irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
+	rc = request_irq(irq, ipr_test_intr, IRQF_USER_DATA,
+			 IPR_NAME, ioa_cfg);
 	if (rc) {
 		dev_err(&pdev->dev, "Can not assign irq %d\n", irq);
 		return rc;
@@ -10369,15 +10369,16 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
 
 	if (pdev->msi_enabled || pdev->msix_enabled) {
 		name_msi_vectors(ioa_cfg);
-		rc = request_irq(pci_irq_vector(pdev, 0), ipr_isr, 0,
-			ioa_cfg->vectors_info[0].desc,
-			&ioa_cfg->hrrq[0]);
+		rc = request_irq(pci_irq_vector(pdev, 0), ipr_isr,
+				 IRQF_USER_DATA,
+				 ioa_cfg->vectors_info[0].desc,
+				 &ioa_cfg->hrrq[0]);
 		if (!rc)
 			rc = ipr_request_other_msi_irqs(ioa_cfg, pdev);
 	} else {
 		rc = request_irq(pdev->irq, ipr_isr,
-			 IRQF_SHARED,
-			 IPR_NAME, &ioa_cfg->hrrq[0]);
+				 IRQF_SHARED | IRQF_USER_DATA, IPR_NAME,
+				 &ioa_cfg->hrrq[0]);
 	}
 	if (rc) {
 		dev_err(&pdev->dev, "Couldn't register IRQ %d! rc=%d\n",
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index e8bc8d328bab..5d878d646708 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -6664,7 +6664,7 @@ ips_register_scsi(int index)
 	memcpy(ha, oldha, sizeof (ips_ha_t));
 	free_irq(oldha->pcidev->irq, oldha);
 	/* Install the interrupt handler with the new ha */
-	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
+	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED | IRQF_USER_DATA, ips_name, ha)) {
 		IPS_PRINTK(KERN_WARNING, ha->pcidev,
 			   "Unable to install interrupt handler\n");
 		goto err_out_sh;
@@ -7062,7 +7062,7 @@ ips_init_phase2(int index)
 	}
 
 	/* Install the interrupt handler */
-	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
+	if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED | IRQF_USER_DATA, ips_name, ha)) {
 		IPS_PRINTK(KERN_WARNING, ha->pcidev,
 			   "Unable to install interrupt handler\n");
 		return ips_abort_init(ha, index);
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 1727d0c71b12..a8245e9c367d 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -353,7 +353,8 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
 			isr = isci_msix_isr;
 
 		err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, i),
-				isr, 0, DRV_NAME"-msix", ihost);
+				       isr, IRQF_USER_DATA,
+				       DRV_NAME "-msix", ihost);
 		if (!err)
 			continue;
 
@@ -372,8 +373,9 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
  intx:
 	for_each_isci_host(i, ihost, pdev) {
 		err = devm_request_irq(&pdev->dev, pci_irq_vector(pdev, 0),
-				isci_intx_isr, IRQF_SHARED, DRV_NAME"-intx",
-				ihost);
+				       isci_intx_isr,
+				       IRQF_SHARED | IRQF_USER_DATA,
+				       DRV_NAME "-intx", ihost);
 		if (err)
 			break;
 	}
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index bede11e16349..f1ded4ebd05c 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -10004,7 +10004,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 
 	/* vector-0 is associated to slow-path handler */
 	rc = request_irq(pci_irq_vector(phba->pcidev, 0),
-			 &lpfc_sli_sp_intr_handler, 0,
+			 &lpfc_sli_sp_intr_handler,
+			 IRQF_USER_DATA,
 			 LPFC_SP_DRIVER_HANDLER_NAME, phba);
 	if (rc) {
 		lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
@@ -10015,7 +10016,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
 
 	/* vector-1 is associated to fast-path handler */
 	rc = request_irq(pci_irq_vector(phba->pcidev, 1),
-			 &lpfc_sli_fp_intr_handler, 0,
+			 &lpfc_sli_fp_intr_handler,
+			 IRQF_USER_DATA,
 			 LPFC_FP_DRIVER_HANDLER_NAME, phba);
 
 	if (rc) {
@@ -10103,7 +10105,8 @@ lpfc_sli_enable_msi(struct lpfc_hba *phba)
 	}
 
 	rc = request_irq(phba->pcidev->irq, lpfc_sli_intr_handler,
-			 0, LPFC_DRIVER_NAME, phba);
+			 IRQF_USER_DATA, LPFC_DRIVER_NAME,
+			 phba);
 	if (rc) {
 		pci_disable_msi(phba->pcidev);
 		lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
@@ -10161,7 +10164,8 @@ lpfc_sli_enable_intr(struct lpfc_hba *phba, uint32_t cfg_mode)
 	/* Fallback to INTx if both MSI-X/MSI initalization failed */
 	if (phba->intr_type == NONE) {
 		retval = request_irq(phba->pcidev->irq, lpfc_sli_intr_handler,
-				     IRQF_SHARED, LPFC_DRIVER_NAME, phba);
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     LPFC_DRIVER_NAME, phba);
 		if (!retval) {
 			/* Indicate initialization to INTx mode */
 			phba->intr_type = INTx;
@@ -10297,14 +10301,16 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
 		atomic_set(&phba->sli4_hba.hba_eq_hdl[index].hba_eq_in_use, 1);
 		if (phba->cfg_fof && (index == (vectors - 1)))
 			rc = request_irq(pci_irq_vector(phba->pcidev, index),
-				 &lpfc_sli4_fof_intr_handler, 0,
-				 name,
-				 &phba->sli4_hba.hba_eq_hdl[index]);
+					 &lpfc_sli4_fof_intr_handler,
+					 IRQF_USER_DATA,
+					 name,
+					 &phba->sli4_hba.hba_eq_hdl[index]);
 		else
 			rc = request_irq(pci_irq_vector(phba->pcidev, index),
-				 &lpfc_sli4_hba_intr_handler, 0,
-				 name,
-				 &phba->sli4_hba.hba_eq_hdl[index]);
+					 &lpfc_sli4_hba_intr_handler,
+					 IRQF_USER_DATA,
+					 name,
+					 &phba->sli4_hba.hba_eq_hdl[index]);
 		if (rc) {
 			lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
 					"0486 MSI-X fast-path (%d) "
@@ -10377,7 +10383,8 @@ lpfc_sli4_enable_msi(struct lpfc_hba *phba)
 	}
 
 	rc = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler,
-			 0, LPFC_DRIVER_NAME, phba);
+			 IRQF_USER_DATA, LPFC_DRIVER_NAME,
+			 phba);
 	if (rc) {
 		pci_disable_msi(phba->pcidev);
 		lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
@@ -10445,8 +10452,10 @@ lpfc_sli4_enable_intr(struct lpfc_hba *phba, uint32_t cfg_mode)
 
 	/* Fallback to INTx if both MSI-X/MSI initalization failed */
 	if (phba->intr_type == NONE) {
-		retval = request_irq(phba->pcidev->irq, lpfc_sli4_intr_handler,
-				     IRQF_SHARED, LPFC_DRIVER_NAME, phba);
+		retval = request_irq(phba->pcidev->irq,
+				     lpfc_sli4_intr_handler,
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     LPFC_DRIVER_NAME, phba);
 		if (!retval) {
 			struct lpfc_hba_eq_hdl *eqhdl;
 
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 4862f65ec3e8..12fb3c35cc08 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -4299,9 +4299,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto out_free_cmd_buffer;
 	}
 
-	if (request_irq(irq, (adapter->flag & BOARD_MEMMAP) ?
-				megaraid_isr_memmapped : megaraid_isr_iomapped,
-					IRQF_SHARED, "megaraid", adapter)) {
+	if (request_irq(irq, (adapter->flag & BOARD_MEMMAP) ? megaraid_isr_memmapped : megaraid_isr_iomapped, IRQF_SHARED | IRQF_USER_DATA, "megaraid", adapter)) {
 		dev_warn(&pdev->dev, "Couldn't register IRQ %d!\n", irq);
 		goto out_free_scb_list;
 	}
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index f112458023ff..b94dcce82042 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -767,8 +767,7 @@ megaraid_init_mbox(adapter_t *adapter)
 	 */
 
 	/* request IRQ and register the interrupt service routine */
-	if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED, "megaraid",
-		adapter)) {
+	if (request_irq(adapter->irq, megaraid_isr, IRQF_SHARED | IRQF_USER_DATA, "megaraid", adapter)) {
 
 		con_log(CL_ANN, (KERN_WARNING
 			"megaraid: Couldn't register IRQ %d!\n", adapter->irq));
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index fcbff83c0097..b1dccee2bdc1 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5170,9 +5170,7 @@ megasas_setup_irqs_ioapic(struct megasas_instance *instance)
 	pdev = instance->pdev;
 	instance->irq_context[0].instance = instance;
 	instance->irq_context[0].MSIxIndex = 0;
-	if (request_irq(pci_irq_vector(pdev, 0),
-			instance->instancet->service_isr, IRQF_SHARED,
-			"megasas", &instance->irq_context[0])) {
+	if (request_irq(pci_irq_vector(pdev, 0), instance->instancet->service_isr, IRQF_SHARED | IRQF_USER_DATA, "megasas", &instance->irq_context[0])) {
 		dev_err(&instance->pdev->dev,
 				"Failed to register IRQ from %s %d\n",
 				__func__, __LINE__);
@@ -5202,9 +5200,7 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe)
 	for (i = 0; i < instance->msix_vectors; i++) {
 		instance->irq_context[i].instance = instance;
 		instance->irq_context[i].MSIxIndex = i;
-		if (request_irq(pci_irq_vector(pdev, i),
-			instance->instancet->service_isr, 0, "megasas",
-			&instance->irq_context[i])) {
+		if (request_irq(pci_irq_vector(pdev, i), instance->instancet->service_isr, IRQF_USER_DATA, "megasas", &instance->irq_context[i])) {
 			dev_err(&instance->pdev->dev,
 				"Failed to register IRQ for vector %d.\n", i);
 			for (j = 0; j < i; j++)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0a6cb8f0680c..7f9a4d44c605 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2727,7 +2727,7 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index)
 		snprintf(reply_q->name, MPT_NAME_LENGTH, "%s%d",
 		    ioc->driver_name, ioc->id);
 	r = request_irq(pci_irq_vector(pdev, index), _base_interrupt,
-			IRQF_SHARED, reply_q->name, reply_q);
+			IRQF_SHARED | IRQF_USER_DATA, reply_q->name, reply_q);
 	if (r) {
 		pr_err("%s: unable to allocate interrupt %d!\n",
 		       reply_q->name, pci_irq_vector(pdev, index));
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index 030d911ee374..4fd2179f3d55 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -589,8 +589,8 @@ static int mvs_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent)
 	rc = sas_register_ha(SHOST_TO_SAS_HA(shost));
 	if (rc)
 		goto err_out_shost;
-	rc = request_irq(pdev->irq, irq_handler, IRQF_SHARED,
-		DRV_NAME, SHOST_TO_SAS_HA(shost));
+	rc = request_irq(pdev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA,
+			 DRV_NAME, SHOST_TO_SAS_HA(shost));
 	if (rc)
 		goto err_not_sas;
 
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 36f64205ecfa..7520c7740044 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2516,8 +2516,8 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (ret)
 		goto fail_init_fw;
 
-	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler, IRQF_SHARED,
-				"mvumi", mhba);
+	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler,
+			  IRQF_SHARED | IRQF_USER_DATA, "mvumi", mhba);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register IRQ\n");
 		goto fail_init_irq;
@@ -2645,8 +2645,8 @@ static int __maybe_unused mvumi_resume(struct pci_dev *pdev)
 		goto unmap_pci_addr;
 	}
 
-	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler, IRQF_SHARED,
-				"mvumi", mhba);
+	ret = request_irq(mhba->pdev->irq, mvumi_isr_handler,
+			  IRQF_SHARED | IRQF_USER_DATA, "mvumi", mhba);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register IRQ\n");
 		goto unmap_pci_addr;
diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index 539ac8ce4fcd..8a47670a7700 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -3542,7 +3542,7 @@ static struct myrb_hba *myrb_detect(struct pci_dev *pdev,
 	if (privdata->hw_init(pdev, cb, cb->io_base))
 		goto failure;
 
-	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED, "myrb", cb) < 0) {
+	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, "myrb", cb) < 0) {
 		dev_err(&pdev->dev,
 			"Unable to acquire IRQ Channel %d\n", pdev->irq);
 		goto failure;
diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index b8d54ef8cf6d..4e8fd9480469 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -2323,7 +2323,7 @@ static struct myrs_hba *myrs_detect(struct pci_dev *pdev,
 		goto Failure;
 
 	/* Acquire shared access to the IRQ Channel. */
-	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED, "myrs", cs) < 0) {
+	if (request_irq(pdev->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, "myrs", cs) < 0) {
 		dev_err(&pdev->dev,
 			"Unable to acquire IRQ Channel %d\n", pdev->irq);
 		goto Failure;
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 00e3cbee55b8..3477288bad79 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -2729,7 +2729,8 @@ static int nsp32_detect(struct pci_dev *pdev)
 	 */
 	nsp32_do_bus_reset(data);
 
-	ret = request_irq(host->irq, do_nsp32_isr, IRQF_SHARED, "nsp32", data);
+	ret = request_irq(host->irq, do_nsp32_isr,
+			  IRQF_SHARED | IRQF_USER_DATA, "nsp32", data);
 	if (ret < 0) {
 		nsp32_msg(KERN_ERR, "Unable to allocate IRQ for NinjaSCSI32 "
 			  "SCSI PCI controller. Interrupt: %d", host->irq);
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 828d53faf09a..e321a9c57c5d 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -119,7 +119,7 @@ static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
 	priv->shost = shost;
 	priv->int_type = INT_TYPE;					
 
-	if (request_irq(qlirq, qlogicfas408_ihandl, 0, qlogic_name, shost))
+	if (request_irq(qlirq, qlogicfas408_ihandl, IRQF_USER_DATA, qlogic_name, shost))
 		goto free_scsi_host;
 
 	sprintf(priv->qinfo,
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index d1e98a6ea28f..66c96648ecaf 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -761,7 +761,7 @@ SYM53C500_config(struct pcmcia_device *link)
 	data = (struct sym53c500_data *)host->hostdata;
 
 	if (irq_level > 0) {
-		if (request_irq(irq_level, SYM53C500_intr, IRQF_SHARED, "SYM53C500", host)) {
+		if (request_irq(irq_level, SYM53C500_intr, IRQF_SHARED | IRQF_USER_DATA, "SYM53C500", host)) {
 			printk("SYM53C500: unable to allocate IRQ %d\n", irq_level);
 			goto err_free_scsi;
 		}
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index a36060c23b37..bc9ce9eceaa2 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -900,8 +900,9 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
 		pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
 
 		rc = request_irq(pci_irq_vector(pm8001_ha->pdev, i),
-			pm8001_interrupt_handler_msix, flag,
-			intr_drvname[i], &(pm8001_ha->irq_vector[i]));
+				 pm8001_interrupt_handler_msix,
+				 flag | IRQF_USER_DATA, intr_drvname[i],
+				 &(pm8001_ha->irq_vector[i]));
 		if (rc) {
 			for (j = 0; j < i; j++) {
 				free_irq(pci_irq_vector(pm8001_ha->pdev, i),
@@ -941,8 +942,9 @@ static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha)
 	/* initialize the INT-X interrupt */
 	pm8001_ha->irq_vector[0].irq_id = 0;
 	pm8001_ha->irq_vector[0].drv_inst = pm8001_ha;
-	rc = request_irq(pdev->irq, pm8001_interrupt_handler_intx, IRQF_SHARED,
-		DRV_NAME, SHOST_TO_SAS_HA(pm8001_ha->shost));
+	rc = request_irq(pdev->irq, pm8001_interrupt_handler_intx,
+			 IRQF_SHARED | IRQF_USER_DATA, DRV_NAME,
+			 SHOST_TO_SAS_HA(pm8001_ha->shost));
 	return rc;
 }
 
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index e338d7a4f571..9f94b2b713dd 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4530,8 +4530,9 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance)
 
 		vec->hrrq_id = i;
 		vec->drv_inst = pinstance;
-		rc = request_irq(pci_irq_vector(pdev, i), isr, flag,
-				PMCRAID_DRIVER_NAME, vec);
+		rc = request_irq(pci_irq_vector(pdev, i), isr,
+				 flag | IRQF_USER_DATA, PMCRAID_DRIVER_NAME,
+				 vec);
 		if (rc)
 			goto out_unwind;
 	}
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 9bbc19fc190b..452e8e7db1d1 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2112,7 +2112,9 @@ static int qedf_request_msix_irq(struct qedf_ctx *qedf)
 	cpu = cpumask_first(cpu_online_mask);
 	for (i = 0; i < qedf->num_queues; i++) {
 		rc = request_irq(qedf->int_info.msix[i].vector,
-		    qedf_msix_handler, 0, "qedf", &qedf->fp_array[i]);
+				 qedf_msix_handler,
+				 IRQF_USER_DATA, "qedf",
+				 &qedf->fp_array[i]);
 
 		if (rc) {
 			QEDF_WARN(&(qedf->dbg_ctx), "request_irq failed.\n");
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index e74a62448ba4..792ead7e468a 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -1338,7 +1338,8 @@ static int qedi_request_msix_irq(struct qedi_ctx *qedi)
 	cpu = cpumask_first(cpu_online_mask);
 	for (i = 0; i < qedi->int_info.msix_cnt; i++) {
 		rc = request_irq(qedi->int_info.msix[i].vector,
-				 qedi_msix_handler, 0, "qedi",
+				 qedi_msix_handler,
+				 IRQF_USER_DATA, "qedi",
 				 &qedi->fp_array[i]);
 
 		if (rc) {
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 6856dfdfa473..fb0cebb1665f 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -4323,8 +4323,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* Disable ISP interrupts. */
 	qla1280_disable_intrs(ha);
 
-	if (request_irq(pdev->irq, qla1280_intr_handler, IRQF_SHARED,
-				"qla1280", ha)) {
+	if (request_irq(pdev->irq, qla1280_intr_handler, IRQF_SHARED | IRQF_USER_DATA, "qla1280", ha)) {
 		printk("qla1280 : Failed to reserve interrupt %d already "
 		       "in use\n", pdev->irq);
 		goto error_release_region;
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 8507c43b918c..43463db8a0d7 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -3476,12 +3476,14 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 		    "qla2xxx%lu_%s", vha->host_no, msix_entries[i].name);
 		if (IS_P3P_TYPE(ha))
 			ret = request_irq(qentry->vector,
-				qla82xx_msix_entries[i].handler,
-				0, qla82xx_msix_entries[i].name, rsp);
+					  qla82xx_msix_entries[i].handler,
+					  IRQF_USER_DATA,
+					  qla82xx_msix_entries[i].name, rsp);
 		else
 			ret = request_irq(qentry->vector,
-				msix_entries[i].handler,
-				0, qentry->name, rsp);
+					  msix_entries[i].handler,
+					  IRQF_USER_DATA,
+					  qentry->name, rsp);
 		if (ret)
 			goto msix_register_fail;
 		qentry->have_irq = 1;
@@ -3502,8 +3504,9 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 		    msix_entries[QLA_ATIO_VECTOR].name);
 		qentry->in_use = 1;
 		ret = request_irq(qentry->vector,
-			msix_entries[QLA_ATIO_VECTOR].handler,
-			0, qentry->name, rsp);
+				  msix_entries[QLA_ATIO_VECTOR].handler,
+				  IRQF_USER_DATA,
+				  qentry->name, rsp);
 		qentry->have_irq = 1;
 	}
 
@@ -3606,8 +3609,8 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
 		return QLA_FUNCTION_FAILED;
 
 	ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler,
-	    ha->flags.msi_enabled ? 0 : IRQF_SHARED,
-	    QLA2XXX_DRIVER_NAME, rsp);
+			  (ha->flags.msi_enabled ? 0 : IRQF_SHARED) | IRQF_USER_DATA,
+			  QLA2XXX_DRIVER_NAME, rsp);
 	if (ret) {
 		ql_log(ql_log_warn, vha, 0x003a,
 		    "Failed to reserve interrupt %d already in use.\n",
@@ -3677,7 +3680,8 @@ int qla25xx_request_irq(struct qla_hw_data *ha, struct qla_qpair *qpair,
 
 	scnprintf(msix->name, sizeof(msix->name),
 	    "qla2xxx%lu_qpair%d", vha->host_no, qpair->id);
-	ret = request_irq(msix->vector, intr->handler, 0, msix->name, qpair);
+	ret = request_irq(msix->vector, intr->handler,
+			  IRQF_USER_DATA, msix->name, qpair);
 	if (ret) {
 		ql_log(ql_log_fatal, vha, 0x00e6,
 		    "MSI-X: Unable to register handler -- %x/%d.\n",
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index d2cd33d8d67f..236166da1ac8 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -1567,7 +1567,8 @@ int qla4xxx_request_irqs(struct scsi_qla_host *ha)
 	ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI);
 	if (ret > 0) {
 		ret = request_irq(ha->pdev->irq, qla4_8xxx_msi_handler,
-			0, DRIVER_NAME, ha);
+				  IRQF_USER_DATA,
+				  DRIVER_NAME, ha);
 		if (!ret) {
 			DEBUG2(ql4_printk(KERN_INFO, ha, "MSI: Enabled.\n"));
 			goto irq_attached;
@@ -1588,7 +1589,7 @@ int qla4xxx_request_irqs(struct scsi_qla_host *ha)
 
 	/* Trying INTx */
 	ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler,
-	    IRQF_SHARED, DRIVER_NAME, ha);
+			  IRQF_SHARED | IRQF_USER_DATA, DRIVER_NAME, ha);
 	if (!ret) {
 		DEBUG2(ql4_printk(KERN_INFO, ha, "INTx: Enabled.\n"));
 		goto irq_attached;
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 5a31877c9d04..4a3e1ce069f8 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -4190,13 +4190,15 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha)
 	}
 
 	ret = request_irq(pci_irq_vector(ha->pdev, 0),
-			qla4_8xxx_default_intr_handler, 0, "qla4xxx (default)",
-			ha);
+			  qla4_8xxx_default_intr_handler,
+			  IRQF_USER_DATA,
+			  "qla4xxx (default)", ha);
 	if (ret)
 		goto out_free_vectors;
 
-	ret = request_irq(pci_irq_vector(ha->pdev, 1),
-			qla4_8xxx_msix_rsp_q, 0, "qla4xxx (rsp_q)", ha);
+	ret = request_irq(pci_irq_vector(ha->pdev, 1), qla4_8xxx_msix_rsp_q,
+			  IRQF_USER_DATA, "qla4xxx (rsp_q)",
+			  ha);
 	if (ret)
 		goto out_free_default_irq;
 
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index 8f709002f746..c9bd84f4df25 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -111,7 +111,7 @@ static struct Scsi_Host *__qlogicfas_detect(struct scsi_host_template *host,
 		qltyp, qbase, qlirq, QL_TURBO_PDMA);
 	host->name = qlogicfas_name;
 
-	if (request_irq(qlirq, qlogicfas408_ihandl, 0, qlogicfas_name, hreg))
+	if (request_irq(qlirq, qlogicfas408_ihandl, IRQF_USER_DATA, qlogicfas_name, hreg))
 		goto free_scsi_host;
 
 	if (scsi_add_host(hreg, NULL))
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 82ed99848378..1838cc163fea 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -133,7 +133,7 @@ static int sim710_probe_common(struct device *dev, unsigned long base_addr,
 	host->this_id = scsi_id;
 	host->base = base_addr;
 	host->irq = irq;
-	if (request_irq(irq, NCR_700_intr, IRQF_SHARED, "sim710", host)) {
+	if (request_irq(irq, NCR_700_intr, IRQF_SHARED | IRQF_USER_DATA, "sim710", host)) {
 		printk(KERN_ERR "sim710: request_irq failed\n");
 		goto out_put_host;
 	}
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index f564af8949e8..10cb10c47b87 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -3469,8 +3469,10 @@ static int pqi_request_irqs(struct pqi_ctrl_info *ctrl_info)
 	ctrl_info->event_irq = pci_irq_vector(pci_dev, 0);
 
 	for (i = 0; i < ctrl_info->num_msix_vectors_enabled; i++) {
-		rc = request_irq(pci_irq_vector(pci_dev, i), pqi_irq_handler, 0,
-			DRIVER_NAME_SHORT, &ctrl_info->queue_groups[i]);
+		rc = request_irq(pci_irq_vector(pci_dev, i), pqi_irq_handler,
+				 IRQF_USER_DATA,
+				 DRIVER_NAME_SHORT,
+				 &ctrl_info->queue_groups[i]);
 		if (rc) {
 			dev_err(&pci_dev->dev,
 				"irq %u init failed with error %d\n",
@@ -7890,8 +7892,9 @@ static __maybe_unused int pqi_resume(struct pci_dev *pci_dev)
 		pqi_free_interrupts(ctrl_info);
 		pqi_change_irq_mode(ctrl_info, IRQ_MODE_INTX);
 		rc = request_irq(pci_irq_vector(pci_dev, 0), pqi_irq_handler,
-			IRQF_SHARED, DRIVER_NAME_SHORT,
-			&ctrl_info->queue_groups[0]);
+				 IRQF_SHARED | IRQF_USER_DATA,
+				 DRIVER_NAME_SHORT,
+				 &ctrl_info->queue_groups[0]);
 		if (rc) {
 			dev_err(&ctrl_info->pci_dev->dev,
 				"irq %u init failed with error %d\n",
diff --git a/drivers/scsi/snic/snic_isr.c b/drivers/scsi/snic/snic_isr.c
index c4da3673f2ae..015ae0bc061b 100644
--- a/drivers/scsi/snic/snic_isr.c
+++ b/drivers/scsi/snic/snic_isr.c
@@ -136,9 +136,8 @@ snic_request_intr(struct snic *snic)
 	for (i = 0; i < ARRAY_SIZE(snic->msix); i++) {
 		ret = request_irq(pci_irq_vector(snic->pdev, i),
 				  snic->msix[i].isr,
-				  0,
-				  snic->msix[i].devname,
-				  snic->msix[i].devid);
+				  IRQF_USER_DATA,
+				  snic->msix[i].devname, snic->msix[i].devid);
 		if (ret) {
 			SNIC_HOST_ERR(snic->shost,
 				      "MSI-X: request_irq(%d) failed %d\n",
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index f6bef7ad65e7..416a71d13169 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -1635,8 +1635,8 @@ static int stex_request_irq(struct st_hba *hba)
 		hba->msi_enabled = 0;
 
 	status = request_irq(pdev->irq,
-		(hba->cardtype == st_yel || hba->cardtype == st_P3) ?
-		stex_ss_intr : stex_intr, IRQF_SHARED, DRV_NAME, hba);
+			     (hba->cardtype == st_yel || hba->cardtype == st_P3) ? stex_ss_intr : stex_intr,
+			     IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, hba);
 
 	if (status != 0) {
 		if (hba->msi_enabled)
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 57f6d63e4c40..9c38ffd7675f 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1327,8 +1327,7 @@ static struct Scsi_Host *sym_attach(struct scsi_host_template *tpnt, int unit,
 	 *  If we synchonize the C code with SCRIPTS on interrupt, 
 	 *  we do not want to share the INTR line at all.
 	 */
-	if (request_irq(pdev->irq, sym53c8xx_intr, IRQF_SHARED, NAME53C8XX,
-			shost)) {
+	if (request_irq(pdev->irq, sym53c8xx_intr, IRQF_SHARED | IRQF_USER_DATA, NAME53C8XX, shost)) {
 		printf_err("%s: request irq %u failure\n",
 			sym_name(np), pdev->irq);
 		goto attach_failed;
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 2ddf24466a62..807fbd94c31f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -273,8 +273,8 @@ static inline int ufshcd_enable_irq(struct ufs_hba *hba)
 	int ret = 0;
 
 	if (!hba->is_irq_enabled) {
-		ret = request_irq(hba->irq, ufshcd_intr, IRQF_SHARED, UFSHCD,
-				hba);
+		ret = request_irq(hba->irq, ufshcd_intr,
+				  IRQF_SHARED | IRQF_USER_DATA, UFSHCD, hba);
 		if (ret)
 			dev_err(hba->dev, "%s: request_irq failed, ret=%d\n",
 				__func__, ret);
@@ -8315,7 +8315,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	mb();
 
 	/* IRQ registration */
-	err = devm_request_irq(dev, irq, ufshcd_intr, IRQF_SHARED, UFSHCD, hba);
+	err = devm_request_irq(dev, irq, ufshcd_intr,
+			       IRQF_SHARED | IRQF_USER_DATA, UFSHCD, hba);
 	if (err) {
 		dev_err(hba->dev, "request irq failed\n");
 		goto exit_gating;
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index ecee4b3ff073..14885a807d2d 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1499,11 +1499,14 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		printk(KERN_INFO "vmw_pvscsi: using MSI%s\n",
 			adapter->dev->msix_enabled ? "-X" : "");
 		error = request_irq(pci_irq_vector(pdev, 0), pvscsi_isr,
-				0, "vmw_pvscsi", adapter);
+				    IRQF_USER_DATA,
+				    "vmw_pvscsi", adapter);
 	} else {
 		printk(KERN_INFO "vmw_pvscsi: using INTx\n");
-		error = request_irq(pci_irq_vector(pdev, 0), pvscsi_shared_isr,
-				IRQF_SHARED, "vmw_pvscsi", adapter);
+		error = request_irq(pci_irq_vector(pdev, 0),
+				    pvscsi_shared_isr,
+				    IRQF_SHARED | IRQF_USER_DATA,
+				    "vmw_pvscsi", adapter);
 	}
 
 	if (error) {
diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index e3310e9488d2..a27d1269736d 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -823,8 +823,8 @@ static int wd719x_board_found(struct Scsi_Host *sh)
 		goto fail_free_params;
 	}
 
-	ret = request_irq(wd->pdev->irq, wd719x_interrupt, IRQF_SHARED,
-			  "wd719x", wd);
+	ret = request_irq(wd->pdev->irq, wd719x_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, "wd719x", wd);
 	if (ret) {
 		dev_warn(&wd->pdev->dev, "unable to assign IRQ %d\n",
 			 wd->pdev->irq);
diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
index ad3e2e23f56e..8e7e50676162 100644
--- a/drivers/slimbus/qcom-ctrl.c
+++ b/drivers/slimbus/qcom-ctrl.c
@@ -563,7 +563,8 @@ static int qcom_slim_probe(struct platform_device *pdev)
 	qcom_slim_prg_slew(pdev, ctrl);
 
 	ret = devm_request_irq(&pdev->dev, ctrl->irq, qcom_slim_interrupt,
-				IRQF_TRIGGER_HIGH, "qcom_slim_irq", ctrl);
+			       IRQF_TRIGGER_HIGH | IRQF_USER_DATA,
+			       "qcom_slim_irq", ctrl);
 	if (ret) {
 		dev_err(&pdev->dev, "request IRQ failed\n");
 		goto err_request_irq_failed;
diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
index a5adf0d868fc..5ad3eb51e7bd 100644
--- a/drivers/spi/spi-altera.c
+++ b/drivers/spi/spi-altera.c
@@ -207,7 +207,8 @@ static int altera_spi_probe(struct platform_device *pdev)
 	/* irq is optional */
 	hw->irq = platform_get_irq(pdev, 0);
 	if (hw->irq >= 0) {
-		err = devm_request_irq(&pdev->dev, hw->irq, altera_spi_irq, 0,
+		err = devm_request_irq(&pdev->dev, hw->irq, altera_spi_irq,
+				       IRQF_USER_DATA,
 				       pdev->name, master);
 		if (err)
 			goto exit;
diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 68cfc351b47f..189aa3723ef8 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -522,7 +522,8 @@ static int spi_engine_probe(struct platform_device *pdev)
 	writel_relaxed(0xff, spi_engine->base + SPI_ENGINE_REG_INT_PENDING);
 	writel_relaxed(0x00, spi_engine->base + SPI_ENGINE_REG_INT_ENABLE);
 
-	ret = request_irq(irq, spi_engine_irq, 0, pdev->name, master);
+	ret = request_irq(irq, spi_engine_irq,
+			  IRQF_USER_DATA, pdev->name, master);
 	if (ret)
 		goto err_ref_clk_disable;
 
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 7c88f74f7f47..792af77b42c9 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -614,7 +614,8 @@ static int cdns_spi_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, irq, cdns_spi_irq,
-			       0, pdev->name, master);
+			       IRQF_USER_DATA, pdev->name,
+			       master);
 	if (ret != 0) {
 		ret = -ENXIO;
 		dev_err(&pdev->dev, "request_irq failed\n");
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 2e822a56576a..2acec28544e3 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -489,8 +489,8 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
 
 	spi_controller_set_devdata(master, dws);
 
-	ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dev_name(dev),
-			  master);
+	ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED | IRQF_USER_DATA,
+			  dev_name(dev), master);
 	if (ret < 0) {
 		dev_err(dev, "can not get IRQ\n");
 		goto err_free_master;
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 8f2e97857e8b..ae6a34fdc38f 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -654,7 +654,8 @@ static struct spi_master * fsl_spi_probe(struct device *dev,
 
 	/* Register for SPI Interrupt */
 	ret = devm_request_irq(dev, mpc8xxx_spi->irq, fsl_spi_irq,
-			       0, "fsl_spi", mpc8xxx_spi);
+			       IRQF_USER_DATA, "fsl_spi",
+			       mpc8xxx_spi);
 
 	if (ret != 0)
 		goto err_probe;
diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c
index 085f580be7ec..ee8dace61752 100644
--- a/drivers/spi/spi-oc-tiny.c
+++ b/drivers/spi/spi-oc-tiny.c
@@ -277,7 +277,8 @@ static int tiny_spi_probe(struct platform_device *pdev)
 	hw->irq = platform_get_irq(pdev, 0);
 	if (hw->irq >= 0) {
 		init_completion(&hw->done);
-		err = devm_request_irq(&pdev->dev, hw->irq, tiny_spi_irq, 0,
+		err = devm_request_irq(&pdev->dev, hw->irq, tiny_spi_irq,
+				       IRQF_USER_DATA,
 				       pdev->name, hw);
 		if (err)
 			goto exit;
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index d84b893a64d7..072f49852e3e 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1681,8 +1681,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 						| SSSR_ROR | SSSR_TUR;
 	}
 
-	status = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev),
-			drv_data);
+	status = request_irq(ssp->irq, ssp_int, IRQF_SHARED | IRQF_USER_DATA,
+			     dev_name(dev), drv_data);
 	if (status < 0) {
 		dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq);
 		goto out_error_master_alloc;
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 97d137591b18..0b4840f1049b 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1370,7 +1370,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
 	}
 
 	ret = request_irq(board_dat->pdev->irq, pch_spi_handler,
-			  IRQF_SHARED, KBUILD_MODNAME, data);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, data);
 	if (ret) {
 		dev_err(&plat_dev->dev,
 			"%s request_irq failed\n", __func__);
@@ -1503,7 +1503,8 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev)
 	if (!data->irq_reg_sts) {
 		/* register IRQ */
 		retval = request_irq(board_dat->pdev->irq, pch_spi_handler,
-				     IRQF_SHARED, KBUILD_MODNAME, data);
+				     IRQF_SHARED | IRQF_USER_DATA,
+				     KBUILD_MODNAME, data);
 		if (retval < 0) {
 			dev_err(&pd_dev->dev,
 				"%s request_irq failed\n", __func__);
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 63fedc49ae9c..0043addb8d4a 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -473,8 +473,9 @@ static int xilinx_spi_probe(struct platform_device *pdev)
 		goto put_master;
 	} else if (xspi->irq >= 0) {
 		/* Register for SPI Interrupt */
-		ret = devm_request_irq(&pdev->dev, xspi->irq, xilinx_spi_irq, 0,
-				dev_name(&pdev->dev), xspi);
+		ret = devm_request_irq(&pdev->dev, xspi->irq, xilinx_spi_irq,
+				       IRQF_USER_DATA,
+				       dev_name(&pdev->dev), xspi);
 		if (ret)
 			goto put_master;
 	}
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index 9f83e1b17aa1..8ff24edd3720 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1079,7 +1079,8 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
 		goto clk_dis_all;
 	}
 	ret = devm_request_irq(&pdev->dev, xqspi->irq, zynqmp_qspi_irq,
-			       0, pdev->name, master);
+			       IRQF_USER_DATA, pdev->name,
+			       master);
 	if (ret != 0) {
 		ret = -ENXIO;
 		dev_err(dev, "request_irq failed\n");
diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index 22571abcaa4e..43e40f31f9e5 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -922,7 +922,8 @@ static int vsoc_probe_device(struct pci_dev *pdev,
 			shm_off_to_virtual_addr(region->region_begin_offset) +
 			g_to_h_signal_table->interrupt_signalled_offset;
 		result = request_irq(vsoc_dev.msix_entries[i].vector,
-				     vsoc_interrupt, 0,
+				     vsoc_interrupt,
+				     IRQF_USER_DATA,
 				     vsoc_dev.regions_data[i].name,
 				     vsoc_dev.regions_data + i);
 		if (result) {
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 805437fa249a..af010e5dbfc6 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -983,7 +983,8 @@ static int axis_fifo_probe(struct platform_device *pdev)
 
 	/* request IRQ */
 	fifo->irq = r_irq->start;
-	rc = request_irq(fifo->irq, &axis_fifo_irq, 0, DRIVER_NAME, fifo);
+	rc = request_irq(fifo->irq, &axis_fifo_irq,
+			 IRQF_USER_DATA, DRIVER_NAME, fifo);
 	if (rc) {
 		dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
 			fifo->irq);
diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c
index 560649be9d13..6503721d68c8 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -306,7 +306,8 @@ static int apci1032_auto_attach(struct comedi_device *dev,
 	dev->iobase = pci_resource_start(pcidev, 1);
 	apci1032_reset(dev);
 	if (pcidev->irq > 0) {
-		ret = request_irq(pcidev->irq, apci1032_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, apci1032_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c
index 45ad4ba92f94..d9e909f3b9bf 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1500.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1500.c
@@ -764,7 +764,8 @@ static int apci1500_auto_attach(struct comedi_device *dev,
 	z8536_reset(dev);
 
 	if (pcidev->irq > 0) {
-		ret = request_irq(pcidev->irq, apci1500_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, apci1500_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 10501fe6bb25..3ae718d28c74 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -682,7 +682,8 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 	apci1564_reset(dev);
 
 	if (pcidev->irq > 0) {
-		ret = request_irq(pcidev->irq, apci1564_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, apci1564_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/addi_apci_2032.c b/drivers/staging/comedi/drivers/addi_apci_2032.c
index a122f3f3f5ec..f0f56908a809 100644
--- a/drivers/staging/comedi/drivers/addi_apci_2032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_2032.c
@@ -238,7 +238,8 @@ static int apci2032_auto_attach(struct comedi_device *dev,
 
 	if (pcidev->irq > 0) {
 		ret = request_irq(pcidev->irq, apci2032_interrupt,
-				  IRQF_SHARED, dev->board_name, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
 	}
diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c
index d2810fdd5e63..362863489892 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3120.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3120.c
@@ -994,7 +994,8 @@ static int apci3120_auto_attach(struct comedi_device *dev,
 	apci3120_reset(dev);
 
 	if (pcidev->irq > 0) {
-		ret = request_irq(pcidev->irq, apci3120_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, apci3120_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0) {
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
index 55784f24e2a7..d64987dfdafa 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
@@ -783,7 +783,8 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
 
 	if (pcidev->irq > 0) {
 		ret = request_irq(pcidev->irq, apci3xxx_irq_handler,
-				  IRQF_SHARED, dev->board_name, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
 	}
diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c
index f4dba6271d0d..a6adf1caeb63 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -643,7 +643,8 @@ static int pci9111_auto_attach(struct comedi_device *dev,
 
 	if (pcidev->irq) {
 		ret = request_irq(pcidev->irq, pci9111_interrupt,
-				  IRQF_SHARED, dev->board_name, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
 	}
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c
index 2528ca0ede6d..ca7ed001d7cb 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -1533,7 +1533,8 @@ static int pci9118_common_attach(struct comedi_device *dev,
 	pci9118_reset(dev);
 
 	if (pcidev->irq) {
-		ret = request_irq(pcidev->irq, pci9118_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, pci9118_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0) {
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c
index 6a93b04f1fdf..50b74ae9404e 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -792,7 +792,8 @@ static int pci1710_auto_attach(struct comedi_device *dev,
 
 	if (pcidev->irq) {
 		ret = request_irq(pcidev->irq, pci1710_irq_handler,
-				  IRQF_SHARED, dev->board_name, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
 	}
diff --git a/drivers/staging/comedi/drivers/aio_iiro_16.c b/drivers/staging/comedi/drivers/aio_iiro_16.c
index 41c9c56816ef..9ef45db38500 100644
--- a/drivers/staging/comedi/drivers/aio_iiro_16.c
+++ b/drivers/staging/comedi/drivers/aio_iiro_16.c
@@ -179,7 +179,8 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
 	 * using IRQ 2-7, 10-12, 14, or 15.
 	 */
 	if ((1 << it->options[1]) & 0xdcfc) {
-		ret = request_irq(it->options[1], aio_iiro_16_cos, 0,
+		ret = request_irq(it->options[1], aio_iiro_16_cos,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 8697dc02ffb4..d8a15e405087 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -841,8 +841,7 @@ int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
 	}
 
 	if (irq && dev->read_subdev) {
-		if (request_irq(irq, dio200_interrupt, req_irq_flags,
-				dev->board_name, dev) >= 0) {
+		if (request_irq(irq, dio200_interrupt, req_irq_flags | IRQF_USER_DATA, dev->board_name, dev) >= 0) {
 			dev->irq = irq;
 		} else {
 			dev_warn(dev->class_dev,
diff --git a/drivers/staging/comedi/drivers/amplc_pc236_common.c b/drivers/staging/comedi/drivers/amplc_pc236_common.c
index 01b90e4eca8a..b29133e1803d 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236_common.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236_common.c
@@ -155,8 +155,7 @@ int amplc_pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
 	s->type = COMEDI_SUBD_UNUSED;
 	pc236_intr_update(dev, false);
 	if (irq) {
-		if (request_irq(irq, pc236_interrupt, req_irq_flags,
-				dev->board_name, dev) >= 0) {
+		if (request_irq(irq, pc236_interrupt, req_irq_flags | IRQF_USER_DATA, dev->board_name, dev) >= 0) {
 			dev->irq = irq;
 			s->type = COMEDI_SUBD_DI;
 			s->subdev_flags = SDF_READABLE | SDF_CMD_READ;
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c
index 657b736ef46d..d463432103c0 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1082,7 +1082,8 @@ pci224_auto_attach(struct comedi_device *dev, unsigned long context_model)
 		return ret;
 
 	if (irq) {
-		ret = request_irq(irq, pci224_interrupt, IRQF_SHARED,
+		ret = request_irq(irq, pci224_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret < 0) {
 			dev_err(dev->class_dev,
diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c
index 08ffe26c5d43..3def00d21e70 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -2470,7 +2470,8 @@ static int pci230_auto_attach(struct comedi_device *dev,
 	     devpriv->daqio + PCI230_ADCCON);
 
 	if (pci_dev->irq) {
-		rc = request_irq(pci_dev->irq, pci230_interrupt, IRQF_SHARED,
+		rc = request_irq(pci_dev->irq, pci230_interrupt,
+				 IRQF_SHARED | IRQF_USER_DATA,
 				 dev->board_name, dev);
 		if (rc == 0)
 			dev->irq = pci_dev->irq;
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 02ae00c95313..71860c4cd7e0 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -1280,8 +1280,8 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
 	outl(INTCSR_INBOX_INTR_STATUS,
 	     devpriv->amcc + AMCC_OP_REG_INTCSR);
 
-	ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,
-			  dev->board_name, dev);
+	ret = request_irq(pcidev->irq, cb_pcidas_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->board_name, dev);
 	if (ret) {
 		dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
 			pcidev->irq);
diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index e1774e09a320..669d5540f0a9 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -4034,8 +4034,9 @@ static int auto_attach(struct comedi_device *dev,
 	init_plx9080(dev);
 	init_stc_registers(dev);
 
-	retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
-			     dev->board_name, dev);
+	retval = request_irq(pcidev->irq, handle_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, dev->board_name,
+			     dev);
 	if (retval) {
 		dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
 			pcidev->irq);
diff --git a/drivers/staging/comedi/drivers/comedi_parport.c b/drivers/staging/comedi/drivers/comedi_parport.c
index efaa57372aeb..41ef8b705546 100644
--- a/drivers/staging/comedi/drivers/comedi_parport.c
+++ b/drivers/staging/comedi/drivers/comedi_parport.c
@@ -232,7 +232,8 @@ static int parport_attach(struct comedi_device *dev,
 		return ret;
 
 	if (it->options[1]) {
-		ret = request_irq(it->options[1], parport_interrupt, 0,
+		ret = request_irq(it->options[1], parport_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c
index 4e36377b592a..b9cf4eb1dfab 100644
--- a/drivers/staging/comedi/drivers/das16m1.c
+++ b/drivers/staging/comedi/drivers/das16m1.c
@@ -524,7 +524,8 @@ static int das16m1_attach(struct comedi_device *dev,
 
 	/* only irqs 2, 3, 4, 5, 6, 7, 10, 11, 12, 14, and 15 are valid */
 	if ((1 << it->options[1]) & 0xdcfc) {
-		ret = request_irq(it->options[1], das16m1_interrupt, 0,
+		ret = request_irq(it->options[1], das16m1_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
index f16aa7e9f4f3..18684d080e1e 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -1197,7 +1197,8 @@ static int das1800_attach(struct comedi_device *dev,
 
 	if (irq == 3 || irq == 5 || irq == 7 || irq == 10 || irq == 11 ||
 	    irq == 15) {
-		ret = request_irq(irq, das1800_interrupt, 0,
+		ret = request_irq(irq, das1800_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0) {
 			dev->irq = irq;
diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c
index f99211ec46de..a008aa26c9da 100644
--- a/drivers/staging/comedi/drivers/das6402.c
+++ b/drivers/staging/comedi/drivers/das6402.c
@@ -570,7 +570,8 @@ static int das6402_attach(struct comedi_device *dev,
 
 	/* IRQs 2,3,5,6,7, 10,11,15 are valid for "enhanced" mode */
 	if ((1 << it->options[1]) & 0x8cec) {
-		ret = request_irq(it->options[1], das6402_interrupt, 0,
+		ret = request_irq(it->options[1], das6402_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0) {
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
index 8cf09ef3012f..b304b1beaa01 100644
--- a/drivers/staging/comedi/drivers/das800.c
+++ b/drivers/staging/comedi/drivers/das800.c
@@ -668,8 +668,9 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	dev->board_name = board->name;
 
 	if (irq > 1 && irq <= 7) {
-		ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
-				  dev);
+		ret = request_irq(irq, das800_interrupt,
+				  IRQF_USER_DATA,
+				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = irq;
 	}
diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c
index 75693cdde313..021323879051 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -558,7 +558,8 @@ static int dmm32at_attach(struct comedi_device *dev,
 	}
 
 	if (it->options[1]) {
-		ret = request_irq(it->options[1], dmm32at_isr, 0,
+		ret = request_irq(it->options[1], dmm32at_isr,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c
index 05207a519755..fd85efad6201 100644
--- a/drivers/staging/comedi/drivers/dt2811.c
+++ b/drivers/staging/comedi/drivers/dt2811.c
@@ -565,7 +565,8 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	/* IRQ's 2,3,5,7 are valid for async command support */
 	if (it->options[1] <= 7  && (BIT(it->options[1]) & 0xac)) {
-		ret = request_irq(it->options[1], dt2811_interrupt, 0,
+		ret = request_irq(it->options[1], dt2811_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c
index d2c715737361..b52d2003f2fc 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -245,7 +245,8 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	i = inb(dev->iobase + DT2814_DATA);
 
 	if (it->options[1]) {
-		ret = request_irq(it->options[1], dt2814_interrupt, 0,
+		ret = request_irq(it->options[1], dt2814_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c
index 3be927f1d3a9..9e7a8f774f3c 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1045,7 +1045,7 @@ static void dt282x_alloc_dma(struct comedi_device *dev,
 	    dma_chan[1] < 5 || dma_chan[1] > 7)
 		return;
 
-	if (request_irq(irq_num, dt282x_interrupt, 0, dev->board_name, dev))
+	if (request_irq(irq_num, dt282x_interrupt, IRQF_USER_DATA, dev->board_name, dev))
 		return;
 
 	/* DMA uses two 4K buffers with separate DMA channels */
diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c
index 2edf3ee91300..0d7d59217343 100644
--- a/drivers/staging/comedi/drivers/dt3000.c
+++ b/drivers/staging/comedi/drivers/dt3000.c
@@ -637,7 +637,8 @@ static int dt3000_auto_attach(struct comedi_device *dev,
 		return -ENOMEM;
 
 	if (pcidev->irq) {
-		ret = request_irq(pcidev->irq, dt3k_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, dt3k_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c
index 4bdf44d82879..73295b0dd890 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -607,8 +607,7 @@ static int gsc_hpdi_auto_attach(struct comedi_device *dev,
 	gsc_hpdi_init_plx9080(dev);
 
 	/* get irq */
-	if (request_irq(pcidev->irq, gsc_hpdi_interrupt, IRQF_SHARED,
-			dev->board_name, dev)) {
+	if (request_irq(pcidev->irq, gsc_hpdi_interrupt, IRQF_SHARED | IRQF_USER_DATA, dev->board_name, dev)) {
 		dev_warn(dev->class_dev,
 			 "unable to allocate irq %u\n", pcidev->irq);
 		return -EINVAL;
diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c
index ee53571a8969..cb183b99cbad 100644
--- a/drivers/staging/comedi/drivers/me4000.c
+++ b/drivers/staging/comedi/drivers/me4000.c
@@ -1129,7 +1129,8 @@ static int me4000_auto_attach(struct comedi_device *dev,
 	me4000_reset(dev);
 
 	if (pcidev->irq > 0) {
-		result = request_irq(pcidev->irq, me4000_ai_isr, IRQF_SHARED,
+		result = request_irq(pcidev->irq, me4000_ai_isr,
+				     IRQF_SHARED | IRQF_USER_DATA,
 				     dev->board_name, dev);
 		if (result == 0) {
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
index 4d1eccb5041d..5611b3d34564 100644
--- a/drivers/staging/comedi/drivers/ni_6527.c
+++ b/drivers/staging/comedi/drivers/ni_6527.c
@@ -401,8 +401,8 @@ static int ni6527_auto_attach(struct comedi_device *dev,
 
 	ni6527_reset(dev);
 
-	ret = request_irq(pcidev->irq, ni6527_interrupt, IRQF_SHARED,
-			  dev->board_name, dev);
+	ret = request_irq(pcidev->irq, ni6527_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->board_name, dev);
 	if (ret == 0)
 		dev->irq = pcidev->irq;
 
diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c
index 996074e471d3..06aba4d9fb29 100644
--- a/drivers/staging/comedi/drivers/ni_65xx.c
+++ b/drivers/staging/comedi/drivers/ni_65xx.c
@@ -658,7 +658,8 @@ static int ni_65xx_auto_attach(struct comedi_device *dev,
 	writeb(0x00, dev->mmio + NI_65XX_CTRL_REG);
 
 	if (pcidev->irq) {
-		ret = request_irq(pcidev->irq, ni_65xx_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, ni_65xx_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c
index e70a461e723f..c68a98309ea6 100644
--- a/drivers/staging/comedi/drivers/ni_660x.c
+++ b/drivers/staging/comedi/drivers/ni_660x.c
@@ -1184,8 +1184,8 @@ static int ni_660x_auto_attach(struct comedi_device *dev,
 	for (i = 0; i < board->n_chips; ++i)
 		set_tio_counterswap(dev, i);
 
-	ret = request_irq(pcidev->irq, ni_660x_interrupt, IRQF_SHARED,
-			  dev->board_name, dev);
+	ret = request_irq(pcidev->irq, ni_660x_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev->board_name, dev);
 	if (ret < 0) {
 		dev_warn(dev->class_dev, " irq not available\n");
 		return ret;
diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 76e8d047f71e..98018c27ea26 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -649,7 +649,7 @@ static void a2150_alloc_irq_and_dma(struct comedi_device *dev,
 	    !((1 << irq_num) & 0xdef8) || !((1 << dma_chan) & 0xef))
 		return;
 
-	if (request_irq(irq_num, a2150_interrupt, 0, dev->board_name, dev))
+	if (request_irq(irq_num, a2150_interrupt, IRQF_USER_DATA, dev->board_name, dev))
 		return;
 
 	/* DMA uses 1 buffer */
diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c
index 2b7bfe0dd7f3..1b333b8b85a0 100644
--- a/drivers/staging/comedi/drivers/ni_atmio.c
+++ b/drivers/staging/comedi/drivers/ni_atmio.c
@@ -318,7 +318,8 @@ static int ni_atmio_attach(struct comedi_device *dev,
 	if (irq != 0) {
 		if (irq > 15 || ni_irqpin[irq] == -1)
 			return -EINVAL;
-		ret = request_irq(irq, ni_E_interrupt, 0,
+		ret = request_irq(irq, ni_E_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret < 0)
 			return -EINVAL;
diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c b/drivers/staging/comedi/drivers/ni_atmio16d.c
index 68ad9676f962..482516f2a7a3 100644
--- a/drivers/staging/comedi/drivers/ni_atmio16d.c
+++ b/drivers/staging/comedi/drivers/ni_atmio16d.c
@@ -601,7 +601,8 @@ static int atmio16d_attach(struct comedi_device *dev,
 	reset_atmio16d(dev);
 
 	if (it->options[1]) {
-		ret = request_irq(it->options[1], atmio16d_interrupt, 0,
+		ret = request_irq(it->options[1], atmio16d_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/ni_labpc_common.c b/drivers/staging/comedi/drivers/ni_labpc_common.c
index 406952f5521d..c7043ef7a767 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_common.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_common.c
@@ -1217,8 +1217,9 @@ int labpc_common_attach(struct comedi_device *dev,
 	}
 
 	if (irq) {
-		ret = request_irq(irq, labpc_interrupt, isr_flags,
-				  dev->board_name, dev);
+		ret = request_irq(irq, labpc_interrupt,
+				  isr_flags | IRQF_USER_DATA, dev->board_name,
+				  dev);
 		if (ret == 0)
 			dev->irq = irq;
 	}
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c
index b9a0dc6eac44..ac7aff073f44 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -949,7 +949,8 @@ static int nidio_auto_attach(struct comedi_device *dev,
 
 	irq = pcidev->irq;
 	if (irq) {
-		ret = request_irq(irq, nidio_interrupt, IRQF_SHARED,
+		ret = request_irq(irq, nidio_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = irq;
diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c
index 14b26fffe049..cdbac51a690c 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -1360,7 +1360,8 @@ static int pcimio_auto_attach(struct comedi_device *dev,
 
 	irq = pcidev->irq;
 	if (irq) {
-		ret = request_irq(irq, ni_E_interrupt, IRQF_SHARED,
+		ret = request_irq(irq, ni_E_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = irq;
diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c
index a5937206bf1c..de61ca3abf33 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -425,7 +425,8 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		return ret;
 
 	if (it->options[1] && it->options[1] <= board->maxirq) {
-		ret = request_irq(it->options[1], pcl711_interrupt, 0,
+		ret = request_irq(it->options[1], pcl711_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/pcl726.c b/drivers/staging/comedi/drivers/pcl726.c
index 0963d85873a9..669a13124343 100644
--- a/drivers/staging/comedi/drivers/pcl726.c
+++ b/drivers/staging/comedi/drivers/pcl726.c
@@ -328,7 +328,8 @@ static int pcl726_attach(struct comedi_device *dev,
 	 * user config option is valid and the board supports interrupts.
 	 */
 	if (it->options[1] && (board->irq_mask & (1 << it->options[1]))) {
-		ret = request_irq(it->options[1], pcl726_interrupt, 0,
+		ret = request_irq(it->options[1], pcl726_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0) {
 			/* External trigger source is from Pin-17 of CN3 */
diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c
index aefc1b849cf7..fe1af6ad4893 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -1152,7 +1152,8 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			return -ENOMEM;
 
 		if ((1 << it->options[1]) & board->irq_bits) {
-			ret = request_irq(it->options[1], pcl812_interrupt, 0,
+			ret = request_irq(it->options[1], pcl812_interrupt,
+					  IRQF_USER_DATA,
 					  dev->board_name, dev);
 			if (ret == 0)
 				dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c
index d87cf6d4a161..3976db1227af 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -579,7 +579,7 @@ static void pcl816_alloc_irq_and_dma(struct comedi_device *dev,
 	    !(dma_chan == 3 || dma_chan == 1))
 		return;
 
-	if (request_irq(irq_num, pcl816_interrupt, 0, dev->board_name, dev))
+	if (request_irq(irq_num, pcl816_interrupt, IRQF_USER_DATA, dev->board_name, dev))
 		return;
 
 	/* DMA uses two 16K buffers */
diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c
index 0af5315d4357..d207a9048a82 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -997,7 +997,8 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	/* we can use IRQ 2-7 for async command support */
 	if (it->options[1] >= 2 && it->options[1] <= 7) {
-		ret = request_irq(it->options[1], pcl818_interrupt, 0,
+		ret = request_irq(it->options[1], pcl818_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
index 72af1776f785..4e08b0c12cf3 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -682,7 +682,8 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	pcmmio_reset(dev);
 
 	if (it->options[1]) {
-		ret = request_irq(it->options[1], interrupt_pcmmio, 0,
+		ret = request_irq(it->options[1], interrupt_pcmmio,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0) {
 			dev->irq = it->options[1];
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 743fb226e2e4..cdcc5fca7402 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -545,7 +545,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	if (it->options[1]) {
 		/* request the irq for the 1st asic */
-		ret = request_irq(it->options[1], pcmuio_interrupt, 0,
+		ret = request_irq(it->options[1], pcmuio_interrupt,
+				  IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = it->options[1];
@@ -557,7 +558,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			devpriv->irq2 = it->options[2];
 		} else if (it->options[2]) {
 			/* request the irq for the 2nd asic */
-			ret = request_irq(it->options[2], pcmuio_interrupt, 0,
+			ret = request_irq(it->options[2], pcmuio_interrupt,
+					  IRQF_USER_DATA,
 					  dev->board_name, dev);
 			if (ret == 0)
 				devpriv->irq2 = it->options[2];
diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c
index bb400e08f0bc..17460b0fb2e2 100644
--- a/drivers/staging/comedi/drivers/rtd520.c
+++ b/drivers/staging/comedi/drivers/rtd520.c
@@ -1238,7 +1238,8 @@ static int rtd_auto_attach(struct comedi_device *dev,
 	rtd_pci_latency_quirk(dev, pcidev);
 
 	if (pcidev->irq) {
-		ret = request_irq(pcidev->irq, rtd_interrupt, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, rtd_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 		if (ret == 0)
 			dev->irq = pcidev->irq;
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index f5af6f4069dc..2c6e135b8838 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -2449,7 +2449,8 @@ static int s626_auto_attach(struct comedi_device *dev,
 		return ret;
 
 	if (pcidev->irq) {
-		ret = request_irq(pcidev->irq, s626_irq_handler, IRQF_SHARED,
+		ret = request_irq(pcidev->irq, s626_irq_handler,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev->board_name, dev);
 
 		if (ret == 0)
diff --git a/drivers/staging/gasket/gasket_interrupt.c b/drivers/staging/gasket/gasket_interrupt.c
index ad5657d213f0..c0c73b1bad90 100644
--- a/drivers/staging/gasket/gasket_interrupt.c
+++ b/drivers/staging/gasket/gasket_interrupt.c
@@ -206,7 +206,8 @@ gasket_interrupt_msix_init(struct gasket_interrupt_data *interrupt_data)
 
 	for (i = 0; i < interrupt_data->num_interrupts; i++) {
 		ret = request_irq(interrupt_data->msix_entries[i].vector,
-				  gasket_msix_interrupt_handler, 0,
+				  gasket_msix_interrupt_handler,
+				  IRQF_USER_DATA,
 				  interrupt_data->name, interrupt_data);
 
 		if (ret) {
diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index d4520490cf6d..8796e7af3541 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -328,8 +328,9 @@ static int goldfish_audio_probe(struct platform_device *pdev)
 	data->write_buffer2 = data->buffer_virt + WRITE_BUFFER_SIZE;
 	data->read_buffer = data->buffer_virt + 2 * WRITE_BUFFER_SIZE;
 
-	ret = devm_request_irq(&pdev->dev, data->irq, goldfish_audio_interrupt,
-			       IRQF_SHARED, pdev->name, data);
+	ret = devm_request_irq(&pdev->dev, data->irq,
+			       goldfish_audio_interrupt,
+			       IRQF_SHARED | IRQF_USER_DATA, pdev->name, data);
 	if (ret) {
 		dev_err(&pdev->dev, "request_irq failed\n");
 		return ret;
diff --git a/drivers/staging/iio/adc/ad7606.c b/drivers/staging/iio/adc/ad7606.c
index 7308fa8fbb4c..64140840b4c1 100644
--- a/drivers/staging/iio/adc/ad7606.c
+++ b/drivers/staging/iio/adc/ad7606.c
@@ -480,7 +480,8 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
 	if (ret)
 		dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
 
-	ret = request_irq(irq, ad7606_interrupt, IRQF_TRIGGER_FALLING, name,
+	ret = request_irq(irq, ad7606_interrupt,
+			  IRQF_TRIGGER_FALLING | IRQF_USER_DATA, name,
 			  indio_dev);
 	if (ret)
 		goto error_disable_reg;
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index d9b02ff66259..063801da275b 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2593,8 +2593,8 @@ static int bcm2048_i2c_driver_probe(struct i2c_client *client)
 	INIT_WORK(&bdev->work, bcm2048_work);
 
 	if (client->irq) {
-		err = request_irq(client->irq,
-				  bcm2048_handler, IRQF_TRIGGER_FALLING,
+		err = request_irq(client->irq, bcm2048_handler,
+				  IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
 				  client->name, bdev);
 		if (err < 0) {
 			dev_err(&client->dev, "Could not request IRQ\n");
diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c
index 94dadbba7cd5..e3c7b11958dd 100644
--- a/drivers/staging/media/zoran/zoran_card.c
+++ b/drivers/staging/media/zoran/zoran_card.c
@@ -1293,7 +1293,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	result = request_irq(zr->pci_dev->irq, zoran_irq,
-			     IRQF_SHARED, ZR_DEVNAME(zr), zr);
+			     IRQF_SHARED | IRQF_USER_DATA, ZR_DEVNAME(zr), zr);
 	if (result < 0) {
 		if (result == -EINVAL) {
 			dprintk(1,
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 31fbc1a75b06..d2dbd23c4841 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -802,7 +802,8 @@ static int dim2_probe(struct platform_device *pdev)
 		goto err_shutdown_dim;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq, dim2_ahb_isr, 0,
+	ret = devm_request_irq(&pdev->dev, irq, dim2_ahb_isr,
+			       IRQF_USER_DATA,
 			       "dim2_ahb0_int", dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request ahb0_int irq %d\n", irq);
@@ -816,7 +817,8 @@ static int dim2_probe(struct platform_device *pdev)
 		goto err_shutdown_dim;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq, dim2_mlb_isr, 0,
+	ret = devm_request_irq(&pdev->dev, irq, dim2_mlb_isr,
+			       IRQF_USER_DATA,
 			       "dim2_mlb_int", dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to request mlb_int irq %d\n", irq);
diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
index 4a4fc1005932..60a33ea89b1e 100644
--- a/drivers/staging/most/i2c/i2c.c
+++ b/drivers/staging/most/i2c/i2c.c
@@ -88,7 +88,8 @@ static int configure_channel(struct most_interface *most_iface,
 				return -ENOENT;
 			}
 			dev->rx.int_disabled = false;
-			ret = request_irq(dev->client->irq, most_irq_handler, 0,
+			ret = request_irq(dev->client->irq, most_irq_handler,
+					  IRQF_USER_DATA,
 					  dev->client->name, dev);
 			if (ret) {
 				pr_err("request_irq(%d) failed: %d\n",
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
index 80b8d4153414..d089114098ef 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
@@ -98,7 +98,7 @@ static int dcon_init_xo_1(struct dcon_priv *dcon)
 	outb(lob, 0x4d0);
 
 	/* Register the interrupt handler */
-	if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", dcon)) {
+	if (request_irq(DCON_IRQ, &dcon_interrupt, IRQF_USER_DATA, "DCON", dcon)) {
 		pr_err("failed to request DCON's irq\n");
 		return -EIO;
 	}
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
index 838daa2be3ef..e5efb7421f92 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
@@ -71,7 +71,7 @@ static int dcon_init_xo_1_5(struct dcon_priv *dcon)
 
 	/* we're sharing the IRQ with ACPI */
 	irq = acpi_gbl_FADT.sci_interrupt;
-	if (request_irq(irq, &dcon_interrupt, IRQF_SHARED, "DCON", dcon)) {
+	if (request_irq(irq, &dcon_interrupt, IRQF_SHARED | IRQF_USER_DATA, "DCON", dcon)) {
 		pr_err("DCON (IRQ%d) allocation failed\n", irq);
 		return 1;
 	}
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index b2314636dc89..e7240abab54e 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1036,10 +1036,8 @@ static int setup_gpio(struct pi433_device *device)
 			device->gpiod[i] = ERR_PTR(-EINVAL);
 			return device->irq_num[i];
 		}
-		retval = request_irq(device->irq_num[i],
-				     DIO_irq_handler[i],
-				     0, /* flags */
-				     name,
+		retval = request_irq(device->irq_num[i], DIO_irq_handler[i],
+				     IRQF_USER_DATA, name,
 				     device);
 
 		if (retval)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 96f265eee007..6070e3da1be6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1081,7 +1081,7 @@ static short _rtl92e_init(struct net_device *dev)
 		    0);
 
 	rtl92e_irq_disable(dev);
-	if (request_irq(dev->irq, _rtl92e_irq, IRQF_SHARED, dev->name, dev)) {
+	if (request_irq(dev->irq, _rtl92e_irq, IRQF_SHARED | IRQF_USER_DATA, dev->name, dev)) {
 		netdev_err(dev, "Error allocating IRQ %d", dev->irq);
 		return -1;
 	}
diff --git a/drivers/staging/rtlwifi/pci.c b/drivers/staging/rtlwifi/pci.c
index 4bb5703bd715..473d9cac1060 100644
--- a/drivers/staging/rtlwifi/pci.c
+++ b/drivers/staging/rtlwifi/pci.c
@@ -2135,7 +2135,7 @@ static int rtl_pci_intr_mode_msi(struct ieee80211_hw *hw)
 		return ret;
 
 	ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, hw);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hw);
 	if (ret < 0) {
 		pci_disable_msi(rtlpci->pdev);
 		return ret;
@@ -2156,7 +2156,7 @@ static int rtl_pci_intr_mode_legacy(struct ieee80211_hw *hw)
 	int ret;
 
 	ret = request_irq(rtlpci->pdev->irq, &_rtl_pci_interrupt,
-			  IRQF_SHARED, KBUILD_MODNAME, hw);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hw);
 	if (ret < 0)
 		return ret;
 
diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index fa597953e9a0..bf11d96531e6 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -243,9 +243,7 @@ static int rtsx_acquire_irq(struct rtsx_dev *dev)
 	dev_info(&dev->pci->dev, "%s: chip->msi_en = %d, pci->irq = %d\n",
 		 __func__, chip->msi_en, dev->pci->irq);
 
-	if (request_irq(dev->pci->irq, rtsx_interrupt,
-			chip->msi_en ? 0 : IRQF_SHARED,
-			CR_DRIVER_NAME, dev)) {
+	if (request_irq(dev->pci->irq, rtsx_interrupt, (chip->msi_en ? 0 : IRQF_SHARED) | IRQF_USER_DATA, CR_DRIVER_NAME, dev)) {
 		dev_err(&dev->pci->dev,
 			"rtsx: unable to grab IRQ %d, disabling device\n",
 			dev->pci->irq);
diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c
index 177a2988641c..49dbedd2be0d 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -130,8 +130,9 @@ static void start_serial_interrupt(int irq)
 	if (!synth->read_buff_add)
 		return;
 
-	rv = request_irq(irq, synth_readbuf_handler, IRQF_SHARED,
-			 "serial", (void *)synth_readbuf_handler);
+	rv = request_irq(irq, synth_readbuf_handler,
+			 IRQF_SHARED | IRQF_USER_DATA, "serial",
+			 (void *)synth_readbuf_handler);
 
 	if (rv)
 		pr_err("Unable to request Speakup serial I R Q\n");
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index c9097e7367d8..32544b8b75d3 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1227,7 +1227,7 @@ static int vnt_start(struct ieee80211_hw *hw)
 		return -ENOMEM;
 
 	ret = request_irq(priv->pcid->irq, vnt_interrupt,
-			  IRQF_SHARED, "vt6655", priv);
+			  IRQF_SHARED | IRQF_USER_DATA, "vt6655", priv);
 	if (ret) {
 		dev_dbg(&priv->pcid->dev, "failed to start irq\n");
 		goto err_free_rings;
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 097328d8e943..fd1326340b2a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -772,8 +772,10 @@ static int ti_bandgap_tshut_init(struct ti_bandgap *bgp,
 		return status;
 	}
 
-	status = request_irq(gpio_to_irq(gpio_nr), ti_bandgap_tshut_irq_handler,
-			     IRQF_TRIGGER_RISING, "tshut", NULL);
+	status = request_irq(gpio_to_irq(gpio_nr),
+			     ti_bandgap_tshut_irq_handler,
+			     IRQF_TRIGGER_RISING | IRQF_USER_DATA, "tshut",
+			     NULL);
 	if (status) {
 		gpio_free(gpio_nr);
 		dev_err(bgp->dev, "request irq failed for TSHUT");
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 9aa44f9762a3..262bff1e829b 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -400,7 +400,8 @@ static int ring_request_msix(struct tb_ring *ring, bool no_suspend)
 		return ring->irq;
 
 	irqflags = no_suspend ? IRQF_NO_SUSPEND : 0;
-	return request_irq(ring->irq, ring_msix, irqflags, "thunderbolt", ring);
+	return request_irq(ring->irq, ring_msix, irqflags | IRQF_USER_DATA,
+			   "thunderbolt", ring);
 }
 
 static void ring_release_msix(struct tb_ring *ring)
@@ -986,7 +987,8 @@ static int nhi_init_msi(struct tb_nhi *nhi)
 			return irq;
 
 		res = devm_request_irq(&pdev->dev, irq, nhi_msi,
-				       IRQF_NO_SUSPEND, "thunderbolt", nhi);
+				       IRQF_NO_SUSPEND | IRQF_USER_DATA,
+				       "thunderbolt", nhi);
 		if (res) {
 			dev_err(&pdev->dev, "request_irq failed, aborting\n");
 			return res;
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index 4562c8060d09..b564886c39ac 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -3306,8 +3306,7 @@ static int __init cy_detect_isa(void)
 		}
 
 		/* allocate IRQ */
-		if (request_irq(cy_isa_irq, cyy_interrupt,
-				0, "Cyclom-Y", card)) {
+		if (request_irq(cy_isa_irq, cyy_interrupt, IRQF_USER_DATA, "Cyclom-Y", card)) {
 			printk(KERN_ERR "Cyclom-Y/ISA found at 0x%lx, but "
 				"could not allocate IRQ#%d.\n",
 				(unsigned long)cy_isa_address, cy_isa_irq);
@@ -3790,7 +3789,8 @@ static int cy_pci_probe(struct pci_dev *pdev,
 			device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi) {
 		/* allocate IRQ */
 		retval = request_irq(irq, cyy_interrupt,
-				IRQF_SHARED, "Cyclom-Y", card);
+				     IRQF_SHARED | IRQF_USER_DATA, "Cyclom-Y",
+				     card);
 		if (retval) {
 			dev_err(&pdev->dev, "could not allocate IRQ\n");
 			goto err_unmap;
@@ -3809,7 +3809,8 @@ static int cy_pci_probe(struct pci_dev *pdev,
 		/* allocate IRQ only if board has an IRQ */
 		if (irq != 0 && irq != 255) {
 			retval = request_irq(irq, cyz_interrupt,
-					IRQF_SHARED, "Cyclades-Z", card);
+					     IRQF_SHARED | IRQF_USER_DATA,
+					     "Cyclades-Z", card);
 			if (retval) {
 				dev_err(&pdev->dev, "could not allocate IRQ\n");
 				goto err_unmap;
diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c
index c8c5cdfc5e19..608922f7c22d 100644
--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -378,8 +378,8 @@ static int goldfish_tty_probe(struct platform_device *pdev)
 
 	writel(GOLDFISH_TTY_CMD_INT_DISABLE, base + GOLDFISH_TTY_REG_CMD);
 
-	ret = request_irq(irq, goldfish_tty_interrupt, IRQF_SHARED,
-			  "goldfish_tty", qtty);
+	ret = request_irq(irq, goldfish_tty_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, "goldfish_tty", qtty);
 	if (ret) {
 		pr_err("goldfish_tty: No IRQ available!\n");
 		goto err_dec_line_count;
diff --git a/drivers/tty/hvc/hvc_irq.c b/drivers/tty/hvc/hvc_irq.c
index 4b255dfef2cc..e12dff7e9658 100644
--- a/drivers/tty/hvc/hvc_irq.c
+++ b/drivers/tty/hvc/hvc_irq.c
@@ -34,8 +34,8 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)
 		hp->irq_requested = 0;
 		return 0;
 	}
-	rc = request_irq(irq, hvc_handle_interrupt, hp->flags,
-			"hvc_console", hp);
+	rc = request_irq(irq, hvc_handle_interrupt,
+			 hp->flags | IRQF_USER_DATA, "hvc_console", hp);
 	if (!rc)
 		hp->irq_requested = 1;
 	return rc;
diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
index e04a43e89f6b..803226775c8e 100644
--- a/drivers/tty/isicom.c
+++ b/drivers/tty/isicom.c
@@ -1559,7 +1559,7 @@ static int isicom_probe(struct pci_dev *pdev,
 	}
 
 	retval = request_irq(board->irq, isicom_interrupt,
-			IRQF_SHARED, ISICOM_NAME, board);
+			     IRQF_SHARED | IRQF_USER_DATA, ISICOM_NAME, board);
 	if (retval < 0) {
 		dev_err(&pdev->dev, "Could not install handler at Irq %d. "
 			"Card%d will be disabled.\n", board->irq, index + 1);
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 9d00ff5ef961..772497d057de 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -2413,8 +2413,8 @@ static int mxser_initbrd(struct mxser_board *brd)
 			info->ioaddr + UART_IER);
 	}
 
-	retval = request_irq(brd->irq, mxser_interrupt, IRQF_SHARED, "mxser",
-			brd);
+	retval = request_irq(brd->irq, mxser_interrupt,
+			     IRQF_SHARED | IRQF_USER_DATA, "mxser", brd);
 	if (retval) {
 		for (i = 0; i < brd->info->nports; i++)
 			tty_port_destroy(&brd->ports[i].port);
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index e441221e04b9..2b161a64a0c8 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -210,7 +210,8 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
 		spin_unlock_irq(&i->lock);
 		irq_flags |= up->port.irqflags;
 		ret = request_irq(up->port.irq, serial8250_interrupt,
-				  irq_flags, up->port.name, i);
+				  irq_flags | IRQF_USER_DATA, up->port.name,
+				  i);
 		if (ret < 0)
 			serial_do_unlink(i, up);
 	}
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index 0089aa305ef9..4d600c39b518 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -499,7 +499,7 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 	uart.port.dev = &pcidev->dev;
 
 	rc = devm_request_irq(&pcidev->dev, uart.port.irq, exar_misc_handler,
-			 IRQF_SHARED, "exar_uart", priv);
+			      IRQF_SHARED | IRQF_USER_DATA, "exar_uart", priv);
 	if (rc)
 		return rc;
 
diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index c90e503d6b57..4f54bf976dca 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -213,8 +213,8 @@ static int altera_jtaguart_startup(struct uart_port *port)
 	unsigned long flags;
 	int ret;
 
-	ret = request_irq(port->irq, altera_jtaguart_interrupt, 0,
-			DRV_NAME, port);
+	ret = request_irq(port->irq, altera_jtaguart_interrupt,
+			  IRQF_USER_DATA, DRV_NAME, port);
 	if (ret) {
 		pr_err(DRV_NAME ": unable to attach Altera JTAG UART %d "
 		       "interrupt vector=%d\n", port->line, port->irq);
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 0e487ce091ac..150c193dfb9c 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -328,8 +328,9 @@ static int altera_uart_startup(struct uart_port *port)
 	} else {
 		int ret;
 
-		ret = request_irq(port->irq, altera_uart_interrupt, 0,
-				DRV_NAME, port);
+		ret = request_irq(port->irq, altera_uart_interrupt,
+				  IRQF_USER_DATA, DRV_NAME,
+				  port);
 		if (ret) {
 			pr_err(DRV_NAME ": unable to attach Altera UART %d "
 			       "interrupt vector=%d\n", port->line, port->irq);
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index d904a3a345e7..63f9d11a93da 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -339,7 +339,7 @@ static int arc_serial_startup(struct uart_port *port)
 	/* Before we hook up the ISR, Disable all UART Interrupts */
 	UART_ALL_IRQ_DISABLE(port);
 
-	if (request_irq(port->irq, arc_serial_isr, 0, "arc uart rx-tx", port)) {
+	if (request_irq(port->irq, arc_serial_isr, IRQF_USER_DATA, "arc uart rx-tx", port)) {
 		dev_warn(port->dev, "Unable to attach ARC UART intr\n");
 		return -EBUSY;
 	}
diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c
index f460cca139e2..a19ea82d617e 100644
--- a/drivers/tty/serial/digicolor-usart.c
+++ b/drivers/tty/serial/digicolor-usart.c
@@ -496,7 +496,8 @@ static int digicolor_uart_probe(struct platform_device *pdev)
 
 	INIT_DELAYED_WORK(&dp->rx_poll_work, digicolor_rx_poll);
 
-	ret = devm_request_irq(&pdev->dev, dp->port.irq, digicolor_uart_int, 0,
+	ret = devm_request_irq(&pdev->dev, dp->port.irq, digicolor_uart_int,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), &dp->port);
 	if (ret)
 		return ret;
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index debdd1b9e01a..39950a1c45a8 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2205,12 +2205,16 @@ static int lpuart_probe(struct platform_device *pdev)
 
 	if (lpuart_is_32(sport)) {
 		lpuart_reg.cons = LPUART32_CONSOLE;
-		ret = devm_request_irq(&pdev->dev, sport->port.irq, lpuart32_int, 0,
-					DRIVER_NAME, sport);
+		ret = devm_request_irq(&pdev->dev, sport->port.irq,
+				       lpuart32_int,
+				       IRQF_USER_DATA,
+				       DRIVER_NAME, sport);
 	} else {
 		lpuart_reg.cons = LPUART_CONSOLE;
-		ret = devm_request_irq(&pdev->dev, sport->port.irq, lpuart_int, 0,
-					DRIVER_NAME, sport);
+		ret = devm_request_irq(&pdev->dev, sport->port.irq,
+				       lpuart_int,
+				       IRQF_USER_DATA,
+				       DRIVER_NAME, sport);
 	}
 
 	if (ret)
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index ffefd218761e..4d796a82f311 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -1163,8 +1163,8 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
 
 	ret = request_irq(gpio_to_irq(ifx_dev->gpio.reset_out),
 			  ifx_spi_reset_interrupt,
-			  IRQF_TRIGGER_RISING|IRQF_TRIGGER_FALLING, DRVNAME,
-			  ifx_dev);
+			  IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_USER_DATA,
+			  DRVNAME, ifx_dev);
 	if (ret) {
 		dev_err(&spi->dev, "Unable to get irq %x\n",
 			gpio_to_irq(ifx_dev->gpio.reset_out));
@@ -1174,7 +1174,8 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
 	ret = ifx_spi_reset(ifx_dev);
 
 	ret = request_irq(gpio_to_irq(ifx_dev->gpio.srdy),
-			  ifx_spi_srdy_interrupt, IRQF_TRIGGER_RISING, DRVNAME,
+			  ifx_spi_srdy_interrupt,
+			  IRQF_TRIGGER_RISING | IRQF_USER_DATA, DRVNAME,
 			  ifx_dev);
 	if (ret) {
 		dev_err(&spi->dev, "Unable to get irq %x",
diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
index 592e51d8944e..2cf37114dbdd 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -215,7 +215,8 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -ENXIO;
 	}
 
-	rc = request_irq(brd->irq, brd->bd_ops->intr, IRQF_SHARED, "JSM", brd);
+	rc = request_irq(brd->irq, brd->bd_ops->intr,
+			 IRQF_SHARED | IRQF_USER_DATA, "JSM", brd);
 	if (rc) {
 		dev_warn(&pdev->dev, "Failed to hook IRQ %d\n", brd->irq);
 		goto out_iounmap;
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 371569a0fd00..437c22dbc7e9 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -603,8 +603,7 @@ static int max3100_startup(struct uart_port *port)
 	}
 	INIT_WORK(&s->work, max3100_work);
 
-	if (request_irq(s->irq, max3100_irq,
-			IRQF_TRIGGER_FALLING, "max3100", s) < 0) {
+	if (request_irq(s->irq, max3100_irq, IRQF_TRIGGER_FALLING | IRQF_USER_DATA, "max3100", s) < 0) {
 		dev_warn(&s->spi->dev, "cannot allocate irq %d\n", s->irq);
 		s->irq = 0;
 		destroy_workqueue(s->workqueue);
diff --git a/drivers/tty/serial/men_z135_uart.c b/drivers/tty/serial/men_z135_uart.c
index ef89534dd760..ca87d7c99f76 100644
--- a/drivers/tty/serial/men_z135_uart.c
+++ b/drivers/tty/serial/men_z135_uart.c
@@ -440,8 +440,8 @@ static int men_z135_request_irq(struct men_z135_port *uart)
 	struct uart_port *port = &uart->port;
 	int err = 0;
 
-	err = request_irq(port->irq, men_z135_intr, IRQF_SHARED,
-			"men_z135_intr", uart);
+	err = request_irq(port->irq, men_z135_intr,
+			  IRQF_SHARED | IRQF_USER_DATA, "men_z135_intr", uart);
 	if (err)
 		dev_err(dev, "Error %d getting interrupt\n", err);
 
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 9ed121f08a54..019d58228f55 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1326,8 +1326,8 @@ static int pch_uart_startup(struct uart_port *port)
 	if (ret < 0)
 		return ret;
 
-	ret = request_irq(priv->port.irq, pch_uart_interrupt, IRQF_SHARED,
-			priv->irq_name, priv);
+	ret = request_irq(priv->port.irq, pch_uart_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, priv->irq_name, priv);
 	if (ret < 0)
 		return ret;
 
diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c
index 5690c09cc041..2697acd6bff8 100644
--- a/drivers/tty/serial/rp2.c
+++ b/drivers/tty/serial/rp2.c
@@ -781,7 +781,7 @@ static int rp2_probe(struct pci_dev *pdev,
 	card->ports = ports;
 
 	rc = devm_request_irq(&pdev->dev, pdev->irq, rp2_uart_interrupt,
-			      IRQF_SHARED, DRV_NAME, card);
+			      IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, card);
 	if (rc)
 		return rc;
 
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 268098681856..c99e7ce41db4 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1298,7 +1298,7 @@ static int sc16is7xx_probe(struct device *dev,
 
 	/* Setup interrupt */
 	ret = devm_request_irq(dev, irq, sc16is7xx_irq,
-			       flags, dev_name(dev), s);
+			       flags | IRQF_USER_DATA, dev_name(dev), s);
 	if (!ret)
 		return 0;
 
diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c
index 19d38b504e27..7febe4bfb676 100644
--- a/drivers/tty/serial/timbuart.c
+++ b/drivers/tty/serial/timbuart.c
@@ -250,8 +250,8 @@ static int timbuart_startup(struct uart_port *port)
 	iowrite32(RXBAF | RXBF | RXTT | CTS_DELTA,
 		port->membase + TIMBUART_IER);
 
-	return request_irq(port->irq, timbuart_handleinterrupt, IRQF_SHARED,
-		"timb-uart", uart);
+	return request_irq(port->irq, timbuart_handleinterrupt,
+			   IRQF_SHARED | IRQF_USER_DATA, "timb-uart", uart);
 }
 
 static void timbuart_shutdown(struct uart_port *port)
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index b8b912b5a8b9..5d5a89b2fa60 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -280,7 +280,8 @@ static int ulite_startup(struct uart_port *port)
 		return ret;
 	}
 
-	ret = request_irq(port->irq, ulite_isr, IRQF_SHARED | IRQF_TRIGGER_RISING,
+	ret = request_irq(port->irq, ulite_isr,
+			  IRQF_SHARED | IRQF_TRIGGER_RISING | IRQF_USER_DATA,
 			  "uartlite", port);
 	if (ret)
 		return ret;
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 094f2958cb2b..76ebb8db3d4c 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -861,7 +861,9 @@ static int cdns_uart_startup(struct uart_port *port)
 
 	spin_unlock_irqrestore(&port->lock, flags);
 
-	ret = request_irq(port->irq, cdns_uart_isr, 0, CDNS_UART_NAME, port);
+	ret = request_irq(port->irq, cdns_uart_isr,
+			  IRQF_USER_DATA, CDNS_UART_NAME,
+			  port);
 	if (ret) {
 		dev_err(port->dev, "request_irq '%d' failed with %d\n",
 			port->irq, ret);
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index d55c858d6058..3a885131f45e 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -4032,8 +4032,7 @@ static int mgsl_claim_resources(struct mgsl_struct *info)
 	}
 	info->io_addr_requested = true;
 	
-	if ( request_irq(info->irq_level,mgsl_interrupt,info->irq_flags,
-		info->device_name, info ) < 0 ) {
+	if (request_irq(info->irq_level, mgsl_interrupt, info->irq_flags | IRQF_USER_DATA, info->device_name, info) < 0 ) {
 		printk( "%s(%d):Can't request interrupt on device %s IRQ=%d\n",
 			__FILE__,__LINE__,info->device_name, info->irq_level );
 		goto errout;
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index e8a9047de451..4b9d1b347673 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -3635,11 +3635,7 @@ static void device_init(int adapter_num, struct pci_dev *pdev)
 			alloc_dma_bufs(port_array[i]);
 		}
 
-		if (request_irq(port_array[0]->irq_level,
-					slgt_interrupt,
-					port_array[0]->irq_flags,
-					port_array[0]->device_name,
-					port_array[0]) < 0) {
+		if (request_irq(port_array[0]->irq_level, slgt_interrupt, port_array[0]->irq_flags | IRQF_USER_DATA, port_array[0]->device_name, port_array[0]) < 0) {
 			DBGERR(("%s request_irq failed IRQ=%d\n",
 				port_array[0]->device_name,
 				port_array[0]->irq_level));
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index fcb91bf7a15b..50b1e41501cf 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -3837,10 +3837,9 @@ static int device_init(int adapter_num, struct pci_dev *pdev)
 		}
 
 		rc = request_irq(port_array[0]->irq_level,
-					synclinkmp_interrupt,
-					port_array[0]->irq_flags,
-					port_array[0]->device_name,
-					port_array[0]);
+				 synclinkmp_interrupt,
+				 port_array[0]->irq_flags | IRQF_USER_DATA,
+				 port_array[0]->device_name, port_array[0]);
 		if ( rc ) {
 			printk( "%s(%d):%s Can't request interrupt, IRQ=%d\n",
 				__FILE__,__LINE__,
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 131342280b46..b9f21495141b 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -973,7 +973,8 @@ int __uio_register_device(struct module *owner,
 		 * freed until they are released.
 		 */
 		ret = request_irq(info->irq, uio_interrupt,
-				  info->irq_flags, info->name, idev);
+				  info->irq_flags | IRQF_USER_DATA,
+				  info->name, idev);
 		if (ret) {
 			info->uio_dev = NULL;
 			goto err_request_irq;
diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c
index 53838e7d4eef..db2532530953 100644
--- a/drivers/usb/c67x00/c67x00-drv.c
+++ b/drivers/usb/c67x00/c67x00-drv.c
@@ -146,7 +146,8 @@ static int c67x00_drv_probe(struct platform_device *pdev)
 	c67x00_ll_init(c67x00);
 	c67x00_ll_hpi_reg_init(c67x00);
 
-	ret = request_irq(res2->start, c67x00_irq, 0, pdev->name, c67x00);
+	ret = request_irq(res2->start, c67x00_irq,
+			  IRQF_USER_DATA, pdev->name, c67x00);
 	if (ret) {
 		dev_err(&pdev->dev, "Cannot claim IRQ\n");
 		goto request_irq_failed;
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 7bfcbb23c2a4..7c8d5edb9819 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1060,8 +1060,9 @@ static int ci_hdrc_probe(struct platform_device *pdev)
 		}
 	}
 
-	ret = devm_request_irq(dev, ci->irq, ci_irq, IRQF_SHARED,
-			ci->platdata->name, ci);
+	ret = devm_request_irq(dev, ci->irq, ci_irq,
+			       IRQF_SHARED | IRQF_USER_DATA,
+			       ci->platdata->name, ci);
 	if (ret)
 		goto stop;
 
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index be47f96e810d..29790c4110fe 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2675,8 +2675,9 @@ static int usb_hcd_request_irqs(struct usb_hcd *hcd,
 
 		snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d",
 				hcd->driver->description, hcd->self.busnum);
-		retval = request_irq(irqnum, &usb_hcd_irq, irqflags,
-				hcd->irq_descr, hcd);
+		retval = request_irq(irqnum, &usb_hcd_irq,
+				     irqflags | IRQF_USER_DATA,
+				     hcd->irq_descr, hcd);
 		if (retval != 0) {
 			dev_err(hcd->self.controller,
 					"request interrupt %d failed\n",
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 55ef3cc2701b..55bf64169647 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -4779,7 +4779,8 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
 	}
 
 	ret = devm_request_irq(hsotg->dev, hsotg->irq, dwc2_hsotg_irq,
-			       IRQF_SHARED, dev_name(hsotg->dev), hsotg);
+			       IRQF_SHARED | IRQF_USER_DATA,
+			       dev_name(hsotg->dev), hsotg);
 	if (ret < 0) {
 		dev_err(dev, "cannot claim IRQ for gadget\n");
 		return ret;
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index c0b64d483552..153e2dff52ec 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -427,7 +427,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
 	dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
 		hsotg->irq);
 	retval = devm_request_irq(hsotg->dev, hsotg->irq,
-				  dwc2_handle_common_intr, IRQF_SHARED,
+				  dwc2_handle_common_intr,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  dev_name(hsotg->dev), hsotg);
 	if (retval)
 		return retval;
diff --git a/drivers/usb/gadget/udc/amd5536udc_pci.c b/drivers/usb/gadget/udc/amd5536udc_pci.c
index 57b6f66331cf..8a629e2031ee 100644
--- a/drivers/usb/gadget/udc/amd5536udc_pci.c
+++ b/drivers/usb/gadget/udc/amd5536udc_pci.c
@@ -140,7 +140,7 @@ static int udc_pci_probe(
 	dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR);
 	dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
 
-	if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
+	if (request_irq(pdev->irq, udc_irq, IRQF_SHARED | IRQF_USER_DATA, name, dev) != 0) {
 		dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
 		retval = -EBUSY;
 		goto err_irq;
diff --git a/drivers/usb/gadget/udc/bdc/bdc_udc.c b/drivers/usb/gadget/udc/bdc/bdc_udc.c
index 7bfd58c846f7..6ddd31aa7f95 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_udc.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_udc.c
@@ -530,7 +530,8 @@ int bdc_udc_init(struct bdc *bdc)
 
 	bdc->gadget.name = BRCM_BDC_NAME;
 	ret = devm_request_irq(bdc->dev, bdc->irq, bdc_udc_interrupt,
-				IRQF_SHARED , BRCM_BDC_NAME, bdc);
+			       IRQF_SHARED | IRQF_USER_DATA, BRCM_BDC_NAME,
+			       bdc);
 	if (ret) {
 		dev_err(bdc->dev,
 			"failed to request irq #%d %d\n",
diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c
index bc6abaea907d..19a0a5449b60 100644
--- a/drivers/usb/gadget/udc/fotg210-udc.c
+++ b/drivers/usb/gadget/udc/fotg210-udc.c
@@ -1168,8 +1168,8 @@ static int fotg210_udc_probe(struct platform_device *pdev)
 
 	fotg210_disable_unplug(fotg210);
 
-	ret = request_irq(ires->start, fotg210_irq, IRQF_SHARED,
-			  udc_name, fotg210);
+	ret = request_irq(ires->start, fotg210_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, udc_name, fotg210);
 	if (ret < 0) {
 		pr_err("request_irq error (%d)\n", ret);
 		goto err_req;
diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c
index 263804d154a7..94daba652c50 100644
--- a/drivers/usb/gadget/udc/fusb300_udc.c
+++ b/drivers/usb/gadget/udc/fusb300_udc.c
@@ -1418,15 +1418,15 @@ static int fusb300_probe(struct platform_device *pdev)
 	fusb300->gadget.name = udc_name;
 	fusb300->reg = reg;
 
-	ret = request_irq(ires->start, fusb300_irq, IRQF_SHARED,
-			  udc_name, fusb300);
+	ret = request_irq(ires->start, fusb300_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, udc_name, fusb300);
 	if (ret < 0) {
 		pr_err("request_irq error (%d)\n", ret);
 		goto clean_up;
 	}
 
 	ret = request_irq(ires1->start, fusb300_irq,
-			IRQF_SHARED, udc_name, fusb300);
+			  IRQF_SHARED | IRQF_USER_DATA, udc_name, fusb300);
 	if (ret < 0) {
 		pr_err("request_irq1 error (%d)\n", ret);
 		goto clean_up;
diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c
index c3721225b61e..cdad54ba2cd7 100644
--- a/drivers/usb/gadget/udc/goku_udc.c
+++ b/drivers/usb/gadget/udc/goku_udc.c
@@ -1798,8 +1798,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* init to known state, then setup irqs */
 	udc_reset(dev);
 	udc_reinit (dev);
-	if (request_irq(pdev->irq, goku_irq, IRQF_SHARED,
-			driver_name, dev) != 0) {
+	if (request_irq(pdev->irq, goku_irq, IRQF_SHARED | IRQF_USER_DATA, driver_name, dev) != 0) {
 		DBG(dev, "request interrupt %d failed\n", pdev->irq);
 		retval = -EBUSY;
 		goto err;
diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
index a8288df6aadf..7f8f97ec63f3 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1592,8 +1592,8 @@ static int m66592_probe(struct platform_device *pdev)
 	timer_setup(&m66592->timer, m66592_timer, 0);
 	m66592->reg = reg;
 
-	ret = request_irq(ires->start, m66592_irq, IRQF_SHARED,
-			udc_name, m66592);
+	ret = request_irq(ires->start, m66592_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, udc_name, m66592);
 	if (ret < 0) {
 		pr_err("request_irq error (%d)\n", ret);
 		goto clean_up;
diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c
index 35e02a8d0091..4b5b71e916fe 100644
--- a/drivers/usb/gadget/udc/mv_u3d_core.c
+++ b/drivers/usb/gadget/udc/mv_u3d_core.c
@@ -1922,8 +1922,7 @@ static int mv_u3d_probe(struct platform_device *dev)
 		goto err_get_irq;
 	}
 	u3d->irq = r->start;
-	if (request_irq(u3d->irq, mv_u3d_irq,
-		IRQF_SHARED, driver_name, u3d)) {
+	if (request_irq(u3d->irq, mv_u3d_irq, IRQF_SHARED | IRQF_USER_DATA, driver_name, u3d)) {
 		u3d->irq = 0;
 		dev_err(&dev->dev, "Request irq %d for u3d failed\n",
 			u3d->irq);
diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
index cafde053788b..99f8ab17f39d 100644
--- a/drivers/usb/gadget/udc/mv_udc_core.c
+++ b/drivers/usb/gadget/udc/mv_udc_core.c
@@ -2246,8 +2246,7 @@ static int mv_udc_probe(struct platform_device *pdev)
 		goto err_destroy_dma;
 	}
 	udc->irq = r->start;
-	if (devm_request_irq(&pdev->dev, udc->irq, mv_udc_irq,
-		IRQF_SHARED, driver_name, udc)) {
+	if (devm_request_irq(&pdev->dev, udc->irq, mv_udc_irq, IRQF_SHARED | IRQF_USER_DATA, driver_name, udc)) {
 		dev_err(&pdev->dev, "Request irq %d for UDC failed\n",
 			udc->irq);
 		retval = -ENODEV;
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index b77f3126580e..1fc269c98ffd 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -2259,7 +2259,8 @@ net2272_probe_fin(struct net2272 *dev, unsigned int irqflags)
 	net2272_usb_reset(dev);
 	net2272_usb_reinit(dev);
 
-	ret = request_irq(dev->irq, net2272_irq, irqflags, driver_name, dev);
+	ret = request_irq(dev->irq, net2272_irq, irqflags | IRQF_USER_DATA,
+			  driver_name, dev);
 	if (ret) {
 		dev_err(dev->dev, "request interrupt %i failed\n", dev->irq);
 		goto err;
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index e7dae5379e04..1b2b012fcac8 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -3713,8 +3713,7 @@ static int net2280_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		if (pci_enable_msi(pdev))
 			ep_err(dev, "Failed to enable MSI mode\n");
 
-	if (request_irq(pdev->irq, net2280_irq, IRQF_SHARED,
-							driver_name, dev)) {
+	if (request_irq(pdev->irq, net2280_irq, IRQF_SHARED | IRQF_USER_DATA, driver_name, dev)) {
 		ep_err(dev, "request interrupt %d failed\n", pdev->irq);
 		retval = -EBUSY;
 		goto done;
diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index 55c8c8abeacd..84e44f14ef5d 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -1394,8 +1394,9 @@ static int pch_vbus_gpio_init(struct pch_udc_dev *dev, int vbus_gpio_port)
 	irq_num = gpio_to_irq(vbus_gpio_port);
 	if (irq_num > 0) {
 		irq_set_irq_type(irq_num, IRQ_TYPE_EDGE_BOTH);
-		err = request_irq(irq_num, pch_vbus_gpio_irq, 0,
-			"vbus_detect", dev);
+		err = request_irq(irq_num, pch_vbus_gpio_irq,
+				  IRQF_USER_DATA,
+				  "vbus_detect", dev);
 		if (!err) {
 			dev->vbus_gpio.intr = irq_num;
 			INIT_WORK(&dev->vbus_gpio.irq_work_rise,
@@ -3106,7 +3107,8 @@ static int pch_udc_probe(struct pci_dev *pdev,
 	pci_enable_msi(pdev);
 
 	retval = devm_request_irq(&pdev->dev, pdev->irq, pch_udc_isr,
-				  IRQF_SHARED, KBUILD_MODNAME, dev);
+				  IRQF_SHARED | IRQF_USER_DATA,
+				  KBUILD_MODNAME, dev);
 	if (retval) {
 		dev_err(&pdev->dev, "%s: request_irq(%d) fail\n", __func__,
 			pdev->irq);
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index 014233252299..e72c51764c7a 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -2420,7 +2420,8 @@ static int pxa_udc_probe(struct platform_device *pdev)
 
 	/* irq setup after old hardware state is cleaned up */
 	retval = devm_request_irq(&pdev->dev, udc->irq, pxa_udc_irq,
-				  IRQF_SHARED, driver_name, udc);
+				  IRQF_SHARED | IRQF_USER_DATA, driver_name,
+				  udc);
 	if (retval != 0) {
 		dev_err(udc->dev, "%s: can't get irq %i, err %d\n",
 			driver_name, udc->irq, retval);
diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c
index 11e25a3f4f1f..1370c43c1f79 100644
--- a/drivers/usb/gadget/udc/r8a66597-udc.c
+++ b/drivers/usb/gadget/udc/r8a66597-udc.c
@@ -1895,8 +1895,9 @@ static int r8a66597_probe(struct platform_device *pdev)
 
 	disable_controller(r8a66597); /* make sure controller is disabled */
 
-	ret = devm_request_irq(dev, irq, r8a66597_irq, IRQF_SHARED,
-			       udc_name, r8a66597);
+	ret = devm_request_irq(dev, irq, r8a66597_irq,
+			       IRQF_SHARED | IRQF_USER_DATA, udc_name,
+			       r8a66597);
 	if (ret < 0) {
 		dev_err(dev, "request_irq error (%d)\n", ret);
 		goto clean_up2;
diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c
index 32f1d3e90c26..31d3fbba1932 100644
--- a/drivers/usb/gadget/udc/snps_udc_plat.c
+++ b/drivers/usb/gadget/udc/snps_udc_plat.c
@@ -193,8 +193,8 @@ static int udc_plat_probe(struct platform_device *pdev)
 			goto exit_extcon;
 	}
 
-	ret = devm_request_irq(dev, udc->irq, udc_irq, IRQF_SHARED,
-			       "snps-udc", udc);
+	ret = devm_request_irq(dev, udc->irq, udc_irq,
+			       IRQF_SHARED | IRQF_USER_DATA, "snps-udc", udc);
 	if (ret < 0) {
 		dev_err(dev, "Request irq %d failed for UDC\n", udc->irq);
 		goto exit_dma;
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index b1f4104d1283..0b48ddec81c0 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -2078,7 +2078,8 @@ static int xudc_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "unable to get irq\n");
 		return irq;
 	}
-	ret = devm_request_irq(&pdev->dev, irq, xudc_irq, 0,
+	ret = devm_request_irq(&pdev->dev, irq, xudc_irq,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), udc);
 	if (ret < 0) {
 		dev_dbg(&pdev->dev, "unable to request irq %d", irq);
diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index afa321ab55fc..b64eaea62e23 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -1940,7 +1940,8 @@ max3421_probe(struct spi_device *spi)
 	}
 
 	retval = request_irq(spi->irq, max3421_irq_handler,
-			     IRQF_TRIGGER_LOW, "max3421", hcd);
+			     IRQF_TRIGGER_LOW | IRQF_USER_DATA, "max3421",
+			     hcd);
 	if (retval < 0) {
 		dev_err(&spi->dev, "failed to request irq %d\n", spi->irq);
 		goto error;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 005e65922608..3f191e431edf 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -308,7 +308,8 @@ static int xhci_setup_msi(struct xhci_hcd *xhci)
 	}
 
 	ret = request_irq(pdev->irq, xhci_msi_irq,
-				0, "xhci_hcd", xhci_to_hcd(xhci));
+			  IRQF_USER_DATA, "xhci_hcd",
+			  xhci_to_hcd(xhci));
 	if (ret) {
 		xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 				"disable MSI interrupt");
@@ -346,8 +347,9 @@ static int xhci_setup_msix(struct xhci_hcd *xhci)
 	}
 
 	for (i = 0; i < xhci->msix_count; i++) {
-		ret = request_irq(pci_irq_vector(pdev, i), xhci_msi_irq, 0,
-				"xhci_hcd", xhci_to_hcd(xhci));
+		ret = request_irq(pci_irq_vector(pdev, i), xhci_msi_irq,
+				  IRQF_USER_DATA, "xhci_hcd",
+				  xhci_to_hcd(xhci));
 		if (ret)
 			goto disable_msix;
 	}
@@ -446,8 +448,8 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
 			 hcd->driver->description, hcd->self.busnum);
 
 	/* fall back to legacy interrupt*/
-	ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
-			hcd->irq_descr, hcd);
+	ret = request_irq(pdev->irq, &usb_hcd_irq,
+			  IRQF_SHARED | IRQF_USER_DATA, hcd->irq_descr, hcd);
 	if (ret) {
 		xhci_err(xhci, "request interrupt %d failed\n",
 				pdev->irq);
diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
index 1714b2258b54..fe83ffbc8cdc 100644
--- a/drivers/usb/isp1760/isp1760-udc.c
+++ b/drivers/usb/isp1760/isp1760-udc.c
@@ -1458,7 +1458,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
 	if (!udc->irqname)
 		return -ENOMEM;
 
-	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
+	ret = request_irq(irq, isp1760_udc_irq,
+			  IRQF_SHARED | irqflags | IRQF_USER_DATA,
 			  udc->irqname, udc);
 	if (ret < 0)
 		goto error;
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index b7d56272f9d1..445a8520b4e5 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2331,7 +2331,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
 	timer_setup(&musb->otg_timer, musb_otg_timer_func, 0);
 
 	/* attach to the IRQ */
-	if (request_irq(nIrq, musb->isr, IRQF_SHARED, dev_name(dev), musb)) {
+	if (request_irq(nIrq, musb->isr, IRQF_SHARED | IRQF_USER_DATA, dev_name(dev), musb)) {
 		dev_err(dev, "request_irq %d failed!\n", nIrq);
 		status = -ENODEV;
 		goto fail3;
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c
index 553e2573c74f..71d4e46fdac3 100644
--- a/drivers/usb/phy/phy-gpio-vbus-usb.c
+++ b/drivers/usb/phy/phy-gpio-vbus-usb.c
@@ -305,8 +305,8 @@ static int gpio_vbus_probe(struct platform_device *pdev)
 		gpio_direction_output(gpio, pdata->gpio_pullup_inverted);
 	}
 
-	err = devm_request_irq(&pdev->dev, irq, gpio_vbus_irq, irqflags,
-			       "vbus_detect", pdev);
+	err = devm_request_irq(&pdev->dev, irq, gpio_vbus_irq,
+			       irqflags | IRQF_USER_DATA, "vbus_detect", pdev);
 	if (err) {
 		dev_err(&pdev->dev, "can't request irq %i, err: %d\n",
 			irq, err);
diff --git a/drivers/uwb/whc-rc.c b/drivers/uwb/whc-rc.c
index 3ae3c702500d..6591dbaac5eb 100644
--- a/drivers/uwb/whc-rc.c
+++ b/drivers/uwb/whc-rc.c
@@ -237,8 +237,9 @@ int whcrc_setup_rc_umc(struct whcrc *whcrc)
 		goto error_ioremap_nocache;
 	}
 
-	result = request_irq(umc_dev->irq, whcrc_irq_cb, IRQF_SHARED,
-			     KBUILD_MODNAME, whcrc);
+	result = request_irq(umc_dev->irq, whcrc_irq_cb,
+			     IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			     whcrc);
 	if (result < 0) {
 		dev_err(dev, "can't allocate IRQ %d: %d\n",
 			umc_dev->irq, result);
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
index 1c46045b0e7f..d928f12708b9 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -206,7 +206,7 @@ static int vfio_intx_set_signal(struct vfio_pci_device *vdev, int fd)
 		irqflags = 0;
 
 	ret = request_irq(pdev->irq, vfio_intx_handler,
-			  irqflags, vdev->ctx[0].name, vdev);
+			  irqflags | IRQF_USER_DATA, vdev->ctx[0].name, vdev);
 	if (ret) {
 		vdev->ctx[0].trigger = NULL;
 		kfree(vdev->ctx[0].name);
@@ -333,7 +333,8 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_device *vdev,
 		pci_write_msi_msg(irq, &msg);
 	}
 
-	ret = request_irq(irq, vfio_msihandler, 0,
+	ret = request_irq(irq, vfio_msihandler,
+			  IRQF_USER_DATA,
 			  vdev->ctx[vector].name, trigger);
 	if (ret) {
 		kfree(vdev->ctx[vector].name);
diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
index a48741aab240..c873ebc1a551 100644
--- a/drivers/video/fbdev/arcfb.c
+++ b/drivers/video/fbdev/arcfb.c
@@ -550,8 +550,7 @@ static int arcfb_probe(struct platform_device *dev)
 	platform_set_drvdata(dev, info);
 	if (irq) {
 		par->irq = irq;
-		if (request_irq(par->irq, &arcfb_interrupt, IRQF_SHARED,
-				"arcfb", info)) {
+		if (request_irq(par->irq, &arcfb_interrupt, IRQF_SHARED | IRQF_USER_DATA, "arcfb", info)) {
 			printk(KERN_INFO
 				"arcfb: Failed req IRQ %d\n", par->irq);
 			retval = -EBUSY;
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index b6fe103df145..0764bb519b83 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -1633,7 +1633,7 @@ static int aty_enable_irq(struct atyfb_par *par, int reenable)
 	u32 int_cntl;
 
 	if (!test_and_set_bit(0, &par->irq_flags)) {
-		if (request_irq(par->irq, aty_irq, IRQF_SHARED, "atyfb", par)) {
+		if (request_irq(par->irq, aty_irq, IRQF_SHARED | IRQF_USER_DATA, "atyfb", par)) {
 			clear_bit(0, &par->irq_flags);
 			return -EINVAL;
 		}
diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index 4377e3442638..4ad3e0cf34ee 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -263,8 +263,8 @@ static int goldfish_fb_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_fb_set_var_failed;
 
-	ret = request_irq(fb->irq, goldfish_fb_interrupt, IRQF_SHARED,
-							pdev->name, fb);
+	ret = request_irq(fb->irq, goldfish_fb_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, pdev->name, fb);
 	if (ret)
 		goto err_request_irq_failed;
 
diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c
index 838869c6490c..f8707365ee67 100644
--- a/drivers/video/fbdev/matrox/matroxfb_base.c
+++ b/drivers/video/fbdev/matrox/matroxfb_base.c
@@ -232,8 +232,7 @@ int matroxfb_enable_irq(struct matrox_fb_info *minfo, int reenable)
 		bm = 0x020;
 
 	if (!test_and_set_bit(0, &minfo->irq_flags)) {
-		if (request_irq(minfo->pcidev->irq, matrox_irq,
-				IRQF_SHARED, "matroxfb", minfo)) {
+		if (request_irq(minfo->pcidev->irq, matrox_irq, IRQF_SHARED | IRQF_USER_DATA, "matroxfb", minfo)) {
 			clear_bit(0, &minfo->irq_flags);
 			return -EINVAL;
 		}
diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
index cd372527c9e4..d74a8a5b4ff9 100644
--- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
@@ -740,8 +740,7 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev)
 	if (mb862xx_gdc_init(par))
 		goto io_unmap;
 
-	if (request_irq(par->irq, mb862xx_intr, 0,
-			DRV_NAME, (void *)par)) {
+	if (request_irq(par->irq, mb862xx_intr, IRQF_USER_DATA, DRV_NAME, (void *)par)) {
 		dev_err(dev, "Cannot request irq\n");
 		goto io_unmap;
 	}
@@ -1077,8 +1076,8 @@ static int mb862xx_pci_probe(struct pci_dev *pdev,
 	if (ret)
 		goto io_unmap;
 
-	ret = request_irq(par->irq, mb862xx_intr, IRQF_SHARED,
-			  DRV_NAME, (void *)par);
+	ret = request_irq(par->irq, mb862xx_intr,
+			  IRQF_SHARED | IRQF_USER_DATA, DRV_NAME, (void *)par);
 	if (ret) {
 		dev_err(dev, "Cannot request irq\n");
 		goto io_unmap;
diff --git a/drivers/video/fbdev/via/via-core.c b/drivers/video/fbdev/via/via-core.c
index b041eb27a9bf..d242edf537a0 100644
--- a/drivers/video/fbdev/via/via-core.c
+++ b/drivers/video/fbdev/via/via-core.c
@@ -197,7 +197,8 @@ int viafb_request_dma(void)
 	viafb_dma_users++;
 	if (viafb_dma_users == 1) {
 		ret = request_irq(global_dev.pdev->irq, viafb_dma_irq,
-				IRQF_SHARED, "via-dma", &viafb_dma_users);
+				  IRQF_SHARED | IRQF_USER_DATA, "via-dma",
+				  &viafb_dma_users);
 		if (ret)
 			viafb_dma_users--;
 		else
diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c
index 6e2a9619192d..768aa4677c64 100644
--- a/drivers/virt/vboxguest/vboxguest_linux.c
+++ b/drivers/virt/vboxguest/vboxguest_linux.c
@@ -340,8 +340,9 @@ static int vbg_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 		goto err_vbg_core_exit;
 	}
 
-	ret = devm_request_irq(dev, pci->irq, vbg_core_isr, IRQF_SHARED,
-			       DEVICE_NAME, gdev);
+	ret = devm_request_irq(dev, pci->irq, vbg_core_isr,
+			       IRQF_SHARED | IRQF_USER_DATA, DEVICE_NAME,
+			       gdev);
 	if (ret) {
 		vbg_err("vboxguest: Error requesting irq: %d\n", ret);
 		goto err_vbg_core_exit;
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index d9dd0f789279..c45cfc7a0ddf 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -470,8 +470,8 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
 	unsigned int irq = platform_get_irq(vm_dev->pdev, 0);
 	int i, err, queue_idx = 0;
 
-	err = request_irq(irq, vm_interrupt, IRQF_SHARED,
-			dev_name(&vdev->dev), vm_dev);
+	err = request_irq(irq, vm_interrupt, IRQF_SHARED | IRQF_USER_DATA,
+			  dev_name(&vdev->dev), vm_dev);
 	if (err)
 		return err;
 
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index d0584c040c60..04a25f2c208b 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -144,8 +144,8 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,
 	snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names,
 		 "%s-config", name);
 	err = request_irq(pci_irq_vector(vp_dev->pci_dev, v),
-			  vp_config_changed, 0, vp_dev->msix_names[v],
-			  vp_dev);
+			  vp_config_changed, IRQF_USER_DATA,
+			  vp_dev->msix_names[v], vp_dev);
 	if (err)
 		goto error;
 	++vp_dev->msix_used_vectors;
@@ -163,8 +163,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,
 		snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names,
 			 "%s-virtqueues", name);
 		err = request_irq(pci_irq_vector(vp_dev->pci_dev, v),
-				  vp_vring_interrupt, 0, vp_dev->msix_names[v],
-				  vp_dev);
+				  vp_vring_interrupt,
+				  IRQF_USER_DATA,
+				  vp_dev->msix_names[v], vp_dev);
 		if (err)
 			goto error;
 		++vp_dev->msix_used_vectors;
@@ -338,9 +339,9 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
 			 "%s-%s",
 			 dev_name(&vp_dev->vdev.dev), names[i]);
 		err = request_irq(pci_irq_vector(vp_dev->pci_dev, msix_vec),
-				  vring_interrupt, 0,
-				  vp_dev->msix_names[msix_vec],
-				  vqs[i]);
+				  vring_interrupt,
+				  IRQF_USER_DATA,
+				  vp_dev->msix_names[msix_vec], vqs[i]);
 		if (err)
 			goto error_find;
 	}
@@ -362,8 +363,9 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned nvqs,
 	if (!vp_dev->vqs)
 		return -ENOMEM;
 
-	err = request_irq(vp_dev->pci_dev->irq, vp_interrupt, IRQF_SHARED,
-			dev_name(&vdev->dev), vp_dev);
+	err = request_irq(vp_dev->pci_dev->irq, vp_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, dev_name(&vdev->dev),
+			  vp_dev);
 	if (err)
 		goto out_del_vqs;
 
diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c
index 53bdc256805f..0afef4408ded 100644
--- a/drivers/vme/bridges/vme_ca91cx42.c
+++ b/drivers/vme/bridges/vme_ca91cx42.c
@@ -214,8 +214,9 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
 	/* Clear Any Pending PCI Interrupts */
 	iowrite32(0x00FFFFFF, bridge->base + LINT_STAT);
 
-	result = request_irq(pdev->irq, ca91cx42_irqhandler, IRQF_SHARED,
-			driver_name, ca91cx42_bridge);
+	result = request_irq(pdev->irq, ca91cx42_irqhandler,
+			     IRQF_SHARED | IRQF_USER_DATA, driver_name,
+			     ca91cx42_bridge);
 	if (result) {
 		dev_err(&pdev->dev, "Can't get assigned pci irq vector %02X\n",
 		       pdev->irq);
diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c
index 647d231d4422..73160ddfe675 100644
--- a/drivers/vme/bridges/vme_tsi148.c
+++ b/drivers/vme/bridges/vme_tsi148.c
@@ -316,10 +316,9 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
 
 	bridge = tsi148_bridge->driver_priv;
 
-	result = request_irq(pdev->irq,
-			     tsi148_irqhandler,
-			     IRQF_SHARED,
-			     driver_name, tsi148_bridge);
+	result = request_irq(pdev->irq, tsi148_irqhandler,
+			     IRQF_SHARED | IRQF_USER_DATA, driver_name,
+			     tsi148_bridge);
 	if (result) {
 		dev_err(tsi148_bridge->parent, "Can't get assigned pci irq "
 			"vector %02X\n", pdev->irq);
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index f661695fb589..c5b0e509f4a8 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -578,7 +578,8 @@ static int ds1wm_probe(struct platform_device *pdev)
 		irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_LEVEL_LOW);
 
 	ret = devm_request_irq(&pdev->dev, ds1wm_data->irq, ds1wm_isr,
-			IRQF_SHARED, "ds1wm", ds1wm_data);
+			       IRQF_SHARED | IRQF_USER_DATA, "ds1wm",
+			       ds1wm_data);
 	if (ret) {
 		dev_err(&ds1wm_data->pdev->dev,
 			"devm_request_irq %d failed with errno %d\n",
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 117e76b2f939..c849861f3c33 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1028,7 +1028,8 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
 	irq = bind_evtchn_to_irq(evtchn);
 	if (irq < 0)
 		return irq;
-	retval = request_irq(irq, handler, irqflags, devname, dev_id);
+	retval = request_irq(irq, handler, irqflags | IRQF_USER_DATA, devname,
+			     dev_id);
 	if (retval != 0) {
 		unbind_from_irq(irq);
 		return retval;
@@ -1051,7 +1052,8 @@ int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
 	if (irq < 0)
 		return irq;
 
-	retval = request_irq(irq, handler, irqflags, devname, dev_id);
+	retval = request_irq(irq, handler, irqflags | IRQF_USER_DATA, devname,
+			     dev_id);
 	if (retval != 0) {
 		unbind_from_irq(irq);
 		return retval;
@@ -1070,7 +1072,8 @@ int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
 	irq = bind_virq_to_irq(virq, cpu, irqflags & IRQF_PERCPU);
 	if (irq < 0)
 		return irq;
-	retval = request_irq(irq, handler, irqflags, devname, dev_id);
+	retval = request_irq(irq, handler, irqflags | IRQF_USER_DATA, devname,
+			     dev_id);
 	if (retval != 0) {
 		unbind_from_irq(irq);
 		return retval;
@@ -1094,7 +1097,8 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
 		return irq;
 
 	irqflags |= IRQF_NO_SUSPEND | IRQF_FORCE_RESUME | IRQF_EARLY_RESUME;
-	retval = request_irq(irq, handler, irqflags, devname, dev_id);
+	retval = request_irq(irq, handler, irqflags | IRQF_USER_DATA, devname,
+			     dev_id);
 	if (retval != 0) {
 		unbind_from_irq(irq);
 		return retval;
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 5d7dcad0b0a0..8416bfa8b0bf 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -83,8 +83,8 @@ static irqreturn_t do_hvm_evtchn_intr(int irq, void *dev_id)
 static int xen_allocate_irq(struct pci_dev *pdev)
 {
 	return request_irq(pdev->irq, do_hvm_evtchn_intr,
-			IRQF_NOBALANCING | IRQF_TRIGGER_RISING,
-			"xen-platform-pci", pdev);
+			   IRQF_NOBALANCING | IRQF_TRIGGER_RISING | IRQF_USER_DATA,
+			   "xen-platform-pci", pdev);
 }
 
 static int platform_pci_resume(struct pci_dev *pdev)
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index ea4a08b83fa0..0ce77cab9cc3 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -78,9 +78,9 @@ static void xen_pcibk_control_isr(struct pci_dev *dev, int reset)
 		if (dev->msi_enabled || dev->msix_enabled)
 			goto out;
 
-		rc = request_irq(dev_data->irq,
-				xen_pcibk_guest_interrupt, IRQF_SHARED,
-				dev_data->irq_name, dev);
+		rc = request_irq(dev_data->irq, xen_pcibk_guest_interrupt,
+				 IRQF_SHARED | IRQF_USER_DATA,
+				 dev_data->irq_name, dev);
 		if (rc) {
 			dev_err(&dev->dev, "%s: failed to install fake IRQ " \
 				"handler for IRQ %d! (rc:%d)\n",
diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples/v4l/v4l2-pci-skeleton.c
index 27ec30952cfa..b6115d9c0459 100644
--- a/samples/v4l/v4l2-pci-skeleton.c
+++ b/samples/v4l/v4l2-pci-skeleton.c
@@ -779,8 +779,9 @@ static int skeleton_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* Allocate the interrupt */
-	ret = devm_request_irq(&pdev->dev, pdev->irq,
-			       skeleton_irq, 0, KBUILD_MODNAME, skel);
+	ret = devm_request_irq(&pdev->dev, pdev->irq, skeleton_irq,
+			       IRQF_USER_DATA,
+			       KBUILD_MODNAME, skel);
 	if (ret) {
 		dev_err(&pdev->dev, "request_irq failed\n");
 		goto disable_pci;
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index 85610cdcde9f..528bcc670149 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -580,8 +580,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
 	else
 		mpu->cport = port + 1;
 	if (irq >= 0) {
-		if (request_irq(irq, snd_mpu401_uart_interrupt, 0,
-				"MPU401 UART", (void *) mpu)) {
+		if (request_irq(irq, snd_mpu401_uart_interrupt, IRQF_USER_DATA, "MPU401 UART", (void *)mpu)) {
 			snd_printk(KERN_ERR "mpu401_uart: "
 				   "unable to grab IRQ %d\n", irq);
 			err = -EBUSY;
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index 547662e02fcc..32b04d8b10e3 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -588,7 +588,7 @@ static int snd_mtpav_get_ISA(struct mtpav *mcard)
 		return -EBUSY;
 	}
 	mcard->port = port;
-	if (request_irq(irq, snd_mtpav_irqh, 0, "MOTU MTPAV", mcard)) {
+	if (request_irq(irq, snd_mtpav_irqh, IRQF_USER_DATA, "MOTU MTPAV", mcard)) {
 		snd_printk(KERN_ERR "MTVAP IRQ %d busy\n", irq);
 		return -EBUSY;
 	}
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 0a67b8b9f176..6f7315903ce9 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -813,8 +813,7 @@ static int snd_uart16550_create(struct snd_card *card,
 	}
 
 	if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
-		if (request_irq(irq, snd_uart16550_interrupt,
-				0, "Serial MIDI", uart)) {
+		if (request_irq(irq, snd_uart16550_interrupt, IRQF_USER_DATA, "Serial MIDI", uart)) {
 			snd_printk(KERN_WARNING
 				   "irq %d busy. Using Polling.\n", irq);
 		} else {
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index fba6d22f7f4b..c1740bb3874a 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -615,7 +615,7 @@ int snd_ad1816a_create(struct snd_card *card,
 		snd_ad1816a_free(chip);
 		return -EBUSY;
 	}
-	if (request_irq(irq, snd_ad1816a_interrupt, 0, "AD1816A", (void *) chip)) {
+	if (request_irq(irq, snd_ad1816a_interrupt, IRQF_USER_DATA, "AD1816A", (void *)chip)) {
 		snd_printk(KERN_ERR "ad1816a: can't grab IRQ %d\n", irq);
 		snd_ad1816a_free(chip);
 		return -EBUSY;
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index 50cdce0e8946..d243f6763330 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -665,7 +665,9 @@ int snd_es1688_create(struct snd_card *card,
 		goto exit;
 	}
 
-	err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip);
+	err = request_irq(irq, snd_es1688_interrupt,
+			  IRQF_USER_DATA, "ES1688",
+			  (void *)chip);
 	if (err < 0) {
 		snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
 		goto exit;
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 0d103d6f805e..85ecf0c7173f 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -1807,8 +1807,7 @@ static int snd_es18xx_new_device(struct snd_card *card,
 		return -EBUSY;
 	}
 
-	if (request_irq(irq, snd_es18xx_interrupt, 0, "ES18xx",
-			(void *) card)) {
+	if (request_irq(irq, snd_es18xx_interrupt, IRQF_USER_DATA, "ES18xx", (void *)card)) {
 		snd_es18xx_free(card);
 		snd_printk(KERN_ERR PFX "unable to grap IRQ %d\n", irq);
 		return -EBUSY;
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index 3b8a0c880db5..d6e6cf996b8e 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -181,7 +181,7 @@ int snd_gus_create(struct snd_card *card,
 		snd_gus_free(gus);
 		return -EBUSY;
 	}
-	if (irq >= 0 && request_irq(irq, snd_gus_interrupt, 0, "GUS GF1", (void *) gus)) {
+	if (irq >= 0 && request_irq(irq, snd_gus_interrupt, IRQF_USER_DATA, "GUS GF1", (void *)gus)) {
 		snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq);
 		snd_gus_free(gus);
 		return -EBUSY;
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index 63309a453140..9e4f8d55522c 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -291,7 +291,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
 		goto _err;
 	}
 
-	if (request_irq(xirq, snd_gusmax_interrupt, 0, "GUS MAX", (void *)maxcard)) {
+	if (request_irq(xirq, snd_gusmax_interrupt, IRQF_USER_DATA, "GUS MAX", (void *)maxcard)) {
 		snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq);
 		err = -EBUSY;
 		goto _err;
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index a6fc26bf0af2..f09d8198f61f 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -676,8 +676,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
 	if ((err = snd_gus_initialize(gus)) < 0)
 		return err;
 
-	if (request_irq(xirq, snd_interwave_interrupt, 0,
-			"InterWave", iwcard)) {
+	if (request_irq(xirq, snd_interwave_interrupt, IRQF_USER_DATA, "InterWave", iwcard)) {
 		snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq);
 		return -EBUSY;
 	}
diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c
index 11af9c40bc05..f448872f943e 100644
--- a/sound/isa/msnd/msnd_pinnacle.c
+++ b/sound/isa/msnd/msnd_pinnacle.c
@@ -546,7 +546,8 @@ static int snd_msnd_attach(struct snd_card *card)
 		.dev_free =      snd_msnd_dev_free,
 		};
 
-	err = request_irq(chip->irq, snd_msnd_interrupt, 0, card->shortname,
+	err = request_irq(chip->irq, snd_msnd_interrupt,
+			  IRQF_USER_DATA, card->shortname,
 			  chip);
 	if (err < 0) {
 		printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", chip->irq);
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 7cce4cd4a23b..75ac5916c1e2 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -667,8 +667,8 @@ static int snd_opl3sa2_probe(struct snd_card *card, int dev)
 	err = snd_opl3sa2_detect(card);
 	if (err < 0)
 		return err;
-	err = request_irq(xirq, snd_opl3sa2_interrupt, 0,
-			  "OPL3-SA2", card);
+	err = request_irq(xirq, snd_opl3sa2_interrupt,
+			  IRQF_USER_DATA, "OPL3-SA2", card);
 	if (err) {
 		snd_printk(KERN_ERR PFX "can't grab IRQ %d\n", xirq);
 		return -ENODEV;
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 47e0b2820ace..ade2f53fc8c2 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -874,7 +874,8 @@ static int snd_opti9xx_probe(struct snd_card *card)
 #endif
 #ifdef OPTi93X
 	error = request_irq(irq, snd_opti93x_interrupt,
-			    0, DEV_NAME" - WSS", chip);
+			    IRQF_USER_DATA,
+			    DEV_NAME " - WSS", chip);
 	if (error < 0) {
 		snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", irq);
 		return error;
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index 90b254aaef74..9f7e44c4973c 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -237,11 +237,7 @@ int snd_sbdsp_create(struct snd_card *card,
 	chip->dma16 = -1;
 	chip->port = port;
 	
-	if (request_irq(irq, irq_handler,
-			(hardware == SB_HW_ALS4000 ||
-			 hardware == SB_HW_CS5530) ?
-			IRQF_SHARED : 0,
-			"SoundBlaster", (void *) chip)) {
+	if (request_irq(irq, irq_handler, ((hardware == SB_HW_ALS4000 || hardware == SB_HW_CS5530) ? IRQF_SHARED : 0) | IRQF_USER_DATA, "SoundBlaster", (void *)chip)) {
 		snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
 		snd_sbdsp_free(chip);
 		return -EBUSY;
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index b1989facd732..abc0e4136030 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -415,8 +415,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)
 			   ics2115_port[dev], ics2115_port[dev] + 16 - 1);
 		return -EBUSY;
 	}
-	if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt,
-			0, "ICS2115", acard)) {
+	if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt, IRQF_USER_DATA, "ICS2115", acard)) {
 		snd_printk(KERN_ERR "unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]);
 		return -EBUSY;
 	}
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 3a5008837576..a2ec51887db5 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -1835,8 +1835,7 @@ int snd_wss_create(struct snd_card *card,
 	}
 	chip->cport = cport;
 	if (!(hwshare & WSS_HWSHARE_IRQ))
-		if (request_irq(irq, snd_wss_interrupt, 0,
-				"WSS", (void *) chip)) {
+		if (request_irq(irq, snd_wss_interrupt, IRQF_USER_DATA, "WSS", (void *)chip)) {
 			snd_printk(KERN_ERR "wss: can't grab IRQ %d\n", irq);
 			snd_wss_free(chip);
 			return -EBUSY;
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index d9c54c08e2db..4234cfe099f6 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -932,8 +932,7 @@ snd_ad1889_create(struct snd_card *card,
 
 	spin_lock_init(&chip->lock);	/* only now can we call ad1889_free */
 
-	if (request_irq(pci->irq, snd_ad1889_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_ad1889_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "cannot obtain IRQ %d\n", pci->irq);
 		snd_ad1889_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 9f569379b77e..a1001fe87a6c 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -2066,8 +2066,7 @@ static int snd_ali_resources(struct snd_ali *codec)
 		return err;
 	codec->port = pci_resource_start(codec->pci, 0);
 
-	if (request_irq(codec->pci->irq, snd_ali_card_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, codec)) {
+	if (request_irq(codec->pci->irq, snd_ali_card_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, codec)) {
 		dev_err(codec->card->dev, "Unable to request irq.\n");
 		return -EBUSY;
 	}
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index eaa2d853d922..3a1a1cf54d33 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -690,8 +690,7 @@ static int snd_als300_create(struct snd_card *card,
 	else
 		irq_handler = snd_als300_interrupt;
 
-	if (request_irq(pci->irq, irq_handler, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, irq_handler, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_als300_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
index 7d049569012c..a3b5dbfec973 100644
--- a/sound/pci/asihpi/hpioctl.c
+++ b/sound/pci/asihpi/hpioctl.c
@@ -485,8 +485,7 @@ int asihpi_adapter_probe(struct pci_dev *pci_dev,
 		}
 
 		/* Note: request_irq calls asihpi_isr here */
-		if (request_irq(pci_dev->irq, asihpi_isr, IRQF_SHARED,
-				"asihpi", &adapters[adapter_index])) {
+		if (request_irq(pci_dev->irq, asihpi_isr, IRQF_SHARED | IRQF_USER_DATA, "asihpi", &adapters[adapter_index])) {
 			dev_err(&pci_dev->dev, "request_irq(%d) failed\n",
 				pci_dev->irq);
 			goto err;
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 1a41f8c80243..dc7002089fe2 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1619,8 +1619,7 @@ static int snd_atiixp_create(struct snd_card *card,
 		return -EIO;
 	}
 
-	if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_atiixp_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index dc1de860cedf..5fbed10f86ca 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -1245,8 +1245,7 @@ static int snd_atiixp_create(struct snd_card *card,
 		return -EIO;
 	}
 
-	if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_atiixp_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c
index 9a49e4243a9c..15118f5be53d 100644
--- a/sound/pci/aw2/aw2-alsa.c
+++ b/sound/pci/aw2/aw2-alsa.c
@@ -298,8 +298,7 @@ static int snd_aw2_create(struct snd_card *card,
 	/* (2) initialization of the chip hardware */
 	snd_aw2_saa7146_setup(&chip->saa7146, chip->iobase_virt);
 
-	if (request_irq(pci->irq, snd_aw2_saa7146_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_aw2_saa7146_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "Cannot grab irq %d\n", pci->irq);
 
 		iounmap(chip->iobase_virt);
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index fc18c29a8173..6ff40c762da1 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -2455,8 +2455,7 @@ snd_azf3328_create(struct snd_card *card,
 	codec_setup->type = AZF_CODEC_I2S_OUT;
 	codec_setup->name = "I2S_OUT";
 
-	if (request_irq(pci->irq, snd_azf3328_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_azf3328_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		err = -EBUSY;
 		goto out_err;
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index ba971042f871..230c58b24383 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -766,8 +766,8 @@ static int snd_bt87x_create(struct snd_card *card,
 	snd_bt87x_writel(chip, REG_INT_MASK, 0);
 	snd_bt87x_writel(chip, REG_INT_STAT, MY_INTERRUPTS);
 
-	err = request_irq(pci->irq, snd_bt87x_interrupt, IRQF_SHARED,
-			  KBUILD_MODNAME, chip);
+	err = request_irq(pci->irq, snd_bt87x_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip);
 	if (err < 0) {
 		dev_err(card->dev, "cannot grab irq %d\n", pci->irq);
 		goto fail;
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index cd27b5536654..553f8e50393b 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1701,8 +1701,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card,
 		return -EBUSY;
 	}
 
-	if (request_irq(pci->irq, snd_ca0106_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_ca0106_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		snd_ca0106_free(chip);
 		dev_err(card->dev, "cannot grab irq\n");
 		return -EBUSY;
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 452cc79b44af..f058c8d01d01 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -3054,8 +3054,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
 	}
 	cm->iobase = pci_resource_start(pci, 0);
 
-	if (request_irq(pci->irq, snd_cmipci_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, cm)) {
+	if (request_irq(pci->irq, snd_cmipci_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, cm)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_cmipci_free(cm);
 		return -EBUSY;
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ec4247638fa1..9855ce43d187 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -1379,8 +1379,7 @@ static int snd_cs4281_create(struct snd_card *card,
 		return -ENOMEM;
 	}
 	
-	if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_cs4281_free(chip);
 		return -ENOMEM;
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 750eec437a79..88f7a7c5e918 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -4008,8 +4008,7 @@ int snd_cs46xx_create(struct snd_card *card,
 		}
 	}
 
-	if (request_irq(pci->irq, snd_cs46xx_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_cs46xx_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_cs46xx_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 4590086d9cd8..db73543eb7c8 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -309,8 +309,7 @@ static int snd_cs5535audio_create(struct snd_card *card,
 
 	cs5535au->port = pci_resource_start(pci, 0);
 
-	if (request_irq(pci->irq, snd_cs5535audio_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, cs5535au)) {
+	if (request_irq(pci->irq, snd_cs5535audio_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, cs5535au)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		err = -EBUSY;
 		goto sndfail;
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index 6a051a1c3724..4ef23084d48b 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -1933,7 +1933,8 @@ static int hw_card_start(struct hw *hw)
 	}
 
 	if (hw->irq < 0) {
-		err = request_irq(pci->irq, ct_20k1_interrupt, IRQF_SHARED,
+		err = request_irq(pci->irq, ct_20k1_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  KBUILD_MODNAME, hw);
 		if (err < 0) {
 			dev_err(hw->card->dev,
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 3c966fafc754..7b470af8f10a 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -2057,7 +2057,8 @@ static int hw_card_start(struct hw *hw)
 	hw_write_20kx(hw, GLOBAL_CNTL_GCTL, gctl);
 
 	if (hw->irq < 0) {
-		err = request_irq(pci->irq, ct_20k2_interrupt, IRQF_SHARED,
+		err = request_irq(pci->irq, ct_20k2_interrupt,
+				  IRQF_SHARED | IRQF_USER_DATA,
 				  KBUILD_MODNAME, hw);
 		if (err < 0) {
 			dev_err(hw->card->dev,
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 61f85ff91cd9..05cad2c2ac92 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -2007,8 +2007,7 @@ int snd_emu10k1_create(struct snd_card *card,
 	emu->fx8010.etram_pages.bytes = 0;
 
 	/* irq handler must be registered after I/O ports are activated */
-	if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, emu)) {
+	if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, emu)) {
 		err = -EBUSY;
 		goto error;
 	}
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 611589cbdad6..1513af662fe6 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -942,8 +942,7 @@ static int snd_emu10k1x_create(struct snd_card *card,
 		return -EBUSY;
 	}
 
-	if (request_irq(pci->irq, snd_emu10k1x_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_emu10k1x_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "cannot grab irq %d\n", pci->irq);
 		snd_emu10k1x_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 727eb3da1fda..afb73016d36f 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -2106,8 +2106,7 @@ static int snd_ensoniq_create(struct snd_card *card,
 		return err;
 	}
 	ensoniq->port = pci_resource_start(pci, 0);
-	if (request_irq(pci->irq, snd_audiopci_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, ensoniq)) {
+	if (request_irq(pci->irq, snd_audiopci_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, ensoniq)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_ensoniq_free(ensoniq);
 		return -EBUSY;
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 9d248eb2e26c..a775bcb1c15b 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1496,8 +1496,7 @@ static int es1938_resume(struct device *dev)
 	struct es1938 *chip = card->private_data;
 	unsigned char *s, *d;
 
-	if (request_irq(pci->irq, snd_es1938_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_es1938_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(dev, "unable to grab IRQ %d, disabling device\n",
 			pci->irq);
 		snd_card_disconnect(card);
@@ -1625,8 +1624,7 @@ static int snd_es1938_create(struct snd_card *card,
 	chip->vc_port = pci_resource_start(pci, 2);
 	chip->mpu_port = pci_resource_start(pci, 3);
 	chip->game_port = pci_resource_start(pci, 4);
-	if (request_irq(pci->irq, snd_es1938_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_es1938_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_es1938_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 0b1845ca6005..b1fea07bdd87 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2724,8 +2724,7 @@ static int snd_es1968_create(struct snd_card *card,
 		return err;
 	}
 	chip->io_port = pci_resource_start(pci, 0);
-	if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_es1968_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index e3fb9c61017c..bbd5c056a412 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1244,8 +1244,7 @@ static int snd_fm801_create(struct snd_card *card,
 	}
 
 	if ((chip->tea575x_tuner & TUNER_ONLY) == 0) {
-		if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt,
-				IRQF_SHARED, KBUILD_MODNAME, chip)) {
+		if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 			dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 			snd_fm801_free(chip);
 			return -EBUSY;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e5c49003e75f..5e03b7cde151 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -783,9 +783,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
 {
 	struct hdac_bus *bus = azx_bus(chip);
 
-	if (request_irq(chip->pci->irq, azx_interrupt,
-			chip->msi ? 0 : IRQF_SHARED,
-			chip->card->irq_descr, chip)) {
+	if (request_irq(chip->pci->irq, azx_interrupt, (chip->msi ? 0 : IRQF_SHARED) | IRQF_USER_DATA, chip->card->irq_descr, chip)) {
 		dev_err(chip->card->dev,
 			"unable to grab IRQ %d, disabling device\n",
 			chip->pci->irq);
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index f1fe497c2f9d..d1aaf856fd0a 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2588,8 +2588,7 @@ static int snd_ice1712_create(struct snd_card *card,
 	ice->dmapath_port = pci_resource_start(pci, 2);
 	ice->profi_port = pci_resource_start(pci, 3);
 
-	if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, ice)) {
+	if (request_irq(pci->irq, snd_ice1712_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, ice)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_ice1712_free(ice);
 		return -EIO;
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 057c2f394ea7..ec53f2f7b6cc 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -2576,8 +2576,7 @@ static int snd_vt1724_create(struct snd_card *card,
 	ice->port = pci_resource_start(pci, 0);
 	ice->profi_port = pci_resource_start(pci, 1);
 
-	if (request_irq(pci->irq, snd_vt1724_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, ice)) {
+	if (request_irq(pci->irq, snd_vt1724_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, ice)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_vt1724_free(ice);
 		return -EIO;
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index ffddcdfe0c66..ba2d7a64c051 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2636,8 +2636,7 @@ static int intel8x0_resume(struct device *dev)
 	int i;
 
 	snd_intel8x0_chip_init(chip, 0);
-	if (request_irq(pci->irq, snd_intel8x0_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(dev, "unable to grab IRQ %d, disabling device\n",
 			pci->irq);
 		snd_card_disconnect(card);
@@ -3119,8 +3118,7 @@ static int snd_intel8x0_create(struct snd_card *card,
 	}
 
 	/* request irq after initializaing int_sta_mask, etc */
-	if (request_irq(pci->irq, snd_intel8x0_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_intel8x0_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index c84629190cba..0ffb23fa00b9 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -1044,8 +1044,7 @@ static int intel8x0m_resume(struct device *dev)
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct intel8x0m *chip = card->private_data;
 
-	if (request_irq(pci->irq, snd_intel8x0m_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(dev, "unable to grab IRQ %d, disabling device\n",
 			pci->irq);
 		snd_card_disconnect(card);
@@ -1221,8 +1220,7 @@ static int snd_intel8x0m_create(struct snd_card *card,
 		return err;
 	}
 
-	if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_intel8x0m_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_intel8x0m_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 4e189a93f475..f7608ffce070 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -2243,8 +2243,8 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,
         }
 
         err = request_irq(pci->irq, snd_korg1212_interrupt,
-                          IRQF_SHARED,
-                          KBUILD_MODNAME, korg1212);
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME,
+			  korg1212);
 
         if (err) {
 		snd_printk(KERN_ERR "korg1212: unable to grab IRQ %d\n", pci->irq);
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
index 254f24366892..b7f8fc1b422e 100644
--- a/sound/pci/lola/lola.c
+++ b/sound/pci/lola/lola.c
@@ -644,8 +644,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
 	if (err < 0)
 		goto errout;
 
-	if (request_irq(pci->irq, lola_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, lola_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
 		err = -EBUSY;
 		goto errout;
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 62962178a9d7..2de65a6027b5 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2648,8 +2648,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
 
 	snd_m3_hv_init(chip);
 
-	if (request_irq(pci->irq, snd_m3_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_m3_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		err = -ENOMEM;
 		goto free_chip;
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index b97f4ea6b56c..2901b32e509f 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -466,8 +466,7 @@ static int snd_nm256_acquire_irq(struct nm256 *chip)
 {
 	mutex_lock(&chip->irq_mutex);
 	if (chip->irq < 0) {
-		if (request_irq(chip->pci->irq, chip->interrupt, IRQF_SHARED,
-				KBUILD_MODNAME, chip)) {
+		if (request_irq(chip->pci->irq, chip->interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 			dev_err(chip->card->dev,
 				"unable to grab IRQ %d\n", chip->pci->irq);
 			mutex_unlock(&chip->irq_mutex);
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index b4ef5804212d..544457309d33 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -669,8 +669,8 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
 	oxygen_init(chip);
 	chip->model.init(chip);
 
-	err = request_irq(pci->irq, oxygen_interrupt, IRQF_SHARED,
-			  KBUILD_MODNAME, chip);
+	err = request_irq(pci->irq, oxygen_interrupt,
+			  IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip);
 	if (err < 0) {
 		dev_err(card->dev, "cannot grab interrupt %d\n", pci->irq);
 		goto err_card;
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 23017e3bc76c..7b94fb792a8c 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1877,8 +1877,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,
 	hwport = (struct riptideport *)chip->port;
 	UNSET_AIE(hwport);
 
-	if (request_irq(pci->irq, snd_riptide_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_riptide_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		snd_printk(KERN_ERR "Riptide: unable to grab IRQ %d\n",
 			   pci->irq);
 		snd_riptide_free(chip);
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index 3ac8c71d567c..6e69d95a5834 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -1366,8 +1366,7 @@ static int snd_rme32_create(struct rme32 *rme32)
 		return -ENOMEM;
 	}
 
-	if (request_irq(pci->irq, snd_rme32_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, rme32)) {
+	if (request_irq(pci->irq, snd_rme32_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, rme32)) {
 		dev_err(rme32->card->dev, "unable to grab IRQ %d\n", pci->irq);
 		return -EBUSY;
 	}
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index dcfa4d7a73e2..04b9dfe9349b 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1641,8 +1641,7 @@ snd_rme96_create(struct rme96 *rme96)
 		return -ENOMEM;
 	}
 
-	if (request_irq(pci->irq, snd_rme96_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, rme96)) {
+	if (request_irq(pci->irq, snd_rme96_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, rme96)) {
 		dev_err(rme96->card->dev, "unable to grab IRQ %d\n", pci->irq);
 		return -EBUSY;
 	}
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index ba99ff0e93e0..479db0dcb86f 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -5248,8 +5248,7 @@ static int snd_hdsp_create(struct snd_card *card,
 		return -EBUSY;
 	}
 
-	if (request_irq(pci->irq, snd_hdsp_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, hdsp)) {
+	if (request_irq(pci->irq, snd_hdsp_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hdsp)) {
 		dev_err(hdsp->card->dev, "unable to use IRQ %d\n", pci->irq);
 		return -EBUSY;
 	}
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 679ad0415e3b..5cb6248677f7 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -6629,8 +6629,7 @@ static int snd_hdspm_create(struct snd_card *card,
 			(unsigned long)hdspm->iobase, hdspm->port,
 			hdspm->port + io_extent - 1);
 
-	if (request_irq(pci->irq, snd_hdspm_interrupt,
-			IRQF_SHARED, KBUILD_MODNAME, hdspm)) {
+	if (request_irq(pci->irq, snd_hdspm_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, hdspm)) {
 		dev_err(card->dev, "unable to use IRQ %d\n", pci->irq);
 		return -EBUSY;
 	}
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index edd765e22377..cab697211d25 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -2495,8 +2495,7 @@ static int snd_rme9652_create(struct snd_card *card,
 		return -EBUSY;
 	}
 	
-	if (request_irq(pci->irq, snd_rme9652_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, rme9652)) {
+	if (request_irq(pci->irq, snd_rme9652_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, rme9652)) {
 		dev_err(card->dev, "unable to request IRQ %d\n", pci->irq);
 		return -EBUSY;
 	}
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 964acf302479..33b0ab75060f 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1252,8 +1252,7 @@ static int sis_resume(struct device *dev)
 		goto error;
 	}
 
-	if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, sis)) {
+	if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, sis)) {
 		dev_err(&pci->dev, "unable to regain IRQ %d\n", pci->irq);
 		goto error;
 	}
@@ -1362,8 +1361,8 @@ static int sis_chip_create(struct snd_card *card,
 	if (rc)
 		goto error_out_cleanup;
 
-	rc = request_irq(pci->irq, sis_interrupt, IRQF_SHARED, KBUILD_MODNAME,
-			 sis);
+	rc = request_irq(pci->irq, sis_interrupt,
+			 IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, sis);
 	if (rc) {
 		dev_err(&pci->dev, "unable to allocate irq %d\n", sis->irq);
 		goto error_out_cleanup;
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 7218f38b59db..5ae258d3b8b4 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -1293,8 +1293,7 @@ static int snd_sonicvibes_create(struct snd_card *card,
 	sonic->midi_port = pci_resource_start(pci, 3);
 	sonic->game_port = pci_resource_start(pci, 4);
 
-	if (request_irq(pci->irq, snd_sonicvibes_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, sonic)) {
+	if (request_irq(pci->irq, snd_sonicvibes_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, sonic)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_sonicvibes_free(sonic);
 		return -EBUSY;
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 5523e193d556..4e5b48c8745f 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3590,8 +3590,7 @@ int snd_trident_create(struct snd_card *card,
 	}
 	trident->port = pci_resource_start(pci, 0);
 
-	if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, trident)) {
+	if (request_irq(pci->irq, snd_trident_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, trident)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_trident_free(trident);
 		return -EBUSY;
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index c488c5afa195..0051a94c5030 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -2403,11 +2403,7 @@ static int snd_via82xx_create(struct snd_card *card,
 		return err;
 	}
 	chip->port = pci_resource_start(pci, 0);
-	if (request_irq(pci->irq,
-			chip_type == TYPE_VIA8233 ?
-			snd_via8233_interrupt :	snd_via686_interrupt,
-			IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, chip_type == TYPE_VIA8233 ? snd_via8233_interrupt : snd_via686_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_via82xx_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index b13c8688cc8d..277b44566d47 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -1127,8 +1127,7 @@ static int snd_via82xx_create(struct snd_card *card,
 		return err;
 	}
 	chip->port = pci_resource_start(pci, 0);
-	if (request_irq(pci->irq, snd_via82xx_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_via82xx_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
 		snd_via82xx_free(chip);
 		return -EBUSY;
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index a4926fb03991..0e0bdefbee4d 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2402,8 +2402,7 @@ int snd_ymfpci_create(struct snd_card *card,
 		err = -EBUSY;
 		goto free_chip;
 	}
-	if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_SHARED,
-			KBUILD_MODNAME, chip)) {
+	if (request_irq(pci->irq, snd_ymfpci_interrupt, IRQF_SHARED | IRQF_USER_DATA, KBUILD_MODNAME, chip)) {
 		dev_err(chip->card->dev, "unable to grab IRQ %d\n", pci->irq);
 		err = -EBUSY;
 		goto free_chip;
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index f4011bebc7ec..3689383fd5c3 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -1288,7 +1288,8 @@ static int acp_audio_probe(struct platform_device *pdev)
 	}
 
 	status = devm_request_irq(&pdev->dev, res->start, dma_irq_handler,
-				  0, "ACP_IRQ", &pdev->dev);
+				  IRQF_USER_DATA, "ACP_IRQ",
+				  &pdev->dev);
 	if (status) {
 		dev_err(&pdev->dev, "ACP IRQ request failed\n");
 		return status;
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index 3d58338fa3cf..8c15933a3145 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -647,7 +647,8 @@ static int acp3x_audio_probe(struct platform_device *pdev)
 		goto dev_err;
 	}
 	status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
-				  irqflags, "ACP3x_I2S_IRQ", adata);
+				  irqflags | IRQF_USER_DATA, "ACP3x_I2S_IRQ",
+				  adata);
 	if (status) {
 		dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n");
 		goto dev_err;
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index fc530481a6e4..6433d713ae8b 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -2833,8 +2833,8 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
 		return ret;
 
 	ret = devm_request_irq(&i2c->dev, rt5640->irq, rt5640_irq,
-			       IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
-			       | IRQF_ONESHOT, "rt5640", rt5640);
+			       IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_USER_DATA,
+			       "rt5640", rt5640);
 	if (ret == 0) {
 		/* Gets re-enabled by rt5640_set_jack() */
 		disable_irq(rt5640->irq);
diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c
index b7ba64350a07..6965f970a32a 100644
--- a/sound/soc/codecs/rt5651.c
+++ b/sound/soc/codecs/rt5651.c
@@ -2200,8 +2200,8 @@ static int rt5651_i2c_probe(struct i2c_client *i2c,
 		return ret;
 
 	ret = devm_request_irq(&i2c->dev, rt5651->irq, rt5651_irq,
-			       IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
-			       | IRQF_ONESHOT, "rt5651", rt5651);
+			       IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_USER_DATA,
+			       "rt5651", rt5651);
 	if (ret == 0) {
 		/* Gets re-enabled by rt5651_set_jack() */
 		disable_irq(rt5651->irq);
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index da6647015708..aa24893a98b6 100644
--- a/sound/soc/codecs/rt5663.c
+++ b/sound/soc/codecs/rt5663.c
@@ -3676,8 +3676,8 @@ static int rt5663_i2c_probe(struct i2c_client *i2c,
 
 	if (i2c->irq) {
 		ret = request_irq(i2c->irq, rt5663_irq,
-			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
-			| IRQF_ONESHOT, "rt5663", rt5663);
+				  IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT | IRQF_USER_DATA,
+				  "rt5663", rt5663);
 		if (ret) {
 			dev_err(&i2c->dev, "%s Failed to reguest IRQ: %d\n",
 				__func__, ret);
diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index 65112b9d8588..4ab23c0474c8 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -641,8 +641,9 @@ static int dw_i2s_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq >= 0) {
-		ret = devm_request_irq(&pdev->dev, irq, i2s_irq_handler, 0,
-				pdev->name, dev);
+		ret = devm_request_irq(&pdev->dev, irq, i2s_irq_handler,
+				       IRQF_USER_DATA,
+				       pdev->name, dev);
 		if (ret < 0) {
 			dev_err(&pdev->dev, "failed to request irq\n");
 			return ret;
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 528e8b108422..119c1f908115 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -839,7 +839,8 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
+	ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), asrc_priv);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to claim irq %u: %d\n", irq, ret);
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 57b484768a58..e72b88a34cd5 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -851,7 +851,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
+	ret = devm_request_irq(&pdev->dev, irq, esai_isr,
+			       IRQF_USER_DATA,
 			       esai_priv->name, esai_priv);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 4163f2cfc06f..859c7b8b5074 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -843,7 +843,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
+	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr,
+		               IRQF_USER_DATA, np->name, sai);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
 		return ret;
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 740b90df44bb..9987849d5258 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -1251,7 +1251,8 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
+	ret = devm_request_irq(&pdev->dev, irq, spdif_isr,
+			       IRQF_USER_DATA,
 			       dev_name(&pdev->dev), spdif_priv);
 	if (ret) {
 		dev_err(&pdev->dev, "could not claim irq %u\n", irq);
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 0a648229e643..6481ea718aa3 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1572,7 +1572,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	}
 
 	if (ssi->use_dma) {
-		ret = devm_request_irq(dev, ssi->irq, fsl_ssi_isr, 0,
+		ret = devm_request_irq(dev, ssi->irq, fsl_ssi_isr,
+				       IRQF_USER_DATA,
 				       dev_name(dev), ssi);
 		if (ret < 0) {
 			dev_err(dev, "failed to claim irq %u\n", ssi->irq);
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 00c92eb854ce..d497def8ecdf 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1786,8 +1786,9 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
 	}
 
 	/* setup interrupt handler */
-	ret = request_irq(irq, display_pipe_interrupt_handler, 0,
-			  pdev->name, card_ctx);
+	ret = request_irq(irq, display_pipe_interrupt_handler,
+			  IRQF_USER_DATA, pdev->name,
+			  card_ctx);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "request_irq failed\n");
 		goto err;
-- 
2.17.2

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [MODERATED] [PATCH v6 42/43] MDSv6
  2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
                   ` (40 preceding siblings ...)
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 41/43] MDSv6 Andi Kleen
@ 2019-02-24 15:07 ` Andi Kleen
  2019-02-24 15:07 ` [MODERATED] [PATCH v6 43/43] MDSv6 Andi Kleen
  42 siblings, 0 replies; 68+ messages in thread
From: Andi Kleen @ 2019-02-24 15:07 UTC (permalink / raw)
  To: speck; +Cc: Andi Kleen

From: Andi Kleen <ak@linux.intel.com>
Subject:  mds sweep: Mark timer handlers that touch user data

This is the result of a large scale tree audit, looking for timer
handlers that may touch user data. The audit was on the conservative
side, it was either handlers that clearly user data, or
were too complicated to audit and not performance critical.

There are more timer handlers that touch user data, but
these are covered by centralized hooks.

The change was done with the following cocci script,
except for DEFINE_TIMER, which was done by sed.

// SPDX-License-Identifier: GPL-2.0

@@
expression timer, func, flags;
@@
- timer_setup(timer, func, flags)
+ timer_setup(timer, func, flags | TIMER_USER_DATA)

@@
expression timer, func, flags;
@@
- timer_setup_on_stack(timer, func, flags)
+ timer_setup_on_stack(timer, func, flags | TIMER_USER_DATA)

@@
expression timer, flags1, flags2;
@@
- hrtimer_init(timer, flags1, flags2)
+ hrtimer_init(timer, flags1, flags2 | HRTIMER_MODE_USER_DATA)

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/events/intel/uncore.c                |  3 ++-
 drivers/auxdisplay/img-ascii-lcd.c            |  2 +-
 drivers/block/xsysace.c                       |  2 +-
 drivers/firewire/core-transaction.c           |  5 +++--
 drivers/gpu/drm/i915/i915_pmu.c               |  3 ++-
 drivers/ide/ide-probe.c                       |  2 +-
 drivers/iio/trigger/iio-trig-hrtimer.c        |  3 ++-
 drivers/input/ff-memless.c                    |  2 +-
 drivers/input/input.c                         |  2 +-
 drivers/isdn/capi/capidrv.c                   |  2 +-
 drivers/isdn/i4l/isdn_common.c                |  2 +-
 drivers/media/cec/cec-pin.c                   |  3 ++-
 drivers/media/pci/bt8xx/bttv-driver.c         |  2 +-
 drivers/media/pci/bt8xx/bttv-input.c          |  5 +++--
 .../pci/netup_unidvb/netup_unidvb_core.c      |  3 ++-
 drivers/media/pci/saa7134/saa7134-input.c     |  3 ++-
 drivers/media/pci/saa7134/saa7134-ts.c        |  3 ++-
 drivers/media/pci/saa7134/saa7134-vbi.c       |  3 ++-
 drivers/media/pci/saa7134/saa7134-video.c     |  3 ++-
 drivers/media/pci/ttpci/av7110_ir.c           |  3 ++-
 drivers/media/radio/radio-cadet.c             |  2 +-
 drivers/media/radio/wl128x/fmdrv_common.c     |  3 ++-
 drivers/media/rc/img-ir/img-ir-raw.c          |  2 +-
 drivers/media/rc/ir-rx51.c                    |  3 ++-
 drivers/media/usb/au0828/au0828-video.c       |  6 +++--
 drivers/net/appletalk/cops.c                  |  2 +-
 drivers/net/caif/caif_hsi.c                   |  9 +++++---
 drivers/net/hamradio/6pack.c                  |  4 ++--
 drivers/net/hamradio/scc.c                    |  4 ++--
 drivers/net/hamradio/yam.c                    |  4 ++--
 drivers/net/hippi/rrunner.c                   |  2 +-
 drivers/net/ieee802154/at86rf230.c            |  3 ++-
 drivers/net/slip/slip.c                       |  4 ++--
 drivers/net/wan/sdla.c                        |  2 +-
 drivers/net/wireless/ath/ath9k/init.c         |  5 +++--
 .../net/wireless/intersil/hostap/hostap_ap.c  |  2 +-
 .../wireless/marvell/mwifiex/11n_rxreorder.c  |  3 ++-
 drivers/net/wireless/marvell/mwifiex/usb.c    |  2 +-
 drivers/pcmcia/yenta_socket.c                 |  3 ++-
 drivers/platform/x86/sony-laptop.c            |  2 +-
 drivers/staging/comedi/drivers/comedi_test.c  |  6 +++--
 drivers/staging/comedi/drivers/jr3_pci.c      |  2 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c     |  2 +-
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 17 +++++++++-----
 drivers/staging/rtl8188eu/os_dep/recv_linux.c |  2 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |  2 +-
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |  6 +++--
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 22 ++++++++++++-------
 drivers/staging/rtl8723bs/os_dep/recv_linux.c |  2 +-
 drivers/staging/speakup/main.c                |  2 +-
 drivers/tty/isicom.c                          |  2 +-
 drivers/tty/moxa.c                            |  2 +-
 drivers/tty/n_gsm.c                           |  5 +++--
 drivers/tty/n_r3964.c                         |  2 +-
 drivers/tty/rocket.c                          |  2 +-
 drivers/tty/serial/8250/8250_core.c           |  3 ++-
 drivers/tty/serial/8250/8250_port.c           |  4 ++--
 drivers/tty/serial/max3100.c                  |  2 +-
 drivers/tty/serial/mux.c                      |  2 +-
 drivers/tty/serial/pnx8xxx_uart.c             |  3 ++-
 drivers/tty/serial/sccnxp.c                   |  2 +-
 drivers/tty/serial/sh-sci.c                   |  9 +++++---
 drivers/tty/vcc.c                             |  4 ++--
 drivers/tty/vt/keyboard.c                     |  2 +-
 drivers/usb/chipidea/otg_fsm.c                |  3 ++-
 drivers/usb/dwc2/hcd_queue.c                  |  6 +++--
 drivers/usb/gadget/function/f_ncm.c           |  3 ++-
 drivers/usb/gadget/udc/dummy_hcd.c            |  4 ++--
 drivers/usb/gadget/udc/m66592-udc.c           |  2 +-
 drivers/usb/gadget/udc/r8a66597-udc.c         |  2 +-
 drivers/usb/usbip/vudc_transfer.c             |  2 +-
 drivers/uwb/neh.c                             |  2 +-
 drivers/uwb/rsv.c                             |  5 +++--
 drivers/visorbus/visorbus_main.c              |  2 +-
 kernel/time/alarmtimer.c                      |  2 +-
 lib/random32.c                                |  2 +-
 net/wireless/lib80211.c                       |  2 +-
 security/keys/gc.c                            |  2 +-
 sound/core/hrtimer.c                          |  3 ++-
 sound/drivers/mpu401/mpu401_uart.c            |  3 ++-
 sound/drivers/mtpav.c                         |  3 ++-
 sound/drivers/pcsp/pcsp.c                     |  3 ++-
 sound/drivers/serial-u16550.c                 |  3 ++-
 sound/isa/sb/emu8000_pcm.c                    |  2 +-
 sound/isa/sb/sb8_midi.c                       |  3 ++-
 sound/isa/wavefront/wavefront_midi.c          |  4 ++--
 sound/pci/echoaudio/midi.c                    |  2 +-
 sound/pci/rme9652/hdsp.c                      |  2 +-
 sound/pci/rme9652/hdspm.c                     |  3 ++-
 sound/usb/midi.c                              |  3 ++-
 90 files changed, 180 insertions(+), 123 deletions(-)

diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 27a461414b30..2fe6f453b440 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -289,7 +289,8 @@ void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box)
 
 static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box)
 {
-	hrtimer_init(&box->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&box->hrtimer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	box->hrtimer.function = uncore_pmu_hrtimer;
 }
 
diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index 834509506ef6..cfa0d8dcfbda 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -395,7 +395,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev)
 	ctx->scroll_rate = HZ / 2;
 
 	/* initialise a timer for scrolling the message */
-	timer_setup(&ctx->timer, img_ascii_lcd_scroll, 0);
+	timer_setup(&ctx->timer, img_ascii_lcd_scroll, TIMER_USER_DATA);
 
 	platform_set_drvdata(pdev, ctx);
 
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 87ccef4bd69e..a6b3aa5bbb82 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1005,7 +1005,7 @@ static int ace_setup(struct ace_device *ace)
 	 * Initialize the state machine tasklet and stall timer
 	 */
 	tasklet_init(&ace->fsm_tasklet, ace_fsm_tasklet, (unsigned long)ace);
-	timer_setup(&ace->stall_timer, ace_stall_timer, 0);
+	timer_setup(&ace->stall_timer, ace_stall_timer, TIMER_USER_DATA);
 
 	/*
 	 * Initialize the request queue
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 50bf1fe1775f..44b19256a6aa 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -374,7 +374,7 @@ void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
 	t->card = card;
 	t->is_split_transaction = false;
 	timer_setup(&t->split_timeout_timer,
-		    split_transaction_timeout_callback, 0);
+		    split_transaction_timeout_callback, TIMER_USER_DATA);
 	t->callback = callback;
 	t->callback_data = callback_data;
 
@@ -431,7 +431,8 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
 	struct transaction_callback_data d;
 	struct fw_transaction t;
 
-	timer_setup_on_stack(&t.split_timeout_timer, NULL, 0);
+	timer_setup_on_stack(&t.split_timeout_timer, NULL,
+			     TIMER_USER_DATA);
 	init_completion(&d.done);
 	d.payload = payload;
 	fw_send_request(card, &t, tcode, destination_id, generation, speed,
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 017fc602a10e..be1aae302add 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -1066,7 +1066,8 @@ void i915_pmu_register(struct drm_i915_private *i915)
 	i915->pmu.base.event_idx	= i915_pmu_event_event_idx;
 
 	spin_lock_init(&i915->pmu.lock);
-	hrtimer_init(&i915->pmu.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&i915->pmu.timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	i915->pmu.timer.function = i915_sample;
 
 	ret = perf_pmu_register(&i915->pmu.base, "i915", -1);
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 958bf916d096..a137dfb1220c 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1233,7 +1233,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
 
 	spin_lock_init(&hwif->lock);
 
-	timer_setup(&hwif->timer, ide_timer_expiry, 0);
+	timer_setup(&hwif->timer, ide_timer_expiry, TIMER_USER_DATA);
 
 	init_completion(&hwif->gendev_rel_comp);
 
diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c
index 7accd0187ba1..d254026f82c4 100644
--- a/drivers/iio/trigger/iio-trig-hrtimer.c
+++ b/drivers/iio/trigger/iio-trig-hrtimer.c
@@ -136,7 +136,8 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
 	trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops;
 	trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups;
 
-	hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	trig_info->timer.function = iio_hrtimer_trig_handler;
 
 	trig_info->sampling_frequency = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index 2743ed4656e4..0fa743d51d46 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -526,7 +526,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
 	ml->private = data;
 	ml->play_effect = play_effect;
 	ml->gain = 0xffff;
-	timer_setup(&ml->timer, ml_effect_timer, 0);
+	timer_setup(&ml->timer, ml_effect_timer, TIMER_USER_DATA);
 
 	set_bit(FF_GAIN, dev->ffbit);
 
diff --git a/drivers/input/input.c b/drivers/input/input.c
index c22e8e167025..ce77a24512fe 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1795,7 +1795,7 @@ struct input_dev *input_allocate_device(void)
 		device_initialize(&dev->dev);
 		mutex_init(&dev->mutex);
 		spin_lock_init(&dev->event_lock);
-		timer_setup(&dev->timer, NULL, 0);
+		timer_setup(&dev->timer, NULL, TIMER_USER_DATA);
 		INIT_LIST_HEAD(&dev->h_list);
 		INIT_LIST_HEAD(&dev->node);
 
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index e8949f3dcae1..44c6722b596f 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -2265,7 +2265,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 		return -1;
 	}
 	card->owner = THIS_MODULE;
-	timer_setup(&card->listentimer, listentimerfunc, 0);
+	timer_setup(&card->listentimer, listentimerfunc, TIMER_USER_DATA);
 	strcpy(card->name, id);
 	card->contrnr = contr;
 	card->nbchan = profp->nbchannel;
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 6a5b3f00f9ad..0ec6f1115447 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -2290,7 +2290,7 @@ static int __init isdn_init(void)
 		printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
 		return -EIO;
 	}
-	timer_setup(&dev->timer, isdn_timer_funct, 0);
+	timer_setup(&dev->timer, isdn_timer_funct, TIMER_USER_DATA);
 	spin_lock_init(&dev->lock);
 	spin_lock_init(&dev->timerlock);
 #ifdef MODULE
diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c
index 8f987bc0dd88..62efd672b249 100644
--- a/drivers/media/cec/cec-pin.c
+++ b/drivers/media/cec/cec-pin.c
@@ -1312,7 +1312,8 @@ struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops,
 	if (pin == NULL)
 		return ERR_PTR(-ENOMEM);
 	pin->ops = pin_ops;
-	hrtimer_init(&pin->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&pin->timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	pin->timer.function = cec_pin_timer;
 	init_waitqueue_head(&pin->kthread_waitq);
 	pin->tx_custom_low_usecs = CEC_TIM_CUSTOM_DEFAULT;
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index d09785fd37a8..703d0bdd9607 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -4040,7 +4040,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
 	INIT_LIST_HEAD(&btv->capture);
 	INIT_LIST_HEAD(&btv->vcapture);
 
-	timer_setup(&btv->timeout, bttv_irq_timeout, 0);
+	timer_setup(&btv->timeout, bttv_irq_timeout, TIMER_USER_DATA);
 
 	btv->i2c_rc = -1;
 	btv->tuner_type  = UNSET;
diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c
index d34fbaa027c2..6acb2e1fa418 100644
--- a/drivers/media/pci/bt8xx/bttv-input.c
+++ b/drivers/media/pci/bt8xx/bttv-input.c
@@ -299,12 +299,13 @@ static int bttv_rc5_irq(struct bttv *btv)
 static void bttv_ir_start(struct bttv_ir *ir)
 {
 	if (ir->polling) {
-		timer_setup(&ir->timer, bttv_input_timer, 0);
+		timer_setup(&ir->timer, bttv_input_timer, TIMER_USER_DATA);
 		ir->timer.expires  = jiffies + msecs_to_jiffies(1000);
 		add_timer(&ir->timer);
 	} else if (ir->rc5_gpio) {
 		/* set timer_end for code completion */
-		timer_setup(&ir->timer, bttv_rc5_timer_end, 0);
+		timer_setup(&ir->timer, bttv_rc5_timer_end,
+			    TIMER_USER_DATA);
 		ir->shift_by = 1;
 		ir->rc5_remote_gap = ir_rc5_remote_gap;
 	}
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index ead59fabd15f..8b945aa3d1c1 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -664,7 +664,8 @@ static int netup_unidvb_dma_init(struct netup_unidvb_dev *ndev, int num)
 	spin_lock_init(&dma->lock);
 	INIT_WORK(&dma->work, netup_unidvb_dma_worker);
 	INIT_LIST_HEAD(&dma->free_buffers);
-	timer_setup(&dma->timeout, netup_unidvb_dma_timeout, 0);
+	timer_setup(&dma->timeout, netup_unidvb_dma_timeout,
+		    TIMER_USER_DATA);
 	dma->ring_buffer_size = ndev->dma_size / 2;
 	dma->addr_virt = ndev->dma_virt + dma->ring_buffer_size * num;
 	dma->addr_phys = (dma_addr_t)((u64)ndev->dma_phys +
diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c
index 35884d5b8337..43422aa92a1a 100644
--- a/drivers/media/pci/saa7134/saa7134-input.c
+++ b/drivers/media/pci/saa7134/saa7134-input.c
@@ -492,7 +492,8 @@ int saa7134_ir_open(struct rc_dev *rc)
 	ir->running = true;
 
 	if (ir->polling) {
-		timer_setup(&ir->timer, saa7134_input_timer, 0);
+		timer_setup(&ir->timer, saa7134_input_timer,
+			    TIMER_USER_DATA);
 		ir->timer.expires = jiffies + HZ;
 		add_timer(&ir->timer);
 	}
diff --git a/drivers/media/pci/saa7134/saa7134-ts.c b/drivers/media/pci/saa7134/saa7134-ts.c
index 2be703617e29..bb94e1a92669 100644
--- a/drivers/media/pci/saa7134/saa7134-ts.c
+++ b/drivers/media/pci/saa7134/saa7134-ts.c
@@ -223,7 +223,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev)
 	dev->ts.nr_packets = ts_nr_packets;
 
 	INIT_LIST_HEAD(&dev->ts_q.queue);
-	timer_setup(&dev->ts_q.timeout, saa7134_buffer_timeout, 0);
+	timer_setup(&dev->ts_q.timeout, saa7134_buffer_timeout,
+		    TIMER_USER_DATA);
 	dev->ts_q.dev              = dev;
 	dev->ts_q.need_two         = 1;
 	dev->ts_started            = 0;
diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c b/drivers/media/pci/saa7134/saa7134-vbi.c
index 57bea543c39b..f860bcc1797e 100644
--- a/drivers/media/pci/saa7134/saa7134-vbi.c
+++ b/drivers/media/pci/saa7134/saa7134-vbi.c
@@ -181,7 +181,8 @@ const struct vb2_ops saa7134_vbi_qops = {
 int saa7134_vbi_init1(struct saa7134_dev *dev)
 {
 	INIT_LIST_HEAD(&dev->vbi_q.queue);
-	timer_setup(&dev->vbi_q.timeout, saa7134_buffer_timeout, 0);
+	timer_setup(&dev->vbi_q.timeout, saa7134_buffer_timeout,
+		    TIMER_USER_DATA);
 	dev->vbi_q.dev              = dev;
 
 	if (vbibufs < 2)
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 5bc4b8fc8ebf..26076173343b 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2147,7 +2147,8 @@ int saa7134_video_init1(struct saa7134_dev *dev)
 	dev->automute       = 0;
 
 	INIT_LIST_HEAD(&dev->video_q.queue);
-	timer_setup(&dev->video_q.timeout, saa7134_buffer_timeout, 0);
+	timer_setup(&dev->video_q.timeout, saa7134_buffer_timeout,
+		    TIMER_USER_DATA);
 	dev->video_q.dev              = dev;
 	dev->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
 	dev->width    = 720;
diff --git a/drivers/media/pci/ttpci/av7110_ir.c b/drivers/media/pci/ttpci/av7110_ir.c
index ee414803e6b5..11fb9c8f9892 100644
--- a/drivers/media/pci/ttpci/av7110_ir.c
+++ b/drivers/media/pci/ttpci/av7110_ir.c
@@ -313,7 +313,8 @@ int av7110_ir_init(struct av7110 *av7110)
 	av_list[av_cnt++] = av7110;
 	av7110_check_ir_config(av7110, true);
 
-	timer_setup(&av7110->ir.keyup_timer, av7110_emit_keyup, 0);
+	timer_setup(&av7110->ir.keyup_timer, av7110_emit_keyup,
+		    TIMER_USER_DATA);
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index d12e07e32546..3ad09e86971c 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -317,7 +317,7 @@ static void cadet_start_rds(struct cadet *dev)
 {
 	dev->rdsstat = 1;
 	outb(0x80, dev->io);        /* Select RDS fifo */
-	timer_setup(&dev->readtimer, cadet_handler, 0);
+	timer_setup(&dev->readtimer, cadet_handler, TIMER_USER_DATA);
 	dev->readtimer.expires = jiffies + msecs_to_jiffies(50);
 	add_timer(&dev->readtimer);
 }
diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c
index 800d69c3f80b..f2b0598d62e5 100644
--- a/drivers/media/radio/wl128x/fmdrv_common.c
+++ b/drivers/media/radio/wl128x/fmdrv_common.c
@@ -1550,7 +1550,8 @@ int fmc_prepare(struct fmdev *fmdev)
 	atomic_set(&fmdev->tx_cnt, 1);
 	fmdev->resp_comp = NULL;
 
-	timer_setup(&fmdev->irq_info.timer, int_timeout_handler, 0);
+	timer_setup(&fmdev->irq_info.timer, int_timeout_handler,
+		    TIMER_USER_DATA);
 	/*TODO: add FM_STIC_EVENT later */
 	fmdev->irq_info.mask = FM_MAL_EVENT;
 
diff --git a/drivers/media/rc/img-ir/img-ir-raw.c b/drivers/media/rc/img-ir/img-ir-raw.c
index 6e545680d3b6..26c72c418942 100644
--- a/drivers/media/rc/img-ir/img-ir-raw.c
+++ b/drivers/media/rc/img-ir/img-ir-raw.c
@@ -107,7 +107,7 @@ int img_ir_probe_raw(struct img_ir_priv *priv)
 	int error;
 
 	/* Set up the echo timer */
-	timer_setup(&raw->timer, img_ir_echo_timer, 0);
+	timer_setup(&raw->timer, img_ir_echo_timer, TIMER_USER_DATA);
 
 	/* Allocate raw decoder */
 	raw->rdev = rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
index 8a93f7468622..b32ba38951bd 100644
--- a/drivers/media/rc/ir-rx51.c
+++ b/drivers/media/rc/ir-rx51.c
@@ -253,7 +253,8 @@ static int ir_rx51_probe(struct platform_device *dev)
 	ir_rx51.freq = DIV_ROUND_CLOSEST(pwm_get_period(pwm), NSEC_PER_SEC);
 	pwm_put(pwm);
 
-	hrtimer_init(&ir_rx51.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&ir_rx51.timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	ir_rx51.timer.function = ir_rx51_timer_cb;
 
 	ir_rx51.dev = &dev->dev;
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 7876c897cc1d..6b802ab82488 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1969,8 +1969,10 @@ int au0828_analog_register(struct au0828_dev *dev,
 	INIT_LIST_HEAD(&dev->vidq.active);
 	INIT_LIST_HEAD(&dev->vbiq.active);
 
-	timer_setup(&dev->vid_timeout, au0828_vid_buffer_timeout, 0);
-	timer_setup(&dev->vbi_timeout, au0828_vbi_buffer_timeout, 0);
+	timer_setup(&dev->vid_timeout, au0828_vid_buffer_timeout,
+		    TIMER_USER_DATA);
+	timer_setup(&dev->vbi_timeout, au0828_vbi_buffer_timeout,
+		    TIMER_USER_DATA);
 
 	dev->width = NTSC_STD_W;
 	dev->height = NTSC_STD_H;
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index f90bb723985f..31c4c2e504b3 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -426,7 +426,7 @@ static int cops_open(struct net_device *dev)
 		if(lp->board==TANGENT)	/* Poll 20 times per second */
 		{
 		    cops_timer_dev = dev;
-		    timer_setup(&cops_timer, cops_poll, 0);
+		    timer_setup(&cops_timer, cops_poll, TIMER_USER_DATA);
 		    cops_timer.expires 	= jiffies + HZ/20;
 		    add_timer(&cops_timer);
 		} 
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 433a14b9f731..8d3422e2444e 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -1210,11 +1210,14 @@ static int cfhsi_open(struct net_device *ndev)
 	init_waitqueue_head(&cfhsi->flush_fifo_wait);
 
 	/* Setup the inactivity timer. */
-	timer_setup(&cfhsi->inactivity_timer, cfhsi_inactivity_tout, 0);
+	timer_setup(&cfhsi->inactivity_timer, cfhsi_inactivity_tout,
+		    TIMER_USER_DATA);
 	/* Setup the slowpath RX timer. */
-	timer_setup(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath, 0);
+	timer_setup(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath,
+		    TIMER_USER_DATA);
 	/* Setup the aggregation timer. */
-	timer_setup(&cfhsi->aggregation_timer, cfhsi_aggregation_tout, 0);
+	timer_setup(&cfhsi->aggregation_timer, cfhsi_aggregation_tout,
+		    TIMER_USER_DATA);
 
 	/* Activate HSI interface. */
 	res = cfhsi->ops->cfhsi_up(cfhsi->ops);
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index a19868cba48c..13d1566bf9bc 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -613,9 +613,9 @@ static int sixpack_open(struct tty_struct *tty)
 
 	netif_start_queue(dev);
 
-	timer_setup(&sp->tx_t, sp_xmit_on_air, 0);
+	timer_setup(&sp->tx_t, sp_xmit_on_air, TIMER_USER_DATA);
 
-	timer_setup(&sp->resync_t, resync_tnc, 0);
+	timer_setup(&sp->resync_t, resync_tnc, TIMER_USER_DATA);
 
 	spin_unlock_bh(&sp->lock);
 
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 1e7ee07887e1..16f851941e51 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1523,8 +1523,8 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc)
 	dev->ml_priv = scc;
 	scc->dev = dev;
 	spin_lock_init(&scc->lock);
-	timer_setup(&scc->tx_t, NULL, 0);
-	timer_setup(&scc->tx_wdog, NULL, 0);
+	timer_setup(&scc->tx_t, NULL, TIMER_USER_DATA);
+	timer_setup(&scc->tx_wdog, NULL, TIMER_USER_DATA);
 
 	err = register_netdevice(dev);
 	if (err) {
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 433695ae5e5c..ee316c06eb3c 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -157,7 +157,7 @@ static struct net_device *yam_devs[NR_PORTS];
 
 static struct yam_mcs *yam_data;
 
-static DEFINE_TIMER(yam_timer, NULL);
+static DEFINE_TIMER_USERDATA(yam_timer, NULL);
 
 /* --------------------------------------------------------------------- */
 
@@ -1154,7 +1154,7 @@ static int __init yam_init_driver(void)
 
 	}
 
-	timer_setup(&yam_timer, yam_dotimer, 0);
+	timer_setup(&yam_timer, yam_dotimer, TIMER_USER_DATA);
 	yam_timer.expires = jiffies + HZ / 100;
 	add_timer(&yam_timer);
 
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 029206e4da3b..d38830828bad 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -1229,7 +1229,7 @@ static int rr_open(struct net_device *dev)
 
 	/* Set the timer to switch to check for link beat and perhaps switch
 	   to an alternate media type. */
-	timer_setup(&rrpriv->timer, rr_timer, 0);
+	timer_setup(&rrpriv->timer, rr_timer, TIMER_USER_DATA);
 	rrpriv->timer.expires = RUN_AT(5*HZ);           /* 5 sec. watchdog */
 	add_timer(&rrpriv->timer);
 
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 50af3e288503..bb82970486b3 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -812,7 +812,8 @@ at86rf230_setup_spi_messages(struct at86rf230_local *lp,
 	state->trx.tx_buf = state->buf;
 	state->trx.rx_buf = state->buf;
 	spi_message_add_tail(&state->trx, &state->msg);
-	hrtimer_init(&state->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_init(&state->timer, CLOCK_MONOTONIC,
+		     HRTIMER_MODE_REL | HRTIMER_MODE_USER_DATA | HRTIMER_MODE_USER_DATA);
 	state->timer.function = at86rf230_async_state_timer;
 }
 
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 9757f1fc104f..9a7bb0f5ffff 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -762,8 +762,8 @@ static struct slip *sl_alloc(void)
 	sl->mode        = SL_MODE_DEFAULT;
 #ifdef CONFIG_SLIP_SMART
 	/* initialize timer_list struct */
-	timer_setup(&sl->keepalive_timer, sl_keepalive, 0);
-	timer_setup(&sl->outfill_timer, sl_outfill, 0);
+	timer_setup(&sl->keepalive_timer, sl_keepalive, TIMER_USER_DATA);
+	timer_setup(&sl->outfill_timer, sl_outfill, TIMER_USER_DATA);
 #endif
 	slip_devs[i] = dev;
 	return sl;
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 0a0cff9228e8..6bb1c9b5b87d 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -1615,7 +1615,7 @@ static void setup_sdla(struct net_device *dev)
 	flp->dlci_conf		= sdla_dlci_conf;
 	flp->dev		= dev;
 
-	timer_setup(&flp->timer, sdla_poll, 0);
+	timer_setup(&flp->timer, sdla_poll, TIMER_USER_DATA);
 	flp->timer.expires	= 1;
 }
 
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index c070a9e51ebf..ef93894a1cf1 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -425,7 +425,8 @@ static void ath9k_init_misc(struct ath_softc *sc)
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	int i = 0;
 
-	timer_setup(&common->ani.timer, ath_ani_calibrate, 0);
+	timer_setup(&common->ani.timer, ath_ani_calibrate,
+		    TIMER_USER_DATA);
 
 	common->last_rssi = ATH_RSSI_DUMMY_MARKER;
 	eth_broadcast_addr(common->bssidmask);
@@ -734,7 +735,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
 	tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
 		     (unsigned long)sc);
 
-	timer_setup(&sc->sleep_timer, ath_ps_full_sleep, 0);
+	timer_setup(&sc->sleep_timer, ath_ps_full_sleep, TIMER_USER_DATA);
 	INIT_WORK(&sc->hw_reset_work, ath_reset_work);
 	INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
 	INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
diff --git a/drivers/net/wireless/intersil/hostap/hostap_ap.c b/drivers/net/wireless/intersil/hostap/hostap_ap.c
index 0094b1d2b577..8494fb259e8d 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_ap.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_ap.c
@@ -1131,7 +1131,7 @@ static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr)
 	}
 
 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
-	timer_setup(&sta->timer, ap_handle_timer, 0);
+	timer_setup(&sta->timer, ap_handle_timer, TIMER_USER_DATA);
 	sta->timer.expires = jiffies + ap->max_inactivity;
 	if (!ap->local->hostapd)
 		add_timer(&sta->timer);
diff --git a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
index 5380fba652cc..dcb5e62e0102 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
@@ -413,7 +413,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
 	new_node->timer_context.priv = priv;
 	new_node->timer_context.timer_is_set = false;
 
-	timer_setup(&new_node->timer_context.timer, mwifiex_flush_data, 0);
+	timer_setup(&new_node->timer_context.timer, mwifiex_flush_data,
+		    TIMER_USER_DATA);
 
 	for (i = 0; i < win_size; ++i)
 		new_node->rx_reorder_ptr[i] = NULL;
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index d445acc4786b..ce963105142b 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -1261,7 +1261,7 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter)
 		port->tx_aggr.timer_cnxt.is_hold_timer_set = false;
 		port->tx_aggr.timer_cnxt.hold_tmo_msecs = 0;
 		timer_setup(&port->tx_aggr.timer_cnxt.hold_timer,
-			    mwifiex_usb_tx_aggr_tmo, 0);
+			    mwifiex_usb_tx_aggr_tmo, TIMER_USER_DATA);
 	}
 
 	return 0;
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index c978a6961578..4f8d72d7a691 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1234,7 +1234,8 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED | IRQF_USER_DATA, "yenta", socket)) {
 		/* No IRQ or request_irq failed. Poll */
 		socket->cb_irq = 0; /* But zero is a valid IRQ number. */
-		timer_setup(&socket->poll_timer, yenta_interrupt_wrapper, 0);
+		timer_setup(&socket->poll_timer, yenta_interrupt_wrapper,
+			    TIMER_USER_DATA);
 		mod_timer(&socket->poll_timer, jiffies + HZ);
 		dev_info(&dev->dev,
 			 "no PCI IRQ, CardBus support disabled for this socket.\n");
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index c83a8da216ce..52770388c84f 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -471,7 +471,7 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device)
 	}
 
 	timer_setup(&sony_laptop_input.release_key_timer,
-		    do_sony_laptop_release_key, 0);
+		    do_sony_laptop_release_key, TIMER_USER_DATA);
 
 	/* input keys */
 	key_dev = input_allocate_device();
diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
index ef4c7c8a2b71..02b9ea93c1e7 100644
--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -723,8 +723,10 @@ static int waveform_common_attach(struct comedi_device *dev,
 		devpriv->ao_loopbacks[i] = s->maxdata / 2;
 
 	devpriv->dev = dev;
-	timer_setup(&devpriv->ai_timer, waveform_ai_timer, 0);
-	timer_setup(&devpriv->ao_timer, waveform_ao_timer, 0);
+	timer_setup(&devpriv->ai_timer, waveform_ai_timer,
+		    TIMER_USER_DATA);
+	timer_setup(&devpriv->ao_timer, waveform_ao_timer,
+		    TIMER_USER_DATA);
 
 	dev_info(dev->class_dev,
 		 "%s: %u microvolt, %u microsecond waveform attached\n",
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index c3c88e6d298f..87e8b685b586 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -762,7 +762,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
 	}
 
 	devpriv->dev = dev;
-	timer_setup(&devpriv->timer, jr3_pci_poll_dev, 0);
+	timer_setup(&devpriv->timer, jr3_pci_poll_dev, TIMER_USER_DATA);
 	devpriv->timer.expires = jiffies + msecs_to_jiffies(1000);
 	add_timer(&devpriv->timer);
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 1d83affc08ce..d0bda444397a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -77,7 +77,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
 	res = rtw_hal_init_recv_priv(padapter);
 
 	timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl,
-		    0);
+		    TIMER_USER_DATA);
 
 	precvpriv->signal_stat_sampling_interval = 1000; /* ms */
 
diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
index d5ceb3beabbc..bed626e73545 100644
--- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
@@ -15,10 +15,12 @@ void rtw_init_mlme_timer(struct adapter *padapter)
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler, 0);
-	timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler, 0);
+	timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler,
+		    TIMER_USER_DATA);
 	timer_setup(&pmlmepriv->dynamic_chk_timer,
-		    rtw_dynamic_check_timer_handlder, 0);
+		    rtw_dynamic_check_timer_handlder, TIMER_USER_DATA);
 }
 
 void rtw_os_indicate_connect(struct adapter *adapter)
@@ -114,15 +116,18 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
 
 void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
 {
-	timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0);
+	timer_setup(&psta->addba_retry_timer, addba_timer_hdl,
+		    TIMER_USER_DATA);
 }
 
 void init_mlme_ext_timer(struct adapter *padapter)
 {
 	struct	mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
-	timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0);
-	timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0);
+	timer_setup(&pmlmeext->survey_timer, survey_timer_hdl,
+		    TIMER_USER_DATA);
+	timer_setup(&pmlmeext->link_timer, link_timer_hdl,
+		    TIMER_USER_DATA);
 }
 
 #ifdef CONFIG_88EU_AP_MODE
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index 9c9339863a4a..e24c94c24441 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -141,5 +141,5 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
 void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
 {
 	timer_setup(&preorder_ctrl->reordering_ctrl_timer,
-		    rtw_reordering_ctrl_timeout_handler, 0);
+		    rtw_reordering_ctrl_timeout_handler, TIMER_USER_DATA);
 }
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index d7975aa3