Files
kernel_google_b1c1/kernel/time/timer_list.c
Robin Peng d5bdee4cf1 Merge android-4.9-q (4.9.192) into android-msm-pixel-4.9-lts
Merge 4.9.192 into android-4.9-q
Linux 4.9.192
  * mld: fix memory leak in mld_del_delrec()
      net/ipv6/mcast.c
  * tcp: inherit timestamp on mtu probe
      net/ipv4/tcp_output.c
    net: stmmac: dwmac-rk: Don't fail if phy regulator is absent
    net: fix skb use after free in netpoll
    Revert "x86/apic: Include the LDR when clearing out APIC registers"
    spi: bcm2835aux: fix corruptions for longer spi transfers
    spi: bcm2835aux: remove dangerous uncontrolled read of fifo
    spi: bcm2835aux: unifying code between polling and interrupt driven code
    spi: bcm2835aux: ensure interrupts are enabled for shared handler
    libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer
    KVM: arm/arm64: Only skip MMIO insn once
    ceph: fix buffer free while holding i_ceph_lock in fill_inode()
    ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()
    IB/mlx4: Fix memory leaks
    Tools: hv: kvp: eliminate 'may be used uninitialized' warning
    ravb: Fix use-after-free ravb_tstamp_skb
    wimax/i2400m: fix a memory leak bug
    net: kalmia: fix memory leaks
    cx82310_eth: fix a memory leak bug
    net: myri10ge: fix memory leaks
    cxgb4: fix a memory leak bug
  * gpio: Fix build error of function redefinition
      include/linux/gpio.h
    ibmveth: Convert multicast list size for little-endian system
    Bluetooth: btqca: Add a short delay before downloading the NVM
    net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx
    net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
    Merge 4.9.191 into android-4.9-q
Linux 4.9.191
  * mm/zsmalloc.c: fix build when CONFIG_COMPACTION=n
      mm/zsmalloc.c
    x86/ptrace: fix up botched merge of spectrev1 fix
    i2c: piix4: Fix port selection for AMD Family 16h Model 30h
    KVM: arm/arm64: vgic-v2: Handle SGI bits in GICD_I{S,C}PENDR0 as WI
    KVM: arm/arm64: vgic: Fix potential deadlock when ap_list is long
    mac80211: fix possible sta leak
  * Revert "cfg80211: fix processing world regdomain when non modular"
      net/wireless/reg.c
    VMCI: Release resource if the work is already queued
    stm class: Fix a double free of stm_source_device
  * mmc: core: Fix init of SD cards reporting an invalid VDD range
      drivers/mmc/core/sd.c
    mmc: sdhci-of-at91: add quirk for broken HS200
    uprobes/x86: Fix detection of 32-bit user mode
    ptrace,x86: Make user_64bit_mode() available to 32-bit builds
    USB: storage: ums-realtek: Whitelist auto-delink support
    USB: storage: ums-realtek: Update module parameter description for auto_delink_en
    usb: host: xhci: rcar: Fix typo in compatible string matching
    usb: host: ohci: fix a race condition between shutdown and irq
    usb: chipidea: udc: don't do hardware access if gadget has stopped
    USB: cdc-wdm: fix race between write and disconnect due to flag abuse
  * usb-storage: Add new JMS567 revision to unusual_devs
      drivers/usb/storage/unusual_devs.h
  * mm/zsmalloc.c: fix race condition in zs_destroy_pool
      mm/zsmalloc.c
    x86/apic: Include the LDR when clearing out APIC registers
    x86/apic: Do not initialize LDR and DFR for bigsmp
    KVM: x86: Don't update RIP or do single-step on faulting emulation
    ALSA: seq: Fix potential concurrent access to the deleted pool
    ALSA: line6: Fix memory leak at line6_init_pcm() error path
  * tcp: make sure EPOLLOUT wont be missed
      net/core/stream.c
  * ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit
      sound/usb/mixer.c
  * ALSA: usb-audio: Fix a stack buffer overflow bug in check_input_term
      sound/usb/mixer.c
  * tcp: fix tcp_rtx_queue_tail in case of empty retransmit queue
      include/net/tcp.h
  * scsi: ufs: Fix RX_TERMINATION_FORCE_ENABLE define value
      drivers/scsi/ufs/unipro.h
    watchdog: bcm2835_wdt: Fix module autoload
    tools: hv: fix KVP and VSS daemons exit code
    usb: host: fotg2: restart hcd after port reset
    i2c: emev2: avoid race when unregistering slave client
    xen/blkback: fix memory leaks
  * usb: gadget: composite: Clear "suspended" on reset/disconnect
      drivers/usb/gadget/composite.c
  * iommu/dma: Handle SG length overflow better
      drivers/iommu/dma-iommu.c
    dmaengine: ste_dma40: fix unneeded variable warning
    x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
    Revert "perf test 6: Fix missing kvm module load for s390"
    xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT
  * mm/zsmalloc.c: migration can leave pages in ZS_EMPTY indefinitely
      mm/zsmalloc.c
    mm, page_owner: handle THP splits correctly
  * genirq: Properly pair kobject_del() with kobject_add()
      kernel/irq/irqdesc.c
  * dm table: fix invalid memory accesses with too high sector number
      drivers/md/dm-table.c
    dm space map metadata: fix missing store of apply_bops() return value
    dm btree: fix order of block initialization in btree_split_beneath
    x86/boot: Fix boot regression caused by bootparam sanitizing
    x86/boot: Save fields explicitly, zero out everything else
    x86/apic: Handle missing global clockevent gracefully
    x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
    userfaultfd_release: always remove uffd flags and clear vm_userfaultfd_ctx
  * gpiolib: never report open-drain/source lines as 'input' to user-space
      drivers/gpio/gpiolib.c
  * Revert "dm bufio: fix deadlock with loop device"
      drivers/md/dm-bufio.c
    HID: wacom: Correct distance scale for 2nd-gen Intuos devices
    HID: wacom: correct misreported EKR ring values
    selftests: kvm: Adding config fragments
    perf pmu-events: Fix missing "cpu_clk_unhalted.core" event
    drm/vmwgfx: fix memory leak when too many retries have occurred
    x86/lib/cpu: Address missing prototypes warning
    libata: add SG safety checks in SFF pio transfers
    net: hisilicon: Fix dma_map_single failed on arm64
    net: hisilicon: fix hip04-xmit never return TX_BUSY
    net: hisilicon: make hip04_tx_reclaim non-reentrant
    net: cxgb3_main: Fix a resource leak in a error path in 'init_one()'
    HID: input: fix a4tech horizontal wheel custom usage
    NFSv4: Fix a potential sleep while atomic in nfs4_do_reclaim()
    can: peak_usb: force the string buffer NULL-terminated
    can: sja1000: force the string buffer NULL-terminated
    perf bench numa: Fix cpu0 binding
    isdn: hfcsusb: Fix mISDN driver crash caused by transfer buffer on the stack
    isdn: mISDN: hfcsusb: Fix possible null-pointer dereferences in start_isoc_chain()
    net: usb: qmi_wwan: Add the BroadMobi BM818 card
    ASoC: ti: davinci-mcasp: Correct slot_width posed constraint
    st_nci_hci_connectivity_event_received: null check the allocation
    st21nfca_connectivity_event_received: null check the allocation
    can: dev: call netif_carrier_off() in register_candev()
  * bonding: Force slave speed check after link state recovery for 802.3ad
      drivers/net/bonding/bond_main.c
  * ASoC: dapm: Fix handling of custom_stop_condition on DAPM graph walks
      sound/soc/soc-dapm.c
  * netfilter: ebtables: fix a memory leak bug in compat
      net/bridge/netfilter/ebtables.c
    MIPS: kernel: only use i8253 clocksource with periodic clockevent
    HID: Add 044f:b320 ThrustMaster, Inc. 2 in 1 DT
  * BACKPORT: arch: add pidfd and io_uring syscalls everywhere
      arch/arm64/include/asm/unistd32.h
  * UPSTREAM: pidfd: fix a poll race when setting exit_state
      kernel/exit.c
  * BACKPORT: arch: wire-up pidfd_open()
      arch/arm64/include/asm/unistd.h
      arch/arm64/include/asm/unistd32.h
      arch/x86/entry/syscalls/syscall_32.tbl
      include/uapi/asm-generic/unistd.h
  * BACKPORT: pid: add pidfd_open()
      include/linux/syscalls.h
      kernel/pid.c
  * UPSTREAM: pidfd: add polling support
      include/linux/pid.h
      kernel/fork.c
      kernel/pid.c
      kernel/signal.c
  * UPSTREAM: signal: improve comments
      kernel/signal.c
  * BACKPORT: fork: do not release lock that wasn't taken
      kernel/fork.c
  * BACKPORT: signal: support CLONE_PIDFD with pidfd_send_signal
      kernel/signal.c
      kernel/sys_ni.c
  * BACKPORT: clone: add CLONE_PIDFD
      include/linux/pid.h
      include/uapi/linux/sched.h
      kernel/fork.c
  * UPSTREAM: Make anon_inodes unconditional
      arch/arm64/kvm/Kconfig
      drivers/base/Kconfig
      drivers/char/tpm/Kconfig
      drivers/dma-buf/Kconfig
      drivers/gpio/Kconfig
      drivers/iio/Kconfig
      drivers/infiniband/Kconfig
      drivers/vfio/Kconfig
      fs/Makefile
      fs/notify/fanotify/Kconfig
      fs/notify/inotify/Kconfig
      init/Kconfig
  * UPSTREAM: signal: use fdget() since we don't allow O_PATH
      kernel/signal.c
  * UPSTREAM: signal: don't silently convert SI_USER signals to non-current pidfd
      kernel/signal.c
  * BACKPORT: signal: add pidfd_send_signal() syscall
      arch/x86/entry/syscalls/syscall_32.tbl
      fs/proc/base.c
      include/linux/proc_fs.h
      include/linux/syscalls.h
      include/uapi/asm-generic/unistd.h
      kernel/signal.c
      kernel/sys_ni.c
  * ANDROID: sched: Disallow WALT with CFS bandwidth control
      init/Kconfig
  * ANDROID: fiq_debugger: remove
      drivers/staging/android/Kconfig
      drivers/staging/android/Makefile
    Merge 4.9.190 into android-4.9-q
