From patchwork Tue Mar 8 08:49:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1602809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=TwmOL1aU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCTXV0bcMz9sGF for ; Tue, 8 Mar 2022 19:49:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nRVX1-00026f-Oo; Tue, 08 Mar 2022 08:49:23 +0000 Received: from mail-pf1-f177.google.com ([209.85.210.177]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nRVWz-0001zd-0H for kernel-team@lists.ubuntu.com; Tue, 08 Mar 2022 08:49:21 +0000 Received: by mail-pf1-f177.google.com with SMTP id s11so16720434pfu.13 for ; Tue, 08 Mar 2022 00:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Aa6AwolJK4vRbN+BUIq/jWtwrDQRm3w65hry3eTojBw=; b=TwmOL1aUacjTeql0qN0SmkynSnLRWx0oVo/hFfTn2yBDlto7krT02e59JateexlWVj TWfT/I+NSyFhBEve3RFD9YoopLxtnv4jmQ1UlOMUDFIWQpAPpiD/Jb16lkyk/ZyS0mjS TG+WpdkEY87pDS+0P/UUl5X7kd3ur+Nwf/CX6lh7NGlO6AvGQ2JajW7nFrFpTgrhRC0X Cn0P8Ct3SgawKPKjSD+s8ejIiyGXYXHD0JEQ8tIR9SXAHZ6dFvPFTNCbPOxMkF3Gehrh RlnLN0XeYmPw+87t4cYKu/XOpF7YGX/qS70eFBbJFGfAxI2RWU1YsnRxrLt2kxWd9zWU /sxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Aa6AwolJK4vRbN+BUIq/jWtwrDQRm3w65hry3eTojBw=; b=UPgs8bYsI1mdT5+WIFJnFx33xGjPqacBRSrujKu2Yk/BRe5AAcc+kCczU5gIg0oiNL h4iy02+3EEWEGyMwpEvf+LKJ2EN7FK3CmSIqHGt+FhVLbNQA0sdrAiudFPWu8Oo4GjVQ 9Wj8RAFpc9KLHNRMvsXmgy+AkWefhcgJzaE/ig6Pnrk5kIvfagYhQ5ZIT7Zx9jR39odh Ytm/SdEusGXaSme5F1CPphJoXn36xTssVWntKGmSWNpr2aD3Q51TdIpwJWfip+6WmIOU 6D3aTZ1ABYxmSzV2GuTgVgfiXqXmpbDAhh2LsxGeRWJwBA21jpwdGyPuVMlGaPVq5AuB jeLw== X-Gm-Message-State: AOAM533h+ZlbPSqxo3HTlGtDvL0XVPZpxdBXZYsHnY8vMBTDCaojy7dm BCTcenNkcDDm6sHHP+KyQ2UiTvakz90= X-Google-Smtp-Source: ABdhPJx3zea6RzlTKlfBBHXTCp/ld2MLxPX1JLJH/RhLqY5D8pp4N8O6hItXlnXaz9cEmAFFnd30vg== X-Received: by 2002:a05:6a00:d5b:b0:4f6:bc0b:9b35 with SMTP id n27-20020a056a000d5b00b004f6bc0b9b35mr17200619pfv.25.1646729357741; Tue, 08 Mar 2022 00:49:17 -0800 (PST) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id c7-20020aa78e07000000b004f6e4d8ccc8sm9359446pfr.163.2022.03.08.00.49.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:49:17 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/5][SRU][J] thunderbolt: Do not program path HopIDs for USB4 routers Date: Tue, 8 Mar 2022 16:49:08 +0800 Message-Id: <20220308084909.2043184-5-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220308084909.2043184-1-acelan.kao@canonical.com> References: <20220308084909.2043184-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.177; envelope-from=acelan@gmail.com; helo=mail-pf1-f177.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mika Westerberg BugLink: https://bugs.launchpad.net/bugs/1955016 These fields are marked read-only for USB4 routers so do not touch them in that case. Update the kernel-doc of tb_dp_port_set_hops() to reflect this too. Signed-off-by: Mika Westerberg (cherry picked from commit e5bb88e961e5e3e72e3cc3a866a232115bd15e1e) Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/thunderbolt/switch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 463cfdc0b42f..e00f4b878b56 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -1322,7 +1322,9 @@ int tb_dp_port_hpd_clear(struct tb_port *port) * @aux_tx: AUX TX Hop ID * @aux_rx: AUX RX Hop ID * - * Programs specified Hop IDs for DP IN/OUT port. + * Programs specified Hop IDs for DP IN/OUT port. Can be called for USB4 + * router DP adapters too but does not program the values as the fields + * are read-only. */ int tb_dp_port_set_hops(struct tb_port *port, unsigned int video, unsigned int aux_tx, unsigned int aux_rx) @@ -1330,6 +1332,9 @@ int tb_dp_port_set_hops(struct tb_port *port, unsigned int video, u32 data[2]; int ret; + if (tb_switch_is_usb4(port->sw)) + return 0; + ret = tb_port_read(port, data, TB_CFG_PORT, port->cap_adap + ADP_DP_CS_0, ARRAY_SIZE(data)); if (ret)