summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authorAnand Lodnoor <anand.lodnoor@broadcom.com>2020-01-14 12:21:15 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2020-01-16 05:21:02 +0100
commiteb974f34bb9daa4b7309800beb596ee173f74eda (patch)
tree1b51e567f411248db77b3e06b180792cc4e0abad /drivers/scsi/megaraid
parentscsi: megaraid_sas: Update optimal queue depth for SAS and NVMe devices (diff)
downloadlinux-eb974f34bb9daa4b7309800beb596ee173f74eda.tar.xz
linux-eb974f34bb9daa4b7309800beb596ee173f74eda.zip
scsi: megaraid_sas: Do not kill host bus adapter, if adapter is already dead
Link: https://lore.kernel.org/r/1579000882-20246-5-git-send-email-anand.lodnoor@broadcom.com Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Anand Lodnoor <anand.lodnoor@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 167a3e5edc45..2d74c1697155 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -2154,6 +2154,12 @@ static void megasas_complete_outstanding_ioctls(struct megasas_instance *instanc
void megaraid_sas_kill_hba(struct megasas_instance *instance)
{
+ if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) {
+ dev_warn(&instance->pdev->dev,
+ "Adapter already dead, skipping kill HBA\n");
+ return;
+ }
+
/* Set critical error to block I/O & ioctls in case caller didn't */
atomic_set(&instance->adprecovery, MEGASAS_HW_CRITICAL_ERROR);
/* Wait 1 second to ensure IO or ioctls in build have posted */