Commit Graph

1080740 Commits

Author SHA1 Message Date
Kever Yang
ab89185ddb ANDROID: GKI: rockchip: Update symbols
Leaf changes summary: 0 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function void drm_hdcp_update_content_protection(drm_connector*, u64)'
  [A] 'function void sdhci_reset_tuning(sdhci_host*)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I9d15fb674c1bd308e88ad34352092deef60eafcc
2023-01-10 20:58:10 +00:00
Jaegeuk Kim
6e50bbff17 BACKPORT: f2fs: let's avoid panic if extent_tree is not created
This patch avoids the below panic.

pc : __lookup_extent_tree+0xd8/0x760
lr : f2fs_do_write_data_page+0x104/0x87c
sp : ffffffc010cbb3c0
x29: ffffffc010cbb3e0 x28: 0000000000000000
x27: ffffff8803e7f020 x26: ffffff8803e7ed40
x25: ffffff8803e7f020 x24: ffffffc010cbb460
x23: ffffffc010cbb480 x22: 0000000000000000
x21: 0000000000000000 x20: ffffffff22e90900
x19: 0000000000000000 x18: ffffffc010c5d080
x17: 0000000000000000 x16: 0000000000000020
x15: ffffffdb1acdbb88 x14: ffffff888759e2b0
x13: 0000000000000000 x12: ffffff802da49000
x11: 000000000a001200 x10: ffffff8803e7ed40
x9 : ffffff8023195800 x8 : ffffff802da49078
x7 : 0000000000000001 x6 : 0000000000000000
x5 : 0000000000000006 x4 : ffffffc010cbba28
x3 : 0000000000000000 x2 : ffffffc010cbb480
x1 : 0000000000000000 x0 : ffffff8803e7ed40
Call trace:
 __lookup_extent_tree+0xd8/0x760
 f2fs_do_write_data_page+0x104/0x87c
 f2fs_write_single_data_page+0x420/0xb60
 f2fs_write_cache_pages+0x418/0xb1c
 __f2fs_write_data_pages+0x428/0x58c
 f2fs_write_data_pages+0x30/0x40
 do_writepages+0x88/0x190
 __writeback_single_inode+0x48/0x448
 writeback_sb_inodes+0x468/0x9e8
 __writeback_inodes_wb+0xb8/0x2a4
 wb_writeback+0x33c/0x740
 wb_do_writeback+0x2b4/0x400
 wb_workfn+0xe4/0x34c
 process_one_work+0x24c/0x5bc
 worker_thread+0x3e8/0xa50
 kthread+0x150/0x1b4

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 24af2f08d60039427995f78150963743dcb080de)
Change-Id: I7594e80fb7df0dff3f494e79be763a9870c8f063
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
39b8fee3c0 BACKPORT: f2fs: should use a temp extent_info for lookup
Otherwise, __lookup_extent_tree() will override the given extent_info which will
be used by caller.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit db640d99b1ed4745eaf3af9ea1910996cddaf30c)
Change-Id: Ib37a9ec57c24cfe303ee23a5e90618e6e0dabe61
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
937ed4edda BACKPORT: f2fs: don't mix to use union values in extent_info
Let's explicitly use the defined values in block_age case only.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 354a326851a615c7fd8f5a6bda72afc9f051c264)
Change-Id: I4011cbf10117a9023ef6fc507726020159ead72d
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
073b997b02 BACKPORT: f2fs: initialize extent_cache parameter
This can avoid confusing tracepoint values.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit b5825de803e7cf56262f5b3a8bc692d61acfe653)
Change-Id: Ia43e2c1fd405a11fc4122b68f05f40c10f47f263
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
aa064914fd BACKPORT: f2fs: add block_age-based extent cache
This patch introduces a runtime hot/cold data separation method
for f2fs, in order to improve the accuracy for data temperature
classification, reduce the garbage collection overhead after
long-term data updates.

