Skip to content

Commit

Permalink
scsi: ibmvfc: Add Sub-CRQ IRQ enable/disable routine
Browse files Browse the repository at this point in the history
Each Sub-CRQ has its own interrupt. A hypercall is required to toggle the
IRQ state. Provide the necessary mechanism via a helper function.

Link: https://lore.kernel.org/r/20210114203148.246656-9-tyreld@linux.ibm.com
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Tyrel Datwyler authored and Martin K. Petersen committed Jan 15, 2021
1 parent 3034ebe commit d20046e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/scsi/ibmvscsi/ibmvfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d20046e

Please sign in to comment.