Linux 4.9.190
  * bonding: Add vlan tx offload to hw_enc_features
      drivers/net/bonding/bond_main.c
    team: Add vlan tx offload to hw_enc_features
    net/mlx5e: Use flow keys dissector to parse packets for ARFS
    net/mlx5e: Only support tx/rx pause setting for port owner
    xen/netback: Reset nr_frags before freeing skb
    sctp: fix the transport error_count check
  * net/packet: fix race in tpacket_snd()
      net/packet/af_packet.c
    bnx2x: Fix VF's VLAN reconfiguration in reload.
    iommu/amd: Move iommu_init_pci() to .init section
    Input: psmouse - fix build error of multiple definition
  * netfilter: conntrack: Use consistent ct id hash calculation
      net/netfilter/nf_conntrack_core.c
  * arm64: compat: Allow single-byte watchpoints on all addresses
      arch/arm64/kernel/hw_breakpoint.c
  * bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K
      include/linux/filter.h
      kernel/bpf/core.c
      net/core/sysctl_net_core.c
  * asm-generic: fix -Wtype-limits compiler warnings
      include/asm-generic/getorder.h
    USB: serial: option: Add Motorola modem UARTs
    USB: serial: option: add the BroadMobi BM818 card
    USB: serial: option: Add support for ZTE MF871A
    USB: serial: option: add D-Link DWM-222 device ID
  * USB: CDC: fix sanity checks in CDC union parser
      drivers/usb/core/message.c
    usb: cdc-acm: make sure a refcount is taken early enough
  * USB: core: Fix races in character device registration and deregistraion
      drivers/usb/core/file.c
    staging: comedi: dt3000: Fix rounding up of timer divisor
    staging: comedi: dt3000: Fix signed integer overflow 'divider * base'
    ocfs2: remove set but not used variable 'last_hash'
    IB/mad: Fix use-after-free in ib mad completion handling
    IB/core: Add mitigation for Spectre V1
  * arm64/mm: fix variable 'pud' set but not used
      arch/arm64/include/asm/pgtable.h
  * arm64/efi: fix variable 'si' set but not used
      arch/arm64/include/asm/efi.h
  * kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules
      scripts/Makefile.modpost
    ata: libahci: do not complain in case of deferred probe
    scsi: hpsa: correct scsi command status issue after reset
    libata: zpodd: Fix small read overflow in zpodd_get_mech_type()
    perf header: Fix use of unitialized value warning
    perf header: Fix divide by zero error if f_header.attr_size==0
    irqchip/irq-imx-gpcv2: Forward irq type to parent
    xen/pciback: remove set but not used variable 'old_state'
    net: usb: pegasus: fix improper read if get_registers() fail
    Input: iforce - add sanity checks
    Input: kbtab - sanity check for endpoint type
  * HID: hiddev: do cleanup in failure of opening a device
      drivers/hid/usbhid/hiddev.c
  * HID: hiddev: avoid opening a disconnected device
      drivers/hid/usbhid/hiddev.c
    HID: holtek: test for sanity of intfdata
    ALSA: hda - Let all conexant codec enter D3 when rebooting
    ALSA: hda - Add a generic reboot_notify
    ALSA: hda - Fix a memory leak bug
    xtensa: add missing isync to the cpu_reset TLB code
  * netfilter: ctnetlink: don't use conntrack/expect object addresses as id
      include/net/netfilter/nf_conntrack.h
      net/netfilter/nf_conntrack_core.c
      net/netfilter/nf_conntrack_netlink.c
  * inet: switch IP ID generator to siphash
      include/linux/siphash.h
      include/net/netns/ipv4.h
      net/ipv4/route.c
      net/ipv6/output_core.c
  * siphash: implement HalfSipHash1-3 for hash tables
      include/linux/siphash.h
      lib/siphash.c
  * siphash: add cryptographically secure PRF
      include/linux/siphash.h
      lib/Kconfig.debug
      lib/Makefile
      lib/siphash.c
    vhost: scsi: add weight support
    vhost_net: fix possible infinite loop
    vhost: introduce vhost_exceeds_weight()
    vhost_net: introduce vhost_exceeds_weight()
    vhost_net: use packet weight for rx handler, too
    vhost-net: set packet weight of tx polling to 2 * vq size
  * bpf: add bpf_jit_limit knob to restrict unpriv allocations
      include/linux/filter.h
      kernel/bpf/core.c
      net/core/sysctl_net_core.c
  * bpf: restrict access to core bpf sysctls
      net/core/sysctl_net_core.c
  * bpf: get rid of pure_initcall dependency to enable jits
      kernel/bpf/core.c
      net/core/sysctl_net_core.c
      net/socket.c
  * mm/memcontrol.c: fix use after free in mem_cgroup_iter()
      mm/memcontrol.c
  * mm/usercopy: use memory range to be accessed for wraparound check
      mm/usercopy.c
    sh: kernel: hw_breakpoint: Fix missing break in switch statement
    scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA
    iwlwifi: don't unmap as page memory that was mapped as single
    mwifiex: fix 802.11n/WPA detection
    smb3: send CAP_DFS capability during session setup
    SMB3: Fix deadlock in validate negotiate hits reconnect
    mac80211: don't WARN on short WMM parameters from AP
    ALSA: hda - Don't override global PCM hw info flag
    ALSA: firewire: fix a memory leak bug
    hwmon: (nct7802) Fix wrong detection of in4 presence
    can: peak_usb: pcan_usb_fd: Fix info-leaks to USB devices
    can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices
  * perf/core: Fix creating kernel counters for PMUs that override event->cpu
      kernel/events/core.c
  * tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop
      drivers/tty/tty_ldsem.c
    scsi: scsi_dh_alua: always use a 2 second delay before retrying RTPG
    scsi: ibmvfc: fix WARN_ON during event pool release
    scsi: megaraid_sas: fix panic on loading firmware crashdump
    ARM: davinci: fix sleep.S build error on ARMv4
    ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()
    drbd: dynamically allocate shash descriptor
    perf probe: Avoid calling freeing routine multiple times for same pointer
  * ALSA: compress: Be more restrictive about when a drain is allowed
      sound/core/compress_offload.c
  * ALSA: compress: Don't allow paritial drain operations on capture streams
      sound/core/compress_offload.c
  * ALSA: compress: Prevent bypasses of set_params
      sound/core/compress_offload.c
  * ALSA: compress: Fix regression on compressed capture streams
      include/sound/compress_driver.h
      sound/core/compress_offload.c
    s390/qdio: add sanity checks to the fast-requeue path
    cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init()
    hwmon: (nct6775) Fix register address and added missed tolerance for nct6106
    mac80211: don't warn about CW params when not using them
  * iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND
      drivers/firmware/Kconfig
  * netfilter: nfnetlink: avoid deadlock due to synchronous request_module
      net/netfilter/nfnetlink.c
    can: peak_usb: fix potential double kfree_skb()
    usb: yurex: Fix use-after-free in yurex_delete
    perf record: Fix module size on s390
    perf db-export: Fix thread__exec_comm()
    perf record: Fix wrong size in perf_record_mmap for last kernel module
  * mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()
      mm/vmalloc.c
    x86/mm: Sync also unmappings in vmalloc_sync_all()
    x86/mm: Check for pfn instead of page in vmalloc_sync_one()
  * sound: fix a memory leak bug
      sound/sound_core.c
    usb: iowarrior: fix deadlock on disconnect
  * usb: usbfs: fix double-free of usb memory upon submiturb error
      drivers/usb/core/devio.c
    ANDROID: fix kernelci build-break in lowmemorykiller
    ANDROID: Fixes to locking around handle_lmk_event
  * UPSTREAM: net/ipv6: allow sysctl to change link-local address generation mode
      include/linux/ipv6.h
      include/net/if_inet6.h
      net/ipv6/addrconf.c
  * ANDROID: fix binder change in merge of 4.9.188
      drivers/android/binder_alloc.c
    Merge 4.9.189 into android-4.9-q
