Files
lucaswei 64c0256540 Merge upstream-linux-4.4.y (4.4.210) into android-msm-wahoo-4.4-lts
Linux 4.4.210
    drm/i915/gen9: Clear residual context state on context switch
    netfilter: ipset: avoid null deref when IPSET_ATTR_LINENO is present
  * netfilter: arp_tables: init netns pointer in xt_tgchk_param struct
      net/ipv4/netfilter/arp_tables.c
  * USB: Fix: Don't skip endpoint descriptors with maxpacket=0
      drivers/usb/core/config.c
    rtl8xxxu: prevent leaking urb
    scsi: bfa: release allocated memory in case of error
    mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf
    mwifiex: fix possible heap overflow in mwifiex_process_country_ie()
  * tty: always relink the port
      drivers/tty/tty_port.c
  * tty: link tty and port before configuring it as console
      drivers/tty/serial/serial_core.c
      drivers/tty/tty_port.c
    staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21
    usb: musb: dma: Correct parameter passed to IRQ handler
    usb: musb: Disable pullup at init
    USB: serial: option: add ZLP support for 0x1bc7/0x9010
    staging: vt6656: set usb_set_intfdata on driver fail.
    can: can_dropped_invalid_skb(): ensure an initialized headroom in outgoing CAN sk_buffs
    can: mscan: mscan_rx_poll(): fix rx path lockup when returning from polling to irq mode
    can: gs_usb: gs_usb_probe(): use descriptors of current altsetting
    drm/dp_mst: correct the shifting in DP_REMOTE_I2C_READ
  * Input: add safety guards to input_set_keycode()
      drivers/input/input.c
  * HID: hid-input: clear unmapped usages
      drivers/hid/hid-input.c
  * HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
      drivers/hid/uhid.c
  * HID: Fix slab-out-of-bounds read in hid_field_extract
      drivers/hid/hid-core.c
    tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined
    kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail
  * ALSA: usb-audio: Apply the sample rate quirk for Bose Companion 5
      sound/usb/quirks.c
    usb: chipidea: host: Disable port power only if previously enabled
  * chardev: Avoid potential use-after-free in 'chrdev_open()'
      fs/char_dev.c
  * kobject: Export kobject_get_unless_zero()
      include/linux/kobject.h
      lib/kobject.c
Linux 4.4.209
    USB: serial: option: add Telit ME910G1 0x110a composition
  * USB: core: fix check for duplicate endpoints
      drivers/usb/core/config.c
  * macvlan: do not assume mac_header is set in macvlan_broadcast()
      include/linux/if_ether.h
    vxlan: fix tos value before xmit
    vlan: fix memory leak in vlan_dev_set_egress_priority
    vlan: vlan_changelink() should propagate errors
  * tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK
      net/ipv4/tcp_input.c
    sctp: free cmd->obj.chunk for the unprocessed SCTP_CMD_REPLY
    pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM
    net: usb: lan78xx: fix possible skb leak
    net: stmmac: dwmac-sunxi: Allow all RGMII modes
    llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)
    parisc: Fix compiler warnings in debug_core.c
  * kconfig: don't crash on NULL expressions in expr_eq()
      scripts/kconfig/expr.c
    regulator: rn5t618: fix module aliases
    ASoC: wm8962: fix lambda value
  * rfkill: Fix incorrect check to avoid NULL pointer dereference
      net/rfkill/core.c
    net: usb: lan78xx: Fix error message format specifier
    bnx2x: Fix logic to get total no. of PFs per engine
    bnx2x: Do not handle requests from VFs after parity
    powerpc: Ensure that swiotlb buffer is allocated from low memory
    ARM: dts: am437x-gp/epos-evm: fix panel compatible
    netfilter: uapi: Avoid undefined left-shift in xt_sctp.h
    ARM: vexpress: Set-up shared OPP table instead of individual for each CPU
  * netfilter: ctnetlink: netns exit must wait for callbacks
      net/netfilter/nf_conntrack_netlink.c
    locking/spinlock/debug: Fix various data races
  * pstore/ram: Write new dumps to start of recycled zones
      fs/pstore/ram.c
    locking/x86: Remove the unused atomic_inc_short() methd
    s390/smp: fix physical to logical CPU map for SMT
  * net: add annotations on hh->hh_len lockless accesses
      include/net/neighbour.h
      net/core/neighbour.c
      net/ethernet/eth.c
    ath9k_htc: Discard undersized packets
    ath9k_htc: Modify byte order for an error message
    powerpc/pseries/hvconsole: Fix stack overread via udbg
    drm/mst: Fix MST sideband up-reply failure handling
  * tty: serial: msm_serial: Fix lockup for sysrq and oops
      drivers/tty/serial/msm_serial.c
  * Bluetooth: delete a stray unlock
      net/bluetooth/l2cap_core.c
    Bluetooth: btusb: fix PM leak in error case of setup
    ftrace: Avoid potential division by zero in function profiler
    ALSA: cs4236: fix error return comparison of an unsigned integer
  * gpiolib: fix up emulated open drain outputs
      drivers/gpio/gpiolib.c
  * compat_ioctl: block: handle Persistent Reservations
      block/compat_ioctl.c
  * dmaengine: Fix access to uninitialized dma_slave_caps
      include/linux/dmaengine.h
  * locks: print unsigned ino in /proc/locks
      fs/locks.c
    MIPS: Avoid VDSO ABI breakage due to global register variable
    ALSA: ice1724: Fix sleep-in-atomic in Infrasonic Quartet support code
    Revert "perf report: Add warning when libunwind not compiled in"
  * taskstats: fix data-race
      kernel/taskstats.c
    xfs: fix mount failure crash on invalid iclog memory access
    xen/balloon: fix ballooned page accounting without hotplug enabled
    s390/cpum_sf: Avoid SBD overflow condition in irq handler
    s390/cpum_sf: Adjust sampling interval to avoid hitting sample limits
    md: raid1: check rdev before reference in raid1_sync_request func
    usb: gadget: fix wrong endpoint desc
    scsi: libsas: stop discovering if oob mode is disconnected
    scsi: iscsi: qla4xxx: fix double free in probe
    scsi: qla2xxx: Don't call qlt_async_event twice
    scsi: lpfc: Fix memory leak on lpfc_bsg_write_ebuf_set func
    RDMA/cma: add missed unregister_pernet_subsys in init failure
  * PM / devfreq: Don't fail devfreq_dev_release if not in list
      drivers/devfreq/devfreq.c
