Commit Graph

1074866 Commits

Author SHA1 Message Date
Robin Hsu
d86f55a38e ANDROID: Pixel: Add missing symbol to symbol list
Pixel MM Metrics:
    add the missing symbol 'seq_put_decimal_ll' and re-do update list

Bug: 299190787
Test: local build
Change-Id: I005ccfa15cee8252bc51242460bbab9b7d0eb2ab
Signed-off-by: Robin Hsu <robinhsu@google.com>
2024-06-07 21:11:53 +00:00
yenchia.chen
699d87745a ANDROID: GKI: update mtktv symbol
11 function symbol(s) added
  'void usbnet_cdc_unbind(struct usbnet*, struct usb_interface*)'
  'void usbnet_disconnect(struct usb_interface*)'
  'int usbnet_generic_cdc_bind(struct usbnet*, struct usb_interface*)'
  'int usbnet_open(struct net_device*)'
  'int usbnet_probe(struct usb_interface*, const struct usb_device_id*)'
  'int usbnet_resume(struct usb_interface*)'
  'void usbnet_skb_return(struct usbnet*, struct sk_buff*)'
  'netdev_tx_t usbnet_start_xmit(struct sk_buff*, struct net_device*)'
  'int usbnet_stop(struct net_device*)'
  'int usbnet_suspend(struct usb_interface*, pm_message_t)'
  'void usbnet_tx_timeout(struct net_device*, unsigned int)'

Bug: 344792547
Change-Id: I5954a9e53e2a4687ac39d51378d4e519c74e9685
Signed-off-by: yenchia.chen <yenchia.chen@mediatek.com>
2024-06-06 11:09:43 +00:00
Yifan Hong
7f18f2a32a ANDROID: set rewrite_absolute_paths_in_config for GKI aarch64.
For GKI targets with kmi_symbol_list set,
also set rewrite_absolute_paths_in_config to True
so that CONFIG_UNUSED_KSYMS_WHITELIST is not an
absolute path any more, increasing reproducibility
on different machines.

This is made possible with d94e16579b
"Revert^2 "BACKPORT: FROMGIT: module: allow UNUSED_KSYMS_WHITELIST to be relative against objtree.""
so that Kbuild recognizes relative paths by searching
$(objtree) first.

This does not change x86 builds because it
doesn't have kmi_symbol_list set.

This change does not affect device builds like
db845c, rockpi and fips140. Adding the attribute
to these targets would be okay, but it is not
covered by this change.

Bug: 333769605
Bug: 342390208
Change-Id: I844c251979bae5277474837eaa055f1346b0afa2
Signed-off-by: Yifan Hong <elsk@google.com>
2024-06-05 00:27:00 +00:00
Roy Luo
0f96f3a53c BACKPORT: USB: gadget: core: create sysfs link between udc and gadget
udc device and gadget device are tightly coupled, yet there's no good
way to corelate the two. Add a sysfs link in udc that points to the
corresponding gadget device.
An example use case: userspace configures a f_midi configfs driver and
bind the udc device, then it tries to locate the corresponding midi
device, which is a child device of the gadget device. The gadget device
that's associated to the udc device has to be identified in order to
index the midi device. Having a sysfs link would make things much
easier.

Signed-off-by: Roy Luo <royluo@google.com>
Link: https://lore.kernel.org/r/20240307030922.3573161-1-royluo@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 333778731
Change-Id: I9e3f782543eba5e026a65031aaae754daafb69ab
(cherry picked from commit 0ef40f399aa2be8c04aee9b7430705612c104ce5)
[royluo: Resolved conflict in drivers/usb/gadget/udc/core.c ]
Signed-off-by: Roy Luo <royluo@google.com>
2024-06-03 20:10:10 +00:00
Auditya Bhattaram
eef06c5488 ANDROID: Add __nocfi return for swsusp_arch_resume
Resolve the CFI failure problem encountered
during the restoration of the hibernation snapshot image.

Bug: 340049585
Signed-off-by: Mukesh Pilaniya <quic_mpilaniy@quicinc.com>
Signed-off-by: Auditya Bhattaram <quic_audityab@quicinc.com>
Signed-off-by: Kamati Srinivas <quic_kamasrin@quicinc.com>
(cherry picked from https://android-review.googlesource.com/q/commit:93f0348ea15b65656e1c2f909de3dd3bbf26599f)
Merged-In: I1f8f2c38e9d02a177c0cadb066419bf7edd66085
Change-Id: I1f8f2c38e9d02a177c0cadb066419bf7edd66085
2024-06-03 15:17:19 +00:00
Greg Kroah-Hartman
9a84d60e35 ANDROID: ABI fixup for abi break in struct dst_ops
In commit 92f1655aa2b2 ("net: fix __dst_negative_advice() race") the
struct dst_ops callback negative_advice is callback changes function
parameters.  But as this pointer is part of a structure that is tracked
in the ABI checker, the tool triggers when this is changed.

However, the callback pointer is internal to the networking stack, so
changing the function type is safe, so needing to preserve this is not
required.  To do so, switch the function pointer type back to the old
one so that the checking tools pass, AND then do a hard cast of the
function pointer to the new type when assigning and calling the
function.

Bug: 343727534
Fixes: 92f1655aa2b2 ("net: fix __dst_negative_advice() race")
Change-Id: I48d4ab4bbd29f8edc8fbd7923828b7f78a23e12e
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-06-01 14:14:15 +00:00
Eric Dumazet
9b0dadc811 BACKPORT: net: fix __dst_negative_advice() race
__dst_negative_advice() does not enforce proper RCU rules when
sk->dst_cache must be cleared, leading to possible UAF.

RCU rules are that we must first clear sk->sk_dst_cache,
then call dst_release(old_dst).

Note that sk_dst_reset(sk) is implementing this protocol correctly,
while __dst_negative_advice() uses the wrong order.

Given that ip6_negative_advice() has special logic
against RTF_CACHE, this means each of the three ->negative_advice()
existing methods must perform the sk_dst_reset() themselves.

Note the check against NULL dst is centralized in
__dst_negative_advice(), there is no need to duplicate
it in various callbacks.

Many thanks to Clement Lecigne for tracking this issue.

This old bug became visible after the blamed commit, using UDP sockets.

Bug: 343727534
Fixes: a87cb3e48e ("net: Facility to report route quality of connected sockets")
Reported-by: Clement Lecigne <clecigne@google.com>
Diagnosed-by: Clement Lecigne <clecigne@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240528114353.1794151-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 92f1655aa2b2294d0b49925f3b875a634bd3b59e)
[Lee: Trivial/unrelated conflict - no change to the patch]
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I293734dca1b81fcb712e1de294f51e96a405f7e4
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-06-01 14:13:52 +00:00
Andrei Ciubotariu
42528b83af ANDROID: GKI: Update symbol list for Pixel Watch
Bug: 332548598
Change-Id: I0843ed59b917daeb04b179e5ed26be52fbe52909
Signed-off-by: Andrei Ciubotariu <aciubotariu@google.com>
2024-05-31 21:20:57 +00:00
Yifan Hong
d94e16579b Revert^2 "BACKPORT: FROMGIT: module: allow UNUSED_KSYMS_WHITELIST ..."
This reverts commit b7d4cf60e7.

Reason for revert: relanding change that should be safe to go in on its own. Below is the original commit message.

BACKPORT: FROMGIT: module: allow UNUSED_KSYMS_WHITELIST to be relative against objtree.

If UNUSED_KSYMS_WHITELIST is a file generated
before Kbuild runs, and the source tree is in
a read-only filesystem, the developer must put
the file somewhere and specify an absolute
path to UNUSED_KSYMS_WHITELIST. This worked,
but if IKCONFIG=y, an absolute path is embedded
into .config and eventually into vmlinux, causing
the build to be less reproducible when building
on a different machine.

This patch makes the handling of
UNUSED_KSYMS_WHITELIST to be similar to
MODULE_SIG_KEY.

First, check if UNUSED_KSYMS_WHITELIST is an
absolute path, just as before this patch. If so,
use the path as is.

If it is a relative path, use wildcard to check
the existence of the file below objtree first.
If it does not exist, fall back to the original
behavior of adding $(srctree)/ before the value.

After this patch, the developer can put the generated
file in objtree, then use a relative path against
objtree in .config, eradicating any absolute paths
that may be evaluated differently on different machines.

Signed-off-by: Yifan Hong <elsk@google.com>
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

(cherry picked from commit a2e3c811938b4902725e259c03b2d6c539613992
 https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-next)
Bug: 333769605

Change-Id: Ibf3f09dc8559e92023811abaabb33fd6b4ed8fa5
[elsk: apply change to gen_autoksyms.sh instead because
 CONFIG_UNUSED_KSYMS_WHITELIST is parsed there. Revert change
 to Makefile.modpost.]
Bug: 342390208
Signed-off-by: Yifan Hong <elsk@google.com>
2024-05-30 20:23:21 +00:00
Greg Kroah-Hartman
81d41dd61b Merge tag 'android14-5.15.149_r00' into branch android14-5.15
This catches the android14-5.15 branch up to date with the 5.15.149 LTS
release.  Included in here are the following commits:

