diff options
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 481afe60bc91..7f0af4fcc001 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -1403,6 +1403,7 @@ _scsih_slave_alloc(struct scsi_device *sdev) | |||
1403 | struct MPT2SAS_DEVICE *sas_device_priv_data; | 1403 | struct MPT2SAS_DEVICE *sas_device_priv_data; |
1404 | struct scsi_target *starget; | 1404 | struct scsi_target *starget; |
1405 | struct _raid_device *raid_device; | 1405 | struct _raid_device *raid_device; |
1406 | struct _sas_device *sas_device; | ||
1406 | unsigned long flags; | 1407 | unsigned long flags; |
1407 | 1408 | ||
1408 | sas_device_priv_data = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); | 1409 | sas_device_priv_data = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); |
@@ -1431,6 +1432,19 @@ _scsih_slave_alloc(struct scsi_device *sdev) | |||
1431 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); | 1432 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); |
1432 | } | 1433 | } |
1433 | 1434 | ||
1435 | if (!(sas_target_priv_data->flags & MPT_TARGET_FLAGS_VOLUME)) { | ||
1436 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | ||
1437 | sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc, | ||
1438 | sas_target_priv_data->sas_address); | ||
1439 | if (sas_device && (sas_device->starget == NULL)) { | ||
1440 | sdev_printk(KERN_INFO, sdev, | ||
1441 | "%s : sas_device->starget set to starget @ %d\n", | ||
1442 | __func__, __LINE__); | ||
1443 | sas_device->starget = starget; | ||
1444 | } | ||
1445 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | ||
1446 | } | ||
1447 | |||
1434 | return 0; | 1448 | return 0; |
1435 | } | 1449 | } |
1436 | 1450 | ||