Commit Graph

1068444 Commits

Author SHA1 Message Date
Will McVicker
8f1d7c6850 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - d_path
  - __traceiter_android_vh_sched_setaffinity_early
  - __tracepoint_android_vh_sched_setaffinity_early

Bug: 293815374
Change-Id: I2fd3b47217fa7a9806d81ba1964c94b3c4b05554
Signed-off-by: David Kimmel <davidkimmel@google.com>
Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-08-21 19:09:33 +00:00
valis
54afed884d UPSTREAM: net/sched: cls_route: No longer copy tcf_result on update to avoid use-after-free
[ Upstream commit b80b829e9e ]

When route4_change() is called on an existing filter, the whole
tcf_result struct is always copied into the new instance of the filter.

This causes a problem when updating a filter bound to a class,
as tcf_unbind_filter() is always called on the old instance in the
success path, decreasing filter_cnt of the still referenced class
and allowing it to be deleted, leading to a use-after-free.

Fix this by no longer copying the tcf_result struct from the old filter.

Bug: 296347075
Fixes: 1109c00547 ("net: sched: RCU cls_route")
Reported-by: valis <sec@valis.email>
Reported-by: Bing-Jhong Billy Jheng <billy@starlabs.sg>
Signed-off-by: valis <sec@valis.email>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
Reviewed-by: M A Ramdhan <ramdhan@starlabs.sg>
Link: https://lore.kernel.org/r/20230729123202.72406-4-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit d4d3b53a4c)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Iefbd201b92847ec1349f92c107d7ef5aec3fb359
2023-08-21 14:54:06 +00:00
valis
d6c1899f33 UPSTREAM: net/sched: cls_fw: No longer copy tcf_result on update to avoid use-after-free
[ Upstream commit 76e42ae831 ]

When fw_change() is called on an existing filter, the whole
tcf_result struct is always copied into the new instance of the filter.

This causes a problem when updating a filter bound to a class,
as tcf_unbind_filter() is always called on the old instance in the
success path, decreasing filter_cnt of the still referenced class
and allowing it to be deleted, leading to a use-after-free.

Fix this by no longer copying the tcf_result struct from the old filter.

Bug: 296347075
Fixes: e35a8ee599 ("net: sched: fw use RCU")
Reported-by: valis <sec@valis.email>
Reported-by: Bing-Jhong Billy Jheng <billy@starlabs.sg>
Signed-off-by: valis <sec@valis.email>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
Reviewed-by: M A Ramdhan <ramdhan@starlabs.sg>
Link: https://lore.kernel.org/r/20230729123202.72406-3-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7f691439b2)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I33c91c83d1cd8e889a7261adfa3779ca6c141088
2023-08-21 14:54:04 +00:00
valis
cb45423bcc UPSTREAM: net/sched: cls_u32: No longer copy tcf_result on update to avoid use-after-free
[ Upstream commit 3044b16e7c ]

When u32_change() is called on an existing filter, the whole
tcf_result struct is always copied into the new instance of the filter.

This causes a problem when updating a filter bound to a class,
as tcf_unbind_filter() is always called on the old instance in the
success path, decreasing filter_cnt of the still referenced class
and allowing it to be deleted, leading to a use-after-free.

Fix this by no longer copying the tcf_result struct from the old filter.

Bug: 296347075
Fixes: de5df63228 ("net: sched: cls_u32 changes to knode must appear atomic to readers")
Reported-by: valis <sec@valis.email>
Reported-by: M A Ramdhan <ramdhan@starlabs.sg>
Signed-off-by: valis <sec@valis.email>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
Reviewed-by: M A Ramdhan <ramdhan@starlabs.sg>
Link: https://lore.kernel.org/r/20230729123202.72406-2-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit aab2d095ce)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I1a8381c308cc97cf61d6f95a02992d2c553455c5
2023-08-21 14:54:01 +00:00
Pablo Neira Ayuso
880189fdd2 UPSTREAM: netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID
[ Upstream commit 0ebc1064e4 ]

Bail out with EOPNOTSUPP when adding rule to bound chain via
NFTA_RULE_CHAIN_ID. The following warning splat is shown when
adding a rule to a deleted bound chain:

 WARNING: CPU: 2 PID: 13692 at net/netfilter/nf_tables_api.c:2013 nf_tables_chain_destroy+0x1f7/0x210 [nf_tables]
 CPU: 2 PID: 13692 Comm: chain-bound-rul Not tainted 6.1.39 #1
 RIP: 0010:nf_tables_chain_destroy+0x1f7/0x210 [nf_tables]

Bug: 296128351
Fixes: d0e2c7de92 ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Reported-by: Kevin Rich <kevinrich1337@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 268cb07ef3)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Icf97f57d18bb2b30ed28a3de6cdd18661d7f1c3d
2023-08-21 13:57:51 +01:00
Lee Jones
4c73cba07b ANDROID: usb: gadget: f_accessory: Mitgate handling of non-existent USB request
Prevents mishandling USB requests that are no longer present.

Bug: 161010552
Fixes: 483cb5629e ("ANDROID: usb: gadget: f_accessory: Add Android Accessory function")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I8ff24d6d49214c3bd10a1b5d5e72814ec2a91c61
(cherry picked from commit 5228cb193d)
Signed-off-by: Lee Jones <joneslee@google.com>
2023-08-16 09:47:31 +00:00
Petri Gynther
eebccae505 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - drm_connector_attach_max_bpc_property

Bug: 295934766
Change-Id: I7e32466caae2ae200b9549c62a3bcb2652612181
Signed-off-by: Petri Gynther <pgynther@google.com>
2023-08-15 21:19:03 +00:00
Charan Teja Kalla
a845525d3e FROMGIT: Multi-gen LRU: skip CMA pages when they are not eligible
This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when
they are not available") which skips cma pages reclaim when they are not
eligible for the current allocation context.  In mglru, such pages are
added to the tail of the immediate generation to maintain better LRU
order, which is unlike the case of conventional LRU where such pages are
directly added to the head of the LRU list(akin to adding to head of the
youngest generation in mglru).

No observable issue without this patch on MGLRU, but logically it make
sense to skip the CMA page reclaim when those pages can't be satisfied for
the current allocation context.

Link: https://lkml.kernel.org/r/1691568344-13475-1-git-send-email-quic_charante@quicinc.com
Change-Id: I586415b3e3a92da23f3e79b9d63802a2ced03432
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 75d52d9304ef5b268eb798b0c679815290a0fc83 https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable)
Bug: 288383787
Bug: 291719697
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-08-15 19:57:14 +00:00
Zhaoyang Huang
4502265e16 BACKPORT: mm: skip CMA pages when they are not available
This patch fixes unproductive reclaiming of CMA pages by skipping them
when they are not available for current context.  It arises from the below
OOM issue, which was caused by a large proportion of MIGRATE_CMA pages
among free pages.

