From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B1A736167F for ; Mon, 13 Apr 2026 12:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776082534; cv=none; b=HMYP1MDPUwESDT5ksyTm2fK+n4kyGwcZsWTIS/nL/L+CJK6lb1O7Hrz8FQcHS6f/nB4KjL4xY3Otwv64wXC6AWCbtxILILtieWfXtbG18fhk6V6zVr6rGPe1oAg7JjLQ5v+Z/U3q+YV5msr5Zfa+y2VrVHk2HXI+2NEK3kEVmbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776082534; c=relaxed/simple; bh=b2KW6U67xE01uYo/G8RxPBUNg6BwtHFvu37L96sm9Ig=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tWTr7yK+uAgy3jNGSw3k9H9igZyaHnL1KdhH9SkIifo8gM9ZSQIBMlV5ihedHRzIR/4sU1M1bAd+v61QjVSv28DqF55lSYFQgVkOvcsZo4gQlejdNMb8XaJopBsKAt72VVk5Z7wpbcZdyPuZebSZK93TueVH5NGR4ohoLP6I3hc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=WGd+4OB2; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=I8GYFgk3; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="WGd+4OB2"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="I8GYFgk3" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63DC0psd3692418 for ; Mon, 13 Apr 2026 12:15:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= MeOeo4v6EXekakSCExIcqk5douxj2pX0LuVyxBkTQv8=; b=WGd+4OB2S5ZA90eg N1n89NYl3KwAH7C9a5G0cNvMxg07DcYTg+hn6ncPmBtekxIslBK+CPhvIq8gJ9w9 P2YY+zFPQiE8jjA5MOcAdBfIL7KrZXTHh9+EguWhJIVt4rCRq2ihCZlYdGAUfnei 50hJG2g1SAQzLVCWd+bNz6xjEtdzLnhlCqdSZmUhMPAEjhKudpLMZQSqtKpev4Cc oQLg5/+6N62azxrqW3sL68KG9rYUi1BAchN9NeQalQsv9rfG7nR4xVe92ZhSUYLR F8gONZcmdZsq+m7FN4osl4QEoChc4LowXn4I4lcVdB9OIIVM/27B/f62z+QwNayK UY/jkA== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dfffhw5jr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 13 Apr 2026 12:15:32 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50d8c183c2eso40971431cf.0 for ; Mon, 13 Apr 2026 05:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776082531; x=1776687331; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MeOeo4v6EXekakSCExIcqk5douxj2pX0LuVyxBkTQv8=; b=I8GYFgk3avo25QoX9yQExZD62J3krO2DZtjyawJb7VeFtVJkrkU0QICNKSDAiGBGAa j/sre5ZN468VBs2iQY0TBgMJ1fyEPFfbEN4aU+oVdVoJTiRWxAYLPG+COIlJAUU23yCI 9PH74qJU1DUXXearRO6bKS+v5oOY4J0hijXmoP0nU/WGrRTDw9wsqj0QDnbesw5nhhnE 9cfHmhZ3rLL6qfhVNYG+csWW5kg7U/jFhucp5yse52zu14AihqgwVdqgpmKKl9rPcc41 zDMpcZPbB3fPHwsYe8dVRQl9+H50plcfVmAKbvHEJvb2EBeLX607FX0KGGO9fyxmMdte EESQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776082531; x=1776687331; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MeOeo4v6EXekakSCExIcqk5douxj2pX0LuVyxBkTQv8=; b=TACq2x9XXa6FTzBnHnPdRrnE9smiqB0VpAFTajF7W1gt7B56dTYui18KsHEvlTEJmO 7PAg19NP6nGHTRfa0cCDnYxwyrHk/lMXt8jeinOfL0CSNqvgHLAEn7PC2Hnd84M+qiv/ cCjfwS4HO0h/JZZVdqPZghobHSn535oRLlJIZixadnOBBYA54Qx25Fh/DS7DbQrJP5Cz SC2mYTQibRLppp5NIDzeOsjJEc7Jt6eA+I1//vl+ZYyjWeFdD2TM00mfx1c++r2NvxA3 j3eiBx9mipJJdMm+kykkqWTk1avuJo1KGlmtCQpiWojMyqTAss7dUkBBDqqQIvPgl5Y/ mxYA== X-Forwarded-Encrypted: i=1; AFNElJ/nMUPULiOhWo5w4tjkaOgBblxLni75e7GIQc+4VHb74PPUg0PcK2DZ21HOBtRqUDPNidt0JIVmutGqgFM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxlwyfn5E4RzXqHe09u7zQNT89Efw1KrCBDFkS6hVwenCXmMWsA zbizzUTPLWuagkxnLJ/vVdh+6ymBsne3LmpRQ3nHS/Xbm+6cBcj/UYN7PfKwwU7wS5JUGLq8iCN eh78ImdNUDtNNse+LDhb5PE6nMUcvbwzPpl5/dHt5Urv/OynifY2kn6SgAuIg/kwBA2o= X-Gm-Gg: AeBDieviNF4gOOCRmdrX0DKvJ4b8Yve75Xjl+9s746TiJV+f+OiKe9z9yasT36fJ8WZ 19mWYSKlJmEJvgPU+wKYBbKKBC5JUWFAuemJ36ApTFPSQTwoLG7PaXfNZS2+WoUgr40PB0DF+tr /aYGhrWtfAFZ3l1phZADDbRFxXnc+g/052g9XhiJ6vmS3WCds/TABBbGXgwYcyTv+rknsxvr4jp 0Jtva56dNYnH/1v0U4sTddHAFYbZ64vbeT0mxiFCWU7dXLQktkFllDoFdS96kSThMHIANc/8VWF 7KlLTsYkhK/kqltzp0oUUkgGze4y0GJ7g3gfAjsVkUasmzfdSj6l0NhFO3bW7uGP2aRICsrdDd4 8T0nclzfsfVeCoL+aKqtBbfF/4BN3mGVN6vofdUOgM3jnvPMCV4WxvyQu0coDbDJ6ev8deDL6SX xRalM= X-Received: by 2002:ac8:5fd1:0:b0:509:2a92:8088 with SMTP id d75a77b69052e-50dd5a9118cmr146954651cf.1.1776082531146; Mon, 13 Apr 2026 05:15:31 -0700 (PDT) X-Received: by 2002:ac8:5fd1:0:b0:509:2a92:8088 with SMTP id d75a77b69052e-50dd5a9118cmr146953821cf.1.1776082530462; Mon, 13 Apr 2026 05:15:30 -0700 (PDT) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9d6dfd77f6sm307386466b.21.2026.04.13.05.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2026 05:15:29 -0700 (PDT) Message-ID: <52e8c5d3-52ac-4e33-b6f6-88c8823abd06@oss.qualcomm.com> Date: Mon, 13 Apr 2026 14:15:27 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC] thunderbolt: Skip reading Rsvd SB registers on older-gen hardware To: Mika Westerberg Cc: Konrad Dybcio , Andreas Noever , Mika Westerberg , Yehezkel Bernat , Greg Kroah-Hartman , Gil Fine , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260413-topic-usb4_limit_sb_reads-v1-1-778a6eb37f7b@oss.qualcomm.com> <20260413114015.GO3552@black.igk.intel.com> <20260413115305.GP3552@black.igk.intel.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260413115305.GP3552@black.igk.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDEzMDEyMSBTYWx0ZWRfX2Fz2RO26KIbu Azs1WWVGpzpdUWArl/cajIvwWVcNWvwXZyABRB6+wqwWCNMH8Gb0psoDEol1AnGU5HpYyPWbVOe fmrChpEfzR7eMQzS/TU1pMapcn1IhYWN6ET8QheVzi9UUexUFjvEz6/34c4XPDjwpYRhe1nGpMU tE2KZxyXadfBWWv/M/mKE0iDZ8E87rxi9ktyqbEaFdaJz4o0bITO+IkOFkd9QW3MCqBM339xnHg iRzYWnNR47YzvC7Aqne5Ebu1CkHRSZJl4dPNBTn7IxA1hpYrIEjH6x9xHf0x2AAP4m/h9pgAR7n 2+xjilywG0q+W+lVBD0jHP73XBSbyXGnAVsWbBwNtV/WUw8Xd5Os8Gfym3BlzbTrMbehARNZSf8 rj1oonvLVDKsaDs6uWvqgus025umWo41Drs4t8aVipyQas7qBFpsfysLt5ow641Xi3ywK0am3/t 5p3y5/gdQ3M47UCxh/A== X-Proofpoint-ORIG-GUID: uTZTD5BU5JSyJgHX6L-BIajr1kQGh_vs X-Authority-Analysis: v=2.4 cv=FOkrAeos c=1 sm=1 tr=0 ts=69dcde64 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=3vEATxqM7effXUbsBJ0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-GUID: uTZTD5BU5JSyJgHX6L-BIajr1kQGh_vs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-13_03,2026-04-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604130121 On 4/13/26 1:53 PM, Mika Westerberg wrote: > On Mon, Apr 13, 2026 at 01:43:49PM +0200, Konrad Dybcio wrote: >> 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 >>>> >>>> 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 >>>> --- >>>> 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. > > This adds a lot of code for just debugfs access so I think we are better > without. Just the other one works too, then. Konrad