* [PATCH] spmi: pmic-arb: Enforce the ownership check optionally
@ 2017-08-18 11:54 Kiran Gunda
2017-08-18 13:20 ` Shawn Guo
0 siblings, 1 reply; 2+ messages in thread
From: Kiran Gunda @ 2017-08-18 11:54 UTC (permalink / raw)
To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ, Rob Herring, Mark Rutland,
Kiran Gunda, Abhijeet Dharmapurikar, David Collins,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: shawnguo-DgEjT+Ai2ygdnm+yROfE0A,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
linux-arm-msm-owner-u79uwXL29TY76Z2rM5mHXA
The peripheral ownership check is not necessary on single master
platforms. Hence, enforce the peripheral ownership check optioanlly.
Signed-off-by: Kiran Gunda <kgunda-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
---
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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spmi: pmic-arb: Enforce the ownership check optionally
2017-08-18 11:54 [PATCH] spmi: pmic-arb: Enforce the ownership check optionally Kiran Gunda
@ 2017-08-18 13:20 ` Shawn Guo
0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2017-08-18 13:20 UTC (permalink / raw)
To: Kiran Gunda
Cc: gregkh, sboyd, Rob Herring, Mark Rutland, Abhijeet Dharmapurikar,
David Collins, devicetree, linux-kernel, linux-arm-msm,
linux-arm-msm-owner
On Fri, Aug 18, 2017 at 05:24:36PM +0530, Kiran Gunda wrote:
> The peripheral ownership check is not necessary on single master
> platforms. Hence, enforce the peripheral ownership check optioanlly.
>
> Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Tested-by: Shawn Guo <shawnguo@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-18 13:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 11:54 [PATCH] spmi: pmic-arb: Enforce the ownership check optionally Kiran Gunda
2017-08-18 13:20 ` Shawn Guo
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).