mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
faf34a67eb92e37a844f15efa35afe9b0c3cc72f
1161248 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
faf34a67eb |
Merge 6.1.86 into android14-6.1-lts
Changes in 6.1.86 amdkfd: use calloc instead of kzalloc to avoid integer overflow wifi: ath9k: fix LNA selection in ath_ant_try_scan() bnx2x: Fix firmware version string character counts wifi: rtw89: pci: enlarge RX DMA buffer to consider size of RX descriptor VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() wifi: iwlwifi: pcie: Add the PCI device id for new hardware panic: Flush kernel log buffer at the end cpuidle: Avoid potential overflow in integer multiplication arm64: dts: rockchip: fix rk3328 hdmi ports node arm64: dts: rockchip: fix rk3399 hdmi ports node ionic: set adminq irq affinity net: skbuff: add overflow debug check to pull/push helpers firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename() wifi: brcmfmac: Add DMI nvram filename quirk for ACEPC W5 Pro pstore/zone: Add a null pointer check to the psz_kmsg_read tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num() net: pcs: xpcs: Return EINVAL in the internal methods dma-direct: Leak pages on dma_set_decrypted() failure wifi: ath11k: decrease MHI channel buffer length to 8KB cpufreq: Don't unregister cpufreq cooling on CPU hotplug btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks() btrfs: export: handle invalid inode or root reference in btrfs_get_parent() btrfs: send: handle path ref underflow in header iterate_inode_ref() ice: use relative VSI index for VFs instead of PF VSI number net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list() Bluetooth: btintel: Fix null ptr deref in btintel_read_version Bluetooth: btmtk: Add MODULE_FIRMWARE() for MT7922 drm/vc4: don't check if plane->state->fb == state->fb Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails drm: panel-orientation-quirks: Add quirk for GPD Win Mini pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs sysv: don't call sb_bread() with pointers_lock held scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc() isofs: handle CDs with bad root inode but good Joliet root directory ASoC: Intel: common: DMI remap for rebranded Intel NUC M15 (LAPRC710) laptops rcu-tasks: Repair RCU Tasks Trace quiescence check Julia Lawall reported this null pointer dereference, this should fix it. media: sta2x11: fix irq handler cast ALSA: firewire-lib: handle quirk to calculate payload quadlets as data block counter ext4: add a hint for block bitmap corrupt state in mb_groups ext4: forbid commit inconsistent quota data when errors=remount-ro drm/amd/display: Fix nanosec stat overflow drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init() SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default" libperf evlist: Avoid out-of-bounds access input/touchscreen: imagis: Correct the maximum touch area value block: prevent division by zero in blk_rq_stat_sum() RDMA/cm: add timeout to cm_destroy_id wait Input: imagis - use FIELD_GET where applicable Input: allocate keycode for Display refresh rate toggle platform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8 tablet perf/x86/amd/lbr: Discard erroneous branch entries ktest: force $buildonly = 1 for 'make_warnings_file' test type ring-buffer: use READ_ONCE() to read cpu_buffer->commit_page in concurrent environment tools: iio: replace seekdir() in iio_generic_buffer bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state usb: gadget: uvc: mark incomplete frames with UVC_STREAM_ERR thunderbolt: Keep the domain powered when USB4 port is in redrive mode usb: typec: tcpci: add generic tcpci fallback compatible usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined thermal/of: Assume polling-delay(-passive) 0 when absent ASoC: soc-core.c: Skip dummy codec when adding platforms fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 io_uring: clear opcode specific data for an early failure drivers/nvme: Add quirks for device 126f:2262 fbmon: prevent division by zero in fb_videomode_from_videomode() netfilter: nf_tables: release batch on table validation from abort path netfilter: nf_tables: release mutex after nft_gc_seq_end from abort path netfilter: nf_tables: discard table flag update with pending basechain deletion tty: n_gsm: require CAP_NET_ADMIN to attach N_GSM0710 ldisc gcc-plugins/stackleak: Avoid .head.text section Revert "scsi: sd: usb_storage: uas: Access media prior to querying device properties" Revert "scsi: core: Add struct for args to execution functions" scsi: sd: usb_storage: uas: Access media prior to querying device properties virtio: reenable config if freezing device failed randomize_kstack: Improve entropy diffusion platform/x86: intel-vbtn: Update tablet mode switch at end of probe Bluetooth: btintel: Fixe build regression net: mpls: error out if inner headers are not set VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()" Linux 6.1.86 Change-Id: I385fd199fb709d2f63ac02f9f9d1c3061fbbf93f Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> |
||
|
|
a28d27f66e |
ANDROID: fix crc issue in net/ipv4/inet_fragment.c
In commit |
||
|
|
da08c217d8 |
ANDROID: preserve CRC values in struct sk_buff due to ip_defrag_offset removal
In commit |
||
|
|
416b90bf47 |
Revert "vsock/virtio: fix packet delivery to tap device"
This reverts commit
|
||
|
|
66a1080110 |
Merge 6.1.85 into android14-6.1-lts
Changes in 6.1.85 scripts/bpf_doc: Use silent mode when exec make cmd dma-buf: Fix NULL pointer dereference in sanitycheck() nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet mlxbf_gige: stop PHY during open() error paths wifi: iwlwifi: mvm: rfi: fix potential response leaks ixgbe: avoid sleeping allocation in ixgbe_ipsec_vf_add_sa() s390/qeth: handle deferred cc1 tcp: properly terminate timers for kernel sockets net: wwan: t7xx: Split 64bit accesses to fix alignment issues ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields() net: hns3: fix index limit to support all queue stats net: hns3: fix kernel crash when devlink reload during pf initialization net: hns3: mark unexcuted loopback test result as UNEXECUTED tls: recv: process_rx_list shouldn't use an offset with kvec tls: adjust recv return with async crypto and failed copy to userspace tls: get psock ref after taking rxlock to avoid leak mlxbf_gige: call request_irq() after NAPI initialized bpf: Protect against int overflow for stack access size cifs: Fix duplicate fscache cookie warnings net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips Octeontx2-af: fix pause frame configuration in GMP mode inet: inet_defrag: prevent sk release while still in use dm integrity: fix out-of-range warning x86/cpufeatures: Add new word for scattered features perf/x86/amd/lbr: Use freeze based on availability KVM: arm64: Fix host-programmed guest events in nVHE r8169: fix issue caused by buggy BIOS on certain boards with RTL8168d x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word Revert "Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT" arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken Bluetooth: qca: fix device-address endianness Bluetooth: add quirk for broken address properties Bluetooth: hci_event: set the conn encrypted before conn establishes Bluetooth: Fix TOCTOU in HCI debugfs implementation xen-netfront: Add missing skb_mark_for_recycle net/rds: fix possible cp null dereference net: usb: ax88179_178a: avoid the interface always configured as random address vsock/virtio: fix packet delivery to tap device Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped." netfilter: nf_tables: reject new basechain after table flag update netfilter: nf_tables: flush pending destroy work before exit_net release netfilter: nf_tables: Fix potential data-race in __nft_flowtable_type_get() netfilter: validate user input for expected length vboxsf: Avoid an spurious warning if load_nls_xxx() fails bpf, sockmap: Prevent lock inversion deadlock in map delete elem net/sched: act_skbmod: prevent kernel-infoleak net/sched: fix lockdep splat in qdisc_tree_reduce_backlog() net: stmmac: fix rx queue priority assignment net: phy: micrel: lan8814: Fix when enabling/disabling 1-step timestamping net: phy: micrel: Fix potential null pointer dereference selftests: net: gro fwd: update vxlan GRO test expectations gro: fix ownership transfer x86/bugs: Fix the SRSO mitigation on Zen3/4 x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO i40e: Fix VF MAC filter removal erspan: make sure erspan_base_hdr is present in skb->head selftests: reuseaddr_conflict: add missing new line at the end of the output ipv6: Fix infinite recursion in fib6_dump_done(). mlxbf_gige: stop interface during shutdown r8169: skip DASH fw status checks when DASH is disabled udp: do not accept non-tunnel GSO skbs landing in a tunnel udp: do not transition UDP GRO fraglist partial checksums to unnecessary udp: prevent local UDP tunnel packets from being GROed octeontx2-af: Fix issue with loading coalesced KPU profiles octeontx2-pf: check negative error code in otx2_open() octeontx2-af: Add array index check i40e: fix i40e_count_filters() to count only active/new filters i40e: fix vf may be used uninitialized in this function warning drm/amd: Evict resources during PM ops prepare() callback drm/amd: Add concept of running prepare_suspend() sequence for IP blocks drm/amd: Flush GFXOFF requests in prepare stage i40e: Store the irq number in i40e_q_vector i40e: Remove _t suffix from enum type names i40e: Enforce software interrupt during busy-poll exit r8169: use spinlock to protect mac ocp register access r8169: use spinlock to protect access to registers Config2 and Config5 r8169: prepare rtl_hw_aspm_clkreq_enable for usage in atomic context tcp: Fix bind() regression for v6-only wildcard and v4(-mapped-v6) non-wildcard addresses. drivers: net: convert to boolean for the mac_managed_pm flag net: fec: Set mac_managed_pm during probe net: ravb: Let IP-specific receive function to interrogate descriptors net: ravb: Always process TX descriptor ring net: ravb: Always update error counters KVM: SVM: enhance info printk's in SEV init KVM: SVM: WARN, but continue, if misc_cg_set_capacity() fails KVM: SVM: Use unsigned integers when dealing with ASIDs KVM: SVM: Add support for allowing zero SEV ASIDs fs/pipe: Fix lockdep false-positive in watchqueue pipe_write() 9p: Fix read/write debug statements to report server reply drivers/perf: riscv: Disable PERF_SAMPLE_BRANCH_* while not supported drm/panfrost: fix power transition timeout warnings ASoC: rt5682-sdw: fix locking sequence ASoC: rt711-sdca: fix locking sequence ASoC: rt711-sdw: fix locking sequence ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit scsi: mylex: Fix sysfs buffer lengths scsi: sd: Unregister device if device_add_disk() failed in sd_probe() cifs: Fix caching to try to do open O_WRONLY as rdwr on server ata: sata_mv: Fix PCI device ID table declaration compilation warning nfsd: hold a lighter-weight client reference over CB_RECALL_ANY x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk ksmbd: don't send oplock break if rename fails ksmbd: validate payload size in ipc response ksmbd: do not set SMB2_GLOBAL_CAP_ENCRYPTION for SMB 3.1.1 ALSA: hda/realtek - Fix inactive headset mic jack ALSA: hda/realtek: Update Panasonic CF-SZ6 quirk to support headset with microphone driver core: Introduce device_link_wait_removal() of: dynamic: Synchronize of_changeset_destroy() with the devlink removals x86/mm/pat: fix VM_PAT handling in COW mappings x86/mce: Make sure to grab mce_sysfs_mutex in set_bank() x86/coco: Require seeding RNG with RDRAND on CoCo systems s390/entry: align system call table on 8 bytes riscv: Fix spurious errors from __get/put_kernel_nofault riscv: process: Fix kernel gp leakage smb3: retrying on failed server close smb: client: fix potential UAF in cifs_debug_files_proc_show() smb: client: fix potential UAF in cifs_stats_proc_write() smb: client: fix potential UAF in cifs_stats_proc_show() smb: client: fix potential UAF in smb2_is_valid_oplock_break() smb: client: fix potential UAF in smb2_is_valid_lease_break() smb: client: fix potential UAF in is_valid_oplock_break() smb: client: fix potential UAF in smb2_is_network_name_deleted() smb: client: fix potential UAF in cifs_signal_cifsd_for_reconnect() selftests: mptcp: join: fix dev in check_endpoint mptcp: don't account accept() of non-MPC client as fallback to TCP selftests: mptcp: display simult in extra_msg mm/secretmem: fix GUP-fast succeeding on secretmem folios nvme: fix miss command type check x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file x86/syscall: Don't force use of indirect calls for system calls x86/bhi: Add support for clearing branch history at syscall entry x86/bhi: Define SPEC_CTRL_BHI_DIS_S x86/bhi: Enumerate Branch History Injection (BHI) bug x86/bhi: Add BHI mitigation knob x86/bhi: Mitigate KVM by default KVM: x86: Add BHI_NO x86: set SPECTRE_BHI_ON as default Linux 6.1.85 Change-Id: I8b0581cf7f5ea86885a78315729467d7f128e117 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> |
||
|
|
7b7c6df465 |
Merge branch 'android14-6.1' into branch 'android14-6.1-lts'
Sync up the android14-6.1-lts branch with recent android14-6.1 changes. This includes the following commits: * |
||
|
|
74c507aab1 |
UPSTREAM: 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) Signed-off-by: Roy Luo <royluo@google.com> |
||
|
|
92704e00b5 |
ANDROID: GKI: add tegra20-cpufreq.ko to rockpi4 build
Enabling configs for Tegra SoCs required this module to be included in
the rockpi4 builds. This change fixes the following build issue:
ERROR: The following kernel modules are built but not copied. Add these lines to the module_outs attribute of @@//common:rockpi4_no_kgdb:
"drivers/cpufreq/tegra20-cpufreq.ko",
Bug: 335325897
Change-Id: I898000725287f34956cb977b3b02685f189cd5a0
Signed-off-by: Carlos Llamas <cmllamas@google.com>
|
||
|
|
8498700531 |
ANDROID: GKI: update symbol list for db845c
Enabling configs for Tegra SoCs required these symbols to be included. This change fixes the following build issues: ERROR: modpost: "devm_tegra_memory_controller_get" [drivers/iommu/arm/arm-smmu/arm_smmu.ko] undefined! ERROR: modpost: "tegra_mc_probe_device" [drivers/iommu/arm/arm-smmu/arm_smmu.ko] undefined! Also update the STG file accordingly: 2 function symbol(s) added 'struct tegra_mc* devm_tegra_memory_controller_get(struct device*)' 'int tegra_mc_probe_device(struct tegra_mc*, struct device*)' Bug: 335325897 Change-Id: Ie357116189e074f1dc0e572553b2264abc910bd3 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
1e4532a4a3 |
ANDROID: Build some tegra configs as vendor module
Build some configs that are tristate and selected by CONFIG_ARCH_TEGRA as vendor modules rather than built-in. Bug: 335325897 Change-Id: I7ce4cf975fcbc834bc5fc3c90317d9d81162185a Signed-off-by: Ahmad Chaudhry <ahmadc@nvidia.com> |
||
|
|
974a6f430e |
ANDROID: gki_defconfig: Enable Tegra SoCs
Enable configs required for Tegra SoCs. Bug: 335325897 Change-Id: I74fd9e1b16810ca417f656ed681e01dff8a4efc9 Signed-off-by: Ahmad Chaudhry <ahmadc@nvidia.com> |
||
|
|
6b75fd4835 |
ANDROID: Update the ABI symbol list
To use cpumask_parse_user in vendor code, it will call bitmap_parse_user. Adding the following symbols: - bitmap_parse_user Bug: 248621289 Change-Id: I4b24d8b1fba71af7b55c7444963a003d50f6d93c Signed-off-by: Rick Yiu <rickyiu@google.com> |
||
|
|
0cf5cecba6 |
Revert "crypto: api - Disallow identical driver names"
This reverts commit
|
||
|
|
c6427490ab |
Revert^2 "BACKPORT: FROMGIT: module: allow UNUSED_KSYMS_WHITELIST ..."
This reverts commit
|
||
|
|
87a4e67740 |
Merge tag 'android14-6.1.78_r00' into branch android14-6.1
This brings the android14-6.1 branch up to date with the 6.1.78 LTS release. Included in here are the following commits: * |
||
|
|
a6358098da |
ANDROID: binder: fix KMI-break due to alloc->lock
Wrap 'struct binder_proc' inside 'struct binder_proc_wrap' to add the
alloc->lock equivalent without breaking the KMI. Also, add convenient
apis to access/modify this new spinlock.
Without this patch, the following KMI issues show up:
type 'struct binder_proc' changed
byte size changed from 616 to 576
type 'struct binder_alloc' changed
byte size changed from 152 to 112
member 'spinlock_t lock' was added
member 'struct mutex mutex' was removed
Bug: 254650075
Bug: 319778300
Change-Id: Ic31dc39fb82800a3e47be10a7873cd210f7b60be
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[cmllamas: fixed trivial conflicts]
|
||
|
|
1c5fb0ebd8 |
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:
|
||
|
|
d30de4c7b0 |
ANDROID: binder: fix KMI-break due to address type change
In commit ("binder: keep vma addresses type as unsigned long") the vma
address type in 'struct binder_alloc' and 'struct binder_buffer' is
changed from 'void __user *' to 'unsigned long'.
This triggers the following KMI issues:
type 'struct binder_buffer' changed
member changed from 'void* user_data' to 'unsigned long user_data'
type changed from 'void*' to 'unsigned long'
type 'struct binder_alloc' changed
member changed from 'void* buffer' to 'unsigned long buffer'
type changed from 'void*' to 'unsigned long'
This offending commit is being backported as part of a larger patchset
from upstream in [1]. Lets fix these issues by doing a partial revert
that restores the original types and casts to an integer type where
necessary.
Note this approach is preferred over dropping the single KMI-breaking
patch from the backport, as this would have created non-trivial merge
conflicts in the subsequent cherry-picks.
Bug: 254650075
Bug: 319778300
Link: https://lore.kernel.org/all/20231201172212.1813387-1-cmllamas@google.com/ [1]
Change-Id: Ief9de717d0f34642f5954ffa2e306075a5b4e02e
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[cmllamas: fixed trivial conflicts]
|
||
|
|
81054a4507 |
Reapply "ANDROID: vendor_hooks: Add hook for binder_detect_low_async_space"
This reverts commit 637c8e0d372f1dfff53337a5db89f772577828d7.
Also squash commit
|
||
|
|
7e855d1492 |
Reapply "ANDROID: Add vendor hooks for binder perf tuning"
This reverts commit eeb899e9f54bef5286fd5044db481ecc01e417b4. Change-Id: I810727a6872c16ccb484023bfbc587daca8a2515 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
a091f9709e |
UPSTREAM: binder: switch alloc->mutex to spinlock_t
The alloc->mutex is a highly contended lock that causes performance issues on Android devices. When a low-priority task is given this lock and it sleeps, it becomes difficult for the task to wake up and complete its work. This delays other tasks that are also waiting on the mutex. The problem gets worse when there is memory pressure in the system, because this increases the contention on the alloc->mutex while the shrinker reclaims binder pages. Switching to a spinlock helps to keep the waiters running and avoids the overhead of waking up tasks. This significantly improves the transaction latency when the problematic scenario occurs. The performance impact of this patchset was measured by stress-testing the binder alloc contention. In this test, several clients of different priorities send thousands of transactions of different sizes to a single server. In parallel, pages get reclaimed using the shinker's debugfs. The test was run on a Pixel 8, Pixel 6 and qemu machine. The results were similar on all three devices: after: | sched | prio | average | max | min | |--------+------+---------+-----------+---------| | fifo | 99 | 0.135ms | 1.197ms | 0.022ms | | fifo | 01 | 0.136ms | 5.232ms | 0.018ms | | other | -20 | 0.180ms | 7.403ms | 0.019ms | | other | 19 | 0.241ms | 58.094ms | 0.018ms | before: | sched | prio | average | max | min | |--------+------+---------+-----------+---------| | fifo | 99 | 0.350ms | 248.730ms | 0.020ms | | fifo | 01 | 0.357ms | 248.817ms | 0.024ms | | other | -20 | 0.399ms | 249.906ms | 0.020ms | | other | 19 | 0.477ms | 297.756ms | 0.022ms | The key metrics above are the average and max latencies (wall time). These improvements should roughly translate to p95-p99 latencies on real workloads. The response time is up to 200x faster in these scenarios and there is no penalty in the regular path. Note that it is only possible to convert this lock after a series of changes made by previous patches. These mainly include refactoring the sections that might_sleep() and changing the locking order with the mmap_lock amongst others. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-29-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 7710e2cca32e7f3958480e8bd44f50e29d0c2509) Change-Id: I67121be071d5f072ac0e5eb719c95c0f1dee5eb5 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
a4abaacdab |
UPSTREAM: binder: reverse locking order in shrinker callback
The locking order currently requires the alloc->mutex to be acquired first followed by the mmap lock. However, the alloc->mutex is converted into a spinlock in subsequent commits so the order needs to be reversed to avoid nesting the sleeping mmap lock under the spinlock. The shrinker's callback binder_alloc_free_page() is the only place that needs to be reordered since other functions have been refactored and no longer nest these locks. Some minor cosmetic changes are also included in this patch. Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-28-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit e50f4e6cc9bfaca655d3b6a3506d27cf2caa1d40) Change-Id: I7f7501945a477ac5571082a5dd2a7934f484b8ab Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
112ca28d26 |
UPSTREAM: binder: avoid user addresses in debug logs
Prefer logging vma offsets instead of addresses or simply drop the debug log altogether if not useful. Note this covers the instances affected by the switch to store addresses as unsigned long. However, there are other sections in the driver that could do the same. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-27-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 162c79731448a5a052e93af7753df579dfe0bf7a) Change-Id: I92b7f409e45d9006492d56302e911ccdd8efc950 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
0402339efb |
UPSTREAM: binder: refactor binder_delete_free_buffer()
Skip the freelist call immediately as needed, instead of continuing the pointless checks. Also, drop the debug logs that we don't really need. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-26-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit f07b83a48e944c8a1cc1e9f6703fae5e34df2ba4) Change-Id: I035bd6cd5c06ec984cd6eb3c3b53e0958c64df4f Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
aacaa36eaa |
UPSTREAM: binder: collapse print_binder_buffer() into caller
The code in print_binder_buffer() is quite small so it can be collapsed into its single caller binder_alloc_print_allocated(). No functional change in this patch. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-25-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 8e905217c4543af9cf1754809846157a7dbbb261) Change-Id: Ic3e2522b4702e60e09be3d5940f88ec8252ac793 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
baef4637fc |
UPSTREAM: binder: document the final page calculation
The code to determine the page range for binder_lru_freelist_del() is quite obscure. It leverages the buffer_size calculated before doing an oversized buffer split. This is used to figure out if the last page is being shared with another active buffer. If so, the page gets trimmed out of the range as it has been previously removed from the freelist. This would be equivalent to getting the start page of the next in-use buffer explicitly. However, the code for this is much larger as we can see in binder_free_buf_locked() routine. Instead, lets settle on documenting the tricky step and using better names for now. I believe an ideal solution would be to count the binder_page->users to determine when a page should be added or removed from the freelist. However, this is a much bigger change than what I'm willing to risk at this time. Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-24-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 67dcc880780569ec40391cae4d8299adc1e7a44e) Change-Id: Iec2466605fe7f8aa338c8313f586cdb7519a36e7 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
19d966c1c6 |
BACKPORT: UPSTREAM: binder: rename lru shrinker utilities
Now that the page allocation step is done separately we should rename
the binder_free_page_range() and binder_allocate_page_range() functions
to provide a more accurate description of what they do. Lets borrow the
freelist concept used in other parts of the kernel for this.
No functional change here.
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-23-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 254650075
(cherry picked from commit ea9cdbf0c7273b55e251b2ed8f85794cfadab5d5)
Change-Id: I0d0dfcc6f72d54209da310be2ad5e30f3d722652
[cmllamas: fixed trivial conflicts due to missing commits
|
||
|
|
aac2b2c731 |
UPSTREAM: binder: make oversized buffer code more readable
The sections in binder_alloc_new_buf_locked() dealing with oversized buffers are scattered which makes them difficult to read. Instead, consolidate this code into a single block to improve readability. No functional change here. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-22-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit de0e6573125f8ea7a01a9b05a45b0c73116c73b2) Change-Id: I62c2cec7341e13d9174b4f0839a1345df7cfd808 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
de86cd1e00 |
UPSTREAM: binder: remove redundant debug log
The debug information in this statement is already logged earlier in the same function. We can get rid of this duplicate log. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-21-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 258ce20ede33c551002705fa1488864fb287752c) Change-Id: Ie533a55ea10b2af927004f1d0e244b386ba25360 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
78dfa69547 |
UPSTREAM: binder: perform page installation outside of locks
Split out the insertion of pages to be outside of the alloc->mutex in a separate binder_install_buffer_pages() routine. Since this is no longer serialized, we must look at the full range of pages used by the buffers. The installation is protected with mmap_sem in write mode since multiple tasks might race to install the same page. Besides avoiding unnecessary nested locking this helps in preparation of switching the alloc->mutex into a spinlock_t in subsequent patches. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-20-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 37ebbb4f73a0d299fa0c7dd043932a2f5fbbb779) Change-Id: I7b0684310b8824194d7e4a51a1fd67944f8ec06a Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
2b6af2f338 |
UPSTREAM: binder: initialize lru pages in mmap callback
Rather than repeatedly initializing some of the binder_lru_page members during binder_alloc_new_buf(), perform this initialization just once in binder_alloc_mmap_handler(), after the pages have been created. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-19-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 68aef12d094e4c96d972790f1620415460a4f3cf) Change-Id: I3197038683f76a5cb98a79d017d1515429df2d73 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
48554214a7 |
UPSTREAM: binder: malloc new_buffer outside of locks
Preallocate new_buffer before acquiring the alloc->mutex and hand it down to binder_alloc_new_buf_locked(). The new buffer will be used in the vast majority of requests (measured at 98.2% in field data). The buffer is discarded otherwise. This change is required in preparation for transitioning alloc->mutex into a spinlock in subsequent commits. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-18-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit c7ac30fad18231a1637d38aa8a97d6b4788ed8ad) Change-Id: Ib7c8eb3c53e8383694a118fabc776a6a22783c75 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
796a1cae7b |
UPSTREAM: binder: refactor page range allocation
Instead of looping through the page range twice to first determine if the mmap lock is required, simply do it per-page as needed. Split out all this logic into a separate binder_install_single_page() function. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-17-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit ea2735ce19c1c6ce0f6011f813a1eea0272c231d) Change-Id: Ic057e9cfaeb22754f99bdec2a51076cf58c86855 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
568a63be9a |
UPSTREAM: binder: relocate binder_alloc_clear_buf()
Move this function up along with binder_alloc_get_page() so that their prototypes aren't necessary. No functional change in this patch. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-16-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit cbc174a64b8d0ab542752c167dc1334b52b88624) Change-Id: I0d3c69c9a26c7415308202c4b7868a36b83d089c Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
e4ee73a682 |
UPSTREAM: binder: relocate low space calculation
Move the low async space calculation to debug_low_async_space_locked(). This logic not only fits better here but also offloads some of the many tasks currently done in binder_alloc_new_buf_locked(). No functional change in this patch. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-15-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit c13500eaabd2343aa4cbb76b54ec624cb0c0ef8d) Change-Id: I1b396f59f2a5b6640d8664767f2d45a675af7197 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
919daae2b6 |
UPSTREAM: binder: separate the no-space debugging logic
Move the no-space debugging logic into a separate function. Lets also mark this branch as unlikely in binder_alloc_new_buf_locked() as most requests will fit without issue. Also add a few cosmetic changes and suggestions from checkpatch. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-14-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 9409af24e4503d14093b27db9425f7c99e64fef4) Change-Id: I4ff8ced5728a63815f7d47df9eb9ac85aa0a362d Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
a37caf8d4c |
UPSTREAM: binder: remove pid param in binder_alloc_new_buf()
Binder attributes the buffer allocation to the current->tgid everytime. There is no need to pass this as a parameter so drop it. Also add a few touchups to follow the coding guidelines. No functional changes are introduced in this patch. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-13-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 89f71743bf42217dd4092fda703a8e4f6f4e55ac) Change-Id: Ib21fdc5afd7eeb4723b08913ba40ded762421b0b Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
a880c450b7 |
UPSTREAM: binder: do unlocked work in binder_alloc_new_buf()
Extract non-critical sections from binder_alloc_new_buf_locked() that don't require holding the alloc->mutex. While we are here, consolidate the checks for size overflow and zero-sized padding into a separate sanitized_size() helper function. Also add a few touchups to follow the coding guidelines. Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-12-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 377e1684db7a1e23261f3c3ebf76523c0554d512) Change-Id: I8fc18c06563ad2c26536633034fb3e94b0aaf510 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
e5fae62ffb |
UPSTREAM: binder: split up binder_update_page_range()
The binder_update_page_range() function performs both allocation and freeing of binder pages. However, these two operations are unrelated and have no common logic. In fact, when a free operation is requested, the allocation logic is skipped entirely. This behavior makes the error path unnecessarily complex. To improve readability of the code, this patch splits the allocation and freeing operations into separate functions. No functional changes are introduced by this patch. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-11-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit 0d35bf3bf2da8d43fd12fea7699dc936999bf96e) Change-Id: Iaf64f94564d2017c4633f2421c15b0bdee914738 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
b66dacff3d |
UPSTREAM: binder: keep vma addresses type as unsigned long
The vma addresses in binder are currently stored as void __user *. This requires casting back and forth between the mm/ api which uses unsigned long. Since we also do internal arithmetic on these addresses we end up having to cast them _again_ to an integer type. Lets stop all the unnecessary casting which kills code readability and store the virtual addresses as the native unsigned long from mm/. Note that this approach is preferred over uintptr_t as Linus explains in [1]. Opportunistically add a few cosmetic touchups. Link: https://lore.kernel.org/all/CAHk-=wj2OHy-5e+srG1fy+ZU00TmZ1NFp6kFLbVLMXHe7A1d-g@mail.gmail.com/ [1] Signed-off-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-10-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit df9aabead791d7a3d59938abe288720f5c1367f7) Change-Id: Ib2fbaf0ad881973eb77957863f079f986fe0d926 Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
8b2c4f7ab3 |
UPSTREAM: binder: remove extern from function prototypes
The kernel coding style does not require 'extern' in function prototypes in .h files, so remove them from drivers/android/binder_alloc.h as they are not needed. No functional changes in this patch. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Carlos Llamas <cmllamas@google.com> Link: https://lore.kernel.org/r/20231201172212.1813387-9-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 254650075 (cherry picked from commit da483f8b390546fbe36abd72f58d612a8032e2a8) Change-Id: I75e4ee9cf08fada7378f448bc5992d125174132f Signed-off-by: Carlos Llamas <cmllamas@google.com> |
||
|
|
6a29f5fb4b |
Revert "ANDROID: Add vendor hooks for binder perf tuning"
This reverts commit
|
||
|
|
9e2c184da1 |
Revert "ANDROID: vendor_hooks: Add hook for binder_detect_low_async_space_locked"
This reverts commit
|
||
|
|
6c17e786e7 |
Revert "ANDROID: vendor_hook: rename the the name of hooks"
This reverts commit
|
||
|
|
dd875b6366 |
ANDROID: GKI: Update rockchip symbols for some usb wifi bt.
3 function symbol(s) added 'int usb_anchor_empty(struct usb_anchor*)' 'void usb_disable_autosuspend(struct usb_device*)' 'void usb_reset_endpoint(struct usb_device*, unsigned int)' Bug: 300024866 Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com> Change-Id: Ib1c613e2aca4ab7f4c29f044829505efd4544ef3 |
||
|
|
d3c340f987 |
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
|
||
|
|
e302f3a21b |
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) |
||
|
|
3f13972470 |
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: If86a1a6c7875bace543381575544590823cd092c |
||
|
|
29f2af3ce7 |
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.] Bug: 342390208 Signed-off-by: Yifan Hong <elsk@google.com> |
||
|
|
6820762b5e |
FROMLIST: kheaders: explicitly define file modes for archived headers
Build environments might be running with different umask settings resulting in indeterministic file modes for the files contained in kheaders.tar.xz. The file itself is served with 444, i.e. world readable. Archive the files explicitly with 744,a+X to improve reproducibility across build environments. --mode=0444 is not suitable as directories need to be executable. Also, 444 makes it hard to delete all the readonly files after extraction. Cc: <stable@vger.kernel.org> Cc: <linux-kbuild@vger.kernel.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Joel Fernandes <joel@joelfernandes.org> Link: https://lore.kernel.org/r/20240528113243.827490-2-maennich@google.com Bug: 342094847 Bug: 342393806 Change-Id: Ib206a6e0abfacf8132bfad8c43a62982062175fa Signed-off-by: Matthias Maennich <maennich@google.com> |