ieee1394: sbp2: let nodemgr retry node updates during bus reset series

sbp2 was too quick to report .update() to the ieee1394 core as failed.
(Logged as "Failed to reconnect to sbp2 device!".) The core would then
unbind sbp2 from the device.

This is not justified if the .update() failed because another bus reset
happened. We check this and tell the ieee1394 that .update() succeeded,
and the core will call sbp2's .update() for the new bus reset as well.

This improves reconnection/re-login especially on buses with several
disks as they may issue bus resets in close succession when they come
online.

Tested by Damien Benoist.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+18 -7
+18 -7
drivers/ieee1394/sbp2.c
··· 731 731 { 732 732 struct sbp2_lu *lu = ud->device.driver_data; 733 733 734 - if (sbp2_reconnect_device(lu)) { 735 - /* Reconnect has failed. Perhaps we didn't reconnect fast 736 - * enough. Try a regular login, but first log out just in 737 - * case of any weirdness. */ 734 + if (sbp2_reconnect_device(lu) != 0) { 735 + /* 736 + * Reconnect failed. If another bus reset happened, 737 + * let nodemgr proceed and call sbp2_update again later 738 + * (or sbp2_remove if this node went away). 739 + */ 740 + if (!hpsb_node_entry_valid(lu->ne)) 741 + return 0; 742 + /* 743 + * Or the target rejected the reconnect because we weren't 744 + * fast enough. Try a regular login, but first log out 745 + * just in case of any weirdness. 746 + */ 738 747 sbp2_logout_device(lu); 739 748 740 - if (sbp2_login_device(lu)) { 741 - /* Login failed too, just fail, and the backend 742 - * will call our sbp2_remove for us */ 749 + if (sbp2_login_device(lu) != 0) { 750 + if (!hpsb_node_entry_valid(lu->ne)) 751 + return 0; 752 + 753 + /* Maybe another initiator won the login. */ 743 754 SBP2_ERR("Failed to reconnect to sbp2 device!"); 744 755 return -EBUSY; 745 756 }