From: Amit Kucheria <amit.kucheria@linaro.org>
To: Doug Anderson <dianders@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Rajendra Nayak <rnayak@codeaurora.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Eduardo Valentin <edubezval@gmail.com>,
smohanad@codeaurora.org,
Vivek Gautam <vivek.gautam@codeaurora.org>,
Andy Gross <andy.gross@linaro.org>,
Zhang Rui <rui.zhang@intel.com>,
Linux PM list <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v6 2/7] thermal: tsens: Add support to split up register address space into two
Date: Thu, 12 Jul 2018 10:10:34 +0530 [thread overview]
Message-ID: <CAHLCerNcoXuDi0MF5q8fzmegMZfGwAxSkv4czndVa0a-ov6ZVg@mail.gmail.com> (raw)
In-Reply-To: <CAD=FV=UGjf+qSfzYbQ1OEydEWJH2e8vhNiOPAytPH_rnkabq3Q@mail.gmail.com>
On Thu, Jul 12, 2018 at 12:07 AM, Doug Anderson <dianders@chromium.org> wrote:
> Hi,
>
> On Mon, Jul 9, 2018 at 4:43 AM, Amit Kucheria <amit.kucheria@linaro.org> wrote:
>> There are two banks of registers for v2 TSENS IPs: SROT and TM. On older
>> SoCs these were contiguous, leading to DTs mapping them as one register
>> address space of size 0x2000. In newer SoCs, these two banks are not
>> contiguous anymore.
>>
>> Fixing old DTs to split the address space into allows us to have cleaner
>> common code e.g. get_temp() that is shared across new and old platforms.
>
> This makes it sound like old DTs won't be supported anymore. ...but
> the code says otherwise. I'd just remove the above paragraph.
OK.
>
>> @@ -126,11 +127,21 @@ static const struct regmap_config tsens_config = {
>> int __init init_common(struct tsens_device *tmdev)
>> {
>> void __iomem *base;
>> + struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node);
>>
>> + if (!op)
>> + return -EINVAL;
>> base = of_iomap(tmdev->dev->of_node, 0);
>> if (!base)
>> return -EINVAL;
>>
>> + if (op->num_resources > 1) {
>
> Maybe add a comment here that says that we don't actually map the SROT
> yet because you don't read anything from there? I kept getting
> confused about how this patch could possibly work with no code to map
> SROT...
OK. The SROT comment got separated (patch 3) during patch refactoring.
Will add a comment.
>> + tmdev->tm_offset = 0;
>> + } else {
>> + /* old DTs where SROT and TM were in a contiguous 2K block */
>> + tmdev->tm_offset = 0x1000;
>
> This patch without patch #4 will break compatibility. You should
> squash part of patch #4 into this one, specifically:
>
> -#define STATUS_OFFSET 0x10a0
> -#define LAST_TEMP_MASK 0xfff
> +#define STATUS_OFFSET 0xa0
> +#define LAST_TEMP_MASK 0xfff
>
> Without that you break bisect-ability and also confuse anyone trying
> to look at this patch.
Thanks. Will fix.
next prev parent reply other threads:[~2018-07-12 4:40 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 11:43 [PATCH v6 0/7] thermal: tsens: Refactoring for TSENSv2 IP Amit Kucheria
2018-07-09 11:43 ` [PATCH v6 1/7] thermal: tsens: Get rid of unused fields in structure Amit Kucheria
2018-07-09 11:43 ` [PATCH v6 2/7] thermal: tsens: Add support to split up register address space into two Amit Kucheria
2018-07-11 16:34 ` Bjorn Andersson
2018-07-11 18:37 ` Doug Anderson
2018-07-12 4:40 ` Amit Kucheria [this message]
2018-07-09 11:43 ` [PATCH v6 3/7] dt: qcom: 8996: thermal: Move to DT initialisation Amit Kucheria
2018-07-11 16:37 ` Bjorn Andersson
2018-07-11 18:39 ` Doug Anderson
2018-07-12 5:03 ` Amit Kucheria
2018-07-09 11:43 ` [PATCH v6 4/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse Amit Kucheria
2018-07-11 16:39 ` Bjorn Andersson
2018-07-09 11:43 ` [PATCH v6 5/7] thermal: tsens: Add generic support for TSENS v2 IP Amit Kucheria
2018-07-11 16:40 ` Bjorn Andersson
2018-07-11 18:40 ` Doug Anderson
2018-07-12 5:12 ` Amit Kucheria
2018-07-09 11:43 ` [PATCH v6 6/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP Amit Kucheria
2018-07-11 13:49 ` Rob Herring
2018-07-11 16:42 ` Bjorn Andersson
2018-07-11 18:42 ` Doug Anderson
2018-07-12 5:56 ` Amit Kucheria
2018-07-09 11:43 ` [PATCH v6 7/7] arm64: dts: sdm845: Add tsens nodes Amit Kucheria
2018-07-11 16:41 ` Bjorn Andersson
2018-07-11 18:44 ` Doug Anderson
2018-07-11 21:51 ` Matthias Kaehlcke
2018-07-11 22:00 ` Doug Anderson
2018-07-12 5:36 ` Amit Kucheria
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=CAHLCerNcoXuDi0MF5q8fzmegMZfGwAxSkv4czndVa0a-ov6ZVg@mail.gmail.com \
--to=amit.kucheria@linaro.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=dianders@chromium.org \
--cc=edubezval@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rnayak@codeaurora.org \
--cc=rui.zhang@intel.com \
--cc=smohanad@codeaurora.org \
--cc=vivek.gautam@codeaurora.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 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).