devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: kgene@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com,
	"Chanwoo Choi" <cw00.choi@samsung.com>,
	myungjoo.ham@samsung.com,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	pankaj.dubey@samsung.com,
	"Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>
Subject: Re: [PATCH RFC 4/8] soc: samsung: Add Exynos Adaptive Supply Voltage driver
Date: Wed, 24 Apr 2019 10:20:29 +0200	[thread overview]
Message-ID: <CAJKOXPccFqZv6nopRThi1+G1-5LWtFQu53rDXcsO2QXu2DWtwA@mail.gmail.com> (raw)
In-Reply-To: <1d2238be-1758-2413-42f1-d571706de766@samsung.com>

On Wed, 24 Apr 2019 at 10:10, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
>
> On 4/23/19 12:50, Krzysztof Kozlowski wrote:
> >> +static int exynos5422_asv_get_table(void)
> >> +{
> >> +       unsigned int reg = exynos_chipid_read(EXYNOS_CHIPID_REG_PKG_ID);
> >
> > One more thought: you read this register multiple times in the same
> > function. I think it is not needed - just read once, store the value
> > and use the helpers to parse it.
>
> Yes, I have noticed that as well. I'm not sure though if it is worth
> to additionally cache registers manually like this when we use the
> regmap.  I have already converted that code to use the regmap API for
> v2.  And these are barely few registers reads at the driver
> initialization time, not any hot path.

By default regmap does not use caching so there is no benefit out of
it. In the same time reading with regmap involves its layer of
abstraction with locks, indirect calls etc... I agree that there is no
point for implementing specific "caching" but with the same code
readability/simplicity you can have it without multiple regmap
accesses one after another. Consider this:
    unsigned int pkgid = exynos_chipid_read(EXYNOS_CHIPID_REG_PKG_ID);
    asv->table = exynos5422_asv_get_table(pkgid);
    asv->is_bin2 = exynos5422_asv_check_bin2(pkgid);
(and probably renaming the helpers)
The code is equivalent. The same readability.

Best regards,
Krzysztof

  reply	other threads:[~2019-04-24  8:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190404172220epcas1p3a6a8d843780321c4914a63d589c56b33@epcas1p3.samsung.com>
2019-04-04 17:17 ` [PATCH RFC 0/8] Exynos Adaptive Supply Voltage support Sylwester Nawrocki
     [not found]   ` <CGME20190404172224epcas2p21b449c0ae8e36f7e800ae67c18db35a2@epcas2p2.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 1/8] soc: samsung: Add exynos chipid driver support Sylwester Nawrocki
2019-04-05  6:53       ` Krzysztof Kozlowski
2019-04-05  8:49         ` Sylwester Nawrocki
     [not found]   ` <CGME20190404172229epcas2p25a819e37035b26ccf53613e880bdcacf@epcas2p2.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 2/8] soc: samsung: Exynos chipid driver update Sylwester Nawrocki
2019-04-05  9:22       ` Krzysztof Kozlowski
2019-04-05 10:04         ` Sylwester Nawrocki
     [not found]   ` <CGME20190404172234epcas1p37667ec0996000aff9297f13639908dfc@epcas1p3.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 3/8] dt-bindings: exynos: Add ASV tables binding documentation Sylwester Nawrocki
2019-04-29 17:23       ` Rob Herring
2019-07-18 14:02         ` Sylwester Nawrocki
     [not found]   ` <CGME20190404172238epcas2p21ef28f46b728127dcd6e8ee72752a1b8@epcas2p2.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 4/8] soc: samsung: Add Exynos Adaptive Supply Voltage driver Sylwester Nawrocki
2019-04-05 10:24       ` Krzysztof Kozlowski
2019-04-09 17:40         ` Sylwester Nawrocki
2019-04-23 10:50       ` Krzysztof Kozlowski
2019-04-24  8:11         ` Sylwester Nawrocki
2019-04-24  8:20           ` Krzysztof Kozlowski [this message]
     [not found]   ` <CGME20190404172243epcas1p39af2498a51772ee4ab2a31f26e469c5b@epcas1p3.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 5/8] ARM: EXYNOS: enable exynos_chipid for ARCH_EXYNOS Sylwester Nawrocki
     [not found]   ` <CGME20190404172247epcas2p2d24f19f76db3cee177bd5b9df783eb3b@epcas2p2.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 6/8] ARM64: " Sylwester Nawrocki
     [not found]   ` <CGME20190404172252epcas2p284b7e2e9e7102f6f95c982d547ed9d64@epcas2p2.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 7/8] ARM: EXYNOS: Enable exynos-asv driver " Sylwester Nawrocki
     [not found]   ` <CGME20190404172257epcas1p20d789242a2353dc8e9ffd7f435dc5eee@epcas1p2.samsung.com>
2019-04-04 17:17     ` [PATCH RFC 8/8] ARM: dts: exynos: Add ASV tables for exynos5422/5800 Sylwester Nawrocki
2019-04-11  7:39       ` Anand Moon
2019-04-11  8:50         ` Willy Wolff

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=CAJKOXPccFqZv6nopRThi1+G1-5LWtFQu53rDXcsO2QXu2DWtwA@mail.gmail.com \
    --to=krzk@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=pankaj.dubey@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).