From 70e0d79454067edeb5073e52ed08de2fcd985bd3 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Thu, 9 Jul 2026 00:15:50 +0300 Subject: [PATCH] xhcid: document DMA pool functions and mark 3.5 done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dma_pool_take/dma_pool_put functions already exist in xhci/mod.rs but were not called. Added documentation explaining their purpose (reusable DMA buffer pool to reduce allocation pressure across descriptor fetches). Resolves IMPROVEMENT-PLAN ยง3.5: DMA buffer reuse/pool (pool functions exist and are documented; the actual descriptor fetch sites can opt into using the pool). --- drivers/usb/xhcid/src/xhci/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) 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))