From patchwork Thu Dec 16 09:26:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1568993 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=C41+8wwx; 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 4JF6Fd45kGz9s0r for ; Thu, 16 Dec 2021 20:27:01 +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 1mxn2M-0006EL-42; Thu, 16 Dec 2021 09:26:54 +0000 Received: from mail-pg1-f174.google.com ([209.85.215.174]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mxn2K-00065u-4I for kernel-team@lists.ubuntu.com; Thu, 16 Dec 2021 09:26:52 +0000 Received: by mail-pg1-f174.google.com with SMTP id f125so22636825pgc.0 for ; Thu, 16 Dec 2021 01:26:48 -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=UOLDlF1APIfV/iA01bi6kmegFHHWBBDPvgH2xY5DLqs=; b=C41+8wwx9kmFRJ/lvQ8uFrMZzmHyJiNxFup6RQ0YdN1yEt/zIfKXKJpfFs6y7k6UOk AwBTfbDO8q+7j5kt1htA7Q1JdjPRNUFWEQ6ov0Fw+wIsgoxdIY3KA+5hsSh290UJ5y15 0KVRBkTvkogU1C7p73AdSgR/fh+pVnYz9zSqWkx26SU/wahZxrVo3SU56+r52Al8kr+d kpK/+h3wfoxfyjYkLg2ndOW15Zsfndgjo4ZflS2vmf78SE3Ze/KQC9OlMdG4MfGMCHX3 T0TraXGCIAwzvf/1cjoJHrG8VHgqdEPfNJdMZZH5QwpWhEnAnsKG50niV6HG53OPbFLO 95bQ== 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=UOLDlF1APIfV/iA01bi6kmegFHHWBBDPvgH2xY5DLqs=; b=nrReBvLNKHgXPTe6LzTr6AtfwcGMTr+LtvL5lZWSHCDtfj98em9OnC945yMPPNW0XO UVfXKbZ5rDpnOw5TWxPbdRYyq5kTYPe/hKcKR+X347jQGYyLkdPlAa/Vvonh1np7qUlM mgWqoVAlhLrLOx9jPhW+5xyu/OWfurnOilvxha7PyE+rQuTJ3C884rQEsipSk3hRUj+M IniM+Rr4PqQlT1cTf3DQLKd6ORuslJ/aU/H9FkLLOxSAUl88LqEwwPiG9L1COVWas6qR MuDZUDd7Fke8YNenjam2lkTHyzlZTiIqxSfIbGn+qDD2A3PWlmrdQja7N1RbmuPPQjv9 ZYAQ== X-Gm-Message-State: AOAM5308laQE805ShmcOZ8RoFSLdtKeYfN5VpUrpRM2niKjbic2wCL5z 1ox8IzMWlCrRchEi4gfrA+rITo6t8ZY= X-Google-Smtp-Source: ABdhPJwYqfsxzJ624ttmSDlfc4NG2PRJcxnIqpRakI8fK8ThlFCvqHrAhiyw5n4dl+byKJiV4byPfw== X-Received: by 2002:a05:6a00:23c4:b0:49f:e054:84cb with SMTP id g4-20020a056a0023c400b0049fe05484cbmr13042756pfc.63.1639646806993; Thu, 16 Dec 2021 01:26:46 -0800 (PST) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id b2sm5397496pfv.198.2021.12.16.01.26.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 01:26:46 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/6][SRU][J][OEM-5.14] thunderbolt: Do not program path HopIDs for USB4 routers Date: Thu, 16 Dec 2021 17:26:32 +0800 Message-Id: <20211216092633.1079354-6-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211216092633.1079354-1-acelan.kao@canonical.com> References: <20211216092633.1079354-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.174; envelope-from=acelan@gmail.com; helo=mail-pg1-f174.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 --- 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 f384cda76e862..96828dc13bdee 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)