Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44EDFC433EF for ; Wed, 17 Nov 2021 13:47:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 293F561B3E for ; Wed, 17 Nov 2021 13:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237886AbhKQNuR convert rfc822-to-8bit (ORCPT ); Wed, 17 Nov 2021 08:50:17 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:55783 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233591AbhKQNuQ (ORCPT ); Wed, 17 Nov 2021 08:50:16 -0500 Received: (Authenticated sender: herve.codina@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 43FB6E0003; Wed, 17 Nov 2021 13:47:16 +0000 (UTC) Date: Wed, 17 Nov 2021 14:47:15 +0100 From: Herve Codina To: Miquel Raynal Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni Subject: Re: [PATCH 2/4] mtd: rawnand: fsmc: Force to use 8 bits access when expected Message-ID: <20211117144715.731a9856@bootlin.com> In-Reply-To: <20211112163859.23a2487a@xps13> References: <20211112143855.2678989-1-herve.codina@bootlin.com> <20211112143855.2678989-3-herve.codina@bootlin.com> <20211112163859.23a2487a@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-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, On Fri, 12 Nov 2021 16:38:59 +0100 Miquel Raynal wrote: > Hi Hervé, > > herve.codina@bootlin.com wrote on Fri, 12 Nov 2021 15:38:53 +0100: > > > Some data transfers are expected on 8 bits by the nand core. > > The fsmc driver did not check this constraint and these transfers > > can be done on 32 bits depending on buffer alignment and transfers > > data size. > > > > This patch ensures that these transfers will be 8bits transfers in > > all cases. > > I believe there is a misunderstanding here: NAND buses -between the > NAND controller and the NAND chip- are either 8-bit or 16-bit wide and > the amount of bytes that you will retrieve per register read is not > related to it. > > When the controller supports 16-bit accesses, there are certain > operations that must be performed using only the lowest 8 bits of the > NAND bus, such as reading a status [1]. In this case, the controller > must have a way to disable the 16-bit mode temporarily. See [2] and [3] > for an example. Reading with readb() or readl() will IMHO not impact the > amount of data lines used for the operation. > Indeed, I misunderstood the force_8bit usage. This patch is not needed and will be simply removed in v2 series. Thanks, Hervé