From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43666 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759492AbdLRNXY (ORCPT ); Mon, 18 Dec 2017 08:23:24 -0500 Subject: Patch "net/mlx5: Don't save PCI state when PCI error is detected" has been added to the 4.9-stable tree To: danielj@mellanox.com, alexander.levin@verizon.com, davem@davemloft.net, gregkh@linuxfoundation.org, saeedm@mellanox.com Cc: , From: Date: Mon, 18 Dec 2017 14:21:47 +0100 Message-ID: <151360330746138@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled net/mlx5: Don't save PCI state when PCI error is detected to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mlx5-don-t-save-pci-state-when-pci-error-is-detected.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Mon Dec 18 14:12:34 CET 2017 From: Daniel Jurgens Date: Fri, 10 Mar 2017 14:33:02 +0200 Subject: net/mlx5: Don't save PCI state when PCI error is detected From: Daniel Jurgens [ Upstream commit 5d47f6c89d568ab61712d8c40676fbb020b68752 ] When a PCI error is detected the PCI state could be corrupt, don't save it in that flow. Save the state after initialization. After restoring the PCI state during slot reset save it again, restoring the state destroys the previously saved state info. Fixes: 05ac2c0b7438 ('net/mlx5: Fix race between PCI error handlers and health work') Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1283,6 +1283,7 @@ static int init_one(struct pci_dev *pdev if (err) goto clean_load; + pci_save_state(pdev); return 0; clean_load: @@ -1331,9 +1332,8 @@ static pci_ers_result_t mlx5_pci_err_det mlx5_enter_error_state(dev); mlx5_unload_one(dev, priv, false); - /* In case of kernel call save the pci state and drain the health wq */ + /* In case of kernel call drain the health wq */ if (state) { - pci_save_state(pdev); mlx5_drain_health_wq(dev); mlx5_pci_disable_device(dev); } @@ -1385,6 +1385,7 @@ static pci_ers_result_t mlx5_pci_slot_re pci_set_master(pdev); pci_restore_state(pdev); + pci_save_state(pdev); if (wait_vital(pdev)) { dev_err(&pdev->dev, "%s: wait_vital timed out\n", __func__); Patches currently in stable-queue which might be from danielj@mellanox.com are queue-4.9/ib-core-fix-calculation-of-maximum-roce-mtu.patch queue-4.9/net-mlx5-don-t-save-pci-state-when-pci-error-is-detected.patch