public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: Andreas Noever <andreas.noever@gmail.com>,
	Mika Westerberg <westeri@kernel.org>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Gil Fine <gil.fine@intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] thunderbolt: Skip reading Rsvd SB registers on older-gen hardware
Date: Mon, 13 Apr 2026 13:43:49 +0200	[thread overview]
Message-ID: <f59c4193-7e07-4375-b418-ab019514fdf8@oss.qualcomm.com> (raw)
In-Reply-To: <20260413114015.GO3552@black.igk.intel.com>

On 4/13/26 1:40 PM, Mika Westerberg wrote:
> On Mon, Apr 13, 2026 at 12:54:41PM +0200, Konrad Dybcio wrote:
>> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>>
>> The Linux TBT subsystem supports hardware aligned with the latest
>> USB4 v2.0 specification. In some places though, it assumes registers
>> only defined in that specification version (previously marked as
>> Reserved) are always accessible.
>>
>> Every version of the spec states:
>>
>> """
>> Unless specified otherwise, the Connection Manager shall not write a
>> register with a value that is marked as “Rsvd”. Writing a register with
>> a value that is marked as “Rsvd” results in undefined behavior.
>> """
>>
>> The effective list of SB registers that need this guarding currently
>> exclusively contains ones that aren't used outside the debugfs dump
>> logic, so just add the required checks there.
>>
>> Fixes: 54e418106c76 ("thunderbolt: Add debugfs interface")
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> ---
>>  drivers/thunderbolt/debugfs.c | 20 ++++++++++++--------
>>  drivers/thunderbolt/retimer.c | 11 ++++++++++-
>>  drivers/thunderbolt/sb_regs.h | 11 ++++++-----
>>  drivers/thunderbolt/tb.h      |  2 ++
>>  4 files changed, 30 insertions(+), 14 deletions(-)
> 
> This is alternative for the v2 patch you sent earlier, right? I prefer that
> one over this.

I think they're complementary. This patch ensures compliance with the
quoted part of the spec, while the other one improves the UX and aids
debugging.

Konrad

  reply	other threads:[~2026-04-13 11:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 10:54 [PATCH RFC] thunderbolt: Skip reading Rsvd SB registers on older-gen hardware Konrad Dybcio
2026-04-13 10:57 ` Greg Kroah-Hartman
2026-04-13 11:40 ` Mika Westerberg
2026-04-13 11:43   ` Konrad Dybcio [this message]
2026-04-13 11:53     ` Mika Westerberg
2026-04-13 12:15       ` Konrad Dybcio

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=f59c4193-7e07-4375-b418-ab019514fdf8@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=gil.fine@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=westeri@kernel.org \
    /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