From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 752DACCA482 for ; Tue, 21 Jun 2022 21:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356093AbiFUVDm (ORCPT ); Tue, 21 Jun 2022 17:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356435AbiFUVAK (ORCPT ); Tue, 21 Jun 2022 17:00:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECCA013DCA; Tue, 21 Jun 2022 13:52:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7D3D661874; Tue, 21 Jun 2022 20:51:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E167C3411C; Tue, 21 Jun 2022 20:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655844704; bh=5RO8nX9FgfFlq+ZpUAoFpO1fZvRG13fHUxCWKqzrDqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b/Eja4Qumqm2bBdp5ZVlTxHrgH8RKPcF2ToSwwIlYFDi8Cxrw86POIOSLEHPMA+Oy Oh3ZM7pViUzZkmzCXgn0Ae+GFqVbnd7/tjkqIn7MRduTdm4p8UXqSJtcsqoHXUdFZV jMD7KMK631bvHUTTZGVuLzUdik1VMQAO4N5yA9yqllfraxYkvrH7Ehw/yF8Fp2f4QJ pOZ2/2c+JZmZSxwXiPWrzJUX/4Uu7+B00myBjHc+i6hjQ0OAFX0f5XqDk1Ev/ft1iD 0di5GLJhrdB1c59VwZYAPwAn5iftxrICTMaN81lRQ6G5MWjq34Kin4KWudvySMz3Qn +09ZGOWSaJo3g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Keith Busch , Chaitanya Kulkarni , Christoph Hellwig , Sasha Levin , axboe@fb.com, sagi@grimberg.me, linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 4.14 3/5] nvme-pci: add trouble shooting steps for timeouts Date: Tue, 21 Jun 2022 16:51:37 -0400 Message-Id: <20220621205140.250968-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220621205140.250968-1-sashal@kernel.org> References: <20220621205140.250968-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keith Busch [ Upstream commit 4641a8e6e145f595059e695f0f8dbbe608134086 ] Many users have encountered IO timeouts with a CSTS value of 0xffffffff, which indicates a failure to read the register. While there are various potential causes for this observation, faulty NVMe APST has been the culprit quite frequently. Add the recommended troubleshooting steps in the error output when this condition occurs. Signed-off-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index de23f2814877..6d352a69a637 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1055,6 +1055,14 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts) dev_warn(dev->ctrl.device, "controller is down; will reset: CSTS=0x%x, PCI_STATUS read failed (%d)\n", csts, result); + + if (csts != ~0) + return; + + dev_warn(dev->ctrl.device, + "Does your device have a faulty power saving mode enabled?\n"); + dev_warn(dev->ctrl.device, + "Try \"nvme_core.default_ps_max_latency_us=0 pcie_aspm=off\" and report a bug\n"); } static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved) -- 2.35.1