id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
5b77261c5510f1e6f4d359e97dd3e39ee7259c3d
Analyze and fix the following issue in the Linux kernel code: sched/topology: Remove the EM_MAX_COMPLEXITY limit
Problem Details: The Energy Aware Scheduler (EAS) estimates the energy consumption of placing a task on different CPUs. The goal is to minimize this energy consumption. Estimating the energy of different task placements is increasingly complex with the size of the platform. To avoid having a slow wake-up path, EAS is ...
```diff diff --git a/Documentation/scheduler/sched-energy.rst b/Documentation/scheduler/sched-energy.rst index fc853c8cc346..70e2921ef725 100644 --- a/Documentation/scheduler/sched-energy.rst +++ b/Documentation/scheduler/sched-energy.rst @@ -359,32 +359,9 @@ in milli-Watts or in an 'abstract scale'. 6.3 - Energy Mode...
38cd5b6a875adc877681faf8e3ad47fdbd6eceb5
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel/pt: Fix kernel-doc comments
Problem Details: Some parameters or return codes were either wrong or missing, update them. Signed-off-by: Lucy Mielke <lucymielke@icloud.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/ZSOjQW3e2nJR4bAo@fedora.fritz.box
```diff diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index 42a55794004a..8e2a12235e62 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -736,6 +736,7 @@ static bool topa_table_full(struct topa *topa) /** * topa_insert_pages() - create a list of ToPA tables * @buf: ...
7ef7145a2b26b172ac6885c4cf3272a38bc0979a
Analyze and fix the following issue in the Linux kernel code: sched/nohz: Update idle load-balancing (ILB) comments
Problem Details: - Fix incorrect/misleading comments, - clarify some others, - fix typos & grammar, - and use more consistent style throughout. Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Link: https://lore.kernel.org/r/20231006102518.2452758-2-ming...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 52c498fd6c46..2b63a14cd05e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11503,14 +11503,15 @@ static inline int on_null_domain(struct rq *rq) #ifdef CONFIG_NO_HZ_COMMON /* - * idle load balancing details - * - When one of the bus...
4db74c0fdeb8138f6438d42a015c5dcdb2e6874c
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs/gaudi2: fix spmu mask creation
Problem Details: event_types_num received from the user can be 0. In that case, the event_mask should be 0. In addition, to create a correct mask we need to match the number of event types to the bit location such that bit 0 represents a single event type, bit 1 represents 2 types and so on. Signed-off-by: Oded Gabba...
```diff diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c b/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c index 14a855cdc96b..2423620ff358 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2_coresight.c @@ -2500,7 +2500,8 @@ static int gaudi2_c...
84190b92cc1fd6cdbcb90b65dedeb32fb49336e7
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix bug in decoder wait for cs completion
Problem Details: The decoder interrupts are handled in the interrupt context same as all user interrupts. In such case, the wait list should be protected by spin_lock_irqsave in order to avoid deadlock that might happen with the user submission flow. Signed-off-by: farah kassabri <fkassabri@habana.ai> Reviewed-by: Ode...
```diff diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index 4f7b70d9754c..3aa6eeef443b 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -3526,7 +3526,7 @@ static int ...
1630d14f8db0f2e41a5e1cd9cc90b41e899d26df
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: minor cosmetic update to habanalabs.h
Problem Details: - Update copyright years - Align fields in struct hl_userptr - Fix comments Signed-off-by: Oded Gabbay <ogabbay@kernel.org> Reviewed-by: Ofir Bitton <obitton@habana.ai>
```diff diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h index a8ccc04e7f92..2a3acdbf9171 100644 --- a/drivers/accel/habanalabs/common/habanalabs.h +++ b/drivers/accel/habanalabs/common/habanalabs.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 * - * Copy...
3824be1f4d4282190e82a9d5113f4079cb0796e9
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: add debug prints to dump content of SG table for dma-buf
Problem Details: Add debug prints to dump the content of the SG table which is prepared when the dma-buf map op is called. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
```diff diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c index 7ddfaf17d15a..c465dc828b0c 100644 --- a/drivers/accel/habanalabs/common/memory.c +++ b/drivers/accel/habanalabs/common/memory.c @@ -1679,6 +1679,13 @@ static struct sg_table *alloc_sgt_from_device_pages(struct...
bb644f61970ad44147c9466b0cb99a028de02138
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix SG table creation for dma-buf mapping
Problem Details: In some cases the calculated number of required entries for the dma-buf SG table is wrong. For example, if the page size is larger than both the dma max segment size of the importer device and from the exported side, or if the exported size is part of a phys_pg_pack that is composed of several pages. I...
```diff diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c index c09c066a0db4..f42cb04b578b 100644 --- a/drivers/accel/habanalabs/common/memory.c +++ b/drivers/accel/habanalabs/common/memory.c @@ -1535,21 +1535,17 @@ static struct sg_table *alloc_sgt_from_device_pages(struc...
0165994c215f321e2d055368f89b424756e340eb
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix bug in timestamp interrupt handling
Problem Details: There is a potential race between user thread seeking to re-use a timestamp record with new interrupt id, while this record is still in the middle of interrupt handling and it is about to be freed. Imagine the driver set the record in_use to 0 and only then fill the free_node information. This might le...
```diff diff --git a/drivers/accel/habanalabs/common/irq.c b/drivers/accel/habanalabs/common/irq.c index f6b6c54bc868..058f27040805 100644 --- a/drivers/accel/habanalabs/common/irq.c +++ b/drivers/accel/habanalabs/common/irq.c @@ -259,8 +259,6 @@ static int handle_registration_node(struct hl_device *hdev, struct hl_use...
e0f452802bdaaf45dcb24080053f2b3a9c7c464a
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix inline doc typos
Problem Details: Fix two typos Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
```diff diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index d9531e434f60..e217ee6d1768 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -639,7 +639,7 @@ static void device_release_func(struct device *dev) * @hdev...
d261b0ab131e2511b70f7bc4a3737d3b90ca6e87
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs/gaudi2: include block id in ECC error reporting
Problem Details: During ECC event handling, Memory wrapper id was mistakenly printed as block id. Fix the print and in addition fetch the actual block-id from firmware. Signed-off-by: Ofir Bitton <obitton@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
```diff diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index d60389b6700f..dca19be42d5f 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -7834,16 +7834,29 @@ static void gaudi2_print_event(struct hl_device *hdev, u1...
571bfeb48ac24564658e58c0a3a5318904846aae
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: refactor deprecated strncpy
Problem Details: `strncpy` is deprecated for use on NUL-terminated destination strings [1]. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on its destination buffer argument which is _not_ the case for `strncpy`! There is likely no bug happening in this case since HL_STR_MA...
```diff diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c index 7e66f623f350..5db9af7e2daf 100644 --- a/drivers/accel/habanalabs/common/habanalabs_drv.c +++ b/drivers/accel/habanalabs/common/habanalabs_drv.c @@ -460,14 +460,14 @@ static int create_hdev(stru...
90f3de616259cbb5666f00f8daf5420cd7d71d18
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines()
Problem Details: snprintf() returns the "number of characters which *would* be generated for the given input", not the size *really* generated. In order to avoid too large values for 'str_size' (and potential negative values for "PSOC_RAZWI_ENG_STR_SIZE - str_size") use scnprintf() instead of snprintf(). Fixes: c0e6d...
```diff diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index e53de95b1791..d60389b6700f 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -8278,11 +8278,11 @@ static int gaudi2_psoc_razwi_get_engines(struct gaudi2_ra...
a45d5cf09d49ed46c1cf1150ed5a891878a161f3
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: refactor deprecated strncpy to strscpy_pad
Problem Details: `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We see that `prop->cpucp_info.card_name` is supposed to be NUL-terminated based on its usage within `__hwmon_device_register()` (wherein it's called "name"): | if (name && (!strlen(name) || strpbrk(name, "-* \t\n"))) | dev_war...
```diff diff --git a/drivers/accel/habanalabs/gaudi/gaudi.c b/drivers/accel/habanalabs/gaudi/gaudi.c index e0f6541eb3d6..29fb71c8b47f 100644 --- a/drivers/accel/habanalabs/gaudi/gaudi.c +++ b/drivers/accel/habanalabs/gaudi/gaudi.c @@ -664,7 +664,7 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev) prop-...
428f6882a6f9fc0521eb2dca5293436d5a041ff3
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix ETR/ETF flush logic
Problem Details: When config_etr or config_etf are called we need to validate the parameters that are passed into them to make sure the requested operation is valid. Signed-off-by: Benjamin Dotan <bdotan@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
```diff diff --git a/drivers/accel/habanalabs/gaudi/gaudi_coresight.c b/drivers/accel/habanalabs/gaudi/gaudi_coresight.c index 3455b14554c6..1168fefa33f4 100644 --- a/drivers/accel/habanalabs/gaudi/gaudi_coresight.c +++ b/drivers/accel/habanalabs/gaudi/gaudi_coresight.c @@ -482,6 +482,11 @@ static int gaudi_config_etf(...
38ed55bc58f72d4180f74fd901e71b16d68641b9
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: update debugfs-driver-habanalabs with the accel path
Problem Details: Replace "/sys/kernel/debug/habanalabs/hl<n>/..." with "/sys/kernel/debug/accel/<n>/...". Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
```diff diff --git a/Documentation/ABI/testing/debugfs-driver-habanalabs b/Documentation/ABI/testing/debugfs-driver-habanalabs index df535780058b..042fd125fbc9 100644 --- a/Documentation/ABI/testing/debugfs-driver-habanalabs +++ b/Documentation/ABI/testing/debugfs-driver-habanalabs @@ -1,4 +1,4 @@ -What: /sys...
10926f60051332a754084d45862afc4e83e597e1
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: set default device release watchdog T/O as 30 sec
Problem Details: After being notified about certain errors, user is expected to finish his post-errors actions and to release the device within some timeout, after which is deice is being reset. The default timeout value is 5 sec, which in some case is not enough for a user application to collect debug data. Increase t...
```diff diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index d7d9198b2103..28be0fc325ea 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -18,7 +18,7 @@ #define HL_RESET_DELAY_USEC 10000 /* 10ms */ -#define HL...
fa46c7bb501b8b649ba17e4a048243b85ba1b1b0
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs/gaudi2: fix missing check of kernel ctx
Problem Details: If we are initializing the kernel context when we have a Gaudi2 device, we don't need to do any late initializing of that context with specific Gaudi2 code. Reviewed-by: Ofir Bitton <obitton@habana.ai> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
```diff diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index 2b537ef6a550..22a9aee9a7c9 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -10651,6 +10651,9 @@ static int gaudi2_ctx_init(struct hl_ctx *ctx) { int r...
2da9f8d8059331db9d26a5e794a417be547c4236
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix wait_for_interrupt abortion flow
Problem Details: When the driver needs to abort waiters for interrupts, for cases such as critical events that occur and driver need to do hard reset, in such scenario the driver will complete the fence to wake up the waiting thread, and will set the fence error indication. The return value of the completion API will b...
```diff diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index 02ac6d754fba..396bbf8652b7 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -3449,7 +3449,15 @@ static int...
bffd2f16ae374decdeb5bc714b1aa2e0c23f3708
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: fix standalone preboot descriptor request
Problem Details: The preboot used to statically allocate memory for the comms descriptor on the device memory when driver requested the descriptor information. Now preboot moved to dynamic memory allocation where it wants to check the size the driver expects vs. what the f/w expects. Note there are no backward compatib...
```diff diff --git a/drivers/accel/habanalabs/common/firmware_if.c b/drivers/accel/habanalabs/common/firmware_if.c index acbc1a6b5cb1..370508e98854 100644 --- a/drivers/accel/habanalabs/common/firmware_if.c +++ b/drivers/accel/habanalabs/common/firmware_if.c @@ -2743,7 +2743,8 @@ static int hl_fw_dynamic_init_cpu(struc...
e4a97d6b62599cc6c4bd37674de378b2a86225c3
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: set device status 'malfunction' while in rmmod
Problem Details: hl_device_status() returns the status of an acquired device. If a device is going down (following an rmmod cmd), it should be marked as an unusable/malfunctioning device, and hence should not be acquired. However, since this was not the case so far (i.e., a device going down would inaccurately return '...
```diff diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 993305871292..5973e4d64e19 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -315,7 +315,9 @@ enum hl_device_status hl_device_status(struct hl_device *hdev...
e7b2902a330eba354024581edead0002521bcedf
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: print task name upon creation of a user context
Problem Details: It is useful for debug to know which user process have acquired the device. Add this info to the relevant debug print, in addition to the already printed user context's ASID. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay...
```diff diff --git a/drivers/accel/habanalabs/common/context.c b/drivers/accel/habanalabs/common/context.c index 9c8b1b37b510..0a53f7154739 100644 --- a/drivers/accel/habanalabs/common/context.c +++ b/drivers/accel/habanalabs/common/context.c @@ -102,7 +102,7 @@ static void hl_ctx_fini(struct hl_ctx *ctx) kfree(ctx->...
7dccb064a7ab54068b5a92466361dcd0db069c73
Analyze and fix the following issue in the Linux kernel code: accel/habanalabs: print task name and request code upon ioctl failure
Problem Details: When an ioctl fails, it is useful to know what is the task command name and the full ioctl request code, in addition to the task pid and the ioctl number. Add the additional information to the relevant debug error prints. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@...
```diff diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c index 6a45a92344e9..549b2518fae0 100644 --- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c +++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c @@ -1194,9 +1194,13 @@ static long _hl_io...
cc2e49235d87bf21055743b448f47193421f3ac0
Analyze and fix the following issue in the Linux kernel code: drm/msm/dp: Inline dp_display_is_sink_count_zero()
Problem Details: This function is basically a one-liner when you ignore the debug logging. Just inline the function and drop the log to simplify the code. Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Vinod Polimera <quic_vpolimer@quicinc.com> Cc: Kuogee Hsieh <quic_khsieh@quicinc.com> Signed-off-by...
```diff diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 96bbf6fec2f1..2a5f1ab9a65b 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -341,14 +341,6 @@ static const struct component_ops dp_display_comp_ops = { .unbind = dp_display...
c0977e0dd8a4f5f5ecd46e12b1022cd08568eefd
Analyze and fix the following issue in the Linux kernel code: drm/msm/dp: Inline dp_link_parse_sink_count()
Problem Details: The function dp_link_parse_sink_count() is really just drm_dp_read_sink_count(). It debug prints out the bit for content protection (DP_SINK_CP_READY), but that is not useful beyond debug because 'link->dp_link.sink_count' is overwritten to only contain the sink_count in this same function. Just use dr...
```diff diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c index 6375daaeb98e..98427d45e9a7 100644 --- a/drivers/gpu/drm/msm/dp/dp_link.c +++ b/drivers/gpu/drm/msm/dp/dp_link.c @@ -712,49 +712,17 @@ end: return ret; } -/** - * dp_link_parse_sink_count() - parses the sink count - * @dp...
6acb691824933535219dfd94d9d97c922f5593d2
Analyze and fix the following issue in the Linux kernel code: drm/bridge: samsung-dsim: calculate porches in Hz
Problem Details: Calculating the byte_clk in kHz is imprecise for a hs_clock of 55687500 Hz, which may be used with a pixel clock of 74.25 MHz with mode 1920x1080-30. Fix the calculation by using HZ instead of kHZ. This requires to change the type to u64 to prevent overflows of the integer type. Reviewed-by: Adam Fo...
```diff diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index a0310f050693..3a5c7618e7aa 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -988,10 +988,12 @@ static void samsung_dsim_set_display_mode(struct samsung_dsim *dsi) u...
198e54282ae560958e64328fe8f72893661b9e8b
Analyze and fix the following issue in the Linux kernel code: drm/bridge: samsung-dsim: adjust porches by rounding up
Problem Details: Rounding the porches up instead of down fixes the samsung-dsim at some more resolutions and refresh rates: The following resolutions are working with rounded-up porches, but don't work when the porches are rounded down: 1920x1080-59.94 1920x1080-30.00 1920x1080-29.97 1920x1080-25.00 1680x1050-59.88 1...
```diff diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 60d5ab2e0989..a0310f050693 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -989,9 +989,9 @@ static void samsung_dsim_set_display_mode(struct samsung_dsim *dsi) i...
3683182a7254f728778452814abe2437a12502c3
Analyze and fix the following issue in the Linux kernel code: drm/bridge: samsung-dsim: add more mipi-dsi device debug information
Problem Details: Since the MIPI configuration can be changed on demand it is very useful to print more MIPI settings during the MIPI device attach step. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-b...
```diff diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 2b56a5bfe273..59b51eb4cd7b 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1721,7 +1721,10 @@ of_find_panel_or_bridge: return ret; } - DRM_DEV_INFO(dev, "Att...
054c22bd784d6953ac85f545bed4a2a27b0e4ddb
Analyze and fix the following issue in the Linux kernel code: printk: flush consoles before checking progress
Problem Details: Commit 9e70a5e109a4 ("printk: Add per-console suspended state") removed console lock usage during resume and replaced it with the clearly defined console_list_lock and srcu mechanisms. However, the console lock usage had an important side-effect of flushing the consoles. After its removal, consoles we...
```diff diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 8787d3a72114..1919899b6897 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -3738,12 +3738,18 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre seq = prb_next_seq(prb); + /* Flush the co...
b01db23d5923a35023540edc4f0c5f019e11ac7d
Analyze and fix the following issue in the Linux kernel code: sched/eevdf: Fix pick_eevdf()
Problem Details: The old pick_eevdf() could fail to find the actual earliest eligible deadline when it descended to the right looking for min_deadline, but it turned out that that min_deadline wasn't actually eligible. In that case we need to go back and search through any left branches we skipped looking for the actua...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a4b904a010c6..061a30a8925a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -872,14 +872,16 @@ struct sched_entity *__pick_first_entity(struct cfs_rq *cfs_rq) * * Which allows an EDF like search on (sub)trees. */ -static struct sche...
8dafa9d0eb1a1550a0f4d462db9354161bc51e0c
Analyze and fix the following issue in the Linux kernel code: sched/eevdf: Fix min_deadline heap integrity
Problem Details: Marek and Biju reported instances of: "EEVDF scheduling fail, picking leftmost" which Mike correlated with cgroup scheduling and the min_deadline heap getting corrupted; some trace output confirms: > And yeah, min_deadline is hosed somehow: > > validate_cfs_rq: --- / > __print_se: ffff88845c...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ef7490c4b8b4..a4b904a010c6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3613,6 +3613,7 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, */ deadline = div_s64(deadline * old_weight, weight); se-...
87797fad6cce28ec9be3c13f031776ff4f104cfc
Analyze and fix the following issue in the Linux kernel code: xen/events: replace evtchn_rwlock with RCU
Problem Details: In unprivileged Xen guests event handling can cause a deadlock with Xen console handling. The evtchn_rwlock and the hvc_lock are taken in opposite sequence in __hvc_poll() and in Xen console IRQ handling. Normally this is no problem, as the evtchn_rwlock is taken as a reader in both paths, but as soon ...
```diff diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 0bb86e6c4d0a..1b2136fe0fa5 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -33,6 +33,7 @@ #include <linux/slab.h> #include <linux/irqnr.h> #include <linux/pci.h> +#include <linux/rcu...
06ab64a0d836ac430c5f94669710a78aa43942cb
Analyze and fix the following issue in the Linux kernel code: drm: vmwgfx_surface.c: copy user-array safely
Problem Details: Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie <airlied@redhat.com> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Reviewed-by: Kees Cook <keescoo...
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 5db403ee8261..9be185b094cb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -777,9 +777,9 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, ...
f37d63e219c39199a59b8b8a211412ff27192830
Analyze and fix the following issue in the Linux kernel code: drm_lease.c: copy user-array safely
Problem Details: Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie <airlied@redhat.com> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Reviewed-by: Kees Cook <keescoo...
```diff diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index 150fe1555068..94375c6a5425 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -510,8 +510,8 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, /* Handle leased objects, if any */ idr_init(&leases)...
ca0776571d3163bd03b3e8c9e3da936abfaecbf6
Analyze and fix the following issue in the Linux kernel code: kernel: watch_queue: copy user-array safely
Problem Details: Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie <airlied@redhat.com> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Reviewed-by: Kees Cook <keescoo...
```diff diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c index d0b6b390ee42..778b4056700f 100644 --- a/kernel/watch_queue.c +++ b/kernel/watch_queue.c @@ -331,7 +331,7 @@ long watch_queue_set_filter(struct pipe_inode_info *pipe, filter.__reserved != 0) return -EINVAL; - tf = memdup_user(_filter->filt...
569c8d82f95eb5993c84fb61a649a9c4ddd208b3
Analyze and fix the following issue in the Linux kernel code: kernel: kexec: copy user-array safely
Problem Details: Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie <airlied@redhat.com> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Acked-by: Baoquan He <bhe@redha...
```diff diff --git a/kernel/kexec.c b/kernel/kexec.c index 107f355eac10..8f35a5a42af8 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -247,7 +247,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, ((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH_DEFAULT)) return -EINVAL; - ksegments ...
313ebe47d75558511aa1237b6e35c663b5c0ec6f
Analyze and fix the following issue in the Linux kernel code: string.h: add array-wrappers for (v)memdup_user()
Problem Details: Currently, user array duplications are sometimes done without an overflow check. Sometimes the checks are done manually; sometimes the array size is calculated with array_size() and sometimes by calculating n * size directly in code. Introduce wrappers for arrays for memdup_user() and vmemdup_user() t...
```diff diff --git a/include/linux/string.h b/include/linux/string.h index dbfc66400050..debf4ef1098f 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -5,7 +5,9 @@ #include <linux/compiler.h> /* for inline */ #include <linux/types.h> /* for size_t */ #include <linux/stddef.h> /* for NULL */ +#incl...
ea2274ab0b18549dbf0e755e41d8c5e8b5232dc3
Analyze and fix the following issue in the Linux kernel code: wifi: wfx: fix case where rates are out of order
Problem Details: When frames are sent over the air, the device always applies the data rates in descending order. The driver assumed Minstrel also provided rate in descending order. However, in some cases, Minstrel can a choose a fallback rate greater than the primary rate. In this case, the two rates was inverted, th...
```diff diff --git a/drivers/net/wireless/silabs/wfx/data_tx.c b/drivers/net/wireless/silabs/wfx/data_tx.c index e8b6d41f5519..a44a7403ce8d 100644 --- a/drivers/net/wireless/silabs/wfx/data_tx.c +++ b/drivers/net/wireless/silabs/wfx/data_tx.c @@ -256,53 +256,40 @@ static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, stru...
8b27aed225cadaee6a8a263ae621d7adbe3b12d0
Analyze and fix the following issue in the Linux kernel code: wifi: wfx: fix power_save setting when AP is stopped
Problem Details: The WF200 allow to start two network interfaces (one AP, one station) on two different channels. Since magic does not exist, it only works if the station interface enables power save. Thus, the driver detects this case and enforce power save as necessary. This patch fixes the case where the AP interf...
```diff diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c index 626dfb4b7a55..9c0a11c277e9 100644 --- a/drivers/net/wireless/silabs/wfx/sta.c +++ b/drivers/net/wireless/silabs/wfx/sta.c @@ -402,7 +402,12 @@ void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...
4a63e68a295187ae3c1cb3fa0c583c96a959714f
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: Fix microphone sound on Nexigo webcam.
Problem Details: I own an external usb Webcam, model NexiGo N930AF, which had low mic volume and inconsistent sound quality. Video works as expected. (snip) [ +0.047857] usb 5-1: new high-speed USB device number 2 using xhci_hcd [ +0.003406] usb 5-1: New USB device found, idVendor=1bcf, idProduct=2283, bcdDevice=12....
```diff diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 985b1aea9cdc..409fc1164694 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1204,6 +1204,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, cval->res = 16; } break; + case USB_ID(0x1bcf, 0x2283): /* NexiGo N930AF...
381fdb73d1e2a48244de7260550e453d1003bb8e
Analyze and fix the following issue in the Linux kernel code: randstruct: Fix gcc-plugin performance mode to stay in group
Problem Details: The performance mode of the gcc-plugin randstruct was shuffling struct members outside of the cache-line groups. Limit the range to the specified group indexes. Cc: linux-hardening@vger.kernel.org Cc: stable@vger.kernel.org Reported-by: Lukas Loidolt <e1634039@student.tuwien.ac.at> Closes: https://lor...
```diff diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 951b74ba1b24..366395cab490 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -191,12 +191,14 @@ static void partition_struct(tree *fiel...
3fa53518ad419bfacceae046a9d8027e4c4c5290
Analyze and fix the following issue in the Linux kernel code: dmaengine: fsl-edma: fix all channels requested when call fsl_edma3_xlate()
Problem Details: dma_get_slave_channel() increases client_count for all channels. It should only be called when a matched channel is found in fsl_edma3_xlate(). Move dma_get_slave_channel() after checking for a matched channel. Cc: stable@vger.kernel.org Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support...
```diff diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 621a460fae0c..8c4ed7012e23 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -154,18 +154,20 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, fsl_chan = to_fsl_edma_chan(chan);...
67e13e89742c3b21ce177f612bf9ef32caae6047
Analyze and fix the following issue in the Linux kernel code: dmaengine: stm32-dma: fix residue in case of MDMA chaining
Problem Details: In case of MDMA chaining, DMA is configured in Double-Buffer Mode (DBM) with two periods, but if transfer has been prepared with _prep_slave_sg(), the transfer is not marked cyclic (=!chan->desc->cyclic). However, as DBM is activated for MDMA chaining, residue computation must take into account cyclic ...
```diff diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 7427acc82259..0b30151fb45c 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -1389,11 +1389,12 @@ static size_t stm32_dma_desc_residue(struct stm32_dma_chan *chan, residue = stm32_dma_get_remaining_bytes(chan); - if (...
2df467e908ce463cff1431ca1b00f650f7a514b4
Analyze and fix the following issue in the Linux kernel code: dmaengine: stm32-dma: fix stm32_dma_prep_slave_sg in case of MDMA chaining
Problem Details: Current Target (CT) have to be reset when starting an MDMA chaining use case, as Double Buffer mode is activated. It ensures the DMA will start processing the first memory target (pointed with SxM0AR). Fixes: 723795173ce1 ("dmaengine: stm32-dma: add support to trigger STM32 MDMA") Signed-off-by: Ameli...
```diff diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 5c36811aa134..7427acc82259 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -1113,8 +1113,10 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_slave_sg( chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_PFCTRL; /* Act...
584970421725b7805db84714b857851fdf7203a9
Analyze and fix the following issue in the Linux kernel code: dmaengine: stm32-mdma: set in_flight_bytes in case CRQA flag is set
Problem Details: CRQA flag is set by hardware when the channel request become active and the channel is enabled. It is cleared by hardware, when the channel request is completed. So when it is set, it means MDMA is transferring bytes. This information is useful in case of STM32 DMA and MDMA chaining, especially when th...
```diff diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index da73e13b8c9d..bae08b3f55c7 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1318,7 +1318,8 @@ static int stm32_mdma_slave_config(struct dma_chan *c, static size_t stm32_mdma_desc_residue(struct stm32_mdma_chan *cha...
a4b306eb83579c07b63dc65cd5bae53b7b4019d0
Analyze and fix the following issue in the Linux kernel code: dmaengine: stm32-mdma: use Link Address Register to compute residue
Problem Details: Current implementation relies on curr_hwdesc index. But to keep this index up to date, Block Transfer interrupt (BTIE) has to be enabled. If it is not, curr_hwdesc is not updated, and then residue is not reliable. Rely on Link Address Register instead. And disable BTIE interrupt in stm32_mdma_setup_xfe...
```diff diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index cc6f4b00091f..da73e13b8c9d 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -777,8 +777,6 @@ static int stm32_mdma_setup_xfer(struct stm32_mdma_chan *chan, /* Enable interrupts */ ccr &= ~STM32_MDMA_CCR_IRQ_MASK; ...
81337b9a72dc58a5fa0ae8a042e8cb59f9bdec4a
Analyze and fix the following issue in the Linux kernel code: dmaengine: stm32-mdma: abort resume if no ongoing transfer
Problem Details: chan->desc can be null, if transfer is terminated when resume is called, leading to a NULL pointer when retrieving the hwdesc. To avoid this case, check that chan->desc is not null and channel is disabled (transfer previously paused or terminated). Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA drive...
```diff diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index 0de234022c6d..cc6f4b00091f 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1236,6 +1236,10 @@ static int stm32_mdma_resume(struct dma_chan *c) unsigned long flags; u32 status, reg; + /* Transfer can be terminat...
0618c077a8c20e8c81e367988f70f7e32bb5a717
Analyze and fix the following issue in the Linux kernel code: dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
Problem Details: The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by calling pm_runtime_disable when error returns. Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com> Reviewed-by: Linus Walle...
```diff diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 89e82508c133..002833fb1fa0 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3668,6 +3668,7 @@ static int __init d40_probe(struct platform_device *pdev) regulator_disable(base->lcpa_regulator); regulator_put(base->lc...
83c761f568733277ce1f7eb9dc9e890649c29a8c
Analyze and fix the following issue in the Linux kernel code: dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc()
Problem Details: If pxad_alloc_desc() fails on the first dma_pool_alloc() call, then sw_desc->nb_desc is zero. In such a case pxad_free_desc() is called and it will BUG_ON(). Remove this erroneous BUG_ON(). It is also useless, because if "sw_desc->nb_desc == 0", then, on the first iteration of the for loop, i is -1 a...
```diff diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 3c574dc0613b..94cef2905940 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -722,7 +722,6 @@ static void pxad_free_desc(struct virt_dma_desc *vd) dma_addr_t dma; struct pxad_desc_sw *sw_desc = to_pxad_sw_desc(vd); - BUG_ON(s...
1e0731c05c985deb68a97fa44c1adcd3305dda90
Analyze and fix the following issue in the Linux kernel code: PM / devfreq: rockchip-dfi: Make pmu regmap mandatory
Problem Details: As a matter of fact the regmap_pmu already is mandatory because it is used unconditionally in the driver. Bail out gracefully in probe() rather than crashing later. Link: https://lore.kernel.org/lkml/20230704093242.583575-2-s.hauer@pengutronix.de/ Fixes: b9d1262bca0af ("PM / devfreq: event: support ro...
```diff diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index 39ac069cabc7..74893c06aa08 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -193,14 +193,15 @@ static int rockchip_dfi_probe(struct platform_device *pdev) return dev_e...
3537a75e73f3420614a358d0c8b390ea483cc87d
Analyze and fix the following issue in the Linux kernel code: clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped
Problem Details: Add the missing devm_kfree() when we skip the clocks with invalid or missing information from the firmware. Cc: Cristian Marussi <cristian.marussi@arm.com> Cc: Michael Turquette <mturquette@baylibre.com> Cc: Stephen Boyd <sboyd@kernel.org> Cc: linux-clk@vger.kernel.org Fixes: 6d6a1d82eaef ("clk: add s...
```diff diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index 2e1337b511eb..3f525bed9794 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -232,6 +232,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev) sclk->info = scmi_proto_clk_ops->info_get(ph, idx); if (!sclk->info) { ...
776fe19953b0e0af00399e50fb3b205101d4b3c1
Analyze and fix the following issue in the Linux kernel code: ice: block default rule setting on LAG interface
Problem Details: When one of the LAG interfaces is in switchdev mode, setting default rule can't be done. The interface on which switchdev is running has ice_set_rx_mode() blocked to avoid default rule adding (and other rules). The other interfaces (without switchdev running but connected via bond with interface that ...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c index 4f39863b5537..7b1256992dcf 100644 --- a/drivers/net/ethernet/intel/ice/ice_lag.c +++ b/drivers/net/ethernet/intel/ice/ice_lag.c @@ -2093,3 +2093,35 @@ lag_rebuild_out: } mutex_unlock(&pf->lag_mutex); } + ...
66cf7435a26917c0c4d6245ad9137e7606e84fdf
Analyze and fix the following issue in the Linux kernel code: xen-netback: use default TX queue size for vifs
Problem Details: Do not set netback interfaces (vifs) default TX queue size to the ring size. The TX queue size is not related to the ring size, and using the ring size (32) as the queue size can lead to packet drops. Note the TX side of the vif interface in the netback domain is the one receiving packets to be inject...
```diff diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index f3f2c07423a6..fc3bb63b9ac3 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -41,8 +41,6 @@ #include <asm/xen/hypercall.h> #include <xen/balloon.h> -#define XENVIF_QUEUE_L...
1e0b72a2a6432c0ef67ee5ce8d9172a7c20bba25
Analyze and fix the following issue in the Linux kernel code: mlxsw: fix mlxsw_sp2_nve_vxlan_learning_set() return type
Problem Details: The mlxsw_sp2_nve_vxlan_learning_set() function is supposed to return zero on success or negative error codes. So it needs to be type int instead of bool. Fixes: 4ee70efab68d ("mlxsw: spectrum_nve: Add support for VXLAN on Spectrum-2") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-...
```diff diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c index bb8eeb86edf7..52c2fe3644d4 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c @@ -310,8 +310,8 ...
e53899771a02f798d436655efbd9d4b46c0f9265
Analyze and fix the following issue in the Linux kernel code: perf/x86/lbr: Filter vsyscall addresses
Problem Details: We found that a panic can occur when a vsyscall is made while LBR sampling is active. If the vsyscall is interrupted (NMI) for perf sampling, this call sequence can occur (most recent at top): __insn_get_emulate_prefix() insn_get_emulate_prefix() insn_get_prefixes() insn_get_opcode() ...
```diff diff --git a/arch/x86/events/utils.c b/arch/x86/events/utils.c index 76b1f8bb0fd5..dab4ed199227 100644 --- a/arch/x86/events/utils.c +++ b/arch/x86/events/utils.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <asm/insn.h> +#include <linux/mm.h> #include "perf_event.h" @@ -132,9 +133,9 @@ s...
025d5ac978cc3b47874cc1c03ab096a78b49f278
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Fix kernel-doc warnings
Problem Details: The kernel test robot reported kernel-doc warnings here: monitor.c:34: warning: Cannot understand * @rmid_free_lru A least recently used list of free RMIDs on line 34 - I thought it was a doc line monitor.c:41: warning: Cannot understand * @rmid_limbo_count count of currently unused but (...
```diff diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index ded1fc7cb7cb..f136ac046851 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -30,15 +30,15 @@ struct rmid_entry { struct list_head list; }; -/** - * @rmid_free_l...
0f5aa1b01263b8b621bc4f031a1f2983ef8517b7
Analyze and fix the following issue in the Linux kernel code: usb: usbtest: fix a type promotion bug
Problem Details: The "len" here is sometimes negative error codes from usb_get_descriptor(), so we don't want to type promote them to unsigned long. This bug pre-dates the invention of git. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/506f7935-2cba-41d9-ab5d-ddb6ad6320bd@mor...
```diff diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index ac0d75ac2d2f..caf65f8294db 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -705,7 +705,7 @@ static int is_good_config(struct usbtest_dev *tdev, int len) { struct usb_config_descriptor *config; - if (len <...
97475763484245916735a1aa9a3310a01d46b008
Analyze and fix the following issue in the Linux kernel code: USB: usbip: fix stub_dev hub disconnect
Problem Details: If a hub is disconnected that has device(s) that's attached to the usbip layer the disconnect function might fail because it tries to release the port on an already disconnected hub. Fixes: 6080cd0e9239 ("staging: usbip: claim ports used by shared devices") Signed-off-by: Jonas Blixt <jonas.blixt@acti...
```diff diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c index 9c6954aad6c8..ce625b1ce9a5 100644 --- a/drivers/usb/usbip/stub_dev.c +++ b/drivers/usb/usbip/stub_dev.c @@ -464,8 +464,13 @@ static void stub_disconnect(struct usb_device *udev) /* release port */ rc = usb_hub_release_port(udev->...
b3fa3cf02e3ce92d32bfdeedd5a6bd0825f55a14
Analyze and fix the following issue in the Linux kernel code: ASoC: ti: ams-delta: Fix cx81801_receive() argument types
Problem Details: Since types of arguments accepted by tty_ldis_ops::receive_buf() have changed, the driver no longer builds. .../linux/sound/soc/ti/ams-delta.c:403:24: error: initialization of 'void (*)(struct tty_struct *, const u8 *, const u8 *, size_t)' {aka 'void (*)(struct tty_struct *, const unsigned char *, con...
```diff diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c index 371943350fdf..666057d50ea0 100644 --- a/sound/soc/ti/ams-delta.c +++ b/sound/soc/ti/ams-delta.c @@ -336,8 +336,8 @@ static void cx81801_hangup(struct tty_struct *tty) } /* Line discipline .receive_buf() */ -static void cx81801_receive(st...
53412dc2905401207f264dc30890f6b9e41524a6
Analyze and fix the following issue in the Linux kernel code: drm/mediatek: Fix iommu fault during crtc enabling
Problem Details: The difference between drm_atomic_helper_commit_tail() and drm_atomic_helper_commit_tail_rpm() is drm_atomic_helper_commit_tail() will commit plane first and then enable crtc, drm_atomic_helper_commit_tail_rpm() will enable crtc first and then commit plane. Before mediatek-drm enables crtc, the power ...
```diff diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index 742218691080..ef02b412bb52 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -410,6 +410,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) ...
3ec71e05ae6e7f46512e568ed81c92be589003dd
Analyze and fix the following issue in the Linux kernel code: drm/mediatek: Fix iommu fault by swapping FBs after updating plane state
Problem Details: According to the comment in drm_atomic_helper_async_commit(), we should make sure FBs have been swapped, so that cleanups in the new_state performs a cleanup in the old FB. So we should move swapping FBs after calling mtk_plane_update_new_state(), to avoid using the old FB which could be freed. Fixes...
```diff diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index 5acb03b7c6fe..ddc9355b06d5 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -227,9 +227,9 @@ static void mtk_plane_atomic_async_update(struct drm_plane *p...
ebba0960993045787ca00bb0932d83dad98c2e26
Analyze and fix the following issue in the Linux kernel code: drm/mediatek: Fix using wrong drm private data to bind mediatek-drm
Problem Details: According to mtk_drm_kms_init(), the all_drm_private array in each drm private data stores all drm private data in display path order. In mtk_drm_get_all_drm_priv(), each element in all_drm_priv should have one display path private data, such as: all_drm_priv[CRTC_MAIN] should only have main_path data...
```diff diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 8fe10e72edcb..436d46bc23f3 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -352,6 +352,7 @@ static bool mtk_drm_get_all_drm_priv(struct device *dev) { struct ...
ff64e4c31d969cdba20a41969edb3def15f3aaa0
Analyze and fix the following issue in the Linux kernel code: drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data
Problem Details: Add missing mmsys_dev_num to mt8188 vdosys0 driver data. Fixes: 54b48080278a ("drm/mediatek: Add mediatek-drm of vdosys0 support for mt8188") Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delreg...
```diff diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 034056d0f741..ff4d245dfaba 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -288,6 +288,7 @@ static const struct mtk_mmsys_driver_data mt8186_mmsys_driver_data = ...
f990874b1c98fe8e57ee9385669f501822979258
Analyze and fix the following issue in the Linux kernel code: ieee802154: ca8210: Fix a potential UAF in ca8210_probe
Problem Details: If of_clk_add_provider() fails in ca8210_register_ext_clock(), it calls clk_unregister() to release priv->clk and returns an error. However, the caller ca8210_probe() then calls ca8210_remove(), where priv->clk is freed again in ca8210_unregister_ext_clock(). In this case, a use-after-free may happen i...
```diff diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index aebb19f1b3a4..4ec0dab38872 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -2740,7 +2740,6 @@ static int ca8210_register_ext_clock(struct spi_device *spi) struct device_node *np = spi->de...
d3b3c637e4eb8d3bbe53e5692aee66add72f9851
Analyze and fix the following issue in the Linux kernel code: parisc: Fix crash with nr_cpus=1 option
Problem Details: John David Anglin reported that giving "nr_cpus=1" on the command line causes a crash, while "maxcpus=1" works. Reported-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v5.18+
```diff diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 4098f9a0964b..2019c1f04bd0 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -440,7 +440,9 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) if (cpu_online(cpu)) return 0; - if (num_online_cpus() < set...
b44444027ce7714f309e96b804b7fb088a40d708
Analyze and fix the following issue in the Linux kernel code: thermal: trip: Remove lockdep assertion from for_each_thermal_trip()
Problem Details: The lockdep assertion in for_each_thermal_trip() was added to possibly catch incorrect usage of that function without the thermal zone lock. However, it turns out that the ACPI thermal driver has a legitimate reason to call for_each_thermal_trip() without locking. Namely, it is called by acpi_thermal_...
```diff diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c index 8c649a899537..9f10e2ff9248 100644 --- a/drivers/thermal/thermal_trip.c +++ b/drivers/thermal/thermal_trip.c @@ -15,8 +15,6 @@ int for_each_thermal_trip(struct thermal_zone_device *tz, { int i, ret; - lockdep_assert_held(&tz-...
c32ab7bd6191d64998dced3ba567b8737d217861
Analyze and fix the following issue in the Linux kernel code: riscv: defconfig: enable SOPHGO SoC
Problem Details: Enable SOPHGO SoC config in defconfig to allow the default upstream kernel to boot on Milk-V Pioneer board. Acked-by: Chao Wei <chao.wei@sophgo.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Guo Ren <guoren@kernel.org> Signed-off-by: Chen Wang <unicorn_wang@outlook.com> [conor: ...
```diff diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index ab86ec3b9eab..1edf3cd886c5 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -27,10 +27,11 @@ CONFIG_EXPERT=y CONFIG_PROFILING=y CONFIG_SOC_MICROCHIP_POLARFIRE=y CONFIG_ARCH_RENESAS=y -CONFIG_ARCH_THE...
bc87127a45928de5fdf0ec39d7a86e1edd0e179e
Analyze and fix the following issue in the Linux kernel code: sched/debug: Print 'tgid' in sched_show_task()
Problem Details: Multiple blocked tasks are printed when the system hangs. They may have the same parent pid, but belong to different task groups. Printing tgid lets users better know whether these tasks are from the same task group or not. Signed-off-by: Yajun Deng <yajun.deng@linux.dev> Signed-off-by: Ingo Molnar <...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f5783cb16791..cf6d3fdd4eb5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9089,9 +9089,9 @@ void sched_show_task(struct task_struct *p) if (pid_alive(p)) ppid = task_pid_nr(rcu_dereference(p->real_parent)); rcu_read_unlock(); - ...
ea41bb514fe286bf50498b3c6d7f7a5dc2b6c5e0
Analyze and fix the following issue in the Linux kernel code: sched/core: Update stale comment in try_to_wake_up()
Problem Details: The following commit: 9b3c4ab3045e ("sched,rcu: Rework try_invoke_on_locked_down_task()") ... renamed try_invoke_on_locked_down_task() to task_call_func(), but forgot to update the comment in try_to_wake_up(). But it turns out that the smp_rmb() doesn't live in task_call_func() either, it was move...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 65e10ac34660..f5783cb16791 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4237,7 +4237,7 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) * Pairs with the LOCK+smp_mb__after_spinlock() on rq->lock in...
81a61051e0ce5fd7e09225c0d5985da08c7954a7
Analyze and fix the following issue in the Linux kernel code: serial: core: Fix checks for tx runtime PM state
Problem Details: Maximilian reported that surface_serial_hub serdev tx does not work during system suspend. During system suspend, runtime PM gets disabled in __device_suspend_late(), and tx is unable to wake-up the serial core port device that we use to check if tx is safe to start. Johan summarized the regression not...
```diff diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index ca26a8aef2cb..d5ba6e90bd95 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -156,7 +156,7 @@ static void __uart_start(struct uart_state *state) * enabled, serial_port_runtime_resume()...
42851dfd4dbe38e34724a00063a9fad5cfc48dcd
Analyze and fix the following issue in the Linux kernel code: dt-bindings: serial: fix regex pattern for matching serial node children
Problem Details: The regular expression pattern for matching serial node children should accept only nodes starting and ending with the set of words: bluetooth, gnss, gps or mcu. Add missing brackets to enforce such matching. Fixes: 0c559bc8abfb ("dt-bindings: serial: restrict possible child node names") Reported-by:...
```diff diff --git a/Documentation/devicetree/bindings/serial/serial.yaml b/Documentation/devicetree/bindings/serial/serial.yaml index ea277560a596..5727bd549dec 100644 --- a/Documentation/devicetree/bindings/serial/serial.yaml +++ b/Documentation/devicetree/bindings/serial/serial.yaml @@ -96,7 +96,7 @@ then: rts-...
25d367506a284bb0404b7d53b0b20c9bfb33f926
Analyze and fix the following issue in the Linux kernel code: staging: rtl8192e: Remove unused file rtllib_debug.h
Problem Details: Remove #define DRV_NAME "rtllib_92e" as it is already set. Remove enum RTL_DEBUG as it is unused. Remove #include <linux/bits.h> as it is unused. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/b7b61bd068e8090b954e3c025bc724d9e85fc568.1696548527.git.phili...
```diff diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 2f968c3c0229..b12a39ecdd9d 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -31,7 +31,6 @@ #include <linux/delay.h> #include <linux/wireless.h> -#include "rtllib_debug.h" #inclu...
26e703c677e981f3e363ef327a94f7a4f4790013
Analyze and fix the following issue in the Linux kernel code: staging: rtl8192e: Remove function _rtl92e_wx_set_debug()
Problem Details: Remove function _rtl92e_wx_set_debug() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/887ca5f66bad5105eeba449a9bd3e40be4b835ce.1696548527.git.philipp.g.hortmann@gmail.com...
```diff diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index d4d8d66df82c..ec8e7d5fe634 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -122,25 +122,6 @@ static int _rtl92e_wx_get_power(struct net_device *d...
a1766a4fd83befa0b34d932d532e7ebb7fab1fa7
Analyze and fix the following issue in the Linux kernel code: media: imon: fix access to invalid resource for the second interface
Problem Details: imon driver probes two USB interfaces, and at the probe of the second interface, the driver assumes blindly that the first interface got bound with the same imon driver. It's usually true, but it's still possible that the first interface is bound with another driver via a malformed descriptor. Then i...
```diff diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 74546f7e3469..5719dda6e0f0 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -2427,6 +2427,12 @@ static int imon_probe(struct usb_interface *interface, goto fail; } + if (first_if->dev.driver != interface->dev.driver...
4c812e33b0de26bc61e2ab5b3c4dd3e4d3c6cd51
Analyze and fix the following issue in the Linux kernel code: media: v4l: subdev: Print debug information on frame descriptor
Problem Details: Print debug level information on returned frame descriptors. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 9cb04ace86ae..d295a4e87b66 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -15,6 +15,7 @@ #include <linux/module.h> #include <linux/overflow.h> #include <linux/sl...
2428e585b1e79efc1ecc3eaf64ad777e1272b792
Analyze and fix the following issue in the Linux kernel code: media: ccs: Partially revert "media: i2c: Use pm_runtime_resume_and_get()"
Problem Details: ccs_pm_get_init() depends on the return values > 0 of pm_runtime_get_sync(), thus it can't use pm_runtime_resume_and_get(). There's even a comment in the driver on this, a few lines above the code. Fixes: aa0adb399d09 ("media: i2c: Use pm_runtime_resume_and_get()") Signed-off-by: Sakari Ailus <sakari....
```diff diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index c6853622946b..34f4f62a9523 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -1873,9 +1873,9 @@ static int ccs_pm_get_init(struct ccs_sensor *sensor) * relies at the returned value to ...
724ff68e968b19d786870d333f9952bdd6b119cb
Analyze and fix the following issue in the Linux kernel code: media: ccs: Correctly initialise try compose rectangle
Problem Details: Initialise the try sink compose rectangle size to the sink compose rectangle for binner and scaler sub-devices. This was missed due to the faulty condition that lead to the compose rectangles to be initialised for the pixel array sub-device where it is not relevant. Fixes: ccfc97bdb5ae ("[media] smiap...
```diff diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 6a8116454f87..022e8712d48e 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -3097,7 +3097,7 @@ static int ccs_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) try_fmt->code = s...
441b5c63d71ec9ec5453328f7e83384ecc1dddd9
Analyze and fix the following issue in the Linux kernel code: media: ccs: Fix driver quirk struct documentation
Problem Details: Fix documentation for struct ccs_quirk, a device specific struct for managing deviations from the standard. The flags field was drifted away from where it should have been. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Sign...
```diff diff --git a/drivers/media/i2c/ccs/ccs-quirk.h b/drivers/media/i2c/ccs/ccs-quirk.h index 5838fcda92fd..0b1a64958d71 100644 --- a/drivers/media/i2c/ccs/ccs-quirk.h +++ b/drivers/media/i2c/ccs/ccs-quirk.h @@ -32,12 +32,10 @@ struct ccs_sensor; * @reg: Pointer to the register to access * @value: Register val...
2ae504a561dbb31e5fb0a21f242f07e8c91cce61
Analyze and fix the following issue in the Linux kernel code: media: i2c: imx219: Initialize ycbcr_enc
Problem Details: While the ycbcr_enc field doesn't apply to raw formats, leaving it uninitialized makes the driver behave in a less deterministic way. Fix it by picking the default value for the colorspace. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dave Stevenson <dave.stevenson@...
```diff diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 140924445a61..2e1fbeef11a8 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -495,6 +495,7 @@ static void imx219_update_pad_format(struct imx219 *imx219, fmt->height = mode->height; fmt->field = V4L2_FIELD_N...
55c3ec033b7e3353d1bed7ab96de8e9abc02fe3a
Analyze and fix the following issue in the Linux kernel code: media: i2c: imx219: Fix test pattern window for 640x480 mode
Problem Details: The 640x480 mode specifies incorrect values for the TP_WINDOW_WIDTH and TP_WINDOW_HEIGHT registers, which likely got copied from the 1640x1232 mode. They should be identical to the X_OUTPUT_SIZE and Y_OUTPUT_SIZE registers as for all the other modes, to avoid cropping the test pattern. Fix them. Signe...
```diff diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index a14de8f3dee7..cf55c59cbb7f 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -263,8 +263,8 @@ static const struct cci_reg_sequence mode_640_480_regs[] = { { IMX219_REG_Y_ADD_END_A, 1711 }, { IMX219_REG_X_OUT...
ec80c606cca5f7a676febde10d63f5532f57e8e7
Analyze and fix the following issue in the Linux kernel code: media: i2c: imx219: Drop IMX219_REG_CSI_LANE_MODE from common regs array
Problem Details: The IMX219_REG_CSI_LANE_MODE is configured twice, once with a hardcoded value in the imx219_common_regs registers array, and once with the value appropriate for the system in imx219_configure_lanes(). The latter is enough, drop the former. Fixes: ceddfd4493b3 ("media: i2c: imx219: Support four-lane op...
```diff diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 530b03d78e34..a14de8f3dee7 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -214,7 +214,6 @@ static const struct cci_reg_sequence imx219_common_regs[] = { { IMX219_REG_Y_ODD_INC_A, 1 }, /* Output setup re...
36fe515c1a3cd5eac148e8a591a82108d92d5522
Analyze and fix the following issue in the Linux kernel code: media: cedrus: Fix clock/reset sequence
Problem Details: According to H6 user manual, resets should always be de-asserted before clocks are enabled. This is also consistent with vendor driver. Fixes: d5aecd289bab ("media: cedrus: Implement runtime PM") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Paul Kocialkowski <paul.kocialkowski@bo...
```diff diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index b696bf884cbd..32af0e96e762 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -172,12 +172,12 @@ int cedrus_hw_suspend(struct device...
85b901e6003b54f1377f63e9444466972c0707a7
Analyze and fix the following issue in the Linux kernel code: media: visl: use canonical ftrace path
Problem Details: The canonical location for the tracefs filesystem is at /sys/kernel/tracing. But, from Documentation/trace/ftrace.rst: Before 4.1, all ftrace tracing control files were within the debugfs file system, which is typically located at /sys/kernel/debug/tracing. For backward compatibility, when moun...
```diff diff --git a/Documentation/admin-guide/media/visl.rst b/Documentation/admin-guide/media/visl.rst index 7d2dc78341c9..4328c6c72d30 100644 --- a/Documentation/admin-guide/media/visl.rst +++ b/Documentation/admin-guide/media/visl.rst @@ -78,7 +78,7 @@ The trace events are defined on a per-codec basis, e.g.: .. ...
1fd6eb12642e0c32692924ff359c07de4b781d78
Analyze and fix the following issue in the Linux kernel code: media: vidtv: mux: Add check and kfree for kstrdup
Problem Details: Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Moreover, use kfree() in the later error handling in order to avoid memory leak. Fixes: c2f78f0cb294 ("media: vidtv: psi: add a Network Information Table (NIT)") Signed-off-by: Jias...
```diff diff --git a/drivers/media/test-drivers/vidtv/vidtv_mux.c b/drivers/media/test-drivers/vidtv/vidtv_mux.c index b51e6a3b8cbe..f99878eff7ac 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_mux.c +++ b/drivers/media/test-drivers/vidtv/vidtv_mux.c @@ -504,13 +504,16 @@ struct vidtv_mux *vidtv_mux_init(struct dvb...
76a2c5df6ca8bd8ada45e953b8c72b746f42918d
Analyze and fix the following issue in the Linux kernel code: media: vidtv: psi: Add check for kstrdup
Problem Details: Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Fixes: 7a7899f6f58e ("media: vidtv: psi: Implement an Event Information Table (EIT)") Fixes: c2f78f0cb294 ("media: vidtv: psi: add a Network Information Table (NIT)") Fixes: f90cf60...
```diff diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c index ce0b7a6e92dc..2a51c898c11e 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_psi.c +++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c @@ -301,16 +301,29 @@ struct vidtv_psi_desc_service *vidtv_psi_se...
5f9fcbf92da901495f2f8b09d2f6df5c2ca83dc5
Analyze and fix the following issue in the Linux kernel code: media: nuvoton: npcm-video: Fix IS_ERR() vs NULL bug
Problem Details: The of_parse_phandle() function returns NULL on error. It never returns error pointers. Update the check accordingly. Fixes: 70721089985c ("media: nuvoton: Add driver for NPCM video capture and encoding engine") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hans Verkuil <hve...
```diff diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c index ac8d73b794d3..b9e6782f59b4 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1660,9 +1660,9 @@ static int npcm_video_ece_init(struct npcm_vide...
04d19e65137e3cd4a5004e624c85c762933d115c
Analyze and fix the following issue in the Linux kernel code: media: s5p-mfc: Fix potential deadlock on condlock
Problem Details: As &dev->condlock is acquired under irq context along the following call chain from s5p_mfc_irq(), other acquisition of the same lock inside process context or softirq context should disable irq avoid double lock. enc_post_frame_start() seems to be one such function that execute under process context o...
```diff diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index f62703cebb77..4b4c129c09e7 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1297,7 +1297,7 @@ static int ...
61334819aca018c3416ee6c330a08a49c1524fc3
Analyze and fix the following issue in the Linux kernel code: media: s3c-camif: Avoid inappropriate kfree()
Problem Details: s3c_camif_register_video_node() works with video_device structure stored as a field of camif_vp, so it should not be kfreed. But there is video_device_release() on error path that do it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: babde1c243b2 ("[media] V4L: Add driver fo...
```diff diff --git a/drivers/media/platform/samsung/s3c-camif/camif-capture.c b/drivers/media/platform/samsung/s3c-camif/camif-capture.c index 76634d242b10..0f5b3845d7b9 100644 --- a/drivers/media/platform/samsung/s3c-camif/camif-capture.c +++ b/drivers/media/platform/samsung/s3c-camif/camif-capture.c @@ -1133,12 +1133...
0aeccc63f3bc4cfd49dc4893da1409402ee6b295
Analyze and fix the following issue in the Linux kernel code: media: mtk-jpegenc: Fix bug in JPEG encode quality selection
Problem Details: The driver uses the upper-bound approach to decide the target JPEG encode quality, but there's a logic bug that if the desired quality is higher than what the driver can support, the driver falls back to using the worst quality. Fix the bug by assuming using the best quality in the beginning, and with...
```diff diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c index 2bbc48c7402c..f8fa3b841ccf 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c @@ -127,6 +127,7 @@ void ...
6496617b2b06d7004a5cbd53d48f19567d6b018c
Analyze and fix the following issue in the Linux kernel code: media: amphion: handle firmware debug message
Problem Details: decoder firmware may notify host some debug message, it can help analyze the state of the firmware in case of error Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Signed-off-by: Ming Qian <ming.qian@nxp.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Han...
```diff diff --git a/drivers/media/platform/amphion/vpu_defs.h b/drivers/media/platform/amphion/vpu_defs.h index 667637eedb5d..7320852668d6 100644 --- a/drivers/media/platform/amphion/vpu_defs.h +++ b/drivers/media/platform/amphion/vpu_defs.h @@ -71,6 +71,7 @@ enum { VPU_MSG_ID_TIMESTAMP_INFO, VPU_MSG_ID_FIRMWARE_X...
35a62432af1ee9041fde0e1afe1d019ca82516cc
Analyze and fix the following issue in the Linux kernel code: media: qcom: camss: Fix support for setting CSIPHY clock name csiphyX
Problem Details: Several of our upstream and soon-to-be upstream SoC CAMSS dtsi declare csiphyX as opposed to the older clock name csiX_phy. Right now the CAMSS code will fail to set the csiphyX clock even if we have declared it in our list of clocks. For sdm845 and sm8250 we appear to "get away" with this error, howe...
```diff diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index 20bb361e9ad0..edd573606a6a 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -677,6 +677,10 @@ int msm_csiphy_subdev_init(s...
bcd2adfef23aee34d74e0b0a299e3268182cf27f
Analyze and fix the following issue in the Linux kernel code: media: qcom: camss: Allow clocks vfeN vfe_liteN or vfe_lite
Problem Details: The number of Video Front End - VFE or Image Front End - IFE supported with new SoCs can vary both for the full and lite cases. For example sdm845 has one vfe_lite and two vfe interfaces with the vfe clock called simply "vfe_lite" with no integer postfix. sc8280xp has four vfe and four vfe lite blocks...
```diff diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index db8f68819ded..4db0d0a1c6a5 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -431,6 +431,20 @@ void vfe_isr_reset_ack(struct vfe_device...
7eeca8ccd1066c68d6002dbbe26433f8c17c53eb
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: timer32K: fix all kernel-doc warnings
Problem Details: Fix kernel-doc warnings reported by the kernel test robot: timer32k.c:186: warning: cannot understand function prototype: 'struct timespec64 persistent_ts; ' timer32k.c:191: warning: Function parameter or member 'ts' not described in 'omap_read_persistent_clock64' timer32k.c:216: warning: Function par...
```diff diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index 410d17d1d443..f618a6df2938 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c @@ -176,17 +176,18 @@ static u64 notrace omap_32k_read_sched_clock(void) return sync32k_cnt_reg ? readl_relaxed(sync32k...
46e61750cfafea17f92add0a89483db7db3b1bda
Analyze and fix the following issue in the Linux kernel code: ARM: omap2: fix a debug printk
Problem Details: The %pR format string takes a pointer to struct resource, but this is passing a pointer to a pointer which it will print wrong information. Fixes: c63f5b454885 ("ARM: omap2: Use of_range_to_resource() for "ranges" parsing") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Message-ID: <c126dc33-...
```diff diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 1e17b5f77588..ba71928c0fcb 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2209,7 +2209,7 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh, return err; pr_debug("omap_...
ea1c1e67e631be14f6e6bc9a6e96219c47f31ed4
Analyze and fix the following issue in the Linux kernel code: ARM: dts: omap4-embt2ws: Fix pinctrl single node name warning
Problem Details: Looks like one pinctrl single binding warning sneaked in while we were implementing the yaml binding. Let's fix the 'pinmux-wl12xx-gpio' does not match any of the regexes warning by adding -pins suffix. Signed-off-by: Tony Lindgren <tony@atomide.com>
```diff diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts index 7bab03f0ce7a..01d783826d5f 100644 --- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts +++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts @@ -441,7 +441,7 @@ >; }; - wl12xx_gpi...
2ab6b437c65233f06bdd2988fd5913baeca5f159
Analyze and fix the following issue in the Linux kernel code: ARM: dts: am3517-evm: Fix LED3/4 pinmux
Problem Details: The pinmux for LED3 and LED4 are incorrectly attached to the omap3_pmx_core when they should be connected to the omap3_pmx_wkup pin mux. This was likely masked by the fact that the bootloader used to do all the pinmuxing. Fixes: 0dbf99542caf ("ARM: dts: am3517-evm: Add User LEDs and Pushbutton") Sign...
```diff diff --git a/arch/arm/boot/dts/ti/omap/am3517-evm.dts b/arch/arm/boot/dts/ti/omap/am3517-evm.dts index af9df15274be..866f68c5b504 100644 --- a/arch/arm/boot/dts/ti/omap/am3517-evm.dts +++ b/arch/arm/boot/dts/ti/omap/am3517-evm.dts @@ -271,13 +271,6 @@ >; }; - leds_pins: leds-pins { - pinctrl-single,pins...
ba62d61128bda71fd02622f320ac59d861fc4baa
Analyze and fix the following issue in the Linux kernel code: bpf: Refuse unused attributes in bpf_prog_{attach,detach}
Problem Details: The recently added tcx attachment extended the BPF UAPI for attaching and detaching by a couple of fields. Those fields are currently only supported for tcx, other types like cgroups and flow dissector silently ignore the new fields except for the new flags. This is problematic once we extend bpf_mpro...
```diff diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 453a43695a23..d77b2f8b9364 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3796,7 +3796,6 @@ static int bpf_prog_attach(const union bpf_attr *attr) { enum bpf_prog_type ptype; struct bpf_prog *prog; - u32 mask; int ret; i...
a4fe78386afb94780f8e6fcd10a67c4d4dfe4da8
Analyze and fix the following issue in the Linux kernel code: bpf: Fix BPF_PROG_QUERY last field check
Problem Details: While working on the ebpf-go [0] library integration for bpf_mprog and tcx, Lorenz noticed that two subsequent BPF_PROG_QUERY requests currently fail. A typical workflow is to first gather the bpf_mprog count without passing program/ link arrays, followed by the second request which contains the actual...
```diff diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index eb01c31ed591..453a43695a23 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3913,7 +3913,7 @@ static int bpf_prog_detach(const union bpf_attr *attr) return ret; } -#define BPF_PROG_QUERY_LAST_FIELD query.link_attach_flags +#defi...
3971442870713de527684398416970cf025b4f89
Analyze and fix the following issue in the Linux kernel code: ravb: Fix use-after-free issue in ravb_tx_timeout_work()
Problem Details: The ravb_stop() should call cancel_work_sync(). Otherwise, ravb_tx_timeout_work() is possible to use the freed priv after ravb_remove() was called like below: CPU0 CPU1 ravb_tx_timeout() ravb_remove() unregister_netdev() free_netdev(ndev) // free priv ravb_tx_timeout_work() // use priv unr...
```diff diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 9e2e801049cc..0ef0b88b7145 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2167,6 +2167,8 @@ static int ravb_close(struct net_device *ndev) of_phy_d...
e6864af61493113558c502b5cd0d754c19b93277
Analyze and fix the following issue in the Linux kernel code: ravb: Fix up dma_free_coherent() call in ravb_remove()
Problem Details: In ravb_remove(), dma_free_coherent() should be call after unregister_netdev(). Otherwise, this controller is possible to use the freed buffer. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Sergey Shtylyov <s...
```diff diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 7df9f9f8e134..9e2e801049cc 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2891,8 +2891,6 @@ static int ravb_remove(struct platform_device *pdev) clk_...