Commit 57ce1261 authored by Raghava Aditya Renukunta's avatar Raghava Aditya Renukunta Committed by Ben Hutchings

scsi: aacraid: Reorder Adapter status check

commit c421530b upstream.

The driver currently checks the SELF_TEST_FAILED first and then
KERNEL_PANIC next. Under error conditions(boot code failure) both
SELF_TEST_FAILED and KERNEL_PANIC can be set at the same time.

The driver has the capability to reset the controller on an KERNEL_PANIC,
but not on SELF_TEST_FAILED.

Fixed by first checking KERNEL_PANIC and then the others.

Fixes: e8b12f0f ([SCSI] aacraid: Add new code for PMC-Sierra's SRC base controller family)
Signed-off-by: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: default avatarDavid Carroll <David.Carroll@microsemi.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 7544d402
...@@ -358,17 +358,24 @@ static int aac_src_check_health(struct aac_dev *dev) ...@@ -358,17 +358,24 @@ static int aac_src_check_health(struct aac_dev *dev)
{ {
u32 status = src_readl(dev, MUnit.OMR); u32 status = src_readl(dev, MUnit.OMR);
/*
* Check to see if the board panic'd.
*/
if (unlikely(status & KERNEL_PANIC))
goto err_blink;
/* /*
* Check to see if the board failed any self tests. * Check to see if the board failed any self tests.
*/ */
if (unlikely(status & SELF_TEST_FAILED)) if (unlikely(status & SELF_TEST_FAILED))
return -1; goto err_out;
/* /*
* Check to see if the board panic'd. * Check to see if the board failed any self tests.
*/ */
if (unlikely(status & KERNEL_PANIC)) if (unlikely(status & MONITOR_PANIC))
return (status >> 16) & 0xFF; goto err_out;
/* /*
* Wait for the adapter to be up and running. * Wait for the adapter to be up and running.
*/ */
...@@ -378,6 +385,12 @@ static int aac_src_check_health(struct aac_dev *dev) ...@@ -378,6 +385,12 @@ static int aac_src_check_health(struct aac_dev *dev)
* Everything is OK * Everything is OK
*/ */
return 0; return 0;
err_out:
return -1;
err_blink:
return (status > 16) & 0xFF;
} }
/** /**
......
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