From: Greg Kroah-Hartman Date: Mon, 10 Feb 2025 15:14:24 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v6.6.77~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ea41ccb4482fcfc3e241c2dbf114822c9b6f67a;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.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.10/iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch b/queue-5.10/iio-light-as73211-fix-channel-handling-in-only-color-triggered-buffer.patch new file mode 100644 index 0000000000..eb0ded4f54 --- /dev/null +++ b/queue-5.10/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 +@@ -155,6 +155,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, +@@ -603,9 +609,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) { +@@ -613,9 +622,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)); +@@ -685,6 +700,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.10/media-mc-fix-endpoint-iteration.patch b/queue-5.10/media-mc-fix-endpoint-iteration.patch new file mode 100644 index 0000000000..65de02b0e2 --- /dev/null +++ b/queue-5.10/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.10/media-ov5640-fix-get_light_freq-on-auto.patch b/queue-5.10/media-ov5640-fix-get_light_freq-on-auto.patch new file mode 100644 index 0000000000..4855af39f2 --- /dev/null +++ b/queue-5.10/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 +@@ -1380,6 +1380,7 @@ static int ov5640_get_light_freq(struct + light_freq = 50; + } else { + /* 60Hz */ ++ light_freq = 60; + } + } + diff --git a/queue-5.10/media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch b/queue-5.10/media-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch new file mode 100644 index 0000000000..eeeb3850c3 --- /dev/null +++ b/queue-5.10/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 +@@ -1400,13 +1400,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.10/media-uvcvideo-remove-redundant-null-assignment.patch b/queue-5.10/media-uvcvideo-remove-redundant-null-assignment.patch new file mode 100644 index 0000000000..29e9a94545 --- /dev/null +++ b/queue-5.10/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 +@@ -1367,10 +1367,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.10/series b/queue-5.10/series index de63676272..79088b26cf 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -216,3 +216,9 @@ scsi-qla2xxx-move-fce-trace-buffer-allocation-to-user-control.patch scsi-storvsc-set-correct-data-length-for-sending-scsi-command-without-payload.patch kbuild-move-wenum-enum-conversion-to-w-2.patch x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.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-uvcvideo-fix-event-flags-in-uvc_ctrl_send_events.patch +media-uvcvideo-remove-redundant-null-assignment.patch diff --git a/queue-5.10/soc-qcom-smem_state-fix-missing-of_node_put-in-error-path.patch b/queue-5.10/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.10/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);