diff options
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index b162f7a1c563..40dbaaaf49e1 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -1008,6 +1008,8 @@ mptsas_slave_alloc(struct scsi_device *sdev) | |||
1008 | static int | 1008 | static int |
1009 | mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 1009 | mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
1010 | { | 1010 | { |
1011 | MPT_SCSI_HOST *hd; | ||
1012 | MPT_ADAPTER *ioc; | ||
1011 | VirtDevice *vdevice = SCpnt->device->hostdata; | 1013 | VirtDevice *vdevice = SCpnt->device->hostdata; |
1012 | 1014 | ||
1013 | if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) { | 1015 | if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) { |
@@ -1016,6 +1018,12 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1016 | return 0; | 1018 | return 0; |
1017 | } | 1019 | } |
1018 | 1020 | ||
1021 | hd = shost_priv(SCpnt->device->host); | ||
1022 | ioc = hd->ioc; | ||
1023 | |||
1024 | if (ioc->sas_discovery_quiesce_io) | ||
1025 | return SCSI_MLQUEUE_HOST_BUSY; | ||
1026 | |||
1019 | // scsi_print_command(SCpnt); | 1027 | // scsi_print_command(SCpnt); |
1020 | 1028 | ||
1021 | return mptscsih_qcmd(SCpnt,done); | 1029 | return mptscsih_qcmd(SCpnt,done); |
@@ -3009,6 +3017,7 @@ mptsas_send_discovery_event(MPT_ADAPTER *ioc, | |||
3009 | EVENT_DATA_SAS_DISCOVERY *discovery_data) | 3017 | EVENT_DATA_SAS_DISCOVERY *discovery_data) |
3010 | { | 3018 | { |
3011 | struct mptsas_discovery_event *ev; | 3019 | struct mptsas_discovery_event *ev; |
3020 | u32 discovery_status; | ||
3012 | 3021 | ||
3013 | /* | 3022 | /* |
3014 | * DiscoveryStatus | 3023 | * DiscoveryStatus |
@@ -3017,7 +3026,9 @@ mptsas_send_discovery_event(MPT_ADAPTER *ioc, | |||
3017 | * kicks off discovery, and return to zero | 3026 | * kicks off discovery, and return to zero |
3018 | * once its completed. | 3027 | * once its completed. |
3019 | */ | 3028 | */ |
3020 | if (discovery_data->DiscoveryStatus) | 3029 | discovery_status = le32_to_cpu(discovery_data->DiscoveryStatus); |
3030 | ioc->sas_discovery_quiesce_io = discovery_status ? 1 : 0; | ||
3031 | if (discovery_status) | ||
3021 | return; | 3032 | return; |
3022 | 3033 | ||
3023 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); | 3034 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); |
@@ -3299,12 +3310,22 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
3299 | return error; | 3310 | return error; |
3300 | } | 3311 | } |
3301 | 3312 | ||
3313 | void | ||
3314 | mptsas_shutdown(struct pci_dev *pdev) | ||
3315 | { | ||
3316 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); | ||
3317 | |||
3318 | ioc->sas_discovery_quiesce_io = 0; | ||
3319 | } | ||
3320 | |||
3302 | static void __devexit mptsas_remove(struct pci_dev *pdev) | 3321 | static void __devexit mptsas_remove(struct pci_dev *pdev) |
3303 | { | 3322 | { |
3304 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); | 3323 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); |
3305 | struct mptsas_portinfo *p, *n; | 3324 | struct mptsas_portinfo *p, *n; |
3306 | int i; | 3325 | int i; |
3307 | 3326 | ||
3327 | mptsas_shutdown(pdev); | ||
3328 | |||
3308 | ioc->sas_discovery_ignore_events = 1; | 3329 | ioc->sas_discovery_ignore_events = 1; |
3309 | sas_remove_host(ioc->sh); | 3330 | sas_remove_host(ioc->sh); |
3310 | 3331 | ||
@@ -3342,7 +3363,7 @@ static struct pci_driver mptsas_driver = { | |||
3342 | .id_table = mptsas_pci_table, | 3363 | .id_table = mptsas_pci_table, |
3343 | .probe = mptsas_probe, | 3364 | .probe = mptsas_probe, |
3344 | .remove = __devexit_p(mptsas_remove), | 3365 | .remove = __devexit_p(mptsas_remove), |
3345 | .shutdown = mptscsih_shutdown, | 3366 | .shutdown = mptsas_shutdown, |
3346 | #ifdef CONFIG_PM | 3367 | #ifdef CONFIG_PM |
3347 | .suspend = mptscsih_suspend, | 3368 | .suspend = mptscsih_suspend, |
3348 | .resume = mptscsih_resume, | 3369 | .resume = mptscsih_resume, |