Commit graph

916,670 commits

Author SHA1 Message Date
Yu Zhao
d5c04fec66 BACKPORT: mm: use self-explanatory macros rather than "2"
Moto-CRs-Fixed:(CR)

Change-Id: I4bb60eb4191c2a378c3d7c5a8c8170eb72d598ae
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alex Shi <alex.shi@linux.alibaba.com>
Link: http://lkml.kernel.org/r/20200831175042.3527153-2-yuzhao@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit ed0173733dd468883198c3136284394320b8fad6)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491788
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:14 +08:00
Yu Zhao
f8d273257a BACKPORT: mm: remove superfluous __ClearPageActive()
To activate a page, mark_page_accessed() always holds a reference on it.
It either gets a new reference when adding a page to
lru_pvecs.activate_page or reuses an existing one it previously got when
it added a page to lru_pvecs.lru_add.  So it doesn't call SetPageActive()
on a page that doesn't have any reference left.  Therefore, the race is
impossible these days (I didn't brother to dig into its history).

For other paths, namely reclaim and migration, a reference count is always
held while calling SetPageActive() on a page.

SetPageSlabPfmemalloc() also uses SetPageActive(), but it's irrelevant to
LRU pages.
Moto-CRs-Fixed:(CR)

Change-Id: If818ad43f98960f6b397dae7c2dd555bd4469854
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Qian Cai <cai@lca.pw>
Link: http://lkml.kernel.org/r/20200818184704.3625199-2-yuzhao@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 6f4dd8de4835563de9bae797ce1d7a13465a7a7d)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491787
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:14 +08:00
Joonsoo Kim
76b93a6550 BACKPORT: mm/swapcache: support to handle the shadow entries
Workingset detection for anonymous page will be implemented in the
following patch and it requires to store the shadow entries into the
swapcache.  This patch implements an infrastructure to store the shadow
entry in the swapcache.
Moto-CRs-Fixed:(CR)

Change-Id: Id9c2ac3af7ae73f95ba06cdda5e28aa678954d08
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Link: http://lkml.kernel.org/r/1595490560-15117-5-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3852f6768ede542ed48b9077bedf482c7ecb6327)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491786
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:14 +08:00
Wei Yang
59492259cb UPSTREAM: mm/vmscan.c: use update_lru_size() in update_lru_sizes()
We already defined the helper update_lru_size().

Let's use this to reduce code duplication.
Moto-CRs-Fixed:(CR)

Change-Id: Icae4274c4f4c9bdfd70355bb32eb2fe1800a79c1
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Link: http://lkml.kernel.org/r/20200331221550.1011-1-richard.weiyang@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit a892cb6b977ffe209683809e5e9d627656d20aa8)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491785
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:14 +08:00
Jason Gunthorpe
87ee083dbc BACKPORT: mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock
This eventually calls into handle_mm_fault() which is a sleeping function.
Release the lock first.

hmm_vma_walk_hole() does not touch the contents of the PUD, so it does not
need the lock.
Moto-CRs-Fixed:(CR)

Link: https://lore.kernel.org/r/20200311183506.3997-4-jgg@ziepe.ca/
Fixes: 3afc423632a1 ("mm: pagewalk: add p4d_entry() and pgd_entry()")
Cc: Steven Price <steven.price@arm.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Change-Id: I4dd851a2fcf242877ae7acd082f3521e7202d258
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 05fc1df95e5dc09802813bab9c1e718f1e419d93)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491784
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:14 +08:00
Steven Price
fd534464e4 BACKPORT: mm: pagewalk: add p4d_entry() and pgd_entry()
pgd_entry() and pud_entry() were removed by commit 0b1fbfe500
("mm/pagewalk: remove pgd_entry() and pud_entry()") because there were no
users.  We're about to add users so reintroduce them, along with
p4d_entry() as we now have 5 levels of tables.

Note that commit a00cc7d9dd ("mm, x86: add support for PUD-sized
transparent hugepages") already re-added pud_entry() but with different
semantics to the other callbacks.  This commit reverts the semantics back
to match the other callbacks.

To support hmm.c which now uses the new semantics of pud_entry() a new
member ('action') of struct mm_walk is added which allows the callbacks to
either descend (ACTION_SUBTREE, the default), skip (ACTION_CONTINUE) or
repeat the callback (ACTION_AGAIN).  hmm.c is then updated to call
pud_trans_huge_lock() itself and make use of the splitting/retry logic of
the core code.

After this change pud_entry() is called for all entries, not just
transparent huge pages.
Moto-CRs-Fixed:(CR)

[arnd@arndb.de: fix unused variable warning]
 Link: http://lkml.kernel.org/r/20200107204607.1533842-1-arnd@arndb.de
Link: http://lkml.kernel.org/r/20191218162402.45610-12-steven.price@arm.com
Change-Id: Id8578aab7de0f670db45d32cb3752993b81464be
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Perry Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: He(CR) Carstens <he(CR).carstens@de.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: "Liang, Kan" <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Racer_turbo <paul.Racer_turbo@mips.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorb(CR) <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Cc: Zong Li <zong.li@sifive.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3afc423632a194d7d6afef34e4bb98f804cd071d)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491783
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:14 +08:00
Steven Price
76f9f031cb UPSTREAM: x86: mm: add p?d_leaf() definitions
walk_page_range() is going to be allowed to walk page tables other than
those of user space.  For this it needs to know when it has reached a
'leaf' entry in the page tables.  This information is provided by the
p?d_leaf() functions/macros.