Linux 4.9.189
    x86/speculation/swapgs: Exclude ATOMs from speculation through SWAPGS
    x86/entry/64: Use JMP instead of JMPQ
    x86/speculation: Enable Spectre v1 swapgs mitigations
    x86/speculation: Prepare entry code for Spectre v1 swapgs mitigations
    x86: cpufeatures: Sort feature word 7
    spi: bcm2835: Fix 3-wire mode if DMA is enabled
  * block: blk_init_allocated_queue() set q->fq as NULL in the fail case
      block/blk-core.c
    bnx2x: Disable multi-cos feature.
    ife: error out when nla attributes are empty
  * ip6_tunnel: fix possible use-after-free on xmit
      net/ipv6/ip6_tunnel.c
  * compat_ioctl: pppoe: fix PPPOEIOCSFWD handling
      drivers/net/ppp/pppoe.c
      drivers/net/ppp/pppox.c
      fs/compat_ioctl.c
      include/linux/if_pppox.h
      net/l2tp/l2tp_ppp.c
    tipc: compat: allow tipc commands without arguments
    net: sched: Fix a possible null-pointer dereference in dequeue_func()
    net/mlx5: Use reversed order when unregister devices
  * net: fix ifindex collision during namespace removal
      net/core/dev.c
  * net: bridge: mcast: don't delete permanent entries when fast leave is enabled
      net/bridge/br_multicast.c
    net: bridge: delete local fdb on device init failure
    atm: iphase: Fix Spectre v1 vulnerability
    libceph: use kbasename() and kill ceph_file_part()
    objtool: Add rewind_stack_do_exit() to the noreturn list
    objtool: Add machine_real_restart() to the noreturn list
    IB: directly cast the sockaddr union to aockaddr
    RDMA: Directly cast the sockaddr union to sockaddr
  * HID: Add quirk for HP X1200 PIXART OEM mouse
      drivers/hid/hid-ids.h
      drivers/hid/usbhid/hid-quirks.c
    HID: wacom: fix bit shift for Cintiq Companion 2
  * tcp: be more careful in tcp_fragment()
      include/net/tcp.h
      net/ipv4/tcp_output.c
  * arm64: cpufeature: Fix feature comparison for CTR_EL0.{CWG,ERG}
      arch/arm64/include/asm/cpufeature.h
      arch/arm64/kernel/cpufeature.c
  * arm64: cpufeature: Fix CTR_EL0 field definitions
      arch/arm64/kernel/cpufeature.c
    ARM: dts: logicpd-som-lv: Fix Audio Mute
    ARM: dts: Add pinmuxing for i2c2 and i2c3 for LogicPD torpedo
    ARM: dts: Add pinmuxing for i2c2 and i2c3 for LogicPD SOM-LV
    scsi: fcoe: Embed fc_rport_priv in fcoe_rport structure
  * fs/crypto: Fix 4.9.186 missmerge
      fs/crypto/policy.c
    Merge 4.9.188 into android-4.9-q
