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 5A3571A6803 for ; Thu, 9 Apr 2026 13:00:18 +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=1775739619; cv=none; b=AfWxwmO76hVFI03aPqBmSYJUxhJlRda7B+GDxwFCj/EJ8OWJpE2gnAXnkQp/S5gmfxkYk/nY/UqTfYa6PYIHCTJAe4Yb6cfTf1aJfcCRdylmtPINyVCDwqveQDk3uvrcWgrZjI9uLqLK2oad8bvU01g8YRHJSiqDhD5iJi2HBCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775739619; c=relaxed/simple; bh=B3T1ur1/pLWxh4vLuUwgZxeixK+GjqqHG2hHpa1b/zo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EbFC92Zh0NBD9ma4zh+dt/FHFT5rjRtEdVOucxGeQMmcvga3G06e5hcnPeTqq30rLRcLXPyfE7xyafJv5+MxlIV8fGs5GQb8DnUtsIEXZDQoTiJw2HVwFILNO8QRbIsAv+smo1p6PWb66WAKMbY/xtbPUIL/OLeGuSP9ZdqpbhE= 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=fSZXjaZX; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZWqKW5wB; 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="fSZXjaZX"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZWqKW5wB" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6397tYY43781304 for ; Thu, 9 Apr 2026 13:00:17 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= xbczaBz0yrE8tkAEgYb73pKREevRtWau+pNaf1Zr2bo=; b=fSZXjaZXSfqyXZJg RW2TWloIDSBlwRx45S9u9Qzwsei1EJfyW+sycV9V/VMjXz2Osz03sfgxcUVKYj1A 7yf46E2CEyrMu6/v0F6fxDlaqQpaLM//xFs/jkDLAQM6p2+2rumCOsVogZBkh6cv E6f2SYr2X2zHSjv9K9KfgOZzBySFPKxExLBLwG6SJdlMiatii3iZY5o8I8nns5Jb tTPr0Z2poN64cu9zEeenDcVDGDStlY3qnL2nFitrqnqfkt8qDrkyJFjKhBGLkcvn a4YjvhSdCYh+th7fix4VndB/8ecsVxnM44pKuYzGuHibOksuzZkynN6seMfLndMT 5nTq9g== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ddt6yc6t0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Apr 2026 13:00:16 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb39de5c54so20130385a.0 for ; Thu, 09 Apr 2026 06:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775739574; x=1776344374; 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=xbczaBz0yrE8tkAEgYb73pKREevRtWau+pNaf1Zr2bo=; b=ZWqKW5wBqvbDZ4QBQHjqcvKmzAz6uuioGENrWlZyEPE2m0u1SfQndibQv0NvJguOIa ht4Yq3djGlAFexSKCwX4VRm+MHjOK2aALhiEL4QZn8pzl+R/zD+JSow5mvSjjAemO8SA JzCkDifwpkx++NNSiZ8bMWCRw79XkHxV7YemDIDtgTgJAc6fxjJNJhnBkV41+ZaCkSir /jGsqxeJlBJcrkiUQF0M/1p5I7HCG59+V/Tp+khhC1VuQ0gHI4L3J4IjX7NWxNLEejHL s2Udc67kNxGIXohk3nFQryMm6OAjWu6NyavLrZbtn/PNIKTNVlnKHzF1O86eTabD51ne MN6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775739574; x=1776344374; 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=xbczaBz0yrE8tkAEgYb73pKREevRtWau+pNaf1Zr2bo=; b=sVWpng99PfWXJTDu+hVaW0rXat28Ca3wEuGEbNBjR/x9bd8/vI8iXqAlMb1I2Oxe1O edLD+kfrYBq3BSZ/zltsR7vN6x1VSNNH34i4lJkTozlxhHcU3C0W3mDTRAvEImB/6Aiy A8iFZCTZfDNOOux1wE1VXoPlAqHEKPuZgByfKlTUQtsXY9wJ142YTxWktKsJyu2Potln dzE2yArK/uCJf8T9JM5dnu8URB8Kgo0pZMDlWW8dTcnhjwK3lYK98hbwFOjCocNg3TZy zz0s4Lwsf3wLmDI2MbL7US8SpdZnqAZDmK0fbv1w3cliz6UTZ1k+mMXi+kd1Ca9g5Vvc Ntqw== X-Forwarded-Encrypted: i=1; AJvYcCW9to1xKGxmsoQUIEHHNCL3dbrOtg2IDrhzZfTb8iYxHob2A+5ekAVttgvXfJuQaJbt5TAA3QOE5dYMNKQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzfycnjhTnpIIdwYl5JoKDI+3gchKtvBhCdjHaRU41wePEWwa+y cBxdYQPpXuMbsVe+fvZ7T7HScGkGgUkvRNRv2VEd/iL5/WNAMetMLrIje0zTzLIBq19i40hmrXI lMn0rmPvrjUPh4TJTfXi9Twmb1TOlzPeloyDlGcsX1t/z3T1xnIkALlWS6Qpu5UcyLMI= X-Gm-Gg: AeBDieumc0rXHAOPWDhz9CZMxABTJsM+APx4WOWIl2/qEI8VA3VCBiUheCT10dRi84p Q4M89yxGsiq/XsHrW4myV0Ioq/Ub0lngtdiqxkmjnxM9r6EZR2934QgFugDyzy6KNKdQ+V7qESp +PBI0ziiu+5N8+KvnKjySEPnHMwGqpfjIdTSrpzkxQFEawvzEx7zOxmdReUueg1OUJ0yv5zGW3e 1sxHeX/J8i2m4UemKhIIxnkTnaPPqpcVl8XZi/Qo27NH26NyoM8stUboZWWMxH88eF6PWN1ggXV 3QfGw1l9HjW1SAz9APQTSab+DfWrj+CIJsdSBrslyDegBucdpJld3fwqaPZ+AkouDcR/xi8w48/ DJCdKy2YravPGrL+EmuanORWzUvzTPSeCmkm2YWJXuci1P/WTECWzuUKs0pzstOlF9Yrrdi0PV3 KMnB4= X-Received: by 2002:a05:620a:f0b:b0:8cf:df37:4f97 with SMTP id af79cd13be357-8d41bad7a32mr2661523385a.7.1775739574496; Thu, 09 Apr 2026 05:59:34 -0700 (PDT) X-Received: by 2002:a05:620a:f0b:b0:8cf:df37:4f97 with SMTP id af79cd13be357-8d41bad7a32mr2661519685a.7.1775739574055; Thu, 09 Apr 2026 05:59:34 -0700 (PDT) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-66e7b5ffa64sm3930010a12.21.2026.04.09.05.59.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2026 05:59:24 -0700 (PDT) Message-ID: <75c962d1-7ade-483b-bbc9-a6c6140fc0e9@oss.qualcomm.com> Date: Thu, 9 Apr 2026 14:59:22 +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] thunderbolt: debugfs: Don't stop reading SB registers if just one fails To: Mika Westerberg , Konrad Dybcio Cc: Andreas Noever , Mika Westerberg , Yehezkel Bernat , usb4-upstream@oss.qualcomm.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260409-topic-tbt_sb_debugfs-v1-1-131540e0cc2b@oss.qualcomm.com> <20260409120457.GH3552@black.igk.intel.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260409120457.GH3552@black.igk.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: TQ9V32md-9CepczlaCHWW2p40-T--ztk X-Proofpoint-GUID: TQ9V32md-9CepczlaCHWW2p40-T--ztk X-Authority-Analysis: v=2.4 cv=R9sz39RX c=1 sm=1 tr=0 ts=69d7a2e0 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=fGwfUCG3lQqjGGzWVLIA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDA5MDExNyBTYWx0ZWRfX9IQQ9ytyHb7F bDr2i7eIdLuBdsRAwvzVTJXMgftAT3uDT8J0cy7ikPVloPkZQgL8rDdMw6rMvJm4dEEEW1hXWlW MQso3UHbefbgdu6/yLAVijHlwty/h3W/jJa2tTf8sSdj+oKEsdKReUTGwTSbSCQF/VE46HJg5r2 tHC2oA5HME/zep/z+nKyqYXwoka9uMATqUpC9flNe7qo3dexkYfwcwnWSsL91iXSudddTHMTJb1 SZ/FF20EMNZght+3Ax2uQ6xK9nAO8m/+YG7t7wpvHrngqyL/yosNA8KPzCPQHTGQOv1o82V2LbX W5dYdS+GPlh6LC3sP7noDEJ7+7h4dFMo6Z0KUV4fwjwbTgtnxH1P45FlnB2XH6fqdhGKie0Q7mU FRUj924GYthi65HxSFt1CNzRSFQh913SfalcjfPyYhqGJvjeu9wa3TiqkNUBZqsaxb0BFuW3ZGq tss4IZNdkJmuqPTkr6Q== 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-09_03,2026-04-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604090117 On 4/9/26 2:04 PM, Mika Westerberg wrote: > Hi, > > On Thu, Apr 09, 2026 at 01:22:01PM +0200, Konrad Dybcio wrote: >> From: Konrad Dybcio >> >> The GEN4 TxFFE register is not part of the USB4 v1.0 specification, so >> understandably some pre-USB4v2 retimers (like the Parade PS8830) don't >> seem to implement it. >> >> The immediate idea to counter this would be to introduce a version >> check for that specific register, but on a second thought, the current >> flow only returns a quiet -EIO if there's _any_ failures, without >> hinting at what the actual problem is. > > Please don't use _any_ emphasis in the commit messages here or in the > future. If I must, I shall.. other maintainers don't mind. >> To take care of both of these issues, simply print an error line for >> each SB register read that fails and go on with attempting to read the >> others. >> >> Note that this is not quite in-spec behavior ("The SB Register Space >> registers shall have the structure and fields described in Table 4-17. >> Registers not listed in Table 4-20 are undefined and shall not be >> used."), but it's the easiest fix that shouldn't (TM) have real-world >> bad side effects. > > Also drop the "(TM)" thing. > > I assume you have tested this on a hardware that supports this too, right? Hardware that exposes that register this does not exercise the altered code path. >> Fixes: 6d241fa00159 ("thunderbolt: Add sideband register access to debugfs") >> Signed-off-by: Konrad Dybcio >> --- >> drivers/thunderbolt/debugfs.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c >> index 042f6a0d0f7f..8237e1ea6d09 100644 >> --- a/drivers/thunderbolt/debugfs.c >> +++ b/drivers/thunderbolt/debugfs.c >> @@ -2361,8 +2361,10 @@ static int sb_regs_show(struct tb_port *port, const struct sb_reg *sb_regs, >> memset(data, 0, sizeof(data)); >> ret = usb4_port_sb_read(port, target, index, regs->reg, data, >> regs->size); >> - if (ret) >> - return ret; >> + if (ret) { >> + seq_printf(s, "0x%02x Error reading register: %d\n", regs->reg, ret); > > Why not tb_port_dgb/warn()() here instead so it goes into dmesg, not to the > output. Because when one reads out sys/debugfs, it's generally expected that the related output is provided there. If we don't want to print the retval, I can copy the message that's printed when switch/port capabilities readout fails, i.e. -- drivers/thunderbolt/debugfs.c : cap_show_by_dw() if (port) ret = tb_port_read(port, &data, TB_CFG_PORT, cap + offset + i, 1); else ret = tb_sw_read(sw, &data, TB_CFG_SWITCH, cap + offset + i, 1); if (ret) { seq_printf(s, "0x%04x \n", cap + offset + i); continue; } Konrad