android_kernel_xiaomi_sm8350/drivers/base/power/wakeup.c
Srinivasarao Pathipati f01f08906a Merge android11-5.4.180+ (598165f) into msm-5.4
* refs/heads/tmp-598165f:
  Revert "arm: extend pfn_valid to take into account freed memory map alignment"
  UPSTREAM: usb: gadget: clear related members when goto fail
  UPSTREAM: usb: gadget: don't release an existing dev->buf
  UPSTREAM: usb: gadget: Fix use-after-free bug by not setting udc->dev.driver
  UPSTREAM: usb: gadget: rndis: prevent integer overflow in rndis_set_response()
  UPSTREAM: fixup for "arm64 entry: Add macro for reading symbol address from the trampoline"
  UPSTREAM: arm64: Use the clearbhb instruction in mitigations
  UPSTREAM: KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated
  UPSTREAM: arm64: Mitigate spectre style branch history side channels
  UPSTREAM: KVM: arm64: Add templates for BHB mitigation sequences
  UPSTREAM: arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2
  UPSTREAM: arm64: Add percpu vectors for EL1
  UPSTREAM: arm64: entry: Add macro for reading symbol addresses from the trampoline
  UPSTREAM: arm64: entry: Add vectors that have the bhb mitigation sequences
  UPSTREAM: arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations
  UPSTREAM: arm64: entry: Allow the trampoline text to occupy multiple pages
  UPSTREAM: arm64: entry: Make the kpti trampoline's kpti sequence optional
  UPSTREAM: arm64: entry: Move trampoline macros out of ifdef'd section
  UPSTREAM: arm64: entry: Don't assume tramp_vectors is the start of the vectors
  UPSTREAM: arm64: entry: Allow tramp_alias to access symbols after the 4K boundary
  UPSTREAM: arm64: entry: Move the trampoline data page before the text page
  UPSTREAM: arm64: entry: Free up another register on kpti's tramp_exit path
  UPSTREAM: arm64: entry: Make the trampoline cleanup optional
  UPSTREAM: arm64: entry.S: Add ventry overflow sanity checks
  UPSTREAM: arm64: Add Cortex-X2 CPU part definition
  UPSTREAM: arm64: add ID_AA64ISAR2_EL1 sys register
  UPSTREAM: arm64: Add Neoverse-N2, Cortex-A710 CPU part definition
  UPSTREAM: arm64: Add part number for Arm Cortex-A77
  UPSTREAM: sctp: fix the processing for INIT chunk
  ANDROID: dm-bow: Protect Ranges fetched and erased from the RB tree
  UPSTREAM: ARM: fix Thumb2 regression with Spectre BHB
  UPSTREAM: ARM: Spectre-BHB: provide empty stub for non-config
  UPSTREAM: ARM: fix build warning in proc-v7-bugs.c
  UPSTREAM: ARM: Do not use NOCROSSREFS directive with ld.lld
  UPSTREAM: ARM: fix co-processor register typo
  UPSTREAM: ARM: fix build error when BPF_SYSCALL is disabled
  UPSTREAM: ARM: include unprivileged BPF status in Spectre V2 reporting
  UPSTREAM: ARM: Spectre-BHB workaround
  UPSTREAM: ARM: use LOADADDR() to get load address of sections
  UPSTREAM: ARM: early traps initialisation
  UPSTREAM: ARM: report Spectre v2 status through sysfs
  UPSTREAM: arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
  UPSTREAM: arm/arm64: Provide a wrapper for SMCCC 1.1 calls
  UPSTREAM: x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT
  UPSTREAM: x86/speculation: Warn about Spectre v2 LFENCE mitigation
  UPSTREAM: x86/speculation: Update link to AMD speculation whitepaper
  UPSTREAM: x86/speculation: Use generic retpoline by default on AMD
  UPSTREAM: x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
  UPSTREAM: Documentation/hw-vuln: Update spectre doc
  UPSTREAM: x86/speculation: Add eIBRS + Retpoline options
  UPSTREAM: x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE
  UPSTREAM: x86,bugs: Unconditionally allow spectre_v2=retpoline,amd
  UPSTREAM: x86/speculation: Merge one test in spectre_v2_user_select_mitigation()
  UPSTREAM: bpf: Add kconfig knob for disabling unpriv bpf by default
  UPSTREAM: mmc: block: fix read single on recovery logic
  Linux 5.4.180
  ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE
  perf: Fix list corruption in perf_cgroup_switch()
  scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled
  hwmon: (dell-smm) Speed up setting of fan speed
  seccomp: Invalidate seccomp mode to catch death failures
  USB: serial: cp210x: add CPI Bulk Coin Recycler id
  USB: serial: cp210x: add NCR Retail IO box id
  USB: serial: ch341: add support for GW Instek USB2.0-Serial devices
  USB: serial: option: add ZTE MF286D modem
  USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320
  usb: gadget: f_uac2: Define specific wTerminalType
  usb: gadget: rndis: check size of RNDIS_MSG_SET command
  USB: gadget: validate interface OS descriptor requests
  usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition
  usb: dwc3: gadget: Prevent core from processing stale TRBs
  usb: ulpi: Call of_node_put correctly
  usb: ulpi: Move of_node_put to ulpi_dev_release
  net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup
  eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX
  n_tty: wake up poll(POLLRDNORM) on receiving data
  vt_ioctl: add array_index_nospec to VT_ACTIVATE
  vt_ioctl: fix array_index_nospec in vt_setactivate
  net: amd-xgbe: disable interrupts during pci removal
  tipc: rate limit warning for received illegal binding update
  net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE
  veth: fix races around rq->rx_notify_masked
  net: fix a memleak when uncloning an skb dst and its metadata
  net: do not keep the dst cache when uncloning an skb dst and its metadata
  nfp: flower: fix ida_idx not being released
  ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path
  bonding: pair enable_port with slave_arr_updates
  ixgbevf: Require large buffers for build_skb on 82599VF
  misc: fastrpc: avoid double fput() on failed usercopy
  usb: f_fs: Fix use-after-free for epfile
  ARM: dts: imx6qdl-udoo: Properly describe the SD card detect
  staging: fbtft: Fix error path in fbtft_driver_module_init()
  ARM: dts: meson: Fix the UART compatible strings
  perf probe: Fix ppc64 'perf probe add events failed' case
  net: bridge: fix stale eth hdr pointer in br_dev_xmit
  PM: s2idle: ACPI: Fix wakeup interrupts handling
  ACPI/IORT: Check node revision for PMCG resources
  nvme-tcp: fix bogus request completion when failing to send AER
  ARM: socfpga: fix missing RESET_CONTROLLER
  ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group
  riscv: fix build with binutils 2.38
  bpf: Add kconfig knob for disabling unpriv bpf by default
  KVM: nVMX: eVMCS: Filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER
  net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout()
  usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend
  PM: hibernate: Remove register_nosave_region_late()
  scsi: myrs: Fix crash in error case
  scsi: qedf: Fix refcount issue when LOGO is received during TMF
  scsi: target: iscsi: Make sure the np under each tpg is unique
  net: sched: Clarify error message when qdisc kind is unknown
  drm: panel-orientation-quirks: Add quirk for the 1Netbook OneXPlayer
  NFSv4 expose nfs_parse_server_name function
  NFSv4 remove zero number of fs_locations entries error check
  NFSv4.1: Fix uninitialised variable in devicenotify
  nfs: nfs4clinet: check the return value of kstrdup()
  NFSv4 only print the label when its queried
  nvme: Fix parsing of ANA log page
  NFSD: Fix offset type in I/O trace points
  NFSD: Clamp WRITE offsets
  NFS: Fix initialisation of nfs_client cl_flags field
  net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
  net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs
  mmc: sdhci-of-esdhc: Check for error num after setting mask
  ima: Do not print policy rule with inactive LSM labels
  ima: Allow template selection with ima_template[_fmt]= after ima_hash=
  ima: Remove ima_policy file before directory
  integrity: check the return value of audit_log_start()
  Linux 5.4.179
  tipc: improve size validations for received domain records
  moxart: fix potential use-after-free on remove path
  Linux 5.4.178
  cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning
  ext4: fix error handling in ext4_restore_inline_data()
  EDAC/xgene: Fix deferred probing
  EDAC/altera: Fix deferred probing
  rtc: cmos: Evaluate century appropriate
  selftests: futex: Use variable MAKE instead of make
  nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client.
  scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe
  pinctrl: bcm2835: Fix a few error paths
  ASoC: max9759: fix underflow in speaker_gain_control_put()
  ASoC: cpcap: Check for NULL pointer after calling of_get_child_by_name
  ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes
  ASoC: fsl: Add missing error handling in pcm030_fabric_probe
  drm/i915/overlay: Prevent divide by zero bugs in scaling
  net: stmmac: ensure PTP time register reads are consistent
  net: stmmac: dump gmac4 DMA registers correctly
  net: macsec: Verify that send_sci is on when setting Tx sci explicitly
  net: ieee802154: Return meaningful error codes from the netlink helpers
  net: ieee802154: ca8210: Stop leaking skb's
  net: ieee802154: mcr20a: Fix lifs/sifs periods
  net: ieee802154: hwsim: Ensure proper channel selection at probe time
  spi: meson-spicc: add IRQ check in meson_spicc_probe
  spi: mediatek: Avoid NULL pointer crash in interrupt
  spi: bcm-qspi: check for valid cs before applying chip select
  iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()
  iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()
  RDMA/mlx4: Don't continue event handler after memory allocation failure
  RDMA/siw: Fix broken RDMA Read Fence/Resume logic.
  IB/rdmavt: Validate remote_addr during loopback atomic tests
  memcg: charge fs_context and legacy_fs_context
  Revert "ASoC: mediatek: Check for error clk pointer"
  block: bio-integrity: Advance seed correctly for larger interval sizes
  mm/kmemleak: avoid scanning potential huge holes
  drm/nouveau: fix off by one in BIOS boundary checking
  btrfs: fix deadlock between quota disable and qgroup rescan worker
  ALSA: hda/realtek: Fix silent output on Gigabyte X570 Aorus Xtreme after reboot from Windows
  ALSA: hda/realtek: Fix silent output on Gigabyte X570S Aorus Master (newer chipset)
  ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks
  ALSA: hda/realtek: Add quirk for ASUS GU603
  ALSA: usb-audio: Simplify quirk entries with a macro
  ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx()
  ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()
  ASoC: ops: Reject out of bounds values in snd_soc_put_volsw()
  audit: improve audit queue handling when "audit=1" on cmdline
  Revert "net: fix information leakage in /proc/net/ptype"
  Linux 5.4.177
  af_packet: fix data-race in packet_setsockopt / packet_setsockopt
  cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
  rtnetlink: make sure to refresh master_dev/m_ops in __rtnl_newlink()
  net: sched: fix use-after-free in tc_new_tfilter()
  net: amd-xgbe: Fix skb data length underflow
  net: amd-xgbe: ensure to reset the tx_timer_active flag
  ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback
  cgroup-v1: Require capabilities to set release_agent
  psi: Fix uaf issue when psi trigger is destroyed while being polled
  PCI: pciehp: Fix infinite loop in IRQ handler upon power fault
  Linux 5.4.176
  mtd: rawnand: mpc5121: Remove unused variable in ads5121_select_chip()
  block: Fix wrong offset in bio_truncate()
  fsnotify: invalidate dcache before IN_DELETE event
  dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config
  ipv4: remove sparse error in ip_neigh_gw4()
  ipv4: tcp: send zero IPID in SYNACK messages
  ipv4: raw: lock the socket in raw_bind()
  net: hns3: handle empty unknown interrupt for VF
  yam: fix a memory leak in yam_siocdevprivate()
  drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
  ibmvnic: don't spin in tasklet
  ibmvnic: init ->running_cap_crqs early
  hwmon: (lm90) Mark alert as broken for MAX6654
  rxrpc: Adjust retransmission backoff
  phylib: fix potential use-after-free
  net: phy: broadcom: hook up soft_reset for BCM54616S
  netfilter: conntrack: don't increment invalid counter on NF_REPEAT
  NFS: Ensure the server has an up to date ctime before renaming
  NFS: Ensure the server has an up to date ctime before hardlinking
  ipv6: annotate accesses to fn->fn_sernum
  drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable
  drm/msm/dsi: Fix missing put_device() call in dsi_get_phy
  drm/msm: Fix wrong size calculation
  net-procfs: show net devices bound packet types
  NFSv4: nfs_atomic_open() can race when looking up a non-regular file
  NFSv4: Handle case where the lookup of a directory fails
  hwmon: (lm90) Reduce maximum conversion rate for G781
  ipv4: avoid using shared IP generator for connected sockets
  ping: fix the sk_bound_dev_if match in ping_lookup
  hwmon: (lm90) Mark alert as broken for MAX6680
  hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649
  net: fix information leakage in /proc/net/ptype
  ipv6_tunnel: Rate limit warning messages
  scsi: bnx2fc: Flush destroy_work queue before calling bnx2fc_interface_put()
  rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev
  rpmsg: char: Fix race between the release of rpmsg_ctrldev and cdev
  i40e: fix unsigned stat widths
  i40e: Fix queues reservation for XDP
  i40e: Fix issue when maximum queues is exceeded
  i40e: Increase delay to 1 s after global EMP reset
  powerpc/32: Fix boot failure with GCC latent entropy plugin
  net: sfp: ignore disabled SFP node
  ucsi_ccg: Check DEV_INT bit only when starting CCG4
  usb: typec: tcpm: Do not disconnect while receiving VBUS off
  USB: core: Fix hang in usb_kill_urb by adding memory barriers
  usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS
  usb: common: ulpi: Fix crash in ulpi_match()
  usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge
  tty: Add support for Brainboxes UC cards.
  tty: n_gsm: fix SW flow control encoding/handling
  serial: stm32: fix software flow control transfer
  serial: 8250: of: Fix mapped region size when using reg-offset property
  netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
  arm64: errata: Fix exec handling in erratum 1418040 workaround
  drm/etnaviv: relax submit size limits
  fsnotify: fix fsnotify hooks in pseudo filesystems
  tracing: Don't inc err_log entry count if entry allocation fails
  tracing/histogram: Fix a potential memory leak for kstrdup()
  PM: wakeup: simplify the output logic of pm_show_wakelocks()
  udf: Fix NULL ptr deref when converting from inline format
  udf: Restore i_lenAlloc when inode expansion fails
  scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices
  s390/hypfs: include z/VM guests with access control group set
  Bluetooth: refactor malicious adv data check
  ANDROID: Fix CRC issue up with xfrm headers in 5.4.174
  Linux 5.4.175
  drm/vmwgfx: Fix stale file descriptors on failed usercopy
  select: Fix indefinitely sleeping task in poll_schedule_timeout()
  mmc: sdhci-esdhc-imx: disable CMDQ support
  ARM: dts: gpio-ranges property is now required
  pinctrl: bcm2835: Change init order for gpio hogs
  pinctrl: bcm2835: Add support for wake-up interrupts
  pinctrl: bcm2835: Match BCM7211 compatible string
  pinctrl: bcm2835: Add support for all GPIOs on BCM2711
  pinctrl: bcm2835: Refactor platform data
  pinctrl: bcm2835: Drop unused define
  rcu: Tighten rcu_advance_cbs_nowake() checks
  drm/i915: Flush TLBs before releasing backing store
  Linux 5.4.174
  Revert "ia64: kprobes: Use generic kretprobe trampoline handler"
  mtd: nand: bbt: Fix corner case in bad block table handling
  lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test
  lib82596: Fix IRQ check in sni_82596_probe
  scripts/dtc: dtx_diff: remove broken example from help text
  dt-bindings: display: meson-vpu: Add missing amlogic,canvas property
  dt-bindings: display: meson-dw-hdmi: add missing sound-name-prefix property
  net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
  bcmgenet: add WOL IRQ check
  net_sched: restore "mpu xxx" handling
  arm64: dts: qcom: msm8996: drop not documented adreno properties
  dmaengine: at_xdmac: Fix at_xdmac_lld struct definition
  dmaengine: at_xdmac: Fix lld view setting
  dmaengine: at_xdmac: Fix concurrency over xfers_list
  dmaengine: at_xdmac: Print debug message after realeasing the lock
  dmaengine: at_xdmac: Don't start transactions at tx_submit level
  perf script: Fix hex dump character output
  libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route()
  gre: Don't accidentally set RTO_ONLINK in gre_fill_metadata_dst()
  xfrm: Don't accidentally set RTO_ONLINK in decode_session4()
  netns: add schedule point in ops_exit_list()
  inet: frags: annotate races around fqdir->dead and fqdir->high_thresh
  rtc: pxa: fix null pointer dereference
  net: axienet: increase default TX ring size to 128
  net: axienet: fix number of TX ring slots for available check
  net: axienet: limit minimum TX ring size
  clk: si5341: Fix clock HW provider cleanup
  af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress
  f2fs: fix to reserve space for IO align feature
  parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries
  net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
  ipv4: avoid quadratic behavior in netns dismantle
  bpftool: Remove inclusion of utilities.mak from Makefiles
  powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
  powerpc/cell: Fix clang -Wimplicit-fallthrough warning
  Revert "net/mlx5: Add retry mechanism to the command entry index allocation"
  dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK
  RDMA/rxe: Fix a typo in opcode name
  RDMA/hns: Modify the mapping attribute of doorbell to device
  scsi: core: Show SCMD_LAST in text form
  Documentation: fix firewire.rst ABI file path error
  Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization
  Documentation: ACPI: Fix data node reference documentation
  Documentation: dmaengine: Correctly describe dmatest with channel unset
  media: rcar-csi2: Optimize the selection PHTW register
  firmware: Update Kconfig help text for Google firmware
  of: base: Improve argument length mismatch error
  drm/radeon: fix error handling in radeon_driver_open_kms
  ext4: don't use the orphan list when migrating an inode
  ext4: Fix BUG_ON in ext4_bread when write quota data
  ext4: set csum seed in tmp inode while migrating to extents
  ext4: make sure quota gets properly shutdown on error
  ext4: make sure to reset inode lockdep class when quota enabling fails
  btrfs: respect the max size in the header when activating swap file
  btrfs: check the root node for uptodate before returning it
  btrfs: fix deadlock between quota enable and other quota operations
  xfrm: fix policy lookup for ipv6 gre packets
  PCI: pci-bridge-emul: Set PCI_STATUS_CAP_LIST for PCIe device
  PCI: pci-bridge-emul: Correctly set PCIe capabilities
  PCI: pci-bridge-emul: Properly mark reserved PCIe bits in PCI config space
  drm/bridge: analogix_dp: Make PSR-exit block less
  drm/nouveau/kms/nv04: use vzalloc for nv04_display
  drm/etnaviv: limit submit sizes
  s390/mm: fix 2KB pgtable release race
  iwlwifi: mvm: Increase the scan timeout guard to 30 seconds
  tracing/kprobes: 'nmissed' not showed correctly for kretprobe
  cputime, cpuacct: Include guest time in user time in cpuacct.stat
  serial: Fix incorrect rs485 polarity on uart open
  fuse: Pass correct lend value to filemap_write_and_wait_range()
  ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers
  crypto: caam - replace this_cpu_ptr with raw_cpu_ptr
  crypto: stm32/crc32 - Fix kernel BUG triggered in probe()
  crypto: omap-aes - Fix broken pm_runtime_and_get() usage
  rpmsg: core: Clean up resources on announce_create failure.
  power: bq25890: Enable continuous conversion for ADC at charging
  ASoC: mediatek: mt8173: fix device_node leak
  scsi: sr: Don't use GFP_DMA
  MIPS: Octeon: Fix build errors using clang
  i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters
  MIPS: OCTEON: add put_device() after of_find_device_by_node()
  powerpc: handle kdump appropriately with crash_kexec_post_notifiers option
  ALSA: seq: Set upper limit of processed events
  scsi: lpfc: Trigger SLI4 firmware dump before doing driver cleanup
  w1: Misuse of get_user()/put_user() reported by sparse
  KVM: PPC: Book3S: Suppress failed alloc warning in H_COPY_TOFROM_GUEST
  powerpc/powermac: Add missing lockdep_register_key()
  clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB
  i2c: mpc: Correct I2C reset procedure
  powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
  i2c: i801: Don't silently correct invalid transfer size
  powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
  powerpc/btext: add missing of_node_put
  powerpc/cell: add missing of_node_put
  powerpc/powernv: add missing of_node_put
  powerpc/6xx: add missing of_node_put
  parisc: Avoid calling faulthandler_disabled() twice
  random: do not throw away excess input to crng_fast_load
  serial: core: Keep mctrl register state and cached copy in sync
  serial: pl010: Drop CR register reset on set_termios
  regulator: qcom_smd: Align probe function with rpmh-regulator
  net: gemini: allow any RGMII interface mode
  net: phy: marvell: configure RGMII delays for 88E1118
  dm space map common: add bounds check to sm_ll_lookup_bitmap()
  dm btree: add a defensive bounds check to insert_at()
  mac80211: allow non-standard VHT MCS-10/11
  net: mdio: Demote probed message to debug print
  btrfs: remove BUG_ON(!eie) in find_parent_nodes
  btrfs: remove BUG_ON() in find_parent_nodes()
  ACPI: battery: Add the ThinkPad "Not Charging" quirk
  drm/amdgpu: fixup bad vram size on gmc v8
  ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5
  ACPICA: Fix wrong interpretation of PCC address
  ACPICA: Executer: Fix the REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R()
  ACPICA: Utilities: Avoid deleting the same object twice in a row
  ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions
  jffs2: GC deadlock reading a page that is used in jffs2_write_begin()
  um: registers: Rename function names to avoid conflicts and build problems
  iwlwifi: mvm: Fix calculation of frame length
  iwlwifi: remove module loading failure message
  iwlwifi: fix leaks/bad data after failed firmware load
  ath9k: Fix out-of-bound memcpy in ath9k_hif_usb_rx_stream
  usb: hub: Add delay for SuperSpeed hub resume to let links transit to U0
  cpufreq: Fix initialization of min and max frequency QoS requests
  arm64: tegra: Adjust length of CCPLEX cluster MMIO region
  arm64: dts: ls1028a-qds: move rtc node to the correct i2c bus
  audit: ensure userspace is penalized the same as the kernel when under pressure
  mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO
  media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
  media: igorplugusb: receiver overflow should be reported
  HID: quirks: Allow inverting the absolute X/Y values
  bpf: Do not WARN in bpf_warn_invalid_xdp_action()
  net: bonding: debug: avoid printing debug logs when bond is not notifying peers
  x86/mce: Mark mce_read_aux() noinstr
  x86/mce: Mark mce_end() noinstr
  x86/mce: Mark mce_panic() noinstr
  gpio: aspeed: Convert aspeed_gpio.lock to raw_spinlock
  net: phy: prefer 1000baseT over 1000baseKX
  net-sysfs: update the queue counts in the unregistration path
  ath10k: Fix tx hanging
  iwlwifi: mvm: synchronize with FW after multicast commands
  media: m920x: don't use stack on USB reads
  media: saa7146: hexium_orion: Fix a NULL pointer dereference in hexium_attach()
  media: uvcvideo: Increase UVC_CTRL_CONTROL_TIMEOUT to 5 seconds.
  x86/mm: Flush global TLB when switching to trampoline page-table
  floppy: Add max size check for user space request
  usb: uhci: add aspeed ast2600 uhci support
  rsi: Fix out-of-bounds read in rsi_read_pkt()
  rsi: Fix use-after-free in rsi_rx_done_handler()
  mwifiex: Fix skb_over_panic in mwifiex_usb_recv()
  HSI: core: Fix return freed object in hsi_new_client
  gpiolib: acpi: Do not set the IRQ type if the IRQ is already in use
  drm/bridge: megachips: Ensure both bridges are probed before registration
  mlxsw: pci: Add shutdown method in PCI driver
  EDAC/synopsys: Use the quirk for version instead of ddr version
  media: b2c2: Add missing check in flexcop_pci_isr:
  HID: apple: Do not reset quirks when the Fn key is not found
  drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Book X91F/L
  usb: gadget: f_fs: Use stream_open() for endpoint files
  batman-adv: allow netlink usage in unprivileged containers
  ARM: shmobile: rcar-gen2: Add missing of_node_put()
  drm/nouveau/pmu/gm200-: avoid touching PMU outside of DEVINIT/PREOS/ACR
  ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply
  drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y
  fs: dlm: filter user dlm messages for kernel locks
  Bluetooth: Fix debugfs entry leak in hci_register_dev()
  of: base: Fix phandle argument length mismatch error message
  RDMA/cxgb4: Set queue pair state when being queried
  mips: bcm63xx: add support for clk_set_parent()
  mips: lantiq: add support for clk_set_parent()
  misc: lattice-ecp3-config: Fix task hung when firmware load failed
  ASoC: samsung: idma: Check of ioremap return value
  ASoC: mediatek: Check for error clk pointer
  phy: uniphier-usb3ss: fix unintended writing zeros to PHY register
  iommu/iova: Fix race between FQ timeout and teardown
  dmaengine: pxa/mmp: stop referencing config->slave_id
  clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
  ASoC: rt5663: Handle device_property_read_u32_array error codes
  RDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry
  RDMA/core: Let ib_find_gid() continue search even after empty entry
  powerpc/powermac: Add additional missing lockdep_register_key()
  PCI/MSI: Fix pci_irq_vector()/pci_irq_get_affinity()
  scsi: ufs: Fix race conditions related to driver data
  iommu/io-pgtable-arm: Fix table descriptor paddr formatting
  binder: fix handling of error during copy
  char/mwave: Adjust io port register size
  ALSA: oss: fix compile error when OSS_DEBUG is enabled
  ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA
  powerpc/prom_init: Fix improper check of prom_getprop()
  clk: imx8mn: Fix imx8mn_clko1_sels
  RDMA/hns: Validate the pkey index
  ALSA: hda: Add missing rwsem around snd_ctl_remove() calls
  ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls
  ALSA: jack: Add missing rwsem around snd_ctl_remove() calls
  ext4: avoid trim error on fs with small groups
  net: mcs7830: handle usb read errors properly
  pcmcia: fix setting of kthread task states
  can: xilinx_can: xcan_probe(): check for error irq
  can: softing: softing_startstop(): fix set but not used variable warning
  tpm: add request_locality before write TPM_INT_ENABLE
  spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe
  net/mlx5: Set command entry semaphore up once got index free
  Revert "net/mlx5e: Block offload of outer header csum for UDP tunnels"
  net/mlx5e: Don't block routes with nexthop objects in SW
  debugfs: lockdown: Allow reading debugfs files that are not world readable
  HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad
  HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init
  HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc
  HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init
  Bluetooth: hci_bcm: Check for error irq
  fsl/fman: Check for null pointer after calling devm_ioremap
  staging: greybus: audio: Check null pointer
  rocker: fix a sleeping in atomic bug
  ppp: ensure minimum packet size in ppp_write()
  bpf: Fix SO_RCVBUF/SO_SNDBUF handling in _bpf_setsockopt().
  netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check()
  pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region()
  pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region()
  ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes
  x86/mce/inject: Avoid out-of-bounds write when setting flags
  bpftool: Enable line buffering for stdout
  selinux: fix potential memleak in selinux_add_opt()
  mmc: meson-mx-sdio: add IRQ check
  ARM: dts: armada-38x: Add generic compatible to UART nodes
  usb: ftdi-elan: fix memory leak on device disconnect
  ARM: 9159/1: decompressor: Avoid UNPREDICTABLE NOP encoding
  xfrm: state and policy should fail if XFRMA_IF_ID 0
  xfrm: interface with if_id 0 should return error
  media: hantro: Fix probe func error path
  drm/bridge: ti-sn65dsi86: Set max register for regmap
  drm/msm/dpu: fix safe status debugfs file
  media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes
  media: msi001: fix possible null-ptr-deref in msi001_probe()
  media: dw2102: Fix use after free
  ARM: dts: gemini: NAS4220-B: fis-index-block with 128 KiB sectors
  crypto: stm32/cryp - fix lrw chaining mode
  crypto: stm32/cryp - fix double pm exit
  crypto: stm32/cryp - fix xts and race condition in crypto_engine requests
  xfrm: fix a small bug in xfrm_sa_len()
  mwifiex: Fix possible ABBA deadlock
  rcu/exp: Mark current CPU as exp-QS in IPI loop second pass
  sched/rt: Try to restart rt period timer when rt runtime exceeded
  media: si2157: Fix "warm" tuner state detection
  media: saa7146: mxb: Fix a NULL pointer dereference in mxb_attach()
  media: dib8000: Fix a memleak in dib8000_init()
  Bluetooth: btmtksdio: fix resume failure
  staging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib()
  staging: rtl8192e: return error code from rtllib_softmac_init()
  floppy: Fix hang in watchdog when disk is ejected
  serial: amba-pl011: do not request memory region twice
  tty: serial: uartlite: allow 64 bit address
  arm64: dts: ti: k3-j721e: Fix the L2 cache sets
  drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()
  drm/amdgpu: Fix a NULL pointer dereference in amdgpu_connector_lcd_native_mode()
  ACPI: EC: Rework flushing of EC work while suspended to idle
  arm64: dts: qcom: msm8916: fix MMC controller aliases
  netfilter: bridge: add support for pppoe filtering
  media: venus: core: Fix a resource leak in the error handling path of 'venus_probe()'
  media: mtk-vcodec: call v4l2_m2m_ctx_release first when file is released
  media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()
  media: imx-pxp: Initialize the spinlock prior to using it
  media: rcar-csi2: Correct the selection of hsfreqrange
  tty: serial: atmel: Call dma_async_issue_pending()
  tty: serial: atmel: Check return code of dmaengine_submit()
  arm64: dts: ti: k3-j721e: correct cache-sets info
  crypto: qce - fix uaf on qce_ahash_register_one
  media: dmxdev: fix UAF when dvb_register_device() fails
  tee: fix put order in teedev_close_context()
  Bluetooth: stop proccessing malicious adv data
  arm64: dts: meson-gxbb-wetek: fix missing GPIO binding
  arm64: dts: meson-gxbb-wetek: fix HDMI in early boot
  media: aspeed: Update signal status immediately to ensure sane hw state
  media: em28xx: fix memory leak in em28xx_init_dev
  media: aspeed: fix mode-detect always time out at 2nd run
  media: videobuf2: Fix the size printk format
  wcn36xx: Release DMA channel descriptor allocations
  wcn36xx: Indicate beacon not connection loss on MISSED_BEACON_IND
  clk: bcm-2835: Remove rounding up the dividers
  clk: bcm-2835: Pick the closest clock rate
  Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails
  drm/rockchip: dsi: Fix unbalanced clock on probe error
  drm/panel: innolux-p079zca: Delete panel on attach() failure
  drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure
  drm/rockchip: dsi: Reconfigure hardware on resume()
  drm/rockchip: dsi: Hold pm-runtime across bind/unbind
  shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode
  mm/page_alloc.c: do not warn allocation failure on zone DMA if no managed pages
  mm_zone: add function to check if managed dma zone exists
  PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller
  dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()
  iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure
  lkdtm: Fix content of section containing lkdtm_rodata_do_nothing()
  can: softing_cs: softingcs_probe(): fix memleak on registration failure
  media: stk1160: fix control-message timeouts
  media: pvrusb2: fix control-message timeouts
  media: redrat3: fix control-message timeouts
  media: dib0700: fix undefined behavior in tuner shutdown
  media: s2255: fix control-message timeouts
  media: cpia2: fix control-message timeouts
  media: em28xx: fix control-message timeouts
  media: mceusb: fix control-message timeouts
  media: flexcop-usb: fix control-message timeouts
  media: v4l2-ioctl.c: readbuffers depends on V4L2_CAP_READWRITE
  rtc: cmos: take rtc_lock while reading from CMOS
  tools/nolibc: fix incorrect truncation of exit code
  tools/nolibc: i386: fix initial stack alignment
  tools/nolibc: x86-64: Fix startup code bug
  x86/gpu: Reserve stolen memory for first integrated Intel GPU
  mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6
  mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings
  nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
  f2fs: fix to do sanity check in is_alive()
  HID: wacom: Avoid using stale array indicies to read contact count
  HID: wacom: Ignore the confidence flag when a touch is removed
  HID: wacom: Reset expected and received contact counts at the same time
  HID: uhid: Fix worker destroying device without any protection
  Linux 5.4.173
  ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN depends on !LD_IS_LLD
  mtd: fixup CFI on ixp4xx
  ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master after reboot from Windows
  KVM: x86: remove PMU FIXED_CTR3 from msrs_to_save_all
  firmware: qemu_fw_cfg: fix kobject leak in probe error path
  firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries
  firmware: qemu_fw_cfg: fix sysfs information leak
  rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
  media: uvcvideo: fix division by zero at stream start
  KVM: s390: Clarify SIGP orders versus STOP/RESTART
  perf: Protect perf_guest_cbs with RCU
  vfs: fs_context: fix up param length parsing in legacy_parse_param
  orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
  devtmpfs regression fix: reconfigure on each mount
  kbuild: Add $(KBUILD_HOSTLDFLAGS) to 'has_libelf' test
  Linux 5.4.172
  staging: greybus: fix stack size warning with UBSAN
  drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk()
  staging: wlan-ng: Avoid bitwise vs logical OR warning in hfa384x_usb_throttlefn()
  media: Revert "media: uvcvideo: Set unique vdev name based in type"
  random: fix crash on multiple early calls to add_bootloader_randomness()
  random: fix data race on crng init time
  random: fix data race on crng_node_pool
  can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
  can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data
  drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
  mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe()
  veth: Do not record rx queue hint in veth_xmit
  mmc: sdhci-pci: Add PCI ID for Intel ADL
  USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status
  USB: core: Fix bug in resuming hub's handling of wakeup requests
  Bluetooth: bfusb: fix division by zero in send path
  Bluetooth: btusb: fix memory leak in btusb_mtk_submit_wmt_recv_urb()
  workqueue: Fix unbind_workers() VS wq_worker_running() race
  UPSTREAM: x86/pci: Fix the function type for check_reserved_t
  Linux 5.4.171
  mISDN: change function names to avoid conflicts
  atlantic: Fix buff_ring OOB in aq_ring_rx_clean
  net: udp: fix alignment problem in udp4_seq_show()
  ip6_vti: initialize __ip6_tnl_parm struct in vti6_siocdevprivate
  scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown()
  usb: mtu3: fix interval value for intr and isoc
  ipv6: Do cleanup if attribute validation fails in multipath route
  ipv6: Continue processing multipath route even if gateway attribute is invalid
  phonet: refcount leak in pep_sock_accep
  rndis_host: support Hytera digital radios
  power: reset: ltc2952: Fix use of floating point literals
  power: supply: core: Break capacity loop
  xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
  net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ8081
  sch_qfq: prevent shift-out-of-bounds in qfq_init_qdisc
  batman-adv: mcast: don't send link-local multicast to mcast routers
  lwtunnel: Validate RTA_ENCAP_TYPE attribute length
  ipv6: Check attribute length for RTA_GATEWAY when deleting multipath route
  ipv6: Check attribute length for RTA_GATEWAY in multipath route
  ipv4: Check attribute length for RTA_FLOW in multipath route
  ipv4: Check attribute length for RTA_GATEWAY in multipath route
  i40e: Fix incorrect netdev's real number of RX/TX queues
  i40e: Fix for displaying message regarding NVM version
  i40e: fix use-after-free in i40e_sync_filters_subtask()
  mac80211: initialize variable have_higher_than_11mbit
  RDMA/uverbs: Check for null return of kmalloc_array
  RDMA/core: Don't infoleak GRH fields
  iavf: Fix limit of total number of queues to active queues of VF
  ieee802154: atusb: fix uninit value in atusb_set_extended_addr
  tracing: Tag trace_percpu_buffer as a percpu pointer
  tracing: Fix check for trace_percpu_buffer validity in get_trace_buf()
  selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()
  Input: touchscreen - Fix backport of a02dcde595f7cbd240ccd64de96034ad91cffc40
  f2fs: quota: fix potential deadlock
  Linux 5.4.170
  perf script: Fix CPU filtering of a script's switch events
  net: fix use-after-free in tw_timer_handler
  Input: spaceball - fix parsing of movement data packets
  Input: appletouch - initialize work before device registration
  scsi: vmw_pvscsi: Set residual data length conditionally
  binder: fix async_free_space accounting for empty parcels
  usb: mtu3: set interval of FS intr and isoc endpoint
  usb: mtu3: fix list_head check warning
  usb: mtu3: add memory barrier before set GPD's HWO
  usb: gadget: f_fs: Clear ffs_eventfd in ffs_data_clear.
  xhci: Fresco FL1100 controller should not have BROKEN_MSI quirk set.
  uapi: fix linux/nfc.h userspace compilation errors
  nfc: uapi: use kernel size_t to fix user-space builds
  i2c: validate user data in compat ioctl
  fsl/fman: Fix missing put_device() call in fman_port_probe
  net/ncsi: check for error return from call to nla_put_u32
  selftests/net: udpgso_bench_tx: fix dst ip argument
  net/mlx5e: Fix wrong features assignment in case of error
  ionic: Initialize the 'lif->dbid_inuse' bitmap
  NFC: st21nfca: Fix memory leak in device probe and remove
  net: lantiq_xrx200: fix statistics of received bytes
  net: usb: pegasus: Do not drop long Ethernet frames
  sctp: use call_rcu to free endpoint
  selftests: Calculate udpgso segment count without header adjustment
  udp: using datalen to cap ipv6 udp max gso segments
  net/mlx5: DR, Fix NULL vs IS_ERR checking in dr_domain_init_resources
  scsi: lpfc: Terminate string in lpfc_debugfs_nvmeio_trc_write()
  selinux: initialize proto variable in selinux_ip_postroute_compat()
  recordmcount.pl: fix typo in s390 mcount regex
  memblock: fix memblock_phys_alloc() section mismatch error
  platform/x86: apple-gmux: use resource_size() with res
  tomoyo: Check exceeded quota early in tomoyo_domain_quota_is_ok().
  Input: i8042 - enable deferred probe quirk for ASUS UM325UA
  Input: i8042 - add deferred probe support
  tee: handle lookup of shm with reference count 0
  HID: asus: Add depends on USB_HID to HID_ASUS Kconfig option
  Linux 5.4.169
  phonet/pep: refuse to enable an unbound pipe
  hamradio: improve the incomplete fix to avoid NPD
  hamradio: defer ax25 kfree after unregister_netdev
  ax25: NPD bug when detaching AX25 device
  hwmon: (lm90) Do not report 'busy' status bit as alarm
  hwmom: (lm90) Fix citical alarm status for MAX6680/MAX6681
  pinctrl: mediatek: fix global-out-of-bounds issue
  mm: mempolicy: fix THP allocations escaping mempolicy restrictions
  KVM: VMX: Fix stale docs for kvm-intel.emulate_invalid_guest_state
  usb: gadget: u_ether: fix race in setting MAC address in setup phase
  f2fs: fix to do sanity check on last xattr entry in __f2fs_setxattr()
  tee: optee: Fix incorrect page free bug
  ARM: 9169/1: entry: fix Thumb2 bug in iWMMXt exception handling
  mmc: core: Disable card detect during shutdown
  mmc: sdhci-tegra: Fix switch to HS400ES mode
  pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines
  x86/pkey: Fix undefined behaviour with PKRU_WD_BIT
  parisc: Correct completer in lws start
  ipmi: fix initialization when workqueue allocation fails
  ipmi: ssif: initialize ssif_info->client early
  ipmi: bail out if init_srcu_struct fails
  Input: atmel_mxt_ts - fix double free in mxt_read_info_block
  ALSA: hda/realtek: Amp init fixup for HP ZBook 15 G6
  ALSA: drivers: opl3: Fix incorrect use of vp->state
  ALSA: jack: Check the return value of kstrdup()
  hwmon: (lm90) Drop critical attribute support for MAX6654
  hwmon: (lm90) Introduce flag indicating extended temperature support
  hwmon: (lm90) Add basic support for TI TMP461
  hwmon: (lm90) Add max6654 support to lm90 driver
  hwmon: (lm90) Fix usage of CONFIG2 register in detect function
  Input: elantech - fix stack out of bound access in elantech_change_report_id()
  sfc: falcon: Check null pointer of rx_queue->page_ring
  drivers: net: smc911x: Check for error irq
  fjes: Check for error irq
  bonding: fix ad_actor_system option setting to default
  ipmi: Fix UAF when uninstall ipmi_si and ipmi_msghandler module
  net: skip virtio_net_hdr_set_proto if protocol already set
  net: accept UFOv6 packages in virtio_net_hdr_to_skb
  qlcnic: potential dereference null pointer of rx_queue->page_ring
  netfilter: fix regression in looped (broad|multi)cast's MAC handling
  IB/qib: Fix memory leak in qib_user_sdma_queue_pkts()
  spi: change clk_disable_unprepare to clk_unprepare
  arm64: dts: allwinner: orangepi-zero-plus: fix PHY mode
  HID: holtek: fix mouse probing
  serial: 8250_fintek: Fix garbled text for console
  net: usb: lan78xx: add Allied Telesis AT29M2-AF
  Linux 5.4.168
  xen/netback: don't queue unlimited number of packages
  xen/netback: fix rx queue stall detection
  xen/console: harden hvc_xen against event channel storms
  xen/netfront: harden netfront against event channel storms
  xen/blkfront: harden blkfront against event channel storms
  Revert "xsk: Do not sleep in poll() when need_wakeup set"
  net: sched: Fix suspicious RCU usage while accessing tcf_tunnel_info
  mac80211: fix regression in SSN handling of addba tx
  rcu: Mark accesses to rcu_state.n_force_qs
  scsi: scsi_debug: Sanity check block descriptor length in resp_mode_select()
  ovl: fix warning in ovl_create_real()
  fuse: annotate lock in fuse_reverse_inval_entry()
  media: mxl111sf: change mutex_init() location
  xsk: Do not sleep in poll() when need_wakeup set
  ARM: dts: imx6ull-pinfunc: Fix CSI_DATA07__ESAI_TX0 pad name
  Input: touchscreen - avoid bitwise vs logical OR warning
  mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO
  mac80211: validate extended element ID is present
  drm/amdgpu: correct register access for RLC_JUMP_TABLE_RESTORE
  libata: if T_LENGTH is zero, dma direction should be DMA_NONE
  timekeeping: Really make sure wall_to_monotonic isn't positive
  USB: serial: option: add Telit FN990 compositions
  USB: serial: cp210x: fix CP2105 GPIO registration
  usb: xhci: Extend support for runtime power management for AMD's Yellow carp.
  PCI/MSI: Mask MSI-X vectors only on success
  PCI/MSI: Clear PCI_MSIX_FLAGS_MASKALL on error
  USB: NO_LPM quirk Lenovo USB-C to Ethernet Adapher(RTL8153-04)
  USB: gadget: bRequestType is a bitfield, not a enum
  sit: do not call ipip6_dev_free() from sit_init_net()
  net: systemport: Add global locking for descriptor lifecycle
  net/smc: Prevent smc_release() from long blocking
  net: Fix double 0x prefix print in SKB dump
  net/packet: rx_owner_map depends on pg_vec
  netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc
  ixgbe: set X550 MDIO speed before talking to PHY
  igbvf: fix double free in `igbvf_probe`
  igb: Fix removal of unicast MAC filters of VFs
  soc/tegra: fuse: Fix bitwise vs. logical OR warning
  rds: memory leak in __rds_conn_create()
  flow_offload: return EOPNOTSUPP for the unsupported mpls action type
  net: sched: lock action when translating it to flow_action infra
  mac80211: fix lookup when adding AddBA extension element
  mac80211: accept aggregation sessions on 6 GHz
  mac80211: agg-tx: don't schedule_and_wake_txq() under sta->lock
  mac80211: agg-tx: refactor sending addba
  selftest/net/forwarding: declare NETIFS p9 p10
  dmaengine: st_fdma: fix MODULE_ALIAS
  selftests: Fix IPv6 address bind tests
  selftests: Fix raw socket bind tests with VRF
  inet_diag: fix kernel-infoleak for UDP sockets
  inet_diag: use jiffies_delta_to_msecs()
  sch_cake: do not call cake_destroy() from cake_init()
  s390/kexec_file: fix error handling when applying relocations
  selftests: net: Correct ping6 expected rc from 2 to 1
  clk: Don't parent clks until the parent is fully registered
  ARM: socfpga: dts: fix qspi node compatible
  mac80211: track only QoS data frames for admission control
  arm64: dts: rockchip: fix audio-supply for Rock Pi 4
  arm64: dts: rockchip: fix rk3399-leez-p710 vcc3v3-lan supply
  arm64: dts: rockchip: remove mmc-hs400-enhanced-strobe from rk3399-khadas-edge
  nfsd: fix use-after-free due to delegation race
  iio: adc: stm32: fix a current leak by resetting pcsel before disabling vdda
  audit: improve robustness of the audit queue handling
  dm btree remove: fix use after free in rebalance_children()
  recordmcount.pl: look for jgnop instruction as well as bcrl on s390
  virtio_ring: Fix querying of maximum DMA mapping size for virtio device
  firmware: arm_scpi: Fix string overflow in SCPI genpd driver
  mac80211: send ADDBA requests using the tid/queue of the aggregation session
  mac80211: mark TX-during-stop for TX in in_reconfig
  KVM: selftests: Make sure kvm_create_max_vcpus test won't hit RLIMIT_NOFILE
  Linux 5.4.167
  arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM
  arm: extend pfn_valid to take into account freed memory map alignment
  memblock: ensure there is no overflow in memblock_overlaps_region()
  memblock: align freed memory map on pageblock boundaries with SPARSEMEM
  memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER
  hwmon: (dell-smm) Fix warning on /proc/i8k creation error
  bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc
  selinux: fix race condition when computing ocontext SIDs
  KVM: x86: Ignore sparse banks size for an "all CPUs", non-sparse IPI req
  tracing: Fix a kmemleak false positive in tracing_map
  drm/amd/display: add connector type check for CRC source set
  drm/amd/display: Fix for the no Audio bug with Tiled Displays
  net: netlink: af_netlink: Prevent empty skb by adding a check on len.
  i2c: rk3x: Handle a spurious start completion interrupt flag
  parisc/agp: Annotate parisc agp init functions with __init
  net/mlx4_en: Update reported link modes for 1/10G
  drm/msm/dsi: set default num_data_lanes
  nfc: fix segfault in nfc_genl_dump_devices_done
  Linux 5.4.166
  netfilter: selftest: conntrack_vrf.sh: fix file permission
  Linux 5.4.165
  bpf: Add selftests to cover packet access corner cases
  misc: fastrpc: fix improper packet size calculation
  irqchip: nvic: Fix offset for Interrupt Priority Offsets
  irqchip/irq-gic-v3-its.c: Force synchronisation when issuing INVALL
  irqchip/armada-370-xp: Fix support for Multi-MSI interrupts
  irqchip/armada-370-xp: Fix return value of armada_370_xp_msi_alloc()
  iio: accel: kxcjk-1013: Fix possible memory leak in probe and remove
  iio: ad7768-1: Call iio_trigger_notify_done() on error
  iio: adc: axp20x_adc: fix charging current reporting on AXP22x
  iio: at91-sama5d2: Fix incorrect sign extension
  iio: dln2: Check return value of devm_iio_trigger_register()
  iio: dln2-adc: Fix lockdep complaint
  iio: itg3200: Call iio_trigger_notify_done() on error
  iio: kxsd9: Don't return error code in trigger handler
  iio: ltr501: Don't return error code in trigger handler
  iio: mma8452: Fix trigger reference couting
  iio: stk3310: Don't return error code in interrupt handler
  iio: trigger: stm32-timer: fix MODULE_ALIAS
  iio: trigger: Fix reference counting
  xhci: avoid race between disable slot command and host runtime suspend
  usb: core: config: using bit mask instead of individual bits
  xhci: Remove CONFIG_USB_DEFAULT_PERSIST to prevent xHCI from runtime suspending
  usb: core: config: fix validation of wMaxPacketValue entries
  USB: gadget: zero allocate endpoint 0 buffers
  USB: gadget: detect too-big endpoint 0 requests
  selftests/fib_tests: Rework fib_rp_filter_test()
  net/qla3xxx: fix an error code in ql_adapter_up()
  net, neigh: clear whole pneigh_entry at alloc time
  net: fec: only clear interrupt of handling queue in fec_enet_rx_queue()
  net: altera: set a couple error code in probe()
  net: cdc_ncm: Allow for dwNtbOutMaxSize to be unset or zero
  tools build: Remove needless libpython-version feature check that breaks test-all fast path
  dt-bindings: net: Reintroduce PHY no lane swap binding
  mtd: rawnand: fsmc: Fix timing computation
  mtd: rawnand: fsmc: Take instruction delay into account
  i40e: Fix pre-set max number of queues for VF
  i40e: Fix failed opcode appearing if handling messages from VF
  ASoC: qdsp6: q6routing: Fix return value from msm_routing_put_audio_mixer
  qede: validate non LSO skb length
  block: fix ioprio_get(IOPRIO_WHO_PGRP) vs setuid(2)
  tracefs: Set all files to the same group ownership as the mount option
  aio: fix use-after-free due to missing POLLFREE handling
  aio: keep poll requests on waitqueue until completed
  signalfd: use wake_up_pollfree()
  binder: use wake_up_pollfree()
  wait: add wake_up_pollfree()
  libata: add horkage for ASMedia 1092
  x86/sme: Explicitly map new EFI memmap table as encrypted
  can: m_can: Disable and ignore ELO interrupt
  can: pch_can: pch_can_rx_normal: fix use after free
  drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.
  clk: qcom: regmap-mux: fix parent clock lookup
  tracefs: Have new files inherit the ownership of their parent
  nfsd: Fix nsfd startup race (again)
  btrfs: replace the BUG_ON in btrfs_del_root_ref with proper error handling
  btrfs: clear extent buffer uptodate when we fail to write it
  ALSA: pcm: oss: Handle missing errors in snd_pcm_oss_change_params*()
  ALSA: pcm: oss: Limit the period size to 16MB
  ALSA: pcm: oss: Fix negative period/buffer sizes
  ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform
  ALSA: ctl: Fix copy of updated id with element read/write
  mm: bdi: initialize bdi_min_ratio when bdi is unregistered
  IB/hfi1: Correct guard on eager buffer deallocation
  iavf: Fix reporting when setting descriptor count
  iavf: restore MSI state on reset
  udp: using datalen to cap max gso segments
  seg6: fix the iif in the IPv6 socket control block
  nfp: Fix memory leak in nfp_cpp_area_cache_add()
  bonding: make tx_rebalance_counter an atomic
  ice: ignore dropped packets during init
  bpf: Fix the off-by-two error in range markings
  vrf: don't run conntrack on vrf with !dflt qdisc
  selftests: netfilter: add a vrf+conntrack testcase
  nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done
  can: sja1000: fix use after free in ems_pcmcia_add_card()
  can: kvaser_pciefd: kvaser_pciefd_rx_error_frame(): increase correct stats->{rx,tx}_errors counter
  can: kvaser_usb: get CAN clock frequency from device
  HID: check for valid USB device for many HID drivers
  HID: wacom: fix problems when device is not a valid USB device
  HID: bigbenff: prevent null pointer dereference
  HID: add USB_HID dependancy on some USB HID drivers
  HID: add USB_HID dependancy to hid-chicony
  HID: add USB_HID dependancy to hid-prodikeys
  HID: add hid_is_usb() function to make it simpler for USB detection
  HID: google: add eel USB id
  HID: quirks: Add quirk for the Microsoft Surface 3 type-cover
  ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type
  serial: tegra: Change lower tolerance baud rate limit for tegra20 and tegra30
  ANDROID: GKI: fix up abi breakage in fib_rules.h
  Linux 5.4.164
  ipmi: msghandler: Make symbol 'remove_work_wq' static
  net/tls: Fix authentication failure in CCM mode
  parisc: Mark cr16 CPU clocksource unstable on all SMP machines
  iwlwifi: mvm: retry init flow if failed
  serial: 8250_pci: rewrite pericom_do_set_divisor()
  serial: 8250_pci: Fix ACCES entries in pci_serial_quirks array
  serial: core: fix transmit-buffer reset and memleak
  serial: pl011: Add ACPI SBSA UART match id
  tty: serial: msm_serial: Deactivate RX DMA for polling support
  x86/64/mm: Map all kernel memory into trampoline_pgd
  x86/tsc: Disable clocksource watchdog for TSC on qualified platorms
  x86/tsc: Add a timer to make sure TSC_adjust is always checked
  usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect
  USB: NO_LPM quirk Lenovo Powered USB-C Travel Hub
  xhci: Fix commad ring abort, write all 64 bits to CRCR register.
  vgacon: Propagate console boot parameters before calling `vc_resize'
  parisc: Fix "make install" on newer debian releases
  parisc: Fix KBUILD_IMAGE for self-extracting kernel
  sched/uclamp: Fix rq->uclamp_max not set on first enqueue
  KVM: x86/pmu: Fix reserved bits for AMD PerfEvtSeln register
  ipv6: fix memory leak in fib6_rule_suppress
  drm/msm: Do hw_init() before capturing GPU state
  net/smc: Keep smc_close_final rc during active close
  net/rds: correct socket tunable error in rds_tcp_tune()
  ipv4: convert fib_num_tclassid_users to atomic_t
  net: annotate data-races on txq->xmit_lock_owner
  net: marvell: mvpp2: Fix the computation of shared CPUs
  net: usb: lan78xx: lan78xx_phy_init(): use PHY_POLL instead of "0" if no IRQ is available
  rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer()
  selftests: net: Correct case name
  net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()
  siphash: use _unaligned version by default
  net: mpls: Fix notifications when deleting a device
  net: qlogic: qlcnic: Fix a NULL pointer dereference in qlcnic_83xx_add_rings()
  natsemi: xtensa: fix section mismatch warnings
  i2c: cbus-gpio: set atomic transfer callback
  i2c: stm32f7: stop dma transfer in case of NACK
  i2c: stm32f7: recover the bus on access timeout
  i2c: stm32f7: flush TX FIFO upon transfer errors
  sata_fsl: fix warning in remove_proc_entry when rmmod sata_fsl
  sata_fsl: fix UAF in sata_fsl_port_stop when rmmod sata_fsl
  fget: check that the fd still exists after getting a ref to it
  s390/pci: move pseudo-MMIO to prevent MIO overlap
  cpufreq: Fix get_cpu_device() failure in add_cpu_dev_symlink()
  ipmi: Move remove_work to dedicated workqueue
  rt2x00: do not mark device gone on EPROTO errors during start
  kprobes: Limit max data_size of the kretprobe instances
  vrf: Reset IPCB/IP6CB when processing outbound pkts in vrf dev xmit
  net/smc: Avoid warning of possible recursive locking
  perf report: Fix memory leaks around perf_tip()
  perf hist: Fix memory leak of a perf_hpp_fmt
  net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock()
  net: tulip: de4x5: fix the problem that the array 'lp->phy[8]' may be out of bound
  ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port()
  ata: ahci: Add Green Sardine vendor ID as board_ahci_mobile
  scsi: iscsi: Unblock session then wake up error handler
  thermal: core: Reset previous low and high trip during thermal zone init
  btrfs: check-integrity: fix a warning on write caching disabled disk
  s390/setup: avoid using memblock_enforce_memory_limit
  platform/x86: thinkpad_acpi: Fix WWAN device disabled issue after S3 deep
  net: return correct error code
  atlantic: Fix OOB read and write in hw_atl_utils_fw_rpc_wait
  net/smc: Transfer remaining wait queue entries during fallback
  mac80211: do not access the IV when it was stripped
  drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY
  gfs2: Fix length of holes reported at end-of-file
  can: j1939: j1939_tp_cmd_recv(): check the dst address of TP.CM_BAM
  arm64: dts: mcbin: support 2W SFP modules
  of: clk: Make <linux/of_clk.h> self-contained
  NFSv42: Fix pagecache invalidation after COPY/CLONE
  Revert "net: ipv6: add fib6_nh_release_dsts stub"
  Revert "net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group"
  Revert "mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB"
  Linux 5.4.163
  tty: hvc: replace BUG_ON() with negative return value
  xen/netfront: don't trust the backend response data blindly
  xen/netfront: disentangle tx_skb_freelist
  xen/netfront: don't read data from request on the ring page
  xen/netfront: read response from backend only once
  xen/blkfront: don't trust the backend response data blindly
  xen/blkfront: don't take local copy of a request from the ring page
  xen/blkfront: read response from backend only once
  xen: sync include/xen/interface/io/ring.h with Xen's newest version
  fuse: release pipe buf after last use
  NFC: add NCI_UNREG flag to eliminate the race
  shm: extend forced shm destroy to support objects from several IPC nses
  s390/mm: validate VMA in PGSTE manipulation functions
  tracing: Check pid filtering when creating events
  vhost/vsock: fix incorrect used length reported to the guest
  smb3: do not error on fsync when readonly
  f2fs: set SBI_NEED_FSCK flag when inconsistent node block found
  net: mscc: ocelot: correctly report the timestamping RX filters in ethtool
  net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP
  net: hns3: fix VF RSS failed problem after PF enable multi-TCs
  net/smc: Don't call clcsock shutdown twice when smc shutdown
  net: vlan: fix underflow for the real_dev refcnt
  MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48
  igb: fix netpoll exit with traffic
  nvmet: use IOCB_NOWAIT only if the filesystem supports it
  tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows
  PM: hibernate: use correct mode for swsusp_close()
  net/ncsi : Add payload to be 32-bit aligned to fix dropped packets
  nvmet-tcp: fix incomplete data digest send
  net/smc: Ensure the active closing peer first closes clcsock
  scsi: core: sysfs: Fix setting device state to SDEV_RUNNING
  net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group
  net: ipv6: add fib6_nh_release_dsts stub
  nfp: checking parameter process for rx-usecs/tx-usecs is invalid
  ipv6: fix typos in __ip6_finish_output()
  iavf: Prevent changing static ITR values if adaptive moderation is on
  drm/vc4: fix error code in vc4_create_object()
  scsi: mpt3sas: Fix kernel panic during drive powercycle test
  ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE
  NFSv42: Don't fail clone() unless the OP_CLONE operation failed
  firmware: arm_scmi: pm: Propagate return value to caller
  net: ieee802154: handle iftypes as u32
  ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
  ASoC: qdsp6: q6routing: Conditionally reset FrontEnd Mixer
  ARM: dts: BCM5301X: Add interrupt properties to GPIO node
  ARM: dts: BCM5301X: Fix I2C controller interrupt
  netfilter: ipvs: Fix reuse connection if RS weight is 0
  proc/vmcore: fix clearing user buffer by properly using clear_user()
  arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function
  pinctrl: armada-37xx: Correct PWM pins definitions
  PCI: aardvark: Fix support for PCI_BRIDGE_CTL_BUS_RESET on emulated bridge
  PCI: aardvark: Set PCI Bridge Class Code to PCI Bridge
  PCI: aardvark: Fix support for bus mastering and PCI_COMMAND on emulated bridge
  PCI: aardvark: Fix link training
  PCI: aardvark: Simplify initialization of rootcap on virtual bridge
  PCI: aardvark: Implement re-issuing config requests on CRS response
  PCI: aardvark: Fix PCIe Max Payload Size setting
  PCI: aardvark: Configure PCIe resources from 'ranges' DT property
  PCI: pci-bridge-emul: Fix array overruns, improve safety
  PCI: aardvark: Update comment about disabling link training
  PCI: aardvark: Move PCIe reset card code to advk_pcie_train_link()
  PCI: aardvark: Fix compilation on s390
  PCI: aardvark: Don't touch PCIe registers if no card connected
  PCI: aardvark: Replace custom macros by standard linux/pci_regs.h macros
  PCI: aardvark: Issue PERST via GPIO
  PCI: aardvark: Improve link training
  PCI: aardvark: Train link immediately after enabling training
  PCI: aardvark: Fix big endian support
  PCI: aardvark: Wait for endpoint to be ready before training link
  PCI: aardvark: Deduplicate code in advk_pcie_rd_conf()
  mdio: aspeed: Fix "Link is Down" issue
  mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB
  tracing: Fix pid filtering when triggers are attached
  tracing/uprobe: Fix uprobe_perf_open probes iteration
  KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB
  xen: detect uninitialized xenbus in xenbus_init
  xen: don't continue xenstore initialization in case of errors
  staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect()
  staging/fbtft: Fix backlight
  HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts
  Revert "parisc: Fix backtrace to always include init funtion names"
  media: cec: copy sequence field for the reply
  ALSA: ctxfi: Fix out-of-range access
  binder: fix test regression due to sender_euid change
  usb: hub: Fix locking issues with address0_mutex
  usb: hub: Fix usb enumeration issue due to address0 race
  usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts
  net: nexthop: fix null pointer dereference when IPv6 is not enabled
  usb: dwc2: hcd_queue: Fix use of floating point literal
  usb: dwc2: gadget: Fix ISOC flow for elapsed frames
  USB: serial: option: add Fibocom FM101-GL variants
  USB: serial: option: add Telit LE910S1 0x9200 composition
  Linux 5.4.162
  ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()
  ALSA: hda: hdac_ext_stream: fix potential locking issues
  hugetlbfs: flush TLBs correctly after huge_pmd_unshare
  tlb: mmu_gather: add tlb_flush_*_range APIs
  ice: Delete always true check of PF pointer
  usb: max-3421: Use driver data instead of maintaining a list of bound devices
  ASoC: DAPM: Cover regression by kctl change notification fix
  batman-adv: Don't always reallocate the fragmentation skb head
  batman-adv: Reserve needed_*room for fragments
  batman-adv: Consider fragmentation for needed_headroom
  perf/core: Avoid put_page() when GUP fails
  Revert "net: mvpp2: disable force link UP during port init procedure"
  drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors
  drm/i915/dp: Ensure sink rate values are always valid
  drm/nouveau: use drm_dev_unplug() during device removal
  drm/udl: fix control-message timeout
  cfg80211: call cfg80211_stop_ap when switch from P2P_GO type
  parisc/sticon: fix reverse colors
  btrfs: fix memory ordering between normal and ordered work functions
  udf: Fix crash after seekdir
  s390/kexec: fix memory leak of ipl report buffer
  x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails
  mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag
  ipc: WARN if trying to remove ipc object which is absent
  hexagon: export raw I/O routines for modules
  tun: fix bonding active backup with arp monitoring
  arm64: vdso32: suppress error message for 'make mrproper'
  s390/kexec: fix return code handling
  perf/x86/intel/uncore: Fix IIO event constraints for Skylake Server
  perf/x86/intel/uncore: Fix filter_tid mask for CHA events on Skylake Server
  KVM: PPC: Book3S HV: Use GLOBAL_TOC for kvmppc_h_set_dabr/xdabr()
  NFC: reorder the logic in nfc_{un,}register_device
  drm/nouveau: hdmigv100.c: fix corrupted HDMI Vendor InfoFrame
  NFC: reorganize the functions in nci_request
  i40e: Fix display error code in dmesg
  i40e: Fix creation of first queue by omitting it if is not power of two
  i40e: Fix ping is lost after configuring ADq on VF
  i40e: Fix changing previously set num_queue_pairs for PFs
  i40e: Fix NULL ptr dereference on VSI filter sync
  i40e: Fix correct max_pkt_size on VF RX queue
  net: virtio_net_hdr_to_skb: count transport header in UFO
  net: dpaa2-eth: fix use-after-free in dpaa2_eth_remove
  net: sched: act_mirred: drop dst for the direction from egress to ingress
  scsi: core: sysfs: Fix hang when device state is set via sysfs
  platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()'
  mips: lantiq: add support for clk_get_parent()
  mips: bcm63xx: add support for clk_get_parent()
  MIPS: generic/yamon-dt: fix uninitialized variable error
  iavf: Fix for the false positive ASQ/ARQ errors while issuing VF reset
  iavf: validate pointers
  iavf: prevent accidental free of filter structure
  iavf: Fix failure to exit out from last all-multicast mode
  iavf: free q_vectors before queues in iavf_disable_vf
  iavf: check for null in iavf_fix_features
  net: bnx2x: fix variable dereferenced before check
  perf tests: Remove bash construct from record+zstd_comp_decomp.sh
  perf bench futex: Fix memory leak of perf_cpu_map__new()
  perf bpf: Avoid memory leak from perf_env__insert_btf()
  RDMA/netlink: Add __maybe_unused to static inline in C file
  tracing/histogram: Do not copy the fixed-size char array field over the field size
  tracing: Save normal string variables
  sched/core: Mitigate race cpus_share_cache()/update_top_cache_domain()
  mips: BCM63XX: ensure that CPU_SUPPORTS_32BIT_KERNEL is set
  clk: qcom: gcc-msm8996: Drop (again) gcc_aggre1_pnoc_ahb_clk
  clk/ast2600: Fix soc revision for AHB
  clk: ingenic: Fix bugs with divided dividers
  sh: define __BIG_ENDIAN for math-emu
  sh: math-emu: drop unused functions
  sh: fix kconfig unmet dependency warning for FRAME_POINTER
  f2fs: fix up f2fs_lookup tracepoints
  maple: fix wrong return value of maple_bus_init().
  sh: check return code of request_irq
  powerpc/dcr: Use cmplwi instead of 3-argument cmpli
  ALSA: gus: fix null pointer dereference on pointer block
  powerpc/5200: dts: fix memory node unit name
  iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
  scsi: target: Fix alua_tg_pt_gps_count tracking
  scsi: target: Fix ordered tag handling
  MIPS: sni: Fix the build
  tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc
  ALSA: ISA: not for M68K
  ARM: dts: ls1021a-tsn: use generic "jedec,spi-nor" compatible for flash
  ARM: dts: ls1021a: move thermal-zones node out of soc/
  usb: host: ohci-tmio: check return value after calling platform_get_resource()
  ARM: dts: omap: fix gpmc,mux-add-data type
  firmware_loader: fix pre-allocated buf built-in firmware use
  scsi: advansys: Fix kernel pointer leak
  ASoC: nau8824: Add DMI quirk mechanism for active-high jack-detect
  clk: imx: imx6ul: Move csi_sel mux to correct base register
  ASoC: SOF: Intel: hda-dai: fix potential locking issue
  arm64: dts: freescale: fix arm,sp805 compatible string
  arm64: dts: qcom: msm8998: Fix CPU/L2 idle state latency and residency
  usb: typec: tipd: Remove WARN_ON in tps6598x_block_read
  usb: musb: tusb6010: check return value after calling platform_get_resource()
  RDMA/bnxt_re: Check if the vlan is valid before reporting
  arm64: dts: hisilicon: fix arm,sp805 compatible string
  scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()
  ARM: dts: NSP: Fix mpcore, mmc node names
  arm64: zynqmp: Fix serial compatible string
  arm64: zynqmp: Do not duplicate flash partition label property

 Conflicts:
	Documentation/devicetree/bindings
	Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
	Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml
	Documentation/devicetree/bindings/net/can/tcan4x5x.txt
	Documentation/devicetree/bindings/net/ethernet-phy.yaml
	Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt
	arch/arm64/include/asm/cputype.h
	drivers/base/power/wakeup.c
	drivers/clk/qcom/common.c
	drivers/iommu/io-pgtable-arm.c
	drivers/net/macsec.c
	drivers/usb/dwc3/gadget.c
	drivers/usb/gadget/function/f_fs.c
	include/trace/events/f2fs.h

Change-Id: I06d6af403c13b93b319a8bc01db206c619ee96d3
Signed-off-by: Srinivasarao Pathipati <quic_spathi@quicinc.com>
2022-04-21 10:51:21 +05:30

1217 lines
32 KiB
C

// SPDX-License-Identifier: GPL-2.0
/*
* drivers/base/power/wakeup.c - System wakeup events framework
*
* Copyright (c) 2010 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
*/
#define pr_fmt(fmt) "PM: " fmt
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/sched/signal.h>
#include <linux/capability.h>
#include <linux/export.h>
#include <linux/suspend.h>
#include <linux/seq_file.h>
#include <linux/debugfs.h>
#include <linux/pm_wakeirq.h>
#include <linux/irq.h>
#include <linux/irqdesc.h>
#include <linux/wakeup_reason.h>
#include <trace/events/power.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/irqdesc.h>
#include "power.h"
#ifndef CONFIG_SUSPEND
suspend_state_t pm_suspend_target_state;
#define pm_suspend_target_state (PM_SUSPEND_ON)
#endif
/*
* If set, the suspend/hibernate code will abort transitions to a sleep state
* if wakeup events are registered during or immediately before the transition.
*/
bool events_check_enabled __read_mostly;
/* First wakeup IRQ seen by the kernel in the last cycle. */
static unsigned int wakeup_irq[2] __read_mostly;
static DEFINE_RAW_SPINLOCK(wakeup_irq_lock);
/* If greater than 0 and the system is suspending, terminate the suspend. */
static atomic_t pm_abort_suspend __read_mostly;
/*
* Combined counters of registered wakeup events and wakeup events in progress.
* They need to be modified together atomically, so it's better to use one
* atomic variable to hold them both.
*/
static atomic_t combined_event_count = ATOMIC_INIT(0);
#define IN_PROGRESS_BITS (sizeof(int) * 4)
#define MAX_IN_PROGRESS ((1 << IN_PROGRESS_BITS) - 1)
static void split_counters(unsigned int *cnt, unsigned int *inpr)
{
unsigned int comb = atomic_read(&combined_event_count);
*cnt = (comb >> IN_PROGRESS_BITS);
*inpr = comb & MAX_IN_PROGRESS;
}
/* A preserved old value of the events counter. */
static unsigned int saved_count;
static DEFINE_RAW_SPINLOCK(events_lock);
static void pm_wakeup_timer_fn(struct timer_list *t);
static LIST_HEAD(wakeup_sources);
static DECLARE_WAIT_QUEUE_HEAD(wakeup_count_wait_queue);
DEFINE_STATIC_SRCU(wakeup_srcu);
static struct wakeup_source deleted_ws = {
.name = "deleted",
.lock = __SPIN_LOCK_UNLOCKED(deleted_ws.lock),
};
static DEFINE_IDA(wakeup_ida);
/**
* wakeup_source_create - Create a struct wakeup_source object.
* @name: Name of the new wakeup source.
*/
struct wakeup_source *wakeup_source_create(const char *name)
{
struct wakeup_source *ws;
const char *ws_name;
int id;
ws = kzalloc(sizeof(*ws), GFP_KERNEL);
if (!ws)
goto err_ws;
ws_name = kstrdup_const(name, GFP_KERNEL);
if (!ws_name)
goto err_name;
ws->name = ws_name;
id = ida_alloc(&wakeup_ida, GFP_KERNEL);
if (id < 0)
goto err_id;
ws->id = id;
return ws;
err_id:
kfree_const(ws->name);
err_name:
kfree(ws);
err_ws:
return NULL;
}
EXPORT_SYMBOL_GPL(wakeup_source_create);
/*
* Record wakeup_source statistics being deleted into a dummy wakeup_source.
*/
static void wakeup_source_record(struct wakeup_source *ws)
{
unsigned long flags;
spin_lock_irqsave(&deleted_ws.lock, flags);
if (ws->event_count) {
deleted_ws.total_time =
ktime_add(deleted_ws.total_time, ws->total_time);
deleted_ws.prevent_sleep_time =
ktime_add(deleted_ws.prevent_sleep_time,
ws->prevent_sleep_time);
deleted_ws.max_time =
ktime_compare(deleted_ws.max_time, ws->max_time) > 0 ?
deleted_ws.max_time : ws->max_time;
deleted_ws.event_count += ws->event_count;
deleted_ws.active_count += ws->active_count;
deleted_ws.relax_count += ws->relax_count;
deleted_ws.expire_count += ws->expire_count;
deleted_ws.wakeup_count += ws->wakeup_count;
}
spin_unlock_irqrestore(&deleted_ws.lock, flags);
}
static void wakeup_source_free(struct wakeup_source *ws)
{
ida_free(&wakeup_ida, ws->id);
kfree_const(ws->name);
kfree(ws);
}
/**
* wakeup_source_destroy - Destroy a struct wakeup_source object.
* @ws: Wakeup source to destroy.
*
* Use only for wakeup source objects created with wakeup_source_create().
*/
void wakeup_source_destroy(struct wakeup_source *ws)
{
if (!ws)
return;
__pm_relax(ws);
wakeup_source_record(ws);
wakeup_source_free(ws);
}
EXPORT_SYMBOL_GPL(wakeup_source_destroy);
/**
* wakeup_source_add - Add given object to the list of wakeup sources.
* @ws: Wakeup source object to add to the list.
*/
void wakeup_source_add(struct wakeup_source *ws)
{
unsigned long flags;
if (WARN_ON(!ws))
return;
spin_lock_init(&ws->lock);
timer_setup(&ws->timer, pm_wakeup_timer_fn, 0);
ws->active = false;
raw_spin_lock_irqsave(&events_lock, flags);
list_add_rcu(&ws->entry, &wakeup_sources);
raw_spin_unlock_irqrestore(&events_lock, flags);
}
EXPORT_SYMBOL_GPL(wakeup_source_add);
/**
* wakeup_source_remove - Remove given object from the wakeup sources list.
* @ws: Wakeup source object to remove from the list.
*/
void wakeup_source_remove(struct wakeup_source *ws)
{
unsigned long flags;
if (WARN_ON(!ws))
return;
raw_spin_lock_irqsave(&events_lock, flags);
list_del_rcu(&ws->entry);
raw_spin_unlock_irqrestore(&events_lock, flags);
synchronize_srcu(&wakeup_srcu);
del_timer_sync(&ws->timer);
/*
* Clear timer.function to make wakeup_source_not_registered() treat
* this wakeup source as not registered.
*/
ws->timer.function = NULL;
}
EXPORT_SYMBOL_GPL(wakeup_source_remove);
/**
* wakeup_source_register - Create wakeup source and add it to the list.
* @dev: Device this wakeup source is associated with (or NULL if virtual).
* @name: Name of the wakeup source to register.
*/
struct wakeup_source *wakeup_source_register(struct device *dev,
const char *name)
{
struct wakeup_source *ws;
int ret;
ws = wakeup_source_create(name);
if (ws) {
if (!dev || device_is_registered(dev)) {
ret = wakeup_source_sysfs_add(dev, ws);
if (ret) {
wakeup_source_free(ws);
return NULL;
}
}
wakeup_source_add(ws);
}
return ws;
}
EXPORT_SYMBOL_GPL(wakeup_source_register);
/**
* wakeup_source_unregister - Remove wakeup source from the list and remove it.
* @ws: Wakeup source object to unregister.
*/
void wakeup_source_unregister(struct wakeup_source *ws)
{
if (ws) {
wakeup_source_remove(ws);
if (ws->dev)
wakeup_source_sysfs_remove(ws);
wakeup_source_destroy(ws);
}
}
EXPORT_SYMBOL_GPL(wakeup_source_unregister);
/**
* device_wakeup_attach - Attach a wakeup source object to a device object.
* @dev: Device to handle.
* @ws: Wakeup source object to attach to @dev.
*
* This causes @dev to be treated as a wakeup device.
*/
static int device_wakeup_attach(struct device *dev, struct wakeup_source *ws)
{
spin_lock_irq(&dev->power.lock);
if (dev->power.wakeup) {
spin_unlock_irq(&dev->power.lock);
return -EEXIST;
}
dev->power.wakeup = ws;
if (dev->power.wakeirq)
device_wakeup_attach_irq(dev, dev->power.wakeirq);
spin_unlock_irq(&dev->power.lock);
return 0;
}
/**
* device_wakeup_enable - Enable given device to be a wakeup source.
* @dev: Device to handle.
*
* Create a wakeup source object, register it and attach it to @dev.
*/
int device_wakeup_enable(struct device *dev)
{
struct wakeup_source *ws;
int ret;
if (!dev || !dev->power.can_wakeup)
return -EINVAL;
if (pm_suspend_target_state != PM_SUSPEND_ON)
dev_dbg(dev, "Suspicious %s() during system transition!\n", __func__);
ws = wakeup_source_register(dev, dev_name(dev));
if (!ws)
return -ENOMEM;
ret = device_wakeup_attach(dev, ws);
if (ret)
wakeup_source_unregister(ws);
return ret;
}
EXPORT_SYMBOL_GPL(device_wakeup_enable);
/**
* device_wakeup_attach_irq - Attach a wakeirq to a wakeup source
* @dev: Device to handle
* @wakeirq: Device specific wakeirq entry
*
* Attach a device wakeirq to the wakeup source so the device
* wake IRQ can be configured automatically for suspend and
* resume.
*
* Call under the device's power.lock lock.
*/
void device_wakeup_attach_irq(struct device *dev,
struct wake_irq *wakeirq)
{
struct wakeup_source *ws;
ws = dev->power.wakeup;
if (!ws)
return;
if (ws->wakeirq)
dev_err(dev, "Leftover wakeup IRQ found, overriding\n");
ws->wakeirq = wakeirq;
}
/**
* device_wakeup_detach_irq - Detach a wakeirq from a wakeup source
* @dev: Device to handle
*
* Removes a device wakeirq from the wakeup source.
*
* Call under the device's power.lock lock.
*/
void device_wakeup_detach_irq(struct device *dev)
{
struct wakeup_source *ws;
ws = dev->power.wakeup;
if (ws)
ws->wakeirq = NULL;
}
/**
* device_wakeup_arm_wake_irqs(void)
*
* Itereates over the list of device wakeirqs to arm them.
*/
void device_wakeup_arm_wake_irqs(void)
{
struct wakeup_source *ws;
int srcuidx;
srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry)
dev_pm_arm_wake_irq(ws->wakeirq);
srcu_read_unlock(&wakeup_srcu, srcuidx);
}
/**
* device_wakeup_disarm_wake_irqs(void)
*
* Itereates over the list of device wakeirqs to disarm them.
*/
void device_wakeup_disarm_wake_irqs(void)
{
struct wakeup_source *ws;
int srcuidx;
srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry)
dev_pm_disarm_wake_irq(ws->wakeirq);
srcu_read_unlock(&wakeup_srcu, srcuidx);
}
/**
* device_wakeup_detach - Detach a device's wakeup source object from it.
* @dev: Device to detach the wakeup source object from.
*
* After it returns, @dev will not be treated as a wakeup device any more.
*/
static struct wakeup_source *device_wakeup_detach(struct device *dev)
{
struct wakeup_source *ws;
spin_lock_irq(&dev->power.lock);
ws = dev->power.wakeup;
dev->power.wakeup = NULL;
spin_unlock_irq(&dev->power.lock);
return ws;
}
/**
* device_wakeup_disable - Do not regard a device as a wakeup source any more.
* @dev: Device to handle.
*
* Detach the @dev's wakeup source object from it, unregister this wakeup source
* object and destroy it.
*/
int device_wakeup_disable(struct device *dev)
{
struct wakeup_source *ws;
if (!dev || !dev->power.can_wakeup)
return -EINVAL;
ws = device_wakeup_detach(dev);
wakeup_source_unregister(ws);
return 0;
}
EXPORT_SYMBOL_GPL(device_wakeup_disable);
/**
* device_set_wakeup_capable - Set/reset device wakeup capability flag.
* @dev: Device to handle.
* @capable: Whether or not @dev is capable of waking up the system from sleep.
*
* If @capable is set, set the @dev's power.can_wakeup flag and add its
* wakeup-related attributes to sysfs. Otherwise, unset the @dev's
* power.can_wakeup flag and remove its wakeup-related attributes from sysfs.
*
* This function may sleep and it can't be called from any context where
* sleeping is not allowed.
*/
void device_set_wakeup_capable(struct device *dev, bool capable)
{
if (!!dev->power.can_wakeup == !!capable)
return;
dev->power.can_wakeup = capable;
if (device_is_registered(dev) && !list_empty(&dev->power.entry)) {
if (capable) {
int ret = wakeup_sysfs_add(dev);
if (ret)
dev_info(dev, "Wakeup sysfs attributes not added\n");
} else {
wakeup_sysfs_remove(dev);
}
}
}
EXPORT_SYMBOL_GPL(device_set_wakeup_capable);
/**
* device_init_wakeup - Device wakeup initialization.
* @dev: Device to handle.
* @enable: Whether or not to enable @dev as a wakeup device.
*
* By default, most devices should leave wakeup disabled. The exceptions are
* devices that everyone expects to be wakeup sources: keyboards, power buttons,
* possibly network interfaces, etc. Also, devices that don't generate their
* own wakeup requests but merely forward requests from one bus to another
* (like PCI bridges) should have wakeup enabled by default.
*/
int device_init_wakeup(struct device *dev, bool enable)
{
int ret = 0;
if (!dev)
return -EINVAL;
if (enable) {
device_set_wakeup_capable(dev, true);
ret = device_wakeup_enable(dev);
} else {
device_wakeup_disable(dev);
device_set_wakeup_capable(dev, false);
}
return ret;
}
EXPORT_SYMBOL_GPL(device_init_wakeup);
/**
* device_set_wakeup_enable - Enable or disable a device to wake up the system.
* @dev: Device to handle.
*/
int device_set_wakeup_enable(struct device *dev, bool enable)
{
return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev);
}
EXPORT_SYMBOL_GPL(device_set_wakeup_enable);
/**
* wakeup_source_not_registered - validate the given wakeup source.
* @ws: Wakeup source to be validated.
*/
static bool wakeup_source_not_registered(struct wakeup_source *ws)
{
/*
* Use timer struct to check if the given source is initialized
* by wakeup_source_add.
*/
return ws->timer.function != pm_wakeup_timer_fn;
}
/*
* The functions below use the observation that each wakeup event starts a
* period in which the system should not be suspended. The moment this period
* will end depends on how the wakeup event is going to be processed after being
* detected and all of the possible cases can be divided into two distinct
* groups.
*
* First, a wakeup event may be detected by the same functional unit that will
* carry out the entire processing of it and possibly will pass it to user space
* for further processing. In that case the functional unit that has detected
* the event may later "close" the "no suspend" period associated with it
* directly as soon as it has been dealt with. The pair of pm_stay_awake() and
* pm_relax(), balanced with each other, is supposed to be used in such
* situations.
*
* Second, a wakeup event may be detected by one functional unit and processed
* by another one. In that case the unit that has detected it cannot really
* "close" the "no suspend" period associated with it, unless it knows in
* advance what's going to happen to the event during processing. This
* knowledge, however, may not be available to it, so it can simply specify time
* to wait before the system can be suspended and pass it as the second
* argument of pm_wakeup_event().
*
* It is valid to call pm_relax() after pm_wakeup_event(), in which case the
* "no suspend" period will be ended either by the pm_relax(), or by the timer
* function executed when the timer expires, whichever comes first.
*/
/**
* wakup_source_activate - Mark given wakeup source as active.
* @ws: Wakeup source to handle.
*
* Update the @ws' statistics and, if @ws has just been activated, notify the PM
* core of the event by incrementing the counter of of wakeup events being
* processed.
*/
static void wakeup_source_activate(struct wakeup_source *ws)
{
unsigned int cec;
if (WARN_ONCE(wakeup_source_not_registered(ws),
"unregistered wakeup source\n"))
return;
ws->active = true;
ws->active_count++;
ws->last_time = ktime_get();
if (ws->autosleep_enabled)
ws->start_prevent_time = ws->last_time;
/* Increment the counter of events in progress. */
cec = atomic_inc_return(&combined_event_count);
trace_wakeup_source_activate(ws->name, cec);
}
/**
* wakeup_source_report_event - Report wakeup event using the given source.
* @ws: Wakeup source to report the event for.
* @hard: If set, abort suspends in progress and wake up from suspend-to-idle.
*/
static void wakeup_source_report_event(struct wakeup_source *ws, bool hard)
{
ws->event_count++;
/* This is racy, but the counter is approximate anyway. */
if (events_check_enabled)
ws->wakeup_count++;
if (!ws->active)
wakeup_source_activate(ws);
if (hard)
pm_system_wakeup();
}
/**
* __pm_stay_awake - Notify the PM core of a wakeup event.
* @ws: Wakeup source object associated with the source of the event.
*
* It is safe to call this function from interrupt context.
*/
void __pm_stay_awake(struct wakeup_source *ws)
{
unsigned long flags;
if (!ws)
return;
spin_lock_irqsave(&ws->lock, flags);
wakeup_source_report_event(ws, false);
del_timer(&ws->timer);
ws->timer_expires = 0;
spin_unlock_irqrestore(&ws->lock, flags);
}
EXPORT_SYMBOL_GPL(__pm_stay_awake);
/**
* pm_stay_awake - Notify the PM core that a wakeup event is being processed.
* @dev: Device the wakeup event is related to.
*
* Notify the PM core of a wakeup event (signaled by @dev) by calling
* __pm_stay_awake for the @dev's wakeup source object.
*
* Call this function after detecting of a wakeup event if pm_relax() is going
* to be called directly after processing the event (and possibly passing it to
* user space for further processing).
*/
void pm_stay_awake(struct device *dev)
{
unsigned long flags;
if (!dev)
return;
spin_lock_irqsave(&dev->power.lock, flags);
__pm_stay_awake(dev->power.wakeup);
spin_unlock_irqrestore(&dev->power.lock, flags);
}
EXPORT_SYMBOL_GPL(pm_stay_awake);
#ifdef CONFIG_PM_AUTOSLEEP
static void update_prevent_sleep_time(struct wakeup_source *ws, ktime_t now)
{
ktime_t delta = ktime_sub(now, ws->start_prevent_time);
ws->prevent_sleep_time = ktime_add(ws->prevent_sleep_time, delta);
}
#else
static inline void update_prevent_sleep_time(struct wakeup_source *ws,
ktime_t now) {}
#endif
/**
* wakup_source_deactivate - Mark given wakeup source as inactive.
* @ws: Wakeup source to handle.
*
* Update the @ws' statistics and notify the PM core that the wakeup source has
* become inactive by decrementing the counter of wakeup events being processed
* and incrementing the counter of registered wakeup events.
*/
static void wakeup_source_deactivate(struct wakeup_source *ws)
{
unsigned int cnt, inpr, cec;
ktime_t duration;
ktime_t now;
ws->relax_count++;
/*
* __pm_relax() may be called directly or from a timer function.
* If it is called directly right after the timer function has been
* started, but before the timer function calls __pm_relax(), it is
* possible that __pm_stay_awake() will be called in the meantime and
* will set ws->active. Then, ws->active may be cleared immediately
* by the __pm_relax() called from the timer function, but in such a
* case ws->relax_count will be different from ws->active_count.
*/
if (ws->relax_count != ws->active_count) {
ws->relax_count--;
return;
}
ws->active = false;
now = ktime_get();
duration = ktime_sub(now, ws->last_time);
ws->total_time = ktime_add(ws->total_time, duration);
if (ktime_to_ns(duration) > ktime_to_ns(ws->max_time))
ws->max_time = duration;
ws->last_time = now;
del_timer(&ws->timer);
ws->timer_expires = 0;
if (ws->autosleep_enabled)
update_prevent_sleep_time(ws, now);
/*
* Increment the counter of registered wakeup events and decrement the
* couter of wakeup events in progress simultaneously.
*/
cec = atomic_add_return(MAX_IN_PROGRESS, &combined_event_count);
trace_wakeup_source_deactivate(ws->name, cec);
split_counters(&cnt, &inpr);
if (!inpr && waitqueue_active(&wakeup_count_wait_queue))
wake_up(&wakeup_count_wait_queue);
}
/**
* __pm_relax - Notify the PM core that processing of a wakeup event has ended.
* @ws: Wakeup source object associated with the source of the event.
*
* Call this function for wakeup events whose processing started with calling
* __pm_stay_awake().
*
* It is safe to call it from interrupt context.
*/
void __pm_relax(struct wakeup_source *ws)
{
unsigned long flags;
if (!ws)
return;
spin_lock_irqsave(&ws->lock, flags);
if (ws->active)
wakeup_source_deactivate(ws);
spin_unlock_irqrestore(&ws->lock, flags);
}
EXPORT_SYMBOL_GPL(__pm_relax);
/**
* pm_relax - Notify the PM core that processing of a wakeup event has ended.
* @dev: Device that signaled the event.
*
* Execute __pm_relax() for the @dev's wakeup source object.
*/
void pm_relax(struct device *dev)
{
unsigned long flags;
if (!dev)
return;
spin_lock_irqsave(&dev->power.lock, flags);
__pm_relax(dev->power.wakeup);
spin_unlock_irqrestore(&dev->power.lock, flags);
}
EXPORT_SYMBOL_GPL(pm_relax);
/**
* pm_wakeup_timer_fn - Delayed finalization of a wakeup event.
* @data: Address of the wakeup source object associated with the event source.
*
* Call wakeup_source_deactivate() for the wakeup source whose address is stored
* in @data if it is currently active and its timer has not been canceled and
* the expiration time of the timer is not in future.
*/
static void pm_wakeup_timer_fn(struct timer_list *t)
{
struct wakeup_source *ws = from_timer(ws, t, timer);
unsigned long flags;
spin_lock_irqsave(&ws->lock, flags);
if (ws->active && ws->timer_expires
&& time_after_eq(jiffies, ws->timer_expires)) {
wakeup_source_deactivate(ws);
ws->expire_count++;
}
spin_unlock_irqrestore(&ws->lock, flags);
}
/**
* pm_wakeup_ws_event - Notify the PM core of a wakeup event.
* @ws: Wakeup source object associated with the event source.
* @msec: Anticipated event processing time (in milliseconds).
* @hard: If set, abort suspends in progress and wake up from suspend-to-idle.
*
* Notify the PM core of a wakeup event whose source is @ws that will take
* approximately @msec milliseconds to be processed by the kernel. If @ws is
* not active, activate it. If @msec is nonzero, set up the @ws' timer to
* execute pm_wakeup_timer_fn() in future.
*
* It is safe to call this function from interrupt context.
*/
void pm_wakeup_ws_event(struct wakeup_source *ws, unsigned int msec, bool hard)
{
unsigned long flags;
unsigned long expires;
if (!ws)
return;
spin_lock_irqsave(&ws->lock, flags);
wakeup_source_report_event(ws, hard);
if (!msec) {
wakeup_source_deactivate(ws);
goto unlock;
}
expires = jiffies + msecs_to_jiffies(msec);
if (!expires)
expires = 1;
if (!ws->timer_expires || time_after(expires, ws->timer_expires)) {
mod_timer(&ws->timer, expires);
ws->timer_expires = expires;
}
unlock:
spin_unlock_irqrestore(&ws->lock, flags);
}
EXPORT_SYMBOL_GPL(pm_wakeup_ws_event);
/**
* pm_wakeup_dev_event - Notify the PM core of a wakeup event.
* @dev: Device the wakeup event is related to.
* @msec: Anticipated event processing time (in milliseconds).
* @hard: If set, abort suspends in progress and wake up from suspend-to-idle.
*
* Call pm_wakeup_ws_event() for the @dev's wakeup source object.
*/
void pm_wakeup_dev_event(struct device *dev, unsigned int msec, bool hard)
{
unsigned long flags;
if (!dev)
return;
spin_lock_irqsave(&dev->power.lock, flags);
pm_wakeup_ws_event(dev->power.wakeup, msec, hard);
spin_unlock_irqrestore(&dev->power.lock, flags);
}
EXPORT_SYMBOL_GPL(pm_wakeup_dev_event);
void pm_get_active_wakeup_sources(char *pending_wakeup_source, size_t max)
{
struct wakeup_source *ws, *last_active_ws = NULL;
int len = 0;
bool active = false;
rcu_read_lock();
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (ws->active && len < max) {
if (!active)
len += scnprintf(pending_wakeup_source, max,
"Pending Wakeup Sources: ");
len += scnprintf(pending_wakeup_source + len, max - len,
"%s ", ws->name);
active = true;
} else if (!active &&
(!last_active_ws ||
ktime_to_ns(ws->last_time) >
ktime_to_ns(last_active_ws->last_time))) {
last_active_ws = ws;
}
}
if (!active && last_active_ws) {
scnprintf(pending_wakeup_source, max,
"Last active Wakeup Source: %s",
last_active_ws->name);
}
rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(pm_get_active_wakeup_sources);
void pm_print_active_wakeup_sources(void)
{
struct wakeup_source *ws;
int srcuidx, active = 0;
struct wakeup_source *last_activity_ws = NULL;
srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (ws->active) {
pm_pr_dbg("active wakeup source: %s\n", ws->name);
active = 1;
} else if (!active &&
(!last_activity_ws ||
ktime_to_ns(ws->last_time) >
ktime_to_ns(last_activity_ws->last_time))) {
last_activity_ws = ws;
}
}
if (!active && last_activity_ws)
pm_pr_dbg("last active wakeup source: %s\n",
last_activity_ws->name);
srcu_read_unlock(&wakeup_srcu, srcuidx);
}
EXPORT_SYMBOL_GPL(pm_print_active_wakeup_sources);
/**
* pm_wakeup_pending - Check if power transition in progress should be aborted.
*
* Compare the current number of registered wakeup events with its preserved
* value from the past and return true if new wakeup events have been registered
* since the old value was stored. Also return true if the current number of
* wakeup events being processed is different from zero.
*/
bool pm_wakeup_pending(void)
{
unsigned long flags;
bool ret = false;
char suspend_abort[MAX_SUSPEND_ABORT_LEN];
raw_spin_lock_irqsave(&events_lock, flags);
if (events_check_enabled) {
unsigned int cnt, inpr;
split_counters(&cnt, &inpr);
ret = (cnt != saved_count || inpr > 0);
events_check_enabled = !ret;
}
raw_spin_unlock_irqrestore(&events_lock, flags);
if (ret) {
pm_pr_dbg("Wakeup pending, aborting suspend\n");
pm_print_active_wakeup_sources();
pm_get_active_wakeup_sources(suspend_abort,
MAX_SUSPEND_ABORT_LEN);
log_suspend_abort_reason(suspend_abort);
pr_info("PM: %s\n", suspend_abort);
}
return ret || atomic_read(&pm_abort_suspend) > 0;
}
void pm_system_wakeup(void)
{
atomic_inc(&pm_abort_suspend);
s2idle_wake();
}
EXPORT_SYMBOL_GPL(pm_system_wakeup);
void pm_system_cancel_wakeup(void)
{
atomic_dec_if_positive(&pm_abort_suspend);
}
EXPORT_SYMBOL_GPL(pm_system_cancel_wakeup);
void pm_wakeup_clear(unsigned int irq_number)
{
raw_spin_lock_irq(&wakeup_irq_lock);
if (irq_number && wakeup_irq[0] == irq_number)
wakeup_irq[0] = wakeup_irq[1];
else
wakeup_irq[0] = 0;
wakeup_irq[1] = 0;
raw_spin_unlock_irq(&wakeup_irq_lock);
if (!irq_number)
atomic_set(&pm_abort_suspend, 0);
}
void pm_system_irq_wakeup(unsigned int irq_number)
{
unsigned long flags;
raw_spin_lock_irqsave(&wakeup_irq_lock, flags);
if (wakeup_irq[0] == 0)
wakeup_irq[0] = irq_number;
else if (wakeup_irq[1] == 0)
wakeup_irq[1] = irq_number;
else
irq_number = 0;
raw_spin_unlock_irqrestore(&wakeup_irq_lock, flags);
if (irq_number) {
struct irq_desc *desc;
const char *name = "null";
if (msm_show_resume_irq_mask) {
desc = irq_to_desc(irq_number);
if (desc == NULL)
name = "stray irq";
else if (desc->action && desc->action->name)
name = desc->action->name;
log_irq_wakeup_reason(irq_number);
pr_warn("%s: %d triggered %s\n", __func__,
irq_number, name);
}
pm_system_wakeup();
}
}
unsigned int pm_wakeup_irq(void)
{
return wakeup_irq[0];
}
/**
* pm_get_wakeup_count - Read the number of registered wakeup events.
* @count: Address to store the value at.
* @block: Whether or not to block.
*
* Store the number of registered wakeup events at the address in @count. If
* @block is set, block until the current number of wakeup events being
* processed is zero.
*
* Return 'false' if the current number of wakeup events being processed is
* nonzero. Otherwise return 'true'.
*/
bool pm_get_wakeup_count(unsigned int *count, bool block)
{
unsigned int cnt, inpr;
if (block) {
DEFINE_WAIT(wait);
for (;;) {
prepare_to_wait(&wakeup_count_wait_queue, &wait,
TASK_INTERRUPTIBLE);
split_counters(&cnt, &inpr);
if (inpr == 0 || signal_pending(current))
break;
pm_print_active_wakeup_sources();
schedule();
}
finish_wait(&wakeup_count_wait_queue, &wait);
}
split_counters(&cnt, &inpr);
*count = cnt;
return !inpr;
}
/**
* pm_save_wakeup_count - Save the current number of registered wakeup events.
* @count: Value to compare with the current number of registered wakeup events.
*
* If @count is equal to the current number of registered wakeup events and the
* current number of wakeup events being processed is zero, store @count as the
* old number of registered wakeup events for pm_check_wakeup_events(), enable
* wakeup events detection and return 'true'. Otherwise disable wakeup events
* detection and return 'false'.
*/
bool pm_save_wakeup_count(unsigned int count)
{
unsigned int cnt, inpr;
unsigned long flags;
events_check_enabled = false;
raw_spin_lock_irqsave(&events_lock, flags);
split_counters(&cnt, &inpr);
if (cnt == count && inpr == 0) {
saved_count = count;
events_check_enabled = true;
}
raw_spin_unlock_irqrestore(&events_lock, flags);
return events_check_enabled;
}
#ifdef CONFIG_PM_AUTOSLEEP
/**
* pm_wakep_autosleep_enabled - Modify autosleep_enabled for all wakeup sources.
* @enabled: Whether to set or to clear the autosleep_enabled flags.
*/
void pm_wakep_autosleep_enabled(bool set)
{
struct wakeup_source *ws;
ktime_t now = ktime_get();
int srcuidx;
srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
spin_lock_irq(&ws->lock);
if (ws->autosleep_enabled != set) {
ws->autosleep_enabled = set;
if (ws->active) {
if (set)
ws->start_prevent_time = now;
else
update_prevent_sleep_time(ws, now);
}
}
spin_unlock_irq(&ws->lock);
}
srcu_read_unlock(&wakeup_srcu, srcuidx);
}
#endif /* CONFIG_PM_AUTOSLEEP */
/**
* print_wakeup_source_stats - Print wakeup source statistics information.
* @m: seq_file to print the statistics into.
* @ws: Wakeup source object to print the statistics for.
*/
static int print_wakeup_source_stats(struct seq_file *m,
struct wakeup_source *ws)
{
unsigned long flags;
ktime_t total_time;
ktime_t max_time;
unsigned long active_count;
ktime_t active_time;
ktime_t prevent_sleep_time;
spin_lock_irqsave(&ws->lock, flags);
total_time = ws->total_time;
max_time = ws->max_time;
prevent_sleep_time = ws->prevent_sleep_time;
active_count = ws->active_count;
if (ws->active) {
ktime_t now = ktime_get();
active_time = ktime_sub(now, ws->last_time);
total_time = ktime_add(total_time, active_time);
if (active_time > max_time)
max_time = active_time;
if (ws->autosleep_enabled)
prevent_sleep_time = ktime_add(prevent_sleep_time,
ktime_sub(now, ws->start_prevent_time));
} else {
active_time = 0;
}
seq_printf(m, "%-12s\t%lu\t\t%lu\t\t%lu\t\t%lu\t\t%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
ws->name, active_count, ws->event_count,
ws->wakeup_count, ws->expire_count,
ktime_to_ms(active_time), ktime_to_ms(total_time),
ktime_to_ms(max_time), ktime_to_ms(ws->last_time),
ktime_to_ms(prevent_sleep_time));
spin_unlock_irqrestore(&ws->lock, flags);
return 0;
}
static void *wakeup_sources_stats_seq_start(struct seq_file *m,
loff_t *pos)
{
struct wakeup_source *ws;
loff_t n = *pos;
int *srcuidx = m->private;
if (n == 0) {
seq_puts(m, "name\t\tactive_count\tevent_count\twakeup_count\t"
"expire_count\tactive_since\ttotal_time\tmax_time\t"
"last_change\tprevent_suspend_time\n");
}
*srcuidx = srcu_read_lock(&wakeup_srcu);
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (n-- <= 0)
return ws;
}
return NULL;
}
static void *wakeup_sources_stats_seq_next(struct seq_file *m,
void *v, loff_t *pos)
{
struct wakeup_source *ws = v;
struct wakeup_source *next_ws = NULL;
++(*pos);
list_for_each_entry_continue_rcu(ws, &wakeup_sources, entry) {
next_ws = ws;
break;
}
if (!next_ws)
print_wakeup_source_stats(m, &deleted_ws);
return next_ws;
}
static void wakeup_sources_stats_seq_stop(struct seq_file *m, void *v)
{
int *srcuidx = m->private;
srcu_read_unlock(&wakeup_srcu, *srcuidx);
}
/**
* wakeup_sources_stats_seq_show - Print wakeup sources statistics information.
* @m: seq_file to print the statistics into.
* @v: wakeup_source of each iteration
*/
static int wakeup_sources_stats_seq_show(struct seq_file *m, void *v)
{
struct wakeup_source *ws = v;
print_wakeup_source_stats(m, ws);
return 0;
}
static const struct seq_operations wakeup_sources_stats_seq_ops = {
.start = wakeup_sources_stats_seq_start,
.next = wakeup_sources_stats_seq_next,
.stop = wakeup_sources_stats_seq_stop,
.show = wakeup_sources_stats_seq_show,
};
static int wakeup_sources_stats_open(struct inode *inode, struct file *file)
{
return seq_open_private(file, &wakeup_sources_stats_seq_ops, sizeof(int));
}
static const struct file_operations wakeup_sources_stats_fops = {
.owner = THIS_MODULE,
.open = wakeup_sources_stats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_private,
};
static int __init wakeup_sources_debugfs_init(void)
{
debugfs_create_file("wakeup_sources", S_IRUGO, NULL, NULL,
&wakeup_sources_stats_fops);
return 0;
}
postcore_initcall(wakeup_sources_debugfs_init);