[   36.172486] [03-19 10:05:52.172] ActivityManager: page allocation failure: order:0, mode:0xc00(GFP_NOIO), nodemask=(null),cpuset=foreground,mems_allowed=0
[   36.189447] [03-19 10:05:52.189] DMA32: 0*4kB 447*8kB (C) 217*16kB (C) 124*32kB (C) 136*64kB (C) 70*128kB (C) 22*256kB (C) 3*512kB (C) 0*1024kB 0*2048kB 0*4096kB = 35848kB
[   36.193125] [03-19 10:05:52.193] Normal: 231*4kB (UMEH) 49*8kB (MEH) 14*16kB (H) 13*32kB (H) 8*64kB (H) 2*128kB (H) 0*256kB 1*512kB (H) 0*1024kB 0*2048kB 0*4096kB = 3236kB
...
[   36.234447] [03-19 10:05:52.234] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
[   36.234455] [03-19 10:05:52.234] cache: ext4_io_end, object size: 64, buffer size: 64, default order: 0, min order: 0
[   36.234459] [03-19 10:05:52.234] node 0: slabs: 53,objs: 3392, free: 0

This change further decreases the chance for wrong OOMs in the presence
of a lot of CMA memory.

[david@redhat.com: changelog addition]
Link: https://lkml.kernel.org/r/1685501461-19290-1-git-send-email-zhaoyang.huang@unisoc.com
Change-Id: I84f1145c38b5ff7b825f2122b33bc55997931bd7
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: ke.wang <ke.wang@unisoc.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 5da226dbfc)
Bug: 288383787
Bug: 291719697
[ Rename folio to page - Kalesh Singh ]
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-08-15 19:57:14 +00:00
Lee Jones
53c38ebc4e ANDROID: dm-bow: Protect Ranges fetched and erased from the RB tree
Bug: 195565510
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: Ic8134eb902aa7d929e3121b2f69b1d258f570652
(cherry picked from commit 98c15b2bad)
Signed-off-by: Lee Jones <joneslee@google.com>
2023-08-15 16:21:25 +00:00
Pablo Neira Ayuso
b88b3d3664 UPSTREAM: netfilter: nf_tables: skip bound chain on rule flush
[ Upstream commit 6eaf41e87a ]

Skip bound chain when flushing table rules, the rule that owns this
chain releases these objects.

Otherwise, the following warning is triggered:

  WARNING: CPU: 2 PID: 1217 at net/netfilter/nf_tables_api.c:2013 nf_tables_chain_destroy+0x1f7/0x210 [nf_tables]
  CPU: 2 PID: 1217 Comm: chain-flush Not tainted 6.1.39 #1
  RIP: 0010:nf_tables_chain_destroy+0x1f7/0x210 [nf_tables]

Bug: 294357305
Fixes: d0e2c7de92 ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Reported-by: Kevin Rich <kevinrich1337@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e18922ce3e)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I48f43d0ce3410efec2513479a1f4c7708a097b01
2023-08-15 16:18:31 +00:00
Chaoyuan Peng
6bcc6ff841 UPSTREAM: tty: n_gsm: fix UAF in gsm_cleanup_mux
commit 9b9c8195f3 upstream.

In gsm_cleanup_mux() the 'gsm->dlci' pointer was not cleaned properly,
leaving it a dangling pointer after gsm_dlci_release.
This leads to use-after-free where 'gsm->dlci[0]' are freed and accessed
by the subsequent gsm_cleanup_mux().

Such is the case in the following call trace:

 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 gsm_cleanup_mux+0x76a/0x850 drivers/tty/n_gsm.c:2397
 gsm_config drivers/tty/n_gsm.c:2653 [inline]
 gsmld_ioctl+0xaae/0x15b0 drivers/tty/n_gsm.c:2986
 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
 </TASK>

Allocated by task 3501:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 gsm_dlci_alloc+0x53/0x3a0 drivers/tty/n_gsm.c:1932
 gsm_activate_mux+0x1c/0x330 drivers/tty/n_gsm.c:2438
 gsm_config drivers/tty/n_gsm.c:2677 [inline]
 gsmld_ioctl+0xd46/0x15b0 drivers/tty/n_gsm.c:2986
 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Freed by task 3501:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xf1/0x270 mm/slub.c:4559
 dlci_put drivers/tty/n_gsm.c:1988 [inline]
 gsm_dlci_release drivers/tty/n_gsm.c:2021 [inline]
 gsm_cleanup_mux+0x574/0x850 drivers/tty/n_gsm.c:2415
 gsm_config drivers/tty/n_gsm.c:2653 [inline]
 gsmld_ioctl+0xaae/0x15b0 drivers/tty/n_gsm.c:2986
 tty_ioctl+0x8ff/0xc50 drivers/tty/tty_io.c:2816
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Bug: 291178675
Fixes: aa371e96f0 ("tty: n_gsm: fix restart handling via CLD command")
Signed-off-by: Chaoyuan Peng <hedonistsmith@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9615ca54bc)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I947cad0e8080378b40d4098add48992ade5fe638
2023-08-15 16:17:27 +00:00
Pedro Tammela
b4a6c6f4a1 UPSTREAM: net/sched: sch_qfq: account for stab overhead in qfq_enqueue
[ Upstream commit 3e337087c3 ]

Lion says:
-------
In the QFQ scheduler a similar issue to CVE-2023-31436
persists.

Consider the following code in net/sched/sch_qfq.c:

static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
                struct sk_buff **to_free)
{
     unsigned int len = qdisc_pkt_len(skb), gso_segs;

    // ...

     if (unlikely(cl->agg->lmax < len)) {
         pr_debug("qfq: increasing maxpkt from %u to %u for class %u",
              cl->agg->lmax, len, cl->common.classid);
         err = qfq_change_agg(sch, cl, cl->agg->class_weight, len);
         if (err) {
             cl->qstats.drops++;
             return qdisc_drop(skb, sch, to_free);
         }

    // ...

     }

Similarly to CVE-2023-31436, "lmax" is increased without any bounds
checks according to the packet length "len". Usually this would not
impose a problem because packet sizes are naturally limited.

This is however not the actual packet length, rather the
"qdisc_pkt_len(skb)" which might apply size transformations according to
"struct qdisc_size_table" as created by "qdisc_get_stab()" in
net/sched/sch_api.c if the TCA_STAB option was set when modifying the qdisc.

A user may choose virtually any size using such a table.

As a result the same issue as in CVE-2023-31436 can occur, allowing heap
out-of-bounds read / writes in the kmalloc-8192 cache.
-------

We can create the issue with the following commands:

tc qdisc add dev $DEV root handle 1: stab mtu 2048 tsize 512 mpu 0 \
overhead 999999999 linklayer ethernet qfq
tc class add dev $DEV parent 1: classid 1:1 htb rate 6mbit burst 15k
tc filter add dev $DEV parent 1: matchall classid 1:1
ping -I $DEV 1.1.1.2

This is caused by incorrectly assuming that qdisc_pkt_len() returns a
length within the QFQ_MIN_LMAX < len < QFQ_MAX_LMAX.

Bug: 292249631
Fixes: 462dbc9101 ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost")
Reported-by: Lion <nnamrec@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 70feebdbfa)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I69bec7b092e980fe8e0946c26ed9b5ac7c57bf3d
2023-08-15 16:15:07 +00:00
Pedro Tammela
1b2e6ebdc6 UPSTREAM: net/sched: sch_qfq: refactor parsing of netlink parameters
[ Upstream commit 25369891fc ]

Two parameters can be transformed into netlink policies and
validated while parsing the netlink message.

