Commit Graph

1245246 Commits

Author SHA1 Message Date
Jiri Rezler
ffc0f6ce26 AAUTO-1941 SBOM file has been added. 2025-05-20 10:20:47 +02:00
Frantisek Prochaska
12eb3bad69 AAUTO-1926 add imx95-19x19-verdin-rpmsg-car.dts for i2c through SRTM 2025-05-13 17:06:16 +02:00
Frantisek Prochaska
5274e8a438 AAUTO-1926 forward EVS i2c-3 through SRTM 2025-05-13 10:05:26 +02:00
Frantisek Prochaska
ab7fe4936d AAUTO-1889 Enable RPI_CAM_MIPI (ap1302) in Android car device-tree 2025-04-29 17:10:43 +02:00
Jiri Rezler
6c792bdad1 AAUTO-1856 Car image type has been supported for imx95 Verdin board. 2025-04-28 11:21:55 +02:00
Jiri Rezler
5649b17443 AAUTO-1879 DMA error interrupt vector type has been added for imx8q SOF cs42888 functionality. 2025-03-31 15:06:01 +02:00
Laurentiu Palcu
16dc360c0c LF-14222-2 media/i2c: ox03c10: introduce standard controls
This adds standard controls for exposure, analogue gain and digital gain
which will temporarily work in parallel with the custom ones.
Eventually, the custom controls will be removed and only the standard
ones will be used.

The new controls, however, needs a complicated distribution function
that takes all 3 user provided values of exposure, analogue gain and
digital gain as inputs and computes the proper values that will be
written to the sensor registers.

In order to make this process a little more efficient and avoid writing
the same registers 3 times, add a caching mechanism that will avoid
writing a register if its value didn't change.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2025-03-25 17:02:07 +01:00
Laurentiu Palcu
48496abaa1 LF-14222-1 media/i2c: ox03c10: add a few helper functions
Add group-hold helper functions for the exposure and gain setting
routines to prepare for the next patches where we need to be able to set
exposure and gains within one single group-hold.

Also, only use group-hold 0 for all operations since the controls are
serialized anyway.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2025-03-25 17:02:07 +01:00
Jiri Rezler
d4c97505f5 Merge branch 'lf-6.6.y_android' into dev_automotive-15.0_1.3.0 2025-03-06 15:20:39 +01:00
Jiri Rezler
9143b16764 AAUTO-1844 Multi display functionality on imx8QM has been aligned with Android standard.
MIPI_DSI outputs are enabled on imx8QM by default, "md" u-boot and dtbo must be used for physical HDMI display output only (Car2 image type).
2025-03-04 13:39:11 +01:00
Zhang Bo
758ad1ac4e MA-20997[Android] change EPDC update mode as partial update to avoid screen flashing when update
The UPDATE_MODE_FULL update mode will cause screen flashing one time when update UI.
Now change to UPDATE_MODE_PARTIAL mode to avoid flashing, but the screen maybe dirty
after update UI some times.

Change-Id: If02e60e7af441fb9939528e7345ba134f3573c43
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
2025-03-03 16:24:03 +09:00
Frantisek Prochaska
92002780fc v4l2-subdev.c - reduce amount of printk calls when stream is already enabled by WARN_ON_ONCE 2025-02-27 16:13:58 +01:00
Alexi Birlinger
e44a94005f ILIE-154: media: nxp: neoisp: Update try_fmt to adapt color space configuration
In try_fmt function the color space selection has been added
depending on the incoming configuration from user space.
It selects a valid colorspace by its name or a default one if
incoming configuration is not appropriate. Only default transfer
function, encoding and quantization are supported.

GCM unit uses the configuration from the color space to
define the related registers accordingly.

