diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-07-08 10:09:06 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-07-13 03:58:27 -0400 |
commit | 02d37bed188c500ee7afb0a2dc6b65a80704c58e (patch) | |
tree | a019891672a1505e35eb15fa2621caffecff2c80 /drivers/firewire/core-transaction.c | |
parent | 8b4f70ba4967cae90d128857af1382026a24230a (diff) |
firewire: core: integrate software-forced bus resets with bus management
Bus resets which are triggered
- by the kernel drivers after updates of the local nodes' config ROM,
- by userspace software via ioctl
shall be deferred until after >=2 seconds after the last bus reset.
If multiple modifications of the local nodes' config ROM happen in a row,
only a single bus reset should happen after them.
When the local node's link goes from inactive to active or vice versa,
and at the two occasions of bus resets mentioned above --- and if the
current gap count differs from 63 --- the bus reset should be preceded
by a PHY configuration packet that reaffirms the gap count. Otherwise a
bus manager would have to reset the bus again right after that.
This is necessary to promote bus stability, e.g. leave grace periods for
allocations and reallocations of isochronous channels and bandwidth,
SBP-2 reconnections etc.; see IEEE 1394 clause 8.2.1.
This change implements all of the above by moving bus reset initiation
into a delayed work (except for bus resets which are triggered by the
bus manager workqueue job and are performed there immediately). It
comes with a necessary addition to the card driver methods that allows
to get the current gap count from PHY registers.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r-- | drivers/firewire/core-transaction.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 7813da8a129..5f5a7852f7a 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c | |||
@@ -426,9 +426,21 @@ void fw_send_phy_config(struct fw_card *card, | |||
426 | int node_id, int generation, int gap_count) | 426 | int node_id, int generation, int gap_count) |
427 | { | 427 | { |
428 | long timeout = DIV_ROUND_UP(HZ, 10); | 428 | long timeout = DIV_ROUND_UP(HZ, 10); |
429 | u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) | | 429 | u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG); |
430 | PHY_CONFIG_ROOT_ID(node_id) | | 430 | |
431 | PHY_CONFIG_GAP_COUNT(gap_count); | 431 | if (node_id != FW_PHY_CONFIG_NO_NODE_ID) |
432 | data |= PHY_CONFIG_ROOT_ID(node_id); | ||
433 | |||
434 | if (gap_count == FW_PHY_CONFIG_CURRENT_GAP_COUNT) { | ||
435 | gap_count = card->driver->read_phy_reg(card, 1); | ||
436 | if (gap_count < 0) | ||
437 | return; | ||
438 | |||
439 | gap_count &= 63; | ||
440 | if (gap_count == 63) | ||
441 | return; | ||
442 | } | ||
443 | data |= PHY_CONFIG_GAP_COUNT(gap_count); | ||
432 | 444 | ||
433 | mutex_lock(&phy_config_mutex); | 445 | mutex_lock(&phy_config_mutex); |
434 | 446 | ||