Bug: 292249631
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 3e337087c3 ("net/sched: sch_qfq: account for stab overhead in qfq_enqueue")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 8e0326cbc4)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Idb17a2f9a50b060bcadca6cf7a8c6b7ecaf7d0f1
2023-08-15 16:15:07 +00:00
Florian Westphal
4128e28878 UPSTREAM: netfilter: nft_set_pipapo: fix improper element removal
[ Upstream commit 87b5a5c209 ]

end key should be equal to start unless NFT_SET_EXT_KEY_END is present.

Its possible to add elements that only have a start key
("{ 1.0.0.0 . 2.0.0.0 }") without an internval end.

Insertion treats this via:

if (nft_set_ext_exists(ext, NFT_SET_EXT_KEY_END))
   end = (const u8 *)nft_set_ext_key_end(ext)->data;
else
   end = start;

but removal side always uses nft_set_ext_key_end().
This is wrong and leads to garbage remaining in the set after removal
next lookup/insert attempt will give:

BUG: KASAN: slab-use-after-free in pipapo_get+0x8eb/0xb90
Read of size 1 at addr ffff888100d50586 by task nft-pipapo_uaf_/1399
Call Trace:
 kasan_report+0x105/0x140
 pipapo_get+0x8eb/0xb90
 nft_pipapo_insert+0x1dc/0x1710
 nf_tables_newsetelem+0x31f5/0x4e00
 ..

Bug: 293587745
Fixes: 3c4287f620 ("nf_tables: Add set type for arbitrary concatenation of ranges")
Reported-by: lonial con <kongln9170@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 90c3955beb)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I51a423aaa2c31c4df89776505b602aa2c1523b82
2023-08-15 11:55:10 +01:00
Yifan Hong
1122dd3711 ANDROID: Add checkpatch target.
Running the following will run scripts/checkpatch.pl on a
patch of HEAD

  tools/bazel run //common:checkpatch

or a given Git SHA1:

  tools/bazel run //common:checkpatch -- --git_sha1 ...

For additional flags, see

  tools/bazel run //common:checkpatch -- --help

For details, see
  build/kernel/kleaf/docs/checkpatch.md
in your source tree.

Test: TH
Bug: 259995152
Change-Id: Iaad8fd69508cf9be11340166aafbb84930d4805c
Signed-off-by: Yifan Hong <elsk@google.com>
(cherry picked from commit 7dbf26568fcccde88470e7a25c07f0c7229e85f1)
2023-08-14 23:01:40 +00:00
RD Babiera
056a17677d BACKPORT: FROMGIT: usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
When connecting to some DisplayPort partners, the initial status update
after entering DisplayPort Alt Mode notifies that the DFP_D/UFP_D is not in
the connected state. This leads to sending a configure message that keeps
the device in USB mode. The port partner then sets DFP_D/UFP_D to the
connected state and HPD to high in the same Attention message. Currently,
the HPD signal is dropped in order to handle configuration.

This patch saves changes to the HPD signal when the device chooses to
configure during dp_altmode_status_update, and invokes sysfs_notify if
necessary for HPD after configuring.

Fixes: 0e3bb7d689 ("usb: typec: Add driver for DisplayPort alternate mode")
Cc: stable@vger.kernel.org
Signed-off-by: RD Babiera <rdbabiera@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/all/20230726020903.1409072-1-rdbabiera@google.com/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 288137625
(cherry picked from commit 5a5ccd61cf
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
 usb-linus)
[rd: resolved minor conflict in displayport.c]
Change-Id: I26ef49949aa0681ea6b88d8c95f5ddd54fe84664
Signed-off-by: RD Babiera <rdbabiera@google.com>
2023-08-14 22:52:26 +00:00
Alan Stern
ee1147625d BACKPORT: USB: Gadget: core: Help prevent panic during UVC unconfigure
Avichal Rakesh reported a kernel panic that occurred when the UVC
gadget driver was removed from a gadget's configuration.  The panic
involves a somewhat complicated interaction between the kernel driver
and a userspace component (as described in the Link tag below), but
the analysis did make one thing clear: The Gadget core should
accomodate gadget drivers calling usb_gadget_deactivate() as part of
their unbind procedure.

Currently this doesn't work.  gadget_unbind_driver() calls
driver->unbind() while holding the udc->connect_lock mutex, and
usb_gadget_deactivate() attempts to acquire that mutex, which will
result in a deadlock.

The simple fix is for gadget_unbind_driver() to release the mutex when
invoking the ->unbind() callback.  There is no particular reason for
it to be holding the mutex at that time, and the mutex isn't held
while the ->bind() callback is invoked.  So we'll drop the mutex
before performing the unbind callback and reacquire it afterward.

We'll also add a couple of comments to usb_gadget_activate() and
usb_gadget_deactivate().  Because they run in process context they
must not be called from a gadget driver's ->disconnect() callback,
which (according to the kerneldoc for struct usb_gadget_driver in
include/linux/usb/gadget.h) may run in interrupt context.  This may
help prevent similar bugs from arising in the future.

Reported-and-tested-by: Avichal Rakesh <arakesh@google.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: 286d9975a8 ("usb: gadget: udc: core: Prevent soft_connect_store() race")
Link: https://lore.kernel.org/linux-usb/4d7aa3f4-22d9-9f5a-3d70-1bd7148ff4ba@google.com/
Cc: Badhri Jagan Sridharan <badhri@google.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/48b2f1f1-0639-46bf-bbfc-98cb05a24914@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 291976100
Change-Id: Icff01d8e88f041af4bda8726242de9cd518a247a
(cherry picked from commit 65dadb2bee)
[arakesh: Current branch has diverged from upstream, but the
          semantics of the bug remains the same. Manually cp'ed over
          the diff from upstream patch]
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-08-11 17:30:31 +00:00
Bart Van Assche
7ba2131ad4 FROMLIST: scsi: ufs: Disable zone write locking
From the UFSHCI 4.0 specification, about the legacy (single queue) mode:
"The host controller always process transfer requests in-order according
to the order submitted to the list. In case of multiple commands with
single doorbell register ringing (batch mode), The dispatch order for
these transfer requests by host controller will base on their index in
the List. A transfer request with lower index value will be executed
before a transfer request with higher index value."

From the UFSHCI 4.0 specification, about the MCQ mode:
"Command Submission
1. Host SW writes an Entry to SQ
2. Host SW updates SQ doorbell tail pointer

Command Processing
3. After fetching the Entry, Host Controller updates SQ doorbell head
   pointer
4. Host controller sends COMMAND UPIU to UFS device"

In other words, for both legacy and MCQ mode, UFS controllers are
required to forward commands to the UFS device in the order these
commands have been received from the host.

Notes:
- For legacy mode this is only correct if the host submits one
  command at a time. The UFS driver does this.
- Also in legacy mode, the command order is not preserved if
  auto-hibernation is enabled in the UFS controller. Hence, enable
  zone write locking if auto-hibernation is enabled.

This patch improves performance as follows on my test setup:
- With the mq-deadline scheduler: 2.5x more IOPS for small writes.
- When not using an I/O scheduler compared to using mq-deadline with
  zone locking: 4x more IOPS for small writes.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: Ming Lei <ming.lei@redhat.com>
