Browse Source

misc: pci_endpoint_test: Add ioctl to clear IRQ

Add ioctl to clear IRQ which can be used to free the allocated
IRQ vectors and free the requested IRQ.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Kishon Vijay Abraham I 6 năm trước cách đây
mục cha
commit
705e4a7f81
2 tập tin đã thay đổi với 11 bổ sung0 xóa
  1. 10 0
      drivers/misc/pci_endpoint_test.c
  2. 1 0
      include/uapi/linux/pcitest.h

+ 10 - 0
drivers/misc/pci_endpoint_test.c

@@ -614,6 +614,13 @@ err:
 	return ret;
 }
 
+static bool pci_endpoint_test_clear_irq(struct pci_endpoint_test *test)
+{
+	pci_endpoint_test_release_irq(test);
+	pci_endpoint_test_free_irq_vectors(test);
+	return true;
+}
+
 static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test,
 				      int req_irq_type)
 {
@@ -685,6 +692,9 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
 	case PCITEST_GET_IRQTYPE:
 		ret = irq_type;
 		break;
+	case PCITEST_CLEAR_IRQ:
+		ret = pci_endpoint_test_clear_irq(test);
+		break;
 	}
 
 ret:

+ 1 - 0
include/uapi/linux/pcitest.h

@@ -19,5 +19,6 @@
 #define PCITEST_MSIX		_IOW('P', 0x7, int)
 #define PCITEST_SET_IRQTYPE	_IOW('P', 0x8, int)
 #define PCITEST_GET_IRQTYPE	_IO('P', 0x9)
+#define PCITEST_CLEAR_IRQ	_IO('P', 0x10)
 
 #endif /* __UAPI_LINUX_PCITEST_H */