From patchwork Tue May 16 19:51:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Cox X-Patchwork-Id: 1782295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=YTyarGFP; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QLRhQ1mGZz20KF for ; Wed, 17 May 2023 05:51:49 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pz0hs-0001eD-DG; Tue, 16 May 2023 19:51:36 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pz0hq-0001dn-Km for kernel-team@lists.ubuntu.com; Tue, 16 May 2023 19:51:34 +0000 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 695853F22C for ; Tue, 16 May 2023 19:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1684266691; bh=gprbK3EshbW/ZQs7bozQKvqx6e91Ozl81lBq/0jvtSA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YTyarGFPKmG4OhDMJHGy4RCyTFSRlNeRRZRXlfb3gSUnZvvZw+Y34nK6YQWwmibAC Mh35hh7t16qI9AjH5/u2bmgaIl+9P9sm+mHOzPUX2/dfd0YVg3V1LxkSZLZ3Ic1fsr 8LS+T6YGclUqv1OK+bqUUzJMR/ArsnCrZ0UxcY4+//CyKb1QA9Ixp5YLZADc5msXCD BSI4n1BRFR/wlp1Wm3FdqV5Pw3iyCQvDSkpDE2Xc9um1/HEwtWsQph/suSX2wij/4L Jr50Z4vxZ1AxgIAKhyzYCax+esgdUA89p2PxdfQO5wjh70exmWIYKv9gRrIDU/iset Eo9x9E+/KfVKg== Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7578369dff3so514744285a.0 for ; Tue, 16 May 2023 12:51:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684266690; x=1686858690; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gprbK3EshbW/ZQs7bozQKvqx6e91Ozl81lBq/0jvtSA=; b=Cp9sa1y/nE7ceZTF3IhoY3xISeu9dncc9qHidSYOpR23+P9x5lkH7yuBw5BcRtwZ5E ejrbJSxNa36YpKwTyJqEG2OcMTTieA2vTmPnJA2R3o/YSJjgJzu00Erwmx1jZta/BDW5 kudqdRP7axTaVNjCiApsPgsA3zulawpvixfLdW67iYL4ZIFtObGS8KZpiqzgFDi4uUrD zSyz5yzKDwROaJuwCJYhlDriPWLsUwcIxxeMKImOt5pt3WN+yBxmmmaknOcBBf0FQAaf SY7HAK4BM5rdF8U1yJbHp7ZsmFKp6H8D68cHrFTGMlEa+VJaRHcWzPMuZiF353FeD7ra hz2Q== X-Gm-Message-State: AC+VfDz3I/u1laheH67zl15I0o3+FuArhJov6IX/WWNYm5Ne09CC97bD STKxgrfqyRcWYaTbjRYP713L10JRbdICd8chbINwSGKT3zLPuVst8/tTQJlPJn/f5C/MakPQWJb 6x45tDrWfPMrJ+Bp8xmM12PCHRPV//bMa1INk9kMCneWzP01u0g== X-Received: by 2002:a05:622a:44:b0:3e3:9185:cb15 with SMTP id y4-20020a05622a004400b003e39185cb15mr60844661qtw.7.1684266690219; Tue, 16 May 2023 12:51:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UTC3WnQSNF/U09fgGDrJ4hEZg2ErhGMwv9tb6OeZ9ShVTutKcwJYaxE7hTUf9786mMNYEZA== X-Received: by 2002:a05:622a:44:b0:3e3:9185:cb15 with SMTP id y4-20020a05622a004400b003e39185cb15mr60844640qtw.7.1684266689998; Tue, 16 May 2023 12:51:29 -0700 (PDT) Received: from cox.home.arpa ([45.72.211.59]) by smtp.gmail.com with ESMTPSA id y30-20020ac8705e000000b003ef6cfbbe6esm6509738qtm.51.2023.05.16.12.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 12:51:27 -0700 (PDT) From: Philip Cox To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] igc: Disable PTM sequences when interface goes down Date: Tue, 16 May 2023 15:51:20 -0400 Message-Id: <20230516195121.10933-2-philip.cox@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516195121.10933-1-philip.cox@canonical.com> References: <20230516195121.10933-1-philip.cox@canonical.com> MIME-Version: 1.0 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: Aravindhan Gunasekaran BugLink: https://bugs.launchpad.net/bugs/2019222 Kernel hangs or reboots reported in some boards with a combination of interface up/down or reset. It turns out that this occurs due to Foxville bus master disabling when PTM sequences remain enabled. We do not need to always enable PTM in the reset sequence as igc_ptp_reset is also called during interface down. This caused PTM sequences be enabled but Foxville tries to disable bus mastering before going through controller reset. This patch disables PCIe PTM when interface goes down. Signed-off-by: Aravindhan Gunasekaran (back-ported from https://github.com/intel/linux-intel-quilt/tree/mainline-tracking-v5.19-linux-221019T120731Z/patches/0001-igc-Disable-PTM-sequences-when-interface-goes-down.tsn [context changes]) Signed-off-by: Philip Cox --- drivers/net/ethernet/intel/igc/igc_ptp.c | 50 ++++++++++++++---------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c index b1b93e9a4399..993d339205ed 100644 --- a/drivers/net/ethernet/intel/igc/igc_ptp.c +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c @@ -1109,6 +1109,30 @@ static void igc_ptp_time_restore(struct igc_adapter *adapter) igc_ptp_write_i225(adapter, &ts); } +static void igc_ptm_start(struct igc_adapter *adapter) +{ + struct igc_hw *hw = &adapter->hw; + u32 cycle_ctrl, ctrl; + + wr32(IGC_PCIE_DIG_DELAY, IGC_PCIE_DIG_DELAY_DEFAULT); + wr32(IGC_PCIE_PHY_DELAY, IGC_PCIE_PHY_DELAY_DEFAULT); + + cycle_ctrl = IGC_PTM_CYCLE_CTRL_CYC_TIME(IGC_PTM_CYC_TIME_DEFAULT); + + wr32(IGC_PTM_CYCLE_CTRL, cycle_ctrl); + + ctrl = IGC_PTM_CTRL_EN | + IGC_PTM_CTRL_START_NOW | + IGC_PTM_CTRL_SHRT_CYC(IGC_PTM_SHORT_CYC_DEFAULT) | + IGC_PTM_CTRL_PTM_TO(IGC_PTM_TIMEOUT_DEFAULT) | + IGC_PTM_CTRL_TRIG; + + wr32(IGC_PTM_CTRL, ctrl); + + /* Force the first cycle to run. */ + wr32(IGC_PTM_STAT, IGC_PTM_STAT_VALID); +} + static void igc_ptm_stop(struct igc_adapter *adapter) { struct igc_hw *hw = &adapter->hw; @@ -1142,10 +1166,8 @@ void igc_ptp_suspend(struct igc_adapter *adapter) spin_unlock(&adapter->ptp_tx_lock); - if (pci_device_is_present(adapter->pdev)) { + if (pci_device_is_present(adapter->pdev)) igc_ptp_time_save(adapter); - igc_ptm_stop(adapter); - } } /** @@ -1174,7 +1196,6 @@ void igc_ptp_stop(struct igc_adapter *adapter) void igc_ptp_reset(struct igc_adapter *adapter) { struct igc_hw *hw = &adapter->hw; - u32 cycle_ctrl, ctrl; unsigned long flags; u32 timadj; @@ -1199,23 +1220,10 @@ void igc_ptp_reset(struct igc_adapter *adapter) if (!igc_is_crosststamp_supported(adapter)) break; - wr32(IGC_PCIE_DIG_DELAY, IGC_PCIE_DIG_DELAY_DEFAULT); - wr32(IGC_PCIE_PHY_DELAY, IGC_PCIE_PHY_DELAY_DEFAULT); - - cycle_ctrl = IGC_PTM_CYCLE_CTRL_CYC_TIME(IGC_PTM_CYC_TIME_DEFAULT); - - wr32(IGC_PTM_CYCLE_CTRL, cycle_ctrl); - - ctrl = IGC_PTM_CTRL_EN | - IGC_PTM_CTRL_START_NOW | - IGC_PTM_CTRL_SHRT_CYC(IGC_PTM_SHORT_CYC_DEFAULT) | - IGC_PTM_CTRL_PTM_TO(IGC_PTM_TIMEOUT_DEFAULT) | - IGC_PTM_CTRL_TRIG; - - wr32(IGC_PTM_CTRL, ctrl); - - /* Force the first cycle to run. */ - wr32(IGC_PTM_STAT, IGC_PTM_STAT_VALID); + if (!test_bit(__IGC_DOWN, &adapter->state)) + igc_ptm_start(adapter); + else + igc_ptm_stop(adapter); break; default: From patchwork Tue May 16 19:51:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Cox X-Patchwork-Id: 1782294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=KuRNqev4; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QLRhQ2GbVz20dk for ; Wed, 17 May 2023 05:51:49 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pz0hu-0001f4-Iq; Tue, 16 May 2023 19:51:38 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pz0hr-0001e4-9W for kernel-team@lists.ubuntu.com; Tue, 16 May 2023 19:51:35 +0000 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 04A023F1A6 for ; Tue, 16 May 2023 19:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1684266695; bh=r55Vi875hlGGdNUBYGlADufS5uwpD2aLJnIMVqvLigY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KuRNqev4cpFF2TgjPFzKERMGSXzbHebad2cXAyMExA41scRDiUU5oG0mnowZyBIhG N4u4PFhqY2WVeGlc6IeyMnleqDTBdO6zhs/+PMyzN1by5wsPmb9B2sKgCAxm24sf8q Sk+K/grEXQT24aFmaYcJA1Uh/JPCByD4w2RdZCeJyfWrC0uF5D82fYsoTVqJQoqIbq AmbR1Uxri4ujM+SdN5AR45xBKth8NUJC5mh+8c3KdjXalXR3aU69lGTdYP3gTpxuUt 1yqzp6wjsT60WIdulAIadqbqn/1p5/Pr14g8zRGfeZ6IAsTWcarWjR28XrBTtDzMzi HcIuOVrCDaJCw== Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7578a3358ceso1348149985a.1 for ; Tue, 16 May 2023 12:51:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684266693; x=1686858693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r55Vi875hlGGdNUBYGlADufS5uwpD2aLJnIMVqvLigY=; b=Z/kKKgOEsbdQg/X+ehaBT7VENjFQioH0/PxHpYwJl8/1kYYG4fTHGR23kXMOu84hRo HbVP7whSXiDY5K97OJTXSy2vMfui887POVrgaVLEHI63l7/NlY/u/mahMS/ampy5kBW0 KBZzqI+c65Z+8/zOhO1Vr26u3CbIriNw6CSRtBaxRxtKZLpcSHs4o/+5Ryn881SMPsYM CEV9KoNIpKBbHPb0LyuF1VK94lusKpryp+SKijirh1XVqYMSi/soobvwbjc6H/Gdehpy hIYXMbwHs76y0q+7uX0oKRLmNpBE/z1UddWjjWRCMeHqgnHUNyNBPVDMuovMsxYkbZSB Pzwg== X-Gm-Message-State: AC+VfDwc6zlNlTT0g2WT6ZHOxa23OcQWk7d7R339ccMRAERXxGe/0/Vt 5C4K0Z3oGeRbSNJoxLSCsCNFqKSAb2m4pbeqhSikaxSljdifc0/mJB7xLkgKRc04JeGchmWtSM/ lsfTBRgrWKzE4tIRsTZ58j00Vv/ChtjK3UzEe81sEYN8YjHf4uA== X-Received: by 2002:ac8:594f:0:b0:3f1:e57a:de9d with SMTP id 15-20020ac8594f000000b003f1e57ade9dmr63845794qtz.0.1684266692942; Tue, 16 May 2023 12:51:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pg+9WhkT3frOsnuyfiEaBNLyajd7Te8jJp9lme3/9cCUxj6d+LCOQUXFDvLBzwt7Ku1LPIA== X-Received: by 2002:ac8:594f:0:b0:3f1:e57a:de9d with SMTP id 15-20020ac8594f000000b003f1e57ade9dmr63845777qtz.0.1684266692676; Tue, 16 May 2023 12:51:32 -0700 (PDT) Received: from cox.home.arpa ([45.72.211.59]) by smtp.gmail.com with ESMTPSA id y30-20020ac8705e000000b003ef6cfbbe6esm6509738qtm.51.2023.05.16.12.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 12:51:30 -0700 (PDT) From: Philip Cox To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] stmmac: intel: Separate ADL-N and RPL-P device ID from TGL Date: Tue, 16 May 2023 15:51:21 -0400 Message-Id: <20230516195121.10933-3-philip.cox@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516195121.10933-1-philip.cox@canonical.com> References: <20230516195121.10933-1-philip.cox@canonical.com> MIME-Version: 1.0 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: Michael Sit Wei Hong BugLink: https://bugs.launchpad.net/bugs/2019222 Separating the ADL-N and RPL-P device IDs from TGL to handle the differences from TGL. Signed-off-by: Michael Sit Wei Hong (back ported from https://github.com/intel/linux-intel-quilt/tree/mainline-tracking-v5.19-linux-221019T120731Z/patches/0034-stmmac-intel-Separate-ADL-N-and-RPL-P-device-ID-from-T.tsn [changes partially upstream, and in the build already]) Signed-off-by: Philip Cox --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 312322ba56ab..81cad422d8ca 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -1502,7 +1502,7 @@ static const struct pci_device_id intel_eth_pci_id_table[] = { { PCI_DEVICE_DATA(INTEL, ADLS_SGMII1G_0, &adls_sgmii1g_phy0_info) }, { PCI_DEVICE_DATA(INTEL, ADLS_SGMII1G_1, &adls_sgmii1g_phy1_info) }, { PCI_DEVICE_DATA(INTEL, ADLN_SGMII1G, &adln_sgmii1g_phy0_info) }, - { PCI_DEVICE_DATA(INTEL, RPLP_SGMII1G, &tgl_sgmii1g_phy0_info) }, + { PCI_DEVICE_DATA(INTEL, RPLP_SGMII1G, &adln_sgmii1g_phy0_info) }, {} }; MODULE_DEVICE_TABLE(pci, intel_eth_pci_id_table);