Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2202263imm; Mon, 28 May 2018 03:51:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrjmwaeBM0soJBvTnqI4xK4cpF2lORZkgDTIqng9KrynbQiFvXi2CUj+CXUgCpIOY4oXV1/ X-Received: by 2002:a63:4003:: with SMTP id n3-v6mr10176401pga.184.1527504700715; Mon, 28 May 2018 03:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527504700; cv=none; d=google.com; s=arc-20160816; b=mq18/yHG+i4nZxH+dNy+yiLK0CQYLtYx9FOdtyeZxlD/auDHL2ZXFT5bVe/4GCE5bz loYwoB9WM57hXwkKWY2MXtVjS+ZokOPdxOpM8vQM5x2f3IlkRO8gq/yxJa04vZhnSR58 Gcz53PtDV3R0C57i+DJA+MZ2soG+nO2yPtwrGaJ4rm/ZarFj1PG3bM2kcVe+1Ijtn9Zn BShbmTGEvq9xlLhRH2o768i+KufW/y6vz9dc3SDSVaXI5DGo9ZJYr8WkL4lGo0FYHwWv I8fJyEKU9QKC8rMRJysdquv6z8qGxVEksKHPBlp7bSnjtoNIqrOBV9RqqUZCf7qm+XCu JXCQ== 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:dkim-signature :arc-authentication-results; bh=7nw0MYJvQpC9M+aAetKYz5f2Zfulm5ZrCfdvhHO2ttc=; b=ztmdwCdwdZfHOTpXM9lZytwAT+fmY+x+B10uw64Xt9I+8Cr5JvtJBMLBgvGwv0gv+j le4BExApd/arh/vruWumz0eh/ZueaYm/HKYmiRc5d9NafKmuSRMui5MPom0V0I2En83B HTPvae7umm2iu51NcCHuqR6Ortfenxp5aLuZgb778K5UfzXfE996FIA0Fsk5mkdOPm/5 Q/Hy/QIXjdiq3Sg3jyAWMBOxpWh3q7hWDu0r4g+ioLrdCeCsEkzNGZ8OOTe3sjFMNmfQ rus0v4eoVQzYCnKUQyjrvGQ4j+HqKnx4Nc2Yy5Rp2pnGvWw9z7Rp2jX9B6zqZud1URMI 2ziw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cBavoQX9; 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 w61-v6si831269plb.502.2018.05.28.03.51.26; Mon, 28 May 2018 03:51:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=cBavoQX9; 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 S1163627AbeE1KuF (ORCPT + 99 others); Mon, 28 May 2018 06:50:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:39546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163598AbeE1Kt7 (ORCPT ); Mon, 28 May 2018 06:49:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 027B5204EE; Mon, 28 May 2018 10:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504598; bh=e6XOmcHupArepT8HM8xzJXHCMkllnaJPs7rsUY+f/VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cBavoQX9IpTV5CjxOD8AwNYDy9Lwjbz3p8GWIkeTmjWzqiUoehjzDIUS10yDodq+K f5br0RmXmiEjeYAIsJEaHB3gWhmFYWH1cvVnwWrGtgZme9mroO9CftWnMPNfBARL65 orojuVwOwwRgCO0C7B2ofLLhlUnlx2utreOmmiuY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Xiong , Keith Busch , Sasha Levin Subject: [PATCH 4.14 196/496] nvme-pci: Fix EEH failure on ppc Date: Mon, 28 May 2018 11:59:41 +0200 Message-Id: <20180528100328.186085304@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@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: Wen Xiong [ Upstream commit 651438bb0af5213f1f70d66e75bf11d08cb5537a ] Triggering PPC EEH detection and handling requires a memory mapped read failure. The NVMe driver removed the periodic health check MMIO, so there's no early detection mechanism to trigger the recovery. Instead, the detection now happens when the nvme driver handles an IO timeout event. This takes the pci channel offline, so we do not want the driver to proceed with escalating its own recovery efforts that may conflict with the EEH handler. This patch ensures the driver will observe the channel was set to offline after a failed MMIO read and resets the IO timer so the EEH handler has a chance to recover the device. Signed-off-by: Wen Xiong [updated change log] Signed-off-by: Keith Busch Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/pci.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1013,12 +1013,6 @@ static bool nvme_should_reset(struct nvm if (!(csts & NVME_CSTS_CFS) && !nssro) return false; - /* If PCI error recovery process is happening, we cannot reset or - * the recovery mechanism will surely fail. - */ - if (pci_channel_offline(to_pci_dev(dev->dev))) - return false; - return true; } @@ -1049,6 +1043,13 @@ static enum blk_eh_timer_return nvme_tim struct nvme_command cmd; u32 csts = readl(dev->bar + NVME_REG_CSTS); + /* If PCI error recovery process is happening, we cannot reset or + * the recovery mechanism will surely fail. + */ + mb(); + if (pci_channel_offline(to_pci_dev(dev->dev))) + return BLK_EH_RESET_TIMER; + /* * Reset immediately if the controller is failed */