Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3986884ybi; Mon, 15 Jul 2019 02:04:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU1zvh4DV1zvbXLrzU1cjrAciNhVrmTbMi42KJkQ3mpGpFNULL6lL7RaoB/cin+ZqsOYet X-Received: by 2002:a17:90a:bb0c:: with SMTP id u12mr28500249pjr.132.1563181492415; Mon, 15 Jul 2019 02:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563181492; cv=none; d=google.com; s=arc-20160816; b=PxblXsI+lpgpJphePyeh4MUKbhIbP/fZ2EFFniR8FWWCRBzvj+yf90Wh22wBGOo+o7 gracUw6R9EiGEDzi8xZkEECnFVvR7bYNIuySyC5+d+weiKvYFtPSSB6/fRJJpoZ5BUYU +NxbT9h4pFk1VLqSA3l89b6YVp0qSafMSAvTaVIt1ZTrRJUc3jD5vEQuHEh5Kegs2wKw DgeHtim5IDY71YysaDwg5lrko8zqTs9vkGxkDxNqBTslHBEn+rb3tWS4Pqq1xxyu8qHn 8PP4CLQhjlm/sbvOl+7otYADMWIHv3HNQDQs78Sz5P05ipmmAPpjVl1XQh34Kvb9PZ/w 5mGw== 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=Fr2Vk0+WbO2k2+gCoqe6p3UIUyAvvEX+Pw8liYDxb3E=; b=lZAM/1mWdIB9OHe3iPvSLAbiRMb1OQuTWsGwxuQOGZyExfl2egCKwHbHHXkFEnDDde vvgFP8rnblxz9/fE0b5bGKSgehut6Db6nFqxfDcc8DQPU8jIVPs7zEcIy7I9RVt4+2CH I5ja/JoigmrZaUL73ORRDFlAy64G7+jEeOOP9AQt/f3icJBPcaOZoXv2EC9w+S0GiuLj cbObdrN/onrWPDLu63qnALMAdVm8kdCFUetY+rnURgKkjPTUgd9r0iWfJv0jDWlo+F0j JlsKag7UlDAGD1eicqgWrMrslf3p21weTuEbyJBHeOKeVuxmxcFmYYCsdMlFO41VrZJO IFzA== 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 j9si15038713pgq.555.2019.07.15.02.04.32; Mon, 15 Jul 2019 02:04:52 -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 S1729458AbfGOJDr (ORCPT + 99 others); Mon, 15 Jul 2019 05:03:47 -0400 Received: from gate.crashing.org ([63.228.1.57]:44347 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729394AbfGOJDr (ORCPT ); Mon, 15 Jul 2019 05:03:47 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x6F93WuZ025986; Mon, 15 Jul 2019 04:03:33 -0500 Message-ID: <25c3813ab1c2943658d7e79756803801b14a34db.camel@kernel.crashing.org> Subject: Re: [PATCH] nvme: Add support for Apple 2018+ models From: Benjamin Herrenschmidt To: Christoph Hellwig Cc: linux-nvme@lists.infradead.org, "linux-kernel@vger.kernel.org" , Keith Busch , Jens Axboe , Paul Pawlowski Date: Mon, 15 Jul 2019 19:03:31 +1000 In-Reply-To: References: <71b009057582cd9c82cff2b45bc1af846408bcf7.camel@kernel.crashing.org> <20190715081041.GB31791@lst.de> 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 Mon, 2019-07-15 at 18:43 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2019-07-15 at 10:10 +0200, Christoph Hellwig wrote: > > > + /* > > > + * Apple 2018 and latter variant has a few issues > > > + */ > > > + NVME_QUIRK_APPLE_2018 = (1 << 10), > > > > We try to have quirks for the actual issue, so this should be one quirk > > for the irq vectors issues, and another for the sq entry size. Note that > > NVMe actually has the concept of an I/O queue entry size (IOSQES in the > > Cc register based on values reported in the SQES field in Identify > > Controller. Do these controllers report anything interesting there? > > Ah good to know, I'll dig. Interesting... so SQES is 0x76, indicating that it supports the larger entry size but not that it mandates it. However, we configure CC:IOSQES with 6 and the HW fails unless we have the 128 bytes entry size. So the HW is bogus, but we can probably sort that by doing a better job at fixing up SQES in the identify on the Apple HW, and then actually using it for the SQ. I checked and CC is 0x00460001 so it takes our write of "6" fine. I think they just ignore the value. How do you want to proceed here ? Should I go all the way at attempting to honor sqes "mandatory" size field (and quirk *that*) or just I go the simpler way and stick to shift 6 unless Apple ? If I go the complicated path, should I do the same with cq size (knowing that no known HW has a non-4 mandatory size there and we don't know of a HW bug... yet). Cheers, Ben.