* 8e3ef77857 Revert "hrtimer: Report offline hrtimer enqueue"
* 1683a2f9a5 Revert "mm/sparsemem: fix race in accessing memory_section->usage"
* 216d25b4d4 Revert "drm/mipi-dsi: Fix detach call without attach"
* 59ddf652b8 Revert "bpf: Add map and need_defer parameters to .map_fd_put_ptr()"
* 88ef7f6580 Merge 5.15.149 into android14-5.15-lts
* 458ce51d03 Linux 5.15.149
* d72da18772 usb: dwc3: gadget: Ignore End Transfer delay on teardown
* acff71e587 media: Revert "media: rkisp1: Drop IRQF_SHARED"
* 9ae312f7f3 usb: dwc3: gadget: Execute gadget stop after halting the controller
* 921acacb92 usb: dwc3: gadget: Don't delay End Transfer on delayed_status
* 4178bfa3fc staging: fbtft: core: set smem_len before fb_deferred_io_init call
* 9e25a00540 smb3: Replace smb2pdu 1-element arrays with flex-arrays
* 0b49eac39c fs/ntfs3: Add null pointer checks
* 4c73597f68 net: bcmgenet: Fix EEE implementation
* 62900d358c Revert "selftests/bpf: Test tail call counting with bpf2bpf and data on stack"
* 75ac8dc028 drm/msm/dsi: Enable runtime PM
* c7a0fa3a66 PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
* 1974b3c19a arm64: Subscribe Microsoft Azure Cobalt 100 to ARM Neoverse N2 errata
* 888a0a46b8 dm: limit the number of targets and parameter size area
* cf4da91e99 nilfs2: replace WARN_ONs for invalid DAT metadata block requests
* 8fa90634ec nilfs2: fix potential bug in end_buffer_async_write
* 50fb4e17df sched/membarrier: reduce the ability to hammer on sys_membarrier
* b9aafef744 netfilter: ipset: Missing gc cancellations fixed
* 6c53e85476 net: prevent mss overflow in skb_segment()
* 95c0babebe hrtimer: Ignore slack time for RT tasks in schedule_hrtimeout_range()
* c2dc077d8f netfilter: ipset: fix performance regression in swap operation
* 3b3e4d3560 scripts/decode_stacktrace.sh: optionally use LLVM utilities
* 473791d286 scripts: decode_stacktrace: demangle Rust symbols
* 1ce4ac55d9 scripts/decode_stacktrace.sh: support old bash version
* 2655757a3f fbdev: flush deferred IO before closing
* 15492bab73 fbdev: Fix incorrect page mapping clearance at fb_deferred_io_release()
* 87b9802ca8 fbdev: Fix invalid page access after closing deferred I/O devices
* 9a95fc0426 fbdev: Rename pagelist to pagereflist for deferred I/O
* 186b89659c fbdev: Track deferred-I/O pages in pageref struct
* e79b2b2aad fbdev: defio: fix the pagelist corruption
* 0616b00a31 fbdev: Don't sort deferred-I/O pages by default
* 5d3aff76a3 fbdev/defio: Early-out if page is already enlisted
* 48a09969e4 serial: 8250_exar: Set missing rs485_supported flag
* 9ef7419bc2 serial: 8250_exar: Fill in rs485_supported
* aded03eda2 usb: dwc3: gadget: Queue PM runtime idle on disconnect event
* 21f0bff281 usb: dwc3: gadget: Handle EP0 request dequeuing properly
* 89353c8864 usb: dwc3: gadget: Refactor EP0 forced stall/restart into a separate API
* 9156192573 usb: dwc3: gadget: Stall and restart EP0 if host is unresponsive
* 352b38d15c usb: dwc3: gadget: Submit endxfer command if delayed during disconnect
* 9cccdcc95e usb: dwc3: gadget: Force sending delayed status during soft disconnect
* 1ea8a2a532 usb: dwc3: Fix ep0 handling when getting reset while doing control transfer
* 12c0a0804a usb: dwc3: gadget: Delay issuing End Transfer
* 487341852f usb: dwc3: gadget: Only End Transfer for ep0 data phase
* 9273bd26b0 usb: dwc3: ep0: Don't prepare beyond Setup stage
* 92f7a10a2b usb: dwc3: gadget: Wait for ep0 xfers to complete during dequeue
* 2bb86817b3 crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_init
* 44a8a2c92e bus: moxtet: Add spi device table
* 4e82b9c11d dma-buf: add dma_fence_timestamp helper
* 36f7371de9 af_unix: Fix task hung while purging oob_skb in GC.
* ff2f35f5cd tracing: Inform kmemleak of saved_cmdlines allocation
* 579cb4ff1f pmdomain: core: Move the unused cleanup to a _sync initcall
* 41ccb5bcbf can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER)
* 03358aba99 can: j1939: prevent deadlock by changing j1939_socks_lock to rwlock
* 6315697fc5 of: property: fix typo in io-channels
* 310c7d9853 mm: hugetlb pages should not be reserved by shmat() if SHM_NORESERVE
* 70e329b440 ceph: prevent use-after-free in encode_cap_msg()
* 99fa6d451d net: ethernet: ti: cpsw_new: enable mac_managed_pm to fix mdio
* ff42d99e50 s390/qeth: Fix potential loss of L3-IP@ in case of network issues
* ddb4be0eb2 net: ethernet: ti: cpsw: enable mac_managed_pm to fix mdio
* 86244ae707 irqchip/gic-v3-its: Fix GICv4.1 VPE affinity update
* 27a2af914f irqchip/irq-brcmstb-l2: Add write memory barrier before exit
* b10c8883f8 wifi: mac80211: reload info pointer in ieee80211_tx_dequeue()
* ef5b1041f7 nfp: flower: prevent re-adding mac index for bonded port
* e58efe0f7a nfp: use correct macro for LengthSelect in BAR config
* 7535ec350a crypto: ccp - Fix null pointer dereference in __sev_platform_shutdown_locked
* 7e9b622bd0 nilfs2: fix hang in nilfs_lookup_dirty_data_buffers()
* 120f7fa200 nilfs2: fix data corruption in dsync block recovery for small block sizes
* ee28bbb685 ALSA: hda/conexant: Add quirk for SWS JS201D
* 776f0c695d mmc: slot-gpio: Allow non-sleeping GPIO ro
* 62fa823049 x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
* 1fb17e9b84 x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6
* 0fc0bcbab6 powerpc/64: Set task pt_regs->link to the LR value on scv entry
* 72bf8760ad serial: max310x: fail probe if clock crystal is unstable
* b67b421a82 serial: max310x: improve crystal stable clock detection
* 2e8b2b9180 serial: max310x: set default value when reading clock ready bit
* f8777d33cc ring-buffer: Clean ring_buffer_poll_wait() error return
* 7656372ae1 hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove
* 4cc9092827 drm/prime: Support page array >= 4GB
* d98210108e media: rc: bpf attach/detach requires write permission
* a4b4ba772e iio: accel: bma400: Fix a compilation problem
* 1c6d19c8cb iio: core: fix memleak in iio_device_register_sysfs
* 8d5838a473 iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC
* 7b9cabd478 staging: iio: ad5933: fix type mismatch regression
* 047aa3dc0a tracing: Fix wasted memory in saved_cmdlines logic
* afba9d1132 ext4: fix double-free of blocks due to wrong extents moved_len
* b7902e34b0 misc: fastrpc: Mark all sessions as invalid in cb_remove
* 82722b453d binder: signal epoll threads of self-work
* 4052b18031 ALSA: hda/cs8409: Suppress vmaster control for Dolphin models
* cc3cb482c0 ASoC: codecs: wcd938x: handle deferred probe
* 08c84d1640 ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL
* 8b2f219914 xen-netback: properly sync TX responses
* de769423b2 net: hsr: remove WARN_ONCE() in send_hsr_supervision_frame()
* 471c9ede80 nfc: nci: free rx_data_reassembly skb on NCI device cleanup
* ac0f160a36 kbuild: Fix changing ELF file type for output of gen_btf for big endian
* 4bcfab7388 firewire: core: correct documentation of fw_csr_string() kernel API
* d260a5b76d lsm: fix the logic in security_inode_getsecctx()
* 65158edb0a Revert "drm/amd: flush any delayed gfxoff on suspend entry"
* 5b8f473c4d scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
* 6f95120f89 mptcp: fix data re-injection from stale subflow
* b7449c9fe0 modpost: trim leading spaces when processing source files list
* 1f8d0691c5 i2c: i801: Fix block process call transactions
* 23a8b74fe9 i2c: i801: Remove i801_set_block_buffer_mode
* 2738e0aa2f powerpc/kasan: Fix addr error caused by page alignment
* 207557e393 media: ir_toy: fix a memleak in irtoy_tx
* 88936ceab6 usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend
* 6f54aa9ad5 usb: f_mass_storage: forbid async queue when shutdown happen
* 44c7567cc4 USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT
* 3aa71c7717 usb: ucsi_acpi: Fix command completion handling
* 712afb6ba1 iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP
* 853307924a HID: wacom: Do not register input devices until after hid_hw_start
* 20902b760e HID: wacom: generic: Avoid reporting a serial of '0' to userspace
* 62f5d219ed HID: i2c-hid-of: fix NULL-deref on failed power up
* 20d8a8fe00 ALSA: hda/realtek: Enable Mute LED on HP Laptop 14-fq0xxx
* 16dc275672 ALSA: hda/realtek: Fix the external mic not being recognised for Acer Swift 1 SF114-32
* 595865eb4e scsi: storvsc: Fix ring buffer size calculation
* 5099871b37 mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again
* b5085b5ac1 tracing/trigger: Fix to return error if failed to alloc snapshot
* cd459beede scs: add CONFIG_MMU dependency for vfree_atomic()
* 29b3681010 i40e: Fix waiting for queues of all VSIs to be disabled
* 8e89ac8852 MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler
* 9bc718f6a5 net: sysfs: Fix /sys/class/net/<iface> path for statistics
* d14b8e2005 ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work()
* 2ed13fda59 spi: ppc4xx: Drop write-only variable
* c45f2fa92c net: openvswitch: limit the number of recursions from action sets
* ca8c08db64 wifi: iwlwifi: Fix some error codes
* 1ab2a02bf1 of: unittest: Fix compile in the non-dynamic case
* f0dc9c004b btrfs: send: return EOPNOTSUPP on unknown flags
* 980e2bee30 btrfs: forbid deleting live subvol qgroup
* e31546b0f3 btrfs: do not ASSERT() if the newly created subvolume already got read
* 08bead026b btrfs: forbid creating subvol qgroups
* 2bab493a56 netfilter: nft_set_rbtree: skip end interval element from gc
* 658020d797 net: stmmac: xgmac: fix a typo of register name in DPP safety handling
* 3f2e5581cb net: stmmac: xgmac: use #define for string constants
* 1027d6d63c clocksource: Skip watchdog check for large watchdog intervals
* be38f291fd vhost: use kzalloc() instead of kmalloc() followed by memset()
* 132305ee73 Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID
* 7688958016 Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU
* 15524057a3 hrtimer: Report offline hrtimer enqueue
* e2aaab6fcb usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK
* 5c654c582f usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK
* efe1bfe067 USB: serial: cp210x: add ID for IMST iM871A-USB
* 3799bb646f USB: serial: option: add Fibocom FM101-GL variant
* 2998a7ddff USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e
* c1be84b8ee ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter
* 8b0386bca5 drivers: lkdtm: fix clang -Wformat warning
* 1e4d3f8bd8 blk-iocost: Fix an UBSAN shift-out-of-bounds warning
* 0d3dab8867 scsi: core: Move scsi_host_busy() out of host lock if it is for per-command
* ae4acad41b fs/ntfs3: Fix an NULL dereference bug
* 4f0b6f2c22 netfilter: nft_set_pipapo: remove scratch_aligned pointer
* ed96510365 netfilter: nft_set_pipapo: add helper to release pcpu scratch area
* 24547e88da netfilter: nft_set_pipapo: store index in scratch maps
* 44725dc004 netfilter: nft_ct: reject direction for ct id
* 42442f7431 drm/amd/display: Implement bounds check for stream encoder creation in DCN301
* bc6f288c10 drm/amd/display: Fix multiple memory leaks reported by coverity
* fb49e60d71 netfilter: nft_compat: restrict match/target protocol to u16
* 5f1c4efced netfilter: nft_compat: reject unused compat flag
* 58fbe665b0 ppp_async: limit MRU to 64K
* 4fe505c63a af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC.
* c1701ea85e tipc: Check the bearer type before calling tipc_udp_nl_bearer_add()
* 69682953dd rxrpc: Fix response to PING RESPONSE ACKs to a dead call
* 3266e638ba inet: read sk->sk_family once in inet_recv_error()
* 7df911d4f1 hwmon: (coretemp) Fix bogus core_id to attr name mapping
* a16afec8e8 hwmon: (coretemp) Fix out-of-bounds memory access
* 0d5ceb4caa hwmon: (aspeed-pwm-tacho) mutex for tach reading
* c08a3943dc octeontx2-pf: Fix a memleak otx2_sq_init
* 15393c8fd3 atm: idt77252: fix a memleak in open_card_ubr0
* d964dd1bc1 tunnels: fix out of bounds access when building IPv6 PMTU error
* 5c45e6d015 selftests: net: avoid just another constant wait
* ea51f12e93 selftests: net: cut more slack for gro fwd tests.
* 6609e98ed8 net: stmmac: xgmac: fix handling of DPP safety error for DMA channels
* 513dd309b3 drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case
* 8cc889b9de phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP
* 5db6dd838e dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV
* 850b64fd38 phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
* 15eb996d7d dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA
* c71d4578a3 dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA
* 71fe7fd3d9 dmaengine: ti: k3-udma: Report short packet errors
* c75460bf7a dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools
* 725a9ac717 ASoC: codecs: lpass-wsa-macro: fix compander volume hack
* 48471f7a4c bonding: remove print in bond_verify_device_path
* 85d64b0c39 HID: apple: Add 2021 magic keyboard FN key mapping
* 97799743b4 HID: apple: Add support for the 2021 Magic Keyboard
* c5b70b8f78 gve: Fix use-after-free vulnerability
* ce3c5039e6 arm64: irq: set the correct node for shadow call stack
* 8cdf9b6caa net: sysfs: Fix /sys/class/net/<iface> path
* f3ce3e0038 selftests: net: fix available tunnels detection
* c8f6b3b864 af_unix: fix lockdep positive in sk_diag_dump_icons()
* 5823acd759 net: ipv4: fix a memleak in ip_setup_cork
* b775ced054 netfilter: nft_ct: sanitize layer 3 and 4 protocol number in custom expectations
* 5d7a4559bc netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger
* 4cdab71675 netfilter: nf_tables: restrict tunnel object to NFPROTO_NETDEV
* beb7328192 bridge: mcast: fix disabled snooping after long uptime
* dbc1b89981 llc: call sock_orphan() at release time
* a9ef5dc938 ipv6: Ensure natural alignment of const ipv6 loopback and router addresses
* a2e5f021ca ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550()
* c7f47912f7 ixgbe: Refactor overtemp event handling
* 52ec65d4d4 ixgbe: Refactor returning internal error codes
* 7683f41c7b ixgbe: Remove non-inclusive language
* 718f446e60 tcp: add sanity checks to rx zerocopy
* af6b5c50d4 ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv()
* 6d56450166 ip6_tunnel: use dev_sw_netstats_rx_add()
* 157e1cb2c0 selftests: net: give more time for GRO aggregation
* d37c1c8141 scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler
* 022e2310e8 scsi: isci: Fix an error code problem in isci_io_request_build()
* bc009cb12f drm: using mul_u32_u32() requires linux/math64.h
* cfe8390367 wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update
* 8a070a5884 perf: Fix the nr_addr_filters fix
* b203bc5e22 drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()'
* 362754ec2c drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()'
* 2f7f8e109b drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()'
* a9c15d6e8a ceph: fix deadlock or deadcode of misusing dget()
* 89e0e66682 blk-mq: fix IO hang from sbitmap wakeup race
* 105874a454 virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings
* 7a70663ba0 drm/amdkfd: Fix lock dependency warning
* 93ecc12925 libsubcmd: Fix memory leak in uniq()
* 82006e24aa PCI/AER: Decode Requester ID when no error info found
* 7289a6e6fc PCI: Fix 64GT/s effective data rate calculation
* f4dce08ba1 fs/kernfs/dir: obey S_ISGID
* ef86cdc688 tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE
* 8451aa6694 selftests/sgx: Fix linker script asserts
* 5607328761 usb: hub: Replace hardcoded quirk value with BIT() macro
* a7af1be5cf perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present
* ff1c7e2fb9 PCI: switchtec: Fix stdev_release() crash after surprise hot remove
* 52d42ac643 PCI: Only override AMD USB controller if required
* 1a4f408561 mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt
* 28497271ff mfd: ti_am335x_tscadc: Fix TI SoC dependencies
* f7752e5f53 xen/gntdev: Fix the abuse of underlying struct page in DMA-buf import
* 9b7d253b82 i3c: master: cdns: Update maximum prescaler value for i2c clock
* 0c7478a2da um: time-travel: fix time corruption
* 1e3d449b15 um: net: Fix return type of uml_net_start_xmit()
* b7b44ee08d um: Don't use vfprintf() for os_info()
* 4c4b366add um: Fix naming clash between UML and scheduler
* f5010e2892 leds: trigger: panic: Don't register panic notifier if creating the trigger failed
* f13b8cb5a6 ALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140
* bd086bd1e3 drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()'
* 702b759168 drm/amdgpu: Let KFD sync with VM fences
* 8998723de4 clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks
* 9709da9d10 clk: imx: scu: Fix memory leak in __imx_clk_gpr_scu()
* 91828d9316 watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786
* 54a84bad7b clk: mmp: pxa168: Fix memory leak in pxa168_clk_init()
* fcc477e610 clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()
* 77bcd4ab44 drm/amdgpu: fix ftrace event amdgpu_bo_move always move on same heap
* 2b5a22f0cc drm/msm/dpu: Ratelimit framedone timeout msgs
* a889d9012d media: i2c: imx335: Fix hblank min/max values
* d1e0fdbabf media: ddbridge: fix an error code problem in ddb_probe
* ed790bd090 IB/ipoib: Fix mcast list locking
* 5fcd8a81d3 drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time
* 7ea0f29d9f f2fs: fix to tag gcing flag on page during block migration
* 8ab28b2d70 media: rkisp1: Drop IRQF_SHARED
* 9d23b21a2d ALSA: hda: intel-dspcfg: add filters for ARL-S and ARL
* b1a53c923c ALSA: hda: Intel: add HDA_ARL PCI ID support
* 684cb957fe PCI: add INTEL_HDA_ARL to pci_ids.h
* d08e032f75 media: rockchip: rga: fix swizzling for RGB formats
* fdf14a7c2b media: stk1160: Fixed high volume of stk1160_dbg messages
* 3cdc644470 drm/mipi-dsi: Fix detach call without attach
* 711b5cc5f6 drm/framebuffer: Fix use of uninitialized variable
* df31f3cb04 drm/drm_file: fix use of uninitialized variable
* 6941fe8d94 f2fs: fix write pointers on zoned device after roll forward
* 2ed3db8991 drm/amd/display: Fix tiled display misalignment
* f217be126a RDMA/IPoIB: Fix error code return in ipoib_mcast_join
* 8eb8fca117 fast_dput(): handle underflows gracefully
* 7fa0c4ef67 ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument
* 82ccd840e0 ALSA: hda: Refer to correct stream index at loops
* b4fb0807a1 f2fs: fix to check return value of f2fs_reserve_new_block()
* 315d966df2 octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry
* 28764fab4d i40e: Fix VF disable behavior to block all traffic
* 2cf9158fff bridge: cfm: fix enum typo in br_cc_ccm_tx_parse
* 1fbcb194aa Bluetooth: L2CAP: Fix possible multiple reject send
* 84e3f673b2 Bluetooth: qca: Set both WIDEBAND_SPEECH and LE_STATES quirks for QCA2066
* 2fde2254e0 wifi: cfg80211: free beacon_ies when overridden from hidden BSS
* f589258f40 wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift()
* 49ec369f56 ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision
* 90dbf45356 libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos
* 9e1cae3157 wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices
* 40a71f7e91 arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property
* 2f747a4f66 arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property
* 2aee6c4517 md: Whenassemble the array, consult the superblock of the freshest device
* 6ab391eafa block: prevent an integer overflow in bvec_try_merge_hw_page
* a9d12fdc51 net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path
* fed1463644 ARM: dts: imx23/28: Fix the DMA controller node name
* e9b724664b ARM: dts: imx23-sansa: Use preferred i2c-gpios properties
* 3995aa5238 ARM: dts: imx27-apf27dev: Fix LED name
* 7a01ad0f04 ARM: dts: imx25/27: Pass timing0
* b60d572d85 ARM: dts: imx25: Fix the iim compatible string
* f6abd5e17d block/rnbd-srv: Check for unlikely string overflow
* 963b9c5484 ionic: pass opcode to devcmd_wait
* 1381707578 ARM: dts: imx1: Fix sram node
* ad54a5b041 ARM: dts: imx27: Fix sram node
* b4130668dc ARM: dts: imx: Use flash@0,0 pattern
* 3693ecc0c1 ARM: dts: imx25/27-eukrea: Fix RTC node name
* cf5f3489b6 ARM: dts: rockchip: fix rk3036 hdmi ports node
* fdb812bea0 bpf: Set uattr->batch.count as zero before batched update or deletion
* 813ebba2a7 scsi: libfc: Fix up timeout error in fc_fcp_rec_error()
* 43ba03c31a scsi: libfc: Don't schedule abort twice
* 5ef63c872d bpf: Add map and need_defer parameters to .map_fd_put_ptr()
* 9003fa9a01 wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()
* 8c965c9c4b ARM: dts: imx7s: Fix nand-controller #size-cells
* 3eeefee8da ARM: dts: imx7s: Fix lcdif compatible
* f9ec664f94 ARM: dts: imx7d: Fix coresight funnel ports
* 7733800d38 scsi: arcmsr: Support new PCI device IDs 1883 and 1886
* 34acf5225e bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk
* 2abaf72628 PCI: Add no PM reset quirk for NVIDIA Spectrum devices
* 6b9abf50d3 scsi: lpfc: Fix possible file string name overflow when updating firmware
* 79aadf6492 selftests/bpf: Fix issues in setup_classid_environment()
* 6aad081470 selftests/bpf: Fix pyperf180 compilation failure with clang18
* efe701e916 selftests/bpf: satisfy compiler by having explicit return in btf test
* 4cc198580a wifi: rt2x00: restart beacon queue when hardware reset
* d76c8d7ffe ext4: avoid online resizing failures due to oversized flex bg
* 0cabe04c56 ext4: remove unnecessary check from alloc_flex_gd()
* 474f5b00c5 ext4: unify the type of flexbg_size to unsigned int
* 5d2090597c ext4: fix inconsistent between segment fstrim and full fstrim
* 9f2e407814 ecryptfs: Reject casefold directory inodes
* f8cf4dabbd SUNRPC: Fix a suspicious RCU usage warning
* 732a3bea7a KVM: s390: fix setting of fpc register
* 28a1f492cb s390/ptrace: handle setting of fpc register correctly
* df81cbcd26 arch: consolidate arch_irq_work_raise prototypes
* 6aa3002087 jfs: fix array-index-out-of-bounds in diNewExt
* 40e21a9e48 rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock()
* 44b8640048 afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
* 78b6ff52a5 afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu()
* 556be726a4 crypto: stm32/crc32 - fix parsing list of devices
* 70a3b16113 crypto: octeontx2 - Fix cptvf driver cleanup
* 2a37905d47 pstore/ram: Fix crash when setting number of cpus to an odd number
* 8e44dc3f96 jfs: fix uaf in jfs_evict_inode
* 8393c80cce jfs: fix array-index-out-of-bounds in dbAdjTree
* 6c6a96c3d7 jfs: fix slab-out-of-bounds Read in dtSearch
* e4ce01c25c UBSAN: array-index-out-of-bounds in dtSplitRoot
* 6fe8b70212 FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree
* 7cb4103166 ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events
* 099f6a9edb PM / devfreq: Synchronize devfreq_monitor_[start/stop]
* 5457b0cbaa ACPI: extlog: fix NULL pointer dereference check
* b17cb541f1 PNP: ACPI: fix fortify warning
* 4d169334e5 ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop
* 53ab232375 audit: Send netlink ACK before setting connection in auditd_set
* 0f10c84e44 regulator: core: Only increment use_count when enable_count changes
* a5d70e22b9 debugobjects: Stop accessing objects after releasing hash bucket lock
* c128e64ae0 perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file
* 330cb5e77a x86/mce: Mark fatal MCE's page as poison to avoid panic in the kdump kernel
* de4f5ed63b powerpc/lib: Validate size for vector operations
* 027e61b866 powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE
* 33595c0c77 x86/boot: Ignore NMIs during very early boot
* b3bc07aec7 powerpc/64s: Fix CONFIG_NUMA=n build due to create_section_mapping()
* 88a28bec86 powerpc/mm: Fix build failures due to arch_reserved_kernel_pages()
* b00f275733 powerpc: Fix build error due to is_valid_bugaddr()
* b246a9a3c3 drivers/perf: pmuv3: don't expose SW_INCR event in sysfs
* 17093c32f6 arm64: irq: set the correct node for VMAP stack
* ac3ed969a4 powerpc/mm: Fix null-pointer dereference in pgtable_cache_add
* fb6c8127db x86/entry/ia32: Ensure s32 is sign extended to s64
* 59b24e6245 tick/sched: Preserve number of idle sleeps across CPU hotplug events
* f3bc406e1b mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
* ccb03ec429 spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
* 3bc801ce9d block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
* f2d3ae8cf6 gpio: eic-sprd: Clear interrupt after set the interrupt type
* fcf44c782c drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
* 22937c97c5 drm/exynos: fix accidental on-stack copy of exynos_drm_plane
* 76d1ffa908 drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33]
* 7ae053227c cpufreq: intel_pstate: Refine computation of P-state for given frequency
* 34c02fec33 cpufreq: intel_pstate: Drop redundant intel_pstate_get_hwp_cap() call
* aaa1f1a2ee ksmbd: fix global oob in ksmbd_nl_policy
* 4056ece660 btrfs: add definition for EXTENT_TREE_V2
* 796d3fad8c PM / devfreq: Fix buffer overflow in trans_stat_show
* b448de2459 mm/sparsemem: fix race in accessing memory_section->usage
* 904fafac10 mm: use __pfn_to_section() instead of open coding it
* 1b1036c60a media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
* 4cebb1edb1 ARM: dts: qcom: sdx55: fix USB SS wakeup
* 462d5a6fb2 ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts
* a98b715c94 ARM: dts: qcom: sdx55: fix pdc '#interrupt-cells'
* 57be4dd630 ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12
* 28092c1137 ARM: dts: qcom: sdx55: fix USB wakeup interrupt types
* 3efbd114b9 pipe: wakeup wr_wait after setting max_usage
* 26bfccac21 fs/pipe: move check to pipe_has_watch_queue()
* 94991728c8 bus: mhi: host: Add alignment check for event ring read pointer
* d73f63a645 bus: mhi: host: Rename "struct mhi_tre" to "struct mhi_ring_element"
* a1d62c775b PM: sleep: Fix possible deadlocks in core system-wide PM code
* d5f15888d3 PM: core: Remove unnecessary (void *) conversions
* fd8d6b04de drm/bridge: nxp-ptn3460: simplify some error checking
* 9d2a462917 drm/tidss: Fix atomic_flush check
* bcf51e8f3c drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
* b4af63da9d drm: Don't unref the same fb many times by mistake due to deadlock handling
* 4fc86c70ea gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
* e44e240d53 xfs: read only mounts with fsopen mount API are busted
* 614cc65032 firmware: arm_scmi: Check mailbox/SMT channel for consistency
* 960cf4f812 netfilter: nf_tables: reject QUEUE/DROP verdict parameters
* 70f17b48c8 netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain
* 0ac9cbe006 hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
* 99a23462fe wifi: iwlwifi: fix a memory corruption
* 9a64c7fc15 exec: Fix error handling in begin_new_exec()
* 04a0786a97 rbd: don't move requests to the running list on errors
* 0877497dc9 btrfs: don't abort filesystem when attempting to snapshot deleted subvolume
* 07beceb3e1 btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
* 5b5319e112 btrfs: don't warn if discard range is not aligned to sector
* f054f328bf btrfs: tree-checker: fix inline ref size in error messages
* 5550250f36 btrfs: ref-verify: free ref cache before clearing mount opt
* f76e961a34 btrfs: avoid copying BTRFS_ROOT_SUBVOL_DEAD flag to snapshot of subvolume being deleted
* 415fb71a9a btrfs: fix race between reading a directory and adding entries to it
* a6c2dfbfa2 btrfs: refresh dir last index during a rewinddir(3) call
* 0b04bbfd07 btrfs: set last dir index to the current last index when opening dir
* 79cf35e16d btrfs: fix infinite directory reads
* 4c24059dd3 net: fec: fix the unhandled context fault from smmu
* 5b0f2af31a fjes: fix memleaks in fjes_hw_setup
* c0d29d3033 selftests: netdevsim: fix the udp_tunnel_nic test
* af47faa6d3 net: mvpp2: clear BM pool before initialization
* 5305727ba6 net: stmmac: Wait a bit for the reset to take effect
* 022a8d0bc9 netfilter: nf_tables: validate NFPROTO_* family
* 064bccd4a9 netfilter: nf_tables: restrict anonymous set and map names to 16 bytes
* 79d4efd75e netfilter: nft_limit: reject configurations that cause integer overflow
* 53f2cd86a8 overflow: Allow mixed type arguments
* 72a7298685 net/mlx5e: fix a potential double-free in fs_any_create_groups
* c57ca114eb net/mlx5e: fix a double-free in arfs_create_groups
* cf0a8a3a89 net/mlx5: DR, Can't go to uplink vport on RX rule
* e5783345bd net/mlx5: DR, Align mlx5dv_dr API vport action with FW behavior
* 8e215c249a net/mlx5: DR, Replace local WIRE_PORT macro with the existing MLX5_VPORT_UPLINK
* fda9109e15 net/mlx5: DR, Use the right GVMI number for drop action
* 50bd41dcca ipv6: init the accept_queue's spinlocks in inet6_create
* 931366b9f2 netlink: fix potential sleeping issue in mqueue_flush_file
* fc0f8e2c93 tcp: Add memory barrier to tcp_push()
* 21a2115e0c afs: Hide silly-rename files from userspace
* aef1cb0085 tracing: Ensure visibility when inserting an element into tracing_map
* 00d1ee8e1d net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv
* c0fe2fe7a5 llc: Drop support for ETH_P_TR_802_2.
* c22044270d llc: make llc_ui_sendmsg() more robust against bonding changes
* 79eeb85c44 vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING
* 3243025112 bnxt_en: Wait for FLR to complete during probe
* d86cc6ab33 tcp: make sure init the accept_queue's spinlocks once
* 68b888d51a net/smc: fix illegal rmb_desc access in SMC-D connection dump
* bb27126aef ksmbd: Add missing set_freezable() for freezable kthread
* d7a62b3a3d ksmbd: send lease break notification on FILE_RENAME_INFORMATION
* 6cc508233e ksmbd: don't increment epoch if current state and request state are same
* 5349fd419e ksmbd: fix potential circular locking issue in smb2_set_ea()
* 9ab8935336 ksmbd: set v2 lease version on lease upgrade
* dfda2a5eb6 rename(): fix the locking of subdirectories
* b2512424c9 ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path
* 689c5f8d89 nouveau/vmm: don't set addr on the fail path to avoid warning
* 2d07a63b01 rtc: Adjust failure return code for cmos_set_alarm()
* 3ff34c00db mmc: mmc_spi: remove custom DMA mapped buffers
* 50b8b7a22e mmc: core: Use mrq.sbc in close-ended ffu
* f0bb5d185f scripts/get_abi: fix source path leak
* 4590f2077e lsm: new security_file_ioctl_compat() hook
* cdcd8df577 arm64: dts: qcom: sdm845: fix USB DP/DM HS PHY interrupts
* 8ed011c4e0 arm64: dts: qcom: sm8150: fix USB wakeup interrupt types
* aa38eb9626 arm64: dts: qcom: sdm845: fix USB wakeup interrupt types
* 121d89f0c6 arm64: dts: qcom: sc7180: fix USB wakeup interrupt types
* 33f8bdf37d async: Introduce async_schedule_dev_nocall()
* 86c8e16252 async: Split async_schedule_node_domain()
* 58031306c0 parisc/firmware: Fix F-extend for PDC addresses
* 176ed1727b bus: mhi: host: Add spinlock to protect WP access when queueing TREs
* 6e4c84316e bus: mhi: host: Drop chan lock before queuing buffers
* cdb15ac80a mips: Fix max_mapnr being uninitialized on early stages
* 473f1ae44b media: ov9734: Enable runtime PM before registering async sub-device
* 2d27a7b19c rpmsg: virtio: Free driver_override when rpmsg_remove()
* 3c1b795124 media: imx355: Enable runtime PM before registering async sub-device
* a7f580cdb4 crypto: s390/aes - Fix buffer overread in CTR mode
* 26cc6d7006 hwrng: core - Fix page fault dead lock on mmap-ed hwrng
* 4d4bf19c81 PM: hibernate: Enforce ordering during image compression/decompression
* a6fec6324f crypto: api - Disallow identical driver names
* ad23246ccf btrfs: sysfs: validate scrub_speed_max value
* cb904f5c71 ext4: allow for the last group to be marked as trimmed
* a604d5f2f9 iio:adc:ad7091r: Move exports into IIO_AD7091R namespace.
* 72a3395543 scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan()
* 226554bd27 scsi: ufs: core: Simplify power management during async scan
* 047fce4704 dmaengine: fix NULL pointer in channel unregistration function
* e44eb4ccad iio: adc: ad7091r: Enable internal vref if external vref is not supplied
* 49f322ce1f iio: adc: ad7091r: Allow users to configure device events
* 6ef852a430 iio: adc: ad7091r: Set alert bit in config register
* 81ea755b8f ksmbd: only v2 leases handle the directory
* 999daf367b ksmbd: fix UAF issue in ksmbd_tcp_new_connection()
* dd1de92687 ksmbd: validate mech token in session setup
* 65cadfb3b0 ksmbd: don't allow O_TRUNC open on read-only share
* c917b0529e ksmbd: free ppace array on error in parse_dacl