Linux 4.9.188
    x86, mm, gup: prevent get_page() race with munmap in paravirt guest
    objtool: Support GCC 9 cold subfunction naming scheme
  * include/linux/module.h: copy __init/__exit attrs to init/cleanup_module
      include/linux/module.h
  * Backport minimal compiler_attributes.h to support GCC 9
      include/linux/compiler.h
    eeprom: at24: make spd world-readable again
  * coredump: fix race condition between collapse_huge_page() and core dumping
      include/linux/mm.h
    infiniband: fix race condition between infiniband mlx4, mlx5 driver and core dumping
  * coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
      drivers/android/binder.c
      fs/proc/task_mmu.c
      include/linux/mm.h
      mm/mmap.c
    IB/mlx5: Fix RSS Toeplitz setup to be aligned with the HW specification
    xen/swiotlb: fix condition for calling xen_destroy_contiguous_region()
  * drivers/perf: arm_pmu: Fix failure path in PM notifier
      drivers/perf/arm_pmu.c
    s390/dasd: fix endless loop after read unit address configuration
  * selinux: fix memory leak in policydb_init()
      security/selinux/ss/policydb.c
  * gpiolib: fix incorrect IRQ requesting of an active-low lineevent
      drivers/gpio/gpiolib.c
    mmc: dw_mmc: Fix occasional hang after tuning on eMMC
    Btrfs: fix incremental send failure after deduplication
  * kbuild: initialize CLANG_FLAGS correctly in the top Makefile
      Makefile
    x86, boot: Remove multiple copy of static function sanitize_boot_params()
    x86/kvm: Don't call kvm_spurious_fault() from .fixup
    ipc/mqueue.c: only perform resource calculation if user valid
    drivers/rapidio/devices/rio_mport_cdev.c: NUL terminate some strings
    uapi linux/coda_psdev.h: move upc_req definition from uapi to kernel side headers
    coda: fix build using bare-metal toolchain
    coda: add error handling for fget
  * mm/cma.c: fail if fixed declaration can't be honored
      mm/cma.c
    x86: math-emu: Hide clang warnings for 16-bit overflow
    x86/apic: Silence -Wtype-limits compiler warnings
    be2net: Signal that the device cannot transmit during reconfiguration
  * ACPI: fix false-positive -Wuninitialized warning
      include/linux/acpi.h
    scsi: zfcp: fix GCC compiler warning emitted with -Wmaybe-uninitialized
    ceph: return -ERANGE if virtual xattr value didn't fit in buffer
    ceph: fix improper use of smp_mb__before_atomic()
    btrfs: fix minimum number of chunk errors for DUP
    fs/adfs: super: fix use-after-free bug
    dmaengine: rcar-dmac: Reject zero-length slave DMA requests
    MIPS: lantiq: Fix bitfield masking
  * kernel/module.c: Only return -EEXIST for modules that have finished loading
      kernel/module.c
    ftrace: Enable trampoline when rec count returns back to one
    ARM: dts: rockchip: Mark that the rk3288 timer might stop in suspend
    ARM: dts: rockchip: Make rk3288-veyron-mickey's emmc work again
    ARM: dts: rockchip: Make rk3288-veyron-minnie run at hs200
    ARM: riscpc: fix DMA
  * UPSTREAM: net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier
      include/net/ndisc.h
      net/ipv6/ndisc.c
    ANDROID: fix up 9p filesystem due to CFI non-upstream patches
    Merge 4.9.187 into android-4.9-q
