From patchwork Mon Jul 17 07:33:59 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: 789272 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 3x9w642RWFz9s8V; Mon, 17 Jul 2017 17:34:20 +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="WO8YxLb2"; 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 1dX0Xp-0004Ld-Je; Mon, 17 Jul 2017 07:34:17 +0000 Received: from mail-wr0-f180.google.com ([209.85.128.180]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1dX0Xf-0004Hg-AN for kernel-team@lists.ubuntu.com; Mon, 17 Jul 2017 07:34:07 +0000 Received: by mail-wr0-f180.google.com with SMTP id w4so17845638wrb.2 for ; Mon, 17 Jul 2017 00:34:07 -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=FjEKlfOb3uwTsi2R426000YpfeHhUY7KbX5G31lSApE=; b=WO8YxLb21+qQKh9xfGNvpggAC4EbUL0OGMq6UpZpaPR2oPb+nzKARuGifvpxdDH1+G u/nRmLUlhZ0BQJKsPMfqbSQyqX4Fod+RXKcbi5rVbvy4Q+iUGe8AOWph+MmVaxkGOZ7n Z+KstccFDVCX9MxAtWdbsRqnwTa2HZq80n5F3feOU/uiemyIo63IrvOD6iuYrUCTgW6G PRWGFM2cGnOfJyIWELzwtu1KHnkvlltH/9dffozrYVRCjtzeDPK51/H/8wgngLa13Dk6 hNfv4pnGdZO/+TMxEEGiKAoy2qsRuBTLB6NdCQRoFxkWu24w9xcS8gCw5tojy7Iy5yvO KdBw== 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=FjEKlfOb3uwTsi2R426000YpfeHhUY7KbX5G31lSApE=; b=cnJewclG1iBnXBBIJD+XFKgBme8uAEd7RO4jJhf9MIQ+6eSCHp+MX8KbFosAjSgmuX RZQ62vjhQnefA86joYVXK7krxE3naezjxElzDX4Y8UYv/mb9KOMMsvqjR/UsNwEYhynf VPT2K/oAUMrXqJhHyo2fyFvxXviyXM596E09oqODcWI6JaD4dsO/++wgqhJlIodsIo0N bs3v3hk3LXM0cOoug7vYUB7F4xPqMJS9pnjQSFKdofdsvIj+RdJ6HhTMZ0YCYFwTQ7Dl eHI/bMkPBi/0a00JKDDZf04bbQVAhAeb2MupvAYBE3UPfTty9jAe2yFlUCa88vx84fqC 9IZg== X-Gm-Message-State: AIVw111T0NVuUSz8gjOGpLiTnoKTQmtbMg0qpxFl0+SzeMZR1fGDswOl m1kKZaoUBmRj6+7rPyidKg== X-Received: by 10.223.164.137 with SMTP id g9mr8330712wrb.105.1500276846556; Mon, 17 Jul 2017 00:34:06 -0700 (PDT) Received: from localhost (x55b2f435.dyn.telefonica.de. [85.178.244.53]) by smtp.gmail.com with ESMTPSA id i32sm32661934wra.5.2017.07.17.00.34.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jul 2017 00:34:06 -0700 (PDT) From: Kleber Sacilotto de Souza To: kernel-team@lists.ubuntu.com Subject: [SRU][Artful][PATCH] nvme: Quirks for PM1725 controllers Date: Mon, 17 Jul 2017 09:33:59 +0200 Message-Id: <20170717073359.15547-5-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 23c58872188c..2617ad532e15 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1747,6 +1747,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); } /* @@ -2328,6 +2334,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) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },