The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Bjorn Andersson <andersson@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mukesh Ojha <quic_mojha@quicinc.com>,
	agross@kernel.org, konrad.dybcio@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v3 2/5] pinctrl: qcom: Use qcom_scm_io_update_field()
Date: Sun, 19 Mar 2023 21:10:19 -0700	[thread overview]
Message-ID: <20230320041019.5qs6qbztvv45pacs@ripper> (raw)
In-Reply-To: <CACRpkdbA27buNiOTz6ad4gyS4FCvcoYru6QB5k9Lqwiu72sf9g@mail.gmail.com>

On Fri, Mar 17, 2023 at 09:58:04PM +0100, Linus Walleij wrote:
> On Fri, Mar 17, 2023 at 5:28 PM Mukesh Ojha <quic_mojha@quicinc.com> wrote:
> 
> > Use qcom_scm_io_update_field() exported function introduced
> > in last commit.
> >
> > Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> 
> Fine by me, but I want you to first consider switching the
> custom register accessors to regmap.
> 

I took a quick look at it and there seem to be two ways that it can be
done.

We can retain the MSM_ACCESSOR() macros that generates the custom
register accessors, but plug in a regmap between these accessors and the
mmio operations. But this just adds a few extra hops inbetween the
driver and the volatile read/write, with a slight increase of memory,
without any obvious benefits.


The more alluring alternative is to replace the custom accessors with
reg_fields. This would allow us to replace some (perhaps many) of the
bit-manipulation with regmap_update_bits().

But at minimum we'd need one reg_field per register, per pin, so that's
5 reg_fields per pin which adds up to ~10-24kb extra space, depending on
platform.

Even more alluring would be to have reg_fields describing the actual
fields in the registers, which would allow us to better utilize the
regmap API directly. This would cost us 35-75kb of heap.

IMHO this is quite a significant effort, and given that the driver seems
to be doing its job I'd rather see such efforts being focused elsewhere.

Regards,
Bjorn

  reply	other threads:[~2023-03-20  4:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 16:27 [PATCH v3 0/5] Refactor to support multiple download mode Mukesh Ojha
2023-03-17 16:27 ` [PATCH v3 1/5] firmware: qcom_scm: provide a read-modify-write function Mukesh Ojha
2023-03-17 16:52   ` Mukesh Ojha
2023-03-17 20:56   ` Linus Walleij
2023-03-20  3:22     ` Bjorn Andersson
2023-03-20  8:54       ` Linus Walleij
2023-03-20 17:35   ` Srinivas Kandagatla
2023-03-17 16:27 ` [PATCH v3 2/5] pinctrl: qcom: Use qcom_scm_io_update_field() Mukesh Ojha
2023-03-17 20:58   ` Linus Walleij
2023-03-20  4:10     ` Bjorn Andersson [this message]
2023-03-20  8:59       ` Linus Walleij
2023-03-17 16:28 ` [PATCH v3 3/5] firmware: scm: Modify only the download bits in TCSR register Mukesh Ojha
2023-03-17 16:28 ` [PATCH v3 4/5] firmware: qcom_scm: Refactor code to support multiple download mode Mukesh Ojha
2023-03-17 16:28 ` [PATCH v3 5/5] firmware: qcom_scm: Add multiple download mode support Mukesh Ojha

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=20230320041019.5qs6qbztvv45pacs@ripper \
    --to=andersson@kernel.org \
    --cc=agross@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_mojha@quicinc.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