mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: raoxu <raoxu@uniontech.com>
To: mathias.nyman@intel.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	wangyuli@uniontech.com, zhanjun@uniontech.com
Subject: Re:[PATCH V4] usb: xhci: Add debugfs support for xHCI port bandwidth
Date: Thu, 13 Mar 2025 21:21:50 +0800	[thread overview]
Message-ID: <20250313132150.3004-1-raoxu@uniontech.com> (raw)

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

                 reply	other threads:[~2025-03-13 13:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250313132150.3004-1-raoxu@uniontech.com \
    --to=raoxu@uniontech.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=wangyuli@uniontech.com \
    --cc=zhanjun@uniontech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®