For x86 we already have p?d_large() functions, so simply add macros to
provide the generic p?d_leaf() names for the generic code.
Moto-CRs-Fixed:(CR)

Link: http://lkml.kernel.org/r/20191218162402.45610-11-steven.price@arm.com
Change-Id: Ie5684899f3e89133422324fa2ce12d9f0740fee9
Signed-off-by: Steven Price <steven.price@arm.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Perry Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: He(CR) Carstens <he(CR).carstens@de.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: "Liang, Kan" <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Racer_turbo <paul.Racer_turbo@mips.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorb(CR) <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Cc: Zong Li <zong.li@sifive.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 757b2a4ab560b84d1859cfdfb9c7489af4ef5fd6)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491782
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Muchun Song
b84c1a93a8 BACKPORT: arm64: mm: fix p?d_leaf()
The pmd_leaf() is used to test a leaf mapped PMD, however, it misses
the PROT_NONE mapped PMD on arm64.  Fix it.  A real world issue [1]
caused by this was reported by Qian Cai. Also fix pud_leaf().
Moto-CRs-Fixed:(CR)

Link: https://patchwork.kernel.org/comment/24798260/ [1]
Fixes: 8aa82df3c123 ("arm64: mm: add p?d_leaf() definitions")
Reported-by: Qian Cai <quic_qiancai@quicinc.com>
Change-Id: I3b632d653c4e00a8825e1cc626d935ca5cbac194
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Link: https://lore.kernel.org/r/20220422060033.48711-1-songmuchun@bytedance.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit 23bc8f69f0eceecbb87c3801d2e48827d2dca92b)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491781
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Steven Price
0a3f0ce826 UPSTREAM: arm64: mm: add p?d_leaf() definitions
walk_page_range() is going to be allowed to walk page tables other than
those of user space.  For this it needs to know when it has reached a
'leaf' entry in the page tables.  This information will be provided by the
p?d_leaf() functions/macros.

For arm64, we already have p?d_sect() macros which we can reuse for
p?d_leaf().

pud_sect() is defined as a dummy function when CONFIG_PGTABLE_LEVELS < 3
or CONFIG_ARM64_64K_PAGES is defined.  However when the kernel is
configured this way then architecturally it isn't allowed to have a large
page at this level, and any code using these page walking macros is
implicitly relying on the page size/number of levels being the same as the
kernel.  So it is safe to reuse this for p?d_leaf() as it is an
architectural restriction.
Moto-CRs-Fixed:(CR)

Link: http://lkml.kernel.org/r/20191218162402.45610-5-steven.price@arm.com
Change-Id: Ic031474949c96e9d3d191dd93f232cc20603032d
Signed-off-by: Steven Price <steven.price@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Perry Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: He(CR) Carstens <he(CR).carstens@de.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: "Liang, Kan" <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Racer_turbo <paul.Racer_turbo@mips.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorb(CR) <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Zong Li <zong.li@sifive.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 8aa82df3c123129025a364d8f823929cc488b834)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491780
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Steven Price
502d61e3b8 UPSTREAM: mm: add generic p?d_leaf() macros
Patch series "Generic page walk and ptdump", v17.

Many architectures current have a debugfs file for dumping the kernel page
tables.  Currently each architecture has to implement custom functions for
this because the details of walking the page tables used by the kernel are
different between architectures.

This series extends the capabilities of walk_page_range() so that it can
deal with the page tables of the kernel (which have no VMAs and can
contain larger huge pages than exist for user space).  A generic PTDUMP
implementation is the implemented making use of the new functionality of
walk_page_range() and finally arm64 and x86 are switch to using it,
removing the custom table walkers.

To enable a generic page table walker to walk the unusual mappings of the
kernel we need to implement a set of functions which let us know when the
walker has reached the leaf entry.  After a suggestion from Will Deacon
I've chosen the name p?d_leaf() as this (hopefully) describes the purpose
(and is a new name so has no historic baggage).  Some architectures have
p?d_large macros but this is easily confused with "large pages".

