android_kernel_xiaomi_sm7250/drivers/cpufreq/scpi-cpufreq.c
UtsavBalar1231 07a77e09da Merge tag 'ASB-2021-01-05_4.19-stable' of https://github.com/aosp-mirror/kernel_common into android12-base
https://source.android.com/security/bulletin/2021-01-01
CVE-2020-10732
CVE-2020-10766
CVE-2021-0323

* tag 'ASB-2021-01-05_4.19-stable' of https://github.com/aosp-mirror/kernel_common:
  Revert "seq_buf: Avoid type mismatch for seq_buf_init"
  Linux 4.19.164
  platform/x86: mlx-platform: remove an unused variable
  PCI: Fix pci_slot_release() NULL pointer dereference
  platform/x86: intel-vbtn: Allow switch events on Acer Switch Alpha 12
  libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
  xenbus/xenbus_backend: Disallow pending watch messages
  xen/xenbus: Count pending messages for each watch
  xen/xenbus/xen_bus_type: Support will_handle watch callback
  xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
  xen/xenbus: Allow watches discard events before queueing
  xen-blkback: set ring->xenblkd to NULL after kthread_stop()
  clk: mvebu: a3700: fix the XTAL MODE pin to MPP1_9
  pinctrl: sunxi: Always call chained_irq_{enter, exit} in sunxi_pinctrl_irq_handler
  md/cluster: fix deadlock when node is doing resync job
  md/cluster: block reshape with remote resync job
  iio:imu:bmi160: Fix too large a buffer.
  iio:pressure:mpl3115: Force alignment of buffer
  iio:light:st_uvis25: Fix timestamp alignment and prevent data leak.
  iio:light:rpr0521: Fix timestamp alignment and prevent data leak.
  iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
  iio: buffer: Fix demux update
  scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free()
  scsi: lpfc: Fix invalid sleeping context in lpfc_sli4_nvmet_alloc()
  mtd: rawnand: qcom: Fix DMA sync on FLASH_STATUS register read
  mtd: parser: cmdline: Fix parsing of part-names with colons
  mtd: spinand: Fix OOB read
  soc: qcom: smp2p: Safely acquire spinlock without IRQs
  spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
  spi: st-ssc4: Fix unbalanced pm_runtime_disable() in probe error path
  spi: sc18is602: Don't leak SPI master in probe error path
  spi: rb4xx: Don't leak SPI master in probe error path
  spi: pic32: Don't leak DMA channels in probe error path
  spi: davinci: Fix use-after-free on unbind
  spi: spi-sh: Fix use-after-free on unbind
  drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor()
  jfs: Fix array index bounds check in dbAdjTree
  jffs2: Fix GC exit abnormally
  ubifs: wbuf: Don't leak kernel memory to flash
  SMB3.1.1: do not log warning message if server doesn't populate salt
  SMB3: avoid confusing warning message on mount to Azure
  ceph: fix race in concurrent __ceph_remove_cap invocations
  ima: Don't modify file descriptor mode on the fly
  powerpc/powernv/memtrace: Fix crashing the kernel when enabling concurrently
  powerpc/powernv/memtrace: Don't leak kernel memory to user space
  powerpc/xmon: Change printk() to pr_cont()
  powerpc/rtas: Fix typo of ibm,open-errinjct in RTAS filter
  powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at
  ARM: dts: at91: sama5d2: fix CAN message ram offset and size
  ARM: dts: pandaboard: fix pinmux for gpio user button of Pandaboard ES
  KVM: arm64: Introduce handling of AArch32 TTBCR2 traps
  ext4: fix deadlock with fs freezing and EA inodes
  ext4: fix a memory leak of ext4_free_data
  USB: serial: keyspan_pda: fix write unthrottling
  USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
  USB: serial: keyspan_pda: fix write-wakeup use-after-free
  USB: serial: keyspan_pda: fix stalled writes
  USB: serial: keyspan_pda: fix write deadlock
  USB: serial: keyspan_pda: fix dropped unthrottle interrupts
  USB: serial: digi_acceleport: fix write-wakeup deadlocks
  USB: serial: mos7720: fix parallel-port state restore
  EDAC/amd64: Fix PCI component registration
  crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
  powerpc/perf: Exclude kernel samples while counting events in user space.
  staging: comedi: mf6x4: Fix AI end-of-conversion detection
  s390/dasd: fix list corruption of lcu list
  s390/dasd: fix list corruption of pavgroup group list
  s390/dasd: prevent inconsistent LCU device data
  s390/dasd: fix hanging device offline processing
  s390/kexec_file: fix diag308 subcode when loading crash kernel
  s390/smp: perform initial CPU reset also for SMT siblings
  ALSA: usb-audio: Disable sample read check if firmware doesn't give back
  ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
  ALSA: hda/realtek: Apply jack fixup for Quanta NL3
  ALSA: hda/realtek: Add quirk for MSI-GP73
  ALSA: pcm: oss: Fix a few more UBSAN fixes
  ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
  ALSA: hda/realtek - Enable headset mic of ASUS X430UN with ALC256
  ALSA: hda: Fix regressions on clear and reconfig sysfs
  ACPI: PNP: compare the string length in the matching_id()
  Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
  PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
  ALSA: hda/ca0132 - Change Input Source enum strings.
  Input: cyapa_gen6 - fix out-of-bounds stack access
  media: ipu3-cio2: Make the field on subdev format V4L2_FIELD_NONE
  media: ipu3-cio2: Validate mbus format in setting subdev format
  media: ipu3-cio2: Serialise access to pad format
  media: ipu3-cio2: Return actual subdev format
  media: ipu3-cio2: Remove traces of returned buffers
  media: netup_unidvb: Don't leak SPI master in probe error path
  media: sunxi-cir: ensure IR is handled when it is continuous
  media: gspca: Fix memory leak in probe
  Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
  Input: cros_ec_keyb - send 'scancodes' in addition to key events
  lwt: Disable BH too in run_lwt_bpf()
  fix namespaced fscaps when !CONFIG_SECURITY
  cfg80211: initialize rekey_data
  ARM: sunxi: Add machine match for the Allwinner V3 SoC
  kconfig: fix return value of do_error_if()
  clk: sunxi-ng: Make sure divider tables have sentinel
  clk: s2mps11: Fix a resource leak in error handling paths in the probe function
  qlcnic: Fix error code in probe
  perf record: Fix memory leak when using '--user-regs=?' to list registers
  pwm: lp3943: Dynamically allocate PWM chip base
  pwm: zx: Add missing cleanup in error path
  clk: ti: Fix memleak in ti_fapll_synth_setup
  watchdog: coh901327: add COMMON_CLK dependency
  watchdog: qcom: Avoid context switch in restart handler
  libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
  net: korina: fix return value
  net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
  net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
  checkpatch: fix unescaped left brace
  powerpc/ps3: use dma_mapping_error()
  nfc: s3fwrn5: Release the nfc firmware
  um: chan_xterm: Fix fd leak
  um: tty: Fix handling of close in tty lines
  um: Monitor error events in IRQ controller
  watchdog: Fix potential dereferencing of null pointer
  watchdog: sprd: check busy bit before new loading rather than after that
  watchdog: sprd: remove watchdog disable from resume fail path
  watchdog: sirfsoc: Add missing dependency on HAS_IOMEM
  irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
  ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
  mac80211: don't set set TDLS STA bandwidth wider than possible
  extcon: max77693: Fix modalias string
  clk: tegra: Fix duplicated SE clock entry
  bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
  x86/kprobes: Restore BTF if the single-stepping is cancelled
  nfs_common: need lock during iterate through the list
  nfsd: Fix message level for normal termination
  speakup: fix uninitialized flush_lock
  usb: oxu210hp-hcd: Fix memory leak in oxu_create
  usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
  powerpc/pseries/hibernation: remove redundant cacheinfo update
  powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
  platform/x86: mlx-platform: Fix item counter assignment for MSN2700, MSN24xx systems
  scsi: fnic: Fix error return code in fnic_probe()
  seq_buf: Avoid type mismatch for seq_buf_init
  scsi: pm80xx: Fix error return in pm8001_pci_probe()
  scsi: qedi: Fix missing destroy_workqueue() on error in __qedi_probe
  cpufreq: scpi: Add missing MODULE_ALIAS
  cpufreq: loongson1: Add missing MODULE_ALIAS
  cpufreq: st: Add missing MODULE_DEVICE_TABLE
  cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
  cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
  clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
  dm ioctl: fix error return code in target_message
  ASoC: jz4740-i2s: add missed checks for clk_get()
  net/mlx5: Properly convey driver version to firmware
  memstick: r592: Fix error return in r592_probe()
  arm64: dts: rockchip: Fix UART pull-ups on rk3328
  pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
  ARM: dts: at91: sama5d2: map securam as device
  clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
  media: saa7146: fix array overflow in vidioc_s_audio()
  vfio-pci: Use io_remap_pfn_range() for PCI IO memory
  NFS: switch nfsiod to be an UNBOUND workqueue.
  lockd: don't use interval-based rebinding over TCP
  SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
  NFSv4.2: condition READDIR's mask for security label based on LSM state
  ath10k: Release some resources in an error handling path
  ath10k: Fix an error handling path
  ath10k: Fix the parsing error in service available event
  platform/x86: dell-smbios-base: Fix error return code in dell_smbios_init
  ARM: dts: at91: at91sam9rl: fix ADC triggers
  arm64: dts: meson: fix spi-max-frequency on Khadas VIM2
  PCI: iproc: Fix out-of-bound array accesses
  PCI: Fix overflow in command-line resource alignment requests
  PCI: Bounds-check command-line resource alignment requests
  genirq/irqdomain: Don't try to free an interrupt that has no mapping
  power: supply: bq24190_charger: fix reference leak
  power: supply: axp288_charger: Fix HP Pavilion x2 10 DMI matching
  arm64: dts: rockchip: Set dr_mode to "host" for OTG on rk3328-roc-cc
  ARM: dts: Remove non-existent i2c1 from 98dx3236
  HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
  slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
  media: max2175: fix max2175_set_csm_mode() error code
  mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
  samples: bpf: Fix lwt_len_hist reusing previous BPF map
  platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration
  platform/x86: mlx-platform: Remove PSU EEPROM from default platform configuration
  media: siano: fix memory leak of debugfs members in smsdvb_hotplug
  dmaengine: mv_xor_v2: Fix error return code in mv_xor_v2_probe()
  cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
  orinoco: Move context allocation after processing the skb
  ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
  ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
  memstick: fix a double-free bug in memstick_check
  RDMA/cxgb4: Validate the number of CQEs
  Input: omap4-keypad - fix runtime PM error handling
  drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
  soc: ti: Fix reference imbalance in knav_dma_probe
  soc: ti: knav_qmss: fix reference leak in knav_queue_probe
  spi: fix resource leak for drivers without .remove callback
  crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
  crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd
  powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
  spi: mxs: fix reference leak in mxs_spi_probe
  usb/max3421: fix return error code in max3421_probe()
  Input: ads7846 - fix unaligned access on 7845
  Input: ads7846 - fix integer overflow on Rt calculation
  Input: ads7846 - fix race that causes missing releases
  drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
  video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init()
  media: solo6x10: fix missing snd_card_free in error handling case
  scsi: core: Fix VPD LUN ID designator priorities
  ASoC: meson: fix COMPILE_TEST error
  media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
  media: tm6000: Fix sizeof() mismatches
  staging: gasket: interrupt: fix the missed eventfd_ctx_put() in gasket_interrupt.c
  staging: greybus: codecs: Fix reference counter leak in error handling
  crypto: qat - fix status check in qat_hal_put_rel_rd_xfer()
  MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
  RDMa/mthca: Work around -Wenum-conversion warning
  ASoC: arizona: Fix a wrong free in wm8997_probe
  ASoC: wm8998: Fix PM disable depth imbalance on error
  mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
  spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume
  spi: tegra114: fix reference leak in tegra spi ops
  spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
  spi: tegra20-slink: fix reference leak in slink ops of tegra20
  spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
  Bluetooth: hci_h5: fix memory leak in h5_close
  Bluetooth: Fix null pointer dereference in hci_event_packet()
  arm64: dts: exynos: Correct psci compatible used on Exynos7
  arm64: dts: exynos: Include common syscon restart/poweroff for Exynos7
  selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
  ASoC: pcm: DRAIN support reactivation
  drm/msm/dsi_pll_10nm: restore VCO rate during restore_state
  spi: img-spfi: fix reference leak in img_spfi_resume
  powerpc/64: Set up a kernel stack for secondaries before cpu_restore()
  crypto: inside-secure - Fix sizeof() mismatch
  crypto: talitos - Fix return type of current_desc_hdr()
  crypto: talitos - Endianess in current_desc_hdr()
  sched: Reenable interrupts in do_sched_yield()
  sched/deadline: Fix sched_dl_global_validate()
  x86/apic: Fix x2apic enablement without interrupt remapping
  ARM: p2v: fix handling of LPAE translation in BE mode
  x86/mm/ident_map: Check for errors from ident_pud_init()
  RDMA/rxe: Compute PSN windows correctly
  ARM: dts: aspeed: s2600wf: Fix VGA memory region location
  selinux: fix error initialization in inode_doinit_with_dentry()
  RDMA/bnxt_re: Set queue pair state when being queried
  soc: qcom: geni: More properly switch to DMA mode
  soc: mediatek: Check if power domains can be powered on at boot time
  soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
  drm/tve200: Fix handling of platform_get_irq() error
  drm/gma500: fix double free of gma_connector
  perf cs-etm: Move definition of 'traceid_list' global variable from header file
  perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata
  md: fix a warning caused by a race between concurrent md_ioctl()s
  crypto: af_alg - avoid undefined behavior accessing salg_name
  media: msi2500: assign SPI bus number dynamically
  quota: Sanity-check quota file headers on load
  Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
  serial_core: Check for port state when tty is in error state
  HID: i2c-hid: add Vero K147 to descriptor override
  scsi: megaraid_sas: Check user-provided offsets
  coresight: tmc-etr: Check if page is valid before dma_map_page()
  ARM: dts: exynos: fix USB 3.0 pins supply being turned off on Odroid XU
  ARM: dts: exynos: fix USB 3.0 VBUS control and over-current pins on Exynos5410
  ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU
  usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
  USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
  usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus
  USB: gadget: f_midi: setup SuperSpeed Plus descriptors
  USB: gadget: f_acm: add support for SuperSpeed Plus
  USB: serial: option: add interface-number sanity check to flag handling
  soc/tegra: fuse: Fix index bug in get_process_id
  dm table: Remove BUG_ON(in_interrupt())
  scsi: mpt3sas: Increase IOCInit request timeout to 30s
  vxlan: Copy needed_tailroom from lowerdev
  vxlan: Add needed_headroom for lower device
  arm64: syscall: exit userspace before unmasking exceptions
  drm/tegra: sor: Disable clocks on error in tegra_sor_init()
  kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
  drm/tegra: replace idr_init() by idr_init_base()
  ixgbe: avoid premature Rx buffer reuse
  RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
  selftests/bpf/test_offload.py: Reset ethtool features after failed setting
  gpio: eic-sprd: break loop when getting NULL device resource
  netfilter: x_tables: Switch synchronization to RCU
  block: factor out requeue handling from dispatch code
  clk: renesas: r9a06g032: Drop __packed for portability
  can: softing: softing_netdev_open(): fix error handling
  xsk: Fix xsk_poll()'s return type
  scsi: bnx2i: Requires MMU
  gpio: mvebu: fix potential user-after-free on probe
  ARM: dts: sun8i: v3s: fix GIC node memory range
  pinctrl: baytrail: Avoid clearing debounce value when turning it off
  pinctrl: merrifield: Set default bias in case no particular value given
  x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
  x86/resctrl: Remove unused struct mbm_state::chunks_bw
  arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S
  arm64: lse: Fix LSE atomics with LLVM
  arm64: lse: fix LSE atomics with LLVM's integrated assembler
  drm: fix drm_dp_mst_port refcount leaks in drm_dp_mst_allocate_vcpi
  drm/xen-front: Fix misused IS_ERR_OR_NULL checks
  serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
  ALSA: pcm: oss: Fix potential out-of-bounds shift
  USB: sisusbvga: Make console support depend on BROKEN
  USB: UAS: introduce a quirk to set no_write_same
  xhci: Give USB2 ports time to enter U3 in bus suspend
  ALSA: usb-audio: Fix control 'access overflow' errors from chmap
  ALSA: usb-audio: Fix potential out-of-bounds shift
  USB: add RESET_RESUME quirk for Snapscan 1212
  USB: dummy-hcd: Fix uninitialized array use in init()
  ktest.pl: If size of log is too big to email, email error message
  net: bridge: vlan: fix error return code in __vlan_add()
  net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux
  net: stmmac: delete the eee_ctrl_timer after napi disabled
  net/mlx4_en: Handle TX error CQE
  lan743x: fix for potential NULL pointer dereference with bare card
  net/mlx4_en: Avoid scheduling restart task if it is already running
  tcp: fix cwnd-limited bug for TSO deferral where we send nothing
  tcp: select sane initial rcvq_space.space for big MSS
  net: stmmac: free tx skb buffer in stmmac_resume()
  mac80211: mesh: fix mesh_pathtbl_init() error path
  PCI: qcom: Add missing reset for ipq806x
  compiler.h: fix barrier_data() on clang
  x86/apic/vector: Fix ordering in vector assignment
  x86/membarrier: Get rid of a dubious optimization
  x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
  scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
  kbuild: avoid static_assert for genksyms
  mmc: block: Fixup condition for CMD13 polling for RPMB requests
  pinctrl: amd: remove debounce filter setting in IRQ type setting
  Input: i8042 - add Acer laptops to the i8042 reset list
  Input: cm109 - do not stomp on control URB
  platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC
  platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
  platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for Thinkpad Yoga 11e 4th gen
  platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11e
  soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)
  irqchip/gic-v3-its: Unconditionally save/restore the ITS state on suspend
  scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE
  ARC: stack unwinding: don't assume non-current task is sleeping
  powerpc: Drop -me200 addition to build flags
  iwlwifi: mvm: fix kernel panic in case of assert during CSA
  arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.
  iwlwifi: pcie: limit memory read spin time
  spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
  spi: bcm2835aux: Fix use-after-free on unbind
  x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S
  Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  ANDROID: GKI: Update the ABI xml representation
  ANDROID: Incremental fs: Set credentials before reading/writing
  ANDROID: Incremental fs: Fix incfs_test use of atol, open
  ANDROID: Incremental fs: Change per UID timeouts to microseconds
  ANDROID: Incremental fs: Add v2 feature flag
  ANDROID: Incremental fs: Add zstd feature flag
  Linux 4.19.163
  Revert "geneve: pull IP header before ECN decapsulation"
  x86/insn-eval: Use new for_each_insn_prefix() macro to loop over prefixes bytes
  netfilter: nf_tables: avoid false-postive lockdep splat
  Input: i8042 - fix error return code in i8042_setup_aux()
  dm writecache: remove BUG() and fail gracefully instead
  i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
  gfs2: check for empty rgrp tree in gfs2_ri_update
  tracing: Fix userstacktrace option for instances
  spi: bcm2835: Release the DMA channel if probe fails after dma_init
  spi: bcm2835: Fix use-after-free on unbind
  spi: bcm-qspi: Fix use-after-free on unbind
  spi: Introduce device-managed SPI controller allocation
  iommu/amd: Set DTE[IntTabLen] to represent 512 IRTEs
  speakup: Reject setting the speakup line discipline outside of speakup
  i2c: imx: Check for I2SR_IAL after every byte
  i2c: imx: Fix reset of I2SR_IAL flag
  x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes
  mm/swapfile: do not sleep with a spin lock held
  mm: list_lru: set shrinker map bit when child nr_items is not zero
  dm: remove invalid sparse __acquires and __releases annotations
  dm writecache: fix the maximum number of arguments
  scsi: mpt3sas: Fix ioctl timeout
  i2c: imx: Don't generate STOP condition if arbitration has been lost
  cifs: fix potential use-after-free in cifs_echo_request()
  ftrace: Fix updating FTRACE_FL_TRAMP
  ALSA: hda/generic: Add option to enforce preferred_dacs pairs
  ALSA: hda/realtek - Add new codec supported for ALC897
  ALSA: hda/realtek: Enable headset of ASUS UX482EG & B9400CEA with ALC294
  ALSA: hda/realtek: Add mute LED quirk to yet another HP x360 model
  tty: Fix ->session locking
  tty: Fix ->pgrp locking in tiocspgrp()
  USB: serial: option: fix Quectel BG96 matching
  USB: serial: option: add support for Thales Cinterion EXS82
  USB: serial: option: add Fibocom NL668 variants
  USB: serial: ch341: sort device-id entries
  USB: serial: ch341: add new Product ID for CH341A
  USB: serial: kl5kusb105: fix memleak on open
  usb: gadget: f_fs: Use local copy of descriptors for userspace copy
  pinctrl: baytrail: Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH)
  pinctrl: baytrail: Replace WARN with dev_info_once when setting direct-irq pin to output
  ANDROID: Add symbol of get_next_event_cpu back
  ANDROID: x86: configs: gki: add missing CONFIG_BLK_CGROUP
  ANDROID: Add allowed symbols from sctp.ko and qrtr.ko
  Linux 4.19.162
  RDMA/i40iw: Address an mmap handler exploit in i40iw
  tracing: Remove WARN_ON in start_thread()
  Input: i8042 - add ByteSpeed touchpad to noloop table
  Input: xpad - support Ardwiino Controllers
  ALSA: usb-audio: US16x08: fix value count for level meters
  dt-bindings: net: correct interrupt flags in examples
  chelsio/chtls: fix panic during unload reload chtls
  net/mlx5: Fix wrong address reclaim when command interface is down
  net: mvpp2: Fix error return code in mvpp2_open()
  chelsio/chtls: fix a double free in chtls_setkey()
  net: pasemi: fix error return code in pasemi_mac_open()
  cxgb3: fix error return code in t3_sge_alloc_qset()
  net/x25: prevent a couple of overflows
  net: ip6_gre: set dev->hard_header_len when using header_ops
  geneve: pull IP header before ECN decapsulation
  ibmvnic: Fix TX completion error handling
  ibmvnic: Ensure that SCRQ entry reads are correctly ordered
  ipv4: Fix tos mask in inet_rtm_getroute()
  netfilter: bridge: reset skb->pkt_type after NF_INET_POST_ROUTING traversal
  bonding: wait for sysfs kobject destruction before freeing struct slave
  i40e: Fix removing driver while bare-metal VFs pass traffic
  ibmvnic: fix call_netdevice_notifiers in do_reset
  net/tls: Protect from calling tls_dev_del for TLS RX twice
  usbnet: ipheth: fix connectivity with iOS 14
  tun: honor IOCB_NOWAIT flag
  tcp: Set INET_ECN_xmit configuration in tcp_reinit_congestion_control
  sock: set sk_err to ee_errno on dequeue from errq
  rose: Fix Null pointer dereference in rose_send_frame()
  net/tls: missing received data after fast remote close
  net/af_iucv: set correct sk_protocol for child sockets
  ipv6: addrlabel: fix possible memory leak in ip6addrlbl_net_init
  FROMLIST: Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  ANDROID: kbuild: use grep -F instead of fgrep
  ANDROID: GKI: usb: gadget: support claiming indexed endpoints by name
  UPSTREAM: arm64: sysreg: Clean up instructions for modifying PSTATE fields
  Revert "Revert "ANDROID: clang: update to 11.0.5""
  ANDROID: kbuild: speed up ksym_dep_filter
  Revert "drm/atomic_helper: Stop modesets on unregistered connectors harder"
  Linux 4.19.161
  USB: core: Fix regression in Hercules audio card
  x86/resctrl: Add necessary kernfs_put() calls to prevent refcount leak
  x86/resctrl: Remove superfluous kernfs_get() calls to prevent refcount leak
  x86/speculation: Fix prctl() when spectre_v2_user={seccomp,prctl},ibpb
  usb: gadget: Fix memleak in gadgetfs_fill_super
  USB: quirks: Add USB_QUIRK_DISCONNECT_SUSPEND quirk for Lenovo A630Z TIO built-in usb-audio card
  usb: gadget: f_midi: Fix memleak in f_midi_alloc
  USB: core: Change %pK for __user pointers to %px
  perf probe: Fix to die_entrypc() returns error correctly
  can: m_can: fix nominal bitiming tseg2 min for version >= 3.1
  platform/x86: toshiba_acpi: Fix the wrong variable assignment
  platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time
  can: gs_usb: fix endianess problem with candleLight firmware
  efivarfs: revert "fix memory leak in efivarfs_create()"
  optee: add writeback to valid memory type
  ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq
  ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues
  net: ena: set initial DMA width to avoid intel iommu issue
  nfc: s3fwrn5: use signed integer for parsing GPIO numbers
  IB/mthca: fix return value of error branch in mthca_init_cq()
  s390/qeth: fix tear down of async TX buffers
  cxgb4: fix the panic caused by non smac rewrite
  bnxt_en: Release PCI regions when DMA mask setup fails during probe.
  video: hyperv_fb: Fix the cache type when mapping the VRAM
  bnxt_en: fix error return code in bnxt_init_board()
  bnxt_en: fix error return code in bnxt_init_one()
  scsi: ufs: Fix race between shutdown and runtime resume flow
  ARM: dts: dra76x: m_can: fix order of clocks
  batman-adv: set .owner to THIS_MODULE
  phy: tegra: xusb: Fix dangling pointer on probe failure
  xtensa: uaccess: Add missing __user to strncpy_from_user() prototype
  perf/x86: fix sysfs type mismatches
  scsi: target: iscsi: Fix cmd abort fabric stop race
  scsi: libiscsi: Fix NOP race condition
  dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size
  nvme: free sq/cq dbbuf pointers when dbbuf set fails
  proc: don't allow async path resolution of /proc/self components
  HID: Add Logitech Dinovo Edge battery quirk
  x86/xen: don't unbind uninitialized lock_kicker_irq
  dmaengine: xilinx_dma: use readl_poll_timeout_atomic variant
  HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices
  HID: hid-sensor-hub: Fix issue with devices with no report ID
  Input: i8042 - allow insmod to succeed on devices without an i8042 controller
  HID: add support for Sega Saturn
  HID: cypress: Support Varmilo Keyboards' media hotkeys
  ALSA: hda/hdmi: fix incorrect locking in hdmi_pcm_close
  drm/atomic_helper: Stop modesets on unregistered connectors harder
  arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()
  arm64: pgtable: Fix pte_accessible()
  KVM: x86: Fix split-irqchip vs interrupt injection window request
  KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint
  KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace
  wireless: Use linux/stddef.h instead of stddef.h
  btrfs: fix lockdep splat when reading qgroup config on mount
  btrfs: don't access possibly stale fs_info data for printing duplicate device
  netfilter: clear skb->next in NF_HOOK_LIST()
  perf event: Check ref_reloc_sym before using it
  ANDROID: vmlinux.lds.h: merge compound literal sections
  BACKPORT: sched/fair: Fix overutilized update in enqueue_task_fair()
  Linux 4.19.160
  mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()
  x86/microcode/intel: Check patch signature before saving microcode for early loading
  seccomp: Set PF_SUPERPRIV when checking capability
  ptrace: Set PF_SUPERPRIV when checking capability
  s390/dasd: fix null pointer dereference for ERP requests
  s390/cpum_sf.c: fix file permission for cpum_sfb_size
  mac80211: free sta in sta_info_insert_finish() on errors
  mac80211: minstrel: fix tx status processing corner case
  mac80211: minstrel: remove deferred sampling code
  xtensa: disable preemption around cache alias management calls
  regulator: workaround self-referent regulators
  regulator: avoid resolve_supply() infinite recursion
  regulator: fix memory leak with repeated set_machine_constraints()
  regulator: pfuze100: limit pfuze-support-disable-sw to pfuze{100,200}
  iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode
  iio: accel: kxcjk1013: Replace is_smo8500_device with an acpi_type enum
  ext4: fix bogus warning in ext4_update_dx_flag()
  staging: rtl8723bs: Add 024c:0627 to the list of SDIO device-ids
  efivarfs: fix memory leak in efivarfs_create()
  tty: serial: imx: keep console clocks always on
  ALSA: hda/realtek: Add some Clove SSID in the ALC293(ALC1220)
  ALSA: mixart: Fix mutex deadlock
  ALSA: ctl: fix error path at adding user-defined element set
  ALSA: usb-audio: Add delay quirk for all Logitech USB devices
  ALSA: firewire: Clean up a locking issue in copy_resp_to_buf()
  speakup: Do not let the line discipline be used several times
  libfs: fix error cast of negative value in simple_attr_write()
  efi/x86: Free efi_pgd with free_pages()
  xfs: revert "xfs: fix rmap key and record comparison functions"
  fail_function: Remove a redundant mutex unlock
  regulator: ti-abb: Fix array out of bound read access on the first transition
  xfs: strengthen rmap record flags checking
  xfs: fix the minrecs logic when dealing with inode root child blocks
  can: kvaser_usb: kvaser_usb_hydra: Fix KCAN bittiming limits
  drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()
  MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu
  ASoC: qcom: lpass-platform: Fix memory leak
  can: m_can: m_can_handle_state_change(): fix state change
  can: peak_usb: fix potential integer overflow on shift of a int
  can: mcba_usb: mcba_usb_start_xmit(): first fill skb, then pass to can_put_echo_skb()
  can: ti_hecc: Fix memleak in ti_hecc_probe
  can: dev: can_restart(): post buffer from the right context
  can: af_can: prevent potential access of uninitialized member in canfd_rcv()
  can: af_can: prevent potential access of uninitialized member in can_rcv()
  ip_tunnels: Set tunnel option flag when tunnel metadata is present
  perf lock: Don't free "lock_seq_stat" if read_count isn't zero
  Input: resistive-adc-touch - fix kconfig dependency on IIO_BUFFER
  ARM: dts: imx50-evk: Fix the chip select 1 IOMUX
  arm: dts: imx6qdl-udoo: fix rgmii phy-mode for ksz9031 phy
  arm64: dts: allwinner: h5: OrangePi Prime: Fix ethernet node
  MIPS: export has_transparent_hugepage() for modules
  Input: adxl34x - clean up a data type in adxl34x_probe()
  arm64: dts: allwinner: a64: bananapi-m64: Enable RGMII RX/TX delay on PHY
  ARM: dts: sun8i: a83t: Enable both RGMII RX/TX delay on Ethernet PHY
  ARM: dts: sun8i: h3: orangepi-plus2e: Enable RGMII RX/TX delay on Ethernet PHY
  Revert "arm: sun8i: orangepi-pc-plus: Set EMAC activity LEDs to active high"
  ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix ethernet node
  arm64: dts: allwinner: h5: OrangePi PC2: Fix ethernet node
  arm64: dts: allwinner: a64: Pine64 Plus: Fix ethernet node
  vfs: remove lockdep bogosity in __sb_start_write
  arm64: psci: Avoid printing in cpu_psci_cpu_die()
  ACPI: button: Add DMI quirk for Medion Akoya E2228T
  selftests: kvm: Fix the segment descriptor layout to match the actual layout
  scsi: ufs: Fix unbalanced scsi_block_reqs_cnt caused by ufshcd_hold()
  pinctrl: rockchip: enable gpio pclk for rockchip_gpio_to_irq
  net: ftgmac100: Fix crash when removing driver
  net/ncsi: Fix netlink registration
  net: usb: qmi_wwan: Set DTR quirk for MR400
  net/mlx5: Disable QoS when min_rates on all VFs are zero
  tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
  sctp: change to hold/put transport for proto_unreach_timer
  qlcnic: fix error return code in qlcnic_83xx_restart_hw()
  qed: fix error return code in qed_iwarp_ll2_start()
  page_frag: Recover from memory pressure
  net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request
  net: qualcomm: rmnet: Fix incorrect receive packet handling during cleanup
  net/mlx4_core: Fix init_hca fields offset
  netlabel: fix an uninitialized warning in netlbl_unlabel_staticlist()
  netlabel: fix our progress tracking in netlbl_unlabel_staticlist()
  net: Have netpoll bring-up DSA management interface
  net: dsa: mv88e6xxx: Avoid VTU corruption on 6097
  net: bridge: add missing counters to ndo_get_stats64 callback
  net: b44: fix error return code in b44_init_one()
  mlxsw: core: Use variable timeout for EMAD retries
  lan743x: prevent entire kernel HANG on open, for some platforms
  lan743x: fix issue causing intermittent kernel log warnings
  inet_diag: Fix error path to cancel the meseage in inet_req_diag_fill()
  devlink: Add missing genlmsg_cancel() in devlink_nl_sb_port_pool_fill()
  bnxt_en: read EEPROM A2h address using page 0
  atm: nicstar: Unmap DMA on send error
  ah6: fix error return code in ah6_input()
  Linux 4.19.159
  ACPI: GED: fix -Wformat
  KVM: x86: clflushopt should be treated as a no-op by emulation
  can: proc: can_remove_proc(): silence remove_proc_entry warning
  mac80211: always wind down STA state
  Input: sunkbd - avoid use-after-free in teardown paths
  powerpc/8xx: Always fault when _PAGE_ACCESSED is not set
  Revert "perf cs-etm: Move definition of 'traceid_list' global variable from header file"
  powerpc/64s: flush L1D after user accesses
  powerpc/uaccess: Evaluate macro arguments once, before user access is allowed
  powerpc: Fix __clear_user() with KUAP enabled
  powerpc: Implement user_access_begin and friends
  powerpc: Add a framework for user access tracking
  powerpc/64s: flush L1D on kernel entry
  powerpc/64s: move some exception handlers out of line
  ANDROID: GKI: Update ABI for incfs and dm-user
  Revert "ANDROID: Add dependencies of dm-user.ko"
  ANDROID: Incremental fs: Add zstd compression support
  ANDROID: Incremental fs: Small improvements
  ANDROID: Incremental fs: Initialize mount options correctly
  ANDROID: Incremental fs: Fix read_log_test which failed sporadically
  ANDROID: Incremental fs: Fix misuse of cpu_to_leXX and poll return
  ANDROID: Incremental fs: Add per UID read timeouts
  ANDROID: Incremental fs: Add .incomplete folder
  ANDROID: Incremental fs: Fix dangling else
  ANDROID: Incremental fs: Fix uninitialized variable
  ANDROID: Incremental fs: Fix filled block count from get filled blocks
  ANDROID: Incremental fs: Add hash block counts to IOC_IOCTL_GET_BLOCK_COUNT
  ANDROID: Incremental fs: Add INCFS_IOC_GET_BLOCK_COUNT
  ANDROID: Incremental fs: Make compatible with existing files
  ANDROID: Incremental fs: Remove block HASH flag
  ANDROID: Incremental fs: Remove back links and crcs
  ANDROID: Incremental fs: Remove attributes from file
  ANDROID: Incremental fs: Add .blocks_written file
  ANDROID: Incremental fs: Separate pseudo-file code
  ANDROID: Incremental fs: Add UID to pending_read
  ANDROID: Incremental fs: Create mapped file
  ANDROID: Incremental fs: Don't allow renaming .index directory.
  ANDROID: Incremental fs: Fix incfs to work on virtio-9p
  ANDROID: Incremental fs: Allow running a single test
  ANDROID: Incremental fs: Adding perf test
  ANDROID: Incremental fs: Stress tool
  ANDROID: Incremental fs: Use R/W locks to read/write segment blockmap.
  ANDROID: Incremental fs: Remove unnecessary dependencies
  ANDROID: Incremental fs: Remove annoying pr_debugs
  ANDROID: Incremental fs: dentry_revalidate should not return -EBADF.
  ANDROID: Incremental fs: Fix minor bugs
  ANDROID: Incremental fs: RCU locks instead of mutex for pending_reads.
  ANDROID: Incremental fs: fix up attempt to copy structures with READ/WRITE_ONCE
  Revert "ANDROID: clang: update to 11.0.5"
  Linux 4.19.158
  Convert trailing spaces and periods in path components
  net: sch_generic: fix the missing new qdisc assignment bug
  reboot: fix overflow parsing reboot cpu number
  Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
  perf/core: Fix race in the perf_mmap_close() function
  perf scripting python: Avoid declaring function pointers with a visibility attribute
  x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
  random32: make prandom_u32() output unpredictable
  r8169: fix potential skb double free in an error path
  vrf: Fix fast path output packet handling with async Netfilter rules
  tipc: fix memory leak in tipc_topsrv_start()
  net/x25: Fix null-ptr-deref in x25_connect
  net: Update window_clamp if SOCK_RCVBUF is set
  net/af_iucv: fix null pointer dereference on shutdown
  IPv6: Set SIT tunnel hard_header_len to zero
  swiotlb: fix "x86: Don't panic if can not alloc buffer for swiotlb"
  erofs: derive atime instead of leaving it empty
  pinctrl: amd: fix incorrect way to disable debounce filter
  pinctrl: amd: use higher precision for 512 RtcClk
  drm/gma500: Fix out-of-bounds access to struct drm_device.vblank[]
  don't dump the threads that had been already exiting when zapped.
  mmc: renesas_sdhi_core: Add missing tmio_mmc_host_free() at remove
  gpio: pcie-idio-24: Enable PEX8311 interrupts
  gpio: pcie-idio-24: Fix IRQ Enable Register value
  gpio: pcie-idio-24: Fix irq mask when masking
  selinux: Fix error return code in sel_ib_pkey_sid_slow()
  btrfs: fix potential overflow in cluster_pages_for_defrag on 32bit arch
  ocfs2: initialize ip_next_orphan
  futex: Don't enable IRQs unconditionally in put_pi_state()
  mei: protect mei_cl_mtu from null dereference
  xhci: hisilicon: fix refercence leak in xhci_histb_probe
  usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode
  uio: Fix use-after-free in uio_unregister_device()
  thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
  thunderbolt: Fix memory leak if ida_simple_get() fails in enumerate_services()
  btrfs: dev-replace: fail mount if we don't have replace item with target device
  btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
  ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
  ext4: correctly report "not supported" for {usr,grp}jquota when !CONFIG_QUOTA
  perf: Fix get_recursion_context()
  cosa: Add missing kfree in error path of cosa_write
  of/address: Fix of_node memory leak in of_dma_is_coherent
  xfs: fix a missing unlock on error in xfs_fs_map_blocks
  lan743x: fix "BUG: invalid wait context" when setting rx mode
  xfs: fix brainos in the refcount scrubber's rmap fragment processor
  xfs: fix rmap key and record comparison functions
  xfs: set the unwritten bit in rmap lookup flags in xchk_bmap_get_rmapextents
  xfs: fix flags argument to rmap lookup when converting shared file rmaps
  nbd: fix a block_device refcount leak in nbd_release
  pinctrl: aspeed: Fix GPI only function problem.
  ARM: 9019/1: kprobes: Avoid fortify_panic() when copying optprobe template
  pinctrl: intel: Set default bias in case no particular value given
  mfd: sprd: Add wakeup capability for PMIC IRQ
  tick/common: Touch watchdog in tick_unfreeze() on all CPUs
  tpm_tis: Disable interrupts on ThinkPad T490s
  selftests: proc: fix warning: _GNU_SOURCE redefined
  vfio: platform: fix reference leak in vfio_platform_open
  s390/smp: move rcu_cpu_starting() earlier
  iommu/amd: Increase interrupt remapping table limit to 512 entries
  scsi: scsi_dh_alua: Avoid crash during alua_bus_detach()
  cfg80211: regulatory: Fix inconsistent format argument
  mac80211: fix use of skb payload instead of header
  drm/amd/pm: do not use ixFEATURE_STATUS for checking smc running
  drm/amd/pm: perform SMC reset on suspend/hibernation
  drm/amdgpu: perform srbm soft reset always on SDMA resume
  scsi: hpsa: Fix memory leak in hpsa_init_one()
  gfs2: check for live vs. read-only file system in gfs2_fitrim
  gfs2: Add missing truncate_inode_pages_final for sd_aspace
  gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
  usb: gadget: goku_udc: fix potential crashes in probe
  crypto: arm64/aes-modes - get rid of literal load of addend vector
  netfilter: use actual socket sk rather than skb sk when routing harder
  ath9k_htc: Use appropriate rs_datalen type
  Btrfs: fix missing error return if writeback for extent buffer never started
  tpm: efi: Don't create binary_bios_measurements file for an empty log
  xfs: fix scrub flagging rtinherit even if there is no rt device
  xfs: flush new eof page on truncate to avoid post-eof corruption
  can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A
  can: peak_canfd: pucan_handle_can_rx(): fix echo management when loopback is on
  can: peak_usb: peak_usb_get_ts_time(): fix timestamp wrapping
  can: peak_usb: add range checking in decode operations
  can: can_create_echo_skb(): fix echo skb generation: always use skb_clone()
  can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames
  can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context
  can: rx-offload: don't call kfree_skb() from IRQ context
  ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
  perf tools: Add missing swap for ino_generation
  netfilter: ipset: Update byte and packet counters regardless of whether they match
  xfs: set xefi_discard when creating a deferred agfl free log intent item
  net: xfrm: fix a race condition during allocing spi
  hv_balloon: disable warning when floor reached
  genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY
  btrfs: reschedule when cloning lots of extents
  btrfs: sysfs: init devices outside of the chunk_mutex
  usb: dwc3: gadget: Reclaim extra TRBs after request completion
  usb: dwc3: gadget: Continue to process pending requests
  nbd: don't update block size after device is started
  time: Prevent undefined behaviour in timespec64_to_ns()
  regulator: defer probe when trying to get voltage from unresolved supply
  FROMGIT: Input: Add devices for HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE
  ANDROID: arm64: Fix off-by-one vdso trampoline return value
  ANDROID: Add dependencies of dm-user.ko
  UPSTREAM: arm64: vdso: Add -fasynchronous-unwind-tables to cflags
  UPSTREAM: of: property: Fix create device links for all child-supplier dependencies
  UPSTREAM: of: property: Do not link to disabled devices
  UPSTREAM: drm: Fix doc warning in drm_connector_attach_edid_property()
  UPSTREAM: selinux: fix non-MLS handling in mls_context_to_sid()
  UPSTREAM: drm/prime: Fix drm_gem_prime_mmap() stack use
  UPSTREAM: crypto: chacha-generic - fix use as arm64 no-NEON fallback
  UPSTREAM: slab: store tagged freelist for off-slab slabmgmt
  UPSTREAM: parisc: Switch from DISCONTIGMEM to SPARSEMEM
  UPSTREAM: cgroup: Move cgroup_parse_float() implementation out of CONFIG_SYSFS
  UPSTREAM: fork: don't check parent_tidptr with CLONE_PIDFD
  UPSTREAM: vdso: Remove superfluous #ifdef __KERNEL__ in vdso/datapage.h
  UPSTREAM: arm64: compat: No need for pre-ARMv7 barriers on an ARMv8 system
  UPSTREAM: timekeeping/vsyscall: Use __iter_div_u64_rem()
  UPSTREAM: kasan: remove clang version check for KASAN_STACK
  UPSTREAM: page flags: prioritize kasan bits over last-cpuid
  UPSTREAM: timekeeping/vsyscall: Prevent math overflow in BOOTTIME update
  UPSTREAM: kcm: disable preemption in kcm_parse_func_strparser()
  UPSTREAM: cfg80211: validate SSID/MBSSID element ordering assumption
  UPSTREAM: MIPS: VDSO: Fix build for binutils < 2.25
  UPSTREAM: virt_wifi: fix refcnt leak in module exit routine
  UPSTREAM: sched/topology: Allow sched_asym_cpucapacity to be disabled
  UPSTREAM: scripts/tools-support-relr.sh: un-quote variables
  UPSTREAM: fork: fix pidfd_poll()'s return type
  UPSTREAM: virt_wifi: fix use-after-free in virt_wifi_newlink()
  UPSTREAM: of/platform: Unconditionally pause/resume sync state during kernel init
  UPSTREAM: selinux: ensure the policy has been loaded before reading the sidtab stats
  UPSTREAM: raid6/test: fix a compilation error
  UPSTREAM: PM: hibernate: fix crashes with init_on_free=1
  UPSTREAM: ARM: bcm2835_defconfig: Explicitly restore CONFIG_DEBUG_FS
  UPSTREAM: ARM: socfpga_defconfig: Add back DEBUG_FS
  UPSTREAM: binderfs: use refcount for binder control devices too
  UPSTREAM: um: Fix header inclusion
  UPSTREAM: PM: sleep: wakeup: Skip wakeup_source_sysfs_remove() if device is not there
  UPSTREAM: Input: fix stale timestamp on key autorepeat events
  UPSTREAM: mm/filemap.c: don't bother dropping mmap_sem for zero size readahead
  UPSTREAM: arm64: vdso: don't free unallocated pages
  UPSTREAM: usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer
  UPSTREAM: ipv6: ndisc: RFC-ietf-6man-ra-pref64-09 is now published as RFC8781
  UPSTREAM: s390/setup: init jump labels before command line parsing
  UPSTREAM: dma-buf: free dmabuf->name in dma_buf_release()
  UPSTREAM: driver core: Don't do deferred probe in parallel with kernel_init thread
  UPSTREAM: fscrypt: restrict IV_INO_LBLK_* to AES-256-XTS
  UPSTREAM: fscrypt: use smp_load_acquire() for fscrypt_prepared_key
  UPSTREAM: mm/page_alloc: silence a KASAN false positive
  UPSTREAM: ARM64: vdso32: Install vdso32 from vdso_install
  UPSTREAM: fscrypt: restrict IV_INO_LBLK_32 to ino_bits <= 32
  UPSTREAM: coresight: tmc: Fix bad register address for CLAIM
  UPSTREAM: coresight: etm4x: Fix unused function warning
  UPSTREAM: coresight: etm4x: Fix use-after-free of per-cpu etm drvdata
  UPSTREAM: coresight: etm4x: Fix save/restore during cpu idle
  UPSTREAM: coresight: etm4x: Handle unreachable sink in perf mode
  UPSTREAM: coresight: etm4x: Fix issues on trcseqevr access
  UPSTREAM: coresight: etm: perf: Fix warning caused by etm_setup_aux failure
  UPSTREAM: coresight: etm4x: Fix save and restore of TRCVMIDCCTLR1 register