Change-Id: Ie569b09ed78ecb91af0a13f56992f075f8d1f07a
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#mbfe0e160cc8a47c16af598f1c0b3aeeb125d66de
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
4224108a41 FROMLIST: scsi: ufs: Split an if-condition
Make the next patch in this series easier to read. No functionality is
changed.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: Ming Lei <ming.lei@redhat.com>
Change-Id: Id28955a0fb550c0e65eca2979efd3c796ac97dfa
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#m49d28556332d4b959b8d8f4f7beeaec14add573d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
1c33b80bf7 FROMLIST: scsi: scsi_debug: Support injecting unaligned write errors
Allow user space software, e.g. a blktests test, to inject unaligned
write errors.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Change-Id: I05beba49f97d897b46bb1dc030037d4ae461f02b
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#m90e1577803b1b226a8d85c9ac6195b4c0a4d2e3f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
6c0276ef82 FROMLIST: scsi: scsi_debug: Support disabling zone write locking
Make it easier to test handling of QUEUE_FLAG_NO_ZONE_WRITE_LOCK by
adding support for setting this flag for scsi_debug request queues.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Change-Id: I6c8f338dea26c8bfbbca18c70e306f904eccf0cb
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#m42e4fdc8dce111f4cdd4dee21f438cd6bf0c9c70
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
3347f7daae FROMLIST: scsi: core: Retry unaligned zoned writes
If zoned writes (REQ_OP_WRITE) for a sequential write required zone have
a starting LBA that differs from the write pointer, e.g. because zoned
writes have been reordered, then the storage device will respond with an
UNALIGNED WRITE COMMAND error. Send commands that failed with an
unaligned write error to the SCSI error handler if zone write locking is
disabled. Let the SCSI error handler sort SCSI commands per LBA before
resubmitting these.

If zone write locking is disabled, increase the number of retries for
write commands sent to a sequential zone to the maximum number of
outstanding commands because in the worst case the number of times
reordered zoned writes have to be retried is (number of outstanding
writes per sequential zone) - 1.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Change-Id: I519cb3aedea7e0635be8af554edee76e8d162498
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#ma6573df4361baa921c258e3b39685a5c4c509faa
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
4e1d1b839d FROMLIST: block/mq-deadline: Only use zone locking if necessary
Measurements have shown that limiting the queue depth to one per zone for
zoned writes has a significant negative performance impact on zoned UFS
devices. Hence this patch that disables zone locking by the mq-deadline
scheduler if the storage controller preserves the command order. This
patch is based on the following assumptions:
- It happens infrequently that zoned write requests are reordered by the
  block layer.
- The I/O priority of all write requests is the same per zone.
- Either no I/O scheduler is used or an I/O scheduler is used that
  serializes write requests per zone.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Change-Id: I2000beaa430f29ea1096149a7d3b8a5423b679ec
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#made79fdd0e1d8d466f734250f3868b4d6f8105db
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
5414ea3f50 BACKPORT: FROMLIST: block: Introduce the flag QUEUE_FLAG_NO_ZONE_WRITE_LOCK
Writes in sequential write required zones must happen at the write
pointer. Even if the submitter of the write commands (e.g. a filesystem)
submits writes for sequential write required zones in order, the block
layer or the storage controller may reorder these write commands.

The zone locking mechanism in the mq-deadline I/O scheduler serializes
write commands for sequential zones. Some but not all storage controllers
require this serialization. Introduce a new request queue flag to allow
block drivers to indicate that they preserve the order of write commands
and thus do not require serialization of writes per zone.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Change-Id: Ibf578f0ec92074ccc2c11d2c24c8d6309294bc8c
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bug: 234829282
Link: https://lore.kernel.org/linux-block/20230804154821.3232094-1-bvanassche@acm.org/T/#m539c093dff4322599af97bccea975f73f3f67013
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
d01888a968 Revert "ANDROID: block: Introduce a request queue flag for pipelining zoned writes"
Prepare for applying the FROMLIST version of this patch.

This reverts commit 54678c4c75.

Bug: 234829282
Change-Id: I37215b4527d993e56b1e9a85c390c9ce843850e7
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
6a1ceeede7 Revert "ANDROID: block/mq-deadline: Only use zone locking if necessary"
Prepare for applying the FROMLIST version of this patch.

This reverts commit f57c245b52.

Bug: 234829282
Change-Id: I34cc27653fc8d22f8e068f2776be285c5e2806f3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
dc77af3d38 Revert "ANDROID: scsi: Retry unaligned zoned writes"
Prepare for applying the FROMLIST version of this patch.

This reverts commit 33aea9741e.

Bug: 234829282
Change-Id: I4928e41be2dfcf25dd21ce5feb4e3dcdd8b9df35
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
2e83e40f6a Revert "ANDROID: scsi: ufs: Enable zoned write pipelining"
Prepare for applying the FROMLIST version of this patch.

This reverts commit d701aaaeb4.

Bug: 234829282
Change-Id: I7f267cf661807c7c8c96ea05966d77b338d62de2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
e08f97fe80 Revert "ANDROID: scsi: ufs: Disable zoned write pipelining"
Prepare for applying the FROMLIST version of this patch.

This reverts commit ca743f9d51.

Bug: 234829282
Change-Id: Id95600f80be575da720b098a86aa46b84d33a733
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
a0565250b3 Revert "ANDROID: scsi: core: Delay unaligned write error retries"
Prepare for applying the FROMLIST version of this patch.

This reverts commit 2dffc600ca.

Bug: 234829282
Change-Id: I58fad37a8586350676b6d9be93aa01b1ce170a00
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Bart Van Assche
053f022ed4 Revert "ANDROID: scsi: core: Limit zoned write retries"
Prepare for applying the FROMLIST version of this patch.

This reverts commit 3bfdcf06e4.

Bug: 234829282
Change-Id: I5b2492d9b1475f69a0650a7621a2ea1606d7fb92
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-10 21:03:40 +00:00
Lecopzer Chen
8c7e6396da ANDROID: GKI: update mtktv symbol
update for gki modules protected symbols

11 function symbol(s) added
  'void baswap(bdaddr_t*, const bdaddr_t*)'
  'void bt_procfs_cleanup(struct net*, const char*)'
  'int bt_procfs_init(struct net*, const char*, struct bt_sock_list*, int(*)(struct seq_file*, void*))'
  'void bt_sock_link(struct bt_sock_list*, struct sock*)'
  'int bt_sock_register(int, const struct net_proto_family*)'
  'void bt_sock_unlink(struct bt_sock_list*, struct sock*)'
  'void bt_sock_unregister(int)'
  'int generic_mii_ioctl(struct mii_if_info*, struct mii_ioctl_data*, int, unsigned int*)'
  'bool l2cap_is_socket(struct socket*)'
  'int mii_ethtool_set_link_ksettings(struct mii_if_info*, const struct ethtool_link_ksettings*)'
  'int mii_nway_restart(struct mii_if_info*)'

