From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 702C1C433EF for ; Tue, 5 Oct 2021 17:24:10 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A384261216 for ; Tue, 5 Oct 2021 17:24:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A384261216 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HP4FN17GJz3cc7 for ; Wed, 6 Oct 2021 04:24:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=JP4gIP+X; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::532; helo=mail-pg1-x532.google.com; envelope-from=naveennaidu479@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=JP4gIP+X; dkim-atps=neutral Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4HP4BL0mMyz2yms for ; Wed, 6 Oct 2021 04:21:29 +1100 (AEDT) Received: by mail-pg1-x532.google.com with SMTP id s11so20395768pgr.11 for ; Tue, 05 Oct 2021 10:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GUEhHrxHzVocYPRDueBy4ZqExPBHlS+x/5Sx/kTwk+s=; b=JP4gIP+Xb2Q6TkPHIfeumXmQUTQM17CwINF6D+7nmzq16aS1vPgePsP8BRCUigjzjG Al4+7ftcW2GwjqZcP9+dkFrmj1r1wBDmul9nRYtpL5ATiC7z9W7WguIxb6QpbYQ1c0Qe qzGsbcr1kbkr/DPjeUspYL7M43luiZspVkmyToKxKnw5C4VREjeBfaRQF27NFw29zK0v ItDvybqnRyupN9N1yxQBTQYmHEBI0F3DVSNHkMBn6gEos/E6IbLFxtOIFeujcIC1o8a3 vze4ogNFU3y+AIIZixi5K9sk1daKGlbVraVVAyZ8XdRuTqC7LsIb4fI+ulFXVGcr9cuB bbzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GUEhHrxHzVocYPRDueBy4ZqExPBHlS+x/5Sx/kTwk+s=; b=De+wYZDSIENWrCZT+NGUw0NDiBgkc9Dc3Y6kn2DY48WxWayZX7qpffRFhE3ZK0Zcku W7WneY0FI+IYnjbFxt47aCyaTllFuRPIsmXO9FFOvsdArE872wsyFsweaHvtEi1BiobD JUd/oBzfcD8xgmr3Vb4WlCEoPqE8MOQ4C784WPgamJtG2xEh9+/q5vWkL4L78v2pjxNw IYab8U5nOAT5pEktWAhA39/p3JLuvss+dO3G191YQOO2dmiBcWxOtGqWT9ZGWB8h3dJp wSPr4ZnasLTDT7qR9SLpaePc80rQv7Bn6yTycXwGgEhScHGnGgsBnUBvJNBfaxKp3Eax 4yiA== X-Gm-Message-State: AOAM5326M7Y8li/OcyvS07wGsNgJIz0+Rj0ja6P+p7y8f6My0Tn0kTtw HTVscl5jk4+bQI4bjWZBg7w= X-Google-Smtp-Source: ABdhPJzpUctZDHkmHmyClSYtwn2nBGa87nLISvzaVn9xSDa20lc4X8Z/Nz6W5DkbxezIRHkmIryqeg== X-Received: by 2002:a62:445:0:b0:44c:3b5b:f680 with SMTP id 66-20020a620445000000b0044c3b5bf680mr19133758pfe.30.1633454488012; Tue, 05 Oct 2021 10:21:28 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:f69:1127:b4ce:ef67:b718]) by smtp.gmail.com with ESMTPSA id f25sm18476722pge.7.2021.10.05.10.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 10:21:27 -0700 (PDT) From: Naveen Naidu To: bhelgaas@google.com, ruscur@russell.cc, oohall@gmail.com Subject: [PATCH v4 7/8] PCI/ERR: Remove redundant clearing of AER register in pcie_do_recovery() Date: Tue, 5 Oct 2021 22:48:15 +0530 Message-Id: <326a608cf8ca983442849045c8c7bf95fc2ba084.1633453452.git.naveennaidu479@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Naveen Naidu , skhan@linuxfoundation.org, linuxppc-dev@lists.ozlabs.org, linux-kernel-mentees@lists.linuxfoundation.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" pcie_do_recovery() is shared across the following paths: - ACPI APEI - Native AER path - EDR - DPC ACPI APEI ========== ghes_handle_aer() aer_recover_queue() kfifo_in_spinlocked(aer_recover_ring) aer_recover_work_func() while (kfifo_get(aer_recover_ring)) pcie_do_recovery() In this path the system firmware clears the AER registers before handing off the record to the OS in ghes_handle_aer() Native AER ========== aer_irq() aer_add_err_devices_to_queue() kfifo_put(&rpc->aer_fifo, *e_dev) clear_error_source_aer_registers() <---- AER registers are cleard aer_isr() aer_isr_one_error() handle_error_source() pcie_do_recovery() The AER registers are cleared during the handling of IRQ, i.e before we the recovery starts. DPC ===== dpc_handler() dpc_process_error() pci_aer_clear_status() <---- AER registers are cleared pcie_do_recovery() EDR ==== edr_handle_event() dpc_process_error() pci_aer_raw_clear_status() <---- AER registers are cleared pcie_do_recovery() In all the above paths, the AER registers are cleared before pcie_do_recovery(). The non fatal status AER registers are again cleared in pcie_do_recovery(). This is redundant. Remove redundant clearing of AER register in pcie_do_recovery() Signed-off-by: Naveen Naidu --- drivers/pci/pcie/err.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index b576aa890c76..fe04b0ae22f4 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -231,14 +231,11 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, /* * If we have native control of AER, clear error status in the device - * that detected the error. If the platform retained control of AER, - * it is responsible for clearing this status. In that case, the - * signaling device may not even be visible to the OS. + * that detected the error. */ - if (host->native_aer || pcie_ports_native) { + if (host->native_aer || pcie_ports_native) pcie_clear_device_status(dev); - pci_aer_clear_nonfatal_status(dev); - } + pci_info(bridge, "device recovery successful\n"); return status; -- 2.25.1