This series ends with a generic PTDUMP implemention for arm64 and x86.

Mostly this is a clean up and there should be very little functional
change.  The exceptions are:

* arm64 PTDUMP debugfs now displays pages which aren't present (patch 22).

* arm64 has the ability to efficiently process KASAN pages (which
  previously only x86 implemented).  This means that the combination of
  KASAN and DEBUG_WX is now useable.

This patch (of 23):

Exposing the pud/pgd levels of the page tables to walk_page_range() means
we may come across the exotic large mappings that come with large areas of
contiguous memory (such as the kernel's linear map).

For architectures that don't provide all p?d_leaf() macros, provide
generic do nothing default that are suitable where there cannot be leaf
pages at that level.  Futher patches will add implementations for
individual architectures.

The name p?d_leaf() is chosen to minimize the confusion with existing uses
of "large" pages and "huge" pages which do not necessary mean that the
entry is a leaf (for example it may be a set of contiguous entries that
only take 1 TLB slot).  For the purpose of walking the page tables we
don't need to know how it will be represented in the TLB, but we do need
to know for sure if it is a leaf of the tree.
Moto-CRs-Fixed:(CR)

Link: http://lkml.kernel.org/r/20191218162402.45610-2-steven.price@arm.com
Change-Id: Ibc89e157616134076969b8daa9e9ce104d6c0900
Signed-off-by: Steven Price <steven.price@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Perry Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Morse <james.morse@arm.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Liang, Kan" <kan.liang@linux.intel.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: He(CR) Carstens <he(CR).carstens@de.ibm.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Racer_turbo <paul.Racer_turbo@mips.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Vasily Gorb(CR) <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Zong Li <zong.li@sifive.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 93fab1b22ef7c4abcbc760ce4432762b02e7f3d1)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491779
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Jia He
0389a60f62 UPSTREAM: x86/mm: implement arch_faults_on_old_pte() stub on x86
arch_faults_on_old_pte is a helper to indicate that it might cause page
fault when accessing old pte. But on x86, there is feature to setting
pte access flag by hardware. Hence implement an overriding stub which
always returns false.
Moto-CRs-Fixed:(CR)

Link: https://lore.kernel.org/r/20191011140939.6115-4-justin.he@arm.com/
Change-Id: I69cd5568e648cdf098269958de9e8bcedd603df4
Signed-off-by: Jia He <justin.he@arm.com>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit f2c4e5970cece75a895fcc45f0cd66b5a5ec0819)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491778
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Jia He
adb8e3c5c0 UPSTREAM: arm64: mm: implement arch_faults_on_old_pte() on arm64
On arm64 without hardware Access Flag, copying from user will fail because
the pte is old and cannot be marked young. So we always end up with zeroed
page after fork() + CoW for pfn mappings. We don't always have a
hardware-managed Access Flag on arm64.

Hence implement arch_faults_on_old_pte on arm64 to indicate that it might
cause page fault when accessing old pte.
Moto-CRs-Fixed:(CR)

Link: https://lore.kernel.org/r/20191011140939.6115-3-justin.he@arm.com/
Change-Id: Ica230a882941cb17a1acdd6c6c9f3ec1b3f494b3
Signed-off-by: Jia He <justin.he@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 6af31226d0394691f5562eca0134262bb935fa9c)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491777
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Jia He
5d7abefcf8 BACKPORT: arm64: cpufeature: introduce helper cpu_has_hw_af()
We unconditionally set the HW_AFDBM capability and only enable it on
CPUs which really have the feature. But sometimes we need to know
whether this cpu has the capability of HW AF. So decouple AF from
DBM by a new helper cpu_has_hw_af().

If later we noticed a potential performance issue on this path, we can
turn it into a static label as with other CPU features.
Moto-CRs-Fixed:(CR)

Link: https://lore.kernel.org/r/20191011140939.6115-2-justin.he@arm.com/
Change-Id: Ifed339bfe6c86ada6e45eddefa6aa010a7fe465d
Signed-off-by: Jia He <justin.he@arm.com>
Suggested-by: Suzuki Poulose <Suzuki.Poulose@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 47d7b15b88f96a90694cfc607d0717d62dff6c45)
Bug: 261052246
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reviewed-on: https://gerrit.mot.com/2491776
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Dan Carpenter
45482ab6d3 UPSTREAM: erofs: fix an error code in z_erofs_init_zip_subsystem()
Moto-CRs-Fixed:(CR)
Return -ENOMEM if alloc_workqueue() fails.  Don't return success.

