summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-24 15:31:19 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-24 15:31:19 -1000
commit168151cdb0f93d26557f9f3c7aae659b8d6b1863 (patch)
tree803156129b8f6098e07426b2e2105dd203be7485 /include/linux
parentcb8fef4b07f71da01843457b66e579ad248a625e (diff)
parentbdf12cde30830d46a8ef1ba93986356f1164b4f1 (diff)
Merge tag 'usb-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB / Thunderbolt update from Greg KH: "Here is the big set of USB and Thunderbolt changes for 7.4-rc1. Included in here are: - thunderbolt driver updates and fixes - lots of dt schema conversions - usb gadget driver fixes (and a new maintainer!) - usb core fixups with some interactions with the driver core - usb serial updates and fixes for scan-found "issues" - xhci driver updates - typec driver updates - dwc3 driver updates - lots of usb gadget driver fixes for syzbot found "problems" - lots of other small USB driver fixes for randomly reported problems. All of these have been in linux-next with no reported issues" * tag 'usb-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (158 commits) usb: gadget: dummy_hcd: prevent unbind via sysfs usb: gadget: dummy_hcd: add tick_us module parameter for timer-rate tuning usb: gadget: dummy_hcd: set no_sg_constraint only on the SuperSpeed bus usb: gadget: dummy_hcd: fix SuperSpeed ep0 maxpacket usb: gadget: fix refcount underflow in gadgetfs_bind() error path USB: core: document purpose of interface parent reference MAINTAINERS: add Neill Kapron as USB Gadget maintainer USB: Documentation: Update description of completion callback context USB: serial: mxuport: support RS485 mode configuration USB: serial: mxuport: handle SEND_NEXT transmit flow control USB: serial: add generic write control callbacks USB: serial: mxuport: add MUX50U-based device support USB: serial: mxuport: clean up firmware version handling USB: serial: mxuport: clean up product ID definitions and device table USB: serial: sierra: fix urb leak on write completion usb: typec: ucsi_ccg: Add retry mechanism in ccg_read usb: host: xhci-tegra: Add Tegra264 XHCI support usb: host: xhci-tegra: Skip MBOX MSG_ENABLED on Tegra264 dt-bindings: usb: Add Tegra264 XUSB host support usb: xhci-pci: Add TUSB73x0 definitions ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/thunderbolt.h47
-rw-r--r--include/linux/ulpi/driver.h4
-rw-r--r--include/linux/usb.h13
-rw-r--r--include/linux/usb/serial.h8
-rw-r--r--include/linux/usb/typec_altmode.h4
6 files changed, 66 insertions, 11 deletions
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 63774ae2bf71..b896315b43fd 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -889,6 +889,7 @@
#define PCI_DEVICE_ID_TI_XX12 0x8039
#define PCI_DEVICE_ID_TI_XX12_FM 0x803b
#define PCI_DEVICE_ID_TI_XIO2000A 0x8231
+#define PCI_DEVICE_ID_TI_TUSB73X0 0x8241
#define PCI_DEVICE_ID_TI_1130 0xac12
#define PCI_DEVICE_ID_TI_1031 0xac13
#define PCI_DEVICE_ID_TI_1131 0xac15
diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h
index b62dfa52b149..57502da29080 100644
--- a/include/linux/thunderbolt.h
+++ b/include/linux/thunderbolt.h
@@ -370,7 +370,7 @@ int tb_xdomain_request(struct tb_xdomain *xd, const void *request,
* @uuid: XDomain messages with this UUID are dispatched to this handler
* @callback: Callback called with the XDomain message. Returning %1
* here tells the XDomain core that the message was handled
- * by this handler and should not be forwared to other
+ * by this handler and should not be forwarded to other
* handlers.
* @data: Data passed with the callback
* @list: Handlers are linked using this
@@ -507,6 +507,7 @@ void tb_service_properties_changed(struct tb_service *svc);
* @iobase: MMIO space of the NHI
* @tx_rings: All Tx rings available on this host controller
* @rx_rings: All Rx rings available on this host controller
+ * @interrupt_mask: Shadow copy of the ring interrupt mask register
* @going_away: The host controller device is about to disappear so when
* this flag is set, avoid touching the hardware anymore.
* @iommu_dma_protection: An IOMMU will isolate external-facing ports.
@@ -528,6 +529,7 @@ struct tb_nhi {
void __iomem *iobase;
struct tb_ring **tx_rings;
struct tb_ring **rx_rings;
+ u32 *interrupt_mask;
bool going_away;
bool iommu_dma_protection;
struct work_struct interrupt_work;
@@ -553,6 +555,8 @@ struct tb_nhi {
* @work: Interrupt work structure
* @is_tx: Is the ring Tx or Rx
* @running: Is the ring running
+ * @notify_pending: Controller has not been notified about the posted
+ * descriptors yet
* @irq: MSI-X irq number if the ring uses MSI-X. %0 otherwise.
* @vector: MSI-X vector number the ring uses (only set if @irq is > 0)
* @flags: Ring specific flags
@@ -582,6 +586,7 @@ struct tb_ring {
struct work_struct work;
bool is_tx:1;
bool running:1;
+ bool notify_pending:1;
int irq;
u8 vector;
unsigned int flags;
@@ -672,7 +677,8 @@ bool tb_ring_flush(struct tb_ring *ring, unsigned int timeout_msec);
void tb_ring_stop(struct tb_ring *ring);
void tb_ring_free(struct tb_ring *ring);
-int __tb_ring_enqueue(struct tb_ring *ring, struct ring_frame *frame);
+int __tb_ring_enqueue(struct tb_ring *ring, struct ring_frame *frame, bool more);
+void tb_ring_notify(struct tb_ring *ring);
/**
* tb_ring_rx() - enqueue a frame on an RX ring
@@ -693,7 +699,24 @@ int __tb_ring_enqueue(struct tb_ring *ring, struct ring_frame *frame);
static inline int tb_ring_rx(struct tb_ring *ring, struct ring_frame *frame)
{
WARN_ON(ring->is_tx);
- return __tb_ring_enqueue(ring, frame);
+ return __tb_ring_enqueue(ring, frame, false);
+}
+
+/**
+ * tb_ring_rx_more() - enqueue a frame on an RX ring without notifying
+ * @ring: Ring to enqueue the frame
+ * @frame: Frame to enqueue
+ *
+ * Same as tb_ring_rx() but does not notify the controller about the
+ * enqueued frame. The caller must call tb_ring_notify() once it is done
+ * enqueuing frames.
+ *
+ * Return: %-ESHUTDOWN if tb_ring_stop() has been called, %0 otherwise.
+ */
+static inline int tb_ring_rx_more(struct tb_ring *ring, struct ring_frame *frame)
+{
+ WARN_ON(ring->is_tx);
+ return __tb_ring_enqueue(ring, frame, true);
}
/**
@@ -714,11 +737,27 @@ static inline int tb_ring_rx(struct tb_ring *ring, struct ring_frame *frame)
static inline int tb_ring_tx(struct tb_ring *ring, struct ring_frame *frame)
{
WARN_ON(!ring->is_tx);
- return __tb_ring_enqueue(ring, frame);
+ return __tb_ring_enqueue(ring, frame, false);
+}
+
+/**
+ * tb_ring_tx_more() - enqueue a frame on a TX ring without notifying
+ * @ring: Ring to enqueue the frame
+ * @frame: Frame to enqueue
+ *
+ * Same as tb_ring_rx_more() but for TX ring.
+ *
+ * Return: %-ESHUTDOWN if tb_ring_stop() has been called, %0 otherwise.
+ */
+static inline int tb_ring_tx_more(struct tb_ring *ring, struct ring_frame *frame)
+{
+ WARN_ON(!ring->is_tx);
+ return __tb_ring_enqueue(ring, frame, true);
}
/* Used only when the ring is in polling mode */
struct ring_frame *tb_ring_poll(struct tb_ring *ring);
+bool tb_ring_poll_pending(struct tb_ring *ring);
void tb_ring_poll_complete(struct tb_ring *ring);
int tb_ring_throttling(struct tb_ring *ring, unsigned int interval_nsec);
diff --git a/include/linux/ulpi/driver.h b/include/linux/ulpi/driver.h
index c668d9c8d876..c899197e0aa8 100644
--- a/include/linux/ulpi/driver.h
+++ b/include/linux/ulpi/driver.h
@@ -51,8 +51,8 @@ struct ulpi_driver {
/*
* use a macro to avoid include chaining to get THIS_MODULE
*/
-#define ulpi_register_driver(drv) __ulpi_register_driver(drv, THIS_MODULE)
-int __ulpi_register_driver(struct ulpi_driver *drv, struct module *module);
+#define ulpi_register_driver(drv) __ulpi_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
+int __ulpi_register_driver(struct ulpi_driver *drv, struct module *module, const char *mod_name);
void ulpi_unregister_driver(struct ulpi_driver *drv);
#define module_ulpi_driver(__ulpi_driver) \
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 49ab8dbb885f..825f03b29067 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1369,8 +1369,10 @@ extern void usb_deregister(struct usb_driver *);
module_driver(__usb_driver, usb_register, \
usb_deregister)
-extern int usb_register_device_driver(struct usb_device_driver *,
- struct module *);
+#define usb_register_device_driver(new_udriver) \
+ __usb_register_device_driver(new_udriver, THIS_MODULE, KBUILD_MODNAME)
+extern int __usb_register_device_driver(struct usb_device_driver *,
+ struct module *, const char *);
extern void usb_deregister_device_driver(struct usb_device_driver *);
extern int usb_register_dev(struct usb_interface *intf,
@@ -1606,7 +1608,12 @@ typedef void (*usb_complete_t)(struct urb *);
*
* Completion Callbacks:
*
- * The completion callback is made in_interrupt(), and one of the first
+ * The completion callback can occur in any context: process, interrupt,
+ * BH, or anything else. Also, interrupts may or may not be disabled on
+ * the local CPU when the callback runs. A completion handler routine
+ * must not depend on any particular properties of its environment.
+ *
+ * One of the first
* things that a completion handler should do is check the status field.
* The status field is provided for all URBs. It is used to report
* unlinked URBs, and status for all non-ISO transfers. It should not
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index ab0a32a90629..5866f19d3c7b 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -305,9 +305,17 @@ struct usb_serial_driver {
void (*write_bulk_callback)(struct urb *urb);
/* Called by the generic read bulk callback */
void (*process_read_urb)(struct urb *urb);
+ /*
+ * Called with port->lock held before preparing another write URB.
+ * Drivers returning false must restart the generic write path when
+ * writes may proceed again.
+ */
+ bool (*write_ready)(struct usb_serial_port *port);
/* Called by the generic write implementation */
int (*prepare_write_buffer)(struct usb_serial_port *port,
void *dest, size_t size);
+ /* Called with port->lock held to roll back a failed write submission */
+ void (*write_rollback)(struct usb_serial_port *port, int count);
};
#define to_usb_serial_driver(d) \
container_of(d, struct usb_serial_driver, driver)
diff --git a/include/linux/usb/typec_altmode.h b/include/linux/usb/typec_altmode.h
index ef21ead551be..92309b569c3a 100644
--- a/include/linux/usb/typec_altmode.h
+++ b/include/linux/usb/typec_altmode.h
@@ -227,9 +227,9 @@ struct typec_altmode_driver {
* handle all SVID specific communication.
*/
#define typec_altmode_register_driver(drv) \
- __typec_altmode_register_driver(drv, THIS_MODULE)
+ __typec_altmode_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
int __typec_altmode_register_driver(struct typec_altmode_driver *drv,
- struct module *module);
+ struct module *module, const char *mod_name);
/**
* typec_altmode_unregister_driver - unregisters a USB Type-C alternate mode
* device driver