From: Greg Kroah-Hartman Date: Mon, 10 Feb 2025 15:14:38 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v6.6.77~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a3fb7269a23173d6e88aceb881bc198a51802aa;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch media-ccs-clean-up-parsed-ccs-static-data-on-parse-failure.patch media-ccs-fix-ccs-static-data-parsing-for-large-block-sizes.patch media-ccs-fix-cleanup-order-in-ccs_probe.patch media-mc-fix-endpoint-iteration.patch media-ov5640-fix-get_light_freq-on-auto.patch media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch media-uvcvideo-remove-redundant-null-assignment.patch soc-qcom-smem_state-fix-missing-of_node_put-in-error-path.patch --- diff --git a/queue-5.15/iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch b/queue-5.15/iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch new file mode 100644 index 0000000000..efb1fb6336 --- /dev/null +++ b/queue-5.15/iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch @@ -0,0 +1,86 @@ +From ab09c6cfe01b317f515bcd944668697241a54b9d Mon Sep 17 00:00:00 2001 +From: Javier Carrasco +Date: Sat, 14 Dec 2024 23:55:50 +0100 +Subject: iio: light: as73211: fix channel handling in only-color triggered buffer + +From: Javier Carrasco + +commit ab09c6cfe01b317f515bcd944668697241a54b9d upstream. + +The channel index is off by one unit if AS73211_SCAN_MASK_ALL is not +set (optimized path for color channel readings), and it must be shifted +instead of leaving an empty channel for the temperature when it is off. + +Once the channel index is fixed, the uninitialized channel must be set +to zero to avoid pushing uninitialized data. + +Add available_scan_masks for all channels and only-color channels to let +the IIO core demux and repack the enabled channels. + +Cc: stable@vger.kernel.org +Fixes: 403e5586b52e ("iio: light: as73211: New driver") +Tested-by: Christian Eggers +Signed-off-by: Javier Carrasco +Link: https://patch.msgid.link/20241214-iio_memset_scan_holes-v4-1-260b395b8ed5@gmail.com +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/light/as73211.c | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +--- a/drivers/iio/light/as73211.c ++++ b/drivers/iio/light/as73211.c +@@ -154,6 +154,12 @@ struct as73211_data { + BIT(AS73211_SCAN_INDEX_TEMP) | \ + AS73211_SCAN_MASK_COLOR) + ++static const unsigned long as73211_scan_masks[] = { ++ AS73211_SCAN_MASK_COLOR, ++ AS73211_SCAN_MASK_ALL, ++ 0 ++}; ++ + static const struct iio_chan_spec as73211_channels[] = { + { + .type = IIO_TEMP, +@@ -602,9 +608,12 @@ static irqreturn_t as73211_trigger_handl + + /* AS73211 starts reading at address 2 */ + ret = i2c_master_recv(data->client, +- (char *)&scan.chan[1], 3 * sizeof(scan.chan[1])); ++ (char *)&scan.chan[0], 3 * sizeof(scan.chan[0])); + if (ret < 0) + goto done; ++ ++ /* Avoid pushing uninitialized data */ ++ scan.chan[3] = 0; + } + + if (data_result) { +@@ -612,9 +621,15 @@ static irqreturn_t as73211_trigger_handl + * Saturate all channels (in case of overflows). Temperature channel + * is not affected by overflows. + */ +- scan.chan[1] = cpu_to_le16(U16_MAX); +- scan.chan[2] = cpu_to_le16(U16_MAX); +- scan.chan[3] = cpu_to_le16(U16_MAX); ++ if (*indio_dev->active_scan_mask == AS73211_SCAN_MASK_ALL) { ++ scan.chan[1] = cpu_to_le16(U16_MAX); ++ scan.chan[2] = cpu_to_le16(U16_MAX); ++ scan.chan[3] = cpu_to_le16(U16_MAX); ++ } else { ++ scan.chan[0] = cpu_to_le16(U16_MAX); ++ scan.chan[1] = cpu_to_le16(U16_MAX); ++ scan.chan[2] = cpu_to_le16(U16_MAX); ++ } + } + + iio_push_to_buffers_with_timestamp(indio_dev, &scan, iio_get_time_ns(indio_dev)); +@@ -684,6 +699,7 @@ static int as73211_probe(struct i2c_clie + indio_dev->channels = as73211_channels; + indio_dev->num_channels = ARRAY_SIZE(as73211_channels); + indio_dev->modes = INDIO_DIRECT_MODE; ++ indio_dev->available_scan_masks = as73211_scan_masks; + + ret = i2c_smbus_read_byte_data(data->client, AS73211_REG_OSR); + if (ret < 0) diff --git a/queue-5.15/media-ccs-clean-up-parsed-ccs-static-data-on-parse-failure.patch b/queue-5.15/media-ccs-clean-up-parsed-ccs-static-data-on-parse-failure.patch new file mode 100644 index 0000000000..c1f6eb7e5d --- /dev/null +++ b/queue-5.15/media-ccs-clean-up-parsed-ccs-static-data-on-parse-failure.patch @@ -0,0 +1,72 @@ +From da73efa8e675a2b58f1c7ae61201acfe57714bf7 Mon Sep 17 00:00:00 2001 +From: Sakari Ailus +Date: Tue, 3 Dec 2024 12:23:01 +0200 +Subject: media: ccs: Clean up parsed CCS static data on parse failure + +From: Sakari Ailus + +commit da73efa8e675a2b58f1c7ae61201acfe57714bf7 upstream. + +ccs_data_parse() releases the allocated in-memory data structure when the +parser fails, but it does not clean up parsed metadata that is there to +help access the actual data. Do that, in order to return the data +structure in a sane state. + +Fixes: a6b396f410b1 ("media: ccs: Add CCS static data parser library") +Cc: stable@vger.kernel.org +Signed-off-by: Sakari Ailus +Reviewed-by: Mehdi Djait +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/ccs/ccs-data.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/drivers/media/i2c/ccs/ccs-data.c ++++ b/drivers/media/i2c/ccs/ccs-data.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "ccs-data-defs.h" + +@@ -948,15 +949,15 @@ int ccs_data_parse(struct ccs_data_conta + + rval = __ccs_data_parse(&bin, ccsdata, data, len, dev, verbose); + if (rval) +- return rval; ++ goto out_cleanup; + + rval = bin_backing_alloc(&bin); + if (rval) +- return rval; ++ goto out_cleanup; + + rval = __ccs_data_parse(&bin, ccsdata, data, len, dev, false); + if (rval) +- goto out_free; ++ goto out_cleanup; + + if (verbose && ccsdata->version) + print_ccs_data_version(dev, ccsdata->version); +@@ -965,15 +966,16 @@ int ccs_data_parse(struct ccs_data_conta + rval = -EPROTO; + dev_dbg(dev, "parsing mismatch; base %p; now %p; end %p\n", + bin.base, bin.now, bin.end); +- goto out_free; ++ goto out_cleanup; + } + + ccsdata->backing = bin.base; + + return 0; + +-out_free: ++out_cleanup: + kvfree(bin.base); ++ memset(ccsdata, 0, sizeof(*ccsdata)); + + return rval; + } diff --git a/queue-5.15/media-ccs-fix-ccs-static-data-parsing-for-large-block-sizes.patch b/queue-5.15/media-ccs-fix-ccs-static-data-parsing-for-large-block-sizes.patch new file mode 100644 index 0000000000..21c10db3da --- /dev/null +++ b/queue-5.15/media-ccs-fix-ccs-static-data-parsing-for-large-block-sizes.patch @@ -0,0 +1,37 @@ +From 82b696750f0b60e7513082a10ad42786854f59f8 Mon Sep 17 00:00:00 2001 +From: Sakari Ailus +Date: Tue, 3 Dec 2024 10:10:23 +0200 +Subject: media: ccs: Fix CCS static data parsing for large block sizes + +From: Sakari Ailus + +commit 82b696750f0b60e7513082a10ad42786854f59f8 upstream. + +The length field of the CCS static data blocks was mishandled, leading to +wrong interpretation of the length header for blocks that are 16 kiB in +size. Such large blocks are very, very rare and so this wasn't found +earlier. + +As the length is used as part of input validation, the issue has no +security implications. + +Fixes: a6b396f410b1 ("media: ccs: Add CCS static data parser library") +Cc: stable@vger.kernel.org +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/ccs/ccs-data.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/i2c/ccs/ccs-data.c ++++ b/drivers/media/i2c/ccs/ccs-data.c +@@ -98,7 +98,7 @@ ccs_data_parse_length_specifier(const st + plen = ((size_t) + (__len3->length[0] & + ((1 << CCS_DATA_LENGTH_SPECIFIER_SIZE_SHIFT) - 1)) +- << 16) + (__len3->length[0] << 8) + __len3->length[1]; ++ << 16) + (__len3->length[1] << 8) + __len3->length[2]; + break; + } + default: diff --git a/queue-5.15/media-ccs-fix-cleanup-order-in-ccs_probe.patch b/queue-5.15/media-ccs-fix-cleanup-order-in-ccs_probe.patch new file mode 100644 index 0000000000..0f28cade19 --- /dev/null +++ b/queue-5.15/media-ccs-fix-cleanup-order-in-ccs_probe.patch @@ -0,0 +1,44 @@ +From 6fdbff0f54786e94f0f630ff200ec1d666b1633e Mon Sep 17 00:00:00 2001 +From: Mehdi Djait +Date: Wed, 11 Dec 2024 14:30:45 +0100 +Subject: media: ccs: Fix cleanup order in ccs_probe() + +From: Mehdi Djait + +commit 6fdbff0f54786e94f0f630ff200ec1d666b1633e upstream. + +ccs_limits is allocated in ccs_read_all_limits() after the allocation of +mdata.backing. Ensure that resources are freed in the reverse order of +their allocation by moving out_free_ccs_limits up. + +Fixes: a11d3d6891f0 ("media: ccs: Read CCS static data from firmware binaries") +Cc: stable@vger.kernel.org +Signed-off-by: Mehdi Djait +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/ccs/ccs-core.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/media/i2c/ccs/ccs-core.c ++++ b/drivers/media/i2c/ccs/ccs-core.c +@@ -3652,15 +3652,15 @@ out_media_entity_cleanup: + out_cleanup: + ccs_cleanup(sensor); + ++out_free_ccs_limits: ++ kfree(sensor->ccs_limits); ++ + out_release_mdata: + kvfree(sensor->mdata.backing); + + out_release_sdata: + kvfree(sensor->sdata.backing); + +-out_free_ccs_limits: +- kfree(sensor->ccs_limits); +- + out_power_off: + ccs_power_off(&client->dev); + mutex_destroy(&sensor->mutex); diff --git a/queue-5.15/media-mc-fix-endpoint-iteration.patch b/queue-5.15/media-mc-fix-endpoint-iteration.patch new file mode 100644 index 0000000000..65de02b0e2 --- /dev/null +++ b/queue-5.15/media-mc-fix-endpoint-iteration.patch @@ -0,0 +1,42 @@ +From fb2bd86270cd0ad004f4c614ba4f8c63a5720e25 Mon Sep 17 00:00:00 2001 +From: Cosmin Tanislav +Date: Fri, 22 Nov 2024 16:55:24 +0200 +Subject: media: mc: fix endpoint iteration + +From: Cosmin Tanislav + +commit fb2bd86270cd0ad004f4c614ba4f8c63a5720e25 upstream. + +When creating links from a subdev to a sink, the current logic tries to +iterate over the endpoints of dev's fwnode. + +This might not be correct when the subdev uses a different fwnode +compared to the dev's fwnode. + +If, when registering, the subdev's fwnode is not set, the code inside +v4l2_async_register_subdev will set it to the dev's fwnode. + +To fix this, just use the subdev's fwnode. + +Signed-off-by: Cosmin Tanislav +Fixes: 0d3c81e82da9 ("media: v4l2-mc: add v4l2_create_fwnode_links helpers") +Cc: stable@vger.kernel.org +Reviewed-by: Laurent Pinchart +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/v4l2-core/v4l2-mc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/v4l2-core/v4l2-mc.c ++++ b/drivers/media/v4l2-core/v4l2-mc.c +@@ -321,7 +321,7 @@ int v4l2_create_fwnode_links_to_pad(stru + + sink_sd = media_entity_to_v4l2_subdev(sink->entity); + +- fwnode_graph_for_each_endpoint(dev_fwnode(src_sd->dev), endpoint) { ++ fwnode_graph_for_each_endpoint(src_sd->fwnode, endpoint) { + struct fwnode_handle *remote_ep; + int src_idx, sink_idx, ret; + struct media_pad *src; diff --git a/queue-5.15/media-ov5640-fix-get_light_freq-on-auto.patch b/queue-5.15/media-ov5640-fix-get_light_freq-on-auto.patch new file mode 100644 index 0000000000..049bce8029 --- /dev/null +++ b/queue-5.15/media-ov5640-fix-get_light_freq-on-auto.patch @@ -0,0 +1,33 @@ +From 001d3753538d26ddcbef011f5643cfff58a7f672 Mon Sep 17 00:00:00 2001 +From: Sam Bobrowicz +Date: Fri, 22 Nov 2024 09:28:01 +0100 +Subject: media: ov5640: fix get_light_freq on auto + +From: Sam Bobrowicz + +commit 001d3753538d26ddcbef011f5643cfff58a7f672 upstream. + +Light frequency was not properly returned when in auto +mode and the detected frequency was 60Hz. + +Fixes: 19a81c1426c1 ("[media] add Omnivision OV5640 sensor driver") +Cc: stable@vger.kernel.org +Signed-off-by: Sam Bobrowicz +Signed-off-by: Michal Simek +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/i2c/ov5640.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/media/i2c/ov5640.c ++++ b/drivers/media/i2c/ov5640.c +@@ -1406,6 +1406,7 @@ static int ov5640_get_light_freq(struct + light_freq = 50; + } else { + /* 60Hz */ ++ light_freq = 60; + } + } + diff --git a/queue-5.15/media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch b/queue-5.15/media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch new file mode 100644 index 0000000000..32c5b9692e --- /dev/null +++ b/queue-5.15/media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch @@ -0,0 +1,46 @@ +From c31cffd5ae2c3d7ef21d9008977a9d117ce7a64e Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda +Date: Thu, 14 Nov 2024 19:10:30 +0000 +Subject: media: uvcvideo: Fix event flags in uvc_ctrl_send_events + +From: Ricardo Ribalda + +commit c31cffd5ae2c3d7ef21d9008977a9d117ce7a64e upstream. + +If there is an event that needs the V4L2_EVENT_CTRL_CH_FLAGS flag, all +the following events will have that flag, regardless if they need it or +not. + +This is because we keep using the same variable all the time and we do +not reset its original value. + +Cc: stable@vger.kernel.org +Fixes: 805e9b4a06bf ("[media] uvcvideo: Send control change events for slave ctrls when the master changes") +Signed-off-by: Ricardo Ribalda +Reviewed-by: Laurent Pinchart +Link: https://lore.kernel.org/r/20241114-uvc-roi-v15-1-64cfeb56b6f8@chromium.org +Signed-off-by: Laurent Pinchart +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/uvc/uvc_ctrl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/usb/uvc/uvc_ctrl.c ++++ b/drivers/media/usb/uvc/uvc_ctrl.c +@@ -1511,13 +1511,13 @@ static void uvc_ctrl_send_events(struct + { + struct uvc_control_mapping *mapping; + struct uvc_control *ctrl; +- u32 changes = V4L2_EVENT_CTRL_CH_VALUE; + unsigned int i; + unsigned int j; + + for (i = 0; i < xctrls_count; ++i) { +- ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping); ++ u32 changes = V4L2_EVENT_CTRL_CH_VALUE; + ++ ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping); + if (ctrl->info.flags & UVC_CTRL_FLAG_ASYNCHRONOUS) + /* Notification will be sent from an Interrupt event. */ + continue; diff --git a/queue-5.15/media-uvcvideo-remove-redundant-null-assignment.patch b/queue-5.15/media-uvcvideo-remove-redundant-null-assignment.patch new file mode 100644 index 0000000000..a92a098749 --- /dev/null +++ b/queue-5.15/media-uvcvideo-remove-redundant-null-assignment.patch @@ -0,0 +1,40 @@ +From 04d3398f66d2d31c4b8caea88f051a4257b7a161 Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda +Date: Tue, 3 Dec 2024 21:20:09 +0000 +Subject: media: uvcvideo: Remove redundant NULL assignment + +From: Ricardo Ribalda + +commit 04d3398f66d2d31c4b8caea88f051a4257b7a161 upstream. + +ctrl->handle will only be different than NULL for controls that have +mappings. This is because that assignment is only done inside +uvc_ctrl_set() for mapped controls. + +Cc: stable@vger.kernel.org +Fixes: e5225c820c05 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives") +Reviewed-by: Laurent Pinchart +Reviewed-by: Hans de Goede +Signed-off-by: Ricardo Ribalda +Link: https://lore.kernel.org/r/20241203-uvc-fix-async-v6-2-26c867231118@chromium.org +Signed-off-by: Laurent Pinchart +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/uvc/uvc_ctrl.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/media/usb/uvc/uvc_ctrl.c ++++ b/drivers/media/usb/uvc/uvc_ctrl.c +@@ -1478,10 +1478,8 @@ bool uvc_ctrl_status_event_async(struct + struct uvc_device *dev = chain->dev; + struct uvc_ctrl_work *w = &dev->async_ctrl; + +- if (list_empty(&ctrl->info.mappings)) { +- ctrl->handle = NULL; ++ if (list_empty(&ctrl->info.mappings)) + return false; +- } + + w->data = data; + w->urb = urb; diff --git a/queue-5.15/series b/queue-5.15/series index f4dbbff0a0..f3513c8211 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -308,3 +308,12 @@ x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.patch arm64-dts-qcom-sm8350-fix-mpss-memory-length.patch crypto-qce-fix-priority-to-be-less-than-armv8-ce.patch xfs-add-error-handling-for-xfs_reflink_cancel_cow_range.patch +media-ccs-clean-up-parsed-ccs-static-data-on-parse-failure.patch +iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch +soc-qcom-smem_state-fix-missing-of_node_put-in-error-path.patch +media-mc-fix-endpoint-iteration.patch +media-ov5640-fix-get_light_freq-on-auto.patch +media-ccs-fix-ccs-static-data-parsing-for-large-block-sizes.patch +media-ccs-fix-cleanup-order-in-ccs_probe.patch +media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch +media-uvcvideo-remove-redundant-null-assignment.patch diff --git a/queue-5.15/soc-qcom-smem_state-fix-missing-of_node_put-in-error-path.patch b/queue-5.15/soc-qcom-smem_state-fix-missing-of_node_put-in-error-path.patch new file mode 100644 index 0000000000..51767bbe99 --- /dev/null +++ b/queue-5.15/soc-qcom-smem_state-fix-missing-of_node_put-in-error-path.patch @@ -0,0 +1,35 @@ +From 70096b4990848229d0784c5e51dc3c7c072f1111 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 22 Aug 2024 18:48:51 +0200 +Subject: soc: qcom: smem_state: fix missing of_node_put in error path + +From: Krzysztof Kozlowski + +commit 70096b4990848229d0784c5e51dc3c7c072f1111 upstream. + +If of_parse_phandle_with_args() succeeds, the OF node reference should +be dropped, regardless of number of phandle arguments. + +Cc: stable@vger.kernel.org +Fixes: 9460ae2ff308 ("soc: qcom: Introduce common SMEM state machine code") +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Dmitry Baryshkov +Link: https://lore.kernel.org/r/20240822164853.231087-2-krzysztof.kozlowski@linaro.org +Signed-off-by: Bjorn Andersson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/qcom/smem_state.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/soc/qcom/smem_state.c ++++ b/drivers/soc/qcom/smem_state.c +@@ -116,7 +116,8 @@ struct qcom_smem_state *qcom_smem_state_ + + if (args.args_count != 1) { + dev_err(dev, "invalid #qcom,smem-state-cells\n"); +- return ERR_PTR(-EINVAL); ++ state = ERR_PTR(-EINVAL); ++ goto put; + } + + state = of_node_to_state(args.np);