Fixes: d8a650adf429 ("erofs: add per-cpu threads for decompression as an option")
Bug: 271636421
Tests: launch_cvd
Change-Id: I49dcf8094655db47ac71ae8967b5402373fc7adc
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/Y+4d0FRsUq8jPoOu@kili
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
(cherry picked from commit 8d1b80a79452630f157bf634ae9cfcd9f4eed161)
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
(cherry picked from commit 5004cc655730355d681b333ff5eafd62a4ee02f2)
Reviewed-on: https://gerrit.mot.com/2579833
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
William Liu
34486c7365 config:Enable EROFS PCPU performance improvement
Enable the PCPU erofs performance
Improvement option on bangkk

Change-Id: Ib16e2b65f4a2a71d5c8983595844bf6ae76f3fed
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2576333
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
William Liu
5e13d881af config:Enable EROFS PCPU performance improvement
Enable the PCPU erofs performance
Improvement option on penang

Change-Id: I4637e998fb997938783588df5618b7017e2a1f76
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2576332
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Sandeep Dhavale
8199049168 BACKPORT:erofs: add per-cpu threads for decompression as an option
Using per-cpu thread pool we can reduce the scheduling latency compared
to workqueue implementation. With this patch scheduling latency and
variation is reduced as per-cpu threads are high priority kthread_workers.

The results were evaluated on arm64 Android devices running 5.10 kernel.

The table below shows resulting improvements of total scheduling latency
for the same app launch benchmark runs with 50 iterations. Scheduling
latency is the latency between when the task (workqueue kworker vs
kthread_worker) became eligible to run to when it actually started
running.
+-------------------------+-----------+----------------+---------+
|                         | workqueue | kthread_worker |  diff   |
+-------------------------+-----------+----------------+---------+
| Average (us)            |     15253 |           2914 | -80.89% |
| Median (us)             |     14001 |           2912 | -79.20% |
| Minimum (us)            |      3117 |           1027 | -67.05% |
| Maximum (us)            |     30170 |           3805 | -87.39% |
| Standard deviation (us) |      7166 |            359 |         |
+-------------------------+-----------+----------------+---------+

Background: Boot times and cold app launch benchmarks are very
important to the Android ecosystem as they directly translate to
responsiveness from user point of view. While EROFS provides
a lot of important features l(CR) space savings, we saw some
performance penalty in cold app launch benchmarks in few scenarios.
Analysis showed that the significant variance was coming from the
scheduling cost while decompression cost was more or less the same.

Having per-cpu thread pool we can see from the above table that this
variation is reduced by ~80% on average. This problem was discussed
at LPC 2022. Link to LPC 2022 slides and talk at [1]

Moto-CRs-Fixed:(CR)

[1] https://lpc.events/event/16/contributions/1338/

[ Gao Xiang: At least, we have to add this until WQ_UNBOUND workqueue
             issue [2] on many arm64 devices is resolved. ]
[2] https://lore.kernel.org/r/CAJkfWY490-m6wNubkxiTPsW59sfsQs37Wey279LmiRxKt7aQYg@mail.gmail.com

Change-Id: Idd8f0760f29d58356f5f1ea93c92eb57680686d5
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2576331
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Peter Zijlstra
250751cadf BACKPORT:sched: Provide sched_set_fifo()
SCHED_FIFO (or any static priority scheduler) is a broken scheduler
    model; it is fundamentally incapable of resource management, the one
    thing an OS is actually supposed to do.

    It is impossible to compose static priority workloads. One cannot take
    two well designed and functional static priority workloads and mash
    them together and still expect them to work.

    Therefore it doesn't make sense to expose the priority field; the
    kernel is fundamentally incapable of setting a sensible value, it
    needs systems knowledge that it doesn't have.

    Take away sched_setschedule() / sched_setattr() from modules and
    replace them with:

      - sched_set_fifo(p); create a FIFO task (at prio 50)
      - sched_set_fifo_low(p); create a task higher than NORMAL,
            which ends up being a FIFO task at prio 1.
      - sched_set_normal(p, nice); (re)set the task to normal

    This stops the proliferation of randomly chosen, and irrelevant, FIFO
    priorities that dont't really mean anything anyway.

    The system administrator/integrator, whoever has insight into the
    actual system design and requirements (userspace) can set-up
    appropriate priorities if and when needed.
    Moto-CRs-Fixed:(CR)

    Cc: airlied@redhat.com
    Cc: alexander.deucher@amd.com
    Cc: awalls@md.metrocast.net
    Cc: axboe@kernel.dk
    Cc: broonie@kernel.org
    Cc: daniel.lezcano@linaro.org
    Cc: gregkh@linuxfoundation.org
    Cc: hannes@cmpxchg.org
    Cc: herbert@gondor.apana.org.au
    Cc: hverkuil@xs4all.nl
    Cc: john.stultz@linaro.org
    Cc: nico@fluxnic.net
    Cc: paulmck@kernel.org
    Cc: rafael.j.wysocki@intel.com
    Cc: rmk+kernel@arm.linux.org.uk
    Cc: sudeep.holla@arm.com
    Cc: tglx@linutronix.de
    Cc: ulf.hansson@linaro.org
    Cc: wim@linux-watchdog.org
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Tested-by: Paul E. McKenney <paulmck@kernel.org>

