Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507573

Re: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from OF node

From Sergio Prado <sergio.prado@e-labworks.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from OF node
Date 2016-10-24 20:50 +0200
Message-ID <svStP-31f-3@gated-at.bofh.it> (permalink)
References <sutnP-4EY-9@gated-at.bofh.it> <sutnP-4EY-19@gated-at.bofh.it> <svNaO-80A-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] mtd: s3c2410: add device tree support Sergio Prado <sergio.prado@e-labworks.com> - 2016-10-20 23:50 +0200
  [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from OF node Sergio Prado <sergio.prado@e-labworks.com> - 2016-10-20 23:50 +0200
    Re: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration  from OF node Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-10-24 15:10 +0200
      Re: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from  OF node Sergio Prado <sergio.prado@e-labworks.com> - 2016-10-24 20:50 +0200
        Re: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration  from OF node Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-10-24 21:00 +0200
  [PATCH v3 2/3] dt-bindings: mtd: add DT binding for s3c2410 flash controller Sergio Prado <sergio.prado@e-labworks.com> - 2016-10-20 23:50 +0200
    Re: [PATCH v3 2/3] dt-bindings: mtd: add DT binding for s3c2410  flash controller Rob Herring <robh@kernel.org> - 2016-10-27 01:20 +0200
  [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via platform data Sergio Prado <sergio.prado@e-labworks.com> - 2016-10-20 23:50 +0200
    Re: [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via  platform data Krzysztof Kozlowski <krzk@kernel.org> - 2016-10-21 20:30 +0200
      Re: [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via  platform data Marek Vasut <marek.vasut@gmail.com> - 2016-10-21 21:00 +0200
        Re: [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via  platform data Krzysztof Kozlowski <krzk@kernel.org> - 2016-10-21 22:10 +0200
      Re: [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via  platform data Sergio Prado <sergio.prado@e-labworks.com> - 2016-10-21 21:10 +0200
      Re: [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via  platform data Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-10-22 14:30 +0200
        Re: [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via  platform data Krzysztof Kozlowski <krzk@kernel.org> - 2016-10-22 17:40 +0200

csiph-web