From patchwork Tue Mar 8 08:49:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1602810 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=pAQH/x36; 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 4KCTXV2Ts9z9sGG 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 1nRVX2-00027R-Cp; Tue, 08 Mar 2022 08:49:24 +0000 Received: from mail-pj1-f50.google.com ([209.85.216.50]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nRVWz-00021j-Kv for kernel-team@lists.ubuntu.com; Tue, 08 Mar 2022 08:49:21 +0000 Received: by mail-pj1-f50.google.com with SMTP id ge19-20020a17090b0e1300b001bcca16e2e7so1601889pjb.3 for ; Tue, 08 Mar 2022 00:49:20 -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=JdPaFgpESqxD5KesI6RsU6V9ZoNYPZwid54wk3QcCxo=; b=pAQH/x36Ji+XYiS5QVwHBB7xF5yWquPrW6ObeRYBG3T6Pr0DGLHWGVV8ql+PCHiCAI 3RtaSu4FGWQ5TleMgOxBrEe596++wF6iqbXfWACiWIWeJYlmIBH3qdluEOJix45VNEuK CRj/tzkvkzEWcbWqYdvOemXQel4llVnQBSvtUy7RrkDPCpk7aBuvS/Ou9g3/qfxnOa5R KObqs5AQQc4cNdioqp6CZLLZ+FaQyZXs7XbYMLPO1bId2qwNljaSCQ4qquBQdXha0gZg MwWcItVfv8zaQ0TvGQ+jy1gA4aztL7S9gMb6qnoGeHJOUqRrask5GBTuwuQlYlG6EueN ZFeQ== 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=JdPaFgpESqxD5KesI6RsU6V9ZoNYPZwid54wk3QcCxo=; b=rTGi4lUbEEd9RcCxZf6fv+RZGBW7y1FqGYo0sz1p2TRpA+dqBs6Cz/21rXj0g2TqMs BvivtLtxTz3qSdoxrIbr9EzWKgOjMs8d5+UZj0RaeEfZjUNvcQbfSS3+xJblQI3KGkt2 +ZtEbDXhmOs7rkCI813cx/wkaR9NsNlY075S6MKVXNaUHmpp9zNpPCMT9u8LCdw+fguc Nx949DI4c7AYil864NYMmvDlni2w///ONS2Av/3dGz/fpAwxnlZW2tME+sdivCBf1u87 PE636SKVod6z5tC4g1GL2jOcH0qWpLRrB/prdmQS/MYvN3YuLPe0wWLIaRR1wncRCiRM 5GKA== X-Gm-Message-State: AOAM5333DCF0DTKY4cqy07DCGvTCeDbd6YoVhV3K/lURSP5WSY3BR/Sf zcdTD29UuroZeFNdbDyzRgaYlah40yI= X-Google-Smtp-Source: ABdhPJxMd1yGPnvLb0l6Xv0y9Jm8HzQeo+K+QbVi9HwGE5Y+Dmgc6SuEtycasfWQ48vu/IVIdJvkNg== X-Received: by 2002:a17:90a:8c14:b0:1be:e8cc:96bb with SMTP id a20-20020a17090a8c1400b001bee8cc96bbmr3535929pjo.176.1646729359305; Tue, 08 Mar 2022 00:49:19 -0800 (PST) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id z21-20020a17090a8b9500b001bf74f8bb3asm1948095pjn.24.2022.03.08.00.49.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:49:18 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/5][SRU][J] thunderbolt: Add debug logging of DisplayPort resource allocation Date: Tue, 8 Mar 2022 16:49:09 +0800 Message-Id: <20220308084909.2043184-6-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.216.50; envelope-from=acelan@gmail.com; helo=mail-pj1-f50.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 Add more debugging around DP resource allocation/de-allocation. Signed-off-by: Mika Westerberg (cherry picked from commit ce05b997426df4c5321358e369f1f32f257c57a9) Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/thunderbolt/switch.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index e00f4b878b56..13f9230104d7 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -3056,9 +3056,20 @@ bool tb_switch_query_dp_resource(struct tb_switch *sw, struct tb_port *in) */ int tb_switch_alloc_dp_resource(struct tb_switch *sw, struct tb_port *in) { + int ret; + if (tb_switch_is_usb4(sw)) - return usb4_switch_alloc_dp_resource(sw, in); - return tb_lc_dp_sink_alloc(sw, in); + ret = usb4_switch_alloc_dp_resource(sw, in); + else + ret = tb_lc_dp_sink_alloc(sw, in); + + if (ret) + tb_sw_warn(sw, "failed to allocate DP resource for port %d\n", + in->port); + else + tb_sw_dbg(sw, "allocated DP resource for port %d\n", in->port); + + return ret; } /** @@ -3081,6 +3092,8 @@ void tb_switch_dealloc_dp_resource(struct tb_switch *sw, struct tb_port *in) if (ret) tb_sw_warn(sw, "failed to de-allocate DP resource for port %d\n", in->port); + else + tb_sw_dbg(sw, "released DP resource for port %d\n", in->port); } struct tb_sw_lookup {