Change-Id: I499a5c22a1d7bd561c3f73a90ed3af1162e79dcb
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2576330
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
tin_qiquan.zhou_tmp
be689ac94d bangkk: Secondary supply flash driver ic compatible
details:
1.add CAMERA_FLASH_IIC_COMPATIBLE config
2.add "CONFIG_CAMERA_FLASH_IIC_COMPATIBLE=y" in the moto holi bangkk config

Change-Id: I111a9195f510d0f10d95ddd4e43e5b838ec56f91
Signed-off-by: tin_qiquan.zhou_tmp <tinno70@motorola.com>
Reviewed-on: https://gerrit.mot.com/2573838
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: <hezheng1@motorola.com>
Reviewed-by: <huqian4@motorola.com>
Reviewed-by: <yanglp10@motorola.com>
Reviewed-by: <leijing1@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Shicheng Gong
bad1ca0014 arm64/config: Ban some redundant config
1.Not set config_*_blair for sm4350(Mannar).
2.Not set CONFIG_TOUCHSCREEN_NT36XXX to disturb ibiza
  orginal touch.
3.Not set CONFIG_SLUB_DEBUG_ON to optimize performance
  for userdebug build.

Change-Id: Ibd17f8561e590d4d58ffcd4305758f5c6fa2e896
Signed-off-by: Shicheng Gong <gongsc1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2559518
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xinmin Fu <fuxm1@motorola.com>
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
caoqian4
0827c9f9a8 drivers/soc/qcom/Kconfig:add config for penang5g row sm4375
add debug/factory/moto.config for penangb
to build pass

Change-Id: Ie8550b28fb09c724c2a0f71aec8b531f55c59912
Signed-off-by: caoqian4 <caoqian4@motorola.com>
Reviewed-on: https://gerrit.mot.com/2550579
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Lu Lu <lulu2@lenovo.com>
(cherry picked from commit 9541544542e2724692a968a2959b0b012dda6caa)
Reviewed-on: https://gerrit.mot.com/2552224
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2024-04-18 14:45:13 +08:00
zhangchao
f42cfa2d06 kernel/config:use gpio45/46 for ap i2c 1/2
1.GPIO45 and GPIO45 is reserved_gpios
2.modify config use gpio45/46 for ap i2c

Change-Id: Ie47f9970849f95e49cb3004908540b4f28a3865d
Reviewed-on: https://gerrit.mot.com/2549060
Reviewed-by: Zhengming Yao <yaozm1@lenovo.com>
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
liujg6
ec5ba1a4d8 arm64/ext_config: disable rt throttling on pnangn userdebug build
[Details]
Disable CONFIG_PANIC_ON_RT_THROTTLING on pnangn userdebug build

Change-Id: I3e4830e666d7d536c53e0cb4dfae24dffaac7ef0
Reviewed-on: https://gerrit.mot.com/2541503
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
Fernanda Schmidt
d9bb81177f Disabling some Debug configs
Disabling CONFIG_SLUB_DEBUG_ON, CONFIG_DEBUG_MUTEXES,
CONFIG_DEBUG_SPINLOCK and CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG configs,
which are severily impacting on device's memory pressure.

Change-Id: I376aeac5b37ebc40f01abae8ca557ad10a29687c
Reviewed-on: https://gerrit.mot.com/2541251
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
Reviewed-by: Carlos Pinho <cpinho@motorola.com>
Tested-by: Jira Key
Submit-Approved: Jira Key
2024-04-18 14:45:13 +08:00
zhaoxp3
f88628ff2a defconfig: define bangkk dtb
Change-Id: I0a033f34b473e1d325900f5697dfa48cfe69d252
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/2538318
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Submit-Approved: tongkun1 <tongkun1@motorola.com>
2024-04-18 14:45:13 +08:00
Fernanda Schmidt
5af4f0287d Disabling some Debug configs
Disabling CONFIG_SLUB_DEBUG_ON, CONFIG_DEBUG_MUTEXES,
CONFIG_DEBUG_SPINLOCK and CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG configs,
which are severily impacting on device's memory pressure.

Change-Id: Id610358654b687110d9a2302ec17a8bcfe12f3b6
Reviewed-on: https://gerrit.mot.com/2539189
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Rafael Ortolan <rafones@motorola.com>
Reviewed-by: Carlos Pinho <cpinho@motorola.com>
Tested-by: Jira Key
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
Yunxian He
bf8cede7f6 integrate samsung RN4V NFC driver
integrate samsung RN4V NFC driver
this driver support RN4V and SN4V

