mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
ca5c695a45
Deleted following upstreamed patches: bcm27xx: 950-0006-drm-vc4-hdmi-Fix-HPD-GPIO-detection.patch bcm27xx: 950-0420-drm-vc4-Adopt-the-dma-configuration-from-the-HVS-or-.patch bcm27xx: 950-0425-drm-vc4-A-present-but-empty-dmas-disables-audio.patch bcm27xx: 950-0432-vc4-drm-Avoid-full-hdmi-audio-fifo-writes.patch bcm27xx: 950-0433-vc4-drm-vc4_plane-Remove-subpixel-positioning-check.patch bcm27xx: 950-0435-drm-vc4-Correct-pixel-order-for-DSI0.patch bcm27xx: 950-0436-drm-vc4-Register-dsi0-as-the-correct-vc4-encoder-typ.patch bcm27xx: 950-0437-drm-vc4-Fix-dsi0-interrupt-support.patch bcm27xx: 950-0438-drm-vc4-Add-correct-stop-condition-to-vc4_dsi_encode.patch bcm27xx: 950-0443-drm-vc4-Fix-timings-for-interlaced-modes.patch bcm27xx: 950-0445-drm-vc4-Fix-margin-calculations-for-the-right-bottom.patch bcm27xx: 950-0475-drm-vc4-Reset-HDMI-MISC_CONTROL-register.patch bcm27xx: 950-0476-drm-vc4-Release-workaround-buffer-and-DMA-in-error-p.patch bcm27xx: 950-0477-drm-vc4-Correct-DSI-divider-calculations.patch bcm27xx: 950-0664-drm-vc4-dsi-Correct-max-divider-to-255-not-7.patch bcm53xx: 072-next-ARM_dts_BCM53015-add-mr26.patch mediatek: 920-linux-next-dts-mt7622-bpi-r64-fix-wps-button.patch Manually rebased following patches: bcm27xx: 950-0004-drm-vc4-hdmi-Remove-the-DDC-probing-for-status-detec.patch bcm27xx: 950-0700-net-phy-lan87xx-Decrease-phy-polling-rate.patch bcm27xx: 950-0711-drm-vc4-Rename-bridge-to-out_bridge.patch bcm27xx: 950-0713-drm-vc4-Remove-splitting-the-bridge-chain-from-the-d.patch bcm27xx: 950-0715-drm-vc4-Convert-vc4_dsi-to-using-a-bridge-instead-of.patch bcm27xx: 950-0787-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch bcm27xx: 950-0914-mmc-block-Don-t-do-single-sector-reads-during-recove.patch Runtime tested on turris-omnia and glinet-b1300. Tested-by: John Audia <therealgraysky@proton.me> [bcm2711/RPi4B, mt7622/RT3200] Signed-off-by: Petr Štetiar <ynezz@true.cz>
105 lines
3.9 KiB
Diff
105 lines
3.9 KiB
Diff
From 705c0644daa080527dca92eb3509b8a93e9a553a Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Bell <jonathan@raspberrypi.org>
|
|
Date: Tue, 11 Jun 2019 10:55:00 +0100
|
|
Subject: [PATCH] usb: add plumbing for updating interrupt endpoint
|
|
interval state
|
|
|
|
xHCI caches device and endpoint data after the interface is configured,
|
|
so an explicit command needs to be issued for any device driver wanting
|
|
to alter the polling interval of an endpoint.
|
|
|
|
Add usb_fixup_endpoint() to allow drivers to do this. The fixup must be
|
|
called after calculating endpoint bandwidth requirements but before any
|
|
URBs are submitted.
|
|
|
|
If polling intervals are shortened, any bandwidth reservations are no
|
|
longer valid but in practice polling intervals are only ever relaxed.
|
|
|
|
Limit the scope to interrupt transfers for now.
|
|
|
|
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
|
---
|
|
drivers/usb/core/hcd.c | 10 ++++++++++
|
|
drivers/usb/core/message.c | 15 +++++++++++++++
|
|
include/linux/usb.h | 2 ++
|
|
include/linux/usb/hcd.h | 7 +++++++
|
|
4 files changed, 34 insertions(+)
|
|
|
|
--- a/drivers/usb/core/hcd.c
|
|
+++ b/drivers/usb/core/hcd.c
|
|
@@ -1972,6 +1972,16 @@ reset:
|
|
return ret;
|
|
}
|
|
|
|
+void usb_hcd_fixup_endpoint(struct usb_device *udev,
|
|
+ struct usb_host_endpoint *ep, int interval)
|
|
+{
|
|
+ struct usb_hcd *hcd;
|
|
+
|
|
+ hcd = bus_to_hcd(udev->bus);
|
|
+ if (hcd->driver->fixup_endpoint)
|
|
+ hcd->driver->fixup_endpoint(hcd, udev, ep, interval);
|
|
+}
|
|
+
|
|
/* Disables the endpoint: synchronizes with the hcd to make sure all
|
|
* endpoint state is gone from hardware. usb_hcd_flush_endpoint() must
|
|
* have been called previously. Use for set_configuration, set_interface,
|
|
--- a/drivers/usb/core/message.c
|
|
+++ b/drivers/usb/core/message.c
|
|
@@ -1268,6 +1268,21 @@ static void remove_intf_ep_devs(struct u
|
|
intf->ep_devs_created = 0;
|
|
}
|
|
|
|
+void usb_fixup_endpoint(struct usb_device *dev, int epaddr, int interval)
|
|
+{
|
|
+ unsigned int epnum = epaddr & USB_ENDPOINT_NUMBER_MASK;
|
|
+ struct usb_host_endpoint *ep;
|
|
+
|
|
+ if (usb_endpoint_out(epaddr))
|
|
+ ep = dev->ep_out[epnum];
|
|
+ else
|
|
+ ep = dev->ep_in[epnum];
|
|
+
|
|
+ if (ep && usb_endpoint_xfer_int(&ep->desc))
|
|
+ usb_hcd_fixup_endpoint(dev, ep, interval);
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(usb_fixup_endpoint);
|
|
+
|
|
/**
|
|
* usb_disable_endpoint -- Disable an endpoint by address
|
|
* @dev: the device whose endpoint is being disabled
|
|
--- a/include/linux/usb.h
|
|
+++ b/include/linux/usb.h
|
|
@@ -1840,6 +1840,8 @@ extern int usb_clear_halt(struct usb_dev
|
|
extern int usb_reset_configuration(struct usb_device *dev);
|
|
extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
|
|
extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr);
|
|
+extern void usb_fixup_endpoint(struct usb_device *dev, int epaddr,
|
|
+ int interval);
|
|
|
|
/* this request isn't really synchronous, but it belongs with the others */
|
|
extern int usb_driver_set_configuration(struct usb_device *udev, int config);
|
|
--- a/include/linux/usb/hcd.h
|
|
+++ b/include/linux/usb/hcd.h
|
|
@@ -385,6 +385,11 @@ struct hc_driver {
|
|
* or bandwidth constraints.
|
|
*/
|
|
void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
|
|
+ /* Override the endpoint-derived interval
|
|
+ * (if there is any cached hardware state).
|
|
+ */
|
|
+ void (*fixup_endpoint)(struct usb_hcd *hcd, struct usb_device *udev,
|
|
+ struct usb_host_endpoint *ep, int interval);
|
|
/* Returns the hardware-chosen device address */
|
|
int (*address_device)(struct usb_hcd *, struct usb_device *udev);
|
|
/* prepares the hardware to send commands to the device */
|
|
@@ -449,6 +454,8 @@ extern void usb_hcd_unmap_urb_setup_for_
|
|
extern void usb_hcd_unmap_urb_for_dma(struct usb_hcd *, struct urb *);
|
|
extern void usb_hcd_flush_endpoint(struct usb_device *udev,
|
|
struct usb_host_endpoint *ep);
|
|
+extern void usb_hcd_fixup_endpoint(struct usb_device *udev,
|
|
+ struct usb_host_endpoint *ep, int interval);
|
|
extern void usb_hcd_disable_endpoint(struct usb_device *udev,
|
|
struct usb_host_endpoint *ep);
|
|
extern void usb_hcd_reset_endpoint(struct usb_device *udev,
|