Bug: 295293717
Change-Id: I14162165fc644243d4d73aa32a0cd8cb5c10846e
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
2023-08-10 13:46:18 +00:00
Lecopzer Chen
7d47dd77f1 ANDROID: GKI: Add mtktv ABI symbol list, media, trace and remaining subsys
43 function symbol(s) added
  'int __devm_mdiobus_register(struct device*, struct mii_bus*, struct module*)'
  'void __insert_inode_hash(struct inode*, unsigned long)'
  'int __mdiobus_register(struct mii_bus*, struct module*)'
  'void __sock_recv_cmsgs(struct msghdr*, struct sock*, struct sk_buff*)'
  'int __trace_bputs(unsigned long, const char*)'
  'int __traceiter_android_vh_oom_check_panic(void*, struct oom_control*, int*)'
  'void _trace_android_vh_record_pcpu_rwsem_starttime(struct task_struct*, unsigned long)'
  'int block_is_partially_uptodate(struct page*, unsigned long, unsigned long)'
  'int buffer_migrate_page(struct address_space*, struct page*, struct page*, enum migrate_mode)'
  'struct inode* igrab(struct inode*)'
  'int iio_read_channel_scale(struct iio_channel*, int*, int*)'
  'void invalidate_bh_lrus()'
  'void io_schedule()'
  'u64 jiffies64_to_nsecs(u64)'
  'int kern_path(const char*, unsigned int, struct path*)'
  'int kmsg_dump_register(struct kmsg_dumper*)'
  'int kmsg_dump_unregister(struct kmsg_dumper*)'
  'int kstrtoul_from_user(const char*, size_t, unsigned int, unsigned long*)'
  'enum led_default_state led_init_default_state_get(struct fwnode_handle*)'
  'int lzo1x_1_compress(const unsigned char*, size_t, unsigned char*, size_t*, void*)'
  'int lzo1x_decompress_safe(const unsigned char*, size_t, unsigned char*, size_t*)'
  'struct media_link* media_create_intf_link(struct media_entity*, struct media_interface*, u32)'
  'int media_create_pad_links(const struct media_device*, u32, struct media_entity*, u16, u32, struct media_entity*, u16, u32, bool)'
  'int media_device_register_entity(struct media_device*, struct media_entity*)'
  'int media_device_register_entity_notify(struct media_device*, struct media_entity_notify*)'
  'void media_device_unregister_entity(struct media_entity*)'
  'struct media_intf_devnode* media_devnode_create(struct media_device*, u32, u32, u32, u32)'
  'void media_devnode_remove(struct media_intf_devnode*)'
  'struct media_link* media_entity_find_link(struct media_pad*, struct media_pad*)'
  'int media_get_pad_index(struct media_entity*, bool, enum media_pad_signal_type)'
  'struct dentry* mount_bdev(struct file_system_type*, int, const char*, void*, int(*)(struct super_block*, void*, int))'
  'struct list_head* seq_list_next(void*, struct list_head*, loff_t*)'
  'struct list_head* seq_list_start(struct list_head*, loff_t)'
  'int seq_open_private(struct file*, const struct seq_operations*, int)'
  'int sprint_symbol_no_offset(char*, unsigned long)'
  'unsigned int stack_trace_save_regs(struct pt_regs*, unsigned long*, unsigned int, unsigned int)'
  'ssize_t store_sampling_rate(struct gov_attr_set*, const char*, size_t)'
  'int sysfs_merge_group(struct kobject*, const struct attribute_group*)'
  'void sysfs_unmerge_group(struct kobject*, const struct attribute_group*)'
  'int trace_array_destroy(struct trace_array*)'
  'struct trace_array* trace_array_get_by_name(const char*)'
  'int trace_array_init_printk(struct trace_array*)'
  'int trace_array_printk(struct trace_array*, unsigned long, const char*, ...)'

4 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_oom_check_panic'
  'const struct fwnode_operations irqchip_fwnode_ops'
  'struct workqueue_struct* system_freezable_power_efficient_wq'
  'struct srcu_struct tracepoint_srcu'

Bug: 293831482
Change-Id: If762f88971a9d8c2013c407838e46669a78719ff
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
2023-08-09 17:02:02 +00:00
Lecopzer Chen
655a288103 ANDROID: GKI: Add mtktv ABI symbol list, cpufreq and misc
32 function symbol(s) added
  'void clk_bulk_put_all(int, struct clk_bulk_data*)'
  'struct clk* clk_register_divider_table(struct device*, const char*, const char*, unsigned long, void*, u8, u8, u8, const struct clk_div_table*, spinlock_t*)'
  'void console_verbose()'
  'void cpufreq_dbs_governor_exit(struct cpufreq_policy*)'
  'int cpufreq_dbs_governor_init(struct cpufreq_policy*)'
  'void cpufreq_dbs_governor_limits(struct cpufreq_policy*)'
  'int cpufreq_dbs_governor_start(struct cpufreq_policy*)'
  'void cpufreq_dbs_governor_stop(struct cpufreq_policy*)'
  'void cpufreq_update_policy(unsigned int)'
  'struct dentry* d_add_ci(struct dentry*, struct inode*, struct qstr*)'
  'unsigned int dbs_update(struct cpufreq_policy*)'
  'void dev_get_tstats64(struct net_device*, struct rtnl_link_stats64*)'
  'int device_match_of_node(struct device*, const void*)'
  'struct regmap* device_node_to_regmap(struct device_node*)'
  'void devm_devfreq_remove_device(struct device*, struct devfreq*)'
  'int devm_extcon_register_notifier(struct device*, struct extcon_dev*, unsigned int, struct notifier_block*)'
  'struct gpio_desc* devm_gpiod_get_index_optional(struct device*, const char*, unsigned int, enum gpiod_flags)'
  'int devm_hwspin_lock_unregister(struct device*, struct hwspinlock_device*)'
  'struct mii_bus* devm_mdiobus_alloc_size(struct device*, int)'
  'void drm_atomic_state_default_clear(struct drm_atomic_state*)'
  'void drm_display_mode_from_videomode(const struct videomode*, struct drm_display_mode*)'
  'void end_page_writeback(struct page*)'
  'int eth_platform_get_mac_address(struct device*, u8*)'
  'void ftrace_dump(enum ftrace_dump_mode)'
  'void* gen_pool_dma_alloc(struct gen_pool*, size_t, dma_addr_t*)'
  'struct gen_pool* gen_pool_get(struct device*, const char*)'
  'int generic_error_remove_page(struct address_space*, struct page*)'
  'void gov_update_cpu_data(struct dbs_data*)'
  'struct gpio_chip* gpiochip_find(void*, int(*)(struct gpio_chip*, void*))'
  'int gpiod_is_active_low(const struct gpio_desc*)'
  'int idr_alloc_u32(struct idr*, void*, u32*, unsigned long, gfp_t)'
  'void* idr_get_next_ul(struct idr*, unsigned long*)'

