From patchwork Tue Jan 12 06:49:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 8014111 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8E10BEEE5 for ; Tue, 12 Jan 2016 06:56:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCA8820379 for ; Tue, 12 Jan 2016 06:56:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F26CA201F4 for ; Tue, 12 Jan 2016 06:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761288AbcALGv0 (ORCPT ); Tue, 12 Jan 2016 01:51:26 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38732 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761383AbcALGuU (ORCPT ); Tue, 12 Jan 2016 01:50:20 -0500 Received: by mail-wm0-f44.google.com with SMTP id b14so303599965wmb.1 for ; Mon, 11 Jan 2016 22:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=RLQegpv41RLtcoExKwxInzgBMFo4q4VjshjyvF8l7Zg=; b=CUMLZyjrKVIi5tPu568RkvNVxwGlVvrKaAbUxflURfmipZvAGzgW/KzqfocVTWqrOs FJrsQxxKnbQPzqg8oS7qAmhXmsD83jZxZyKoP4rPK0IICRnZaWQRxr97PnXNFErd0UyD xIVPTxU+Ggck9q7O6aVddUghc4JBkNCferWgM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=RLQegpv41RLtcoExKwxInzgBMFo4q4VjshjyvF8l7Zg=; b=ePH3dXf7FBFPTlqEU1yplCrUpGYjCs4i90fImt4GBPm9/vU9Y+CAgi5kPJFUj1Ljoi 6UDzqY3IZx/TcDXbn6TN/nqDCuGPcPbGKHVoGFh+bO6wDBBPo9l5Z3WgDkO+C6vNExxn jqZUSlzliXwETjdkp8rAPuNkqjmWvgi1Djn2DyiwxbPKsO1e0JQtHAaTko5M8+h9ASJ6 t0evocHolZeIqnN0Ck4gWet0UXKFraWD37hsaky+c89pMnPPE7tzX6ALipyGn0dSgu41 SXKrQwOUAcFKzVAIjOaiL7CuhWdyAUpuZbU5bkjkXc6O/Pu3VLCMbwPKPipCTUdE35j+ NlQA== X-Gm-Message-State: ALoCoQmAGJZytsolSYz2An2R58Ig6HhpLMLUOav2xyMrG9AX6Wz/F+jTsj8eh0dHpcqxTJzkU2cF2n5oN3rYpcjRmkS4uX2bcQ== X-Received: by 10.194.158.73 with SMTP id ws9mr155617765wjb.40.1452581419512; Mon, 11 Jan 2016 22:50:19 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id yz5sm70776886wjc.36.2016.01.11.22.50.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 22:50:18 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 20/25] lightnvm: add mccap support Date: Tue, 12 Jan 2016 07:49:34 +0100 Message-Id: <1452581379-18162-21-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me> References: <1452581379-18162-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some flash media has extended capabilities, such as programming SLC pages on MLC/TLC flash, erase/program suspend, scramble and encryption. MCCAP is introduced to detect support for these capabilities in the command set. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 1 + include/linux/lightnvm.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index e5e3963..5199c12 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -376,6 +376,7 @@ static int nvm_core_init(struct nvm_dev *dev) dev->sec_size = grp->csecs; dev->oob_size = grp->sos; dev->sec_per_pg = grp->fpg_sz / grp->csecs; + dev->mccap = grp->mccap; memcpy(&dev->ppaf, &id->ppaf, sizeof(struct nvm_addr_format)); dev->plane_mode = NVM_PLANE_SINGLE; diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index aa35907..b90d283 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -61,6 +61,12 @@ enum { NVM_BLK_T_GRWN_BAD = 0x2, NVM_BLK_T_DEV = 0x4, NVM_BLK_T_HOST = 0x8, + + /* Memory capabilities */ + NVM_ID_CAP_SLC = 0x1, + NVM_ID_CAP_CMD_SUSPEND = 0x2, + NVM_ID_CAP_SCRAMBLE = 0x4, + NVM_ID_CAP_ENCRYPT = 0x8, }; struct nvm_id_group { @@ -278,6 +284,7 @@ struct nvm_dev { int blks_per_lun; int sec_size; int oob_size; + int mccap; struct nvm_addr_format ppaf; /* Calculated/Cached values. These do not reflect the actual usable