Commit 5aa60732 authored by Raghava Aditya Renukunta's avatar Raghava Aditya Renukunta Committed by Martin K. Petersen

scsi: aacraid: Rework aac_src_restart

Removed switch case and replaced with if mask checks. Moved KERNEL_PANIC
check to when bled is less than 0.
Signed-off-by: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: default avatarDavid Carroll <david.carroll@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 77cb6d5e
...@@ -772,8 +772,7 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) ...@@ -772,8 +772,7 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)
dev->a_ops.adapter_enable_int = aac_src_disable_interrupt; dev->a_ops.adapter_enable_int = aac_src_disable_interrupt;
switch (reset_type) { if (reset_type & HW_IOP_RESET) {
case IOP_HWSOFT_RESET:
aac_send_iop_reset(dev); aac_send_iop_reset(dev);
/* /*
...@@ -784,12 +783,14 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) ...@@ -784,12 +783,14 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)
dev_err(&dev->pdev->dev, "IOP reset failed\n"); dev_err(&dev->pdev->dev, "IOP reset failed\n");
else else
goto set_startup; goto set_startup;
}
if (!dev->sa_firmware) { if (!dev->sa_firmware) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
if (reset_type & HW_SOFT_RESET) {
aac_send_hardware_soft_reset(dev); aac_send_hardware_soft_reset(dev);
dev->msi_enabled = 0; dev->msi_enabled = 0;
...@@ -799,30 +800,19 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type) ...@@ -799,30 +800,19 @@ static int aac_src_restart_adapter(struct aac_dev *dev, int bled, u8 reset_type)
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
break;
case HW_SOFT_RESET:
if (dev->sa_firmware) {
aac_send_hardware_soft_reset(dev);
aac_set_intx_mode(dev);
}
break;
default:
aac_send_iop_reset(dev);
break;
} }
invalid_out:
if (src_readl(dev, MUnit.OMR) & KERNEL_PANIC)
ret = -ENODEV;
set_startup: set_startup:
if (startup_timeout < 300) if (startup_timeout < 300)
startup_timeout = 300; startup_timeout = 300;
out: out:
return ret; return ret;
invalid_out:
if (src_readl(dev, MUnit.OMR) & KERNEL_PANIC)
ret = -ENODEV;
goto out;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment