Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1149463imm; Wed, 1 Aug 2018 11:01:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfeQsyZQvBG8p9AWXGrsMPc7d0u6epwz5P7e3e8RcRB23E5YOROmuzzDKSmMc4ZRSFENEr7 X-Received: by 2002:a17:902:7586:: with SMTP id j6-v6mr25759242pll.295.1533146462898; Wed, 01 Aug 2018 11:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146462; cv=none; d=google.com; s=arc-20160816; b=HpeFlh/brA7zogitAxtIMocc3Xrvl9ZCeRZ6T72FuoBYvGCJEw+StVwfP2vt6nH3QT 7wunH59Fczdu8kzifPU6gz5zZqEo1Dyfx8eQ8/6wBUgCBAchMkz0SUKkpTE0G2GfyIQ6 PpBnU4avTurFI/8DI+yEoEdqXhGBWlEduka86JzI+a8GjugRLjCy4u+90F2MgTcL/FIL aH4mca5duRfh80+hy40NPXjaNg/h1S54pE5XuoYp/CoChztygy9HHTrQNb8oI8mxfkog 7OVtcmRH9VrFdgq8T53vslRthrr8r9BwsJs1/w05YR3gfbgVK1U4LqtVp9grsKY6fDEj RekA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GRxKWkbMumgju4grFWsDXe7bE47BpFuiW3MEBUIyRIo=; b=sQq4SN1+oo0hYkHurc7pkdb6aJwfrboR5TtJOMXuLSEFlC4oZ45j55mC6WHh11CtMA Wi7mjfsUX6YZwK9DHVbaCvgwDopqhIacBWHM+D5CLekvg4RrJPxT+c/JgE/kNznaAECR o8Toj1gMfrNF28PE2EiMKf32wKqSCvoMH5DQMgCVtVVxDoXlesyp7uiqkIHm0bcr3/lB xKOESLtolVw1BrePyfELrK6KyzxCyCp/FfaWiYUT8K48UInMNMkRzLoMXwI5MbYhMbsT H6DyvfZ6k9RKdeR9OKclKZUGJ96MlKm1VK9vbXYjeO+G+6xB9/J7VNEJWz8LpPCT69tf xJqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4-v6si18001690pgm.441.2018.08.01.11.00.48; Wed, 01 Aug 2018 11:01:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732498AbeHATqy (ORCPT + 99 others); Wed, 1 Aug 2018 15:46:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50080 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405717AbeHATIj (ORCPT ); Wed, 1 Aug 2018 15:08:39 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 95F9E13DB; Wed, 1 Aug 2018 17:16:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Gagniuc , Keith Busch , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.14 090/246] nvme-pci: Fix AER reset handling Date: Wed, 1 Aug 2018 18:50:00 +0200 Message-Id: <20180801165016.017168553@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Keith Busch [ Upstream commit 72cd4cc28e234ed7189ee508ed65ab60c80a97c8 ] The nvme timeout handling doesn't do anything if the pci channel is offline, which is the case when recovering from PCI error event, so it was a bad idea to sync the controller reset in this state. This patch flushes the reset work in the error_resume callback instead when the channel is back to online. This keeps AER handling serialized and can recover from timeouts. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199757 Fixes: cc1d5e749a2e ("nvme/pci: Sync controller reset for AER slot_reset") Reported-by: Alex Gagniuc Tested-by: Alex Gagniuc Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/pci.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2519,6 +2519,9 @@ static pci_ers_result_t nvme_slot_reset( static void nvme_error_resume(struct pci_dev *pdev) { + struct nvme_dev *dev = pci_get_drvdata(pdev); + + flush_work(&dev->ctrl.reset_work); pci_cleanup_aer_uncorrect_error_status(pdev); }