Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5334776ybi; Tue, 30 Jul 2019 18:51:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4pmh2uGzYNscHBWqMYzOOhKaJdGA/Zu2dG9VwfH6zoTshWtbG8oU1YTH+pHejSLTk0yWw X-Received: by 2002:a65:6415:: with SMTP id a21mr97304909pgv.98.1564537877186; Tue, 30 Jul 2019 18:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564537877; cv=none; d=google.com; s=arc-20160816; b=yCPHFaqbMFw/niVhjee+EcGQgLAn2NDct8RupM2H5kWGW9oOeNjtTD5lAN5wbVmm74 URDcY09q7N/HuXL5S7jTiFRK5BfCXBSUpXOtD5fBYWVw6vjtKoBWvJDMrLFCCCgCvgUb mj6kWfmVODRusBlT0uj1ht5jriAVU4KFHoMh39mMuSzdwmxklClQnfWiALWltv+YN1xh cMcwtK3tcA1oPEd2LxmfoTGnVwTQj1x1Ug/oU+ps63fLALIt3sY+uq1FuSEmahB7lBP7 yTgB692huPpAkkWQE+rLlexAOjPRbsgnoO7H/HOyBjXCI8JskrvMQQhrRfPcSdAdB+qS GaBA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=5fq9JiiKOvcuouaSzOJQAIqd/FaodCUzf7oqdCYNmHY=; b=DrR6D3s8NNOSAXY/xBsIbZig8OHAFacSiabt8QRy8zZOyfiqMa69qx/tVOdLBxom6o 5/c52ybF8CLsiJ3s3eBj99knbDW1WjdI9grwjVW+9XMqVXLYlAqMCiXHPB1Zn1Sdw+Ky v4ufQp9bUZFVf0UHzFF/MIzj3k9mNkzitBWYvr8LYsX9EE0Ukn4XBGxtZ5kKIWeHUygb gs4VEA1K3rwtkt1gWndlHgE4mJqKfvfw41sc8KNXIhMFsOfFC4WIh0qdlgIMAvlfpIak tL1yhKlbJx3yZam3WHHuoXpIXyBlY0GfriHdlTkDo/l4Msjw9jS6MTXN9XwrYJa9Dxb/ hwFg== 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 n13si30186235pff.46.2019.07.30.18.51.02; Tue, 30 Jul 2019 18:51: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; 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 S1728263AbfG3U3Q (ORCPT + 99 others); Tue, 30 Jul 2019 16:29:16 -0400 Received: from gate.crashing.org ([63.228.1.57]:45202 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728245AbfG3U3Q (ORCPT ); Tue, 30 Jul 2019 16:29:16 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x6UKSwii027076; Tue, 30 Jul 2019 15:28:58 -0500 Message-ID: <2030a028664a9af9e96fffca3ab352faf1f739e5.camel@kernel.crashing.org> Subject: Re: [PATCH v3] nvme-pci: Support shared tags across queues for Apple 2018 controllers From: Benjamin Herrenschmidt To: Keith Busch Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Paul Pawlowski , Jens Axboe , Christoph Hellwig , Minwoo Im , Damien Le Moal Date: Tue, 30 Jul 2019 13:28:57 -0700 In-Reply-To: <20190730153044.GA13948@localhost.localdomain> References: <20190730153044.GA13948@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-07-30 at 09:30 -0600, Keith Busch wrote: > On Fri, Jul 19, 2019 at 03:31:02PM +1000, Benjamin Herrenschmidt wrote: > > From 8dcba2ef5b1466b023b88b4eca463b30de78d9eb Mon Sep 17 00:00:00 2001 > > From: Benjamin Herrenschmidt > > Date: Fri, 19 Jul 2019 15:03:06 +1000 > > Subject: > > > > Another issue with the Apple T2 based 2018 controllers seem to be > > that they blow up (and shut the machine down) if there's a tag > > collision between the IO queue and the Admin queue. > > > > My suspicion is that they use our tags for their internal tracking > > and don't mix them with the queue id. They also seem to not like > > when tags go beyond the IO queue depth, ie 128 tags. > > > > This adds a quirk that marks tags 0..31 of the IO queue reserved > > > > Signed-off-by: Benjamin Herrenschmidt > > --- > > One problem is that we've an nvme parameter, io_queue_depth, that a user > could set to something less than 32, and then you won't be able to do > any IO. I'd recommend enforce the admin queue to QD1 for this device so > that you have more potential IO tags. So I had a look and it's not that trivial. I would have to change a few things that use constants for the admin queue depth, such as the AEN tag etc... For such a special case, I am tempted instead to do the much simpler: if (dev->ctrl.quirks & NVME_QUIRK_SHARED_TAGS) { if (dev->q_depth < (NVME_AQ_DEPTH + 2)) dev->q_depth = NVME_AQ_DEPTH + 2; } In nvme_pci_enable() next to the existing q_depth hackery for other controllers. Thoughts ? Cheers, Ben.