Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1400520pxj; Fri, 21 May 2021 13:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm2//CstMMj91s5CA4acGnpUST35cx8vAWMr3WpU09irlvRa2IqnucwAFg0BCavzGVjI2u X-Received: by 2002:a17:906:17ca:: with SMTP id u10mr11825900eje.124.1621628396616; Fri, 21 May 2021 13:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628396; cv=none; d=google.com; s=arc-20160816; b=pB9g5DF92fMikSClkNaqlpo2mR7YZ/jFOxhvSsUzOFIi4SrhDG6l3TF9fG/THBza30 g81EvgKx7/L5avBZfgd4UafRsiDKIXeMpyatYCDfwsvFLpKZmcb6wgoPTuU95AaAGo0U JLSw9Tcx+jSfGrO+OL+qO2xBsMUfkJTqxnJOZFjwOy1MQUVVzh3JMTP2mX+k+XD+Ngst xAsn6vWpidoVu5X1IglaMtFtncHxpnHnZohmLtrVCc1+dEq2IX/2PhHdPctWJCJE4ZnL QHKb0urKZauGip1+Urjwhhd/OlF1+SxjaAPRAYGEd6L99YG95dlWH/El0AeUVj5cT0ty lnfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=W2IH+ugcE1gEHEkkwhXPr5opu/BazhYJKTr79j4pcpg=; b=iBTLEmNYFPnG9bqfZxKfGq1og58T10AUNcWuUwFiEnwqvvpprfa3TYN0yvB87jJdTC nPFDlGdTQgjCVdKK7Zq5MVOlK0G5RS6YSR2K5tM+MqoSvSWyKo1dUnLyvDRHZZf6eoZX z/EkpcfoTStU5Q7ARsW8lGVblhhcZjTeA3D+1sGzXgiWtBhJrixXLp8AM4xTdPX/qyr6 FcRA+ZdTy/sIJfDw84WX3RsA/DbImIOihQ0u/ujI8l3v/SeZ3K4wzvSwbcPppS9WKaUf nSWVVZFR86JcBqJ3fmvchy3CybR/4g2s4G+cGdYfmFSELotB9eOd5xvTYIY63McoAwPR OvKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MMbiAUaY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si2257272edy.80.2021.05.21.13.19.33; Fri, 21 May 2021 13:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MMbiAUaY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233056AbhEUO6g (ORCPT + 99 others); Fri, 21 May 2021 10:58:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:47656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232049AbhEUO6f (ORCPT ); Fri, 21 May 2021 10:58:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D72E61132; Fri, 21 May 2021 14:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621609032; bh=MP1ZWuiaGoZ6dn6NU3Rv291MI0WIXC7H9aXQHHf6/j0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MMbiAUaYAMvpZvTIGYWnNNvtge5HeGr2VS1AIckz/r7vvrkPHJT/mIHkFfOKtLng3 0tKYmv6xlIphR5s6X8FefMi5mZWW7k4n8qBcSIM0fZIFhglaXLlLsXR+kk2twcK70M //2PYihECgWvKpRvm4QsAtyWO+CZBX+GC1WL4oXWfUg6drQ7bKXg2S/nNZfhPU5mKm fPWYDAnQIzc2UT8BmWpGX56v04h4bdBka1edtXN3qu3l64vEWotOAtgUNdhAzLxywF PIAmb55bt0nZFqVz1FzggqLOykpojhKOH8/Z98iLJvTt5FCcQhVSqQPVHBTl+Tpt1Y 6FA7Uet+LqBVw== Date: Fri, 21 May 2021 23:57:05 +0900 From: Keith Busch To: "Verma, Vishal L" Cc: "linux-nvme@lists.infradead.org" , "hch@lst.de" , "Williams, Dan J" , "Schofield, Alison" , "linux-kernel@vger.kernel.org" , "Weiny, Ira" , "Widawsky, Ben" Subject: Re: [BISECTED] nvme probe failure with v5.13-rc1 Message-ID: <20210521145705.GA29013@redsun51.ssa.fujisawa.hgst.com> References: <40071b11108987556d0473f9d968fe7dcd3f304a.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40071b11108987556d0473f9d968fe7dcd3f304a.camel@intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 05:00:29AM +0000, Verma, Vishal L wrote: > Hi, > > I ran into this failure to probe an nvme device in an emulator > (simics). It looks like there is a ~60 second wait followed by a > timeout and a failure to boot (the root device is an nvme disk) with > these messages in the log: > > [ 67.174010] nvme nvme0: I/O 5 QID 0 timeout, disable controller > [ 67.175793] nvme nvme0: Removing after probe failure status: -4 > > I bisected this to: > 5befc7c26e5a ("nvme: implement non-mdts command limits") > > It's not immediately obvious to me what's causing the problem. > Reverting the above commit fixes it. It is easily reproducible - I'd be > happy to provide more info about the emulated device or test out > patches or theories. > > It is of course possible that the emulated device is behaving in some > non spec-compliant way, in which case I'd appreciate any help figuring > out what that is. Hi Vishal, The patch you bisected to sends only a single Identify command, so it sounds like that must be the command that times out. The controller is not required to support this specific identify (CNS 0x6), but it is required to produce a response. If the identify is unsupported, the controller should respond with an appropriate error (Invalid Field In Command), but it looks like the controller didn't respond at all. So based on your observation, it sounds like the simics implementation has an identify bug. The spec doesn't provide a way for the driver to know ahead of time whether or not this identification is supported, so the driver just has to try it and react to the status code. If the implmenetation can't be fixed, then we'll need to quirk your device. If you want to confirm for certain that the new identify is the source of your timeout, you could try the following patch and the timeout should go away: --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 1a73eed61eee..b16d31d82606 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2711,7 +2711,7 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl) else ctrl->max_zeroes_sectors = 0; - if (nvme_ctrl_limited_cns(ctrl)) + if (true || nvme_ctrl_limited_cns(ctrl)) return 0; id = kzalloc(sizeof(*id), GFP_KERNEL); --