Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3146745pxk; Mon, 28 Sep 2020 09:26:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTd+l8vWhiDM5Tos1Fpyt4R1eQfGtbk1ftOCZfrxvj0l8ke+0M6Nbe0ahQt/UvjO67WadE X-Received: by 2002:a17:906:1984:: with SMTP id g4mr2392876ejd.119.1601310360115; Mon, 28 Sep 2020 09:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601310360; cv=none; d=google.com; s=arc-20160816; b=j6Lzx7q1wKjDXEqNbv0WkWjlB1kbRzZCxo8wPr3OSp9TSOgqaFeR+rCQ9Gf0SCeyWb gdTYRdaA7aL/nALecMttBJd0LgXRew6hyHPjqThRexL6uLjpgFFQ3XPD41k0Y+eeLzqR Al1Mi0cw7qgpJnEdhzAKikp8UEsc6gIzpaGd5ttwE2mws7iy96qxq7GBY1c784dsBpUd KxeWfQyCZe9y7r0Oc/C2HmRVQ1/oI4STSUTL3J4yALsuHbjmRyAcXRZ4zZiMNLbiIP5v lCF30HQs6dhYwPIU4WuJ7Anzv+JmJ55TCSjGTShYRgV3ZIkbIzWUwlelofMOx13fdKd1 BDmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=KyVb4rdNd602Oz1OcB21CfIhZAIUaGvACTaTRhb2mW4=; b=vzpDsRjn1dnxSZacDcaOSr9yc2Vw29Wi9kQfxttxr7XIEQ0rTrYSBM6PyySsR6D88f QFcZIWi7JMVRFGa9kS7K/TEH/1WO8dGyBNTRLRRaj9WKZutd45C+QfRraFSP97vfEkjX cMuuEhNkOnpXV5mbqA10jTxOIc3ko3proQOpnaVHT5L2gNcy0EcAFMXI78BeM6rBKdHM ZLm+kGVYV+inHx1b6EP6z/EoqC7sCLKvl0Cy1WEHIFCw5prMN6Y+7wf1jYFgyvjrw/CZ OgpZpruPqokEKERCpWFFEtvXrdeR7zV+r25rEg5I4sEZIfGH2FjXHfotFlGmDJAyJq0N 0FjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si996652edr.13.2020.09.28.09.25.34; Mon, 28 Sep 2020 09:26:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726665AbgI1QWD convert rfc822-to-8bit (ORCPT + 99 others); Mon, 28 Sep 2020 12:22:03 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:41823 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgI1QWD (ORCPT ); Mon, 28 Sep 2020 12:22:03 -0400 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 656301C000B; Mon, 28 Sep 2020 16:22:00 +0000 (UTC) Date: Mon, 28 Sep 2020 18:21:59 +0200 From: Miquel Raynal To: Boris Brezillon Cc: Thirumalesha N , Richard Weinberger , Vignesh Raghavendra , Shivamurthy Shastri , Chuanhong Guo , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] mtd: spinand: micron: Generalize the function and structure names Message-ID: <20200928182159.5a6cf46a@xps13> In-Reply-To: <20200928180343.4c5302a5@collabora.com> References: <20200913161533.10655-1-nthirumalesha7@gmail.com> <20200913161533.10655-2-nthirumalesha7@gmail.com> <20200915101321.1afa5033@xps13> <20200928165528.54e5db6e@xps13> <20200928174505.75fda272@collabora.com> <20200928175005.48783b61@xps13> <20200928180343.4c5302a5@collabora.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, Boris Brezillon wrote on Mon, 28 Sep 2020 18:03:43 +0200: > On Mon, 28 Sep 2020 17:50:05 +0200 > Miquel Raynal wrote: > > > > > The way OOB > > > > bytes are organized do not seem relevant to me, I think i prefer the > > > > "_4_/_8_" naming,even if it's not very explicit. > > > > > > The ECC strength doesn't say anything about the scheme used for ECC > > > bytes placement, and you might end up with 2 different schemes > > > providing the same strength, or the same scheme used for 2 different > > > strengths. > > > > So perhaps both should be present in the name? > > No, the point was to re-use the same functions for various strengths if > they use the same ECC placement scheme. I get the point, but is the current implementation generic enough? I see hardcoded numbers, I have no idea if these numbers are common to all strength given a specific layout, or if they only match for a given strength? +static int micron_4_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + struct spinand_device *spinand = mtd_to_spinand(mtd); + + if (section >= spinand->base.memorg.pagesize / + mtd->ecc_step_size) + return -ERANGE; + + region->offset = (section * 16) + 8; + region->length = 8; + + return 0; +} If possible, I would like to avoid several successive renaming. Thanks, Miquèl