This reverts commit c4da2896278405a71e10a3abe9639aff9b121d78.
Change-Id: I2df812002f8b1c234f173f014417d7cc7ef6829d
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 3736be6732067d480b95402c4e07239ed5145518.
Change-Id: I45d63b2a84f26da5a346c10670ed6adf46e635d1
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 094480a0881f1ad67e38bf7a92173fe0d88951f0.
Change-Id: I5d022039dd506a1b6bae6bb60bffc19f545c9bcb
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Similar to what I've done on other devices, revert to normal grace
periods to reduce power usage. Expedited RCU hammers CPUs with IPIs to
reduce grace period durations and thus RCU latency, but that disrupts
busy CPUs and causes unnecessary wakeups while providing little to no
improvement in real-world performance.
Change-Id: I230dc7283da50108171937876c60c8f13e4ace4e
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit e17aedc1fa5020b943f8f557f4795668737e8362.
Change-Id: I880ad0558e2bdd26ffb86ac36380dfd5f132e0bc
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
OEMs disable it to improve throughput.
Change-Id: I9116c008cffc78c08e812adca6794d07794171ef
Signed-off-by: minaripenguin <minaripenguin@users.noreply.github.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Both the VM and EXT4 have a "commit to disk after X seconds" time.
Currently the EXT4 time is shorter than our VM time, which is a bit
suboptional,
it's better for performance to let the VM do the writeouts in bulk
rather than something deep in the journalling layer.
Change-Id: I0de7bcfa9487421954cb9ae7f2cab3159c663878
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Android will unset SD_LOAD_BALANCE for big cluster domain and
for some product it is true to have a big cluster and the MC
domain thus lacks the SD_LOAD_BALANCE flag. This will cause
select_task_rq_fair logic break and the task will spin forever
in that cluster.
Bug: 141334320
Fixes: 00bbe7d605a9 "ANDROID: sched: EAS & 'single cpu per cluster'/cpu hotplug interoperability"
Test: boot and see task on core7 scheduled correctly
Change-Id: I7c2845b1f7bc1d4051eb3ad6a5f9838fb0b1ba04
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
If the task is pinned to a cpu, setting the misfit status means that
we'll unnecessarily continuously attempt to migrate the task but fail.
This continuous failure will cause the balance_interval to increase to
a high value, and eventually cause unnecessary significant delays in
balancing the system when real imbalance happens.
Caught while testing uclamp where rt-app calibration loop was pinned to
cpu 0, shortly after which we spawn another task with high util_clamp
value. The task was failing to migrate after over 40ms of runtime due to
balance_interval unnecessary expanded to a very high value from the
calibration loop.
Not done here, but it could be useful to extend the check for pinning to
verify that the affinity of the task has a cpu that fits. We could end
up in a similar situation otherwise.
Fixes: 3b1baa6496e6 ("sched/fair: Add 'group_misfit_task' load-balance type")
Change-Id: I18be95658c3c06faec02ff2fce77c89540e83ebc
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
App compaction can not be aborted due to current design,
it causes app get stuck for a while when it resume to foreground
if app is compacting by kernel. So now we add check in kernel
while loop to abort the compaction if adj is zero.
Change-Id: I16f36a08d1a5efcb36827e84f5058abfa0a7dae0
Signed-off-by: huangzq2 <huangzq2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2014822
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Allow selecting only tasks with oom_score_adj >= 0.
Change-Id: Iebbb487c711da98b8fcb367ba838b5fe0b260d4f
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
The proc file `compact_unevictable_allowed' should allow 0 and 1 only, the
`extra*' attribues have been set properly but without
proc_dointvec_minmax() as the `proc_handler' the limit will not be
enforced.
Use proc_dointvec_minmax() as the `proc_handler' to enfoce the valid
specified range.
Link: http://lkml.kernel.org/r/20200303202054.gsosv7fsx2ma3cic@linutronix.de
Change-Id: I7ba356dac5d11ef0c1bbf4509fa61459f35a0a8f
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit dcd2f048585afbaf334fab83607d28cee2c1f1ed.
Change-Id: Ia6991c9093b516ae5b5915c06f468b3b47a6b8a7
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
To turn the KMSG_DUMP_* reasons into a more ordered list, collapse
the redundant KMSG_DUMP_(RESTART|HALT|POWEROFF) reasons into
KMSG_DUMP_SHUTDOWN. The current users already don't meaningfully
distinguish between them, so there's no need to, as discussed here:
https://lore.kernel.org/lkml/CA+CK2bAPv5u1ih5y9t5FUnTyximtFCtDYXJCpuyjOyHNOkRdqw@mail.gmail.com/
Link: https://lore.kernel.org/lkml/20200515184434.8470-2-keescook@chromium.org/
Change-Id: I23f5d8ed4b16c2b506b1727abfe2b40bb9dc6db0
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Now that pstore_register() can correctly pass max_reason to the kmesg
dump facility, introduce a new "max_reason" module parameter and
"max-reason" Device Tree field.
The "dump_oops" module parameter and "dump-oops" Device
Tree field are now considered deprecated, but are now automatically
converted to their corresponding max_reason values when present, though
the new max_reason setting has precedence.
For struct ramoops_platform_data, the "dump_oops" member is entirely
replaced by a new "max_reason" member, with the only existing user
updated in place.
Additionally remove the "reason" filter logic from ramoops_pstore_write(),
as that is not specifically needed anymore, though technically
this is a change in behavior for any ramoops users also setting the
printk.always_kmsg_dump boot param, which will cause ramoops to behave as
if max_reason was set to KMSG_DUMP_MAX.
Link: https://lore.kernel.org/lkml/20200515184434.8470-6-keescook@chromium.org/
Change-Id: I563849afcc4975f36b616c2976202df92cfe4d14
Co-developed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Add a new member to struct pstore_info for passing information about
kmesg dump maximum reason. This allows a finer control of what kmesg
dumps are sent to pstore storage backends.
Those backends that do not explicitly set this field (keeping it equal to
0), get the default behavior: store only Oopses and Panics, or everything
if the printk.always_kmsg_dump boot param is set.
Link: https://lore.kernel.org/lkml/20200515184434.8470-5-keescook@chromium.org/
Change-Id: Iedf5f428a0bdb38f1fe5effa6226292b7144bd95
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Refactor device tree size parsing routines to be able to pass a non-zero
default value for providing a configurable default for the coming
"max_reason" field. Also rename the helpers, since we're not always
parsing a size -- we're parsing a u32 and making sure it's not greater
than INT_MAX.
Link: https://lore.kernel.org/lkml/20200506211523.15077-4-keescook@chromium.org/
Link: https://lore.kernel.org/lkml/20200521205223.175957-1-tyhicks@linux.microsoft.com
Change-Id: If44ba60c12ecb5595d6c124ce9b44f886cd27018
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
A couple module parameters had 0600 permissions, but changing them would
have no impact on ramoops, so switch these to 0400 to reflect reality.
Link: https://lore.kernel.org/lkml/20200506211523.15077-7-keescook@chromium.org/
Change-Id: Iab22b003fa4f7c9cb9b5fd26d3d176af37c7c454
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Since the header is a fixed small maximum size, just use a stack variable
to avoid memory allocation in the write path.
Change-Id: I9f8a09f0f95058a40647e1cd55238c80f95d5e4b
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
If zero-length header happened in ramoops_write_kmsg_hdr(), that means
we will not be able to read back dmesg record later, since it will be
treated as invalid header in ramoops_pstore_read(). So we should not
execute the following code but return the error.
Change-Id: I86519a8fb83bacde9879b8149d80a34c37ace8a8
Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Since only one single ramoops area allowed at a time, other probes
(like device tree) are meaningless, as it will waste CPU resources.
So let's check for being already initialized first.
Change-Id: I37823492ff578d8b4485d2b762a1bcbbba2ddc49
Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Sometimes pstore_console_write() will write records with zero size
to persistent ram zone, which is unnecessary. It will only increase
resource consumption. Also adjust ramoops_write_kmsg_hdr() to have
same logic if memory allocation fails.
Change-Id: I66e5aa533774ce429feec697056e1eda5ef56b03
Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
After a CPU comes online, clk_set_rate silently refuses to change said CPU's
frequency to the frequency it was running at before going offline (since it
thinks that we are setting the same frequency redundantly). By default, each CPU
runs at its minimum frequency when coming online, so if the governor decides to
keep a CPU running at the frequency it used before going offline, then
clk_set_rate will ignore the frequency change request and the CPU will stay
stuck running at its minimum frequency for a potentially long period of time
(i.e., until the governor decides to change the frequency to something
different). This can cause severe lag when a device is woken up from deep sleep.
In order to prevent a CPU from being stuck at its default frequency for a
potentially long period of time, set the CLK_GET_RATE_NOCACHE flag so that the
governor's frequency change requests will always be honored. Do this for the L3
clock as well.
Change-Id: I80874e6763f6dec98c15646584b9dc764b17a149
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
A CPU can be paused while it is idle with it's tick stopped.
nohz_balance_exit_idle() should be called from the local CPU,
so it can't be called during pause which can happen remotely.
This results in paused CPU participating in the nohz idle balance,
which should be avoided. This can be done by calling
Fix this issue by calling nohz_balance_exit_idle() from the paused
CPU when it exits and enters idle again. This lazy approach avoids
waking the CPU from idle during pause.
Bug: 180530906
Change-Id: Ia2dfd9c9cac9b0f37c55a9256b9d5f3141ca0421
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
The RPM may give back no ACK when sending a command: this
means that it is locking up for some reason, or the
command itself didn't get sent to it.
When we get in this situation, an infinite wait for completion
will lock up the device for an infinite amount of time, until
the user manually reboots it with a power cut or KPDPWR+RESIN
combination.
For this reason, add a timeout to the completion wait (as of
now, very large I'd say) to avoid indefinitely waiting and,
if the timeout is reached with no ACK reply, just return a
-ETIMEDOUT error, so that we will either end up recoverying
from this error state or rebooting the device by panicking
the kernel if subsequent retries won't work.
This issue is largely seen on SMD communication and rarely
on SoCs using GLINK to communicate to the RPM.
Change-Id: Ifb701e767edab792d92d71fdc05a3e0edd91d766
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Commit 6ea234c and fac0755 implements Android specific bits
for RTM_GETLINK and RTM_GETNEIGH{TBL}, but they are not
considered into policydb_write() function. As a result, if userspace
wants to dump /sys/fs/selinux/policy, kernel won't pass those bits
in config, and userspace cannot get correct config bits of loaded
policy. Fix it, similar to mls bits handling.
Fixes: 6ea234c74a60 ("ANDROID: selinux: modify RTM_GETLINK permission")
Fixes: fac07550bdac ("ANDROID: selinux: modify RTM_GETNEIGH{TBL}")
Change-Id: I9602fd7cfe2eefc0cbd79b96892369bd5d4af15d
Signed-off-by: Wang Han <wanghan1995315@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
* Doesn't work here
Change-Id: Id4eeec26ee7d48db4bf8d0d8b1c8a364c915711f
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Change-Id: Id95afdc64deb461a1357aae0c977263252ada1f5
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Change-Id: Iacf1391b8b076efc260290d8e19bb12dff9cfac6
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Change-Id: Ib4ce3f6d34ca5ea0c52bec99618a16ae74180f55
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
* Taken as of HEAD 8b3b0f2a448982699cfd8f529e86d474a58c8214
("ANDROID: Pixel: Add missing symbol to symbol list")
* Place it in a subfolder, to avoid conflicts when merging upstream
Change-Id: If00e90a06ec5b234c9eb4032d6b6fa5c98fb6055
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
The uvc_format_desc, GUID defines and the uvc_format_by_guid helper is
also useful for the uvc gadget stack. This patch moves them to a common
header.
Tested-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220909221335.15033-3-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6b028df7d466a5f7c0263a46256c9bdc42debd9f)
arakesh: resolved minor conflicts in drivers/media/usb/uvc/uvc_driver.c
and drivers/media/usb/uvc/uvcvideo.h
Bug: 259171206
Change-Id: I37b839850896fff279159fca93a50f4788184354
Signed-off-by: Avichal Rakesh <arakesh@google.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
The functions uvc_simplify_fraction and uvc_fraction_to_interval are
generic helpers which are also useful for other v4l2 drivers. This patch
moves them to v4l2-common.
Tested-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220909221335.15033-2-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6ba8b8d45335180523df8f1b6cd1c995a3dbf560)
arakesh: resolved minor conflicts in include/media/v4l2-common.h and
drivers/media/v4l2-core/v4l2-common.c
Bug: 259171206
Change-Id: I17eea1ef6788ba98599b1d8a12499147ebef7d60
Signed-off-by: Avichal Rakesh <arakesh@google.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Change-Id: I827ac7b62f64bb4166896b4cedcfadd525282c11
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Processes waiting to consume buffers are handed off buffers from the kernel
with the kernel's producer often going to sleep right after. This matches a
synchronized wake pattern and can benefit from improved scheduling by making
the scheduler aware of it via a sync wake.
Perform a synchronized wake in vb2_buffer_done() so waiting processes can be
scheduled in sync with kernel-side buffer producers.
Change-Id: I6a8e6f2ee67a6bde3aa04fdbc6d10e69372065eb
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
The synchronous wakeup interface is available only for the interruptible
wakeup. Add it for normal wakeup.
Change-Id: Ia4460aa55690d14d203cdc843bd600c9e26c53f1
Suggested-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This renders the driver unable to dequeue while in LPM as per dmesg [1].
Upon plugging out the cable, the dequeue failure keeps happening and
dwc3 issues a controller error event that ultimately triggers a soft
reset of vbus session. Therefore, revert this.
[1]:
[ 340.812446] MTP has been opened
[ 361.337160] MTP has been closed
[ 361.358926] dwc3 a800000.dwc3: Unable to dequeue while in LPM
[ 361.373802] dwc3 a800000.dwc3: request 0000000000000000 was not queued to ep0out
[ 361.692298] msm-dwc3 a800000.ssusb: DWC3_CONTROLLER_ERROR_EVENT received
[ 361.709579] dwc3 a800000.dwc3: dwc3_gadget_vbus_session: Core soft reset...
This reverts commit 62484437578573a04d23a8ab6db5247a4fd35b92.
Change-Id: I94d5fc8fc8238ec05e3ab3b8b8f07549ca676db1
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Causes RCU stalls.
This reverts commit 3594650c3ec1dbf4fbea5860aa5822150ca60d9d.
Change-Id: I6a7c012d4b121b22ce3b342c721bc2bd0f3eb7b6
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 8487a88136d54a1a4d3f26f1399685db648ab879 which is
commit 1b6a6fc5280e97559287b61eade2d4b363e836f2 upstream.
It breaks the kernel ABI and is not relevant for Android systems.
Change-Id: I18399bc9d5e48a84f513302e2eabff255e9a931a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>