From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Gilad Avidov <gavidov@codeaurora.org>,
Sagar Dharia <sdharia@codeaurora.org>
Subject: Re: [PATCH] spmi-pmic-arb: support configurable number of peripherals
Date: Tue, 15 Sep 2015 14:20:18 +0300 [thread overview]
Message-ID: <1442316018.15519.4.camel@mm-sol.com> (raw)
In-Reply-To: <55F77451.9070900@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]
On Mon, 2015-09-14 at 18:28 -0700, Stephen Boyd wrote:
> On 09/14/2015 02:54 PM, Stephen Boyd wrote:
> > The current driver implementation supports only 128 peripherals.
> > Add support for more than 128 peripherals by taking a lazy
> > caching approach to the mapping tables. Instead of reading the
> > tables at boot given some fixed size, read them on an as needed
> > basis and cache the results. We still assume a max number of 512
> > peripherals, trading off some space for simplicity.
> >
> > Based on a patch by Gilad Avidov <gavidov@codeaurora.org> and
> > Sagar Dharia <sdharia@codeaurora.org>.
> >
> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> > ---
>
> Hi Ivan,
>
> This patch causes 8916 to crash, because there isn't a mapping for ppid
> 257 in the ppid to channel table. It seems that we're reading the revid
> from the slave id 1 pmic by going through channel 0, which seems to be
> setup for ppid 9 (slave id 0 and the peripheral starting at 0x900). Can
> we stop reading the revid registers from non-zero slave id pmic devices?
> That would be one solution to fix this problem. Or maybe we need to
> special case this in the pmic arbiter code to fold ppid 0xN01 (slave id
> N and address 0x100) onto channel 0 all the time?
>
Yes, we can. We are not using this information at the moment.
Right now, revision read is more or less for debug purposes.
Would following patch work for you? Of course it will be difficult
to guaranties that some other driver misbehave and touch non-existing
register, right?
Regards,
Ivan
[-- Attachment #2: 0001-mfd-qcom-spmi-pmic-Do-not-access-non-existing-regist.patch --]
[-- Type: text/x-patch, Size: 1392 bytes --]
From d7c9c59b7134f093cf3f829832f4f7771a65664e Mon Sep 17 00:00:00 2001
From: "Ivan T. Ivanov" <ivan.ivanov@linaro.org>
Date: Tue, 15 Sep 2015 09:43:10 +0300
Subject: [PATCH] mfd: qcom-spmi-pmic: Do not access non existing registers
Cc: linux-kernel@vger.kernel.org
Revision ID registers are available only on devices with
Slave ID Zero, so don't make access to unavailable registers.
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
drivers/mfd/qcom-spmi-pmic.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c
index af6ac1c4b45c..d7ad72af5682 100644
--- a/drivers/mfd/qcom-spmi-pmic.c
+++ b/drivers/mfd/qcom-spmi-pmic.c
@@ -122,12 +122,22 @@ static int pmic_spmi_probe(struct spmi_device *sdev)
{
struct device_node *root = sdev->dev.of_node;
struct regmap *regmap;
+ u32 sid;
+ int ret;
+
+ ret = of_property_read_u32(root, "reg", &sid);
+ if (ret < 0) {
+ dev_err(&sdev->dev, "Missing SID\n");
+ return ret;
+ }
regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
- pmic_spmi_show_revid(regmap, &sdev->dev);
+ /* Only devices with Slave ID Zero contain this information */
+ if (sid == 0)
+ pmic_spmi_show_revid(regmap, &sdev->dev);
return of_platform_populate(root, NULL, NULL, &sdev->dev);
}
--
1.9.1
next prev parent reply other threads:[~2015-09-15 11:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 21:54 [PATCH] spmi-pmic-arb: support configurable number of peripherals Stephen Boyd
2015-09-15 1:28 ` Stephen Boyd
2015-09-15 11:20 ` Ivan T. Ivanov [this message]
2015-09-15 18:27 ` Stephen Boyd
2015-10-14 22:43 ` Stephen Boyd
2015-10-15 9:23 ` Ivan T. Ivanov
2015-10-15 18:24 ` Stephen Boyd
-- strict thread matches above, loose matches on Subject: below --
2015-09-03 23:20 Gilad Avidov
2015-09-04 0:16 ` Stephen Boyd
[not found] ` <20150904001630.GJ15099-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-09-04 18:04 ` Gilad Avidov
2015-09-05 0:50 ` Stephen Boyd
2015-09-09 23:32 ` Gilad Avidov
2015-09-10 0:30 ` Stephen Boyd
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=1442316018.15519.4.camel@mm-sol.com \
--to=iivanov@mm-sol.com \
--cc=gavidov@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.org \
--cc=sdharia@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).