Increase the total number of camera ID's supported.
Change-Id: Ib1eb78eb1d6686b28c90b06b87fa57bcc1f45c07
Signed-off-by: Waseem Akhtar <quic_wakhtar@quicinc.com>
When the kernel is configured with CONFIG_NR_CPUS smaller than the
number of CPU nodes in the device tree(DT), all the CPU nodes parsing
done to fetch topology information will fail. This is not reasonable
as it is valid to have all the physical CPUs in the system in the DT.
Let us just skip such CPU DT nodes that are not used in the kernel
rather than returning an error.
Change-Id: Ic7c50afd52741eb2a472fe33d532835f767e8d1c
Signed-off-by: Shivnandan Kumar <quic_kshivnan@quicinc.com>
In writeback cache mode mtime/ctime updates are cached, and flushed to the
server using the ->write_inode() callback.
Closing the file will result in a dirty inode being immediately written,
but in other cases the inode can remain dirty after all references are
dropped. This result in the inode being written back from reclaim, which
can deadlock on a regular allocation while the request is being served.
The usual mechanisms (GFP_NOFS/PF_MEMALLOC*) don't work for FUSE, because
serving a request involves unrelated userspace process(es).
Instead do the same as for dirty pages: make sure the inode is written
before the last reference is gone.
- fallocate(2)/copy_file_range(2): these call file_update_time() or
file_modified(), so flush the inode before returning from the call
- unlink(2), link(2) and rename(2): these call fuse_update_ctime(), so
flush the ctime directly from this helper
fuse_flush_time_update(inode) was skipped to call in __fuse_copy_file_range()
because of huge dependent changes.
Change-Id: I102dab1992c9ed2b5e89606265b3d3aa9c1cdb8a
Reported-by: chenguanyou <chenguanyou@xiaomi.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Git-commit: 5c791fe1e2a4f401f819065ea4fc0450849f1818
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>
A transaction of type BINDER_TYPE_WEAK_HANDLE can fail to increment the
reference for a node. In this case, the target proc normally releases
the failed reference upon close as expected. However, if the target is
dying in parallel the call will race with binder_deferred_release(), so
the target could have released all of its references by now leaving the
cleanup of the new failed reference unhandled.
The transaction then ends and the target proc gets released making the
ref->proc now a dangling pointer. Later on, ref->node is closed and we
attempt to take spin_lock(&ref->proc->inner_lock), which leads to the
use-after-free bug reported below. Let's fix this by cleaning up the
failed reference on the spot instead of relying on the target to do so.
==================================================================
BUG: KASAN: use-after-free in _raw_spin_lock+0xa8/0x150
Write of size 4 at addr ffff5ca207094238 by task kworker/1:0/590
CPU: 1 PID: 590 Comm: kworker/1:0 Not tainted 5.19.0-rc8 #10
Hardware name: linux,dummy-virt (DT)
Workqueue: events binder_deferred_func
Call trace:
dump_backtrace.part.0+0x1d0/0x1e0
show_stack+0x18/0x70
dump_stack_lvl+0x68/0x84
print_report+0x2e4/0x61c
kasan_report+0xa4/0x110
kasan_check_range+0xfc/0x1a4
__kasan_check_write+0x3c/0x50
_raw_spin_lock+0xa8/0x150
binder_deferred_func+0x5e0/0x9b0
process_one_work+0x38c/0x5f0
worker_thread+0x9c/0x694
kthread+0x188/0x190
ret_from_fork+0x10/0x20
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Bug: 239630375
Link: https://lore.kernel.org/all/20220801182511.3371447-1-cmllamas@google.com/
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I5085dd0dc805a780a64c057e5819f82dd8f02868
(cherry picked from commit ae3fa5d16a02ba7c7b170e0e1ab56d6f0ba33964)
Git-commit: 70f060f93c
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: PavanKumar S.R <quic_pavasr@quicinc.com>
Add SOC ID to support socinfo for Khaje IOT platform.
Change-Id: Ibcc958d1f7326afeccb53c5cf6582f7f2269b46b
Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
Add SOC ID to support socinfo for KhajeG platform.
Change-Id: Ie77ac540879e392754e51a3857c2c1317c2acb7c
Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com>
Set the ipa3_ctx->logbuf NULL after destroy,or
IPAERR will use the ipa3_ctx->logbuf after free it,
that can make crash.
Change-Id: I470c4a043d426d7620c01fadac1f1cd12ad54b08
Signed-off-by: Veerendra Kumar Kamsali <quic_veekum@quicinc.com>
There is possiblity of setting wrong IIN value, if user vote
for greater then IIN_MAX (5000mA <), so fix this by updating
the IIN_MAX as IIN value.
Change-Id: I50df73d71514967d0d383d612f1c9ddba58437ce
Signed-off-by: Rakesh Kota <quic_kotarake@quicinc.com>
Cleaned debug log output when nordic
controllers notify data to HMD.
Change-Id: Ibd767d3db181ff7b2f99976e910a4fd2f6c85727
Signed-off-by: Wei Tan <quic_weitan@quicinc.com>
A check is introduced to restrict the double call of
hyp_assign_phys for the same address.
Change-Id: I0ac984af9fe456d317c7c2d99d6d1290f86830e8
Acked-by: Sandheep Balasubramanian <sandheep@qti.qualcomm.com>
Signed-off-by: Vamsi Krishna Gattupalli <quic_vgattupa@quicinc.com>
kcalloc returns out of memory in low memory conditions even if memory
is available in non-contiguous manner. This results in failure to
submit commands to ringbuffer. Use kvcalloc in place of kcalloc so
that when kcalloc fails in low memory conditions, commands can be
submitted if kvcalloc can provide enough memory.
Change-Id: If6a20e35983982b5c0888e5f7dabecfa8c026bcb
Signed-off-by: Pranav Patel <quic_pranavp@quicinc.com>
Add a check for valid cpu and create cpu isolation cooling
device only for those cpu's which passes this check.
Change-Id: Ic931a1aa51857ed109555e055879cb39da11f3cf
Signed-off-by: Priyansh Jain <quic_priyjain@quicinc.com>
Avoid dumping primary and secondary register dump
when crash happens in mission mode as these register might not
have correct info.
Change-Id: Ie6004924ecaf1c7177888c49303dbb221925dfc7
Signed-off-by: Nirav Shah <quic_nnshah@quicinc.com>
Ensure that thermal limits set by devfreq cooling framework,
limits framework and sysfs nodes (like gpu_max_clock) don't
overwrite each other, instead a consolidated (lowest of all)
limit is used as a final thermal limit. If this fails, fall back
to setting thermal_pwrlevel directly.
Change-Id: Ia6ec60e4881176da064c3cd5cf4ffd8e0a8e1046
Signed-off-by: Pranav Patel <quic_pranavp@quicinc.com>
Enable the flag required to support ICE Driver for
Full Disk Encryption feature.
Change-Id: Icd107924f7d1deb1bbb797f155bca8e6aebac72c
Signed-off-by: Abhinav Gupta <quic_abgupt@quicinc.com>
Due to mmc optimizations mmc host controllers are turned off during
mmc suspend. These clocks have to be turned ON during ICE program/evict
key. In PFK based FBE there would be numerous calls to program/evict
ICE key.
The change ensure required clocks are turned on before programming
crypto key to avoid any unclocked access.
Validations done:-
1) Flash P SDM660 build and let device bootup successfully to UI.
2) adb shell getprop ro.crypto.state: encrypted
adb shell getprop ro.crypto.type: file
3) Create files under /data and /data/misc/vold/user_key
4) Flash T build except userdata i.e. OTA to T.
5) Device able to boot successfully to UI.
6) Files created earlier got retained after flashing T build.
Change-Id: Ia1629a6b373895af42b1c724aebbe7ae6fc7de93
Signed-off-by: Pruthvi Kurada <quic_pkurada@quicinc.com>
Add support for 4-byte SDAM cookie, instead of 1-byte(default),
to make the SDAM corruption check more accurate.
Change-Id: I084c44eef08d4555896a7efb38a098420ebfec69
Signed-off-by: Kamal Wadhwa <quic_kamalw@quicinc.com>
Cleaned up and updated the driver for the
end-to-end scenario of XR reference device
connecting with the Remote VR controllers.
Change-Id: I1cb725c331b808addc7c5b8af0422ce616fa7f03
Signed-off-by: Wei Tan <quic_weitan@quicinc.com>
commit 17839856fd588f4ab6b789f482ed3ffd7c403e1f upstream.
Doing a "get_user_pages()" on a copy-on-write page for reading can be
ambiguous: the page can be COW'ed at any time afterwards, and the
direction of a COW event isn't defined.
Yes, whoever writes to it will generally do the COW, but if the thread
that did the get_user_pages() unmapped the page before the write (and
that could happen due to memory pressure in addition to any outright
action), the writer could also just take over the old page instead.
End result: the get_user_pages() call might result in a page pointer
that is no longer associated with the original VM, and is associated
with - and controlled by - another VM having taken it over instead.
So when doing a get_user_pages() on a COW mapping, the only really safe
thing to do would be to break the COW when getting the page, even when
only getting it for reading.
At the same time, some users simply don't even care.
For example, the perf code wants to look up the page not because it
cares about the page, but because the code simply wants to look up the
physical address of the access for informational purposes, and doesn't
really care about races when a page might be unmapped and remapped
elsewhere.
This adds logic to force a COW event by setting FOLL_WRITE on any
copy-on-write mapping when FOLL_GET (or FOLL_PIN) is used to get a page
pointer as a result.
The current semantics end up being:
- __get_user_pages_fast(): no change. If you don't ask for a write,
you won't break COW. You'd better know what you're doing.
- get_user_pages_fast(): the fast-case "look it up in the page tables
without anything getting mmap_sem" now refuses to follow a read-only
page, since it might need COW breaking. Which happens in the slow
path - the fast path doesn't know if the memory might be COW or not.
- get_user_pages() (including the slow-path fallback for gup_fast()):
for a COW mapping, turn on FOLL_WRITE for FOLL_GET/FOLL_PIN, with
very similar semantics to FOLL_FORCE.
If it turns out that we want finer granularity (ie "only break COW when
it might actually matter" - things like the zero page are special and
don't need to be broken) we might need to push these semantics deeper
into the lookup fault path. So if people care enough, it's possible
that we might end up adding a new internal FOLL_BREAK_COW flag to go
with the internal FOLL_COW flag we already have for tracking "I had a
COW".
Alternatively, if it turns out that different callers might want to
explicitly control the forced COW break behavior, we might even want to
make such a flag visible to the users of get_user_pages() instead of
using the above default semantics.
But for now, this is mostly commentary on the issue (this commit message
being a lot bigger than the patch, and that patch in turn is almost all
comments), with that minimal "enable COW breaking early" logic using the
existing FOLL_WRITE behavior.
[ It might be worth noting that we've always had this ambiguity, and it
could arguably be seen as a user-space issue.
You only get private COW mappings that could break either way in
situations where user space is doing cooperative things (ie fork()
before an execve() etc), but it _is_ surprising and very subtle, and
fork() is supposed to give you independent address spaces.
So let's treat this as a kernel issue and make the semantics of
get_user_pages() easier to understand. Note that obviously a true
shared mapping will still get a page that can change under us, so this
does _not_ mean that get_user_pages() somehow returns any "stable"
page ]
[surenb: backport notes
Replaced (gup_flags | FOLL_WRITE) with write=1 in gup_pgd_range.
Removed FOLL_PIN usage in should_force_cow_break since it's missing in
the earlier kernels.]
Change-Id: I6ae007f29a538767fddccf3306264e892f9134ab
Reported-by: Jann Horn <jannh@google.com>
Tested-by: Christoph Hellwig <hch@lst.de>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Kirill Shutemov <kirill@shutemov.name>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[surenb: backport to 4.19 kernel]
Cc: stable@vger.kernel.org # 4.19.x
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 5e24029791
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
There is possibility of a momentary SOC jump after we
exit the FVSS loop. Fix this by updating the msoc
on every FVSS soc update to make sure the soc value in
hardware tracks the FVSS scaled value.
Change-Id: I7a5638551615cc0d6da7171b05ffb2496cac4381
Signed-off-by: Rakesh Kota <quic_kotarake@quicinc.com>