From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghLyg-0000oz-Lc for linux-mtd@lists.infradead.org; Wed, 09 Jan 2019 22:05:36 +0000 Date: Wed, 9 Jan 2019 23:05:25 +0100 From: Boris Brezillon To: Linus Walleij Cc: David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: Re: [PATCH] mtd: rawnand: fsmc: Keep CE enabled fix mb() drain Message-ID: <20190109230525.62038898@bbrezillon> In-Reply-To: References: <20190109205530.5158-1-linus.walleij@linaro.org> <20190109222125.73171ae9@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 9 Jan 2019 22:40:22 +0100 Linus Walleij wrote: > On Wed, Jan 9, 2019 at 10:21 PM Boris Brezillon wrote: > > On Wed, 9 Jan 2019 21:55:30 +0100 > > Linus Walleij wrote: > > > > This patch keeps the CE (chip enable, the only chip select) > > > signal from the FSMC block enabled from the first command > > > after probe() or resume() until the driver either suspend() > > > or remove(). Create a state variable to track this. > > > > I just read the Spear600 reference manual, and I'm not sure the > > BANK_ENABLE bit controls the CE line. My understanding is that it just > > marks the bank as active and CE line is asserted when you actually > > access the AHB mem bank range (probably after making sure the FSMC bus > > is idle). > > The Nomadik STn8815 says (for this bit): > > PBKEN PC-card/NAND-Flash chip-select enable. > Enables the corresponding chip-select. > If a disabled chip-select is accessed, an HRESP = ERROR is generated > on the AHB bus. > 0: disabled (default after reset) > 1: enabled > > The same for Nomadik STn8820 and the Ux500 variants. > > So "enable" might very well have the meaning you say above, > it's just very unclear and confusing. > > > If I'm correct, I'd recommend dropping fsmc_ce_ctrl() and marking the > > bank enabled at probe time. > > This already happens in fsmc_nand_setup() so we just > need to delete some code then. > > But maybe we should disable it during remove() > at least? Yep, and set it again at resume time, just in case regs content is lost at suspend time.