* Re:[PATCH V4] usb: xhci: Add debugfs support for xHCI port bandwidth
@ 2025-03-13 13:21 raoxu
0 siblings, 0 replies; only message in thread
From: raoxu @ 2025-03-13 13:21 UTC (permalink / raw)
To: mathias.nyman, gregkh; +Cc: linux-usb, linux-kernel, wangyuli, zhanjun
On 2025/3/12 23:32, Mathias Nyman wrote:
thanks Mathias Nyman,
>xHC might be runtime suspended when this debugfs file is read.
>We should make sure xHC is running here by calling pm_runtime_get() or similar,
>to make sure command can be processed.
This suggestion is very useful. Before reading the bandwidth. Need to make sure
the device is active
>I think its better to create a new command structure with context for each time
>we read port bandwidth instead of allocating one shared.
>
>The port bandwidth won't be read at all in most cases, and sharing has
>concurrency issues.
>
>I'd suggest adding support for a new XHCI_CTX_TYPE_PORT_BW context type to
>xhci_alloc_container_ctx(), which allocates and maps 256 bytes, 16byte aligned,
>like xhci->small_streams_pool dma pool.
When obtaining port bandwidth, alloc a new command structure with context for
each time.This is indeed better for concurrent reading.
In the specific implementation, I created a new dma pool for port bandwidth
context. I used the new function xhci_alloc_port_bw_ctx to get container_ctx
instead of still using xhci_alloc_container_ctx. Because xhci_alloc_container_ctx
allocates space from device_pool, and xhci_free_container_ctx also operates
on device_pool. So it is more intuitive to use a new function instead of
adding a new XHCI_CTX_TYPE_PORT_BW context type. I put the code changes on
patch v5.
thanks,
raoxu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-13 13:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-13 13:21 Re:[PATCH V4] usb: xhci: Add debugfs support for xHCI port bandwidth raoxu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®