Change-Id: Ibea9dcded110f0d058fcbc84516912a1be9d1915
Signed-off-by: Yunxian He <heyx6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2533690
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
Yunxian He
53ad4b3fb9 Enable samsung RN4V NFC driver
integrate samsung RN4V NFC driver
this driver support RN4V and SN4V

Change-Id: I022f009eb7db4ad3e0bc96ca0fa9aad8b9f5003b
Signed-off-by: Yunxian He <heyx6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2538504
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
tongkun1
b6b62eb330 configs: vendor/ext_config: init configuration for Bangkk to pass build
Change-Id: Ic8f6e1e5b651da856ae2f294ebc57edc1e8171d2
Reviewed-on: https://gerrit.mot.com/2513550
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Hao Li <lihao24@motorola.com>
(cherry picked from commit ce397efc28e4e9e45e15180dd8630a2c66166978)
Reviewed-on: https://gerrit.mot.com/2532084
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: tongkun1 <tongkun1@motorola.com>
2024-04-18 14:45:12 +08:00
panzh2
c318647637 [PnangNA][configs] disable HPB in pnang 5G NA
Disable the HPB in penang5G NA
follow the product family decision

Change-Id: I07daa682ddd5675263763befe1965851f37cbee7
Signed-off-by: panzh2 <panzh2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2501716
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianguo Liu <liujg6@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
tanhua1
40b836f15d disable HPB in penang5g
Disable the HPB in penang5G
To follow the product family decision

Change-Id: I1eac669c626f26f26c365626df97086e816343e7
Signed-off-by: tanhua1 <tanhua1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2438990
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
xiewen3
4bcc5f3769 arm64/configs: Enable CONFIG_FELICA_MOUNT_BLOCK for penang 5G.
Enable CONFIG_FELICA_MOUNT_BLOCK to block mount in the
root environment.

Change-Id: Ia9c71f44ac00bced7a374bca70ffd0b4dbd4ee01
Signed-off-by: xiewen3 <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/2428915
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
Yunxian He
9d8582cf76 no need btfm enable delay when freq 48000 rxport 0
main change:
when freq 48000, rxport 0, btfm enable no need delay.
revert change in (CR)

Change-Id: I1dec2ada86501b6690b08718c038e465c14b2029
Signed-off-by: Yunxian He <heyx6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2428502
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
Yunxian He
e819d7d240 update btfm enable ch delay when freq 48000 ch 0
main changes:
btfm_slim.c

Change-Id: I6c38d3956da85b13a8946cb5db7bad312320bba5
Signed-off-by: Yunxian He <heyx6@motorola.com>
Reviewed-on: https://gerrit.mot.com/2427412
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
YangYi
485bfce748 penang: device suspend tests fail
Penang:
fix the problem of device suspend tests fail.

Change-Id: I2477d57440b40dcf930fff27631554c2024ec444
Signed-off-by: YangYi <yangyi31@motorola.com>
Reviewed-on: https://gerrit.mot.com/2424757
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
YangYi
0ab43c2ab5 Penang: kasan panic
Penang:
resolve kasan panic.

Change-Id: I69112a4f4717c8f8c8bf958316ae9a0516dad945
Signed-off-by: YangYi <yangyi31@motorola.com>
Reviewed-on: https://gerrit.mot.com/2417581
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
YangYi
a65aa65ad1 Penang: resolve kasan panic
Penang:
KASAN: slab-out-of-bounds in qrtr_endpoint_register

Change-Id: I7542a0f2af0ceb0fdd04291b86795ba942ffe8d7
Signed-off-by: YangYi <yangyi31@motorola.com>
Reviewed-on: https://gerrit.mot.com/2413704
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
liujg6
7ea5934176 arm64/configs: disable NFC on pnangn
[Details]
Penang5G NA does not support NFC, disable NFC config which inheritted
from Penang ROW.

Change-Id: I785a3234df733f4ce5d548ebdc04bbc3675b09d8
Reviewed-on: https://gerrit.mot.com/2411025
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
YangYi
f536ebe9fc Penang: fix for device suspend tests fail. [1/2]
Penang:
Fix for device suspend tests fail.
qcom cr number: 3243388, 3208991.

Change-Id: Idedf1825a3237cd85cf463ec459f6d5a31662c8d
Signed-off-by: YangYi <yangyi31@motorola.com>
Reviewed-on: https://gerrit.mot.com/2400062
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuchang Guo <guoyc1@lenovo.com>
Reviewed-by: Jiacheng Ou <oujc1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
HQ Cam LiJunyu
42d17b3910 penang: Adjust actuator noise reduction
details:
Add drive node
Modify the motor voltage value

