From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 921B018EFC9; Mon, 28 Oct 2024 06:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730098058; cv=none; b=bwnLGUVaE9PNdtLjs4UqTAqjluXJzBHuz6qI6H4miqJA9UmveKAxjaS5L39idoBHiSbx2tnsjQRIzmAtxbwAYWH2IVDYC1JnT2fqQpU4orxyaNelF4Rzf8GMkCoXXFRUKh87BZjR2kyZbvE1FR9UJeztg22SqeG0+5GD88uEvFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730098058; c=relaxed/simple; bh=f66a4o4FdmdVxGkoGAmf7tnx+kLXtxgtH3QxOKnmv70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u36YAYRcjXwaP8NBDY74zbb8cYi1fLHtWWO1gG8/7ek4VeoCX1d7vuSpBFEaWn7IMSRvvIhgGBPh8tSHcwd0yBtzoou23f0lHbZgX9rjfhAgv7H2h0J2gOAX5t4ODMNgUfcE6tM48a205aVReMlqOt+hA6qdTQJycZmFM+gcFh4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qoqT+DkF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qoqT+DkF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27131C4CEC3; Mon, 28 Oct 2024 06:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730098058; bh=f66a4o4FdmdVxGkoGAmf7tnx+kLXtxgtH3QxOKnmv70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qoqT+DkF30gvTNWAUO6MCCaPafgZWHHHqyOgJERC24JHs/Md+WGK5Ys5Ky4IINh9d CdjmottW0lDujMuHNODcfWdtBrzhVGf9Gt6W46XWCEG5+k4Ch+zkLU+S9Tt4zyprOg R9XPYRhMD37Ofi/9st9Qf/Gf7+jv+DmFcA1uJXoE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gerd Bayer , Niklas Schnelle , Heiko Carstens , Sasha Levin Subject: [PATCH 6.11 022/261] s390/pci: Handle PCI error codes other than 0x3a Date: Mon, 28 Oct 2024 07:22:44 +0100 Message-ID: <20241028062312.570336554@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028062312.001273460@linuxfoundation.org> References: <20241028062312.001273460@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Schnelle [ Upstream commit 3cd03ea57e8e16cc78cc357d5e9f26078426f236 ] The Linux implementation of PCI error recovery for s390 was based on the understanding that firmware error recovery is a two step process with an optional initial error event to indicate the cause of the error if known followed by either error event 0x3A (Success) or 0x3B (Failure) to indicate whether firmware was able to recover. While this has been the case in testing and the error cases seen in the wild it turns out this is not correct. Instead firmware only generates 0x3A for some error and service scenarios and expects the OS to perform recovery for all PCI events codes except for those indicating permanent error (0x3B, 0x40) and those indicating errors on the function measurement block (0x2A, 0x2B, 0x2C). Align Linux behavior with these expectations. Fixes: 4cdf2f4e24ff ("s390/pci: implement minimal PCI error recovery") Reviewed-by: Gerd Bayer Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/pci/pci_event.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c index dbe95ec5917e5..d4f19d33914cb 100644 --- a/arch/s390/pci/pci_event.c +++ b/arch/s390/pci/pci_event.c @@ -280,18 +280,19 @@ static void __zpci_event_error(struct zpci_ccdf_err *ccdf) goto no_pdev; switch (ccdf->pec) { - case 0x003a: /* Service Action or Error Recovery Successful */ + case 0x002a: /* Error event concerns FMB */ + case 0x002b: + case 0x002c: + break; + case 0x0040: /* Service Action or Error Recovery Failed */ + case 0x003b: + zpci_event_io_failure(pdev, pci_channel_io_perm_failure); + break; + default: /* PCI function left in the error state attempt to recover */ ers_res = zpci_event_attempt_error_recovery(pdev); if (ers_res != PCI_ERS_RESULT_RECOVERED) zpci_event_io_failure(pdev, pci_channel_io_perm_failure); break; - default: - /* - * Mark as frozen not permanently failed because the device - * could be subsequently recovered by the platform. - */ - zpci_event_io_failure(pdev, pci_channel_io_frozen); - break; } pci_dev_put(pdev); no_pdev: -- 2.43.0