Bug: 293831482
Change-Id: Icc54949b24588b4d3e2ef59783b494bf3cd682c0
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
2023-08-09 17:02:02 +00:00
Lecopzer Chen
663ca511e8 ANDROID: GKI: Add mtktv ABI symbol list, net, eth, regulator and pinmux
36 function symbol(s) added
  'void net_selftest(struct net_device*, struct ethtool_test*, u64*)'
  'int net_selftest_get_count()'
  'void net_selftest_get_strings(u8*)'
  'struct thermal_cooling_device* of_cpufreq_cooling_register(struct cpufreq_policy*)'
  'void path_put(const struct path*)'
  'ssize_t perf_event_sysfs_show(struct device*, struct device_attribute*, char*)'
  'struct phy_device* phy_connect(struct net_device*, const char*, void(*)(struct net_device*), phy_interface_t)'
  'void phy_disconnect(struct phy_device*)'
  'int phy_do_ioctl_running(struct net_device*, struct ifreq*, int)'
  'int phy_ethtool_get_link_ksettings(struct net_device*, struct ethtool_link_ksettings*)'
  'int phy_ethtool_nway_reset(struct net_device*)'
  'int phy_ethtool_set_link_ksettings(struct net_device*, const struct ethtool_link_ksettings*)'
  'void phy_start(struct phy_device*)'
  'void phy_stop(struct phy_device*)'
  'int phy_suspend(struct phy_device*)'
  'pid_t pid_vnr(struct pid*)'
  'void pinconf_generic_dump_config(struct pinctrl_dev*, struct seq_file*, unsigned long)'
  'int pinctrl_count_index_with_args(const struct device_node*, const char*)'
  'int pinctrl_generic_add_group(struct pinctrl_dev*, const char*, int*, int, void*)'
  'int pinctrl_generic_get_group_count(struct pinctrl_dev*)'
  'const char* pinctrl_generic_get_group_name(struct pinctrl_dev*, unsigned int)'
  'int pinctrl_generic_get_group_pins(struct pinctrl_dev*, unsigned int, const unsigned int**, unsigned int*)'
  'int pinctrl_generic_remove_group(struct pinctrl_dev*, unsigned int)'
  'int pinctrl_parse_index_with_args(const struct device_node*, const char*, int, struct of_phandle_args*)'
  'int pinctrl_register_and_init(struct pinctrl_desc*, struct device*, void*, struct pinctrl_dev**)'
  'int pinmux_generic_add_function(struct pinctrl_dev*, const char*, const char**, unsigned int, void*)'
  'struct function_desc* pinmux_generic_get_function(struct pinctrl_dev*, unsigned int)'
  'int pinmux_generic_get_function_count(struct pinctrl_dev*)'
  'int pinmux_generic_get_function_groups(struct pinctrl_dev*, unsigned int, const char* const**, unsigned int*)'
  'const char* pinmux_generic_get_function_name(struct pinctrl_dev*, unsigned int)'
  'int pinmux_generic_remove_function(struct pinctrl_dev*, unsigned int)'
  'void proc_set_user(struct proc_dir_entry*, kuid_t, kgid_t)'
  'int regulator_set_mode(struct regulator*, unsigned int)'
  'int regulator_set_voltage_time(struct regulator*, int, int)'
  'int sb_min_blocksize(struct super_block*, int)'
  'int schedule_hrtimeout(ktime_t*, enum hrtimer_mode)'

Bug: 293831482
Change-Id: I83226962af59b23418594dbc4ca816f9a0456b45
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
2023-08-09 17:02:02 +00:00
Lecopzer Chen
99c011c37d ANDROID: GKI: Add mtktv ABI symbol list, pwm, serial and snd
22 function symbol(s) added
  'void pwm_free(struct pwm_device*)'
  'struct pwm_device* pwm_request(int, const char*)'
  'void serial8250_do_pm(struct uart_port*, unsigned int, unsigned int)'
  'void serial8250_do_set_termios(struct uart_port*, struct ktermios*, struct ktermios*)'
  'void serial8250_do_shutdown(struct uart_port*)'
  'int serial8250_do_startup(struct uart_port*)'
  'struct uart_8250_port* serial8250_get_port(int)'
  'unsigned int serial8250_modem_status(struct uart_8250_port*)'
  'int serial8250_register_8250_port(const struct uart_8250_port*)'
  'void serial8250_resume_port(int)'
  'void serial8250_rpm_get(struct uart_8250_port*)'
  'void serial8250_rpm_put(struct uart_8250_port*)'
  'void serial8250_rpm_put_tx(struct uart_8250_port*)'
  'unsigned char serial8250_rx_chars(struct uart_8250_port*, unsigned char)'
  'void serial8250_suspend_port(int)'
  'void serial8250_tx_chars(struct uart_8250_port*)'
  'void serial8250_unregister_port(int)'
  'bool sk_capable(const struct sock*, int)'
  'int snd_compress_new(struct snd_card*, int, int, const char*, struct snd_compr*)'
  'struct snd_kcontrol* snd_ctl_find_id(struct snd_card*, struct snd_ctl_elem_id*)'
  'int snd_pcm_format_big_endian(snd_pcm_format_t)'
  'const char* snd_pcm_format_name(snd_pcm_format_t)'

Bug: 293831482
Change-Id: I4b664a3b232f0a038ed59ec523f09eab3e3506cc
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
2023-08-09 17:02:02 +00:00
Lecopzer Chen
b85af8a6dd ANDROID: GKI: Add mtktv ABI symbol list, usb and v4l2
usb and v4l2 part

46 function symbol(s) added
  'struct usb_host_interface* usb_altnum_to_altsetting(const struct usb_interface*, unsigned int)'
  'int usb_anchor_empty(struct usb_anchor*)'
  'int usb_control_msg_recv(struct usb_device*, __u8, __u8, __u8, __u16, __u16, void*, __u16, int, gfp_t)'
  'int usb_control_msg_send(struct usb_device*, __u8, __u8, __u8, __u16, __u16, const void*, __u16, int, gfp_t)'
  'void usb_deregister_dev(struct usb_interface*, struct usb_class_driver*)'
  'int usb_driver_set_configuration(struct usb_device*, int)'
  'void usb_enable_lpm(struct usb_device*)'
  'struct usb_interface* usb_find_interface(struct usb_driver*, int)'
  'struct urb* usb_get_urb(struct urb*)'
  'int usb_lock_device_for_reset(struct usb_device*, const struct usb_interface*)'
  'int usb_register_dev(struct usb_interface*, struct usb_class_driver*)'
  'int usb_reset_configuration(struct usb_device*)'
  'void usb_reset_endpoint(struct usb_device*, unsigned int)'
  'int usb_string(struct usb_device*, int, char*, size_t)'
  'void usb_unlink_anchored_urbs(struct usb_anchor*)'
  'void v4l2_ctrl_request_complete(struct media_request*, struct v4l2_ctrl_handler*)'
  'int v4l2_ctrl_request_setup(struct media_request*, struct v4l2_ctrl_handler*)'
  'int v4l2_event_pending(struct v4l2_fh*)'
  'void v4l2_event_queue(struct video_device*, const struct v4l2_event*)'
  'int v4l2_fh_is_singular(struct v4l2_fh*)'
  'void v4l2_m2m_buf_copy_metadata(const struct vb2_v4l2_buffer*, struct vb2_v4l2_buffer*, bool)'
  'int v4l2_m2m_ioctl_prepare_buf(struct file*, void*, struct v4l2_buffer*)'
  'int v4l2_m2m_ioctl_qbuf(struct file*, void*, struct v4l2_buffer*)'
  'int v4l2_m2m_querybuf(struct file*, struct v4l2_m2m_ctx*, struct v4l2_buffer*)'
  'int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev*, struct video_device*, int)'
  'void v4l2_m2m_request_queue(struct media_request*)'
  'void v4l2_m2m_unregister_media_controller(struct v4l2_m2m_dev*)'
  'int vb2_core_dqbuf(struct vb2_queue*, unsigned int*, void*, bool)'
  'int vb2_core_expbuf(struct vb2_queue*, int*, unsigned int, unsigned int, unsigned int, unsigned int)'
  '__poll_t vb2_core_poll(struct vb2_queue*, struct file*, poll_table*)'
  'int vb2_core_qbuf(struct vb2_queue*, unsigned int, void*, struct media_request*)'
  'void vb2_core_querybuf(struct vb2_queue*, unsigned int, void*)'
  'int vb2_core_queue_init(struct vb2_queue*)'
  'void vb2_core_queue_release(struct vb2_queue*)'
  'int vb2_core_reqbufs(struct vb2_queue*, enum vb2_memory, unsigned int*)'
  'int vb2_core_streamoff(struct vb2_queue*, unsigned int)'
  'int vb2_core_streamon(struct vb2_queue*, unsigned int)'
  'int vb2_request_validate(struct media_request*)'
  'void videomode_from_timing(const struct display_timing*, struct videomode*)'
  'int walk_iomem_res_desc(unsigned long, unsigned long, u64, u64, void*, int(*)(struct resource*, void*))'
  'long work_on_cpu_safe(int, long(*)(void*), void*)'
  'int xhci_add_endpoint(struct usb_hcd*, struct usb_device*, struct usb_host_endpoint*)'
  'int xhci_check_bandwidth(struct usb_hcd*, struct usb_device*)'
  'int xhci_drop_endpoint(struct usb_hcd*, struct usb_device*, struct usb_host_endpoint*)'
  'struct xhci_ep_ctx* xhci_get_ep_ctx(struct xhci_hcd*, struct xhci_container_ctx*, unsigned int)'
  'void xhci_reset_bandwidth(struct usb_hcd*, struct usb_device*)'

