summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>2017-12-26 20:34:43 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2018-01-03 23:26:43 -0500
commit6f44a22b2c96acd018b407ee28407e1730370169 (patch)
tree13d2d7906cf107291149867c08f8c9adf377a663 /drivers/scsi/aacraid
parent3031c6565f04d4d6d1d4a04788c394a68b1d285b (diff)
downloadtalos-op-linux-6f44a22b2c96acd018b407ee28407e1730370169.tar.gz
talos-op-linux-6f44a22b2c96acd018b407ee28407e1730370169.zip
scsi: aacraid: Merge adapter setup with resolve luns
The device hotplug events are processed only after retrieving the updated lun information from the fw. Does not make sense to keep them separate. Merge both the hotplug handling and safw adapter setup code into single function. Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/commsup.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 5b7a4f559227..34155b1aa83e 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1934,11 +1934,18 @@ static int aac_is_safw_device_exposed(struct aac_dev *dev, int bus, int target)
return is_exposed;
}
-static void aac_resolve_luns(struct aac_dev *dev)
+static int aac_update_safw_host_devices(struct aac_dev *dev, int rescan)
{
int i;
- int bus, target;
+ int bus;
+ int target;
int is_exposed = 0;
+ int rcode = 0;
+
+ rcode = aac_setup_safw_adapter(dev, rescan);
+ if (unlikely(rcode < 0)) {
+ goto out;
+ }
for (i = 0; i < AAC_BUS_TARGET_LOOP; i++) {
@@ -1953,6 +1960,8 @@ static void aac_resolve_luns(struct aac_dev *dev)
is_exposed)
aac_remove_safw_device(dev, bus, target);
}
+out:
+ return rcode;
}
/**
@@ -1988,9 +1997,7 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr)
case SA_AIF_LDEV_CHANGE:
case SA_AIF_BPCFG_CHANGE:
- aac_setup_safw_adapter(dev, AAC_RESCAN);
-
- aac_resolve_luns(dev);
+ aac_update_safw_host_devices(dev, AAC_RESCAN);
break;
case SA_AIF_BPSTAT_CHANGE:
OpenPOWER on IntegriCloud