From patchwork Mon Jul 17 07:33:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kleber Sacilotto de Souza X-Patchwork-Id: 789270 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3x9w5z6bhwz9sxR; Mon, 17 Jul 2017 17:34:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b="y4NjkE3o"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1dX0Xi-0004Hz-8z; Mon, 17 Jul 2017 07:34:10 +0000 Received: from mail-wr0-f177.google.com ([209.85.128.177]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1dX0Xd-0004HR-QK for kernel-team@lists.ubuntu.com; Mon, 17 Jul 2017 07:34:05 +0000 Received: by mail-wr0-f177.google.com with SMTP id 12so2171062wrb.1 for ; Mon, 17 Jul 2017 00:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=3kpu19syhVXn99WTnN2hjf0ozHT+My9eh3kuYXiIkZQ=; b=y4NjkE3oCG6Ou7VyD8ZVLD273vB5FYfJbdkUWWmTvaRh4zcD9LtlkURQXNXqL48LAE SxqIJ0vUUwqtvZXyElJLyKEod40/vFwxh0x6ufPPbANCOCB1vxcQ8ZiooKaQ6EFzT+tS Nfc0Nu/jtKro7VE0G1jSndlizPKXG+8laJ4Q3o5TKswg8uyOpF0G9IUjme+gD8Tlgn38 86iUwRGMIg31sQcL/lxGwbEsoEXSIod2rm2CCC4cegJHhGyMXOcQXIpVrxj6ytGa9um+ k2JjJ6jTfdeCVs96DfB/PVS3TJQ7uIdkUoNtXhPpIKnBJNl2G2HB/pYWHqtvOp05cWdC 6Riw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=3kpu19syhVXn99WTnN2hjf0ozHT+My9eh3kuYXiIkZQ=; b=I+XLi1F2/q4LGzvmJDLhEd6+GGaGm+1T/1aFUkRWOhgV2B17TF+ag41xLlHJQNTsk1 9z0Ut5P36Upilo+XkWWtBWEqwRmpUpz+vEK6HDS0dIf8mpjdBCEf0Mh0+xt6bV8YcOW/ fQdTE2NhI7ximCAqsAKRaH7xCGjGlVnPcIJPJS5OJINqar0C5kDPjJdLkcLrwklsHAP6 iuqR5qmOFTmTAW0cl6rADJIUubXOL0yo9tf5QLKtpwwwQUGFawJ8Az7186tYvz3V3xi2 jla0o4ddiksuJdf+25f8lipvnPRwNVFiTOOy+S/q+eAy80iI2RRvI2jfPJdhnIzXGDvx mAOA== X-Gm-Message-State: AIVw110f+cYyZGrht1FKzOmS6dyJthe5tQx5bapXjoMcOmsVZx6C4CBi b9ooOTTCVrOVFpQs2o5pqg== X-Received: by 10.223.171.83 with SMTP id r19mr11965472wrc.173.1500276845196; Mon, 17 Jul 2017 00:34:05 -0700 (PDT) Received: from localhost (x55b2f435.dyn.telefonica.de. [85.178.244.53]) by smtp.gmail.com with ESMTPSA id 123sm10868898wmp.1.2017.07.17.00.34.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jul 2017 00:34:04 -0700 (PDT) From: Kleber Sacilotto de Souza To: kernel-team@lists.ubuntu.com Subject: [SRU][Zesty][PATCH] nvme: Quirks for PM1725 controllers Date: Mon, 17 Jul 2017 09:33:58 +0200 Message-Id: <20170717073359.15547-4-kleber.souza@canonical.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170717073359.15547-1-kleber.souza@canonical.com> References: <20170717073359.15547-1-kleber.souza@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: "Martin K. Petersen" BugLink: http://bugs.launchpad.net/bugs/1704435 PM1725 controllers have a couple of quirks that need to be handled in the driver: - I/O queue depth must be limited to 64 entries on controllers that do not report MQES. - The host interface registers go offline briefly while resetting the chip. Thus a delay is needed before checking whether the controller is ready. Note that the admin queue depth is also limited to 64 on older versions of this board. Since our NVME_AQ_DEPTH is now 32 that is no longer an issue. Signed-off-by: Martin K. Petersen Signed-off-by: Sagi Grimberg (backported from d554b5e1ca64d23e4f839e6531490fee8479fbaf) Signed-off-by: Kleber Sacilotto de Souza --- drivers/nvme/host/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 6b929466c286..63f04a64b83b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1740,6 +1740,12 @@ static int nvme_pci_enable(struct nvme_dev *dev) dev_warn(dev->dev, "detected Apple NVMe controller, set " "queue depth=%u to work around controller resets\n", dev->q_depth); + } else if (pdev->vendor == PCI_VENDOR_ID_SAMSUNG && + (pdev->device == 0xa821 || pdev->device == 0xa822) && + NVME_CAP_MQES(cap) == 0) { + dev->q_depth = 64; + dev_err(dev->ctrl.device, "detected PM1725 NVMe controller, " + "set queue depth=%u\n", dev->q_depth); } /* @@ -2285,6 +2291,10 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, { PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, + { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */ + .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, + { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */ + .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) }, { 0, }