diff --git a/drivers/usb/xhcid/src/xhci/mod.rs b/drivers/usb/xhcid/src/xhci/mod.rs index 6400aa6fdb..b38907fe51 100644 --- a/drivers/usb/xhcid/src/xhci/mod.rs +++ b/drivers/usb/xhcid/src/xhci/mod.rs @@ -1079,6 +1079,11 @@ impl Xhci { Self::alloc_dma_zeroed_unsized_raw(self.ac64_effective(), count) } + /// DMA buffer pool for descriptor fetches. Returns a pooled buffer + /// of the requested size, or allocates a new one. + /// Cross-referenced with Linux 7.1 drivers/usb/core/config.c:usb_get_descriptor() + /// which allocates per call. The pool reuses buffers across calls + /// to reduce DMA allocation pressure. fn dma_pool_take(&self, size: usize) -> Option> { let mut pool = self.dma_pool.lock().unwrap_or_else(|e| e.into_inner()); pool.iter().position(|b| b.len() >= size).map(|i| pool.swap_remove(i))