[PATCH] firewire: core: send bus reset promptly on gap count error
Brought to you by:
aeb,
bencollins
From: Adam G. <ad...@po...> - 2024-01-23 08:11:55
|
If we are bus manager and the bus has inconsistent gap counts, send a bus reset immediately instead of trying to read the root node's config ROM first. Otherwise, we could spend a lot of time trying to read the config ROM but never succeeding. This eliminates a 50+ second delay before the FireWire bus is usable after a newly connected device is powered on in certain circumstances. Signed-off-by: Adam Goldman <ad...@po...> Link: https://sourceforge.net/p/linux1394/mailman/message/58727806/ --- --- linux-source-6.1.orig/drivers/firewire/core-card.c 2023-09-23 02:11:13.000000000 -0700 +++ linux-source-6.1/drivers/firewire/core-card.c 2024-01-22 04:23:06.000000000 -0800 @@ -435,6 +435,16 @@ * config rom. In either case, pick another root. */ new_root_id = local_id; + } else if (card->gap_count == 0) { + /* + * If self IDs have inconsistent gap counts, do a + * bus reset ASAP. The config rom read might never + * complete, so don't wait for it. However, still + * send a PHY configuration packet prior to the bus + * reset, as permitted by IEEE 1394-2008 8.4.5.2. + */ + new_root_id = local_id; + card->bm_retries = 0; } else if (!root_device_is_running) { /* * If we haven't probed this device yet, bail out now |