Enhanced hot/cold data separation can record data block update
frequency as "age" of the extent per inode, and take use of the age
info to indicate better temperature type for data block allocation:
 - It records total data blocks allocated since mount;
 - When file extent has been updated, it calculate the count of data
blocks allocated since last update as the age of the extent;
 - Before the data block allocated, it searches for the age info and
chooses the suitable segment for allocation.

Test and result:
 - Prepare: create about 30000 files
  * 3% for cold files (with cold file extension like .apk, from 3M to 10M)
  * 50% for warm files (with random file extension like .FcDxq, from 1K
to 4M)
  * 47% for hot files (with hot file extension like .db, from 1K to 256K)
 - create(5%)/random update(90%)/delete(5%) the files
  * total write amount is about 70G
  * fsync will be called for .db files, and buffered write will be used
for other files

The storage of test device is large enough(128G) so that it will not
switch to SSR mode during the test.

Benefit: dirty segment count increment reduce about 14%
 - before: Dirty +21110
 - after:  Dirty +18286

Bug: 264453689
Signed-off-by: qixiaoyu1 <qixiaoyu1@xiaomi.com>
Signed-off-by: xiongping1 <xiongping1@xiaomi.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 729055d7f1e665c57c1c90b093501cb3eb47a876)
Change-Id: I8a62846bd3d44f7243300fa9653dbb623b46a96c
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
d6ba4dceab BACKPORT: f2fs: allocate the extent_cache by default
Let's allocate it to remove the runtime complexity.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 693658e0c0eca25087c1ffb318d85f8d392d6d27)
Change-Id: Ib46b6edd4f4a6232f3451498ee5c2f246dd37682
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
72e9dd90cf BACKPORT: f2fs: refactor extent_cache to support for read and more
This patch prepares extent_cache to be ready for addition.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 7cf42d77c7242d23988215297bdd2d215e208b6f)
Change-Id: I5ca06c274529187b804ddd4b0834dc44fe6aa8ad
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
561e9febb3 BACKPORT: f2fs: remove unnecessary __init_extent_tree
Added into the caller.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 0b461f459f0f53ff29b0ff98d4c18808b4248dcc)
Change-Id: Ic52ba22c00055bfe85bb789e6fd057d5fa84c00f
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
bf3cafe7f1 BACKPORT: f2fs: move internal functions into extent_cache.c
No functional change.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit f458f39556cec5660a5508fbbeea4917bc46bc9c)
Change-Id: I6171ab293b214a2eeb3f420517216371ee29557e
2023-01-10 18:49:35 +00:00
Jaegeuk Kim
b29b3bd7e1 BACKPORT: f2fs: specify extent cache for read explicitly
Let's descrbie it's read extent cache.

Bug: 264453689
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 29539ed310a92b5eb1e6ce8906087536b6259d58)
Change-Id: I9cb258b7ee152ead1458ef8adb3e542532f152ce
2023-01-10 18:49:35 +00:00
Zhang Qilong
02cb04cb05 BACKPORT: f2fs: add "c_len" into trace_f2fs_update_extent_tree_range for compressed file
The trace_f2fs_update_extent_tree_range could not record compressed
block length in the cluster of compress file and we just add it.

Bug: 264453689
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit a95694e33ce998e808b3a72164e8df3b5e0faf87)
Change-Id: Ic3702b2735be27cf1eab34191313b162805a010a
2023-01-10 18:49:35 +00:00
Zhang Qilong
f6b4d18df0 BACKPORT: f2fs: fix race condition on setting FI_NO_EXTENT flag
The following scenarios exist.
process A:               process B:
->f2fs_drop_extent_tree  ->f2fs_update_extent_cache_range
                          ->f2fs_update_extent_tree_range
                           ->write_lock
 ->set_inode_flag
                           ->is_inode_flag_set
                           ->__free_extent_tree // Shouldn't
                                                // have been
                                                // cleaned up
                                                // here
  ->write_lock