Change-Id: I5af8ed6bc3d34ce1dc6833a524e15468d4ce1bf2
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-05-30 15:24:20 +00:00
John Stultz
73bef21507 UPSTREAM: selftests: timers: Fix valid-adjtimex signed left-shift undefined behavior
[ Upstream commit 076361362122a6d8a4c45f172ced5576b2d4a50d ]

The struct adjtimex freq field takes a signed value who's units are in
shifted (<<16) parts-per-million.

Unfortunately for negative adjustments, the straightforward use of:

  freq = ppm << 16 trips undefined behavior warnings with clang:

valid-adjtimex.c:66:6: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        -499<<16,
        ~~~~^
valid-adjtimex.c:67:6: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
        -450<<16,
        ~~~~^
..

Fix it by using a multiply by (1 << 16) instead of shifting negative values
in the valid-adjtimex test case. Align the values for better readability.

Bug: 339526723
Reported-by: Lee Jones <joneslee@google.com>
Reported-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Change-Id: Ied611c13a802acf9c7a2427f0a61eb358b571a3d
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://lore.kernel.org/r/20240409202222.2830476-1-jstultz@google.com
Link: https://lore.kernel.org/lkml/0c6d4f0d-2064-4444-986b-1d1ed782135f@collabora.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 1f3484dec9)
Signed-off-by: Edward Liaw <edliaw@google.com>
2024-05-29 12:54:35 +00:00
Eric Dumazet
58719dc95f UPSTREAM: netlink: hold nlk->cb_mutex longer in __netlink_dump_start()
__netlink_dump_start() releases nlk->cb_mutex right before
calling netlink_dump() which grabs it again.