Change-Id: Ic864e39e2a84ee9bf5063f9ebd7eeac9404490b1
Signed-off-by: Alexi Birlinger <alexi.birlinger@nxp.com>
Reviewed-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2025-02-08 21:43:49 +08:00
Petr Ondracek
7284f0602a AAUTO-1680 Fix of random temperature changes in HVAC after switching power button on/off 2025-02-04 10:50:29 -05:00
Frantisek Prochaska
1311b6b874 AAUTO-1396 - Device-tree: the ov10635 camera moved from isi0-3 to isi1-3,5 2025-01-31 09:41:19 +01:00
Petr Ondracek
853963562d AAUTO-1647 Fix of Area IDs for temperatures messages from vehicle-dummy -> HVAC 2025-01-28 04:47:00 -05:00
Zhipeng Wang
4d40bf34d2 Merge remote-tracking branch 'aosp/android15-6.6-2025-01' into nxp-linux-sdk/lf-6.6.y_android 2025-01-23 17:56:28 +09:00
He Zhai
4b9d87d43c MA-23391 [IMX8Q] VPU/DPU driver probe requires trusty driver probe complete
When all drivers are built in, the trusty driver will probe after
the vpu/dpu driver probe, which will result in a trusty dump. To solve
this issue, the vpu/dpu driver needs to determine whether the trusty
driver probe successfully before calling the trusty api, otherwise the
probe will be deferred.

