[Cause of problem]
Accoring to the factory's stress test,the system will hang when the sim1+sim2+sd card in quickly insert and remove.
the system willreturn to normall after long press in boot keyboard.
[Solution]
The jitter of Cato is analyzed ,it is found that 200ms dedithering time set in the original is too little We change to 1.5S .
after testing, It was found that the change decreased to one in ten thousand.
[Side-effect]
If you insert the sdcard, will longer 1.3s than old config to see the sdcard icon
Change-Id: I65367f8faa74858525ddbbce414f94b7389c660d
Signed-off-by: tinno18 <tinno18@motorola.com>
Reviewed-on: https://gerrit.mot.com/2243769
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ying Shen <shenying@motorola.com>
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
qcom feature: set the bit ADRENO_PROCESS_RECLAIM in a610 to
enable process reclaim that makes shmem bigger and bigger when launch
apps. To save free RAM, qcom confirmed it could be removed.
Change-Id: I39dbff1d5cb5c4307c2726dec9e315cac0ee74db
Reviewed-on: https://gerrit.mot.com/2234582
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Pei Zhang <zhangpei5@lenovo.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
Add some debug logs to narrow down the root cause
of stuck of power resume
Change-Id: If72530b2d26958f3b79c709cb3d70364a372b72b
Signed-off-by: panzh2 <panzh2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2231566
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
[Cause of problem]
Logic of NFC HAL: after sending the commands, HAL will pull down NFC
GPIO0 and notify NFC chip that it can sleep after wait for 1 second.
If power key is pressed, AP will sleeps quickly, so that the 1 second timeout processing of NFC
HAL can not be executed, so the NFC chip cannot sleep.
But there is no issue if enter sleep is by screen auto time-out
[Solution]
In the NFc driver suspend call, check whether the hal has pulled down
NFC GPIO0. If not, prevent the system go to sleep 1 second.
[Side-effect]
None (The time to prevent go to sleep is 1 second, this can be ignored
in power consumption)
Change-Id: If344d4510b02fef66bb23bfe05942c20280b9e02
Reviewed-on: https://gerrit.mot.com/2229464
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Reviewed-by: Zhenghai Pan <panzh2@lenovo.com>
Reviewed-by: <tinno18@motorola.com>
Submit-Approved: Jira Key
This is a partial revert of commit
29bc22ac5e5b ("binder: use euid from cred instead of using task").
Setting sender_euid using proc->cred caused some Android system test
regressions that need further investigation. It is a partial
reversion because subsequent patches rely on proc->cred.
Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-39686
Bug: 200688826
Fixes: 29bc22ac5e5b ("binder: use euid from cred instead of using task")
Cc: stable@vger.kernel.org # 4.4+
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I9b1769a3510fed250bb21859ef8beebabe034c66
Link: https://lore.kernel.org/r/20211112180720.2858135-1-tkjos@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 200688826
(cherry picked from commit c21a80ca0684ec2910344d72556c816cb8940c01
git: //git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-linus)
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2190145
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
commit 4d5b5539742d2554591751b4248b0204d20dcc9d upstream.
Use the 'struct cred' saved at binder_open() to lookup
the security ID via security_cred_getsecid(). This
ensures that the security context that opened binder
is the one used to generate the secctx.
Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-39686
Bug: 200688826
Cc: stable@vger.kernel.org # 5.4+
Fixes: ec74136ded79 ("binder: create node flag to request sender's security context")
Signed-off-by: Todd Kjos <tkjos@google.com>
Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Change-Id: Ia7b59804a0bdbd51191bbcca556414840307c623
Bug: 200688826
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2190144
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
commit 52f88693378a58094c538662ba652aff0253c4fe upstream.
Since binder was integrated with selinux, it has passed
'struct task_struct' associated with the binder_proc
to represent the source and target of transactions.
The conversion of task to SID was then done in the hook
implementations. It turns out that there are race conditions
which can result in an incorrect security context being used.
Fix by using the 'struct cred' saved during binder_open and pass
it to the selinux subsystem.
Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-39686
Bug: 200688826
Cc: stable@vger.kernel.org # 5.14 (need backport for earlier stables)
Fixes: 79af73079d ("Add security hooks to binder and implement the hooks for SELinux.")
Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Change-Id: Id7157515d2b08f11683aeb8ad9b8f1da075d34e7
Bug: 200688826
[ tkjos@ fixed minor conflict ]
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2190143
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
commit 29bc22ac5e5bc63275e850f0c8fc549e3d0e306b upstream.
Save the 'struct cred' associated with a binder process
at initial open to avoid potential race conditions
when converting to an euid.
Set a transaction's sender_euid from the 'struct cred'
saved at binder_open() instead of looking up the euid
from the binder proc's 'struct task'. This ensures
the euid is associated with the security context that
of the task that opened binder.
Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-39686
Bug: 200688826
Cc: stable@vger.kernel.org # 4.4+
Fixes: 457b9a6f09 ("Staging: android: add binder driver")
Signed-off-by: Todd Kjos <tkjos@google.com>
Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Suggested-by: Jann Horn <jannh@google.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Change-Id: I91922e7f359df5901749f1b09094c3c68d45aed4
Bug: 200688826
Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2190142
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Add shutdown procedure for WL2868C and force disable all regulators when
system power off to avoid unexpected current leakage.
Change-Id: I4851e250460962867e27133452a9bbc9d6224a85
Signed-off-by: qiaopf1 <qiaopf1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2178320
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Submit-Approved: Jira Key
Both encrypted and unencrypted TZ logs for
the user release version need to be read from the procfs.
Change-Id: I68e90e5248e3fa0012c347753b8be4c0ef5d3934
Signed-off-by: xiewen3 <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/2167248
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
The configuration of lz4 is missed on Rhode4G and Hawao
Need to add it to make lz4 work
Change-Id: Ida5e46cb19dda1e0b94def6cab40c30947f13c35
Reviewed-on: https://gerrit.mot.com/2162305
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zhangqing Huang <huangzq2@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Afer Zram backing dev setuped, zram will be treated as a ASYNC IO
swap device, no longer SYNC IO device, because WB pages do have IO
operation on swap in, so the optimization on skiping swapcache
for fast swap device will no longer be applyed on such case.
Now we refactor this optimization, skip the swapcache by checking
SYNC IO state on each swap page via ioctl. Reuse ioctl because we
should not break the GKI.
Change-Id: Ie4316c9a43f481ccd4dff6b90c63da108bed916c
Signed-off-by: lulei1 <lulei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2156790
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhangqing Huang <huangzq2@motorola.com>
Reviewed-by: Guolin Wang <wanggl3@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
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: I962171d99e8911219984563d24fdf27e15e648e5
Signed-off-by: lulei1 <lulei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2156599
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhangqing Huang <huangzq2@motorola.com>
Reviewed-by: Guolin Wang <wanggl3@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
[ Upstream commit 1d011c4803c72f3907eccfc1ec63caefb852fcbf ]
Validate csum_start in gre_handle_offloads before we call _gre_xmit so
that we do not crash later when the csum_start value is used in the
lco_csum function call.
This patch deals with ipv4 code.
Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-39633
Bug: 150694665
Change-Id: I5af91cc13c968081f7357f3b6a91eb82ee44175d
Fixes: c544193214 ("GRE: Refactor GRE tunneling code.")
Reported-by: syzbot+ff8e1b9f2f36481e2efc@syzkaller.appspotmail.com
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2153495
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
1. During startup, judge whether to register the LDO driver
for the first time. If it is the first time, it is not
necessary to disable all LDOS;
2. When different pmics are used, different initialization
voltages are used for initialization;
Change-Id: Ic22e2c05fb9edcb48f93f51add369cb71997741f
Signed-off-by: huaqin79 <huaqin79@motorola.com>
Reviewed-on: https://gerrit.mot.com/2138715
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
When the regulator driver is loaded into the
kernel as KO, the LDO driver registration is
too slow, resulting in the LCD power on and
can not be controlled normally.
Change-Id: If1f62f5204a8eda235a5aea91d27b59f6021c704
Signed-off-by: huaqin79 <huaqin79@motorola.com>
Reviewed-on: https://gerrit.mot.com/2132717
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key