Linux 4.4.208
  * tcp: do not send empty skb from tcp_write_xmit()
      net/ipv4/tcp_output.c
    mmc: sdhci: Update the tuning failed messages to pr_debug level
  * hrtimer: Annotate lockless access to timer->state
      include/linux/hrtimer.h
      kernel/time/hrtimer.c
  * net: icmp: fix data-race in cmp_global_allow()
      net/ipv4/icmp.c
    netfilter: bridge: make sure to pull arp header in br_nf_forward_arp()
    6pack,mkiss: fix possible deadlock
  * netfilter: ebtables: compat: reject all padding in matches/watchers
      net/bridge/netfilter/ebtables.c
    net: davinci_cpdma: use dma_addr_t for DMA address
  * filldir[64]: remove WARN_ON_ONCE() for bad directory entries
      fs/readdir.c
  * Make filldir[64]() verify the directory entry filename is valid
      fs/readdir.c
    ALSA: hda - Downgrade error message for single-cmd fallback
  * kernel: sysctl: make drop_caches write-only
      kernel/sysctl.c
    ocfs2: fix passing zero to 'PTR_ERR' warning
    s390/cpum_sf: Check for SDBT and SDB consistency
  * libfdt: define INT32_MAX and UINT32_MAX in libfdt_env.h
      include/linux/libfdt_env.h
    perf regs: Make perf_reg_name() return "unknown" instead of NULL
    cdrom: respect device capabilities during opening action
  * scripts/kallsyms: fix definitely-lost memory leak
      scripts/kallsyms.c
    gpio: mpc8xxx: Don't overwrite default irq_set_type callback
    scsi: target: iscsi: Wait for all commands to finish before freeing a session
    scsi: pm80xx: Fix for SATA device discovery
  * ext4: work around deleting a file with i_nlink == 0 safely
      fs/ext4/namei.c
  * HID: Improve Windows Precision Touchpad detection.
      drivers/hid/hid-core.c
    bcache: at least try to shrink 1 node in bch_mca_scan()
    clk: pxa: fix one of the pxa RTC clocks
    powerpc/security: Fix wrong message when RFI Flush is disable
    powerpc/pseries/cmm: Implement release() function for sysfs device
  * scsi: ufs: fix potential bug which ends in system hang
      drivers/scsi/ufs/ufshcd.c
    scsi: lpfc: fix: Coverity: lpfc_cmpl_els_rsp(): Null pointer dereferences
  * fs/quota: handle overflows of sysctl fs.quota.* and report as unsigned long
      fs/quota/dquot.c
      include/linux/quota.h
    irqchip: ingenic: Error out if IRQ domain creation failed
    irqchip/irq-bcm7038-l1: Enable parent IRQ if necessary
    clk: qcom: Allow constant ratio freq tables for rcg
    scsi: lpfc: Fix duplicate unreg_rpi error in port offline flow
  * scsi: tracing: Fix handling of TRANSFER LENGTH == 0 for READ(6) and WRITE(6)
      drivers/scsi/scsi_trace.c
  * jbd2: Fix statistics for the number of logged blocks
      fs/jbd2/commit.c
    powerpc/security/book3s64: Report L1TF status in sysfs
    clocksource/drivers/asm9260: Add a check for of_clk_get
    dma-debug: add a schedule point in debug_dma_dump_mappings()
    powerpc/pseries: Mark accumulate_stolen_time() as notrace
    scsi: csiostor: Don't enable IRQs too early
    scsi: lpfc: Fix SLI3 hba in loop mode not discovering devices
    scsi: target: compare full CHAP_A Algorithm strings
    iommu/tegra-smmu: Fix page tables in > 4 GiB memory
    Input: atmel_mxt_ts - disable IRQ across suspend
    scsi: lpfc: Fix locking on mailbox command completion
    scsi: mpt3sas: Fix clear pending bit in ioctl status
    perf probe: Fix to show function entry line as probe-able
    mmc: sdhci-of-esdhc: fix P2020 errata handling
    powerpc/irq: fix stack overflow verification
  * ext4: check for directory entries too close to block end
      fs/ext4/dir.c
    staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value
    platform/x86: hp-wmi: Make buffer for HPWMI_FEATURE2_QUERY 128 bytes
    USB: EHCI: Do not return -EPIPE when hub is disconnected
    usbip: Fix error path of vhci_recv_ret_submit()
  * net: dst: Force 4-byte alignment of dst_metrics
      include/net/dst.h
    sctp: fully initialize v4 addr in some functions
    net: usb: lan78xx: Fix suspend/resume PHY register access error
    net: qlogic: Fix error paths in ql_alloc_large_buffers()
    net: nfc: nci: fix a possible sleep-in-atomic-context bug in nci_uart_tty_receive()
    net: hisilicon: Fix a BUG trigered by wrong bytes_compl
  * mod_devicetable: fix PHY module format
      include/linux/mod_devicetable.h
    fjes: fix missed check in fjes_acpi_add
  * af_packet: set defaule value for tmo
      net/packet/af_packet.c
  * ALSA: pcm: Avoid possible info leaks from PCM stream buffers
      sound/core/pcm_native.c
    Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues
    btrfs: abort transaction after failed inode updates in create_subvol
    btrfs: return error pointer from alloc_test_extent_buffer
    btrfs: do not call synchronize_srcu() in inode_tree_del
  * usb: xhci: Fix build warning seen with CONFIG_PM=n
      drivers/usb/host/xhci-pci.c
    Revert "mmc: sdhci: Fix incorrect switch to HS mode"
  * net: phy: initialise phydev speed and duplex sanely
      drivers/net/phy/phy_device.c
    libtraceevent: Fix memory leakage in copy_filter_type
    crypto: vmx - Avoid weird build failures
    crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c
    fbtft: Make sure string is NULL terminated
    iwlwifi: check kasprintf() return value
    btrfs: don't prematurely free work in end_workqueue_fn()
    spi: tegra20-slink: add missed clk_unprepare
    x86/crash: Add a forward declaration of struct kimage
  * cpufreq: Register drivers only after CPU devices have been registered
      drivers/cpufreq/cpufreq.c
    parport: load lowlevel driver if ports not found
    ASoC: rt5677: Mark reg RT5677_PWR_ANLG2 as volatile
    spi: pxa2xx: Add missed security checks
    EDAC/ghes: Fix grain calculation
    media: si470x-i2c: add missed operations in remove
    media: pvrusb2: Fix oops on tear-down when radio support is not present
    ath10k: fix get invalid tx rate for Mesh metric
    perf probe: Filter out instances except for inlined subroutine and subprogram
    perf probe: Skip end-of-sequence and non statement lines
    perf probe: Fix to show calling lines of inlined functions
    perf probe: Return a better scope DIE if there is no best scope
    perf probe: Skip overlapped location on searching variables
    perf probe: Fix to show inlined function callsite without entry_pc
    perf probe: Fix to show ranges of variables in functions without entry_pc
    perf probe: Fix to probe an inline function which has no entry pc
    perf probe: Walk function lines in lexical blocks
    perf probe: Fix to list probe event with correct line number
    perf probe: Fix to find range-only function instance
    rtlwifi: fix memory leak in rtl92c_set_fw_rsvdpagepkt()
    spi: img-spfi: fix potential double release
    bnx2x: Fix PF-VF communication over multi-cos queues.
    pinctrl: sh-pfc: sh7734: Fix duplicate TCLK1_B
    libata: Ensure ata_port probe has completed before detach
  * arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill()
      arch/arm64/kernel/psci.c
    x86/ioapic: Prevent inconsistent state when moving an interrupt
    drm/gma500: fix memory disclosures due to uninitialized bytes
  * Bluetooth: hci_core: fix init for HCI_USER_CHANNEL
      net/bluetooth/hci_core.c
    iio: adc: max1027: Reset the device at probe time
    perf report: Add warning when libunwind not compiled in
    x86/mm: Use the correct function type for native_set_fixmap()
    extcon: sm5502: Reset registers during initialization
    media: ti-vpe: vpe: Make sure YUYV is set as default format
    media: ti-vpe: vpe: fix a v4l2-compliance failure about frame sequence number
    media: ti-vpe: vpe: fix a v4l2-compliance warning about invalid pixel format
    mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring
    samples: pktgen: fix proc_cmd command result check logic
    media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init()
    regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe()
    hwrng: omap3-rom - Call clk_disable_unprepare() on exit only if not idled
    usb: renesas_usbhs: add suspend event support in gadget mode
    tools/power/cpupower: Fix initializer override in hsw_ext_cstates
    media: ov6650: Fix stored frame format not in sync with hardware
    media: i2c: ov2659: Fix missing 720p register config
    media: i2c: ov2659: fix s_stream return value
    media: am437x-vpfe: Setting STD to current value is not an error
    IB/iser: bound protection_sg size by data_sg size
    rtlwifi: prevent memory leak in rtl_usb_probe
    staging: rtl8188eu: fix possible null dereference
  * spi: Add call to spi_slave_abort() function when spidev driver is released
      drivers/spi/spidev.c
    iio: light: bh1750: Resolve compiler warning and make code more readable
    drm: mst: Fix query_payload ack reply struct
    ALSA: hda/ca0132 - Avoid endless loop
    ALSA: hda/ca0132 - Keep power on during processing DSP response
    btrfs: handle ENOENT in btrfs_uuid_tree_iterate
    btrfs: do not leak reloc root if we fail to read the fs root