Change-Id: I2cd20424e9c70dfff478096b28dfef2ca6eeb816
Signed-off-by: He Zhai <zhai.he@nxp.com>
2025-01-23 17:12:31 +09:00
Chloe Sun
75d7cc4ec1 MA-23385 [#imx-3317] 0007-CL1074519-KERNEL-SPACE-IMX-3201-Fix-the-tracepoint-g.
This picks vsi patch CL1074519 [KERNEL SPACE] [IMX-3201]: Fix the tracepoint gpu_period_work
to pass Android CTS CtsAngleIntegrationHost TestCases group. [Ying.Zhang]

Fix CtsGpuMetricsHostTestCases com.android.cts.graphics.GpuWorkDumpsysTest#testOutputFormat

Change-Id: I624e0d250529364cdc3acff9e01a3bac1d4448a0
Signed-off-by: Chloe Sun <dandan.sun@nxp.com>
2025-01-21 18:05:56 +08:00
Zhou Peng
18e9a68856 LF-14462: arm64: mxc: vpu: Add 'identical size ranges' feature for vpu encoder
Change maximum height from 2304 to 4096 to support maximum resolution
4096x4096

Change-Id: Ic96e3f4b5302c25d12616489800775373756ece9
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2025-01-20 14:37:52 +08:00
Qun-Wei Lin
9f047a51b3 UPSTREAM: mm: krealloc: Fix MTE false alarm in __do_krealloc
commit 704573851b upstream.

This patch addresses an issue introduced by commit 1a83a716ec ("mm:
krealloc: consider spare memory for __GFP_ZERO") which causes MTE
(Memory Tagging Extension) to falsely report a slab-out-of-bounds error.

The problem occurs when zeroing out spare memory in __do_krealloc. The
original code only considered software-based KASAN and did not account
for MTE. It does not reset the KASAN tag before calling memset, leading
to a mismatch between the pointer tag and the memory tag, resulting in a
false positive.

Example of the error:
==================================================================
swapper/0: BUG: KASAN: slab-out-of-bounds in __memset+0x84/0x188
swapper/0: Write at addr f4ffff8005f0fdf0 by task swapper/0/1
swapper/0: Pointer tag: [f4], memory tag: [fe]
swapper/0:
swapper/0: CPU: 4 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.
swapper/0: Hardware name: MT6991(ENG) (DT)
swapper/0: Call trace:
swapper/0:  dump_backtrace+0xfc/0x17c
swapper/0:  show_stack+0x18/0x28
swapper/0:  dump_stack_lvl+0x40/0xa0
swapper/0:  print_report+0x1b8/0x71c
swapper/0:  kasan_report+0xec/0x14c
swapper/0:  __do_kernel_fault+0x60/0x29c
swapper/0:  do_bad_area+0x30/0xdc
swapper/0:  do_tag_check_fault+0x20/0x34
swapper/0:  do_mem_abort+0x58/0x104
swapper/0:  el1_abort+0x3c/0x5c
swapper/0:  el1h_64_sync_handler+0x80/0xcc
swapper/0:  el1h_64_sync+0x68/0x6c
swapper/0:  __memset+0x84/0x188
swapper/0:  btf_populate_kfunc_set+0x280/0x3d8
swapper/0:  __register_btf_kfunc_id_set+0x43c/0x468
swapper/0:  register_btf_kfunc_id_set+0x48/0x60
swapper/0:  register_nf_nat_bpf+0x1c/0x40
swapper/0:  nf_nat_init+0xc0/0x128
swapper/0:  do_one_initcall+0x184/0x464
swapper/0:  do_initcall_level+0xdc/0x1b0
swapper/0:  do_initcalls+0x70/0xc0
swapper/0:  do_basic_setup+0x1c/0x28
swapper/0:  kernel_init_freeable+0x144/0x1b8
swapper/0:  kernel_init+0x20/0x1a8
swapper/0:  ret_from_fork+0x10/0x20
==================================================================

Bug: 390070977
Bug: 391031881
(cherry picked from commit 704573851b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
linux-6.6.y)
Fixes: 1a83a716ec ("mm: krealloc: consider spare memory for __GFP_ZERO")
Signed-off-by: Qun-Wei Lin <qun-wei.lin@mediatek.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Seiya Wang <seiya.wang@mediatek.com>
Change-Id: Iea0ba629183042d594665ab51b410965963d167e
(cherry picked from commit 6b18f0b574ab3267615ae6ce642d5a7c3c21ac09)
(cherry picked from commit e087ce9a44c0671bf11e86df937821aed4ce995b)
2025-01-19 17:41:46 -08:00
Jessie Hao
4e2033e792 MA-23378-10 refine code format for gpu-viv
This sync code changes in rel_6.4.11.p3_20241216.

Change-Id: I83fcfb9931369b02e13822e04146b68333a6433a
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:14:45 +08:00
Jessie Hao
98f8713120 MA-23378-9 CL999762 [KERNEL SPACE] NXP: Remove no_llseek for kernel 6.11.
This pick the below patch in rel_6.4.11.p3_20241216.
18d7393af1 CL999762 [KERNEL SPACE] NXP: Remove no_llseek for kernel
6.11. [Kaiwen.Sheng]

Change-Id: I48aaccf13b8e6dcdc7408296089052c726e634e6
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:11:59 +08:00
Jessie Hao
d7ef060976 MA-23378-8 IMX-3339 CL997929 Merge customer's fix patch. Correct gpu physSize from dtb.
This pick the below patch in rel_6.4.11.p3_20241216.
f191e5d133 IMX-3339 CL997929 [KERNEL SPACE] [22q2_nxp/64x/7x]:
[IMX-3339]: Merge customer's fix patch. Correct gpu physSize from dtb.
[Ying.Zhang]

Change-Id: I10ecc5bdea749a8bd81dd2c0cfef8e76b4db9f5b
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:10:57 +08:00
Jessie Hao
d2fa550dbb MA-23378-7 IMX-3332 CL979108 [KERNEL SPACE] Fix build errors with linux-next kernel 6.10.
This pick the below patch in rel_6.4.11.p3_20241216.
970ed09249 IMX-3332 CL979108 [KERNEL SPACE] [22Q2_NXP]: [IMX-3332] Fix
build errors with linux-next kernel 6.10. [Ying.Zhanag]

Change-Id: I8ea954c0a9f3f621591c00ae5a6be3ea549241d0
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:10:02 +08:00
Jessie Hao
f238236010 MA-23378-6 CL1002665 [KERNEL SPACE] NXP: Update previous cl 1002206. Change kernel version from 6.11 to 6.12 and from 6.9 to 6.10.
This pick the below patch in rel_6.4.11.p3_20241216.
379b828131 CL1002665 [KERNEL SPACE] NXP: Update previous cl 1002206.
Change kernel version from 6.11 to 6.12 and from 6.9 to 6.10.
[Kaiwen.Sheng]

Change-Id: If89d07fb79e599cfc8c7ebd84cde065d183ba4b9
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:08:54 +08:00
Jessie Hao
62e4c7377c MA-23378-5 CL983054 [KERNEL SPACE] [NXP]: Merging CL978351: Move FMODE_UNSIGNED_OFFSET to fop_flags for linux-6.11
This pick the below patch in rel_6.4.11.p3_20241216.
ff6be4076a CL983054 [KERNEL SPACE] [NXP]: Merging CL978351: Move
FMODE_UNSIGNED_OFFSET to fop_flags for linux-6.11. [Tianyu.Wu]

Change-Id: I215ea8f0b26936583e3599e85d710c600dff4309
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:07:55 +08:00
Jessie Hao
b938ce15a4 MA-23378-4 CL1002206 [KERNEL SPACE] NXP: Replace with follow_pfnmap APIs for kernel 6.11/6.9
This pick the below patch in rel_6.4.11.p3_20241216.
d05512eb28 CL1002206 [KERNEL SPACE] NXP: Replace with follow_pfnmap APIs
for kernel 6.11 and replace with follow_pte for kernel 6.9.
[Kaiwen.Sheng]

Change-Id: I7666c487000bebec80878a0d1a3dabbf5e7d1b0a
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:04:07 +08:00
Jessie Hao
ecc92bc7af MA-23378-3 [KERNEL SPACE] Update copyright
This pick the below patch in rel_6.4.11.p3_20241216.
02e55bbed6 [KERNEL SPACE] Update copyright

Change-Id: Ib4ba2ed9a8c716d1308e987a4f9e6371df981a02
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:03:11 +08:00
Jessie Hao
fac75659bc MA-23378-2 CL825001 [KERNEL SPACE] [NXP]: Fix a build issue when CAPTURE_ONLY_MODE is set to 1.
This pick the below patch in rel_6.4.11.p3_20241216.
4f4e3b85f1 CL825001 [KERNEL SPACE] [NXP]: Fix a build issue when
CAPTURE_ONLY_MODE is set to 1. By Shiheng.Zhou

Change-Id: Ib136d546a5740ed062e0e82a5c32c3047aaa921b
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:02:30 +08:00
Jessie Hao
ff0082ddd6 MA-23378-1 CL868804 [KERNEL SPACE] 22Q2_NXP: Support CL30 Capture Only Mode.
This pick the below patch in rel_6.4.11.p3_20241216.
7e84f1fc25 CL868804 [KERNEL SPACE] 22Q2_NXP: Support CL30 Capture Only
Mode.

Change-Id: Iadcb5c3caa3a1a201f1dc66f9ec9a1e0b8efd6a8
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 18:01:02 +08:00
Jessie Hao
a6bc3afb42 MA-23378 CL775297 [KERNEL SPACE] 22Q2_NXP: Make capture only work on Wayland alpha version.
This pick the below patch in rel_6.4.11.p3_20241216.
ac4da795ec CL775297 [KERNEL SPACE]  22Q2_NXP: Make capture only work on
Wayland alpha version.

Change-Id: I97e8ce5f3ff902f1123763c8840f26d13c9ecc65
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
2025-01-17 17:58:13 +08:00
Nas Chung
474e56a70e MA-23263 wave6: Allow 2x2 cropping size for the encoder.
The driver allows a 2x2 alignment crop size,
which does not adhere to the Wave6 hardware limitations.
However, the driver still encodes the crop size
according to the Wave6 hardware limitations.
Instead, it includes the conf_win info in the SPS
to indicate the exact crop size.
Driver should report the exact crop size in CAPTURE buffer.

Change-Id: I3978da4a013ea9fbf87865a51f1cd765f5532f58
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
2025-01-17 10:28:19 +08:00
yunjie
7cb7a9c046 MA-23333 [Android-15] enable LE audio on 8MM and 95 15*15
Reason: UART3 on 8MM has been disabled in commit 68da6a9fd2, this port
will be used in LE Audio, so enable it in imx8mm-evk-iw612.dts
Tested: on 8MM

Change-Id: I756f8c0bb377b3cc74d443e51edfe6051aec518b
Signed-off-by: yunjie <yunjie.jia@nxp.com>
2025-01-16 10:29:40 +00:00
Tao Jiang
f086b7525d LF-14314: arm64: vpu : hantro: h1 improve crop accuracy
For AVC and HEVC format, support 2x2 pixel alignment
For VP8 format, support 1x1 pixel alignment

Change-Id: I8fae851f80d85f556e34b8b979b1fb2177fb3c03
Signed-off-by: Tao Jiang <nxf88235@lsv051605.swis.nl-cdc01.nxp.com>
2025-01-14 10:23:46 +08:00
Ming Qian
ea7e897091 MA-23268-8: mxc: vpu: hantro_v4l2: Increase sequence for frame buffer
Ignore the last empty buffer, otherwise it may fail the android case

Change-Id: Icc3eab88ebc5572685c434b1158d7911f23bf1c7
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
2025-01-10 15:34:36 +09:00
Ming Qian
ae1fb2b610 MA-23268-7: mxc: vpu: hantro_v4l2: Support DEC_CMD_START for colorspace change
When colorspace change, the resolution or the dpb amount are not
changed. don't need to streamoff capture, just use DEC_CMD_START to
finish source change flow.

Change-Id: I60f286dc0f4848748081e2e91766eb919a3feb3b
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
2025-01-10 15:34:30 +09:00
Ming Qian
bce1bcb464 MA-23268-6: media: amphion: clear last_buffer_dequeued flag for DEC_START cmd
Clear last_buffer_dequeued flag for DEC_CMD_START, as client may use
this cmd to finish source change flow.

Change-Id: Iffd84e5bd58b9cc857bebad188523827aba77f50
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
2025-01-10 11:45:34 +09:00
Ming Qian
390b23bc36 MA-23268-5: media: amphion: Trigger source change if colorspace chagned
Follow source change follow if only colorspace is changed, but not the
resolution or dbp amount.

Change-Id: I50025dbc8abcdcd454c7b88cfd370c4e47b90527
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
2025-01-10 11:45:27 +09:00
Ming Qian
6cec36edbf MA-23237-2: mxc: vpu: wave6: Support decoding size up to 4096x4096
The wave6 decoder support identical size ranges horizontally as
vertically.

Change-Id: Ie5e278b0d5bc9d6e5da8780628da7cba65c81660
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Ming Zhou <ming.zhou@nxp.com>
2025-01-09 17:06:06 +08:00
Ming Zhou
0fceeb32b8 MA-23237: mxc: vpu: hantro_v4l2: Update supported resolution of hantro decoder.
The hantro decoder can support identical size ranges horizontally as
vertically.

Change-Id: I9c7dcc4345e91129324a79594bd0004e1bc5b8ae
Signed-off-by: Ming Zhou <ming.zhou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
2025-01-09 17:03:48 +08:00
Ming Qian
36c3ad4d2e MA-23268: mxc: vpu: wave6: Handle colorspace change
When colorspace change, but size is not changed, firmware still trigger
a source chagne event.
Implement decoder start cmd.

Then we can follow the dynamic resolution flow to handle colorspace
change.

Change-Id: If0d7a0d14ce9f7d1deaf62e54981c47fda9e5d1a
Signed-off-by: Ming Qian <ming.qian@nxp.com>
2025-01-08 17:47:32 +09:00
Zhipeng Wang
668e2e8ac7 Merge remote-tracking branch 'aosp/android15-6.6-2025-01' into nxp-linux-sdk/lf-6.6.y_android
Conflicts:
	BUILD.bazel
	drivers/net/ethernet/freescale/enetc/enetc.c
	drivers/remoteproc/imx_rproc.c
	drivers/usb/typec/tcpm/tcpm.c
2025-01-07 18:35:05 +09:00
Todd Kjos
217cec2d03 ANDROID: Initialize android15-6.6-2025-01
Bug: 383669484
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Icc49e9fa197ecbbd6a974f7df2791de75b548989
2025-01-06 17:08:33 +00:00
Jiri Rezler
0f0e5fd429 Merge branch 'lf-6.6.y_android' into dev_automotive-15.0_1.1.0 2025-01-06 15:21:39 +01:00
Richard Chang
17640c12bf BACKPORT: UPSTREAM: mm: add alloc_contig_migrate_range allocation statistics
alloc_contig_migrate_range has every information to be able to understand
big contiguous allocation latency.  For example, how many pages are
migrated, how many times they were needed to unmap from page tables.

This patch adds the trace event to collect the allocation statistics.  In
the field, it was quite useful to understand CMA allocation latency.

[akpm@linux-foundation.org: a/trace_mm_alloc_config_migrate_range_info_enabled/trace_mm_alloc_contig_migrate_range_info_enabled]
Link: https://lkml.kernel.org/r/20240228051127.2859472-1-richardycc@google.com
Signed-off-by: Richard Chang <richardycc@google.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org.
Cc: Martin Liu <liumartin@google.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 315897534
(cherry picked from commit c8b3600312)
[richardycc: slight modification for android change 0de2f42977]
Change-Id: If6c3cd106201fd13683d1dd5afdfa62a48a4dd3b
Signed-off-by: Richard Chang <richardycc@google.com>
2025-01-05 19:37:39 -08:00
Paul Moore
37c8296ce6 UPSTREAM: selinux: improve error checking in sel_write_load()
Move our existing input sanity checking to the top of sel_write_load()
and add a check to ensure the buffer size is non-zero.

Move a local variable initialization from the declaration to before it
is used.

Minor style adjustments.

Reported-by: Sam Sun <samsun1006219@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

Bug: 386755977
Change-Id: I76ec20258a8ef8a2966e98d523b58a0aa8b49bda
(cherry picked from commit 42c7732380)
Signed-off-by: yaozhongmin <yaozhongmin@xiaomi.com>
2025-01-04 11:42:11 -08:00
Chunhai Guo
7c5518bc0a ANDROID: GKI: update symbol list for vivo
1 variable symbol(s) added
  'struct utf8data_table tf8_data_table_new'

Bug: 387229724
Bug: 382800956

Change-Id: I550db0dad74ff5fcfe34de7708b6b6118d21a477
Signed-off-by: Chunhai Guo <guochunhai@vivo.corp-partner.google.com>
2025-01-03 12:03:08 -08:00
Chunhai Guo
59a52ac0e6 ANDROID: unicode: Add symbol for utf8 encoding compatibility for file lookup
Add symbol utf8_data_table_new to ensure compatibility with both new and
old utf8 encoding during file lookup.

Bug: 387229724
Bug: 382800956

Change-Id: I75da2a468ac4a51f7bc907633b9c316a72f2b8c2
Signed-off-by: Chunhai Guo <guochunhai@vivo.corp-partner.google.com>
2025-01-03 12:03:08 -08:00
Akash M
a6fbce8673 FROMGIT: usb: gadget: f_fs: Remove WARN_ON in functionfs_bind
This commit addresses an issue related to below kernel panic where
panic_on_warn is enabled. It is caused by the unnecessary use of WARN_ON
in functionsfs_bind, which easily leads to the following scenarios.

1.adb_write in adbd               2. UDC write via configfs
  =================	             =====================

->usb_ffs_open_thread()           ->UDC write
 ->open_functionfs()               ->configfs_write_iter()
  ->adb_open()                      ->gadget_dev_desc_UDC_store()
   ->adb_write()                     ->usb_gadget_register_driver_owner
                                      ->driver_register()
->StartMonitor()                       ->bus_add_driver()
 ->adb_read()                           ->gadget_bind_driver()
<times-out without BIND event>           ->configfs_composite_bind()
                                          ->usb_add_function()
->open_functionfs()                        ->ffs_func_bind()
 ->adb_open()                               ->functionfs_bind()
                                       <ffs->state !=FFS_ACTIVE>

The adb_open, adb_read, and adb_write operations are invoked from the
daemon, but trying to bind the function is a process that is invoked by
UDC write through configfs, which opens up the possibility of a race
condition between the two paths. In this race scenario, the kernel panic
occurs due to the WARN_ON from functionfs_bind when panic_on_warn is
enabled. This commit fixes the kernel panic by removing the unnecessary
WARN_ON.

Kernel panic - not syncing: kernel: panic_on_warn set ...
[   14.542395] Call trace:
[   14.542464]  ffs_func_bind+0x1c8/0x14a8
[   14.542468]  usb_add_function+0xcc/0x1f0
[   14.542473]  configfs_composite_bind+0x468/0x588
[   14.542478]  gadget_bind_driver+0x108/0x27c
[   14.542483]  really_probe+0x190/0x374
[   14.542488]  __driver_probe_device+0xa0/0x12c
[   14.542492]  driver_probe_device+0x3c/0x220
[   14.542498]  __driver_attach+0x11c/0x1fc
[   14.542502]  bus_for_each_dev+0x104/0x160
[   14.542506]  driver_attach+0x24/0x34
[   14.542510]  bus_add_driver+0x154/0x270
[   14.542514]  driver_register+0x68/0x104
[   14.542518]  usb_gadget_register_driver_owner+0x48/0xf4
[   14.542523]  gadget_dev_desc_UDC_store+0xf8/0x144
[   14.542526]  configfs_write_iter+0xf0/0x138

Fixes: ddf8abd259 ("USB: f_fs: the FunctionFS driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Akash M <akash.m5@samsung.com>
Link: https://lore.kernel.org/r/20241219125221.1679-1-akash.m5@samsung.c
om
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 383235079
(cherry picked from commit dfc51e48bca475bbee984e90f33fdc537ce09699
https: //git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/
usb-linus)
Change-Id: Ib8ec6cbac0ac0601f75ede2911f00baef099cec1
Signed-off-by: Akash M <akash.m5@samsung.com>
2025-01-03 09:36:25 -08:00