From: Greg Kroah-Hartman Date: Mon, 8 Jan 2024 15:03:25 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v4.14.336~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a37851c72725895c797b121934a5c9c036e38030;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: media-qcom-camss-comment-csid-dt_id-field.patch --- diff --git a/queue-6.6/media-qcom-camss-comment-csid-dt_id-field.patch b/queue-6.6/media-qcom-camss-comment-csid-dt_id-field.patch new file mode 100644 index 00000000000..411c667c7e1 --- /dev/null +++ b/queue-6.6/media-qcom-camss-comment-csid-dt_id-field.patch @@ -0,0 +1,61 @@ +From f910d3ba78a2677c23508f225eb047d89eb4b2b6 Mon Sep 17 00:00:00 2001 +From: Bryan O'Donoghue +Date: Thu, 28 Sep 2023 01:58:25 +0100 +Subject: media: qcom: camss: Comment CSID dt_id field + +From: Bryan O'Donoghue + +commit f910d3ba78a2677c23508f225eb047d89eb4b2b6 upstream. + +Digging into the documentation we find that the DT_ID bitfield is used to +map the six bit DT to a two bit ID code. This value is concatenated to the +VC bitfield to create a CID value. DT_ID is the two least significant bits +of CID and VC the most significant bits. + +Originally we set dt_id = vc * 4 in and then subsequently set dt_id = vc. + +commit 3c4ed72a16bc ("media: camss: sm8250: Virtual channels for CSID") +silently fixed the multiplication by four which would give a better +value for the generated CID without mentioning what was being done or why. + +Next up I haplessly changed the value back to "dt_id = vc * 4" since there +didn't appear to be any logic behind it. + +Hans asked what the change was for and I honestly couldn't remember the +provenance of it, so I dug in. + +Link: https://lore.kernel.org/linux-arm-msm/edd4bf9b-0e1b-883c-1a4d-50f4102c3924@xs4all.nl/ + +Add a comment so the next hapless programmer doesn't make this same +mistake. + +Signed-off-by: Bryan O'Donoghue +Signed-off-by: Hans Verkuil +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/qcom/camss/camss-csid-gen2.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +--- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c ++++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c +@@ -352,7 +352,19 @@ static void __csid_configure_stream(stru + phy_sel = csid->phy.csiphy_id; + + if (enable) { +- u8 dt_id = vc; ++ /* ++ * DT_ID is a two bit bitfield that is concatenated with ++ * the four least significant bits of the five bit VC ++ * bitfield to generate an internal CID value. ++ * ++ * CSID_RDI_CFG0(vc) ++ * DT_ID : 28:27 ++ * VC : 26:22 ++ * DT : 21:16 ++ * ++ * CID : VC 3:0 << 2 | DT_ID 1:0 ++ */ ++ u8 dt_id = vc & 0x03; + + if (tg->enabled) { + /* configure one DT, infinite frames */ diff --git a/queue-6.6/series b/queue-6.6/series index d53bc2bcdc3..f24beb9afba 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -121,3 +121,4 @@ mmc-sdhci-sprd-fix-emmc-init-failure-after-hw-reset.patch cxl-add-cxl_num_decoders_committed-usage-to-cxl_test.patch cxl-hdm-fix-a-benign-lockdep-splat.patch cxl-memdev-hold-region_rwsem-during-inject-and-clear-poison-ops.patch +media-qcom-camss-comment-csid-dt_id-field.patch