Re: [PATCH v20 06/41] usb: host: xhci-sideband: Expose a sideband interrupter enable API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.4.2024 0.50, Wesley Cheng wrote:
Some use cases maybe require that the secondary interrupter's events to
be handled by the OS.  In this case, configure the IMOD and the
skip_events property to enable the interrupter's events.  By default,
assume that the secondary interrupter doesn't want to enable OS event
handling.

Signed-off-by: Wesley Cheng <quic_wcheng@xxxxxxxxxxx>
---
  drivers/usb/host/xhci-sideband.c  | 28 ++++++++++++++++++++++++++++
  include/linux/usb/xhci-sideband.h |  2 ++
  2 files changed, 30 insertions(+)

diff --git a/drivers/usb/host/xhci-sideband.c b/drivers/usb/host/xhci-sideband.c
index 255feae33c6e..6fdae9840c11 100644
--- a/drivers/usb/host/xhci-sideband.c
+++ b/drivers/usb/host/xhci-sideband.c
@@ -237,6 +237,30 @@ xhci_sideband_get_event_buffer(struct xhci_sideband *sb)
  }
  EXPORT_SYMBOL_GPL(xhci_sideband_get_event_buffer);
+/**
+ * xhci_sideband_enable_interrupt - enable interrupt for secondary interrupter
+ * @sb: sideband instance for this usb device
+ * @imod_interval: number of event ring segments to allocate
+ *
+ * Enables OS owned event handling for a particular interrupter if client
+ * requests for it.  In addition, set the IMOD interval for this particular
+ * interrupter.
+ *
+ * Returns 0 on success, negative error otherwise
+ */
+int xhci_sideband_enable_interrupt(struct xhci_sideband *sb, u32 imod_interval)
+{
+	if (!sb || !sb->ir)
+		return -ENODEV;
+
+	xhci_set_interrupter_moderation(sb->ir, imod_interval);

Is there a need to adjust the moderation after initial setup?

If not then maybe we could pass the imod_interval as a parameter to
xhci_create_secondary_interrupter(), and avoid exporting
xhci_set_interrupter_moderation()


+	sb->ir->skip_events = false;
+	xhci_enable_interrupter(sb->ir);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(xhci_sideband_enable_interrupt);

I can't find the place where xhci_sideband_enable_interrupt() is called in
this series. How is it planned to be used?

Thanks
Mathias



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux