android_kernel_xiaomi_sm8450/drivers/cpufreq/cpufreq.c
Ivaylo Georgiev 642de2eea2 Merge android12-5.10.1+ (ec1fff1) into msm-5.10
* refs/heads/tmp-ec1fff1:
  ANDROID: enable assymetric aarch32 for 32 bit app support
  ANDROID: GKI: Export memblock_free to drivers
  ANDROID: arch_topology: Export thermal pressure symbol
  ANDROID: softirq: Export irq_handler_entry tracepoint
  ANDROID: sched: Export sched_switch tracepoint symbol
  Revert "ANDROID: GKI: Enable CONFIG_USB_XHCI_HCD"
  UPSTREAM: binder: add flag to clear buffer on txn complete
  Revert "ANDROID: db845c_gki.fragment: Drop CONFIG_USB_DWC3 from config frament"
  Revert "ANDROID: GKI: enable CONFIG_USB_DWC3 to be build in"
  FROMGIT: dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU
  FROMGIT: iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU
  ANDROID: GKI: Unhide VIRTIO_DMA_SHARED_BUFFER
  ANDROID: Disable dynamic ftrace for allmodconfig builds
  FROMLIST: x86, build: allow LTO to be selected
  FROMLIST: x86, vdso: disable LTO only for vDSO
  FROMLIST: kbuild: lto: postpone objtool
  FROMLIST: objtool: Split noinstr validation from --vmlinux
  FROMLIST: x86, build: use objtool mcount
  FROMLIST: tracing: add support for objtool mcount
  FROMLIST: objtool: Don't autodetect vmlinux.o
  ANDROID: objtool: Fix __mcount_loc generation with Clang's assembler
  FROMLIST: objtool: Add a pass for generating __mcount_loc
  FROMLIST: arm64: allow LTO to be selected
  FROMLIST: arm64: disable recordmcount with DYNAMIC_FTRACE_WITH_REGS
  FROMLIST: arm64: vdso: disable LTO
  FROMLIST: drivers/misc/lkdtm: disable LTO for rodata.o
  FROMLIST: efi/libstub: disable LTO
  FROMLIST: scripts/mod: disable LTO for empty.c
  FROMLIST: modpost: lto: strip .lto from module names
  FROMLIST: PCI: Fix PREL32 relocations for LTO
  FROMLIST: init: lto: fix PREL32 relocations
  FROMLIST: init: lto: ensure initcall ordering
  FROMLIST: kbuild: lto: add a default list of used symbols
  FROMLIST: kbuild: lto: merge module sections
  FROMLIST: kbuild: lto: limit inlining
  FROMLIST: kbuild: lto: fix module versioning
  FROMLIST: kbuild: add support for Clang LTO
  FROMLIST: tracing: move function tracer options to Kconfig
  UPSTREAM: arm64/mm: add fallback option to allocate virtually contiguous memory
  ANDROID: add initial symbol list for cuttlefish
  ANDROID: add initial symbol list for db845c
  ANDROID: create initial symbol lists for android12-5.10
  ANDROID: binder: Export binder_transaction_received trace point
  ANDROID: binder: consolidate wakeup vendor hooks into one
  ANDROID: GKI: Drop CONFIG_LOCALVERSION on 5.10
  ANDROID: usb: typec: tcpm: Add a helper function to port is toggling
  ANDROID: disable BTF generation
  FROMLIST: dma-buf: system_heap: Add a system-uncached heap re-using the system heap
  FROMLIST: dma-buf: dma-heap: Keep track of the heap device struct
  Linux 5.10.1
  Revert "dm raid: fix discard limits for raid1 and raid10"
  Revert "md: change mddev 'chunk_sectors' from int to unsigned"
  ANDROID: GKI: remove lockup detection configs
  ANDROID: tty: hvc_dcc: Save irq flags when locking
  ANDROID: sched: Export sched_setattr_nocheck
  ANDROID: sched/fair: fix place_entity() vendor hook
  ANDROID: sched/fair: export sysctl_sched_latency symbol
  FROMLIST: PM / Domains: use device's next wakeup to determine domain idle state
  FROMLIST: PM / domains: inform PM domain of a device's next wakeup
  FROMLIST: PM / Domains: add domain feature flag for next wakeup
  ANDROID: sched: Export key used by module
  ANDROID: cgroup: Export functions used by modules
  ANDROID: build.config: set branch to android12-5.10
  Linux 5.10
  FROMGIT: cpuidle: psci: Enable suspend-to-idle for PSCI OSI mode
  FROMGIT: PM: domains: Enable dev_pm_genpd_suspend|resume() for suspend-to-idle
  FROMGIT: PM: domains: Rename pm_genpd_syscore_poweroff|poweron()
  md: change mddev 'chunk_sectors' from int to unsigned
  x86/kprobes: Fix optprobe to detect INT3 padding correctly
  Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
  tools/kvm_stat: Exempt time-based counters
  KVM: mmu: Fix SPTE encoding of MMIO generation upper half
  bpf: Fix enum names for bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers
  mm/hugetlb: clear compound_nr before freeing gigantic pages
  kasan: fix object remaining in offline per-cpu quarantine
  elfcore: fix building with clang
  initramfs: fix clang build failure
  kbuild: avoid static_assert for genksyms
  selftest/fpu: avoid clang warning
  proc: use untagged_addr() for pagemap_read addresses
  revert "mm/filemap: add static for function __add_to_page_cache_locked"
  Input: cm109 - do not stomp on control URB
  ANDROID: configs: GKI: disable ARMv8.3 PAC
  mtd: rawnand: xway: Do not force a particular software ECC engine
  mtd: rawnand: socrates: Do not force a particular software ECC engine
  mtd: rawnand: plat_nand: Do not force a particular software ECC engine
  mtd: rawnand: pasemi: Do not force a particular software ECC engine
  mtd: rawnand: orion: Do not force a particular software ECC engine
  mtd: rawnand: mpc5121: Do not force a particular software ECC engine
  mtd: rawnand: gpio: Do not force a particular software ECC engine
  mtd: rawnand: au1550: Do not force a particular software ECC engine
  mtd: rawnand: ams-delta: Do not force a particular software ECC engine
  Revert "scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()"
  FROMGIT: usb: typec: tcpci: Enable bleed discharge when auto discharge is enabled
  FROMGIT: usb: typec: Add class for plug alt mode device
  FROMGIT: USB: typec: tcpci: Add Bleed discharge to POWER_CONTROL definition
  FROMGIT: USB: typec: tcpm: Add a 30ms room for tPSSourceOn in PR_SWAP
  FROMGIT: USB: typec: tcpm: Fix PR_SWAP error handling
  FROMGIT: USB: typec: tcpm: Hard Reset after not receiving a Request
  RISC-V: Define get_cycles64() regardless of M-mode
  drm/i915/display: Go softly softly on initial modeset failure
  ANDROID: dm: dm-user: New target that proxies BIOs to userspace
  ANDROID: uapi: Add dm-user structure definition
  x86/apic/vector: Fix ordering in vector assignment
  NFS: Disable READ_PLUS by default
  NFSv4.2: Fix 5 seconds delay when doing inter server copy
  NFS: Fix rpcrdma_inline_fixup() crash with new LISTXATTRS operation
  ANDROID: x86: configs: gki: add missing CONFIG_BLK_CGROUP
  selftests: fix poll error in udpgro.sh
  selftests/bpf: Fix "dubious pointer arithmetic" test
  selftests/bpf: Fix array access with signed variable test
  selftests/bpf: Add test for signed 32-bit bound check bug
  bpf: Fix propagation of 32-bit signed bounds from 64-bit bounds.
  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
  ANDROID: sched: Add rvh for cpu controller cgroup attach
  x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
  FROMGIT: usb: typec: intel_pmc_mux: Configure cable generation value for USB4
  ANDROID: sched: Fix sched_cpu_drain CONFIG_HOTPLUG_CPU dependence
  x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
  ANDROID: db845c_gki.fragment: Drop CONFIG_USB_DWC3 from config frament
  zonefs: fix page reference and BIO leak
  Input: i8042 - add Acer laptops to the i8042 reset list
  Revert "md: add md_submit_discard_bio() for submitting discard bio"
  Revert "md/raid10: extend r10bio devs to raid disks"
  Revert "md/raid10: pull codes that wait for blocked dev into one function"
  Revert "md/raid10: improve raid10 discard request"
  Revert "md/raid10: improve discard request for far layout"
  Revert "dm raid: remove unnecessary discard limits for raid10"
  MAINTAINERS: Add entry for Marvell Prestera Ethernet Switch driver
  net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower
  drm/amd/pm: typo fix (CUSTOM -> COMPUTE)
  Input: cros_ec_keyb - send 'scancodes' in addition to key events
  ANDROID: Revert "GKI: build in a kernel command line of "rw""
  net/mlx4_en: Handle TX error CQE
  net/mlx4_en: Avoid scheduling restart task if it is already running
  BACKPORT: dma-buf: system_heap: Allocate higher order pages if available
  BACKPORT: dma-buf: heaps: Skip sync if not mapped
  BACKPORT: dma-buf: heaps: Remove heap-helpers code
  BACKPORT: dma-buf: heaps: Move heap-helper logic into the cma_heap implementation
  BACKPORT: dma-buf: system_heap: Rework system heap to use sgtables instead of pagelists
  tcp: fix cwnd-limited bug for TSO deferral where we send nothing
  net: flow_offload: Fix memory leak for indirect flow block
  tcp: Retain ECT bits for tos reflection
  ethtool: fix stack overflow in ethnl_parse_bitset()
  e1000e: fix S0ix flow to allow S0i3.2 subset entry
  ice: avoid premature Rx buffer reuse
  ixgbe: avoid premature Rx buffer reuse
  i40e: avoid premature Rx buffer reuse
  igb: avoid transmit queue timeout in xdp path
  igb: use xdp_do_flush
  igb: skb add metasize for xdp
  igb: XDP extack message on error
  igb: take VLAN double header into account
  igb: XDP xmit back fix error code
  Revert "geneve: pull IP header before ECN decapsulation"
  firmware: xilinx: Mark pm_api_features_map with static keyword
  ARM: dts: mmp2-olpc-xo-1-75: clear the warnings when make dtbs
  RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
  FROMGIT: usb: typec: tcpci_maxim: Enable VSAFE0V signalling
  FROMGIT: scsi: ufs: Print host regs in IRQ handler when AH8 error happens
  BACKPORT: FROMGIT: scsi: ufs: Fix a race condition between ufshcd_abort() and eh_work()
  FROMGIT: scsi: ufs: Serialize eh_work with system PM events and async scan
  ANDROID: GKI: enable CONFIG_USB_DWC3 to be build in
  can: isotp: isotp_setsockopt(): block setsockopt on bound sockets
  selftests/bpf/test_offload.py: Filter bpftool internal map when counting maps
  selftests/bpf/test_offload.py: Reset ethtool features after failed setting
  selftests/bpf/test_offload.py: Fix expected case of extack messages
  selftests/bpf/test_offload.py: Only check verifier log on verification fails
  netdevsim: Add debugfs toggle to reject BPF programs in verifier
  selftests/bpf/test_offload.py: Remove check for program load flags match
  xdp: Remove the xdp_attachment_flags_ok() callback
  drm/amdgpu: Initialise drm_gem_object_funcs for imported BOs
  drm/amdgpu: fix size calculation with stolen vga memory
  drm/amd/pm: update smu10.h WORKLOAD_PPLIB setting for raven
  drm/amdkfd: Fix leak in dmabuf import
  drm/amdgpu: fix sdma instance fw version and feature version init
  drm/amd/display: Add wm table for Renoir
  drm/amd/display: Prevent bandwidth overflow
  drm/amdgpu: fix debugfs creation/removal, again
  drm/amdgpu/disply: set num_crtc earlier
  FROMGIT: usb: typec: tcpci: Add support to report vSafe0V
  FROMGIT: usb: typec: tcpm: Introduce vsafe0v for vbus
  FROMGIT: usb: typec: tcpm: Clear send_discover in tcpm_check_send_discover
  FROMGIT: usb: typec: tcpm: Pass down negotiated rev to update retry count
  FROMGIT: usb: typec: intel_pmc_mux: Use correct response message bits
  netfilter: nft_ct: Remove confirmation check for NFT_CT_ID
  xen: don't use page->lru for ZONE_DEVICE memory
  xen: add helpers for caching grant mapping pages
  gpio: eic-sprd: break loop when getting NULL device resource
  membarrier: Execute SYNC_CORE on the calling thread
  membarrier: Explicitly sync remote cores when SYNC_CORE is requested
  membarrier: Add an actual barrier before rseq_preempt()
  x86/membarrier: Get rid of a dubious optimization
  pinctrl: intel: Actually disable Tx and Rx buffers on GPIO request
  mm/madvise: remove racy mm ownership check
  drm/amdgpu/powerplay: parse fan table for CI asics
  bpf, doc: Update KP's email in MAINTAINERS
  FROMGIT: f2fs: fix race of pending_pages in decompression
  tcp: select sane initial rcvq_space.space for big MSS
  net: ll_temac: Fix potential NULL dereference in temac_probe()
  afs: Fix memory leak when mounting with multiple source parameters
  net: tipc: prevent possible null deref of link
  ANDROID: x86: entry: fix LSL open coding
  Revert "scsi: megaraid_sas: Added support for shared host tagset for cpuhotplug"
  net: stmmac: overwrite the dma_cap.addr64 according to HW design
  net: stmmac: delete the eee_ctrl_timer after napi disabled
  net: stmmac: free tx skb buffer in stmmac_resume()
  net: stmmac: start phylink instance before stmmac_hw_setup()
  net: stmmac: increase the timeout for dma reset
  [regression fix] really dumb fuckup in sparc64 __csum_partial_copy() changes
  netfilter: nftables: comment indirect serialization of commit_mutex with rtnl_mutex
  netfilter: nft_dynset: fix timeouts later than 23 days
  bonding: fix feature flag setting at init time
  Revert "cgroup/cpuset: Convert cpuset_mutex to percpu_rwsem"
  ANDROID: cpu/hotplug: vendor hook for resume cpus
  ANDROID: cpu/hotplug: rebuild sched domains immediately
  ANDROID: cpu/hotplug: add migration to paused_cpus
  ANDROID: cpu/hotplug: add pause/resume_cpus interface
  ANDROID: cpu/hotplug: protect _cpu_down against partial HP
  ANDROID: cgroup/cpuset: rely on active_mask for guaranteed online CPU
  ANDROID: sched/fair: update_max_interval() active_mask dependant
  ANDROID: sched/rt: cpu_active_mask intersection
  ANDROID: stop_machine: stop_one_cpu_async
  io_uring: fix file leak on error path of io ctx creation
  tools/bpftool: Fix PID fetching with a lot of results
  drm/i915/gt: Declare gen9 has 64 mocs entries!
  drm/i915/display/dp: Compute the correct slice count for VDSC on DP
  drm/i915: fix size_t greater or equal to zero comparison
  drm/i915/gt: Cancel the preemption timeout on responding to it
  drm/i915/gt: Ignore repeated attempts to suspend request flow across reset
  drm/i915/gem: Propagate error from cancelled submit due to context closure
  drm/i915/gem: Check the correct variable in selftest
  netfilter: x_tables: Switch synchronization to RCU
  ANDROID: Disable hermetic toolchain for allmodconfig builds
  pinctrl: aspeed: Fix GPIO requests on pass-through banks
  media: vidtv: fix some warnings
  scsi: hisi_sas: Select a suitable queue for internal I/Os
  scsi: core: Fix race between handling STS_RESOURCE and completion
  net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux
  dpaa2-mac: Add a missing of_node_put after of_device_is_available
  mptcp: print new line in mptcp_seq_show() if mptcp isn't in use
  bridge: Fix a deadlock when enabling multicast snooping
  enetc: Fix reporting of h/w packet counters
  powerpc/mm: Fix KUAP warning by providing copy_from_kernel_nofault_allowed()
  clk: renesas: r9a06g032: Drop __packed for portability
  clk: imx: scu: fix MXC_CLK_SCU module build break
  RDMA/core: Fix empty gid table for non IB/RoCE devices
  lwt_bpf: Replace preempt_disable() with migrate_disable()
  lwt: Disable BH too in run_lwt_bpf()
  io_uring: fix mis-seting personality's creds
  MAINTAINERS: add a limited ARM and ARM64 SoC entry
  MAINTAINERS: correct SoC Git address (formerly: arm-soc)
  ARM: keystone: remove SECTION_SIZE_BITS/MAX_PHYSMEM_BITS
  iommu/amd: Set DTE[IntTabLen] to represent 512 IRTEs
  udp: fix the proto value passed to ip_protocol_deliver_rcu for the segments
  net: hns3: remove a misused pragma packed
  Input: soc_button_array - add Lenovo Yoga Tablet2 1051L to the dmi_use_low_level_irq list
  Input: raydium_ts_i2c - do not split tx transactions
  Linux 5.10-rc7
  mm/mmap.c: fix mmap return value when vma is merged after call_mmap()
  hugetlb_cgroup: fix offline of hugetlb cgroup with reservations
  mm/filemap: add static for function __add_to_page_cache_locked
  userfaultfd: selftests: fix SIGSEGV if huge mmap fails
  tools/testing/selftests/vm: fix build error
  mailmap: add two more addresses of Uwe Kleine-König
  mm/swapfile: do not sleep with a spin lock held
  mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING
  mm: list_lru: set shrinker map bit when child nr_items is not zero
  mm: memcg/slab: fix obj_cgroup_charge() return value handling
  coredump: fix core_pattern parse error
  zlib: export S390 symbols for zlib modules
  kbuild: avoid split lines in .mod files
  Revert "mei: virtio: virtualization frontend driver"
  x86/sev-es: Use new for_each_insn_prefix() macro to loop over prefixes bytes
  x86/insn-eval: Use new for_each_insn_prefix() macro to loop over prefixes bytes
  x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes
  net: mscc: ocelot: fix dropping of unknown IPv4 multicast on Seville
  net: marvell: prestera: Fix error return code in prestera_port_create()
  vrf: packets with lladdr src needs dst at input with orig_iif when needs strict
  can: softing: softing_netdev_open(): fix error handling
  ch_ktls: fix build warning for ipv4-only config
  i2c: mlxbf: Fix the return check of devm_ioremap and ioremap
  i2c: mlxbf: select CONFIG_I2C_SLAVE
  mac80211: mesh: fix mesh_pathtbl_init() error path
  [SECURITY] fix namespaced fscaps when !CONFIG_SECURITY
  openvswitch: fix error return code in validate_and_copy_dec_ttl()
  net: bridge: vlan: fix error return code in __vlan_add()
  ipv4: fix error return code in rtm_to_fib_config()
  ethernet: select CONFIG_CRC32 as needed
  net: ipa: pass the correct size when freeing DMA memory
  block: fix incorrect branching in blk_max_size_offset()
  net/sched: fq_pie: initialize timer earlier in fq_pie_init()
  tracing: Fix userstacktrace option for instances
  dm: remove invalid sparse __acquires and __releases annotations
  dm: fix double RCU unlock in dm_dax_zero_page_range() error path
  dm: fix IO splitting
  tty: Fix ->session locking
  tty: Fix ->pgrp locking in tiocspgrp()
  xsk: Return error code if force_zc is set
  usb: gadget: f_fs: Use local copy of descriptors for userspace copy
  usb: ohci-omap: Fix descriptor conversion
  Revert "usb-storage: fix sdev->host->dma_dev"
  Revert "uas: fix sdev->host->dma_dev"
  Revert "uas: bump hw_max_sectors to 2048 blocks for SS or faster drives"
  mmc: mediatek: mark PM functions as __maybe_unused
  mmc: block: Fixup condition for CMD13 polling for RPMB requests
  mac80211: set SDATA_STATE_RUNNING for monitor interfaces
  cfg80211: initialize rekey_data
  mac80211: fix return value of ieee80211_chandef_he_6ghz_oper
  mmc: tmio: improve bringing HW to a sane state with MMC_POWER_OFF
  USB: serial: kl5kusb105: fix memleak on open
  misc: eeprom: at24: fix NVMEM name with custom AT24 device name
  pinctrl: amd: remove debounce filter setting in IRQ type setting
  kvm: x86/mmu: Use cpuid to determine max gfn
  kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()
  cifs: refactor create_sd_buf() and and avoid corrupting the buffer
  cifs: add NULL check for ses->tcon_ipc
  smb3: set COMPOUND_FID to FileID field of subsequent compound request
  scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
  ANDROID: Sched: Add restricted vendor hooks for scheduler
  net/mlx5: DR, Proper handling of unsupported Connect-X6DX SW steering
  net/mlx5e: kTLS, Enforce HW TX csum offload with kTLS
  net: mlx5e: fix fs_tcp.c build when IPV6 is not enabled
  net/mlx5: Fix wrong address reclaim when command interface is down
  net/sched: act_mpls: ensure LSE is pullable before reading it
  net: openvswitch: ensure LSE is pullable before reading it
  net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl
  net: mvpp2: Fix error return code in mvpp2_open()
  chelsio/chtls: fix a double free in chtls_setkey()
  uapi: fix statx attribute value overlap for DAX & MOUNT_ROOT
  pwm: sl28cpld: fix getting driver data in pwm callbacks
  lib/syscall: fix syscall registers retrieval on 32-bit platforms
  ANDROID: tracing: Add restricted vendor hooks for preemptirq events
  selftests: kvm/set_memory_region_test: Fix race in move region test
  x86/platform/uv: Fix UV4 hub revision adjustment
  ANDROID: Sched: Export scheduler symbols needed by vendor modules
  rtw88: debug: Fix uninitialized memory in debugfs code
  USB: serial: ch341: sort device-id entries
  USB: serial: ch341: add new Product ID for CH341A
  perf/x86/intel: Check PEBS status correctly
  perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS
  intel_idle: Build fix
  FROMLIST: scripts: merge_config: add strict mode to fail upon any redefinition
  drm/amdgpu/vcn3.0: remove old DPG workaround
  drm/amdgpu/vcn3.0: stall DPG when WPTR/RPTR reset
  drm/amd/display: Init clock value by current vbios CLKs
  drm/amdgpu/pm/smu11: Fix fan set speed bug
  vxlan: fix error return code in __vxlan_dev_create()
  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
  drm/i915/display: Defer initial modeset until after GGTT is initialised
  drm/i915/display: return earlier from intel_modeset_init() without display
  drm/i915/gt: Limit frequency drop to RPe on parking
  drm/i915/gt: Retain default context state across shrinking
  drm/i915/gt: Split the breadcrumb spinlock between global and contexts
  drm/i915/gt: Protect context lifetime with RCU
  xsk: Change the tx writeable condition
  xsk: Replace datagram_poll by sock_poll_wait
  FROMLIST: scsi: ufs: clear uac for RPMB after ufshcd resets
  i2c: imx: Don't generate STOP condition if arbitration has been lost
  i2c: imx: Check for I2SR_IAL after every byte
  i2c: imx: Fix reset of I2SR_IAL flag
  dpaa_eth: copy timestamp fields to new skb in A-050385 workaround
  net: ip6_gre: set dev->hard_header_len when using header_ops
  mt76: usb: fix crash on device removal
  iwlwifi: pcie: add some missing entries for AX210
  iwlwifi: pcie: invert values of NO_160 device config entries
  iwlwifi: pcie: add one missing entry for AX210
  iwlwifi: update MAINTAINERS entry
  scsi: bnx2i: Requires MMU
  s390: fix irq state tracing
  s390/pci: fix CPU address in MSI for directed IRQ
  ANDROID: binder: Add vendor hooks
  i2c: qcom: Fix IRQ error misassignement
  i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
  ANDROID: gki: build-in DMA_VIRTUAL_CHANNELS
  media: vidtv: fix kernel-doc markups
  powerpc/64s/powernv: Fix memory corruption when saving SLB entries on MCE
  media: [next] media: vidtv: fix a read from an object after it has been freed
  media: vb2: set cache sync hints when init buffers
  FROMGIT: arm64: mm: account for hotplug memory when randomizing the linear region
  gpio: mvebu: fix potential user-after-free on probe
  KVM: arm64: Add usage of stage 2 fault lookup level in user_mem_abort()
  KVM: arm64: Fix handling of merging tables into a block entry
  KVM: arm64: Fix memory leak on stage2 update of a valid PTE
  gpio: zynq: fix reference leak in zynq_gpio functions
  gpiolib: Don't free if pin ranges are not defined
  gpio: dwapb: fix NULL pointer dereference at dwapb_gpio_suspend()
  gpio: arizona: disable pm_runtime in case of failure
  vhost_vdpa: return -EFAULT if copy_to_user() fails
  vdpa: mlx5: fix vdpa/vhost dependencies
  selftests/bpf: Drain ringbuf samples at the end of test
  libbpf: Fix ring_buffer__poll() to return number of consumed samples
  geneve: pull IP header before ECN decapsulation
  inet_ecn: Fix endianness of checksum update when setting ECT(1)
  RDMA/efa: Use the correct current and new states in modify QP
  RDMA/qedr: iWARP invalid(zero) doorbell address fix
  tipc: fix incompatible mtu of transmission
  ANDROID: usb: gadget: f_midi: Avoid invalid pointer access
  dm writecache: remove BUG() and fail gracefully instead
  dm table: Remove BUG_ON(in_interrupt())
  dm: fix bug with RCU locking in dm_blk_report_zones
  Revert "dm cache: fix arm link errors with inline"
  fs: 9p: add generic splice_write file operation
  net: broadcom CNIC: requires MMU
  ibmvnic: Fix TX completion error handling
  ibmvnic: Ensure that SCRQ entry reads are correctly ordered
  ANDROID: mm: Create vendor hooks to control ZONE_MOVABLE allocations
  ANDROID: mm: add cma pcp list
  ANDROID: cma: redirect page allocation to CMA
  block: use gcd() to fix chunk_sectors limit stacking
  Input: atmel_mxt_ts - fix lost interrupts
  fpga: Specify HAS_IOMEM dependency for FPGA_DFL
  fs: 9p: add generic splice_read file operations
  x86/resctrl: Fix AMD L3 QOS CDP enable/disable
  ANDROID: spi: of: Populate fwnode in of_register_spi_device
  media: pulse8-cec: add support for FW v10 and up
  media: pulse8-cec: fix duplicate free at disconnect or probe error
  media: mtk-cir: fix calculation of chk period
  kbuild: Disable CONFIG_LD_ORPHAN_WARN for ld.lld 10.0.1
  kbuild: Hoist '--orphan-handling' into Kconfig
  ANDROID: net: xfrm: always export pktgen_xfrm_outer_mode_output
  KVM: PPC: Book3S HV: XIVE: Fix vCPU id sanity check
  arm64: dts: allwinner: H5: NanoPi Neo Plus2: phy-mode rgmii-id
  arm64: dts: allwinner: A64 Sopine: phy-mode rgmii-id
  USB: serial: option: fix Quectel BG96 matching
  ANDROID: pcie/dwc: driver: export dw_handle_msi_irq
  Input: xpad - support Ardwiino Controllers
  Input: i8042 - add ByteSpeed touchpad to noloop table
  scsi: mpt3sas: Increase IOCInit request timeout to 30s
  scsi: mpt3sas: Fix ioctl timeout
  scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()
  docs: bootconfig: Add the endianness of fields
  tools/bootconfig: Store size and checksum in footer as le32
  bootconfig: Load size and checksum in the footer as le32
  ring-buffer: Always check to put back before stamp when crossing pages
  scsi: storvsc: Fix error return in storvsc_probe()
  ftrace: Fix DYNAMIC_FTRACE_WITH_DIRECT_CALLS dependency
  ftrace: Fix updating FTRACE_FL_TRAMP
  tracing: Fix alignment of static buffer
  tracing: Remove WARN_ON in start_thread()
  samples/ftrace: Mark my_tramp[12]? global
  vxlan: Copy needed_tailroom from lowerdev
  vxlan: Add needed_headroom for lower device
  chelsio/chtls: fix panic during unload reload chtls
  ARM: dts: imx6qdl-kontron-samx6i: fix I2C_PM scl pin
  ARM: dts: imx6qdl-wandboard-revd1: Remove PAD_GPIO_6 from enetgrp
  ANDROID: sched: Track wake_q length
  drm/i915/gt: Program mocs:63 for cache eviction on gen9
  ARM: imx: Use correct SRC base address
  gfs2: Fix deadlock between gfs2_{create_inode,inode_lookup} and delete_work_func
  xdp: Handle MEM_TYPE_XSK_BUFF_POOL correctly in xdp_return_buff()
  ktest.pl: Fix incorrect reboot for grub2bls
  cifs: fix potential use-after-free in cifs_echo_request()
  cifs: allow syscalls to be restarted in __smb_send_rqst()
  ring-buffer: Set the right timestamp in the slow path of __rb_reserve_next()
  ring-buffer: Update write stamp with the correct ts
  io_uring: fix recvmsg setup with compat buf-select
  arm64: mte: Fix typo in macro definition
  pNFS/flexfiles: Fix array overflow when flexfiles mirroring is enabled
  ANDROID: sched/cpuset: Add vendor hook to change tasks affinity
  ANDROID: sched/core: Add vendor hook to change task affinity
  arm64: entry: fix EL1 debug transitions
  arm64: entry: fix NMI {user, kernel}->kernel transitions
  arm64: entry: fix non-NMI kernel<->kernel transitions
  arm64: ptrace: prepare for EL1 irq/rcu tracking
  arm64: entry: fix non-NMI user<->kernel transitions
  arm64: entry: move el1 irq/nmi logic to C
  arm64: entry: prepare ret_to_user for function call
  arm64: entry: move enter_from_user_mode to entry-common.c
  arm64: entry: mark entry code as noinstr
  arm64: mark idle code as noinstr
  arm64: syscall: exit userspace before unmasking exceptions
  can: kvaser_pciefd: kvaser_pciefd_open(): fix error handling
  can: c_can: c_can_power_up(): fix error handling
  can: sun4i_can: sun4i_can_err(): don't count arbitration lose as an error
  can: sja1000: sja1000_err(): don't count arbitration lose as an error
  can: m_can: tcan4x5x_can_probe(): fix error path: remove erroneous clk_disable_unprepare()
  powerpc/pseries: Pass MSI affinity to irq_create_mapping()
  genirq/irqdomain: Add an irq_create_mapping_affinity() function
  drm/omap: sdi: fix bridge enable/disable
  MAINTAINERS: Move Jason Cooper to CREDITS
  habanalabs: put devices before driver removal
  habanalabs: free host huge va_range if not used
  speakup: Reject setting the speakup line discipline outside of speakup
  usb: cdns3: core: fix goto label for error path
  usb: cdns3: gadget: clear trb->length as zero after preparing every trb
  usb: cdns3: Fix hardware based role switch
  Linux 5.10-rc6
  drm/panel: sony-acx565akm: Fix race condition in probe
  drm/rockchip: Avoid uninitialized use of endpoint id in LVDS
  dt-bindings: net: correct interrupt flags in examples
  ibmvnic: reduce wait for completion time
  ibmvnic: no reset timeout for 5 seconds after reset
  ibmvnic: send_login should check for crq errors
  ibmvnic: track pending login
  ibmvnic: delay next reset if hard reset fails
  ibmvnic: restore adapter state on failed reset
  ibmvnic: avoid memset null scrq msgs
  ibmvnic: stop free_all_rwi on failed reset
  ibmvnic: handle inconsistent login with reset
  selftests: tc-testing: enable CONFIG_NET_SCH_RED as a module
  ipv4: Fix tos mask in inet_rtm_getroute()
  netfilter: bridge: reset skb->pkt_type after NF_INET_POST_ROUTING traversal
  ALSA: hda/realtek: Add mute LED quirk to yet another HP x360 model
  ALSA: hda/realtek: Fix bass speaker DAC assignment on Asus Zephyrus G14
  ALSA: hda/generic: Add option to enforce preferred_dacs pairs
  ANDROID: GKI: export dev_pm_qos_read_value
  FROMGIT: usb: typec: Add type sysfs attribute file for partners
  FROMGIT: usb: pd: DFP product types
  FROMGIT: usb: typec: Constify static attribute_group structs
  FROMGIT: usb: typec: Expose Product Type VDOs via sysfs
  FROMGIT: usb: typec: Consolidate sysfs ABI documentation
  FROMGIT: usb: typec: Fix num_altmodes kernel-doc error
  FROMGIT: usb: typec: Add plug num_altmodes sysfs attr
  FROMGIT: usb: typec: Add number of altmodes partner attr
  FROMGIT: usb: typec: Remove one bit support for the Thunderbolt rounded/non-rounded cable
  FROMGIT: platform/chrome: cros_ec_typec: Correct the Thunderbolt rounded/non-rounded cable support
  sock: set sk_err to ee_errno on dequeue from errq
  mptcp: fix NULL ptr dereference on bad MPJ
  net: openvswitch: fix TTL decrement action netlink message format
  ANDROID: drm: expose drm_mode_convert_to_umode to display module
  perf probe: Change function definition check due to broken DWARF
  perf probe: Fix to die_entrypc() returns error correctly
  perf stat: Use proper cpu for shadow stats
  perf record: Synthesize cgroup events only if needed
  perf diff: Fix error return value in __cmd_diff()
  perf tools: Update copy of libbpf's hashmap.c
  ANDROID: Revert "thermal: Make thermal_zone_device_is_enabled() available to core only"
  x86/mce: Do not overwrite no_way_out if mce_end() fails
  FROMGIT: usb: typec: intel_pmc_mux: Configure Thunderbolt cable generation bits
  FROMGIT: usb: typec: Correct the bit values for the Thunderbolt rounded/non-rounded cable support
  FROMGIT: usb: typec: ucsi: Work around PPM losing change information
  FROMGIT: usb: typec: ucsi: acpi: Always decode connector change information
  ANDROID: kernel: cgroup: cpuset: Clear cpus_requested for empty buf
  ANDROID: cpuset: Make cpusets restore on hotplug
  ANDROID: sched: Export symbols for vendor EAS wakup path function
  ANDROID: sched: Add vendor hooks for skipping sugov update
  ANDROID: sched: Add vendor hooks for override sugov behavior
  ANDROID: attribute page lock and waitqueue functions as sched
  ANDROID: sched: Add vendor hooks for find_energy_efficient_cpu
  kvm: x86/mmu: Fix get_mmio_spte() on CPUs supporting 5-level PT
  ANDROID: arch_topology: Export symbol for thermal pressure notification
  ANDROID: sched/core: Export symbols needed by modules
  ANDROID: modpost: Forbid double exports
  FROMLIST: modpost: Make static exports fatal
  ANDROID: GKI: enable CONFIG_THERMAL_NETLINK
  KVM: x86: Fix split-irqchip vs interrupt injection window request
  KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint
  ALSA: usb-audio: US16x08: fix value count for level meters
  ANDROID: sched: Add env->cpus to android_rvh_sched_nohz_balancer_kick
  usb: typec: stusb160x: fix power-opmode property with typec-power-opmode
  FROMGIT: usb: typec: tcpm: Stay in SNK_TRY_WAIT_DEBOUNCE_CHECK_VBUS till Rp is seen
  FROMGIT: usb: typec: tcpm: Disregard vbus off while in PR_SWAP_SNK_SRC_SOURCE_ON
  FROMGIT: usb: typec: tcpci_maxim: Fix the compatible string
  netfilter: nftables_offload: build mask based from the matching bytes
  netfilter: nftables_offload: set address type in control dissector
  ipvs: fix possible memory leak in ip_vs_control_net_init
  powerpc/numa: Fix a regression on memoryless node 0
  printk: finalize records with trailing newlines
  ANDROID: extract-cert: omit PKCS#11 support if building against BoringSSL
  USB: serial: option: add support for Thales Cinterion EXS82
  can: af_can: can_rx_unregister(): remove WARN() statement from list operation sanity check
  can: m_can: m_can_dev_setup(): add support for bosch mcan version 3.3.0
  can: m_can: fix nominal bitiming tseg2 min for version >= 3.1
  can: m_can: m_can_open(): remove IRQF_TRIGGER_FALLING from request_threaded_irq()'s flags
  FROMGIT: dt-bindings: usb: Maxim type-c controller device tree binding document
  FROMGIT: usb: typec: tcpci_maxim: Fix uninitialized return variable
  FROMGIT: usb: typec: tcpci_maxim: Enable auto discharge disconnect
  FROMGIT: usb: typec: tcpci: Implement Auto discharge disconnect callbacks
  ALSA: hda/realtek - Add new codec supported for ALC897
  FROMGIT: usb: typec: tcpm: Implement enabling Auto Discharge disconnect support
  batman-adv: Don't always reallocate the fragmentation skb head
  batman-adv: Reserve needed_*room for fragments
  batman-adv: Consider fragmentation for needed_headroom
  FROMGIT: usb: typec: tcpci_maxim: Fix vbus stuck on upon diconnecting sink
  FROMGIT: usb: typec: tcpci: frs sourcing vbus callback
  FROMGIT: usb: typec: tcpm: frs sourcing vbus callback
  ANDROID: staging: ion: export some ion symbols
  ANDROID: staging: ion: Remove unused local variable 'vaddr'
  ANDROID: staging: ion: remove kmap from begin[end]_cpu_access
  ANDROID: staging: ion: Fix potential memory corruption
  ANDROID: staging: ion: optimize cache operation for non-cached buffer
  ANDROID: staging: ion: use dma_[un]map_sg_attrs
  ANDROID: staging: ion: Export query function to be used in modules
  FROMGIT: usb: typec: tcpm: Refactor logic for new-source-frs-typec-current
  ANDROID: USB: gadget: f_accessory: add support for SuperSpeed Plus
  FROMLIST: USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
  FROMLIST: USB: gadget: f_midi: setup SuperSpeed Plus descriptors
  FROMLIST: USB: gadget: f_fs: add SuperSpeed Plus support
  FROMLIST: USB: gadget: f_acm: add support for SuperSpeed Plus
  ANDROID: configs: gki: add CONFIG_PSTORE_PMSG
  ANDROID: configs: gki: add CONFIG_LEDS_TRIGGER_TRANSIENT
  gfs2: Upgrade shared glocks for atime updates
  drm/tegra: sor: Disable clocks on error in tegra_sor_init()
  mm: memcg: relayout structure mem_cgroup to avoid cache interference
  drm/nouveau: make sure ret is initialized in nouveau_ttm_io_mem_reserve
  io_uring: fix files grab/cancel race
  RDMA/hns: Bugfix for memory window mtpt configuration
  RDMA/hns: Fix retry_cnt and rnr_cnt when querying QP
  RDMA/hns: Fix wrong field of SRQ number the device supports
  iommu/vt-d: Don't read VCCAP register unless it exists
  platform/x86: touchscreen_dmi: Add info for the Irbis TW118 tablet
  platform/x86: touchscreen_dmi: Add info for the Predia Basic tablet
  platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC
  platform/x86: toshiba_acpi: Fix the wrong variable assignment
  platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
  platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control
  platform/x86: thinkpad_acpi: Send tablet mode switch at wakeup time
  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
  platform/x86: thinkpad_acpi: add P1 gen3 second fan support
  powerpc/64s: Trim offlined CPUs from mm_cpumasks
  kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
  powerpc/64s/pseries: Fix hash tlbiel_all_isa300 for guest kernels
  powerpc/64s: Fix hash ISA v3.0 TLBIEL instruction generation
  ASoC: rt5682: change SAR voltage threshold
  drm: mxsfb: Implement .format_mod_supported
  drm: mxsfb: fix fence synchronization
  ANDROID: configs: gki: add CONFIG_PRINTK_CALLER
  can: mcp251xfd: mcp251xfd_probe(): bail out if no IRQ was given
  can: gs_usb: fix endianess problem with candleLight firmware
  MAINTAINERS: Adding help for coresight subsystem
  media: vidtv.rst: add kernel-doc markups
  media: vidtv.rst: update vidtv documentation
  media: vidtv: simplify EIT write function
  media: vidtv: simplify NIT write function
  media: vidtv: simplify SDT write function
  media: vidtv: cleanup PMT write table function
  media: vidtv: cleanup PAT write function
  media: vidtv: cleanup PSI table header function
  media: vidtv: cleanup PSI descriptor write function
  media: vidtv: simplify the crc writing logic
  media: vidtv: simplify PSI write function
  media: vidtv: add date to the current event
  media: vidtv: fix service_id at SDT table
  media: vidtv: fix service type
  media: vidtv: add a PID entry for the NIT table
  media: vidtv: properly fill EIT service_id
  media: vidtv: fix the network ID range
  media: vidtv: improve EIT data
  media: vidtv: cleanup null packet initialization logic
  media: vidtv: pre-initialize mux arrays
  media: vidtv: remove some unused functions
  media: vidtv: do some cleanups at the driver
  drm/nouveau: fix relocations applying logic and a double-free
  media: vidtv: avoid copying data for PES structs
  media: vidtv: avoid data copy when initializing the multiplexer
  media: vidtv: fix some notes at the tone generator
  media: vidtv: fix the tone generator logic
  media: vidtv: fix the name of the program
  media: vidtv: don't use recursive functions
  media: vidtv: add error checks
  media: vidtv: reorganize includes
  media: vidtv: psi: fix missing assignments in while loops
  media: vidtv: Move s302m specific fields into encoder context
  media: vidtv: psi: extract descriptor chaining code into a helper
  media: vidtv: psi: Implement an Event Information Table (EIT)
  media: vidtv: psi: add a Network Information Table (NIT)
  media: vidtv: extract the initial CRC value to into a #define
  ch_ktls: lock is not freed
  net/tls: Protect from calling tls_dev_del for TLS RX twice
  devlink: Make sure devlink instance and port are in same net namespace
  devlink: Hold rtnl lock while reading netdev attributes
  ptp: clockmatrix: bug fix for idtcm_strverscmp
  IB/hfi1: Ensure correct mm is used at all times
  netfilter: nf_tables: avoid false-postive lockdep splat
  netfilter: ipset: prevent uninit-value in hash_ip6_add
  bpf: Add MAINTAINERS entry for BPF LSM
  enetc: Let the hardware auto-advance the taprio base-time of 0
  gro_cells: reduce number of synchronize_net() calls
  net: stmmac: fix incorrect merge of patch upstream
  ipv6: addrlabel: fix possible memory leak in ip6addrlbl_net_init
  x86/speculation: Fix prctl() when spectre_v2_user={seccomp,prctl},ibpb
  RISC-V: fix barrier() use in <vdso/processor.h>
  RISC-V: Add missing jump label initialization
  riscv: Explicitly specify the build id style in vDSO Makefile again
  gfs2: Don't freeze the file system during unmount
  gfs2: check for empty rgrp tree in gfs2_ri_update
  ANDROID: sync encrypt+casefold support with patches going upstream
  efi: EFI_EARLYCON should depend on EFI
  efivarfs: revert "fix memory leak in efivarfs_create()"
  efi/efivars: Set generic ops before loading SSDT
  RDMA/i40iw: Address an mmap handler exploit in i40iw
  arm64: tegra: Fix Tegra234 VDK node names
  arm64: tegra: Wrong AON HSP reg property size
  arm64: tegra: Fix USB_VBUS_EN0 regulator on Jetson TX1
  arm64: tegra: Correct the UART for Jetson Xavier NX
  arm64: tegra: Disable the ACONNECT for Jetson TX2
  spi: dw: Fix spi registration for controllers overriding CS
  ASoC: wm_adsp: fix error return code in wm_adsp_load()
  x86/tboot: Don't disable swiotlb when iommu is forced on
  trace: fix potenial dangerous pointer
  optee: add writeback to valid memory type
  vhost-vdpa: fix page pinning leakage in error path (rework)
  vringh: fix vringh_iov_push_*() documentation
  vhost scsi: fix lun reset completion handling
  drm/ast: Reload gamma LUT after changing primary plane's color format
  drm/amdgpu: Fix size calculation when init onchip memory
  Documentation: netdev-FAQ: suggest how to post co-dependent series
  Input: i8042 - fix error return code in i8042_setup_aux()
  Input: soc_button_array - add missing include
  ibmvnic: enhance resetting status check during module exit
  ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq
  ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues
  net: ena: fix packet's addresses for rx_offset feature
  net: ena: set initial DMA width to avoid intel iommu issue
  net: ena: handle bad request id in ena_netdev
  mm: fix VM_BUG_ON(PageTail) and BUG_ON(PageWriteback)
  nfc: s3fwrn5: use signed integer for parsing GPIO numbers
  dpaa2-eth: Fix compile error due to missing devlink support
  gfs2: set lockdep subclass for iopen glocks
  gfs2: Fix deadlock dumping resource group glocks
  MAINTAINERS: Update page pool entry
  bpftool: Fix error return value in build_btf_type_table
  tcp: Set ECT0 bit in tos/tclass for synack when BPF needs ECN
  net, xsk: Avoid taking multiple skbuff references
  devlink: Fix reload stats structure
  aquantia: Remove the build_skb path
  Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  kbuild: use -fmacro-prefix-map for .S sources
  Makefile.extrawarn: move -Wcast-align to W=3
  drm/amdgpu: update golden setting for sienna_cichlid
  drm/amd/display: Avoid HDCP initialization in devices without output
  drm/i915/gt: Free stale request on destroying the virtual engine
  drm/i915/gt: Don't cancel the interrupt shadow too early
  drm/i915/gt: Track signaled breadcrumbs outside of the breadcrumb spinlock
  drm/amdgpu: fix a page fault
  drm/amdgpu: fix SI UVD firmware validate resume fail
  drm/amd/amdgpu: fix null pointer in runtime pm
  drm/i915/gt: Defer enabling the breadcrumb interrupt to after submission
  drm/i915/gvt: correct a false comment of flag F_UNALIGN
  drm/i915/perf: workaround register corruption in OATAILPTR
  ANDROID: vfs: d_canonical_path cleanup #if 0
  intel_idle: Fix intel_idle() vs tracing
  sched/idle: Fix arch_cpu_idle() vs tracing
  io_uring: fix ITER_BVEC check
  io_uring: fix shift-out-of-bounds when round up cq size
  ARM: dts: sun7i: pcduino3-nano: enable RGMII RX/TX delay on PHY
  spi: imx: fix the unbalanced spi runtime pm management
  firmware: xilinx: Use hash-table for api feature check
  firmware: xilinx: Fix SD DLL node reset issue
  ALSA: hda/realtek: Enable headset of ASUS UX482EG & B9400CEA with ALC294
  x86/resctrl: Add necessary kernfs_put() calls to prevent refcount leak
  x86/resctrl: Remove superfluous kernfs_get() calls to prevent refcount leak
  mmc: sdhci-of-arasan: Fix clock registration error for Keem Bay SOC
  mmc: mediatek: Extend recheck_sdio_irq fix to more variants
  ANDROID: sched: add missing data type for cpu variable
  net/packet: fix packet receive on L3 devices without visible hard header
  soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)
  ANDROID: sched: Add restrict vendor hooks for load balance
  i40e: Fix removing driver while bare-metal VFs pass traffic
  vsock/virtio: discard packets only when socket is really closed
  ANDROID: db845c_gki.fragment: Remove USB_XHCI_HCD and XHCI_PCI_RENESAS configs
  tcp: fix race condition when creating child sockets from syncookies
  ANDROID: sched/fair: Have sync honor fits_capacity
  ANDROID: usb: f_accessory: avoid requeuing write req if disconnected
  FROMGIT: scsi: ufs: Put HBA into LPM during gating
  ANDROID: add vendor hooks to override show_cpufinfo_max_freq
  IB/mthca: fix return value of error branch in mthca_init_cq()
  btrfs: fix lockdep splat when enabling and disabling qgroups
  btrfs: do nofs allocations when adding and removing qgroup relations
  btrfs: fix lockdep splat when reading qgroup config on mount
  btrfs: tree-checker: add missing returns after data_ref alignment checks
  btrfs: don't access possibly stale fs_info data for printing duplicate device
  ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state
  habanalabs/gaudi: fix missing code in ECC handling
  ANDROID: arm64: gki_defconfig: Disable VHE
  drm/vc4: kms: Don't disable the muxing of an active CRTC
  drm/vc4: kms: Store the unassigned channel list in the state
  ANDROID: GKI: enable CONFIG_SCSI_UFS_BSG=y
  arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()
  arm64: pgtable: Fix pte_accessible()
  ANDROID: GKI: Enable CONFIG_USB_TYPEC_UCSI
  ANDROID: GKI: enable CONFIG_SCSI_UFS_DWC_TC_PLATFORM
  ANDROID: GKI: enable a bunch of HID config options =y
  iommu: Check return of __iommu_attach_device()
  arm-smmu-qcom: Ensure the qcom_scm driver has finished probing
  spi: spi-nxp-fspi: fix fspi panic by unexpected interrupts
  mmc: mediatek: Fix system suspend/resume support for CQHCI
  iommu/amd: Enforce 4k mapping for certain IOMMU data structures
  xsk: Fix incorrect netdev reference count
  ANDROID: GKI: Enable CONFIG_USB_XHCI_HCD
  ACPI/IORT: Fix doc warnings in iort.c
  arm64/fpsimd: add <asm/insn.h> to <asm/kprobes.h> to fix fpsimd build
  s390: fix fpu restore in entry.S
  powerpc/64s: Fix allnoconfig build since uaccess flush
  cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK
  drm/exynos: depend on COMMON_CLK to fix compile tests
  Linux 5.10-rc5
  afs: Fix speculative status fetch going out of order wrt to modifications
  mm: fix madvise WILLNEED performance problem
  libfs: fix error cast of negative value in simple_attr_write()
  mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()
  mm: memcg/slab: fix root memcg vmstats
  mm: fix readahead_page_batch for retry entries
  mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports
  compiler-clang: remove version check for BPF Tracing
  mm/madvise: fix memory leak from process_madvise
  irqchip/gic-v3-its: Unconditionally save/restore the ITS state on suspend
  irqchip/exiu: Fix the index of fwspec for IRQ type
  ibmvnic: skip tx timeout reset while in resetting
  ibmvnic: notify peers when failover and migration happen
  ibmvnic: fix call_netdevice_notifiers in do_reset
  tun: honor IOCB_NOWAIT flag
  net/af_iucv: set correct sk_protocol for child sockets
  usbnet: ipheth: fix connectivity with iOS 14
  cxgb4: Fix build failure when CONFIG_TLS=m
  bonding: wait for sysfs kobject destruction before freeing struct slave
  drm/mediatek: dsi: Modify horizontal front/back porch byte formula
  s390/qeth: fix tear down of async TX buffers
  s390/qeth: fix af_iucv notification race
  s390/qeth: make af_iucv TX notification call more robust
  s390/qeth: Remove pnso workaround
  tcp: Set INET_ECN_xmit configuration in tcp_reinit_congestion_control
  tcp: Allow full IP tos/IPv6 tclass to be reflected in L3 header
  dpaa2-eth: select XGMAC_MDIO for MDIO bus support
  ANDROID: gki_defconfig: Enable SERIAL_MSM_GENI_EARLY_CONSOLE
  ANDROID: gki_defconfig: Remove QCOM_COMMAND_DB=y
  cxgb4: fix the panic caused by non smac rewrite
  selftests/seccomp: sh: Fix register names
  selftests/seccomp: powerpc: Fix typo in macro variable name
  block/keyslot-manager: prevent crash when num_slots=1
  net/tls: missing received data after fast remote close
  bnxt_en: Release PCI regions when DMA mask setup fails during probe.
  rose: Fix Null pointer dereference in rose_send_frame()
  MAINTAINERS: Change Solarflare maintainers
  spi: Take the SPI IO-mutex in the spi_setup() method
  ARM: dts: sun8i: v3s: fix GIC node memory range
  USB: core: Change %pK for __user pointers to %px
  MAINTAINERS: Update email address for Sean Christopherson
  USB: core: Fix regression in Hercules audio card
  usb: gadget: Fix memleak in gadgetfs_fill_super
  usb: gadget: f_midi: Fix memleak in f_midi_alloc
  USB: quirks: Add USB_QUIRK_DISCONNECT_SUSPEND quirk for Lenovo A630Z TIO built-in usb-audio card
  xsk: Fix umem cleanup bug at socket destruct
  MAINTAINERS: Update XDP and AF_XDP entries
  interconnect: fix memory trashing in of_count_icc_providers()
  ALSA: hda/realtek - Fixed Dell AIO wrong sound tone
  interconnect: qcom: qcs404: Remove GPU and display RPM IDs
  interconnect: qcom: msm8916: Remove rpm-ids from non-RPM nodes
  video: hyperv_fb: Fix the cache type when mapping the VRAM
  mtd: rawnand: socrates: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: sharpsl: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: r852: Move the ECC initialization to ->attach_chip()
  USB: serial: option: add Fibocom NL668 variants
  ANDROID: sched: rt: rearrange invocation of find_lowest_rq() vendor hook
  bnxt_en: fix error return code in bnxt_init_board()
  bnxt_en: fix error return code in bnxt_init_one()
  ext4: fix bogus warning in ext4_update_dx_flag()
  jbd2: fix kernel-doc markups
  scsi: ufs: Fix race between shutdown and runtime resume flow
  ANDROID: GKI: enable CONFIG_SUN4I_TIMER
  xfs: revert "xfs: fix rmap key and record comparison functions"
  ANDROID: mm/memblock: export memblock_end_of_DRAM
  mtd: rawnand: plat_nand: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: pasemi: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: tmio: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: txx9ndfmc: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: orion: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: mpc5121: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: lpc32xx_slc: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: lpc32xx_mlc: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: fsmc: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: diskonchip: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: davinci: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: cs553x: Move the ECC initialization to ->attach_chip()
  ext4: drop fast_commit from /proc/mounts
  mtd: rawnand: au1550: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: ams-delta: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: xway: Move the ECC initialization to ->attach_chip()
  mtd: rawnand: gpio: Move the ECC initialization to ->attach_chip()
  drm/i915/gt: Fixup tgl mocs for PTE tracking
  fail_function: Remove a redundant mutex unlock
  selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL
  lib/strncpy_from_user.c: Mask out bytes after NUL terminator.
  ANDROID: Sched: Export sched_feat_keys symbol needed by vendor modules
  drm/vram-helper: Fix use of top-down placement
  net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
  net/smc: fix matching of existing link groups
  ipv6: Remove dependency of ipv6_frag_thdr_truncated on ipv6 module
  ANDROID: sched: Export few scheduler symbols for vendor modules
  ALSA: mixart: Fix mutex deadlock
  xfs: don't allow NOWAIT DIO across extent boundaries
  libbpf: Fix VERSIONED_SYM_COUNT number parsing
  HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
  HID: logitech-dj: Fix an error in mse_bluetooth_descriptor
  drm/vc4: hdmi: Disable Wifi Frequencies
  dt-bindings: display: Add a property to deal with WiFi coexistence
  thunderbolt: Fix use-after-free in remove_unplugged_switch()
  Revert "iommu/vt-d: Take CONFIG_PCI_ATS into account"
  docs: bootconfig: Update file format on initrd image
  tools/bootconfig: Align the bootconfig applied initrd image size to 4
  tools/bootconfig: Fix to check the write failure correctly
  tools/bootconfig: Fix errno reference after printf()
  drm/vc4: kms: Document the muxing corner cases
  drm/vc4: kms: Split the HVS muxing check in a separate function
  drm/vc4: kms: Rename NUM_CHANNELS
  drm/vc4: kms: Remove useless define
  drm/vc4: kms: Switch to drmm_add_action_or_reset
  drm/vc4: hdmi: Block odd horizontal timings
  drm/vc4: hdmi: Make sure our clock rate is within limits
  ASoC: Intel: bytcr_rt5640: Fix HP Pavilion x2 Detachable quirks
  powerpc/64s: rename pnv|pseries_setup_rfi_flush to _setup_security_mitigations
  selftests/powerpc: refactor entry and rfi_flush tests
  selftests/powerpc: entry flush test
  powerpc: Only include kup-radix.h for 64-bit Book3S
  powerpc/64s: flush L1D after user accesses
  powerpc/64s: flush L1D on kernel entry
  selftests/powerpc: rfi_flush: disable entry flush if present
  ALSA: hda/ca0132: Fix compile warning without PCI
  MAINTAINERS: Temporarily add myself to the IOMMU entry
  iommu/vt-d: Fix compile error with CONFIG_PCI_ATS not set
  ARM: dts: dra76x: m_can: fix order of clocks
  bus: ti-sysc: suppress err msg for timers used as clockevent/source
  drm/i915/gt: Remember to free the virtual breadcrumbs
  drm/i915: Handle max_bpc==16
  scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE
  scsi: ufs: Fix unexpected values from ufshcd_read_desc_param()
  net/mlx4_core: Fix init_hca fields offset
  atm: nicstar: Unmap DMA on send error
  page_frag: Recover from memory pressure
  ANDROID: uid_sys_stats: report uid_cputime stats in microseconds
  drm/amd/display: Always get CRTC updated constant values inside commit tail
  net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset
  mlxsw: core: Use variable timeout for EMAD retries
  mlxsw: Fix firmware flashing
  net: Have netpoll bring-up DSA management interface
  atl1e: fix error return code in atl1e_probe()
  atl1c: fix error return code in atl1c_probe()
  ah6: fix error return code in ah6_input()
  net: usb: qmi_wwan: Set DTR quirk for MR400
  regulator: ti-abb: Fix array out of bound read access on the first transition
  ASOC: Intel: kbl_rt5663_rt5514_max98927: Do not try to disable disabled clock
  xfs: return corresponding errcode if xfs_initialize_perag() fail
  xfs: ensure inobt record walks always make forward progress
  xfs: fix forkoff miscalculation related to XFS_LITINO(mp)
  xfs: directory scrub should check the null bestfree entries too
  xfs: strengthen rmap record flags checking
  xfs: fix the minrecs logic when dealing with inode root child blocks
  can: m_can: process interrupt only when not runtime suspended
  gfs2: Fix regression in freeze_go_sync
  can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery
  io_uring: order refnode recycling
  io_uring: get an active ref_node from files_data
  iommu/vt-d: Avoid panic if iommu init fails in tboot system
  dmaengine: fix error codes in channel_register()
  MAINTAINERS: add uv.c also to KVM/s390
  s390/uv: handle destroy page legacy interface
  x86/dumpstack: Do not try to access user space code of other tasks
  can: kvaser_usb: kvaser_usb_hydra: Fix KCAN bittiming limits
  can: kvaser_pciefd: Fix KCAN bittiming limits
  drm/sun4i: backend: Fix probe failure with multiple backends
  ARC: stack unwinding: reorganize how initial register state setup
  ARC: stack unwinding: don't assume non-current task is sleeping
  ARC: mm: fix spelling mistakes
  ARC: bitops: Remove unecessary operation and value
  powerpc/64s/exception: KVM Fix for host DSI being taken in HPT guest MMU context
  ipv4: use IS_ENABLED instead of ifdef
  qed: fix ILT configuration of SRC block
  inet_diag: Fix error path to cancel the meseage in inet_req_diag_fill()
  tools/testing/scatterlist: Fix test to compile and run
  bpf, sockmap: Avoid failures from skb_to_sgvec when skb has frag_list
  bpf, sockmap: Handle memory acct if skb_verdict prog redirects to self
  bpf, sockmap: Avoid returning unneeded EAGAIN when redirecting to self
  bpf, sockmap: Use truesize with sk_rmem_schedule()
  bpf, sockmap: Ensure SO_RCVBUF memory is observed on ingress redirect
  bpf, sockmap: Fix partial copy_page_to_iter so progress can still be made
  net/tls: Fix wrong record sn in async mode of device resync
  interconnect: qcom: msm8974: Don't boost the NoC rate during boot
  interconnect: qcom: msm8974: Prevent integer overflow in rate
  io_uring: don't double complete failed reissue request
  netdevsim: set .owner to THIS_MODULE
  seccomp: Set PF_SUPERPRIV when checking capability
  ptrace: Set PF_SUPERPRIV when checking capability
  enetc: Workaround for MDIO register access issue
  MAINTAINERS: Remove myself as LPC32xx maintainers
  net/mlx5: fix error return code in mlx5e_tc_nic_init()
  net/mlx5: E-Switch, Fail mlx5_esw_modify_vport_rate if qos disabled
  net/mlx5: Disable QoS when min_rates on all VFs are zero
  net/mlx5: Clear bw_share upon VF disable
  net/mlx5: Add handling of port type in rule deletion
  net/mlx5e: Fix check if netdev is bond slave
  net/mlx5e: Fix IPsec packet drop by mlx5e_tc_update_skb
  net/mlx5e: Set IPsec WAs only in IP's non checksum partial case.
  net/mlx5e: Fix refcount leak on kTLS RX resync
  tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
  net: ftgmac100: Fix crash when removing driver
  KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace
  net: b44: fix error return code in b44_init_one()
  qed: fix error return code in qed_iwarp_ll2_start()
  drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()
  spi: npcm-fiu: Don't leak SPI master in probe error path
  spi: dw: Set transfer handler before unmasking the IRQs
  dm writecache: fix the maximum number of arguments
  dm writecache: advance the number of arguments when reporting max_age
  dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY
  arm64: dts: qcom: clear the warnings caused by empty dma-ranges
  arm64: dts: broadcom: clear the warnings caused by empty dma-ranges
  xtensa: uaccess: Add missing __user to strncpy_from_user() prototype
  ALSA: usb-audio: Add delay quirk for all Logitech USB devices
  perf/x86: fix sysfs type mismatches
  lockdep: Put graph lock/unlock under lock_recursion protection
  sched/deadline: Fix priority inheritance with multiple scheduling classes
  sched: Fix rq->nr_iowait ordering
  sched: Fix data-race in wakeup
  sched/fair: Fix overutilized update in enqueue_task_fair()
  MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu
  mmc: sdhci-of-arasan: Issue DLL reset explicitly
  mmc: sdhci-of-arasan: Use Mask writes for Tap delays
  mmc: sdhci-of-arasan: Allow configuring zero tap values
  mmc: sdhci-pci: Prefer SDR25 timing for High Speed mode for BYT-based Intel controllers
  powerpc: Drop -me200 addition to build flags
  x86/microcode/intel: Check patch signature before saving microcode for early loading
  MIPS: kernel: Fix for_each_memblock conversion
  KVM: SVM: fix error return code in svm_create_vcpu()
  cpufreq: scmi: Fix OPP addition failure with a dummy clock provider
  cpufreq: tegra186: Fix get frequency callback
  scsi: target: iscsi: Fix cmd abort fabric stop race
  scsi: libiscsi: Fix NOP race condition
  bnxt_en: Avoid unnecessary NVM_GET_DEV_INFO cmd error log on VFs.
  bnxt_en: Fix counter overflow logic.
  bnxt_en: Free port stats during firmware reset.
  bnxt_en: read EEPROM A2h address using page 0
  net: ipa: lock when freeing transaction
  net/tls: fix corrupted data in recvmsg
  net: qualcomm: rmnet: Fix incorrect receive packet handling during cleanup
  net: mvneta: fix possible memory leak in mvneta_swbm_add_rx_fragment
  net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call
  net: bridge: add missing counters to ndo_get_stats64 callback
  net: ethernet: ti: cpsw: fix error return code in cpsw_probe()
  net: stmmac: dwmac-intel-plat: fix error return code in intel_eth_plat_probe()
  qlcnic: fix error return code in qlcnic_83xx_restart_hw()
  cx82310_eth: fix error return code in cx82310_bind()
  drm/i915/selftests: Fix wrong return value of perf_request_latency()
  drm/i915/selftests: Fix wrong return value of perf_series_engines()
  drm/i915: Avoid memory leak with more than 16 workarounds on a list
  drm/i915/tgl: Fix Media power gate sequence.
  MAINTAINERS: update cxgb4 and cxgb3 maintainer
  drm/amdgpu: remove experimental flag from arcturus
  net: lantiq: Wait for the GPHY firmware to be ready
  selftests/bpf: Fix error return code in run_getsockopt_test()
  mm: never attempt async page lock if we've transferred data already
  ASoC: Intel: catpt: Correct clock selection for dai trigger
  ASoC: Intel: catpt: Skip position update for unprepared streams
  spi: cadence-quadspi: Fix error return code in cqspi_probe
  ASoC: qcom: lpass-platform: Fix memory leak
  ASoC: Intel: KMB: Fix S24_LE configuration
  KVM: SVM: Fix offset computation bug in __sev_dbg_decrypt().
  drm/amd/display: Add missing pflip irq for dcn2.0
  ACPI, APEI, Fix error return value in apei_map_generic_address()
  MAINTAINERS: Add Martin Schiller as a maintainer for the X.25 stack
  ipv6/netfilter: Discard first fragment not including all headers
  media: venus: pm_helpers: Fix kernel module reload
  media: venus: venc: Fix setting of profile and level
  net: fec: Fix reference count leak in fec series ops
  PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter
  dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size
  dmaengine: ioatdma: remove unused function missed during dma_v2 removal
  perf test: Avoid an msan warning in a copied stack.
  dmaengine: idxd: fix mapping of portal size
  perf inject: Fix file corruption due to event deletion
  arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed
  s390/dasd: fix null pointer dereference for ERP requests
  ALSA: hda: Add Alderlake-S PCI ID and HDMI codec vid
  ACPI: fan: Initialize performance state sysfs attribute
  iommu/vt-d: Take CONFIG_PCI_ATS into account
  KVM: PPC: Book3S HV: XIVE: Fix possible oops when accessing ESB page
  cpuidle: tegra: Annotate tegra_pm_set_cpu_in_lp2() with RCU_NONIDLE
  xtensa: disable preemption around cache alias management calls
  xtensa: fix TLBTEMP area placement
  pinctrl: baytrail: Avoid clearing debounce value when turning it off
  pinctrl: merrifield: Set default bias in case no particular value given
  pinctrl: jasperlake: Fix HOSTSW_OWN offset
  pinctrl: jasperlake: Unhide SPI group of pins
  KVM: arm64: Correctly align nVHE percpu data
  usb: typec: qcom-pmic-typec: fix builtin build errors
  ALSA: usb-audio: Use ALC1220-VB-DT mapping for ASUS ROG Strix TRX40 mobo
  phy: mediatek: fix spelling mistake in Kconfig "veriosn" -> "version"
  phy: qualcomm: Fix 28 nm Hi-Speed USB PHY OF dependency
  phy: qualcomm: usb: Fix SuperSpeed PHY OF dependency
  phy: intel: PHY_INTEL_KEEMBAY_EMMC should depend on ARCH_KEEMBAY
  usb: cdns3: gadget: calculate TD_SIZE based on TD
  usb: cdns3: gadget: initialize link_trb as NULL
  smb3: Handle error case during offload read path
  smb3: Avoid Mid pending list corruption
  smb3: Call cifs reconnect from demultiplex thread
  cifs: fix a memleak with modefromsid
  fix return values of seq_read_iter()
  Linux 5.10-rc4
  powerpc/64s: Fix KVM system reset handling when CONFIG_PPC_PSERIES=y
  vhost scsi: Add support for LUN resets.
  vhost scsi: add lun parser helper
  vhost scsi: fix cmd completion race
  vhost scsi: alloc cmds per vq instead of session
  vhost: add helper to check if a vq has been setup
  vdpasim: fix "mac_pton" undefined error
  can: m_can: m_can_stop(): set device to software init mode before closing
  can: m_can: Fix freeing of can device from peripherials
  can: m_can: m_can_class_free_dev(): introduce new function
  can: m_can: m_can_handle_state_change(): fix state change
  can: tcan4x5x: tcan4x5x_can_remove(): fix order of deregistration
  can: tcan4x5x: tcan4x5x_can_probe(): add missing error checking for devm_regmap_init()
  can: tcan4x5x: replace depends on REGMAP_SPI with depends on SPI
  can: flexcan: fix failure handling of pm_runtime_get_sync()
  can: flexcan: flexcan_setup_stop_mode(): add missing "req_bit" to stop mode property comment
  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()
  kvm: mmu: fix is_tdp_mmu_check when the TDP MMU is not in use
  batman-adv: set .owner to THIS_MODULE
  devlink: Add missing genlmsg_cancel() in devlink_nl_sb_port_pool_fill()
  net: stmmac: dwmac_lib: enlarge dma reset timeout
  lan743x: prevent entire kernel HANG on open, for some platforms
  lan743x: fix issue causing intermittent kernel log warnings
  netlabel: fix an uninitialized warning in netlbl_unlabel_staticlist()
  sctp: change to hold/put transport for proto_unreach_timer
  afs: Fix afs_write_end() when called with copied == 0 [ver #3]
  vsock: forward all packets to the host when no H2G is registered
  net: dsa: mv88e6xxx: Avoid VTU corruption on 6097
  ocfs2: initialize ip_next_orphan
  panic: don't dump stack twice on warn
  hugetlbfs: fix anon huge page migration race
  mm: memcontrol: fix missing wakeup polling thread
  kernel/watchdog: fix watchdog_allowed_mask not used warning
  reboot: fix overflow parsing reboot cpu number
  Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
  compiler.h: fix barrier_data() on clang
  mm/gup: use unpin_user_pages() in __gup_longterm_locked()
  mm/slub: fix panic in slab_alloc_node()
  mailmap: fix entry for Dmitry Baryshkov/Eremin-Solenikov
  mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit
  mm/compaction: stop isolation if too many pages are isolated and we have pages to migrate
  mm/compaction: count pages and stop correctly during page isolation
  net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe()
  blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats
  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
  io_uring: handle -EOPNOTSUPP on path resolution
  bpf: Relax return code check for subprograms
  nvme: fix memory leak freeing command effects
  nvme: directly cache command effects log
  nvme: free sq/cq dbbuf pointers when dbbuf set fails
  drm/nouveau/kms/nv50-: Use atomic encoder callbacks everywhere
  drm/nouveau/ttm: avoid using nouveau_drm.ttm.type_vram prior to nv50
  drm/nouveau/kms: Fix NULL pointer dereference in nouveau_connector_detect_depth
  ipv6: Fix error path to cancel the meseage
  ip_tunnels: Set tunnel option flag when tunnel metadata is present
  proc: don't allow async path resolution of /proc/self components
  net: ethernet: ti: am65-cpts: update ret when ptp_clock is ERROR
  net: marvell: prestera: fix error return code in prestera_pci_probe()
  net: phy: mscc: remove non-MACSec compatible phy
  net: Exempt multicast addresses from five-second neighbor lifetime
  net: ethernet: ti: cpsw: fix cpts irq after suspend
  block: mark flush request as IDLE when it is really finished
  btrfs: tree-checker: add missing return after error in root_item
  btrfs: qgroup: don't commit transaction when we already hold the handle
  btrfs: fix missing delalloc new bit for new delalloc ranges
  ANDROID: sched_clock: Add vendor hook to print epoch values
  drm/tegra: output: Do not put OF node twice
  ANDROID: enable LLVM_IAS=1 for clang's integrated assembler for x86_64
  ANDROID: x86: entry: work around LLVM_IAS=1 bug in LSL
  spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
  ALSA: firewire: Clean up a locking issue in copy_resp_to_buf()
  IB/hfi1: Fix error return code in hfi1_init_dd()
  ANDROID: ARM: Bump command line size
  ANDROID: ARM: Use zImage instead of Image
  docs: ABI: testing: iio: stm32: remove re-introduced unsupported ABI
  tools, bpftool: Add missing close before bpftool net attach exit
  dt-bindings: clock: imx5: fix example
  dt-bindings: can: fsl,flexcan.yaml: fix compatible for i.MX35 and i.MX53
  hwmon: (amd_energy) modify the visibility of the counters
  usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode
  MAINTAINERS: add usb raw gadget entry
  usb: typec: ucsi: Report power supply changes
  regulator: workaround self-referent regulators
  regulator: avoid resolve_supply() infinite recursion
  regulator: fix memory leak with repeated set_machine_constraints()
  ASoC: rt1015: increase the time to detect BCLK
  xhci: hisilicon: fix refercence leak in xhci_histb_probe
  Revert "usb: musb: convert to devm_platform_ioremap_resource_byname"
  ARM: dts: exynos: revert "add input clock to CMU in Exynos4412 Odroid"
  KVM: SVM: Update cr3_lm_rsvd_bits for AMD SEV guests
  KVM: x86: Introduce cr3_lm_rsvd_bits in kvm_vcpu_arch
  KVM: x86: clflushopt should be treated as a no-op by emulation
  iommu/vt-d: Cure VF irqdomain hickup
  ALSA: ctl: fix error path at adding user-defined element set
  ALSA: hda/realtek - HP Headset Mic can't detect after boot
  ALSA: hda/realtek - Add supported mute Led for HP
  arm64: cpu_errata: Apply Erratum 845719 to KRYO2XX Silver
  arm64: proton-pack: Add KRYO2XX silver CPUs to spectre-v2 safe-list
  arm64: kpti: Add KRYO2XX gold/silver CPU cores to kpti safelist
  arm64: Add MIDR value for KRYO2XX gold/silver CPU cores
  arm64/mm: Validate hotplug range before creating linear mapping
  ANDROID: scsi: ufs: Allow prepare_command to return error code
  FROMLIST: scsi: ufs: show lba and length for unmap commands
  mac80211: free sta in sta_info_insert_finish() on errors
  drm/amdgpu: enable DCN for navi10 headless SKU
  drm/amdgpu: add ta firmware load for green-sardine
  drm/i915/gvt: return error when failing to take the module reference
  net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request
  net: ethernet: mtk-star-emac: fix error return code in mtk_star_enable()
  bootconfig: Extend the magic check range to the preceding 3 bytes
  selinux: Fix error return code in sel_ib_pkey_sid_slow()
  net: ethernet: mtk-star-emac: return ok when xmit drops
  net/ncsi: Fix netlink registration
  drm/i915: Correctly set SFC capability for video engines
  drm/i915/gem: Pull phys pread/pwrite implementations to the backend
  drm/i915/gem: Allow backends to override pread implementation
  x86/platform/uv: Fix copied UV5 output archtype
  KVM: arm64: Handle SCXTNUM_ELx traps
  KVM: arm64: Unify trap handlers injecting an UNDEF
  KVM: arm64: Allow setting of ID_AA64PFR0_EL1.CSV2 from userspace
  drm: bridge: dw-hdmi: Avoid resetting force in the detect function
  loop: Fix occasional uevent drop
  block: add a return value to set_capacity_revalidate_and_notify
  SUNRPC: Fix oops in the rpc_xdr_buf event class
  perf test: Update branch sample pattern for cs-etm
  perf test: Fix a typo in cs-etm testing
  tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy'
  perf lock: Don't free "lock_seq_stat" if read_count isn't zero
  perf lock: Correct field name "flags"
  MAINTAINERS/bpf: Update Andrii's entry.
  spi: lpspi: Fix use-after-free on unbind
  lan743x: fix use of uninitialized variable
  net: udp: fix IP header access and skb lookup on Fast/frag0 UDP GRO
  net: udp: fix UDP header access on Fast/frag0 UDP GRO
  gfs2: Fix case in which ail writes are done to jdata holes
  Revert "gfs2: Ignore journal log writes for jdata holes"
  RMDA/sw: Don't allow drivers using dma_virt_ops on highmem configs
  selftests/bpf: Fix unused attribute usage in subprogs_unused test
  RDMA/pvrdma: Fix missing kfree() in pvrdma_register_device()
  FROMLIST: fuse: Fix colliding FUSE_PASSTHROUGH flag
  RDMA/cm: Make the local_id_table xarray non-irq
  devlink: Avoid overwriting port attributes of registered port
  vrf: Fix fast path output packet handling with async Netfilter rules
  NFS: Remove unnecessary inode lock in nfs_fsync_dir()
  NFS: Remove unnecessary inode locking in nfs_llseek_dir()
  NFS: Fix listxattr receive buffer size
  NFSv4.2: fix failure to unregister shrinker
  spi: bcm-qspi: Fix use-after-free on unbind
  spi: bcm2835aux: Fix use-after-free on unbind
  spi: bcm2835: Fix use-after-free on unbind
  spi: Introduce device-managed SPI controller allocation
  HID: Add Logitech Dinovo Edge battery quirk
  HID: logitech-hidpp: Add HIDPP_CONSUMER_VENDOR_KEYS quirk for the Dinovo Edge
  hwmon: (applesmc) Re-work SMC comms
  hwmon: (pwm-fan) Fix RPM calculation
  HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
  gfs2: fix possible reference leak in gfs2_check_blk_type
  thermal: ti-soc-thermal: Disable the CPU PM notifier for OMAP4430
  s390/cpum_sf.c: fix file permission for cpum_sfb_size
  s390: update defconfigs
  mac80211: minstrel: fix tx status processing corner case
  mac80211: minstrel: remove deferred sampling code
  mac80211: fix memory leak on filtered powersave frames
  serial: ar933x_uart: disable clk on error handling path in probe
  tty: serial: imx: keep console clocks always on
  speakup: Do not let the line discipline be used several times
  tty: serial: imx: fix potential deadlock
  rfkill: Fix use-after-free in rfkill_resume()
  drm/i915/gvt: Set ENHANCED_FRAME_CAP bit
  fscrypt: fix inline encryption not used on new files
  Input: elan_i2c - fix firmware update on newer ICs
  ANDROID: gic-v3: Add vendor hook to GIC v3
  cosa: Add missing kfree in error path of cosa_write
  Input: resistive-adc-touch - fix kconfig dependency on IIO_BUFFER
  net: switch to the kernel.org patchwork instance
  ANDROID: arm64: gki_defconfig: Disable RANDOMIZE_MODULE_REGION_FULL
  ch_ktls: stop the txq if reaches threshold
  ch_ktls: tcb update fails sometimes
  ch_ktls/cxgb4: handle partial tag alone SKBs
  ch_ktls: don't free skb before sending FIN
  ch_ktls: packet handling prior to start marker
  ch_ktls: Correction in middle record handling
  ch_ktls: missing handling of header alone
  ch_ktls: Correction in trimmed_len calculation
  cxgb4/ch_ktls: creating skbs causes panic
  ch_ktls: Update cheksum information
  ch_ktls: Correction in finding correct length
  cxgb4/ch_ktls: decrypted bit is not enough
  dt-bindings: can: fsl,flexcan.yaml: fix fsl,stop-mode
  of/address: Fix of_node memory leak in of_dma_is_coherent
  net/x25: Fix null-ptr-deref in x25_connect
  arm64: dts: fsl-ls1028a-kontron-sl28: specify in-band mode for ENETC
  tipc: fix memory leak in tipc_topsrv_start()
  Revert "ext4: fix superblock checksum calculation race"
  ext4: handle dax mount option collision
  ANDROID: ext4: fix encrypt+casefold support
  io_uring: round-up cq size before comparing with rounded sq size
  xfs: fix a missing unlock on error in xfs_fs_map_blocks
  spi: fsi: Fix transfer returning without finalizing message
  spi: fix client driver breakages when using GPIO descriptors
  regulator: pfuze100: limit pfuze-support-disable-sw to pfuze{100,200}
  x86/platform/uv: Drop last traces of uv_flush_tlb_others
  Drivers: hv: vmbus: Allow cleanup of VMBUS_CONNECT_CPU if disconnected
  bpf: Fix unsigned 'datasec_id' compared with zero in check_pseudo_btf_id
  gpio: sifive: Fix SiFive gpio probe
  KVM: s390: remove diag318 reset code
  KVM: s390: pv: Mark mm as protected after the set secure parameters and improve cleanup
  ALSA: hda/realtek: Add some Clove SSID in the ALC293(ALC1220)
  ARM: dts: am437x-l4: fix compatible for cpsw switch dt node
  scsi: ufshcd: Fix missing destroy_workqueue()
  MAINTAINERS: remove Ursula Braun as s390 network maintainer
  net/af_iucv: fix null pointer dereference on shutdown
  lan743x: fix "BUG: invalid wait context" when setting rx mode
  net: dsa: mv88e6xxx: Fix memleak in mv88e6xxx_region_atu_snapshot
  net: Update window_clamp if SOCK_RCVBUF is set
  rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled
  vfs: move __sb_{start,end}_write* to fs.h
  vfs: separate __sb_start_write into blocking and non-blocking helpers
  vfs: remove lockdep bogosity in __sb_start_write
  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
  net: phy: realtek: support paged operations on RTL8201CP
  lan743x: correctly handle chips with internal PHY
  netlabel: fix our progress tracking in netlbl_unlabel_staticlist()
  drm/mcde: Fix unbalanced regulator
  MAINTAINERS: Update repositories for Intel Ethernet Drivers
  igc: Fix returning wrong statistics
  i40e, xsk: uninitialized variable in i40e_clean_rx_irq_zc()
  i40e: Fix MAC address setting for a VF via Host/VM
  selftest: fix flower terse dump tests
  ANDROID: scsi: ufs: revise and fix custom keyslot manager support
  ANDROID: vendor_hooks: Add hook for jiffies updates
  ANDROID: clk: Enable writable debugfs files
  um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb()
  kunit: fix display of failed expectations for strings
  kunit: tool: fix extra trailing \n in raw + parsed test output
  kunit: tool: print out stderr from make (like build warnings)
  KUnit: Docs: usage: wording fixes
  KUnit: Docs: style: fix some Kconfig example issues
  KUnit: Docs: fix a wording typo
  kunit: Do not pollute source directory with generated files (test.log)
  ANDROID: enable LLVM_IAS=1 for clang's integrated assembler for aarch64
  FROMLIST: Kbuild: do not emit debug info for assembly with LLVM_IAS=1
  kunit: Do not pollute source directory with generated files (.kunitconfig)
  kunit: tool: fix pre-existing python type annotation errors
  kunit: Fix kunit.py parse subcommand (use null build_dir)
  ANDROID: printk: add vendor hook for console flush
  ANDROID: Reduce log level for couple of prints in hotplug flow
  kunit: tool: unmark test_data as binary blobs
  drm/tegra: replace idr_init() by idr_init_base()
  ANDROID: GKI: Enable CONFIG_RT_SOFTINT_OPTIMIZATION
  ANDROID: trace: Add trace points for tasklet entry/exit
  ANDROID: Revert "softirq: Let ksoftirqd do its job"
  ANDROID: Revert "Mark HI and TASKLET softirq synchronous"
  ANDROID: softirq: defer softirq processing to ksoftirqd if CPU is busy with RT
  ANDROID: sched: avoid migrating when softint on tgt cpu should be short
  ANDROID: sched: avoid placing RT threads on cores handling softirqs
  Revert "ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple"
  iwlwifi: mvm: fix kernel panic in case of assert during CSA
  iwlwifi: pcie: set LTR to avoid completion timeout
  iwlwifi: mvm: write queue_sync_state only for sync
  iwlwifi: mvm: properly cancel a session protection for P2P
  iwlwifi: mvm: use the HOT_SPOT_CMD to cancel an AUX ROC
  iwlwifi: sta: set max HE max A-MPDU according to HE capa
  efi/x86: Free efi_pgd with free_pages()
  ACPI: DPTF: Support Alder Lake
  Documentation: ACPI: fix spelling mistakes
  sched/debug: Fix memory corruption caused by multiple small reads of flags
  sched/fair: Prefer prev cpu in asymmetric wakeup path
  sched/fair: Ensure tasks spreading in LLC during LB
  perf/x86/intel/uncore: Fix Add BW copypasta
  lockdep: Avoid to modify chain keys in validate_chain()
  drm/tegra: sor: Ensure regulators are disabled on teardown
  cpufreq: intel_pstate: Take CPUFREQ_GOV_STRICT_TARGET into account
  cpufreq: Add strict_target to struct cpufreq_policy
  cpufreq: Introduce CPUFREQ_GOV_STRICT_TARGET
  cpufreq: Introduce governor flags
  regulator: core: don't disable regulator if is_enabled return error.
  tools/power turbostat: update version number
  powercap: restrict energy meter to root access
  nbd: fix a block_device refcount leak in nbd_release
  pinctrl: qcom: sm8250: Specify PDC map
  pinctrl: qcom: Move clearing pending IRQ to .irq_request_resources callback
  pinctrl: amd: use higher precision for 512 RtcClk
  pinctrl: amd: fix incorrect way to disable debounce filter
  arm64: smp: Tell RCU about CPUs that fail to come online
  arm64: psci: Avoid printing in cpu_psci_cpu_die()
  arm64: kexec_file: Fix sparse warning
  arm64: errata: Fix handling of 1418040 with late CPU onlining
  Revert "mmc: renesas_sdhi: workaround a regression when reinserting SD cards"
  mmc: tmio: bring tuning HW to a sane state with MMC_POWER_OFF
  mmc: tmio: when resetting, reset DMA controller, too
  dmaengine: ti: omap-dma: Block PM if SDMA is busy to fix audio
  mmc: sdhci-of-esdhc: Handle pulse width detection erratum for more SoCs
  mmc: renesas_sdhi_core: Add missing tmio_mmc_host_free() at remove
  ANDROID: Enable hermetic toolchain
  net: xfrm: fix memory leak in xfrm_user_policy()
  drm/i915/gvt: Temporarily disable vfio_edid for BXT/APL
  ARM: dts: imx50-evk: Fix the chip select 1 IOMUX
  arm64: dts: imx8mm: fix voltage for 1.6GHz CPU operating point
  mptcp: provide rmem[0] limit
  docs: networking: phy: s/2.5 times faster/2.5 times as fast/
  ethtool: netlink: add missing netdev_features_change() call
  tunnels: Fix off-by-one in lower MTU bounds for ICMP/ICMPv6 replies
  IPv6: Set SIT tunnel hard_header_len to zero
  bpf: Fix passing zero to PTR_ERR() in bpf_btf_printf_prepare
  libbpf: Don't attempt to load unused subprog as an entry-point BPF program
  ACPI: button: Add DMI quirk for Medion Akoya E2228T
  ACPI: GED: fix -Wformat
  ACPI: Fix whitespace inconsistencies
  ACPI: scan: Fix acpi_dma_configure_id() kerneldoc name
  Documentation: firmware-guide: gpio-properties: Clarify initial output state
  Documentation: firmware-guide: gpio-properties: active_low only for GpioIo()
  Documentation: firmware-guide: gpio-properties: Fix factual mistakes
  uio: Fix use-after-free in uio_unregister_device()
  firmware: xilinx: fix out-of-bounds access
  nitro_enclaves: Fixup type and simplify logic of the poll mask setup
  speakup ttyio: Do not schedule() in ttyio_in_nowait
  speakup: Fix clearing selection in safe context
  speakup: Fix var_id_t values and thus keymap
  perf/x86/intel: Make anythread filter support conditional
  perf: Tweak perf_event_attr::exclusive semantics
  perf: Fix event multiplexing for exclusive groups
  perf: Simplify group_sched_in()
  perf: Simplify group_sched_out()
  perf/x86: Make dummy_iregs static
  perf/arch: Remove perf_sample_data::regs_user_copy
  perf: Optimize get_recursion_context()
  perf: Fix get_recursion_context()
  perf/x86: Reduce stack usage for x86_pmu::drain_pebs()
  perf: Reduce stack usage of perf_output_begin()
  virtio: virtio_console: fix DMA memory allocation for rproc serial
  nvme: fix incorrect behavior when BLKROSET is called by the user
  KVM: selftests: allow two iterations of dirty_log_perf_test
  drm/gma500: Fix out-of-bounds access to struct drm_device.vblank[]
  fanotify: fix logic of reporting name info with watched parent
  x86/xen: don't unbind uninitialized lock_kicker_irq
  ARM: dts: stm32: Keep VDDA LDO1 always on on DHCOM
  ARM: dts: stm32: Enable thermal sensor support on stm32mp15xx-dhcor
  drm/tegra: sor: Don't warn on probe deferral
  futex: Don't enable IRQs unconditionally in put_pi_state()
  ARM: dts: stm32: Define VIO regulator supply on DHCOM
  ARM: dts: stm32: Fix LED5 on STM32MP1 DHCOM PDK2
  ARM: dts: stm32: Fix TA3-GPIO-C key on STM32MP1 DHCOM PDK2
  dmaengine: xilinx_dma: Fix SG capability check for MCDMA
  dmaengine: xilinx_dma: Fix usage of xilinx_aximcdma_tx_segment
  dmaengine: xilinx_dma: use readl_poll_timeout_atomic variant
  HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices
  arm64: dts: renesas: r8a774e1: Add missing audio_clk_b
  s390: fix system call exit path
  tee: amdtee: synchronize access to shm list
  tee: amdtee: fix memory leak due to reset of global shm list
  video: hyperv_fb: include vmalloc.h
  xfrm/compat: Don't allocate memory with __GFP_ZERO
  xfrm/compat: memset(0) 64-bit padding at right place
  xfrm/compat: Translate by copying XFRMA_UNSPEC attribute
  Input: sunkbd - avoid use-after-free in teardown paths
  Linux 5.10-rc3
  net/sunrpc: fix useless comparison in proc_do_xprt()
  fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent
  vt: Disable KD_FONT_OP_COPY
  iio: light: fix kconfig dependency bug for VCNL4035
  iio/adc: ingenic: Fix AUX/VBAT readings when touchscreen is used
  iio/adc: ingenic: Fix battery VREF for JZ4770 SoC
  KVM: selftests: Introduce the dirty log perf test
  KVM: selftests: Make the number of vcpus global
  KVM: selftests: Make the per vcpu memory size global
  KVM: selftests: Drop pointless vm_create wrapper
  KVM: selftests: Add wrfract to common guest code
  KVM: selftests: Simplify demand_paging_test with timespec_diff_now
  KVM: selftests: Remove address rounding in guest code
  KVM: selftests: Factor code out of demand_paging_test
  KVM: selftests: Use a single binary for dirty/clear log test
  KVM: selftests: Always clear dirty bitmap after iteration
  KVM: selftests: Add blessed SVE registers to get-reg-list
  KVM: selftests: Add aarch64 get-reg-list test
  selftests: kvm: test enforcement of paravirtual cpuid features
  selftests: kvm: Add exception handling to selftests
  selftests: kvm: Clear uc so UCALL_NONE is being properly reported
  selftests: kvm: Fix the segment descriptor layout to match the actual layout
  drm: bridge: cdns: Kconfig: Switch over dependency to ARCH_K3
  KVM: x86: handle MSR_IA32_DEBUGCTLMSR with report_ignored_msrs
  kvm: x86: request masterclock update any time guest uses different msr
  kvm: x86: ensure pv_cpuid.features is initialized when enabling cap
  kvm: x86: reads of restricted pv msrs should also result in #GP
  KVM: x86: use positive error values for msr emulation that causes #GP
  KVM: Documentation: Update entry for KVM_CAP_ENFORCE_PV_CPUID
  KVM: Documentation: Update entry for KVM_X86_SET_MSR_FILTER
  KVM: x86/mmu: fix counting of rmap entries in pte_list_add
  powerpc/32s: Use relocation offset when setting early hash table
  arm64: dts: rockchip: Reorder LED triggers from mmc devices on rk3399-roc-pc.
  arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.
  futex: Handle transient "ownerless" rtmutex state correctly
  net: marvell: prestera: fix compilation with CONFIG_BRIDGE=m
  r8169: disable hw csum for short packets on all chip versions
  r8169: fix potential skb double free in an error path
  perf/core: Fix a memory leak in perf_event_parse_addr_filter()
  x86/platform/uv: Recognize UV5 hubless system identifier
  x86/platform/uv: Remove spaces from OEM IDs
  x86/platform/uv: Fix missing OEM_TABLE_ID
  ALSA: hda/realtek - Add supported for Lenovo ThinkPad Headset Button
  jbd2: fix up sparse warnings in checkpoint code
  ext4: fix sparse warnings in fast_commit code
  ext4: cleanup fast commit mount options
  jbd2: don't start fast commit on aborted journal
  ext4: make s_mount_flags modifications atomic
  ext4: issue fsdev cache flush before starting fast commit
  ext4: disable fast commit with data journalling
  ext4: fix inode dirty check in case of fast commits
  ext4: remove unnecessary fast commit calls from ext4_file_mmap
  ext4: mark buf dirty before submitting fast commit buffer
  ext4: fix code documentatioon
  ext4: dedpulicate the code to wait on inode that's being committed
  jbd2: don't read journal->j_commit_sequence without taking a lock
  jbd2: don't touch buffer state until it is filled
  jbd2: add todo for a fast commit performance optimization
  jbd2: don't pass tid to jbd2_fc_end_commit_fallback()
  jbd2: don't use state lock during commit path
  jbd2: drop jbd2_fc_init documentation
  ext4: clean up the JBD2 API that initializes fast commits
  jbd2: rename j_maxlen to j_total_len and add jbd2_journal_max_txn_bufs
  ext4: fixup ext4_fc_track_* functions' signature
  ext4: drop redundant calls ext4_fc_track_range
  ext4: mark fc ineligible if inode gets evictied due to mem pressure
  ext4: describe fast_commit feature flags
  ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
  ext4: silence an uninitialized variable warning
  MAINTAINERS: add missing file in ext4 entry
  ext4: correctly report "not supported" for {usr,grp}jquota when !CONFIG_QUOTA
  bpf: Update verification logic for LSM programs
  net/sunrpc: return 0 on attempt to write to "transports"
  ANDROID: fuse: Add support for d_canonical_path
  ANDROID: vfs: d_canonical_path for stacked FS
  seq_file: add seq_read_iter
  proc "seq files": switch to ->read_iter
  proc "single files": switch to ->read_iter
  proc/stat: switch to ->read_iter
  proc/cpuinfo: switch to ->read_iter
  proc: wire up generic_file_splice_read for iter ops
  fscrypt: remove reachable WARN in fscrypt_setup_iv_ino_lblk_32_key()
  ANDROID: GKI: build in a kernel command line of "rw"
  null_blk: Fix scheduling in atomic with zoned mode
  tty: fix crash in release_tty if tty->port is not set
  serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
  tty: serial: imx: enable earlycon by default if IMX_SERIAL_CONSOLE is enabled
  serial: 8250_mtk: Fix uart_get_baud_rate warning
  tpm: efi: Don't create binary_bios_measurements file for an empty log
  tpm_tis: Disable interrupts on ThinkPad T490s
  staging: rtl8723bs: Add 024c:0627 to the list of SDIO device-ids
  KVM: arm64: Remove AA64ZFR0_EL1 accessors
  KVM: arm64: Check RAZ visibility in ID register accessors
  KVM: arm64: Consolidate REG_HIDDEN_GUEST/USER
  KVM: arm64: Don't hide ID registers from userspace
  KVM: arm64: Fix build error in user_mem_abort()
  i2c: designware: slave should do WRITE_REQUESTED before WRITE_RECEIVED
  i2c: designware: call i2c_dw_read_clear_intrbits_slave() once
  i2c: mlxbf: I2C_MLXBF should depend on MELLANOX_PLATFORM
  i2c: mlxbf: Update author and maintainer email info
  i2c: mlxbf: Update reference clock frequency
  i2c: mlxbf: Remove unecessary wrapper functions
  i2c: mlxbf: Fix resrticted cast warning of sparse
  i2c: mlxbf: Add CONFIG_ACPI to guard ACPI function call
  i2c: sh_mobile: implement atomic transfers
  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
  thunderbolt: Add support for Intel Tiger Lake-H
  spi: bcm2835: remove use of uninitialized gpio flags variable
  USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property
  usb: mtu3: fix panic in mtu3_gadget_stop()
  staging: ralink-gdma: fix kconfig dependency bug for DMA_RALINK
  staging: mt7621-pci: avoid to request pci bus resources
  printk: remove unneeded dead-store assignment
  MAINTAINERS: update maintainers list for Cypress
  MAINTAINERS: update Yan-Hsuan's email address
  RISC-V: Fix the VDSO symbol generaton for binutils-2.35+
  RISC-V: Use non-PGD mappings for early DTB access
  riscv: uaccess: fix __put_kernel_nofault()
  riscv: fix pfn_to_virt err in do_page_fault().
  bpf: Zero-fill re-used per-cpu map element
  powerpc/numa: Fix build when CONFIG_NUMA=n
  bpf: BPF_PRELOAD depends on BPF_SYSCALL
  tools/bpftool: Fix attaching flow dissector
  riscv: Set text_offset correctly for M-Mode
  ANDROID: Incremental fs: Add zstd compression support
  drm/amd/display: Add missing pflip irq
  io_uring: fix link lookup racing with link timeout
  NFSD: fix missing refcount in nfsd4_copy by nfsd4_do_async_copy
  NFSD: Fix use-after-free warning when doing inter-server copy
  NFSD: MKNOD should return NFSERR_BADTYPE instead of NFSERR_INVAL
  SUNRPC: Fix general protection fault in trace_rpc_xdr_overflow()
  NFSD: NFSv3 PATHCONF Reply is improperly formed
  arm64: kexec_file: try more regions if loading segments fails
  ANDROID: arm: allow hooks into ipi
  ANDROID: arm64: allow hooks into ipi
  x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
  net/mlx5e: Fix incorrect access of RCU-protected xdp_prog
  net/mlx5e: Fix VXLAN synchronization after function reload
  net/mlx5: E-switch, Avoid extack error log for disabled vport
  net/mlx5: Fix deletion of duplicate rules
  net/mlx5e: Use spin_lock_bh for async_icosq_lock
  net/mlx5e: Protect encap route dev from concurrent release
  net/mlx5e: Fix modify header actions memory leak
  ANDROID: printk: printk_deferred for modules
  ANDROID: sched: Add trace hook for rt throttle dump
  ionic: check port ptr before use
  RISC-V: Remove any memblock representing unusable memory area
  ASoC: rt1015: add delay to fix pop noise from speaker
  selftests: binderfs: use SKIP instead of XFAIL
  selftests: clone3: use SKIP instead of XFAIL
  selftests: core: use SKIP instead of XFAIL in close_range_test.c
  selftests: proc: fix warning: _GNU_SOURCE redefined
  io_uring: use correct pointer for io_uring_show_cred()
  io_uring: don't forget to task-cancel drained reqs
  RDMA/srpt: Fix typo in srpt_unregister_mad_agent docstring
  gpiolib: fix sysfs when cdev is not selected
  pinctrl: aspeed: Fix GPI only function problem.
  media: cedrus: h264: Fix check for presence of scaling matrix
  media: media/platform/marvell-ccic: fix warnings when CONFIG_PM is not enabled
  media: mtk-vcodec: fix build breakage when one of VPU or SCP is enabled
  media: mtk-vcodec: move firmware implementations into their own files
  powerpc/8xx: Manage _PAGE_ACCESSED through APG bits in L1 entry
  powerpc/8xx: Always fault when _PAGE_ACCESSED is not set
  powerpc/40x: Always fault when _PAGE_ACCESSED is not set
  powerpc/603: Always fault when _PAGE_ACCESSED is not set
  btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
  btrfs: dev-replace: fail mount if we don't have replace item with target device
  btrfs: scrub: update message regarding read-only status
  btrfs: clean up NULL checks in qgroup_unreserve_range()
  btrfs: fix min reserved size calculation in merge_reloc_root
  btrfs: print the block rsv type when we fail our reservation
  btrfs: fix potential overflow in cluster_pages_for_defrag on 32bit arch
  thunderbolt: Only configure USB4 wake for lane 0 adapters
  thunderbolt: Add uaccess dependency to debugfs interface
  thunderbolt: Fix memory leak if ida_simple_get() fails in enumerate_services()
  pinctrl: mcp23s08: Print error message when regmap init fails
  pinctrl: mcp23s08: Use full chunk of memory for regmap configuration
  HID: mcp2221: Fix GPIO output handling
  HID: hid-sensor-hub: Fix issue with devices with no report ID
  ALSA: usb-audio: Add implicit feedback quirk for Qu-16
  scsi: ufs: Try to save power mode change and UIC cmd completion timeout
  scsi: ufs: Fix unbalanced scsi_block_reqs_cnt caused by ufshcd_hold()
  xfs: only flush the unshared range in xfs_reflink_unshare
  r8169: work around short packet hw bug on RTL8125
  clk: imx8m: fix bus critical clk registration
  drm/mediatek: mtk_dpi: Fix unused variable 'mtk_dpi_encoder_funcs'
  powerpc: Use asm_goto_volatile for put_user()
  risc-v: kernel: ftrace: Fixes improper SPDX comment style
  libbpf: Fix possible use after free in xsk_socket__delete
  libbpf: Fix null dereference in xsk_socket__delete
  USB: serial: option: add Telit FN980 composition 0x1055
  ceph: check session state after bumping session->s_seq
  PCI: mvebu: Fix duplicate resource requests
  PCI: dwc: Restore ATU memory resource setup to use last entry
  spi: fsl-dspi: fix wrong pointer in suspend/resume
  ASoC: mchp-spdiftx: Do not set Validity bit(s)
  io_uring: fix overflowed cancel w/ linked ->files
  io_uring: drop req/tctx io_identity separately
  io_uring: ensure consistent view of original task ->mm from SQPOLL
  io_uring: properly handle SQPOLL request cancelations
  io-wq: cancel request if it's asking for files and we don't have them
  entry: Fix the incorrect ordering of lockdep and RCU check
  xfs: fix scrub flagging rtinherit even if there is no rt device
  xfs: fix missing CoW blocks writeback conversion retry
  iomap: clean up writeback state logic on writepage error
  iomap: support partial page discard on writeback block mapping failure
  xfs: flush new eof page on truncate to avoid post-eof corruption
  kprobes: Tell lockdep about kprobe nesting
  pinctrl: rockchip: create irq mapping in gpio_to_irq
  pinctrl: rockchip: enable gpio pclk for rockchip_gpio_to_irq
  ALSA: usb-audio: Add implicit feedback quirk for MODX
  ALSA: usb-audio: add usb vendor id as DSD-capable for Khadas devices
  drm/amdgpu/display: remove DRM_AMD_DC_GREEN_SARDINE
  drm/amd/display: Add green_sardine support to DM
  drm/amd/display: Add green_sardine support to DC
  drm/amdgpu: enable vcn support for green_sardine (v2)
  drm/amdgpu: enable green_sardine_asd.bin loading (v2)
  drm/amdgpu/sdma: add sdma engine support for green_sardine (v2)
  drm/amdgpu: add gfx support for green_sardine (v2)
  drm/amdgpu: add soc15 common ip block support for green_sardine (v3)
  drm/amdgpu: add green_sardine support for gpu_info and ip block setting (v2)
  drm/amdgpu: add Green_Sardine APU flag
  x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S
  Documentation: remove mic/index from misc-devices/index.rst
  USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231
  USB: serial: cyberjack: fix write-URB completion race
  ARM, xtensa: highmem: avoid clobbering non-page aligned memory reservations
  habanalabs/gaudi: mask WDT error in QMAN
  habanalabs/gaudi: move coresight mmu config
  habanalabs: fix kernel pointer type
  hwmon: (pmbus) Add mutex locking for sysfs reads
  drm/amdgpu: resolved ASD loading issue on sienna
  amdkfd: Check kvmalloc return before memcpy
  drm/amdgpu: update golden setting for sienna_cichlid
  amd/amdgpu: Disable VCN DPG mode for Picasso
  drm/amdgpu/swsmu: remove duplicate call to smu_set_default_dpm_table
  erofs: fix setting up pcluster for temporary pages
  erofs: derive atime instead of leaving it empty
  net: openvswitch: silence suspicious RCU usage warning
  drm/i915: Hold onto an explicit ref to i915_vma_work.pinned
  drm/i915/gt: Flush xcs before tgl breadcrumbs
  drm/i915/gt: Expose more parameters for emitting writes into the ring
  drm/i915: Fix encoder lookup during PSR atomic check
  drm/i915/gt: Use the local HWSP offset during submission
  drm/i915/gem: Flush coherency domains on first set-domain-ioctl
  chelsio/chtls: fix always leaking ctrl_skb
  chelsio/chtls: fix memory leaks caused by a race
  can: flexcan: flexcan_remove(): disable wakeup completely
  can: flexcan: add ECC initialization for VF610
  can: flexcan: add ECC initialization for LX2160A
  can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A
  can: mcp251xfd: remove unneeded break
  can: mcp251xfd: mcp251xfd_regmap_nocrc_read(): fix semicolon.cocci warnings
  can: mcp251xfd: mcp251xfd_regmap_crc_read(): increase severity of CRC read error messages
  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: xilinx_can: handle failure cases of pm_runtime_get_sync
  can: ti_hecc: ti_hecc_probe(): add missed clk_disable_unprepare() in error path
  can: isotp: padlen(): make const array static, makes object smaller
  can: isotp: isotp_rcv_cf(): enable RX timeout handling in listen-only mode
  can: isotp: Explain PDU in CAN_ISOTP help text
  can: j1939: j1939_sk_bind(): return failure if netdev is down
  can: j1939: use backquotes for code samples
  can: j1939: swap addr and pgn in the send example
  can: j1939: fix syntax and spelling
  can: j1939: rename jacd tool
  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
  can: proc: can_remove_proc(): silence remove_proc_entry warning
  dt-bindings: can: flexcan: convert fsl,*flexcan bindings to yaml
  dt-bindings: can: add can-controller.yaml
  net: usb: qmi_wwan: add Telit LE910Cx 0x1230 composition
  i2c: mediatek: move dma reset before i2c reset
  mptcp: token: fix unititialized variable
  vfio/pci: Bypass IGD init in case of -ENODEV
  vfio: platform: fix reference leak in vfio_platform_open
  vfio/pci: Implement ioeventfd thread handler for contended memory lock
  vfio/fsl-mc: Make vfio_fsl_mc_irqs_allocate static
  vfio/fsl-mc: prevent underflow in vfio_fsl_mc_mmap()
  afs: Fix incorrect freeing of the ACL passed to the YFS ACL store op
  afs: Fix warning due to unadvanced marshalling pointer
  ALSA: hda/realtek - Enable headphone for ASUS TM420
  dt-bindings: irqchip: ti, sci-inta: Fix diagram indentation for unmapped events
  docs: fix automarkup regression on Python 2
  s390/pci: fix hot-plug of PCI function missing bus
  s390/smp: move rcu_cpu_starting() earlier
  s390/pkey: fix paes selftest failure with paes and pkey static build
  s390: update defconfigs
  s390/vdso: remove unused constants
  s390/vdso: remove empty unused file
  s390/mm: make pmd/pud_deref() large page aware
  s390/ap: fix ap devices reference counting
  arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line
  iommu: Fix a check in iommu_check_bind_data()
  gfs2: Wake up when sd_glock_disposal becomes zero
  iommu/vt-d: Fix a bug for PDP check in prq_event_thread
  iommu/vt-d: Fix sid not set issue in intel_svm_bind_gpasid()
  iommu/vt-d: Fix kernel NULL pointer dereference in find_domain()
  iommu/amd: Increase interrupt remapping table limit to 512 entries
  regulator: defer probe when trying to get voltage from unresolved supply
  ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
  tools feature: Fixup fast path feature detection
  perf tools: Add missing swap for cgroup events
  perf tools: Add missing swap for ino_generation
  perf tools: Initialize output buffer in build_id__sprintf
  perf hists browser: Increase size of 'buf' in perf_evsel__hists_browse()
  tools include UAPI: Update linux/mount.h copy
  tools headers UAPI: Update tools's copy of linux/perf_event.h
  tools kvm headers: Update KVM headers from the kernel sources
  tools UAPI: Update copy of linux/mman.h from the kernel sources
  tools arch x86: Sync the msr-index.h copy with the kernel sources
  tools x86 headers: Update required-features.h header from the kernel
  tools x86 headers: Update cpufeatures.h headers copies
  tools headers UAPI: Update fscrypt.h copy
  tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
  tools headers UAPI: Sync prctl.h with the kernel sources
  perf scripting python: Avoid declaring function pointers with a visibility attribute
  perf tools: Remove broken __no_tail_call attribute
  perf vendor events: Fix DRAM_BW_Use 0 issue for CLX/SKX
  perf trace: Fix segfault when trying to trace events by cgroup
  perf tools: Fix crash with non-jited bpf progs
  tools headers UAPI: Update process_madvise affected files
  perf tools: Update copy of libbpf's hashmap.c
  perf tools: Remove LTO compiler options when building perl support
  Fonts: Replace discarded const qualifier
  arm64: NUMA: Kconfig: Increase NODES_SHIFT to 4
  nvme-tcp: avoid repeated request completion
  nvme-rdma: avoid repeated request completion
  nvme-tcp: avoid race between time out and tear down
  nvme-rdma: avoid race between time out and tear down
  nvme: introduce nvme_sync_io_queues
  USB: Add NO_LPM quirk for Kingston flash drive
  mei: protect mei_cl_mtu from null dereference
  drm/vc4: drv: Remove unused variable
  drm/panfrost: Fix module unload
  init/Kconfig: Fix CPU number in LOG_CPU_MAX_BUF_SHIFT description
  drm/panfrost: Fix a deadlock between the shrinker and madvise path
  sfp: Fix error handing in sfp_probe()
  powerpc/vnic: Extend "failover pending" window
  RDMA/vmw_pvrdma: Fix the active_speed and phys_state value
  net: dsa: qca8k: Fix port MTU setting
  scsi: mpt3sas: Fix timeouts observed while reenabling IRQ
  scsi: scsi_dh_alua: Avoid crash during alua_bus_detach()
  sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms
  tty: make FONTX ioctl use the tty pointer they were actually passed
  libbpf, hashmap: Fix undefined behavior in hash_bits
  net: ethernet: ti: cpsw: disable PTPv1 hw timestamping advertisement
  vfio/fsl-mc: return -EFAULT if copy_to_user() fails
  vfio/type1: Use the new helper to find vfio_group
  tracing: Make -ENOMEM the default error for parse_synth_field()
  ring-buffer: Fix recursion protection transitions between interrupt context
  gfs2: Don't call cancel_delayed_work_sync from within delete work function
  kernel/hung_task.c: make type annotations consistent
  epoll: add a selftest for epoll timeout race
  mm: always have io_remap_pfn_range() set pgprot_decrypted()
  mm, oom: keep oom_adj under or at upper limit when printing
  kthread_worker: prevent queuing delayed work from timer_fn when it is being canceled
  mm/truncate.c: make __invalidate_mapping_pages() static
  lib/crc32test: remove extra local_irq_disable/enable
  ptrace: fix task_join_group_stop() for the case when current is traced
  mm: mempolicy: fix potential pte_unmap_unlock pte error
  kasan: adopt KUNIT tests to SW_TAGS mode
  mm: memcg: link page counters to root if use_hierarchy is false
  mm: memcontrol: correct the NR_ANON_THPS counter of hierarchical memcg
  hugetlb_cgroup: fix reservation accounting
  mm/mremap_pages: fix static key devmap_managed_key updates
  ARC: [plat-hsdk] Remap CCMs super early in asm boot trampoline
  ARC: stack unwinding: avoid indefinite looping
  IB/srpt: Fix memory leak in srpt_add_one
  dpaa_eth: fix the RX headroom size alignment
  dpaa_eth: update the buffer layout for non-A050385 erratum scenarios
  RDMA: Fix software RDMA drivers for dma mapping error
  iwlwifi: pcie: limit memory read spin time
  rtw88: fix fw_fifo_addr check
  Revert "nvme-pci: remove last_sq_tail"
  arm64: dts: agilex/stratix10: Fix qspi node compatible
  of: Drop superfluous ULL suffix for ~0
  PM: runtime: Resume the device earlier in __device_release_driver()
  PM: runtime: Drop pm_runtime_clean_up_links()
  PM: runtime: Drop runtime PM references to supplier on link removal
  ARM: dts: sun8i: v40: bananapi-m2-berry: Fix ethernet node
  ARM: dts: sun8i: r40: bananapi-m2-berry: Fix dcdc1 regulator
  ARM: dts: sun7i: bananapi: Enable RGMII RX/TX delay on Ethernet PHY
  powercap/intel_rapl: remove unneeded semicolon
  Documentation: PM: cpuidle: correct path name
  Documentation: PM: cpuidle: correct typo
  cpufreq: schedutil: Don't skip freq update if need_freq_update is set
  tracing: Fix the checking of stackidx in __ftrace_trace_stack
  nfsroot: Default mount option should ask for built-in NFS version
  swiotlb: remove the tbl_dma_addr argument to swiotlb_tbl_map_single
  swiotlb: fix "x86: Don't panic if can not alloc buffer for swiotlb"
  ftrace: Handle tracing when switching between context
  ftrace: Fix recursion check for NMI test
  tracing: Fix out of bounds write in get_trace_buf
  scripts: get_api.pl: Add sub-titles to ABI output
  scripts: get_abi.pl: Don't let ABI files to create subtitles
  docs: leds: index.rst: add a missing file
  docs: ABI: sysfs-class-net: fix a typo
  docs: ABI: sysfs-driver-dma-ioatdma: what starts with /sys
  drm/vc4: kms: Add functions to create the state objects
  drm/vc4: Use devm_drm_dev_alloc
  drm/vc4: Use the helper to retrieve vc4_dev when needed
  drm/vc4: gem: Add a managed action to cleanup the job queue
  drm/vc4: drv: Use managed drm_mode_config_init
  drm/vc4: bo: Add a managed action to cleanup the cache
  swiotlb: using SIZE_MAX needs limits.h included
  ARM: dts: s3: pinecube: align compatible property to other S3 boards
  ARM: sunxi: Add machine match for the Allwinner V3 SoC
  arm64: dts: allwinner: h6: orangepi-one-plus: Fix ethernet
  builddeb: Fix rootless build in setuid/setgid directory
  kbuild: remove unused OBJSIZE
  powerpc/smp: Call rcu_cpu_starting() earlier
  powerpc/eeh_cache: Fix a possible debugfs deadlock
  ARM: dts: imx6q-prti6q: fix PHY address
  ARM: dts: vf610-zii-dev-rev-b: Fix MDIO over clocking
  arm: dts: imx6qdl-udoo: fix rgmii phy-mode for ksz9031 phy
  iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout
  counter/ti-eqep: Fix regmap max_register
  iio: adc: stm32-adc: fix a regression when using dma and irq
  iio: adc: mediatek: fix unset field
  iio: cros_ec: Use default frequencies when EC returns invalid information
  arm64: dts: rockchip: Remove system-power-controller from pmic on Odroid Go Advance
  arm64: dts: rockchip: fix NanoPi R2S GMAC clock name
  irqchip/ti-sci-inta: Add support for unmapped event handling
  dt-bindings: irqchip: ti, sci-inta: Update for unmapped event handling
  irqchip/renesas-intc-irqpin: Merge irlm_bit and needs_irlm
  irqchip/sifive-plic: Fix chip_data access within a hierarchy
  ip_tunnel: fix over-mtu packet send fail without TUNNEL_DONT_FRAGMENT flags
  cadence: force nonlinear buffers to be cloned
  IPv6: reply ICMP error if the first fragment don't include all headers
  ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition
  net: atm: fix update of position index in lec_seq_next
  netfilter: ipset: Update byte and packet counters regardless of whether they match
  percpu: convert flexible array initializers to use struct_size()
  PCI: Always enable ACS even if no ACS Capability
  mtd: rawnand: stm32_fmc2: fix broken ECC
  net: stmmac: Fix channel lock initialization
  stmmac: intel: Fix kernel panic on pci probe
  gianfar: Account for Tx PTP timestamp in the skb headroom
  gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP
  net: fec: fix MDIO probing for some FEC hardware blocks
  ip6_tunnel: set inner ipproto before ip6_tnl_encap
  netfilter: nf_tables: missing validation from the abort path
  netfilter: use actual socket sk rather than skb sk when routing harder
  wireguard: selftests: check that route_me_harder packets use the right sk
  netfilter: nftables: fix netlink report logic in flowtable and genid
  mac80211: don't require VHT elements for HE on 2.4 GHz
  cfg80211: regulatory: Fix inconsistent format argument
  mac80211: fix kernel-doc markups
  mac80211: always wind down STA state
  cfg80211: initialize wdev data earlier
  mac80211: fix use of skb payload instead of header
  mac80211: fix regression where EAPOL frames were sent in plaintext
  arm64: dts imx8mn: Remove non-existent USB OTG2
  arm64: dts: imx8mm-beacon-som: Fix Choppy BT audio
  arm64: dts: fsl: DPAA FMan DMA operations are coherent
  drm/amdgpu/powerplay: Only apply optimized mclk dpm policy on polaris
  MAINTAINERS: Update AMD POWERPLAY pattern
  drm/amd/pm: do not use ixFEATURE_STATUS for checking smc running
  drm/amd/pm: perform SMC reset on suspend/hibernation
  drm/amd/pm: enable baco reset for Hawaii
  drm/amd/pm: correct the baco reset sequence for CI ASICs
  drm/amdgpu: perform srbm soft reset always on SDMA resume
  drm/amdgpu: rename nv_is_headless_sku()
  drm/amdgpu: disable DCN and VCN for Navi14 0x7340/C9 SKU
  drm/i915/gvt: Fix mmio handler break on BXT/APL.
  drm/i915/gvt: Only pin/unpin intel_context along with workload
  bpf: Don't rely on GCC __attribute__((optimize)) to disable GCSE
  scsi: hpsa: Fix memory leak in hpsa_init_one()
  arm64: dts: fsl: fix endianness issue of rcpm
  arm64: dts: imx8mn-evk: fix missing PMIC's interrupt line pull-up
  arm64: dts: imx8mn-ddr4-evk: fix missing PMIC's interrupt line pull-up
  arm64: dts: imx8mn-var-som: fix missing PMIC's interrupt line pull-up
  arm64: dts: imx8mm-evk: fix missing PMIC's interrupt line pull-up
  arm64: dts: imx8mm-beacon-som: fix missing PMIC's interrupt line pull-up
  arm64: dts: imx8mm-var-som: fix missing PMIC's interrupt line pull-up
  gfs2: check for live vs. read-only file system in gfs2_fitrim
  gfs2: don't initialize statfs_change inodes in spectator mode
  gfs2: Split up gfs2_meta_sync into inode and rgrp versions
  gfs2: init_journal's undo directive should also undo the statfs inodes
  gfs2: Add missing truncate_inode_pages_final for sd_aspace
  gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
  x86/sev-es: Do not support MMIO to/from encrypted memory
  x86/head/64: Check SEV encryption before switching to kernel page-table
  x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path
  xfs: set xefi_discard when creating a deferred agfl free log intent item
  tools, bpftool: Remove two unused variables.
  tools, bpftool: Avoid array index warnings.
  xsk: Fix possible memory leak at socket close
  bpf: Add struct bpf_redir_neigh forward declaration to BPF helper defs
  x86/boot/compressed/64: Sanity-check CPUID results in the early #VC handler
  spi: bcm2835: fix gpio cs level inversion
  ASoC: qcom: lpass-cpu: Fix clock disable failure
  ASoC: qcom: lpass-sc7180: Fix MI2S bitwidth field bit positions
  HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown
  x86/boot/compressed/64: Introduce sev_status
  arm64: dts: allwinner: h5: OrangePi Prime: Fix ethernet node
  clk: define to_clk_regmap() as inline function
  CREDITS: remove trailing white spaces
  MAINTAINERS: remove Jeongtae Park from Samsung MFC entry
  MAINTAINERS: move Kyungmin Park to credits
  MAINTAINERS: move Kamil Debski to credits
  don't dump the threads that had been already exiting when zapped.
  docs: SafeSetID: fix a warning
  amdgpu: fix a few kernel-doc markup issues
  selftests: kselftest_harness.h: fix kernel-doc markups
  drm: amdgpu_dm: fix a typo
  gpu: docs: amdgpu.rst: get rid of wrong kernel-doc markups
  drm: amdgpu: kernel-doc: update some adev parameters
  docs: fs: api-summary.rst: get rid of kernel-doc include
  IB/srpt: docs: add a description for cq_size member
  locking/refcount: move kernel-doc markups to the proper place
  docs: lockdep-design: fix some warning issues
  MAINTAINERS: fix broken doc refs due to yaml conversion
  ice: docs fix a devlink info that broke a table
  crypto: sun8x-ce*: update entries to its documentation
  net: phy: remove kernel-doc duplication
  mm: pagemap.h: fix two kernel-doc markups
  blk-mq: docs: add kernel-doc description for a new struct member
  docs: userspace-api: add iommu.rst to the index file
  docs: hwmon: mp2975.rst: address some html build warnings
  docs: net: statistics.rst: remove a duplicated kernel-doc
  docs: kasan.rst: add two missing blank lines
  docs: admin-guide: net.rst: add a missing blank line
  docs: hwmon: adm1266.rst: fix a broken reference
  sphinx: conf.py: properly handle Sphinx 4.0
  scripts: kernel-doc: use :c:union when needed
  documentation: arm: sunxi: add Allwinner H6 documents
  scripts: kernel-doc: split typedef complex regex
  scripts: kernel-doc: fix typedef parsing
  mtd: spi-nor: Fix address width on flash chips > 16MB
  docs: Makefile: honor V=0 for docs building
  mtd: spi-nor: Don't copy self-pointing struct around
  ASoC: codecs: wcd9335: Set digital gain range correctly
  phy: cpcap-usb: Use IRQF_ONESHOT
  phy: qcom-qmp: Initialize another pointer to NULL
  phy: tegra: xusb: Fix dangling pointer on probe failure
  phy: usb: Fix incorrect clearing of tca_drv_sel bit in SETUP reg for 7211
  ASoC: codecs: wcd934x: Set digital gain range correctly
  pinctrl: ingenic: Fix invalid SSI pins
  Revert "Revert "gpio: omap: Fix lost edge wake-up interrupts""
  gpio: uapi: clarify the meaning of 'empty' char arrays
  gpio: uapi: remove whitespace
  gpio: uapi: kernel-doc formatting improvements
  gpio: uapi: comment consistency
  gpio: uapi: fix kernel-doc warnings
  ALSA: hda: Reinstate runtime_allow() for all hda controllers
  ALSA: hda: Separate runtime and system suspend
  ALSA: hda: Refactor codec PM to use direct-complete optimization
  ALSA: hda/realtek - Fixed HP headset Mic can't be detected
  USB: serial: option: add Quectel EC200T module support
  dmaengine: ti: k3-udma: fix -Wenum-conversion warning
  dmaengine: idxd: fix wq config registers offset programming
  selftests: pidfd: drop needless linux/kcmp.h inclusion in pidfd_setns_test.c
  selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
  selftests: pidfd: skip test on kcmp() ENOSYS
  selftests: pidfd: use ksft_test_result_skip() when skipping test
  selftests/harness: prettify SKIP message whitespace again
  selftests: pidfd: fix compilation errors due to wait.h
  selftests: filter kselftest headers from command in lib.mk
  selftests/ftrace: check for do_sys_openat2 in user-memory test
  selftests/ftrace: Use $FUNCTION_FORK to reference kernel fork function
  samples/bpf: Set rlimit for memlock to infinity in all samples
  bpf: Fix -Wshadow warnings
  ARM: 9019/1: kprobes: Avoid fortify_panic() when copying optprobe template
  MIPS: export has_transparent_hugepage() for modules
  usb: raw-gadget: fix memory leak in gadget_setup
  usb: dwc2: Avoid leaving the error_debugfs label unused
  usb: dwc3: ep0: Fix delay status handling
  drm/imx: tve remove extraneous type qualifier
  drm/imx: parallel-display: reduce scope of edid_len
  drm/imx: parallel-display: remove unused function enc_to_imxpd()
  drm/imx: parallel-display: fix edid memory leak
  drm/imx: imx-ldb: reduce scope of edid_len
  usb: gadget: fsl: fix null pointer checking
  usb: gadget: goku_udc: fix potential crashes in probe
  opp: Reduce the size of critical section in _opp_table_kref_release()
  ARM: OMAP2+: Manage MPU state properly for omap_enter_idle_coupled()
  ALSA: usb-audio: Add implicit feedback quirk for Zoom UAC-2
  usb: dwc3: pci: add support for the Intel Alder Lake-S
  opp: Fix early exit from dev_pm_opp_register_set_opp_helper()
  opp: Don't always remove static OPPs in _of_add_opp_table_v1()
  Input: i8042 - allow insmod to succeed on devices without an i8042 controller
  Input: adxl34x - clean up a data type in adxl34x_probe()
  asm-generic: percpu: avoid Wshadow warning
  ALSA: make snd_kcontrol_new name a normal string
  kunit: tools: fix kunit_tool tests for parsing test plans
  Documentation: kunit: Update Kconfig parts for KUNIT's module support
  kunit: test: fix remaining kernel-doc warnings
  kunit: Don't fail test suites if one of them is empty
  kunit: Fix kunit.py --raw_output option
  mtd: rawnand: ifc: Move the ECC engine initialization to the right place
  mtd: rawnand: mxc: Move the ECC engine initialization to the right place
  x86/hyperv: Clarify comment on x2apic mode
  selftest/bpf: Fix profiler test using CO-RE relocation for enums
  thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
  hwmon: (pmbus/max20730) use scnprintf() instead of snprintf()
  gpio: aspeed: fix ast2600 bank properties
  gpio: dwapb: Fix missing conversion to GPIO-lib-based IRQ-chip
  ALSA: fix kernel-doc markups
  pinctrl: intel: Set default bias in case no particular value given
  pinctrl: intel: Fix 2 kOhm bias which is 833 Ohm
  arm64: dts: allwinner: a64: bananapi-m64: Enable RGMII RX/TX delay on PHY
  arm64: dts: allwinner: h5: libretech-all-h5-cc: Enable RGMII RX/TX delay on PHY
  ARM: dts: sunxi: bananapi-m2-plus: Enable RGMII RX/TX delay on Ethernet PHY
  ARM: dts: sun9i: Enable both RGMII RX/TX delay on Ethernet 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
  ARM: dts: sun7i: bananapi-m1-plus: Enable RGMII RX/TX delay on Ethernet PHY
  ARM: dts: sun7i: cubietruck: Enable RGMII RX/TX delay on Ethernet PHY
  ARM: dts: sun6i: a31-hummingbird: 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
  arm64: dts: allwinner: a64: OrangePi Win: Fix ethernet node
  arm64: dts: allwinner: Pine H64: Enable both RGMII RX/TX delay
  arm64: dts: allwinner: beelink-gs1: Enable both RGMII RX/TX delay
  arm64: dts: allwinner: pinetab: Drop unnecessary address/size-cells information
  MAINTAINERS: Add Jernej Škrabec as a reviewer for Allwinner SoCs support
  drm/imx: dw_hdmi-imx: remove empty encoder_disable callback
  drm/imx: drop explicit drm_mode_config_cleanup
  drm/imx: imx-tve: remove redundant enable tracking
  drm/imx: imx-tve: use regmap fast_io spinlock
  drm/imx: dw_hdmi-imx: use imx_drm_encoder_parse_of
  gpu: ipu-v3: remove unused functions
  bus: ti-sysc: Fix bogus resetdone warning on enable for cpsw
  bus: ti-sysc: Fix reset status check for modules with quirks
  ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF
  ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS
  efivarfs: fix memory leak in efivarfs_create()
  efi/arm: set HSCTLR Thumb2 bit correctly for HVC calls from HYP
  irqchip/sifive-plic: Fix broken irq_set_affinity() callback
  irqchip/stm32-exti: Add all LP timer exti direct events support
  irqchip/bcm2836: Fix missing __init annotation
  tools/power turbostat: harden against cpu hotplug
  tools/power turbostat: adjust for temperature offset
  HID: add support for Sega Saturn
  spi: imx: fix runtime pm support for !CONFIG_PM
  ASoC: SOF: loader: handle all SOF_IPC_EXT types
  ASoC: cs42l51: manage mclk shutdown delay
  ASoC: qcom: sdm845: set driver name correctly
  ASoC: codecs: wsa881x: add missing stream rates and format
  HID: cypress: Support Varmilo Keyboards' media hotkeys
  net: xfrm: fix a race condition during allocing spi
  HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses
  HID: logitech-hidpp: Add PID for MX Anywhere 2
  HID: uclogic: Add ID for Trust Flex Design Tablet
  MAINTAINERS: Add entry for Qualcomm IPQ4019 VQMMC regulator
  ASoC: mediatek: mt8183-da7219: fix DAPM paths for rt1015
  hv_balloon: disable warning when floor reached
  drm/i915/gvt: Set SNOOP for PAT3 on BXT/APL to workaround GPU BB hang
  drm/i915/gvt: Allow zero out HWSP addr on hws_pga_write
  irqchip/mips: Drop selection of IRQ_DOMAIN_HIERARCHY
  irqchip/mst: Make mst_intc_of_init static
  irqchip/mst: MST_IRQ should depend on ARCH_MEDIATEK or ARCH_MSTARV7
  genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY
  ASoC: Intel: catpt: Relax clock selection conditions
  ASoC: Intel: catpt: Wake up device before configuring SSP port
  ASoC: Intel: atom: Remove duplicate kconfigs
  ASoC: Intel: kbl_rt5663_max98927: Fix kabylake_ssp_fixup function
  xfrm: interface: fix the priorities for ipip and ipv6 tunnels
  tools/power turbostat: Build with _FILE_OFFSET_BITS=64
  tools/power turbostat: Support AMD Family 19h
  tools/power turbostat: Remove empty columns for Jacobsville
  tools/power turbostat: Add a new GFXAMHz column that exposes gt_act_freq_mhz.
  tools/power x86_energy_perf_policy: Input/output error in a VM
  tools/power turbostat: Skip pc8, pc9, pc10 columns, if they are disabled
  tools/power turbostat: Support additional CPU model numbers
  tools/power turbostat: Fix output formatting for ACPI CST enumeration
  tools/power turbostat: Replace HTTP links with HTTPS ones: TURBOSTAT UTILITY
  tools/power turbostat: Use sched_getcpu() instead of hardcoded cpu 0
  tools/power turbostat: Enable accumulate RAPL display
  tools/power turbostat: Introduce functions to accumulate RAPL consumption
  tools/power turbostat: Make the energy variable to be 64 bit
  tools/power turbostat: Always print idle in the system configuration header
  tools/power turbostat: Print /dev/cpu_dma_latency

Conflicts:
	Documentation/devicetree/bindings
	Documentation/devicetree/bindings/clock/hi6220-clock.txt
	Documentation/devicetree/bindings/clock/imx5-clock.yaml
	Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml
	Documentation/devicetree/bindings/interrupt-controller/ti,sci-inta.yaml
	Documentation/devicetree/bindings/iommu/arm,smmu.yaml
	Documentation/devicetree/bindings/net/can/tcan4x5x.txt
	Documentation/devicetree/bindings/net/nfc/nxp-nci.txt
	Documentation/devicetree/bindings/net/nfc/pn544.txt
	Documentation/devicetree/bindings/sound/rt1015.txt
	arch/arm/include/uapi/asm/setup.h
	drivers/android/binder.c
	drivers/cpufreq/cpufreq.c
	drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
	drivers/iommu/arm/arm-smmu/arm-smmu.h
	drivers/usb/typec/ucsi/ucsi.c
	drivers/usb/typec/ucsi/ucsi.h
	include/linux/gfp.h
	include/linux/highmem.h
	include/linux/interrupt.h
	include/linux/sched/wake_q.h
	include/trace/events/irq.h
	kernel/cgroup/cpuset.c
	kernel/sched/core.c
	kernel/sched/cpufreq_schedutil.c
	kernel/sched/cpupri.c
	kernel/sched/cputime.c
	kernel/sched/fair.c
	kernel/sched/rt.c
	kernel/sched/sched.h
	kernel/softirq.c
	kernel/trace/trace_preemptirq.c

Change-Id: If4c21439e002e776ced1a454b2ddfd42f670e99d
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2020-12-17 12:15:41 -08:00

2907 lines
75 KiB
C

// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/drivers/cpufreq/cpufreq.c
*
* Copyright (C) 2001 Russell King
* (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
* (C) 2013 Viresh Kumar <viresh.kumar@linaro.org>
*
* Oct 2005 - Ashok Raj <ashok.raj@intel.com>
* Added handling for CPU hotplug
* Feb 2006 - Jacob Shin <jacob.shin@amd.com>
* Fix handling for CPU hotplug -- affected CPUs
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/cpu.h>
#include <linux/cpufreq.h>
#include <linux/cpufreq_times.h>
#include <linux/cpu_cooling.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/kernel_stat.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/pm_qos.h>
#include <linux/slab.h>
#include <linux/suspend.h>
#include <linux/syscore_ops.h>
#include <linux/tick.h>
#ifdef CONFIG_SCHED_WALT
#include <linux/sched/sysctl.h>
#endif
#include <trace/events/power.h>
#include <trace/hooks/cpufreq.h>
static LIST_HEAD(cpufreq_policy_list);
/* Macros to iterate over CPU policies */
#define for_each_suitable_policy(__policy, __active) \
list_for_each_entry(__policy, &cpufreq_policy_list, policy_list) \
if ((__active) == !policy_is_inactive(__policy))
#define for_each_active_policy(__policy) \
for_each_suitable_policy(__policy, true)
#define for_each_inactive_policy(__policy) \
for_each_suitable_policy(__policy, false)
#define for_each_policy(__policy) \
list_for_each_entry(__policy, &cpufreq_policy_list, policy_list)
/* Iterate over governors */
static LIST_HEAD(cpufreq_governor_list);
#define for_each_governor(__governor) \
list_for_each_entry(__governor, &cpufreq_governor_list, governor_list)
static char default_governor[CPUFREQ_NAME_LEN];
/*
* The "cpufreq driver" - the arch- or hardware-dependent low
* level driver of CPUFreq support, and its spinlock. This lock
* also protects the cpufreq_cpu_data array.
*/
static struct cpufreq_driver *cpufreq_driver;
static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data);
static DEFINE_RWLOCK(cpufreq_driver_lock);
static DEFINE_STATIC_KEY_FALSE(cpufreq_freq_invariance);
bool cpufreq_supports_freq_invariance(void)
{
return static_branch_likely(&cpufreq_freq_invariance);
}
/* Flag to suspend/resume CPUFreq governors */
static bool cpufreq_suspended;
static inline bool has_target(void)
{
return cpufreq_driver->target_index || cpufreq_driver->target;
}
/* internal prototypes */
static unsigned int __cpufreq_get(struct cpufreq_policy *policy);
static int cpufreq_init_governor(struct cpufreq_policy *policy);
static void cpufreq_exit_governor(struct cpufreq_policy *policy);
static void cpufreq_governor_limits(struct cpufreq_policy *policy);
static int cpufreq_set_policy(struct cpufreq_policy *policy,
struct cpufreq_governor *new_gov,
unsigned int new_pol);
/*
* Two notifier lists: the "policy" list is involved in the
* validation process for a new CPU frequency policy; the
* "transition" list for kernel code that needs to handle
* changes to devices when the CPU clock speed changes.
* The mutex locks both lists.
*/
static BLOCKING_NOTIFIER_HEAD(cpufreq_policy_notifier_list);
SRCU_NOTIFIER_HEAD_STATIC(cpufreq_transition_notifier_list);
static int off __read_mostly;
static int cpufreq_disabled(void)
{
return off;
}
void disable_cpufreq(void)
{
off = 1;
}
static DEFINE_MUTEX(cpufreq_governor_mutex);
bool have_governor_per_policy(void)
{
return !!(cpufreq_driver->flags & CPUFREQ_HAVE_GOVERNOR_PER_POLICY);
}
EXPORT_SYMBOL_GPL(have_governor_per_policy);
static struct kobject *cpufreq_global_kobject;
struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy)
{
if (have_governor_per_policy())
return &policy->kobj;
else
return cpufreq_global_kobject;
}
EXPORT_SYMBOL_GPL(get_governor_parent_kobj);
static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
{
struct kernel_cpustat kcpustat;
u64 cur_wall_time;
u64 idle_time;
u64 busy_time;
cur_wall_time = jiffies64_to_nsecs(get_jiffies_64());
kcpustat_cpu_fetch(&kcpustat, cpu);
busy_time = kcpustat.cpustat[CPUTIME_USER];
busy_time += kcpustat.cpustat[CPUTIME_SYSTEM];
busy_time += kcpustat.cpustat[CPUTIME_IRQ];
busy_time += kcpustat.cpustat[CPUTIME_SOFTIRQ];
busy_time += kcpustat.cpustat[CPUTIME_STEAL];
busy_time += kcpustat.cpustat[CPUTIME_NICE];
idle_time = cur_wall_time - busy_time;
if (wall)
*wall = div_u64(cur_wall_time, NSEC_PER_USEC);
return div_u64(idle_time, NSEC_PER_USEC);
}
u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)
{
u64 idle_time = get_cpu_idle_time_us(cpu, io_busy ? wall : NULL);
if (idle_time == -1ULL)
return get_cpu_idle_time_jiffy(cpu, wall);
else if (!io_busy)
idle_time += get_cpu_iowait_time_us(cpu, wall);
return idle_time;
}
EXPORT_SYMBOL_GPL(get_cpu_idle_time);
/*
* This is a generic cpufreq init() routine which can be used by cpufreq
* drivers of SMP systems. It will do following:
* - validate & show freq table passed
* - set policies transition latency
* - policy->cpus with all possible CPUs
*/
void cpufreq_generic_init(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
unsigned int transition_latency)
{
policy->freq_table = table;
policy->cpuinfo.transition_latency = transition_latency;
/*
* The driver only supports the SMP configuration where all processors
* share the clock and voltage and clock.
*/
cpumask_setall(policy->cpus);
}
EXPORT_SYMBOL_GPL(cpufreq_generic_init);
struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
{
struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
return policy && cpumask_test_cpu(cpu, policy->cpus) ? policy : NULL;
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_get_raw);
unsigned int cpufreq_generic_get(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
if (!policy || IS_ERR(policy->clk)) {
pr_err("%s: No %s associated to cpu: %d\n",
__func__, policy ? "clk" : "policy", cpu);
return 0;
}
return clk_get_rate(policy->clk) / 1000;
}
EXPORT_SYMBOL_GPL(cpufreq_generic_get);
/**
* cpufreq_cpu_get - Return policy for a CPU and mark it as busy.
* @cpu: CPU to find the policy for.
*
* Call cpufreq_cpu_get_raw() to obtain a cpufreq policy for @cpu and increment
* the kobject reference counter of that policy. Return a valid policy on
* success or NULL on failure.
*
* The policy returned by this function has to be released with the help of
* cpufreq_cpu_put() to balance its kobject reference counter properly.
*/
struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
{
struct cpufreq_policy *policy = NULL;
unsigned long flags;
if (WARN_ON(cpu >= nr_cpu_ids))
return NULL;
/* get the cpufreq driver */
read_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver) {
/* get the CPU */
policy = cpufreq_cpu_get_raw(cpu);
if (policy)
kobject_get(&policy->kobj);
}
read_unlock_irqrestore(&cpufreq_driver_lock, flags);
return policy;
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
/**
* cpufreq_cpu_put - Decrement kobject usage counter for cpufreq policy.
* @policy: cpufreq policy returned by cpufreq_cpu_get().
*/
void cpufreq_cpu_put(struct cpufreq_policy *policy)
{
kobject_put(&policy->kobj);
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
/**
* cpufreq_cpu_release - Unlock a policy and decrement its usage counter.
* @policy: cpufreq policy returned by cpufreq_cpu_acquire().
*/
void cpufreq_cpu_release(struct cpufreq_policy *policy)
{
if (WARN_ON(!policy))
return;
lockdep_assert_held(&policy->rwsem);
up_write(&policy->rwsem);
cpufreq_cpu_put(policy);
}
/**
* cpufreq_cpu_acquire - Find policy for a CPU, mark it as busy and lock it.
* @cpu: CPU to find the policy for.
*
* Call cpufreq_cpu_get() to get a reference on the cpufreq policy for @cpu and
* if the policy returned by it is not NULL, acquire its rwsem for writing.
* Return the policy if it is active or release it and return NULL otherwise.
*
* The policy returned by this function has to be released with the help of
* cpufreq_cpu_release() in order to release its rwsem and balance its usage
* counter properly.
*/
struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
if (!policy)
return NULL;
down_write(&policy->rwsem);
if (policy_is_inactive(policy)) {
cpufreq_cpu_release(policy);
return NULL;
}
return policy;
}
/*********************************************************************
* EXTERNALLY AFFECTING FREQUENCY CHANGES *
*********************************************************************/
/*
* adjust_jiffies - adjust the system "loops_per_jiffy"
*
* This function alters the system "loops_per_jiffy" for the clock
* speed change. Note that loops_per_jiffy cannot be updated on SMP
* systems as each CPU might be scaled differently. So, use the arch
* per-CPU loops_per_jiffy value wherever possible.
*/
static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
{
#ifndef CONFIG_SMP
static unsigned long l_p_j_ref;
static unsigned int l_p_j_ref_freq;
if (ci->flags & CPUFREQ_CONST_LOOPS)
return;
if (!l_p_j_ref_freq) {
l_p_j_ref = loops_per_jiffy;
l_p_j_ref_freq = ci->old;
pr_debug("saving %lu as reference value for loops_per_jiffy; freq is %u kHz\n",
l_p_j_ref, l_p_j_ref_freq);
}
if (val == CPUFREQ_POSTCHANGE && ci->old != ci->new) {
loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq,
ci->new);
pr_debug("scaling loops_per_jiffy to %lu for frequency %u kHz\n",
loops_per_jiffy, ci->new);
}
#endif
}
/**
* cpufreq_notify_transition - Notify frequency transition and adjust_jiffies.
* @policy: cpufreq policy to enable fast frequency switching for.
* @freqs: contain details of the frequency update.
* @state: set to CPUFREQ_PRECHANGE or CPUFREQ_POSTCHANGE.
*
* This function calls the transition notifiers and the "adjust_jiffies"
* function. It is called twice on all CPU frequency changes that have
* external effects.
*/
static void cpufreq_notify_transition(struct cpufreq_policy *policy,
struct cpufreq_freqs *freqs,
unsigned int state)
{
int cpu;
BUG_ON(irqs_disabled());
if (cpufreq_disabled())
return;
freqs->policy = policy;
freqs->flags = cpufreq_driver->flags;
pr_debug("notification %u of frequency transition to %u kHz\n",
state, freqs->new);
switch (state) {
case CPUFREQ_PRECHANGE:
/*
* Detect if the driver reported a value as "old frequency"
* which is not equal to what the cpufreq core thinks is
* "old frequency".
*/
if (policy->cur && policy->cur != freqs->old) {
pr_debug("Warning: CPU frequency is %u, cpufreq assumed %u kHz\n",
freqs->old, policy->cur);
freqs->old = policy->cur;
}
srcu_notifier_call_chain(&cpufreq_transition_notifier_list,
CPUFREQ_PRECHANGE, freqs);
adjust_jiffies(CPUFREQ_PRECHANGE, freqs);
break;
case CPUFREQ_POSTCHANGE:
adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
pr_debug("FREQ: %u - CPUs: %*pbl\n", freqs->new,
cpumask_pr_args(policy->cpus));
for_each_cpu(cpu, policy->cpus)
trace_cpu_frequency(freqs->new, cpu);
srcu_notifier_call_chain(&cpufreq_transition_notifier_list,
CPUFREQ_POSTCHANGE, freqs);
cpufreq_stats_record_transition(policy, freqs->new);
cpufreq_times_record_transition(policy, freqs->new);
policy->cur = freqs->new;
}
}
/* Do post notifications when there are chances that transition has failed */
static void cpufreq_notify_post_transition(struct cpufreq_policy *policy,
struct cpufreq_freqs *freqs, int transition_failed)
{
cpufreq_notify_transition(policy, freqs, CPUFREQ_POSTCHANGE);
if (!transition_failed)
return;
swap(freqs->old, freqs->new);
cpufreq_notify_transition(policy, freqs, CPUFREQ_PRECHANGE);
cpufreq_notify_transition(policy, freqs, CPUFREQ_POSTCHANGE);
}
void cpufreq_freq_transition_begin(struct cpufreq_policy *policy,
struct cpufreq_freqs *freqs)
{
/*
* Catch double invocations of _begin() which lead to self-deadlock.
* ASYNC_NOTIFICATION drivers are left out because the cpufreq core
* doesn't invoke _begin() on their behalf, and hence the chances of
* double invocations are very low. Moreover, there are scenarios
* where these checks can emit false-positive warnings in these
* drivers; so we avoid that by skipping them altogether.
*/
WARN_ON(!(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATION)
&& current == policy->transition_task);
wait:
wait_event(policy->transition_wait, !policy->transition_ongoing);
spin_lock(&policy->transition_lock);
if (unlikely(policy->transition_ongoing)) {
spin_unlock(&policy->transition_lock);
goto wait;
}
policy->transition_ongoing = true;
policy->transition_task = current;
spin_unlock(&policy->transition_lock);
cpufreq_notify_transition(policy, freqs, CPUFREQ_PRECHANGE);
}
EXPORT_SYMBOL_GPL(cpufreq_freq_transition_begin);
void cpufreq_freq_transition_end(struct cpufreq_policy *policy,
struct cpufreq_freqs *freqs, int transition_failed)
{
if (WARN_ON(!policy->transition_ongoing))
return;
cpufreq_notify_post_transition(policy, freqs, transition_failed);
arch_set_freq_scale(policy->related_cpus,
policy->cur,
policy->cpuinfo.max_freq);
policy->transition_ongoing = false;
policy->transition_task = NULL;
wake_up(&policy->transition_wait);
}
EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end);
/*
* Fast frequency switching status count. Positive means "enabled", negative
* means "disabled" and 0 means "not decided yet".
*/
static int cpufreq_fast_switch_count;
static DEFINE_MUTEX(cpufreq_fast_switch_lock);
static void cpufreq_list_transition_notifiers(void)
{
struct notifier_block *nb;
pr_info("Registered transition notifiers:\n");
mutex_lock(&cpufreq_transition_notifier_list.mutex);
for (nb = cpufreq_transition_notifier_list.head; nb; nb = nb->next)
pr_info("%pS\n", nb->notifier_call);
mutex_unlock(&cpufreq_transition_notifier_list.mutex);
}
/**
* cpufreq_enable_fast_switch - Enable fast frequency switching for policy.
* @policy: cpufreq policy to enable fast frequency switching for.
*
* Try to enable fast frequency switching for @policy.
*
* The attempt will fail if there is at least one transition notifier registered
* at this point, as fast frequency switching is quite fundamentally at odds
* with transition notifiers. Thus if successful, it will make registration of
* transition notifiers fail going forward.
*/
void cpufreq_enable_fast_switch(struct cpufreq_policy *policy)
{
lockdep_assert_held(&policy->rwsem);
if (!policy->fast_switch_possible)
return;
mutex_lock(&cpufreq_fast_switch_lock);
if (cpufreq_fast_switch_count >= 0) {
cpufreq_fast_switch_count++;
policy->fast_switch_enabled = true;
} else {
pr_warn("CPU%u: Fast frequency switching not enabled\n",
policy->cpu);
cpufreq_list_transition_notifiers();
}
mutex_unlock(&cpufreq_fast_switch_lock);
}
EXPORT_SYMBOL_GPL(cpufreq_enable_fast_switch);
/**
* cpufreq_disable_fast_switch - Disable fast frequency switching for policy.
* @policy: cpufreq policy to disable fast frequency switching for.
*/
void cpufreq_disable_fast_switch(struct cpufreq_policy *policy)
{
mutex_lock(&cpufreq_fast_switch_lock);
if (policy->fast_switch_enabled) {
policy->fast_switch_enabled = false;
if (!WARN_ON(cpufreq_fast_switch_count <= 0))
cpufreq_fast_switch_count--;
}
mutex_unlock(&cpufreq_fast_switch_lock);
}
EXPORT_SYMBOL_GPL(cpufreq_disable_fast_switch);
/**
* cpufreq_driver_resolve_freq - Map a target frequency to a driver-supported
* one.
* @policy: associated policy to interrogate
* @target_freq: target frequency to resolve.
*
* The target to driver frequency mapping is cached in the policy.
*
* Return: Lowest driver-supported frequency greater than or equal to the
* given target_freq, subject to policy (min/max) and driver limitations.
*/
unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
unsigned int target_freq)
{
target_freq = clamp_val(target_freq, policy->min, policy->max);
policy->cached_target_freq = target_freq;
if (cpufreq_driver->target_index) {
unsigned int idx;
idx = cpufreq_frequency_table_target(policy, target_freq,
CPUFREQ_RELATION_L);
policy->cached_resolved_idx = idx;
return policy->freq_table[idx].frequency;
}
if (cpufreq_driver->resolve_freq)
return cpufreq_driver->resolve_freq(policy, target_freq);
return target_freq;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq);
unsigned int cpufreq_policy_transition_delay_us(struct cpufreq_policy *policy)
{
unsigned int latency;
if (policy->transition_delay_us)
return policy->transition_delay_us;
latency = policy->cpuinfo.transition_latency / NSEC_PER_USEC;
if (latency) {
/*
* For platforms that can change the frequency very fast (< 10
* us), the above formula gives a decent transition delay. But
* for platforms where transition_latency is in milliseconds, it
* ends up giving unrealistic values.
*
* Cap the default transition delay to 10 ms, which seems to be
* a reasonable amount of time after which we should reevaluate
* the frequency.
*/
return min(latency * LATENCY_MULTIPLIER, (unsigned int)10000);
}
return LATENCY_MULTIPLIER;
}
EXPORT_SYMBOL_GPL(cpufreq_policy_transition_delay_us);
/*********************************************************************
* SYSFS INTERFACE *
*********************************************************************/
static ssize_t show_boost(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", cpufreq_driver->boost_enabled);
}
static ssize_t store_boost(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
int ret, enable;
ret = sscanf(buf, "%d", &enable);
if (ret != 1 || enable < 0 || enable > 1)
return -EINVAL;
if (cpufreq_boost_trigger_state(enable)) {
pr_err("%s: Cannot %s BOOST!\n",
__func__, enable ? "enable" : "disable");
return -EINVAL;
}
pr_debug("%s: cpufreq BOOST %s\n",
__func__, enable ? "enabled" : "disabled");
return count;
}
define_one_global_rw(boost);
static struct cpufreq_governor *find_governor(const char *str_governor)
{
struct cpufreq_governor *t;
for_each_governor(t)
if (!strncasecmp(str_governor, t->name, CPUFREQ_NAME_LEN))
return t;
return NULL;
}
static struct cpufreq_governor *get_governor(const char *str_governor)
{
struct cpufreq_governor *t;
mutex_lock(&cpufreq_governor_mutex);
t = find_governor(str_governor);
if (!t)
goto unlock;
if (!try_module_get(t->owner))
t = NULL;
unlock:
mutex_unlock(&cpufreq_governor_mutex);
return t;
}
static unsigned int cpufreq_parse_policy(char *str_governor)
{
if (!strncasecmp(str_governor, "performance", CPUFREQ_NAME_LEN))
return CPUFREQ_POLICY_PERFORMANCE;
if (!strncasecmp(str_governor, "powersave", CPUFREQ_NAME_LEN))
return CPUFREQ_POLICY_POWERSAVE;
return CPUFREQ_POLICY_UNKNOWN;
}
/**
* cpufreq_parse_governor - parse a governor string only for has_target()
* @str_governor: Governor name.
*/
static struct cpufreq_governor *cpufreq_parse_governor(char *str_governor)
{
struct cpufreq_governor *t;
t = get_governor(str_governor);
if (t)
return t;
if (request_module("cpufreq_%s", str_governor))
return NULL;
return get_governor(str_governor);
}
/*
* cpufreq_per_cpu_attr_read() / show_##file_name() -
* print out cpufreq information
*
* Write out information from cpufreq_driver->policy[cpu]; object must be
* "unsigned int".
*/
#define show_one(file_name, object) \
static ssize_t show_##file_name \
(struct cpufreq_policy *policy, char *buf) \
{ \
return sprintf(buf, "%u\n", policy->object); \
}
static ssize_t show_cpuinfo_max_freq(struct cpufreq_policy *policy, char *buf)
{
unsigned int max_freq = policy->cpuinfo.max_freq;
trace_android_vh_show_max_freq(policy, &max_freq);
return sprintf(buf, "%u\n", max_freq);
}
show_one(cpuinfo_min_freq, cpuinfo.min_freq);
show_one(cpuinfo_transition_latency, cpuinfo.transition_latency);
show_one(scaling_min_freq, min);
show_one(scaling_max_freq, max);
#ifdef CONFIG_SCHED_WALT
unsigned int cpuinfo_max_freq_cached;
static bool should_use_cached_freq(int cpu)
{
if (!cpuinfo_max_freq_cached)
return false;
if (!(BIT(cpu) & sched_lib_mask_force))
return false;
return is_sched_lib_based_app(current->pid);
}
static ssize_t show_cpuinfo_max_freq(struct cpufreq_policy *policy, char *buf)
{
unsigned int freq = policy->cpuinfo.max_freq;
if (should_use_cached_freq(policy->cpu))
freq = cpuinfo_max_freq_cached << 1;
else
freq = policy->cpuinfo.max_freq;
return scnprintf(buf, PAGE_SIZE, "%u\n", freq);
}
#endif
__weak unsigned int arch_freq_get_on_cpu(int cpu)
{
return 0;
}
static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf)
{
ssize_t ret;
unsigned int freq;
freq = arch_freq_get_on_cpu(policy->cpu);
if (freq)
ret = sprintf(buf, "%u\n", freq);
else if (cpufreq_driver->setpolicy && cpufreq_driver->get)
ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu));
else
ret = sprintf(buf, "%u\n", policy->cur);
return ret;
}
/*
* cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
*/
#define store_one(file_name, object) \
static ssize_t store_##file_name \
(struct cpufreq_policy *policy, const char *buf, size_t count) \
{ \
unsigned long val; \
int ret; \
\
ret = sscanf(buf, "%lu", &val); \
if (ret != 1) \
return -EINVAL; \
\
ret = freq_qos_update_request(policy->object##_freq_req, val);\
return ret >= 0 ? count : ret; \
}
store_one(scaling_min_freq, min);
store_one(scaling_max_freq, max);
/*
* show_cpuinfo_cur_freq - current CPU frequency as detected by hardware
*/
static ssize_t show_cpuinfo_cur_freq(struct cpufreq_policy *policy,
char *buf)
{
unsigned int cur_freq = __cpufreq_get(policy);
if (cur_freq)
return sprintf(buf, "%u\n", cur_freq);
return sprintf(buf, "<unknown>\n");
}
/*
* show_scaling_governor - show the current policy for the specified CPU
*/
static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
{
if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
return sprintf(buf, "powersave\n");
else if (policy->policy == CPUFREQ_POLICY_PERFORMANCE)
return sprintf(buf, "performance\n");
else if (policy->governor)
return scnprintf(buf, CPUFREQ_NAME_PLEN, "%s\n",
policy->governor->name);
return -EINVAL;
}
/*
* store_scaling_governor - store policy for the specified CPU
*/
static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
const char *buf, size_t count)
{
char str_governor[16];
int ret;
ret = sscanf(buf, "%15s", str_governor);
if (ret != 1)
return -EINVAL;
if (cpufreq_driver->setpolicy) {
unsigned int new_pol;
new_pol = cpufreq_parse_policy(str_governor);
if (!new_pol)
return -EINVAL;
ret = cpufreq_set_policy(policy, NULL, new_pol);
} else {
struct cpufreq_governor *new_gov;
new_gov = cpufreq_parse_governor(str_governor);
if (!new_gov)
return -EINVAL;
ret = cpufreq_set_policy(policy, new_gov,
CPUFREQ_POLICY_UNKNOWN);
module_put(new_gov->owner);
}
return ret ? ret : count;
}
/*
* show_scaling_driver - show the cpufreq driver currently loaded
*/
static ssize_t show_scaling_driver(struct cpufreq_policy *policy, char *buf)
{
return scnprintf(buf, CPUFREQ_NAME_PLEN, "%s\n", cpufreq_driver->name);
}
/*
* show_scaling_available_governors - show the available CPUfreq governors
*/
static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
char *buf)
{
ssize_t i = 0;
struct cpufreq_governor *t;
if (!has_target()) {
i += sprintf(buf, "performance powersave");
goto out;
}
mutex_lock(&cpufreq_governor_mutex);
for_each_governor(t) {
if (i >= (ssize_t) ((PAGE_SIZE / sizeof(char))
- (CPUFREQ_NAME_LEN + 2)))
break;
i += scnprintf(&buf[i], CPUFREQ_NAME_PLEN, "%s ", t->name);
}
mutex_unlock(&cpufreq_governor_mutex);
out:
i += sprintf(&buf[i], "\n");
return i;
}
ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf)
{
ssize_t i = 0;
unsigned int cpu;
for_each_cpu(cpu, mask) {
if (i)
i += scnprintf(&buf[i], (PAGE_SIZE - i - 2), " ");
i += scnprintf(&buf[i], (PAGE_SIZE - i - 2), "%u", cpu);
if (i >= (PAGE_SIZE - 5))
break;
}
i += sprintf(&buf[i], "\n");
return i;
}
EXPORT_SYMBOL_GPL(cpufreq_show_cpus);
/*
* show_related_cpus - show the CPUs affected by each transition even if
* hw coordination is in use
*/
static ssize_t show_related_cpus(struct cpufreq_policy *policy, char *buf)
{
return cpufreq_show_cpus(policy->related_cpus, buf);
}
/*
* show_affected_cpus - show the CPUs affected by each transition
*/
static ssize_t show_affected_cpus(struct cpufreq_policy *policy, char *buf)
{
return cpufreq_show_cpus(policy->cpus, buf);
}
static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
const char *buf, size_t count)
{
unsigned int freq = 0;
unsigned int ret;
if (!policy->governor || !policy->governor->store_setspeed)
return -EINVAL;
ret = sscanf(buf, "%u", &freq);
if (ret != 1)
return -EINVAL;
policy->governor->store_setspeed(policy, freq);
return count;
}
static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf)
{
if (!policy->governor || !policy->governor->show_setspeed)
return sprintf(buf, "<unsupported>\n");
return policy->governor->show_setspeed(policy, buf);
}
/*
* show_bios_limit - show the current cpufreq HW/BIOS limitation
*/
static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf)
{
unsigned int limit;
int ret;
ret = cpufreq_driver->bios_limit(policy->cpu, &limit);
if (!ret)
return sprintf(buf, "%u\n", limit);
return sprintf(buf, "%u\n", policy->cpuinfo.max_freq);
}
cpufreq_freq_attr_ro_perm(cpuinfo_cur_freq, 0400);
cpufreq_freq_attr_ro(cpuinfo_min_freq);
cpufreq_freq_attr_ro(cpuinfo_max_freq);
cpufreq_freq_attr_ro(cpuinfo_transition_latency);
cpufreq_freq_attr_ro(scaling_available_governors);
cpufreq_freq_attr_ro(scaling_driver);
cpufreq_freq_attr_ro(scaling_cur_freq);
cpufreq_freq_attr_ro(bios_limit);
cpufreq_freq_attr_ro(related_cpus);
cpufreq_freq_attr_ro(affected_cpus);
cpufreq_freq_attr_rw(scaling_min_freq);
cpufreq_freq_attr_rw(scaling_max_freq);
cpufreq_freq_attr_rw(scaling_governor);
cpufreq_freq_attr_rw(scaling_setspeed);
static struct attribute *default_attrs[] = {
&cpuinfo_min_freq.attr,
&cpuinfo_max_freq.attr,
&cpuinfo_transition_latency.attr,
&scaling_min_freq.attr,
&scaling_max_freq.attr,
&affected_cpus.attr,
&related_cpus.attr,
&scaling_governor.attr,
&scaling_driver.attr,
&scaling_available_governors.attr,
&scaling_setspeed.attr,
NULL
};
#define to_policy(k) container_of(k, struct cpufreq_policy, kobj)
#define to_attr(a) container_of(a, struct freq_attr, attr)
static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)
{
struct cpufreq_policy *policy = to_policy(kobj);
struct freq_attr *fattr = to_attr(attr);
ssize_t ret;
if (!fattr->show)
return -EIO;
down_read(&policy->rwsem);
ret = fattr->show(policy, buf);
up_read(&policy->rwsem);
return ret;
}
static ssize_t store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
struct cpufreq_policy *policy = to_policy(kobj);
struct freq_attr *fattr = to_attr(attr);
ssize_t ret = -EINVAL;
if (!fattr->store)
return -EIO;
/*
* cpus_read_trylock() is used here to work around a circular lock
* dependency problem with respect to the cpufreq_register_driver().
*/
if (!cpus_read_trylock())
return -EBUSY;
if (cpu_online(policy->cpu)) {
down_write(&policy->rwsem);
ret = fattr->store(policy, buf, count);
up_write(&policy->rwsem);
}
cpus_read_unlock();
return ret;
}
static void cpufreq_sysfs_release(struct kobject *kobj)
{
struct cpufreq_policy *policy = to_policy(kobj);
pr_debug("last reference is dropped\n");
complete(&policy->kobj_unregister);
}
static const struct sysfs_ops sysfs_ops = {
.show = show,
.store = store,
};
static struct kobj_type ktype_cpufreq = {
.sysfs_ops = &sysfs_ops,
.default_attrs = default_attrs,
.release = cpufreq_sysfs_release,
};
static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu)
{
struct device *dev = get_cpu_device(cpu);
if (unlikely(!dev))
return;
if (cpumask_test_and_set_cpu(cpu, policy->real_cpus))
return;
dev_dbg(dev, "%s: Adding symlink\n", __func__);
if (sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq"))
dev_err(dev, "cpufreq symlink creation failed\n");
}
static void remove_cpu_dev_symlink(struct cpufreq_policy *policy,
struct device *dev)
{
dev_dbg(dev, "%s: Removing symlink\n", __func__);
sysfs_remove_link(&dev->kobj, "cpufreq");
}
static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
{
struct freq_attr **drv_attr;
int ret = 0;
/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while (drv_attr && *drv_attr) {
ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
if (ret)
return ret;
drv_attr++;
}
if (cpufreq_driver->get) {
ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
if (ret)
return ret;
}
ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
if (ret)
return ret;
if (cpufreq_driver->bios_limit) {
ret = sysfs_create_file(&policy->kobj, &bios_limit.attr);
if (ret)
return ret;
}
return 0;
}
static int cpufreq_init_policy(struct cpufreq_policy *policy)
{
struct cpufreq_governor *gov = NULL;
unsigned int pol = CPUFREQ_POLICY_UNKNOWN;
int ret;
if (has_target()) {
/* Update policy governor to the one used before hotplug. */
gov = get_governor(policy->last_governor);
if (gov) {
pr_debug("Restoring governor %s for cpu %d\n",
gov->name, policy->cpu);
} else {
gov = get_governor(default_governor);
}
if (!gov) {
gov = cpufreq_default_governor();
__module_get(gov->owner);
}
} else {
/* Use the default policy if there is no last_policy. */
if (policy->last_policy) {
pol = policy->last_policy;
} else {
pol = cpufreq_parse_policy(default_governor);
/*
* In case the default governor is neither "performance"
* nor "powersave", fall back to the initial policy
* value set by the driver.
*/
if (pol == CPUFREQ_POLICY_UNKNOWN)
pol = policy->policy;
}
if (pol != CPUFREQ_POLICY_PERFORMANCE &&
pol != CPUFREQ_POLICY_POWERSAVE)
return -ENODATA;
}
ret = cpufreq_set_policy(policy, gov, pol);
if (gov)
module_put(gov->owner);
return ret;
}
static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu)
{
int ret = 0;
/* Has this CPU been taken care of already? */
if (cpumask_test_cpu(cpu, policy->cpus))
return 0;
down_write(&policy->rwsem);
if (has_target())
cpufreq_stop_governor(policy);
cpumask_set_cpu(cpu, policy->cpus);
if (has_target()) {
ret = cpufreq_start_governor(policy);
if (ret)
#ifndef CONFIG_SCHED_WALT
pr_err("%s: Failed to start governor\n", __func__);
#else
pr_err("%s: Failed to start governor for CPU%u, policy CPU%u\n",
__func__, cpu, policy->cpu);
#endif
}
up_write(&policy->rwsem);
return ret;
}
void refresh_frequency_limits(struct cpufreq_policy *policy)
{
if (!policy_is_inactive(policy)) {
pr_debug("updating policy for CPU %u\n", policy->cpu);
cpufreq_set_policy(policy, policy->governor, policy->policy);
}
}
EXPORT_SYMBOL(refresh_frequency_limits);
static void handle_update(struct work_struct *work)
{
struct cpufreq_policy *policy =
container_of(work, struct cpufreq_policy, update);
pr_debug("handle_update for cpu %u called\n", policy->cpu);
down_write(&policy->rwsem);
refresh_frequency_limits(policy);
up_write(&policy->rwsem);
}
static int cpufreq_notifier_min(struct notifier_block *nb, unsigned long freq,
void *data)
{
struct cpufreq_policy *policy = container_of(nb, struct cpufreq_policy, nb_min);
schedule_work(&policy->update);
return 0;
}
static int cpufreq_notifier_max(struct notifier_block *nb, unsigned long freq,
void *data)
{
struct cpufreq_policy *policy = container_of(nb, struct cpufreq_policy, nb_max);
schedule_work(&policy->update);
return 0;
}
static void cpufreq_policy_put_kobj(struct cpufreq_policy *policy)
{
struct kobject *kobj;
struct completion *cmp;
down_write(&policy->rwsem);
cpufreq_stats_free_table(policy);
kobj = &policy->kobj;
cmp = &policy->kobj_unregister;
up_write(&policy->rwsem);
kobject_put(kobj);
/*
* We need to make sure that the underlying kobj is
* actually not referenced anymore by anybody before we
* proceed with unloading.
*/
pr_debug("waiting for dropping of refcount\n");
wait_for_completion(cmp);
pr_debug("wait complete\n");
}
static struct cpufreq_policy *cpufreq_policy_alloc(unsigned int cpu)
{
struct cpufreq_policy *policy;
struct device *dev = get_cpu_device(cpu);
int ret;
if (!dev)
return NULL;
policy = kzalloc(sizeof(*policy), GFP_KERNEL);
if (!policy)
return NULL;
if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL))
goto err_free_policy;
if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL))
goto err_free_cpumask;
if (!zalloc_cpumask_var(&policy->real_cpus, GFP_KERNEL))
goto err_free_rcpumask;
ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq,
cpufreq_global_kobject, "policy%u", cpu);
if (ret) {
dev_err(dev, "%s: failed to init policy->kobj: %d\n", __func__, ret);
/*
* The entire policy object will be freed below, but the extra
* memory allocated for the kobject name needs to be freed by
* releasing the kobject.
*/
kobject_put(&policy->kobj);
goto err_free_real_cpus;
}
freq_constraints_init(&policy->constraints);
policy->nb_min.notifier_call = cpufreq_notifier_min;
policy->nb_max.notifier_call = cpufreq_notifier_max;
ret = freq_qos_add_notifier(&policy->constraints, FREQ_QOS_MIN,
&policy->nb_min);
if (ret) {
dev_err(dev, "Failed to register MIN QoS notifier: %d (%*pbl)\n",
ret, cpumask_pr_args(policy->cpus));
goto err_kobj_remove;
}
ret = freq_qos_add_notifier(&policy->constraints, FREQ_QOS_MAX,
&policy->nb_max);
if (ret) {
dev_err(dev, "Failed to register MAX QoS notifier: %d (%*pbl)\n",
ret, cpumask_pr_args(policy->cpus));
goto err_min_qos_notifier;
}
INIT_LIST_HEAD(&policy->policy_list);
init_rwsem(&policy->rwsem);
spin_lock_init(&policy->transition_lock);
init_waitqueue_head(&policy->transition_wait);
init_completion(&policy->kobj_unregister);
INIT_WORK(&policy->update, handle_update);
policy->cpu = cpu;
return policy;
err_min_qos_notifier:
freq_qos_remove_notifier(&policy->constraints, FREQ_QOS_MIN,
&policy->nb_min);
err_kobj_remove:
cpufreq_policy_put_kobj(policy);
err_free_real_cpus:
free_cpumask_var(policy->real_cpus);
err_free_rcpumask:
free_cpumask_var(policy->related_cpus);
err_free_cpumask:
free_cpumask_var(policy->cpus);
err_free_policy:
kfree(policy);
return NULL;
}
static void cpufreq_policy_free(struct cpufreq_policy *policy)
{
unsigned long flags;
int cpu;
/* Remove policy from list */
write_lock_irqsave(&cpufreq_driver_lock, flags);
list_del(&policy->policy_list);
for_each_cpu(cpu, policy->related_cpus)
per_cpu(cpufreq_cpu_data, cpu) = NULL;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
freq_qos_remove_notifier(&policy->constraints, FREQ_QOS_MAX,
&policy->nb_max);
freq_qos_remove_notifier(&policy->constraints, FREQ_QOS_MIN,
&policy->nb_min);
/* Cancel any pending policy->update work before freeing the policy. */
cancel_work_sync(&policy->update);
if (policy->max_freq_req) {
/*
* CPUFREQ_CREATE_POLICY notification is sent only after
* successfully adding max_freq_req request.
*/
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
CPUFREQ_REMOVE_POLICY, policy);
freq_qos_remove_request(policy->max_freq_req);
}
freq_qos_remove_request(policy->min_freq_req);
kfree(policy->min_freq_req);
cpufreq_policy_put_kobj(policy);
free_cpumask_var(policy->real_cpus);
free_cpumask_var(policy->related_cpus);
free_cpumask_var(policy->cpus);
kfree(policy);
}
static int cpufreq_online(unsigned int cpu)
{
struct cpufreq_policy *policy;
bool new_policy;
unsigned long flags;
unsigned int j;
int ret;
pr_debug("%s: bringing CPU%u online\n", __func__, cpu);
/* Check if this CPU already has a policy to manage it */
policy = per_cpu(cpufreq_cpu_data, cpu);
if (policy) {
WARN_ON(!cpumask_test_cpu(cpu, policy->related_cpus));
if (!policy_is_inactive(policy))
return cpufreq_add_policy_cpu(policy, cpu);
/* This is the only online CPU for the policy. Start over. */
new_policy = false;
down_write(&policy->rwsem);
policy->cpu = cpu;
policy->governor = NULL;
up_write(&policy->rwsem);
} else {
new_policy = true;
policy = cpufreq_policy_alloc(cpu);
if (!policy)
return -ENOMEM;
}
if (!new_policy && cpufreq_driver->online) {
ret = cpufreq_driver->online(policy);
if (ret) {
pr_debug("%s: %d: initialization failed\n", __func__,
__LINE__);
goto out_exit_policy;
}
/* Recover policy->cpus using related_cpus */
cpumask_copy(policy->cpus, policy->related_cpus);
} else {
cpumask_copy(policy->cpus, cpumask_of(cpu));
/*
* Call driver. From then on the cpufreq must be able
* to accept all calls to ->verify and ->setpolicy for this CPU.
*/
ret = cpufreq_driver->init(policy);
if (ret) {
pr_debug("%s: %d: initialization failed\n", __func__,
__LINE__);
goto out_free_policy;
}
ret = cpufreq_table_validate_and_sort(policy);
if (ret)
goto out_exit_policy;
/* related_cpus should at least include policy->cpus. */
cpumask_copy(policy->related_cpus, policy->cpus);
}
down_write(&policy->rwsem);
/*
* affected cpus must always be the one, which are online. We aren't
* managing offline cpus here.
*/
cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);
if (new_policy) {
for_each_cpu(j, policy->related_cpus) {
per_cpu(cpufreq_cpu_data, j) = policy;
add_cpu_dev_symlink(policy, j);
}
policy->min_freq_req = kzalloc(2 * sizeof(*policy->min_freq_req),
GFP_KERNEL);
if (!policy->min_freq_req)
goto out_destroy_policy;
ret = freq_qos_add_request(&policy->constraints,
policy->min_freq_req, FREQ_QOS_MIN,
policy->min);
if (ret < 0) {
/*
* So we don't call freq_qos_remove_request() for an
* uninitialized request.
*/
kfree(policy->min_freq_req);
policy->min_freq_req = NULL;
goto out_destroy_policy;
}
/*
* This must be initialized right here to avoid calling
* freq_qos_remove_request() on uninitialized request in case
* of errors.
*/
policy->max_freq_req = policy->min_freq_req + 1;
ret = freq_qos_add_request(&policy->constraints,
policy->max_freq_req, FREQ_QOS_MAX,
policy->max);
if (ret < 0) {
policy->max_freq_req = NULL;
goto out_destroy_policy;
}
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
CPUFREQ_CREATE_POLICY, policy);
}
if (cpufreq_driver->get && has_target()) {
policy->cur = cpufreq_driver->get(policy->cpu);
if (!policy->cur) {
pr_err("%s: ->get() failed\n", __func__);
goto out_destroy_policy;
}
}
/*
* Sometimes boot loaders set CPU frequency to a value outside of
* frequency table present with cpufreq core. In such cases CPU might be
* unstable if it has to run on that frequency for long duration of time
* and so its better to set it to a frequency which is specified in
* freq-table. This also makes cpufreq stats inconsistent as
* cpufreq-stats would fail to register because current frequency of CPU
* isn't found in freq-table.
*
* Because we don't want this change to effect boot process badly, we go
* for the next freq which is >= policy->cur ('cur' must be set by now,
* otherwise we will end up setting freq to lowest of the table as 'cur'
* is initialized to zero).
*
* We are passing target-freq as "policy->cur - 1" otherwise
* __cpufreq_driver_target() would simply fail, as policy->cur will be
* equal to target-freq.
*/
if ((cpufreq_driver->flags & CPUFREQ_NEED_INITIAL_FREQ_CHECK)
&& has_target()) {
unsigned int old_freq = policy->cur;
/* Are we running at unknown frequency ? */
ret = cpufreq_frequency_table_get_index(policy, old_freq);
if (ret == -EINVAL) {
ret = __cpufreq_driver_target(policy, old_freq - 1,
CPUFREQ_RELATION_L);
/*
* Reaching here after boot in a few seconds may not
* mean that system will remain stable at "unknown"
* frequency for longer duration. Hence, a BUG_ON().
*/
BUG_ON(ret);
pr_info("%s: CPU%d: Running at unlisted initial frequency: %u KHz, changing to: %u KHz\n",
__func__, policy->cpu, old_freq, policy->cur);
}
}
if (new_policy) {
ret = cpufreq_add_dev_interface(policy);
if (ret)
goto out_destroy_policy;
cpufreq_stats_create_table(policy);
cpufreq_times_create_policy(policy);
write_lock_irqsave(&cpufreq_driver_lock, flags);
list_add(&policy->policy_list, &cpufreq_policy_list);
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
}
ret = cpufreq_init_policy(policy);
if (ret) {
pr_err("%s: Failed to initialize policy for cpu: %d (%d)\n",
__func__, cpu, ret);
goto out_destroy_policy;
}
up_write(&policy->rwsem);
kobject_uevent(&policy->kobj, KOBJ_ADD);
/* Callback for handling stuff after policy is ready */
if (cpufreq_driver->ready)
cpufreq_driver->ready(policy);
if (cpufreq_thermal_control_enabled(cpufreq_driver))
policy->cdev = of_cpufreq_cooling_register(policy);
pr_debug("initialization complete\n");
return 0;
out_destroy_policy:
for_each_cpu(j, policy->real_cpus)
remove_cpu_dev_symlink(policy, get_cpu_device(j));
up_write(&policy->rwsem);
out_exit_policy:
if (cpufreq_driver->exit)
cpufreq_driver->exit(policy);
out_free_policy:
cpufreq_policy_free(policy);
return ret;
}
/**
* cpufreq_add_dev - the cpufreq interface for a CPU device.
* @dev: CPU device.
* @sif: Subsystem interface structure pointer (not used)
*/
static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
{
struct cpufreq_policy *policy;
unsigned cpu = dev->id;
int ret;
dev_dbg(dev, "%s: adding CPU%u\n", __func__, cpu);
if (cpu_online(cpu)) {
ret = cpufreq_online(cpu);
if (ret)
return ret;
}
/* Create sysfs link on CPU registration */
policy = per_cpu(cpufreq_cpu_data, cpu);
if (policy)
add_cpu_dev_symlink(policy, cpu);
return 0;
}
static int cpufreq_offline(unsigned int cpu)
{
struct cpufreq_policy *policy;
int ret;
pr_debug("%s: unregistering CPU %u\n", __func__, cpu);
policy = cpufreq_cpu_get_raw(cpu);
if (!policy) {
pr_debug("%s: No cpu_data found\n", __func__);
return 0;
}
down_write(&policy->rwsem);
if (has_target())
cpufreq_stop_governor(policy);
cpumask_clear_cpu(cpu, policy->cpus);
if (policy_is_inactive(policy)) {
if (has_target())
strncpy(policy->last_governor, policy->governor->name,
CPUFREQ_NAME_LEN);
else
policy->last_policy = policy->policy;
} else if (cpu == policy->cpu) {
/* Nominate new CPU */
policy->cpu = cpumask_any(policy->cpus);
}
/* Start governor again for active policy */
if (!policy_is_inactive(policy)) {
if (has_target()) {
ret = cpufreq_start_governor(policy);
if (ret)
pr_err("%s: Failed to start governor\n", __func__);
}
goto unlock;
}
if (cpufreq_thermal_control_enabled(cpufreq_driver)) {
cpufreq_cooling_unregister(policy->cdev);
policy->cdev = NULL;
}
if (cpufreq_driver->stop_cpu)
cpufreq_driver->stop_cpu(policy);
if (has_target())
cpufreq_exit_governor(policy);
/*
* Perform the ->offline() during light-weight tear-down, as
* that allows fast recovery when the CPU comes back.
*/
if (cpufreq_driver->offline) {
cpufreq_driver->offline(policy);
} else if (cpufreq_driver->exit) {
cpufreq_driver->exit(policy);
policy->freq_table = NULL;
}
unlock:
up_write(&policy->rwsem);
return 0;
}
/*
* cpufreq_remove_dev - remove a CPU device
*
* Removes the cpufreq interface for a CPU device.
*/
static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
{
unsigned int cpu = dev->id;
struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
if (!policy)
return;
if (cpu_online(cpu))
cpufreq_offline(cpu);
cpumask_clear_cpu(cpu, policy->real_cpus);
remove_cpu_dev_symlink(policy, dev);
if (cpumask_empty(policy->real_cpus)) {
/* We did light-weight exit earlier, do full tear down now */
if (cpufreq_driver->offline)
cpufreq_driver->exit(policy);
cpufreq_policy_free(policy);
}
}
/**
* cpufreq_out_of_sync - If actual and saved CPU frequency differs, we're
* in deep trouble.
* @policy: policy managing CPUs
* @new_freq: CPU frequency the CPU actually runs at
*
* We adjust to current frequency first, and need to clean up later.
* So either call to cpufreq_update_policy() or schedule handle_update()).
*/
static void cpufreq_out_of_sync(struct cpufreq_policy *policy,
unsigned int new_freq)
{
struct cpufreq_freqs freqs;
pr_debug("Warning: CPU frequency out of sync: cpufreq and timing core thinks of %u, is %u kHz\n",
policy->cur, new_freq);
freqs.old = policy->cur;
freqs.new = new_freq;
cpufreq_freq_transition_begin(policy, &freqs);
cpufreq_freq_transition_end(policy, &freqs, 0);
}
static unsigned int cpufreq_verify_current_freq(struct cpufreq_policy *policy, bool update)
{
unsigned int new_freq;
new_freq = cpufreq_driver->get(policy->cpu);
if (!new_freq)
return 0;
/*
* If fast frequency switching is used with the given policy, the check
* against policy->cur is pointless, so skip it in that case.
*/
if (policy->fast_switch_enabled || !has_target())
return new_freq;
if (policy->cur != new_freq) {
cpufreq_out_of_sync(policy, new_freq);
if (update)
schedule_work(&policy->update);
}
return new_freq;
}
/**
* cpufreq_quick_get - get the CPU frequency (in kHz) from policy->cur
* @cpu: CPU number
*
* This is the last known freq, without actually getting it from the driver.
* Return value will be same as what is shown in scaling_cur_freq in sysfs.
*/
unsigned int cpufreq_quick_get(unsigned int cpu)
{
struct cpufreq_policy *policy;
unsigned int ret_freq = 0;
unsigned long flags;
read_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver && cpufreq_driver->setpolicy && cpufreq_driver->get) {
ret_freq = cpufreq_driver->get(cpu);
read_unlock_irqrestore(&cpufreq_driver_lock, flags);
return ret_freq;
}
read_unlock_irqrestore(&cpufreq_driver_lock, flags);
policy = cpufreq_cpu_get(cpu);
if (policy) {
ret_freq = policy->cur;
cpufreq_cpu_put(policy);
}
return ret_freq;
}
EXPORT_SYMBOL(cpufreq_quick_get);
/**
* cpufreq_quick_get_max - get the max reported CPU frequency for this CPU
* @cpu: CPU number
*
* Just return the max possible frequency for a given CPU.
*/
unsigned int cpufreq_quick_get_max(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
unsigned int ret_freq = 0;
if (policy) {
ret_freq = policy->max;
cpufreq_cpu_put(policy);
}
return ret_freq;
}
EXPORT_SYMBOL(cpufreq_quick_get_max);
/**
* cpufreq_get_hw_max_freq - get the max hardware frequency of the CPU
* @cpu: CPU number
*
* The default return value is the max_freq field of cpuinfo.
*/
__weak unsigned int cpufreq_get_hw_max_freq(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
unsigned int ret_freq = 0;
if (policy) {
ret_freq = policy->cpuinfo.max_freq;
cpufreq_cpu_put(policy);
}
return ret_freq;
}
EXPORT_SYMBOL(cpufreq_get_hw_max_freq);
static unsigned int __cpufreq_get(struct cpufreq_policy *policy)
{
if (unlikely(policy_is_inactive(policy)))
return 0;
return cpufreq_verify_current_freq(policy, true);
}
/**
* cpufreq_get - get the current CPU frequency (in kHz)
* @cpu: CPU number
*
* Get the CPU current (static) CPU frequency
*/
unsigned int cpufreq_get(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
unsigned int ret_freq = 0;
if (policy) {
down_read(&policy->rwsem);
if (cpufreq_driver->get)
ret_freq = __cpufreq_get(policy);
up_read(&policy->rwsem);
cpufreq_cpu_put(policy);
}
return ret_freq;
}
EXPORT_SYMBOL(cpufreq_get);
static struct subsys_interface cpufreq_interface = {
.name = "cpufreq",
.subsys = &cpu_subsys,
.add_dev = cpufreq_add_dev,
.remove_dev = cpufreq_remove_dev,
};
/*
* In case platform wants some specific frequency to be configured
* during suspend..
*/
int cpufreq_generic_suspend(struct cpufreq_policy *policy)
{
int ret;
if (!policy->suspend_freq) {
pr_debug("%s: suspend_freq not defined\n", __func__);
return 0;
}
pr_debug("%s: Setting suspend-freq: %u\n", __func__,
policy->suspend_freq);
ret = __cpufreq_driver_target(policy, policy->suspend_freq,
CPUFREQ_RELATION_H);
if (ret)
pr_err("%s: unable to set suspend-freq: %u. err: %d\n",
__func__, policy->suspend_freq, ret);
return ret;
}
EXPORT_SYMBOL(cpufreq_generic_suspend);
/**
* cpufreq_suspend() - Suspend CPUFreq governors
*
* Called during system wide Suspend/Hibernate cycles for suspending governors
* as some platforms can't change frequency after this point in suspend cycle.
* Because some of the devices (like: i2c, regulators, etc) they use for
* changing frequency are suspended quickly after this point.
*/
void cpufreq_suspend(void)
{
struct cpufreq_policy *policy;
if (!cpufreq_driver)
return;
if (!has_target() && !cpufreq_driver->suspend)
goto suspend;
pr_debug("%s: Suspending Governors\n", __func__);
for_each_active_policy(policy) {
if (has_target()) {
down_write(&policy->rwsem);
cpufreq_stop_governor(policy);
up_write(&policy->rwsem);
}
if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
pr_err("%s: Failed to suspend driver: %s\n", __func__,
cpufreq_driver->name);
}
suspend:
cpufreq_suspended = true;
}
/**
* cpufreq_resume() - Resume CPUFreq governors
*
* Called during system wide Suspend/Hibernate cycle for resuming governors that
* are suspended with cpufreq_suspend().
*/
void cpufreq_resume(void)
{
struct cpufreq_policy *policy;
int ret;
if (!cpufreq_driver)
return;
if (unlikely(!cpufreq_suspended))
return;
cpufreq_suspended = false;
if (!has_target() && !cpufreq_driver->resume)
return;
pr_debug("%s: Resuming Governors\n", __func__);
for_each_active_policy(policy) {
if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) {
pr_err("%s: Failed to resume driver: %p\n", __func__,
policy);
} else if (has_target()) {
down_write(&policy->rwsem);
ret = cpufreq_start_governor(policy);
up_write(&policy->rwsem);
if (ret)
pr_err("%s: Failed to start governor for policy: %p\n",
__func__, policy);
}
}
}
/**
* cpufreq_driver_test_flags - Test cpufreq driver's flags against given ones.
* @flags: Flags to test against the current cpufreq driver's flags.
*
* Assumes that the driver is there, so callers must ensure that this is the
* case.
*/
bool cpufreq_driver_test_flags(u16 flags)
{
return !!(cpufreq_driver->flags & flags);
}
/**
* cpufreq_get_current_driver - return current driver's name
*
* Return the name string of the currently loaded cpufreq driver
* or NULL, if none.
*/
const char *cpufreq_get_current_driver(void)
{
if (cpufreq_driver)
return cpufreq_driver->name;
return NULL;
}
EXPORT_SYMBOL_GPL(cpufreq_get_current_driver);
/**
* cpufreq_get_driver_data - return current driver data
*
* Return the private data of the currently loaded cpufreq
* driver, or NULL if no cpufreq driver is loaded.
*/
void *cpufreq_get_driver_data(void)
{
if (cpufreq_driver)
return cpufreq_driver->driver_data;
return NULL;
}
EXPORT_SYMBOL_GPL(cpufreq_get_driver_data);
/*********************************************************************
* NOTIFIER LISTS INTERFACE *
*********************************************************************/
/**
* cpufreq_register_notifier - register a driver with cpufreq
* @nb: notifier function to register
* @list: CPUFREQ_TRANSITION_NOTIFIER or CPUFREQ_POLICY_NOTIFIER
*
* Add a driver to one of two lists: either a list of drivers that
* are notified about clock rate changes (once before and once after
* the transition), or a list of drivers that are notified about
* changes in cpufreq policy.
*
* This function may sleep, and has the same return conditions as
* blocking_notifier_chain_register.
*/
int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list)
{
int ret;
if (cpufreq_disabled())
return -EINVAL;
switch (list) {
case CPUFREQ_TRANSITION_NOTIFIER:
mutex_lock(&cpufreq_fast_switch_lock);
if (cpufreq_fast_switch_count > 0) {
mutex_unlock(&cpufreq_fast_switch_lock);
return -EBUSY;
}
ret = srcu_notifier_chain_register(
&cpufreq_transition_notifier_list, nb);
if (!ret)
cpufreq_fast_switch_count--;
mutex_unlock(&cpufreq_fast_switch_lock);
break;
case CPUFREQ_POLICY_NOTIFIER:
ret = blocking_notifier_chain_register(
&cpufreq_policy_notifier_list, nb);
break;
default:
ret = -EINVAL;
}
return ret;
}
EXPORT_SYMBOL(cpufreq_register_notifier);
/**
* cpufreq_unregister_notifier - unregister a driver with cpufreq
* @nb: notifier block to be unregistered
* @list: CPUFREQ_TRANSITION_NOTIFIER or CPUFREQ_POLICY_NOTIFIER
*
* Remove a driver from the CPU frequency notifier list.
*
* This function may sleep, and has the same return conditions as
* blocking_notifier_chain_unregister.
*/
int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list)
{
int ret;
if (cpufreq_disabled())
return -EINVAL;
switch (list) {
case CPUFREQ_TRANSITION_NOTIFIER:
mutex_lock(&cpufreq_fast_switch_lock);
ret = srcu_notifier_chain_unregister(
&cpufreq_transition_notifier_list, nb);
if (!ret && !WARN_ON(cpufreq_fast_switch_count >= 0))
cpufreq_fast_switch_count++;
mutex_unlock(&cpufreq_fast_switch_lock);
break;
case CPUFREQ_POLICY_NOTIFIER:
ret = blocking_notifier_chain_unregister(
&cpufreq_policy_notifier_list, nb);
break;
default:
ret = -EINVAL;
}
return ret;
}
EXPORT_SYMBOL(cpufreq_unregister_notifier);
/*********************************************************************
* GOVERNORS *
*********************************************************************/
/**
* cpufreq_driver_fast_switch - Carry out a fast CPU frequency switch.
* @policy: cpufreq policy to switch the frequency for.
* @target_freq: New frequency to set (may be approximate).
*
* Carry out a fast frequency switch without sleeping.
*
* The driver's ->fast_switch() callback invoked by this function must be
* suitable for being called from within RCU-sched read-side critical sections
* and it is expected to select the minimum available frequency greater than or
* equal to @target_freq (CPUFREQ_RELATION_L).
*
* This function must not be called if policy->fast_switch_enabled is unset.
*
* Governors calling this function must guarantee that it will never be invoked
* twice in parallel for the same policy and that it will never be called in
* parallel with either ->target() or ->target_index() for the same policy.
*
* Returns the actual frequency set for the CPU.
*
* If 0 is returned by the driver's ->fast_switch() callback to indicate an
* error condition, the hardware configuration must be preserved.
*/
unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
unsigned int target_freq)
{
unsigned int freq;
int cpu;
target_freq = clamp_val(target_freq, policy->min, policy->max);
freq = cpufreq_driver->fast_switch(policy, target_freq);
if (!freq)
return 0;
policy->cur = freq;
arch_set_freq_scale(policy->related_cpus, freq,
policy->cpuinfo.max_freq);
cpufreq_stats_record_transition(policy, freq);
if (trace_cpu_frequency_enabled()) {
for_each_cpu(cpu, policy->cpus)
trace_cpu_frequency(freq, cpu);
}
return freq;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_fast_switch);
/* Must set freqs->new to intermediate frequency */
static int __target_intermediate(struct cpufreq_policy *policy,
struct cpufreq_freqs *freqs, int index)
{
int ret;
freqs->new = cpufreq_driver->get_intermediate(policy, index);
/* We don't need to switch to intermediate freq */
if (!freqs->new)
return 0;
pr_debug("%s: cpu: %d, switching to intermediate freq: oldfreq: %u, intermediate freq: %u\n",
__func__, policy->cpu, freqs->old, freqs->new);
cpufreq_freq_transition_begin(policy, freqs);
ret = cpufreq_driver->target_intermediate(policy, index);
cpufreq_freq_transition_end(policy, freqs, ret);
if (ret)
pr_err("%s: Failed to change to intermediate frequency: %d\n",
__func__, ret);
return ret;
}
static int __target_index(struct cpufreq_policy *policy, int index)
{
struct cpufreq_freqs freqs = {.old = policy->cur, .flags = 0};
unsigned int intermediate_freq = 0;
unsigned int newfreq = policy->freq_table[index].frequency;
int retval = -EINVAL;
bool notify;
if (newfreq == policy->cur)
return 0;
notify = !(cpufreq_driver->flags & CPUFREQ_ASYNC_NOTIFICATION);
if (notify) {
/* Handle switching to intermediate frequency */
if (cpufreq_driver->get_intermediate) {
retval = __target_intermediate(policy, &freqs, index);
if (retval)
return retval;
intermediate_freq = freqs.new;
/* Set old freq to intermediate */
if (intermediate_freq)
freqs.old = freqs.new;
}
freqs.new = newfreq;
pr_debug("%s: cpu: %d, oldfreq: %u, new freq: %u\n",
__func__, policy->cpu, freqs.old, freqs.new);
cpufreq_freq_transition_begin(policy, &freqs);
}
retval = cpufreq_driver->target_index(policy, index);
if (retval)
pr_err("%s: Failed to change cpu frequency: %d\n", __func__,
retval);
if (notify) {
cpufreq_freq_transition_end(policy, &freqs, retval);
/*
* Failed after setting to intermediate freq? Driver should have
* reverted back to initial frequency and so should we. Check
* here for intermediate_freq instead of get_intermediate, in
* case we haven't switched to intermediate freq at all.
*/
if (unlikely(retval && intermediate_freq)) {
freqs.old = intermediate_freq;
freqs.new = policy->restore_freq;
cpufreq_freq_transition_begin(policy, &freqs);
cpufreq_freq_transition_end(policy, &freqs, 0);
}
}
return retval;
}
int __cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
unsigned int old_target_freq = target_freq;
int index;
if (cpufreq_disabled())
return -ENODEV;
/* Make sure that target_freq is within supported range */
target_freq = clamp_val(target_freq, policy->min, policy->max);
pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
policy->cpu, target_freq, relation, old_target_freq);
#ifndef CONFIG_SCHED_WALT
/*
* This might look like a redundant call as we are checking it again
* after finding index. But it is left intentionally for cases where
* exactly same freq is called again and so we can save on few function
* calls.
*/
if (target_freq == policy->cur &&
!(cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS))
return 0;
#endif
/* Save last value to restore later on errors */
policy->restore_freq = policy->cur;
if (cpufreq_driver->target)
return cpufreq_driver->target(policy, target_freq, relation);
if (!cpufreq_driver->target_index)
return -EINVAL;
index = cpufreq_frequency_table_target(policy, target_freq, relation);
return __target_index(policy, index);
}
EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
int cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
int ret;
down_write(&policy->rwsem);
ret = __cpufreq_driver_target(policy, target_freq, relation);
up_write(&policy->rwsem);
return ret;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_target);
__weak struct cpufreq_governor *cpufreq_fallback_governor(void)
{
return NULL;
}
static int cpufreq_init_governor(struct cpufreq_policy *policy)
{
int ret;
/* Don't start any governor operations if we are entering suspend */
if (cpufreq_suspended)
return 0;
/*
* Governor might not be initiated here if ACPI _PPC changed
* notification happened, so check it.
*/
if (!policy->governor)
return -EINVAL;
/* Platform doesn't want dynamic frequency switching ? */
if (policy->governor->flags & CPUFREQ_GOV_DYNAMIC_SWITCHING &&
cpufreq_driver->flags & CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING) {
struct cpufreq_governor *gov = cpufreq_fallback_governor();
if (gov) {
pr_warn("Can't use %s governor as dynamic switching is disallowed. Fallback to %s governor\n",
policy->governor->name, gov->name);
policy->governor = gov;
} else {
return -EINVAL;
}
}
if (!try_module_get(policy->governor->owner))
return -EINVAL;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
if (policy->governor->init) {
ret = policy->governor->init(policy);
if (ret) {
module_put(policy->governor->owner);
return ret;
}
}
policy->strict_target = !!(policy->governor->flags & CPUFREQ_GOV_STRICT_TARGET);
return 0;
}
static void cpufreq_exit_governor(struct cpufreq_policy *policy)
{
if (cpufreq_suspended || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
if (policy->governor->exit)
policy->governor->exit(policy);
module_put(policy->governor->owner);
}
int cpufreq_start_governor(struct cpufreq_policy *policy)
{
int ret;
if (cpufreq_suspended)
return 0;
if (!policy->governor)
return -EINVAL;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
if (cpufreq_driver->get)
cpufreq_verify_current_freq(policy, false);
if (policy->governor->start) {
ret = policy->governor->start(policy);
if (ret)
return ret;
}
if (policy->governor->limits)
policy->governor->limits(policy);
return 0;
}
void cpufreq_stop_governor(struct cpufreq_policy *policy)
{
if (cpufreq_suspended || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
if (policy->governor->stop)
policy->governor->stop(policy);
}
static void cpufreq_governor_limits(struct cpufreq_policy *policy)
{
if (cpufreq_suspended || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
if (policy->governor->limits)
policy->governor->limits(policy);
}
int cpufreq_register_governor(struct cpufreq_governor *governor)
{
int err;
if (!governor)
return -EINVAL;
if (cpufreq_disabled())
return -ENODEV;
mutex_lock(&cpufreq_governor_mutex);
err = -EBUSY;
if (!find_governor(governor->name)) {
err = 0;
list_add(&governor->governor_list, &cpufreq_governor_list);
}
mutex_unlock(&cpufreq_governor_mutex);
return err;
}
EXPORT_SYMBOL_GPL(cpufreq_register_governor);
void cpufreq_unregister_governor(struct cpufreq_governor *governor)
{
struct cpufreq_policy *policy;
unsigned long flags;
if (!governor)
return;
if (cpufreq_disabled())
return;
/* clear last_governor for all inactive policies */
read_lock_irqsave(&cpufreq_driver_lock, flags);
for_each_inactive_policy(policy) {
if (!strcmp(policy->last_governor, governor->name)) {
policy->governor = NULL;
strcpy(policy->last_governor, "\0");
}
}
read_unlock_irqrestore(&cpufreq_driver_lock, flags);
mutex_lock(&cpufreq_governor_mutex);
list_del(&governor->governor_list);
mutex_unlock(&cpufreq_governor_mutex);
}
EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
/*********************************************************************
* POLICY INTERFACE *
*********************************************************************/
/**
* cpufreq_get_policy - get the current cpufreq_policy
* @policy: struct cpufreq_policy into which the current cpufreq_policy
* is written
* @cpu: CPU to find the policy for
*
* Reads the current cpufreq policy.
*/
int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
{
struct cpufreq_policy *cpu_policy;
if (!policy)
return -EINVAL;
cpu_policy = cpufreq_cpu_get(cpu);
if (!cpu_policy)
return -EINVAL;
memcpy(policy, cpu_policy, sizeof(*policy));
cpufreq_cpu_put(cpu_policy);
return 0;
}
EXPORT_SYMBOL(cpufreq_get_policy);
/**
* cpufreq_set_policy - Modify cpufreq policy parameters.
* @policy: Policy object to modify.
* @new_gov: Policy governor pointer.
* @new_pol: Policy value (for drivers with built-in governors).
*
* Invoke the cpufreq driver's ->verify() callback to sanity-check the frequency
* limits to be set for the policy, update @policy with the verified limits
* values and either invoke the driver's ->setpolicy() callback (if present) or
* carry out a governor update for @policy. That is, run the current governor's
* ->limits() callback (if @new_gov points to the same object as the one in
* @policy) or replace the governor for @policy with @new_gov.
*
* The cpuinfo part of @policy is not updated by this function.
*/
static int cpufreq_set_policy(struct cpufreq_policy *policy,
struct cpufreq_governor *new_gov,
unsigned int new_pol)
{
struct cpufreq_policy_data new_data;
struct cpufreq_governor *old_gov;
int ret;
memcpy(&new_data.cpuinfo, &policy->cpuinfo, sizeof(policy->cpuinfo));
new_data.freq_table = policy->freq_table;
new_data.cpu = policy->cpu;
/*
* PM QoS framework collects all the requests from users and provide us
* the final aggregated value here.
*/
new_data.min = freq_qos_read_value(&policy->constraints, FREQ_QOS_MIN);
new_data.max = freq_qos_read_value(&policy->constraints, FREQ_QOS_MAX);
pr_debug("setting new policy for CPU %u: %u - %u kHz\n",
new_data.cpu, new_data.min, new_data.max);
/*
* Verify that the CPU speed can be set within these limits and make sure
* that min <= max.
*/
ret = cpufreq_driver->verify(&new_data);
if (ret)
return ret;
policy->min = new_data.min;
policy->max = new_data.max;
trace_cpu_frequency_limits(policy);
policy->cached_target_freq = UINT_MAX;
pr_debug("new min and max freqs are %u - %u kHz\n",
policy->min, policy->max);
if (cpufreq_driver->setpolicy) {
policy->policy = new_pol;
pr_debug("setting range\n");
return cpufreq_driver->setpolicy(policy);
}
if (new_gov == policy->governor) {
pr_debug("governor limits update\n");
cpufreq_governor_limits(policy);
return 0;
}
pr_debug("governor switch\n");
/* save old, working values */
old_gov = policy->governor;
/* end old governor */
if (old_gov) {
cpufreq_stop_governor(policy);
cpufreq_exit_governor(policy);
}
/* start new governor */
policy->governor = new_gov;
ret = cpufreq_init_governor(policy);
if (!ret) {
ret = cpufreq_start_governor(policy);
if (!ret) {
pr_debug("governor change\n");
#ifdef CONFIG_SCHED_WALT
sched_cpufreq_governor_change(policy, old_gov);
#endif
return 0;
}
cpufreq_exit_governor(policy);
}
/* new governor failed, so re-start old one */
pr_debug("starting governor %s failed\n", policy->governor->name);
if (old_gov) {
policy->governor = old_gov;
if (cpufreq_init_governor(policy))
policy->governor = NULL;
else
cpufreq_start_governor(policy);
}
return ret;
}
/**
* cpufreq_update_policy - Re-evaluate an existing cpufreq policy.
* @cpu: CPU to re-evaluate the policy for.
*
* Update the current frequency for the cpufreq policy of @cpu and use
* cpufreq_set_policy() to re-apply the min and max limits, which triggers the
* evaluation of policy notifiers and the cpufreq driver's ->verify() callback
* for the policy in question, among other things.
*/
void cpufreq_update_policy(unsigned int cpu)
{
struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpu);
if (!policy)
return;
/*
* BIOS might change freq behind our back
* -> ask driver for current freq and notify governors about a change
*/
if (cpufreq_driver->get && has_target() &&
(cpufreq_suspended || WARN_ON(!cpufreq_verify_current_freq(policy, false))))
goto unlock;
refresh_frequency_limits(policy);
unlock:
cpufreq_cpu_release(policy);
}
EXPORT_SYMBOL(cpufreq_update_policy);
/**
* cpufreq_update_limits - Update policy limits for a given CPU.
* @cpu: CPU to update the policy limits for.
*
* Invoke the driver's ->update_limits callback if present or call
* cpufreq_update_policy() for @cpu.
*/
void cpufreq_update_limits(unsigned int cpu)
{
if (cpufreq_driver->update_limits)
cpufreq_driver->update_limits(cpu);
else
cpufreq_update_policy(cpu);
}
EXPORT_SYMBOL_GPL(cpufreq_update_limits);
/*********************************************************************
* BOOST *
*********************************************************************/
static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state)
{
int ret;
if (!policy->freq_table)
return -ENXIO;
ret = cpufreq_frequency_table_cpuinfo(policy, policy->freq_table);
if (ret) {
pr_err("%s: Policy frequency update failed\n", __func__);
return ret;
}
ret = freq_qos_update_request(policy->max_freq_req, policy->max);
if (ret < 0)
return ret;
return 0;
}
int cpufreq_boost_trigger_state(int state)
{
struct cpufreq_policy *policy;
unsigned long flags;
int ret = 0;
if (cpufreq_driver->boost_enabled == state)
return 0;
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver->boost_enabled = state;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
get_online_cpus();
for_each_active_policy(policy) {
ret = cpufreq_driver->set_boost(policy, state);
if (ret)
goto err_reset_state;
}
put_online_cpus();
return 0;
err_reset_state:
put_online_cpus();
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver->boost_enabled = !state;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
pr_err("%s: Cannot %s BOOST\n",
__func__, state ? "enable" : "disable");
return ret;
}
static bool cpufreq_boost_supported(void)
{
return cpufreq_driver->set_boost;
}
static int create_boost_sysfs_file(void)
{
int ret;
ret = sysfs_create_file(cpufreq_global_kobject, &boost.attr);
if (ret)
pr_err("%s: cannot register global BOOST sysfs file\n",
__func__);
return ret;
}
static void remove_boost_sysfs_file(void)
{
if (cpufreq_boost_supported())
sysfs_remove_file(cpufreq_global_kobject, &boost.attr);
}
int cpufreq_enable_boost_support(void)
{
if (!cpufreq_driver)
return -EINVAL;
if (cpufreq_boost_supported())
return 0;
cpufreq_driver->set_boost = cpufreq_boost_set_sw;
/* This will get removed on driver unregister */
return create_boost_sysfs_file();
}
EXPORT_SYMBOL_GPL(cpufreq_enable_boost_support);
int cpufreq_boost_enabled(void)
{
return cpufreq_driver->boost_enabled;
}
EXPORT_SYMBOL_GPL(cpufreq_boost_enabled);
/*********************************************************************
* REGISTER / UNREGISTER CPUFREQ DRIVER *
*********************************************************************/
static enum cpuhp_state hp_online;
static int cpuhp_cpufreq_online(unsigned int cpu)
{
cpufreq_online(cpu);
return 0;
}
static int cpuhp_cpufreq_offline(unsigned int cpu)
{
cpufreq_offline(cpu);
return 0;
}
/**
* cpufreq_register_driver - register a CPU Frequency driver
* @driver_data: A struct cpufreq_driver containing the values#
* submitted by the CPU Frequency driver.
*
* Registers a CPU Frequency driver to this core code. This code
* returns zero on success, -EEXIST when another driver got here first
* (and isn't unregistered in the meantime).
*
*/
int cpufreq_register_driver(struct cpufreq_driver *driver_data)
{
unsigned long flags;
int ret;
if (cpufreq_disabled())
return -ENODEV;
/*
* The cpufreq core depends heavily on the availability of device
* structure, make sure they are available before proceeding further.
*/
if (!get_cpu_device(0))
return -EPROBE_DEFER;
if (!driver_data || !driver_data->verify || !driver_data->init ||
!(driver_data->setpolicy || driver_data->target_index ||
driver_data->target) ||
(driver_data->setpolicy && (driver_data->target_index ||
driver_data->target)) ||
(!driver_data->get_intermediate != !driver_data->target_intermediate) ||
(!driver_data->online != !driver_data->offline))
return -EINVAL;
pr_debug("trying to register driver %s\n", driver_data->name);
/* Protect against concurrent CPU online/offline. */
cpus_read_lock();
write_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver) {
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
ret = -EEXIST;
goto out;
}
cpufreq_driver = driver_data;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
/*
* Mark support for the scheduler's frequency invariance engine for
* drivers that implement target(), target_index() or fast_switch().
*/
if (!cpufreq_driver->setpolicy) {
static_branch_enable_cpuslocked(&cpufreq_freq_invariance);
pr_debug("supports frequency invariance");
}
if (driver_data->setpolicy)
driver_data->flags |= CPUFREQ_CONST_LOOPS;
if (cpufreq_boost_supported()) {
ret = create_boost_sysfs_file();
if (ret)
goto err_null_driver;
}
ret = subsys_interface_register(&cpufreq_interface);
if (ret)
goto err_boost_unreg;
if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
list_empty(&cpufreq_policy_list)) {
/* if all ->init() calls failed, unregister */
ret = -ENODEV;
pr_debug("%s: No CPU initialized for driver %s\n", __func__,
driver_data->name);
goto err_if_unreg;
}
ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
"cpufreq:online",
cpuhp_cpufreq_online,
cpuhp_cpufreq_offline);
if (ret < 0)
goto err_if_unreg;
hp_online = ret;
ret = 0;
pr_debug("driver %s up and running\n", driver_data->name);
goto out;
err_if_unreg:
subsys_interface_unregister(&cpufreq_interface);
err_boost_unreg:
remove_boost_sysfs_file();
err_null_driver:
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver = NULL;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
out:
cpus_read_unlock();
return ret;
}
EXPORT_SYMBOL_GPL(cpufreq_register_driver);
/*
* cpufreq_unregister_driver - unregister the current CPUFreq driver
*
* Unregister the current CPUFreq driver. Only call this if you have
* the right to do so, i.e. if you have succeeded in initialising before!
* Returns zero if successful, and -EINVAL if the cpufreq_driver is
* currently not initialised.
*/
int cpufreq_unregister_driver(struct cpufreq_driver *driver)
{
unsigned long flags;
if (!cpufreq_driver || (driver != cpufreq_driver))
return -EINVAL;
pr_debug("unregistering driver %s\n", driver->name);
/* Protect against concurrent cpu hotplug */
cpus_read_lock();
subsys_interface_unregister(&cpufreq_interface);
remove_boost_sysfs_file();
static_branch_disable_cpuslocked(&cpufreq_freq_invariance);
cpuhp_remove_state_nocalls_cpuslocked(hp_online);
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver = NULL;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
cpus_read_unlock();
return 0;
}
EXPORT_SYMBOL_GPL(cpufreq_unregister_driver);
static int __init cpufreq_core_init(void)
{
struct cpufreq_governor *gov = cpufreq_default_governor();
if (cpufreq_disabled())
return -ENODEV;
cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
BUG_ON(!cpufreq_global_kobject);
if (!strlen(default_governor))
strncpy(default_governor, gov->name, CPUFREQ_NAME_LEN);
return 0;
}
module_param(off, int, 0444);
module_param_string(default_governor, default_governor, CPUFREQ_NAME_LEN, 0444);
core_initcall(cpufreq_core_init);