提交 a2b302e4 编写于 作者: D Dave Carroll 提交者: Greg Kroah-Hartman

scsi: aacraid: Insure we don't access PCIe space during AER/EEH

[ Upstream commit b6554cfe09e1f610aed7d57164ab7760be57acd9 ]

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: NDave Carroll <david.carroll@microsemi.com>
Reviewed-by: NSagar Biradar <sagar.biradar@microchip.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
上级 2c8c8ef8
...@@ -2639,9 +2639,14 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor) ...@@ -2639,9 +2639,14 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor)
return capacity; 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) 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 -1;
return (dev)->a_ops.adapter_check_health(dev); return (dev)->a_ops.adapter_check_health(dev);
......
...@@ -673,7 +673,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size, ...@@ -673,7 +673,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
return -ETIMEDOUT; return -ETIMEDOUT;
} }
if (unlikely(pci_channel_offline(dev->pdev))) if (unlikely(aac_pci_offline(dev)))
return -EFAULT; return -EFAULT;
if ((blink = aac_adapter_check_health(dev)) > 0) { if ((blink = aac_adapter_check_health(dev)) > 0) {
...@@ -773,7 +773,7 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback, ...@@ -773,7 +773,7 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
spin_unlock_irqrestore(&fibptr->event_lock, flags); spin_unlock_irqrestore(&fibptr->event_lock, flags);
if (unlikely(pci_channel_offline(dev->pdev))) if (unlikely(aac_pci_offline(dev)))
return -EFAULT; return -EFAULT;
fibptr->flags |= FIB_CONTEXT_FLAG_WAIT; fibptr->flags |= FIB_CONTEXT_FLAG_WAIT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册