Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1185246rwb; Tue, 27 Sep 2022 09:28:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ncV8uZ8YU4ConbX2ikKI2/7j872Q66mGX7gLRez82koQruZww6SZ2EiugcPXHY8eLlnr0 X-Received: by 2002:a05:6402:2693:b0:450:a807:6c91 with SMTP id w19-20020a056402269300b00450a8076c91mr28912179edd.33.1664296098617; Tue, 27 Sep 2022 09:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664296098; cv=none; d=google.com; s=arc-20160816; b=CLjm/+F/NvVFhhJUWCJiiN85TVlkKqvEvfcqNnYynwXQGcOTjq9JeyN9St7m2ov7s6 vyvf6T9iqVr2K5mXEItmxTklvZC/x6Vzo840yquiTsJfPdms+dyoFAqgdpzzG70lLoDP AWBx9H2c+pJ3c6eFE5PERiYGecsUQdMZOmADlWEyUIe2cLB6K5fveRBq8SL34NH5wjv7 H4A2sHOaA03vx9QTLO7QoyXwS3DuSfj5ugicn/hPVItaWb1+iJwDd4XxBZLds9AjYdvH 5de+4TW3EJrSliRD80Q4eUl+xX44L5fYsFE37kPUvkfzvHewZJj/VnL0lwhwB1J3u3tT qMrQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AFdCbuK2STwU1a0Nvf1lTDCDj1ToB//H9Q+bBUP1Qko=; b=FpeV0CZ7TR+88ldKKfLwp9aWhFI4gRgGnmxs2DqFjhF/2RGuYrz/gFZPG4hSBrGtX2 a4Ek3i5ZqfD70OQU7tvbGXckwXwems9Q+v9g21bIyTEAj9Tof9HL8pzv5oLJFgr20rEZ 4YDBXyVAr+l8GhUWcidlf4lVnvJXRY6HC3VD/Mta5t/xZaDR3ZSGrJzjQqlZcXuORwef ooT6WqV0uYi7zNf4SEzra8mfgOeZbzN3cLSNDiEj/QHPxxC0pUSgIfr4tWI5D+m6GaVA JMbJ2SwS5a+TFwPXTokkSwk6q6rVeRW3GjiNBDEdF3yfoqzE1Ocrcf7cxrfneiW5nUMA mewg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NvRgdBCT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd11-20020a1709069b8b00b00782faf12c6esi2059161ejc.78.2022.09.27.09.27.51; Tue, 27 Sep 2022 09:28:18 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NvRgdBCT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232805AbiI0PlV (ORCPT + 99 others); Tue, 27 Sep 2022 11:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232798AbiI0PkF (ORCPT ); Tue, 27 Sep 2022 11:40:05 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D5CDFF7 for ; Tue, 27 Sep 2022 08:37:52 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d24so9435131pls.4 for ; Tue, 27 Sep 2022 08:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=AFdCbuK2STwU1a0Nvf1lTDCDj1ToB//H9Q+bBUP1Qko=; b=NvRgdBCT61Gudxqofirgx5th8IhGdXVH8ploDF6qA3ooguYlkZg71QV76whvsg9N6l R4KzgPkWN0h5/4Wa+jfAUT3X64/ZrWIc657LewcLsRa8odQNcnMLsWGTFDRG8vyEoBXq TJavhn1JY3shjpKopxaVJH4TRh6fLbyxkkYpmDlWls5S86f+jRYvc4HcSKwwjuTZetKu nRDD15OmlhogeMrBS17ayxlWc9/04/Cg6th9rUmLkxtuPjumSS559ESr/I/y3Z9c7fIn wpKIHX66ByA5ce2JXGh+pHeaqv7pxm0/5tBguNnJcxWHUMej+FaDDZah39r9lluVzFcQ XCgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=AFdCbuK2STwU1a0Nvf1lTDCDj1ToB//H9Q+bBUP1Qko=; b=ezVCuW6GrzDkCUFkB5g7XvLLuJX2hn2pvfWMs21UY8SUkinPkpyNO5Nd0ZOeAiB4vw 6XDIKtXDbcH/alMEPj7/98LIlzrCdQNhqQI3Kjv0KnCSKa5vHcBWdGnvIind6ixdXRgo uLfFiK1EchLE4o4RxQpf2lMYXkw1FZKo0DGdpDo+6DxlrViiS4eHG5INq9U2WMk206Lq 4hcDtHoMfD7XC2I2fviUmyEsQIRrCUpwJY4LiPs5gu7vVIych0mB9nmco2B+o3cmCPWj PuiSZFDGvKFy+sM84d/ItjltE2ZFVB2bJw2pGx0lsohSEbuHdyJQC1HiY60/gmNzCTxV QJ1A== X-Gm-Message-State: ACrzQf1M0A8Ms3/7AgR2/kU1z1qvimGCFaj4r+uS6/Zn04LgxC7pbCgC QrLZNgi7TfyCv5WPwklOSseb0g== X-Received: by 2002:a17:90a:6405:b0:203:6eaa:4999 with SMTP id g5-20020a17090a640500b002036eaa4999mr5266575pjj.8.1664293039489; Tue, 27 Sep 2022 08:37:19 -0700 (PDT) Received: from C02F63J9MD6R.bytedance.net ([61.120.150.77]) by smtp.gmail.com with ESMTPSA id w16-20020aa79a10000000b0053639773ad8sm1933087pfj.119.2022.09.27.08.37.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2022 08:37:19 -0700 (PDT) From: Zhuo Chen To: bhelgaas@google.com, ruscur@russell.cc, oohall@gmail.com, fancer.lancer@gmail.com, jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com, james.smart@broadcom.com, dick.kennedy@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: chenzhuo.1@bytedance.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ntb@lists.linux.dev, linux-scsi@vger.kernel.org Subject: [PATCH v2 8/9] PCI/ERR: Clear fatal status when pci_channel_io_frozen Date: Tue, 27 Sep 2022 23:35:23 +0800 Message-Id: <20220927153524.49172-9-chenzhuo.1@bytedance.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220927153524.49172-1-chenzhuo.1@bytedance.com> References: <20220927153524.49172-1-chenzhuo.1@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 When state is pci_channel_io_frozen in pcie_do_recovery(), the severity is fatal and fatal status should be cleared. So we add pci_aer_clear_fatal_status(). Signed-off-by: Zhuo Chen --- drivers/pci/pcie/err.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index f80b21244ef1..b46f1d36c090 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -241,7 +241,10 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, pci_walk_bridge(bridge, report_resume, &status); pcie_clear_device_status(dev); - pci_aer_clear_nonfatal_status(dev); + if (state == pci_channel_io_frozen) + pci_aer_clear_fatal_status(dev); + else + pci_aer_clear_nonfatal_status(dev); pci_info(bridge, "device recovery successful\n"); return status; -- 2.30.1 (Apple Git-130)