Commit ff6e88f1 authored by Varun Prakash's avatar Varun Prakash Committed by Martin K. Petersen

scsi: csiostor: enable PCIe relaxed ordering if supported

Set PCIe relaxed ordering bits in FW_IQ_CMD if relaxed ordering is
enabled in the PCIe device.
Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7c82532d
...@@ -368,6 +368,9 @@ struct csio_hw_stats { ...@@ -368,6 +368,9 @@ struct csio_hw_stats {
#define CSIO_HWF_HOST_INTR_ENABLED 0x00000200 /* Are host interrupts #define CSIO_HWF_HOST_INTR_ENABLED 0x00000200 /* Are host interrupts
* enabled? * enabled?
*/ */
#define CSIO_HWF_ROOT_NO_RELAXED_ORDERING 0x00000400 /* Is PCIe relaxed
* ordering enabled
*/
#define csio_is_hw_intr_enabled(__hw) \ #define csio_is_hw_intr_enabled(__hw) \
((__hw)->flags & CSIO_HWF_HW_INTR_ENABLED) ((__hw)->flags & CSIO_HWF_HW_INTR_ENABLED)
......
...@@ -968,6 +968,9 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -968,6 +968,9 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_pci_exit; goto err_pci_exit;
} }
if (!pcie_relaxed_ordering_enabled(pdev))
hw->flags |= CSIO_HWF_ROOT_NO_RELAXED_ORDERING;
pci_set_drvdata(pdev, hw); pci_set_drvdata(pdev, hw);
rv = csio_hw_start(hw); rv = csio_hw_start(hw);
......
...@@ -491,6 +491,7 @@ csio_mb_iq_write(struct csio_hw *hw, struct csio_mb *mbp, void *priv, ...@@ -491,6 +491,7 @@ csio_mb_iq_write(struct csio_hw *hw, struct csio_mb *mbp, void *priv,
uint32_t iq_start_stop = (iq_params->iq_start) ? uint32_t iq_start_stop = (iq_params->iq_start) ?
FW_IQ_CMD_IQSTART_F : FW_IQ_CMD_IQSTART_F :
FW_IQ_CMD_IQSTOP_F; FW_IQ_CMD_IQSTOP_F;
int relaxed = !(hw->flags & CSIO_HWF_ROOT_NO_RELAXED_ORDERING);
/* /*
* If this IQ write is cascaded with IQ alloc request, do not * If this IQ write is cascaded with IQ alloc request, do not
...@@ -537,6 +538,8 @@ csio_mb_iq_write(struct csio_hw *hw, struct csio_mb *mbp, void *priv, ...@@ -537,6 +538,8 @@ csio_mb_iq_write(struct csio_hw *hw, struct csio_mb *mbp, void *priv,
cmdp->iqns_to_fl0congen |= htonl( cmdp->iqns_to_fl0congen |= htonl(
FW_IQ_CMD_FL0HOSTFCMODE_V(iq_params->fl0hostfcmode)| FW_IQ_CMD_FL0HOSTFCMODE_V(iq_params->fl0hostfcmode)|
FW_IQ_CMD_FL0CPRIO_V(iq_params->fl0cprio) | FW_IQ_CMD_FL0CPRIO_V(iq_params->fl0cprio) |
FW_IQ_CMD_FL0FETCHRO_V(relaxed) |
FW_IQ_CMD_FL0DATARO_V(relaxed) |
FW_IQ_CMD_FL0PADEN_V(iq_params->fl0paden) | FW_IQ_CMD_FL0PADEN_V(iq_params->fl0paden) |
FW_IQ_CMD_FL0PACKEN_V(iq_params->fl0packen)); FW_IQ_CMD_FL0PACKEN_V(iq_params->fl0packen));
cmdp->fl0dcaen_to_fl0cidxfthresh |= htons( cmdp->fl0dcaen_to_fl0cidxfthresh |= htons(
......
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