diff options
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
| -rw-r--r-- | drivers/ieee1394/sbp2.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 9cbf3154d243..1d6ad3435537 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
| @@ -731,15 +731,26 @@ static int sbp2_update(struct unit_directory *ud) | |||
| 731 | { | 731 | { |
| 732 | struct sbp2_lu *lu = ud->device.driver_data; | 732 | struct sbp2_lu *lu = ud->device.driver_data; |
| 733 | 733 | ||
| 734 | if (sbp2_reconnect_device(lu)) { | 734 | if (sbp2_reconnect_device(lu) != 0) { |
| 735 | /* Reconnect has failed. Perhaps we didn't reconnect fast | 735 | /* |
| 736 | * enough. Try a regular login, but first log out just in | 736 | * Reconnect failed. If another bus reset happened, |
| 737 | * case of any weirdness. */ | 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 | sbp2_logout_device(lu); | 747 | sbp2_logout_device(lu); |
| 739 | 748 | ||
| 740 | if (sbp2_login_device(lu)) { | 749 | if (sbp2_login_device(lu) != 0) { |
| 741 | /* Login failed too, just fail, and the backend | 750 | if (!hpsb_node_entry_valid(lu->ne)) |
| 742 | * will call our sbp2_remove for us */ | 751 | return 0; |
| 752 | |||
| 753 | /* Maybe another initiator won the login. */ | ||
| 743 | SBP2_ERR("Failed to reconnect to sbp2 device!"); | 754 | SBP2_ERR("Failed to reconnect to sbp2 device!"); |
| 744 | return -EBUSY; | 755 | return -EBUSY; |
| 745 | } | 756 | } |
