aboutsummaryrefslogtreecommitdiff
path: root/drivers/firewire/core-card.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-06-10 08:23:28 +0200
committerClemens Ladisch <clemens@ladisch.de>2010-06-10 08:23:28 +0200
commitbda3b8a1faf209a98063ccd77d6833a2bb0fc77e (patch)
tree1f7146d8951a5addac9932a071a6f0e4a4d97182 /drivers/firewire/core-card.c
parent153e3979201b76dbd5788f032fb683e95121e159 (diff)
firewire: core: retry on local errors in bus manager election
When the candidate bus manager fails to do the lock request with which it tries to become bus manager, it assumes that the current IRM is not actually IRM capable and forces itself to become root. However, if that lock request failed because the local node itself was not able to send it, then we cannot blame the current IRM and should not steal its rootness. In this case, RCODE_SEND_ERROR is likely to indicate a temporary error condition such as exhausted tlabels or low memory, so we better try again later. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r--drivers/firewire/core-card.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index 9dcb30466ec..901435cdd5c 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -306,6 +306,16 @@ static void fw_card_bm_work(struct work_struct *work)
goto out;
}
+ if (rcode == RCODE_SEND_ERROR) {
+ /*
+ * We have been unable to send the lock request due to
+ * some local problem. Let's try again later and hope
+ * that the problem has gone away by then.
+ */
+ fw_schedule_bm_work(card, DIV_ROUND_UP(HZ, 8));
+ goto out;
+ }
+
spin_lock_irqsave(&card->lock, flags);
if (rcode != RCODE_COMPLETE) {