Change-Id: I2cd674e7df7a2e02829c6afe5889c61a9e835e29
Signed-off-by: HQ Cam LiJunyu <lijunyu@huaqin.com>
Reviewed-on: https://gerrit.mot.com/2385577
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Pengfei Qiao <qiaopf1@motorola.com>
Reviewed-by: <chenlj26@motorola.com>
Reviewed-by: <liuzy55@motorola.com>
Reviewed-by: Shuo Wang <wangsh18@motorola.com>
Reviewed-by: Wang Liu <liuwang2@lenovo.com>
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
liujg6
38414b7380 disable CONFIG_SLUB_DEBUG_ON on pnangn
Performance on pnangn is worse due to CONFIG_SLUB_DEBUG_ON is enabled.
Disable it to optimize performance on userdebug build.

Change-Id: I3c46ffc87d95271a4ceef73914c7a13ee052e11e
Reviewed-on: https://gerrit.mot.com/2383580
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
William Liu
84a58d6dd0 include:statfs.h:reduce boilerplate in fsid handling
Get rid of boilerplate in most of ->statfs()
    instances...

Change-Id: I630d57a8016013d7d4a2854e2c2c43b1563c27ef
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2380706
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
Guoqing Jiang
be4fac7c66 include/linux/pagemap.h: introduce attach/detach_page_private
Patch series "Introduce attach/detach_page_private to cleanup code".

    This patch (of 10):

    The logic in attach_page_buffers and __clear_page_buffers are quite
    paired, but

    1. they are located in different files.

    2. attach_page_buffers is implemented in buffer_head.h, so it could be
       used by other files. But __clear_page_buffers is static function in
       buffer.c and other potential users can't call the function, md-bitmap
       even copied the function.

    So, introduce the new attach/detach_page_private to replace them.  With
    the new pair of function, we will remove the usage of attach_page_buffers
    and __clear_page_buffers in next patches.  Thanks for suggestions about
    the function name from Alexander Viro, Andreas Grünbacher, Christoph
    Hellwig and Matthew Wilcox.

    Suggested-by: Matthew Wilcox <willy@infradead.org>
    Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
    Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
    Cc: William Kucharski <william.kucharski@oracle.com>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: Andreas Gruenbacher <agruenba@redhat.com>
    Cc: Yang Shi <yang.shi@linux.alibaba.com>
    Cc: Yafang Shao <laoar.shao@gmail.com>
    Cc: Song Liu <song@kernel.org>
    Cc: Chris Mason <clm@fb.com>
    Cc: Josef Bac(CR) <josef@toxicpanda.com>
    Cc: David Sterba <dsterba@suse.com>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Jaegeuk Kim <jaegeuk@kernel.org>
    Cc: Chao Yu <chao@kernel.org>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Anton Altaparmakov <anton@tuxera.com>
    Cc: M(CR)e Marshall <hubcap@omnibond.com>
    Cc: Martin Brandenburg <martin@omnibond.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Roman Gushchin <guro@fb.com>
    Cc: Andreas Dilger <adilger@dilger.ca>
    Cc: Chao Yu <yuchao0@huawei.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Link: http://lkml.kernel.org/r/20200517214718.468-1-guoqing.jiang@cloud.ionos.com
    Link: http://lkml.kernel.org/r/20200517214718.468-2-guoqing.jiang@cloud.ionos.com
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Moto-CRs-Fixed:(CR)

Change-Id: Id4bbb98c9a658b834988f37843d09f065e246668
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2380691
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
William Liu
fa3b0b74bb fs:EROFS:Porting 5.10 erofs to 5.4
Porting erfos changes from 5.10 common kernel
And some glue code to make it pass build on 5.4

