From patchwork Mon Jun 7 11:00:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 12303147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7845C47094 for ; Mon, 7 Jun 2021 11:00:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A149560FDA for ; Mon, 7 Jun 2021 11:00:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231209AbhFGLCC (ORCPT ); Mon, 7 Jun 2021 07:02:02 -0400 Received: from mga09.intel.com ([134.134.136.24]:4781 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbhFGLCA (ORCPT ); Mon, 7 Jun 2021 07:02:00 -0400 IronPort-SDR: vfuot7jVB7SAr2+DJbSSwfV/Zp/HdpvbMViLyW0rUh0bxnHn2CX9mTkycKdtoeM8MJkYLEwedp oaTUFUW2jd+A== X-IronPort-AV: E=McAfee;i="6200,9189,10007"; a="204569300" X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="204569300" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 04:00:09 -0700 IronPort-SDR: MpE/U940CBhjR4xeXMPmE2XHOv6YCGTbbvwFpc9zY//kmHpkj1AXnBWek2hoKnQBhl59Fv5t32 NhlXTvIuH2vA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="413000837" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 07 Jun 2021 04:00:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 5AF4B67; Mon, 7 Jun 2021 14:00:30 +0300 (EEST) From: Mika Westerberg To: linux-usb@vger.kernel.org Cc: Yehezkel Bernat , Michael Jamet , Lukas Wunner , Andreas Noever , Mika Westerberg , Dan Carpenter , kernel test robot , Gil Fine , Azhar Shaikh Subject: [PATCH 1/5] thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default() Date: Mon, 7 Jun 2021 14:00:26 +0300 Message-Id: <20210607110030.38664-2-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607110030.38664-1-mika.westerberg@linux.intel.com> References: <20210607110030.38664-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org We should not dereference ->dual_link_port if it is NULL and lane bonding is requested. For this reason move lane bonding configuration happen inside the block where ->dual_link_port != NULL. Fixes: 54509f5005ca ("thunderbolt: Add KUnit tests for path walking") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Mika Westerberg --- drivers/thunderbolt/test.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c index cf34c1ecf5d5..ba5afd471766 100644 --- a/drivers/thunderbolt/test.c +++ b/drivers/thunderbolt/test.c @@ -303,18 +303,18 @@ static struct tb_switch *alloc_dev_default(struct kunit *test, if (port->dual_link_port && upstream_port->dual_link_port) { port->dual_link_port->remote = upstream_port->dual_link_port; upstream_port->dual_link_port->remote = port->dual_link_port; - } - if (bonded) { - /* Bonding is used */ - port->bonded = true; - port->total_credits *= 2; - port->dual_link_port->bonded = true; - port->dual_link_port->total_credits = 0; - upstream_port->bonded = true; - upstream_port->total_credits *= 2; - upstream_port->dual_link_port->bonded = true; - upstream_port->dual_link_port->total_credits = 0; + if (bonded) { + /* Bonding is used */ + port->bonded = true; + port->total_credits *= 2; + port->dual_link_port->bonded = true; + port->dual_link_port->total_credits = 0; + upstream_port->bonded = true; + upstream_port->total_credits *= 2; + upstream_port->dual_link_port->bonded = true; + upstream_port->dual_link_port->total_credits = 0; + } } return sw; From patchwork Mon Jun 7 11:00:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 12303145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D43ABC47082 for ; Mon, 7 Jun 2021 11:00:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B42ED60FDA for ; Mon, 7 Jun 2021 11:00:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230508AbhFGLCB (ORCPT ); Mon, 7 Jun 2021 07:02:01 -0400 Received: from mga14.intel.com ([192.55.52.115]:36794 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhFGLCA (ORCPT ); Mon, 7 Jun 2021 07:02:00 -0400 IronPort-SDR: cSH0MPg7zQIPsH6kHEU7mVIiZ6VhD2YQb9Q4KW5+d/tN6NzKB5a+/3HA8hIVU0mA80CB8y/4eS bJl9XmDQC24Q== X-IronPort-AV: E=McAfee;i="6200,9189,10007"; a="204414442" X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="204414442" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 04:00:09 -0700 IronPort-SDR: VeMnx+xCN+2KFoEsIr5HGdA4a5sgdqk+c78juRIAwI2Ja7pWL1fKHz+CCi2AVzANDqgopDFurX DtPf8CA7B6mQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="469046621" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 07 Jun 2021 04:00:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 628AC147; Mon, 7 Jun 2021 14:00:30 +0300 (EEST) From: Mika Westerberg To: linux-usb@vger.kernel.org Cc: Yehezkel Bernat , Michael Jamet , Lukas Wunner , Andreas Noever , Mika Westerberg , Dan Carpenter , kernel test robot , Gil Fine , Azhar Shaikh Subject: [PATCH 2/5] thunderbolt: Add device links only when software connection manager is used Date: Mon, 7 Jun 2021 14:00:27 +0300 Message-Id: <20210607110030.38664-3-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607110030.38664-1-mika.westerberg@linux.intel.com> References: <20210607110030.38664-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org We only need to set up the device links when software connection manager path is used. The firmware connection manager does not need them and if they are present they may even cause problems. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/nhi.c | 67 --------------------------------------- drivers/thunderbolt/tb.c | 67 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index a0386d1e3fc9..478bf6701145 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "nhi.h" #include "nhi_regs.h" @@ -1127,69 +1126,6 @@ static bool nhi_imr_valid(struct pci_dev *pdev) return true; } -/* - * During suspend the Thunderbolt controller is reset and all PCIe - * tunnels are lost. The NHI driver will try to reestablish all tunnels - * during resume. This adds device links between the tunneled PCIe - * downstream ports and the NHI so that the device core will make sure - * NHI is resumed first before the rest. - */ -static void tb_apple_add_links(struct tb_nhi *nhi) -{ - struct pci_dev *upstream, *pdev; - - if (!x86_apple_machine) - return; - - switch (nhi->pdev->device) { - case PCI_DEVICE_ID_INTEL_LIGHT_RIDGE: - case PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C: - case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_NHI: - case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI: - break; - default: - return; - } - - upstream = pci_upstream_bridge(nhi->pdev); - while (upstream) { - if (!pci_is_pcie(upstream)) - return; - if (pci_pcie_type(upstream) == PCI_EXP_TYPE_UPSTREAM) - break; - upstream = pci_upstream_bridge(upstream); - } - - if (!upstream) - return; - - /* - * For each hotplug downstream port, create add device link - * back to NHI so that PCIe tunnels can be re-established after - * sleep. - */ - for_each_pci_bridge(pdev, upstream->subordinate) { - const struct device_link *link; - - if (!pci_is_pcie(pdev)) - continue; - if (pci_pcie_type(pdev) != PCI_EXP_TYPE_DOWNSTREAM || - !pdev->is_hotplug_bridge) - continue; - - link = device_link_add(&pdev->dev, &nhi->pdev->dev, - DL_FLAG_AUTOREMOVE_SUPPLIER | - DL_FLAG_PM_RUNTIME); - if (link) { - dev_dbg(&nhi->pdev->dev, "created link from %s\n", - dev_name(&pdev->dev)); - } else { - dev_warn(&nhi->pdev->dev, "device link creation from %s failed\n", - dev_name(&pdev->dev)); - } - } -} - static struct tb *nhi_select_cm(struct tb_nhi *nhi) { struct tb *tb; @@ -1278,9 +1214,6 @@ static int nhi_probe(struct pci_dev *pdev, const struct pci_device_id *id) return res; } - tb_apple_add_links(nhi); - tb_acpi_add_links(nhi); - tb = nhi_select_cm(nhi); if (!tb) { dev_err(&nhi->pdev->dev, diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index bc6d568dbb89..2897a77d44c3 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "tb.h" #include "tb_regs.h" @@ -1571,6 +1572,69 @@ static const struct tb_cm_ops tb_cm_ops = { .disconnect_xdomain_paths = tb_disconnect_xdomain_paths, }; +/* + * During suspend the Thunderbolt controller is reset and all PCIe + * tunnels are lost. The NHI driver will try to reestablish all tunnels + * during resume. This adds device links between the tunneled PCIe + * downstream ports and the NHI so that the device core will make sure + * NHI is resumed first before the rest. + */ +static void tb_apple_add_links(struct tb_nhi *nhi) +{ + struct pci_dev *upstream, *pdev; + + if (!x86_apple_machine) + return; + + switch (nhi->pdev->device) { + case PCI_DEVICE_ID_INTEL_LIGHT_RIDGE: + case PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C: + case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_NHI: + case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI: + break; + default: + return; + } + + upstream = pci_upstream_bridge(nhi->pdev); + while (upstream) { + if (!pci_is_pcie(upstream)) + return; + if (pci_pcie_type(upstream) == PCI_EXP_TYPE_UPSTREAM) + break; + upstream = pci_upstream_bridge(upstream); + } + + if (!upstream) + return; + + /* + * For each hotplug downstream port, create add device link + * back to NHI so that PCIe tunnels can be re-established after + * sleep. + */ + for_each_pci_bridge(pdev, upstream->subordinate) { + const struct device_link *link; + + if (!pci_is_pcie(pdev)) + continue; + if (pci_pcie_type(pdev) != PCI_EXP_TYPE_DOWNSTREAM || + !pdev->is_hotplug_bridge) + continue; + + link = device_link_add(&pdev->dev, &nhi->pdev->dev, + DL_FLAG_AUTOREMOVE_SUPPLIER | + DL_FLAG_PM_RUNTIME); + if (link) { + dev_dbg(&nhi->pdev->dev, "created link from %s\n", + dev_name(&pdev->dev)); + } else { + dev_warn(&nhi->pdev->dev, "device link creation from %s failed\n", + dev_name(&pdev->dev)); + } + } +} + struct tb *tb_probe(struct tb_nhi *nhi) { struct tb_cm *tcm; @@ -1594,5 +1658,8 @@ struct tb *tb_probe(struct tb_nhi *nhi) tb_dbg(tb, "using software connection manager\n"); + tb_apple_add_links(nhi); + tb_acpi_add_links(nhi); + return tb; } From patchwork Mon Jun 7 11:00:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 12303151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 353DBC48BCD for ; Mon, 7 Jun 2021 11:00:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B2B5610A2 for ; Mon, 7 Jun 2021 11:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbhFGLCE (ORCPT ); Mon, 7 Jun 2021 07:02:04 -0400 Received: from mga09.intel.com ([134.134.136.24]:4781 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbhFGLCC (ORCPT ); Mon, 7 Jun 2021 07:02:02 -0400 IronPort-SDR: Uax36emI5H7iQxk6BMrXt4UVjE4NrhbNaJ4AFPCiLVA8p5pMmrNOM96aso6i0NMqXOSRQqOU+w JI4/AXotdIqg== X-IronPort-AV: E=McAfee;i="6200,9189,10007"; a="204569302" X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="204569302" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 04:00:09 -0700 IronPort-SDR: RkCfR0ShIOg9HMOcOemnZg6tWIiWEVkiNYOYOwj+/EkoptkmZvbsD7h5Uqy3mgX4LIU2rafqQW Gx8PsoZwZWTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="481479072" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 07 Jun 2021 04:00:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 6ECEB184; Mon, 7 Jun 2021 14:00:30 +0300 (EEST) From: Mika Westerberg To: linux-usb@vger.kernel.org Cc: Yehezkel Bernat , Michael Jamet , Lukas Wunner , Andreas Noever , Mika Westerberg , Dan Carpenter , kernel test robot , Gil Fine , Azhar Shaikh Subject: [PATCH 3/5] thunderbolt: Poll 10ms for REG_FW_STS_NVM_AUTH_DONE to be set Date: Mon, 7 Jun 2021 14:00:28 +0300 Message-Id: <20210607110030.38664-4-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607110030.38664-1-mika.westerberg@linux.intel.com> References: <20210607110030.38664-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Gil Fine In Intel Tiger Lake and beyond it takes some time after the force power is set until the firmware connection manager is ready. So instead of reading it once we poll it for 10ms before giving up. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index 2f30b816705a..0f25cf9fe519 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -1677,14 +1677,18 @@ static void icm_icl_rtd3_veto(struct tb *tb, const struct icm_pkg_header *hdr) static bool icm_tgl_is_supported(struct tb *tb) { - u32 val; + unsigned long end = jiffies + msecs_to_jiffies(10); - /* - * If the firmware is not running use software CM. This platform - * should fully support both. - */ - val = ioread32(tb->nhi->iobase + REG_FW_STS); - return !!(val & REG_FW_STS_NVM_AUTH_DONE); + do { + u32 val; + + val = ioread32(tb->nhi->iobase + REG_FW_STS); + if (val & REG_FW_STS_NVM_AUTH_DONE) + return true; + usleep_range(100, 500); + } while (time_before(jiffies, end)); + + return false; } static void icm_handle_notification(struct work_struct *work) From patchwork Mon Jun 7 11:00:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 12303153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95FD1C47095 for ; Mon, 7 Jun 2021 11:00:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8256C61205 for ; Mon, 7 Jun 2021 11:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231270AbhFGLCE (ORCPT ); Mon, 7 Jun 2021 07:02:04 -0400 Received: from mga18.intel.com ([134.134.136.126]:16555 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbhFGLCD (ORCPT ); Mon, 7 Jun 2021 07:02:03 -0400 IronPort-SDR: VC9+rep48R6BI8ik9livKizIDuYfOevEygiv8CMixm2SthZgi37gxY/ZgYDc4BmBA7K0BtGsrf ftFv0xi79JwA== X-IronPort-AV: E=McAfee;i="6200,9189,10007"; a="191928008" X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="191928008" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 04:00:09 -0700 IronPort-SDR: 0iuRss4nm8UWVvxt4uvwRi6x1fL9CF4rIlflwSXfWluxXSNmJTS+V842Vwo9zKNNTUdIfxtIT4 tn1dXdUCocww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="618915261" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 07 Jun 2021 04:00:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 78FAD30E; Mon, 7 Jun 2021 14:00:30 +0300 (EEST) From: Mika Westerberg To: linux-usb@vger.kernel.org Cc: Yehezkel Bernat , Michael Jamet , Lukas Wunner , Andreas Noever , Mika Westerberg , Dan Carpenter , kernel test robot , Gil Fine , Azhar Shaikh Subject: [PATCH 4/5] thunderbolt: No need to include in usb4_port.c Date: Mon, 7 Jun 2021 14:00:29 +0300 Message-Id: <20210607110030.38664-5-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607110030.38664-1-mika.westerberg@linux.intel.com> References: <20210607110030.38664-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This include is not needed so drop it. Reported-by: kernel test robot Signed-off-by: Mika Westerberg --- drivers/thunderbolt/usb4_port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c index 765c74179598..29e2a4f9c9f5 100644 --- a/drivers/thunderbolt/usb4_port.c +++ b/drivers/thunderbolt/usb4_port.c @@ -6,7 +6,6 @@ * Author: Mika Westerberg */ -#include #include #include "tb.h" From patchwork Mon Jun 7 11:00:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 12303155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F3ECC47082 for ; Mon, 7 Jun 2021 11:00:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E16D560FDA for ; Mon, 7 Jun 2021 11:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231281AbhFGLCF (ORCPT ); Mon, 7 Jun 2021 07:02:05 -0400 Received: from mga01.intel.com ([192.55.52.88]:32027 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbhFGLCE (ORCPT ); Mon, 7 Jun 2021 07:02:04 -0400 IronPort-SDR: lTVzP93gU1O5msTVMb6u1H8Rq5DpK6zQFKiL4wVkdgDBq6o5YXUqFT6e1J8JJ0iFQIdjxntBNB 5ukGGYeyZHPA== X-IronPort-AV: E=McAfee;i="6200,9189,10007"; a="225934234" X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="225934234" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 04:00:12 -0700 IronPort-SDR: d5y8M/iCBvC69Xxyva2d3Nb9fTOXb+nSo8Yw2Xub0I+6lwDRgfjZziUXybi8M/QwcQUBDYDGvm nKTMQe6q8nVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,254,1616482800"; d="scan'208";a="551850265" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Jun 2021 04:00:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 83FA8314; Mon, 7 Jun 2021 14:00:30 +0300 (EEST) From: Mika Westerberg To: linux-usb@vger.kernel.org Cc: Yehezkel Bernat , Michael Jamet , Lukas Wunner , Andreas Noever , Mika Westerberg , Dan Carpenter , kernel test robot , Gil Fine , Azhar Shaikh Subject: [PATCH 5/5] thunderbolt: Add support for Intel Alder Lake Date: Mon, 7 Jun 2021 14:00:30 +0300 Message-Id: <20210607110030.38664-6-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607110030.38664-1-mika.westerberg@linux.intel.com> References: <20210607110030.38664-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Azhar Shaikh Alder Lake has the same integrated Thunderbolt/USB4 controller as Intel Tiger Lake. By default it is still using firmware based connection manager so we can use most of the Tiger Lake flows. Add the Alder Lake PCI IDs to the driver list of supported devices. Signed-off-by: Azhar Shaikh Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 2 ++ drivers/thunderbolt/nhi.c | 4 ++++ drivers/thunderbolt/nhi.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index 0f25cf9fe519..6255f1ef9599 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -2509,6 +2509,8 @@ struct tb *icm_probe(struct tb_nhi *nhi) case PCI_DEVICE_ID_INTEL_TGL_NHI1: case PCI_DEVICE_ID_INTEL_TGL_H_NHI0: case PCI_DEVICE_ID_INTEL_TGL_H_NHI1: + case PCI_DEVICE_ID_INTEL_ADL_NHI0: + case PCI_DEVICE_ID_INTEL_ADL_NHI1: icm->is_supported = icm_tgl_is_supported; icm->driver_ready = icm_icl_driver_ready; icm->set_uuid = icm_icl_set_uuid; diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index 478bf6701145..fa44332845a1 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -1333,6 +1333,10 @@ static struct pci_device_id nhi_ids[] = { .driver_data = (kernel_ulong_t)&icl_nhi_ops }, { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_TGL_H_NHI1), .driver_data = (kernel_ulong_t)&icl_nhi_ops }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADL_NHI0), + .driver_data = (kernel_ulong_t)&icl_nhi_ops }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADL_NHI1), + .driver_data = (kernel_ulong_t)&icl_nhi_ops }, /* Any USB4 compliant host */ { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_USB_USB4, ~0) }, diff --git a/drivers/thunderbolt/nhi.h b/drivers/thunderbolt/nhi.h index 69770beca792..69083aab2736 100644 --- a/drivers/thunderbolt/nhi.h +++ b/drivers/thunderbolt/nhi.h @@ -72,6 +72,8 @@ extern const struct tb_nhi_ops icl_nhi_ops; #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_BRIDGE 0x15ea #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_NHI 0x15eb #define PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_BRIDGE 0x15ef +#define PCI_DEVICE_ID_INTEL_ADL_NHI0 0x463e +#define PCI_DEVICE_ID_INTEL_ADL_NHI1 0x466d #define PCI_DEVICE_ID_INTEL_ICL_NHI1 0x8a0d #define PCI_DEVICE_ID_INTEL_ICL_NHI0 0x8a17 #define PCI_DEVICE_ID_INTEL_TGL_NHI0 0x9a1b