Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp754751ybd; Wed, 26 Jun 2019 05:37:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWXciWDPT2bcyhYONlXbYOaAfluqQzpLTa8cmd1YTtdqZHpkwA1d7zZuUThEbhUHXU06CN X-Received: by 2002:a17:902:aa0a:: with SMTP id be10mr5040432plb.293.1561552647737; Wed, 26 Jun 2019 05:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561552647; cv=none; d=google.com; s=arc-20160816; b=bP8kQp9WruXtbz1U4tGabuj6CCVYsK7D/ysgGWswhpW3sbprKMEtNbd/UjRUaUa448 JlUm19DSwr2y9lVtyP+VhtQuiyEbcanpXB8B3If7kkNtbcCdZyPQcq+jaO9ExfqMOE7k S3RKx+rzTt3otFbUFL/pq0iRRgG6HFUuCY03sylkPh53Y6Krx9MHAzhi6jgs7fstneP0 I6Z7wDNrtcbXYrMW9U62q42VtV3JhAaa5pfekgIUs8ShEppYxYj3iZ/1/ko9niBUMkE1 ilNaVyRLDVfDL4ioqXnw21QIQbZUw8rz5SZ2/MaZmq6MTcil6HIc5AN6yb3puiv5AKMI zNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=eH1Gjz/SwiOnqPv7o/dbajUXmfLWHUqFdqJQ2e6SEf0=; b=N6MT9n2LaVAvneq15IDnI3qjP2wzXj3YQR+rqjzpISgVuvhNetTS/5iPkVnWg1tK8/ 6AqktUGxAP06IiMc2HVf4D2JWMtrM5icQkzgywpEjrVGa/6+SCaVpdhDHUh7YQEcQF2q VIW98Hmy2gsAbmYOSv8ndrDCVKKa2IZ6lyQao1WFo/juW+glZriCk7daL6+Lpns/1xYl st1ZLI2NN9Euby+dHUZp+J+B/6uxQIJfNuBJ01ekliqqXYUS/QMZp/8b68yuTYVo3rCG SrO78OE7BTDKxRcFBvNwf0+q32jGfy0Tt7JJYdFDrH2D/v3x7O1xRHQXAG4k3a4mkJ3Y Ux9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-onmicrosoft-com header.b=iI9qcS6N; 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 b3si3771716pfa.89.2019.06.26.05.37.11; Wed, 26 Jun 2019 05:37:27 -0700 (PDT) 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=@xilinx.onmicrosoft.com header.s=selector1-xilinx-onmicrosoft-com header.b=iI9qcS6N; 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 S1727513AbfFZMfj (ORCPT + 99 others); Wed, 26 Jun 2019 08:35:39 -0400 Received: from mail-eopbgr760082.outbound.protection.outlook.com ([40.107.76.82]:3910 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726131AbfFZMfi (ORCPT ); Wed, 26 Jun 2019 08:35:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eH1Gjz/SwiOnqPv7o/dbajUXmfLWHUqFdqJQ2e6SEf0=; b=iI9qcS6NjUdkzQgWwnqiFOD+Vqi2zZHjg6+tsRF1bbCiwRD3QpVctOynYmjh286nk5yYNkk/nSs3lqkvELFYzma3ux7rVxca63ju766Jt9zKHM3Cdm/H6xjGpWKyU9FxlZx73f3lKjqG2t6jpvX8EFKyV6pK2qNjjZqTNxhvnRc= Received: from DM6PR02MB4779.namprd02.prod.outlook.com (20.176.109.16) by DM6PR02MB4090.namprd02.prod.outlook.com (20.176.75.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.18; Wed, 26 Jun 2019 12:33:54 +0000 Received: from DM6PR02MB4779.namprd02.prod.outlook.com ([fe80::936:90c8:a385:1513]) by DM6PR02MB4779.namprd02.prod.outlook.com ([fe80::936:90c8:a385:1513%4]) with mapi id 15.20.2008.017; Wed, 26 Jun 2019 12:33:54 +0000 From: Naga Sureshkumar Relli To: Boris Brezillon CC: "miquel.raynal@bootlin.com" , "helmut.grohne@intenta.de" , "richard@nod.at" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "bbrezillon@kernel.org" , "yamada.masahiro@socionext.com" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: RE: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do not over write driver's read_page()/write_page() Thread-Topic: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do not over write driver's read_page()/write_page() Thread-Index: AQHVKxEOKM99KajnN0G2IiFegkrxG6atgBaAgABKdoCAAAOHgIAABNvwgAAFfoCAAAE2wIAAA0eAgAABfeA= Date: Wed, 26 Jun 2019 12:33:54 +0000 Message-ID: References: <20190625044630.31717-1-naga.sureshkumar.relli@xilinx.com> <20190626084807.3f06e718@collabora.com> <20190626132715.6128d8b1@collabora.com> <20190626140417.440cf762@collabora.com> <20190626142021.484c4fd8@collabora.com> In-Reply-To: <20190626142021.484c4fd8@collabora.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nagasure@xilinx.com; x-originating-ip: [149.199.50.133] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f3229a60-a164-475a-3395-08d6fa328d2d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM6PR02MB4090; x-ms-traffictypediagnostic: DM6PR02MB4090: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 00808B16F3 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(366004)(396003)(346002)(376002)(136003)(13464003)(189003)(199004)(14444005)(9686003)(102836004)(256004)(25786009)(6436002)(7416002)(81166006)(4326008)(81156014)(229853002)(305945005)(55016002)(53936002)(74316002)(33656002)(8936002)(52536014)(7736002)(8676002)(2906002)(476003)(11346002)(76176011)(14454004)(5660300002)(71190400001)(6506007)(53546011)(99286004)(66066001)(446003)(68736007)(486006)(7696005)(54906003)(71200400001)(316002)(478600001)(6246003)(3846002)(6116002)(186003)(26005)(6916009)(76116006)(66446008)(73956011)(86362001)(66476007)(66556008)(66946007)(64756008);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4090;H:DM6PR02MB4779.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: xilinx.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: HckuFpK08hU5rbLwAujp9Y8G8e2qKvDd/fZm3Vymryp47zvq6xlzVZzk2LJX4tmm8m9FWy1FjELEUutp2KtzKPEIvwsrFoe6QNjIoy5e4Zqd5q6kb3B8Cmad++sJ8G3RuJDxMxmIp8XzpsKPWNAY6Lo0qPGzAWj6wwTLeXRRGjwvQtboUqfiLxmRNc8Nayi2fR08SiFw/lLW5UIASw5dU6fdV7xFqUYks18Az7xfq8aKhD1b5BdHsch6pH6d9RuSWtZ6ONhyjxwb1OS10PPJxTaGZflwxOAzXoBKljPqPsSZQmvdKHcj1J9nQy/wWAuNqXWGPoMX927gTtKEIMSi1c4JE+pqK/dijnWRz+X9fzFW5sTcPLquaTjdrPxv7JHeCr9vRLa2fddQr9u+yBq/qgEQRFkP43mOXzbXgJUbvTw= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3229a60-a164-475a-3395-08d6fa328d2d X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2019 12:33:54.2592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nagasure@xilinx.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, > -----Original Message----- > From: Boris Brezillon > Sent: Wednesday, June 26, 2019 5:50 PM > To: Naga Sureshkumar Relli > Cc: miquel.raynal@bootlin.com; helmut.grohne@intenta.de; richard@nod.at; > dwmw2@infradead.org; computersforpeace@gmail.com; marek.vasut@gmail.com; > vigneshr@ti.com; bbrezillon@kernel.org; yamada.masahiro@socionext.com; li= nux- > mtd@lists.infradead.org; linux-kernel@vger.kernel.org > Subject: Re: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do not over= write > driver's read_page()/write_page() >=20 > On Wed, 26 Jun 2019 12:12:47 +0000 > Naga Sureshkumar Relli wrote: >=20 > > Hi Boris, > > > > > -----Original Message----- > > > From: Boris Brezillon > > > Sent: Wednesday, June 26, 2019 5:34 PM > > > To: Naga Sureshkumar Relli > > > Cc: miquel.raynal@bootlin.com; helmut.grohne@intenta.de; > > > richard@nod.at; dwmw2@infradead.org; computersforpeace@gmail.com; > > > marek.vasut@gmail.com; vigneshr@ti.com; bbrezillon@kernel.org; > > > yamada.masahiro@socionext.com; linux- mtd@lists.infradead.org; > > > linux-kernel@vger.kernel.org > > > Subject: Re: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do not > > > over write driver's read_page()/write_page() > > > > > > On Wed, 26 Jun 2019 11:51:12 +0000 > > > Naga Sureshkumar Relli wrote: > > > > > > > Hi Boris, > > > > > > > > > -----Original Message----- > > > > > From: Boris Brezillon > > > > > Sent: Wednesday, June 26, 2019 4:57 PM > > > > > To: Naga Sureshkumar Relli > > > > > Cc: miquel.raynal@bootlin.com; helmut.grohne@intenta.de; > > > > > richard@nod.at; dwmw2@infradead.org; > > > > > computersforpeace@gmail.com; marek.vasut@gmail.com; > > > > > vigneshr@ti.com; bbrezillon@kernel.org; > > > > > yamada.masahiro@socionext.com; linux- mtd@lists.infradead.org; > > > > > linux-kernel@vger.kernel.org > > > > > Subject: Re: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do > > > > > not over write driver's read_page()/write_page() > > > > > > > > > > On Wed, 26 Jun 2019 11:22:33 +0000 Naga Sureshkumar Relli > > > > > wrote: > > > > > > > > > > > Hi Boris, > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: Boris Brezillon > > > > > > > Sent: Wednesday, June 26, 2019 12:18 PM > > > > > > > To: Naga Sureshkumar Relli > > > > > > > Cc: miquel.raynal@bootlin.com; helmut.grohne@intenta.de; > > > > > > > richard@nod.at; dwmw2@infradead.org; > > > > > > > computersforpeace@gmail.com; marek.vasut@gmail.com; > > > > > > > vigneshr@ti.com; bbrezillon@kernel.org; > > > > > > > yamada.masahiro@socionext.com; linux- > > > > > > > mtd@lists.infradead.org; linux-kernel@vger.kernel.org > > > > > > > Subject: Re: [LINUX PATCH v17 1/2] mtd: rawnand: > > > > > > > nand_micron: Do not over write driver's > > > > > > > read_page()/write_page() > > > > > > > > > > > > > > On Mon, 24 Jun 2019 22:46:29 -0600 Naga Sureshkumar Relli > > > > > > > wrote: > > > > > > > > > > > > > > > Add check before assigning chip->ecc.read_page() and > > > > > > > > chip->ecc.write_page() > > > > > > > > > > > > > > > > Signed-off-by: Naga Sureshkumar Relli > > > > > > > > > > > > > > > > --- > > > > > > > > drivers/mtd/nand/raw/nand_micron.c | 7 +++++-- > > > > > > > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > diff --git a/drivers/mtd/nand/raw/nand_micron.c > > > > > > > > b/drivers/mtd/nand/raw/nand_micron.c > > > > > > > > index cbd4f09ac178..565f2696c747 100644 > > > > > > > > --- a/drivers/mtd/nand/raw/nand_micron.c > > > > > > > > +++ b/drivers/mtd/nand/raw/nand_micron.c > > > > > > > > @@ -500,8 +500,11 @@ static int micron_nand_init(struct nan= d_chip *chip) > > > > > > > > chip->ecc.size =3D 512; > > > > > > > > chip->ecc.strength =3D chip->base.eccreq.strength; > > > > > > > > chip->ecc.algo =3D NAND_ECC_BCH; > > > > > > > > - chip->ecc.read_page =3D micron_nand_read_page_on_die_ecc= ; > > > > > > > > - chip->ecc.write_page =3D micron_nand_write_page_on_die_e= cc; > > > > > > > > + if (!chip->ecc.read_page) > > > > > > > > + chip->ecc.read_page =3D > > > > > > > > +micron_nand_read_page_on_die_ecc; > > > > > > > > + > > > > > > > > + if (!chip->ecc.write_page) > > > > > > > > + chip->ecc.write_page =3D > > > > > > > > +micron_nand_write_page_on_die_ecc; > > > > > > > > > > > > > > That's wrong, if you don't want on-die ECC to be used, > > > > > > > simply don't set nand-ecc-mode to "on- die". > > > > > > Ok. But if we want to use on-die ECC then you mean to say it > > > > > > is mandatory to use > > > > > micron_nand_read/write_page_on_die_ecc()? > > > > > > > > > > Absolutely, and if it doesn't work that means you driver does > > > > > not implement raw accesses correctly, which means it's still bugg= y... > > > > I agree. But let's say, if there is a limitation with the > > > > controller. Then it is must to have this > > > check right? > > > > I mean, for pl353 controller, we must clear the CS during the data > > > > phase, hence we are splitting the Transfer in the pl353_read/write_= page_raw(). > > > > + pl353_nand_read_data_op(chip, buf, mtd->writesize, false); > > > > + p =3D chip->oob_poi; > > > > + pl353_nand_read_data_op(chip, p, > > > > + (mtd->oobsize - > > > > + PL353_NAND_LAST_TRANSFER_LENGTH), > false); > > > > + p +=3D (mtd->oobsize - PL353_NAND_LAST_TRANSFER_LENGTH); > > > > + xnfc->dataphase_addrflags |=3D PL353_NAND_CLEAR_CS; > > > > + pl353_nand_read_data_op(chip, p, > PL353_NAND_LAST_TRANSFER_LENGTH, > > > > + false); > > > > As the above sequence is needed even for raw access, PL353 is > > > > unable to use the on_die_page > > > reads. > > > > > > This "de-assert CS on last access" logic should be done in the > > > exec_op() implementation. I also wonder how that works for > > > operations that don't have data cycles. Oh, BTW, most chips are > > > CE-don't-care, which means you can assert/de-assert CS on each read_d= ata_op() without > any issues. > > Yes, we can assert/de-assert CS on each read/write_data_op(). > > But what about transfer length splitting? > > + p =3D chip->oob_poi; > > + pl353_nand_read_data_op(chip, p, > > + (mtd->oobsize - > > + PL353_NAND_LAST_TRANSFER_LENGTH), false); > > + p +=3D (mtd->oobsize - PL353_NAND_LAST_TRANSFER_LENGTH); > > This should be done as a part of pl353_raw_read/write() right? >=20 > Are you sure you need to do that, and if that's the case, do you have an = idea why this is needed? > Is this "read last 4 bytes separately" > thing is needed, I suspect it's needed for any kind of input-data cycles,= not just page reads. Yes. It is needed. This is Limitation in the HW, need to handle last 4 byte= s separately for both page read/writes Regards, Naga Sureshkumar Relli