This seems dangerous, even if KASAN did not bother yet.

Add a @lock_taken parameter to netlink_dump() to let it
grab the mutex if called from netlink_recvmsg() only.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b5590270068c4324dac4a2b5a4a156e02e21339f)
Bug: 339546075
Change-Id: I29a711ea804794b556674011cbd23c5bf9a03ab6
Signed-off-by: yenchia.chen <yenchia.chen@mediatek.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-05-29 04:01:35 +00:00
Eric Dumazet
e94d70c73a UPSTREAM: netlink: annotate data-races around sk->sk_err
commit d0f95894fd upstream.

syzbot caught another data-race in netlink when
setting sk->sk_err.

Annotate all of them for good measure.

BUG: KCSAN: data-race in netlink_recvmsg / netlink_recvmsg

write to 0xffff8881613bb220 of 4 bytes by task 28147 on cpu 0:
netlink_recvmsg+0x448/0x780 net/netlink/af_netlink.c:1994
sock_recvmsg_nosec net/socket.c:1027 [inline]
sock_recvmsg net/socket.c:1049 [inline]
__sys_recvfrom+0x1f4/0x2e0 net/socket.c:2229
__do_sys_recvfrom net/socket.c:2247 [inline]
__se_sys_recvfrom net/socket.c:2243 [inline]
__x64_sys_recvfrom+0x78/0x90 net/socket.c:2243
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

