From patchwork Tue Jan 30 13:26:05 2018 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: 10191825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9323860375 for ; Tue, 30 Jan 2018 13:26:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 835E320453 for ; Tue, 30 Jan 2018 13:26:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76DDD2884A; Tue, 30 Jan 2018 13:26:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06E9220453 for ; Tue, 30 Jan 2018 13:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598AbeA3N0e (ORCPT ); Tue, 30 Jan 2018 08:26:34 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36150 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbeA3N0R (ORCPT ); Tue, 30 Jan 2018 08:26:17 -0500 Received: by mail-lf0-f66.google.com with SMTP id t79so15333767lfe.3 for ; Tue, 30 Jan 2018 05:26:16 -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-transfer-encoding; bh=zxfHYvwV4t5tDi3mfoZGHN7FiDCmois+5YqU4VDTFPg=; b=cONokP1q2bcWS7KTaTEP1NQHsPFsVDMEeM8dmzV5Ugvc+7NLcpvPQGPsaLZbFtFRV/ DtHI3KJw28HSFDrvaKpmf8g4tQ2o4YMdMaNI1IIpZJ6knGR+5O/nRIygHoJIvjIBxoF4 chFzQw8nmSesXA0aov2YdTrnGDRYggb3lXfhU= 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=zxfHYvwV4t5tDi3mfoZGHN7FiDCmois+5YqU4VDTFPg=; b=D+obuxwvobzpMwqYR1ONh5lqQScK0ZzC3UjaZ7OYYzKugSMCnRGC2id5uPu+Zd48sj Aj6iqmTsCPI3GJ1sHbhZxwzQYCuAmLGC3cJubjQdYzR//GNKOt5PfoP2AXvCd/hjh7NH swWXd2pr6MO0nMTC57sk0fxx3WJExSqNmSdwGujM6OR/GghuntrcJ3b5P1Kcuhmi6XFP iZzVjXn6H92UGn8jBf1P6iS7K6zxZA4xeaVijr1xM+emrOwnB9NAGa58emUPNyV4c67t LTLEEvpDbmJM1e+xTi3ZvysfCkJZjrpNVDrg2euGowRGS/Mp3QhJcNEeBKF3NARoXx9T M5CQ== X-Gm-Message-State: AKwxytdm4KyoeMMzoBq36PzEVUZajm6V41IiPFvQUNru06W07OqofJMO QblV6uY6D0k/kkr8ZLQCBcLPdzks X-Google-Smtp-Source: AH8x224wmH+JpvYi4ThR2lUxn32L5nQJgEfQDjJG6eU+SlyoQaDJodCKm+656bhndyB3oZTV1+gcFQ== X-Received: by 10.25.158.67 with SMTP id h64mr16340327lfe.56.1517318775994; Tue, 30 Jan 2018 05:26:15 -0800 (PST) Received: from Macroninja.cnexlabs.com (x1-6-a4-08-f5-18-3c-3a.cpe.webspeed.dk. [188.176.29.198]) by smtp.gmail.com with ESMTPSA id 28sm3434870lfw.57.2018.01.30.05.26.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 05:26:15 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 2/2] lightnvm: remove multiple groups in 1.2 data structure Date: Tue, 30 Jan 2018 14:26:05 +0100 Message-Id: <20180130132605.28635-2-m@bjorling.me> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180130132605.28635-1-m@bjorling.me> References: <20180130132605.28635-1-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-Virus-Scanned: ClamAV using ClamSMTP Only one id group from the 1.2 specification is supported. Make sure that only the first group is accessible. Signed-off-by: Matias Bjørling --- drivers/nvme/host/lightnvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 16906327645e..e5544806fb0e 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -167,7 +167,8 @@ struct nvme_nvm_id { __le32 dom; struct nvme_nvm_addr_format ppaf; __u8 resv[228]; - struct nvme_nvm_id_group groups[4]; + struct nvme_nvm_id_group group; + __u8 resv2[2880]; } __packed; struct nvme_nvm_bb_tbl { @@ -209,7 +210,7 @@ static int init_grps(struct nvm_id *nvm_id, struct nvme_nvm_id *nvme_nvm_id) if (nvme_nvm_id->cgrps != 1) return -EINVAL; - src = &nvme_nvm_id->groups[0]; + src = &nvme_nvm_id->group; grp = &nvm_id->grp; grp->mtype = src->mtype;