Linux 4.9.187
    ceph: hold i_ceph_lock when removing caps for freeing inode
    drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl
  * sched/fair: Don't free p->numa_faults with concurrent readers
      fs/exec.c
      include/linux/sched.h
      kernel/fork.c
      kernel/sched/fair.c
    Bluetooth: hci_uart: check for missing tty operations
    media: radio-raremono: change devm_k*alloc to k*alloc
    media: cpia2_usb: first wake up, then free in disconnect
    media: au0828: fix null dereference in error path
    ISDN: hfcsusb: checking idx of ep configuration
  * arm64: compat: Provide definition for COMPAT_SIGMINSTKSZ
      arch/arm64/include/asm/compat.h
    i2c: qup: fixed releasing dma without flush operation completion
    arm64: dts: marvell: Fix A37xx UART0 register size
  * tcp: reset sk_send_head in tcp_write_queue_purge
      include/net/tcp.h
    ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt
  * access: avoid the RCU grace period for the temporary subjective credentials
      fs/open.c
      include/linux/cred.h
      kernel/cred.c
    powerpc/tm: Fix oops on sigreturn on systems without TM
    ALSA: hda - Add a conexant codec entry to let mute led work
    ALSA: line6: Fix wrong altsetting for LINE6_PODHD500_1
    hpet: Fix division by zero in hpet_time_div()
    x86/speculation/mds: Apply more accurate check on hypervisor platform
    x86/sysfb_efi: Add quirks for some devices with swapped width and height
  * usb: pci-quirks: Correct AMD PLL quirk detection
      drivers/usb/host/pci-quirks.c
    usb: wusbcore: fix unbalanced get/put cluster_id
    locking/lockdep: Hide unused 'class' variable
    locking/lockdep: Fix lock used or unused stats error
    mm/mmu_notifier: use hlist_add_head_rcu()
    9p: pass the correct prototype to read_cache_page
    mm/kmemleak.c: fix check for softirq context
    sh: prevent warnings when using iounmap
    powerpc/eeh: Handle hugepages in ioremap space
  * mailbox: handle failed named mailbox channel request
      drivers/mailbox/mailbox.c
  * f2fs: avoid out-of-range memory access
      fs/f2fs/segment.c
    powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h
    RDMA/rxe: Fill in wc byte_len with IB_WC_RECV_RDMA_WITH_IMM
    perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning
  * kallsyms: exclude kasan local symbols on s390
      scripts/kallsyms.c
    serial: sh-sci: Fix TX DMA buffer flushing and workqueue races
    serial: sh-sci: Terminate TX DMA during buffer flushing
    RDMA/i40iw: Set queue pair state when being queried
    powerpc/4xx/uic: clear pending interrupt after irq type/pol change
    um: Silence lockdep complaint about mmap_sem
    mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk
    mfd: arizona: Fix undefined behavior
  * mfd: core: Set fwnode for created devices
      drivers/mfd/mfd-core.c
    recordmcount: Fix spurious mcount entries on powerpc
    iio: iio-utils: Fix possible incorrect mask calculation
    PCI: xilinx-nwl: Fix Multi MSI data programming
  * kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS
      Makefile
  * PCI: sysfs: Ignore lockdep for remove attribute
      drivers/pci/pci-sysfs.c
    powerpc/pci/of: Fix OF flags parsing for 64bit BARs
  * usb: gadget: Zero ffs_io_data
      drivers/usb/gadget/function/f_fs.c
  * tty: serial_core: Set port active bit in uart_port_activate
      drivers/tty/serial/serial_core.c
    drm/rockchip: Properly adjust to a true clock in adjusted_mode
    phy: renesas: rcar-gen2: Fix memory leak at error paths
    drm/virtio: Add memory barriers for capset cache.
    serial: 8250: Fix TX interrupt handling condition
    tty: serial: msm_serial: avoid system lockup condition
    tty/serial: digicolor: Fix digicolor-usart already registered warning
    memstick: Fix error cleanup path of memstick_init
    drm/bridge: sii902x: pixel clock unit is 10kHz instead of 1kHz
    drm/bridge: tc358767: read display_props in get_modes()
    tty: serial: cpm_uart - fix init when SMC is relocated
    pinctrl: rockchip: fix leaked of_node references
    tty: max310x: Fix invalid baudrate divisors calculator
  * usb: core: hub: Disable hub-initiated U1/U2
      drivers/usb/core/hub.c
    drm/panel: simple: Fix panel_simple_dsi_probe
    nfsd: Fix overflow causing non-working mounts on 1 TB machines
    nfsd: fix performance-limiting session calculation
    nfsd: give out fewer session slots as limit approaches
    nfsd: increase DRC cache limit
    NFSv4: Fix open create exclusive when the server reboots
    perf/events/amd/uncore: Fix amd_uncore_llc ID to use pre-defined cpu_llc_id
    perf/x86/amd/uncore: Get correct number of cores sharing last level cache
    perf/x86/amd/uncore: Rename 'L2' to 'LLC'
  * net: bridge: stp: don't cache eth dest pointer before skb pull
      net/bridge/br_stp_bpdu.c
  * net: bridge: mcast: fix stale ipv6 hdr pointer when handling v6 query
      net/bridge/br_multicast.c
  * net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling
      net/bridge/br_multicast.c
  * tcp: Reset bytes_acked and bytes_received when disconnecting
      net/ipv4/tcp.c
  * bonding: validate ip header before check IPPROTO_IGMP
      drivers/net/bonding/bond_main.c
    netrom: hold sock when setting skb->destructor
    netrom: fix a memory leak in nr_rx_frame()
    macsec: fix checksumming after decryption
    macsec: fix use-after-free of skb during RX
    vrf: make sure skb->data contains ip header to make routing
    sky2: Disable MSI on ASUS P6T
    rxrpc: Fix send on a connected, but unbound socket
    nfc: fix potential illegal memory access
    net: openvswitch: fix csum updates for MPLS actions
  * net: neigh: fix multiple neigh timer scheduling
      net/core/neighbour.c
    net: dsa: mv88e6xxx: wait after reset deactivation
    net: bcmgenet: use promisc for unsupported filters
  * ipv4: don't set IPv6 only flags to IPv4 addresses
      net/ipv4/devinet.c
  * igmp: fix memory leak in igmpv3_del_delrec()
      net/ipv4/igmp.c
    caif-hsi: fix possible deadlock in cfhsi_exit_module()
    bnx2x: Prevent ptp_task to be rescheduled indefinitely
    bnx2x: Prevent load reordering in tx completion processing
  * ext4: allow directory holes
      fs/ext4/dir.c
      fs/ext4/namei.c
  * lib/strscpy: Shut up KASAN false-positives in strscpy()
      lib/string.c
  * compiler.h: Add read_word_at_a_time() function.
      include/linux/compiler.h
  * compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()
      include/linux/compiler.h
  * dm bufio: fix deadlock with loop device
      drivers/md/dm-bufio.c
  * usb: Handle USB3 remote wakeup for LPM enabled devices correctly
      drivers/usb/core/hub.c
  * Bluetooth: Add SMP workaround Microsoft Surface Precision Mouse bug
      net/bluetooth/smp.c
    intel_th: msu: Fix single mode with disabled IOMMU
  * eCryptfs: fix a couple type promotion bugs
      fs/ecryptfs/crypto.c
    powerpc/watchpoint: Restore NV GPRs while returning from exception
    powerpc/32s: fix suspend/resume when IBATs 4-7 are used
    parisc: Fix kernel panic due invalid values in IAOQ0 or IAOQ1
    parisc: Ensure userspace privilege for ptraced processes in regset functions
    um: Fix FP register size for XSTATE/XSAVE
    um: Allow building and running on older hosts
    crypto: caam - limit output IV to CBC to work around CTR mode DMA issue
    PCI: hv: Fix a use-after-free bug in hv_eject_device_work()
    PCI: hv: Delete the device earlier from hbus->children for hot-remove
    crypto: ccp - Validate the the error value used to index error messages
    gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEM
    coda: pass the host file in vma->vm_file on mmap
    floppy: fix out-of-bounds read in copy_buffer
    floppy: fix invalid pointer dereference in drive_name
    floppy: fix out-of-bounds read in next_valid_format
    floppy: fix div-by-zero in setup_format_params
  * take floppy compat ioctls to sodding floppy.c
      block/compat_ioctl.c
    libnvdimm/pfn: fix fsdax-mode namespace info-block zero-fields
    Btrfs: add missing inode version, ctime and mtime updates when punching hole
  * PCI: Do not poll for PME if the device is in D3cold
      drivers/pci/pci.c
    9p/virtio: Add cleanup path in p9_virtio_init
    padata: use smp_mb in padata_reorder to avoid orphaned padata jobs
    drm/nouveau/i2c: Enable i2c pads & busses during preinit
  * fs/proc/proc_sysctl.c: fix the default values of i_uid/i_gid on /proc/sys inodes.
      fs/proc/proc_sysctl.c
    arm64: tegra: Fix AGIC register range
    KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed
    media: coda: Remove unbalanced and unneeded mutex unlock
  * media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom()
      drivers/media/v4l2-core/v4l2-ctrls.c
    ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine
    ALSA: seq: Break too long mutex context in the write loop
  * lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE
      lib/scatterlist.c
    NFSv4: Handle the special Linux file open access mode
  * tracing/snapshot: Resize spare buffer if size changed
      kernel/trace/trace.c
    iwlwifi: pcie: don't service an interrupt that was masked
    arm64: tegra: Update Jetson TX1 GPU regulator timings
    regulator: s2mps11: Fix buck7 and buck8 wrong voltages
    Input: gtco - bounds check collection indent level
    crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe
    crypto: chacha20poly1305 - fix atomic sleep when using async algorithm
  * crypto: arm64/sha2-ce - correct digest for empty data in finup
      arch/arm64/crypto/sha2-ce-glue.c
  * crypto: arm64/sha1-ce - correct digest for empty data in finup
      arch/arm64/crypto/sha1-ce-glue.c
  * crypto: ghash - fix unaligned memory access in ghash_setkey()
      crypto/ghash-generic.c
    scsi: mac_scsi: Increase PIO/PDMA transfer length threshold
    scsi: NCR5380: Always re-enable reselection interrupt
    scsi: NCR5380: Reduce goto statements in NCR5380_select()
    xen: let alloc_xenballooned_pages() fail if not enough memory free
    gtp: fix use-after-free in gtp_newlink()
    gtp: fix Illegal context switch in RCU read-side critical section.
  * Bluetooth: validate BLE connection interval updates
      net/bluetooth/hci_event.c
      net/bluetooth/l2cap_core.c
  * Bluetooth: Check state in l2cap_disconnect_rsp
      net/bluetooth/l2cap_core.c
    Bluetooth: 6lowpan: search for destination address in all peers
    Bluetooth: hci_bcsp: Fix memory leak in rx_skb
  * gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants
      drivers/gpio/gpiolib.c
  * net: usb: asix: init MAC address buffers
      drivers/net/usb/asix_devices.c
    iwlwifi: mvm: Drop large non sta frames
    bcache: check c->gc_thread by IS_ERR_OR_NULL in cache_set_flush()
  * EDAC: Fix global-out-of-bounds write when setting edac_mc_poll_msec
      drivers/edac/edac_mc_sysfs.c
      drivers/edac/edac_module.h
  * crypto: asymmetric_keys - select CRYPTO_HASH where needed
      crypto/asymmetric_keys/Kconfig
    ixgbe: Check DDM existence in transceiver before access
  * rslib: Fix handling of of caller provided syndrome
      lib/reed_solomon/decode_rs.c
  * rslib: Fix decoding of shortened codes
      lib/reed_solomon/decode_rs.c
  * clocksource/drivers/exynos_mct: Increase priority over ARM arch timer
      include/linux/cpuhotplug.h
    libata: don't request sense data on !ZAC ATA devices
    perf tools: Increase MAX_NR_CPUS and MAX_CACHES
    ath10k: fix PCIE device wake up failed
    mt7601u: fix possible memory leak when the device is disconnected
    x86/build: Add 'set -e' to mkcapflags.sh to delete broken capflags.c
    mt7601u: do not schedule rx_tasklet when the device has been disconnected
    media: coda: increment sequence offset for the last returned frame
    media: coda: fix mpeg2 sequence number handling
    acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  * timer_list: Guard procfs specific code
      kernel/time/timer_list.c
  * ntp: Limit TAI-UTC offset
      kernel/time/ntp.c
  * media: i2c: fix warning same module names
      drivers/media/i2c/Makefile
  * ipsec: select crypto ciphers for xfrm_algo
      net/xfrm/Kconfig
  * EDAC/sysfs: Fix memory leak when creating a csrow object
      drivers/edac/edac_mc_sysfs.c
    ipoib: correcly show a VF hardware address
    vhost_net: disable zerocopy by default
    perf evsel: Make perf_evsel__name() accept a NULL argument
  * xfrm: fix sa selector validation
      net/xfrm/xfrm_user.c
  * blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration
      fs/fs-writeback.c
  * rcu: Force inlining of rcu_read_lock()
      include/linux/rcupdate.h
  * bpf: silence warning messages in core
      kernel/bpf/Makefile
  * regmap: fix bulk writes on paged registers
      drivers/base/regmap/regmap.c
    gpio: omap: ensure irq is enabled before wakeup
    gpio: omap: fix lack of irqstatus_raw0 for OMAP4
    perf test 6: Fix missing kvm module load for s390
    perf cs-etm: Properly set the value of 'old' and 'head' in snapshot mode
    s390/qdio: handle PENDING state for QEBSM devices
    net: axienet: Fix race condition causing TX hang
    net: fec: Do not use netdev messages too early
    cpupower : frequency-set -r option misses the last cpu in related cpu list
    media: wl128x: Fix some error handling in fm_v4l2_init_video_device()
    locking/lockdep: Fix merging of hlocks with non-zero references
    tua6100: Avoid build warnings.
    crypto: talitos - Align SEC1 accesses to 32 bits boundaries.
    crypto: talitos - properly handle split ICV.
  * net: phy: Check against net_device being NULL
      drivers/net/phy/phy_device.c
    media: staging: media: davinci_vpfe: - Fix for memory leak if decoder initialization fails.
  * media: mc-device.c: don't memset __user pointer contents
      drivers/media/media-device.c
  * xfrm: Fix xfrm sel prefix length validation
      net/xfrm/xfrm_user.c
  * af_key: fix leaks in key_pol_get_resp and dump_sp.
      net/key/af_key.c
    signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig
    net: stmmac: dwmac4/5: Clear unused address entries
    net: stmmac: dwmac1000: Clear unused address entries
  * media: media_device_enum_links32: clean a reserved field
      drivers/media/media-device.c
    media: vpss: fix a potential NULL pointer dereference
    media: marvell-ccic: fix DMA s/g desc number calculation
    crypto: talitos - fix skcipher failure due to wrong output IV
    media: dvb: usb: fix use after free in dvb_usb_device_exit
    batman-adv: fix for leaked TVLV handler.
    ath: DFS JP domain W56 fixed pulse type 3 RADAR detection
    ath6kl: add some bounds checking
    ath9k: Check for errors when reading SREV register
    ath10k: Do not send probe response template for mesh
    dmaengine: imx-sdma: fix use-after-free on probe error path
  * arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly
      arch/arm64/kernel/image.h
    MIPS: fix build on non-linux hosts
    MIPS: ath79: fix ar933x uart parity mode
    ANDROID: enable CONFIG_RTC_DRV_TEST on cuttlefish
  * ANDROID: xfrm: remove in_compat_syscall() checks
      net/xfrm/xfrm_state.c
      net/xfrm/xfrm_user.c
  * UPSTREAM: binder: Set end of SG buffer area properly.
      drivers/android/binder.c
    Merge 4.9.186 into android-4.9-q