write to 0xffff8881613bb220 of 4 bytes by task 28146 on cpu 1:
netlink_recvmsg+0x448/0x780 net/netlink/af_netlink.c:1994
sock_recvmsg_nosec net/socket.c:1027 [inline]
sock_recvmsg net/socket.c:1049 [inline]
__sys_recvfrom+0x1f4/0x2e0 net/socket.c:2229
__do_sys_recvfrom net/socket.c:2247 [inline]
__se_sys_recvfrom net/socket.c:2243 [inline]
__x64_sys_recvfrom+0x78/0x90 net/socket.c:2243
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x00000000 -> 0x00000016

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 28146 Comm: syz-executor.0 Not tainted 6.6.0-rc3-syzkaller-00055-g9ed22ae6be81 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231003183455.3410550-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: yenchia.chen <yenchia.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2750d7641d0825aeb1e4d3b40c627ff3e3670d24)
Bug: 339546075
Change-Id: I66f0690e8ab0d2e88f0cb0ce3b4be92907a0dcc1
Signed-off-by: yenchia.chen <yenchia.chen@mediatek.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-05-29 03:58:42 +00:00
Eric Dumazet
c0e59dab58 UPSTREAM: netlink: annotate lockless accesses to nlk->max_recvmsg_len
commit a1865f2e7d upstream.

syzbot reported a data-race in data-race in netlink_recvmsg() [1]

Indeed, netlink_recvmsg() can be run concurrently,
and netlink_dump() also needs protection.

[1]
BUG: KCSAN: data-race in netlink_recvmsg / netlink_recvmsg

read to 0xffff888141840b38 of 8 bytes by task 23057 on cpu 0:
netlink_recvmsg+0xea/0x730 net/netlink/af_netlink.c:1988
sock_recvmsg_nosec net/socket.c:1017 [inline]
sock_recvmsg net/socket.c:1038 [inline]
__sys_recvfrom+0x1ee/0x2e0 net/socket.c:2194
__do_sys_recvfrom net/socket.c:2212 [inline]
__se_sys_recvfrom net/socket.c:2208 [inline]
__x64_sys_recvfrom+0x78/0x90 net/socket.c:2208
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

write to 0xffff888141840b38 of 8 bytes by task 23037 on cpu 1:
netlink_recvmsg+0x114/0x730 net/netlink/af_netlink.c:1989
sock_recvmsg_nosec net/socket.c:1017 [inline]
sock_recvmsg net/socket.c:1038 [inline]
____sys_recvmsg+0x156/0x310 net/socket.c:2720
___sys_recvmsg net/socket.c:2762 [inline]
do_recvmmsg+0x2e5/0x710 net/socket.c:2856
__sys_recvmmsg net/socket.c:2935 [inline]
__do_sys_recvmmsg net/socket.c:2958 [inline]
__se_sys_recvmmsg net/socket.c:2951 [inline]
__x64_sys_recvmmsg+0xe2/0x160 net/socket.c:2951
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x0000000000000000 -> 0x0000000000001000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 23037 Comm: syz-executor.2 Not tainted 6.3.0-rc4-syzkaller-00195-g5a57b48fdfcb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023

Fixes: 9063e21fb0 ("netlink: autosize skb lengthes")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230403214643.768555-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: yenchia.chen <yenchia.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7cff4103be7c402ecc3e7bf8f95a64089e3c91b8)
Bug: 339546075
Change-Id: I13f81332f05f2c5bc14de00bfa3de0925162af2b
Signed-off-by: yenchia.chen <yenchia.chen@mediatek.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-05-29 03:57:45 +00:00
Paul Lawrence
8d122b23ed ANDROID: incremental-fs: Make work with 16k pages
Bug: 260919895
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ia4fbb6011930b085bc00a36851e9b0e8559d3dc5
(cherry picked from commit 5ac10739bcf2dae9220a7a39392aa41235bc64c2)
2024-05-28 22:30:52 +00:00
Yifan Hong
b7d4cf60e7 Revert "BACKPORT: FROMGIT: module: allow UNUSED_KSYMS_WHITELIST ..."
Revert submission 3101887-android14-ksyms-wl

Reason for revert: Restore green in release builds

Reverted changes: /q/submissionid:3101887-android14-ksyms-wl

Change-Id: Ia6c694be720c7a07abdfee6a4720a4518ea59141
2024-05-28 17:13:06 +00:00
Yifan Hong
acacba8bfa BACKPORT: FROMGIT: module: allow UNUSED_KSYMS_WHITELIST to be relative against objtree.
If UNUSED_KSYMS_WHITELIST is a file generated
before Kbuild runs, and the source tree is in
a read-only filesystem, the developer must put
the file somewhere and specify an absolute
path to UNUSED_KSYMS_WHITELIST. This worked,
but if IKCONFIG=y, an absolute path is embedded
into .config and eventually into vmlinux, causing
the build to be less reproducible when building
on a different machine.

This patch makes the handling of
UNUSED_KSYMS_WHITELIST to be similar to
MODULE_SIG_KEY.

First, check if UNUSED_KSYMS_WHITELIST is an
absolute path, just as before this patch. If so,
use the path as is.

If it is a relative path, use wildcard to check
the existence of the file below objtree first.
If it does not exist, fall back to the original
behavior of adding $(srctree)/ before the value.

After this patch, the developer can put the generated
file in objtree, then use a relative path against
objtree in .config, eradicating any absolute paths
that may be evaluated differently on different machines.

Signed-off-by: Yifan Hong <elsk@google.com>
Reviewed-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

(cherry picked from commit a2e3c811938b4902725e259c03b2d6c539613992
 https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-next)
Bug: 333769605

Change-Id: I0696ac8f686329795034ada5a4587af4ecbb774f
[elsk: apply change to gen_autoksyms.sh instead because
 CONFIG_UNUSED_KSYMS_WHITELIST is parsed there. Revert change
 to Makefile.modpost. Edit init/Kconfig instead of kernel/module/Kconfig
 because UNUSED_KSYMS_WHITELIST is defined there.]
Bug: 342390208
Signed-off-by: Yifan Hong <elsk@google.com>
2024-05-28 16:18:05 +00:00
Robin Hsu
d19f3c553a ANDROID: export one function for mm metrics
export function for sysfs node formating

Bug: 299190787
Change-Id: I71e6a0815efa8df99d036bf457b8a0081999f3de
Signed-off-by: Robin Hsu <robinhsu@google.com>
2024-05-28 12:17:47 +00:00
Kyle Tso
de30e28ba8 FROMLIST: usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state
Similar to what fixed in Commit a6fe37f428c1 ("usb: typec: tcpm: Skip
hard reset when in error recovery"), the handling of the received Hard
Reset has to be skipped during TOGGLING state.

[ 4086.021288] VBUS off
[ 4086.021295] pending state change SNK_READY -> SNK_UNATTACHED @ 650 ms [rev2 NONE_AMS]
[ 4086.022113] VBUS VSAFE0V
[ 4086.022117] state change SNK_READY -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 4086.022447] VBUS off
[ 4086.022450] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 4086.023060] VBUS VSAFE0V
[ 4086.023064] state change SNK_UNATTACHED -> SNK_UNATTACHED [rev2 NONE_AMS]
[ 4086.023070] disable BIST MODE TESTDATA
[ 4086.023766] disable vbus discharge ret:0
[ 4086.023911] Setting usb_comm capable false
[ 4086.028874] Setting voltage/current limit 0 mV 0 mA
[ 4086.028888] polarity 0
[ 4086.030305] Requesting mux state 0, usb-role 0, orientation 0
[ 4086.033539] Start toggling
[ 4086.038496] state change SNK_UNATTACHED -> TOGGLING [rev2 NONE_AMS]

// This Hard Reset is unexpected
[ 4086.038499] Received hard reset
[ 4086.038501] state change TOGGLING -> HARD_RESET_START [rev2 HARD_RESET]

Fixes: f0690a25a1 ("staging: typec: USB Type-C Port Manager (tcpm)")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Tso <kyletso@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Change-Id: Icfa144f370bd87670df1cd71f247a3528ab4c591
Bug: 331356545
Link: https://lore.kernel.org/all/20240520154858.1072347-1-kyletso@google.com/
2024-05-22 12:10:42 +00:00
Carlos Llamas
fb512eac3c ANDROID: binder: fix ptrdiff_t printk-format issue
The correct printk format specifier when calculating buffer offsets
should be "%tx" as it is a pointer difference (a.k.a ptrdiff_t). This
fixes some W=1 build warnings reported by the kernel test robot.

Bug: 329799092
Fixes: 63f7ddea2e ("ANDROID: binder: fix KMI-break due to address type change")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401100511.A4BKMwoq-lkp@intel.com/
Change-Id: Iaa87433897b507c47fe8601464445cb6de4b61db
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-05-17 17:32:17 +00:00
hulianqin
2526c59f3f ANDROID: usb: Optimize the problem of slow transfer rate in USB accessory mode
The data transfer rate using Google Restore in USB3.2 mode is slower,
only about 140MB/s at 5Gbps.

The bMaxBurst is not set, and num_fifos in
dwc3_gadget_resize_tx_fifosis 1, which results
in only 131btye of dwc3 ram space being allocated to ep.

Modify bMaxBurst to 6.
The 5Gbps rate increases from 140MB/s to 350MB/s.
The 10Gbps rate is increased from 220MB/s to 500MB/s.

Bug: 340049583
BUG: 341178033

Change-Id: I5710af32c72d0b57afaecc00c4f0909af4b9a299
Signed-off-by: Lianqin Hu <hulianqin@vivo.corp-partner.google.com>
Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
(cherry picked from commit 23f2a9f5f1)
Signed-off-by: Lianqin Hu <hulianqin@vivo.com>
2024-05-17 02:31:30 +00:00
RD Babiera
5981994114 UPSTREAM: usb: typec: tcpm: clear pd_event queue in PORT_RESET
When a Fast Role Swap control message attempt results in a transition
to ERROR_RECOVERY, the TCPC can still queue a TCPM_SOURCING_VBUS event.

If the event is queued but processed after the tcpm_reset_port() call
in the PORT_RESET state, then the following occurs:
1. tcpm_reset_port() calls tcpm_init_vbus() to reset the vbus sourcing and
sinking state
2. tcpm_pd_event_handler() turns VBUS on before the port is in the default
state.
3. The port resolves as a sink. In the SNK_DISCOVERY state,
tcpm_set_charge() cannot set vbus to charge.

Clear pd events within PORT_RESET to get rid of non-applicable events.

Fixes: b17dd57118 ("staging: typec: tcpm: Improve role swap with non PD capable partners")
Cc: stable@vger.kernel.org
Signed-off-by: RD Babiera <rdbabiera@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240423202715.3375827-2-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 311127232
(cherry picked from commit bf20c69cf3cf9c6445c4925dd9a8a6ca1b78bfdf)
Signed-off-by: RD Babiera <rdbabiera@google.com>
Change-Id: I9b27d040d0acdeb2af74fd3fe90d246b864b5141
2024-05-14 10:59:17 +00:00
RD Babiera
1167a6a15c BACKPORT: usb: typec: tcpm: enforce ready state when queueing alt mode vdm
Before sending Enter Mode for an Alt Mode, there is a gap between Discover
Modes and the Alt Mode driver queueing the Enter Mode VDM for the port
partner to send a message to the port.

