[PATCH 03/13] firewire: core: add test to detect irm-ignores-bus-manager quirk in config ROM parser

From: Takashi Sakamoto

Date: Tue Sep 01 2026 - 11:46:45 EST


Some Canon DV cameras have a quirk where they malfunction as non-root
nodes by ignoring the bus manager. This quirk was supported by commit
6044565af458e ("firewire: core: fix unstable I/O with Canon camcorder")
and refactored by commit 5a43dc9f4ee0 ("firewire: core: detect device
quirk when reading configuration ROM").

Add a KUnit test to verify that the configuration ROM parser detects the
quirk correctly. The configuration ROM content is retrieved from the
following discussion:
https://bugzilla.redhat.com/show_bug.cgi?id=633260

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/config-rom-parser-test.c | 46 +++++++++++++++++++++++
1 file changed, 46 insertions(+)

diff --git a/drivers/firewire/config-rom-parser-test.c b/drivers/firewire/config-rom-parser-test.c
index 131c7aa3b224..11c01ef9efd9 100644
--- a/drivers/firewire/config-rom-parser-test.c
+++ b/drivers/firewire/config-rom-parser-test.c
@@ -45,6 +45,41 @@ static const u32 sony_dcr_trv310k_config_rom[] = {
0x00000000,
};

+static const u32 canon_mv5i_mc_config_rom[] = {
+ 0x0404e552,
+ 0x31333934,
+ 0xe0648100,
+ 0x00008500,
+ 0x005eb597,
+ 0x0007cdd0,
+ 0x03000085,
+ 0x8100000d,
+ 0x17000002,
+ 0x81000010,
+ 0x0c0083c0,
+ 0xd8000002,
+ 0xd1000003,
+ 0x0001ce96,
+ 0xd1000001,
+ 0x0004bbee,
+ 0x1200a02d,
+ 0x13010001,
+ 0x17000002,
+ 0x81000006,
+ 0x00046dc8,
+ 0x00000000,
+ 0x00000000,
+ 0x43616e6f,
+ 0x6e000000,
+ 0x000621ee,
+ 0x00000000,
+ 0x00000000,
+ 0x4d563569,
+ 0x204d4300,
+ 0x00000000,
+ 0x00000000,
+};
+
static const struct parser_test_case {
const char *name;
const u32 *quadlets;
@@ -67,6 +102,17 @@ static const struct parser_test_case {
.expected_cmc = true,
.expected_irmc = true,
},
+ {
+ .name = "detect_irm_ignores_bus_manager_quirk",
+ .quadlets = canon_mv5i_mc_config_rom,
+ .quadlet_length = ARRAY_SIZE(canon_mv5i_mc_config_rom),
+ .phy_speed_in_self_id = SCODE_100,
+ .expected_speed = SCODE_100,
+ .expected_quirk = FW_DEVICE_QUIRK_IRM_IGNORES_BUS_MANAGER,
+ .expected_max_rec = 8,
+ .expected_cmc = true,
+ .expected_irmc = true,
+ },
};

// Define parser_test_gen_params.
--
2.53.0