From patchwork Mon Jan 4 23:02:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 11997703 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA75AC432C3 for ; Mon, 4 Jan 2021 23:03:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82493207BC for ; Mon, 4 Jan 2021 23:03:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727269AbhADXDv (ORCPT ); Mon, 4 Jan 2021 18:03:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:52514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbhADXDs (ORCPT ); Mon, 4 Jan 2021 18:03:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95A0B22583; Mon, 4 Jan 2021 23:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609801388; bh=Rk+0p05fTxUh6B0JyVhxlzcGbXRv8aBfkyR+1TUo9FE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l7r12fkR/8diSMYYSDPqctIad2jXUPe6PjL0oBU8MSXKjutta2SH+Cb0tvHhy6EPn u8PS9uQDcKK/DJQ1KRPLcsaPX9gc76g/Mvx2ycP3WjT9scUhmRm7PQSeh6aAVtlH9l /v+8XtbKrykr8GU3M4o1a0bdny34V6/6rBN1JJ+fOmGpkkQy+1ZjRwbclZ9DIJO/Cf eqdhaOPcH0apalyRdCZGpMOhcAfu9E+PAPy3gtA0Rr9nZ+qAVS6OofeGkhRC7/mGk9 x/8zXjSlAcpcHJ/cWiITC0UOXRngZ98K/tuNDWiyvh89Kzjw+HMu5yX5EHU16LKRyQ nM5T6yKKNulgg== From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Keith Busch , Hinko Kocevar , Sean V Kelley Subject: [PATCHv2 3/5] PCI/ERR: Retain status from error notification Date: Mon, 4 Jan 2021 15:02:58 -0800 Message-Id: <20210104230300.1277180-4-kbusch@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20210104230300.1277180-1-kbusch@kernel.org> References: <20210104230300.1277180-1-kbusch@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Overwriting the frozen detected status with the result of the link reset loses the NEED_RESET result that drivers are depending on for error handling to report the .slot_reset() callback. Retain this status so that subsequent error handling has the correct flow. Reported-by: Hinko Kocevar Acked-by: Sean V Kelley Signed-off-by: Keith Busch Reviewed-by: Kuppuswamy Sathyanarayanan --- drivers/pci/pcie/err.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index a84f0bf4c1e2..b576aa890c76 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -198,8 +198,7 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev, pci_dbg(bridge, "broadcast error_detected message\n"); if (state == pci_channel_io_frozen) { pci_walk_bridge(bridge, report_frozen_detected, &status); - status = reset_subordinates(bridge); - if (status != PCI_ERS_RESULT_RECOVERED) { + if (reset_subordinates(bridge) != PCI_ERS_RESULT_RECOVERED) { pci_warn(bridge, "subordinate device reset failed\n"); goto failed; }