Commit a81ed5f3 authored by Kevin Barnett's avatar Kevin Barnett Committed by Martin K. Petersen

scsi: smartpqi: set pci completion timeout

add support for setting PCIe completion timeout.
Reviewed-by: default avatarScott Benesh <scott.benesh@microsemi.com>
Reviewed-by: default avatarScott Teel <scott.teel@microsemi.com>
Signed-off-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 98bf061b
...@@ -5437,6 +5437,13 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) ...@@ -5437,6 +5437,13 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
return 0; return 0;
} }
static inline int pqi_set_pcie_completion_timeout(struct pci_dev *pci_dev,
u16 timeout)
{
return pcie_capability_clear_and_set_word(pci_dev, PCI_EXP_DEVCTL2,
PCI_EXP_DEVCTL2_COMP_TIMEOUT, timeout);
}
static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info) static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info)
{ {
int rc; int rc;
...@@ -5480,6 +5487,17 @@ static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info) ...@@ -5480,6 +5487,17 @@ static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info)
ctrl_info->registers = ctrl_info->iomem_base; ctrl_info->registers = ctrl_info->iomem_base;
ctrl_info->pqi_registers = &ctrl_info->registers->pqi_registers; ctrl_info->pqi_registers = &ctrl_info->registers->pqi_registers;
#define PCI_EXP_COMP_TIMEOUT_65_TO_210_MS 0x6
/* Increase the PCIe completion timeout. */
rc = pqi_set_pcie_completion_timeout(ctrl_info->pci_dev,
PCI_EXP_COMP_TIMEOUT_65_TO_210_MS);
if (rc) {
dev_err(&ctrl_info->pci_dev->dev,
"failed to set PCIe completion timeout\n");
goto release_regions;
}
/* Enable bus mastering. */ /* Enable bus mastering. */
pci_set_master(ctrl_info->pci_dev); pci_set_master(ctrl_info->pci_dev);
......
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