* 'linux-4.19.y-cip' of https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip: CIP: Bump version suffix to -cip120 after merge from cip/linux-4.19.y-st tree Update localversion-st, tree is up-to-date with 5.4.292. net: dsa: mv88e6xxx: propperly shutdown PPU re-enable timer on destroy jfs: add index corruption check to DT_GETPAGE() jfs: fix slab-out-of-bounds read in ea_get() tracing: Fix use-after-free in print_graph_function_flags during tracer switching mmc: sdhci-pxav3: set NEED_RSP_BUSY capability x86/tsc: Always save/restore TSC sched_clock() on suspend/resume ntb_perf: Delete duplicate dmaengine_unmap_put() call in perf_copy_chunk() arcnet: Add NULL check in com20020pci_probe() ipv6: fix omitted netlink attributes when using RTEXT_FILTER_SKIP_STATS vsock: avoid timeout during connect() if the socket is closing net_sched: skbprio: Remove overly strict queue assertions netlabel: Fix NULL pointer exception caused by CALIPSO on IPv4 sockets ntb: intel: Fix using link status DB's ntb_hw_switchtec: Fix shift-out-of-bounds in switchtec_ntb_mw_set_trans spufs: fix a leak in spufs_create_context() spufs: fix a leak on spufs_new_file() failure hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9} sched/deadline: Use online cpus for validating runtime affs: don't write overlarge OFS data block size fields affs: generate OFS sequence numbers starting at 1 wifi: iwlwifi: fw: allocate chained SG tables for dump sched/smt: Always inline sched_smt_active() ring-buffer: Fix bytes_dropped calculation issue objtool, media: dib8000: Prevent divide-by-zero in dib8000_set_dds() fs/procfs: fix the comment above proc_pid_wchan() perf python: Check if there is space to copy all the event perf python: Decrement the refcount of just created event on failure perf python: Fixup description of sample.id event member ocfs2: validate l_tree_depth to avoid out-of-bounds access perf units: Fix insufficient array space iio: accel: mma8452: Ensure error return on failure to matching oversampling ratio coresight: catu: Fix number of pages while using 64k pages isofs: fix KMSAN uninit-value bug in do_isofs_readdir() x86/dumpstack: Fix inaccurate unwinding from exception stacks due to misplaced assignment mfd: sm501: Switch to BIT() to mitigate integer overflows RDMA/mlx5: Fix mlx5_poll_one() cur_qp update flow power: supply: max77693: Fix wrong conversion of charge input threshold value x86/entry: Fix ORC unwinder for PUSH_REGS with save_ret=1 IB/mad: Check available slots before posting receive WRs clk: rockchip: rk3328: fix wrong clk_ref_usb3otg parent lib: 842: Improve error handling in sw842_compress() clk: amlogic: gxbb: drop incorrect flag on 32k clock fbdev: sm501fb: Add some geometry checks. mdacon: rework dependency list fbdev: au1100fb: Move a variable assignment behind a null pointer check PCI/portdrv: Only disable pciehp interrupts early when needed ALSA: hda/realtek: Always honor no_shutup_pins perf/ring_buffer: Allow the EPOLLRDNORM flag for poll lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*() thermal: int340x: Add NULL check for adev EDAC/ie31200: Fix the error path order of ie31200_init() EDAC/ie31200: Fix the DIMM size mask for several SoCs x86/fpu: Avoid copying dynamic FP state from init_task in arch_dup_task_struct() cpufreq: governor: Fix negative 'idle_time' handling in dbs_update() net: usb: usbnet: restore usb%d name exception for local mac addresses net: usb: qmi_wwan: add Telit Cinterion FE990B composition net: usb: qmi_wwan: add Telit Cinterion FN990B composition tty: serial: 8250: Add some more device IDs netfilter: socket: Lookup orig tuple for IPv6 SNAT ARM: 9351/1: fault: Add "cut here" line for prefetch aborts ARM: 9350/1: fault: Implement copy_from_kernel_nofault_allowed() atm: Fix NULL pointer dereference ALSA: usb-audio: Add quirk for Plantronics headsets to fix control names drm/radeon: fix uninitialized size issue in radeon_vce_cs_parse() batman-adv: Ignore own maximum aggregation size during RX ARM: shmobile: smp: Enforce shmobile_smp_* alignment mmc: atmel-mci: Add missing clk_disable_unprepare() net/neighbor: add missing policy for NDTPA_QUEUE_LENBYTES net: atm: fix use after free in lec_send() Bluetooth: Fix error code in chan_alloc_skb_cb() RDMA/hns: Fix wrong value of max_sge_rd RDMA/bnxt_re: Avoid clearing VLAN_ID mask in modify qp path xfrm_output: Force software GSO only in tunnel mode i2c: sis630: Fix an error handling path in sis630_probe() i2c: ali15x3: Fix an error handling path in ali15x3_probe() i2c: ali1535: Fix an error handling path in ali1535_probe() ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe() drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data() qlcnic: fix memory leak issues in qlcnic_sriov_common.c drm/amd/display: Assign normalized_pix_clk when color depth = 14 x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes USB: serial: option: match on interface class for Telit FN990B USB: serial: option: fix Telit Cinterion FE990A name USB: serial: option: add Telit Cinterion FE990B compositions USB: serial: ftdi_sio: add support for Altera USB Blaster 3 block: fix 'kmem_cache of name 'bio-108' already exists' drm/nouveau: Do not override forced connector status x86/irq: Define trace events conditionally nvme: only allow entering LIVE from CONNECTING state sctp: Fix undefined behavior in left shift operation nvmet-rdma: recheck queue state is LIVE in state lock in recv done s390/cio: Fix CHPID "configure" attribute caching HID: ignore non-functional sensor in HP 5MP Camera iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() powercap: call put_device() on an error path in powercap_register_control_type() nvme-fc: go straight to connecting state when initializing net_sched: Prevent creation of classes with TC_H_ROOT ipvs: prevent integer overflow in do_ip_vs_get_ctl() netfilter: nf_conncount: Fully initialize struct nf_conncount_tuple in insert_tree() Drivers: hv: vmbus: Don't release fb_mmio resource in vmbus_free_mmio() drivers/hv: Replace binary semaphore with mutex netpoll: hold rcu read lock in __netpoll_send_skb() netpoll: netpoll_send_skb() returns transmit status netpoll: move netpoll_send_skb() out of line netpoll: remove dev argument from netpoll_send_skb_on_dev() netpoll: Fix use correct return type for ndo_start_xmit() pinctrl: bcm281xx: Fix incorrect regmap max_registers value sctp: sysctl: auth_enable: avoid using current->nsproxy sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy Revert "sctp: sysctl: auth_enable: avoid using current->nsproxy" Revert "sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy" sched/isolation: Prevent boot crash when the boot CPU is nohz_full CIP: Bump version suffix to -cip119 after merge from cip/linux-4.19.y-st tree watchdog: renesas_wdt: support handover from bootloader Update localversion-st, tree is up-to-date with 5.4.291. gtp: Suppress list corruption splat in gtp_net_exit_batch_rtnl(). gtp: Destroy device along with udp socket's netns dismantle. net: gso: fix ownership in __udp_gso_segment vlan: fix memory leak in vlan_newlink() batman-adv: Drop unmanaged ELP metric worker tee: optee: Fix supplicant wait loop pps: Fix a use-after-free net: rose: lock the socket in rose_bind() btrfs: fix use-after-free when attempting to join an aborted transaction media: lmedm04: Handle errors for lme2510_int_read wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step eeprom: digsy_mtc: Make GPIO lookup table match the device slimbus: messaging: Free transaction ID in delayed interrupt scenario intel_th: pci: Add Panther Lake-P/U support intel_th: pci: Add Panther Lake-H support intel_th: pci: Add Arrow Lake support Squashfs: check the inode number is not the invalid value of zero xhci: pci: Fix indentation in the PCI device ID definitions usb: gadget: Check bmAttributes only if configuration is valid usb: gadget: Fix setting self-powered state on suspend usb: gadget: Set self-powered based on MaxPower and bmAttributes usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality usb: typec: ucsi: increase timeout for PPM reset operations usb: atm: cxacru: fix a flaw in existing endpoint checks usb: quirks: Add DELAY_INIT and NO_LPM for Prolific Mass Storage Card Reader usb: renesas_usbhs: Use devm_usb_get_phy() Revert "drivers/card_reader/rtsx_usb: Restore interrupt based detection" net: ipv6: fix missing dst ref drop in ila lwtunnel net: ipv6: fix dst ref loop in ila lwtunnel net-timestamp: support TCP GSO case for a few missing flags vlan: enforce underlying device type ppp: Fix KMSAN uninit-value warning with bpf be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe() llc: do not use skb_get() before dev_queue_xmit() hwmon: (ad7314) Validate leading zero bits and return error hwmon: (ntc_thermistor) Fix the ncpXXxh103 sensor table hwmon: (pmbus) Initialise page count in pmbus_identify() caif_virtio: fix wrong pointer check in cfv_probe() HID: intel-ish-hid: Fix use-after-free issue in ishtp_hid_remove() mm/page_alloc: fix uninitialized variable rapidio: fix an API misues when rio_add_net() fails rapidio: add check for rio_add_net() in rio_scan_alloc_net() wifi: nl80211: reject cooked mode if it is set along with other flags wifi: cfg80211: regulatory: improve invalid hints checking x86/cpu: Properly parse CPUID leaf 0x2 TLB descriptor 0x63 x86/cpu: Validate CPUID leaf 0x2 EDX output x86/cacheinfo: Validate CPUID leaf 0x2 EDX output platform/x86: thinkpad_acpi: Add battery quirk for ThinkPad X131e drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M ALSA: hda/realtek: update ALC222 depop optimize ALSA: hda: intel: Add Dell ALC3271 to power_save denylist HID: appleir: Fix potential NULL dereference at raw event handle Revert "of: reserved-memory: Fix using wrong number of cells to get property 'alignment'" drm/amdgpu: disable BAR resize on Dell G5 SE drm/amdgpu: Check extended configuration space register when system uses large bar drm/amdgpu: skip BAR resizing if the bios already did it acct: perform last write from workqueue kernel/acct.c: use dedicated helper to access rlimit values kernel/acct.c: use #elif instead of #end and #elif pfifo_tail_enqueue: Drop new packet when sch->limit == 0 sched/core: Prevent rescheduling when interrupts are disabled phy: exynos5-usbdrd: fix MPLL_MULTIPLIER and SSC_REFCLKSEL masks in refclk usbnet: gl620a: fix endpoint checking in genelink_bind() perf/core: Fix low freq setting via IOC_PERIOD ftrace: Avoid potential division by zero in function_stat_show() x86/CPU: Fix warm boot hang regression on AMD SC1100 SoC systems ipvs: Always clear ipvs_property flag in skb_scrub_packet() ASoC: es8328: fix route from DAC to output net: cadence: macb: Synchronize stats calculations sunrpc: suppress warnings for unused procfs functions batman-adv: Ignore neighbor throughput metrics in error case acct: block access to kernel internal filesystems ALSA: hda/conexant: Add quirk for HP ProBook 450 G4 mute LED nfp: bpf: Add check for nfp_app_ctrl_msg_alloc() power: supply: da9150-fg: fix potential overflow geneve: Suppress list corruption splat in geneve_destroy_tunnels(). geneve: Fix use-after-free in geneve_find_dev(). powerpc/code-patching: Fix KASAN hit by not flagging text patching area as VM_ALLOC ALSA: hda/realtek - Add type for ALC287 powerpc/64s: Rewrite __real_pte() and __rpte_to_hidx() as static inline powerpc/64s/mm: Move __real_pte stubs into hash-4k.h USB: gadget: f_midi: f_midi_complete to call queue_work usb/gadget: f_midi: Replace tasklet with work usb/gadget: f_midi: convert tasklets to use new tasklet_setup() API usb: dwc3: Fix timeout issue during controller enter/exit from halt state mm: update mark_victim tracepoints fields crypto: testmgr - some more fixes to RSA test vectors crypto: testmgr - populate RSA CRT parameters in RSA test vectors crypto: testmgr - fix version number of RSA tests crypto: testmgr - Fix wrong test case of RSA crypto: testmgr - fix wrong key length for pkcs1pad driver core: bus: Fix double free in driver API bus_register() scsi: storvsc: Set correct data length for sending SCSI command without payload vlan: move dev_put into vlan_dev_uninit vlan: introduce vlan_dev_free_egress_priority Revert "btrfs: avoid monopolizing a core when activating a swap file" parport_pc: add support for ASIX AX99100 can: ems_pci: move ASIX AX99100 ids to pci_ids.h nilfs2: protect access to buffers with no active references nilfs2: do not force clear folio if buffer is referenced nilfs2: do not output warnings when clearing dirty buffers alpha: replace hardcoded stack offsets with autogenerated ones ndisc: extend RCU protection in ndisc_send_skb() openvswitch: use RCU protection in ovs_vport_cmd_fill_info() arp: use RCU protection in arp_xmit() neighbour: use RCU protection in __neigh_notify() neighbour: delete redundant judgment statements ndisc: use RCU protection in ndisc_alloc_skb() ipv6: use RCU protection in ip6_default_advmss() ipv4: use RCU protection in inet_select_addr() ipv4: use RCU protection in rt_is_expired() net: add dev_net_rcu() helper net: treat possible_net_t net pointer as an RCU one and add read_pnet_rcu() partitions: mac: fix handling of bogus partition table gpio: stmpe: Check return value of stmpe_reg_read in stmpe_gpio_irq_sync_unlock alpha: align stack for page fault and user unaligned trap handlers alpha: make stack 16-byte aligned (most cases) can: c_can: fix unbalanced runtime PM disable in error path USB: serial: option: drop MeiG Smart defines USB: serial: option: fix Telit Cinterion FN990A name USB: serial: option: add Telit Cinterion FN990B compositions USB: serial: option: add MeiG Smart SLM828 usb: cdc-acm: Fix handling of oversized fragments usb: cdc-acm: Check control transfer buffer size before access USB: cdc-acm: Fill in Renesas R-Car D3 USB Download mode quirk USB: hub: Ignore non-compliant devices with too many configs or interfaces usb: gadget: f_midi: fix MIDI Streaming descriptor lengths USB: Add USB_QUIRK_NO_LPM quirk for sony xperia xz1 smartphone USB: quirks: add USB_QUIRK_NO_LPM quirk for Teclast dist USB: pci-quirks: Fix HCCPARAMS register error for LS7A EHCI usb: dwc2: gadget: remove of_node reference upon udc_stop usb: gadget: udc: renesas_usb3: Fix compiler warning usb: roles: set switch registered flag early on batman-adv: fix panic during interface removal ASoC: Intel: bytcr_rt5640: Add DMI quirk for Vexia Edu Atla 10 tablet 5V orangefs: fix a oob in orangefs_debug_write Grab mm lock before grabbing pt lock vfio/pci: Enable iowrite64 and ioread64 for vfio pci media: cxd2841er: fix 64-bit division on gcc-9 xen: remove a confusing comment on auto-translated guest I/O gpio: bcm-kona: Add missing newline to dev_err format string gpio: bcm-kona: Fix GPIO lock/unlock for banks above bank 0 arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array team: better TEAM_OPTION_TYPE_STRING validation vrf: use RCU protection in l3mdev_l3_out() ndisc: ndisc_send_redirect() must use dev_get_by_index_rcu() HID: multitouch: Add NULL check in mt_input_configured ocfs2: check dir i_size in ocfs2_find_entry MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static ptp: Ensure info->enable callback is always set mtd: onenand: Fix uninitialized retlen in do_otp_read() NFC: nci: Add bounds checking in nci_hci_create_pipe() nilfs2: fix possible int overflows in nilfs_fiemap() ocfs2: handle a symlink read error correctly ocfs2: fix incorrect CPU endianness conversion causing mount failure nvmem: core: improve range check for nvmem_cell_write() crypto: qce - fix goto jump in error path media: uvcvideo: Remove redundant NULL assignment media: uvcvideo: Fix event flags in uvc_ctrl_send_events media: ov5640: fix get_light_freq on auto soc: qcom: smem_state: fix missing of_node_put in error path powerpc/pseries/eeh: Fix get PE state translation serial: sh-sci: Do not probe the serial port if its slot in sci_ports[] is in use serial: sh-sci: Drop __initdata macro for port_cfg usb: gadget: f_tcm: Don't prepare BOT write request twice usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint usb: gadget: f_tcm: Decrement command ref count on cleanup usb: gadget: f_tcm: Translate error to sense wifi: brcmfmac: fix NULL pointer dereference in brcmf_txfinalize() HID: hid-sensor-hub: don't use stale platform-data on remove of: reserved-memory: Fix using wrong number of cells to get property 'alignment' of: Fix of_find_node_opts_by_path() handling of alias+path+options of: Correct child specifier used as input of the 2nd nexus node clk: qcom: clk-alpha-pll: fix alpha mode configuration Bluetooth: L2CAP: handle NULL sock pointer in l2cap_sock_alloc KVM: s390: vsie: fix some corner-cases when grabbing vsie pages KVM: Explicitly verify target vCPU is online in kvm_get_vcpu() arm64: dts: rockchip: increase gmac rx_delay on rk3399-puma binfmt_flat: Fix integer overflow bug on 32 bit systems m68k: vga: Fix I/O defines s390/futex: Fix FUTEX_OP_ANDN implementation leds: lp8860: Write full EEPROM, not only half of it cpufreq: s3c64xx: Fix compilation warning tun: revert fix group permission check netem: Update sch->q.qlen before qdisc_tree_reduce_backlog() udp: gso: do not drop small packets when PMTU reduces tg3: Disable tg3 PCIe AER on system reboot firmware: iscsi_ibft: fix ISCSI_IBFT Kconfig entry nvme: handle connectivity loss in nvme_set_queue_count usb: xhci: Fix NULL pointer dereference on certain command aborts usb: xhci: Add timeout argument in address_device USB HCD callback media: uvcvideo: Remove dangling pointers media: uvcvideo: Only save async fh if success nilfs2: handle errors that nilfs_prepare_chunk() may return nilfs2: eliminate staggered calls to kunmap in nilfs_rename nilfs2: move page release outside of nilfs_delete_entry and nilfs_set_link x86/mm: Don't disable PCID when INVLPG has been fixed by microcode HID: Wacom: Add PCI Wacom device support mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id wifi: brcmsmac: add gain range check to wlc_phy_iqcal_gainparams_nphy() mmc: core: Respect quirk_max_rate for non-UHS SDIO card tun: fix group permission check printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX sched: Don't try to catch up excess steal time. btrfs: convert BUG_ON in btrfs_reloc_cow_block() to proper error handling btrfs: output the reason for open_ctree() failure usb: gadget: f_tcm: Don't free command immediately media: uvcvideo: Fix double free in error path usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE drivers/card_reader/rtsx_usb: Restore interrupt based detection ktest.pl: Check kernelrelease return in get_version NFSD: Reset cb_seq_status after NFS4ERR_DELAY hexagon: Fix unbalanced spinlock in die() hexagon: fix using plain integer as NULL pointer warning in cmpxchg genksyms: fix memory leak when the same symbol is read from *.symref file genksyms: fix memory leak when the same symbol is added from source net: sh_eth: Fix missing rtnl lock in suspend/resume path vsock: Allow retrying on connect() failure net: davicom: fix UAF in dm9000_drv_remove net: rose: fix timer races against user threads PM: hibernate: Add error handling for syscore_suspend() net: fec: implement TSO descriptor cleanup ubifs: skip dumping tnc tree when zroot is null dmaengine: ti: edma: fix OF node reference leaks in edma_driver module: Extend the preempt disabled section in dereference_symbol_descriptor(). ocfs2: mark dquot as inactive if failed to start trans while releasing dquot scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1 media: camif-core: Add check for clk_enable() media: mipi-csis: Add check for clk_enable() PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy() media: rc: iguanair: handle timeouts fbdev: omapfb: Fix an OF node leak in dss_of_port_get_parent_device() ARM: dts: mediatek: mt7623: fix IR nodename arm64: dts: mediatek: mt8173-evb: Fix MT6397 PMIC sub-node names arm64: dts: mediatek: mt8173-evb: Drop regulator-compatible property rdma/cxgb4: Prevent potential integer overflow on 32bit RDMA/mlx4: Avoid false error about access to uninitialized gids array perf report: Fix misleading help message about --demangle perf top: Don't complain about lack of vmlinux when not resolving some kernel samples padata: fix sysfs store callback check ktest.pl: Remove unused declarations in run_bisect_test function net: sched: Disallow replacing of child qdisc from one parent to another net/mlxfw: Drop hard coded max FW flash image size selftests: harness: fix printing of mismatch values in __EXPECT() selftests/harness: Display signed values correctly wifi: wlcore: fix unbalanced pm_runtime calls regulator: of: Implement the unwind path of of_regulator_match() team: prevent adding a device which is already a team device lower cpupower: fix TSC MHz calculation wifi: rtlwifi: pci: wait for firmware loading before releasing memory wifi: rtlwifi: fix memory leaks and invalid access at probe error path wifi: rtlwifi: remove unused dualmac control leftovers rtlwifi: replace usage of found with dedicated list iterator variable wifi: rtlwifi: usb: fix workqueue leak when probe fails wifi: rtlwifi: do not complete firmware loading needlessly drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table drm/etnaviv: Fix page property being used for non writecombine buffers afs: Fix directory format encoding struct overflow: Allow mixed type arguments overflow: Correct check_shl_overflow() comment overflow: Add __must_check attribute to check_*() helpers udf: Fix use of check_add_overflow() with mixed type arguments Change-Id: Ia7c26633509cfe8ec59d7dd0d6efd602629c87f4 Signed-off-by: bengris32 <bengris32@protonmail.ch>
731 lines
22 KiB
C
731 lines
22 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* interrupt.h */
|
|
#ifndef _LINUX_INTERRUPT_H
|
|
#define _LINUX_INTERRUPT_H
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/cpumask.h>
|
|
#include <linux/irqreturn.h>
|
|
#include <linux/irqnr.h>
|
|
#include <linux/hardirq.h>
|
|
#include <linux/irqflags.h>
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/kref.h>
|
|
#include <linux/workqueue.h>
|
|
|
|
#include <linux/atomic.h>
|
|
#include <asm/ptrace.h>
|
|
#include <asm/irq.h>
|
|
#include <asm/sections.h>
|
|
|
|
#include <mt-plat/mtk_sched_mon.h>
|
|
|
|
/*
|
|
* These correspond to the IORESOURCE_IRQ_* defines in
|
|
* linux/ioport.h to select the interrupt line behaviour. When
|
|
* requesting an interrupt without specifying a IRQF_TRIGGER, the
|
|
* setting should be assumed to be "as already configured", which
|
|
* may be as per machine or firmware initialisation.
|
|
*/
|
|
#define IRQF_TRIGGER_NONE 0x00000000
|
|
#define IRQF_TRIGGER_RISING 0x00000001
|
|
#define IRQF_TRIGGER_FALLING 0x00000002
|
|
#define IRQF_TRIGGER_HIGH 0x00000004
|
|
#define IRQF_TRIGGER_LOW 0x00000008
|
|
#define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
|
|
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
|
|
#define IRQF_TRIGGER_PROBE 0x00000010
|
|
|
|
/*
|
|
* These flags used only by the kernel as part of the
|
|
* irq handling routines.
|
|
*
|
|
* IRQF_SHARED - allow sharing the irq among several devices
|
|
* IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
|
|
* IRQF_TIMER - Flag to mark this interrupt as timer interrupt
|
|
* IRQF_PERCPU - Interrupt is per cpu
|
|
* IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing
|
|
* IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
|
|
* registered first in an shared interrupt is considered for
|
|
* performance reasons)
|
|
* IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
|
|
* Used by threaded interrupts which need to keep the
|
|
* irq line disabled until the threaded handler has been run.
|
|
* IRQF_NO_SUSPEND - Do not disable this IRQ during suspend. Does not guarantee
|
|
* that this interrupt will wake the system from a suspended
|
|
* state. See Documentation/power/suspend-and-interrupts.txt
|
|
* IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
|
|
* IRQF_NO_THREAD - Interrupt cannot be threaded
|
|
* IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
|
|
* resume time.
|
|
* IRQF_COND_SUSPEND - If the IRQ is shared with a NO_SUSPEND user, execute this
|
|
* interrupt handler after suspending interrupts. For system
|
|
* wakeup devices users need to implement wakeup detection in
|
|
* their interrupt handlers.
|
|
*/
|
|
#define IRQF_SHARED 0x00000080
|
|
#define IRQF_PROBE_SHARED 0x00000100
|
|
#define __IRQF_TIMER 0x00000200
|
|
#define IRQF_PERCPU 0x00000400
|
|
#define IRQF_NOBALANCING 0x00000800
|
|
#define IRQF_IRQPOLL 0x00001000
|
|
#define IRQF_ONESHOT 0x00002000
|
|
#define IRQF_NO_SUSPEND 0x00004000
|
|
#define IRQF_FORCE_RESUME 0x00008000
|
|
#define IRQF_NO_THREAD 0x00010000
|
|
#define IRQF_EARLY_RESUME 0x00020000
|
|
#define IRQF_COND_SUSPEND 0x00040000
|
|
|
|
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
|
|
|
|
/*
|
|
* These values can be returned by request_any_context_irq() and
|
|
* describe the context the interrupt will be run in.
|
|
*
|
|
* IRQC_IS_HARDIRQ - interrupt runs in hardirq context
|
|
* IRQC_IS_NESTED - interrupt runs in a nested threaded context
|
|
*/
|
|
enum {
|
|
IRQC_IS_HARDIRQ = 0,
|
|
IRQC_IS_NESTED,
|
|
};
|
|
|
|
typedef irqreturn_t (*irq_handler_t)(int, void *);
|
|
|
|
/**
|
|
* struct irqaction - per interrupt action descriptor
|
|
* @handler: interrupt handler function
|
|
* @name: name of the device
|
|
* @dev_id: cookie to identify the device
|
|
* @percpu_dev_id: cookie to identify the device
|
|
* @next: pointer to the next irqaction for shared interrupts
|
|
* @irq: interrupt number
|
|
* @flags: flags (see IRQF_* above)
|
|
* @thread_fn: interrupt handler function for threaded interrupts
|
|
* @thread: thread pointer for threaded interrupts
|
|
* @secondary: pointer to secondary irqaction (force threading)
|
|
* @thread_flags: flags related to @thread
|
|
* @thread_mask: bitmask for keeping track of @thread activity
|
|
* @dir: pointer to the proc/irq/NN/name entry
|
|
*/
|
|
struct irqaction {
|
|
irq_handler_t handler;
|
|
void *dev_id;
|
|
void __percpu *percpu_dev_id;
|
|
struct irqaction *next;
|
|
irq_handler_t thread_fn;
|
|
struct task_struct *thread;
|
|
struct irqaction *secondary;
|
|
unsigned int irq;
|
|
unsigned int flags;
|
|
unsigned long thread_flags;
|
|
unsigned long thread_mask;
|
|
const char *name;
|
|
struct proc_dir_entry *dir;
|
|
} ____cacheline_internodealigned_in_smp;
|
|
|
|
extern irqreturn_t no_action(int cpl, void *dev_id);
|
|
|
|
/*
|
|
* If a (PCI) device interrupt is not connected we set dev->irq to
|
|
* IRQ_NOTCONNECTED. This causes request_irq() to fail with -ENOTCONN, so we
|
|
* can distingiush that case from other error returns.
|
|
*
|
|
* 0x80000000 is guaranteed to be outside the available range of interrupts
|
|
* and easy to distinguish from other possible incorrect values.
|
|
*/
|
|
#define IRQ_NOTCONNECTED (1U << 31)
|
|
|
|
extern int __must_check
|
|
request_threaded_irq(unsigned int irq, irq_handler_t handler,
|
|
irq_handler_t thread_fn,
|
|
unsigned long flags, const char *name, void *dev);
|
|
|
|
static inline int __must_check
|
|
request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
|
|
const char *name, void *dev)
|
|
{
|
|
return request_threaded_irq(irq, handler, NULL, flags, name, dev);
|
|
}
|
|
|
|
extern int __must_check
|
|
request_any_context_irq(unsigned int irq, irq_handler_t handler,
|
|
unsigned long flags, const char *name, void *dev_id);
|
|
|
|
extern int __must_check
|
|
__request_percpu_irq(unsigned int irq, irq_handler_t handler,
|
|
unsigned long flags, const char *devname,
|
|
void __percpu *percpu_dev_id);
|
|
|
|
static inline int __must_check
|
|
request_percpu_irq(unsigned int irq, irq_handler_t handler,
|
|
const char *devname, void __percpu *percpu_dev_id)
|
|
{
|
|
return __request_percpu_irq(irq, handler, 0,
|
|
devname, percpu_dev_id);
|
|
}
|
|
|
|
extern const void *free_irq(unsigned int, void *);
|
|
extern void free_percpu_irq(unsigned int, void __percpu *);
|
|
|
|
struct device;
|
|
|
|
extern int __must_check
|
|
devm_request_threaded_irq(struct device *dev, unsigned int irq,
|
|
irq_handler_t handler, irq_handler_t thread_fn,
|
|
unsigned long irqflags, const char *devname,
|
|
void *dev_id);
|
|
|
|
static inline int __must_check
|
|
devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
|
|
unsigned long irqflags, const char *devname, void *dev_id)
|
|
{
|
|
return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags,
|
|
devname, dev_id);
|
|
}
|
|
|
|
extern int __must_check
|
|
devm_request_any_context_irq(struct device *dev, unsigned int irq,
|
|
irq_handler_t handler, unsigned long irqflags,
|
|
const char *devname, void *dev_id);
|
|
|
|
extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
|
|
|
|
/*
|
|
* On lockdep we dont want to enable hardirqs in hardirq
|
|
* context. Use local_irq_enable_in_hardirq() to annotate
|
|
* kernel code that has to do this nevertheless (pretty much
|
|
* the only valid case is for old/broken hardware that is
|
|
* insanely slow).
|
|
*
|
|
* NOTE: in theory this might break fragile code that relies
|
|
* on hardirq delivery - in practice we dont seem to have such
|
|
* places left. So the only effect should be slightly increased
|
|
* irqs-off latencies.
|
|
*/
|
|
#ifdef CONFIG_LOCKDEP
|
|
# define local_irq_enable_in_hardirq() do { } while (0)
|
|
#else
|
|
# define local_irq_enable_in_hardirq() local_irq_enable()
|
|
#endif
|
|
|
|
extern void disable_irq_nosync(unsigned int irq);
|
|
extern bool disable_hardirq(unsigned int irq);
|
|
extern void disable_irq(unsigned int irq);
|
|
extern void disable_percpu_irq(unsigned int irq);
|
|
extern void enable_irq(unsigned int irq);
|
|
extern void enable_percpu_irq(unsigned int irq, unsigned int type);
|
|
extern bool irq_percpu_is_enabled(unsigned int irq);
|
|
extern void irq_wake_thread(unsigned int irq, void *dev_id);
|
|
|
|
/* The following three functions are for the core kernel use only. */
|
|
extern void suspend_device_irqs(void);
|
|
extern void resume_device_irqs(void);
|
|
|
|
/**
|
|
* struct irq_affinity_notify - context for notification of IRQ affinity changes
|
|
* @irq: Interrupt to which notification applies
|
|
* @kref: Reference count, for internal use
|
|
* @work: Work item, for internal use
|
|
* @notify: Function to be called on change. This will be
|
|
* called in process context.
|
|
* @release: Function to be called on release. This will be
|
|
* called in process context. Once registered, the
|
|
* structure must only be freed when this function is
|
|
* called or later.
|
|
*/
|
|
struct irq_affinity_notify {
|
|
unsigned int irq;
|
|
struct kref kref;
|
|
struct work_struct work;
|
|
void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
|
|
void (*release)(struct kref *ref);
|
|
};
|
|
|
|
/**
|
|
* struct irq_affinity - Description for automatic irq affinity assignements
|
|
* @pre_vectors: Don't apply affinity to @pre_vectors at beginning of
|
|
* the MSI(-X) vector space
|
|
* @post_vectors: Don't apply affinity to @post_vectors at end of
|
|
* the MSI(-X) vector space
|
|
*/
|
|
struct irq_affinity {
|
|
int pre_vectors;
|
|
int post_vectors;
|
|
};
|
|
|
|
#if defined(CONFIG_SMP)
|
|
|
|
extern cpumask_var_t irq_default_affinity;
|
|
|
|
/* Internal implementation. Use the helpers below */
|
|
extern int __irq_set_affinity(unsigned int irq, const struct cpumask *cpumask,
|
|
bool force);
|
|
|
|
/**
|
|
* irq_set_affinity - Set the irq affinity of a given irq
|
|
* @irq: Interrupt to set affinity
|
|
* @cpumask: cpumask
|
|
*
|
|
* Fails if cpumask does not contain an online CPU
|
|
*/
|
|
static inline int
|
|
irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
|
|
{
|
|
return __irq_set_affinity(irq, cpumask, false);
|
|
}
|
|
|
|
/**
|
|
* irq_force_affinity - Force the irq affinity of a given irq
|
|
* @irq: Interrupt to set affinity
|
|
* @cpumask: cpumask
|
|
*
|
|
* Same as irq_set_affinity, but without checking the mask against
|
|
* online cpus.
|
|
*
|
|
* Solely for low level cpu hotplug code, where we need to make per
|
|
* cpu interrupts affine before the cpu becomes online.
|
|
*/
|
|
static inline int
|
|
irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
|
|
{
|
|
return __irq_set_affinity(irq, cpumask, true);
|
|
}
|
|
|
|
extern int irq_can_set_affinity(unsigned int irq);
|
|
extern int irq_select_affinity(unsigned int irq);
|
|
|
|
extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
|
|
|
|
extern int
|
|
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
|
|
|
|
struct cpumask *irq_create_affinity_masks(int nvec, const struct irq_affinity *affd);
|
|
int irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd);
|
|
|
|
#else /* CONFIG_SMP */
|
|
|
|
static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int irq_can_set_affinity(unsigned int irq)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int irq_select_affinity(unsigned int irq) { return 0; }
|
|
|
|
static inline int irq_set_affinity_hint(unsigned int irq,
|
|
const struct cpumask *m)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int
|
|
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline struct cpumask *
|
|
irq_create_affinity_masks(int nvec, const struct irq_affinity *affd)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline int
|
|
irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd)
|
|
{
|
|
return maxvec;
|
|
}
|
|
|
|
#endif /* CONFIG_SMP */
|
|
|
|
/*
|
|
* Special lockdep variants of irq disabling/enabling.
|
|
* These should be used for locking constructs that
|
|
* know that a particular irq context which is disabled,
|
|
* and which is the only irq-context user of a lock,
|
|
* that it's safe to take the lock in the irq-disabled
|
|
* section without disabling hardirqs.
|
|
*
|
|
* On !CONFIG_LOCKDEP they are equivalent to the normal
|
|
* irq disable/enable methods.
|
|
*/
|
|
static inline void disable_irq_nosync_lockdep(unsigned int irq)
|
|
{
|
|
disable_irq_nosync(irq);
|
|
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
|
local_irq_disable();
|
|
#endif
|
|
}
|
|
|
|
static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
|
|
{
|
|
disable_irq_nosync(irq);
|
|
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
|
local_irq_save(*flags);
|
|
#endif
|
|
}
|
|
|
|
static inline void disable_irq_lockdep(unsigned int irq)
|
|
{
|
|
disable_irq(irq);
|
|
#ifdef CONFIG_LOCKDEP
|
|
local_irq_disable();
|
|
#endif
|
|
}
|
|
|
|
static inline void enable_irq_lockdep(unsigned int irq)
|
|
{
|
|
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
|
local_irq_enable();
|
|
#endif
|
|
enable_irq(irq);
|
|
}
|
|
|
|
static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
|
|
{
|
|
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
|
local_irq_restore(*flags);
|
|
#endif
|
|
enable_irq(irq);
|
|
}
|
|
|
|
/* IRQ wakeup (PM) control: */
|
|
extern int irq_set_irq_wake(unsigned int irq, unsigned int on);
|
|
|
|
static inline int enable_irq_wake(unsigned int irq)
|
|
{
|
|
return irq_set_irq_wake(irq, 1);
|
|
}
|
|
|
|
static inline int disable_irq_wake(unsigned int irq)
|
|
{
|
|
return irq_set_irq_wake(irq, 0);
|
|
}
|
|
|
|
/*
|
|
* irq_get_irqchip_state/irq_set_irqchip_state specific flags
|
|
*/
|
|
enum irqchip_irq_state {
|
|
IRQCHIP_STATE_PENDING, /* Is interrupt pending? */
|
|
IRQCHIP_STATE_ACTIVE, /* Is interrupt in progress? */
|
|
IRQCHIP_STATE_MASKED, /* Is interrupt masked? */
|
|
IRQCHIP_STATE_LINE_LEVEL, /* Is IRQ line high? */
|
|
};
|
|
|
|
extern int irq_get_irqchip_state(unsigned int irq, enum irqchip_irq_state which,
|
|
bool *state);
|
|
extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which,
|
|
bool state);
|
|
|
|
#ifdef CONFIG_IRQ_FORCED_THREADING
|
|
extern bool force_irqthreads;
|
|
#else
|
|
#define force_irqthreads (0)
|
|
#endif
|
|
|
|
#ifndef local_softirq_pending
|
|
|
|
#ifndef local_softirq_pending_ref
|
|
#define local_softirq_pending_ref irq_stat.__softirq_pending
|
|
#endif
|
|
|
|
#define local_softirq_pending() (__this_cpu_read(local_softirq_pending_ref))
|
|
#define set_softirq_pending(x) (__this_cpu_write(local_softirq_pending_ref, (x)))
|
|
#define or_softirq_pending(x) (__this_cpu_or(local_softirq_pending_ref, (x)))
|
|
|
|
#endif /* local_softirq_pending */
|
|
|
|
/* Some architectures might implement lazy enabling/disabling of
|
|
* interrupts. In some cases, such as stop_machine, we might want
|
|
* to ensure that after a local_irq_disable(), interrupts have
|
|
* really been disabled in hardware. Such architectures need to
|
|
* implement the following hook.
|
|
*/
|
|
#ifndef hard_irq_disable
|
|
#define hard_irq_disable() do { } while(0)
|
|
#endif
|
|
|
|
/* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
|
|
frequency threaded job scheduling. For almost all the purposes
|
|
tasklets are more than enough. F.e. all serial device BHs et
|
|
al. should be converted to tasklets, not to softirqs.
|
|
*/
|
|
|
|
enum
|
|
{
|
|
HI_SOFTIRQ=0,
|
|
TIMER_SOFTIRQ,
|
|
NET_TX_SOFTIRQ,
|
|
NET_RX_SOFTIRQ,
|
|
BLOCK_SOFTIRQ,
|
|
IRQ_POLL_SOFTIRQ,
|
|
TASKLET_SOFTIRQ,
|
|
SCHED_SOFTIRQ,
|
|
HRTIMER_SOFTIRQ, /* Unused, but kept as tools rely on the
|
|
numbering. Sigh! */
|
|
RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
|
|
|
|
NR_SOFTIRQS
|
|
};
|
|
|
|
#define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ))
|
|
|
|
/* map softirq index to softirq name. update 'softirq_to_name' in
|
|
* kernel/softirq.c when adding a new softirq.
|
|
*/
|
|
extern const char * const softirq_to_name[NR_SOFTIRQS];
|
|
|
|
/* softirq mask and active fields moved to irq_cpustat_t in
|
|
* asm/hardirq.h to get better cache usage. KAO
|
|
*/
|
|
|
|
struct softirq_action
|
|
{
|
|
void (*action)(struct softirq_action *);
|
|
};
|
|
|
|
asmlinkage void do_softirq(void);
|
|
asmlinkage void __do_softirq(void);
|
|
|
|
#ifdef __ARCH_HAS_DO_SOFTIRQ
|
|
void do_softirq_own_stack(void);
|
|
#else
|
|
static inline void do_softirq_own_stack(void)
|
|
{
|
|
__do_softirq();
|
|
}
|
|
#endif
|
|
|
|
extern void open_softirq(int nr, void (*action)(struct softirq_action *));
|
|
extern void softirq_init(void);
|
|
extern void __raise_softirq_irqoff(unsigned int nr);
|
|
|
|
extern void raise_softirq_irqoff(unsigned int nr);
|
|
extern void raise_softirq(unsigned int nr);
|
|
|
|
DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
|
|
|
|
static inline struct task_struct *this_cpu_ksoftirqd(void)
|
|
{
|
|
return this_cpu_read(ksoftirqd);
|
|
}
|
|
|
|
/* Tasklets --- multithreaded analogue of BHs.
|
|
|
|
Main feature differing them of generic softirqs: tasklet
|
|
is running only on one CPU simultaneously.
|
|
|
|
Main feature differing them of BHs: different tasklets
|
|
may be run simultaneously on different CPUs.
|
|
|
|
Properties:
|
|
* If tasklet_schedule() is called, then tasklet is guaranteed
|
|
to be executed on some cpu at least once after this.
|
|
* If the tasklet is already scheduled, but its execution is still not
|
|
started, it will be executed only once.
|
|
* If this tasklet is already running on another CPU (or schedule is called
|
|
from tasklet itself), it is rescheduled for later.
|
|
* Tasklet is strictly serialized wrt itself, but not
|
|
wrt another tasklets. If client needs some intertask synchronization,
|
|
he makes it with spinlocks.
|
|
*/
|
|
|
|
struct tasklet_struct
|
|
{
|
|
struct tasklet_struct *next;
|
|
unsigned long state;
|
|
atomic_t count;
|
|
void (*func)(unsigned long);
|
|
unsigned long data;
|
|
};
|
|
|
|
#define DECLARE_TASKLET(name, func, data) \
|
|
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 }
|
|
|
|
|
|
enum
|
|
{
|
|
TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */
|
|
TASKLET_STATE_RUN /* Tasklet is running (SMP only) */
|
|
};
|
|
|
|
#ifdef CONFIG_SMP
|
|
static inline int tasklet_trylock(struct tasklet_struct *t)
|
|
{
|
|
return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state);
|
|
}
|
|
|
|
static inline void tasklet_unlock(struct tasklet_struct *t)
|
|
{
|
|
smp_mb__before_atomic();
|
|
clear_bit(TASKLET_STATE_RUN, &(t)->state);
|
|
}
|
|
|
|
static inline void tasklet_unlock_wait(struct tasklet_struct *t)
|
|
{
|
|
while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
|
|
}
|
|
#else
|
|
#define tasklet_trylock(t) 1
|
|
#define tasklet_unlock_wait(t) do { } while (0)
|
|
#define tasklet_unlock(t) do { } while (0)
|
|
#endif
|
|
|
|
extern void __tasklet_schedule(struct tasklet_struct *t);
|
|
|
|
static inline void tasklet_schedule(struct tasklet_struct *t)
|
|
{
|
|
if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
|
|
__tasklet_schedule(t);
|
|
}
|
|
|
|
extern void __tasklet_hi_schedule(struct tasklet_struct *t);
|
|
|
|
static inline void tasklet_hi_schedule(struct tasklet_struct *t)
|
|
{
|
|
if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
|
|
__tasklet_hi_schedule(t);
|
|
}
|
|
|
|
static inline void tasklet_disable_nosync(struct tasklet_struct *t)
|
|
{
|
|
atomic_inc(&t->count);
|
|
smp_mb__after_atomic();
|
|
}
|
|
|
|
static inline void tasklet_disable(struct tasklet_struct *t)
|
|
{
|
|
tasklet_disable_nosync(t);
|
|
tasklet_unlock_wait(t);
|
|
smp_mb();
|
|
}
|
|
|
|
static inline void tasklet_enable(struct tasklet_struct *t)
|
|
{
|
|
smp_mb__before_atomic();
|
|
atomic_dec(&t->count);
|
|
}
|
|
|
|
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);
|
|
|
|
struct tasklet_hrtimer {
|
|
struct hrtimer timer;
|
|
struct tasklet_struct tasklet;
|
|
enum hrtimer_restart (*function)(struct hrtimer *);
|
|
};
|
|
|
|
extern void
|
|
tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
|
|
enum hrtimer_restart (*function)(struct hrtimer *),
|
|
clockid_t which_clock, enum hrtimer_mode mode);
|
|
|
|
static inline
|
|
void tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
|
|
const enum hrtimer_mode mode)
|
|
{
|
|
hrtimer_start(&ttimer->timer, time, mode);
|
|
}
|
|
|
|
static inline
|
|
void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
|
|
{
|
|
hrtimer_cancel(&ttimer->timer);
|
|
tasklet_kill(&ttimer->tasklet);
|
|
}
|
|
|
|
/*
|
|
* Autoprobing for irqs:
|
|
*
|
|
* probe_irq_on() and probe_irq_off() provide robust primitives
|
|
* for accurate IRQ probing during kernel initialization. They are
|
|
* reasonably simple to use, are not "fooled" by spurious interrupts,
|
|
* and, unlike other attempts at IRQ probing, they do not get hung on
|
|
* stuck interrupts (such as unused PS2 mouse interfaces on ASUS boards).
|
|
*
|
|
* For reasonably foolproof probing, use them as follows:
|
|
*
|
|
* 1. clear and/or mask the device's internal interrupt.
|
|
* 2. sti();
|
|
* 3. irqs = probe_irq_on(); // "take over" all unassigned idle IRQs
|
|
* 4. enable the device and cause it to trigger an interrupt.
|
|
* 5. wait for the device to interrupt, using non-intrusive polling or a delay.
|
|
* 6. irq = probe_irq_off(irqs); // get IRQ number, 0=none, negative=multiple
|
|
* 7. service the device to clear its pending interrupt.
|
|
* 8. loop again if paranoia is required.
|
|
*
|
|
* probe_irq_on() returns a mask of allocated irq's.
|
|
*
|
|
* probe_irq_off() takes the mask as a parameter,
|
|
* and returns the irq number which occurred,
|
|
* or zero if none occurred, or a negative irq number
|
|
* if more than one irq occurred.
|
|
*/
|
|
|
|
#if !defined(CONFIG_GENERIC_IRQ_PROBE)
|
|
static inline unsigned long probe_irq_on(void)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int probe_irq_off(unsigned long val)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline unsigned int probe_irq_mask(unsigned long val)
|
|
{
|
|
return 0;
|
|
}
|
|
#else
|
|
extern unsigned long probe_irq_on(void); /* returns 0 on failure */
|
|
extern int probe_irq_off(unsigned long); /* returns 0 or negative on failure */
|
|
extern unsigned int probe_irq_mask(unsigned long); /* returns mask of ISA interrupts */
|
|
#endif
|
|
|
|
#ifdef CONFIG_PROC_FS
|
|
/* Initialize /proc/irq/ */
|
|
extern void init_irq_proc(void);
|
|
#else
|
|
static inline void init_irq_proc(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_IRQ_TIMINGS
|
|
void irq_timings_enable(void);
|
|
void irq_timings_disable(void);
|
|
u64 irq_timings_next_event(u64 now);
|
|
#endif
|
|
|
|
struct seq_file;
|
|
int show_interrupts(struct seq_file *p, void *v);
|
|
int arch_show_interrupts(struct seq_file *p, int prec);
|
|
|
|
extern int early_irq_init(void);
|
|
extern int arch_probe_nr_irqs(void);
|
|
extern int arch_early_irq_init(void);
|
|
|
|
/*
|
|
* We want to know which function is an entrypoint of a hardirq or a softirq.
|
|
*/
|
|
#define __irq_entry __attribute__((__section__(".irqentry.text")))
|
|
#define __softirq_entry \
|
|
__attribute__((__section__(".softirqentry.text")))
|
|
|
|
#endif
|