public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: "Neronin, Niklas" <niklas.neronin@linux.intel.com>
To: "Michał Pecio" <michal.pecio@gmail.com>
Cc: linux-usb@vger.kernel.org, mathias.nyman@linux.intel.com
Subject: Re: [PATCH 2/4] usb: xhci: move debug capabilities from trb_in_td() to handle_tx_event()
Date: Wed, 5 Mar 2025 11:17:58 +0200	[thread overview]
Message-ID: <5144b2b1-997a-4c4e-befe-43a21d357c1b@linux.intel.com> (raw)
In-Reply-To: <20250305094600.1630ef54@foxbook>



On 05/03/2025 10.46, Michał Pecio wrote:
>> +debug_finding_td:
>> +	xhci_err(xhci, "Transfer event %u ep %d dma %016llx not part of current TD start %016llx end %016llx\n",
>> +		 trb_comp_code, ep_index, (unsigned long long)ep_trb_dma,
>> +		 (unsigned long long)xhci_trb_virt_to_dma(td->start_seg, td->start_trb),
>> +		 (unsigned long long)xhci_trb_virt_to_dma(td->end_seg, td->end_trb)); +
>> +	xhci_for_each_ring_seg(ep_ring->first_seg, ep_seg) {
>> +		xhci_warn(xhci, "Ring seg %u trb start %016llx end %016llx\n", ep_seg->num,
>> +			  (unsigned long long)ep_seg->dma,
>> +			  (unsigned long long)(ep_seg->dma + TRB_SEGMENT_SIZE));
>> +	}
>> +	return -ESHUTDOWN;
> 
> Cleaning up trb_in_td() is obviously the right thing to do, but one
> thing I always disliked about this message is how long and verbose it
> is. Not sure if dumping all ring segments is useful here, seg->dma can
> generally be deduced by looking at the DMA pointers involved.
> 
> As far as improvements go, IMO it would be much more useful to decode
> those pointers into seg-number/trb-index pairs. I wrote a PoC and the
> result is quite encouraging, I may submit it if there is interest.
> 

Agreed, printing the segment number and TRB index is a better approach.
This is my plan for the future, but in my opinion, the format for common
values should be consistent. Therefore, the change to segment number and
index should be implemented simultaneously across all xHCI driver prints,
except for some specific places. Thus, it's not changed in this patch set.

I plan to make this change after the rework of trb_in_td(). Currently,
I am testing a new trb_in_td() version suggested by Mathias, which would
make the number/index change even more logical.

Regards,
Niklas


  reply	other threads:[~2025-03-05  9:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 10:34 [PATCH 0/4] usb: xhci: improve trb_in_td() Niklas Neronin
2025-02-06 10:34 ` [PATCH 1/4] usb: xhci: refactor trb_in_td() to be static Niklas Neronin
2025-02-06 10:34 ` [PATCH 2/4] usb: xhci: move debug capabilities from trb_in_td() to handle_tx_event() Niklas Neronin
2025-03-05  8:46   ` Michał Pecio
2025-03-05  9:17     ` Neronin, Niklas [this message]
2025-02-06 10:34 ` [PATCH 3/4] usb: xhci: rework and simplify trb_in_td() Niklas Neronin
2025-02-19  8:56   ` Michał Pecio
2025-02-19 14:25     ` Mathias Nyman
2025-02-20 12:14     ` [PATCH 5/4 RFC] An alternative dma_in_range() implementation Michał Pecio
2025-02-20 13:18       ` Neronin, Niklas
2025-02-20 12:25     ` [PATCH 3/4] usb: xhci: rework and simplify trb_in_td() Neronin, Niklas
2025-02-06 10:34 ` [PATCH 4/4] usb: xhci: modify trb_in_td() to be more modular Niklas Neronin

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=5144b2b1-997a-4c4e-befe-43a21d357c1b@linux.intel.com \
    --to=niklas.neronin@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=michal.pecio@gmail.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