scsi_transport_sas and device hotplug
Hello,
I have a question about this transport layer and SAS Hot plugging.
With a LSI1068 (SAS) card, I'm trying to do device hotplug. Back in the day I used the /proc calls below to hotplug a device.
scsi remove-single-device <args>
scsi add_single-device <args>
With 2.6.16-1 kernel, the "remove" call below works, the /dev/sd* structure is removed.
echo scsi remove-single-device 0 07 00 00 > /proc/scsi/scsi
However, this does not add the device back (the /dev/sd* node is not created):
echo scsi add-single-device 0 07 00 00 > /proc/scsi/scsi
I see the scsi_proc.c to scsi_transport_sas.c user_scan transport layer code and it seems hooked up properly. Before I debug, has anyone else seen a problem here?
Thanks for any help,
-Scott.
Quoted 11 lines · Scott O'Connor
With a LSI1068 (SAS) card, I'm trying to do device hotplug. Back in the day I used the /proc calls below to hotplug a device.
scsi remove-single-device <args>
scsi add_single-device <args>With 2.6.16-1 kernel, the "remove" call below works, the
/dev/sd*structure is removed.echo scsi remove-single-device 0 07 00 00 >
/proc/scsi/scsi
Quoted 8 lines
However, this does not add the device back (the
/dev/sd*node is not created):echo scsi add-single-device 0 07 00 00 >
/proc/scsi/scsiI see the
scsi_proc.ctoscsi_transport_sas.cuser_scantransport layer code and it seems hooked up properly. Before I debug, has anyone else seen a problem here?
Actually, when I try this with 2.6.17-rc4, I get a BUG triggered in the transport class at line 579 ... it's finding the wrong device in the user_scan callback.
Does this attached patch fix it for you?
James
drivers/scsi/scsi_transport_sas.c +2 -1
@@ -955,7 +955,8 @@ static int sas_user_scan(struct Scsi_Hoslist_for_each_entry (rphy, &sas_host->rphy_list, list) {struct sas_phy *parent =dev_to_phy (rphy->dev.parent); -if (rphy->scsi_target_id ==-1 ) +if (rphy->identify.device_type !=SAS_END_DEVICE || + rphy->scsi_target_id ==-1 )continue ; if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) &&