From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274AbcDZKbn (ORCPT ); Tue, 26 Apr 2016 06:31:43 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36160 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbcDZKb2 (ORCPT ); Tue, 26 Apr 2016 06:31:28 -0400 From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 5/5] lightnvm: set block priority in nvm_set_rqd_ppalist() Date: Tue, 26 Apr 2016 12:31:10 +0200 Message-Id: <1461666670-30996-6-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1461666670-30996-1-git-send-email-m@bjorling.me> References: <1461666670-30996-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a ppa_list with vblks is expanded, it can either go block or plane first. Currently it is been plane first. This works well for a single vblk that is expanded, but fails for controllers that require data for all planes is grouped together. Make the ppa_list expand first expand with block, and then plane to support this behavior. Before (2 blocks, 4 planes per vblk) idx block plane 0 0 0 1 1 0 2 0 1 3 1 1 4 0 2 5 1 2 6 0 3 7 1 3 After idx block plane 0 0 0 1 0 1 2 0 2 3 0 3 4 1 0 5 1 1 6 1 2 7 1 3 Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index de5db7b..0e82798 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -279,7 +279,8 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd, for (i = 0; i < nr_ppas; i++) { for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) { ppas[i].g.pl = pl_idx; - rqd->ppa_list[(pl_idx * nr_ppas) + i] = ppas[i]; + rqd->ppa_list[(plane_cnt * i) + pl_idx] = + ppas[i]; } } } -- 2.1.4