Thread (32 messages) 32 messages, 2 authors, 2024-12-12

Re: [PATCH v2 07/13] iommufd/viommu: Add iommufd_viommu_report_irq helper

From: Nicolin Chen <hidden>
Date: 2024-12-12 21:23:53
Also in: linux-doc, linux-iommu, linux-kselftest, lkml

On Wed, Dec 11, 2024 at 08:05:45AM +0000, Tian, Kevin wrote:
quoted
From: Nicolin Chen <redacted>
Sent: Wednesday, December 4, 2024 6:10 AM

+/* Typically called in driver's threaded IRQ handler */
+int iommufd_viommu_report_irq(struct iommufd_viommu *viommu,
unsigned int type,
+			      void *irq_ptr, size_t irq_len)
+{
+	struct iommufd_eventq_virq *eventq_virq;
+	struct iommufd_virq *virq;
+	int rc = 0;
+
+	might_sleep();
why is it required here but not in the iopf path?
It might not be that *required* as there is a might_sleep inside
the down_read(). So, I can drop this.
quoted
+
+	if (!viommu)
+		return -ENODEV;
+	if (WARN_ON_ONCE(!irq_len || !irq_ptr))
+		return -EINVAL;
+
+	down_read(&viommu->virqs_rwsem);
+
+	eventq_virq = iommufd_viommu_find_eventq_virq(viommu, type);
+	if (!eventq_virq) {
+		rc = -EOPNOTSUPP;
+		goto out_unlock_vdev_ids;
s/out_unlock_vdev_ids/out_unlock_virqs/
Yes..

Thanks!
Nic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help