In this case, the "FI_NO_EXTENT" flag is set between
f2fs_update_extent_tree_range and is_inode_flag_set
by other process. it leads to clearing the whole exten
tree which should not have happened. And we fix it by
move the setting it to the range of write_lock.

Bug: 264453689
Fixes: 5f281fab9b ("f2fs: disable extent_cache for fcollapse/finsert inodes")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit a597af3b5a967e810cc8155abaa49abf10d6c417)
Change-Id: If36c3556c9062d46509f704f0491a7e6ad652ae6
2023-01-10 18:49:35 +00:00
Chao Yu
3112d6f502 BACKPORT: f2fs: extent cache: support unaligned extent
Compressed inode may suffer read performance issue due to it can not
use extent cache, so I propose to add this unaligned extent support
to improve it.

Currently, it only works in readonly format f2fs image.

Unaligned extent: in one compressed cluster, physical block number
will be less than logical block number, so we add an extra physical
block length in extent info in order to indicate such extent status.

The idea is if one whole cluster blocks are contiguous physically,
once its mapping info was readed at first time, we will cache an
unaligned (or aligned) extent info entry in extent cache, it expects
that the mapping info will be hitted when rereading cluster.

Merge policy:
- Aligned extents can be merged.
- Aligned extent and unaligned extent can not be merged.

Bug: 264453689
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 627371ed31)
Change-Id: I106279145558f38dfa295c3e99fa03f6fcd306f4
2023-01-10 18:49:35 +00:00
Jens Axboe
25280f263d UPSTREAM: io_uring: kill goto error handling in io_sqpoll_wait_sq()
Hunk extracted from commit 70aacfe661
upstream.

If the sqpoll thread has died, the out condition doesn't remove the
waiting task from the waitqueue. The goto and check are not needed, just
make it a break condition after setting the error value. That ensures
that we always remove ourselves from sqo_sq_wait waitqueue.

Bug: 259534862
Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0f544353fe)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I453c3e23a2f0c5ce6a8dd73dac020ec6f32994ca
2023-01-10 09:44:08 +00:00
Tao Huang
9b9f560ac9 arm64: rockchip_linux_defconfig: Disable unsupported ARM64 features
-CONFIG_ARM64_PTR_AUTH
-CONFIG_ARM64_AMU_EXTN
-CONFIG_ARM64_TLB_RANGE
-CONFIG_ARM64_BTI
-CONFIG_ARM64_E0PD
-CONFIG_ARCH_RANDOM
-CONFIG_ARM64_MTE
-CONFIG_ARM64_SVE

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Iffe91d9bb9fa7154021980bdd2040189eb4380f0
2023-01-10 17:00:37 +08:00
Tao Huang
633e5b4abf arm64: rockchip_linux_defconfig: Disable erratum do not affects rk3588
-CONFIG_ARM64_ERRATUM_1418040
-CONFIG_ARM64_ERRATUM_1165522
-CONFIG_ARM64_ERRATUM_1286807
-CONFIG_ARM64_ERRATUM_1463225
-CONFIG_ARM64_ERRATUM_1542419
-CONFIG_ARM64_ERRATUM_1508412
-CONFIG_ARM64_ERRATUM_2054223
-CONFIG_ARM64_ERRATUM_2067961
-CONFIG_CAVIUM_ERRATUM_27456
-CONFIG_CAVIUM_ERRATUM_30115
-CONFIG_CAVIUM_TX2_ERRATUM_219
-CONFIG_FUJITSU_ERRATUM_010001
-CONFIG_HISILICON_ERRATUM_161600802
-CONFIG_QCOM_FALKOR_ERRATUM_1003
-CONFIG_QCOM_FALKOR_ERRATUM_1009
-CONFIG_QCOM_QDF2400_ERRATUM_0065
-CONFIG_QCOM_FALKOR_ERRATUM_E1041
-CONFIG_SOCIONEXT_SYNQUACER_PREITS

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I830c730289e7ff405c34e5a9c3e80ba38a71193e
2023-01-10 16:57:18 +08:00
Tao Huang
89082b519e arm64: rockchip_defconfig: Disable unsupported ARM64 features
The Cortex-A76 core supports:
The Armv8.2-A extension.
The RAS extension.
The Load acquire (LDAPR) instructions introduced in the Armv8.3-A extension
The Dot Product support instructions introduced in the Armv8.4-A extension.
The PSTATE Speculative Store Bypass Safe (SSBS) bit and the speculation barriers (CSDB, SSBB,
PSSBB) instructions introduced in the Armv8.5-A extension.