Linux 4.4.207
    net: stmmac: don't stop NAPI processing when dropping a packet
    net: stmmac: use correct DMA buffer size in the RX descriptor
  * xhci: fix USB3 device initiated resume race with roothub autosuspend
      drivers/usb/host/xhci-hub.c
      drivers/usb/host/xhci-ring.c
      drivers/usb/host/xhci.h
    drm/radeon: fix r1xx/r2xx register checker for POT textures
    dm btree: increase rebalance threshold in __rebalance2()
    vfio/pci: call irq_bypass_unregister_producer() before freeing irq
    ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
    ARM: dts: s3c64xx: Fix init order of clock providers
    CIFS: Respect O_SYNC and O_DIRECT flags during reconnect
    xtensa: fix TLB sanity checker
  * PCI/MSI: Fix incorrect MSI-X masking on resume
      drivers/pci/msi.c
  * PCI: Fix Intel ACS quirk UPDCR register address
      drivers/pci/quirks.c
    net: ethernet: ti: cpsw: fix extra rx interrupt
  * tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()
      include/net/tcp.h
  * tcp: tighten acceptance of ACKs not matching a child socket
      include/net/tcp.h
  * tcp: fix rejected syncookies due to stale timestamps
      include/linux/time.h
      include/net/tcp.h
  * inet: protect against too small mtu values.
      include/linux/netdevice.h
      include/net/ip.h
      net/core/dev.c
      net/ipv4/devinet.c
      net/ipv4/ip_output.c
    tipc: fix ordering of tipc module init and exit routine
  * tcp: md5: fix potential overestimation of TCP option space
      net/ipv4/tcp_output.c
  * net: bridge: deny dev_set_mac_address() when unregistering
      net/bridge/br_device.c
  * kernel/module.c: wakeup processes in module_wq on module unload
      kernel/module.c
    sunrpc: fix crash when cache_head become valid before update
  * workqueue: Fix missing kfree(rescuer) in destroy_workqueue()
      kernel/workqueue.c
  * blk-mq: make sure that line break can be printed
      block/blk-mq-sysfs.c
  * mm/shmem.c: cast the type of unmap_start to u64
      mm/shmem.c
    powerpc: Fix vDSO clock_getres()
    scsi: qla2xxx: Always check the qla2x00_wait_for_hba_online() return value
    scsi: qla2xxx: Fix qla24xx_process_bidir_cmd()
    scsi: qla2xxx: Fix DMA unmap leak
    pinctrl: samsung: Fix device node refcount leaks in S3C64xx wakeup controller init
    ARM: dts: omap3-tao3530: Fix incorrect MMC card detection GPIO polarity
    x86/MCE/AMD: Turn off MC4_MISC thresholding on all family 0x15 models
    e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait
    scsi: lpfc: Cap NPIV vports to 256
    Btrfs: fix negative subv_writers counter and data space leak after buffered write
    iio: adis16480: Add debugfs_reg_access entry
  * xhci: make sure interrupts are restored to correct state
      drivers/usb/host/xhci-hub.c
  * xhci: Fix memory leak in xhci_add_in_port()
      drivers/usb/host/xhci-mem.c
  * usb: xhci: only set D3hot for pci device
      drivers/usb/host/xhci-pci.c
      drivers/usb/host/xhci.c
      drivers/usb/host/xhci.h
    scsi: zfcp: trace channel log even for FCP command responses
  * quota: fix livelock in dquot_writeback_dquots
      fs/quota/dquot.c
  * quota: Check that quota is not dirty before release
      fs/quota/dquot.c
      include/linux/quotaops.h
    video/hdmi: Fix AVI bar unpack
    powerpc: Allow 64bit VDSO __kernel_sync_dicache to work across ranges >4GB
    pinctrl: samsung: Fix device node refcount leaks in init code
    pinctrl: samsung: Fix device node refcount leaks in S3C24xx wakeup controller init
  * ACPI: PM: Avoid attaching ACPI PM domain to certain devices
      drivers/acpi/device_pm.c
  * ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data()
      drivers/acpi/bus.c
  * ACPI: OSL: only free map once in osl.c
      drivers/acpi/osl.c
  * cpuidle: Do not unset the driver if it is there already
      drivers/cpuidle/driver.c
    media: radio: wl1273: fix interrupt masking on release
    media: bdisp: fix memleak on release
    ar5523: check NULL before memcpy() in ar5523_cmd()
    cgroup: pids: use atomic64_t for pids->limit
  * blk-mq: avoid sysfs buffer overflow with too many CPU cores
      block/blk-mq-sysfs.c
  * ASoC: Jack: Fix NULL pointer dereference in snd_soc_jack_report
      sound/soc/soc-jack.c
  * workqueue: Fix pwq ref leak in rescuer_thread()
      kernel/workqueue.c
  * workqueue: Fix spurious sanity check failures in destroy_workqueue()
      kernel/workqueue.c
    lib: raid6: fix awk build warnings
    rtlwifi: rtl8192de: Fix missing enable interrupt flag
    rtlwifi: rtl8192de: Fix missing callback that tests for hw release of buffer
    rtlwifi: rtl8192de: Fix missing code to retrieve RX buffer address
    btrfs: Remove btrfs_bio::flags member
    btrfs: check page->mapping when loading free space cache
    virtio-balloon: fix managed page counts when migrating pages between zones
    mtd: spear_smi: Fix Write Burst mode
    usb: mon: Fix a deadlock in usbmon between mmap and read
  * usb: core: urb: fix URB structure initialization function
      drivers/usb/core/urb.c
    USB: adutux: fix interface sanity check
    USB: serial: io_edgeport: fix epic endpoint lookup
    USB: idmouse: fix interface sanity checks
    USB: atm: ueagle-atm: add missing endpoint check
    iio: humidity: hdc100x: fix IIO_HUMIDITYRELATIVE channel reporting
  * xhci: Increase STS_HALT timeout in xhci_suspend()
      drivers/usb/host/xhci.c
    staging: gigaset: add endpoint-type sanity check
    staging: gigaset: fix illegal free on probe errors
    staging: gigaset: fix general protection fault on probe
    staging: rtl8712: fix interface sanity check
    staging: rtl8188eu: fix interface sanity check
  * usb: Allow USB device to be warm reset in suspended state
      drivers/usb/core/hub.c
  * usb: gadget: configfs: Fix missing spin_lock_init()
      drivers/usb/gadget/configfs.c
  * fs/proc/array.c: allow reporting eip/esp for all coredumping threads
      fs/proc/array.c
  * proc: fix coredump vs read /proc/*/stat race
      fs/proc/array.c
  * fs/proc: Report eip/esp in /prod/PID/stat for coredumping
      fs/proc/array.c
  * fs/proc: Stop reporting eip and esp in /proc/PID/stat
      fs/proc/array.c
  * sched/core, x86: Make struct thread_info arch specific again
      include/linux/thread_info.h
  * sched/core: Add try_get_task_stack() and put_task_stack()
      include/linux/sched.h
      init/Kconfig
  * sched/core: Allow putting thread_info into task_struct
      include/linux/init_task.h
      include/linux/sched.h
      include/linux/thread_info.h
      init/Kconfig
      init/init_task.c
      kernel/sched/sched.h
    ALSA: hda - Fix pending unsol events at shutdown
    appletalk: Set error code if register_snap_client failed
  * appletalk: Fix potential NULL pointer dereference in unregister_snap_client
      include/linux/atalk.h
    KVM: x86: fix out-of-bounds write in KVM_GET_EMULATED_CPUID (CVE-2019-19332)
  * thermal: Fix deadlock in thermal thermal_zone_device_check
      drivers/thermal/thermal_core.c
    RDMA/qib: Validate ->show()/store() callbacks before calling them
    spi: atmel: Fix CS high support
    crypto: user - fix memory leak in crypto_report
    crypto: crypto4xx - fix double-free in crypto4xx_destroy_sdr
    KVM: x86: fix presentation of TSX feature in ARCH_CAPABILITIES
    KVM: x86: do not modify masked bits of shared MSRs
    drm/i810: Prevent underflow in ioctl
  * jbd2: Fix possible overflow in jbd2_log_space_left()
      include/linux/jbd2.h
    can: slcan: Fix use-after-free Read in slcan_open
    tty: vt: keyboard: reject invalid keycodes
    CIFS: Fix SMB2 oplock break processing
    CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
    Input: goodix - add upside-down quirk for Teclast X89 tablet
    ALSA: pcm: oss: Avoid potential buffer overflows
  * fuse: verify attributes
      fs/fuse/dir.c
      fs/fuse/fuse_i.h
  * fuse: verify nlink
      fs/fuse/dir.c
  * sched/fair: Scale bandwidth quota and period without losing quota/period ratio precision
      kernel/sched/fair.c
    ARM: dts: sunxi: Fix PMU compatible strings
    mlx4: Use snprintf instead of complicated strcpy
    nfsd: Return EPERM, not EACCES, in some SETATTR cases
    MIPS: OCTEON: cvmx_pko_mem_debug8: use oldest forward compatible definition
    powerpc/math-emu: Update macros from GCC
    dlm: fix invalid cluster name warning
    ARM: dts: pxa: clean up USB controller nodes
  * kbuild: fix single target build for external module
      Makefile
  * modpost: skip ELF local symbols during section mismatch check
      scripts/mod/modpost.c
  * tcp: fix off-by-one bug on aborting window-probing socket
      net/ipv4/tcp_timer.c
    ARM: dts: mmp2: fix the gpio interrupt cell number
    net/x25: fix null_x25_address handling
    net/x25: fix called/calling length calculation in x25_parse_address_block
    ARM: OMAP1/2: fix SoC name printing
    nfsd: fix a warning in __cld_pipe_upcall()
    dlm: NULL check before kmem_cache_destroy is not needed
    i2c: imx: don't print error message on probe defer
    serial: imx: fix error handling in console_setup
    altera-stapl: check for a null key before strcasecmp'ing it
  * dma-mapping: fix return type of dma_set_max_seg_size()
      include/linux/dma-mapping.h
  * ACPI: fix acpi_find_child_device() invocation in acpi_preset_companion()
      include/linux/acpi.h
    dmaengine: coh901318: Remove unused variable
    dmaengine: coh901318: Fix a double-lock bug
    ARM: dts: exynos: Use Samsung SoC specific compatible for DWC2 module
    rtc: dt-binding: abx80x: fix resistance scale
    rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
    math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning
    MIPS: OCTEON: octeon-platform: fix typing
  * regulator: Fix return value of _set_load() stub
      include/linux/regulator/consumer.h
    Staging: iio: adt7316: Fix i2c data reading, set the data field
    pinctrl: qcom: ssbi-gpio: fix gpio-hog related boot issues
    scsi: zfcp: drop default switch case which might paper over missing case
    MIPS: SiByte: Enable ZONE_DMA32 for LittleSur
    dlm: fix missing idr_destroy for recover_idr
    clk: rockchip: fix rk3188 sclk_mac_lbtest parameter ordering
    clk: rockchip: fix rk3188 sclk_smc gate data
    extcon: max8997: Fix lack of path setting in USB device mode
    ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+
    iwlwifi: mvm: Send non offchannel traffic via AP sta
  * serial: core: Allow processing sysrq at port unlock time
      include/linux/serial_core.h
    net: ep93xx_eth: fix mismatch of request_mem_region in remove
    rsxx: add missed destroy_workqueue calls in remove
  * ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed()
      sound/core/pcm_lib.c
    Input: cyttsp4_core - fix use after free bug
    NFC: nxp-nci: Fix NULL pointer dereference after I2C communication error
    autofs: fix a leak in autofs_expire_indirect()
    serial: ifx6x60: add missed pm_runtime_disable
  * serial: serial_core: Perform NULL checks for break_ctl ops
      drivers/tty/serial/serial_core.c
    x86/PCI: Avoid AMD FCH XHCI USB PME# from D0 defect
  * tty: serial: msm_serial: Fix flow control
      drivers/tty/serial/msm_serial.c
    usb: gadget: u_serial: add missing port entry locking
    x86/apic/32: Avoid bogus LDR warnings
Linux 4.4.206
    platform/x86: hp-wmi: Fix ACPI errors caused by too small buffer
    hwrng: stm32 - fix unbalanced pm_runtime_enable
  * HID: core: check whether Usage Page item is after Usage ID items
      drivers/hid/hid-core.c
  * net: sched: fix `tc -s class show` no bstats on class with nolock subqueues
      net/sched/sch_mq.c
      net/sched/sch_multiq.c
      net/sched/sch_prio.c
    tipc: fix link name length check
    openvswitch: remove another BUG_ON()
    openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()
    slip: Fix use-after-free Read in slip_open
    openvswitch: fix flow command message size
    macvlan: schedule bc_work even if error
  * pwm: Clear chip_data in pwm_put()
      drivers/pwm/core.c
    net: macb: fix error format in dev_err()
  * media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE
      drivers/media/v4l2-core/v4l2-ctrls.c
    mei: bus: prefix device names on bus with the bus name
    USB: serial: ftdi_sio: add device IDs for U-Blox C099-F9P
    staging: rtl8192e: fix potential use after free
    mtd: Remove a debug trace in mtdpart.c
    powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property()
    scsi: libsas: Check SMP PHY control function result
    ACPI / APEI: Switch estatus pool to use vmalloc memory
    scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery
  * net: dev: Use unsigned integer as an argument to left-shift
      include/linux/netdevice.h
  * net: fix possible overflow in __sk_mem_raise_allocated()
      include/net/sock.h
      net/core/sock.c
    sfc: initialise found bitmap in efx_ef10_mtd_probe
    tipc: fix skb may be leaky in tipc_link_input
    decnet: fix DN_IFREQ_SIZE
    sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe
  * net/core/neighbour: fix kmemleak minimal reference count for hash tables
      net/core/neighbour.c
  * net/core/neighbour: tell kmemleak about hash tables
      net/core/neighbour.c
    tipc: fix memory leak in tipc_nl_compat_publ_dump
    mtd: Check add_mtd_device() ret code
  * lib/genalloc.c: include vmalloc.h
      lib/genalloc.c
  * lib/genalloc.c: use vzalloc_node() to allocate the bitmap
      lib/genalloc.c
    ocfs2: clear journal dirty flag after shutdown journal
    tipc: fix a missing check of genlmsg_put
    atl1e: checking the status of atl1e_write_phy_reg
    net: stmicro: fix a missing check of clk_prepare
    um: Make GCOV depend on !KCOV
  * net/net_namespace: Check the return value of register_pernet_subsys()
      net/core/net_namespace.c
    regulator: tps65910: fix a missing check of return value
    drbd: fix print_st_err()'s prototype to match the definition
    drbd: reject attach of unsuitable uuids even if connected
    powerpc/44x/bamboo: Fix PCI range
    powerpc/mm: Make NULL pointer deferences explicit on bad page faults.
    powerpc/prom: fix early DEBUG messages
    ath6kl: Fix off by one error in scan completion
    ath6kl: Only use match sets when firmware supports it
    scsi: csiostor: fix incorrect dma device in case of vport
    scsi: qla2xxx: deadlock by configfs_depend_item
    RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer
    openrisc: Fix broken paths to arch/or32
    serial: max310x: Fix tx_empty() callback
    drivers/regulator: fix a missing check of return value
    powerpc/xmon: fix dump_segments()
    powerpc/book3s/32: fix number of bats in p/v_block_mapped()
    IB/qib: Fix an error code in qib_sdma_verbs_send()
    xfs: Align compat attrlist_by_handle with native implementation.
    gfs2: take jdata unstuff into account in do_grow
    HID: doc: fix wrong data structure reference for UHID_OUTPUT
    pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10
    pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration
    KVM: s390: unregister debug feature on failing arch init
    xen/pciback: Check dev_data before using it
    btrfs: only track ref_heads in delayed_ref_updates
    VSOCK: bind to random port for VMADDR_PORT_ANY
  * gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB
      include/linux/gpio/consumer.h
    microblaze: move "... is ready" messages to arch/microblaze/Makefile
    microblaze: adjust the help to the real behavior
    ubi: Do not drop UBI device reference before using
    ubi: Put MTD device after it is not used
    xfs: require both realtime inodes to mount
    rtl818x: fix potential use after free
    mwifiex: debugfs: correct histogram spacing, formatting
    mwifiex: fix potential NULL dereference and use after free
    crypto: user - support incremental algorithm dumps
  * ACPI / LPSS: Ignore acpi_device_fix_up_power() return value
      drivers/acpi/acpi_lpss.c
    ARM: ks8695: fix section mismatch warning
    PM / AVS: SmartReflex: NULL check before some freeing functions is not needed
  * arm64: smp: Handle errors reported by the firmware
      arch/arm64/kernel/smp.c
    parisc: Fix HP SDC hpa address output
    parisc: Fix serio address output
    ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication
    ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed
    scsi: lpfc: Fix dif and first burst use in write commands
    block: drbd: remove a stray unlock in __drbd_send_protocol()
    scripts/gdb: fix debugging modules compiled with hot/cold partitioning
    can: c_can: D_CAN: c_can_chip_config(): perform a sofware reset on open
    can: peak_usb: report bus recovery as well
  * reset: fix reset_control_ops kerneldoc comment
      include/linux/reset-controller.h
    clk: samsung: exynos5420: Preserve PLL configuration during suspend/resume
    ASoC: kirkwood: fix external clock probe defer
  * ASoC: compress: fix unsigned integer overflow check
      sound/core/compress_offload.c

Change-Id: Ieefc3442d0ce62a147d6d427b125f7b148e88c05
Signed-off-by: lucaswei <lucaswei@google.com>
2020-02-14 10:51:59 +08:00

510 lines
15 KiB
C

/*
* include/linux/hrtimer.h
*
* hrtimers - High-resolution kernel timers
*
* Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
* Copyright(C) 2005, Red Hat, Inc., Ingo Molnar
*
* data type definitions, declarations, prototypes
*
* Started by: Thomas Gleixner and Ingo Molnar
*
* For licencing details see kernel-base/COPYING
*/
#ifndef _LINUX_HRTIMER_H
#define _LINUX_HRTIMER_H
#include <linux/rbtree.h>
#include <linux/ktime.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/percpu.h>
#include <linux/timer.h>
#include <linux/timerqueue.h>
struct hrtimer_clock_base;
struct hrtimer_cpu_base;
/*
* Mode arguments of xxx_hrtimer functions:
*/
enum hrtimer_mode {
HRTIMER_MODE_ABS = 0x0, /* Time value is absolute */
HRTIMER_MODE_REL = 0x1, /* Time value is relative to now */
HRTIMER_MODE_PINNED = 0x02, /* Timer is bound to CPU */
HRTIMER_MODE_ABS_PINNED = 0x02,
HRTIMER_MODE_REL_PINNED = 0x03,
};
/*
* Return values for the callback function
*/
enum hrtimer_restart {
HRTIMER_NORESTART, /* Timer is not restarted */
HRTIMER_RESTART, /* Timer must be restarted */
};
/*
* Values to track state of the timer
*
* Possible states:
*
* 0x00 inactive
* 0x01 enqueued into rbtree
* 0x02 timer is pinned to a cpu
*
* The callback state is not part of the timer->state because clearing it would
* mean touching the timer after the callback, this makes it impossible to free
* the timer from the callback function.
*
* Therefore we track the callback state in:
*
* timer->base->cpu_base->running == timer
*
* On SMP it is possible to have a "callback function running and enqueued"
* status. It happens for example when a posix timer expired and the callback
* queued a signal. Between dropping the lock which protects the posix timer
* and reacquiring the base lock of the hrtimer, another CPU can deliver the
* signal and rearm the timer.
*
* All state transitions are protected by cpu_base->lock.
*/
#define HRTIMER_STATE_INACTIVE 0x00
#define HRTIMER_STATE_ENQUEUED 0x01
#define HRTIMER_PINNED_SHIFT 1
#define HRTIMER_STATE_PINNED (1 << HRTIMER_PINNED_SHIFT)
/**
* struct hrtimer - the basic hrtimer structure
* @node: timerqueue node, which also manages node.expires,
* the absolute expiry time in the hrtimers internal
* representation. The time is related to the clock on
* which the timer is based. Is setup by adding
* slack to the _softexpires value. For non range timers
* identical to _softexpires.
* @_softexpires: the absolute earliest expiry time of the hrtimer.
* The time which was given as expiry time when the timer
* was armed.
* @function: timer expiry callback function
* @base: pointer to the timer base (per cpu and per clock)
* @state: state information (See bit values above)
* @is_rel: Set if the timer was armed relative
* @start_pid: timer statistics field to store the pid of the task which
* started the timer
* @start_site: timer statistics field to store the site where the timer
* was started
* @start_comm: timer statistics field to store the name of the process which
* started the timer
*
* The hrtimer structure must be initialized by hrtimer_init()
*/
struct hrtimer {
struct timerqueue_node node;
ktime_t _softexpires;
enum hrtimer_restart (*function)(struct hrtimer *);
struct hrtimer_clock_base *base;
u8 state;
u8 is_rel;
#ifdef CONFIG_TIMER_STATS
int start_pid;
void *start_site;
char start_comm[16];
#endif
};
/**
* struct hrtimer_sleeper - simple sleeper structure
* @timer: embedded timer structure
* @task: task to wake up
*
* task is set to NULL, when the timer expires.
*/
struct hrtimer_sleeper {
struct hrtimer timer;
struct task_struct *task;
};
#ifdef CONFIG_64BIT
# define HRTIMER_CLOCK_BASE_ALIGN 64
#else
# define HRTIMER_CLOCK_BASE_ALIGN 32
#endif
/**
* struct hrtimer_clock_base - the timer base for a specific clock
* @cpu_base: per cpu clock base
* @index: clock type index for per_cpu support when moving a
* timer to a base on another cpu.
* @clockid: clock id for per_cpu support
* @active: red black tree root node for the active timers
* @get_time: function to retrieve the current time of the clock
* @offset: offset of this clock to the monotonic base
*/
struct hrtimer_clock_base {
struct hrtimer_cpu_base *cpu_base;
int index;
clockid_t clockid;
struct timerqueue_head active;
ktime_t (*get_time)(void);
ktime_t offset;
} __attribute__((__aligned__(HRTIMER_CLOCK_BASE_ALIGN)));
enum hrtimer_base_type {
HRTIMER_BASE_MONOTONIC,
HRTIMER_BASE_REALTIME,
HRTIMER_BASE_BOOTTIME,
HRTIMER_BASE_TAI,
HRTIMER_MAX_CLOCK_BASES,
};
/*
* struct hrtimer_cpu_base - the per cpu clock bases
* @lock: lock protecting the base and associated clock bases
* and timers
* @seq: seqcount around __run_hrtimer
* @running: pointer to the currently running hrtimer
* @cpu: cpu number
* @active_bases: Bitfield to mark bases with active timers
* @clock_was_set_seq: Sequence counter of clock was set events
* @migration_enabled: The migration of hrtimers to other cpus is enabled
* @nohz_active: The nohz functionality is enabled
* @expires_next: absolute time of the next event which was scheduled
* via clock_set_next_event()
* @next_timer: Pointer to the first expiring timer
* @in_hrtirq: hrtimer_interrupt() is currently executing
* @hres_active: State of high resolution mode
* @hang_detected: The last hrtimer interrupt detected a hang
* @nr_events: Total number of hrtimer interrupt events
* @nr_retries: Total number of hrtimer interrupt retries
* @nr_hangs: Total number of hrtimer interrupt hangs
* @max_hang_time: Maximum time spent in hrtimer_interrupt
* @clock_base: array of clock bases for this cpu
*
* Note: next_timer is just an optimization for __remove_hrtimer().
* Do not dereference the pointer because it is not reliable on
* cross cpu removals.
*/
struct hrtimer_cpu_base {
raw_spinlock_t lock;
seqcount_t seq;
struct hrtimer *running;
unsigned int cpu;
unsigned int active_bases;
unsigned int clock_was_set_seq;
bool migration_enabled;
bool nohz_active;
#ifdef CONFIG_HIGH_RES_TIMERS
unsigned int in_hrtirq : 1,
hres_active : 1,
hang_detected : 1;
ktime_t expires_next;
struct hrtimer *next_timer;
unsigned int nr_events;
unsigned int nr_retries;
unsigned int nr_hangs;
unsigned int max_hang_time;
#endif
struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
} ____cacheline_aligned;
static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
{
BUILD_BUG_ON(sizeof(struct hrtimer_clock_base) > HRTIMER_CLOCK_BASE_ALIGN);
timer->node.expires = time;
timer->_softexpires = time;
}
static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta)
{
timer->_softexpires = time;
timer->node.expires = ktime_add_safe(time, delta);
}
static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, u64 delta)
{
timer->_softexpires = time;
timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta));
}
static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64)
{
timer->node.expires.tv64 = tv64;
timer->_softexpires.tv64 = tv64;
}
static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
{
timer->node.expires = ktime_add_safe(timer->node.expires, time);
timer->_softexpires = ktime_add_safe(timer->_softexpires, time);
}
static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns)
{
timer->node.expires = ktime_add_ns(timer->node.expires, ns);
timer->_softexpires = ktime_add_ns(timer->_softexpires, ns);
}
static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer)
{
return timer->node.expires;
}
static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer)
{
return timer->_softexpires;
}
static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer)
{
return timer->node.expires.tv64;
}
static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer)
{
return timer->_softexpires.tv64;
}
static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer)
{
return ktime_to_ns(timer->node.expires);
}
static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer)
{
return ktime_sub(timer->node.expires, timer->base->get_time());
}
static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
{
return timer->base->get_time();
}
#ifdef CONFIG_HIGH_RES_TIMERS
struct clock_event_device;
extern void hrtimer_interrupt(struct clock_event_device *dev);
static inline int hrtimer_is_hres_active(struct hrtimer *timer)
{
return timer->base->cpu_base->hres_active;
}
extern void hrtimer_peek_ahead_timers(void);
/*
* The resolution of the clocks. The resolution value is returned in
* the clock_getres() system call to give application programmers an
* idea of the (in)accuracy of timers. Timer values are rounded up to
* this resolution values.
*/
# define HIGH_RES_NSEC 1
# define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC }
# define MONOTONIC_RES_NSEC HIGH_RES_NSEC
# define KTIME_MONOTONIC_RES KTIME_HIGH_RES
extern void clock_was_set_delayed(void);
extern unsigned int hrtimer_resolution;
#else
# define MONOTONIC_RES_NSEC LOW_RES_NSEC
# define KTIME_MONOTONIC_RES KTIME_LOW_RES
#define hrtimer_resolution (unsigned int)LOW_RES_NSEC
static inline void hrtimer_peek_ahead_timers(void) { }
static inline int hrtimer_is_hres_active(struct hrtimer *timer)
{
return 0;
}
static inline void clock_was_set_delayed(void) { }
#endif
static inline ktime_t
__hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
{
ktime_t rem = ktime_sub(timer->node.expires, now);
/*
* Adjust relative timers for the extra we added in
* hrtimer_start_range_ns() to prevent short timeouts.
*/
if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel)
rem.tv64 -= hrtimer_resolution;
return rem;
}
static inline ktime_t
hrtimer_expires_remaining_adjusted(const struct hrtimer *timer)
{
return __hrtimer_expires_remaining_adjusted(timer,
timer->base->get_time());
}
extern void clock_was_set(void);
#ifdef CONFIG_TIMERFD
extern void timerfd_clock_was_set(void);
#else
static inline void timerfd_clock_was_set(void) { }
#endif
extern void hrtimers_resume(void);
DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
/* Exported timer functions: */
/* To be used from cpusets, only */
extern void hrtimer_quiesce_cpu(void *cpup);
/* Initialize timers: */
extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
enum hrtimer_mode mode);
#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock,
enum hrtimer_mode mode);
extern void destroy_hrtimer_on_stack(struct hrtimer *timer);
#else
static inline void hrtimer_init_on_stack(struct hrtimer *timer,
clockid_t which_clock,
enum hrtimer_mode mode)
{
hrtimer_init(timer, which_clock, mode);
}
static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
#endif
/* Basic timer operations: */
extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
u64 range_ns, const enum hrtimer_mode mode);
/**
* hrtimer_start - (re)start an hrtimer on the current CPU
* @timer: the timer to be added
* @tim: expiry time
* @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or
* relative (HRTIMER_MODE_REL)
*/
static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim,
const enum hrtimer_mode mode)
{
hrtimer_start_range_ns(timer, tim, 0, mode);
}
extern int hrtimer_cancel(struct hrtimer *timer);
extern int hrtimer_try_to_cancel(struct hrtimer *timer);
static inline void hrtimer_start_expires(struct hrtimer *timer,
enum hrtimer_mode mode)
{
u64 delta;
ktime_t soft, hard;
soft = hrtimer_get_softexpires(timer);
hard = hrtimer_get_expires(timer);
delta = ktime_to_ns(ktime_sub(hard, soft));
hrtimer_start_range_ns(timer, soft, delta, mode);
}
static inline void hrtimer_restart(struct hrtimer *timer)
{
hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
}
/* Query timers: */
extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
{
return __hrtimer_get_remaining(timer, false);
}
extern u64 hrtimer_get_next_event(void);
extern bool hrtimer_active(const struct hrtimer *timer);
/**
* hrtimer_is_queued = check, whether the timer is on one of the queues
* @timer: Timer to check
*
* Returns: True if the timer is queued, false otherwise
*
* The function can be used lockless, but it gives only a current snapshot.
*/
static inline bool hrtimer_is_queued(struct hrtimer *timer)
{
/* The READ_ONCE pairs with the update functions of timer->state */
return !!(READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED);
}
/*
* Helper function to check, whether the timer is running the callback
* function
*/
static inline int hrtimer_callback_running(struct hrtimer *timer)
{
return timer->base->cpu_base->running == timer;
}
/* Forward a hrtimer so it expires after now: */
extern u64
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
/**
* hrtimer_forward_now - forward the timer expiry so it expires after now
* @timer: hrtimer to forward
* @interval: the interval to forward
*
* Forward the timer expiry so it will expire after the current time
* of the hrtimer clock base. Returns the number of overruns.
*
* Can be safely called from the callback function of @timer. If
* called from other contexts @timer must neither be enqueued nor
* running the callback and the caller needs to take care of
* serialization.
*
* Note: This only updates the timer expiry value and does not requeue
* the timer.
*/
static inline u64 hrtimer_forward_now(struct hrtimer *timer,
ktime_t interval)
{
return hrtimer_forward(timer, timer->base->get_time(), interval);
}
/* Precise sleep: */
extern long hrtimer_nanosleep(struct timespec *rqtp,
struct timespec __user *rmtp,
const enum hrtimer_mode mode,
const clockid_t clockid);
extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
struct task_struct *tsk);
extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta,
const enum hrtimer_mode mode);
extern int schedule_hrtimeout_range_clock(ktime_t *expires,
u64 delta,
const enum hrtimer_mode mode,
int clock);
extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
/* Soft interrupt function to run the hrtimer queues: */
extern void hrtimer_run_queues(void);
/* Bootup initialization: */
extern void __init hrtimers_init(void);
/* Show pending timers: */
extern void sysrq_timer_list_show(void);
#endif