From: Kiran Gunda <kgunda@codeaurora.org>
To: gregkh@linuxfoundation.org, sboyd@codeaurora.org,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Kiran Gunda <kgunda@codeaurora.org>,
Abhijeet Dharmapurikar <adharmap@codeaurora.org>,
David Collins <collinsd@codeaurora.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: shawnguo@kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-msm-owner@vger.kernel.org
Subject: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally
Date: Fri, 18 Aug 2017 20:58:29 +0530 [thread overview]
Message-ID: <1503070110-15018-1-git-send-email-kgunda@codeaurora.org> (raw)
The peripheral ownership check is not necessary on single master
platforms. Hence, enforce the peripheral ownership check optionally.
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Tested-by: Shawn Guo <shawnguo@kernel.org>
---
v2:
Fixed the commit message.
Added Shawn's 'Tested-by' tag.
v1:
This patch depends on the below patch series. Please take this patch
along with this series.
[PATCH V2 00/12]: spmi: pmic-arb: Support for HW v5 and other fixes
Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt | 6 ++++++
drivers/spmi/spmi-pmic-arb.c | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt b/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt
index e16b9b5..da708e8 100644
--- a/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt
+++ b/Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt
@@ -42,6 +42,10 @@ Required properties:
cell 4: interrupt flags indicating level-sense information, as defined in
dt-bindings/interrupt-controller/irq.h
+Optional properties:
+- qcom,enforce-ownership : A boolean property. If defined the peripheral
+ ownership check is enforced. Otherwise the ownership
+ check is ignored.
Example:
spmi {
@@ -62,4 +66,6 @@ Example:
interrupt-controller;
#interrupt-cells = <4>;
+
+ qcom,enforce-ownership;
};
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index ca9bdd3..354c949 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -167,6 +167,7 @@ struct spmi_pmic_arb {
u16 *ppid_to_apid;
u16 last_apid;
struct apid_data apid_data[PMIC_ARB_MAX_PERIPHS];
+ bool enforce_ownership;
};
/**
@@ -707,7 +708,8 @@ static int qpnpint_irq_domain_dt_translate(struct irq_domain *d,
}
apid = rc;
- if (pmic_arb->apid_data[apid].irq_ee != pmic_arb->ee) {
+ if (pmic_arb->enforce_ownership &&
+ pmic_arb->apid_data[apid].irq_ee != pmic_arb->ee) {
dev_err(&pmic_arb->spmic->dev, "failed to xlate sid = %#x, periph = %#x, irq = %u: ee=%u but owner=%u\n",
intspec[0], intspec[1], intspec[2], pmic_arb->ee,
pmic_arb->apid_data[apid].irq_ee);
@@ -1236,6 +1238,9 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
}
pmic_arb->ee = ee;
+ pmic_arb->enforce_ownership =
+ of_property_read_bool(pdev->dev.of_node, "qcom,enforce-ownership");
+
mapping_table = devm_kcalloc(&ctrl->dev, PMIC_ARB_MAX_PERIPHS,
sizeof(*mapping_table), GFP_KERNEL);
if (!mapping_table) {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next reply other threads:[~2017-08-18 15:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 15:28 Kiran Gunda [this message]
[not found] ` <1503070110-15018-1-git-send-email-kgunda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-08-21 23:18 ` [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Stephen Boyd
2017-08-22 8:55 ` Shawn Guo
2017-08-22 20:31 ` Stephen Boyd
2017-08-23 12:57 ` kgunda
2017-08-24 12:18 ` Shawn Guo
2017-08-24 18:37 ` Stephen Boyd
2017-08-25 7:47 ` Shawn Guo
2017-08-25 23:18 ` Stephen Boyd
[not found] ` <20170825231818.GP21656-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-08-26 3:46 ` Shawn Guo
2017-08-30 21:02 ` Stephen Boyd
2017-08-31 8:37 ` Shawn Guo
2017-09-01 1:30 ` Stephen Boyd
[not found] ` <20170901013048.GK21656-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-09-01 3:00 ` Shawn Guo
2017-08-28 8:27 ` Fenglin Wu
[not found] ` <93b8935e-061f-ba3a-ee36-8ffbc8230bcc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-08-28 14:47 ` Shawn Guo
2017-08-22 9:01 ` Shawn Guo
2017-08-28 11:53 ` Greg KH
2017-08-28 14:08 ` Shawn Guo
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=1503070110-15018-1-git-send-email-kgunda@codeaurora.org \
--to=kgunda@codeaurora.org \
--cc=adharmap@codeaurora.org \
--cc=collinsd@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm-owner@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=shawnguo@kernel.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).