Linux 4.9.186
    s390/qdio: don't touch the dsci in tiqdio_add_input_queues()
    s390/qdio: (re-)initialize tiqdio list entries
    s390: fix stfle zero padding
    ARC: hide unused function unw_hdr_alloc
  * dm verity: use message limit for data block corruption message
      drivers/md/dm-verity-target.c
    ARM: dts: imx6ul: fix PWM[1-4] interrupts
    sis900: fix TX completion
  * ppp: mppe: Add softdep to arc4
      drivers/net/ppp/ppp_mppe.c
    be2net: fix link failure after ethtool offline test
    ARM: omap2: remove incorrect __init annotation
  * perf/core: Fix perf_sample_regs_user() mm check
      kernel/events/core.c
    arm64: crypto: remove accidentally backported files
    nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header
    e1000e: start network tx queue only when link is up
    Revert "e1000e: fix cyclic resets at link up with active tx"
    MIPS: Remove superfluous check for __linux__
    VMCI: Fix integer overflow in VMCI handle arrays
    carl9170: fix misuse of device driver API
    staging: comedi: amplc_pci230: fix null pointer deref on interrupt
    staging: comedi: dt282x: fix a null pointer deref on interrupt
    usb: renesas_usbhs: add a workaround for a race condition of workqueue
  * usb: gadget: ether: Fix race between gether_disconnect and rx_submit
      drivers/usb/gadget/function/u_ether.c
    p54usb: Fix race between disconnect and firmware loading
    Revert "serial: 8250: Don't service RX FIFO if interrupts are disabled"
    USB: serial: option: add support for GosunCn ME3630 RNDIS mode
    USB: serial: ftdi_sio: add ID for isodebug v1
    mwifiex: Don't abort on small, spec-compliant vendor IEs
  * fscrypt: don't set policy for a dead directory
      fs/crypto/policy.c
    mwifiex: Fix heap overflow in mwifiex_uap_parse_tail_ies()
    mwifiex: Abort at too short BSS descriptor element
    x86/tls: Fix possible spectre-v1 in do_get_thread_area()
    x86/ptrace: Fix possible spectre-v1 in ptrace_get_debugreg()
    udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
    net :sunrpc :clnt :Fix xps refcount imbalance on the error path
  * ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL
      include/net/ip6_tunnel.h
    bnx2x: Check if transceiver implements DDM before access
    md: fix for divide error in status_resync
    mac80211: only warn once on chanctx_conf being NULL
    ARM: davinci: da8xx: specify dma_coherent_mask for lcdc
    ARM: davinci: da850-evm: call regulator_has_full_constraints()
    mlxsw: spectrum: Disallow prio-tagged packets when PVID is removed
    KVM: arm/arm64: vgic: Fix kvm_device leak in vgic_its_destroy
    Input: imx_keypad - make sure keyboard can always wake up system
  * can: mcp251x: add support for mcp25625
      drivers/net/can/spi/Kconfig
    dt-bindings: can: mcp251x: add mcp25625 support
  * netfilter: ipv6: nf_defrag: accept duplicate fragments again
      net/ipv6/netfilter/nf_conntrack_reasm.c
  * netfilter: ipv6: nf_defrag: fix leakage of unqueued fragments
      net/ipv6/netfilter/nf_conntrack_reasm.c
    mwifiex: Fix possible buffer overflows at parsing bss descriptor
    mac80211: free peer keys before vif down in mesh
    mac80211: mesh: fix RCU warning
    staging:iio:ad7150: fix threshold mode config bit
    samples, bpf: fix to change the buffer size for read()
    Input: elantech - enable middle button support on 2 ThinkPads
    crypto: talitos - rename alternative AEAD algos.

