Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3416554ioa; Tue, 26 Apr 2022 03:19:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPlzL+OZzyScDcbXZI5czhaX9h5LfyFqNra4rTzsUvOxLyJZ61Bw2ReGu0f+YGB2Bvmhcz X-Received: by 2002:a17:907:7e8b:b0:6f3:78f1:80b0 with SMTP id qb11-20020a1709077e8b00b006f378f180b0mr13392473ejc.596.1650968357906; Tue, 26 Apr 2022 03:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650968357; cv=none; d=google.com; s=arc-20160816; b=py3SX51TitZz6l2ZA7st86C7xQ9vpPKtkMjuyb7B27OJBb23gsAp1IwKvby+458nFa ukLYSS1HWi2+Iv2eWYKsqQqPlBDbbIYjNgrwZ/hlZYsWjWdIFJ7fICl6ut0IyfQu1/DC 8AfviIboo2tE68aoIUPpDCVS4hWY97beFCiyZR/ZSzSf4TX78QxwxADdyrsN+wZEheG0 W5WcO9rXDaDhFGVso+1/j50OssgPh1ZdFHak18oJtnH3RJmGGhn/c/6WBQiiR8SFFf4c QIpvzbmOLP6xKEk2A5fxomrrwmWwIepSqsEIOmCCyaoIs6D9kGY8NRngO1Dfr3a+SwSZ z+ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JOMrunOtHR0NgAVYdBKRjkdtll5PS8fUpQCdoHJGWXI=; b=C1WxapIMPHw1NmQiSUf2qS46KvJWEBhPAQO4TX2a7T3spSlMap4fG75pJh8HE4yRbf YD+Jq+1wEg8MD4AyYgB/RUxcmjzN4LIEG7cj4Ww3A9tgq5W4JPWKIWys/1u+jalUycuP TsMK8oFa8O96sQ0xhdfYd3EFxMJwxpXL6ZA5tNNnw+Xknmcr85IjAz7Vq58Dy2p1N3uZ Yj4qfJYqeYRE1xMNQytmHKtNSIahqf5T++ZKVQmqCfXAd0RJgwvn1ysb5nHfVr1Rx22o IMRcB9VSZKx4k7FOdvZShXtumfNyYSVOMUV+N1agFdeowjBl+vW/hJ783itdaak4sQG6 899g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="O/m9gHQ4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a1709067d5100b006efbdd0a4a0si13165249ejp.601.2022.04.26.03.18.36; Tue, 26 Apr 2022 03:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="O/m9gHQ4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244238AbiDZJCa (ORCPT + 99 others); Tue, 26 Apr 2022 05:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347127AbiDZIpv (ORCPT ); Tue, 26 Apr 2022 04:45:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA3C5793B5; Tue, 26 Apr 2022 01:37:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3BFC7603E0; Tue, 26 Apr 2022 08:37:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31E9CC385A0; Tue, 26 Apr 2022 08:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962243; bh=WX/DtGNbHwolQ0XWCUvkRTjty4uMyDFVP57ojyvmgJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O/m9gHQ4zbG/9VPNA0jnl+Dqe6FP6KeJCbkZg6yChFshWUv6/OxrPqQQlhCz9dw3H xXFQYkvFFzLOiA86N3chniDtHq7BoU1UkYuEANS4OK42ngWtrsMwaFZVcRuM5MB5xQ TxNovMJxEUSvwMaAL4Wsp9VY3TgNn8+j4OW/4dOc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinicius Costa Gomes , Naama Meir , Paul Menzel , Tony Nguyen , Sasha Levin Subject: [PATCH 5.15 031/124] igc: Fix suspending when PTM is active Date: Tue, 26 Apr 2022 10:20:32 +0200 Message-Id: <20220426081748.188785492@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinicius Costa Gomes [ Upstream commit 822f52e7efdc88fccffb9fbf6250a4b7666a0b0f ] Some mainboard/CPU combinations, in particular, Alder Lake-S with a W680 mainboard, have shown problems (system hangs usually, no kernel logs) with suspend/resume when PCIe PTM is enabled and active. In some cases, it could be reproduced when removing the igc module. The best we can do is to stop PTM dialogs from the downstream/device side before the interface is brought down. PCIe PTM will be re-enabled when the interface is being brought up. Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()") Signed-off-by: Vinicius Costa Gomes Tested-by: Naama Meir Acked-by: Paul Menzel Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igc/igc_ptp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c index 4f9245aa79a1..8e521f99b80a 100644 --- a/drivers/net/ethernet/intel/igc/igc_ptp.c +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c @@ -996,6 +996,17 @@ static void igc_ptp_time_restore(struct igc_adapter *adapter) igc_ptp_write_i225(adapter, &ts); } +static void igc_ptm_stop(struct igc_adapter *adapter) +{ + struct igc_hw *hw = &adapter->hw; + u32 ctrl; + + ctrl = rd32(IGC_PTM_CTRL); + ctrl &= ~IGC_PTM_CTRL_EN; + + wr32(IGC_PTM_CTRL, ctrl); +} + /** * igc_ptp_suspend - Disable PTP work items and prepare for suspend * @adapter: Board private structure @@ -1013,8 +1024,10 @@ void igc_ptp_suspend(struct igc_adapter *adapter) adapter->ptp_tx_skb = NULL; clear_bit_unlock(__IGC_PTP_TX_IN_PROGRESS, &adapter->state); - if (pci_device_is_present(adapter->pdev)) + if (pci_device_is_present(adapter->pdev)) { igc_ptp_time_save(adapter); + igc_ptm_stop(adapter); + } } /** -- 2.35.1