[SCSI] mpt3sas: when async scanning is enabled then while scanning, devices are removed but their transport layer entries are not removed
When Async scanning mode is enabled and device scanning is in progress, devices should not be removed. But in actuality, devices are removed but their transport layer entries are not removed. This causes error to add the same device to the transport layer after host reset or diagnostic reset. So, in this patch, modified the code in such a way that device is not removed when Async scanning mode is enabled and device scanning is in progress. Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
committed by
James Bottomley
parent
17263e754d
commit
f5edbe77d9
@@ -675,13 +675,14 @@ _scsih_sas_device_add(struct MPT3SAS_ADAPTER *ioc,
|
|||||||
* devices while scanning is turned on due to an oops in
|
* devices while scanning is turned on due to an oops in
|
||||||
* scsi_sysfs_add_sdev()->add_device()->sysfs_addrm_start()
|
* scsi_sysfs_add_sdev()->add_device()->sysfs_addrm_start()
|
||||||
*/
|
*/
|
||||||
if (!ioc->is_driver_loading)
|
if (!ioc->is_driver_loading) {
|
||||||
mpt3sas_transport_port_remove(ioc,
|
mpt3sas_transport_port_remove(ioc,
|
||||||
sas_device->sas_address,
|
sas_device->sas_address,
|
||||||
sas_device->sas_address_parent);
|
sas_device->sas_address_parent);
|
||||||
_scsih_sas_device_remove(ioc, sas_device);
|
_scsih_sas_device_remove(ioc, sas_device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _scsih_sas_device_init_add - insert sas_device to the list.
|
* _scsih_sas_device_init_add - insert sas_device to the list.
|
||||||
@@ -7531,13 +7532,15 @@ _scsih_probe_boot_devices(struct MPT3SAS_ADAPTER *ioc)
|
|||||||
sas_address_parent)) {
|
sas_address_parent)) {
|
||||||
_scsih_sas_device_remove(ioc, sas_device);
|
_scsih_sas_device_remove(ioc, sas_device);
|
||||||
} else if (!sas_device->starget) {
|
} else if (!sas_device->starget) {
|
||||||
if (!ioc->is_driver_loading)
|
if (!ioc->is_driver_loading) {
|
||||||
mpt3sas_transport_port_remove(ioc, sas_address,
|
mpt3sas_transport_port_remove(ioc,
|
||||||
|
sas_address,
|
||||||
sas_address_parent);
|
sas_address_parent);
|
||||||
_scsih_sas_device_remove(ioc, sas_device);
|
_scsih_sas_device_remove(ioc, sas_device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _scsih_probe_raid - reporting raid volumes to scsi-ml
|
* _scsih_probe_raid - reporting raid volumes to scsi-ml
|
||||||
@@ -7590,7 +7593,7 @@ _scsih_probe_sas(struct MPT3SAS_ADAPTER *ioc)
|
|||||||
* oops in scsi_sysfs_add_sdev()->add_device()->
|
* oops in scsi_sysfs_add_sdev()->add_device()->
|
||||||
* sysfs_addrm_start()
|
* sysfs_addrm_start()
|
||||||
*/
|
*/
|
||||||
if (!ioc->is_driver_loading)
|
if (!ioc->is_driver_loading) {
|
||||||
mpt3sas_transport_port_remove(ioc,
|
mpt3sas_transport_port_remove(ioc,
|
||||||
sas_device->sas_address,
|
sas_device->sas_address,
|
||||||
sas_device->sas_address_parent);
|
sas_device->sas_address_parent);
|
||||||
@@ -7598,6 +7601,7 @@ _scsih_probe_sas(struct MPT3SAS_ADAPTER *ioc)
|
|||||||
kfree(sas_device);
|
kfree(sas_device);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock_irqsave(&ioc->sas_device_lock, flags);
|
spin_lock_irqsave(&ioc->sas_device_lock, flags);
|
||||||
list_move_tail(&sas_device->list, &ioc->sas_device_list);
|
list_move_tail(&sas_device->list, &ioc->sas_device_list);
|
||||||
|
Reference in New Issue
Block a user