summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aacraid.h
diff options
context:
space:
mode:
authorDave Carroll <david.carroll@microsemi.com>2019-03-22 19:16:03 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-26 03:19:01 +0100
commitb6554cfe09e1f610aed7d57164ab7760be57acd9 (patch)
treef55eeb54f1b6b926bfaab5eb9c7e8f2f7ab814ff /drivers/scsi/aacraid/aacraid.h
parentscsi: mpt3sas: Fix kernel panic during expander reset (diff)
downloadlinux-b6554cfe09e1f610aed7d57164ab7760be57acd9.tar.xz
linux-b6554cfe09e1f610aed7d57164ab7760be57acd9.zip
scsi: aacraid: Insure we don't access PCIe space during AER/EEH
There are a few windows during AER/EEH when we can access PCIe I/O mapped registers. This will harden the access to insure we do not allow PCIe access during errors Signed-off-by: Dave Carroll <david.carroll@microsemi.com> Reviewed-by: Sagar Biradar <sagar.biradar@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aacraid/aacraid.h')
-rw-r--r--drivers/scsi/aacraid/aacraid.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 1df5171594b8..11fb68d7e60d 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -2640,9 +2640,14 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor)
return capacity;
}
+static inline int aac_pci_offline(struct aac_dev *dev)
+{
+ return pci_channel_offline(dev->pdev) || dev->handle_pci_error;
+}
+
static inline int aac_adapter_check_health(struct aac_dev *dev)
{
- if (unlikely(pci_channel_offline(dev->pdev)))
+ if (unlikely(aac_pci_offline(dev)))
return -1;
return (dev)->a_ops.adapter_check_health(dev);