If this message results in unregistering Alt Modes such as in a DR_SWAP,
then the following deadlock can occur with respect to the DisplayPort Alt
Mode driver:
1. The DR_SWAP state holds port->lock. Unregistering the Alt Mode driver
results in a cancel_work_sync() that waits for the current dp_altmode_work
to finish.
2. dp_altmode_work makes a call to tcpm_altmode_enter. The deadlock occurs
because tcpm_queue_vdm_unlock attempts to hold port->lock.

Before attempting to grab the lock, ensure that the port is in a state
vdm_run_state_machine can run in. Alt Mode unregistration will not occur
in these states.

Fixes: 03eafcfb60 ("usb: typec: tcpm: Add tcpm_queue_vdm_unlocked() helper")
Cc: stable@vger.kernel.org
Signed-off-by: RD Babiera <rdbabiera@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240423202356.3372314-2-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 333787869
(cherry picked from commit cdc9946ea6377e8e214b135ccc308c5e514ba25f)
[rd: removed SRC_VDM_IDENTITY_REQUEST check, state not defined in branch]
Signed-off-by: RD Babiera <rdbabiera@google.com>
Change-Id: I8018d1fdc294885ae609b6e45e9bf6ab190897b9
2024-05-14 09:28:40 +00:00
Chao Yu
ab87c12aa2 BACKPORT: f2fs: sysfs: support discard_io_aware
It gives a way to enable/disable IO aware feature for background
discard, so that we can tune background discard more precisely
based on undiscard condition. e.g. force to disable IO aware if
there are large number of discard extents, and discard IO may
always be interrupted by frequent common IO.

Bug:340148900
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit d346fa09abff46988de9267b67b6900d9913d5a2)
Change-Id: Icff98ecc1f9e3a294afa08cfe2e8ba4e9f7fdaf3
2024-05-14 02:00:08 +00:00
qinglin.li
1f9a0ccd86 ANDROID: GKI: Update symbol list for Amlogic
1 function symbol(s) added
  'int thermal_zone_bind_cooling_device(struct thermal_zone_device*, int, struct thermal_cooling_device*, unsigned long, unsigned long, unsigned int)'

Bug: 339356479
Change-Id: Ic83d54a0be3156194b4bebf78ca4cfcc2ef30290
Signed-off-by: Qinglin Li <qinglin.li@amlogic.com>
2024-05-08 17:33:02 +00:00
Vincent Donnefort
62000bb037 ANDROID: KVM: arm64: wait_for_initramfs for pKVM module loading procfs
Of course, the initramfs needs to be ready before procfs can be
mounted... in the initramfs. While at it, only mount if a pKVM module
must be loaded and only print a warning in case of failure.

Bug: 278749606
Bug: 301483379
Bug: 331152809
Change-Id: Ie56bd26d4575f69cb1f06ba6317a098649f6da44
Reported-by: Mankyum Kim <mankyum.kim@samsung-slsi.corp-partner.google.com>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
(cherry picked from commit 7d5843b59548672c23c977b4666c3779d31695fb)
2024-05-08 13:50:22 +00:00
Badhri Jagan Sridharan
d5eef65564 BACKPORT: FROMGIT: usb: typec: tcpm: Check for port partner validity before consuming it
typec_register_partner() does not guarantee partner registration
to always succeed. In the event of failure, port->partner is set
to the error value or NULL. Given that port->partner validity is
not checked, this results in the following crash:

Unable to handle kernel NULL pointer dereference at virtual address 00000000000003c0
 pc : run_state_machine+0x1bc8/0x1c08
 lr : run_state_machine+0x1b90/0x1c08
..
 Call trace:
   run_state_machine+0x1bc8/0x1c08
   tcpm_state_machine_work+0x94/0xe4
   kthread_worker_fn+0x118/0x328
   kthread+0x1d0/0x23c
   ret_from_fork+0x10/0x20

To prevent the crash, check for port->partner validity before
derefencing it in all the call sites.

Cc: stable@vger.kernel.org
Fixes: c97cd0b4b5 ("usb: typec: tcpm: set initial svdm version based on pd revision")
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240427202812.3435268-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 321849121
(cherry picked from commit ae11f04b452b5205536e1c02d31f8045eba249dd
https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/usb
usb-linus)
Change-Id: I01510c86e147b3011afc5d475fc1dc38d2636a60
Signed-off-by: Zheng Pan <zhengpan@google.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2024-05-07 14:53:15 +00:00
Nathan Chancellor
4dd58977f2 BACKPORT: FROMGIT: kbuild: Remove support for Clang's ThinLTO caching
There is an issue in clang's ThinLTO caching (enabled for the kernel via
'--thinlto-cache-dir') with .incbin, which the kernel occasionally uses
to include data within the kernel, such as the .config file for
/proc/config.gz. For example, when changing the .config and rebuilding
vmlinux, the copy of .config in vmlinux does not match the copy of
.config in the build folder:

  $ echo 'CONFIG_LTO_NONE=n
  CONFIG_LTO_CLANG_THIN=y
  CONFIG_IKCONFIG=y
  CONFIG_HEADERS_INSTALL=y' >kernel/configs/repro.config

  $ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 clean defconfig repro.config vmlinux
  ...

  $ grep CONFIG_HEADERS_INSTALL .config
  CONFIG_HEADERS_INSTALL=y

  $ scripts/extract-ikconfig vmlinux | grep CONFIG_HEADERS_INSTALL
  CONFIG_HEADERS_INSTALL=y

  $ scripts/config -d HEADERS_INSTALL

  $ make -kj"$(nproc)" ARCH=x86_64 LLVM=1 vmlinux
  ...
    UPD     kernel/config_data
    GZIP    kernel/config_data.gz
    CC      kernel/configs.o
  ...
    LD      vmlinux
  ...

  $ grep CONFIG_HEADERS_INSTALL .config
  # CONFIG_HEADERS_INSTALL is not set

  $ scripts/extract-ikconfig vmlinux | grep CONFIG_HEADERS_INSTALL
  CONFIG_HEADERS_INSTALL=y

Without '--thinlto-cache-dir' or when using full LTO, this issue does
not occur.

Benchmarking incremental builds on a few different machines with and
without the cache shows a 20% increase in incremental build time without
the cache when measured by touching init/main.c and running 'make all'.

ARCH=arm64 defconfig + CONFIG_LTO_CLANG_THIN=y on an arm64 host:

  Benchmark 1: With ThinLTO cache
    Time (mean ± σ):     56.347 s ±  0.163 s    [User: 83.768 s, System: 24.661 s]
    Range (min … max):   56.109 s … 56.594 s    10 runs

  Benchmark 2: Without ThinLTO cache
    Time (mean ± σ):     67.740 s ±  0.479 s    [User: 718.458 s, System: 31.797 s]
    Range (min … max):   67.059 s … 68.556 s    10 runs

  Summary
    With ThinLTO cache ran
      1.20 ± 0.01 times faster than Without ThinLTO cache

ARCH=x86_64 defconfig + CONFIG_LTO_CLANG_THIN=y on an x86_64 host:

  Benchmark 1: With ThinLTO cache
    Time (mean ± σ):     85.772 s ±  0.252 s    [User: 91.505 s, System: 8.408 s]
    Range (min … max):   85.447 s … 86.244 s    10 runs

  Benchmark 2: Without ThinLTO cache
    Time (mean ± σ):     103.833 s ±  0.288 s    [User: 232.058 s, System: 8.569 s]
    Range (min … max):   103.286 s … 104.124 s    10 runs

  Summary
    With ThinLTO cache ran
      1.21 ± 0.00 times faster than Without ThinLTO cache

While it is unfortunate to take this performance improvement off the
table, correctness is more important. If/when this is fixed in LLVM, it
can potentially be brought back in a conditional manner. Alternatively,
a developer can just disable LTO if doing incremental compiles quickly
is important, as a full compile cycle can still take over a minute even
with the cache and it is unlikely that LTO will result in functional
differences for a kernel change.

Cc: stable@vger.kernel.org
Fixes: dc5723b02e ("kbuild: add support for Clang LTO")
Reported-by: Yifan Hong <elsk@google.com>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2021
Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
Closes: https://lore.kernel.org/r/20220327115526.cc4b0ff55fc53c97683c3e4d@kernel.org/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Bug: 312268956
Bug: 335301039
Change-Id: Iace492db67f28e172427669b1b7eb6a8c44dd3aa
(cherry picked from commit aba091547ef6159d52471f42a3ef531b7b660ed8
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
[elsk: Resolved minor conflict in Makefile]
Signed-off-by: Yifan Hong <elsk@google.com>
2024-05-06 22:21:09 +00:00
Kalesh Singh
2a64b7fe17 ANDROID: 16K: Fix call to show_pad_maps_fn()
The call should be for printing maps not smaps; fix this.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: I8356b9e93fa2a300cb8bcd66fed857d42e8bfdca
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-01 19:55:54 +00:00
Kalesh Singh
596b6507c3 ANDROID: 16K: Fix show maps CFI failure
If the kernel is built CONFIG_CFI_CLANG=y, reading smaps
may cause a panic. This is due to a failed CFI check; which
is triggered becuase the signature of the function pointer for
printing smaps padding VMAs does not match exactly with that
for show_smap().

Fix this by casting the function pointer to the expected type
based on whether printing maps or smaps padding.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: I65564a547dacbc4131f8557344c8c96e51f90cd5
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-05-01 16:35:25 +00:00
Kalesh Singh
d83231efe4 ANDROID: 16K: Handle pad VMA splits and merges
In some cases a VMA with padding representation may be split, and
therefore the padding flags must be updated accordingly.

There are 3 cases to handle:

Given:
    | DDDDPPPP |

where:
    - D represents 1 page of data;
    - P represents 1 page of padding;
    - | represents the boundaries (start/end) of the VMA

1) Split exactly at the padding boundary

    | DDDDPPPP | --> | DDDD | PPPP |

    - Remove padding flags from the first VMA.
    - The second VMA is all padding

2) Split within the padding area

    | DDDDPPPP | --> | DDDDPP | PP |

    - Subtract the length of the second VMA from the first VMA's
      padding.
    - The second VMA is all padding, adjust its padding length (flags)

3) Split within the data area

    | DDDDPPPP | --> | DD | DDPPPP |

    - Remove padding flags from the first VMA.
    - The second VMA is has the same padding as from before the split.

To simplify the semantics merging of padding VMAs is not allowed.

If a split produces a VMA that is entirely padding, show_[s]maps()
only outputs the padding VMA entry (as the data entry is of length 0).

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: Ie2628ced5512e2c7f8af25fabae1f38730c8bb1a
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-04-29 23:44:57 +00:00
Kalesh Singh
19d6e7eb47 ANDROID: 16K: madvise_vma_pad_pages: Remove filemap_fault check
Some file systems like F2FS use a custom filemap_fault ops. Remove this
check, as checking vm_file is sufficient.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: Id6a584d934f06650c0a95afd1823669fc77ba2c2
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-04-29 23:44:57 +00:00
Kalesh Singh
ae44e8dac8 ANDROID: 16K: Only madvise padding from dynamic linker context
Only preform padding advise from the execution context on bionic's
dynamic linker. This ensures that madvise() doesn't have unwanted
side effects.

Also rearrange the order of fail checks in madvise_vma_pad_pages()
in order of ascending cost.

Bug: 330117029
Bug: 327600007
Bug: 330767927
Bug: 328266487
Bug: 329803029
Change-Id: I3e05b8780c6eda78007f86b613f8c11dd18ac28f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-04-29 23:44:57 +00:00
Qais Yousef
ae67f18944 ANDROID: Enable CONFIG_LAZY_RCU in x86 gki_defconfig
It is still disabled by default. Must specify
rcutree.android_enable_rcu_lazy and rcu_nocbs=all in boot time parameter
to actually enable it.

Bug: 258241771
Change-Id: Ic9e15b846d58ffa3d5dd81842c568da79352ff2d
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Qais Yousef
d38091b4ff ANDROID: Enable CONFIG_LAZY_RCU in arm64 gki_defconfig
It is still disabled by default. Must specify
rcutree.android_enable_rcu_lazy and rcu_nocbs=all in boot time parameter
to actually enable it.

Bug: 258241771
Change-Id: I11c920aa5edde2fc42ab54245cd198eb8cb47616
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Qais Yousef
37b02c190c FROMLIST: rcu: Provide a boot time parameter to control lazy RCU
To allow more flexible arrangements while still provide a single kernel
for distros, provide a boot time parameter to enable/disable lazy RCU.

Specify:

	rcutree.enable_rcu_lazy=[y|1|n|0]

Which also requires

	rcu_nocbs=all

at boot time to enable/disable lazy RCU.

To disable it by default at build time when CONFIG_RCU_LAZY=y, the new
CONFIG_RCU_LAZY_DEFAULT_OFF can be used.

Bug: 258241771
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Tested-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/lkml/20231203011252.233748-1-qyousef@layalina.io/
[Fix trivial conflicts rejecting newer code that doesn't exist on 5.15]
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: Ib5585ae717a2ba7749f2802101b785c4e5de8a90
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
4adb60810c ANDROID: rcu: Add a minimum time for marking boot as completed
On many systems, a great deal of boot (in userspace) happens after the
kernel thinks the boot has completed. It is difficult to determine if
the system has really booted from the kernel side. Some features like
lazy-RCU can risk slowing down boot time if, say, a callback has been
added that the boot synchronously depends on. Further expedited callbacks
can get unexpedited way earlier than it should be, thus slowing down
boot (as shown in the data below).

For these reasons, this commit adds a config option
'CONFIG_RCU_BOOT_END_DELAY' and a boot parameter rcupdate.boot_end_delay.
Userspace can also make RCU's view of the system as booted, by writing the
time in milliseconds to: /sys/module/rcupdate/parameters/android_rcu_boot_end_delay
Or even just writing a value of 0 to this sysfs node.
However, under no circumstance will the boot be allowed to end earlier
than just before init is launched.

The default value of CONFIG_RCU_BOOT_END_DELAY is chosen as 15s. This
suites ChromeOS and also a PREEMPT_RT system below very well, which need
no config or parameter changes, and just a simple application of this
patch. A system designer can also choose a specific value here to keep
RCU from marking boot completion.  As noted earlier, RCU's perspective
of the system as booted will not be marker until at least
android_rcu_boot_end_delay milliseconds have passed or an update is made
via writing a small value (or 0) in milliseconds to:
/sys/module/rcupdate/parameters/android_rcu_boot_end_delay.

One side-effect of this patch is, there is a risk that a real-time workload
launched just after the kernel boots will suffer interruptions due to expedited
RCU, which previous ended just before init was launched. However, to mitigate
such an issue (however unlikely), the user should either tune
CONFIG_RCU_BOOT_END_DELAY to a smaller value than 15 seconds or write a value
of 0 to /sys/module/rcupdate/parameters/android_rcu_boot_end_delay, once userspace
boots, and before launching the real-time workload.

Qiuxu also noted impressive boot-time improvements with earlier version
of patch. An excerpt from the data he shared:

1) Testing environment:
    OS            : CentOS Stream 8 (non-RT OS)
    Kernel     : v6.2
    Machine : Intel Cascade Lake server (2 sockets, each with 44 logical threads)
    Qemu  args  : -cpu host -enable-kvm, -smp 88,threads=2,sockets=2, …

2) OS boot time definition:
    The time from the start of the kernel boot to the shell command line
    prompt is shown from the console. [ Different people may have
    different OS boot time definitions. ]

3) Measurement method (very rough method):
    A timer in the kernel periodically prints the boot time every 100ms.
    As soon as the shell command line prompt is shown from the console,
    we record the boot time printed by the timer, then the printed boot
    time is the OS boot time.

4) Measured OS boot time (in seconds)
   a) Measured 10 times w/o this patch:
        8.7s, 8.4s, 8.6s, 8.2s, 9.0s, 8.7s, 8.8s, 9.3s, 8.8s, 8.3s
        The average OS boot time was: ~8.7s

   b) Measure 10 times w/ this patch:
        8.5s, 8.2s, 7.6s, 8.2s, 8.7s, 8.2s, 7.8s, 8.2s, 9.3s, 8.4s
        The average OS boot time was: ~8.3s.

(CHROMIUM tag rationale: Submitted upstream but got lots of pushback as
it may harm a PREEMPT_RT system -- the concern is VERY theoretical and
this improves things for ChromeOS. Plus we are not a PREEMPT_RT system.
So I am strongly suggesting this mostly simple change for ChromeOS.)

Bug: 258241771
Bug: 268129466
Test: boot
Tested-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Change-Id: Ibd262189d7f92dbcc57f1508efe90fcfba95a6cc
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4350228
Commit-Queue: Joel Fernandes <joelaf@google.com>
Commit-Queue: Vineeth Pillai <vineethrp@google.com>
Tested-by: Vineeth Pillai <vineethrp@google.com>
Tested-by: Joel Fernandes <joelaf@google.com>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
(cherry picked from commit 7968079ec77b320ee9d4115fe13048a8f7afbc02)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style. Prefix boot param with android_]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Uladzislau Rezki (Sony)
16ea06fe44 UPSTREAM: rcu/kvfree: Move need_offload_krc() out of krcp->lock
The need_offload_krc() function currently holds the krcp->lock in order
to safely check krcp->head.  This commit removes the need for this lock
in that function by updating the krcp->head pointer using WRITE_ONCE()
macro so that readers can carry out lockless loads of that pointer.

Bug: 258241771
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 8fc5494ad5)
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: Iddde5ec15e8574216abc95d8c64efa5c66868508
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
5d1a3986c2 UPSTREAM: rcu/kfree: Fix kfree_rcu_shrink_count() return value
As per the comments in include/linux/shrinker.h, .count_objects callback
should return the number of freeable items, but if there are no objects
to free, SHRINK_EMPTY should be returned. The only time 0 is returned
should be when we are unable to determine the number of objects, or the
cache should be skipped for another reason.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 3826909635)

Bug: 258241771
Bug: 222463781
Test: CQ
Change-Id: I5cb380fceaccc85971a47773d9058f0ea044c6dd
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4332178
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
(cherry picked from commit 3243f1e22bf915c9b805a96cc4a8cbc03ed5d7a8)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Uladzislau Rezki (Sony)
88587c1838 UPSTREAM: rcu/kvfree: Update KFREE_DRAIN_JIFFIES interval
Currently the monitor work is scheduled with a fixed interval of HZ/20,
which is roughly 50 milliseconds. The drawback of this approach is
low utilization of the 512 page slots in scenarios with infrequence
kvfree_rcu() calls.  For example on an Android system:

<snip>
  kworker/3:3-507     [003] ....   470.286305: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000d0f0dde5 nr_records=6
  kworker/6:1-76      [006] ....   470.416613: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000ea0d6556 nr_records=1
  kworker/6:1-76      [006] ....   470.416625: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000003e025849 nr_records=9
  kworker/3:3-507     [003] ....   471.390000: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000815a8713 nr_records=48
  kworker/1:1-73      [001] ....   471.725785: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000fda9bf20 nr_records=3
  kworker/1:1-73      [001] ....   471.725833: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000a425b67b nr_records=76
  kworker/0:4-1411    [000] ....   472.085673: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000007996be9d nr_records=1
  kworker/0:4-1411    [000] ....   472.085728: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000d0f0dde5 nr_records=5
  kworker/6:1-76      [006] ....   472.260340: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x0000000065630ee4 nr_records=102
<snip>

In many cases, out of 512 slots, fewer than 10 were actually used.
In order to improve batching and make utilization more efficient this
commit sets a drain interval to a fixed 5-seconds interval. Floods are
detected when a page fills quickly, and in that case, the reclaim work
is re-scheduled for the next scheduling-clock tick (jiffy).

After this change:

<snip>
  kworker/7:1-371     [007] ....  5630.725708: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000005ab0ffb3 nr_records=121
  kworker/7:1-371     [007] ....  5630.989702: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x0000000060c84761 nr_records=47
  kworker/7:1-371     [007] ....  5630.989714: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000000babf308 nr_records=510
  kworker/7:1-371     [007] ....  5631.553790: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000bb7bd0ef nr_records=169
  kworker/7:1-371     [007] ....  5631.553808: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x0000000044c78753 nr_records=510
  kworker/5:6-9428    [005] ....  5631.746102: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000d98519aa nr_records=123
  kworker/4:7-9434    [004] ....  5632.001758: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x00000000526c9d44 nr_records=322
  kworker/4:7-9434    [004] ....  5632.002073: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000002c6a8afa nr_records=185
  kworker/7:1-371     [007] ....  5632.277515: rcu_invoke_kfree_bulk_callback: rcu_preempt bulk=0x000000007f4a962f nr_records=510
<snip>

Here, all but one of the cases, more than one hundreds slots were used,
representing an order-of-magnitude improvement.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 51824b780b)

Bug: 258241771
Bug: 222463781
Test: CQ
Change-Id: I4635ba0dbece4e029d5271ef3950b8eaa1ae5e81
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4332177
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
(cherry picked from commit b1bf359877e084383be107bf0008d58d0a6b15e3)
[Conflict due to 71cf9c9835 adding a new
function in the same location.
Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
5b47d8411d UPSTREAM: rcu/kvfree: Remove useless monitor_todo flag
monitor_todo is not needed as the work struct already tracks
if work is pending. Just use that to know if work is pending
using schedule_delayed_work() helper.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
(cherry picked from commit 82d26c36cc)

Bug: 258241771
Bug: 222463781
Test: CQ
Change-Id: I4c13f89da735a628a5030ab55a13e338b97da4b8
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4332176
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
(cherry picked from commit bb867be28d6a70b36ff1d6563f794c489072ab7e)
[Minor conflict with 71cf9c9835 where it
added a new function in the same location.
Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Uladzislau Rezki
84828604c7 UPSTREAM: scsi/scsi_error: Use call_rcu_hurry() instead of call_rcu()
Earlier commits in this series allow battery-powered systems to build
their kernels with the default-disabled CONFIG_RCU_LAZY=y Kconfig option.
This Kconfig option causes call_rcu() to delay its callbacks in order
to batch them.  This means that a given RCU grace period covers more
callbacks, thus reducing the number of grace periods, in turn reducing
the amount of energy consumed, which increases battery lifetime which
can be a very good thing.  This is not a subtle effect: In some important
use cases, the battery lifetime is increased by more than 10%.

This CONFIG_RCU_LAZY=y option is available only for CPUs that offload
callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot
parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y.

Delaying callbacks is normally not a problem because most callbacks do
nothing but free memory.  If the system is short on memory, a shrinker
will kick all currently queued lazy callbacks out of their laziness,
thus freeing their memory in short order.  Similarly, the rcu_barrier()
function, which blocks until all currently queued callbacks are invoked,
will also kick lazy callbacks, thus enabling rcu_barrier() to complete
in a timely manner.

However, there are some cases where laziness is not a good option.
For example, synchronize_rcu() invokes call_rcu(), and blocks until
the newly queued callback is invoked.  It would not be a good for
synchronize_rcu() to block for ten seconds, even on an idle system.
Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of
call_rcu().  The arrival of a non-lazy call_rcu_hurry() callback on a
given CPU kicks any lazy callbacks that might be already queued on that
CPU.  After all, if there is going to be a grace period, all callbacks
might as well get full benefit from it.

Yes, this could be done the other way around by creating a
call_rcu_lazy(), but earlier experience with this approach and
feedback at the 2022 Linux Plumbers Conference shifted the approach
to call_rcu() being lazy with call_rcu_hurry() for the few places
where laziness is inappropriate.

And another call_rcu() instance that cannot be lazy is the one in the
scsi_eh_scmd_add() function.  Leaving this instance lazy results in
unacceptably slow boot times.

Therefore, make scsi_eh_scmd_add() use call_rcu_hurry() in order to
revert to the old behavior.

[ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ]

Bug: 258241771
Bug: 222463781
Test: CQ
Tested-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Change-Id: I95bba865e582b0a12b1c09ba1f0bd4f897401c07
Signed-off-by: Uladzislau Rezki <urezki@gmail.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: <linux-scsi@vger.kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 54d87b0a0c)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318056
Commit-Queue: Joel Fernandes <joelaf@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Tested-by: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 5578f9ac27d25e3e57a5b9c4cf0346cfc5162994)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
a4124a21b1 ANDROID: rxrpc: Use call_rcu_hurry() instead of call_rcu()
call_rcu() changes to save power may cause slowness. Use the
call_rcu_hurry() API instead which reverts to the old behavior.