Disable follow ARMv8.3/4/5 features:
-CONFIG_ARM64_PTR_AUTH
-CONFIG_ARM64_AMU_EXTN
-CONFIG_ARM64_TLB_RANGE
-CONFIG_ARM64_BTI
-CONFIG_ARM64_E0PD
-CONFIG_ARCH_RANDOM
-CONFIG_ARM64_MTE
-CONFIG_ARM64_SVE

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I34b8af33b9ed64add2a5e17f6bfa4d3c7601c07f
2023-01-10 16:51:28 +08:00
Tao Huang
0e1976c067 arm64: rockchip_defconfig: Disable erratum do not affects rk3588
RK3588 Cortex-A76 version is r4p0.
1188873 Fixed in r3p0.
1165522 Fixed in r3p0.
1286807 Fixed in r3p1.
1463225 Fixed in r4p0.
2054223 Cortex-A710
2067961 Neoverse-N2

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I02b3f71d6b276c6bd1bdce35d8da0838748b954a
2023-01-10 16:47:27 +08:00
David Wu
0ef7394930 arm64: configs: rockchip: Enable RK630PHY config
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I7a1270bd40f5026d064543b52c08e7586a25e28d
2023-01-10 16:47:27 +08:00
David Wu
77f8a69780 net: phy: rk630phy: Fix the compile error
drivers/net/phy/rk630phy.c:97:37: error: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
                efuse_buf = nvmem_cell_read(cell, &len);
                                                  ^~~~
./include/linux/nvmem-consumer.h:62:56: note: passing argument to parameter 'len' here
void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iee69c589b532b067b57290bcb3e39f3402ea83e7
2023-01-10 16:47:27 +08:00
Jason Zhu
cac328dcac arm64: configs: rockchip: enable SND_SOC_RK3528
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I95a7d906069968898ba0146301d467fef5c12cc6
2023-01-10 15:07:54 +08:00
Jason Zhu
0c0c7f4d85 ASoC: codecs: support rk3528 acodec
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ie789864edde7aec69b5906868a76f6ba60a53d7a
2023-01-10 15:07:16 +08:00
Zhen Chen
b77f682d3c MALI: bifrost: fix a compilation error when DEBUG_FS and MALI_CSF_SUPPORT are disabled
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I8f4228ccc6a8ef5d9bb9f3cb43a10fd091bbc5c5
2023-01-10 11:12:17 +08:00
Caesar Wang
daf6b63482 drm/rockchip: inno_hdmi: support the aclk_vio clock for rk3036
The aclk_vio is the vio noc, the HDMI accessed the register
need this clock enabled first. If not, VOP iommu errors will
also occur.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ib3073b73020e46c7d31b09225dd2bd39a289a4cc
2023-01-10 10:49:55 +08:00
Damon Ding
588df8ccd6 dt-bindings: display: inno_hdmi: add aclk assignment in hdmi node
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I8be6bcac5de9d3a1ae03e35c09ef4c925f5a1ef4
2023-01-10 10:49:55 +08:00
Jon Lin
d8c3ffb8d6 mtd: spi-nor: xtx: Support xt25f256b
Change-Id: Id6b61e57c2ca81388a7312b07481afd1a9c52945
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-01-10 10:38:52 +08:00
Greg Kroah-Hartman
7c31ae524c ANDROID: allmodconfig: disable WERROR
-Werror still fails on some arm and arm64 code due to clang issues
(works on gcc!), so disable it when building allmodconfig builds for
now.

