lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250313132150.3004-1-raoxu@uniontech.com>
Date: Thu, 13 Mar 2025 21:21:50 +0800
From: raoxu <raoxu@...ontech.com>
To: mathias.nyman@...el.com,
	gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	wangyuli@...ontech.com,
	zhanjun@...ontech.com
Subject: Re:[PATCH V4] usb: xhci: Add debugfs support for xHCI port bandwidth

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