We find this via inspection that the RCU callback does a wakeup of a
thread. This usually indicates that something is waiting on it. To be
safe, let us use call_rcu_hurry() here instead.

[ joel: Upstream is rewriting this code, so I am merging this as a CHROMIUM
  patch. There is no harm in including it.
  Link: https://lore.kernel.org/rcu/658624.1669849522@warthog.procyon.org.uk/#t ]

Bug: 258241771
Bug: 222463781
Test: CQ
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Change-Id: Iaadfe2f9db189489915828c6f2f74522f4b90ea3
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3965078
Reviewed-by: Ross Zwisler <zwisler@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318055
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
(cherry picked from commit 1f98f32393f83d14bc290fef06d5b3132bee23e0)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Eric Dumazet
930bdc0924 UPSTREAM: net: devinet: Reduce refcount before grace period
Currently, the inetdev_destroy() function waits for an RCU grace period
before decrementing the refcount and freeing memory. This causes a delay
with a new RCU configuration that tries to save power, which results in the
network interface disappearing later than expected. The resulting delay
causes test failures on ChromeOS.

Refactor the code such that the refcount is freed before the grace period
and memory is freed after. With this a ChromeOS network test passes that
does 'ip netns del' and polls for an interface disappearing, now passes.

Bug: 258241771
Bug: 222463781
Test: CQ
Reported-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Change-Id: I98b13c5a8fb9696c1111219d774cf91c8b14b4c5
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: David Ahern <dsahern@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 9d40c84cf5)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318054
Tested-by: Joel Fernandes <joelaf@google.com>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Commit-Queue: Joel Fernandes <joelaf@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
(cherry picked from commit 3c0f4bb182d6b0be5424947b53019e92bea8b38c)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
706e751b33 UPSTREAM: rcu: Disable laziness if lazy-tracking says so
During suspend, we see failures to suspend 1 in 300-500 suspends.
Looking closer, it appears that asynchronous RCU callbacks are being
queued as lazy even though synchronous callbacks are expedited. These
delays appear to not be very welcome by the suspend/resume code as
evidenced by these occasional suspend failures.

This commit modifies call_rcu() to check if rcu_async_should_hurry(),
which will return true if we are in suspend or in-kernel boot.

[ paulmck: Alphabetize local variables. ]

Ignoring the lazy hint makes the 3000 suspend/resume cycles pass
reliably on a 12th gen 12-core Intel CPU, and there is some evidence
that it also slightly speeds up boot performance.

Bug: 258241771
Bug: 222463781
Test: CQ
Fixes: 3cb278e73b ("rcu: Make call_rcu() lazy to save power")
Change-Id: I4cfe6f43de8bae9a6c034831c79d9773199d6d29
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit cf7066b97e)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318052
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Tested-by: Joel Fernandes <joelaf@google.com>
Commit-Queue: Joel Fernandes <joelaf@google.com>
(cherry picked from commit e59686da91b689d3771a09f3eae37db5f40d3f75)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
8568593719 UPSTREAM: rcu: Track laziness during boot and suspend
Boot and suspend/resume should not be slowed down in kernels built with
CONFIG_RCU_LAZY=y.  In particular, suspend can sometimes fail in such
kernels.

This commit therefore adds rcu_async_hurry(), rcu_async_relax(), and
rcu_async_should_hurry() functions that track whether or not either
a boot or a suspend/resume operation is in progress.  This will
enable a later commit to refrain from laziness during those times.

Export rcu_async_should_hurry(), rcu_async_hurry(), and rcu_async_relax()
for later use by rcutorture.

[ paulmck: Apply feedback from Steve Rostedt. ]

Bug: 258241771
Bug: 222463781
Test: CQ
Fixes: 3cb278e73b ("rcu: Make call_rcu() lazy to save power")
Change-Id: Ieb2f2d484a33cfbd71f71c8e3dbcfc05cd7efe8c
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 6efdda8bec)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318051
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
Tested-by: Joel Fernandes <joelaf@google.com>
Commit-Queue: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 8bc7efc64c84da753f2174a7071c8f1a7823d2bb)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
f12c162eac UPSTREAM: net: Use call_rcu_hurry() for dst_release()
In a networking test on ChromeOS, kernels built with the new
CONFIG_RCU_LAZY=y Kconfig option fail a networking test in the teardown
phase.

This failure may be reproduced as follows: ip netns del <name>

The CONFIG_RCU_LAZY=y Kconfig option was introduced by earlier commits
in this series for the benefit of certain battery-powered systems.
This Kconfig option causes call_rcu() to delay its callbacks in order
to batch them.  This means that a given RCU grace period covers more
callbacks, thus reducing the number of grace periods, in turn reducing
the amount of energy consumed, which increases battery lifetime which
can be a very good thing.  This is not a subtle effect: In some important
use cases, the battery lifetime is increased by more than 10%.

This CONFIG_RCU_LAZY=y option is available only for CPUs that offload
callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot
parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y.

Delaying callbacks is normally not a problem because most callbacks do
nothing but free memory.  If the system is short on memory, a shrinker
will kick all currently queued lazy callbacks out of their laziness,
thus freeing their memory in short order.  Similarly, the rcu_barrier()
function, which blocks until all currently queued callbacks are invoked,
will also kick lazy callbacks, thus enabling rcu_barrier() to complete
in a timely manner.

However, there are some cases where laziness is not a good option.
For example, synchronize_rcu() invokes call_rcu(), and blocks until
the newly queued callback is invoked.  It would not be a good for
synchronize_rcu() to block for ten seconds, even on an idle system.
Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of
call_rcu().  The arrival of a non-lazy call_rcu_hurry() callback on a
given CPU kicks any lazy callbacks that might be already queued on that
CPU.  After all, if there is going to be a grace period, all callbacks
might as well get full benefit from it.

Yes, this could be done the other way around by creating a
call_rcu_lazy(), but earlier experience with this approach and
feedback at the 2022 Linux Plumbers Conference shifted the approach
to call_rcu() being lazy with call_rcu_hurry() for the few places
where laziness is inappropriate.

Returning to the test failure, use of ftrace showed that this failure
cause caused by the aadded delays due to this new lazy behavior of
call_rcu() in kernels built with CONFIG_RCU_LAZY=y.

Therefore, make dst_release() use call_rcu_hurry() in order to revert
to the old test-failure-free behavior.

[ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ]

Bug: 258241771
Bug: 222463781
Test: CQ
Change-Id: Ifd64083bd210a9dfe94c179152f27d310c179507
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: David Ahern <dsahern@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: <netdev@vger.kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 483c26ff63)
Signed-off-by: Joel Fernandes <joelaf@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318050
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
(cherry picked from commit e0886387489fed8a60e7e0f107b95fb9c0241930)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
ff22b562f0 UPSTREAM: percpu-refcount: Use call_rcu_hurry() for atomic switch
Earlier commits in this series allow battery-powered systems to build
their kernels with the default-disabled CONFIG_RCU_LAZY=y Kconfig option.
This Kconfig option causes call_rcu() to delay its callbacks in order to
batch callbacks.  This means that a given RCU grace period covers more
callbacks, thus reducing the number of grace periods, in turn reducing
the amount of energy consumed, which increases battery lifetime which
can be a very good thing.  This is not a subtle effect: In some important
use cases, the battery lifetime is increased by more than 10%.

This CONFIG_RCU_LAZY=y option is available only for CPUs that offload
callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot
parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y.

Delaying callbacks is normally not a problem because most callbacks do
nothing but free memory.  If the system is short on memory, a shrinker
will kick all currently queued lazy callbacks out of their laziness,
thus freeing their memory in short order.  Similarly, the rcu_barrier()
function, which blocks until all currently queued callbacks are invoked,
will also kick lazy callbacks, thus enabling rcu_barrier() to complete
in a timely manner.

However, there are some cases where laziness is not a good option.
For example, synchronize_rcu() invokes call_rcu(), and blocks until
the newly queued callback is invoked.  It would not be a good for
synchronize_rcu() to block for ten seconds, even on an idle system.
Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of
call_rcu().  The arrival of a non-lazy call_rcu_hurry() callback on a
given CPU kicks any lazy callbacks that might be already queued on that
CPU.  After all, if there is going to be a grace period, all callbacks
might as well get full benefit from it.

Yes, this could be done the other way around by creating a
call_rcu_lazy(), but earlier experience with this approach and
feedback at the 2022 Linux Plumbers Conference shifted the approach
to call_rcu() being lazy with call_rcu_hurry() for the few places
where laziness is inappropriate.

And another call_rcu() instance that cannot be lazy is the one on the
percpu refcounter's "per-CPU to atomic switch" code path, which
uses RCU when switching to atomic mode.  The enqueued callback
wakes up waiters waiting in the percpu_ref_switch_waitq.  Allowing
this callback to be lazy would result in unacceptable slowdowns for
users of per-CPU refcounts, such as blk_pre_runtime_suspend().

Therefore, make __percpu_ref_switch_to_atomic() use call_rcu_hurry()
in order to revert to the old behavior.

[ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ]

Bug: 258241771
Bug: 222463781
Test: CQ
Change-Id: Icc325f69d0df1a37b6f1de02a284e1fabf20e366
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: <linux-mm@kvack.org>
(cherry picked from commit 343a72e5e3)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318049
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
Tested-by: Joel Fernandes <joelaf@google.com>
Commit-Queue: Joel Fernandes <joelaf@google.com>
(cherry picked from commit dfd536f499642cd18679cc64c79a8fb275137f45)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
a4cc1aa22d UPSTREAM: rcu/sync: Use call_rcu_hurry() instead of call_rcu
call_rcu() changes to save power will slow down rcu sync. Use the
call_rcu_hurry() API instead which reverts to the old behavior.

[ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ]

Bug: 258241771
Bug: 222463781
Test: CQ
Change-Id: I5123ba52f47676305dbcfa1233bf3b41f140766c
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
(cherry picked from commit 7651d6b250)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318048
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Joel Fernandes <joelaf@google.com>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Tested-by: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 183fce4e1bfbbae1266ec90c6bb871b51d7af81c)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00
Joel Fernandes (Google)
222a4cd66c UPSTREAM: rcu: Refactor code a bit in rcu_nocb_do_flush_bypass()
This consolidates the code a bit and makes it cleaner. Functionally it
is the same.

Bug: 258241771
Bug: 222463781
Test: CQ
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

(cherry picked from commit 3d222a0c0c)
Change-Id: I8422c7138edd6a476fc46374beefdf46dd76b8b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4318047
Tested-by: Joel Fernandes <joelaf@google.com>
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Vineeth Pillai <vineethrp@google.com>
Commit-Queue: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 58cb433d445d2416ba26645e8df63d86afa15f8c)
[Cherry picked from chromeos-5.15 tree. Minor tweaks to commit message
to match Android style]
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-04-29 22:43:39 +00:00