* [PATCH] scsi: csiostor: enable PCIe relax ordering if supported
@ 2017-08-29 15:48 Varun Prakash
2017-09-25 19:34 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Varun Prakash @ 2017-08-29 15:48 UTC (permalink / raw)
To: martin.petersen; +Cc: linux-scsi, indranil, varun, rajesh.kumar
Set PCIe relax ordering bits in FW_IQ_CMD if
relax ordering is enabled in the PCIe device.
Signed-off-by: Varun Prakash <varun@chelsio.com>
---
drivers/scsi/csiostor/csio_hw.h | 3 +++
drivers/scsi/csiostor/csio_init.c | 3 +++
drivers/scsi/csiostor/csio_mb.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/drivers/scsi/csiostor/csio_hw.h b/drivers/scsi/csiostor/csio_hw.h
index 9acb895..49e190b 100644
--- a/drivers/scsi/csiostor/csio_hw.h
+++ b/drivers/scsi/csiostor/csio_hw.h
@@ -368,6 +368,9 @@ struct csio_hw_stats {
#define CSIO_HWF_HOST_INTR_ENABLED 0x00000200 /* Are host interrupts
* enabled?
*/
+#define CSIO_HWF_ROOT_NO_RELAXED_ORDERING 0x00000400 /* Is PCIe relaxed
+ * ordering enabled
+ */
#define csio_is_hw_intr_enabled(__hw) \
((__hw)->flags & CSIO_HWF_HW_INTR_ENABLED)
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index dcd0741..3e6f33c 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -967,6 +967,9 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_pci_exit;
}
+ if (!pcie_relaxed_ordering_enabled(pdev))
+ hw->flags |= CSIO_HWF_ROOT_NO_RELAXED_ORDERING;
+
pci_set_drvdata(pdev, hw);
rv = csio_hw_start(hw);
diff --git a/drivers/scsi/csiostor/csio_mb.c b/drivers/scsi/csiostor/csio_mb.c
index 9451787..7e74ec8 100644
--- a/drivers/scsi/csiostor/csio_mb.c
+++ b/drivers/scsi/csiostor/csio_mb.c
@@ -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) ?
FW_IQ_CMD_IQSTART_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
@@ -537,6 +538,8 @@ csio_mb_iq_write(struct csio_hw *hw, struct csio_mb *mbp, void *priv,
cmdp->iqns_to_fl0congen |= htonl(
FW_IQ_CMD_FL0HOSTFCMODE_V(iq_params->fl0hostfcmode)|
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_FL0PACKEN_V(iq_params->fl0packen));
cmdp->fl0dcaen_to_fl0cidxfthresh |= htons(
--
2.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: csiostor: enable PCIe relax ordering if supported
2017-08-29 15:48 [PATCH] scsi: csiostor: enable PCIe relax ordering if supported Varun Prakash
@ 2017-09-25 19:34 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-09-25 19:34 UTC (permalink / raw)
To: Varun Prakash; +Cc: martin.petersen, linux-scsi, indranil, rajesh.kumar
Varun,
> Set PCIe relax ordering bits in FW_IQ_CMD if relax ordering is enabled
> in the PCIe device.
Applied to 4.15/scsi-queue. Thank you!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-25 19:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 15:48 [PATCH] scsi: csiostor: enable PCIe relax ordering if supported Varun Prakash
2017-09-25 19:34 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.