From: Ben Hoff <hoff.benjamin.k@gmail.com>
To: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mchehab@kernel.org,
Hans Verkuil <hverkuil+cisco@kernel.org>
Subject: [PATCH] media: hws: fix device info register field masks
Date: Sat, 1 Aug 2026 01:37:41 -0400 [thread overview]
Message-ID: <20260801053741.805829-1-hoff.benjamin.k@gmail.com> (raw)
The baseline driver decodes the device version from bits 15:8 and the
sub-version from bits 23:16 of HWS_REG_DEVICE_INFO. The current masks
decode both fields one byte too low, reading the device version from a
byte the baseline driver ignores and the sub-version from the device
version field.
hws_configure_hardware_capabilities() uses the device version to
classify the hardware generation. An incorrect version can classify
newer hardware as legacy, select the legacy capture path, and skip
HWS_REG_DMA_MAX_SIZE programming.
Correct both field masks and update the register layout documentation.
Signed-off-by: Ben Hoff <hoff.benjamin.k@gmail.com>
---
drivers/media/pci/hws/hws_pci.c | 4 ++--
drivers/media/pci/hws/hws_reg.h | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/media/pci/hws/hws_pci.c b/drivers/media/pci/hws/hws_pci.c
index 30bb7d34465b..75be77d6c197 100644
--- a/drivers/media/pci/hws/hws_pci.c
+++ b/drivers/media/pci/hws/hws_pci.c
@@ -33,8 +33,8 @@ static unsigned long long hws_elapsed_us(u64 start_ns)
}
/* register layout inside HWS_REG_DEVICE_INFO */
-#define DEVINFO_VER GENMASK(7, 0)
-#define DEVINFO_SUBVER GENMASK(15, 8)
+#define DEVINFO_VER GENMASK(15, 8)
+#define DEVINFO_SUBVER GENMASK(23, 16)
#define DEVINFO_YV12 GENMASK(31, 28)
#define DEVINFO_HWKEY GENMASK(27, 24)
#define DEVINFO_PORTID GENMASK(25, 24) /* low 2 bits of HW-key */
diff --git a/drivers/media/pci/hws/hws_reg.h b/drivers/media/pci/hws/hws_reg.h
index e4fb4af44434..ac607360d628 100644
--- a/drivers/media/pci/hws/hws_reg.h
+++ b/drivers/media/pci/hws/hws_reg.h
@@ -121,9 +121,10 @@
#define HWS_REG_DEVICE_INFO (CVBS_IN_BASE + 88 * PCIE_BARADDROFSIZE)
/*
* Reading this 32-bit word returns:
- * bits 7:0 = "device version"
- * bits 15:8 = "device sub-version"
- * bits 23:24 = "HW key / port ID" etc.
+ * bits 7:0 = unused by the baseline driver
+ * bits 15:8 = device version
+ * bits 23:16 = device sub-version
+ * bits 27:24 = HW key (port ID in bits 25:24)
* bits 31:28 = "support YV12" flags
*/
--
2.43.0
reply other threads:[~2026-08-01 5:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260801053741.805829-1-hoff.benjamin.k@gmail.com \
--to=hoff.benjamin.k@gmail.com \
--cc=hverkuil+cisco@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox