Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935323AbcJXSrw (ORCPT ); Mon, 24 Oct 2016 14:47:52 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35940 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754461AbcJXSrt (ORCPT ); Mon, 24 Oct 2016 14:47:49 -0400 Date: Mon, 24 Oct 2016 16:47:38 -0200 From: Sergio Prado To: Boris Brezillon Cc: kgene@kernel.org, krzk@kernel.org, javier@osg.samsung.com, linux@armlinux.org.uk, linux@simtec.co.uk, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org Subject: Re: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from OF node Message-ID: <20161024184738.GA26671@sprado-desktop> References: <1476999766-32526-1-git-send-email-sergio.prado@e-labworks.com> <1476999766-32526-4-git-send-email-sergio.prado@e-labworks.com> <20161024150201.01952f67@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161024150201.01952f67@bbrezillon> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1346 Lines: 37 On Mon, Oct 24, 2016 at 03:02:01PM +0200, Boris Brezillon wrote: > > +static int s3c2410_nand_setup_data_interface(struct mtd_info *mtd, > > + const struct nand_data_interface *conf, > > + bool check_only) > > +{ > > + struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); > > + struct s3c2410_platform_nand *pdata = info->platform; > > + const struct nand_sdr_timings *timings; > > + int tacls; > > + > > + timings = nand_get_sdr_timings(conf); > > + if (IS_ERR(timings)) > > + return -ENOTSUPP; > > + > > + tacls = timings->tCLS_min - timings->tWP_min; > > + if (tacls < 0) > > + tacls = 0; > > + > > + pdata->tacls = DIV_ROUND_UP(tacls, 1000); > > + pdata->twrph0 = DIV_ROUND_UP(timings->tWP_min, 1000); > > + pdata->twrph1 = DIV_ROUND_UP(timings->tCLH_min, 1000); > > You seem to only apply the timings in s3c2410_nand_setrate(), which is > only called at probe time or on a cpufreq even, but the core can change > timings at runtime (this is what happens each time you reset the chip). > > To support that you have 2 options: > - apply the timings in ->select_chip() > - apply the timings here Right. As far as I understood, ->setup_data_interface() will be called when MTD core change timings at runtime, so it is enough to apply the timings in the end of ->setup_data_interface()? Thanks, Sergio Prado