Hopefully the clang developers will work on this...

Bug: 199872592
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6ccc856773c40e3c0f541a1316b20e9ae3de4380
(cherry picked from commit eb57c31115)
Signed-off-by: Alistair Delva <adelva@google.com>
2023-01-09 19:34:08 +00:00
Linus Torvalds
824c55581d UPSTREAM: Enable '-Werror' by default for all kernel builds
... but make it a config option so that broken environments can disable
it when required.

We really should always have a clean build, and will disable specific
over-eager warnings as required, if we can't fix them.  But while I
fairly religiously enforce that in my own tree, it doesn't get enforced
by various build robots that don't necessarily report warnings.

So this just makes '-Werror' a default compiler flag, but allows people
to disable it for their configuration if they have some particular
issues.

Occasionally, new compiler versions end up enabling new warnings, and it
can take a while before we have them fixed (or the warnings disabled if
that is what it takes), so the config option allows for that situation.

Hopefully this will mean that I get fewer pull requests that have new
warnings that were not noticed by various automation we have in place.

Knock wood.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3fe617ccaf)
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: If981f26ebe668be7c727661fede10215c4ee5bc5
2023-01-09 19:34:08 +00:00
Zefa Chen
38da82854c media: rockchip: vicap add mutex lock for get dev stream cnt
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I33aba35e029a02b4b8dfb5016f44943358565b8f
2023-01-09 19:48:50 +08:00
Shaohan Yao
1e244fb37e thermal: rockchip: Support the rk3528 SoC in thermal driver
There are one Temperature Sensor on rk3528, channel 0 is for chip.

Signed-off-by: Shaohan Yao <shaohan.yao@rock-chips.com>
Change-Id: Ib5bbb81615fe9fab80f26cdd2098cfb56746ca15
2023-01-09 19:33:47 +08:00
Zefa Chen
bd548c0a79 media: rockchip: vicap: add mutex lock for v4l2 pipeline get/put
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ia989121b9320a33f94bb51b7692ac56dbbae3d36
2023-01-09 19:24:16 +08:00
Zefa Chen
66eaffb030 media: rockchip: vicap disable capture and dma enable bit in fs intr
when app stop stream

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I9187b2f3ffa061bc30fb76f9dbfda5cacabfb920
2023-01-09 19:23:58 +08:00
Zefa Chen
860506945e media: rockchip: vicap write stop dma and capture enable register earlier
to make sure it take effect in next frame start

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I4e57ccba704abb9c9a6700f27d5786cb694215dc
2023-01-09 19:23:31 +08:00
Wu Bo
447ba7ae75 ANDROID: GKI: VIVO: Add a symbol to symbol list
Add 'dentry_path_raw' symbol to support some monitoring tools.
This patch does not add or remove symbol from xml file.

Bug: 264831214
Change-Id: I2b5aaa2945c5fd0ebe4062915b53407251a6ab77
Signed-off-by: Wu Bo <bo.wu@vivo.com>
2023-01-09 10:56:55 +00:00
Eric Biggers
91e4675508 ANDROID: fips140: add crypto_memneq() back to the module
crypto_memneq() is one of the utility functions that was intentionally
included in the fips140 module, out of concerns that it would be seen as
"cryptographic" and thus would be required to be included the module for
the FIPS certification.  It should not have been removed from the
module, so add it back.

Bug: 188620248
Fixes: 18cd39b706 ("Merge tag 'android12-5.10.136_r00' into android12-5.10")
Change-Id: I8a19dfd73390f8c1348885f97fa42d900e47b82b
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-01-09 10:55:19 +00:00
Jon Lin
17e8848752 PCI: rockchip: dw: Add mask for the irq handler DMA interrupt status
When the DMA interrupt masked, the conresbonding DMA interrupt stastus
should be ignored in the interrupt handler.