Change-Id: I484731476d503d3b60e4d072fcf8e94fbff8c2e2
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2022-02-26 14:49:12 +05:30

259 lines
6.1 KiB
C

/*
* System Control and Power Interface (SCPI) based CPUFreq Interface driver
*
* It provides necessary ops to arm_big_little cpufreq driver.
*
* Copyright (C) 2015 ARM Ltd.
* Sudeep Holla <sudeep.holla@arm.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/clk.h>
#include <linux/cpu.h>
#include <linux/cpufreq.h>
#include <linux/cpumask.h>
#include <linux/cpu_cooling.h>
#include <linux/energy_model.h>
#include <linux/export.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/pm_opp.h>
#include <linux/scpi_protocol.h>
#include <linux/slab.h>
#include <linux/types.h>
struct scpi_data {
struct clk *clk;
struct device *cpu_dev;
struct thermal_cooling_device *cdev;
};
static struct scpi_ops *scpi_ops;
static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
struct scpi_data *priv = policy->driver_data;
unsigned long rate = clk_get_rate(priv->clk);
return rate / 1000;
}
static int
scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
{
unsigned long freq = policy->freq_table[index].frequency;
struct scpi_data *priv = policy->driver_data;
u64 rate = freq * 1000;
int ret;
ret = clk_set_rate(priv->clk, rate);
if (ret)
return ret;
if (clk_get_rate(priv->clk) != rate)
return -EIO;
arch_set_freq_scale(policy->related_cpus, freq,
policy->cpuinfo.max_freq);
return 0;
}
static int
scpi_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
{
int cpu, domain, tdomain;
struct device *tcpu_dev;
domain = scpi_ops->device_domain_id(cpu_dev);
if (domain < 0)
return domain;
for_each_possible_cpu(cpu) {
if (cpu == cpu_dev->id)
continue;
tcpu_dev = get_cpu_device(cpu);
if (!tcpu_dev)
continue;
tdomain = scpi_ops->device_domain_id(tcpu_dev);
if (tdomain == domain)
cpumask_set_cpu(cpu, cpumask);
}
return 0;
}
static int scpi_cpufreq_init(struct cpufreq_policy *policy)
{
int ret, nr_opp;
unsigned int latency;
struct device *cpu_dev;
struct scpi_data *priv;
struct cpufreq_frequency_table *freq_table;
struct em_data_callback em_cb = EM_DATA_CB(of_dev_pm_opp_get_cpu_power);
cpu_dev = get_cpu_device(policy->cpu);
if (!cpu_dev) {
pr_err("failed to get cpu%d device\n", policy->cpu);
return -ENODEV;
}
ret = scpi_ops->add_opps_to_device(cpu_dev);
if (ret) {
dev_warn(cpu_dev, "failed to add opps to the device\n");
return ret;
}
ret = scpi_get_sharing_cpus(cpu_dev, policy->cpus);
if (ret) {
dev_warn(cpu_dev, "failed to get sharing cpumask\n");
return ret;
}
ret = dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus);
if (ret) {
dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n",
__func__, ret);
return ret;
}
ret = dev_pm_opp_get_opp_count(cpu_dev);
if (ret <= 0) {
dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n");
ret = -EPROBE_DEFER;
goto out_free_opp;
}
nr_opp = ret;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
ret = -ENOMEM;
goto out_free_opp;
}
ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
if (ret) {
dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
goto out_free_priv;
}
priv->cpu_dev = cpu_dev;
priv->clk = clk_get(cpu_dev, NULL);
if (IS_ERR(priv->clk)) {
dev_err(cpu_dev, "%s: Failed to get clk for cpu: %d\n",
__func__, cpu_dev->id);
ret = PTR_ERR(priv->clk);
goto out_free_cpufreq_table;
}
policy->driver_data = priv;
policy->freq_table = freq_table;
/* scpi allows DVFS request for any domain from any CPU */
policy->dvfs_possible_from_any_cpu = true;
latency = scpi_ops->get_transition_latency(cpu_dev);
if (!latency)
latency = CPUFREQ_ETERNAL;
policy->cpuinfo.transition_latency = latency;
policy->fast_switch_possible = false;
em_register_perf_domain(policy->cpus, nr_opp, &em_cb);
return 0;
out_free_cpufreq_table:
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
out_free_priv:
kfree(priv);
out_free_opp:
dev_pm_opp_remove_all_dynamic(cpu_dev);
return ret;
}
static int scpi_cpufreq_exit(struct cpufreq_policy *policy)
{
struct scpi_data *priv = policy->driver_data;
cpufreq_cooling_unregister(priv->cdev);
clk_put(priv->clk);
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
kfree(priv);
dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
return 0;
}
static void scpi_cpufreq_ready(struct cpufreq_policy *policy)
{
struct scpi_data *priv = policy->driver_data;
priv->cdev = of_cpufreq_cooling_register(policy);
}
static struct cpufreq_driver scpi_cpufreq_driver = {
.name = "scpi-cpufreq",
.flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
CPUFREQ_NEED_INITIAL_FREQ_CHECK,
.verify = cpufreq_generic_frequency_table_verify,
.attr = cpufreq_generic_attr,
.get = scpi_cpufreq_get_rate,
.init = scpi_cpufreq_init,
.exit = scpi_cpufreq_exit,
.ready = scpi_cpufreq_ready,
.target_index = scpi_cpufreq_set_target,
};
static int scpi_cpufreq_probe(struct platform_device *pdev)
{
int ret;
scpi_ops = get_scpi_ops();
if (!scpi_ops)
return -EIO;
ret = cpufreq_register_driver(&scpi_cpufreq_driver);
if (ret)
dev_err(&pdev->dev, "%s: registering cpufreq failed, err: %d\n",
__func__, ret);
return ret;
}
static int scpi_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&scpi_cpufreq_driver);
scpi_ops = NULL;
return 0;
}
static struct platform_driver scpi_cpufreq_platdrv = {
.driver = {
.name = "scpi-cpufreq",
},
.probe = scpi_cpufreq_probe,
.remove = scpi_cpufreq_remove,
};
module_platform_driver(scpi_cpufreq_platdrv);
MODULE_ALIAS("platform:scpi-cpufreq");
MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
MODULE_DESCRIPTION("ARM SCPI CPUFreq interface driver");
MODULE_LICENSE("GPL v2");