Skip to content

Commit d0b06dc

Browse files
committed
firewire: core: use long bus reset on gap count error
When resetting the bus after a gap count error, use a long rather than short bus reset. IEEE 1394-1995 uses only long bus resets. IEEE 1394a adds the option of short bus resets. When video or audio transmission is in progress and a device is hot-plugged elsewhere on the bus, the resulting bus reset can cause video frame drops or audio dropouts. Short bus resets reduce or eliminate this problem. Accordingly, short bus resets are almost always preferred. However, on a mixed 1394/1394a bus, a short bus reset can trigger an immediate additional bus reset. This double bus reset can be interpreted differently by different nodes on the bus, resulting in an inconsistent gap count after the bus reset. An inconsistent gap count will cause another bus reset, leading to a neverending bus reset loop. This only happens for some bus topologies, not for all mixed 1394/1394a buses. By instead sending a long bus reset after a gap count inconsistency, we avoid the doubled bus reset, restoring the bus to normal operation. Signed-off-by: Adam Goldman <adamg@pobox.com> Link: https://sourceforge.net/p/linux1394/mailman/message/58741624/ Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
1 parent d206a76 commit d0b06dc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/firewire/core-card.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,19 @@ static void bm_work(struct work_struct *work)
500500
fw_notice(card, "phy config: new root=%x, gap_count=%d\n",
501501
new_root_id, gap_count);
502502
fw_send_phy_config(card, new_root_id, generation, gap_count);
503-
reset_bus(card, true);
503+
/*
504+
* Where possible, use a short bus reset to minimize
505+
* disruption to isochronous transfers. But in the event
506+
* of a gap count inconsistency, use a long bus reset.
507+
*
508+
* As noted in 1394a 8.4.6.2, nodes on a mixed 1394/1394a bus
509+
* may set different gap counts after a bus reset. On a mixed
510+
* 1394/1394a bus, a short bus reset can get doubled. Some
511+
* nodes may treat the double reset as one bus reset and others
512+
* may treat it as two, causing a gap count inconsistency
513+
* again. Using a long bus reset prevents this.
514+
*/
515+
reset_bus(card, card->gap_count != 0);
504516
/* Will allocate broadcast channel after the reset. */
505517
goto out;
506518
}

0 commit comments

Comments
 (0)