Change-Id: Ic17f4ff767e98db1ddee5f127d7de4a4c314e026
Signed-off-by: Robin Peng <robinpeng@google.com>
2019-10-01 15:25:52 +08:00

400 lines
9.5 KiB
C

/*
* kernel/time/timer_list.c
*
* List pending timers
*
* Copyright(C) 2006, Red Hat, Inc., Ingo Molnar
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/proc_fs.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/seq_file.h>
#include <linux/kallsyms.h>
#include <linux/nmi.h>
#include <asm/uaccess.h>
#include "tick-internal.h"
struct timer_list_iter {
int cpu;
bool second_pass;
u64 now;
};
typedef void (*print_fn_t)(struct seq_file *m, unsigned int *classes);
/*
* This allows printing both to /proc/timer_list and
* to the console (on SysRq-Q):
*/
__printf(2, 3)
static void SEQ_printf(struct seq_file *m, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
if (m)
seq_vprintf(m, fmt, args);
else
vprintk(fmt, args);
va_end(args);
}
static void print_name_offset(struct seq_file *m, void *sym)
{
char symname[KSYM_NAME_LEN];
if (lookup_symbol_name((unsigned long)sym, symname) < 0)
SEQ_printf(m, "<%pK>", sym);
else
SEQ_printf(m, "%s", symname);
}
static void
print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer,
int idx, u64 now)
{
SEQ_printf(m, " #%d: ", idx);
print_name_offset(m, taddr);
SEQ_printf(m, ", ");
print_name_offset(m, timer->function);
SEQ_printf(m, ", S:%02x", timer->state);
SEQ_printf(m, "\n");
SEQ_printf(m, " # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n",
(unsigned long long)ktime_to_ns(hrtimer_get_softexpires(timer)),
(unsigned long long)ktime_to_ns(hrtimer_get_expires(timer)),
(long long)(ktime_to_ns(hrtimer_get_softexpires(timer)) - now),
(long long)(ktime_to_ns(hrtimer_get_expires(timer)) - now));
}
static void
print_active_timers(struct seq_file *m, struct hrtimer_clock_base *base,
u64 now)
{
struct hrtimer *timer, tmp;
unsigned long next = 0, i;
struct timerqueue_node *curr;
unsigned long flags;
next_one:
i = 0;
touch_nmi_watchdog();
raw_spin_lock_irqsave(&base->cpu_base->lock, flags);
curr = timerqueue_getnext(&base->active);
/*
* Crude but we have to do this O(N*N) thing, because
* we have to unlock the base when printing:
*/
while (curr && i < next) {
curr = timerqueue_iterate_next(curr);
i++;
}
if (curr) {
timer = container_of(curr, struct hrtimer, node);
tmp = *timer;
raw_spin_unlock_irqrestore(&base->cpu_base->lock, flags);
print_timer(m, timer, &tmp, i, now);
next++;
goto next_one;
}
raw_spin_unlock_irqrestore(&base->cpu_base->lock, flags);
}
static void
print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now)
{
SEQ_printf(m, " .base: %pK\n", base);
SEQ_printf(m, " .index: %d\n", base->index);
SEQ_printf(m, " .resolution: %u nsecs\n", (unsigned) hrtimer_resolution);
SEQ_printf(m, " .get_time: ");
print_name_offset(m, base->get_time);
SEQ_printf(m, "\n");
#ifdef CONFIG_HIGH_RES_TIMERS
SEQ_printf(m, " .offset: %Lu nsecs\n",
(unsigned long long) ktime_to_ns(base->offset));
#endif
SEQ_printf(m, "active timers:\n");
print_active_timers(m, base, now + ktime_to_ns(base->offset));
}
static void print_cpu(struct seq_file *m, int cpu, u64 now)
{
struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
int i;
SEQ_printf(m, "cpu: %d\n", cpu);
for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
SEQ_printf(m, " clock %d:\n", i);
print_base(m, cpu_base->clock_base + i, now);
}
#define P(x) \
SEQ_printf(m, " .%-15s: %Lu\n", #x, \
(unsigned long long)(cpu_base->x))
#define P_ns(x) \
SEQ_printf(m, " .%-15s: %Lu nsecs\n", #x, \
(unsigned long long)(ktime_to_ns(cpu_base->x)))
#ifdef CONFIG_HIGH_RES_TIMERS
P_ns(expires_next);
P(hres_active);
P(nr_events);
P(nr_retries);
P(nr_hangs);
P(max_hang_time);
#endif
#undef P
#undef P_ns
#ifdef CONFIG_TICK_ONESHOT
# define P(x) \
SEQ_printf(m, " .%-15s: %Lu\n", #x, \
(unsigned long long)(ts->x))
# define P_ns(x) \
SEQ_printf(m, " .%-15s: %Lu nsecs\n", #x, \
(unsigned long long)(ktime_to_ns(ts->x)))
{
struct tick_sched *ts = tick_get_tick_sched(cpu);
P(nohz_mode);
P_ns(last_tick);
P(tick_stopped);
P(idle_jiffies);
P(idle_calls);
P(idle_sleeps);
P_ns(idle_entrytime);
P_ns(idle_waketime);
P_ns(idle_exittime);
P_ns(idle_sleeptime);
P_ns(iowait_sleeptime);
P(last_jiffies);
P(next_timer);
P_ns(idle_expires);
SEQ_printf(m, "jiffies: %Lu\n",
(unsigned long long)jiffies);
}
#endif
#undef P
#undef P_ns
SEQ_printf(m, "\n");
}
#ifdef CONFIG_GENERIC_CLOCKEVENTS
static void
print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
{
struct clock_event_device *dev = td->evtdev;
touch_nmi_watchdog();
SEQ_printf(m, "Tick Device: mode: %d\n", td->mode);
if (cpu < 0)
SEQ_printf(m, "Broadcast device\n");
else
SEQ_printf(m, "Per CPU device: %d\n", cpu);
SEQ_printf(m, "Clock Event Device: ");
if (!dev) {
SEQ_printf(m, "<NULL>\n");
return;
}
SEQ_printf(m, "%s\n", dev->name);
SEQ_printf(m, " max_delta_ns: %llu\n",
(unsigned long long) dev->max_delta_ns);
SEQ_printf(m, " min_delta_ns: %llu\n",
(unsigned long long) dev->min_delta_ns);
SEQ_printf(m, " mult: %u\n", dev->mult);
SEQ_printf(m, " shift: %u\n", dev->shift);
SEQ_printf(m, " mode: %d\n", clockevent_get_state(dev));
SEQ_printf(m, " next_event: %Ld nsecs\n",
(unsigned long long) ktime_to_ns(dev->next_event));
SEQ_printf(m, " set_next_event: ");
print_name_offset(m, dev->set_next_event);
SEQ_printf(m, "\n");
if (dev->set_state_shutdown) {
SEQ_printf(m, " shutdown: ");
print_name_offset(m, dev->set_state_shutdown);
SEQ_printf(m, "\n");
}
if (dev->set_state_periodic) {
SEQ_printf(m, " periodic: ");
print_name_offset(m, dev->set_state_periodic);
SEQ_printf(m, "\n");
}
if (dev->set_state_oneshot) {
SEQ_printf(m, " oneshot: ");
print_name_offset(m, dev->set_state_oneshot);
SEQ_printf(m, "\n");
}
if (dev->set_state_oneshot_stopped) {
SEQ_printf(m, " oneshot stopped: ");
print_name_offset(m, dev->set_state_oneshot_stopped);
SEQ_printf(m, "\n");
}
if (dev->tick_resume) {
SEQ_printf(m, " resume: ");
print_name_offset(m, dev->tick_resume);
SEQ_printf(m, "\n");
}
SEQ_printf(m, " event_handler: ");
print_name_offset(m, dev->event_handler);
SEQ_printf(m, "\n");
SEQ_printf(m, " retries: %lu\n", dev->retries);
SEQ_printf(m, "\n");
}
static void timer_list_show_tickdevices_header(struct seq_file *m)
{
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
print_tickdevice(m, tick_get_broadcast_device(), -1);
SEQ_printf(m, "tick_broadcast_mask: %*pb\n",
cpumask_pr_args(tick_get_broadcast_mask()));
#ifdef CONFIG_TICK_ONESHOT
SEQ_printf(m, "tick_broadcast_oneshot_mask: %*pb\n",
cpumask_pr_args(tick_get_broadcast_oneshot_mask()));
#endif
SEQ_printf(m, "\n");
#endif
}
#endif
static inline void timer_list_header(struct seq_file *m, u64 now)
{
SEQ_printf(m, "Timer List Version: v0.8\n");
SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
SEQ_printf(m, "\n");
}
void sysrq_timer_list_show(void)
{
u64 now = ktime_to_ns(ktime_get());
int cpu;
timer_list_header(NULL, now);
for_each_online_cpu(cpu)
print_cpu(NULL, cpu, now);
#ifdef CONFIG_GENERIC_CLOCKEVENTS
timer_list_show_tickdevices_header(NULL);
for_each_online_cpu(cpu)
print_tickdevice(NULL, tick_get_device(cpu), cpu);
#endif
return;
}
#ifdef CONFIG_PROC_FS
static int timer_list_show(struct seq_file *m, void *v)
{
struct timer_list_iter *iter = v;
if (iter->cpu == -1 && !iter->second_pass)
timer_list_header(m, iter->now);
else if (!iter->second_pass)
print_cpu(m, iter->cpu, iter->now);
#ifdef CONFIG_GENERIC_CLOCKEVENTS
else if (iter->cpu == -1 && iter->second_pass)
timer_list_show_tickdevices_header(m);
else
print_tickdevice(m, tick_get_device(iter->cpu), iter->cpu);
#endif
return 0;
}
static void *move_iter(struct timer_list_iter *iter, loff_t offset)
{
for (; offset; offset--) {
iter->cpu = cpumask_next(iter->cpu, cpu_online_mask);
if (iter->cpu >= nr_cpu_ids) {
#ifdef CONFIG_GENERIC_CLOCKEVENTS
if (!iter->second_pass) {
iter->cpu = -1;
iter->second_pass = true;
} else
return NULL;
#else
return NULL;
#endif
}
}
return iter;
}
static void *timer_list_start(struct seq_file *file, loff_t *offset)
{
struct timer_list_iter *iter = file->private;
if (!*offset)
iter->now = ktime_to_ns(ktime_get());
iter->cpu = -1;
iter->second_pass = false;
return move_iter(iter, *offset);
}
static void *timer_list_next(struct seq_file *file, void *v, loff_t *offset)
{
struct timer_list_iter *iter = file->private;
++*offset;
return move_iter(iter, 1);
}
static void timer_list_stop(struct seq_file *seq, void *v)
{
}
static const struct seq_operations timer_list_sops = {
.start = timer_list_start,
.next = timer_list_next,
.stop = timer_list_stop,
.show = timer_list_show,
};
static int timer_list_open(struct inode *inode, struct file *filp)
{
return seq_open_private(filp, &timer_list_sops,
sizeof(struct timer_list_iter));
}
static const struct file_operations timer_list_fops = {
.open = timer_list_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_private,
};
static int __init init_timer_list_procfs(void)
{
struct proc_dir_entry *pe;
pe = proc_create("timer_list", 0400, NULL, &timer_list_fops);
if (!pe)
return -ENOMEM;
return 0;
}
__initcall(init_timer_list_procfs);
#endif