be3f6035831a erofs: fix unsafe pagevec reuse of hooked pclusters
6c1ad56b2d78 erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
ee75174f6ab9 erofs: don't trigger WARN() when decompression fails
8326be9e5121 erofs: fix up erofs_lookup tracepoint
ca9ee53cea1f18edf318a01a19653ae3847474a9
UPSTREAM: erofs: fix deadlock when shrink erofs slab
b943d328889d25cdb1aa397880c079b7d55a0901
UPSTREAM: erofs: fix unsafe pagevec reuse of hooked pclusters
028f7128c4fbb75ba113824f8600ca9a7097a0ed
UPSTREAM: erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
ee75174f6ab93611e1623f0ae5590beda008aef5
erofs: don't trigger WARN() when decompression fail
dcd77f0b7453 UPSTREAM: erofs: fix 1 lcluster-sized pcluster for big pcluster
e085d3f0d0dc UPSTREAM: erofs: enable big pcluster feature
ed0607cc5256 UPSTREAM: erofs: support decompress big pcluster for lz4 backend
d34cb6cdc044 UPSTREAM: erofs: support parsing big pcluster compact indexes
051d76b899bd UPSTREAM: erofs: support parsing big pcluster compress indexes
d14993160141 UPSTREAM: erofs: adjust per-CPU buffers according to max_pclusterblks
95a1d5df840a UPSTREAM: erofs: add big physical cluster definition
8043aaed1dad UPSTREAM: erofs: fix up inplace I/O pointer for big pcluster
6ad2f8f1699c UPSTREAM: erofs: introduce physical cluster slab pools
432f58b100f0 UPSTREAM: erofs: introduce multipage per-CPU buffers
571c9a0bd334 UPSTREAM: erofs: remove a void EROFS_VERSION macro set in Makefile
431d73396dad UPSTREAM: erofs: reserve physical_clusterbits[]
89dbc6246a86 UPSTREAM: erofs: Clean up spelling mistakes found in fs/erofs
ac1f14e9d5a8 UPSTREAM: erofs: add on-disk compression configurations
cd21e62366bb UPSTREAM: erofs: introduce on-disk lz4 fs configurations
e17fd2ac9dfc UPSTREAM: erofs: introduce erofs_sb_has_xxx() helpers
ba1a3d1fb2db UPSTREAM: erofs: don't use erofs_map_blocks() any more
384b2cdaf83e UPSTREAM: erofs: complete a missing case for inplace I/O
8326be9e51218d23ebe52c8d4c2d7c23302f6e44
erofs: fix up erofs_lookup tracepoint
51c19f4a62129bca096df760c7690833958ce9cf
erofs: fix error return code in erofs_read_superblock()
06229c49eb7f UPSTREAM: erofs: support adjust lz4 history window size
0a24d25f0882 UPSTREAM: erofs: use sync decompression for atomic contexts only
0ca4eafb3928 UPSTREAM: erofs: use workqueue decompression for atomic contexts only

4ae1c8a4d06a UPSTREAM: erofs: force inplace I/O under low memory scenario
46a00756cbf8 UPSTREAM: erofs: insert to managed cache after adding to pcl
b1c757466f42 UPSTREAM: erofs: get rid of magical Z_EROFS_MAPPING_STAGING

Change-Id: Ibc0d16af7424aa02806ec35b431d4faa28a126cd
Signed-off-by: William Liu <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/2379154
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
xiewen3
5a9376b145 print qseelog to kernel buffer
debug feature:
Print qseelog to kernel buffer when debug cmdl
is programmed.

Change-Id: Ib8ebc5e60dd0b4b7b7c082a9d4537ed73a1ac992
Signed-off-by: xiewen3 <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/2378108
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:12 +08:00
xiewen3
c1a407aada enable CONFIG_MSM_TZ_QSEE_LOG for penang
debug feature:
enable CONFIG_MSM_TZ_QSEE_LOG for penang

Change-Id: Ia122789a496aaff9f7e2a6a5be0def514e1a0670
Signed-off-by: xiewen3 <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/2378109
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:11 +08:00
longc105
665a9f969c driver-kernel: Penang5G NA: change reserved gpio for camera
detials:
change reserved gpio
TZ protect gpio45,46,56,57 for NFC SPI,
but the four of them are used for other purpose
so we need to saperate them from holi baseline

Change-Id: Id22587c488a7ef3e63ffd9c090cd56a85b61bf05
Signed-off-by: longc105 <longc105@motorola.com>
Reviewed-on: https://gerrit.mot.com/2371429
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Liu <liuwang2@lenovo.com>
Reviewed-by: <zhaoxy41@motorola.com>
Reviewed-by: <chenlj26@motorola.com>
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:11 +08:00
zhangpei5
54b29dd3e6 disable CONFIG_SLUB_DEBUG_ON on penang
disable config on penang debug

Change-Id: I0ba52b88d47c3f296adc83fa3a7dedf9a9ea7360
Reviewed-on: https://gerrit.mot.com/2370806
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guolin Wang <wanggl3@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:11 +08:00
hujing3
cab90b27c8 dts/pnangn: disable useless TP configs to avoid confict
dts/pnangn:
disable useless TP configs to avoid confict

Change-Id: I6721695e98dbb66c48f14d017290f3b2d26bf236
Signed-off-by: hujing3 <hujing3@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2368825
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2024-04-18 14:45:11 +08:00
guoyf2
a2bc7d6a71 arm64/configs: use aw882xx for pnangn
changes:
pnangn use aw88261 smartpa

Change-Id: I279449c0e26431d1bf3dbdc941ddeb03e1ce3bdc
Signed-off-by: guoyf2 <guoyf2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2368810
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yunfei Guo <guoyf2@motorola.com>
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
2024-04-18 14:45:11 +08:00