mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Compare commits
1004 changed files with 3519 additions and 190298 deletions
|
|
@ -265,71 +265,6 @@ Description: Specific uncompressed frame descriptors
|
|||
bmCapabilities - still image support, fixed frame-rate
|
||||
support
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased
|
||||
Date: Oct 2025
|
||||
KernelVersion: 5.4
|
||||
Description: Framebased format descriptors
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased/name
|
||||
Date: Oct 2025
|
||||
KernelVersion: 5.4
|
||||
Description: Specific framebased format descriptors
|
||||
|
||||
================== =======================================
|
||||
bFormatIndex unique id for this format descriptor;
|
||||
only defined after parent header is
|
||||
linked into the streaming class;
|
||||
read-only
|
||||
bmaControls this format's data for bmaControls in
|
||||
the streaming header
|
||||
bmInterlaceFlags specifies interlace information,
|
||||
read-only
|
||||
bAspectRatioY the X dimension of the picture aspect
|
||||
ratio, read-only
|
||||
bAspectRatioX the Y dimension of the picture aspect
|
||||
ratio, read-only
|
||||
bDefaultFrameIndex optimum frame index for this stream
|
||||
bBitsPerPixel number of bits per pixel used to
|
||||
specify color in the decoded video
|
||||
frame
|
||||
guidFormat globally unique id used to identify
|
||||
stream-encoding format
|
||||
================== =======================================
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased/name/name
|
||||
Date: Sept 2024
|
||||
KernelVersion: 5.15
|
||||
Description: Specific framebased frame descriptors
|
||||
|
||||
========================= =====================================
|
||||
bFrameIndex unique id for this framedescriptor;
|
||||
only defined after parent format is
|
||||
linked into the streaming header;
|
||||
read-only
|
||||
dwFrameInterval indicates how frame interval can be
|
||||
programmed; a number of values
|
||||
separated by newline can be specified
|
||||
dwDefaultFrameInterval the frame interval the device would
|
||||
like to use as default
|
||||
dwBytesPerLine Specifies the number of bytes per line
|
||||
|
||||
of video for packed fixed frame size
|
||||
formats, allowing the receiver to
|
||||
perform stride alignment of the video.
|
||||
If the bVariableSize value (above) is
|
||||
TRUE (1), or if the format does not
|
||||
permit such alignment, this value shall
|
||||
be set to zero (0).
|
||||
dwMaxBitRate the maximum bit rate at the shortest
|
||||
frame interval in bps
|
||||
dwMinBitRate the minimum bit rate at the longest
|
||||
frame interval in bps
|
||||
wHeight height of decoded bitmap frame in px
|
||||
wWidth width of decoded bitmam frame in px
|
||||
bmCapabilities still image support, fixed frame-rate
|
||||
support
|
||||
========================= =====================================
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/header
|
||||
Date: Dec 2014
|
||||
KernelVersion: 4.0
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
What: /sys/fs/fuse/features/fuse_bpf
|
||||
Date: December 2022
|
||||
Contact: Paul Lawrence <paullawrence@google.com>
|
||||
Description:
|
||||
Read-only file that contains the word 'supported' if fuse-bpf is
|
||||
supported, does not exist otherwise
|
||||
|
||||
What: /sys/fs/fuse/bpf_prog_type_fuse
|
||||
Date: December 2022
|
||||
Contact: Paul Lawrence <paullawrence@google.com>
|
||||
Description:
|
||||
bpf_prog_type_fuse defines the program type of bpf programs that
|
||||
may be passed to fuse-bpf. For upstream bpf program types, this
|
||||
is a constant defined in a contiguous array of constants.
|
||||
bpf_prog_type_fuse is appended to the end of the list, so it may
|
||||
change and therefore its value must be read from this file.
|
||||
|
||||
Contents is ASCII decimal representation of bpf_prog_type_fuse
|
||||
|
||||
|
|
@ -3187,21 +3187,6 @@
|
|||
in certain environments such as networked servers or
|
||||
real-time systems.
|
||||
|
||||
no_hash_pointers
|
||||
Force pointers printed to the console or buffers to be
|
||||
unhashed. By default, when a pointer is printed via %p
|
||||
format string, that pointer is "hashed", i.e. obscured
|
||||
by hashing the pointer value. This is a security feature
|
||||
that hides actual kernel addresses from unprivileged
|
||||
users, but it also makes debugging the kernel more
|
||||
difficult since unequal pointers can no longer be
|
||||
compared. However, if this command-line option is
|
||||
specified, then all normal pointers will have their true
|
||||
value printed. Pointers printed via %pK may still be
|
||||
hashed. This option should only be specified when
|
||||
debugging the kernel. Please do not use on production
|
||||
kernels.
|
||||
|
||||
nohibernate [HIBERNATION] Disable hibernation and resume.
|
||||
|
||||
nohz= [KNL] Boottime enable/disable dynamic ticks
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ whole; patches welcome!
|
|||
kasan
|
||||
ubsan
|
||||
kmemleak
|
||||
kfence
|
||||
gdb-kernel-debugging
|
||||
kgdb
|
||||
kselftest
|
||||
|
|
|
|||
|
|
@ -1,298 +0,0 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. Copyright (C) 2020, Google LLC.
|
||||
|
||||
Kernel Electric-Fence (KFENCE)
|
||||
==============================
|
||||
|
||||
Kernel Electric-Fence (KFENCE) is a low-overhead sampling-based memory safety
|
||||
error detector. KFENCE detects heap out-of-bounds access, use-after-free, and
|
||||
invalid-free errors.
|
||||
|
||||
KFENCE is designed to be enabled in production kernels, and has near zero
|
||||
performance overhead. Compared to KASAN, KFENCE trades performance for
|
||||
precision. The main motivation behind KFENCE's design, is that with enough
|
||||
total uptime KFENCE will detect bugs in code paths not typically exercised by
|
||||
non-production test workloads. One way to quickly achieve a large enough total
|
||||
uptime is when the tool is deployed across a large fleet of machines.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
To enable KFENCE, configure the kernel with::
|
||||
|
||||
CONFIG_KFENCE=y
|
||||
|
||||
To build a kernel with KFENCE support, but disabled by default (to enable, set
|
||||
``kfence.sample_interval`` to non-zero value), configure the kernel with::
|
||||
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=0
|
||||
|
||||
KFENCE provides several other configuration options to customize behaviour (see
|
||||
the respective help text in ``lib/Kconfig.kfence`` for more info).
|
||||
|
||||
Tuning performance
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The most important parameter is KFENCE's sample interval, which can be set via
|
||||
the kernel boot parameter ``kfence.sample_interval`` in milliseconds. The
|
||||
sample interval determines the frequency with which heap allocations will be
|
||||
guarded by KFENCE. The default is configurable via the Kconfig option
|
||||
``CONFIG_KFENCE_SAMPLE_INTERVAL``. Setting ``kfence.sample_interval=0``
|
||||
disables KFENCE.
|
||||
|
||||
The KFENCE memory pool is of fixed size, and if the pool is exhausted, no
|
||||
further KFENCE allocations occur. With ``CONFIG_KFENCE_NUM_OBJECTS`` (default
|
||||
255), the number of available guarded objects can be controlled. Each object
|
||||
requires 2 pages, one for the object itself and the other one used as a guard
|
||||
page; object pages are interleaved with guard pages, and every object page is
|
||||
therefore surrounded by two guard pages.
|
||||
|
||||
The total memory dedicated to the KFENCE memory pool can be computed as::
|
||||
|
||||
( #objects + 1 ) * 2 * PAGE_SIZE
|
||||
|
||||
Using the default config, and assuming a page size of 4 KiB, results in
|
||||
dedicating 2 MiB to the KFENCE memory pool.
|
||||
|
||||
Note: On architectures that support huge pages, KFENCE will ensure that the
|
||||
pool is using pages of size ``PAGE_SIZE``. This will result in additional page
|
||||
tables being allocated.
|
||||
|
||||
Error reports
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
A typical out-of-bounds access looks like this::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: out-of-bounds read in test_out_of_bounds_read+0xa3/0x22b
|
||||
|
||||
Out-of-bounds read at 0xffffffffb672efff (1B left of kfence-#17):
|
||||
test_out_of_bounds_read+0xa3/0x22b
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#17 [0xffffffffb672f000-0xffffffffb672f01f, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_out_of_bounds_read+0x98/0x22b
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 107 Comm: kunit_try_catch Not tainted 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
The header of the report provides a short summary of the function involved in
|
||||
the access. It is followed by more detailed information about the access and
|
||||
its origin. Note that, real kernel addresses are only shown when using the
|
||||
kernel command line option ``no_hash_pointers``.
|
||||
|
||||
Use-after-free accesses are reported as::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: use-after-free read in test_use_after_free_read+0xb3/0x143
|
||||
|
||||
Use-after-free read at 0xffffffffb673dfe0 (in kfence-#24):
|
||||
test_use_after_free_read+0xb3/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#24 [0xffffffffb673dfe0-0xffffffffb673dfff, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_use_after_free_read+0x76/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
freed by task 507:
|
||||
test_use_after_free_read+0xa8/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 109 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
KFENCE also reports on invalid frees, such as double-frees::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: invalid free in test_double_free+0xdc/0x171
|
||||
|
||||
Invalid free of 0xffffffffb6741000:
|
||||
test_double_free+0xdc/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#26 [0xffffffffb6741000-0xffffffffb674101f, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_double_free+0x76/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
freed by task 507:
|
||||
test_double_free+0xa8/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 111 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
KFENCE also uses pattern-based redzones on the other side of an object's guard
|
||||
page, to detect out-of-bounds writes on the unprotected side of the object.
|
||||
These are reported on frees::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: memory corruption in test_kmalloc_aligned_oob_write+0xef/0x184
|
||||
|
||||
Corrupted memory at 0xffffffffb6797ff9 [ 0xac . . . . . . ] (in kfence-#69):
|
||||
test_kmalloc_aligned_oob_write+0xef/0x184
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#69 [0xffffffffb6797fb0-0xffffffffb6797ff8, size=73, cache=kmalloc-96] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_kmalloc_aligned_oob_write+0x57/0x184
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 120 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
For such errors, the address where the corruption occurred as well as the
|
||||
invalidly written bytes (offset from the address) are shown; in this
|
||||
representation, '.' denote untouched bytes. In the example above ``0xac`` is
|
||||
the value written to the invalid address at offset 0, and the remaining '.'
|
||||
denote that no following bytes have been touched. Note that, real values are
|
||||
only shown if the kernel was booted with ``no_hash_pointers``; to avoid
|
||||
information disclosure otherwise, '!' is used instead to denote invalidly
|
||||
written bytes.
|
||||
|
||||
And finally, KFENCE may also report on invalid accesses to any protected page
|
||||
where it was not possible to determine an associated object, e.g. if adjacent
|
||||
object pages had not yet been allocated::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: invalid read in test_invalid_access+0x26/0xe0
|
||||
|
||||
Invalid read at 0xffffffffb670b00a:
|
||||
test_invalid_access+0x26/0xe0
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 124 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
DebugFS interface
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Some debugging information is exposed via debugfs:
|
||||
|
||||
* The file ``/sys/kernel/debug/kfence/stats`` provides runtime statistics.
|
||||
|
||||
* The file ``/sys/kernel/debug/kfence/objects`` provides a list of objects
|
||||
allocated via KFENCE, including those already freed but protected.
|
||||
|
||||
Implementation Details
|
||||
----------------------
|
||||
|
||||
Guarded allocations are set up based on the sample interval. After expiration
|
||||
of the sample interval, the next allocation through the main allocator (SLAB or
|
||||
SLUB) returns a guarded allocation from the KFENCE object pool (allocation
|
||||
sizes up to PAGE_SIZE are supported). At this point, the timer is reset, and
|
||||
the next allocation is set up after the expiration of the interval. To "gate" a
|
||||
KFENCE allocation through the main allocator's fast-path without overhead,
|
||||
KFENCE relies on static branches via the static keys infrastructure. The static
|
||||
branch is toggled to redirect the allocation to KFENCE.
|
||||
|
||||
KFENCE objects each reside on a dedicated page, at either the left or right
|
||||
page boundaries selected at random. The pages to the left and right of the
|
||||
object page are "guard pages", whose attributes are changed to a protected
|
||||
state, and cause page faults on any attempted access. Such page faults are then
|
||||
intercepted by KFENCE, which handles the fault gracefully by reporting an
|
||||
out-of-bounds access, and marking the page as accessible so that the faulting
|
||||
code can (wrongly) continue executing (set ``panic_on_warn`` to panic instead).
|
||||
|
||||
To detect out-of-bounds writes to memory within the object's page itself,
|
||||
KFENCE also uses pattern-based redzones. For each object page, a redzone is set
|
||||
up for all non-object memory. For typical alignments, the redzone is only
|
||||
required on the unguarded side of an object. Because KFENCE must honor the
|
||||
cache's requested alignment, special alignments may result in unprotected gaps
|
||||
on either side of an object, all of which are redzoned.
|
||||
|
||||
The following figure illustrates the page layout::
|
||||
|
||||
---+-----------+-----------+-----------+-----------+-----------+---
|
||||
| xxxxxxxxx | O : | xxxxxxxxx | : O | xxxxxxxxx |
|
||||
| xxxxxxxxx | B : | xxxxxxxxx | : B | xxxxxxxxx |
|
||||
| x GUARD x | J : RED- | x GUARD x | RED- : J | x GUARD x |
|
||||
| xxxxxxxxx | E : ZONE | xxxxxxxxx | ZONE : E | xxxxxxxxx |
|
||||
| xxxxxxxxx | C : | xxxxxxxxx | : C | xxxxxxxxx |
|
||||
| xxxxxxxxx | T : | xxxxxxxxx | : T | xxxxxxxxx |
|
||||
---+-----------+-----------+-----------+-----------+-----------+---
|
||||
|
||||
Upon deallocation of a KFENCE object, the object's page is again protected and
|
||||
the object is marked as freed. Any further access to the object causes a fault
|
||||
and KFENCE reports a use-after-free access. Freed objects are inserted at the
|
||||
tail of KFENCE's freelist, so that the least recently freed objects are reused
|
||||
first, and the chances of detecting use-after-frees of recently freed objects
|
||||
is increased.
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
The following describes the functions which are used by allocators as well as
|
||||
page handling code to set up and deal with KFENCE allocations.
|
||||
|
||||
.. kernel-doc:: include/linux/kfence.h
|
||||
:functions: is_kfence_address
|
||||
kfence_shutdown_cache
|
||||
kfence_alloc kfence_free __kfence_free
|
||||
kfence_ksize kfence_object_start
|
||||
kfence_handle_page_fault
|
||||
|
||||
Related Tools
|
||||
-------------
|
||||
|
||||
In userspace, a similar approach is taken by `GWP-ASan
|
||||
<http://llvm.org/docs/GwpAsan.html>`_. GWP-ASan also relies on guard pages and
|
||||
a sampling strategy to detect memory unsafety bugs at scale. KFENCE's design is
|
||||
directly influenced by GWP-ASan, and can be seen as its kernel sibling. Another
|
||||
similar but non-sampling approach, that also inspired the name "KFENCE", can be
|
||||
found in the userspace `Electric Fence Malloc Debugger
|
||||
<https://linux.die.net/man/3/efence>`_.
|
||||
|
||||
In the kernel, several tools exist to debug memory access errors, and in
|
||||
particular KASAN can detect all bug classes that KFENCE can detect. While KASAN
|
||||
is more precise, relying on compiler instrumentation, this comes at a
|
||||
performance cost.
|
||||
|
||||
It is worth highlighting that KASAN and KFENCE are complementary, with
|
||||
different target environments. For instance, KASAN is the better debugging-aid,
|
||||
where test cases or reproducers exists: due to the lower chance to detect the
|
||||
error, it would require more effort using KFENCE to debug. Deployments at scale
|
||||
that cannot afford to enable KASAN, however, would benefit from using KFENCE to
|
||||
discover bugs due to code paths not exercised by test cases or fuzzers.
|
||||
|
|
@ -46,8 +46,10 @@ non-privileged mounts. This opens up new possibilities for the use of
|
|||
filesystems. A good example is sshfs: a secure network filesystem
|
||||
using the sftp protocol.
|
||||
|
||||
The userspace library and utilities are available from the
|
||||
`FUSE homepage: <https://github.com/libfuse/>`_
|
||||
The userspace library and utilities are available from the FUSE
|
||||
homepage:
|
||||
|
||||
http://fuse.sourceforge.net/
|
||||
|
||||
Filesystem type
|
||||
~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -1823,20 +1823,18 @@ if precise results are needed.
|
|||
3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
|
||||
---------------------------------------------------------------
|
||||
This file provides information associated with an opened file. The regular
|
||||
files have at least four fields -- 'pos', 'flags', 'mnt_id' and 'ino'.
|
||||
The 'pos' represents the current offset of the opened file in decimal
|
||||
form [see lseek(2) for details], 'flags' denotes the octal O_xxx mask the
|
||||
file has been created with [see open(2) for details] and 'mnt_id' represents
|
||||
mount ID of the file system containing the opened file [see 3.5
|
||||
/proc/<pid>/mountinfo for details]. 'ino' represents the inode number of
|
||||
the file.
|
||||
files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos'
|
||||
represents the current offset of the opened file in decimal form [see lseek(2)
|
||||
for details], 'flags' denotes the octal O_xxx mask the file has been
|
||||
created with [see open(2) for details] and 'mnt_id' represents mount ID of
|
||||
the file system containing the opened file [see 3.5 /proc/<pid>/mountinfo
|
||||
for details].
|
||||
|
||||
A typical output is
|
||||
|
||||
pos: 0
|
||||
flags: 0100002
|
||||
mnt_id: 19
|
||||
ino: 63107
|
||||
|
||||
All locks associated with a file descriptor are shown in its fdinfo too.
|
||||
|
||||
|
|
@ -1850,7 +1848,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
eventfd-count: 5a
|
||||
|
||||
where 'eventfd-count' is hex value of a counter.
|
||||
|
|
@ -1860,7 +1857,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
sigmask: 0000000000000200
|
||||
|
||||
where 'sigmask' is hex value of the signal mask associated
|
||||
|
|
@ -1871,7 +1867,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
tfd: 5 events: 1d data: ffffffffffffffff pos:0 ino:61af sdev:7
|
||||
|
||||
where 'tfd' is a target file descriptor number in decimal form,
|
||||
|
|
@ -1888,8 +1883,6 @@ pair provide additional information particular to the objects they represent.
|
|||
|
||||
pos: 0
|
||||
flags: 02000000
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d
|
||||
|
||||
where 'wd' is a watch descriptor in decimal form, ie a target file
|
||||
|
|
@ -1912,7 +1905,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
fanotify flags:10 event-flags:0
|
||||
fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003
|
||||
fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4
|
||||
|
|
@ -1935,7 +1927,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
clockid: 0
|
||||
ticks: 0
|
||||
settime flags: 01
|
||||
|
|
@ -1950,22 +1941,6 @@ pair provide additional information particular to the objects they represent.
|
|||
with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value'
|
||||
still exhibits timer's remaining time.
|
||||
|
||||
DMA Buffer files
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
size: 32768
|
||||
count: 2
|
||||
exp_name: system-heap
|
||||
|
||||
where 'size' is the size of the DMA buffer in bytes. 'count' is the file count of
|
||||
the DMA buffer file. 'exp_name' is the name of the DMA buffer exporter.
|
||||
|
||||
3.9 /proc/<pid>/map_files - Information about memory mapped files
|
||||
---------------------------------------------------------------------
|
||||
This directory contains symbolic links which represent memory mapped files
|
||||
|
|
|
|||
|
|
@ -1660,14 +1660,6 @@ accept_ra_min_hop_limit - INTEGER
|
|||
|
||||
Default: 1
|
||||
|
||||
accept_ra_min_lft - INTEGER
|
||||
Minimum acceptable lifetime value in Router Advertisement.
|
||||
|
||||
RA sections with a lifetime less than this value shall be
|
||||
ignored. Zero lifetimes stay unaffected.
|
||||
|
||||
Default: 0
|
||||
|
||||
accept_ra_pinfo - BOOLEAN
|
||||
Learn Prefix Information in Router Advertisement.
|
||||
|
||||
|
|
|
|||
|
|
@ -6742,8 +6742,7 @@ F: drivers/platform/x86/fujitsu-tablet.c
|
|||
FUSE: FILESYSTEM IN USERSPACE
|
||||
M: Miklos Szeredi <miklos@szeredi.hu>
|
||||
L: linux-fsdevel@vger.kernel.org
|
||||
S: Maintained
|
||||
W: https://github.com/libfuse/
|
||||
W: http://fuse.sourceforge.net/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git
|
||||
S: Maintained
|
||||
F: fs/fuse/
|
||||
|
|
@ -9141,7 +9140,6 @@ F: include/linux/skmsg.h
|
|||
F: net/core/skmsg.c
|
||||
F: net/core/sock_map.c
|
||||
F: net/ipv4/tcp_bpf.c
|
||||
F: net/ipv4/udp_bpf.c
|
||||
|
||||
LANTIQ / INTEL Ethernet drivers
|
||||
M: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
|
|
@ -12851,7 +12849,6 @@ S: Maintained
|
|||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
|
||||
F: samples/pidfd/
|
||||
F: tools/testing/selftests/pidfd/
|
||||
F: tools/testing/selftests/clone3/
|
||||
K: (?i)pidfd
|
||||
K: (?i)clone3
|
||||
K: \b(clone_args|kernel_clone_args)\b
|
||||
|
|
|
|||
23
Makefile
23
Makefile
|
|
@ -596,11 +596,9 @@ CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
|
|||
endif # CROSS_COMPILE
|
||||
|
||||
ifeq ($(LLVM_IAS),0)
|
||||
CLANG_FLAGS += -fno-integrated-as
|
||||
CLANG_FLAGS += -no-integrated-as
|
||||
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
|
||||
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
|
||||
else
|
||||
CLANG_FLAGS += -fintegrated-as
|
||||
endif
|
||||
CLANG_FLAGS += -Werror=unknown-warning-option
|
||||
KBUILD_CPPFLAGS += $(CLANG_FLAGS)
|
||||
|
|
@ -873,8 +871,7 @@ DEBUG_CFLAGS += -gsplit-dwarf
|
|||
else
|
||||
DEBUG_CFLAGS += -g
|
||||
endif
|
||||
|
||||
ifdef CONFIG_AS_IS_LLVM
|
||||
ifeq ($(LLVM_IAS),1)
|
||||
KBUILD_AFLAGS += -g
|
||||
else
|
||||
KBUILD_AFLAGS += -Wa,-gdwarf-2
|
||||
|
|
@ -947,6 +944,7 @@ endif
|
|||
ifdef CONFIG_LTO_CLANG
|
||||
ifdef CONFIG_THINLTO
|
||||
CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit)
|
||||
KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache
|
||||
else
|
||||
CC_FLAGS_LTO_CLANG := -flto
|
||||
endif
|
||||
|
|
@ -963,8 +961,7 @@ endif
|
|||
|
||||
ifdef CONFIG_LTO
|
||||
CC_FLAGS_LTO := $(CC_FLAGS_LTO_CLANG)
|
||||
KBUILD_CFLAGS += -fno-lto $(CC_FLAGS_LTO)
|
||||
KBUILD_AFLAGS += -fno-lto
|
||||
KBUILD_CFLAGS += $(CC_FLAGS_LTO)
|
||||
export CC_FLAGS_LTO
|
||||
endif
|
||||
|
||||
|
|
@ -1017,6 +1014,15 @@ KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
|||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
# clang sets -fmerge-all-constants by default as optimization, but this
|
||||
# is non-conforming behavior for C and in fact breaks the kernel, so we
|
||||
# need to disable it here generally.
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
|
||||
|
||||
# for gcc -fno-merge-all-constants disables everything, but it is fine
|
||||
# to have actual conforming behavior enabled.
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)
|
||||
|
||||
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
|
||||
|
||||
|
|
@ -1058,8 +1064,7 @@ LDFLAGS_vmlinux += $(call ld-option, -X,)
|
|||
endif
|
||||
|
||||
ifeq ($(CONFIG_RELR),y)
|
||||
# ld.lld before 15 did not support -z pack-relative-relocs.
|
||||
LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z pack-relative-relocs)
|
||||
LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags
|
||||
endif
|
||||
|
||||
# userspace programs are linked via the compiler, use the correct linker
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
LTS_5.4.302_91d385eb2a41
|
||||
LTS_5.4.289_4c8fb3275889
|
||||
|
|
|
|||
|
|
@ -124,8 +124,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 68
|
||||
|
||||
#define SO_NETNS_COOKIE 71
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
4
arch/arm/configs/vendor/sdxlemur.config
vendored
4
arch/arm/configs/vendor/sdxlemur.config
vendored
|
|
@ -51,10 +51,6 @@ CONFIG_CNSS_ASYNC=y
|
|||
CONFIG_CNSS_QCA6490=y
|
||||
CONFIG_CNSS_UTILS=y
|
||||
# CONFIG_CNSS_GENL is not set
|
||||
CONFIG_CNSS=m
|
||||
CONFIG_CNSS_CRYPTO=y
|
||||
CONFIG_CNSS_PCI=y
|
||||
CONFIG_CNSS_LOGGER=m
|
||||
CONFIG_QCOM_MEMORY_DUMP_V2=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ generic-y += mmiowb.h
|
|||
generic-y += msi.h
|
||||
generic-y += parport.h
|
||||
generic-y += preempt.h
|
||||
generic-y += seccomp.h
|
||||
generic-y += serial.h
|
||||
generic-y += trace_clock.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARM
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "arm"
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -129,7 +129,6 @@ config ARM64
|
|||
select HAVE_ARCH_JUMP_LABEL_RELATIVE
|
||||
select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
|
||||
select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
|
||||
select HAVE_ARCH_KFENCE
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_ARCH_MMAP_RND_BITS
|
||||
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 60 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
label = "google_key";
|
||||
gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
linux,code = <KEY_ASSISTANT>;
|
||||
linux,code = <KEY_SEARCH>;
|
||||
gpio-key,wakeup;
|
||||
debounce-interval = <15>;
|
||||
linux,can-disable;
|
||||
|
|
|
|||
|
|
@ -209,27 +209,14 @@ CONFIG_L2TP=y
|
|||
CONFIG_BRIDGE=y
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_PRIO=y
|
||||
CONFIG_NET_SCH_MULTIQ=y
|
||||
CONFIG_NET_SCH_TBF=y
|
||||
CONFIG_NET_SCH_NETEM=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_CLS_U32_MARK=y
|
||||
CONFIG_NET_CLS_FLOW=y
|
||||
CONFIG_NET_CLS_BPF=y
|
||||
CONFIG_NET_CLS_MATCHALL=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_EMATCH_CMP=y
|
||||
CONFIG_NET_EMATCH_NBYTE=y
|
||||
CONFIG_NET_EMATCH_U32=y
|
||||
CONFIG_NET_EMATCH_META=y
|
||||
CONFIG_NET_EMATCH_TEXT=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_NET_ACT_SKBEDIT=y
|
||||
CONFIG_NET_ACT_BPF=y
|
||||
CONFIG_BPF_JIT=y
|
||||
CONFIG_BT=y
|
||||
|
|
@ -513,7 +500,6 @@ CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
|
|||
CONFIG_QUOTA=y
|
||||
CONFIG_QFMT_V2=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_FUSE_BPF=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
|
|
@ -603,9 +589,6 @@ CONFIG_DEBUG_INFO_DWARF4=y
|
|||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_STACK_USAGE=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=500
|
||||
CONFIG_KFENCE_NUM_OBJECTS=63
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
# CONFIG_DETECT_HUNG_TASK is not set
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
|
|
|
|||
|
|
@ -17,49 +17,9 @@ CONFIG_IBIZA_DTB=y
|
|||
|
||||
# Camera
|
||||
CONFIG_CAM_SENSOR_PROBE_RETRY=y
|
||||
CONFIG_CAMERA_CCI_INTF=m
|
||||
# CONFIG_CAMERA_CCI_MASTER_CHANGE is not set
|
||||
CONFIG_REGULATOR_WL2864C=m
|
||||
|
||||
# Charger
|
||||
CONFIG_MMI_SMBCHARGER_IIO=m
|
||||
CONFIG_QG_LEGACY=y
|
||||
CONFIG_QPNP_ADAPTIVE_CHARGE=m
|
||||
|
||||
# Fingerprint
|
||||
CONFIG_INPUT_CHIPONE_FPS_MMI=m
|
||||
CONFIG_INPUT_MISC_FPC1020=m
|
||||
CONFIG_INPUT_MISC_FPC1020_SAVE_TO_CLASS_DEVICE=y
|
||||
|
||||
# MMI
|
||||
CONFIG_MMI_ANNOTATE=m
|
||||
CONFIG_MMI_INFO=m
|
||||
CONFIG_MMI_RELAY=m
|
||||
CONFIG_MMI_SYS_TEMP=m
|
||||
CONFIG_MOTO_UTAGS=m
|
||||
CONFIG_SENSORS_CLASS=m
|
||||
|
||||
# NFC
|
||||
CONFIG_NFC_QTI_I2C=m
|
||||
|
||||
# SAR
|
||||
CONFIG_SARSENSOR_SX937X=m
|
||||
|
||||
# Touchscreen
|
||||
CONFIG_TOUCHSCREEN_NT36xxx_HOSTDL_SPI_MMI=m
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_ENABLE_DOUBLE_TAP=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_NOTIFY_TOUCH_STATE=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_LAST_TIME=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_STOWED_MODE_EN=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_CHIP_VER_1=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_WAKEUP_GESTURE_CTRL=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_STYLUS_PALM=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_DDA_STYLUS=y
|
||||
CONFIG_TOUCHSCREEN_NOVA_0FLASH_MMI_PEN_NOTIFIER=y
|
||||
CONFIG_TOUCHSCREEN_CHIPONE_TDDI=m
|
||||
CONFIG_TOUCHSCREEN_CHIPONE_TDDI_ESD=y
|
||||
CONFIG_BOARD_USES_DOUBLE_TAP_CTRL=y
|
||||
|
||||
# UFS
|
||||
# CONFIG_UFSFEATURE is not set
|
||||
|
|
|
|||
16
arch/arm64/configs/vendor/holi-qgki_defconfig
vendored
16
arch/arm64/configs/vendor/holi-qgki_defconfig
vendored
|
|
@ -239,27 +239,15 @@ CONFIG_BRIDGE=y
|
|||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_PRIO=y
|
||||
CONFIG_NET_SCH_MULTIQ=y
|
||||
CONFIG_NET_SCH_TBF=y
|
||||
CONFIG_NET_SCH_NETEM=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_CLS_FW=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_CLS_U32_MARK=y
|
||||
CONFIG_NET_CLS_FLOW=y
|
||||
CONFIG_NET_CLS_BPF=y
|
||||
CONFIG_NET_CLS_MATCHALL=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_EMATCH_CMP=y
|
||||
CONFIG_NET_EMATCH_NBYTE=y
|
||||
CONFIG_NET_EMATCH_U32=y
|
||||
CONFIG_NET_EMATCH_META=y
|
||||
CONFIG_NET_EMATCH_TEXT=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_NET_ACT_SKBEDIT=y
|
||||
CONFIG_NET_ACT_BPF=y
|
||||
CONFIG_QRTR=y
|
||||
CONFIG_QRTR_SMD=y
|
||||
|
|
@ -782,7 +770,6 @@ CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
|
|||
CONFIG_QUOTA=y
|
||||
CONFIG_QFMT_V2=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_FUSE_BPF=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_INCREMENTAL_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
|
|
@ -878,9 +865,6 @@ CONFIG_HEADERS_INSTALL=y
|
|||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_STACK_USAGE=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=500
|
||||
CONFIG_KFENCE_NUM_OBJECTS=63
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
# CONFIG_DETECT_HUNG_TASK is not set
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* arm64 KFENCE support.
|
||||
*
|
||||
* Copyright (C) 2020, Google LLC.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_KFENCE_H
|
||||
#define __ASM_KFENCE_H
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
static inline bool arch_kfence_init_pool(void) { return true; }
|
||||
|
||||
static inline bool kfence_protect_page(unsigned long addr, bool protect)
|
||||
{
|
||||
set_memory_valid(addr, 1, !protect);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* __ASM_KFENCE_H */
|
||||
|
|
@ -19,13 +19,4 @@
|
|||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_AARCH64
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "aarch64"
|
||||
#ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT AUDIT_ARCH_ARM
|
||||
# define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "arm"
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include <linux/acpi.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/extable.h>
|
||||
#include <linux/kfence.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
|
@ -328,9 +327,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
|
|||
} else if (addr < PAGE_SIZE) {
|
||||
msg = "NULL pointer dereference";
|
||||
} else {
|
||||
if (kfence_handle_page_fault(addr, esr & ESR_ELx_WNR, regs))
|
||||
return;
|
||||
|
||||
msg = "paging request";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -471,8 +471,7 @@ static void __init map_mem(pgd_t *pgdp)
|
|||
struct memblock_region *reg;
|
||||
int flags = 0;
|
||||
|
||||
if (rodata_full || debug_pagealloc_enabled() ||
|
||||
IS_ENABLED(CONFIG_KFENCE))
|
||||
if (rodata_full || debug_pagealloc_enabled())
|
||||
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
|
||||
|
||||
/*
|
||||
|
|
@ -1471,12 +1470,7 @@ int arch_add_memory(int nid, u64 start, u64 size,
|
|||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* KFENCE requires linear map to be mapped at page granularity, so that
|
||||
* it is possible to protect/unprotect single pages in the KFENCE pool.
|
||||
*/
|
||||
if (rodata_full || debug_pagealloc_enabled() ||
|
||||
IS_ENABLED(CONFIG_KFENCE))
|
||||
if (rodata_full || debug_pagealloc_enabled())
|
||||
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
|
||||
|
||||
__create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_CSKY
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "csky"
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -9,12 +9,12 @@ static inline const int *get_compat_mode1_syscalls(void)
|
|||
static const int syscalls_O32[] = {
|
||||
__NR_O32_Linux + 3, __NR_O32_Linux + 4,
|
||||
__NR_O32_Linux + 1, __NR_O32_Linux + 193,
|
||||
-1, /* negative terminated */
|
||||
0, /* null terminated */
|
||||
};
|
||||
static const int syscalls_N32[] = {
|
||||
__NR_N32_Linux + 0, __NR_N32_Linux + 1,
|
||||
__NR_N32_Linux + 58, __NR_N32_Linux + 211,
|
||||
-1, /* negative terminated */
|
||||
0, /* null terminated */
|
||||
};
|
||||
|
||||
if (IS_ENABLED(CONFIG_MIPS32_O32) && test_thread_flag(TIF_32BIT_REGS))
|
||||
|
|
|
|||
|
|
@ -135,8 +135,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 68
|
||||
|
||||
#define SO_NETNS_COOKIE 71
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ generic-y += mm-arch-hooks.h
|
|||
generic-y += mmiowb.h
|
||||
generic-y += percpu.h
|
||||
generic-y += preempt.h
|
||||
generic-y += seccomp.h
|
||||
generic-y += trace_clock.h
|
||||
generic-y += user.h
|
||||
generic-y += vga.h
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PARISC64
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "parisc64"
|
||||
# ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT AUDIT_ARCH_PARISC
|
||||
# define SECCOMP_ARCH_COMPAT_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "parisc"
|
||||
# endif
|
||||
#else /* !CONFIG_64BIT */
|
||||
# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PARISC
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "parisc"
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -116,8 +116,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 0x4042
|
||||
|
||||
#define SO_NETNS_COOKIE 0x4045
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
|
|
@ -8,27 +8,4 @@
|
|||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define __SECCOMP_ARCH_LE __AUDIT_ARCH_LE
|
||||
#define __SECCOMP_ARCH_LE_NAME "le"
|
||||
#else
|
||||
#define __SECCOMP_ARCH_LE 0
|
||||
#define __SECCOMP_ARCH_LE_NAME
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
# define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC64 | __SECCOMP_ARCH_LE)
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "ppc64" __SECCOMP_ARCH_LE_NAME
|
||||
# ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE)
|
||||
# define SECCOMP_ARCH_COMPAT_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "ppc" __SECCOMP_ARCH_LE_NAME
|
||||
# endif
|
||||
#else /* !CONFIG_PPC64 */
|
||||
# define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_PPC | __SECCOMP_ARCH_LE)
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "ppc" __SECCOMP_ARCH_LE_NAME
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_POWERPC_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ ifeq ($(CONFIG_LD_IS_LLD),y)
|
|||
ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0)
|
||||
KBUILD_CFLAGS += -mno-relax
|
||||
KBUILD_AFLAGS += -mno-relax
|
||||
ifndef CONFIG_AS_IS_LLVM
|
||||
ifneq ($(LLVM_IAS),1)
|
||||
KBUILD_CFLAGS += -Wa,-mno-relax
|
||||
KBUILD_AFLAGS += -Wa,-mno-relax
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -16,13 +16,4 @@
|
|||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_S390X
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "s390x"
|
||||
#ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT AUDIT_ARCH_S390
|
||||
# define SECCOMP_ARCH_COMPAT_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "s390"
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_S390_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -8,14 +8,4 @@
|
|||
#define __NR_seccomp_exit __NR_exit
|
||||
#define __NR_seccomp_sigreturn __NR_rt_sigreturn
|
||||
|
||||
#ifdef CONFIG_CPU_LITTLE_ENDIAN
|
||||
#define __SECCOMP_ARCH_LE __AUDIT_ARCH_LE
|
||||
#else
|
||||
#define __SECCOMP_ARCH_LE 0
|
||||
#endif
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE (AUDIT_ARCH_SH | __SECCOMP_ARCH_LE)
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "sh"
|
||||
|
||||
#endif /* __ASM_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -117,8 +117,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 0x0047
|
||||
|
||||
#define SO_NETNS_COOKIE 0x0050
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,6 @@ config X86
|
|||
select HAVE_ARCH_JUMP_LABEL
|
||||
select HAVE_ARCH_JUMP_LABEL_RELATIVE
|
||||
select HAVE_ARCH_KASAN if X86_64
|
||||
select HAVE_ARCH_KFENCE
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_ARCH_MMAP_RND_BITS if MMU
|
||||
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
|
||||
|
|
|
|||
|
|
@ -188,27 +188,14 @@ CONFIG_L2TP=y
|
|||
CONFIG_BRIDGE=y
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_PRIO=y
|
||||
CONFIG_NET_SCH_MULTIQ=y
|
||||
CONFIG_NET_SCH_TBF=y
|
||||
CONFIG_NET_SCH_NETEM=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_CLS_U32_MARK=y
|
||||
CONFIG_NET_CLS_FLOW=y
|
||||
CONFIG_NET_CLS_BPF=y
|
||||
CONFIG_NET_CLS_MATCHALL=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_EMATCH_CMP=y
|
||||
CONFIG_NET_EMATCH_NBYTE=y
|
||||
CONFIG_NET_EMATCH_U32=y
|
||||
CONFIG_NET_EMATCH_META=y
|
||||
CONFIG_NET_EMATCH_TEXT=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_NET_ACT_SKBEDIT=y
|
||||
CONFIG_NET_ACT_BPF=y
|
||||
CONFIG_BPF_JIT=y
|
||||
CONFIG_BT=y
|
||||
|
|
@ -442,7 +429,6 @@ CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y
|
|||
CONFIG_QUOTA=y
|
||||
CONFIG_QFMT_V2=y
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_FUSE_BPF=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
|
|
@ -534,9 +520,6 @@ CONFIG_DEBUG_INFO_DWARF4=y
|
|||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_STACK_USAGE=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=500
|
||||
CONFIG_KFENCE_NUM_OBJECTS=63
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
# CONFIG_DETECT_HUNG_TASK is not set
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* x86 KFENCE support.
|
||||
*
|
||||
* Copyright (C) 2020, Google LLC.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_X86_KFENCE_H
|
||||
#define _ASM_X86_KFENCE_H
|
||||
|
||||
#include <linux/bug.h>
|
||||
#include <linux/kfence.h>
|
||||
|
||||
#include <asm/pgalloc.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/set_memory.h>
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
/* Force 4K pages for __kfence_pool. */
|
||||
static inline bool arch_kfence_init_pool(void)
|
||||
{
|
||||
unsigned long addr;
|
||||
|
||||
for (addr = (unsigned long)__kfence_pool; is_kfence_address((void *)addr);
|
||||
addr += PAGE_SIZE) {
|
||||
unsigned int level;
|
||||
|
||||
if (!lookup_address(addr, &level))
|
||||
return false;
|
||||
|
||||
if (level != PG_LEVEL_4K)
|
||||
set_memory_4k(addr, 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Protect the given page and flush TLB. */
|
||||
static inline bool kfence_protect_page(unsigned long addr, bool protect)
|
||||
{
|
||||
unsigned int level;
|
||||
pte_t *pte = lookup_address(addr, &level);
|
||||
|
||||
if (WARN_ON(!pte || level != PG_LEVEL_4K))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* We need to avoid IPIs, as we may get KFENCE allocations or faults
|
||||
* with interrupts disabled. Therefore, the below is best-effort, and
|
||||
* does not flush TLBs on all CPUs. We can tolerate some inaccuracy;
|
||||
* lazy fault handling takes care of faults after the page is PRESENT.
|
||||
*/
|
||||
|
||||
if (protect)
|
||||
set_pte(pte, __pte(pte_val(*pte) & ~_PAGE_PRESENT));
|
||||
else
|
||||
set_pte(pte, __pte(pte_val(*pte) | _PAGE_PRESENT));
|
||||
|
||||
/* Flush this CPU's TLB. */
|
||||
__flush_tlb_one_kernel(addr);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* _ASM_X86_KFENCE_H */
|
||||
|
|
@ -16,26 +16,6 @@
|
|||
#define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_X86_64
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "x86_64"
|
||||
# ifdef CONFIG_COMPAT
|
||||
# define SECCOMP_ARCH_COMPAT AUDIT_ARCH_I386
|
||||
# define SECCOMP_ARCH_COMPAT_NR IA32_NR_syscalls
|
||||
# define SECCOMP_ARCH_COMPAT_NAME "ia32"
|
||||
# endif
|
||||
/*
|
||||
* x32 will have __X32_SYSCALL_BIT set in syscall number. We don't support
|
||||
* caching them and they are treated as out of range syscalls, which will
|
||||
* always pass through the BPF filter.
|
||||
*/
|
||||
#else /* !CONFIG_X86_64 */
|
||||
# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_I386
|
||||
# define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
# define SECCOMP_ARCH_NATIVE_NAME "ia32"
|
||||
#endif
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#endif /* _ASM_X86_SECCOMP_H */
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <linux/kdebug.h> /* oops_begin/end, ... */
|
||||
#include <linux/extable.h> /* search_exception_tables */
|
||||
#include <linux/memblock.h> /* max_low_pfn */
|
||||
#include <linux/kfence.h> /* kfence_handle_page_fault */
|
||||
#include <linux/kprobes.h> /* NOKPROBE_SYMBOL, ... */
|
||||
#include <linux/mmiotrace.h> /* kmmio_handler, ... */
|
||||
#include <linux/perf_event.h> /* perf_sw_event */
|
||||
|
|
@ -802,11 +801,6 @@ no_context(struct pt_regs *regs, unsigned long error_code,
|
|||
if (IS_ENABLED(CONFIG_EFI))
|
||||
efi_recover_from_page_fault(address);
|
||||
|
||||
/* Only not-present faults should be handled by KFENCE. */
|
||||
if (!(error_code & X86_PF_PROT) &&
|
||||
kfence_handle_page_fault(address, error_code & X86_PF_WRITE, regs))
|
||||
return;
|
||||
|
||||
oops:
|
||||
/*
|
||||
* Oops. The kernel tried to access some bad page. We'll have to
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_XTENSA
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "xtensa"
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -504,6 +504,8 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
|
|||
if (!q->stats)
|
||||
goto fail_stats;
|
||||
|
||||
q->backing_dev_info->ra_pages = VM_READAHEAD_PAGES;
|
||||
q->backing_dev_info->io_pages = VM_READAHEAD_PAGES;
|
||||
q->backing_dev_info->capabilities = BDI_CAP_CGROUP_WRITEBACK;
|
||||
q->backing_dev_info->name = "block";
|
||||
q->node = node_id;
|
||||
|
|
|
|||
|
|
@ -6923,7 +6923,7 @@ const struct file_operations binder_fops = {
|
|||
.owner = THIS_MODULE,
|
||||
.poll = binder_poll,
|
||||
.unlocked_ioctl = binder_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = binder_ioctl,
|
||||
.mmap = binder_mmap,
|
||||
.open = binder_open,
|
||||
.flush = binder_flush,
|
||||
|
|
|
|||
|
|
@ -3495,7 +3495,7 @@ static int cdrom_print_info(const char *header, int val, char *info,
|
|||
}
|
||||
|
||||
static int cdrom_sysctl_info(struct ctl_table *ctl, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos)
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
int pos;
|
||||
char *info = cdrom_sysctl_settings.info;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/* Uncomment this block to log an error on every VERIFY failure */
|
||||
|
|
@ -62,7 +62,6 @@
|
|||
#define TZ_PIL_AUTH_QDSP6_PROC 1
|
||||
|
||||
#define FASTRPC_DMAHANDLE_NOMAP (16)
|
||||
#define FASTRPC_MAP_DMA_HANDLE 0x20000
|
||||
|
||||
#define FASTRPC_ENOSUCH 39
|
||||
#define DEBUGFS_SIZE 3072
|
||||
|
|
@ -444,7 +443,6 @@ struct smq_invoke_ctx {
|
|||
uint32_t sc_interrupted;
|
||||
struct fastrpc_file *fl_interrupted;
|
||||
uint32_t handle_interrupted;
|
||||
struct timespec64 invoke_start_time; /* submission timestamp for async perf */
|
||||
};
|
||||
|
||||
struct fastrpc_ctx_lst {
|
||||
|
|
@ -1130,7 +1128,7 @@ static void fastrpc_mmap_add(struct fastrpc_mmap *map)
|
|||
}
|
||||
|
||||
static int fastrpc_mmap_find(struct fastrpc_file *fl, int fd,
|
||||
uintptr_t va, size_t len, int mflags, bool refs,
|
||||
uintptr_t va, size_t len, int mflags, int refs,
|
||||
struct fastrpc_mmap **ppmap)
|
||||
{
|
||||
struct fastrpc_mmap *match = NULL, *map = NULL;
|
||||
|
|
@ -1308,7 +1306,7 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags)
|
|||
dma_free_attrs(me->dev, map->size, (void *)map->va,
|
||||
(dma_addr_t)map->phys, (unsigned long)map->attr);
|
||||
}
|
||||
} else if (map->flags & FASTRPC_DMAHANDLE_NOMAP) {
|
||||
} else if (map->flags == FASTRPC_DMAHANDLE_NOMAP) {
|
||||
trace_fastrpc_dma_unmap(cid, map->phys, map->size);
|
||||
if (!IS_ERR_OR_NULL(map->table))
|
||||
dma_buf_unmap_attachment(map->attach, map->table,
|
||||
|
|
@ -1393,7 +1391,6 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd,
|
|||
unsigned long flags;
|
||||
int err = 0, vmid, sgl_index = 0;
|
||||
struct scatterlist *sgl = NULL;
|
||||
bool take_ref = true;
|
||||
|
||||
if (!fl) {
|
||||
err = -EBADF;
|
||||
|
|
@ -1407,9 +1404,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd,
|
|||
}
|
||||
chan = &apps->channel[cid];
|
||||
|
||||
if (mflags & FASTRPC_MAP_DMA_HANDLE)
|
||||
take_ref = false;
|
||||
if (!fastrpc_mmap_find(fl, fd, va, len, mflags, take_ref, ppmap))
|
||||
if (!fastrpc_mmap_find(fl, fd, va, len, mflags, 1, ppmap))
|
||||
return 0;
|
||||
map = kzalloc(sizeof(*map), GFP_KERNEL);
|
||||
VERIFY(err, !IS_ERR_OR_NULL(map));
|
||||
|
|
@ -1447,7 +1442,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd,
|
|||
if (err)
|
||||
goto bail;
|
||||
}
|
||||
} else if (mflags & FASTRPC_DMAHANDLE_NOMAP) {
|
||||
} else if (mflags == FASTRPC_DMAHANDLE_NOMAP) {
|
||||
if (map->attr & FASTRPC_ATTR_KEEP_MAP) {
|
||||
ADSPRPC_ERR("Invalid attribute 0x%x for fd %d\n",
|
||||
map->attr, fd);
|
||||
|
|
@ -2507,10 +2502,10 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
|
|||
handles = REMOTE_SCALARS_INHANDLES(sc) + REMOTE_SCALARS_OUTHANDLES(sc);
|
||||
mutex_lock(&ctx->fl->map_mutex);
|
||||
for (i = bufs; i < bufs + handles; i++) {
|
||||
int dmaflags = FASTRPC_MAP_DMA_HANDLE;
|
||||
int dmaflags = 0;
|
||||
|
||||
if (ctx->attrs && (ctx->attrs[i] & FASTRPC_ATTR_NOMAP))
|
||||
dmaflags |= FASTRPC_DMAHANDLE_NOMAP;
|
||||
dmaflags = FASTRPC_DMAHANDLE_NOMAP;
|
||||
if (ctx->fds && (ctx->fds[i] != -1))
|
||||
err = fastrpc_mmap_create(ctx->fl, ctx->fds[i],
|
||||
FASTRPC_ATTR_NOVA, 0, 0, dmaflags,
|
||||
|
|
@ -2671,7 +2666,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
|
|||
if (ctx->maps[i]) {
|
||||
/* check if map still exist */
|
||||
if (!fastrpc_mmap_find(ctx->fl, ctx->fds[i], 0, 0,
|
||||
0, false, &mmap)) {
|
||||
0, 0, &mmap)) {
|
||||
if (mmap) {
|
||||
pages[i].addr = mmap->phys;
|
||||
pages[i].size = mmap->size;
|
||||
|
|
@ -2886,7 +2881,7 @@ static int put_args(uint32_t kernel, struct smq_invoke_ctx *ctx,
|
|||
if (!fdlist[i])
|
||||
break;
|
||||
if (!fastrpc_mmap_find(ctx->fl, (int)fdlist[i], 0, 0,
|
||||
0, false, &mmap)) {
|
||||
0, 0, &mmap)) {
|
||||
if (mmap && mmap->dma_handle_refs) {
|
||||
mmap->dma_handle_refs = 0;
|
||||
fastrpc_mmap_free(mmap, 0);
|
||||
|
|
@ -3369,15 +3364,6 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode,
|
|||
inv_args(ctx);
|
||||
PERF_END);
|
||||
|
||||
/*
|
||||
* Store submission timestamp in ctx before sending to DSP.
|
||||
* For async invokes, perf->invoke will be updated in the collector
|
||||
* thread (fastrpc_wait_on_async_queue) where ctx is still valid,
|
||||
* measuring full end-to-end latency consistent with the sync path.
|
||||
*/
|
||||
if (fl->profile && isasyncinvoke)
|
||||
ctx->invoke_start_time = invoket;
|
||||
|
||||
PERF(fl->profile, GET_COUNTER(perf_counter, PERF_LINK),
|
||||
VERIFY(err, 0 == (err = fastrpc_invoke_send(ctx,
|
||||
kernel, invoke->handle)));
|
||||
|
|
@ -3439,6 +3425,9 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode,
|
|||
err = -ECONNRESET;
|
||||
|
||||
invoke_end:
|
||||
if (fl->profile && !interrupted && isasyncinvoke)
|
||||
fastrpc_update_invoke_count(invoke->handle, perf_counter,
|
||||
&invoket);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -3508,15 +3497,6 @@ bail:
|
|||
async_res->result = ierr;
|
||||
if (ctx) {
|
||||
if (fl->profile && ctx->perf && ctx->handle > FASTRPC_STATIC_HANDLE_MAX) {
|
||||
/*
|
||||
* Update invoke/count perf counters here where ctx->perf is
|
||||
* guaranteed valid. This measures full end-to-end async latency
|
||||
* (submit → DSP → collect), consistent with the sync path.
|
||||
* invoke_start_time was stored in ctx before fastrpc_invoke_send
|
||||
* in fastrpc_internal_invoke.
|
||||
*/
|
||||
fastrpc_update_invoke_count(ctx->handle, perf_counter,
|
||||
&ctx->invoke_start_time);
|
||||
trace_fastrpc_perf_counters(ctx->handle, ctx->sc,
|
||||
ctx->perf->count, ctx->perf->flush, ctx->perf->map,
|
||||
ctx->perf->copy, ctx->perf->link, ctx->perf->getargs,
|
||||
|
|
@ -4981,7 +4961,7 @@ static int fastrpc_internal_munmap_fd(struct fastrpc_file *fl,
|
|||
}
|
||||
mutex_lock(&fl->internal_map_mutex);
|
||||
mutex_lock(&fl->map_mutex);
|
||||
err = fastrpc_mmap_find(fl, ud->fd, ud->va, ud->len, 0, false, &map);
|
||||
err = fastrpc_mmap_find(fl, ud->fd, ud->va, ud->len, 0, 0, &map);
|
||||
if (err) {
|
||||
ADSPRPC_ERR(
|
||||
"mapping not found to unmap fd 0x%x, va 0x%llx, len 0x%x, err %d\n",
|
||||
|
|
|
|||
|
|
@ -799,11 +799,16 @@ early_param("random.trust_cpu", parse_trust_cpu);
|
|||
early_param("random.trust_bootloader", parse_trust_bootloader);
|
||||
|
||||
/*
|
||||
* This is called extremely early, before time keeping functionality is
|
||||
* available, but arch randomness is. Interrupts are not yet enabled.
|
||||
* The first collection of entropy occurs at system boot while interrupts
|
||||
* are still turned off. Here we push in latent entropy, RDSEED, a timestamp,
|
||||
* utsname(), and the command line. Depending on the above configuration knob,
|
||||
* RDSEED may be considered sufficient for initialization. Note that much
|
||||
* earlier setup may already have pushed entropy into the input pool by the
|
||||
* time we get here.
|
||||
*/
|
||||
void __init random_init_early(const char *command_line)
|
||||
int __init random_init(const char *command_line)
|
||||
{
|
||||
ktime_t now = ktime_get_real();
|
||||
unsigned int i, arch_bits;
|
||||
unsigned long entropy;
|
||||
|
||||
|
|
@ -816,41 +821,22 @@ void __init random_init_early(const char *command_line)
|
|||
i < BLAKE2S_BLOCK_SIZE; i += sizeof(entropy)) {
|
||||
if (!arch_get_random_seed_long_early(&entropy) &&
|
||||
!arch_get_random_long_early(&entropy)) {
|
||||
entropy = random_get_entropy();
|
||||
arch_bits -= sizeof(entropy) * 8;
|
||||
continue;
|
||||
}
|
||||
_mix_pool_bytes(&entropy, sizeof(entropy));
|
||||
}
|
||||
|
||||
_mix_pool_bytes(&now, sizeof(now));
|
||||
_mix_pool_bytes(utsname(), sizeof(*(utsname())));
|
||||
_mix_pool_bytes(command_line, strlen(command_line));
|
||||
add_latent_entropy();
|
||||
|
||||
/* Reseed if already seeded by earlier phases. */
|
||||
if (crng_ready())
|
||||
crng_reseed();
|
||||
else if (trust_cpu)
|
||||
_credit_init_bits(arch_bits);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is called a little bit after the prior function, and now there is
|
||||
* access to timestamps counters. Interrupts are not yet enabled.
|
||||
*/
|
||||
void __init random_init(void)
|
||||
{
|
||||
unsigned long entropy = random_get_entropy();
|
||||
ktime_t now = ktime_get_real();
|
||||
|
||||
_mix_pool_bytes(utsname(), sizeof(*(utsname())));
|
||||
_mix_pool_bytes(&now, sizeof(now));
|
||||
_mix_pool_bytes(&entropy, sizeof(entropy));
|
||||
add_latent_entropy();
|
||||
|
||||
/* Reseed if already seeded by earlier phases. */
|
||||
if (crng_ready())
|
||||
crng_reseed();
|
||||
|
||||
WARN(!entropy, "Missing cycle counter and fallback timer; RNG "
|
||||
"entropy collection will consequently suffer.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1491,7 +1477,7 @@ static int proc_do_uuid(struct ctl_table *table, int write, void *buf,
|
|||
}
|
||||
|
||||
/* The same as proc_dointvec, but writes don't change anything. */
|
||||
static int proc_do_rointvec(struct ctl_table *table, int write, void *buf,
|
||||
static int proc_do_rointvec(struct ctl_table *table, int write, void __user *buf,
|
||||
size_t *lenp, loff_t *ppos)
|
||||
{
|
||||
return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos);
|
||||
|
|
|
|||
|
|
@ -329,6 +329,10 @@ int qcedev_check_and_map_buffer(void *handle,
|
|||
mapped_size = binfo->ion_buf.mapped_buf_size;
|
||||
atomic_inc(&binfo->ref_count);
|
||||
|
||||
/* Add buffer mapping information to regd buffer list */
|
||||
mutex_lock(&qce_hndl->registeredbufs.lock);
|
||||
list_add_tail(&binfo->list, &qce_hndl->registeredbufs.list);
|
||||
mutex_unlock(&qce_hndl->registeredbufs.lock);
|
||||
}
|
||||
|
||||
/* Make sure the offset is within the mapped range */
|
||||
|
|
@ -340,13 +344,6 @@ int qcedev_check_and_map_buffer(void *handle,
|
|||
goto unmap;
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
/* Add buffer mapping information to regd buffer list */
|
||||
mutex_lock(&qce_hndl->registeredbufs.lock);
|
||||
list_add_tail(&binfo->list, &qce_hndl->registeredbufs.list);
|
||||
mutex_unlock(&qce_hndl->registeredbufs.lock);
|
||||
}
|
||||
|
||||
/* return the mapped virtual address adjusted by offset */
|
||||
*vaddr += offset;
|
||||
|
||||
|
|
@ -355,6 +352,9 @@ int qcedev_check_and_map_buffer(void *handle,
|
|||
unmap:
|
||||
if (!found) {
|
||||
qcedev_unmap_buffer(handle, mem_client, binfo);
|
||||
mutex_lock(&qce_hndl->registeredbufs.lock);
|
||||
list_del(&binfo->list);
|
||||
mutex_unlock(&qce_hndl->registeredbufs.lock);
|
||||
}
|
||||
|
||||
error:
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
|
|||
static const struct file_operations adf_ctl_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.unlocked_ioctl = adf_ctl_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = adf_ctl_ioctl,
|
||||
};
|
||||
|
||||
struct adf_ctl_drv_info {
|
||||
|
|
|
|||
|
|
@ -348,26 +348,6 @@ size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(dax_copy_to_iter);
|
||||
|
||||
int dax_zero_page_range(struct dax_device *dax_dev, pgoff_t pgoff,
|
||||
size_t nr_pages)
|
||||
{
|
||||
if (!dax_alive(dax_dev))
|
||||
return -ENXIO;
|
||||
|
||||
if (!dax_dev->ops->zero_page_range)
|
||||
return -EOPNOTSUPP;
|
||||
/*
|
||||
* There are no callers that want to zero more than one page as of now.
|
||||
* Once users are there, this check can be removed after the
|
||||
* device mapper code has been updated to split ranges across targets.
|
||||
*/
|
||||
if (nr_pages != 1)
|
||||
return -EIO;
|
||||
|
||||
return dax_dev->ops->zero_page_range(dax_dev, pgoff, nr_pages);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dax_zero_page_range);
|
||||
|
||||
#ifdef CONFIG_ARCH_HAS_PMEM_API
|
||||
void arch_wb_cache_pmem(void *addr, size_t size);
|
||||
void dax_flush(struct dax_device *dax_dev, void *addr, size_t size)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2014-2022, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "arm-memlat-mon: " fmt
|
||||
|
|
@ -126,7 +126,6 @@ struct memlat_mon {
|
|||
* @mons: All of the memlat_mon structs representing
|
||||
* the different voters who share this cpu_grp.
|
||||
* @mons_lock: A lock used to protect the @mons.
|
||||
* @init_mons_lock: A lock used to protect the @mons in probe routine.
|
||||
*/
|
||||
struct memlat_cpu_grp {
|
||||
cpumask_t cpus;
|
||||
|
|
@ -144,7 +143,6 @@ struct memlat_cpu_grp {
|
|||
unsigned int num_active_mons;
|
||||
struct memlat_mon *mons;
|
||||
struct mutex mons_lock;
|
||||
struct mutex init_mons_lock;
|
||||
spinlock_t mon_active_lock;
|
||||
};
|
||||
|
||||
|
|
@ -519,15 +517,11 @@ static int memlat_event_hotplug_going_down(unsigned int cpu)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: We must be holding cpus_read_lock() before calling this function
|
||||
* since we are using cpuslocked version of function inside it
|
||||
*/
|
||||
static int memlat_event_cpu_hp_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
|
||||
ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
|
||||
"MEMLAT_EVENT",
|
||||
memlat_event_hotplug_coming_up,
|
||||
memlat_event_hotplug_going_down);
|
||||
|
|
@ -857,7 +851,6 @@ static int memlat_cpu_grp_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
mutex_init(&cpu_grp->mons_lock);
|
||||
mutex_init(&cpu_grp->init_mons_lock);
|
||||
spin_lock_init(&cpu_grp->mon_active_lock);
|
||||
cpu_grp->update_ms = DEFAULT_UPDATE_MS;
|
||||
|
||||
|
|
@ -893,7 +886,7 @@ static int memlat_mon_probe(struct platform_device *pdev, bool is_compute)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
mutex_lock(&cpu_grp->init_mons_lock);
|
||||
mutex_lock(&cpu_grp->mons_lock);
|
||||
mon = &cpu_grp->mons[cpu_grp->num_inited_mons];
|
||||
spin_lock_irqsave(&cpu_grp->mon_active_lock, flags);
|
||||
mon->is_active = false;
|
||||
|
|
@ -1010,7 +1003,7 @@ static int memlat_mon_probe(struct platform_device *pdev, bool is_compute)
|
|||
cpu_grp->num_inited_mons++;
|
||||
|
||||
unlock_out:
|
||||
mutex_unlock(&cpu_grp->init_mons_lock);
|
||||
mutex_unlock(&cpu_grp->mons_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -882,7 +882,7 @@ int __suspend_bw_hwmon(struct bw_hwmon *hw, enum mon_reg_type type)
|
|||
struct bwmon *m = to_bwmon(hw);
|
||||
|
||||
mon_irq_disable(m, type);
|
||||
disable_irq(m->irq);
|
||||
free_irq(m->irq, m);
|
||||
mon_disable(m, type);
|
||||
mon_irq_clear(m, type);
|
||||
|
||||
|
|
@ -908,6 +908,7 @@ static __always_inline
|
|||
int __resume_bw_hwmon(struct bw_hwmon *hw, enum mon_reg_type type)
|
||||
{
|
||||
struct bwmon *m = to_bwmon(hw);
|
||||
int ret;
|
||||
irq_handler_t handler;
|
||||
|
||||
switch (type) {
|
||||
|
|
@ -923,7 +924,15 @@ int __resume_bw_hwmon(struct bw_hwmon *hw, enum mon_reg_type type)
|
|||
}
|
||||
|
||||
mon_clear(m, false, type);
|
||||
enable_irq(m->irq);
|
||||
ret = request_threaded_irq(m->irq, handler, bwmon_intr_thread,
|
||||
IRQF_ONESHOT | IRQF_SHARED,
|
||||
dev_name(m->dev), m);
|
||||
if (ret < 0) {
|
||||
dev_err(m->dev, "Unable to register interrupt handler! (%d)\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mon_irq_enable(m, type);
|
||||
mon_enable(m, type);
|
||||
|
||||
|
|
|
|||
|
|
@ -70,28 +70,28 @@ static struct devfreq *find_device_devfreq(struct device *dev)
|
|||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static long find_available_min_freq(struct devfreq *devfreq)
|
||||
static unsigned long find_available_min_freq(struct devfreq *devfreq)
|
||||
{
|
||||
struct dev_pm_opp *opp;
|
||||
long min_freq = 0;
|
||||
unsigned long min_freq = 0;
|
||||
|
||||
opp = dev_pm_opp_find_freq_ceil(devfreq->dev.parent, &min_freq);
|
||||
if (IS_ERR(opp))
|
||||
min_freq = PTR_ERR(opp);
|
||||
min_freq = 0;
|
||||
else
|
||||
dev_pm_opp_put(opp);
|
||||
|
||||
return min_freq;
|
||||
}
|
||||
|
||||
static long find_available_max_freq(struct devfreq *devfreq)
|
||||
static unsigned long find_available_max_freq(struct devfreq *devfreq)
|
||||
{
|
||||
struct dev_pm_opp *opp;
|
||||
long max_freq = LONG_MAX;
|
||||
unsigned long max_freq = ULONG_MAX;
|
||||
|
||||
opp = dev_pm_opp_find_freq_floor(devfreq->dev.parent, &max_freq);
|
||||
if (IS_ERR(opp))
|
||||
max_freq = PTR_ERR(opp);
|
||||
max_freq = 0;
|
||||
else
|
||||
dev_pm_opp_put(opp);
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ static int devfreq_set_target(struct devfreq *devfreq, unsigned long new_freq,
|
|||
|
||||
devfreq->previous_freq = new_freq;
|
||||
|
||||
if (devfreq->suspend_freq >= devfreq->scaling_min_freq)
|
||||
if (devfreq->suspend_freq)
|
||||
devfreq->resume_freq = new_freq;
|
||||
|
||||
return err;
|
||||
|
|
@ -552,23 +552,18 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type,
|
|||
{
|
||||
struct devfreq *devfreq = container_of(nb, struct devfreq, nb);
|
||||
int err = -EINVAL;
|
||||
long freq;
|
||||
|
||||
mutex_lock(&devfreq->lock);
|
||||
|
||||
freq = find_available_min_freq(devfreq);
|
||||
if (freq < 0) {
|
||||
devfreq->scaling_min_freq = 0;
|
||||
devfreq->scaling_min_freq = find_available_min_freq(devfreq);
|
||||
if (!devfreq->scaling_min_freq)
|
||||
goto out;
|
||||
}
|
||||
devfreq->scaling_min_freq = freq;
|
||||
|
||||
freq = find_available_max_freq(devfreq);
|
||||
if (freq < 0) {
|
||||
devfreq->scaling_max_freq = find_available_max_freq(devfreq);
|
||||
if (!devfreq->scaling_max_freq) {
|
||||
devfreq->scaling_max_freq = ULONG_MAX;
|
||||
goto out;
|
||||
}
|
||||
devfreq->scaling_max_freq = freq;
|
||||
|
||||
err = update_devfreq(devfreq);
|
||||
|
||||
|
|
@ -621,7 +616,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||
struct devfreq *devfreq;
|
||||
struct devfreq_governor *governor;
|
||||
int err = 0;
|
||||
long freq;
|
||||
|
||||
if (!dev || !profile || !governor_name) {
|
||||
dev_err(dev, "%s: Invalid parameters.\n", __func__);
|
||||
|
|
@ -666,21 +660,21 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
|||
mutex_lock(&devfreq->lock);
|
||||
}
|
||||
|
||||
freq = find_available_min_freq(devfreq);
|
||||
if (freq < 0) {
|
||||
devfreq->scaling_min_freq = find_available_min_freq(devfreq);
|
||||
if (!devfreq->scaling_min_freq) {
|
||||
mutex_unlock(&devfreq->lock);
|
||||
err = -EINVAL;
|
||||
goto err_dev;
|
||||
}
|
||||
devfreq->min_freq = devfreq->scaling_min_freq = freq;
|
||||
devfreq->min_freq = devfreq->scaling_min_freq;
|
||||
|
||||
freq = find_available_max_freq(devfreq);
|
||||
if (freq < 0) {
|
||||
devfreq->scaling_max_freq = find_available_max_freq(devfreq);
|
||||
if (!devfreq->scaling_max_freq) {
|
||||
mutex_unlock(&devfreq->lock);
|
||||
err = -EINVAL;
|
||||
goto err_dev;
|
||||
}
|
||||
devfreq->max_freq = devfreq->scaling_max_freq = freq;
|
||||
devfreq->max_freq = devfreq->scaling_max_freq;
|
||||
|
||||
devfreq->suspend_freq = dev_pm_opp_get_suspend_opp_freq(dev);
|
||||
atomic_set(&devfreq->suspend_count, 0);
|
||||
|
|
@ -912,7 +906,7 @@ int devfreq_suspend_device(struct devfreq *devfreq)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (devfreq->suspend_freq >= devfreq->scaling_min_freq) {
|
||||
if (devfreq->suspend_freq) {
|
||||
mutex_lock(&devfreq->lock);
|
||||
ret = devfreq_set_target(devfreq, devfreq->suspend_freq, 0);
|
||||
mutex_unlock(&devfreq->lock);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "bw-hwmon: " fmt
|
||||
|
|
@ -80,8 +80,6 @@ static DEFINE_MUTEX(list_lock);
|
|||
static int use_cnt;
|
||||
static DEFINE_MUTEX(state_lock);
|
||||
|
||||
static DEFINE_MUTEX(event_handle_lock);
|
||||
|
||||
#define show_attr(name) \
|
||||
static ssize_t name##_show(struct device *dev, \
|
||||
struct device_attribute *attr, char *buf) \
|
||||
|
|
@ -867,7 +865,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
|
|||
struct hwmon_node *node;
|
||||
struct bw_hwmon *hw;
|
||||
|
||||
mutex_lock(&event_handle_lock);
|
||||
mutex_lock(&state_lock);
|
||||
|
||||
switch (event) {
|
||||
case DEVFREQ_GOV_START:
|
||||
|
|
@ -941,7 +939,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
|
|||
}
|
||||
|
||||
out:
|
||||
mutex_unlock(&event_handle_lock);
|
||||
mutex_unlock(&state_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -468,7 +468,9 @@ static const struct file_operations dma_buf_fops = {
|
|||
.llseek = dma_buf_llseek,
|
||||
.poll = dma_buf_poll,
|
||||
.unlocked_ioctl = dma_buf_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = dma_buf_ioctl,
|
||||
#endif
|
||||
.show_fdinfo = dma_buf_show_fdinfo,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -408,5 +408,5 @@ const struct file_operations sw_sync_debugfs_fops = {
|
|||
.open = sw_sync_debugfs_open,
|
||||
.release = sw_sync_debugfs_release,
|
||||
.unlocked_ioctl = sw_sync_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = sw_sync_ioctl,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -481,5 +481,5 @@ static const struct file_operations sync_file_fops = {
|
|||
.release = sync_file_release,
|
||||
.poll = sync_file_poll,
|
||||
.unlocked_ioctl = sync_file_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = sync_file_ioctl,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/atomic.h>
|
||||
|
|
@ -2525,12 +2524,6 @@ struct dma_async_tx_descriptor *gpi_prep_slave_sg(struct dma_chan *chan,
|
|||
for_each_sg(sgl, sg, sg_len, i) {
|
||||
tre = sg_virt(sg);
|
||||
|
||||
if (!tre) {
|
||||
kfree(gpi_desc);
|
||||
GPII_ERR(gpii, gpii_chan->chid, "TRE address is null\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (sg_len == 1) {
|
||||
tre_type =
|
||||
MSM_GPI_TRE_TYPE(((struct msm_gpi_tre *)tre));
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ static const char kfd_dev_name[] = "kfd";
|
|||
static const struct file_operations kfd_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.unlocked_ioctl = kfd_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = kfd_ioctl,
|
||||
.open = kfd_open,
|
||||
.mmap = kfd_mmap,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1743,12 +1743,6 @@ static int adreno_pm_suspend(struct device *dev)
|
|||
status = ops->pm_suspend(adreno_dev);
|
||||
mutex_unlock(&device->mutex);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
kthread_flush_worker(device->events_worker);
|
||||
flush_workqueue(kgsl_driver.mem_workqueue);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <linux/clk/qcom.h>
|
||||
|
|
@ -2524,7 +2523,6 @@ int a6xx_perfcounter_update(struct adreno_device *adreno_dev,
|
|||
struct cpu_gpu_lock *lock = ptr;
|
||||
u32 *data = ptr + sizeof(*lock);
|
||||
int i, offset = 0;
|
||||
u32 pending_pairs = 2; /* No of pairs to add: <select,value> and <cntl,1> */
|
||||
|
||||
if (cpu_gpu_lock(lock)) {
|
||||
cpu_gpu_unlock(lock);
|
||||
|
|
@ -2548,13 +2546,6 @@ int a6xx_perfcounter_update(struct adreno_device *adreno_dev,
|
|||
offset += 2;
|
||||
}
|
||||
|
||||
/* Ensure there is enough space in the reglist buffer for new pairs */
|
||||
if ((offset + (pending_pairs * 2)) >=
|
||||
(adreno_dev->pwrup_reglist->size / sizeof(u32))) {
|
||||
cpu_gpu_unlock(lock);
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
/*
|
||||
* For all targets A6XX_RBBM_PERFCTR_CNTL needs to be the last entry,
|
||||
* so overwrite the existing A6XX_RBBM_PERFCNTL_CTRL and add it back to
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ static int find_vma_block(struct a6xx_gmu_device *gmu, u32 addr, u32 size)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < gmu->num_vmas; i++) {
|
||||
for (i = 0; i < GMU_MEM_TYPE_MAX; i++) {
|
||||
struct gmu_vma_entry *vma = &gmu->vma[i];
|
||||
|
||||
if ((addr >= vma->start) &&
|
||||
|
|
@ -2685,13 +2685,10 @@ int a6xx_gmu_probe(struct kgsl_device *device,
|
|||
if (ret)
|
||||
goto error;
|
||||
|
||||
if (adreno_is_a650_family(adreno_dev)) {
|
||||
if (adreno_is_a650_family(adreno_dev))
|
||||
gmu->vma = a6xx_gmu_vma;
|
||||
gmu->num_vmas = ARRAY_SIZE(a6xx_gmu_vma);
|
||||
} else {
|
||||
else
|
||||
gmu->vma = a6xx_gmu_vma_legacy;
|
||||
gmu->num_vmas = ARRAY_SIZE(a6xx_gmu_vma_legacy);
|
||||
}
|
||||
|
||||
/* Map and reserve GMU CSRs registers */
|
||||
ret = a6xx_gmu_reg_probe(adreno_dev);
|
||||
|
|
|
|||
|
|
@ -187,8 +187,6 @@ struct a6xx_gmu_device {
|
|||
/** @global_entries: To keep track of number of gmu buffers */
|
||||
u32 global_entries;
|
||||
struct gmu_vma_entry *vma;
|
||||
/** @num_vmas: Number of entries in the @vma array */
|
||||
u32 num_vmas;
|
||||
unsigned int log_wptr_retention;
|
||||
/** @cm3_fault: whether gmu received a cm3 fault interrupt */
|
||||
atomic_t cm3_fault;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ static void tcs_cmd_data(struct bcm *bcms, int count, u32 ab, u32 ib,
|
|||
u32 *data)
|
||||
{
|
||||
int i;
|
||||
u64 total_width;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
bool valid = true;
|
||||
|
|
@ -146,11 +145,8 @@ static void tcs_cmd_data(struct bcm *bcms, int count, u32 ab, u32 ib,
|
|||
/* Multiple the bandwidth by the width of the connection */
|
||||
avg = ((u64) ab) * bcms[i].width;
|
||||
|
||||
total_width = bcms[i].buswidth * bcms[i].channels;
|
||||
|
||||
/* And then divide by the total width across channels */
|
||||
if (total_width)
|
||||
do_div(avg, (u32) total_width);
|
||||
do_div(avg, bcms[i].buswidth * bcms[i].channels);
|
||||
|
||||
peak = ((u64) ib) * bcms[i].width;
|
||||
do_div(peak, bcms[i].buswidth);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
int act_level;
|
||||
int norm_max_cycles;
|
||||
int norm_cycles;
|
||||
int wait_active_percent = 0;
|
||||
int wait_active_percent;
|
||||
int gpu_percent;
|
||||
/*
|
||||
* Normalized AB should at max usage be the gpu_bimc frequency in MHz.
|
||||
|
|
@ -132,9 +132,8 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
(unsigned int) priv->bus.total_time;
|
||||
norm_cycles = (unsigned int)(priv->bus.ram_time + priv->bus.ram_wait) /
|
||||
(unsigned int) priv->bus.total_time;
|
||||
if (priv->bus.ram_time)
|
||||
wait_active_percent = (100 * (unsigned int)priv->bus.ram_wait) /
|
||||
(unsigned int) priv->bus.ram_time;
|
||||
wait_active_percent = (100 * (unsigned int)priv->bus.ram_wait) /
|
||||
(unsigned int) priv->bus.ram_time;
|
||||
gpu_percent = (100 * (unsigned int)priv->bus.gpu_time) /
|
||||
(unsigned int) priv->bus.total_time;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <uapi/linux/msm_ion.h>
|
||||
|
|
@ -349,14 +349,12 @@ static void kgsl_destroy_ion(struct kgsl_memdesc *memdesc)
|
|||
|
||||
if (meta != NULL) {
|
||||
remove_dmabuf_list(meta);
|
||||
dma_buf_unmap_attachment(meta->attach, memdesc->sgt, DMA_BIDIRECTIONAL);
|
||||
dma_buf_detach(meta->dmabuf, meta->attach);
|
||||
dma_buf_put(meta->dmabuf);
|
||||
kfree(meta);
|
||||
}
|
||||
|
||||
memdesc->sgt = NULL;
|
||||
entry->priv_data = NULL;
|
||||
}
|
||||
|
||||
static const struct kgsl_memdesc_ops kgsl_dmabuf_ops = {
|
||||
|
|
@ -687,11 +685,11 @@ int kgsl_context_init(struct kgsl_device_private *dev_priv,
|
|||
if (id == -ENOSPC) {
|
||||
/*
|
||||
* Before declaring that there are no contexts left try
|
||||
* flushing the event worker just in case there are
|
||||
* flushing the event workqueue just in case there are
|
||||
* detached contexts waiting to finish
|
||||
*/
|
||||
|
||||
kthread_flush_worker(device->events_worker);
|
||||
flush_workqueue(device->events_wq);
|
||||
id = _kgsl_get_context_id(device);
|
||||
}
|
||||
|
||||
|
|
@ -2997,7 +2995,7 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
|
|||
{
|
||||
int ret = 0;
|
||||
struct scatterlist *s;
|
||||
struct sg_table *sg_table = NULL;
|
||||
struct sg_table *sg_table;
|
||||
struct dma_buf_attachment *attach = NULL;
|
||||
struct kgsl_dma_buf_meta *meta;
|
||||
|
||||
|
|
@ -3039,6 +3037,8 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
|
|||
goto out;
|
||||
}
|
||||
|
||||
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
|
||||
|
||||
meta->table = sg_table;
|
||||
entry->priv_data = meta;
|
||||
entry->memdesc.sgt = sg_table;
|
||||
|
|
@ -3093,9 +3093,6 @@ skip_access_check:
|
|||
|
||||
out:
|
||||
if (ret) {
|
||||
if (!IS_ERR_OR_NULL(sg_table))
|
||||
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
|
||||
|
||||
if (!IS_ERR_OR_NULL(attach))
|
||||
dma_buf_detach(dmabuf, attach);
|
||||
|
||||
|
|
@ -4057,9 +4054,9 @@ static unsigned long _gpu_set_svm_region(struct kgsl_process_private *private,
|
|||
return addr;
|
||||
}
|
||||
|
||||
unsigned long kgsl_get_align(struct kgsl_memdesc *memdesc)
|
||||
static unsigned long get_align(struct kgsl_mem_entry *entry)
|
||||
{
|
||||
u32 bit = kgsl_memdesc_get_align(memdesc);
|
||||
int bit = kgsl_memdesc_get_align(&entry->memdesc);
|
||||
|
||||
if (bit >= ilog2(SZ_2M))
|
||||
return SZ_2M;
|
||||
|
|
@ -4068,7 +4065,7 @@ unsigned long kgsl_get_align(struct kgsl_memdesc *memdesc)
|
|||
else if (bit >= ilog2(SZ_64K))
|
||||
return SZ_64K;
|
||||
|
||||
return PAGE_SIZE;
|
||||
return SZ_4K;
|
||||
}
|
||||
|
||||
static unsigned long set_svm_area(struct file *file,
|
||||
|
|
@ -4101,7 +4098,7 @@ static unsigned long get_svm_unmapped_area(struct file *file,
|
|||
{
|
||||
struct kgsl_device_private *dev_priv = file->private_data;
|
||||
struct kgsl_process_private *private = dev_priv->process_priv;
|
||||
unsigned long align = kgsl_get_align(&entry->memdesc);
|
||||
unsigned long align = get_align(entry);
|
||||
unsigned long ret, iova;
|
||||
u64 start = 0, end = 0;
|
||||
struct vm_area_struct *vma;
|
||||
|
|
@ -4528,16 +4525,15 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
|||
device->pwrctrl.interrupt_num = status;
|
||||
disable_irq(device->pwrctrl.interrupt_num);
|
||||
|
||||
device->events_worker = kthread_create_worker(0, "kgsl-events");
|
||||
device->events_wq = alloc_workqueue("kgsl-events",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS | WQ_HIGHPRI, 0);
|
||||
|
||||
if (IS_ERR(device->events_worker)) {
|
||||
status = PTR_ERR(device->events_worker);
|
||||
dev_err(device->dev, "Failed to create events worker ret=%d\n", status);
|
||||
if (!device->events_wq) {
|
||||
dev_err(device->dev, "Failed to allocate events workqueue\n");
|
||||
status = -ENOMEM;
|
||||
goto error_pwrctrl_close;
|
||||
}
|
||||
|
||||
sched_set_fifo(device->events_worker->task);
|
||||
|
||||
/* This can return -EPROBE_DEFER */
|
||||
status = kgsl_mmu_probe(device);
|
||||
if (status != 0)
|
||||
|
|
@ -4562,8 +4558,10 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
|||
return 0;
|
||||
|
||||
error_pwrctrl_close:
|
||||
if (!IS_ERR(device->events_worker))
|
||||
kthread_destroy_worker(device->events_worker);
|
||||
if (device->events_wq) {
|
||||
destroy_workqueue(device->events_wq);
|
||||
device->events_wq = NULL;
|
||||
}
|
||||
|
||||
kgsl_pwrctrl_close(device);
|
||||
error:
|
||||
|
|
@ -4573,7 +4571,10 @@ error:
|
|||
|
||||
void kgsl_device_platform_remove(struct kgsl_device *device)
|
||||
{
|
||||
kthread_destroy_worker(device->events_worker);
|
||||
if (device->events_wq) {
|
||||
destroy_workqueue(device->events_wq);
|
||||
device->events_wq = NULL;
|
||||
}
|
||||
|
||||
kgsl_device_snapshot_close(device);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#ifndef __KGSL_H
|
||||
#define __KGSL_H
|
||||
|
|
@ -295,7 +295,7 @@ typedef void (*kgsl_event_func)(struct kgsl_device *, struct kgsl_event_group *,
|
|||
* @priv: Private data passed to the callback function
|
||||
* @node: List node for the kgsl_event_group list
|
||||
* @created: Jiffies when the event was created
|
||||
* @work: kthread_work struct for dispatching the callback
|
||||
* @work: Work struct for dispatching the callback
|
||||
* @result: KGSL event result type to pass to the callback
|
||||
* group: The event group this event belongs to
|
||||
*/
|
||||
|
|
@ -307,7 +307,7 @@ struct kgsl_event {
|
|||
void *priv;
|
||||
struct list_head node;
|
||||
unsigned int created;
|
||||
struct kthread_work work;
|
||||
struct work_struct work;
|
||||
int result;
|
||||
struct kgsl_event_group *group;
|
||||
};
|
||||
|
|
@ -473,8 +473,6 @@ void kgsl_mmu_remove_global(struct kgsl_device *device,
|
|||
struct kgsl_memdesc *memdesc);
|
||||
|
||||
/* Helper functions */
|
||||
unsigned long kgsl_get_align(struct kgsl_memdesc *memdesc);
|
||||
|
||||
int kgsl_request_irq(struct platform_device *pdev, const char *name,
|
||||
irq_handler_t handler, void *data);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2002,2008-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
|
|
@ -147,7 +146,7 @@ static const char *memtype_str(int memtype)
|
|||
|
||||
static char get_alignflag(const struct kgsl_memdesc *m)
|
||||
{
|
||||
u32 align = kgsl_memdesc_get_align(m);
|
||||
int align = kgsl_memdesc_get_align(m);
|
||||
|
||||
if (align >= ilog2(SZ_1M))
|
||||
return 'L';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2002,2007-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#ifndef __KGSL_DEVICE_H
|
||||
#define __KGSL_DEVICE_H
|
||||
|
|
@ -294,7 +293,7 @@ struct kgsl_device {
|
|||
struct kgsl_pwrscale pwrscale;
|
||||
|
||||
int reset_counter; /* Track how many GPU core resets have occurred */
|
||||
struct kthread_worker *events_worker;
|
||||
struct workqueue_struct *events_wq;
|
||||
|
||||
/* Number of active contexts seen globally for this device */
|
||||
int active_context_count;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
|
|
@ -22,17 +21,17 @@ static inline void signal_event(struct kgsl_device *device,
|
|||
{
|
||||
list_del(&event->node);
|
||||
event->result = result;
|
||||
kthread_queue_work(device->events_worker, &event->work);
|
||||
queue_work(device->events_wq, &event->work);
|
||||
}
|
||||
|
||||
/**
|
||||
* _kgsl_event_worker() - Work handler for processing GPU event callbacks
|
||||
* @work: Pointer to the kthread_work for the event
|
||||
* @work: Pointer to the work_struct for the event
|
||||
*
|
||||
* Each event callback has its own kthread_work struct and is run on a event specific
|
||||
* worker thread. This is the worker that queues up the event callback function.
|
||||
* Each event callback has its own work struct and is run on a event specific
|
||||
* workqeuue. This is the worker that queues up the event callback function.
|
||||
*/
|
||||
static void _kgsl_event_worker(struct kthread_work *work)
|
||||
static void _kgsl_event_worker(struct work_struct *work)
|
||||
{
|
||||
struct kgsl_event *event = container_of(work, struct kgsl_event, work);
|
||||
int id = KGSL_CONTEXT_ID(event->context);
|
||||
|
|
@ -269,7 +268,7 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
|
|||
event->created = jiffies;
|
||||
event->group = group;
|
||||
|
||||
kthread_init_work(&event->work, _kgsl_event_worker);
|
||||
INIT_WORK(&event->work, _kgsl_event_worker);
|
||||
|
||||
trace_kgsl_register_event(KGSL_CONTEXT_ID(context), timestamp, func);
|
||||
|
||||
|
|
@ -284,7 +283,7 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
|
|||
|
||||
if (timestamp_cmp(retired, timestamp) >= 0) {
|
||||
event->result = KGSL_EVENT_RETIRED;
|
||||
kthread_queue_work(device->events_worker, &event->work);
|
||||
queue_work(device->events_wq, &event->work);
|
||||
spin_unlock(&group->lock);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2011-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
|
|
@ -2229,7 +2229,8 @@ static int kgsl_iommu_get_gpuaddr(struct kgsl_pagetable *pagetable,
|
|||
|
||||
size = kgsl_memdesc_footprint(memdesc);
|
||||
|
||||
align = kgsl_get_align(memdesc);
|
||||
align = max_t(uint64_t, 1 << kgsl_memdesc_get_align(memdesc),
|
||||
PAGE_SIZE);
|
||||
|
||||
if (memdesc->flags & KGSL_MEMFLAGS_FORCE_32BIT) {
|
||||
start = pt->compat_va_start;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2002,2007-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
#ifndef __KGSL_SHAREDMEM_H
|
||||
#define __KGSL_SHAREDMEM_H
|
||||
|
|
@ -158,7 +157,7 @@ void kgsl_free_globals(struct kgsl_device *device);
|
|||
*
|
||||
* Returns the alignment requested, as power of 2 exponent.
|
||||
*/
|
||||
static inline u32
|
||||
static inline int
|
||||
kgsl_memdesc_get_align(const struct kgsl_memdesc *memdesc)
|
||||
{
|
||||
return MEMFLAGS(memdesc->flags, KGSL_MEMALIGN_MASK,
|
||||
|
|
|
|||
|
|
@ -3743,12 +3743,10 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
|||
|
||||
if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) {
|
||||
ret = hidpp_ff_init(hidpp, &data);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
hid_warn(hidpp->hid_dev,
|
||||
"Unable to initialize force feedback support, errno %d\n",
|
||||
ret);
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -472,7 +472,9 @@ static const struct file_operations hidraw_ops = {
|
|||
.release = hidraw_release,
|
||||
.unlocked_ioctl = hidraw_ioctl,
|
||||
.fasync = hidraw_fasync,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = hidraw_ioctl,
|
||||
#endif
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static ssize_t tmc_etr_byte_cntr_read(struct file *fp, char __user *data,
|
|||
size_t len, loff_t *ppos)
|
||||
{
|
||||
struct byte_cntr *byte_cntr_data = fp->private_data;
|
||||
char *bufp = NULL;
|
||||
char *bufp;
|
||||
int ret = 0;
|
||||
if (!data)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -1612,7 +1612,7 @@ static const struct file_operations iio_buffer_fileops = {
|
|||
.owner = THIS_MODULE,
|
||||
.llseek = noop_llseek,
|
||||
.unlocked_ioctl = iio_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = iio_ioctl,
|
||||
};
|
||||
|
||||
static int iio_check_unique_scan_index(struct iio_dev *indio_dev)
|
||||
|
|
|
|||
|
|
@ -1135,7 +1135,7 @@ static const struct file_operations uverbs_fops = {
|
|||
.release = ib_uverbs_close,
|
||||
.llseek = no_llseek,
|
||||
.unlocked_ioctl = ib_uverbs_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = ib_uverbs_ioctl,
|
||||
};
|
||||
|
||||
static const struct file_operations uverbs_mmap_fops = {
|
||||
|
|
@ -1146,7 +1146,7 @@ static const struct file_operations uverbs_mmap_fops = {
|
|||
.release = ib_uverbs_close,
|
||||
.llseek = no_llseek,
|
||||
.unlocked_ioctl = ib_uverbs_ioctl,
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.compat_ioctl = ib_uverbs_ioctl,
|
||||
};
|
||||
|
||||
static int ib_uverbs_get_nl_info(struct ib_device *ibdev, void *client_data,
|
||||
|
|
|
|||
|
|
@ -1543,7 +1543,7 @@ egistec_probe_failed:
|
|||
return status;
|
||||
}
|
||||
|
||||
static int __init egisfp_init(void)
|
||||
int __init egisfp_init(void)
|
||||
{
|
||||
int status;
|
||||
INFO_PRINT(" %s : module init \n", __func__);
|
||||
|
|
@ -1556,7 +1556,7 @@ static int __init egisfp_init(void)
|
|||
INFO_PRINT(" %s : module init OK ! \n", __func__);
|
||||
return status;
|
||||
}
|
||||
static void __exit egisfp_exit(void)
|
||||
void __exit egisfp_exit(void)
|
||||
{
|
||||
INFO_PRINT("module exit \n");
|
||||
platform_driver_unregister(&egisfp_driver);
|
||||
|
|
|
|||
|
|
@ -1473,7 +1473,7 @@ egistec_probe_failed:
|
|||
return status;
|
||||
}
|
||||
|
||||
static int __init egisfp_init(void)
|
||||
int __init egisfp_init(void)
|
||||
{
|
||||
int status;
|
||||
INFO_PRINT(" %s : module init \n", __func__);
|
||||
|
|
@ -1486,7 +1486,7 @@ static int __init egisfp_init(void)
|
|||
INFO_PRINT(" %s : module init OK ! \n", __func__);
|
||||
return status;
|
||||
}
|
||||
static void __exit egisfp_exit(void)
|
||||
void __exit egisfp_exit(void)
|
||||
{
|
||||
INFO_PRINT("module exit \n");
|
||||
platform_driver_unregister(&egisfp_driver);
|
||||
|
|
|
|||
|
|
@ -1389,7 +1389,7 @@ egistec_probe_failed:
|
|||
return status;
|
||||
}
|
||||
|
||||
static int __init egisfp_init(void)
|
||||
int __init egisfp_init(void)
|
||||
{
|
||||
int status;
|
||||
INFO_PRINT(" %s : module init \n", __func__);
|
||||
|
|
@ -1402,7 +1402,7 @@ static int __init egisfp_init(void)
|
|||
INFO_PRINT(" %s : module init OK ! \n", __func__);
|
||||
return status;
|
||||
}
|
||||
static void __exit egisfp_exit(void)
|
||||
void __exit egisfp_exit(void)
|
||||
{
|
||||
INFO_PRINT("module exit \n");
|
||||
platform_driver_unregister(&egisfp_driver);
|
||||
|
|
|
|||
|
|
@ -1333,8 +1333,6 @@ source "drivers/input/touchscreen/synaptics_dsx/Kconfig"
|
|||
|
||||
source "drivers/input/touchscreen/nt36xxx/Kconfig"
|
||||
|
||||
source "drivers/input/touchscreen/chipone_tddi_mmi/Kconfig"
|
||||
|
||||
source "drivers/input/touchscreen/chipone_tddi_v2_mmi/Kconfig"
|
||||
|
||||
source "drivers/input/touchscreen/focaltech_0flash_v2_mmi/Kconfig"
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_TCM) += synaptics_tcm/
|
|||
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX) += synaptics_dsx/
|
||||
obj-$(CONFIG_TOUCHSCREEN_NT36XXX) += nt36xxx/
|
||||
|
||||
obj-$(CONFIG_TOUCHSCREEN_CHIPONE_TDDI) += chipone_tddi_mmi/
|
||||
obj-$(CONFIG_TOUCHSCREEN_CHIPONE_V2_MMI) += chipone_tddi_v2_mmi/
|
||||
obj-$(CONFIG_TOUCHSCREEN_FTS_0FLASH_MMI_V2) += focaltech_0flash_v2_mmi/
|
||||
obj-$(CONFIG_TOUCHSCREEN_FTS_V3) += focaltech_touch_v3/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
ccflags-$(CONFIG_TOUCHSCREEN_CHIPONE_TDDI_ESD) += -DCONFIG_CTS_ESD_PROTECTION
|
||||
# add -Wall to try to catch everything we can.
|
||||
EXTRA_CFLAGS += -Wall
|
||||
EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include \
|
||||
-I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/drivers/input/touchscreen/chipone_tddi_mmi
|
||||
ifneq ($(filter m y,$(CONFIG_CHIPONE_ESD)),)
|
||||
EXTRA_CFLAGS += -DCONFIG_CTS_ESD_PROTECTION
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_TOUCHSCREEN_CHIPONE_TDDI) := chipone_tddi_mmi.o
|
||||
obj-m := chipone_tddi_mmi.o
|
||||
|
||||
chipone_tddi_mmi-objs += cts_i2c_driver.o
|
||||
chipone_tddi_mmi-objs += cts_core.o
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
config TOUCHSCREEN_CHIPONE_TDDI
|
||||
tristate "CHIPONE TDDI Touchscreen"
|
||||
default n
|
||||
help
|
||||
Say Y here if you have a Chipone flash touchscreen connected
|
||||
to your system by SPI bus.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config TOUCHSCREEN_CHIPONE_TDDI_ESD
|
||||
bool "ESD Detection"
|
||||
depends on TOUCHSCREEN_CHIPONE_TDDI
|
||||
default n
|
||||
help
|
||||
Say Y here if you want to have ESD Detection support.
|
||||
|
||||
If unsure, say N.
|
||||
|
|
@ -187,17 +187,15 @@ static void ts_mmi_panel_cb(enum panel_event_notifier_tag tag,
|
|||
|
||||
dev_dbg(DEV_MMI, "%s: %s Notify_type=%d, early=%d, ctrl_dsi=%d\n", __func__,
|
||||
EVENT_PRE_DISPLAY_OFF ? "EVENT_PRE_DISPLAY_OFF" :
|
||||
(EVENT_DISPLAY_LP ? "EVENT_DISPLAY_LP" :
|
||||
(EVENT_DISPLAY_OFF ? "EVENT_DISPLAY_OFF" :
|
||||
(EVENT_PRE_DISPLAY_ON ? "EVENT_PRE_DISPLAY_ON" :
|
||||
(EVENT_DISPLAY_ON ? "EVENT_DISPLAY_ON" : "Unknown")))),
|
||||
(EVENT_DISPLAY_ON ? "EVENT_DISPLAY_ON" : "Unknown"))),
|
||||
event, (evdata.early_trigger ? 1 : 0), touch_cdev->pdata.ctrl_dsi);
|
||||
|
||||
panel_event = EVENT_PRE_DISPLAY_OFF ? TS_MMI_EVENT_PRE_DISPLAY_OFF :
|
||||
(EVENT_DISPLAY_LP ? TS_MMI_EVENT_PRE_DISPLAY_OFF :
|
||||
(EVENT_DISPLAY_OFF ? TS_MMI_EVENT_DISPLAY_OFF :
|
||||
(EVENT_PRE_DISPLAY_ON ? TS_MMI_EVENT_PRE_DISPLAY_ON :
|
||||
(EVENT_DISPLAY_ON ? TS_MMI_EVENT_DISPLAY_ON : TS_MMI_EVENT_UNKNOWN))));
|
||||
(EVENT_DISPLAY_ON ? TS_MMI_EVENT_DISPLAY_ON : TS_MMI_EVENT_UNKNOWN)));
|
||||
|
||||
ts_mmi_panel_event_handle(touch_cdev, panel_event);
|
||||
|
||||
|
|
@ -220,20 +218,18 @@ static int ts_mmi_panel_cb(struct notifier_block *nb,
|
|||
|
||||
dev_dbg(DEV_MMI,"%s: %s event(%lu), ctrl_dsi=%d, idx=%d\n", __func__,
|
||||
EVENT_PRE_DISPLAY_OFF ? "EVENT_PRE_DISPLAY_OFF" :
|
||||
(EVENT_DISPLAY_LP ? "EVENT_DISPLAY_LP" :
|
||||
(EVENT_DISPLAY_OFF ? "EVENT_DISPLAY_OFF" :
|
||||
(EVENT_PRE_DISPLAY_ON ? "EVENT_PRE_DISPLAY_ON" :
|
||||
(EVENT_DISPLAY_ON ? "EVENT_DISPLAY_ON" : "Unknown")))),
|
||||
(EVENT_DISPLAY_ON ? "EVENT_DISPLAY_ON" : "Unknown"))),
|
||||
event, touch_cdev->pdata.ctrl_dsi, idx);
|
||||
|
||||
if (touch_cdev->pdata.ctrl_dsi != idx)
|
||||
return 0;
|
||||
|
||||
panel_event = EVENT_PRE_DISPLAY_OFF ? TS_MMI_EVENT_PRE_DISPLAY_OFF :
|
||||
(EVENT_DISPLAY_LP ? TS_MMI_EVENT_PRE_DISPLAY_OFF :
|
||||
(EVENT_DISPLAY_OFF ? TS_MMI_EVENT_DISPLAY_OFF :
|
||||
(EVENT_PRE_DISPLAY_ON ? TS_MMI_EVENT_PRE_DISPLAY_ON :
|
||||
(EVENT_DISPLAY_ON ? TS_MMI_EVENT_DISPLAY_ON : TS_MMI_EVENT_UNKNOWN))));
|
||||
(EVENT_DISPLAY_ON ? TS_MMI_EVENT_DISPLAY_ON : TS_MMI_EVENT_UNKNOWN)));
|
||||
|
||||
ret = ts_mmi_panel_event_handle(touch_cdev, panel_event);
|
||||
|
||||
|
|
|
|||
|
|
@ -244,12 +244,8 @@ static void fast_smmu_unmap_page(struct device *dev, dma_addr_t iova,
|
|||
}
|
||||
|
||||
spin_lock_irqsave(&mapping->lock, flags);
|
||||
|
||||
if (unlikely(!av8l_fast_unmap_public(mapping->pgtbl_ops, iova, len)))
|
||||
goto fail;
|
||||
|
||||
av8l_fast_unmap_public(mapping->pgtbl_ops, iova, len);
|
||||
__fast_smmu_free_iova(mapping, iova, len);
|
||||
fail:
|
||||
spin_unlock_irqrestore(&mapping->lock, flags);
|
||||
|
||||
trace_unmap(to_msm_iommu_domain(mapping->domain), iova - offset, len,
|
||||
|
|
@ -389,8 +385,7 @@ static void fast_smmu_unmap_sg(struct device *dev,
|
|||
len = ALIGN(sg_dma_address(sg) + sg_dma_len(sg) - (start - offset),
|
||||
FAST_PAGE_SIZE);
|
||||
|
||||
if (unlikely(!av8l_fast_unmap_public(mapping->pgtbl_ops, start, len)))
|
||||
return;
|
||||
av8l_fast_unmap_public(mapping->pgtbl_ops, start, len);
|
||||
|
||||
spin_lock_irqsave(&mapping->lock, flags);
|
||||
__fast_smmu_free_iova(mapping, start, len);
|
||||
|
|
@ -658,10 +653,7 @@ static void fast_smmu_free(struct device *dev, size_t size,
|
|||
size = ALIGN(size, FAST_PAGE_SIZE);
|
||||
|
||||
spin_lock_irqsave(&mapping->lock, flags);
|
||||
|
||||
if (unlikely(!av8l_fast_unmap_public(mapping->pgtbl_ops, dma_handle, size)))
|
||||
goto fail;
|
||||
|
||||
av8l_fast_unmap_public(mapping->pgtbl_ops, dma_handle, size);
|
||||
__fast_smmu_free_iova(mapping, dma_handle, size);
|
||||
spin_unlock_irqrestore(&mapping->lock, flags);
|
||||
|
||||
|
|
@ -682,11 +674,6 @@ static void fast_smmu_free(struct device *dev, size_t size,
|
|||
|
||||
if (page)
|
||||
dma_free_contiguous(dev, page, size);
|
||||
|
||||
return;
|
||||
|
||||
fail:
|
||||
spin_unlock_irqrestore(&mapping->lock, flags);
|
||||
}
|
||||
|
||||
static int fast_smmu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
|
||||
|
|
|
|||
|
|
@ -127,14 +127,7 @@
|
|||
|
||||
#define PTE_SH_IDX(pte) (pte & AV8L_FAST_PTE_SH_MASK)
|
||||
|
||||
#define iopte_pmd_offset(pmds, base, iova) \
|
||||
({ \
|
||||
typeof(iova) __iova = (iova); \
|
||||
typeof(base) __base = (base); \
|
||||
typeof(pmds) __pmds = (pmds); \
|
||||
(__iova < __base) ? ERR_PTR(-EINVAL) : \
|
||||
__pmds + ((__iova - ALIGN_DOWN(__base, SZ_2M)) >> AV8L_FAST_PAGE_SHIFT); \
|
||||
})
|
||||
#define iopte_pmd_offset(pmds, base, iova) (pmds + ((iova - base) >> 12))
|
||||
|
||||
static inline dma_addr_t av8l_dma_addr(void *addr)
|
||||
{
|
||||
|
|
@ -209,12 +202,6 @@ void av8l_fast_clear_stale_ptes(struct io_pgtable_ops *ops, u64 base,
|
|||
struct io_pgtable *iop = iof_pgtable_ops_to_pgtable(ops);
|
||||
av8l_fast_iopte *pmdp = iopte_pmd_offset(data->pmds, data->base, base);
|
||||
|
||||
if (IS_ERR(pmdp)) {
|
||||
pr_err("Invalid iova : 0x%lx, as it is less than base : 0x%llx\n",
|
||||
iova, data->base);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = base >> AV8L_FAST_PAGE_SHIFT;
|
||||
i <= (end >> AV8L_FAST_PAGE_SHIFT); ++i) {
|
||||
if (!(*pmdp & AV8L_FAST_PTE_VALID)) {
|
||||
|
|
@ -267,12 +254,6 @@ static int av8l_fast_map(struct io_pgtable_ops *ops, unsigned long iova,
|
|||
unsigned long i, nptes = size >> AV8L_FAST_PAGE_SHIFT;
|
||||
av8l_fast_iopte pte;
|
||||
|
||||
if (IS_ERR(ptep)) {
|
||||
pr_err("Invalid iova : 0x%lx, as it is less than base : 0x%llx\n",
|
||||
iova, data->base);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pte = av8l_fast_prot_to_pte(data, prot);
|
||||
paddr &= AV8L_FAST_PTE_ADDR_MASK;
|
||||
for (i = 0; i < nptes; i++, paddr += SZ_4K) {
|
||||
|
|
@ -305,12 +286,6 @@ __av8l_fast_unmap(struct io_pgtable_ops *ops, unsigned long iova,
|
|||
ptep = iopte_pmd_offset(data->pmds, data->base, iova);
|
||||
nptes = size >> AV8L_FAST_PAGE_SHIFT;
|
||||
|
||||
if (IS_ERR(ptep)) {
|
||||
pr_err("Invalid iova : 0x%lx, as it is less than base : 0x%llx\n",
|
||||
iova, data->base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(ptep, val, sizeof(*ptep) * nptes);
|
||||
av8l_clean_range(&iop->cfg, ptep, ptep + nptes);
|
||||
if (!allow_stale_tlb)
|
||||
|
|
@ -320,10 +295,10 @@ __av8l_fast_unmap(struct io_pgtable_ops *ops, unsigned long iova,
|
|||
}
|
||||
|
||||
/* caller must take care of tlb cache maintenance */
|
||||
size_t av8l_fast_unmap_public(struct io_pgtable_ops *ops, unsigned long iova,
|
||||
void av8l_fast_unmap_public(struct io_pgtable_ops *ops, unsigned long iova,
|
||||
size_t size)
|
||||
{
|
||||
return __av8l_fast_unmap(ops, iova, size, true);
|
||||
__av8l_fast_unmap(ops, iova, size, true);
|
||||
}
|
||||
|
||||
static size_t av8l_fast_unmap(struct io_pgtable_ops *ops, unsigned long iova,
|
||||
|
|
@ -408,12 +383,6 @@ static bool av8l_fast_iova_coherent(struct io_pgtable_ops *ops,
|
|||
struct av8l_fast_io_pgtable *data = iof_pgtable_ops_to_data(ops);
|
||||
av8l_fast_iopte *ptep = iopte_pmd_offset(data->pmds, data->base, iova);
|
||||
|
||||
if (IS_ERR(ptep)) {
|
||||
pr_err("Invalid iova : 0x%lx, as it is less than base : 0x%llx\n",
|
||||
iova, data->base);
|
||||
return false;
|
||||
}
|
||||
|
||||
return ((PTE_MAIR_IDX(*ptep) == AV8L_FAST_MAIR_ATTR_IDX_CACHE) &&
|
||||
((PTE_SH_IDX(*ptep) == AV8L_FAST_PTE_SH_OS) ||
|
||||
(PTE_SH_IDX(*ptep) == AV8L_FAST_PTE_SH_IS)));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
|
|
@ -135,8 +135,6 @@ static int msm_cvp_initialize_core(struct platform_device *pdev,
|
|||
INIT_LIST_HEAD(&core->instances);
|
||||
mutex_init(&core->lock);
|
||||
mutex_init(&core->clk_lock);
|
||||
mutex_init(&core->idr_mtx);
|
||||
idr_init(&core->sess_idr);
|
||||
|
||||
core->state = CVP_CORE_UNINIT;
|
||||
for (i = SYS_MSG_INDEX(SYS_MSG_START);
|
||||
|
|
@ -508,8 +506,6 @@ static int msm_cvp_remove(struct platform_device *pdev)
|
|||
msm_cvp_free_platform_resources(&core->resources);
|
||||
sysfs_remove_group(&pdev->dev.kobj, &msm_cvp_core_attr_group);
|
||||
dev_set_drvdata(&pdev->dev, NULL);
|
||||
idr_destroy(&core->sess_idr);
|
||||
mutex_destroy(&core->idr_mtx);
|
||||
mutex_destroy(&core->lock);
|
||||
mutex_destroy(&core->clk_lock);
|
||||
kfree(core);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <asm/memory.h>
|
||||
|
|
@ -30,7 +29,6 @@
|
|||
#include "cvp_hfi_helper.h"
|
||||
#include "cvp_hfi_io.h"
|
||||
#include "msm_cvp_dsp.h"
|
||||
#include "msm_cvp.h"
|
||||
|
||||
#define FIRMWARE_SIZE 0X00A00000
|
||||
#define REG_ADDR_OFFSET_BITMASK 0x000FFFFF
|
||||
|
|
@ -471,7 +469,6 @@ static int __dsp_suspend(struct iris_hfi_device *device, bool force, u32 flags)
|
|||
{
|
||||
int rc;
|
||||
struct cvp_hal_session *temp;
|
||||
struct msm_cvp_inst *inst = NULL;
|
||||
|
||||
if (msm_cvp_dsp_disable)
|
||||
return 0;
|
||||
|
|
@ -483,10 +480,9 @@ static int __dsp_suspend(struct iris_hfi_device *device, bool force, u32 flags)
|
|||
|
||||
/* don't suspend if cvp session is not paused */
|
||||
if (!(temp->flags & SESSION_PAUSE)) {
|
||||
inst = (struct msm_cvp_inst *)temp->session_id;
|
||||
dprintk(CVP_DSP,
|
||||
"%s: cvp session %x not paused\n",
|
||||
__func__, inst->sess_id);
|
||||
__func__, hash32_ptr(temp));
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
|
|
@ -2228,17 +2224,12 @@ static void __session_clean(struct cvp_hal_session *session)
|
|||
{
|
||||
struct cvp_hal_session *temp, *next;
|
||||
struct iris_hfi_device *device;
|
||||
struct msm_cvp_core *core = NULL;
|
||||
struct msm_cvp_inst *inst = NULL;
|
||||
void *tmp = NULL;
|
||||
|
||||
if (!session || !session->device) {
|
||||
dprintk(CVP_WARN, "%s: invalid params\n", __func__);
|
||||
return;
|
||||
}
|
||||
device = session->device;
|
||||
core = list_first_entry(&cvp_driver->cores, struct msm_cvp_core, list);
|
||||
inst = (struct msm_cvp_inst *) session->session_id;
|
||||
dprintk(CVP_SESS, "deleted the session: %pK\n", session);
|
||||
/*
|
||||
* session might have been removed from the device list in
|
||||
|
|
@ -2250,13 +2241,6 @@ static void __session_clean(struct cvp_hal_session *session)
|
|||
break;
|
||||
}
|
||||
}
|
||||
/* Remove the IDR id assigned to this session */
|
||||
mutex_lock(&core->idr_mtx);
|
||||
tmp = idr_remove(&core->sess_idr, inst->sess_id);
|
||||
if (tmp != session)
|
||||
dprintk(CVP_WARN, "%s: session\n", __func__);
|
||||
mutex_unlock(&core->idr_mtx);
|
||||
|
||||
/* Poison the session handle with zeros */
|
||||
*session = (struct cvp_hal_session){ {0} };
|
||||
kfree(session);
|
||||
|
|
@ -2294,9 +2278,6 @@ static int iris_hfi_session_init(void *device, void *session_id,
|
|||
struct cvp_hfi_cmd_sys_session_init_packet pkt;
|
||||
struct iris_hfi_device *dev;
|
||||
struct cvp_hal_session *s;
|
||||
struct msm_cvp_core *core;
|
||||
struct msm_cvp_inst *inst;
|
||||
int id = 0;
|
||||
|
||||
if (!device || !new_session) {
|
||||
dprintk(CVP_ERR, "%s - invalid input\n", __func__);
|
||||
|
|
@ -2304,8 +2285,6 @@ static int iris_hfi_session_init(void *device, void *session_id,
|
|||
}
|
||||
|
||||
dev = device;
|
||||
core = list_first_entry(&cvp_driver->cores, struct msm_cvp_core, list);
|
||||
inst = session_id;
|
||||
mutex_lock(&dev->lock);
|
||||
|
||||
s = kzalloc(sizeof(*s), GFP_KERNEL);
|
||||
|
|
@ -2316,35 +2295,15 @@ static int iris_hfi_session_init(void *device, void *session_id,
|
|||
|
||||
s->session_id = session_id;
|
||||
s->device = dev;
|
||||
|
||||
mutex_lock(&core->idr_mtx);
|
||||
idr_preload(GFP_KERNEL);
|
||||
|
||||
/* Need to think if we can use core->lock or dev->lock or need a
|
||||
* different new lock for this?
|
||||
*/
|
||||
id = idr_alloc(&core->sess_idr, (void *)s, 0x7FFF0000, INT_MAX, GFP_NOWAIT);
|
||||
idr_preload_end();
|
||||
mutex_unlock(&core->idr_mtx);
|
||||
if (id < 0) {
|
||||
dprintk(CVP_ERR,
|
||||
"%s: idr allocation failed for session %pK of inst %pK\n",
|
||||
__func__, s, session_id);
|
||||
goto err_session_init_fail;
|
||||
}
|
||||
|
||||
dprintk(CVP_SESS,
|
||||
"%s: inst %pK, session %pK, idr_id = 0x%x\n", __func__, session_id, s, id);
|
||||
"%s: inst %pK, session %pK\n", __func__, session_id, s);
|
||||
|
||||
list_add_tail(&s->list, &dev->sess_head);
|
||||
|
||||
__set_default_sys_properties(device);
|
||||
|
||||
inst->sess_id = id;
|
||||
|
||||
if (call_hfi_pkt_op(dev, session_init, &pkt, s)) {
|
||||
dprintk(CVP_ERR, "session_init: failed to create packet\n");
|
||||
inst->sess_id = 0x0000DEAD;
|
||||
goto err_session_init_fail;
|
||||
}
|
||||
|
||||
|
|
@ -2358,7 +2317,6 @@ static int iris_hfi_session_init(void *device, void *session_id,
|
|||
err_session_init_fail:
|
||||
if (s)
|
||||
__session_clean(s);
|
||||
inst->sess_id = 0;
|
||||
*new_session = NULL;
|
||||
mutex_unlock(&dev->lock);
|
||||
return -EINVAL;
|
||||
|
|
@ -2920,11 +2878,9 @@ static struct cvp_hal_session *__get_session(struct iris_hfi_device *device,
|
|||
u32 session_id)
|
||||
{
|
||||
struct cvp_hal_session *temp = NULL;
|
||||
struct msm_cvp_inst *inst = NULL;
|
||||
|
||||
list_for_each_entry(temp, &device->sess_head, list) {
|
||||
inst = (struct msm_cvp_inst *)temp->session_id;
|
||||
if (session_id == inst->sess_id)
|
||||
if (session_id == hash32_ptr(temp))
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
|
@ -3103,7 +3059,6 @@ static int __response_handler(struct iris_hfi_device *device)
|
|||
/* Process the packet types that we're interested in */
|
||||
process_system_msg(info, device, raw_packet);
|
||||
|
||||
/* This session_id is a double pointer to the idr_id of session */
|
||||
session_id = get_session_id(info);
|
||||
/*
|
||||
* hfi_process_msg_packet provides a session_id that's a hashed
|
||||
|
|
@ -3115,6 +3070,11 @@ static int __response_handler(struct iris_hfi_device *device)
|
|||
if (session_id) {
|
||||
struct cvp_hal_session *session = NULL;
|
||||
|
||||
if (upper_32_bits((uintptr_t)*session_id) != 0) {
|
||||
dprintk(CVP_ERR,
|
||||
"Upper 32-bits != 0 for sess_id=%pK\n",
|
||||
*session_id);
|
||||
}
|
||||
session = __get_session(device,
|
||||
(u32)(uintptr_t)*session_id);
|
||||
if (!session) {
|
||||
|
|
|
|||
|
|
@ -357,8 +357,10 @@ struct cvp_hfi_device {
|
|||
int (*validate_session)(void *sess, const char *func);
|
||||
};
|
||||
|
||||
typedef void (*hfi_cmd_response_callback) (u32 cmd, void *data);
|
||||
typedef void (*msm_cvp_callback) (u32 response, void *callback);
|
||||
typedef void (*hfi_cmd_response_callback) (enum hal_command_response cmd,
|
||||
void *data);
|
||||
typedef void (*msm_cvp_callback) (enum hal_command_response response,
|
||||
void *callback);
|
||||
|
||||
struct cvp_hfi_device *cvp_hfi_initialize(enum msm_cvp_hfi_type hfi_type,
|
||||
u32 device_id, struct msm_cvp_platform_resources *res,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include "hfi_packetization.h"
|
||||
|
|
@ -209,7 +208,7 @@ inline int cvp_create_pkt_cmd_sys_session_init(
|
|||
|
||||
pkt->size = sizeof(struct cvp_hfi_cmd_sys_session_init_packet);
|
||||
pkt->packet_type = HFI_CMD_SYS_SESSION_INIT;
|
||||
pkt->session_id = inst->sess_id;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->session_type = inst->prop.type;
|
||||
pkt->session_kmask = inst->prop.kernel_mask;
|
||||
pkt->session_prio = inst->prop.priority;
|
||||
|
|
@ -267,14 +266,13 @@ int cvp_create_pkt_cmd_session_cmd(struct cvp_hal_session_cmd_pkt *pkt,
|
|||
int pkt_type, struct cvp_hal_session *session)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_cvp_inst *inst = session->session_id;
|
||||
|
||||
if (!pkt)
|
||||
return -EINVAL;
|
||||
|
||||
pkt->size = sizeof(struct cvp_hal_session_cmd_pkt);
|
||||
pkt->packet_type = pkt_type;
|
||||
pkt->session_id = inst->sess_id;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -307,14 +305,13 @@ int cvp_create_pkt_cmd_session_set_buffers(
|
|||
{
|
||||
int rc = 0;
|
||||
struct cvp_hfi_cmd_session_set_buffers_packet *pkt;
|
||||
struct msm_cvp_inst *inst = session->session_id;
|
||||
|
||||
if (!cmd || !session || !inst)
|
||||
if (!cmd || !session)
|
||||
return -EINVAL;
|
||||
|
||||
pkt = (struct cvp_hfi_cmd_session_set_buffers_packet *)cmd;
|
||||
pkt->packet_type = HFI_CMD_SESSION_CVP_SET_BUFFERS;
|
||||
pkt->session_id = inst->sess_id;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->buf_type.iova = iova;
|
||||
pkt->buf_type.size = size;
|
||||
pkt->size = sizeof(struct cvp_hfi_cmd_session_set_buffers_packet);
|
||||
|
|
@ -327,14 +324,13 @@ int cvp_create_pkt_cmd_session_release_buffers(
|
|||
struct cvp_hal_session *session)
|
||||
{
|
||||
struct cvp_session_release_buffers_packet *pkt;
|
||||
struct msm_cvp_inst *inst = session->session_id;
|
||||
|
||||
if (!cmd || !session || !inst)
|
||||
if (!cmd || !session)
|
||||
return -EINVAL;
|
||||
|
||||
pkt = (struct cvp_session_release_buffers_packet *)cmd;
|
||||
pkt->packet_type = HFI_CMD_SESSION_CVP_RELEASE_BUFFERS;
|
||||
pkt->session_id = inst->sess_id;
|
||||
pkt->session_id = hash32_ptr(session);
|
||||
pkt->num_buffers = 1;
|
||||
pkt->buffer_type = 0;
|
||||
pkt->size = sizeof(struct cvp_session_release_buffers_packet) +
|
||||
|
|
@ -351,7 +347,6 @@ int cvp_create_pkt_cmd_session_send(
|
|||
int def_idx;
|
||||
struct cvp_hal_session_cmd_pkt *ptr =
|
||||
(struct cvp_hal_session_cmd_pkt *)in_pkt;
|
||||
struct msm_cvp_inst *inst = session->session_id;
|
||||
|
||||
if (!out_pkt || !in_pkt || !session)
|
||||
return -EINVAL;
|
||||
|
|
@ -359,7 +354,7 @@ int cvp_create_pkt_cmd_session_send(
|
|||
if (ptr->size > MAX_HFI_PKT_SIZE * sizeof(unsigned int))
|
||||
goto error_hfi_packet;
|
||||
|
||||
if (ptr->session_id != inst->sess_id)
|
||||
if (ptr->session_id != hash32_ptr(session))
|
||||
goto error_hfi_packet;
|
||||
|
||||
def_idx = get_pkt_index(ptr);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
|
@ -462,7 +462,7 @@ static struct msm_cvp_inst *cvp_get_inst_from_id(struct msm_cvp_core *core,
|
|||
retry:
|
||||
if (mutex_trylock(&core->lock)) {
|
||||
list_for_each_entry(inst, &core->instances, list) {
|
||||
if (inst->sess_id == session_id) {
|
||||
if (hash32_ptr(inst->session) == session_id) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include "msm_cvp.h"
|
||||
|
|
@ -15,47 +14,6 @@ struct cvp_power_level {
|
|||
unsigned long bw_sum;
|
||||
};
|
||||
|
||||
void *get_sessObj_from_idr(struct msm_cvp_inst *inst)
|
||||
{
|
||||
void *sessObj = NULL;
|
||||
struct msm_cvp_core *core = NULL;
|
||||
|
||||
if (!inst || !inst->core) {
|
||||
dprintk(CVP_ERR, "%s: invalid params\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
core = inst->core;
|
||||
mutex_lock(&core->idr_mtx);
|
||||
sessObj = idr_find(&core->sess_idr, inst->sess_id);
|
||||
mutex_unlock(&core->idr_mtx);
|
||||
if (!sessObj)
|
||||
dprintk(CVP_ERR, "%s: Could not find the sess obj for given idr id\n",
|
||||
__func__);
|
||||
|
||||
return sessObj;
|
||||
}
|
||||
|
||||
u32 get_sessId_from_idr(void *session)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
u32 sess_id = -1;
|
||||
struct msm_cvp_core *core = NULL;
|
||||
|
||||
core = list_first_entry(&cvp_driver->cores, struct msm_cvp_core, list);
|
||||
if (!session || !core)
|
||||
return -EINVAL;
|
||||
mutex_lock(&core->idr_mtx);
|
||||
idr_for_each_entry(&core->sess_idr, ptr, sess_id) {
|
||||
if (ptr == session) {
|
||||
mutex_unlock(&core->idr_mtx);
|
||||
return sess_id;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&core->idr_mtx);
|
||||
return sess_id;
|
||||
}
|
||||
|
||||
static int msm_cvp_get_session_info(struct msm_cvp_inst *inst,
|
||||
struct cvp_kmd_session_info *session)
|
||||
{
|
||||
|
|
@ -72,7 +30,7 @@ static int msm_cvp_get_session_info(struct msm_cvp_inst *inst,
|
|||
return -ECONNRESET;
|
||||
|
||||
s->cur_cmd_type = CVP_KMD_GET_SESSION_INFO;
|
||||
session->session_id = inst->sess_id;
|
||||
session->session_id = hash32_ptr(inst->session);
|
||||
dprintk(CVP_SESS, "%s: id 0x%x\n", __func__, session->session_id);
|
||||
|
||||
s->cur_cmd_type = 0;
|
||||
|
|
@ -741,13 +699,6 @@ static int msm_cvp_session_process_hfi_fence(struct msm_cvp_inst *inst,
|
|||
f->output_index = kfc->output_index;
|
||||
}
|
||||
|
||||
if (f->num_fences >= (MAX_HFI_FENCE_SIZE / 2)) {
|
||||
dprintk(CVP_ERR, "%s: Max number of fences exceeded! Max number supported: %d",
|
||||
__func__, (MAX_HFI_FENCE_SIZE / 2));
|
||||
cvp_free_fence_data(f);
|
||||
msm_cvp_unmap_frame(inst, pkt->client_data.kdata);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
dprintk(CVP_SYNX, "%s: frameID %llu ktid %llu\n",
|
||||
__func__, f->frame_id, pkt->client_data.kdata);
|
||||
|
|
@ -1276,7 +1227,7 @@ static int msm_cvp_session_stop(struct msm_cvp_inst *inst,
|
|||
sq->state = QUEUE_STOP;
|
||||
|
||||
pr_info(CVP_DBG_TAG "Stop session: %pK session_id = %d\n",
|
||||
"sess", inst, inst->sess_id);
|
||||
"sess", inst, hash32_ptr(inst->session));
|
||||
spin_unlock(&sq->lock);
|
||||
|
||||
wake_up_all(&inst->session_queue.wq);
|
||||
|
|
@ -1300,7 +1251,7 @@ int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst)
|
|||
sq->state = QUEUE_STOP;
|
||||
|
||||
dprintk(CVP_SESS, "Stop session queue: %pK session_id = %d\n",
|
||||
inst, inst->sess_id);
|
||||
inst, hash32_ptr(inst->session));
|
||||
spin_unlock(&sq->lock);
|
||||
|
||||
wake_up_all(&inst->session_queue.wq);
|
||||
|
|
@ -1600,7 +1551,7 @@ static void cvp_clean_fence_queue(struct msm_cvp_inst *inst, int synx_state)
|
|||
ktid = f->pkt->client_data.kdata & (FENCE_BIT - 1);
|
||||
|
||||
dprintk(CVP_SYNX, "%s: (%#x) flush frame %llu %llu wait_list\n",
|
||||
__func__, inst->sess_id, ktid, f->frame_id);
|
||||
__func__, hash32_ptr(inst->session), ktid, f->frame_id);
|
||||
|
||||
list_del_init(&f->list);
|
||||
msm_cvp_unmap_frame(inst, f->pkt->client_data.kdata);
|
||||
|
|
@ -1613,7 +1564,7 @@ static void cvp_clean_fence_queue(struct msm_cvp_inst *inst, int synx_state)
|
|||
ktid = f->pkt->client_data.kdata & (FENCE_BIT - 1);
|
||||
|
||||
dprintk(CVP_SYNX, "%s: (%#x)flush frame %llu %llu sched_list\n",
|
||||
__func__, inst->sess_id, ktid, f->frame_id);
|
||||
__func__, hash32_ptr(inst->session), ktid, f->frame_id);
|
||||
cvp_cancel_synx(inst, CVP_INPUT_SYNX, f, synx_state);
|
||||
}
|
||||
|
||||
|
|
@ -1661,14 +1612,14 @@ static int cvp_flush_all(struct msm_cvp_inst *inst)
|
|||
return -ECONNRESET;
|
||||
|
||||
dprintk(CVP_SESS, "session %llx (%#x)flush all starts\n",
|
||||
inst, inst->sess_id);
|
||||
inst, hash32_ptr(inst->session));
|
||||
q = &inst->fence_cmd_queue;
|
||||
hdev = inst->core->device;
|
||||
|
||||
cvp_clean_fence_queue(inst, SYNX_STATE_SIGNALED_CANCEL);
|
||||
|
||||
dprintk(CVP_SESS, "%s: (%#x) send flush to fw\n",
|
||||
__func__, inst->sess_id);
|
||||
__func__, hash32_ptr(inst->session));
|
||||
|
||||
/* Send flush to FW */
|
||||
rc = call_hfi_op(hdev, session_flush, (void *)inst->session);
|
||||
|
|
@ -1685,7 +1636,7 @@ static int cvp_flush_all(struct msm_cvp_inst *inst)
|
|||
__func__, rc);
|
||||
|
||||
dprintk(CVP_SESS, "%s: (%#x) received flush from fw\n",
|
||||
__func__, inst->sess_id);
|
||||
__func__, hash32_ptr(inst->session));
|
||||
|
||||
exit:
|
||||
rc = cvp_drain_fence_sched_list(inst);
|
||||
|
|
@ -1908,10 +1859,10 @@ int msm_cvp_session_deinit(struct msm_cvp_inst *inst)
|
|||
return -EINVAL;
|
||||
}
|
||||
dprintk(CVP_SESS, "%s: inst %pK (%#x)\n", __func__,
|
||||
inst, inst->sess_id);
|
||||
inst, hash32_ptr(inst->session));
|
||||
|
||||
session = (struct cvp_hal_session *)get_sessObj_from_idr(inst);
|
||||
if (!session || session != inst->session)
|
||||
session = (struct cvp_hal_session *)inst->session;
|
||||
if (!session)
|
||||
return rc;
|
||||
|
||||
rc = msm_cvp_comm_try_state(inst, MSM_CVP_CLOSE_DONE);
|
||||
|
|
@ -1932,7 +1883,7 @@ int msm_cvp_session_init(struct msm_cvp_inst *inst)
|
|||
}
|
||||
|
||||
dprintk(CVP_SESS, "%s: inst %pK (%#x)\n", __func__,
|
||||
inst, inst->sess_id);
|
||||
inst, hash32_ptr(inst->session));
|
||||
|
||||
/* set default frequency */
|
||||
inst->clk_data.core_id = 0;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#ifndef _MSM_CVP_H_
|
||||
|
|
@ -35,6 +34,4 @@ int msm_cvp_session_init(struct msm_cvp_inst *inst);
|
|||
int msm_cvp_session_deinit(struct msm_cvp_inst *inst);
|
||||
int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst);
|
||||
int cvp_stop_clean_fence_queue(struct msm_cvp_inst *inst);
|
||||
void *get_sessObj_from_idr(struct msm_cvp_inst *inst);
|
||||
u32 get_sessId_from_idr(void *session);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "msm_cvp_common.h"
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
do { \
|
||||
clear_bit(idx, &inst->dma_cache.usage_bitmap); \
|
||||
dprintk(CVP_MEM, "clear %x bit %d dma_cache bitmap 0x%llx\n", \
|
||||
inst->sess_id, smem->bitmap_index, \
|
||||
hash32_ptr(inst->session), smem->bitmap_index, \
|
||||
inst->dma_cache.usage_bitmap); \
|
||||
} while (0)
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
do { \
|
||||
set_bit(idx, &inst->dma_cache.usage_bitmap); \
|
||||
dprintk(CVP_MEM, "Set %x bit %d dma_cache bitmap 0x%llx\n", \
|
||||
inst->sess_id, idx, \
|
||||
hash32_ptr(inst->session), idx, \
|
||||
inst->dma_cache.usage_bitmap); \
|
||||
} while (0)
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ void print_smem(u32 tag, const char *str, struct msm_cvp_inst *inst,
|
|||
if (smem->dma_buf) {
|
||||
dprintk(tag,
|
||||
"%s: %x : %s size %d flags %#x iova %#x idx %d ref %d",
|
||||
str, inst->sess_id, smem->dma_buf->name,
|
||||
str, hash32_ptr(inst->session), smem->dma_buf->name,
|
||||
smem->size, smem->flags, smem->device_addr,
|
||||
smem->bitmap_index, smem->refcount);
|
||||
}
|
||||
|
|
@ -51,13 +51,13 @@ static void print_internal_buffer(u32 tag, const char *str,
|
|||
if (cbuf->smem->dma_buf) {
|
||||
dprintk(tag,
|
||||
"%s: %x : fd %d off %d %s size %d iova %#x",
|
||||
str, inst->sess_id, cbuf->fd,
|
||||
str, hash32_ptr(inst->session), cbuf->fd,
|
||||
cbuf->offset, cbuf->smem->dma_buf->name, cbuf->size,
|
||||
cbuf->smem->device_addr);
|
||||
} else {
|
||||
dprintk(tag,
|
||||
"%s: %x : idx %2d fd %d off %d size %d iova %#x",
|
||||
str, inst->sess_id, cbuf->fd,
|
||||
str, hash32_ptr(inst->session), cbuf->fd,
|
||||
cbuf->offset, cbuf->size, cbuf->smem->device_addr);
|
||||
}
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ void print_client_buffer(u32 tag, const char *str,
|
|||
|
||||
dprintk(tag,
|
||||
"%s: %x : idx %2d fd %d off %d size %d type %d flags 0x%x\n",
|
||||
str, inst->sess_id, cbuf->index, cbuf->fd,
|
||||
str, hash32_ptr(inst->session), cbuf->index, cbuf->fd,
|
||||
cbuf->offset, cbuf->size, cbuf->type, cbuf->flags);
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ int msm_cvp_map_buf_dsp(struct msm_cvp_inst *inst, struct cvp_kmd_buffer *buf)
|
|||
}
|
||||
|
||||
if (buf->index) {
|
||||
rc = cvp_dsp_register_buffer(inst->sess_id, buf->fd,
|
||||
rc = cvp_dsp_register_buffer(hash32_ptr(session), buf->fd,
|
||||
smem->dma_buf->size, buf->size, buf->offset,
|
||||
buf->index, (uint32_t)smem->device_addr);
|
||||
if (rc) {
|
||||
|
|
@ -227,7 +227,7 @@ int msm_cvp_unmap_buf_dsp(struct msm_cvp_inst *inst, struct cvp_kmd_buffer *buf)
|
|||
}
|
||||
|
||||
if (buf->index) {
|
||||
rc = cvp_dsp_deregister_buffer(inst->sess_id, buf->fd,
|
||||
rc = cvp_dsp_deregister_buffer(hash32_ptr(session), buf->fd,
|
||||
cbuf->smem->dma_buf->size, buf->size, buf->offset,
|
||||
buf->index, (uint32_t)cbuf->smem->device_addr);
|
||||
if (rc) {
|
||||
|
|
@ -545,7 +545,7 @@ void msm_cvp_unmap_frame(struct msm_cvp_inst *inst, u64 ktid)
|
|||
|
||||
ktid &= (FENCE_BIT - 1);
|
||||
dprintk(CVP_MEM, "%s: (%#x) unmap frame %llu\n",
|
||||
__func__, inst->sess_id, ktid);
|
||||
__func__, hash32_ptr(inst->session), ktid);
|
||||
|
||||
found = false;
|
||||
mutex_lock(&inst->frames.lock);
|
||||
|
|
@ -587,7 +587,7 @@ int msm_cvp_unmap_user_persist(struct msm_cvp_inst *inst,
|
|||
smem = pbuf->smem;
|
||||
|
||||
dprintk(CVP_MEM, "unmap persist: %x %d %d %#x",
|
||||
inst->sess_id, pbuf->fd,
|
||||
hash32_ptr(inst->session), pbuf->fd,
|
||||
pbuf->size, smem->device_addr);
|
||||
|
||||
if (smem->bitmap_index >= MAX_DMABUF_NUMS) {
|
||||
|
|
@ -785,7 +785,7 @@ int msm_cvp_session_deinit_buffers(struct msm_cvp_inst *inst)
|
|||
list_for_each_entry_safe(cbuf, dummy, &inst->cvpdspbufs.list,
|
||||
list) {
|
||||
print_internal_buffer(CVP_MEM, "remove dspbufs", inst, cbuf);
|
||||
rc = cvp_dsp_deregister_buffer(inst->sess_id,
|
||||
rc = cvp_dsp_deregister_buffer(hash32_ptr(session),
|
||||
cbuf->fd, cbuf->smem->dma_buf->size, cbuf->size,
|
||||
cbuf->offset, cbuf->index,
|
||||
(uint32_t)cbuf->smem->device_addr);
|
||||
|
|
@ -955,7 +955,7 @@ int cvp_release_arp_buffers(struct msm_cvp_inst *inst)
|
|||
if (buf->ownership == DRIVER) {
|
||||
dprintk(CVP_MEM,
|
||||
"%s: %x : fd %d %s size %d",
|
||||
"free arp", inst->sess_id, buf->fd,
|
||||
"free arp", hash32_ptr(inst->session), buf->fd,
|
||||
smem->dma_buf->name, buf->size);
|
||||
msm_cvp_smem_free(smem);
|
||||
kmem_cache_free(cvp_driver->smem_cache, smem);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <linux/jiffies.h>
|
||||
|
|
@ -196,31 +195,23 @@ struct msm_cvp_inst *cvp_get_inst_validate(struct msm_cvp_core *core,
|
|||
{
|
||||
int rc = 0;
|
||||
struct cvp_hfi_device *hdev;
|
||||
struct msm_cvp_inst *inst;
|
||||
void *sessObj = NULL;
|
||||
struct msm_cvp_inst *s;
|
||||
|
||||
inst = cvp_get_inst(core, session_id);
|
||||
if (!inst) {
|
||||
dprintk(CVP_ERR, "%s Inst doesn't exit\n",
|
||||
s = cvp_get_inst(core, session_id);
|
||||
if (!s) {
|
||||
dprintk(CVP_ERR, "%s session doesn't exit\n",
|
||||
__builtin_return_address(0));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sessObj = get_sessObj_from_idr(inst);
|
||||
if (!sessObj || sessObj != inst->session) {
|
||||
dprintk(CVP_ERR,
|
||||
"Either sessionObj is null or not matching with inst->session\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hdev = inst->core->device;
|
||||
rc = call_hfi_op(hdev, validate_session, sessObj, __func__);
|
||||
hdev = s->core->device;
|
||||
rc = call_hfi_op(hdev, validate_session, s->session, __func__);
|
||||
if (rc) {
|
||||
cvp_put_inst(inst);
|
||||
inst = NULL;
|
||||
cvp_put_inst(s);
|
||||
s = NULL;
|
||||
}
|
||||
|
||||
return inst;
|
||||
return s;
|
||||
}
|
||||
|
||||
static void cvp_handle_session_cmd_done(enum hal_command_response cmd,
|
||||
|
|
@ -495,7 +486,7 @@ static void handle_session_init_done(enum hal_command_response cmd, void *data)
|
|||
}
|
||||
|
||||
dprintk(CVP_SESS, "%s: cvp session %#x\n", __func__,
|
||||
inst->sess_id);
|
||||
hash32_ptr(inst->session));
|
||||
|
||||
signal_session_msg_receipt(cmd, inst);
|
||||
cvp_put_inst(inst);
|
||||
|
|
@ -577,7 +568,7 @@ static void handle_session_error(enum hal_command_response cmd, void *data)
|
|||
|
||||
hdev = inst->core->device;
|
||||
dprintk(CVP_ERR, "Session error received for inst %pK session %x\n",
|
||||
inst, inst->sess_id);
|
||||
inst, hash32_ptr(inst->session));
|
||||
|
||||
if (response->status == CVP_ERR_MAX_CLIENTS) {
|
||||
dprintk(CVP_WARN, "Too many clients, rejecting %pK", inst);
|
||||
|
|
@ -767,7 +758,7 @@ static void handle_session_close(enum hal_command_response cmd, void *data)
|
|||
cvp_put_inst(inst);
|
||||
}
|
||||
|
||||
void cvp_handle_cmd_response(u32 cmd, void *data)
|
||||
void cvp_handle_cmd_response(enum hal_command_response cmd, void *data)
|
||||
{
|
||||
dprintk(CVP_HFI, "Command response = %d\n", cmd);
|
||||
switch (cmd) {
|
||||
|
|
@ -910,7 +901,7 @@ static int msm_comm_session_abort(struct msm_cvp_inst *inst)
|
|||
abort_completion = SESSION_MSG_INDEX(HAL_SESSION_ABORT_DONE);
|
||||
|
||||
dprintk(CVP_WARN, "%s: inst %pK session %x\n", __func__,
|
||||
inst, inst->sess_id);
|
||||
inst, hash32_ptr(inst->session));
|
||||
rc = call_hfi_op(hdev, session_abort, (void *)inst->session);
|
||||
if (rc) {
|
||||
dprintk(CVP_ERR,
|
||||
|
|
@ -923,7 +914,7 @@ static int msm_comm_session_abort(struct msm_cvp_inst *inst)
|
|||
inst->core->resources.msm_cvp_hw_rsp_timeout));
|
||||
if (!rc) {
|
||||
dprintk(CVP_ERR, "%s: inst %pK session %x abort timed out\n",
|
||||
__func__, inst, inst->sess_id);
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
|
||||
dump_hfi_queue(hdev->hfi_device_data);
|
||||
msm_cvp_comm_generate_sys_error(inst);
|
||||
|
|
@ -1277,7 +1268,7 @@ int msm_cvp_comm_try_state(struct msm_cvp_inst *inst, int state)
|
|||
}
|
||||
dprintk(CVP_SESS,
|
||||
"Trying to move inst: %pK (%#x) from: %#x to %#x\n",
|
||||
inst, inst->sess_id, inst->state, state);
|
||||
inst, hash32_ptr(inst->session), inst->state, state);
|
||||
|
||||
mutex_lock(&inst->sync_lock);
|
||||
if (inst->state == MSM_CVP_CORE_INVALID) {
|
||||
|
|
@ -1290,7 +1281,7 @@ int msm_cvp_comm_try_state(struct msm_cvp_inst *inst, int state)
|
|||
flipped_state = get_flipped_state(inst->state, state);
|
||||
dprintk(CVP_SESS,
|
||||
"inst: %pK (%#x) flipped_state = %#x %x\n",
|
||||
inst, inst->sess_id, flipped_state, state);
|
||||
inst, hash32_ptr(inst->session), flipped_state, state);
|
||||
switch (flipped_state) {
|
||||
case MSM_CVP_CORE_UNINIT_DONE:
|
||||
case MSM_CVP_CORE_INIT:
|
||||
|
|
@ -1500,7 +1491,7 @@ int msm_cvp_comm_kill_session(struct msm_cvp_inst *inst)
|
|||
return 0;
|
||||
}
|
||||
dprintk(CVP_WARN, "%s: inst %pK, session %x state %d\n", __func__,
|
||||
inst, inst->sess_id, inst->state);
|
||||
inst, hash32_ptr(inst->session), inst->state);
|
||||
/*
|
||||
* We're internally forcibly killing the session, if fw is aware of
|
||||
* the session send session_abort to firmware to clean up and release
|
||||
|
|
@ -1512,7 +1503,7 @@ int msm_cvp_comm_kill_session(struct msm_cvp_inst *inst)
|
|||
if (rc) {
|
||||
dprintk(CVP_ERR,
|
||||
"%s: inst %pK session %x abort failed\n",
|
||||
__func__, inst, inst->sess_id);
|
||||
__func__, inst, hash32_ptr(inst->session));
|
||||
change_cvp_inst_state(inst, MSM_CVP_CORE_INVALID);
|
||||
} else {
|
||||
change_cvp_inst_state(inst, MSM_CVP_CORE_UNINIT);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <linux/dma-direction.h>
|
||||
|
|
@ -166,7 +165,7 @@ void *msm_cvp_open(int core_id, int session_type)
|
|||
list_for_each_entry(inst, &core->instances, list)
|
||||
dprintk(CVP_ERR, "inst %pK, cmd %d id %d\n",
|
||||
inst, inst->cur_cmd_type,
|
||||
inst->sess_id);
|
||||
hash32_ptr(inst->session));
|
||||
mutex_unlock(&core->lock);
|
||||
|
||||
return NULL;
|
||||
|
|
@ -370,7 +369,7 @@ int msm_cvp_destroy(struct msm_cvp_inst *inst)
|
|||
synx_uninitialize(inst->synx_session_id);
|
||||
|
||||
pr_info(CVP_DBG_TAG "Closed cvp instance: %pK session_id = %d\n",
|
||||
"sess", inst, inst->sess_id);
|
||||
"sess", inst, hash32_ptr(inst->session));
|
||||
if (inst->cur_cmd_type)
|
||||
dprintk(CVP_ERR, "deleted instance has pending cmd %d\n",
|
||||
inst->cur_cmd_type);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue