From: Sergio Prado <sergio.prado@e-labworks.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
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
Date: Mon, 24 Oct 2016 16:47:38 -0200 [thread overview]
Message-ID: <20161024184738.GA26671@sprado-desktop> (raw)
In-Reply-To: <20161024150201.01952f67@bbrezillon>
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
WARNING: multiple messages have this Message-ID (diff)
From: sergio.prado@e-labworks.com (Sergio Prado)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from OF node
Date: Mon, 24 Oct 2016 16:47:38 -0200 [thread overview]
Message-ID: <20161024184738.GA26671@sprado-desktop> (raw)
In-Reply-To: <20161024150201.01952f67@bbrezillon>
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
next prev parent reply other threads:[~2016-10-24 18:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 21:42 [PATCH v3 0/3] mtd: s3c2410: add device tree support Sergio Prado
2016-10-20 21:42 ` Sergio Prado
2016-10-20 21:42 ` [PATCH v3 1/3] mtd: s3c2410: make ecc mode configurable via platform data Sergio Prado
2016-10-20 21:42 ` Sergio Prado
2016-10-21 18:27 ` Krzysztof Kozlowski
2016-10-21 18:27 ` Krzysztof Kozlowski
2016-10-21 18:51 ` Marek Vasut
2016-10-21 18:51 ` Marek Vasut
2016-10-21 18:51 ` Marek Vasut
2016-10-21 20:06 ` Krzysztof Kozlowski
2016-10-21 20:06 ` Krzysztof Kozlowski
2016-10-21 20:06 ` Krzysztof Kozlowski
2016-10-21 19:05 ` Sergio Prado
2016-10-21 19:05 ` Sergio Prado
2016-10-22 12:29 ` Boris Brezillon
2016-10-22 12:29 ` Boris Brezillon
2016-10-22 15:32 ` Krzysztof Kozlowski
2016-10-22 15:32 ` Krzysztof Kozlowski
2016-10-20 21:42 ` [PATCH v3 2/3] dt-bindings: mtd: add DT binding for s3c2410 flash controller Sergio Prado
2016-10-20 21:42 ` Sergio Prado
2016-10-26 23:19 ` Rob Herring
2016-10-26 23:19 ` Rob Herring
2016-10-20 21:42 ` [PATCH v3 3/3] mtd: s3c2410: parse the device configuration from OF node Sergio Prado
2016-10-20 21:42 ` Sergio Prado
2016-10-24 13:02 ` Boris Brezillon
2016-10-24 13:02 ` Boris Brezillon
2016-10-24 13:02 ` Boris Brezillon
2016-10-24 18:47 ` Sergio Prado [this message]
2016-10-24 18:47 ` Sergio Prado
2016-10-24 18:50 ` Boris Brezillon
2016-10-24 18:50 ` Boris Brezillon
2016-10-24 18:50 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161024184738.GA26671@sprado-desktop \
--to=sergio.prado@e-labworks.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=javier@osg.samsung.com \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@simtec.co.uk \
--cc=mark.rutland@arm.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.