Browse Source

firewire: fw-sbp2: skip unnecessary logout

Don't attempt to send a logout ORB if the target was already unplugged
or had its link switched off.  If two targets are attached, this
enhances the chance to quickly reconnect to the remaining target when
one target is plugged out.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Stefan Richter 17 years ago
parent
commit
4dccd020d7
1 changed files with 6 additions and 2 deletions
  1. 6 2
      drivers/firewire/fw-sbp2.c

+ 6 - 2
drivers/firewire/fw-sbp2.c

@@ -606,13 +606,17 @@ static void sbp2_release_target(struct kref *kref)
 	struct sbp2_logical_unit *lu, *next;
 	struct sbp2_logical_unit *lu, *next;
 	struct Scsi_Host *shost =
 	struct Scsi_Host *shost =
 		container_of((void *)tgt, struct Scsi_Host, hostdata[0]);
 		container_of((void *)tgt, struct Scsi_Host, hostdata[0]);
+	struct fw_device *device = fw_device(tgt->unit->device.parent);
 
 
 	list_for_each_entry_safe(lu, next, &tgt->lu_list, link) {
 	list_for_each_entry_safe(lu, next, &tgt->lu_list, link) {
 		if (lu->sdev)
 		if (lu->sdev)
 			scsi_remove_device(lu->sdev);
 			scsi_remove_device(lu->sdev);
 
 
-		sbp2_send_management_orb(lu, tgt->node_id, lu->generation,
-				SBP2_LOGOUT_REQUEST, lu->login_id, NULL);
+		if (!fw_device_is_shutdown(device))
+			sbp2_send_management_orb(lu, tgt->node_id,
+					lu->generation, SBP2_LOGOUT_REQUEST,
+					lu->login_id, NULL);
+
 		fw_core_remove_address_handler(&lu->address_handler);
 		fw_core_remove_address_handler(&lu->address_handler);
 		list_del(&lu->link);
 		list_del(&lu->link);
 		kfree(lu);
 		kfree(lu);