Bug: 293831482
Change-Id: I4e3686f92e09964c6253008ca014ffe2770581da
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
2023-08-09 17:02:02 +00:00
Kalesh Singh
0f986fae12 FROMGIT: BACKPORT: Multi-gen LRU: Fix can_swap in lru_gen_look_around()
walk->can_swap might be invalid since it's not guaranteed to be
initialized for the particular lruvec.  Instead deduce it from the folio
type (anon/file).

Link: https://lkml.kernel.org/r/20230802025606.346758-3-kaleshsingh@google.com
Fixes: 018ee47f14 ("mm: multi-gen LRU: exploit locality in rmap")
Change-Id: I1ae78011d4972d87bac9f2db8c56352cdb7a9be6
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> [mediatek]
Tested-by: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Aneesh Kumar K V <aneesh.kumar@linux.ibm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Steven Barrett <steven@liquorix.net>
Cc: Suleiman Souhlal <suleiman@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit fdf19e8c8f1cdcee4eccf4c98a875f44f39d8b9d https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable)
Bug: 288383787
Bug: 291719697
[ Kalesh Singh - Fix trivial conflict in lru_gen_look_around() ]
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-08-03 20:46:17 +00:00
Kalesh Singh
12fb1c3ef5 FROMGIT: BACKPORT: Multi-gen LRU: Avoid race in inc_min_seq()
inc_max_seq() will try to inc_min_seq() if nr_gens == MAX_NR_GENS. This
is because the generations are reused (the last oldest now empty
generation will become the next youngest generation).

inc_min_seq() is retried until successful, dropping the lru_lock
and yielding the CPU on each failure, and retaking the lock before
trying again:

        while (!inc_min_seq(lruvec, type, can_swap)) {
                spin_unlock_irq(&lruvec->lru_lock);
                cond_resched();
                spin_lock_irq(&lruvec->lru_lock);
        }

However, the initial condition that required incrementing the min_seq
(nr_gens == MAX_NR_GENS) is not retested. This can change by another
call to inc_max_seq() from run_aging() with force_scan=true from the
debugfs interface.

Since the eviction stalls when the nr_gens == MIN_NR_GENS, avoid
unnecessarily incrementing the min_seq by rechecking the number of
generations before each attempt.

This issue was uncovered in previous discussion on the list by Yu Zhao
and Aneesh Kumar [1].

[1] https://lore.kernel.org/linux-mm/CAOUHufbO7CaVm=xjEb1avDhHVvnC8pJmGyKcFf2iY_dpf+zR3w@mail.gmail.com/

Link: https://lkml.kernel.org/r/20230802025606.346758-2-kaleshsingh@google.com
Fixes: d6c3af7d8a ("mm: multi-gen LRU: debugfs interface")
Change-Id: I89e84ef2927eb1b0091f1be28bd03eb04dee4c57
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> [mediatek]
Tested-by: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Aneesh Kumar K V <aneesh.kumar@linux.ibm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Steven Barrett <steven@liquorix.net>
Cc: Suleiman Souhlal <suleiman@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 250dbd10306126b06415afda8adfc27b2b780428 https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable)
Bug: 288383787
Bug: 291719697
[ Fix trivial conflict in inc_max_seq() due to page -> folio
   Kalesh Singh ]
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-08-03 20:46:17 +00:00
Kalesh Singh
bf03a7c90a FROMGIT: BACKPORT: Multi-gen LRU: Fix per-zone reclaim
MGLRU has a LRU list for each zone for each type (anon/file) in each
generation:

	long nr_pages[MAX_NR_GENS][ANON_AND_FILE][MAX_NR_ZONES];

The min_seq (oldest generation) can progress independently for each
type but the max_seq (youngest generation) is shared for both anon and
file. This is to maintain a common frame of reference.

In order for eviction to advance the min_seq of a type, all the per-zone
lists in the oldest generation of that type must be empty.

The eviction logic only considers pages from eligible zones for
eviction or promotion.

    scan_folios() {
	...
	for (zone = sc->reclaim_idx; zone >= 0; zone--)  {
	    ...
	    sort_folio(); 	// Promote
	    ...
	    isolate_folio(); 	// Evict
	}
	...
    }

Consider the system has the movable zone configured and default 4
generations. The current state of the system is as shown below
(only illustrating one type for simplicity):

Type: ANON

	Zone    DMA32     Normal    Movable    Device

	Gen 0       0          0        4GB         0

	Gen 1       0        1GB        1MB         0

	Gen 2     1MB        4GB        1MB         0

	Gen 3     1MB        1MB        1MB         0

Now consider there is a GFP_KERNEL allocation request (eligible zone
index <= Normal), evict_folios() will return without doing any work
since there are no pages to scan in the eligible zones of the oldest
generation. Reclaim won't make progress until triggered from a ZONE_MOVABLE
allocation request; which may not happen soon if there is a lot of free
memory in the movable zone. This can lead to OOM kills, although there
is 1GB pages in the Normal zone of Gen 1 that we have not yet tried to
reclaim.

This issue is not seen in the conventional active/inactive LRU since
there are no per-zone lists.

If there are no (not enough) folios to scan in the eligible zones, move
folios from ineligible zone (zone_index > reclaim_index) to the next
generation. This allows for the progression of min_seq and reclaiming
from the next generation (Gen 1).

Qualcomm, Mediatek and raspberrypi [1] discovered this issue independently.

[1] https://github.com/raspberrypi/linux/issues/5395

Link: https://lkml.kernel.org/r/20230802025606.346758-1-kaleshsingh@google.com
Fixes: ac35a49023 ("mm: multi-gen LRU: minimal implementation")
Change-Id: I5bbf44bd7ffe42f4347df4be59a75c1603c9b947
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reported-by: Charan Teja Kalla <quic_charante@quicinc.com>
Reported-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> [mediatek]
Tested-by: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Steven Barrett <steven@liquorix.net>
Cc: Suleiman Souhlal <suleiman@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Aneesh Kumar K V <aneesh.kumar@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 1462260adc41c5974362cb54ff577c2a15b8c7b2 https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable)
Bug: 288383787
Bug: 291719697
[ folio -> page renames - Kalesh Singh ]
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-08-03 20:46:17 +00:00
Bart Van Assche
0c5273e138 BACKPORT: FROMGIT: block: Improve performance for BLK_MQ_F_BLOCKING drivers
blk_mq_run_queue() runs the queue asynchronously if BLK_MQ_F_BLOCKING
has been set. This is suboptimal since running the queue asynchronously
is slower than running the queue synchronously. This patch modifies
blk_mq_run_queue() as follows if BLK_MQ_F_BLOCKING has been set:
- Run the queue synchronously if it is allowed to sleep.
- Run the queue asynchronously if it is not allowed to sleep.
Additionally, blk_mq_run_hw_queue(hctx, false) calls are modified into
blk_mq_run_hw_queue(hctx, hctx->flags & BLK_MQ_F_BLOCKING) if the caller
may be invoked from atomic context.

The following caller chains have been reviewed:

blk_mq_run_hw_queue(hctx, false)
  blk_mq_get_tag()      /* may sleep, hence the functions it calls may also sleep */
  blk_execute_rq()             /* may sleep */
  blk_mq_run_hw_queues(q, async=false)
    blk_freeze_queue_start()   /* may sleep */
    blk_mq_requeue_work()      /* may sleep */
    scsi_kick_queue()
      scsi_requeue_run_queue() /* may sleep */
      scsi_run_host_queues()
        scsi_ioctl_reset()     /* may sleep */
  blk_mq_insert_requests(hctx, ctx, list, run_queue_async=false)
    blk_mq_dispatch_plug_list(plug, from_sched=false)
      blk_mq_flush_plug_list(plug, from_schedule=false)
        __blk_flush_plug(plug, from_schedule=false)
	blk_add_rq_to_plug()
	  blk_mq_submit_bio()  /* may sleep if REQ_NOWAIT has not been set */
  blk_mq_plug_issue_direct()
    blk_mq_flush_plug_list()   /* see above */
  blk_mq_dispatch_plug_list(plug, from_sched=false)
    blk_mq_flush_plug_list()   /* see above */
  blk_mq_try_issue_directly()
    blk_mq_submit_bio()        /* may sleep if REQ_NOWAIT has not been set */
  blk_mq_try_issue_list_directly(hctx, list)
    blk_mq_insert_requests() /* see above */

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Change-Id: I597e0fa587057ac22e52f73351cbfa1de2c72a6b
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230721172731.955724-4-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Bug: 291379528
(cherry picked from commit 65a558f66c git://git.kernel.dk/linux-block for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-03 19:14:25 +00:00
Bart Van Assche
d12306bb95 FROMGIT: scsi: Remove a blk_mq_run_hw_queues() call
blk_mq_kick_requeue_list() calls blk_mq_run_hw_queues() asynchronously.
Leave out the direct blk_mq_run_hw_queues() call. This patch causes
scsi_run_queue() to call blk_mq_run_hw_queues() asynchronously instead
of synchronously. Since scsi_run_queue() is not called from the hot I/O
submission path, this patch does not affect the hot path.

This patch prepares for allowing blk_mq_run_hw_queue() to sleep if
BLK_MQ_F_BLOCKING has been set. scsi_run_queue() may be called from
atomic context and must not sleep. Hence the removal of the
blk_mq_run_hw_queues(q, false) call. See also scsi_unblock_requests().

Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Change-Id: Ia7447d2cc803cb56728a902fd8562e85640d5fd0
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20230721172731.955724-3-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Bug: 291379528
(cherry picked from commit d42e2e3448 git://git.kernel.dk/linux-block for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-03 19:14:25 +00:00
Bart Van Assche
8bb4682c76 BACKPORT: FROMGIT: scsi: Inline scsi_kick_queue()
Inline scsi_kick_queue() to prepare for modifying the second argument
passed to blk_mq_run_hw_queues().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Change-Id: I595673bbdd357fd27eb61e5f2605257b8c20ecd6
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20230721172731.955724-2-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Bug: 291379528
(cherry picked from commit b5ca9acff5 git://git.kernel.dk/linux-block for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-08-03 19:14:25 +00:00
Giuliano Procida
4bbc8e45b2 ANDROID: ABI: Update STG ABI to format version 2
If you have trouble reading this new file format, please refresh your
prebuilt version of STG with repo sync.

Bug: 294213765
Change-Id: I4d7ee716231956c5f4da1343cc0db5170aaaa3b1
Signed-off-by: Giuliano Procida <gprocida@google.com>
2023-08-02 15:53:46 +01:00
Stanley Chang
a9bc04930f ANDROID: GKI: usb: phy: use ANDROID_KABI_USE for api notify_port_status
In struct usb_phy, the reserved slot 0 is reserved for a notify_port_status
callback addition for ABI freeze. Now this api is accepted on upstream.
Therefore, use ANDROID_KABI_USE to apply this api.

Bug: 286930662
Change-Id: Iae894f9dfff77fd1f23bb48fefdb9b682c54de57
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
2023-08-01 21:24:36 +00:00
Stanley Chang
7aa67c1a12 FROMGIT: dt-bindings: phy: realtek: Add Realtek DHC RTD SoC USB 3.0 PHY
Document the USB PHY bindings for Realtek SoCs.
Realtek DHC (digital home center) RTD SoCs support DWC3 XHCI USB
controller and using USB 3.0 PHY transceiver.

Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230725033318.8361-5-stanley_chang@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 286930662
(cherry picked from commit d6ef688786
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: Ic16e843003c090d5f2ccee6881133a9f782b0c72
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
2023-08-01 21:24:36 +00:00
Stanley Chang
d58cdad855 FROMGIT: dt-bindings: phy: realtek: Add Realtek DHC RTD SoC USB 2.0 PHY
Document the USB PHY bindings for Realtek SoCs.
Realtek DHC (digital home center) RTD SoCs support DWC3 XHCI USB
controller and using USB 2.0 PHY transceiver.

Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230725033318.8361-4-stanley_chang@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 286930662
(cherry picked from commit 612ad27a30
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: I338ac63f15c10687d79b98a6c68f8901b07869a5
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
2023-08-01 21:24:36 +00:00
Stanley Chang
6e97af079d FROMGIT: phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY
Realtek DHC (digital home center) RTD SoCs support DWC3 XHCI USB
controller. Added the driver to drive the USB 3.0 PHY transceivers.

Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Link: https://lore.kernel.org/r/20230725033318.8361-3-stanley_chang@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 286930662
(cherry picked from commit adda6e82a7
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: Icba27bdd44778e4d09006c86acf805d97db5746b
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
2023-08-01 21:24:36 +00:00
Stanley Chang
3dadac8ba6 FROMGIT: phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY
Realtek DHC (digital home center) RTD SoCs support DWC3 XHCI USB
controller. Added the driver to drive the USB 2.0 PHY transceivers.

Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Link: https://lore.kernel.org/r/20230725033318.8361-2-stanley_chang@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 286930662
(cherry picked from commit 134e6d25f6
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: Ia558a759e5bb288bc368335516863738e29bc142
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
2023-08-01 21:24:36 +00:00