[PATCH 04/13] firewire: core: add test to detect ack-packet-with-invalid-pending-code quirk in config ROM parser

From: Takashi Sakamoto

Date: Tue Sep 01 2026 - 09:56:41 EST


MOTU Audio Express has a quirk where it transfers an invalid pending
code when receiving an asynchronous request. This quirk was originally
reported by commit 3a93d082bacf ("ALSA: firewire-motu: add support for
MOTU Audio Express") and later supported by commit 15f9610fc96a
("firewire: core: handle device quirk of MOTU Audio Express").

Add a KUnit test to verify that the configuration ROM parser detects the
quirk correctly. The configuration ROM content is retrieved from the
commit mentioned above.

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

diff --git a/drivers/firewire/config-rom-parser-test.c b/drivers/firewire/config-rom-parser-test.c
index 11c01ef9efd9..35ebe8a6b611 100644
--- a/drivers/firewire/config-rom-parser-test.c
+++ b/drivers/firewire/config-rom-parser-test.c
@@ -80,6 +80,26 @@ static const u32 canon_mv5i_mc_config_rom[] = {
0x00000000,
};

+static const u32 motu_audioexpress_config_rom[] = {
+ 0x0410a756,
+ 0x31333934,
+ 0x20ff7000,
+ 0x0001f200,
+ 0x000a8a7b,
+ 0x0004ef04,
+ 0x030001f2,
+ 0x0c0083c0,
+ 0xd1000002,
+ 0x8d000005,
+ 0x00031680,
+ 0x120001f2,
+ 0x13000033,
+ 0x17104800,
+ 0x00025ef3,
+ 0x0001f200,
+ 0x000a8a7b,
+};
+
static const struct parser_test_case {
const char *name;
const u32 *quadlets;
@@ -113,6 +133,17 @@ static const struct parser_test_case {
.expected_cmc = true,
.expected_irmc = true,
},
+ {
+ .name = "detect_ack_packet_with_invalid_pending_code_quirk",
+ .quadlets = motu_audioexpress_config_rom,
+ .quadlet_length = ARRAY_SIZE(motu_audioexpress_config_rom),
+ .phy_speed_in_self_id = SCODE_400,
+ .expected_speed = SCODE_400,
+ .expected_quirk = FW_DEVICE_QUIRK_ACK_PACKET_WITH_INVALID_PENDING_CODE,
+ .expected_max_rec = 7,
+ .expected_cmc = false,
+ .expected_irmc = false,
+ },
};

// Define parser_test_gen_params.
--
2.53.0