From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761620AbcALGvh (ORCPT ); Tue, 12 Jan 2016 01:51:37 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38582 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760984AbcALGuJ (ORCPT ); Tue, 12 Jan 2016 01:50:09 -0500 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 12/25] lightnvm: sectors first in ppa list Date: Tue, 12 Jan 2016 07:49:26 +0100 Message-Id: <1452581379-18162-13-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 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 The Westlake controller requires that the PPA list has sectors defined sequentially. Currently, the PPA list is created with planes first, then sectors. Change this to sectors first, then planes. Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index fa1a052..0c8f42f 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -245,10 +245,10 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd, return -ENOMEM; } - for (i = 0; i < nr_ppas; i++) { - for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) { + for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) { + for (i = 0; i < nr_ppas; i++) { ppas[i].g.pl = pl_idx; - rqd->ppa_list[(i * plane_cnt) + pl_idx] = ppas[i]; + rqd->ppa_list[(pl_idx * nr_ppas) + i] = ppas[i]; } } -- 2.1.4