Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2561731ybp; Sat, 5 Oct 2019 15:00:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXSYi7TxJRDBusdyakJptqytQEiAr1VKoMF0Zz1aQMqkl7cGbgJWmGtPgh4/rFnr51KG+i X-Received: by 2002:a17:906:255b:: with SMTP id j27mr17817117ejb.96.1570312817813; Sat, 05 Oct 2019 15:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570312817; cv=none; d=google.com; s=arc-20160816; b=qtfA8gCBPfGn/VF6cIBBKhP14uSmHyiQySFkhUyTaikcFlWfrdf6a/ucvRo9umtBeD 49jOLX9waOPgwTBZQ+0134PZOqsTdMm9pULqPQ488pRZaAdN0+cgROrcYYmynfiq0vvh AVIGxdkBqKFzlpncxfUb+1T5YGXtODY1Pw/ZFDo79UPKiF5UEi+cRh/uLDdhk4I6mRxN RrJ+MN9gipgDeQ1S7YFqXX9l7KxXI9gS1dKe3FXdE6UjWrkjFygMrW4A+69GMi5ZnFCd eCwDvEZHWXFHDMShd6oSfaS+Qp/LhYf5UPyzmwvksrXRsDXrrVplCMSpz0wmgKSiUcPF XH9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=G3GiBa1jUTyLkRA1lkNHAhMtxcRwrlIdapCLYa7uKjU=; b=Ngm5h2Te6782X+OE8weL4Vuf+7MTUwPr7PrR/yuuMBgt5/IjjHNwBtZHVjwH64m58v c+ioP1zXBPvdKKbUt0YTBxL/PBQboXngOpSiiEnvF44As6Dbid8szp7mbDP+RVW4DCyi Vyt++uETNOjSt6dFT9Fa78ENmRvVKE5vqsMJqiTmz6w3JVF8XNlVFxAAReGwNZqSpXJM Zt6DV+HjKUq1P7PM5WHIyNLD4bEg83hLpdsKNialzEjTZlxDUaxuPv89kuS270I1qziz gJmUS8+0853raL4axDEKvj6JzjQqiw0PEO/W/4jCMSkdUHETrJcB8C0XS+vYBNE6uQzK +/pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r4wuP4xv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si5707404edq.49.2019.10.05.14.59.54; Sat, 05 Oct 2019 15:00:17 -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=@gmail.com header.s=20161025 header.b=r4wuP4xv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726116AbfJEV6P (ORCPT + 99 others); Sat, 5 Oct 2019 17:58:15 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41331 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbfJEV6O (ORCPT ); Sat, 5 Oct 2019 17:58:14 -0400 Received: by mail-io1-f68.google.com with SMTP id n26so20909625ioj.8 for ; Sat, 05 Oct 2019 14:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=G3GiBa1jUTyLkRA1lkNHAhMtxcRwrlIdapCLYa7uKjU=; b=r4wuP4xvj41CIb0744foDaOX+cmTo+WKgHTlLTYy+YlLTYIS8wfbTtSgjBfmQhTEzc HA+igB0G72DNBpejdeq2ZkSD5D9FHM5uKVXPp6MVInV4fqcSCxHQMjqGmkijai9P8Brm m989hcO2OeWQss7TrXXCM5JWIYPV5uQPAGbRsH0koB/wUiUhp+Cs1UChXA6jd7dQUORa 5C8ZkuCjPLNAJyptUHEbVsJZ75GsJJjZWTeq7xr+W1kF2YELje1JfmqRBgLmV2nfgYTR MMElMGLn50uyIFBCihMhGR5t/FInrJhPc07SUuRcz3REtOihSghZ8FdYn1dbWyFWh0vG Mqbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=G3GiBa1jUTyLkRA1lkNHAhMtxcRwrlIdapCLYa7uKjU=; b=f35GZ32gacd8zsKlG0wBIvs1Rdcbl2afZ9rb+YIZhzSXCcf0uxr0rohq28BuJFKgma 1CozDNuxa4eJBEnqn+FaLE/aDVG62aI647woS+pNnWRE2GTts550TPmnJBgMMr+eNson 8Fn+f3jhcBEb5Zc20IelWkebzbij9lA26/277AwEoDNMLj8eEmfxbtafbnrl89+YyQxz VndOl55ZesuOCkH6TH0TjL4G54Lqf4Gw0BXIDdZlJ0MaO+oJiZ4pmLBaSsCLsRS7elLl vo2CBI5cFTt0pzbnxo+PXZioNnthpDZnyS6Nsk82ADHNTfYvTmPoPp3IIeYtIBMdiyjK cSnQ== X-Gm-Message-State: APjAAAXc+pL5B7Ltwmvg3U6bK1chbkRG+zkLng1cSVIwgwqljgjS5KdM h4D9zHLMUr2DyD1Ir+foYluN87n8uokKPW2hKzQ= X-Received: by 2002:a92:c8d2:: with SMTP id c18mr9251832ilq.4.1570312693821; Sat, 05 Oct 2019 14:58:13 -0700 (PDT) MIME-Version: 1.0 References: <20191003191354.GA4481@Serenity> In-Reply-To: From: Tyler Ramer Date: Sat, 5 Oct 2019 17:58:52 -0400 Message-ID: Subject: Re: [PATCH] nvme-pci: Shutdown when removing dead controller To: "Singh, Balbir" Cc: "kbusch@kernel.org" , "hch@lst.de" , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "axboe@fb.com" , "sagi@grimberg.me" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > What is the bad CSTS bit? CSTS.RDY? The reset will be triggered by the result of nvme_should_reset(): 1196 static bool nvme_should_reset(struct nvme_dev *dev, u32 csts) 1197 { 1198 1199 =E2=87=A5 /* If true, indicates loss of adapter communication, p= ossibly by a 1200 =E2=87=A5 * NVMe Subsystem reset. 1201 =E2=87=A5 */ 1202 =E2=87=A5 bool nssro =3D dev->subsystem && (csts & NVME_CSTS_NSS= RO); This csts value is set in nvme_timeout: 1240 static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved) 1241 { ... 1247 =E2=87=A5 u32 csts =3D readl(dev->bar + NVME_REG_CSTS); ... 1256 =E2=87=A5 /* 1257 =E2=87=A5 * Reset immediately if the controller is failed 1258 =E2=87=A5 */ 1259 =E2=87=A5 if (nvme_should_reset(dev, csts)) { 1260 =E2=87=A5 =E2=87=A5 nvme_warn_reset(dev, csts); 1261 =E2=87=A5 =E2=87=A5 nvme_dev_disable(dev, false); 1262 =E2=87=A5 =E2=87=A5 nvme_reset_ctrl(&dev->ctrl); Again, here's the message printed by nvme_warn_reset: Aug 26 15:01:27 testhost kernel: nvme nvme4: controller is down; will reset: CSTS=3D0x3, PCI_STATUS=3D0x10 From include/linux/nvme.h: 105 =E2=87=A5 NVME_REG_CSTS=E2=87=A5 =3D 0x001c,=E2=87=A5 /* C= ontroller Status */ - Tyler