Skip to content
Permalink
Browse files
ANDROID: GKI: usb: xhci: Add support for secondary interrupters
Implement APIs to dynamically allocate and free secondary
event rings based upon interrupter number. Also add exported
APIs in usb core layer which allows secondary event ring
management via remote processor entity.

Change-Id: I5ee7d44d6cad8e35e22d3c1a027a1eec5d208585
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
(cherry picked from commit 8d48fb820fb849cee2474354f75ef5a78044bd19)
[connoro: squashed the following commits:
          a44f0d73af95 usb: xhci: Clear event handler busy flag upon
          event ring cleanup
          a1504b40da0e usb: xhci: Acknowledge pending events in
          secondary event ring
          a7e7dd8a3499 usb: host: xhci: Fix bound check for
          interrupter number
          c4d9817a3cc6 usb: core: Allow secondary event ring clean
          upon disconnect
          576c1e1fe65b usb: host: xhci: Fix secondary event ring
          setup]
Bug: 151258428
Signed-off-by: Connor O'Brien <connoro@google.com>
  • Loading branch information
Hemant Kumar authored and cobrien7 committed Apr 6, 2020
1 parent a6c834c commit 5dfdaa15caebc782d1c90ff6513d4cc9f6ac3663
Show file tree
Hide file tree
Showing 7 changed files with 344 additions and 65 deletions.
@@ -2233,6 +2233,28 @@ int usb_hcd_get_frame_number (struct usb_device *udev)
return hcd->driver->get_frame_number (hcd);
}

int usb_hcd_sec_event_ring_setup(struct usb_device *udev,
unsigned int intr_num)
{
struct usb_hcd *hcd = bus_to_hcd(udev->bus);

if (!HCD_RH_RUNNING(hcd))
return 0;

return hcd->driver->sec_event_ring_setup(hcd, intr_num);
}

int usb_hcd_sec_event_ring_cleanup(struct usb_device *udev,
unsigned int intr_num)
{
struct usb_hcd *hcd = bus_to_hcd(udev->bus);

if (!HCD_RH_RUNNING(hcd))
return 0;

return hcd->driver->sec_event_ring_cleanup(hcd, intr_num);
}

/*-------------------------------------------------------------------------*/

int usb_hcd_get_controller_id(struct usb_device *udev)
@@ -825,6 +825,23 @@ int usb_get_current_frame_number(struct usb_device *dev)
}
EXPORT_SYMBOL_GPL(usb_get_current_frame_number);

int usb_sec_event_ring_setup(struct usb_device *dev,
unsigned int intr_num)
{
if (dev->state == USB_STATE_NOTATTACHED)
return 0;

return usb_hcd_sec_event_ring_setup(dev, intr_num);
}
EXPORT_SYMBOL(usb_sec_event_ring_setup);

int usb_sec_event_ring_cleanup(struct usb_device *dev,
unsigned int intr_num)
{
return usb_hcd_sec_event_ring_cleanup(dev, intr_num);
}
EXPORT_SYMBOL(usb_sec_event_ring_cleanup);

/**
* usb_get_controller_id - returns the host controller id.
* @dev: the device whose host controller id is being queried.

0 comments on commit 5dfdaa1

Please sign in to comment.