Change-Id: I76a2b8bef08e024f76792c765150c3e5a0ff804e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-01-09 15:25:23 +08:00
Cai YiWei
2e8cb1629d media: rockchip: isp: fix output stream sync for readback mode
Change-Id: I189c64139a2ebf44f3e0c5f091fd4bc776e2047c
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2023-01-09 14:59:13 +08:00
Chi Wu
973a5a0522 UPSTREAM: mm/page-writeback: Fix performance when BDI's share of ratio is 0.
Fix performance when BDI's share of ratio is 0.

The issue is similar to commit 74d3694433 ("writeback: Fix
performance regression in wb_over_bg_thresh()").

Balance_dirty_pages and the writeback worker will also disagree on
whether writeback when a BDI uses BDI_CAP_STRICTLIMIT and BDI's share
of the thresh ratio is zero.

For example, A thread on cpu0 writes 32 pages and then
balance_dirty_pages, it will wake up background writeback and pauses
because wb_dirty > wb->wb_thresh = 0 (share of thresh ratio is zero).
A thread may runs on cpu0 again because scheduler prefers pre_cpu.
Then writeback worker may runs on other cpus(1,2..) which causes the
value of wb_stat(wb, WB_RECLAIMABLE) in wb_over_bg_thresh is 0 and does
not writeback and returns.

Thus, balance_dirty_pages keeps looping, sleeping and then waking up the
worker who will do nothing. It remains stuck in this state until the
writeback worker hit the right dirty cpu or the dirty pages expire.

The fix that we should get the wb_stat_sum radically when thresh is low.

Link: https://lkml.kernel.org/r/20210428225046.16301-1-wuchi.zero@gmail.com
Change-Id: I920e60cd938049641eda70885b069e36200fe153
Signed-off-by: Chi Wu <wuchi.zero@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Jens Axboe <axboe@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit ab19939a6a)
2023-01-08 15:01:36 +08:00
Kever Yang
b460d3c09a ANDROID: GKI: rockchip: Update module fragment and symbol list
Add fragment need by rockchip platform and sync the symbol list to the
latest source code.
This patch does not add or remove symbol from xml file.

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I54e37e865124cbc7f70646481ca798e27fcc4706
2023-01-07 02:53:56 +00:00
Kever Yang
91e760f1f2 ANDROID: GKI: rockchip: Enable symbols for HDMIRX
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function bool v4l2_find_dv_timings_cap(v4l2_dv_timings*, const v4l2_dv_timings_cap*, unsigned int, v4l2_check_dv_timings_fnc*, void*)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I45009e2791f99b65476daafaff343df33af72433
2023-01-07 02:53:56 +00:00
Kever Yang
1960d4cfad ANDROID: GKI: rockchip: Enable symbols for Ethernet
Leaf changes summary: 28 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 28 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

