Received: by 10.223.185.116 with SMTP id b49csp3743743wrg; Mon, 26 Feb 2018 05:26:30 -0800 (PST) X-Google-Smtp-Source: AH8x2244MK4sljy+7EA8A+jejxCdh+naJmz2uh9TfKv3+BJPdoCJ3Oiktu3hvcE2K+8JXx3N/0fh X-Received: by 2002:a17:902:ab89:: with SMTP id f9-v6mr10423996plr.369.1519651590474; Mon, 26 Feb 2018 05:26:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519651590; cv=none; d=google.com; s=arc-20160816; b=J5DP5fYFxFgknfDoy3BIAX1cMkQKEBC7IftGE9XcflUwf0necNh/4lF4BWCojB976s oDnkkNJnIFKr4LgwjYuEeHyHJ+gYa8IXpkJv+h85QN52QYA0V7MlkTc2L+KxzUVwW1G9 LlAdqqNrwXV/PW8zB1/pZ7WNOigxmzdmwv5vz5gXZNBegrK31vVsTIGbdLWBOOjL9oeb 3doLCmwbHnWNlbEmyZM3X3o3gIUtg3/x2iKUrNr96bDdTn5pGRp9/lWtrn6GqkLEwP/Q YtneH50vndCqTHn4dpgOO4mfx2RzMMWviM61F2BEwrDVNzIcS3H8crzrWQnB8VcXpR5Z wvmw== 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:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=lWAM+YC9xLhN3xRF9MMD3eR1JY6karYrtSU7dXL7iGg=; b=u6EA19giHrpE6h5uzXOA8x+XSCLcC0ZPQzPLkZ3iyN/zH9GU913jRb5ek0rc8ZxdqY BBZu7Eer0PsCAItcec9+ULE4S0UNLH5JUG/qwzWU41K5CRM4eKpJZ0R91qMg8bVQAB9Y WrGXByWlqGlHsnspg0pcUH/CquFHi4Pu9z7rat/GvHXblHP5/aV7j7pp9vOtqrCtgOZ3 y//4aDcIM+NPZs1cDQEPjkOOO9WWLle77M/DFQdgeYmoPGLQmFisXwNa6ApRagqnlIuy slpimPKADrDzRhzsnAuDwSf3VR2WNEFKSD6E8DojfmXNfzrm2+2r5rbCLDpDvcGlFZXz OZog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=R/stAHRW; 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 12si2562178pgb.389.2018.02.26.05.26.16; Mon, 26 Feb 2018 05:26:30 -0800 (PST) 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; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=R/stAHRW; 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 S1753587AbeBZNXx (ORCPT + 99 others); Mon, 26 Feb 2018 08:23:53 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37141 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbeBZNRd (ORCPT ); Mon, 26 Feb 2018 08:17:33 -0500 Received: by mail-wm0-f66.google.com with SMTP id 139so4028286wmn.2 for ; Mon, 26 Feb 2018 05:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lWAM+YC9xLhN3xRF9MMD3eR1JY6karYrtSU7dXL7iGg=; b=R/stAHRWjTXrGFF0JmB/vTfR4IdOcqvcY2B+ehJwkki4XAucI9SC8YUBoG0I6XLcQN lveb7JBZ7ljrIJ4P1gIwHgJA+9gNczA4vkzqHEVvhr39X+RpCiUPQXZ+hI7smuOqZCHv lD6tZye1rAkjhv9DjnaplO9sEF4Hmb5DbfgWg7M7NzUJsVLlAZpho3a8/ISkyuoEUQTS L+UFnvFbFe56TydYfc2AR+VPVAK5kiB98ykGcclxcGUcUd8IFGESGSBX/jqoSBctBax0 /s8B0pWDfaS5Ujjx6nZmLmnw0H/ptljdlgfNguPfiOKZgaRImaoxMqAziQfR2/ESI2SU LV3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lWAM+YC9xLhN3xRF9MMD3eR1JY6karYrtSU7dXL7iGg=; b=m/u7iv0nt3wokR1Yk3wqefU7R3QeKjbvwgqL83Jgi+3MMIMCeDvtKD5LhASE6vVG1h kcvzTLdnCTI2YPF59+vxZpCWYNkNgt+MBCcw+TJXekZQS/kmThhBViBArpmio+DvX/aW TUt12SwZtWorkgKMsokEx3D0NmJYsGLTFhfE1utsWZsmrnGN0fPZnfNfSu+iQa5GGLtF yiDMo4EtgVISohZzWYC1FDZvFNCGSslfxrirHnDUQwipaCM+dLs3vp7X/4oQQhrZ1phZ J7Xn8KEziI6pBRzOuvTd73G76juj+qLc8yK1hP5Pc8nnOyXwJ3V1d7YI79hjvMUSJU9I k6ig== X-Gm-Message-State: APf1xPCqTOI/jrv03WMxUPloNrIjfmhHLNzsINqB8VkAtDlbIs1hEK5z SPtPsfvrNDsfyaWT6muveEOtm72K X-Received: by 10.80.135.230 with SMTP id 35mr14866943edz.1.1519651051784; Mon, 26 Feb 2018 05:17:31 -0800 (PST) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id g59sm7097451ede.19.2018.02.26.05.17.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 05:17:31 -0800 (PST) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 05/19] lightnvm: complete geo structure with maxoc* Date: Mon, 26 Feb 2018 14:17:04 +0100 Message-Id: <1519651038-16845-6-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519651038-16845-1-git-send-email-javier@cnexlabs.com> References: <1519651038-16845-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Complete the generic geometry structure with the maxoc and maxocpu felds, present in the 2.0 spec. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 9 +++++++++ include/linux/lightnvm.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index a48950a37b8d..a8f35e8b7953 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -323,6 +323,13 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id, dev_geo->c.ws_opt = sec_per_pg; dev_geo->c.mw_cunits = 8; /* default to MLC safe values */ + /* Do not impose values for maximum number of open blocks as it is + * unspecified in 1.2. Users of 1.2 must be aware of this and eventually + * specify these values through a quirk if restrictions apply. + */ + dev_geo->c.maxoc = dev_geo->all_luns * dev_geo->c.num_chk; + dev_geo->c.maxocpu = dev_geo->c.num_chk; + dev_geo->c.cap = le32_to_cpu(src->mccap); dev_geo->c.trdt = le32_to_cpu(src->trdt); @@ -413,6 +420,8 @@ static int nvme_nvm_setup_20(struct nvme_nvm_id20 *id, dev_geo->c.ws_min = le32_to_cpu(id->ws_min); dev_geo->c.ws_opt = le32_to_cpu(id->ws_opt); dev_geo->c.mw_cunits = le32_to_cpu(id->mw_cunits); + dev_geo->c.maxoc = le32_to_cpu(id->maxoc); + dev_geo->c.maxocpu = le32_to_cpu(id->maxocpu); dev_geo->c.cap = le32_to_cpu(id->mccap); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 57d00644a1c6..e8e6bfd4d0d4 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -280,6 +280,8 @@ struct nvm_common_geo { u32 ws_min; /* minimum write size */ u32 ws_opt; /* optimal write size */ u32 mw_cunits; /* distance required for successful read */ + u32 maxoc; /* maximum open chunks */ + u32 maxocpu; /* maximum open chunks per parallel unit */ /* device capabilities. Note that this represents capabilities in 1.2 * and media and controller capabilities in 2.0 -- 2.7.4