lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqLWxbmWEiE4qxBPK+4KHoBKP+s-7Ubg6ef6GdR9NMaDjQ@mail.gmail.com>
Date:	Wed, 7 May 2014 13:35:54 -0500
From:	Rob Herring <robherring2@...il.com>
To:	"Ivan T. Ivanov" <iivanov@...sol.com>,
	Frank Rowand <frowand.list@...il.com>
Cc:	Courtney Cavin <courtney.cavin@...ymobile.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Lee Jones <lee.jones@...aro.org>,
	Josh Cartwright <joshc@...eaurora.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	linux-arm-msm <linux-arm-msm@...r.kernel.org>,
	Bjorn Andersson <bjorn@...o.se>
Subject: Re: [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs

On Wed, Apr 23, 2014 at 8:19 AM, Ivan T. Ivanov <iivanov@...sol.com> wrote:
>
> Hi,
>
> On Tue, 2014-04-22 at 17:31 -0700, Courtney Cavin wrote:
>> From: Josh Cartwright <joshc@...eaurora.org>
>>
>> The Qualcomm 8941 and 8841 PMICs are components used with the Snapdragon
>> 800 series SoC family.  This driver exists largely as a glue mfd component,
>> it exists to be an owner of an SPMI regmap for children devices
>> described in device tree.
>>
>
> Thanks. This is exactly what I have planed to do :-)
>
>> Signed-off-by: Josh Cartwright <joshc@...eaurora.org>
>> Signed-off-by: Courtney Cavin <courtney.cavin@...ymobile.com>
>> ---
>>  drivers/mfd/Kconfig  | 13 +++++++++++
>>  drivers/mfd/Makefile |  1 +
>>  drivers/mfd/pm8x41.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 77 insertions(+)
>>  create mode 100644 drivers/mfd/pm8x41.c
>>
>
> <snip>
>
>> +
>> +static int pm8x41_probe(struct spmi_device *sdev)
>> +{
>> +     struct regmap *regmap;
>> +
>> +     regmap = devm_regmap_init_spmi_ext(sdev, &pm8x41_regmap_config);
>> +     if (IS_ERR(regmap)) {
>> +             dev_dbg(&sdev->dev, "regmap creation failed.\n");
>> +             return PTR_ERR(regmap);
>> +     }
>> +
>> +     return of_platform_populate(sdev->dev.of_node, NULL, NULL, &sdev->dev);
>
> I think that this will not going to work. For example in this particular
> case, both controllers have "qcom,qpnp-revid" peripheral which is
> located at offset 0x100.
>
> And the result is:
>
> [    0.963944] sysfs: cannot create duplicate filename '/bus/platform/devices/100.revid'
>
> DT looks like this:
>
> spmi {
>         compatible = "qcom,spmi-pmic-arb";
>         reg-names = "core", "intr", "cnfg";
>         reg = <0xfc4cf000 0x1000>,
>               <0xfc4cb000 0x1000>,
>               <0xfc4ca000 0x1000>;
>
>         interrupt-names = "periph_irq";
>         interrupts = <0 190 0>;
>
>         qcom,ee = <0>;
>         qcom,channel = <0>;
>
>         #address-cells = <2>;
>         #size-cells = <0>;
>
>         interrupt-controller;
>         #interrupt-cells = <4>;
>
>         pm8941@0 {
>                 compatible = "qcom,pm8941";
>                 reg = <0x0 SPMI_USID>;
>
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>
>                 revid@100 {
>                         compatible = "qcom,qpnp-revid";
>                         reg = <0x100 0x100>;
>                 };
>         };
>
>         pm8841@4 {
>                 compatible = "qcom,pm8941";
>                 reg = <0x4 SPMI_USID>;
>
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>
>                 revid@100 {
>                         compatible = "qcom,qpnp-revid";
>                         reg = <0x100 0x100>;
>                 };
>         };
> };
>

I've created a similar test case, but do not reproduce the duplicate
name issue. In my test, the lack of ranges property causes translation
to fail so devices are named dev.N. The above should have similar
behavior.1

Here's the test case:

/ {
        testcase-data {
                platform-tests {
                        #address-cells = <1>;
                        #size-cells = <1>;

                        test-device@0 {
                                compatible = "test-device";
                                reg = <0x0 0>;

                                #address-cells = <1>;
                                #size-cells = <1>;

                                dev@100 {
                                        compatible = "test-sub-device";
                                        reg = <0x100 0x100>;
                                };
                        };

                        test-device@1 {
                                compatible = "test-device";
                                reg = <0x1 0>;

                                #address-cells = <1>;
                                #size-cells = <1>;

                                dev@100 {
                                        compatible = "test-sub-device";
                                        reg = <0x100 0x100>;
                                };
                        };
                };
        };
};


Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