28 Added functions:

  [A] 'function void ethtool_convert_legacy_u32_to_link_mode(unsigned long int*, u32)'
  [A] 'function bool ethtool_convert_link_mode_to_legacy_u32(unsigned int*, const unsigned long int*)'
  [A] 'function int flow_block_cb_setup_simple(flow_block_offload*, list_head*, flow_setup_cb_t*, void*, void*, bool)'
  [A] 'function void flow_rule_match_basic(const flow_rule*, flow_match_basic*)'
  [A] 'function void flow_rule_match_ipv4_addrs(const flow_rule*, flow_match_ipv4_addrs*)'
  [A] 'function void flow_rule_match_ports(const flow_rule*, flow_match_ports*)'
  [A] 'function void netdev_rss_key_fill(void*, size_t)'
  [A] 'function page* page_pool_alloc_pages(page_pool*, gfp_t)'
  [A] 'function page_pool* page_pool_create(const page_pool_params*)'
  [A] 'function void page_pool_destroy(page_pool*)'
  [A] 'function void page_pool_put_page(page_pool*, page*, unsigned int, bool)'
  [A] 'function void page_pool_release_page(page_pool*, page*)'
  [A] 'function void phylink_disconnect_phy(phylink*)'
  [A] 'function int phylink_ethtool_get_eee(phylink*, ethtool_eee*)'
  [A] 'function void phylink_ethtool_get_pauseparam(phylink*, ethtool_pauseparam*)'
  [A] 'function void phylink_ethtool_get_wol(phylink*, ethtool_wolinfo*)'
  [A] 'function int phylink_ethtool_ksettings_get(phylink*, ethtool_link_ksettings*)'
  [A] 'function int phylink_ethtool_ksettings_set(phylink*, const ethtool_link_ksettings*)'
  [A] 'function int phylink_ethtool_nway_reset(phylink*)'
  [A] 'function int phylink_ethtool_set_eee(phylink*, ethtool_eee*)'
  [A] 'function int phylink_ethtool_set_pauseparam(phylink*, ethtool_pauseparam*)'
  [A] 'function int phylink_ethtool_set_wol(phylink*, ethtool_wolinfo*)'
  [A] 'function int phylink_get_eee_err(phylink*)'
  [A] 'function void phylink_mac_change(phylink*, bool)'
  [A] 'function int phylink_mii_ioctl(phylink*, ifreq*, int)'
  [A] 'function int phylink_speed_down(phylink*, bool)'
  [A] 'function int phylink_speed_up(phylink*)'
  [A] 'function void phylink_stop(phylink*)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I6adf45c9a7159ef07a1913222248128afc0dcccb
2023-01-07 02:53:56 +00:00
Kalesh Singh
529351c4c8 ANDROID: Re-enable fast mremap and fix UAF with SPF
SPF attempts page faults without taking the mmap lock, but takes the
PTL. If there is a concurrent fast mremap (at PMD/PUD level), this
can lead to a UAF as fast mremap will only take the PTL locks at the
PMD/PUD level. SPF cannot take the PTL locks at the larger subtree
granularity since this introduces much contention in the page fault
paths.

To address the race:
  1) Only try fast mremaps if there are no users of the VMA. Android
     is concerned with this optimization in the context of
     GC stop-the-world pause. So there are no other threads active
     and this should almost always succeed.
  2) Speculative faults detect ongoing fast mremaps and fallback
     to conventional fault handling (taking mmap read lock).

Bug: 263177905
Change-Id: I23917e493ddc8576de19883cac053dfde9982b7f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-01-06 13:08:36 -08:00
Kalesh Singh
c67f268c84 Revert "ANDROID: Make SPF aware of fast mremaps"
This reverts commit 134c1aae43.

Reason for revert: vts_linux_kselftest_arm_64 timeout

Bug: 263479421
Bug: 263177905
Change-Id: I123c56741c982d1539ceebd8bfde2443871aa1de
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-01-06 13:07:18 -08:00
Wei Liu
1351459097 ANDROID: GKI: Update symbols to symbol list
Update symbols to symbol list externed by oppo network group.

1 Added function:

  [A] 'function int __rtnl_link_register(rtnl_link_ops*)'

Bug: 193384408

Signed-off-by: Wei Liu <liuwei.a@oppo.com>
Change-Id: Ibd8f74fa1f3b68047f6fed9b5c4154c51f23b821
2023-01-06 19:41:17 +00:00
Eric Biggers
fe60669d03 ANDROID: fips140: add dump_jitterentropy command to fips140_lab_util
For the entropy analysis, we must provide some output from the Jitter
RNG: a large amount of output from one instance, and a smaller amount of
output from each of a certain number of instances.

The original plan was to use a build of the userspace jitterentropy
library that matches the kernel's jitterentropy_rng as closely as
possible.  However, it's now being requested that the output be gotten
from the kernel instead.

Now that fips140_lab_util depends on AF_ALG anyway, it's straightforward
to dump output from jitterentropy_rng instances using AF_ALG.
Therefore, add a command dump_jitterentropy which supports this.

