android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yu-Ting Tseng d1e87637cd BACKPORT: FROMGIT: binder: frozen notification
Frozen processes present a significant challenge in binder transactions.
When a process is frozen, it cannot, by design, accept and/or respond to
binder transactions. As a result, the sender needs to adjust its
behavior, such as postponing transactions until the peer process
unfreezes. However, there is currently no way to subscribe to these
state change events, making it impossible to implement frozen-aware
behaviors efficiently.

Introduce a binder API for subscribing to frozen state change events.
This allows programs to react to changes in peer process state,
mitigating issues related to binder transactions sent to frozen
processes.

Implementation details:
For a given binder_ref, the state of frozen notification can be one of
the followings:
1. Userspace doesn't want a notification. binder_ref->freeze is null.
2. Userspace wants a notification but none is in flight.
   list_empty(&binder_ref->freeze->work.entry) = true
3. A notification is in flight and waiting to be read by userspace.
   binder_ref_freeze.sent is false.
4. A notification was read by userspace and kernel is waiting for an ack.
   binder_ref_freeze.sent is true.

When a notification is in flight, new state change events are coalesced into
the existing binder_ref_freeze struct. If userspace hasn't picked up the
notification yet, the driver simply rewrites the state. Otherwise, the
notification is flagged as requiring a resend, which will be performed
once userspace acks the original notification that's inflight.

See https://r.android.com/3070045 for how userspace is going to use this
feature.

Signed-off-by: Yu-Ting Tseng <yutingtseng@google.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20240709070047.4055369-4-yutingtseng@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 363013421
(cherry picked from commit d579b04a52a183db47dfcb7a44304d7747d551e1
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
 char-misc-next)
Change-Id: I5dd32abba932ca7d03ae58660143e075ed778b81
[cmllamas: fix merge conflicts due to missing 0567461a7a6e]
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-09-07 22:04:18 +00:00
..
acpi
asm-generic This is the 5.4.265 stable release 2023-12-21 12:17:30 +00:00
clocksource
crypto This is the 5.4.268 stable release 2024-01-26 02:15:05 +00:00
drm Merge 5.4.273 into android11-5.4-lts 2024-04-16 15:17:08 +00:00
dt-bindings
keys
kvm
linux Merge branch 'android11-5.4' into branch 'android11-5.4-lts' 2024-07-22 09:38:37 +00:00
math-emu
media Revert "media: rename VFL_TYPE_GRABBER to _VIDEO" 2024-04-17 16:49:02 +00:00
misc
net This is the 5.4.279 stable release 2024-07-08 13:55:50 +00:00
pcmcia
ras
rdma
scsi This is the 5.4.263 stable release 2023-12-11 12:08:17 +00:00
soc soc: fsl: qbman: Add CGR update function 2024-04-13 12:51:27 +02:00
sound BACKPORT: ALSA: compress: Allow pause and resume during draining 2023-12-06 01:50:50 +00:00
target
trace This is the 5.4.278 stable release 2024-06-18 14:18:49 +00:00
uapi BACKPORT: FROMGIT: binder: frozen notification 2024-09-07 22:04:18 +00:00
vdso
video
xen
OWNERS