Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794045785; b=cM3SvsXMrKN0Kfj/vXiAR4T8KYpV5hJvUc/bep8GHQlS3GmdGgsuayJ1oVwrjR8WumAm JtjD9SAaYlTXgIAk+b+efzt47ZEGHc9qUIH7sLnIXYny1+MLCjppbGtTW3N0JRUqLR1yn xLuH5Iy1oFdYKHO17x+0lMZgjckg1/hfSLuMfdFtyuNZHDixb62fb37YQ1LxG3Zl8ICFW /Cx5ELpAhp8U8qRhetw4VFREz0S2nU4apdCdf7vRm8Pln6XTiLgpBXvBYqxL4J7fiwTwC N95PWaK6R6suGl0TWlqx2cTFEppaOki1qJGihY4pKZGxPEIDgR+0ayyDT0M0rQoP4AA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794045785; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=lJmy650kuZfoBTooc4keXlmXD5N0tm199oFU+6B3gfc=; b=MZeayh4ViJPC5RRhzTpJGW9scCjWW7OZjTgg4b5HBTs5EYorSRjNbhr+au3fL5Nr5+aG ga2Eyz+JibF0w8e1cTVdQ54amhQEd/ZQLhmkKwE23tjK05MRDeRbdM8HLvErF2XninBUm JK0o3NMgmEUXnS4J7QP6Q9TMnMjxamWv/gGnUxQttaf7RVuJNs39wk2jyIg2z0U5cjkTv 66VDJfBaTqyaDF38/OTo31wSnBnxjeSpsC96jFiPqzm4C1kPnQJy9FRI7C08KVeqD+wzh 5H+3Y+moOSdXM9kyNwmTMiRMWhCBSHYowiC5qGsf66S/q65pqlBojK0zMejJKlz1uIw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="QBTB/AQI"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1BA0606A32F for ; Sat, 7 Nov 2026 10:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QBTB/AQI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BA871F0089F; Sat, 7 Nov 2026 10:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794045784; bh=lJmy650kuZfoBTooc4keXlmXD5N0tm199oFU+6B3gfc=; h=From:To:Cc:Subject:Date; b=QBTB/AQIxnUfjBIFCSRTQMjn65FdBxHi+En7lXh9cs3qPC1OLwEwkYr57vRg5Z+Ns GVUsO/TnloLgKw7HfGHt4hTDWbM0G7pB84jo7kVDQ9mBI/JMAugoKS8LOIsXlwt+xn WkrS1czAtp5enqgM+pnjU+Styfymhp6oP9F1QtLacOOtS9Hc9J+2PZLnOwrq1W8OEi JvxBkeaBBZEqgQJTACYlqukHFw7f4y7WiUvFZ7eaUO0wPYUfRyBZYIqoDP6YnI1eqh 1Cp3tdmDvyNMCDQ0OzNUeS5G9LM8B0lqjEitD0AfW1Pd5WhAaUq8brXhEQoqDTnrqY TnEaUgJYcSxdQ== From: Sasha Levin To: balakrishnan.s@microchip.com, ehristev@kernel.org, hverkuil+cisco@kernel.org Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] media: microchip-isc: fix WB offset and gain register field masking" failed to apply to 7.3-stable tree Date: Sat, 7 Nov 2026 05:03:03 -0500 Message-ID: <20261107050303-failed-7.3-6e9eaa3b9387@kernel.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 7.3-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.3.y git checkout FETCH_HEAD git cherry-pick -x 6e9eaa3b93870e4edac1bd2539fe113c24663eaf # git commit -s git send-email --to '' --in-reply-to '20261107050303-failed-7.3-6e9eaa3b9387@kernel.org' --subject-prefix 'PATCH 7.3.y' 'HEAD^..' Thanks, Sasha ------------------ original commit in Linus's tree ------------------ From 6e9eaa3b93870e4edac1bd2539fe113c24663eaf Mon Sep 17 00:00:00 2001 From: Balakrishnan Sambath Date: Mon, 17 Aug 2026 12:22:07 +0530 Subject: [PATCH] media: microchip-isc: fix WB offset and gain register field masking ISC_WB_O_* and ISC_WB_G_* each pack two 13-bit fields. A negative offset sign-extends and corrupts the adjacent field. Add masks for the two fields and write them with FIELD_PREP(), which masks each value into its field, so sign extension can no longer bleed across. Fixes: 73c1a577b839 ("media: atmel: atmel-isc: reworked white balance feature") Cc: stable@vger.kernel.org Reviewed-by: Eugen Hristev Signed-off-by: Balakrishnan Sambath Signed-off-by: Hans Verkuil --- .../platform/microchip/microchip-isc-base.c | 16 ++++++++-------- .../platform/microchip/microchip-isc-regs.h | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index e5ecf6ffd24a8..963d5fd53b589 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -63,17 +63,17 @@ static inline void isc_update_awb_ctrls(struct isc_device *isc) /* In here we set our actual hw pipeline config */ regmap_write(isc->regmap, ISC_WB_O_RGR, - ((ctrls->offset[ISC_HIS_CFG_MODE_R])) | - ((ctrls->offset[ISC_HIS_CFG_MODE_GR]) << 16)); + FIELD_PREP(ISC_WB_O_LO, ctrls->offset[ISC_HIS_CFG_MODE_R]) | + FIELD_PREP(ISC_WB_O_HI, ctrls->offset[ISC_HIS_CFG_MODE_GR])); regmap_write(isc->regmap, ISC_WB_O_BGB, - ((ctrls->offset[ISC_HIS_CFG_MODE_B])) | - ((ctrls->offset[ISC_HIS_CFG_MODE_GB]) << 16)); + FIELD_PREP(ISC_WB_O_LO, ctrls->offset[ISC_HIS_CFG_MODE_B]) | + FIELD_PREP(ISC_WB_O_HI, ctrls->offset[ISC_HIS_CFG_MODE_GB])); regmap_write(isc->regmap, ISC_WB_G_RGR, - ctrls->gain[ISC_HIS_CFG_MODE_R] | - (ctrls->gain[ISC_HIS_CFG_MODE_GR] << 16)); + FIELD_PREP(ISC_WB_G_LO, ctrls->gain[ISC_HIS_CFG_MODE_R]) | + FIELD_PREP(ISC_WB_G_HI, ctrls->gain[ISC_HIS_CFG_MODE_GR])); regmap_write(isc->regmap, ISC_WB_G_BGB, - ctrls->gain[ISC_HIS_CFG_MODE_B] | - (ctrls->gain[ISC_HIS_CFG_MODE_GB] << 16)); + FIELD_PREP(ISC_WB_G_LO, ctrls->gain[ISC_HIS_CFG_MODE_B]) | + FIELD_PREP(ISC_WB_G_HI, ctrls->gain[ISC_HIS_CFG_MODE_GB])); } static inline void isc_reset_awb_ctrls(struct isc_device *isc) diff --git a/drivers/media/platform/microchip/microchip-isc-regs.h b/drivers/media/platform/microchip/microchip-isc-regs.h index 9ddbbb6dd68bf..fe145b142b826 100644 --- a/drivers/media/platform/microchip/microchip-isc-regs.h +++ b/drivers/media/platform/microchip/microchip-isc-regs.h @@ -149,6 +149,12 @@ /* ISC White Balance Gain for B, GB Register */ #define ISC_WB_G_BGB 0x0000006c +/* Each WB offset/gain register packs two 13-bit fields, low and high */ +#define ISC_WB_O_LO GENMASK(12, 0) /* R or B offset [12:0] */ +#define ISC_WB_O_HI GENMASK(28, 16) /* GR or GB offset [28:16] */ +#define ISC_WB_G_LO GENMASK(12, 0) /* R or B gain [12:0] */ +#define ISC_WB_G_HI GENMASK(28, 16) /* GR or GB gain [28:16] */ + /* ISC Color Filter Array Control Register */ #define ISC_CFA_CTRL 0x00000070 -- 2.53.0