Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp788642pxp; Fri, 11 Mar 2022 15:09:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZuzqnI6szkRj/CoCDPHiCCGvE7Iivi1MN9XsCB41Q/4QfktDAnf1nc1VgPOvhViDVikH8 X-Received: by 2002:a17:903:1248:b0:151:9708:d586 with SMTP id u8-20020a170903124800b001519708d586mr12491741plh.15.1647040173982; Fri, 11 Mar 2022 15:09:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647040173; cv=none; d=google.com; s=arc-20160816; b=RYi430i6l33/KZdA0gy3F8fCS+u5ukXv+1th5FYIbmLPzLOwOTh0FlNGiL4Ol8aFrV vG23e4qDLsXcykKOtDgtDRBJr/NPggJnVQho2XhnOWwEGoMw7fnYuN/2MIeIDH81Ogu7 XpYz79IRRY/SOwZ5PF0G6aLNp5XgUHGmuRYpVHveoOknxoeHT7qD4KOAULbFHvASKkky SjbbA7qmy9IA3K0Cl5TRE+A7dpl+kR5DoLolSo5F+hGLpgMDw5hnIdpSUlP7flTMxN9P kS1XMgJyi117l1qaA/uuG52qqtXOVwqGmaPytKsMy6FwrqAvNd9Mudd3HT9e0gja4Z23 H9nw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=bBTRDUPntcPRo1usZ9u1pq0lSe2NksirSnQny3r0I58=; b=v9AZNEfTTVxnFhBT5hxE4YH5LpWdOXGlt+yL4KV7yZbmUQnbnQZKFecBaLVDOPKgJ8 KAgdBMAWs2tUY/+NwktjrgswtNvRjSXlXGmX0CeK+/JZeoTUSMCc6nAU5Auvzv7NN/LH Aeis0oz5Q4iWq6KuEk0eWpYKPWsT6QDEkieLwf7AJdrA5dpyYpYq+9jG01J2f+rPBk/j kPqbZrNNH8U5k1FKTjNdor4Oi0wtriUjB4OowjPrVdv+l5oKy4gxonFv0MhQwHHltT85 xlr11V4m4e+9X5HU+t7fmxT8xX434hjfDRWjxUKyOFFhmO8UjTHugKMLgt8Z3TbIaOGD ae9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="A3ywew/L"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w9-20020a170902904900b0014d5c4a5ae6si9186198plz.255.2022.03.11.15.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 15:09:33 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="A3ywew/L"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 433A22ED586; Fri, 11 Mar 2022 14:07:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345774AbiCKC7o (ORCPT + 99 others); Thu, 10 Mar 2022 21:59:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239337AbiCKC7n (ORCPT ); Thu, 10 Mar 2022 21:59:43 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B32F3506CC; Thu, 10 Mar 2022 18:58:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646967521; x=1678503521; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UJTpyFGEbvemu6dDdKBT6cEZiQLRbmMy45pgsMr9KBM=; b=A3ywew/LVIfD4YBcEWevO4kw+vHpCMXapnLaXTU38v1/Gd7mqRX96Kkf zGShDtIk45p4KAkus0lpJwGCtA9tx5DumrO/CduwpOyIYEsdl6sSBQhAV B5BvUy5ItDwHkRvIPJobj+oA1s77ZPletF6aK08O5D7nBzTdnUjGxKD0T e+YvHfZmjdRA3AZDzWDv3IYt2wMzEleFuKveNX9KuUPWzTc7q1eJKY9YC xHQsReA45gZTC7H+0D1s9jkZhOflJzFr8Zp99kK6GUXjaVhtzOm9fqiHv EVLtOvbfHqoKDD9t6DcjXUtTFr9XHS0PNl6TwTjPwVyxtNVTxuQrAqQSy Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10282"; a="255433978" X-IronPort-AV: E=Sophos;i="5.90,172,1643702400"; d="scan'208";a="255433978" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 18:58:41 -0800 X-IronPort-AV: E=Sophos;i="5.90,172,1643702400"; d="scan'208";a="644784512" Received: from skuppusw-desk2.jf.intel.com ([10.165.154.101]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 18:58:20 -0800 From: Kuppuswamy Sathyanarayanan To: Bjorn Helgaas , Russell Currey , Oliver OHalloran Cc: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Kuppuswamy Sathyanarayanan , Kuppuswamy Sathyanarayanan , Eric Badger , Ashok Raj Subject: [PATCH v1] PCI/AER: Handle Multi UnCorrectable/Correctable errors properly Date: Fri, 11 Mar 2022 02:58:07 +0000 Message-Id: <20220311025807.14664-1-sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Currently the aer_irq() handler returns IRQ_NONE for cases without bits PCI_ERR_ROOT_UNCOR_RCV or PCI_ERR_ROOT_COR_RCV are set. But this assumption is incorrect. Consider a scenario where aer_irq() is triggered for a correctable error, and while we process the error and before we clear the error status in "Root Error Status" register, if the same kind of error is triggered again, since aer_irq() only clears events it saw, the multi-bit error is left in tact. This will cause the interrupt to fire again, resulting in entering aer_irq() with just the multi-bit error logged in the "Root Error Status" register. Repeated AER recovery test has revealed this condition does happen and this prevents any new interrupt from being triggered. Allow to process interrupt even if only multi-correctable (BIT 1) or multi-uncorrectable bit (BIT 3) is set. Reported-by: Eric Badger Reviewed-by: Ashok Raj Signed-off-by: Kuppuswamy Sathyanarayanan --- drivers/pci/pcie/aer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 9fa1f97e5b27..7952e5efd6cf 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -101,6 +101,11 @@ struct aer_stats { #define ERR_COR_ID(d) (d & 0xffff) #define ERR_UNCOR_ID(d) (d >> 16) +#define AER_ERR_STATUS_MASK (PCI_ERR_ROOT_UNCOR_RCV | \ + PCI_ERR_ROOT_COR_RCV | \ + PCI_ERR_ROOT_MULTI_COR_RCV | \ + PCI_ERR_ROOT_MULTI_UNCOR_RCV) + static int pcie_aer_disable; static pci_ers_result_t aer_root_reset(struct pci_dev *dev); @@ -1196,7 +1201,7 @@ static irqreturn_t aer_irq(int irq, void *context) struct aer_err_source e_src = {}; pci_read_config_dword(rp, aer + PCI_ERR_ROOT_STATUS, &e_src.status); - if (!(e_src.status & (PCI_ERR_ROOT_UNCOR_RCV|PCI_ERR_ROOT_COR_RCV))) + if (!(e_src.status & AER_ERR_STATUS_MASK)) return IRQ_NONE; pci_read_config_dword(rp, aer + PCI_ERR_ROOT_ERR_SRC, &e_src.id); -- 2.25.1