diff mbox series

[v4,08/21] ibmvfc: add Sub-CRQ IRQ enable/disable routine

Message ID 20210111231225.105347-9-tyreld@linux.ibm.com (mailing list archive)
State Not Applicable
Headers show
Series ibmvfc: initial MQ development | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/merge (39a77db53cca8200b8bc99fc0993e127b59f08fb)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/next (e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch linus/master (a0d54b4f5b219fb31f0776e9f53aa137e78ae431)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/fixes (3ce47d95b7346dcafd9bed3556a8d072cb2b8571)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch linux-next (2ff90100ace886895e4fbb2850b8d5e49d931ed6)
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Tyrel Datwyler Jan. 11, 2021, 11:12 p.m. UTC
Each Sub-CRQ has its own interrupt. A hypercall is required to toggle
the IRQ state. Provide the necessary mechanism via a helper function.

Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index a198e118887d..5d7ada0ed0d6 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3465,6 +3465,26 @@  static void ibmvfc_tasklet(void *data)
 	}
 }
 
+static int ibmvfc_toggle_scrq_irq(struct ibmvfc_queue *scrq, int enable)
+{
+	struct device *dev = scrq->vhost->dev;
+	struct vio_dev *vdev = to_vio_dev(dev);
+	unsigned long rc;
+	int irq_action = H_ENABLE_VIO_INTERRUPT;
+
+	if (!enable)
+		irq_action = H_DISABLE_VIO_INTERRUPT;
+
+	rc = plpar_hcall_norets(H_VIOCTL, vdev->unit_address, irq_action,
+				scrq->hw_irq, 0, 0);
+
+	if (rc)
+		dev_err(dev, "Couldn't %s sub-crq[%lu] irq. rc=%ld\n",
+			enable ? "enable" : "disable", scrq->hwq_id, rc);
+
+	return rc;
+}
+
 /**
  * ibmvfc_init_tgt - Set the next init job step for the target
  * @tgt:		ibmvfc target struct