Bug: 188620248
Change-Id: I78eb26250e88f2fc28fc44aa201acbe5b84df8bb
Signed-off-by: Eric Biggers <ebiggers@google.com>
(cherry picked from commit dc01503266)
2023-01-06 19:08:16 +00:00
Bing-Jhong Billy Jheng
6d015667ce UPSTREAM: io_uring: add missing item types for splice request
Splice is like read/write and should grab current->nsproxy, denoted by
IO_WQ_WORK_FILES as it refers to current->files as well

Change-Id: I94a99fdef5764e7eda5da778b5b52a150b9fe5eb
Signed-off-by: Bing-Jhong Billy Jheng <billy@starlabs.sg>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 75454b4bbf)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-01-06 09:35:59 +00:00
Xing Zheng
a0ae2bdfc0 Revert "ASoC: codecs: rv1106_codec: use interface set_sysclk to set clk"
This reverts commit 59f45fdccd.

The reason for revert this patch is that mclk_acodec_tx usually keeps
div1 and follows the same value as mclk_i2s0_8ch_tx.

If the DUT is just powered on, the current acodec clk is usually an
uninitialized value (such as 12MHz). At this time, an audio with a
sampling rate of 16kHz needs to be played, and mclk needs 4.096MHz.
The codec set_sysclk() is configured before cpu i2s_sysclk(), set a
div 3 based on target freq 4.096MHz, and then set cpu i2s_sysclk() to
correct the frequency division ratio of parent clock according to
target freq 4.096MHz, and getting the wrong results:

- mclk_i2s0_8ch_tx = 4096000kHz
- mclk_acodec_tx = 1365334kHz

Before:
    pll_gpll                          1        1        0  1188000000          0     0  50000
       gpll                          11       11        0  1188000000          0     0  50000
          clk_i2s0_8ch_tx_src         1        1        0   594000000          0     0  50000
             clk_i2s0_8ch_tx_frac     1        1        0     4096000          0     0  50000
                clk_i2s0_8ch_tx       1        1        0     4096000          0     0  50000
                   mclk_i2s0_8ch_tx   2        2        0     4096000          0     0  50000
                      mclk_sai        0        0        0     4096000          0     0  50000
                      mclk_dsm        0        0        0     4096000          0     0  50000
                      mclk_acodec_tx  1        1        0     1365334          0     0  50000

Fixed:
    pll_gpll                          1        1        0  1188000000          0     0  50000
       gpll                          11       11        0  1188000000          0     0  50000
          clk_i2s0_8ch_tx_src         1        1        0   594000000          0     0  50000
             clk_i2s0_8ch_tx_frac     1        1        0     4096000          0     0  50000
                clk_i2s0_8ch_tx       1        1        0     4096000          0     0  50000
                   mclk_i2s0_8ch_tx   2        2        0     4096000          0     0  50000
                      mclk_sai        0        0        0     4096000          0     0  50000
                      mclk_dsm        0        0        0     4096000          0     0  50000
                      mclk_acodec_tx  1        1        0     4096000          0     0  50000

Therefore, we only need to set_sysclk() once on the rockchip i2s driver.

Change-Id: I8e3d32ec1061166faa8188e6288934867880ab48
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2023-01-06 16:01:51 +08:00
Xing Zheng
683a2c4e02 Revert "ARM: dts: rockchip: rv1106: delete unused clk info of acodec"
This reverts commit 7fdefc3445.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: I5c14327b0de0408af5e16a30891189982dc2bc31
2023-01-06 16:01:51 +08:00
Tao Huang
57aa44569b arm64: dts: rockchip: rk3308: remove g-use-dma from rockchip usb nodes
According to upstream commit e9b6044dce ("arm64: dts: remove g-use-dma
from rockchip usb nodes").

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Iffe9e52c68507b7bea2ab86306519910a2db9d16
2023-01-06 15:12:38 +08:00