Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp710045ybd; Wed, 26 Jun 2019 04:53:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzqbw3fZbMG9pbuUdXY3p7iLSABi4suHo2eTv78hla5iwVYBpfDWMbuz5BJoneHc9JPwZ2 X-Received: by 2002:a17:90a:8c0c:: with SMTP id a12mr4283198pjo.67.1561549996034; Wed, 26 Jun 2019 04:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561549996; cv=none; d=google.com; s=arc-20160816; b=AM9rwbyo+N/sAJorxLbQyzR+iaOH8UCANH1aFfixt4BruGbRwmeEToNMmvGmQU/t93 NrypE3Tri+BxpLVGfb39x/Q1Rp915G/Z45K33AKbqyd14rTiCOxzi7VJ7VHcj/mzp6CR eQCRs3WCOkn/76DVdcqCmq3PfEJYDb6Rs0GsagCfs6OquBdCRyJc5yMpxcIjpQG+cxSO F/32VHf4bsbqJSqg0A1IJmCF0YmUMADVySuUgwBw9aPgf1El9zUaL0Kbpb+ZfS6Z3LJx vw6cGgXdEs21r8RbblBQRL1Tl0GgH46gfqDBEorGDU09r80A/KLVyOLSghqZ9/yS2hKL B9jQ== 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=3MG2vg5mjGpzjv+RMGLlYqUWvE19CepvhBrmIsR8IHk=; b=sp5to+wbrdSgFikElg7qYFV+2kNw0gv8bgLiR8ov6RTJyfuPluWPIeXxpryyImrEvd nr1lvm6I6wbJihnsc/hgkk49U1U4uuj/oHWJDqX36MpYUKcQariiPmin4hVd3ml1X/jK dOoJEv7z+y9V6uum21fbcHS1UT3+62M33bJSJUudDewweLrIoyscI2ypMOpfr6d2z1Ng S+OdNgWo3fKl5c9bh0wQcFnGyy6AOYBgXu/KuvjqnRZjNHqo2UDMe+kJDGB70wA7EZPR t9ABBPLJv1j8VHt+Qrs1oeKYMVOuFhzwa2NBVs3/QRFakmeyRMovhIIi0CRqZ9knILMa Tt6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-onmicrosoft-com header.b=sydjuiQv; 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 t130si11629618pgc.237.2019.06.26.04.52.59; Wed, 26 Jun 2019 04:53:16 -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=sydjuiQv; 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 S1726708AbfFZLv4 (ORCPT + 99 others); Wed, 26 Jun 2019 07:51:56 -0400 Received: from mail-eopbgr740085.outbound.protection.outlook.com ([40.107.74.85]:13939 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726157AbfFZLv4 (ORCPT ); Wed, 26 Jun 2019 07:51:56 -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=3MG2vg5mjGpzjv+RMGLlYqUWvE19CepvhBrmIsR8IHk=; b=sydjuiQvddEW6oK0oJTarDQpm9W5Ypev2pUCqy6xH9hB2ipNSR5jDv5YEMfRe3/CFbOOLnYSFDU8l8Qq00QOWVUoacISwSuLeAjKPqdzfkMIniQdUthMSfwTn3P638ZAHcDiaP7IV3H8p8v+PYbziqS0J74U1j7AexyhPuZ5aAc= Received: from DM6PR02MB4779.namprd02.prod.outlook.com (20.176.109.16) by DM6PR02MB5836.namprd02.prod.outlook.com (20.179.55.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Wed, 26 Jun 2019 11:51:12 +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 11:51:12 +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: AQHVKxEOKM99KajnN0G2IiFegkrxG6atgBaAgABKdoCAAAOHgIAABNvw Date: Wed, 26 Jun 2019 11:51:12 +0000 Message-ID: References: <20190625044630.31717-1-naga.sureshkumar.relli@xilinx.com> <20190626084807.3f06e718@collabora.com> <20190626132715.6128d8b1@collabora.com> In-Reply-To: <20190626132715.6128d8b1@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: d9f27aba-db74-4e36-80ae-08d6fa2c9639 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:DM6PR02MB5836; x-ms-traffictypediagnostic: DM6PR02MB5836: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 00808B16F3 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39860400002)(396003)(346002)(366004)(136003)(199004)(13464003)(189003)(5660300002)(68736007)(71200400001)(71190400001)(81166006)(81156014)(6246003)(8676002)(54906003)(3846002)(6116002)(229853002)(6916009)(6436002)(7736002)(305945005)(86362001)(53936002)(74316002)(55016002)(486006)(25786009)(8936002)(14454004)(9686003)(478600001)(476003)(6506007)(102836004)(53546011)(66946007)(73956011)(64756008)(66446008)(66476007)(66556008)(7696005)(4326008)(66066001)(2906002)(99286004)(446003)(11346002)(26005)(256004)(316002)(14444005)(76116006)(76176011)(7416002)(186003)(52536014)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB5836;H:DM6PR02MB4779.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: t0EguLMoWA3Zfdp+AM0RQtWOz6insG7rklakzmKa+1u9+0MpNjz75m6s+mbVOgYTxZvtDmbBW2qlgNAWd4YSpItkpOpFqCAV6STQmvAriouW2FUk1nfRaAT0wAO62PEBREYThR9oW4VvKAb5e7NPN7KIaOSeQfPjpPu7j4QHvNbpUMxJD9mOQL1192attkNwdCntpBs5O831h5Gmmaih9d8ezMvnGXXVUc2n8Dv2UN7T//9QvQqqmfOrddHGYspK/9lQQTLGbUXdzAHRhPxAqOjgxzprqcT65aLls0WOwrk/j0bHMciifrDxYwAW3J2RJJrG+8gJxnEELve7bpkGwWIOehwTp5ucnxT3w9CWtIj9o7zIFcEaCshuFo/fxv8W8b5KkM1NbuuIFJhInlIhqTlOhK+HCtXQ4Jq0qqQI73c= 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: d9f27aba-db74-4e36-80ae-08d6fa2c9639 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2019 11:51:12.3350 (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: DM6PR02MB5836 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 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; 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 11:22:33 +0000 > Naga Sureshkumar Relli wrote: >=20 > > 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 nand_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_ecc; > > > > + 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 mandato= ry to use > micron_nand_read/write_page_on_die_ecc()? >=20 > Absolutely, and if it doesn't work that means you driver does not > implement raw accesses correctly, which means it's still buggy... 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, h= ence we are splitting the=20 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. Thanks, Naga Sureshkumar Relli