LKML Archive on lore.kernel.org
 help / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
						download: 
* [PATCH v3 6/6] remoteproc: qcom: q6v5-pil: Add PDC reset for modem on SDM845 SoCs
      [irrelevant] <20180829191215.10071-1-sibis@codeaurora.org>
@ 2018-08-29 19:12 ` Sibi Sankar
      [irrelevant] ` <20180829191215.10071-3-sibis@codeaurora.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-08-29 19:12 UTC (permalink / raw)
  To: bjorn.andersson, p.zabel, mka, robh+dt
  Cc: linux-kernel, devicetree, mark.rutland, linux-arm-msm, tsoni,
	Sibi Sankar

In the presence of a PDC block working with subsystem RSC, assert/deassert
PDC reset in modem start/stop path.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_pil.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index 968413edf0c8..835fa005fe3e 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -149,6 +149,7 @@ struct q6v5 {
 	u32 halt_nc;
 
 	struct reset_control *mss_restart;
+	struct reset_control *pdc_reset;
 
 	struct qcom_q6v5 q6v5;
 
@@ -349,10 +350,17 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
 
 static int q6v5_reset_assert(struct q6v5 *qproc)
 {
-	if (qproc->has_alt_reset)
-		return reset_control_reset(qproc->mss_restart);
-	else
-		return reset_control_assert(qproc->mss_restart);
+	int ret;
+
+	if (qproc->has_alt_reset) {
+		reset_control_assert(qproc->pdc_reset);
+		ret = reset_control_reset(qproc->mss_restart);
+		reset_control_deassert(qproc->pdc_reset);
+	} else {
+		ret = reset_control_assert(qproc->mss_restart);
+	}
+
+	return ret;
 }
 
 static int q6v5_reset_deassert(struct q6v5 *qproc)
@@ -360,9 +368,11 @@ static int q6v5_reset_deassert(struct q6v5 *qproc)
 	int ret;
 
 	if (qproc->has_alt_reset) {
+		reset_control_assert(qproc->pdc_reset);
 		writel(1, qproc->rmb_base + RMB_MBA_ALT_RESET);
 		ret = reset_control_reset(qproc->mss_restart);
 		writel(0, qproc->rmb_base + RMB_MBA_ALT_RESET);
+		reset_control_deassert(qproc->pdc_reset);
 	} else {
 		ret = reset_control_deassert(qproc->mss_restart);
 	}
@@ -1183,6 +1193,15 @@ static int q6v5_init_reset(struct q6v5 *qproc)
 		return PTR_ERR(qproc->mss_restart);
 	}
 
+	if (qproc->has_alt_reset) {
+		qproc->pdc_reset = devm_reset_control_get_exclusive(qproc->dev,
+								"pdc_reset");
+		if (IS_ERR(qproc->pdc_reset)) {
+			dev_err(qproc->dev, "failed to acquire pdc reset\n");
+			return PTR_ERR(qproc->pdc_reset);
+		}
+	}
+
 	return 0;
 }
 
@@ -1303,12 +1322,12 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	qproc->has_alt_reset = desc->has_alt_reset;
 	ret = q6v5_init_reset(qproc);
 	if (ret)
 		goto free_rproc;
 
 	qproc->version = desc->version;
-	qproc->has_alt_reset = desc->has_alt_reset;
 	qproc->need_mem_protection = desc->need_mem_protection;
 
 	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH] arm64: dts: qcom: Add AOSS reset driver node for SDM845
@ 2018-09-01 22:23 Bjorn Andersson
  2018-09-06 16:00 ` Doug Anderson
  0 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-09-01 22:23 UTC (permalink / raw)
  To: Andy Gross, David Brown
  Cc: Rob Herring, Mark Rutland, linux-arm-msm, linux-soc, devicetree,
	linux-kernel

From: Sibi Sankar <sibis@codeaurora.org>

This patch adds the node to support AOSS reset driver on
SDM845

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
[bjorn: Updated addresses to match the binding that was merged]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 0c9a2aa6a1b5..077760792cf0 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -9,6 +9,7 @@
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>
+#include <dt-bindings/reset/qcom,sdm845-aoss.h>
 
 / {
 	interrupt-parent = <&intc>;
@@ -978,6 +979,12 @@
 			#thermal-sensor-cells = <1>;
 		};
 
+		aoss_reset: reset-controller@c2a0000 {
+			compatible = "qcom,sdm845-aoss-cc";
+			reg = <0xc2a0000 0x31000>;
+			#reset-cells = <1>;
+		};
+
 		spmi_bus: spmi@c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0xc440000 0x1100>,
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* Re: [PATCH v3 2/6] reset: qcom: PDC Global (Power Domain Controller) reset controller
      [irrelevant] ` <20180829191215.10071-3-sibis@codeaurora.org>
@ 2018-09-03 19:31   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-09-03 19:31 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: p.zabel, mka, robh+dt, linux-kernel, devicetree, mark.rutland,
	linux-arm-msm, tsoni

On Wed 29 Aug 12:12 PDT 2018, Sibi Sankar wrote:

> Add reset controller for SDM845 SoCs to control reset signals provided
> by PDC Global for Modem, Compute, Display, GPU, Debug, AOP, Sensors,
> Audio, SP and APPS
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/reset/Kconfig          |   9 +++
>  drivers/reset/Makefile         |   1 +
>  drivers/reset/reset-qcom-pdc.c | 124 +++++++++++++++++++++++++++++++++
>  3 files changed, 134 insertions(+)
>  create mode 100644 drivers/reset/reset-qcom-pdc.c
> 
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index 13d28fdbdbb5..c21da9fe51ec 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -98,6 +98,15 @@ config RESET_QCOM_AOSS
>  	  reset signals provided by AOSS for Modem, Venus, ADSP,
>  	  GPU, Camera, Wireless, Display subsystem. Otherwise, say N.
>  
> +config RESET_QCOM_PDC
> +	tristate "Qualcomm PDC Reset Driver"
> +	depends on ARCH_QCOM || COMPILE_TEST
> +	help
> +	  This enables the PDC (Power Domain Controller) reset driver
> +	  for Qualcomm Technologies Inc SDM845 SoCs. Say Y if you want
> +	  to control reset signals provided by PDC for Modem, Compute,
> +	  Display, GPU, Debug, AOP, Sensors, Audio, SP and APPS.
> +
>  config RESET_SIMPLE
>  	bool "Simple Reset Controller Driver" if COMPILE_TEST
>  	default ARCH_SOCFPGA || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARCH_ASPEED
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index 4243c38228e2..d08e8b90046a 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -16,6 +16,7 @@ obj-$(CONFIG_RESET_MESON_AUDIO_ARB) += reset-meson-audio-arb.o
>  obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o
>  obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o
>  obj-$(CONFIG_RESET_QCOM_AOSS) += reset-qcom-aoss.o
> +obj-$(CONFIG_RESET_QCOM_PDC) += reset-qcom-pdc.o
>  obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
>  obj-$(CONFIG_RESET_STM32MP157) += reset-stm32mp1.o
>  obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
> diff --git a/drivers/reset/reset-qcom-pdc.c b/drivers/reset/reset-qcom-pdc.c
> new file mode 100644
> index 000000000000..ab74bccd4a5b
> --- /dev/null
> +++ b/drivers/reset/reset-qcom-pdc.c
> @@ -0,0 +1,124 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2018 The Linux Foundation. All rights reserved.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/reset-controller.h>
> +
> +#include <dt-bindings/reset/qcom,sdm845-pdc.h>
> +
> +#define RPMH_PDC_SYNC_RESET	0x100
> +
> +struct qcom_pdc_reset_map {
> +	u8 bit;
> +};
> +
> +struct qcom_pdc_reset_data {
> +	struct reset_controller_dev rcdev;
> +	struct regmap *regmap;
> +};
> +
> +static const struct regmap_config sdm845_pdc_regmap_config = {
> +	.name		= "pdc-reset",
> +	.reg_bits	= 32,
> +	.reg_stride	= 4,
> +	.val_bits	= 32,
> +	.max_register	= 0x20000,
> +	.fast_io	= true,
> +};
> +
> +static const struct qcom_pdc_reset_map sdm845_pdc_resets[] = {
> +	[PDC_APPS_SYNC_RESET] = {0},
> +	[PDC_SP_SYNC_RESET] = {1},
> +	[PDC_AUDIO_SYNC_RESET] = {2},
> +	[PDC_SENSORS_SYNC_RESET] = {3},
> +	[PDC_AOP_SYNC_RESET] = {4},
> +	[PDC_DEBUG_SYNC_RESET] = {5},
> +	[PDC_GPU_SYNC_RESET] = {6},
> +	[PDC_DISPLAY_SYNC_RESET] = {7},
> +	[PDC_COMPUTE_SYNC_RESET] = {8},
> +	[PDC_MODEM_SYNC_RESET] = {9},
> +};
> +
> +static inline struct qcom_pdc_reset_data *to_qcom_pdc_reset_data(
> +				struct reset_controller_dev *rcdev)
> +{
> +	return container_of(rcdev, struct qcom_pdc_reset_data, rcdev);
> +}
> +
> +static int qcom_pdc_control_assert(struct reset_controller_dev *rcdev,
> +					unsigned long idx)
> +{
> +	struct qcom_pdc_reset_data *data = to_qcom_pdc_reset_data(rcdev);
> +
> +	return regmap_update_bits(data->regmap, RPMH_PDC_SYNC_RESET,
> +				  BIT(sdm845_pdc_resets[idx].bit),
> +				  BIT(sdm845_pdc_resets[idx].bit));
> +}
> +
> +static int qcom_pdc_control_deassert(struct reset_controller_dev *rcdev,
> +					unsigned long idx)
> +{
> +	struct qcom_pdc_reset_data *data = to_qcom_pdc_reset_data(rcdev);
> +
> +	return regmap_update_bits(data->regmap, RPMH_PDC_SYNC_RESET,
> +				  BIT(sdm845_pdc_resets[idx].bit), 0);
> +}
> +
> +static const struct reset_control_ops qcom_pdc_reset_ops = {
> +	.assert = qcom_pdc_control_assert,
> +	.deassert = qcom_pdc_control_deassert,
> +};
> +
> +static int qcom_pdc_reset_probe(struct platform_device *pdev)
> +{
> +	struct qcom_pdc_reset_data *data;
> +	struct device *dev = &pdev->dev;
> +	void __iomem *base;
> +	struct resource *res;
> +
> +	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	base = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
> +
> +	data->regmap = devm_regmap_init_mmio(dev, base,
> +					     &sdm845_pdc_regmap_config);
> +	if (IS_ERR(data->regmap)) {
> +		dev_err(dev, "Unable to initialize regmap\n");
> +		return PTR_ERR(data->regmap);
> +	}
> +
> +	data->rcdev.owner = THIS_MODULE;
> +	data->rcdev.ops = &qcom_pdc_reset_ops;
> +	data->rcdev.nr_resets = ARRAY_SIZE(sdm845_pdc_resets);
> +	data->rcdev.of_node = dev->of_node;
> +
> +	return devm_reset_controller_register(dev, &data->rcdev);
> +}
> +
> +static const struct of_device_id qcom_pdc_reset_of_match[] = {
> +	{ .compatible = "qcom,sdm845-pdc-global" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, qcom_pdc_reset_of_match);
> +
> +static struct platform_driver qcom_pdc_reset_driver = {
> +	.probe = qcom_pdc_reset_probe,
> +	.driver = {
> +		.name = "qcom_pdc_reset",
> +		.of_match_table = qcom_pdc_reset_of_match,
> +	},
> +};
> +module_platform_driver(qcom_pdc_reset_driver);
> +
> +MODULE_DESCRIPTION("Qualcomm PDC Reset Driver");
> +MODULE_LICENSE("GPL v2");
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 3/6] dt-bindings: remoteproc: qcom: Remove additional definition tag
      [irrelevant] ` <20180829191215.10071-4-sibis@codeaurora.org>
@ 2018-09-03 19:32   ` Bjorn Andersson
  2018-09-10 18:28   ` Rob Herring
  1 sibling, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-09-03 19:32 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: p.zabel, mka, robh+dt, linux-kernel, devicetree, mark.rutland,
	linux-arm-msm, tsoni

On Wed 29 Aug 12:12 PDT 2018, Sibi Sankar wrote:

> Remove the additional definition tag declared for WCSS sub-system
> under reset-names.
> 
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 601dd9f389aa..3a66cde5895a 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -58,8 +58,8 @@ on the Qualcomm Hexagon core.
>  	Usage: required
>  	Value type: <stringlist>
>  	Definition: must be "mss_restart" for the modem sub-system
> -	Definition: must be "wcss_aon_reset", "wcss_reset", "wcss_q6_reset"
> -		    for the wcss syb-system
> +		    must be "wcss_aon_reset", "wcss_reset", "wcss_q6_reset"
> +		    for the wcss sub-system
>  
>  - cx-supply:
>  - mss-supply:
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: Add AOSS reset driver node for SDM845
  2018-09-01 22:23 [PATCH] arm64: dts: qcom: Add AOSS reset driver node for SDM845 Bjorn Andersson
@ 2018-09-06 16:00 ` Doug Anderson
  0 siblings, 0 replies; 200+ results
From: Doug Anderson @ 2018-09-06 16:00 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML

Hi,

On Sat, Sep 1, 2018 at 3:23 PM, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
> From: Sibi Sankar <sibis@codeaurora.org>
>
> This patch adds the node to support AOSS reset driver on
> SDM845
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> [bjorn: Updated addresses to match the binding that was merged]
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 0c9a2aa6a1b5..077760792cf0 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -9,6 +9,7 @@
>  #include <dt-bindings/clock/qcom,rpmh.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>  #include <dt-bindings/soc/qcom,rpmh-rsc.h>
> +#include <dt-bindings/reset/qcom,sdm845-aoss.h>

nit: please sort alphabetically.  "reset" comes before "soc"

...other than that this looks sane to me.  Feel free to add my Reviewed-by tag.


-Doug

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 3/6] dt-bindings: remoteproc: qcom: Remove additional definition tag
      [irrelevant] ` <20180829191215.10071-4-sibis@codeaurora.org>
  2018-09-03 19:32   ` [PATCH v3 3/6] dt-bindings: remoteproc: qcom: Remove additional definition tag Bjorn Andersson
@ 2018-09-10 18:28   ` Rob Herring
  1 sibling, 0 replies; 200+ results
From: Rob Herring @ 2018-09-10 18:28 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, p.zabel, mka, robh+dt, linux-kernel, devicetree,
	mark.rutland, linux-arm-msm, tsoni, Sibi Sankar

On Thu, 30 Aug 2018 00:42:12 +0530, Sibi Sankar wrote:
> Remove the additional definition tag declared for WCSS sub-system
> under reset-names.
> 
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 1/2] PM / devfreq: Generic CPU frequency to device frequency mapping governor
      [irrelevant]       ` <35ff3e303f5de9980979b49c89f9a687@codeaurora.org>
@ 2018-09-10 18:45         ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-10 18:45 UTC (permalink / raw)
  To: skannan
  Cc: myungjoo.ham, Kyungmin Park, Chanwoo Choi, Rob Herring,
	Mark Rutland, georgi.djakov, vincent.guittot, daidavid1,
	bjorn.andersson, linux-pm, devicetree, linux-kernel,
	linux-kernel-owner, viresh.kumar

Hi Saravana,

On 2018-08-07 11:19, skannan@codeaurora.org wrote:
> On 2018-08-02 14:00, skannan@codeaurora.org wrote:
>> On 2018-08-02 02:56, MyungJoo Ham wrote:
>>>> Many CPU architectures have caches that can scale independent of the 
>>>> CPUs.
>>>> Frequency scaling of the caches is necessary to make sure the cache 
>>>> is not
>>>> a performance bottleneck that leads to poor performance and power. 
>>>> The same
>>>> idea applies for RAM/DDR.
>>>> 
>>>> To achieve this, this patch adds a generic devfreq governor that 
>>>> takes the
>>>> current frequency of each CPU frequency domain and then adjusts the
>>>> frequency of the cache (or any devfreq device) based on the 
>>>> frequency of
>>>> the CPUs. It listens to CPU frequency transition notifiers to keep 
>>>> itself
>>>> up to date on the current CPU frequency.
>>>> 

With the cpu-freq driver for SDM845 SoC supporting fast_switch and 
schedutil supporting
dynamic switching wouldn't this governor be incompatible due to its 
reliance on transition
notifiers? Is it planned to be used only with ondemand/performance 
governors?

>>>> To decide the frequency of the device, the governor does one of the
>>>> following:
>>> 
>>> This exactly has the same purpose with "passive" governor except for 
>>> the
>>> single part: passive governor depends on another devfreq driver, not
>>> cpufreq driver.
>>> 
>>> If both governors have many features in common, can you merge them 
>>> into one?
>>> Passive governor also has "get_target_freq", which allows driver 
>>> authors
>>> to define the mapping.
>> 
>> Thanks for the review and pointing me to the passive governor. I agree
>> that at a high level they are both doing the same. I can certainly
>> stuff this CPU freq to dev freq mapping into passive governor, but I
>> think it'll just make one huge set of code that's harder to understand
>> and maintain because it trying to do different things under the hood.
>> 
>> There are also a bunch of complexities and optimizations that come
>> with the cpufreq-map governor that don't fit with the passive
>> governor.
>> 
>> 1. It's not one CPU who's frequency we have to listen to. There are
>> multiple CPUs/policies we have to aggregate across.
>> 2. We have to deal with big vs little having different needs/mappings.
>> 3. Since it's always just CPUfreq, I can optimize the handling in the
>> transition notifiers. If I have 4 different devices that are scaled
>> based on CPU freq, I still use only 1 transition notifier. It becomes
>> a bit harder to do with the passive governor.
>> 4. It requires that the device explicitly support the passive governor
>> and pick a mapping function. With cpufreq-map governor, the device
>> drivers don't need to make any changes. Whoever is making a
>> device/board can choose what devices to scale up base on CPU freq
>> based on their board and their needs. Even an end user can say, scale
>> the GPU based on my CPU based on interpolation if they choose to.
>> 5. If a device has some other use for the private data, it can't work
>> with passive governor, but can work with cpufreq-map governor.
>> 6. I also want to improve cpufreq-map governor to handle hotplug
>> correctly in later patches (needs more discussion) and that'll add
>> more complexity.
>> 
>> I think for these reasons we shouldn't combine these two governors.
>> Let me know what you think.
> 
> Friendly reminder.
> 
> Thanks,
> Saravana

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v3 2/2] PM / devfreq: Add devfreq driver for interconnect bandwidth voting
      [irrelevant] ` <4fcac639-cba9-1a71-9b78-326ebb9242da@linaro.org>
@ 2018-09-10 18:55   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-10 18:55 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: Saravana Kannan, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	Rob Herring, Mark Rutland, vincent.guittot, daidavid1,
	bjorn.andersson, linux-pm, devicetree, linux-kernel,
	linux-kernel-owner

Hi Georgi,

This driver uses of_icc_get which is very likely to fail if it probes
before the interconnect provider. Would it be possible for icc_get to
return/differentiate both -EPROBE_DEFER and other errors to prevent the
driver to continually probe defer if the path doesn't actually exist
or just error out if it probes before the interconnect provider.

On 2018-08-23 18:30, Georgi Djakov wrote:
> Hi Saravana,
> 
> On 08/02/2018 03:57 AM, Saravana Kannan wrote:
>> This driver registers itself as a devfreq device that allows devfreq
>> governors to make bandwidth votes for an interconnect path. This 
>> allows
>> applying various policies for different interconnect paths using 
>> devfreq
>> governors.
>> 
>> Example uses:
>> * Use the devfreq performance governor to set the CPU to DDR 
>> interconnect
>>   path for maximum performance.
>> * Use the devfreq performance governor to set the GPU to DDR 
>> interconnect
>>   path for maximum performance.
>> * Use the CPU frequency to device frequency mapping governor to scale 
>> the
>>   DDR frequency based on the needs of the CPUs' current frequency.
> 
> Usually CPUs and GPUs have dedicated cpufreq/devfreq drivers and i was
> wondering if the interconnect support could be put into these drivers
> directly?
> 
>> 
>> Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
>> ---
>>  Documentation/devicetree/bindings/devfreq/icbw.txt |  21 ++++
>>  drivers/devfreq/Kconfig                            |  13 +++
>>  drivers/devfreq/Makefile                           |   1 +
>>  drivers/devfreq/devfreq_icbw.c                     | 116 
>> +++++++++++++++++++++
>>  4 files changed, 151 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/devfreq/icbw.txt
>>  create mode 100644 drivers/devfreq/devfreq_icbw.c
>> 
>> diff --git a/Documentation/devicetree/bindings/devfreq/icbw.txt 
>> b/Documentation/devicetree/bindings/devfreq/icbw.txt
>> new file mode 100644
>> index 0000000..36cf045
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/devfreq/icbw.txt
>> @@ -0,0 +1,21 @@
>> +Interconnect bandwidth device
>> +
>> +icbw is a device that represents an interconnect path that connects 
>> two
>> +devices. This device is typically used to vote for BW requirements 
>> between
>> +two devices. Eg: CPU to DDR, GPU to DDR, etc
>> +
>> +Required properties:
>> +- compatible:		Must be "devfreq-icbw"
>> +- interconnects:	Pairs of phandles and interconnect provider 
>> specifier
>> +			to denote the edge source and destination ports of
>> +			the interconnect path. See also:
>> +		Documentation/devicetree/bindings/interconnect/interconnect.txt
>> +- interconnect-names:	Must have one entry with the name "path".
>> +
>> +Example:
>> +
>> +	qcom,cpubw {
>> +		compatible = "devfreq-icbw";
>> +		interconnects = <&snoc MASTER_APSS_1 &bimc SLAVE_EBI_CH0>;
>> +		interconnect-names = "path";
> 
> interconnect-names is optional when there is only a single path.
> 
>> +	};
>> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
>> index 3d9ae68..590370e 100644
>> --- a/drivers/devfreq/Kconfig
>> +++ b/drivers/devfreq/Kconfig
>> @@ -121,6 +121,19 @@ config ARM_RK3399_DMC_DEVFREQ
>>            It sets the frequency for the memory controller and reads 
>> the usage counts
>>            from hardware.
>> 
>> +config DEVFREQ_ICBW
>> +	bool "DEVFREQ device for making bandwidth votes on interconnect 
>> paths"
> 
> Can this be a module?
> 
>> +	select DEVFREQ_GOV_PERFORMANCE
>> +	select DEVFREQ_GOV_POWERSAVE
>> +	select DEVFREQ_GOV_USERSPACE
>> +	default n
> 
> There's no need to specify this default. It is 'n' by default anyway.
> Also maybe you want to add something like:
> 	depends on INTERCONNECT=y
> 
> Thanks,
> Georgi
> 
>> +	help
>> +	  Different devfreq governors use this devfreq device to make
>> +	  bandwidth votes for interconnect paths between different devices
>> +	  (Eg: CPU to DDR, GPU to DDR, etc). This driver provides a generic
>> +	  interface so that the devfreq governors can be shared across SoCs
>> +	  and architectures.
>> +
>>  source "drivers/devfreq/event/Kconfig"

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v3 2/2] PM / devfreq: Add devfreq driver for interconnect bandwidth voting
      [irrelevant] <1533171465-25508-2-git-send-email-skannan@codeaurora.org>
      [irrelevant] ` <4fcac639-cba9-1a71-9b78-326ebb9242da@linaro.org>
@ 2018-09-14 12:53 ` Sibi Sankar
  1 sibling, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-14 12:53 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, Rob Herring,
	Mark Rutland, georgi.djakov, vincent.guittot, daidavid1,
	bjorn.andersson, linux-pm, devicetree, linux-kernel,
	linux-kernel-owner, rnayak

Hi Saravana,

On 2018-08-02 06:27, Saravana Kannan wrote:
> This driver registers itself as a devfreq device that allows devfreq
> governors to make bandwidth votes for an interconnect path. This allows
> applying various policies for different interconnect paths using 
> devfreq
> governors.
> 
> Example uses:
> * Use the devfreq performance governor to set the CPU to DDR 
> interconnect
>   path for maximum performance.
> * Use the devfreq performance governor to set the GPU to DDR 
> interconnect
>   path for maximum performance.
> * Use the CPU frequency to device frequency mapping governor to scale 
> the
>   DDR frequency based on the needs of the CPUs' current frequency.
> 
> Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/devfreq/icbw.txt |  21 ++++
>  drivers/devfreq/Kconfig                            |  13 +++
>  drivers/devfreq/Makefile                           |   1 +
>  drivers/devfreq/devfreq_icbw.c                     | 116 
> +++++++++++++++++++++
>  4 files changed, 151 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/devfreq/icbw.txt
>  create mode 100644 drivers/devfreq/devfreq_icbw.c
> 
> diff --git a/Documentation/devicetree/bindings/devfreq/icbw.txt
> b/Documentation/devicetree/bindings/devfreq/icbw.txt
> new file mode 100644
> index 0000000..36cf045
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/devfreq/icbw.txt
> @@ -0,0 +1,21 @@
> +Interconnect bandwidth device
> +
> +icbw is a device that represents an interconnect path that connects 
> two
> +devices. This device is typically used to vote for BW requirements 
> between
> +two devices. Eg: CPU to DDR, GPU to DDR, etc
> +
> +Required properties:
> +- compatible:		Must be "devfreq-icbw"
> +- interconnects:	Pairs of phandles and interconnect provider specifier
> +			to denote the edge source and destination ports of
> +			the interconnect path. See also:
> +		Documentation/devicetree/bindings/interconnect/interconnect.txt
> +- interconnect-names:	Must have one entry with the name "path".
> +
> +Example:
> +
> +	qcom,cpubw {
> +		compatible = "devfreq-icbw";
> +		interconnects = <&snoc MASTER_APSS_1 &bimc SLAVE_EBI_CH0>;
> +		interconnect-names = "path";
> +	};
> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> index 3d9ae68..590370e 100644
> --- a/drivers/devfreq/Kconfig
> +++ b/drivers/devfreq/Kconfig
> @@ -121,6 +121,19 @@ config ARM_RK3399_DMC_DEVFREQ
>            It sets the frequency for the memory controller and reads
> the usage counts
>            from hardware.
> 
> +config DEVFREQ_ICBW
> +	bool "DEVFREQ device for making bandwidth votes on interconnect 
> paths"
> +	select DEVFREQ_GOV_PERFORMANCE
> +	select DEVFREQ_GOV_POWERSAVE
> +	select DEVFREQ_GOV_USERSPACE
> +	default n
> +	help
> +	  Different devfreq governors use this devfreq device to make
> +	  bandwidth votes for interconnect paths between different devices
> +	  (Eg: CPU to DDR, GPU to DDR, etc). This driver provides a generic
> +	  interface so that the devfreq governors can be shared across SoCs
> +	  and architectures.
> +
>  source "drivers/devfreq/event/Kconfig"
> 
>  endif # PM_DEVFREQ
> diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
> index e9dc3e9..b302c5cf 100644
> --- a/drivers/devfreq/Makefile
> +++ b/drivers/devfreq/Makefile
> @@ -12,6 +12,7 @@ obj-$(CONFIG_DEVFREQ_GOV_CPUFREQ_MAP)	+=
> governor_cpufreq_map.o
>  obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ)	+= exynos-bus.o
>  obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ)	+= rk3399_dmc.o
>  obj-$(CONFIG_ARM_TEGRA_DEVFREQ)		+= tegra-devfreq.o
> +obj-$(CONFIG_DEVFREQ_ICBW)		+= devfreq_icbw.o
> 
>  # DEVFREQ Event Drivers
>  obj-$(CONFIG_PM_DEVFREQ_EVENT)		+= event/
> diff --git a/drivers/devfreq/devfreq_icbw.c 
> b/drivers/devfreq/devfreq_icbw.c
> new file mode 100644
> index 0000000..231fb21
> --- /dev/null
> +++ b/drivers/devfreq/devfreq_icbw.c
> @@ -0,0 +1,116 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights 
> reserved.
> + */
> +
> +#define pr_fmt(fmt) "icbw: " fmt
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/err.h>
> +#include <linux/errno.h>
> +#include <linux/mutex.h>
> +#include <linux/devfreq.h>
> +#include <linux/platform_device.h>
> +#include <linux/of.h>
> +#include <linux/interconnect.h>
> +
> +struct dev_data {
> +	struct icc_path *path;
> +	u32 cur_ab;
> +	u32 cur_pb;
> +	unsigned long gov_ab;
> +	struct devfreq *df;
> +	struct devfreq_dev_profile dp;
> +};
> +
> +static int icbw_target(struct device *dev, unsigned long *freq, u32 
> flags)
> +{
> +	struct dev_data *d = dev_get_drvdata(dev);
> +	int ret;
> +	u32 new_pb = *freq, new_ab = d->gov_ab;
> +
> +	if (d->cur_pb == new_pb && d->cur_ab == new_ab)
> +		return 0;
> +
> +	dev_dbg(dev, "BW KBps: AB: %u PB: %u\n", new_ab, new_pb);
> +
> +	ret = icc_set(d->path, new_ab, new_pb);
> +	if (ret) {
> +		dev_err(dev, "bandwidth request failed (%d)\n", ret);
> +	} else {
> +		d->cur_pb = new_pb;
> +		d->cur_ab = new_ab;
> +	}
> +
> +	return ret;
> +}
> +
> +static int icbw_get_dev_status(struct device *dev,
> +				struct devfreq_dev_status *stat)
> +{
> +	struct dev_data *d = dev_get_drvdata(dev);
> +
> +	stat->private_data = &d->gov_ab;
> +	return 0;
> +}
> +
> +static int devfreq_icbw_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct dev_data *d;
> +	struct devfreq_dev_profile *p;
> +
> +	d = devm_kzalloc(dev, sizeof(*d), GFP_KERNEL);
> +	if (!d)
> +		return -ENOMEM;
> +	dev_set_drvdata(dev, d);
> +
> +	p = &d->dp;
> +	p->polling_ms = 50;
> +	p->target = icbw_target;
> +	p->get_dev_status = icbw_get_dev_status;
> +
> +	d->path = of_icc_get(dev, "path");
> +	if (IS_ERR(d->path)) {
> +		dev_err(dev, "Unable to register interconnect path\n");
> +		return -ENODEV;
> +	}

The probe fails if the provider is not registered yet. Worked around it 
using -EPROBE_DEFER
but this should probably come from of_icc_get itself.

> +
> +	d->df = devfreq_add_device(dev, p, "performance", NULL);
> +	if (IS_ERR(d->df)) {
> +		icc_put(d->path);
> +		return PTR_ERR(d->df);
> +	}

devfreq_add_device will fail with -EINVAL for set_table_freq, 
find_available_min_freq and
find_available_max_freq. If you end up working your way around it, I 
still ended up getting
multiple errors like "Couldn't update frequency transition information" 
after probing.

> +
> +	return 0;
> +}
> +
> +static int devfreq_icbw_remove(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct dev_data *d = dev_get_drvdata(dev);
> +
> +	devfreq_remove_device(d->df);
> +	icc_put(d->path);
> +	return 0;
> +}
> +
> +static const struct of_device_id icbw_match_table[] = {
> +	{ .compatible = "devfreq-icbw" },
> +	{}
> +};
> +
> +static struct platform_driver icbw_driver = {
> +	.probe = devfreq_icbw_probe,
> +	.remove = devfreq_icbw_remove,
> +	.driver = {
> +		.name = "devfreq-icbw",
> +		.of_match_table = icbw_match_table,
> +	},
> +};
> +
> +module_platform_driver(icbw_driver);
> +MODULE_DESCRIPTION("Interconnect bandwidth voting driver");
> +MODULE_LICENSE("GPL v2");

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH AUTOSEL 4.18 74/92] remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote
      [irrelevant] <20180915012944.179481-1-alexander.levin@microsoft.com>
@ 2018-09-15  1:30 ` Sasha Levin
  0 siblings, 0 replies; 200+ results
From: Sasha Levin @ 2018-09-15  1:30 UTC (permalink / raw)
  To: stable, linux-kernel; +Cc: Sibi Sankar, Bjorn Andersson, Sasha Levin

From: Sibi Sankar <sibis@codeaurora.org>

[ Upstream commit 7cbb540a3a68e4d4a8bef2d9451afb1635b5d2d3 ]

GCC_MSS_AXIS2 clock is used for disabling boot IMEM (a part of
AP boot up). With Boot IMEM disable now a part TZ/ATF, AXIS2
clock is no longer required post AP boot up and expected to
remain untouched. However if the clock is turned ON after Q6
is brought out of reset and later turned off, it results in
modem hang. When Q6 attempts a power collapse the internal
handshaking to check if AXIS2 is idle never goes through since
it is turned off preventing the RSC from getting triggered,
leaving modem in a funky state. Hence removing AXIS2 clk
enable/disable from the driver.

Reported-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 drivers/remoteproc/qcom_q6v5_pil.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index 2bf8e7c49f2a..e5ec59102b01 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -1370,7 +1370,6 @@ static const struct rproc_hexagon_res sdm845_mss = {
 	.hexagon_mba_image = "mba.mbn",
 	.proxy_clk_names = (char*[]){
 			"xo",
-			"axis2",
 			"prng",
 			NULL
 	},
-- 
2.17.1

^ permalink raw reply	[relevance 8%]

* Re: [PATCH v3 2/2] remoteproc: qcom: Introduce Non-PAS ADSP PIL driver
      [irrelevant] ` <1535975560-8200-3-git-send-email-rohitkr@codeaurora.org>
@ 2018-09-21 19:41   ` Sibi Sankar
      [irrelevant]     ` <79bee282-e8a4-a1e6-56e3-6ea7e20c0233@codeaurora.org>
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-09-21 19:41 UTC (permalink / raw)
  To: Rohit kumar
  Cc: ohad, bjorn.andersson, robh+dt, mark.rutland, linux-remoteproc,
	devicetree, linux-kernel, plai, bgoswami, srinivas.kandagatla,
	linux-kernel-owner

Hi Rohit,

On 2018-09-03 17:22, Rohit kumar wrote:
> This adds Non PAS ADSP PIL driver for Qualcomm
> Technologies Inc SoCs.
> Added initial support for SDM845 with ADSP bootup and
> shutdown operation handled from Application Processor
> SubSystem(APSS).
> 
> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
> ---
....
> +	select QCOM_MDT_LOADER
> +	select QCOM_Q6V5_COMMON
> +	select QCOM_RPROC_COMMON
> +	help
> +	  Say y here to support the Peripherial Image Loader

replace Peripherial/Peripheral.
....
> +#include <linux/clk.h>
> +#include <linux/firmware.h>
> +#include <linux/interrupt.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/reset.h>
> +#include <linux/iopoll.h>
> +#include <linux/pm_domain.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/regmap.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/of_address.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> +#include <linux/remoteproc.h>
> +#include <linux/soc/qcom/mdt_loader.h>
> +#include <linux/soc/qcom/smem.h>
> +#include <linux/soc/qcom/smem_state.h>
> +

The headers should be in alphabetical order.

....
> +	struct reset_control *pdc_sync_reset;
> +	struct reset_control *cc_lpass_restart;
> +
> +	struct regmap *halt_map;
> +	unsigned int  halt_lpass;

remove the double spaces above.
....
> +	if (ret || val)
> +		goto reset;
> +
> +	regmap_write(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_HALTREQ_REG, 1);
> +
> +	/*  Wait for halt ACK from QDSP6 */

Minor nit, please remove the double spaces in the comment above.

> +	timeout = jiffies + msecs_to_jiffies(ACK_TIMEOUT);
> +	for (;;) {
> +		ret = regmap_read(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_HALTACK_REG, &val);
> +		if (ret || val || time_after(jiffies, timeout))
> +			break;
> +
> +		udelay(1000);

According to Documentation/timers/timers-howto.txt please use 
usleep_range()
when the delay range is between(10us - 20ms).

> +	}
> +
> +	ret = regmap_read(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_MASTER_IDLE_REG, &val);
....
> +	/* wait after asserting subsystem restart from AOSS */
> +	udelay(200);

ditto

> +
> +	/* Clear the halt request for the AXIM and AHBM for Q6 */
> +	regmap_write(adsp->halt_map, adsp->halt_lpass + LPASS_HALTREQ_REG, 
> 0);
> +
> +	/* De-assert the LPASS PDC Reset */
> +	reset_control_deassert(adsp->pdc_sync_reset);
> +	/* Remove the LPASS reset */
> +	reset_control_deassert(adsp->cc_lpass_restart);
> +	/* wait after de-asserting subsystem restart from AOSS */
> +	udelay(200);

ditto

> +
> +	return 0;
> +}
....
> +static int adsp_start(struct rproc *rproc)
> +{
> +	struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
> +	int ret;
> +	unsigned int val;
> +
> +	qcom_q6v5_prepare(&adsp->q6v5);
> +
> +	ret = clk_prepare_enable(adsp->xo);
> +	if (ret)
> +		return ret;

please call qcom_q6v5_unprepare on clk_prepare_enable failure to 
disable_irqs

> +
> +	dev_pm_genpd_set_performance_state(adsp->dev, INT_MAX);
> +	ret = pm_runtime_get_sync(adsp->dev);
> +	if (ret)
> +		goto disable_xo_clk;
> +
....
> +static int adsp_init_reset(struct qcom_adsp *adsp)
> +{
> +	adsp->pdc_sync_reset = devm_reset_control_get_exclusive(adsp->dev,
> +			"pdc_sync");
> +	if (IS_ERR(adsp->pdc_sync_reset)) {
> +		dev_err(adsp->dev, "failed to acquire pdc_sync reset\n");
> +		return PTR_ERR(adsp->pdc_sync_reset);
> +	}

Bjorn, should we return EPROBE_DEFER here since PDC global reset 
controller can be a module?

> +
> +	adsp->cc_lpass_restart = devm_reset_control_get_exclusive(adsp->dev,
> +			"cc_lpass");
> +	if (IS_ERR(adsp->cc_lpass_restart)) {
> +		dev_err(adsp->dev, "failed to acquire cc_lpass restart\n");
> +		return PTR_ERR(adsp->cc_lpass_restart);
> +	}
> +
> +	return 0;
....
> +static int adsp_remove(struct platform_device *pdev)
> +{
> +	struct qcom_adsp *adsp = platform_get_drvdata(pdev);
> +
> +	rproc_del(adsp->rproc);
> +
> +	qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev);
> +	qcom_remove_sysmon_subdev(adsp->sysmon);
> +	qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
> +	rproc_free(adsp->rproc);
> +	pm_runtime_disable(adsp->dev);
> +

rmmod of the driver resulted in the following kernel panic:
having a pm_runtime_disable after rproc_free seems to be the cause of 
the kernel panic.
Please call pm_runtime_disable before rproc_free.

do_raw_spin_lock+0x28/0x118
__raw_spin_lock_irq+0x30/0x3c
__pm_runtime_disable+0x28/0xf4
adsp_remove+0x4c/0x5c [qcom_adsp_pil]
platform_drv_remove+0x28/0x50
device_release_driver_internal+0x124/0x1c8
driver_detach+0x44/0x80
bus_remove_driver+0x78/0x9c
driver_unregister+0x34/0x54
platform_driver_unregister+0x1c/0x28
cleanup_module+0x14/0x6bc [qcom_adsp_pil]
SyS_delete_module+0x1c4/0x214

> +	return 0;
> +}
> +
> +static const struct adsp_pil_data adsp_resource_init = {
> +	.crash_reason_smem = 423,
> +	.firmware_name = "adsp.mdt",
> +	.ssr_name = "lpass",
> +	.sysmon_name = "adsp",
> +	.ssctl_id = 0x14,
> +};
....
> +module_platform_driver(adsp_pil_driver);
> +MODULE_DESCRIPTION("QTi SDM845 ADSP Peripherial Image Loader");

replace QTi/QTI and Peripherial/Peripheral.

....
Also I see the following warns on stopping the adsp remoteproc, couldn't 
root cause it though:
  device_del+0x84/0x29c
  platform_device_del+0x2c/0x88
  platform_device_unregister+0x1c/0x30
  of_platform_device_destroy+0x98/0xa8
  device_for_each_child+0x54/0xa4
  of_platform_depopulate+0x38/0x54
  q6asm_remove+0x1c/0x2c
  apr_device_remove+0x38/0x70
  device_release_driver_internal+0x124/0x1c8
  device_release_driver+0x24/0x30
  bus_remove_device+0xcc/0xe4
  device_del+0x1f8/0x29c
  device_unregister+0x1c/0x30
  apr_remove_device+0x1c/0x2c
  device_for_each_child+0x54/0xa4
  apr_remove+0x28/0x34
  rpmsg_dev_remove+0x48/0x70
  device_release_driver_internal+0x124/0x1c8
  device_release_driver+0x24/0x30
  bus_remove_device+0xcc/0xe4
  device_del+0x1f8/0x29c
  device_unregister+0x1c/0x30
  qcom_glink_remove_device+0x1c/0x2c
  device_for_each_child+0x54/0xa4
  qcom_glink_native_remove+0x54/0x15c
  qcom_glink_smem_unregister+0x1c/0x30
  glink_subdev_stop+0x1c/0x2c [qcom_common]
  rproc_stop+0x40/0xc0
  rproc_shutdown+0x6c/0xc0
  rproc_del+0x28/0xa0
  adsp_remove+0x20/0x5c [qcom_adsp_pil]
  platform_drv_remove+0x28/0x50
  device_release_driver_internal+0x124/0x1c8
  driver_detach+0x44/0x80
  bus_remove_driver+0x78/0x9c
  driver_unregister+0x34/0x54
  platform_driver_unregister+0x1c/0x28
  cleanup_module+0x14/0x6bc [qcom_adsp_pil]
  SyS_delete_module+0x1c4/0x214

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v3 2/2] remoteproc: qcom: Introduce Non-PAS ADSP PIL driver
      [irrelevant]       ` <614ab0e7-b751-4bf9-72f9-33fdd57594ec@codeaurora.org>
@ 2018-09-24 12:02         ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-24 12:02 UTC (permalink / raw)
  To: Rohit Kumar
  Cc: ohad, bjorn.andersson, robh+dt, mark.rutland, linux-remoteproc,
	devicetree, linux-kernel, plai, bgoswami, srinivas.kandagatla,
	linux-kernel-owner

On 2018-09-24 12:38, Rohit Kumar wrote:
> On 9/24/2018 12:19 PM, Rohit Kumar wrote:
>> Thanks Sibi for reviewing.
>> 
>> 
>> On 9/22/2018 1:11 AM, Sibi Sankar wrote:
>>> Hi Rohit,
>>> 
>>> On 2018-09-03 17:22, Rohit kumar wrote:
>>>> This adds Non PAS ADSP PIL driver for Qualcomm
>>>> Technologies Inc SoCs.
>>>> Added initial support for SDM845 with ADSP bootup and
>>>> shutdown operation handled from Application Processor
>>>> SubSystem(APSS).
>>>> 
>>>> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
>>>> ---
>>> ....
> ...
>>> ....
>>> Also I see the following warns on stopping the adsp remoteproc, 
>>> couldn't root cause it though:
>> 
>> It should be issue in Q6 drivers. I will check and update q6 drivers. 
>> Thanks for reporting.
>> 
> 
> Checked this warning. This is a core driver issue fixed with
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/base/core.c?h=next-20180924&id=2ec16150179888b81717d1d3ce84e634f4736af2
> 

Thanks for pointing this out.

>>>  device_del+0x84/0x29c
>>>  platform_device_del+0x2c/0x88
>>>  platform_device_unregister+0x1c/0x30
>>>  of_platform_device_destroy+0x98/0xa8
>>>  device_for_each_child+0x54/0xa4
>>>  of_platform_depopulate+0x38/0x54
>>>  q6asm_remove+0x1c/0x2c
>>>  apr_device_remove+0x38/0x70
>>>  device_release_driver_internal+0x124/0x1c8
>>>  device_release_driver+0x24/0x30
>>>  bus_remove_device+0xcc/0xe4
>>>  device_del+0x1f8/0x29c
>>>  device_unregister+0x1c/0x30
>>>  apr_remove_device+0x1c/0x2c
>>>  device_for_each_child+0x54/0xa4
>>>  apr_remove+0x28/0x34
>>>  rpmsg_dev_remove+0x48/0x70
>>>  device_release_driver_internal+0x124/0x1c8
>>>  device_release_driver+0x24/0x30
>>>  bus_remove_device+0xcc/0xe4
>>>  device_del+0x1f8/0x29c
>>>  device_unregister+0x1c/0x30
>>>  qcom_glink_remove_device+0x1c/0x2c
>>>  device_for_each_child+0x54/0xa4
>>>  qcom_glink_native_remove+0x54/0x15c
>>>  qcom_glink_smem_unregister+0x1c/0x30
>>>  glink_subdev_stop+0x1c/0x2c [qcom_common]
>>>  rproc_stop+0x40/0xc0
>>>  rproc_shutdown+0x6c/0xc0
>>>  rproc_del+0x28/0xa0
>>>  adsp_remove+0x20/0x5c [qcom_adsp_pil]
>>>  platform_drv_remove+0x28/0x50
>>>  device_release_driver_internal+0x124/0x1c8
>>>  driver_detach+0x44/0x80
>>>  bus_remove_driver+0x78/0x9c
>>>  driver_unregister+0x34/0x54
>>>  platform_driver_unregister+0x1c/0x28
>>>  cleanup_module+0x14/0x6bc [qcom_adsp_pil]
>>>  SyS_delete_module+0x1c4/0x214
>>> 
>> 
>> Thanks,
>> Rohit
> Thanks

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v3 2/2] remoteproc: qcom: Introduce Non-PAS ADSP PIL driver
      [irrelevant]     ` <79bee282-e8a4-a1e6-56e3-6ea7e20c0233@codeaurora.org>
      [irrelevant]       ` <614ab0e7-b751-4bf9-72f9-33fdd57594ec@codeaurora.org>
@ 2018-09-24 12:04       ` Sibi Sankar
  1 sibling, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-24 12:04 UTC (permalink / raw)
  To: Rohit Kumar
  Cc: ohad, bjorn.andersson, robh+dt, mark.rutland, linux-remoteproc,
	devicetree, linux-kernel, plai, bgoswami, srinivas.kandagatla,
	linux-kernel-owner, linux-remoteproc-owner

On 2018-09-24 12:19, Rohit Kumar wrote:
> Thanks Sibi for reviewing.
> 
> 
> On 9/22/2018 1:11 AM, Sibi Sankar wrote:
>> Hi Rohit,
>> 
>> On 2018-09-03 17:22, Rohit kumar wrote:
>>> This adds Non PAS ADSP PIL driver for Qualcomm
>>> Technologies Inc SoCs.
>>> Added initial support for SDM845 with ADSP bootup and
>>> shutdown operation handled from Application Processor
>>> SubSystem(APSS).
>>> 
>>> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
>>> ---
>> ....
>>> +    select QCOM_MDT_LOADER
>>> +    select QCOM_Q6V5_COMMON
>>> +    select QCOM_RPROC_COMMON
>>> +    help
>>> +      Say y here to support the Peripherial Image Loader
>> 
>> replace Peripherial/Peripheral.
> 
> sure
>> ....
>>> +#include <linux/clk.h>
>>> +#include <linux/firmware.h>
>>> +#include <linux/interrupt.h>
>>> +#include <linux/kernel.h>
>>> +#include <linux/module.h>
>>> +#include <linux/delay.h>
>>> +#include <linux/io.h>
>>> +#include <linux/reset.h>
>>> +#include <linux/iopoll.h>
>>> +#include <linux/pm_domain.h>
>>> +#include <linux/pm_runtime.h>
>>> +#include <linux/regmap.h>
>>> +#include <linux/mfd/syscon.h>
>>> +#include <linux/of_address.h>
>>> +#include <linux/of_device.h>
>>> +#include <linux/platform_device.h>
>>> +#include <linux/remoteproc.h>
>>> +#include <linux/soc/qcom/mdt_loader.h>
>>> +#include <linux/soc/qcom/smem.h>
>>> +#include <linux/soc/qcom/smem_state.h>
>>> +
>> 
>> The headers should be in alphabetical order.
>> 
> 
> ok, will do
>> ....
>>> +    struct reset_control *pdc_sync_reset;
>>> +    struct reset_control *cc_lpass_restart;
>>> +
>>> +    struct regmap *halt_map;
>>> +    unsigned int  halt_lpass;
>> 
>> remove the double spaces above.
> 
> ok
>> ....
>>> +    if (ret || val)
>>> +        goto reset;
>>> +
>>> +    regmap_write(adsp->halt_map,
>>> +            adsp->halt_lpass + LPASS_HALTREQ_REG, 1);
>>> +
>>> +    /*  Wait for halt ACK from QDSP6 */
>> 
>> Minor nit, please remove the double spaces in the comment above.
> 
> ok
>> 
>>> +    timeout = jiffies + msecs_to_jiffies(ACK_TIMEOUT);
>>> +    for (;;) {
>>> +        ret = regmap_read(adsp->halt_map,
>>> +            adsp->halt_lpass + LPASS_HALTACK_REG, &val);
>>> +        if (ret || val || time_after(jiffies, timeout))
>>> +            break;
>>> +
>>> +        udelay(1000);
>> 
>> According to Documentation/timers/timers-howto.txt please use 
>> usleep_range()
>> when the delay range is between(10us - 20ms).
> 
> okay, will update in next spin.
>> 
>>> +    }
>>> +
>>> +    ret = regmap_read(adsp->halt_map,
>>> +            adsp->halt_lpass + LPASS_MASTER_IDLE_REG, &val);
>> ....
>>> +    /* wait after asserting subsystem restart from AOSS */
>>> +    udelay(200);
>> 
>> ditto
> 
> ok
>> 
>>> +
>>> +    /* Clear the halt request for the AXIM and AHBM for Q6 */
>>> +    regmap_write(adsp->halt_map, adsp->halt_lpass + 
>>> LPASS_HALTREQ_REG, 0);
>>> +
>>> +    /* De-assert the LPASS PDC Reset */
>>> +    reset_control_deassert(adsp->pdc_sync_reset);
>>> +    /* Remove the LPASS reset */
>>> +    reset_control_deassert(adsp->cc_lpass_restart);
>>> +    /* wait after de-asserting subsystem restart from AOSS */
>>> +    udelay(200);
>> 
>> ditto
>> 
>>> +
>>> +    return 0;
>>> +}
>> ....
>>> +static int adsp_start(struct rproc *rproc)
>>> +{
>>> +    struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
>>> +    int ret;
>>> +    unsigned int val;
>>> +
>>> +    qcom_q6v5_prepare(&adsp->q6v5);
>>> +
>>> +    ret = clk_prepare_enable(adsp->xo);
>>> +    if (ret)
>>> +        return ret;
>> 
>> please call qcom_q6v5_unprepare on clk_prepare_enable failure to 
>> disable_irqs
>> 
> 
> sure, will do that
>>> +
>>> +    dev_pm_genpd_set_performance_state(adsp->dev, INT_MAX);
>>> +    ret = pm_runtime_get_sync(adsp->dev);
>>> +    if (ret)
>>> +        goto disable_xo_clk;
>>> +
>> ....
>>> +static int adsp_init_reset(struct qcom_adsp *adsp)
>>> +{
>>> +    adsp->pdc_sync_reset = 
>>> devm_reset_control_get_exclusive(adsp->dev,
>>> +            "pdc_sync");
>>> +    if (IS_ERR(adsp->pdc_sync_reset)) {
>>> +        dev_err(adsp->dev, "failed to acquire pdc_sync reset\n");
>>> +        return PTR_ERR(adsp->pdc_sync_reset);
>>> +    }
>> 
>> Bjorn, should we return EPROBE_DEFER here since PDC global reset 
>> controller can be a module?
>> 
> 
> devm_reset_control_get_exclusive itself returns EPROBE_DEFER until PDC
> reset driver is probed.
> return PTR_ERR(adsp->pdc_sync_reset) handles this case.
> 

Thanks for pointing this out, missed this.

>>> +
>>> +    adsp->cc_lpass_restart = 
>>> devm_reset_control_get_exclusive(adsp->dev,
>>> +            "cc_lpass");
>>> +    if (IS_ERR(adsp->cc_lpass_restart)) {
>>> +        dev_err(adsp->dev, "failed to acquire cc_lpass restart\n");
>>> +        return PTR_ERR(adsp->cc_lpass_restart);
>>> +    }
>>> +
>>> +    return 0;
>> ....
>>> +static int adsp_remove(struct platform_device *pdev)
>>> +{
>>> +    struct qcom_adsp *adsp = platform_get_drvdata(pdev);
>>> +
>>> +    rproc_del(adsp->rproc);
>>> +
>>> +    qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev);
>>> +    qcom_remove_sysmon_subdev(adsp->sysmon);
>>> +    qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
>>> +    rproc_free(adsp->rproc);
>>> +    pm_runtime_disable(adsp->dev);
>>> +
>> 
>> rmmod of the driver resulted in the following kernel panic:
>> having a pm_runtime_disable after rproc_free seems to be the cause of 
>> the kernel panic.
>> Please call pm_runtime_disable before rproc_free.
>> 
> 
> Thanks for pointing out, will update.
>> do_raw_spin_lock+0x28/0x118
>> __raw_spin_lock_irq+0x30/0x3c
>> __pm_runtime_disable+0x28/0xf4
>> adsp_remove+0x4c/0x5c [qcom_adsp_pil]
>> platform_drv_remove+0x28/0x50
>> device_release_driver_internal+0x124/0x1c8
>> driver_detach+0x44/0x80
>> bus_remove_driver+0x78/0x9c
>> driver_unregister+0x34/0x54
>> platform_driver_unregister+0x1c/0x28
>> cleanup_module+0x14/0x6bc [qcom_adsp_pil]
>> SyS_delete_module+0x1c4/0x214
>> 
>>> +    return 0;
>>> +}
>>> +
>>> +static const struct adsp_pil_data adsp_resource_init = {
>>> +    .crash_reason_smem = 423,
>>> +    .firmware_name = "adsp.mdt",
>>> +    .ssr_name = "lpass",
>>> +    .sysmon_name = "adsp",
>>> +    .ssctl_id = 0x14,
>>> +};
>> ....
>>> +module_platform_driver(adsp_pil_driver);
>>> +MODULE_DESCRIPTION("QTi SDM845 ADSP Peripherial Image Loader");
>> 
>> replace QTi/QTI and Peripherial/Peripheral.
>> 
> ok
>> ....
>> Also I see the following warns on stopping the adsp remoteproc, 
>> couldn't root cause it though:
> 
> It should be issue in Q6 drivers. I will check and update q6 drivers.
> Thanks for reporting.
> 
>>  device_del+0x84/0x29c
>>  platform_device_del+0x2c/0x88
>>  platform_device_unregister+0x1c/0x30
>>  of_platform_device_destroy+0x98/0xa8
>>  device_for_each_child+0x54/0xa4
>>  of_platform_depopulate+0x38/0x54
>>  q6asm_remove+0x1c/0x2c
>>  apr_device_remove+0x38/0x70
>>  device_release_driver_internal+0x124/0x1c8
>>  device_release_driver+0x24/0x30
>>  bus_remove_device+0xcc/0xe4
>>  device_del+0x1f8/0x29c
>>  device_unregister+0x1c/0x30
>>  apr_remove_device+0x1c/0x2c
>>  device_for_each_child+0x54/0xa4
>>  apr_remove+0x28/0x34
>>  rpmsg_dev_remove+0x48/0x70
>>  device_release_driver_internal+0x124/0x1c8
>>  device_release_driver+0x24/0x30
>>  bus_remove_device+0xcc/0xe4
>>  device_del+0x1f8/0x29c
>>  device_unregister+0x1c/0x30
>>  qcom_glink_remove_device+0x1c/0x2c
>>  device_for_each_child+0x54/0xa4
>>  qcom_glink_native_remove+0x54/0x15c
>>  qcom_glink_smem_unregister+0x1c/0x30
>>  glink_subdev_stop+0x1c/0x2c [qcom_common]
>>  rproc_stop+0x40/0xc0
>>  rproc_shutdown+0x6c/0xc0
>>  rproc_del+0x28/0xa0
>>  adsp_remove+0x20/0x5c [qcom_adsp_pil]
>>  platform_drv_remove+0x28/0x50
>>  device_release_driver_internal+0x124/0x1c8
>>  driver_detach+0x44/0x80
>>  bus_remove_driver+0x78/0x9c
>>  driver_unregister+0x34/0x54
>>  platform_driver_unregister+0x1c/0x28
>>  cleanup_module+0x14/0x6bc [qcom_adsp_pil]
>>  SyS_delete_module+0x1c4/0x214
>> 
> 
> Thanks,
> Rohit

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v4] remoteproc: qcom: Introduce Non-PAS ADSP PIL driver
      [irrelevant] <1537787270-29630-1-git-send-email-rohitkr@codeaurora.org>
@ 2018-09-24 12:08 ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-24 12:08 UTC (permalink / raw)
  To: Rohit kumar
  Cc: ohad, bjorn.andersson, robh+dt, mark.rutland, linux-remoteproc,
	devicetree, linux-kernel, plai, bgoswami, rohkumar,
	linux-kernel-owner

Hi Rohit,

Thanks for the quick turnaround, the patches look fine.

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sibi Sankar <sibis@codeaurora.org>

On 2018-09-24 16:37, Rohit kumar wrote:
> This adds Non PAS ADSP PIL driver for Qualcomm
> Technologies Inc SoCs.
> Added initial support for SDM845 with ADSP bootup and
> shutdown operation handled from Application Processor
> SubSystem(APSS).
> 
> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
> ---
> Changes since v3:
> 	Addressed comments posted by Sibi
> 
> This patch is dependent on the rpmh powerdomain driver
> https://lkml.org/lkml/2018/6/27/7
> and renaming of Hexagon v5 PAS driver
> https://patchwork.kernel.org/patch/10601119/ .
> 
>  drivers/remoteproc/Kconfig         |  14 ++
>  drivers/remoteproc/Makefile        |   1 +
>  drivers/remoteproc/qcom_adsp_pil.c | 502 
> +++++++++++++++++++++++++++++++++++++
>  3 files changed, 517 insertions(+)
>  create mode 100644 drivers/remoteproc/qcom_adsp_pil.c
> 
> diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
> index 8894935..f554669 100644
> --- a/drivers/remoteproc/Kconfig
> +++ b/drivers/remoteproc/Kconfig
> @@ -140,6 +140,20 @@ config QCOM_Q6V5_WCSS
>  	  Say y here to support the Qualcomm Peripheral Image Loader for the
>  	  Hexagon V5 based WCSS remote processors.
> 
> +config QCOM_ADSP_PIL
> +	tristate "Qualcomm Technology Inc ADSP Peripheral Image Loader"
> +	depends on OF && ARCH_QCOM
> +	depends on QCOM_SMEM
> +	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
> +	depends on QCOM_SYSMON || QCOM_SYSMON=n
> +	select MFD_SYSCON
> +	select QCOM_MDT_LOADER
> +	select QCOM_Q6V5_COMMON
> +	select QCOM_RPROC_COMMON
> +	help
> +	  Say y here to support the Peripheral Image Loader
> +	  for the Qualcomm Technology Inc. ADSP remote processors.
> +
>  config QCOM_SYSMON
>  	tristate "Qualcomm sysmon driver"
>  	depends on RPMSG
> diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
> index 050f41a..0e1b89c 100644
> --- a/drivers/remoteproc/Makefile
> +++ b/drivers/remoteproc/Makefile
> @@ -19,6 +19,7 @@ obj-$(CONFIG_QCOM_Q6V5_COMMON)		+= qcom_q6v5.o
>  obj-$(CONFIG_QCOM_Q6V5_MSS)		+= qcom_q6v5_mss.o
>  obj-$(CONFIG_QCOM_Q6V5_PAS)		+= qcom_q6v5_pas.o
>  obj-$(CONFIG_QCOM_Q6V5_WCSS)		+= qcom_q6v5_wcss.o
> +obj-$(CONFIG_QCOM_ADSP_PIL)		+= qcom_adsp_pil.o
>  obj-$(CONFIG_QCOM_SYSMON)		+= qcom_sysmon.o
>  obj-$(CONFIG_QCOM_WCNSS_PIL)		+= qcom_wcnss_pil.o
>  qcom_wcnss_pil-y			+= qcom_wcnss.o
> diff --git a/drivers/remoteproc/qcom_adsp_pil.c
> b/drivers/remoteproc/qcom_adsp_pil.c
> new file mode 100644
> index 0000000..f2f5e56
> --- /dev/null
> +++ b/drivers/remoteproc/qcom_adsp_pil.c
> @@ -0,0 +1,502 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Qualcomm Technology Inc. ADSP Peripheral Image Loader for SDM845.
> + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/firmware.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/iopoll.h>
> +#include <linux/kernel.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/module.h>
> +#include <linux/of_address.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/regmap.h>
> +#include <linux/remoteproc.h>
> +#include <linux/reset.h>
> +#include <linux/soc/qcom/mdt_loader.h>
> +#include <linux/soc/qcom/smem.h>
> +#include <linux/soc/qcom/smem_state.h>
> +
> +#include "qcom_common.h"
> +#include "qcom_q6v5.h"
> +#include "remoteproc_internal.h"
> +
> +/* time out value */
> +#define ACK_TIMEOUT			1000
> +#define BOOT_FSM_TIMEOUT		10000
> +/* mask values */
> +#define EVB_MASK			GENMASK(27, 4)
> +/*QDSP6SS register offsets*/
> +#define RST_EVB_REG			0x10
> +#define CORE_START_REG			0x400
> +#define BOOT_CMD_REG			0x404
> +#define BOOT_STATUS_REG			0x408
> +#define RET_CFG_REG			0x1C
> +/*TCSR register offsets*/
> +#define LPASS_MASTER_IDLE_REG		0x8
> +#define LPASS_HALTACK_REG		0x4
> +#define LPASS_PWR_ON_REG		0x10
> +#define LPASS_HALTREQ_REG		0x0
> +
> +/* list of clocks required by ADSP PIL */
> +static const char * const adsp_clk_id[] = {
> +	"sway_cbcr", "lpass_aon", "lpass_ahbs_aon_cbcr", 
> "lpass_ahbm_aon_cbcr",
> +	"qdsp6ss_xo", "qdsp6ss_sleep", "qdsp6ss_core",
> +};
> +
> +struct adsp_pil_data {
> +	int crash_reason_smem;
> +	const char *firmware_name;
> +
> +	const char *ssr_name;
> +	const char *sysmon_name;
> +	int ssctl_id;
> +};
> +
> +struct qcom_adsp {
> +	struct device *dev;
> +	struct rproc *rproc;
> +
> +	struct qcom_q6v5 q6v5;
> +
> +	struct clk *xo;
> +
> +	int num_clks;
> +	struct clk_bulk_data *clks;
> +
> +	void __iomem *qdsp6ss_base;
> +
> +	struct reset_control *pdc_sync_reset;
> +	struct reset_control *cc_lpass_restart;
> +
> +	struct regmap *halt_map;
> +	unsigned int halt_lpass;
> +
> +	int crash_reason_smem;
> +
> +	struct completion start_done;
> +	struct completion stop_done;
> +
> +	phys_addr_t mem_phys;
> +	phys_addr_t mem_reloc;
> +	void *mem_region;
> +	size_t mem_size;
> +
> +	struct qcom_rproc_glink glink_subdev;
> +	struct qcom_rproc_ssr ssr_subdev;
> +	struct qcom_sysmon *sysmon;
> +};
> +
> +static int qcom_adsp_shutdown(struct qcom_adsp *adsp)
> +{
> +	unsigned long timeout;
> +	unsigned int val;
> +	int ret;
> +
> +	/* Reset the retention logic */
> +	val = readl(adsp->qdsp6ss_base + RET_CFG_REG);
> +	val |= 0x1;
> +	writel(val, adsp->qdsp6ss_base + RET_CFG_REG);
> +
> +	clk_bulk_disable_unprepare(adsp->num_clks, adsp->clks);
> +
> +	/* QDSP6 master port needs to be explicitly halted */
> +	ret = regmap_read(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_PWR_ON_REG, &val);
> +	if (ret || !val)
> +		goto reset;
> +
> +	ret = regmap_read(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_MASTER_IDLE_REG,
> +			&val);
> +	if (ret || val)
> +		goto reset;
> +
> +	regmap_write(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_HALTREQ_REG, 1);
> +
> +	/* Wait for halt ACK from QDSP6 */
> +	timeout = jiffies + msecs_to_jiffies(ACK_TIMEOUT);
> +	for (;;) {
> +		ret = regmap_read(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_HALTACK_REG, &val);
> +		if (ret || val || time_after(jiffies, timeout))
> +			break;
> +
> +		usleep_range(1000, 1100);
> +	}
> +
> +	ret = regmap_read(adsp->halt_map,
> +			adsp->halt_lpass + LPASS_MASTER_IDLE_REG, &val);
> +	if (ret || !val)
> +		dev_err(adsp->dev, "port failed halt\n");
> +
> +reset:
> +	/* Assert the LPASS PDC Reset */
> +	reset_control_assert(adsp->pdc_sync_reset);
> +	/* Place the LPASS processor into reset */
> +	reset_control_assert(adsp->cc_lpass_restart);
> +	/* wait after asserting subsystem restart from AOSS */
> +	usleep_range(200, 300);
> +
> +	/* Clear the halt request for the AXIM and AHBM for Q6 */
> +	regmap_write(adsp->halt_map, adsp->halt_lpass + LPASS_HALTREQ_REG, 
> 0);
> +
> +	/* De-assert the LPASS PDC Reset */
> +	reset_control_deassert(adsp->pdc_sync_reset);
> +	/* Remove the LPASS reset */
> +	reset_control_deassert(adsp->cc_lpass_restart);
> +	/* wait after de-asserting subsystem restart from AOSS */
> +	usleep_range(200, 300);
> +
> +	return 0;
> +}
> +
> +static int adsp_load(struct rproc *rproc, const struct firmware *fw)
> +{
> +	struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
> +
> +	return qcom_mdt_load_no_init(adsp->dev, fw, rproc->firmware, 0,
> +			     adsp->mem_region, adsp->mem_phys, adsp->mem_size,
> +			     &adsp->mem_reloc);
> +}
> +
> +static int adsp_start(struct rproc *rproc)
> +{
> +	struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
> +	int ret;
> +	unsigned int val;
> +
> +	qcom_q6v5_prepare(&adsp->q6v5);
> +
> +	ret = clk_prepare_enable(adsp->xo);
> +	if (ret)
> +		goto disable_irqs;
> +
> +	dev_pm_genpd_set_performance_state(adsp->dev, INT_MAX);
> +	ret = pm_runtime_get_sync(adsp->dev);
> +	if (ret)
> +		goto disable_xo_clk;
> +
> +	ret = clk_bulk_prepare_enable(adsp->num_clks, adsp->clks);
> +	if (ret) {
> +		dev_err(adsp->dev, "adsp clk_enable failed\n");
> +		goto disable_power_domain;
> +	}
> +
> +	/* Program boot address */
> +	writel(adsp->mem_phys >> 4, adsp->qdsp6ss_base + RST_EVB_REG);
> +
> +	/* De-assert QDSP6 stop core. QDSP6 will execute after out of reset 
> */
> +	writel(0x1, adsp->qdsp6ss_base + CORE_START_REG);
> +
> +	/* Trigger boot FSM to start QDSP6 */
> +	writel(0x1, adsp->qdsp6ss_base + BOOT_CMD_REG);
> +
> +	/* Wait for core to come out of reset */
> +	ret = readl_poll_timeout(adsp->qdsp6ss_base + BOOT_STATUS_REG,
> +			val, (val & BIT(0)) != 0, 10, BOOT_FSM_TIMEOUT);
> +	if (ret) {
> +		dev_err(adsp->dev, "failed to bootup adsp\n");
> +		goto disable_adsp_clks;
> +	}
> +
> +	ret = qcom_q6v5_wait_for_start(&adsp->q6v5, msecs_to_jiffies(5 * 
> HZ));
> +	if (ret == -ETIMEDOUT) {
> +		dev_err(adsp->dev, "start timed out\n");
> +		goto disable_adsp_clks;
> +	}
> +
> +	return 0;
> +
> +disable_adsp_clks:
> +	clk_bulk_disable_unprepare(adsp->num_clks, adsp->clks);
> +disable_power_domain:
> +	dev_pm_genpd_set_performance_state(adsp->dev, 0);
> +	pm_runtime_put(adsp->dev);
> +disable_xo_clk:
> +	clk_disable_unprepare(adsp->xo);
> +disable_irqs:
> +	qcom_q6v5_unprepare(&adsp->q6v5);
> +
> +	return ret;
> +}
> +
> +static void qcom_adsp_pil_handover(struct qcom_q6v5 *q6v5)
> +{
> +	struct qcom_adsp *adsp = container_of(q6v5, struct qcom_adsp, q6v5);
> +
> +	clk_disable_unprepare(adsp->xo);
> +	dev_pm_genpd_set_performance_state(adsp->dev, 0);
> +	pm_runtime_put(adsp->dev);
> +}
> +
> +static int adsp_stop(struct rproc *rproc)
> +{
> +	struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
> +	int handover;
> +	int ret;
> +
> +	ret = qcom_q6v5_request_stop(&adsp->q6v5);
> +	if (ret == -ETIMEDOUT)
> +		dev_err(adsp->dev, "timed out on wait\n");
> +
> +	ret = qcom_adsp_shutdown(adsp);
> +	if (ret)
> +		dev_err(adsp->dev, "failed to shutdown: %d\n", ret);
> +
> +	handover = qcom_q6v5_unprepare(&adsp->q6v5);
> +	if (handover)
> +		qcom_adsp_pil_handover(&adsp->q6v5);
> +
> +	return ret;
> +}
> +
> +static void *adsp_da_to_va(struct rproc *rproc, u64 da, int len)
> +{
> +	struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
> +	int offset;
> +
> +	offset = da - adsp->mem_reloc;
> +	if (offset < 0 || offset + len > adsp->mem_size)
> +		return NULL;
> +
> +	return adsp->mem_region + offset;
> +}
> +
> +static const struct rproc_ops adsp_ops = {
> +	.start = adsp_start,
> +	.stop = adsp_stop,
> +	.da_to_va = adsp_da_to_va,
> +	.parse_fw = qcom_register_dump_segments,
> +	.load = adsp_load,
> +};
> +
> +static int adsp_init_clock(struct qcom_adsp *adsp)
> +{
> +	int i, ret;
> +
> +	adsp->xo = devm_clk_get(adsp->dev, "xo");
> +	if (IS_ERR(adsp->xo)) {
> +		ret = PTR_ERR(adsp->xo);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(adsp->dev, "failed to get xo clock");
> +		return ret;
> +	}
> +
> +	adsp->num_clks = ARRAY_SIZE(adsp_clk_id);
> +	adsp->clks = devm_kcalloc(adsp->dev, adsp->num_clks,
> +				sizeof(*adsp->clks), GFP_KERNEL);
> +	if (IS_ERR(adsp->clks)) {
> +		ret = PTR_ERR(adsp->clks);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(adsp->dev, "failed to get adsp clock");
> +		return ret;
> +	}
> +
> +	for (i = 0; i < adsp->num_clks; i++)
> +		adsp->clks[i].id = adsp_clk_id[i];
> +
> +	return devm_clk_bulk_get(adsp->dev, adsp->num_clks, adsp->clks);
> +}
> +
> +static int adsp_init_reset(struct qcom_adsp *adsp)
> +{
> +	adsp->pdc_sync_reset = devm_reset_control_get_exclusive(adsp->dev,
> +			"pdc_sync");
> +	if (IS_ERR(adsp->pdc_sync_reset)) {
> +		dev_err(adsp->dev, "failed to acquire pdc_sync reset\n");
> +		return PTR_ERR(adsp->pdc_sync_reset);
> +	}
> +
> +	adsp->cc_lpass_restart = devm_reset_control_get_exclusive(adsp->dev,
> +			"cc_lpass");
> +	if (IS_ERR(adsp->cc_lpass_restart)) {
> +		dev_err(adsp->dev, "failed to acquire cc_lpass restart\n");
> +		return PTR_ERR(adsp->cc_lpass_restart);
> +	}
> +
> +	return 0;
> +}
> +
> +static int adsp_init_mmio(struct qcom_adsp *adsp,
> +				struct platform_device *pdev)
> +{
> +	struct device_node *syscon;
> +	struct resource *res;
> +	int ret;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	adsp->qdsp6ss_base = devm_ioremap(&pdev->dev, res->start,
> +			resource_size(res));
> +	if (IS_ERR(adsp->qdsp6ss_base)) {
> +		dev_err(adsp->dev, "failed to map QDSP6SS registers\n");
> +		return PTR_ERR(adsp->qdsp6ss_base);
> +	}
> +
> +	syscon = of_parse_phandle(pdev->dev.of_node, "qcom,halt-regs", 0);
> +	if (!syscon) {
> +		dev_err(&pdev->dev, "failed to parse qcom,halt-regs\n");
> +		return -EINVAL;
> +	}
> +
> +	adsp->halt_map = syscon_node_to_regmap(syscon);
> +	of_node_put(syscon);
> +	if (IS_ERR(adsp->halt_map))
> +		return PTR_ERR(adsp->halt_map);
> +
> +	ret = of_property_read_u32_index(pdev->dev.of_node, "qcom,halt-regs",
> +			1, &adsp->halt_lpass);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "no offset in syscon\n");
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
> +{
> +	struct device_node *node;
> +	struct resource r;
> +	int ret;
> +
> +	node = of_parse_phandle(adsp->dev->of_node, "memory-region", 0);
> +	if (!node) {
> +		dev_err(adsp->dev, "no memory-region specified\n");
> +		return -EINVAL;
> +	}
> +
> +	ret = of_address_to_resource(node, 0, &r);
> +	if (ret)
> +		return ret;
> +
> +	adsp->mem_phys = adsp->mem_reloc = r.start;
> +	adsp->mem_size = resource_size(&r);
> +	adsp->mem_region = devm_ioremap_wc(adsp->dev,
> +				adsp->mem_phys, adsp->mem_size);
> +	if (!adsp->mem_region) {
> +		dev_err(adsp->dev, "unable to map memory region: %pa+%zx\n",
> +			&r.start, adsp->mem_size);
> +		return -EBUSY;
> +	}
> +
> +	return 0;
> +}
> +
> +static int adsp_probe(struct platform_device *pdev)
> +{
> +	const struct adsp_pil_data *desc;
> +	struct qcom_adsp *adsp;
> +	struct rproc *rproc;
> +	int ret;
> +
> +	desc = of_device_get_match_data(&pdev->dev);
> +	if (!desc)
> +		return -EINVAL;
> +
> +	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
> +			    desc->firmware_name, sizeof(*adsp));
> +	if (!rproc) {
> +		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
> +		return -ENOMEM;
> +	}
> +
> +	adsp = (struct qcom_adsp *)rproc->priv;
> +	adsp->dev = &pdev->dev;
> +	adsp->rproc = rproc;
> +	platform_set_drvdata(pdev, adsp);
> +
> +	ret = adsp_alloc_memory_region(adsp);
> +	if (ret)
> +		goto free_rproc;
> +
> +	ret = adsp_init_clock(adsp);
> +	if (ret)
> +		goto free_rproc;
> +
> +	pm_runtime_enable(adsp->dev);
> +
> +	ret = adsp_init_reset(adsp);
> +	if (ret)
> +		goto disable_pm;
> +
> +	ret = adsp_init_mmio(adsp, pdev);
> +	if (ret)
> +		goto disable_pm;
> +
> +	ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, 
> desc->crash_reason_smem,
> +			     qcom_adsp_pil_handover);
> +	if (ret)
> +		goto disable_pm;
> +
> +	qcom_add_glink_subdev(rproc, &adsp->glink_subdev);
> +	qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name);
> +	adsp->sysmon = qcom_add_sysmon_subdev(rproc,
> +					      desc->sysmon_name,
> +					      desc->ssctl_id);
> +
> +	ret = rproc_add(rproc);
> +	if (ret)
> +		goto disable_pm;
> +
> +	return 0;
> +
> +disable_pm:
> +	pm_runtime_disable(adsp->dev);
> +free_rproc:
> +	rproc_free(rproc);
> +
> +	return ret;
> +}
> +
> +static int adsp_remove(struct platform_device *pdev)
> +{
> +	struct qcom_adsp *adsp = platform_get_drvdata(pdev);
> +
> +	rproc_del(adsp->rproc);
> +
> +	qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev);
> +	qcom_remove_sysmon_subdev(adsp->sysmon);
> +	qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
> +	pm_runtime_disable(adsp->dev);
> +	rproc_free(adsp->rproc);
> +
> +	return 0;
> +}
> +
> +static const struct adsp_pil_data adsp_resource_init = {
> +	.crash_reason_smem = 423,
> +	.firmware_name = "adsp.mdt",
> +	.ssr_name = "lpass",
> +	.sysmon_name = "adsp",
> +	.ssctl_id = 0x14,
> +};
> +
> +static const struct of_device_id adsp_of_match[] = {
> +	{ .compatible = "qcom,sdm845-adsp-pil",
> +	  .data = &adsp_resource_init},
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, adsp_of_match);
> +
> +static struct platform_driver adsp_pil_driver = {
> +	.probe = adsp_probe,
> +	.remove = adsp_remove,
> +	.driver = {
> +		.name = "qcom_adsp_pil",
> +		.of_match_table = adsp_of_match,
> +	},
> +};
> +
> +module_platform_driver(adsp_pil_driver);
> +MODULE_DESCRIPTION("QTI SDM845 ADSP Peripheral Image Loader");
> +MODULE_LICENSE("GPL v2");

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 15%]

* [PATCH 4.18 000/235] 4.18.10-stable review
@ 2018-09-24 11:49 Greg Kroah-Hartman
  2018-09-24 11:53 ` [PATCH 4.18 217/235] remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote Greg Kroah-Hartman
  0 siblings, 1 reply; 200+ results
From: Greg Kroah-Hartman @ 2018-09-24 11:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah, patches,
	ben.hutchings, lkft-triage, stable

This is the start of the stable review cycle for the 4.18.10 release.
There are 235 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed Sep 26 11:30:01 UTC 2018.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.18.10-rc1.gz
or in the git tree and branch at:
	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.18.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 4.18.10-rc1

Brijesh Singh <brijesh.singh@amd.com>
    crypto: ccp - add timeout support in the SEV command

Dan Carpenter <dan.carpenter@oracle.com>
    mei: bus: type promotion bug in mei_nfc_if_version()

Mikko Perttunen <mperttunen@nvidia.com>
    clk: tegra: bpmp: Don't crash when a clock fails to register

Douglas Anderson <dianders@chromium.org>
    pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant

Douglas Anderson <dianders@chromium.org>
    pinctrl: msm: Fix msm_config_group_get() to be compliant

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    gpiolib: Respect error code of ->get_direction()

Ming Lei <ming.lei@redhat.com>
    blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()

Ming Lei <ming.lei@redhat.com>
    blk-mq: only attempt to merge bio if there is rq in sw queue

Jann Horn <jannh@google.com>
    IB/mlx5: fix uaccess beyond "count" in debugfs read/write handlers

Randy Dunlap <rdunlap@infradead.org>
    block/DAC960.c: fix defined but not used build warnings

Bart Van Assche <bart.vanassche@wdc.com>
    IB/nes: Fix a compiler warning

Ioana Radulescu <ruxandra.radulescu@nxp.com>
    staging: fsl-dpaa2/eth: Fix DMA mapping direction

Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    dmaengine: sh: rcar-dmac: avoid to write CHCR.TE to 1 if TCR is set to 0

Harry Wentland <harry.wentland@amd.com>
    drm/amd/pp: Send khz clock values to DC for smu7/8

Suzuki K Poulose <suzuki.poulose@arm.com>
    arm64: perf: Disable PMU while processing counter overflows

Dan Carpenter <dan.carpenter@oracle.com>
    drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

Hans de Goede <hdegoede@redhat.com>
    ASoC: rt5651: Fix workqueue cancel vs irq free race on remove

John Stultz <john.stultz@linaro.org>
    selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress

Sibi Sankar <sibis@codeaurora.org>
    remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote

James Smart <jsmart2021@gmail.com>
    scsi: lpfc: Fix panic if driver unloaded when port is offline

James Smart <jsmart2021@gmail.com>
    scsi: lpfc: Fix NVME Target crash in defer rcv logic

Hannes Reinecke <hare@suse.de>
    scsi: libfc: fixup 'sleeping function called from invalid context'

Timo Wischer <twischer@de.adit-jv.com>
    ALSA: pcm: Fix snd_interval_refine first/last with open min/max

Li Zhijian <lizhijian@cn.fujitsu.com>
    selftests/android: initialize heap_type to avoid compiling warning

Shuah Khan (Samsung OSG) <shuah@kernel.org>
    selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run

Zhouyang Jia <jiazhouyang09@gmail.com>
    rtc: bq4802: add error handling for devm_ioremap

Wei Lu <wei.lu2@amd.com>
    drm/amdkfd: Fix error codes in kfd_get_process

Shaoyun Liu <Shaoyun.Liu@amd.com>
    drm/amdkfd: Fix kernel queue 64 bit doorbell offset calculation

Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    rcu: Fix grace-period hangs due to race with CPU offline

Peter Rosin <peda@axentia.se>
    input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

Peter Rosin <peda@axentia.se>
    mfd: 88pm860x-i2c: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

Arnd Bergmann <arnd@arndb.de>
    rcutorture: Use monotonic timestamp for stall detection

Maxime Chevallier <maxime.chevallier@bootlin.com>
    net: mvpp2: make sure we use single queue mode on PPv2.1

Linus Walleij <linus.walleij@linaro.org>
    net: gemini: Allow multiple ports to instantiate

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    gpiolib: Mark gpio_suffixes array with __maybe_unused

Wei Yongjun <weiyongjun1@huawei.com>
    gpio: pxa: Fix potential NULL dereference

Tuomas Tynkkynen <tuomas@tuxera.com>
    staging: bcm2835-audio: Don't leak workqueue if open fails

Matias Bjørling <mb@lightnvm.io>
    lightnvm: pblk: enable line minor version detection

Hans Holmberg <hans.holmberg@cnexlabs.com>
    lightnvm: pblk: assume that chunks are closed on 1.2 devices

Dan Carpenter <dan.carpenter@oracle.com>
    ASoC: qdsp6: q6afe-dai: fix a range check in of_q6afe_parse_dai_data()

Eric Yang <Eric.Yang2@amd.com>
    drm/amd/display: support access ddc for mst branch

Dan Williams <dan.j.williams@intel.com>
    tools/testing/nvdimm: Fix support for emulating controller temperature

Jaegeuk Kim <jaegeuk@kernel.org>
    f2fs: do checkpoint in kill_sb

Suzuki K Poulose <suzuki.poulose@arm.com>
    coresight: ETM: Add support for Arm Cortex-A73 and Cortex-A35

Robin Murphy <robin.murphy@arm.com>
    coresight: tpiu: Fix disabling timeouts

Suzuki K Poulose <suzuki.poulose@arm.com>
    coresight: Handle errors in finding input/output ports

Quentin Perret <quentin.perret@arm.com>
    sched/fair: Fix util_avg of new tasks for asymmetric systems

Julia Lawall <Julia.Lawall@lip6.fr>
    parport: sunbpp: fix error return code

Boris Pismenny <borisp@mellanox.com>
    tls: Fix zerocopy_from_iter iov handling

Thierry Reding <treding@nvidia.com>
    drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping

Karol Herbst <karolherbst@gmail.com>
    drm/nouveau/debugfs: Wake up GPU before doing any reclocking

Lyude Paul <lyude@redhat.com>
    drm/nouveau: Fix runtime PM leak in drm_open()

Stefan Agner <stefan@agner.ch>
    mmc: sdhci: do not try to use 3.3V signaling if not supported

Stefan Agner <stefan@agner.ch>
    mmc: tegra: prevent HS200 on Tegra 3

Laurentiu Tudor <laurentiu.tudor@nxp.com>
    mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips

Johan Hovold <johan@kernel.org>
    tty: fix termios input-speed encoding

Johan Hovold <johan@kernel.org>
    tty: fix termios input-speed encoding when using BOTHER

Alexander Sverdlin <alexander.sverdlin@nokia.com>
    serial: 8250: of: Correct of_platform_serial_setup() error handling

Bartosz Golaszewski <brgl@bgdev.pl>
    gpiolib: don't allow userspace to set values of input lines

Russell King <rmk+kernel@armlinux.org.uk>
    ASoC: hdmi-codec: fix routing

Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
    gpu: ipu-v3: csi: pass back mbus_code_to_bus_cfg error codes

Rick Farrington <ricardo.farrington@cavium.com>
    liquidio: fix hang when re-binding VF host drv after running DPDK VF driver

Nicholas Mc Guire <hofrat@osadl.org>
    ARM: hisi: check of_iomap and fix missing of_node_put

Huazhong Tan <tanhuazhong@huawei.com>
    net: hns3: Fix return value error in hns3_reset_notify_down_enet

Nicholas Mc Guire <hofrat@osadl.org>
    ARM: hisi: fix error handling and missing of_node_put

Nicholas Mc Guire <hofrat@osadl.org>
    ARM: hisi: handle of_iomap and fix missing of_node_put

Yunsheng Lin <linyunsheng@huawei.com>
    net: hns3: Fix for reset_level default assignment probelm

Huazhong Tan <tanhuazhong@huawei.com>
    net: hns3: Reset net device with rtnl_lock

Ard Biesheuvel <ard.biesheuvel@linaro.org>
    efi/esrt: Only call efi_mem_reserve() for boot services memory

Andrea Parri <andrea.parri@amarulasolutions.com>
    sched/core: Use smp_mb() in wake_woken_function()

Ryder Lee <ryder.lee@mediatek.com>
    arm64: dts: mt7622: update a clock property for UART0

Tony Lindgren <tony@atomide.com>
    pinctrl: pinmux: Return selector to the pinctrl driver

Tony Lindgren <tony@atomide.com>
    pinctrl: rza1: Fix selector use for groups and functions

Sean Wang <sean.wang@mediatek.com>
    pinctrl: mt7622: Fix probe fail by misuse the selector

Mike Christie <mchristi@redhat.com>
    configfs: fix registered group removal

Paul Burton <paul.burton@mips.com>
    MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads

Alexey Kardashevskiy <aik@ozlabs.ru>
    KVM: PPC: Book3S: Fix matching of hardware and emulated TCE tables

Arvind Yadav <arvind.yadav.cs@gmail.com>
    PM / devfreq: use put_device() instead of kfree()

Eric Biggers <ebiggers@google.com>
    security: check for kstrdup() failure in lsm_append()

Nicholas Mc Guire <hofrat@osadl.org>
    KVM: PPC: Book3S HV: Add of_node_put() in success path

Matthew Garrett <mjg59@google.com>
    evm: Don't deadlock if a crypto algorithm is unavailable

Philipp Puschmann <pp@emlix.com>
    Bluetooth: Use lock_sock_nested in bt_accept_enqueue

Alexandre Belloni <alexandre.belloni@bootlin.com>
    spi: dw: fix possible race condition

Roman Gushchin <guro@fb.com>
    bpf: fix rcu annotations in compute_effective_progs()

Miklos Szeredi <mszeredi@redhat.com>
    vfs: fix freeze protection in mnt_want_write_file() for overlayfs

Jann Horn <jannh@google.com>
    mtdchar: fix overflows in adjustment of `count`

Ronny Chevalier <ronny.chevalier@hp.com>
    audit: fix use-after-free in audit_add_watch

Viresh Kumar <viresh.kumar@linaro.org>
    arm64: dts: uniphier: Add missing cooling device properties for CPUs

Noa Osherovich <noaos@mellanox.com>
    net/mlx5: Add missing SET_DRIVER_VERSION command translation

Maciej W. Rozycki <macro@mips.com>
    binfmt_elf: Respect error return from `regset->active'

Johan Hovold <johan@kernel.org>
    mmc: meson-mx-sdio: fix OF child-node lookup

Johan Hovold <johan@kernel.org>
    of: add helper to lookup compatible child node

Trond Myklebust <trondmy@gmail.com>
    NFSv4.1 fix infinite loop on I/O.

Trond Myklebust <trondmy@gmail.com>
    NFSv4: Fix a tracepoint Oops in initiate_file_draining()

Boris Ostrovsky <boris.ostrovsky@oracle.com>
    x86/EISA: Don't probe EISA bus for Xen PV guests

Rob Herring <robh@kernel.org>
    of: fix phandle cache creation for DTs with no phandles

Adrian Hunter <adrian.hunter@intel.com>
    perf tools: Fix maps__find_symbol_by_name()

Yabin Cui <yabinc@google.com>
    perf/core: Force USER_DS when recording user stack data

Max Filippov <jcmvbkbc@gmail.com>
    xtensa: ISS: don't allocate memory in platform_setup

Dan Carpenter <dan.carpenter@oracle.com>
    cifs: integer overflow in in SMB2_ioctl()

Dan Carpenter <dan.carpenter@oracle.com>
    CIFS: fix wrapping bugs in num_entries()

Dan Carpenter <dan.carpenter@oracle.com>
    cifs: prevent integer overflow in nxt_dir_entry()

Oliver Neukum <oneukum@suse.com>
    Revert "cdc-acm: implement put_char() and flush_chars()"

Jia-Ju Bai <baijiaju1990@gmail.com>
    usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()

Ben Hutchings <ben.hutchings@codethink.co.uk>
    USB: yurex: Fix buffer over-read in yurex_write()

Johan Hovold <johan@kernel.org>
    USB: serial: ti_usb_3410_5052: fix array underflow in completion handler

Jia-Ju Bai <baijiaju1990@gmail.com>
    usb: misc: uss720: Fix two sleep-in-atomic-context bugs

Johan Hovold <johan@kernel.org>
    USB: serial: io_ti: fix array underflow in completion handler

Alan Stern <stern@rowland.harvard.edu>
    USB: net2280: Fix erroneous synchronization change

Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0

Maxence Duprès <xpros64@hotmail.fr>
    USB: add quirk for WORLDE Controller KS49 or Prodipe MIDI 49C USB controller

Jia-Ju Bai <baijiaju1990@gmail.com>
    usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in u132_get_frame()

Mathias Nyman <mathias.nyman@linux.intel.com>
    usb: Avoid use-after-free by flushing endpoints early in usb_set_interface()

Oliver Neukum <oneukum@suse.com>
    usb: uas: add support for more quirk flags

Tim Anderson <tsa@biglakesoftware.com>
    USB: Add quirk to support DJI CineSSD

Mikulas Patocka <mpatocka@redhat.com>
    dm verity: fix crash on bufio buffer that was allocated with vmalloc

Tomas Winkler <tomas.winkler@intel.com>
    mei: bus: need to unlink client before freeing

Tomas Winkler <tomas.winkler@intel.com>
    mei: bus: fix hw module get/put balance

Alexander Usyskin <alexander.usyskin@intel.com>
    mei: ignore not found client in the enumeration

Chunfeng Yun <chunfeng.yun@mediatek.com>
    usb: mtu3: fix error of xhci port id when enable U3 dual role

Chunfeng Yun <chunfeng.yun@mediatek.com>
    usb: xhci: fix interrupt transfer error happened on MTK platforms

Mathias Nyman <mathias.nyman@linux.intel.com>
    usb: Don't die twice if PCI xhci host is not responding in resume

Mathias Nyman <mathias.nyman@linux.intel.com>
    xhci: Fix use after free for URB cancellation on a reallocated endpoint

Gustavo A. R. Silva <gustavo@embeddedor.com>
    misc: hmc6352: fix potential Spectre v1

Bryant G. Ly <bryantly@linux.ibm.com>
    misc: ibmvsm: Fix wrong assignment of return code

K. Y. Srinivasan <kys@microsoft.com>
    Tools: hv: Fix a bug in the key delete code

Stephen Hemminger <stephen@networkplumber.org>
    vmbus: don't return values for uninitalized channels

Miklos Szeredi <mszeredi@redhat.com>
    ovl: fix oopses in ovl_fill_super() failure paths

Corey Minyard <cminyard@mvista.com>
    ipmi: Fix I2C client removal in the SSIF driver

Corey Minyard <cminyard@mvista.com>
    ipmi: Move BT capabilities detection to the detect call

Corey Minyard <cminyard@mvista.com>
    ipmi: Rework SMI registration failure

Andreas Kemnade <andreas@kemnade.info>
    mmc: omap_hsmmc: fix wakeirq handling on removal

Ingo Franzki <ifranzki@linux.ibm.com>
    s390/crypto: Fix return code checking in cbc_paes_crypt()

Aaron Knister <aaron.s.knister@nasa.gov>
    IB/ipoib: Avoid a race condition between start_xmit and cm_rep_handler

Juergen Gross <jgross@suse.com>
    xen/netfront: fix waiting for xenbus state change

Bin Yang <bin.yang@intel.com>
    pstore: Fix incorrect persistent ram buffer mapping

Parav Pandit <parav@mellanox.com>
    RDMA/cma: Protect cma dev list with lock

Xiao Liang <xiliang@redhat.com>
    xen-netfront: fix warn message as irq device name has '/'

Alexandru Gagniuc <mr.nuke.me@gmail.com>
    PCI/AER: Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST

Joerg Roedel <jroedel@suse.de>
    x86/mm/pti: Add an overflow check to pti_clone_pmds()

Jiang Biao <jiang.biao2@zte.com.cn>
    x86/pti: Check the return value of pti_user_pagetable_walk_pmd()

Jiang Biao <jiang.biao2@zte.com.cn>
    x86/pti: Check the return value of pti_user_pagetable_walk_p4d()

Michael Müller <michael@fds-team.de>
    crypto: sharah - Unregister correct algorithms for SAHARA 3

Hanna Hawa <hannah@marvell.com>
    dmaengine: mv_xor_v2: kill the tasklets upon exit

Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    iommu/ipmmu-vmsa: IMUCTRn.TTSEL needs a special usage on R-Car Gen3

Niklas Cassel <niklas.cassel@linaro.org>
    regulator: qcom_spmi: Fix warning Bad of_node_put()

Niklas Cassel <niklas.cassel@linaro.org>
    regulator: qcom_spmi: Use correct regmap when checking for error

Rex Zhu <rex.zhu@amd.com>
    drm/amd/pp: Set Max clock level to display by default

Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
    i2c: aspeed: Fix initial values of master and slave state

Pingfan Liu <kernelfans@gmail.com>
    drivers/base: stop new probing during shutdown

Christoffer Dall <christoffer.dall@arm.com>
    KVM: arm/arm64: Fix vgic init race

Randy Dunlap <rdunlap@infradead.org>
    platform/x86: toshiba_acpi: Fix defined but not used build warnings

Julian Wiedmann <jwi@linux.ibm.com>
    s390/qeth: reset layer2 attribute on layer switch

Julian Wiedmann <jwi@linux.ibm.com>
    s390/qeth: fix race in used-buffer accounting

Bjorn Andersson <bjorn.andersson@linaro.org>
    soc: qcom: smem: Correct check for global partition

Bhushan Shah <bshah@kde.org>
    ARM: dts: qcom: msm8974-hammerhead: increase load on l20 for sdhci

Loic Poulain <loic.poulain@linaro.org>
    arm64: dts: qcom: db410c: Fix Bluetooth LED trigger

Vitaly Kuznetsov <vkuznets@redhat.com>
    xen-netfront: fix queue name setting

Jakub Kicinski <jakub.kicinski@netronome.com>
    nfp: avoid buffer leak when FW communication fails

Yue Wang <yuleopen@gmail.com>
    ALSA: usb-audio: Generic DSD detection for Thesycon-based implementations

Ard Biesheuvel <ard.biesheuvel@linaro.org>
    efi/arm: preserve early mapping of UEFI memory map longer for BGRT

Leonard Crestez <leonard.crestez@nxp.com>
    reset: imx7: Fix always writing bits as 0

Mark Rutland <mark.rutland@arm.com>
    arm64: fix possible spectre-v1 write in ptrace_hbp_set_event()

YueHaibing <yuehaibing@huawei.com>
    wan/fsl_ucc_hdlc: use IS_ERR_VALUE() to check return value of qe_muram_alloc

Piotr Sawicki <p.sawicki2@partner.samsung.com>
    Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets

Manikanta Pubbisetty <mpubbise@codeaurora.org>
    mac80211: restrict delayed tailroom needed decrement

Paul Cercueil <paul@crapouillou.net>
    MIPS: jz4740: Bump zload address

Oder Chiou <oder_chiou@realtek.com>
    ASoC: rt5514: Fix the issue of the delay volume applied

Nicholas Mc Guire <hofrat@osadl.org>
    staging: bcm2835-camera: handle wait_for_completion_timeout return properly

Nicholas Mc Guire <hofrat@osadl.org>
    staging: bcm2835-camera: fix timeout handling in wait_for_completion_timeout

Sandipan Das <sandipan@linux.ibm.com>
    perf script: Show correct offsets for DWARF-based unwinding

Nicholas Piggin <npiggin@gmail.com>
    powerpc/powernv: opal_put_chars partial write fix

Mark Rutland <mark.rutland@arm.com>
    KVM: arm/arm64: vgic: Fix possible spectre-v1 write in vgic_mmio_write_apr()

Sagi Grimberg <sagi@grimberg.me>
    nvme-rdma: unquiesce queues when deleting the controller

Sagi Grimberg <sagi@grimberg.me>
    nvmet: fix file discard return status

Sandipan Das <sandipan@linux.ibm.com>
    perf powerpc: Fix callchain ip filtering

Krzysztof Kozlowski <krzk@kernel.org>
    ARM: exynos: Clear global variable on init error path

Arnd Bergmann <arnd@arndb.de>
    omapfb: rename omap2 module to omap2fb.ko

Fredrik Noring <noring@nocrew.org>
    fbdev: Distinguish between interlaced and progressive modes

Daniel Mack <daniel@zonque.org>
    video: fbdev: pxafb: clear allocated memory for video modes

Sandipan Das <sandipan@linux.ibm.com>
    perf powerpc: Fix callchain ip filtering when return address is in a register

Randy Dunlap <rdunlap@infradead.org>
    fbdev/via: fix defined but not used warning

Anton Vasilyev <vasilyev@ispras.ru>
    video: goldfishfb: fix memory leak on driver remove

Jiri Olsa <jolsa@redhat.com>
    perf tools: Fix struct comm_str removal crash

Dan Carpenter <dan.carpenter@oracle.com>
    fbdev: omapfb: off by one in omapfb_register_client()

Sandipan Das <sandipan@linux.ibm.com>
    perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups

Sandipan Das <sandipan@linux.ibm.com>
    perf tests: Fix record+probe_libc_inet_pton.sh when event exists

Sandipan Das <sandipan@linux.ibm.com>
    perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64

Jiri Olsa <jolsa@kernel.org>
    perf tools: Synthesize GROUP_DESC feature in pipe mode

Bob Peterson <rpeterso@redhat.com>
    gfs2: Don't reject a supposedly full bitmap if we have blocks reserved

Thomas Richter <tmricht@linux.ibm.com>
    perf test: Fix subtest number when showing results

Todor Tomov <todor.tomov@linaro.org>
    media: ov5645: Supported external clock is 24MHz

Randy Dunlap <rdunlap@infradead.org>
    mtd/maps: fix solutionengine.c printk format warnings

Wei Yongjun <weiyongjun1@huawei.com>
    IB/ipoib: Fix error return code in ipoib_dev_init()

Mike Snitzer <snitzer@redhat.com>
    block: allow max_discard_segments to be stacked

Zhu Yanjun <yanjun.zhu@oracle.com>
    IB/rxe: Drop QP0 silently

Hans Verkuil <hverkuil@xs4all.nl>
    media: videobuf2-core: check for q->error in vb2_core_qbuf()

Felix Fietkau <nbd@nbd.name>
    MIPS: ath79: fix system restart

John Keeping <john@metanate.com>
    dmaengine: pl330: fix irq race with terminate_all

Krzysztof Ha?asa <khalasa@piap.pl>
    media: tw686x: Fix oops on buffer alloc failure

Masahiro Yamada <yamada.masahiro@socionext.com>
    kbuild: do not update config when running install targets

Masahiro Yamada <yamada.masahiro@socionext.com>
    kbuild: add .DELETE_ON_ERROR special target

Rajan Vaja <rajan.vaja@xilinx.com>
    clk: clk-fixed-factor: Clear OF_POPULATED flag in case of failure

Mikko Perttunen <mperttunen@nvidia.com>
    clk: core: Potentially free connection id

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Input: pxrc - fix freeing URB on device teardown

Gregory CLEMENT <gregory.clement@bootlin.com>
    clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent

Nicholas Mc Guire <hofrat@osadl.org>
    clk: imx6sll: fix missing of_node_put()

Nicholas Mc Guire <hofrat@osadl.org>
    clk: imx6ul: fix missing of_node_put()

Andreas Gruenbacher <agruenba@redhat.com>
    gfs2: Special-case rindex for gfs2_grow

Golan Ben Ami <golan.ben.ami@intel.com>
    iwlwifi: cancel the injective function between hw pointers to tfd entry index

Jakub Kicinski <jakub.kicinski@netronome.com>
    nfp: don't fail probe on pci_sriov_set_totalvfs() errors

YueHaibing <yuehaibing@huawei.com>
    amd-xgbe: use dma_mapping_error to check map errors

YueHaibing <yuehaibing@huawei.com>
    xfrm: fix 'passing zero to ERR_PTR()' warning

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Fix multiple definitions in AU0828_DEVICE() macro

Jeff Crukley <jcrukley@gmail.com>
    ALSA: usb-audio: Add support for Encore mDSD USB DAC

Takashi Iwai <tiwai@suse.de>
    ALSA: msnd: Fix the default sample sizes

Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
    iommu/io-pgtable-arm: Fix pgtable allocation in selftest

Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
    iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE

Miao Zhong <zhongmiao@hisilicon.com>
    iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register

Erich E. Hoover <ehoover@sweptlaser.com>
    usb: dwc3: change stream event enable bit back to 13

Tariq Toukan <tariqt@mellanox.com>
    net/mlx5: Use u16 for Work Queue buffer fragment size

Roi Dayan <roid@mellanox.com>
    net/mlx5: Fix possible deadlock from lockdep when adding fte to fg

Roi Dayan <roid@mellanox.com>
    net/mlx5: Fix not releasing read lock when adding flow rules

Vincent Whitchurch <vincent.whitchurch@axis.com>
    tcp: really ignore MSG_ZEROCOPY if no SO_ZEROCOPY

Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
    erspan: return PACKET_REJECT when the appropriate tunnel is not found

Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
    erspan: fix error handling for erspan tunnel

Jack Morgenstein <jackm@dev.mellanox.co.il>
    net/mlx5: Fix debugfs cleanup in the device init/remove flow

Huy Nguyen <huyn@mellanox.com>
    net/mlx5: Check for error in mlx5_attach_interface

Vakul Garg <vakul.garg@nxp.com>
    net/tls: Set count of SG entries if sk_alloc_sg returns -ENOSPC

Raed Salem <raeds@mellanox.com>
    net/mlx5: E-Switch, Fix memory leak when creating switchdev mode FDB tables

Cong Wang <xiyou.wangcong@gmail.com>
    tipc: orphan sock in tipc_release()

Cong Wang <xiyou.wangcong@gmail.com>
    rds: fix two RCU related problems

Stefan Wahren <stefan.wahren@i2se.com>
    net: qca_spi: Fix race condition in spi transfers

Jack Morgenstein <jackm@dev.mellanox.co.il>
    net/mlx5: Fix use-after-free in self-healing flow

Petr Oros <poros@redhat.com>
    be2net: Fix memory leak in be_cmd_get_profile_config()


-------------

Diffstat:

 Makefile                                           |  31 ++++--
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     |   2 +
 arch/arm/mach-exynos/suspend.c                     |   1 +
 arch/arm/mach-hisi/hotplug.c                       |  41 +++++---
 arch/arm64/boot/dts/mediatek/mt7622.dtsi           |   2 +-
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi          |   2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi   |   2 +
 arch/arm64/kernel/perf_event.c                     |  50 +++++-----
 arch/arm64/kernel/ptrace.c                         |  19 ++--
 arch/mips/ath79/setup.c                            |   1 +
 arch/mips/include/asm/mach-ath79/ath79.h           |   1 +
 arch/mips/jz4740/Platform                          |   2 +-
 arch/mips/loongson64/common/cs5536/cs5536_ohci.c   |   2 +-
 arch/powerpc/kvm/book3s_64_vio.c                   |   5 +-
 arch/powerpc/kvm/book3s_hv.c                       |   2 +
 arch/powerpc/platforms/powernv/opal.c              |   2 +-
 arch/s390/crypto/paes_s390.c                       |   2 +-
 arch/x86/kernel/eisa.c                             |  10 +-
 arch/x86/mm/pti.c                                  |  25 ++++-
 arch/xtensa/platforms/iss/setup.c                  |  25 +++--
 block/blk-core.c                                   |   8 +-
 block/blk-mq-sched.c                               |   3 +-
 block/blk-settings.c                               |   2 +-
 crypto/api.c                                       |   2 +-
 drivers/base/core.c                                |   3 +
 drivers/block/DAC960.c                             |   9 +-
 drivers/char/ipmi/ipmi_bt_sm.c                     |  92 ++++++++---------
 drivers/char/ipmi/ipmi_msghandler.c                |  53 +++++-----
 drivers/char/ipmi/ipmi_si_intf.c                   |  17 +---
 drivers/char/ipmi/ipmi_ssif.c                      |  30 ++----
 drivers/clk/clk-fixed-factor.c                     |   9 +-
 drivers/clk/clk.c                                  |   3 +
 drivers/clk/imx/clk-imx6sll.c                      |   1 +
 drivers/clk/imx/clk-imx6ul.c                       |   1 +
 drivers/clk/mvebu/armada-37xx-periph.c             |   3 -
 drivers/clk/tegra/clk-bpmp.c                       |  12 ++-
 drivers/crypto/ccp/psp-dev.c                       |  46 ++++++++-
 drivers/crypto/sahara.c                            |   4 +-
 drivers/devfreq/devfreq.c                          |   4 +-
 drivers/dma/mv_xor_v2.c                            |   2 +
 drivers/dma/pl330.c                                |   5 +-
 drivers/dma/sh/rcar-dmac.c                         |   5 +-
 drivers/firmware/efi/arm-init.c                    |   1 -
 drivers/firmware/efi/arm-runtime.c                 |   4 +-
 drivers/firmware/efi/esrt.c                        |   3 +-
 drivers/gpio/gpio-pxa.c                            |   2 +
 drivers/gpio/gpiolib.c                             |  14 ++-
 drivers/gpio/gpiolib.h                             |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c          |   9 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c           |   2 +
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |   4 +
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c      |   9 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   |   8 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c   |   6 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c          |   4 +
 drivers/gpu/drm/nouveau/nouveau_drm.c              |   6 +-
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |  13 +++
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c      |   2 +-
 drivers/gpu/ipu-v3/ipu-csi.c                       |  20 +++-
 drivers/hv/vmbus_drv.c                             |   3 +
 drivers/hwtracing/coresight/coresight-etm4x.c      |  31 +++---
 drivers/hwtracing/coresight/coresight-tpiu.c       |   7 +-
 drivers/hwtracing/coresight/coresight.c            |   7 +-
 drivers/i2c/busses/i2c-aspeed.c                    |   4 +-
 drivers/infiniband/core/cma.c                      |  12 ++-
 drivers/infiniband/hw/mlx5/cong.c                  |   9 +-
 drivers/infiniband/hw/mlx5/mr.c                    |  32 ++----
 drivers/infiniband/hw/nes/nes.h                    |   2 +-
 drivers/infiniband/sw/rxe/rxe_recv.c               |   9 +-
 drivers/infiniband/ulp/ipoib/ipoib_cm.c            |   2 +
 drivers/infiniband/ulp/ipoib/ipoib_main.c          |   3 +-
 drivers/input/joystick/pxrc.c                      |  66 ++++++-------
 drivers/input/touchscreen/rohm_bu21023.c           |   4 +-
 drivers/iommu/arm-smmu-v3.c                        |   1 +
 drivers/iommu/io-pgtable-arm-v7s.c                 |   7 +-
 drivers/iommu/io-pgtable-arm.c                     |   3 +-
 drivers/iommu/ipmmu-vmsa.c                         |   8 ++
 drivers/lightnvm/pblk-init.c                       |   5 +-
 drivers/lightnvm/pblk-recovery.c                   |   5 +-
 drivers/md/dm-verity-target.c                      |  24 ++++-
 drivers/media/common/videobuf2/videobuf2-core.c    |   5 +
 drivers/media/i2c/ov5645.c                         |  13 +--
 drivers/media/pci/tw686x/tw686x-video.c            |  11 ++-
 drivers/mfd/88pm860x-i2c.c                         |   8 +-
 drivers/misc/hmc6352.c                             |   2 +
 drivers/misc/ibmvmc.c                              |   2 +-
 drivers/misc/mei/bus-fixup.c                       |   2 +-
 drivers/misc/mei/bus.c                             |  12 +--
 drivers/misc/mei/hbm.c                             |   9 +-
 drivers/mmc/host/meson-mx-sdio.c                   |   8 +-
 drivers/mmc/host/omap_hsmmc.c                      |   1 +
 drivers/mmc/host/sdhci-of-esdhc.c                  |   6 ++
 drivers/mmc/host/sdhci-tegra.c                     |   3 +-
 drivers/mmc/host/sdhci.c                           |   9 +-
 drivers/mtd/maps/solutionengine.c                  |   6 +-
 drivers/mtd/mtdchar.c                              |  10 +-
 drivers/net/ethernet/amd/xgbe/xgbe-desc.c          |   7 +-
 .../ethernet/cavium/liquidio/cn23xx_pf_device.c    |   3 +
 .../ethernet/cavium/liquidio/cn23xx_vf_device.c    |   3 +
 drivers/net/ethernet/cortina/gemini.c              |   5 +-
 drivers/net/ethernet/emulex/benet/be_cmds.c        |   2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |   8 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |   5 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c    |   6 ++
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/dev.c      |  15 ++-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c  |  76 +++++++-------
 drivers/net/ethernet/mellanox/mlx5/core/health.c   |  10 +-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  12 ++-
 drivers/net/ethernet/mellanox/mlx5/core/wq.c       |   4 +-
 drivers/net/ethernet/mellanox/mlx5/core/wq.h       |   2 +-
 drivers/net/ethernet/netronome/nfp/nfp_main.c      |  20 ++--
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |  13 ++-
 drivers/net/ethernet/qualcomm/qca_7k.c             |  76 +++++++-------
 drivers/net/ethernet/qualcomm/qca_spi.c            | 110 +++++++++++----------
 drivers/net/ethernet/qualcomm/qca_spi.h            |   5 -
 drivers/net/wan/fsl_ucc_hdlc.c                     |   6 +-
 drivers/net/wireless/intel/iwlwifi/pcie/internal.h |  12 ++-
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c       |  11 ++-
 drivers/net/xen-netfront.c                         |  30 +++---
 drivers/nvme/host/rdma.c                           |   2 +
 drivers/nvme/target/io-cmd-file.c                  |  18 ++--
 drivers/of/base.c                                  |  28 ++++++
 drivers/parport/parport_sunbpp.c                   |   8 +-
 drivers/pci/pcie/aer.c                             |   6 ++
 drivers/pinctrl/mediatek/pinctrl-mt7622.c          |   4 +-
 drivers/pinctrl/pinctrl-rza1.c                     |  24 ++---
 drivers/pinctrl/pinmux.c                           |  16 ++-
 drivers/pinctrl/qcom/pinctrl-msm.c                 |  14 ++-
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |  32 ++++--
 drivers/platform/x86/toshiba_acpi.c                |   3 +-
 drivers/regulator/qcom_spmi-regulator.c            |  34 ++++---
 drivers/remoteproc/qcom_q6v5_pil.c                 |   1 -
 drivers/reset/reset-imx7.c                         |   2 +-
 drivers/rtc/rtc-bq4802.c                           |   4 +
 drivers/s390/net/qeth_core_main.c                  |   3 +-
 drivers/s390/net/qeth_core_sys.c                   |   1 +
 drivers/scsi/libfc/fc_disc.c                       |   7 +-
 drivers/scsi/lpfc/lpfc_nvme.c                      |   5 +-
 drivers/scsi/lpfc/lpfc_nvmet.c                     |  12 ++-
 drivers/soc/qcom/smem.c                            |  10 +-
 drivers/spi/spi-dw.c                               |   3 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c     |   2 +-
 .../vc04_services/bcm2835-audio/bcm2835-vchiq.c    |  16 +--
 .../vc04_services/bcm2835-camera/bcm2835-camera.c  |   7 +-
 .../vc04_services/bcm2835-camera/mmal-vchiq.c      |  11 ++-
 drivers/tty/serial/8250/8250_of.c                  |   2 +-
 drivers/tty/tty_baudrate.c                         |  13 ++-
 drivers/usb/class/cdc-acm.c                        |  73 --------------
 drivers/usb/class/cdc-acm.h                        |   1 -
 drivers/usb/class/cdc-wdm.c                        |   2 +-
 drivers/usb/core/hcd-pci.c                         |   2 -
 drivers/usb/core/message.c                         |  11 +++
 drivers/usb/core/quirks.c                          |   7 ++
 drivers/usb/dwc3/gadget.h                          |   2 +-
 drivers/usb/gadget/udc/net2280.c                   |  16 ++-
 drivers/usb/gadget/udc/renesas_usb3.c              |   5 +-
 drivers/usb/host/u132-hcd.c                        |   2 +-
 drivers/usb/host/xhci-mem.c                        |   4 +
 drivers/usb/host/xhci.c                            |  30 ++++++
 drivers/usb/misc/uss720.c                          |   4 +-
 drivers/usb/misc/yurex.c                           |   5 +-
 drivers/usb/mtu3/mtu3_core.c                       |   6 +-
 drivers/usb/mtu3/mtu3_hw_regs.h                    |   1 +
 drivers/usb/serial/io_ti.h                         |   2 +-
 drivers/usb/serial/ti_usb_3410_5052.c              |   2 +-
 drivers/usb/storage/scsiglue.c                     |   9 ++
 drivers/usb/storage/uas.c                          |  21 ++++
 drivers/usb/storage/unusual_devs.h                 |   7 ++
 drivers/video/fbdev/core/modedb.c                  |  41 +++++---
 drivers/video/fbdev/goldfishfb.c                   |   1 +
 drivers/video/fbdev/omap/omapfb_main.c             |   2 +-
 drivers/video/fbdev/omap2/omapfb/Makefile          |   4 +-
 drivers/video/fbdev/pxafb.c                        |   4 +-
 drivers/video/fbdev/via/viafbdev.c                 |   3 +-
 fs/binfmt_elf.c                                    |   2 +-
 fs/cifs/readdir.c                                  |  11 ++-
 fs/cifs/smb2pdu.c                                  |  29 +++---
 fs/configfs/dir.c                                  |  11 +++
 fs/f2fs/super.c                                    |  16 ++-
 fs/gfs2/bmap.c                                     |   2 +-
 fs/gfs2/rgrp.c                                     |   3 +-
 fs/namespace.c                                     |   7 +-
 fs/nfs/nfs4proc.c                                  |  10 +-
 fs/nfs/nfs4state.c                                 |   2 +
 fs/nfs/nfs4trace.h                                 |   2 +-
 fs/overlayfs/super.c                               |  26 ++---
 fs/pstore/ram_core.c                               |  17 +++-
 include/linux/crypto.h                             |   5 +
 include/linux/mlx5/driver.h                        |   4 +-
 include/linux/of.h                                 |   8 ++
 kernel/audit_watch.c                               |  12 ++-
 kernel/bpf/cgroup.c                                |   7 +-
 kernel/events/core.c                               |   4 +
 kernel/rcu/rcutorture.c                            |   5 +-
 kernel/rcu/tree.c                                  |   6 ++
 kernel/rcu/tree.h                                  |   4 +
 kernel/sched/fair.c                                |  10 +-
 kernel/sched/wait.c                                |  47 ++++-----
 net/bluetooth/af_bluetooth.c                       |   2 +-
 net/core/skbuff.c                                  |   3 -
 net/ipv4/ip_gre.c                                  |   5 +
 net/ipv4/tcp.c                                     |   2 +-
 net/mac80211/cfg.c                                 |   2 +-
 net/mac80211/key.c                                 |  24 +++--
 net/rds/bind.c                                     |   5 +-
 net/tipc/socket.c                                  |   1 +
 net/tls/tls_sw.c                                   |  14 ++-
 net/xfrm/xfrm_policy.c                             |   5 +-
 scripts/Kbuild.include                             |   3 +
 security/integrity/evm/evm_crypto.c                |   3 +-
 security/security.c                                |   2 +
 security/smack/smack_lsm.c                         |  14 ++-
 sound/core/pcm_lib.c                               |  14 ++-
 sound/isa/msnd/msnd_pinnacle.c                     |   4 +-
 sound/soc/codecs/hdmi-codec.c                      |  21 ++--
 sound/soc/codecs/rt5514.c                          |   8 +-
 sound/soc/codecs/rt5651.c                          |  22 +++--
 sound/soc/qcom/qdsp6/q6afe-dai.c                   |   2 +-
 sound/usb/quirks-table.h                           |   3 +-
 sound/usb/quirks.c                                 |   2 +
 tools/hv/hv_kvp_daemon.c                           |   2 +-
 tools/perf/arch/powerpc/util/skip-callchain-idx.c  |  10 +-
 tools/perf/tests/builtin-test.c                    |   2 +-
 .../tests/shell/record+probe_libc_inet_pton.sh     |  36 ++++++-
 tools/perf/util/comm.c                             |  16 ++-
 tools/perf/util/header.c                           |   2 +-
 tools/perf/util/machine.c                          |   9 +-
 tools/perf/util/map.c                              |  11 +++
 tools/perf/util/unwind-libdw.c                     |   2 +-
 tools/perf/util/unwind-libunwind-local.c           |   2 +-
 tools/testing/nvdimm/test/nfit.c                   |   3 +-
 .../testing/selftests/android/ion/ionapp_export.c  |   1 +
 tools/testing/selftests/timers/raw_skew.c          |   5 +
 tools/testing/selftests/vDSO/vdso_test.c           |   7 +-
 virt/kvm/arm/vgic/vgic-init.c                      |   4 +
 virt/kvm/arm/vgic/vgic-mmio-v2.c                   |   3 +
 238 files changed, 1599 insertions(+), 926 deletions(-)



^ permalink raw reply	[relevance 1%]

* [PATCH 4.18 217/235] remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote
  2018-09-24 11:49 [PATCH 4.18 000/235] 4.18.10-stable review Greg Kroah-Hartman
@ 2018-09-24 11:53 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 200+ results
From: Greg Kroah-Hartman @ 2018-09-24 11:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Bjorn Andersson, Sibi Sankar, Sasha Levin

4.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sibi Sankar <sibis@codeaurora.org>

[ Upstream commit 7cbb540a3a68e4d4a8bef2d9451afb1635b5d2d3 ]

GCC_MSS_AXIS2 clock is used for disabling boot IMEM (a part of
AP boot up). With Boot IMEM disable now a part TZ/ATF, AXIS2
clock is no longer required post AP boot up and expected to
remain untouched. However if the clock is turned ON after Q6
is brought out of reset and later turned off, it results in
modem hang. When Q6 attempts a power collapse the internal
handshaking to check if AXIS2 is idle never goes through since
it is turned off preventing the RSC from getting triggered,
leaving modem in a funky state. Hence removing AXIS2 clk
enable/disable from the driver.

Reported-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/remoteproc/qcom_q6v5_pil.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -1370,7 +1370,6 @@ static const struct rproc_hexagon_res sd
 	.hexagon_mba_image = "mba.mbn",
 	.proxy_clk_names = (char*[]){
 			"xo",
-			"axis2",
 			"prng",
 			NULL
 	},



^ permalink raw reply	[relevance 8%]

* Re: [PATCH] remoteproc: qcom: q6v5: Propagate EPROBE_DEFER
      [irrelevant] <20180920015151.15957-1-bjorn.andersson@linaro.org>
@ 2018-09-25  6:50 ` Sibi Sankar
  2018-10-06  6:39   ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-09-25  6:50 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ohad Ben-Cohen, linux-remoteproc, linux-kernel, linux-arm-msm,
	stable, linux-arm-msm-owner

On 2018-09-20 07:21, Bjorn Andersson wrote:
> In the case that the interrupts fail to result because of the
> interrupt-controller not yet being registered the
> platform_get_irq_byname() call will fail with -EPROBE_DEFER, but 
> passing
> this into devm_request_threaded_irq() will result in -EINVAL being
> returned, the driver is therefor not reprobed later.
> 

The patch looks fine.
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>

> Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource 
> handling")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/remoteproc/qcom_q6v5.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5.c 
> b/drivers/remoteproc/qcom_q6v5.c
> index 61a760ee4aac..e9ab90c19304 100644
> --- a/drivers/remoteproc/qcom_q6v5.c
> +++ b/drivers/remoteproc/qcom_q6v5.c
> @@ -198,6 +198,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> platform_device *pdev,
>  	}
> 
>  	q6v5->fatal_irq = platform_get_irq_byname(pdev, "fatal");
> +	if (q6v5->fatal_irq == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
> +
>  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->fatal_irq,
>  					NULL, q6v5_fatal_interrupt,
>  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> @@ -208,6 +211,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> platform_device *pdev,
>  	}
> 
>  	q6v5->ready_irq = platform_get_irq_byname(pdev, "ready");
> +	if (q6v5->ready_irq == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
> +
>  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->ready_irq,
>  					NULL, q6v5_ready_interrupt,
>  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> @@ -218,6 +224,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> platform_device *pdev,
>  	}
> 
>  	q6v5->handover_irq = platform_get_irq_byname(pdev, "handover");
> +	if (q6v5->handover_irq == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
> +
>  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->handover_irq,
>  					NULL, q6v5_handover_interrupt,
>  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> @@ -229,6 +238,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> platform_device *pdev,
>  	disable_irq(q6v5->handover_irq);
> 
>  	q6v5->stop_irq = platform_get_irq_byname(pdev, "stop-ack");
> +	if (q6v5->stop_irq == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
> +
>  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->stop_irq,
>  					NULL, q6v5_stop_interrupt,
>  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 13%]

* Re: [PATCH] remoteproc: qcom: pas: Add QCS404 remoteprocs
      [irrelevant] <20180920172237.30965-1-bjorn.andersson@linaro.org>
@ 2018-09-25 10:18 ` Sibi Sankar
      [irrelevant]   ` <20180925233550.GB27436@tuxbook-pro>
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-09-25 10:18 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ohad Ben-Cohen, Rob Herring, Mark Rutland, linux-remoteproc,
	devicetree, linux-kernel, linux-arm-msm, linux-kernel-owner

Hi Bjorn,

On 2018-09-20 22:52, Bjorn Andersson wrote:
> From: Govind Singh <govinds@codeaurora.org>
> 
> Add compatibles for the three PAS based remote processors found in
> QCS404.
> 
> Signed-off-by: Govind Singh <govinds@codeaurora.org>
> [bjorn: Added adsp and cdsp to the patch]
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  .../devicetree/bindings/remoteproc/qcom,adsp.txt     |  3 +++
>  drivers/remoteproc/qcom_adsp_pil.c                   | 12 ++++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git
> a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> index b7d058228185..9c0cff3a5ed8 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> @@ -10,6 +10,9 @@ on the Qualcomm ADSP Hexagon core.
>  		    "qcom,msm8974-adsp-pil"
>  		    "qcom,msm8996-adsp-pil"
>  		    "qcom,msm8996-slpi-pil"
> +		    "qcom,qcs404-adsp-pas"
> +		    "qcom,qcs404-cdsp-pas"
> +		    "qcom,qcs404-wcss-pas"
>  		    "qcom,sdm845-adsp-pas"
>  		    "qcom,sdm845-cdsp-pas"
> 
> diff --git a/drivers/remoteproc/qcom_adsp_pil.c
> b/drivers/remoteproc/qcom_adsp_pil.c
> index da2254ea1135..fcbb816a9698 100644
> --- a/drivers/remoteproc/qcom_adsp_pil.c
> +++ b/drivers/remoteproc/qcom_adsp_pil.c
> @@ -362,10 +362,22 @@ static const struct adsp_data slpi_resource_init 
> = {
>  		.ssctl_id = 0x16,
>  };
> 
> +static const struct adsp_data wcss_resource_init = {
> +	.crash_reason_smem = 421,
> +	.firmware_name = "wcnss.mdt",
> +	.pas_id = 6,
> +	.ssr_name = "mpss",
> +	.sysmon_name = "wlan",

Shouldn't the sysmon name be "wcnss" instead of "wlan"?

> +	.ssctl_id = 0x12,
> +};
> +
>  static const struct of_device_id adsp_of_match[] = {
>  	{ .compatible = "qcom,msm8974-adsp-pil", .data = 
> &adsp_resource_init},
>  	{ .compatible = "qcom,msm8996-adsp-pil", .data = 
> &adsp_resource_init},
>  	{ .compatible = "qcom,msm8996-slpi-pil", .data = 
> &slpi_resource_init},
> +	{ .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init 
> },
> +	{ .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init 
> },
> +	{ .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init 
> },
>  	{ .compatible = "qcom,sdm845-adsp-pas", .data = &adsp_resource_init},
>  	{ .compatible = "qcom,sdm845-cdsp-pas", .data = &cdsp_resource_init},
>  	{ },

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] remoteproc: qcom: pas: Add QCS404 remoteprocs
      [irrelevant]   ` <20180925233550.GB27436@tuxbook-pro>
@ 2018-09-26 15:48     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-26 15:48 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ohad Ben-Cohen, Rob Herring, Mark Rutland, linux-remoteproc,
	devicetree, linux-kernel, linux-arm-msm, linux-kernel-owner,
	linux-remoteproc-owner

On 2018-09-26 05:05, Bjorn Andersson wrote:
> On Tue 25 Sep 03:18 PDT 2018, Sibi Sankar wrote:
>> On 2018-09-20 22:52, Bjorn Andersson wrote:
>> > diff --git a/drivers/remoteproc/qcom_adsp_pil.c
>> > b/drivers/remoteproc/qcom_adsp_pil.c
>> > index da2254ea1135..fcbb816a9698 100644
>> > --- a/drivers/remoteproc/qcom_adsp_pil.c
>> > +++ b/drivers/remoteproc/qcom_adsp_pil.c
>> > @@ -362,10 +362,22 @@ static const struct adsp_data slpi_resource_init =
>> > {
>> >  		.ssctl_id = 0x16,
>> >  };
>> >
>> > +static const struct adsp_data wcss_resource_init = {
>> > +	.crash_reason_smem = 421,
>> > +	.firmware_name = "wcnss.mdt",
>> > +	.pas_id = 6,
>> > +	.ssr_name = "mpss",
>> > +	.sysmon_name = "wlan",
>> 
>> Shouldn't the sysmon name be "wcnss" instead of "wlan"?
>> 
> 
> I derived this from the downstream kernel, perhaps I got it wrong?
> 

I could see that the label is "wcnss" and glink-label is "mpss" 
downstream.

> Regards,
> Bjorn

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2] remoteproc: qcom: pas: Add QCS404 remoteprocs
      [irrelevant] <20180927190346.2984-1-bjorn.andersson@linaro.org>
@ 2018-09-28  6:27 ` " Sibi Sankar
  2018-10-06  6:38   ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-09-28  6:27 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ohad Ben-Cohen, Rob Herring, Mark Rutland, linux-remoteproc,
	devicetree, linux-kernel, linux-kernel-owner

On 2018-09-28 00:33, Bjorn Andersson wrote:
> Add compatibles for the three PAS based remote processors found in
> QCS404.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>

> Changes since v1:
> - Fixed incorrect sysmon_name, as pointed out by Sibi.
> 
>  .../devicetree/bindings/remoteproc/qcom,adsp.txt     |  3 +++
>  drivers/remoteproc/qcom_adsp_pil.c                   | 12 ++++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git
> a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> index b7d058228185..9c0cff3a5ed8 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> @@ -10,6 +10,9 @@ on the Qualcomm ADSP Hexagon core.
>  		    "qcom,msm8974-adsp-pil"
>  		    "qcom,msm8996-adsp-pil"
>  		    "qcom,msm8996-slpi-pil"
> +		    "qcom,qcs404-adsp-pas"
> +		    "qcom,qcs404-cdsp-pas"
> +		    "qcom,qcs404-wcss-pas"
>  		    "qcom,sdm845-adsp-pas"
>  		    "qcom,sdm845-cdsp-pas"
> 
> diff --git a/drivers/remoteproc/qcom_adsp_pil.c
> b/drivers/remoteproc/qcom_adsp_pil.c
> index da2254ea1135..d5e58235e83a 100644
> --- a/drivers/remoteproc/qcom_adsp_pil.c
> +++ b/drivers/remoteproc/qcom_adsp_pil.c
> @@ -362,10 +362,22 @@ static const struct adsp_data slpi_resource_init 
> = {
>  		.ssctl_id = 0x16,
>  };
> 
> +static const struct adsp_data wcss_resource_init = {
> +	.crash_reason_smem = 421,
> +	.firmware_name = "wcnss.mdt",
> +	.pas_id = 6,
> +	.ssr_name = "mpss",
> +	.sysmon_name = "wcnss",
> +	.ssctl_id = 0x12,
> +};
> +
>  static const struct of_device_id adsp_of_match[] = {
>  	{ .compatible = "qcom,msm8974-adsp-pil", .data = 
> &adsp_resource_init},
>  	{ .compatible = "qcom,msm8996-adsp-pil", .data = 
> &adsp_resource_init},
>  	{ .compatible = "qcom,msm8996-slpi-pil", .data = 
> &slpi_resource_init},
> +	{ .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init 
> },
> +	{ .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init 
> },
> +	{ .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init 
> },
>  	{ .compatible = "qcom,sdm845-adsp-pas", .data = &adsp_resource_init},
>  	{ .compatible = "qcom,sdm845-cdsp-pas", .data = &cdsp_resource_init},
>  	{ },

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 13%]

* Re: [RFC PATCH] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem
      [irrelevant] ` <20180925172943.GA118699@ban.mtv.corp.google.com>
@ 2018-09-30 15:28   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-09-30 15:28 UTC (permalink / raw)
  To: Brian Norris, Bjorn Andersson
  Cc: Rob Herring, Mark Rutland, Andy Gross, David Brown,
	Avaneesh Kumar Dwivedi, devicetree, linux-kernel, linux-arm-msm,
	linux-soc, linux-arm-msm-owner

On 2018-09-25 22:59, Brian Norris wrote:
> Hi Bjorn,
> 
> On Tue, Sep 25, 2018 at 01:06:07AM -0700, Bjorn Andersson wrote:
>> rmtfs_mem provides access to physical storage and is crucial for the
>> operation of the Qualcomm modem subsystem.
>> 
>> The rmtfs_mem implementation must be available before the modem
>> subsystem is booted and a solution where the modem remoteproc will
>> verify that the rmtfs_mem is available has been discussed in the past.
>> But this would not handle the case where the rmtfs_mem provider is
>> restarted, which would cause fatal loss of access to the storage 
>> device
>> for the modem.
>> 
>> The suggestion is therefor to link the rmtfs_mem to its associated
>> remote processor instance and control it based on the availability of
>> the rmtfs_mem implementation.
> 
> But what does "availability" mean? If I'm reading your rmtfs daemon
> properly, "availability" should mean that the daemon is up and has
> registered a RMTFS_QMI_SERVICE. But in this patch, you're keying off of
> the open() call, which sounds like you're introducing a race condition
> -- we might have open()ed the RMTFS memory but we're not actually
> completely ready to service requests.
> 
> So rather than looking for open(), I think somebody needs to be looking
> for the appearance and disappearance of the RMTFS_QMI_SERVICE. (Looking
> for disappearance would resolve the daemon restart issue, no?) That
> "somebody" could be the remoteproc driver I suppose 
> (qmi_add_lookup()?),
> or...couldn't it just be the modem itself? Do you actually need to
> restart the entire modem when the RMTFS service goes away, or do you
> just need to pause storage activity?
> 

Hi Brian,

It might be more logical to make that "somebody" the rmtfs_mem driver 
itself, since
the modem as such does not have any direct functional dependency on 
rmtfs_mem i.e
the firmware can be configured to run on rmtfs_mem or internal fs. So in 
such cases
where the modem is running on internal fs, it would be undesirable to 
have a hard
coded dependency for rmtfs_mem in remoteproc modem itself.

Wouldn't it be simpler/quicker to fix this in kernel than churning out 
new firmware
releases. A fix in firmware will also mean that this becomes one-off fix 
for dragon
boards diverging the firmware branch from whats used in android for 
8916/8974/8996.

>> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> ---
>> 
>> The currently implemented workaround in the Linaro QCOMLT releases is 
>> to
>> blacklist the qcom_q6v5_pil kernel module and load this explicitly 
>> after rmtfs
>> has been started.
>> 
>> With this patch the modem module can be loaded automatically by the
>> platform_bus and will only be booted as the rmtfs becomes available. 
>> Performing
>> actions such as upgrading (and restarting) the rmtfs service will 
>> cause the
>> modem to automatically restart and hence continue to function after 
>> the
>> upgrade.
>> 
>>  .../reserved-memory/qcom,rmtfs-mem.txt        |  7 ++++++
>>  drivers/remoteproc/qcom_q6v5_pil.c            |  1 +
>>  drivers/soc/qcom/Kconfig                      |  1 +
>>  drivers/soc/qcom/rmtfs_mem.c                  | 23 
>> ++++++++++++++++++-
>>  4 files changed, 31 insertions(+), 1 deletion(-)
>> 
> ...
>> diff --git a/drivers/soc/qcom/rmtfs_mem.c 
>> b/drivers/soc/qcom/rmtfs_mem.c
>> index 8a3678c2e83c..8b08be310397 100644
>> --- a/drivers/soc/qcom/rmtfs_mem.c
>> +++ b/drivers/soc/qcom/rmtfs_mem.c
>> @@ -18,6 +18,7 @@
>>  #include <linux/platform_device.h>
>>  #include <linux/of.h>
>>  #include <linux/of_reserved_mem.h>
>> +#include <linux/remoteproc.h>
>>  #include <linux/dma-mapping.h>
>>  #include <linux/slab.h>
>>  #include <linux/uaccess.h>
>> @@ -39,6 +40,8 @@ struct qcom_rmtfs_mem {
>>  	unsigned int client_id;
>> 
>>  	unsigned int perms;
>> +
>> +	struct rproc *rproc;
>>  };
>> 
>>  static ssize_t qcom_rmtfs_mem_show(struct device *dev,
>> @@ -80,11 +83,18 @@ static int qcom_rmtfs_mem_open(struct inode 
>> *inode, struct file *filp)
>>  	struct qcom_rmtfs_mem *rmtfs_mem = container_of(inode->i_cdev,
>>  							struct qcom_rmtfs_mem,
>>  							cdev);
>> +	int ret = 0;
>> 
>>  	get_device(&rmtfs_mem->dev);
>>  	filp->private_data = rmtfs_mem;
>> 
>> -	return 0;
>> +	if (rmtfs_mem->rproc) {
>> +		ret = rproc_boot(rmtfs_mem->rproc);
>> +		if (ret)
>> +			put_device(&rmtfs_mem->dev);
>> +	}
>> +
>> +	return ret;
>>  }
>>  static ssize_t qcom_rmtfs_mem_read(struct file *filp,
>>  			      char __user *buf, size_t count, loff_t *f_pos)
>> @@ -127,6 +137,9 @@ static int qcom_rmtfs_mem_release(struct inode 
>> *inode, struct file *filp)
>>  {
>>  	struct qcom_rmtfs_mem *rmtfs_mem = filp->private_data;
>> 
>> +	if (rmtfs_mem->rproc)
>> +		rproc_shutdown(rmtfs_mem->rproc);
>> +
>>  	put_device(&rmtfs_mem->dev);
>> 
>>  	return 0;
>> @@ -156,6 +169,7 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	struct qcom_scm_vmperm perms[2];
>>  	struct reserved_mem *rmem;
>>  	struct qcom_rmtfs_mem *rmtfs_mem;
>> +	phandle rproc_phandle;
>>  	u32 client_id;
>>  	u32 vmid;
>>  	int ret;
>> @@ -181,6 +195,13 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	rmtfs_mem->client_id = client_id;
>>  	rmtfs_mem->size = rmem->size;
>> 
>> +	ret = of_property_read_u32(node, "rproc", &rproc_phandle);
>> +	if (!ret) {
>> +		rmtfs_mem->rproc = rproc_get_by_phandle(rproc_phandle);
> 
> You're doing an rproc_get(), so you need to do a rproc_put() in
> remove().
> 
> Brian
> 
>> +		if (!rmtfs_mem->rproc)
>> +			return -EPROBE_DEFER;
>> +	}
>> +
>>  	device_initialize(&rmtfs_mem->dev);
>>  	rmtfs_mem->dev.parent = &pdev->dev;
>>  	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [RFC PATCH v2] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem
@ 2018-09-30 15:56 " Sibi Sankar
  2018-10-18  0:54 ` Brian Norris
  2018-10-21 20:16 ` Bjorn Andersson
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-09-30 15:56 UTC (permalink / raw)
  To: bjorn.andersson, briannorris, david.brown, robh+dt, mark.rutland,
	andy.gross
  Cc: akdwived, clew, linux-kernel, linux-arm-msm, linux-soc,
	linux-arm-msm-owner, Sibi Sankar

From: Bjorn Andersson <bjorn.andersson@linaro.org>

rmtfs_mem provides access to physical storage and is crucial for the
operation of the Qualcomm modem subsystem.

The rmtfs_mem implementation must be available before the modem
subsystem is booted and a solution where the modem remoteproc will
verify that the rmtfs_mem is available has been discussed in the past.
But this would not handle the case where the rmtfs_mem provider is
restarted, which would cause fatal loss of access to the storage device
for the modem.

The suggestion is therefore to link the rmtfs_mem to its associated
remote processor instance and control it based on the availability of
the rmtfs_mem implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[sibis: Added qmi lookup for Remote file system service]
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

The currently implemented workaround in the Linaro QCOMLT releases is to
blacklist the qcom_q6v5_pil kernel module and load this explicitly after rmtfs
has been started.

With this patch the modem module can be loaded automatically by the
platform_bus and will only be booted as the rmtfs becomes available. Performing
actions such as upgrading (and restarting) the rmtfs service will cause the
modem to automatically restart and hence continue to function after the
upgrade.

v2:
  Remove rproc_boot/shutdown from rmtfs_mem open/release and add
  qmi lookup for Remote file system service to address Brian's
  race concerns.

 .../reserved-memory/qcom,rmtfs-mem.txt        |  7 ++
 drivers/remoteproc/qcom_q6v5_pil.c            |  1 +
 drivers/soc/qcom/Kconfig                      |  2 +
 drivers/soc/qcom/rmtfs_mem.c                  | 65 ++++++++++++++++++-
 4 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
index 8562ba1dce69..95b209e7f5d1 100644
--- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
+++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
@@ -32,6 +32,13 @@ access block device data using the Remote Filesystem protocol.
 	Value type: <u32>
 	Definition: vmid of the remote processor, to set up memory protection.
 
+- rproc:
+	Usage: optional
+	Value type: <phandle>
+	Definition: reference to a remoteproc node, that should be powered up
+		    while the remote file system memory instance is ready to
+		    handle requests from the remote subsystem.
+
 = EXAMPLE
 The following example shows the remote filesystem memory setup for APQ8016,
 with the rmtfs region for the Hexagon DSP (id #1) located at 0x86700000.
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index d7a4b9eca5d2..1445a38e8b34 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -1142,6 +1142,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc = (struct q6v5 *)rproc->priv;
 	qproc->dev = &pdev->dev;
 	qproc->rproc = rproc;
+	rproc->auto_boot = false;
 	platform_set_drvdata(pdev, qproc);
 
 	ret = q6v5_init_mem(qproc, pdev);
diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 8a7b8dea6990..4e3345944325 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -86,7 +86,9 @@ config QCOM_QMI_HELPERS
 config QCOM_RMTFS_MEM
 	tristate "Qualcomm Remote Filesystem memory driver"
 	depends on ARCH_QCOM
+	depends on REMOTEPROC
 	select QCOM_SCM
+	select QCOM_QMI_HELPERS
 	help
 	  The Qualcomm remote filesystem memory driver is used for allocating
 	  and exposing regions of shared memory with remote processors for the
diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
index 97bb5989aa21..757e30083f67 100644
--- a/drivers/soc/qcom/rmtfs_mem.c
+++ b/drivers/soc/qcom/rmtfs_mem.c
@@ -18,11 +18,13 @@
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_reserved_mem.h>
+#include <linux/remoteproc.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
 #include <linux/qcom_scm.h>
+#include <linux/soc/qcom/qmi.h>
 
 #define QCOM_RMTFS_MEM_DEV_MAX	(MINORMASK + 1)
 
@@ -31,6 +33,7 @@ static dev_t qcom_rmtfs_mem_major;
 struct qcom_rmtfs_mem {
 	struct device dev;
 	struct cdev cdev;
+	struct qmi_handle rmtfs_hdl;
 
 	void *base;
 	phys_addr_t addr;
@@ -39,6 +42,8 @@ struct qcom_rmtfs_mem {
 	unsigned int client_id;
 
 	unsigned int perms;
+
+	struct rproc *rproc;
 };
 
 static ssize_t qcom_rmtfs_mem_show(struct device *dev,
@@ -141,6 +146,36 @@ static const struct file_operations qcom_rmtfs_mem_fops = {
 	.llseek = default_llseek,
 };
 
+static int rmtfs_new_server(struct qmi_handle *qmi,
+				 struct qmi_service *service)
+{
+	int ret = 0;
+	struct qcom_rmtfs_mem *rmtfs_mem = container_of(qmi,
+							struct qcom_rmtfs_mem,
+							rmtfs_hdl);
+
+	if (rmtfs_mem->rproc)
+		ret = rproc_boot(rmtfs_mem->rproc);
+
+	return ret;
+};
+
+static void rmtfs_del_server(struct qmi_handle *qmi,
+				  struct qmi_service *service)
+{
+	struct qcom_rmtfs_mem *rmtfs_mem = container_of(qmi,
+							struct qcom_rmtfs_mem,
+							rmtfs_hdl);
+
+	if (rmtfs_mem->rproc)
+		rproc_shutdown(rmtfs_mem->rproc);
+};
+
+static struct qmi_ops rmtfs_lookup_ops = {
+	.new_server = rmtfs_new_server,
+	.del_server = rmtfs_del_server,
+};
+
 static void qcom_rmtfs_mem_release_device(struct device *dev)
 {
 	struct qcom_rmtfs_mem *rmtfs_mem = container_of(dev,
@@ -156,6 +191,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
 	struct qcom_scm_vmperm perms[2];
 	struct reserved_mem *rmem;
 	struct qcom_rmtfs_mem *rmtfs_mem;
+	phandle rproc_phandle;
 	u32 client_id;
 	u32 vmid;
 	int ret;
@@ -181,6 +217,22 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
 	rmtfs_mem->client_id = client_id;
 	rmtfs_mem->size = rmem->size;
 
+	ret = of_property_read_u32(node, "rproc", &rproc_phandle);
+	if (!ret) {
+		rmtfs_mem->rproc = rproc_get_by_phandle(rproc_phandle);
+		if (!rmtfs_mem->rproc)
+			return -EPROBE_DEFER;
+	}
+
+	ret = qmi_handle_init(&rmtfs_mem->rmtfs_hdl, 0,
+			      &rmtfs_lookup_ops, NULL);
+	if (ret < 0)
+		goto put_rproc;
+
+	ret = qmi_add_lookup(&rmtfs_mem->rmtfs_hdl, 14, 0, 0);
+	if (ret < 0)
+		goto err_release_qmi_handle;
+
 	device_initialize(&rmtfs_mem->dev);
 	rmtfs_mem->dev.parent = &pdev->dev;
 	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;
@@ -191,7 +243,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
 	if (IS_ERR(rmtfs_mem->base)) {
 		dev_err(&pdev->dev, "failed to remap rmtfs_mem region\n");
 		ret = PTR_ERR(rmtfs_mem->base);
-		goto put_device;
+		goto err_release_qmi_handle;
 	}
 
 	cdev_init(&rmtfs_mem->cdev, &qcom_rmtfs_mem_fops);
@@ -204,7 +256,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
 	ret = cdev_device_add(&rmtfs_mem->cdev, &rmtfs_mem->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add cdev: %d\n", ret);
-		goto put_device;
+		goto err_release_qmi_handle;
 	}
 
 	ret = of_property_read_u32(node, "qcom,vmid", &vmid);
@@ -237,7 +289,10 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
 
 remove_cdev:
 	cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
-put_device:
+err_release_qmi_handle:
+	qmi_handle_release(&rmtfs_mem->rmtfs_hdl);
+put_rproc:
+	rproc_put(rmtfs_mem->rproc);
 	put_device(&rmtfs_mem->dev);
 
 	return ret;
@@ -257,6 +312,10 @@ static int qcom_rmtfs_mem_remove(struct platform_device *pdev)
 	}
 
 	cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
+	if (rmtfs_mem->rproc) {
+		qmi_handle_release(&rmtfs_mem->rmtfs_hdl);
+		rproc_put(rmtfs_mem->rproc);
+	}
 	put_device(&rmtfs_mem->dev);
 
 	return 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 16%]

* [PATCH] remoteproc: qcom: q6v5: Fix a race condition on fatal crash
@ 2018-10-01 14:25 Sibi Sankar
  2018-10-06  6:35 ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-10-01 14:25 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: ohad, linux-remoteproc, linux-kernel, linux-arm-msm,
	linux-arm-msm-owner, Sibi Sankar

Currently with GLINK_SSR enabled each fatal crash results in servicing
a crash from wdog as well. This is due to a race that occurs in setting
the running flag in the shutdown path. Fix this by moving the running
flag to the end of fatal interrupt handler.

Crash Logs:
qcom-q6v5-pil 4080000.remoteproc: fatal error without message
remoteproc remoteproc0: crash detected in 4080000.remoteproc: type fatal
	error
remoteproc remoteproc0: handling crash #1 in 4080000.remoteproc
remoteproc remoteproc0: recovering 4080000.remoteproc
qcom-q6v5-pil 4080000.remoteproc: watchdog without message
remoteproc remoteproc0: crash detected in 4080000.remoteproc: type watchdog
remoteproc:glink-edge: intent request timed out
qcom_glink_ssr remoteproc:glink-edge.glink_ssr.-1.-1: failed to send
	cleanup message
qcom_glink_ssr remoteproc:glink-edge.glink_ssr.-1.-1: timeout waiting
	for cleanup done message
qcom-q6v5-pil 4080000.remoteproc: timed out on wait
qcom-q6v5-pil 4080000.remoteproc: port failed halt
remoteproc remoteproc0: stopped remote processor 4080000.remoteproc
qcom-q6v5-pil 4080000.remoteproc: MBA booted, loading mpss
remoteproc remoteproc0: remote processor 4080000.remoteproc is now up
remoteproc remoteproc0: handling crash #2 in 4080000.remoteproc
remoteproc remoteproc0: recovering 4080000.remoteproc
qcom-q6v5-pil 4080000.remoteproc: port failed halt
remoteproc remoteproc0: stopped remote processor 4080000.remoteproc
qcom-q6v5-pil 4080000.remoteproc: MBA booted, loading mpss
remoteproc remoteproc0: remote processor 4080000.remoteproc is now up

[bjorn: move running flag to the end of fatal interrupt handler]
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
index e9ab90c19304..edeb2e43209e 100644
--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -84,6 +84,7 @@ static irqreturn_t q6v5_fatal_interrupt(int irq, void *data)
 	else
 		dev_err(q6v5->dev, "fatal error without message\n");
 
+	q6v5->running = false;
 	rproc_report_crash(q6v5->rproc, RPROC_FATAL_ERROR);
 
 	return IRQ_HANDLED;
@@ -150,8 +151,6 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5)
 {
 	int ret;
 
-	q6v5->running = false;
-
 	qcom_smem_state_update_bits(q6v5->state,
 				    BIT(q6v5->stop_bit), BIT(q6v5->stop_bit));
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* Re: [PATCH v3 0/6] Add support for PDC Global on SDM845 SoCs
      [irrelevant] ` <20180903193647.GJ3456@tuxbook-pro>
@ 2018-10-04 18:27   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-04 18:27 UTC (permalink / raw)
  To: Bjorn Andersson, p.zabel
  Cc: mka, robh+dt, linux-kernel, devicetree, mark.rutland,
	linux-arm-msm, tsoni

Hey Phillip,

Will the PDC driver make the cut for reset/next this time for the
4.20rc?

On 09/04/2018 01:06 AM, Bjorn Andersson wrote:
> On Wed 29 Aug 12:12 PDT 2018, Sibi Sankar wrote:
> 
>> This patch series add support for PDC Global (Power Domain Controller)
>> on SDM845 SoCs and adds pdc reset lines assert/deassert to remoteproc
>> Q6v5 modem-pil. The first two patches adds PDC Global reset driver to
>> control reset signals of Modem, Compute, Display, GPU, Debug, AOP,
>> Sensors, Audio, SP and APPS. The last four patches (cleans up)/adds pdc
>> reset lines to q6v5 bindings and asserts/deasserts in modem start/stop
>> path.
>>
>> V3:
>>    refactored pdc reset driver to remove unused layer of indirection
>>    as suggested by Matthias
>>    Other minor fixes suggested by Matthias/Bjorn
>>
>> V2:
>>    Incorporated Philipp/Bjorn/Rob suggestions
>>    Renamed reset binding to pdc-global.txt
>>    replaced offset with #define of register name
>>    replaced with devm_reset_control_get_exclusive()
>>    Separted dt binding from the drivers
>>
>> Sibi Sankar (6):
>>    dt-bindings: reset: Add PDC Global binding for SDM845 SoCs
>>    reset: qcom: PDC Global (Power Domain Controller) reset controller
> 
> Philipp, there's no compile time dependencies between the PDC and
> remoteproc patches in this series. Will you take these two through your
> tree and I'll take the remaining four through the remoteproc tree?
> 
> Regards,
> Bjorn
> 
>>    dt-bindings: remoteproc: qcom: Remove additional definition tag
>>    dt-bindings: remoteproc: Add PDC reset binding for Q6V5 PIL
>>    remoteproc: qcom: q6v5-pil: Explicitly get mss_restart line
>>    remoteproc: qcom: q6v5-pil: Add PDC reset for modem on SDM845 SoCs
>>
>>   .../bindings/remoteproc/qcom,q6v5.txt         |   8 +-
>>   .../bindings/reset/qcom,pdc-global.txt        |  52 ++++++++
>>   drivers/remoteproc/qcom_q6v5_pil.c            |  31 ++++-
>>   drivers/reset/Kconfig                         |   9 ++
>>   drivers/reset/Makefile                        |   1 +
>>   drivers/reset/reset-qcom-pdc.c                | 124 ++++++++++++++++++
>>   include/dt-bindings/reset/qcom,sdm845-pdc.h   |  20 +++
>>   7 files changed, 237 insertions(+), 8 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/reset/qcom,pdc-global.txt
>>   create mode 100644 drivers/reset/reset-qcom-pdc.c
>>   create mode 100644 include/dt-bindings/reset/qcom,sdm845-pdc.h
>>
>> -- 
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project
>>
> 

-- 
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc, is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] remoteproc: qcom: q6v5: Fix a race condition on fatal crash
  2018-10-01 14:25 [PATCH] remoteproc: qcom: q6v5: Fix a race condition on fatal crash Sibi Sankar
@ 2018-10-06  6:35 ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-06  6:35 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: ohad, linux-remoteproc, linux-kernel, linux-arm-msm, linux-arm-msm-owner

On Mon 01 Oct 07:25 PDT 2018, Sibi Sankar wrote:

> Currently with GLINK_SSR enabled each fatal crash results in servicing
> a crash from wdog as well. This is due to a race that occurs in setting
> the running flag in the shutdown path. Fix this by moving the running
> flag to the end of fatal interrupt handler.
> 
> Crash Logs:
> qcom-q6v5-pil 4080000.remoteproc: fatal error without message
> remoteproc remoteproc0: crash detected in 4080000.remoteproc: type fatal
> 	error
> remoteproc remoteproc0: handling crash #1 in 4080000.remoteproc
> remoteproc remoteproc0: recovering 4080000.remoteproc
> qcom-q6v5-pil 4080000.remoteproc: watchdog without message
> remoteproc remoteproc0: crash detected in 4080000.remoteproc: type watchdog
> remoteproc:glink-edge: intent request timed out
> qcom_glink_ssr remoteproc:glink-edge.glink_ssr.-1.-1: failed to send
> 	cleanup message
> qcom_glink_ssr remoteproc:glink-edge.glink_ssr.-1.-1: timeout waiting
> 	for cleanup done message
> qcom-q6v5-pil 4080000.remoteproc: timed out on wait
> qcom-q6v5-pil 4080000.remoteproc: port failed halt
> remoteproc remoteproc0: stopped remote processor 4080000.remoteproc
> qcom-q6v5-pil 4080000.remoteproc: MBA booted, loading mpss
> remoteproc remoteproc0: remote processor 4080000.remoteproc is now up
> remoteproc remoteproc0: handling crash #2 in 4080000.remoteproc
> remoteproc remoteproc0: recovering 4080000.remoteproc
> qcom-q6v5-pil 4080000.remoteproc: port failed halt
> remoteproc remoteproc0: stopped remote processor 4080000.remoteproc
> qcom-q6v5-pil 4080000.remoteproc: MBA booted, loading mpss
> remoteproc remoteproc0: remote processor 4080000.remoteproc is now up
> 
> [bjorn: move running flag to the end of fatal interrupt handler]

Turned this line into a Suggested-by

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Applied.

Thanks,
Bjorn

> ---
>  drivers/remoteproc/qcom_q6v5.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
> index e9ab90c19304..edeb2e43209e 100644
> --- a/drivers/remoteproc/qcom_q6v5.c
> +++ b/drivers/remoteproc/qcom_q6v5.c
> @@ -84,6 +84,7 @@ static irqreturn_t q6v5_fatal_interrupt(int irq, void *data)
>  	else
>  		dev_err(q6v5->dev, "fatal error without message\n");
>  
> +	q6v5->running = false;
>  	rproc_report_crash(q6v5->rproc, RPROC_FATAL_ERROR);
>  
>  	return IRQ_HANDLED;
> @@ -150,8 +151,6 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5)
>  {
>  	int ret;
>  
> -	q6v5->running = false;
> -
>  	qcom_smem_state_update_bits(q6v5->state,
>  				    BIT(q6v5->stop_bit), BIT(q6v5->stop_bit));
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2] remoteproc: qcom: pas: Add QCS404 remoteprocs
  2018-09-28  6:27 ` [PATCH v2] " Sibi Sankar
@ 2018-10-06  6:38   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-06  6:38 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Ohad Ben-Cohen, Rob Herring, Mark Rutland, linux-remoteproc,
	devicetree, linux-kernel, linux-kernel-owner

On Thu 27 Sep 23:27 PDT 2018, Sibi Sankar wrote:

> On 2018-09-28 00:33, Bjorn Andersson wrote:
> > Add compatibles for the three PAS based remote processors found in
> > QCS404.
> > 
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> > 
> 
> Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
> 

Thanks for the review Sibi, applied the patch.

Regards,
Bjorn

> > Changes since v1:
> > - Fixed incorrect sysmon_name, as pointed out by Sibi.
> > 
> >  .../devicetree/bindings/remoteproc/qcom,adsp.txt     |  3 +++
> >  drivers/remoteproc/qcom_adsp_pil.c                   | 12 ++++++++++++
> >  2 files changed, 15 insertions(+)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> > b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> > index b7d058228185..9c0cff3a5ed8 100644
> > --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> > +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> > @@ -10,6 +10,9 @@ on the Qualcomm ADSP Hexagon core.
> >  		    "qcom,msm8974-adsp-pil"
> >  		    "qcom,msm8996-adsp-pil"
> >  		    "qcom,msm8996-slpi-pil"
> > +		    "qcom,qcs404-adsp-pas"
> > +		    "qcom,qcs404-cdsp-pas"
> > +		    "qcom,qcs404-wcss-pas"
> >  		    "qcom,sdm845-adsp-pas"
> >  		    "qcom,sdm845-cdsp-pas"
> > 
> > diff --git a/drivers/remoteproc/qcom_adsp_pil.c
> > b/drivers/remoteproc/qcom_adsp_pil.c
> > index da2254ea1135..d5e58235e83a 100644
> > --- a/drivers/remoteproc/qcom_adsp_pil.c
> > +++ b/drivers/remoteproc/qcom_adsp_pil.c
> > @@ -362,10 +362,22 @@ static const struct adsp_data slpi_resource_init =
> > {
> >  		.ssctl_id = 0x16,
> >  };
> > 
> > +static const struct adsp_data wcss_resource_init = {
> > +	.crash_reason_smem = 421,
> > +	.firmware_name = "wcnss.mdt",
> > +	.pas_id = 6,
> > +	.ssr_name = "mpss",
> > +	.sysmon_name = "wcnss",
> > +	.ssctl_id = 0x12,
> > +};
> > +
> >  static const struct of_device_id adsp_of_match[] = {
> >  	{ .compatible = "qcom,msm8974-adsp-pil", .data = &adsp_resource_init},
> >  	{ .compatible = "qcom,msm8996-adsp-pil", .data = &adsp_resource_init},
> >  	{ .compatible = "qcom,msm8996-slpi-pil", .data = &slpi_resource_init},
> > +	{ .compatible = "qcom,qcs404-adsp-pas", .data = &adsp_resource_init },
> > +	{ .compatible = "qcom,qcs404-cdsp-pas", .data = &cdsp_resource_init },
> > +	{ .compatible = "qcom,qcs404-wcss-pas", .data = &wcss_resource_init },
> >  	{ .compatible = "qcom,sdm845-adsp-pas", .data = &adsp_resource_init},
> >  	{ .compatible = "qcom,sdm845-cdsp-pas", .data = &cdsp_resource_init},
> >  	{ },
> 
> -- 
> -- Sibi Sankar --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] remoteproc: qcom: q6v5: Propagate EPROBE_DEFER
  2018-09-25  6:50 ` [PATCH] remoteproc: qcom: q6v5: Propagate EPROBE_DEFER Sibi Sankar
@ 2018-10-06  6:39   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-06  6:39 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Ohad Ben-Cohen, linux-remoteproc, linux-kernel, linux-arm-msm,
	stable, linux-arm-msm-owner

On Mon 24 Sep 23:50 PDT 2018, Sibi Sankar wrote:

> On 2018-09-20 07:21, Bjorn Andersson wrote:
> > In the case that the interrupts fail to result because of the
> > interrupt-controller not yet being registered the
> > platform_get_irq_byname() call will fail with -EPROBE_DEFER, but passing
> > this into devm_request_threaded_irq() will result in -EINVAL being
> > returned, the driver is therefor not reprobed later.
> > 
> 
> The patch looks fine.
> Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
> 

Thanks for the review Sibi, applied the patch.

Regards,
Bjorn

> > Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource
> > handling")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> >  drivers/remoteproc/qcom_q6v5.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/remoteproc/qcom_q6v5.c
> > b/drivers/remoteproc/qcom_q6v5.c
> > index 61a760ee4aac..e9ab90c19304 100644
> > --- a/drivers/remoteproc/qcom_q6v5.c
> > +++ b/drivers/remoteproc/qcom_q6v5.c
> > @@ -198,6 +198,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> > platform_device *pdev,
> >  	}
> > 
> >  	q6v5->fatal_irq = platform_get_irq_byname(pdev, "fatal");
> > +	if (q6v5->fatal_irq == -EPROBE_DEFER)
> > +		return -EPROBE_DEFER;
> > +
> >  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->fatal_irq,
> >  					NULL, q6v5_fatal_interrupt,
> >  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> > @@ -208,6 +211,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> > platform_device *pdev,
> >  	}
> > 
> >  	q6v5->ready_irq = platform_get_irq_byname(pdev, "ready");
> > +	if (q6v5->ready_irq == -EPROBE_DEFER)
> > +		return -EPROBE_DEFER;
> > +
> >  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->ready_irq,
> >  					NULL, q6v5_ready_interrupt,
> >  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> > @@ -218,6 +224,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> > platform_device *pdev,
> >  	}
> > 
> >  	q6v5->handover_irq = platform_get_irq_byname(pdev, "handover");
> > +	if (q6v5->handover_irq == -EPROBE_DEFER)
> > +		return -EPROBE_DEFER;
> > +
> >  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->handover_irq,
> >  					NULL, q6v5_handover_interrupt,
> >  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> > @@ -229,6 +238,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
> > platform_device *pdev,
> >  	disable_irq(q6v5->handover_irq);
> > 
> >  	q6v5->stop_irq = platform_get_irq_byname(pdev, "stop-ack");
> > +	if (q6v5->stop_irq == -EPROBE_DEFER)
> > +		return -EPROBE_DEFER;
> > +
> >  	ret = devm_request_threaded_irq(&pdev->dev, q6v5->stop_irq,
> >  					NULL, q6v5_stop_interrupt,
> >  					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> 
> -- 
> -- Sibi Sankar --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 1/6] remoteproc: Introduce custom dump function for each remoteproc segment
      [irrelevant] ` <20180727152003.11663-2-sibis@codeaurora.org>
@ 2018-10-08  6:23   ` Bjorn Andersson
  2018-10-09 16:08     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-10-08  6:23 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: linux-remoteproc, linux-kernel, ohad, kyan, sricharan, akdwived,
	linux-arm-msm, tsoni

On Fri 27 Jul 08:19 PDT 2018, Sibi Sankar wrote:

> Introduce custom dump function per remoteproc segment. It is responsible
> for filling the device memory segment associated with coredump
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/remoteproc_core.c | 15 ++++++++++-----
>  include/linux/remoteproc.h           |  3 +++
>  2 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 283b258f5e0f..ec56cd822b26 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1183,13 +1183,18 @@ static void rproc_coredump(struct rproc *rproc)
>  		phdr->p_align = 0;
>  
>  		ptr = rproc_da_to_va(rproc, segment->da, segment->size);
> -		if (!ptr) {
> -			dev_err(&rproc->dev,
> +
> +		if (segment->dump) {
> +			segment->dump(rproc, ptr, segment->size, data + offset);

rproc_da_to_va() is an exported symbol, so if you pass segment to the
dump function the driver can, if it needs to, call the function itself.

A typical use case, that I see, is to use the custom dump function to
write out CPU or hardware state to the dump file, in which case the "da"
won't be valid.


So please make this call dump(rproc, segment, data + offset) and move
the rproc_da_to_va() into the else block.

> +		} else {
> +			if (!ptr) {
> +				dev_err(&rproc->dev,
>  				"invalid coredump segment (%pad, %zu)\n",
>  				&segment->da, segment->size);
> -			memset(data + offset, 0xff, segment->size);
> -		} else {
> -			memcpy(data + offset, ptr, segment->size);
> +				memset(data + offset, 0xff, segment->size);
> +			} else {
> +				memcpy(data + offset, ptr, segment->size);
> +			}
>  		}
>  
>  		offset += phdr->p_filesz;
> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> index e3c5d856b6da..0fbb01a9955c 100644
> --- a/include/linux/remoteproc.h
> +++ b/include/linux/remoteproc.h
> @@ -399,6 +399,8 @@ enum rproc_crash_type {
>   * @node:	list node related to the rproc segment list
>   * @da:		device address of the segment
>   * @size:	size of the segment
> + * @dump:	custom dump function to fill device memory segment associated
> + *		with coredump
>   */
>  struct rproc_dump_segment {
>  	struct list_head node;
> @@ -406,6 +408,7 @@ struct rproc_dump_segment {
>  	dma_addr_t da;
>  	size_t size;
>  
> +	void (*dump)(struct rproc *rproc, void *ptr, size_t len, void *priv);

"priv" isn't the best name to represent the memory to which you expect
dump to write to. Please call it "dest".

>  	loff_t offset;
>  };

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 5/6] remoteproc: qcom: q6v5-pil: Register segments/dumpfn for coredump
      [irrelevant] ` <20180727152003.11663-6-sibis@codeaurora.org>
@ 2018-10-08  6:48   ` Bjorn Andersson
  2018-10-09 16:21     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-10-08  6:48 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: linux-remoteproc, linux-kernel, ohad, kyan, sricharan, akdwived,
	linux-arm-msm, tsoni

On Fri 27 Jul 08:20 PDT 2018, Sibi Sankar wrote:

> Register the MDT segments and custom dumpfn with the remoteproc core
> dump functionality.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_pil.c | 40 ++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
> index ac3342f9ea5a..22bb049c3e7f 100644
> --- a/drivers/remoteproc/qcom_q6v5_pil.c
> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
> @@ -1058,10 +1058,50 @@ static void *q6v5_da_to_va(struct rproc *rproc, u64 da, int len)
>  	return qproc->mpss_region + offset;
>  }
>  
> +static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
> +				const struct firmware *fw_unused)

How about naming it mba_fw instead of unused? Just as unused, but easier
to understand why it isn't used.

> +{
> +	const struct firmware *fw;
> +	const struct elf32_phdr *phdrs;
> +	const struct elf32_phdr *phdr;
> +	const struct elf32_hdr *ehdr;
> +	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;

No need for an explicit typecast from void *.

The rest looks good!

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 6/6] remoteproc: qcom: q6v5-pil: Assign the relocated address
      [irrelevant] ` <20180727152003.11663-7-sibis@codeaurora.org>
@ 2018-10-08  6:55   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-08  6:55 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: linux-remoteproc, linux-kernel, ohad, kyan, sricharan, akdwived,
	linux-arm-msm, tsoni

On Fri 27 Jul 08:20 PDT 2018, Sibi Sankar wrote:

> Assign the relocated base of the modem image, as the offsets
> from the virtual memory might not be based on the physical
> address.
> 

In order to get this merged before the first call to rproc_da_to_va() I
applied this patch to rproc-next.

Thanks,
Bjorn

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_pil.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
> index 22bb049c3e7f..b1296d614b8b 100644
> --- a/drivers/remoteproc/qcom_q6v5_pil.c
> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
> @@ -862,6 +862,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  	}
>  
>  	mpss_reloc = relocate ? min_addr : qproc->mpss_phys;
> +	qproc->mpss_reloc = mpss_reloc;
>  	/* Load firmware segments */
>  	for (i = 0; i < ehdr->e_phnum; i++) {
>  		phdr = &phdrs[i];
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 1/6] remoteproc: Introduce custom dump function for each remoteproc segment
  2018-10-08  6:23   ` [PATCH v3 1/6] remoteproc: Introduce custom dump function for each remoteproc segment Bjorn Andersson
@ 2018-10-09 16:08     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:08 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: linux-remoteproc, linux-kernel, ohad, kyan, sricharan, akdwived,
	linux-arm-msm, tsoni, linux-remoteproc-owner

Hi Bjorn,
Thanks for the review :)

On 2018-10-08 11:53, Bjorn Andersson wrote:
> On Fri 27 Jul 08:19 PDT 2018, Sibi Sankar wrote:
> 
>> Introduce custom dump function per remoteproc segment. It is 
>> responsible
>> for filling the device memory segment associated with coredump
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  drivers/remoteproc/remoteproc_core.c | 15 ++++++++++-----
>>  include/linux/remoteproc.h           |  3 +++
>>  2 files changed, 13 insertions(+), 5 deletions(-)
>> 
>> diff --git a/drivers/remoteproc/remoteproc_core.c 
>> b/drivers/remoteproc/remoteproc_core.c
>> index 283b258f5e0f..ec56cd822b26 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -1183,13 +1183,18 @@ static void rproc_coredump(struct rproc 
>> *rproc)
>>  		phdr->p_align = 0;
>> 
>>  		ptr = rproc_da_to_va(rproc, segment->da, segment->size);
>> -		if (!ptr) {
>> -			dev_err(&rproc->dev,
>> +
>> +		if (segment->dump) {
>> +			segment->dump(rproc, ptr, segment->size, data + offset);
> 
> rproc_da_to_va() is an exported symbol, so if you pass segment to the
> dump function the driver can, if it needs to, call the function itself.
> 
> A typical use case, that I see, is to use the custom dump function to
> write out CPU or hardware state to the dump file, in which case the 
> "da"
> won't be valid.
> 
> 
> So please make this call dump(rproc, segment, data + offset) and move
> the rproc_da_to_va() into the else block.
> 

yup will redefine it.

>> +		} else {
>> +			if (!ptr) {
>> +				dev_err(&rproc->dev,
>>  				"invalid coredump segment (%pad, %zu)\n",
>>  				&segment->da, segment->size);
>> -			memset(data + offset, 0xff, segment->size);
>> -		} else {
>> -			memcpy(data + offset, ptr, segment->size);
>> +				memset(data + offset, 0xff, segment->size);
>> +			} else {
>> +				memcpy(data + offset, ptr, segment->size);
>> +			}
>>  		}
>> 
>>  		offset += phdr->p_filesz;
>> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
>> index e3c5d856b6da..0fbb01a9955c 100644
>> --- a/include/linux/remoteproc.h
>> +++ b/include/linux/remoteproc.h
>> @@ -399,6 +399,8 @@ enum rproc_crash_type {
>>   * @node:	list node related to the rproc segment list
>>   * @da:		device address of the segment
>>   * @size:	size of the segment
>> + * @dump:	custom dump function to fill device memory segment 
>> associated
>> + *		with coredump
>>   */
>>  struct rproc_dump_segment {
>>  	struct list_head node;
>> @@ -406,6 +408,7 @@ struct rproc_dump_segment {
>>  	dma_addr_t da;
>>  	size_t size;
>> 
>> +	void (*dump)(struct rproc *rproc, void *ptr, size_t len, void 
>> *priv);
> 
> "priv" isn't the best name to represent the memory to which you expect
> dump to write to. Please call it "dest".
> 

will rename it

>>  	loff_t offset;
>>  };
> 
> Regards,
> Bjorn

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v3 4/6] remoteproc: qcom: q6v5-pil: Add custom dump function for modem
      [irrelevant]   ` <20181008064505.GO12063@builder>
@ 2018-10-09 16:19     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:19 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: linux-remoteproc, linux-kernel, ohad, kyan, sricharan, akdwived,
	linux-arm-msm, tsoni

Hi Bjorn,
Thanks for the review !

On 2018-10-08 12:15, Bjorn Andersson wrote:
> On Fri 27 Jul 08:20 PDT 2018, Sibi Sankar wrote:
>> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c 
>> b/drivers/remoteproc/qcom_q6v5_pil.c
> [..]
>> +static void qcom_q6v5_dump_segment(struct rproc *rproc, void *ptr, 
>> size_t len,
>> +								   void *priv)
>> +{
>> +	int ret = 0;
>> +	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
>> +	static u32 pending_mask;
> 
> I dislike that this is a static variable. And it tracks the segments
> that has already been dumped, i.e. the !pending.
> 
>> +
>> +	/* Unlock mba before copying segments */
>> +	if (!qproc->mba_loaded)
>> +		ret = q6v5_mba_load(qproc);
>> +
>> +	if (!ptr || ret)
>> +		memset(priv, 0xff, len);
>> +	else
>> +		memcpy(priv, ptr, len);
>> +
>> +	pending_mask++;
> 
> This is a "count" and not a "mask".
> 

will rename it to count in the next re-spin. We can implement this as
a mask as well, the only disadvantage I see in that case is the need
for another flag to determine if mba is loaded since the mask for the
first segment may not be zero (the first segment may not be valid).

> I can see a few different cases where one would like to be able to pass
> custom data/information from the segment-registration to the dump
> function. So how about adding a "void *priv" to the dump segment.
> 
> For this particular case we could typecast segment->priv to an unsigned
> long (as this is always the same size) and use that as a bitmask, which
> we use to update pending_mask.
> 

sure will do the same

>> +	if (pending_mask == qproc->valid_mask) {
>> +		if (qproc->mba_loaded)
>> +			q6v5_mba_reclaim(qproc);
>> +		pending_mask = 0;
>> +	}
> 
> I think it would be cleaner to reset pending_mask in the start 
> function,
> and then return early in this function when we have dumped all the
> segments.
> 
> If so can pending_mask == 0 and pending_mask == all be the triggers for
> loading and reclaiming the mba? So we don't have two different trackers
> for this?
> 

with the private data stored per dump segment this becomes much simpler 
:)

>> +}
>> +
> 
> Regards,
> Bjorn

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v3 5/6] remoteproc: qcom: q6v5-pil: Register segments/dumpfn for coredump
  2018-10-08  6:48   ` [PATCH v3 5/6] remoteproc: qcom: q6v5-pil: Register segments/dumpfn for coredump Bjorn Andersson
@ 2018-10-09 16:21     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:21 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: linux-remoteproc, linux-kernel, ohad, kyan, sricharan, akdwived,
	linux-arm-msm, tsoni

Hi Bjorn,
Thanks for the review !

On 2018-10-08 12:18, Bjorn Andersson wrote:
> On Fri 27 Jul 08:20 PDT 2018, Sibi Sankar wrote:
> 
>> Register the MDT segments and custom dumpfn with the remoteproc core
>> dump functionality.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  drivers/remoteproc/qcom_q6v5_pil.c | 40 
>> ++++++++++++++++++++++++++++++
>>  1 file changed, 40 insertions(+)
>> 
>> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c 
>> b/drivers/remoteproc/qcom_q6v5_pil.c
>> index ac3342f9ea5a..22bb049c3e7f 100644
>> --- a/drivers/remoteproc/qcom_q6v5_pil.c
>> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
>> @@ -1058,10 +1058,50 @@ static void *q6v5_da_to_va(struct rproc 
>> *rproc, u64 da, int len)
>>  	return qproc->mpss_region + offset;
>>  }
>> 
>> +static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>> +				const struct firmware *fw_unused)
> 
> How about naming it mba_fw instead of unused? Just as unused, but 
> easier
> to understand why it isn't used.
> 

sure

>> +{
>> +	const struct firmware *fw;
>> +	const struct elf32_phdr *phdrs;
>> +	const struct elf32_phdr *phdr;
>> +	const struct elf32_hdr *ehdr;
>> +	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
> 
> No need for an explicit typecast from void *.
> 

will remove it

> The rest looks good!
> 
> Regards,
> Bjorn

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc
@ 2018-10-09 16:23 Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
                   ` (4 more replies)
  0 siblings, 5 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:23 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

This patch series add coredump support for modem on SDM845, MSM8996
and MSM8916 SoCs. Modem requires the mba to be loaded before a
coredump can be performed and this is achieved using a custom per
segment dump function.

V4:
  Addressed Bjorn's comments.

V3:
  [bjorn]:replace prepare/unprepare ops with a more generalised per segment
  dump function

V2:
  Introduce prepare/unprepare ops for rproc coredump
Sibi Sankar (5):
  remoteproc: Introduce custom dump function for each remoteproc segment
  remoteproc: Add mechanism for custom dump function assignment
  remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence
  remoteproc: qcom: q6v5-mss: Add custom dump function for modem
  remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump

 drivers/remoteproc/qcom_q6v5_mss.c   | 307 ++++++++++++++++++---------
 drivers/remoteproc/remoteproc_core.c |  55 ++++-
 include/linux/remoteproc.h           |  11 +
 3 files changed, 268 insertions(+), 105 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 15%]

* [PATCH v4 1/5] remoteproc: Introduce custom dump function for each remoteproc segment
  2018-10-09 16:23 [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
@ 2018-10-09 16:23 ` Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 2/5] remoteproc: Add mechanism for custom dump function assignment Sibi Sankar
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:23 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

Introduce custom dump function and private data per remoteproc dump
segment. The dump function is responsible for filling the device memory
segment associated with coredump

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/remoteproc_core.c | 16 ++++++++++------
 include/linux/remoteproc.h           |  6 ++++++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index aa6206706fe3..afa4274b6ccd 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1183,14 +1183,18 @@ static void rproc_coredump(struct rproc *rproc)
 		phdr->p_flags = PF_R | PF_W | PF_X;
 		phdr->p_align = 0;
 
-		ptr = rproc_da_to_va(rproc, segment->da, segment->size);
-		if (!ptr) {
-			dev_err(&rproc->dev,
+		if (segment->dump) {
+			segment->dump(rproc, segment, data + offset);
+		} else {
+			ptr = rproc_da_to_va(rproc, segment->da, segment->size);
+			if (!ptr) {
+				dev_err(&rproc->dev,
 				"invalid coredump segment (%pad, %zu)\n",
 				&segment->da, segment->size);
-			memset(data + offset, 0xff, segment->size);
-		} else {
-			memcpy(data + offset, ptr, segment->size);
+				memset(data + offset, 0xff, segment->size);
+			} else {
+				memcpy(data + offset, ptr, segment->size);
+			}
 		}
 
 		offset += phdr->p_filesz;
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index e3c5d856b6da..2a93e102d2ad 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -399,6 +399,9 @@ enum rproc_crash_type {
  * @node:	list node related to the rproc segment list
  * @da:		device address of the segment
  * @size:	size of the segment
+ * @priv:	private data associated with the dump_segment
+ * @dump:	custom dump function to fill device memory segment associated
+ *		with coredump
  */
 struct rproc_dump_segment {
 	struct list_head node;
@@ -406,6 +409,9 @@ struct rproc_dump_segment {
 	dma_addr_t da;
 	size_t size;
 
+	void *priv;
+	void (*dump)(struct rproc *rproc, struct rproc_dump_segment *segment,
+		     void *dest);
 	loff_t offset;
 };
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v4 2/5] remoteproc: Add mechanism for custom dump function assignment
  2018-10-09 16:23 [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
@ 2018-10-09 16:23 ` Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence Sibi Sankar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:23 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

This patch adds a mechanism for assigning each rproc dump segment with
a custom dump function and private data. The dump function is to be
called for each rproc segment during coredump if assigned.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/remoteproc_core.c | 39 ++++++++++++++++++++++++++++
 include/linux/remoteproc.h           |  5 ++++
 2 files changed, 44 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index afa4274b6ccd..076579f44c3a 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1121,6 +1121,45 @@ int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size)
 }
 EXPORT_SYMBOL(rproc_coredump_add_segment);
 
+/**
+ * rproc_coredump_add_custom_segment() - add segment of device memory to
+ *					 coredump and extend it with custom
+ *					 dump function
+ * @rproc:	handle of a remote processor
+ * @da:		device address
+ * @size:	size of segment
+ * @priv:	private data
+ * @dumpfn:	custom dump function called for each segment during coredump
+ *
+ * Add device memory to the list of segments to be included in the coredump
+ * and associate the segment with the given custom dump function and private
+ * data.
+ *
+ * Return: 0 on success, negative errno on error.
+ */
+int rproc_coredump_add_custom_segment(struct rproc *rproc,
+				      dma_addr_t da, size_t size, void *priv,
+				      void (*dumpfn)(struct rproc *rproc,
+					struct rproc_dump_segment *segment,
+					void *dest))
+{
+	struct rproc_dump_segment *segment;
+
+	segment = kzalloc(sizeof(*segment), GFP_KERNEL);
+	if (!segment)
+		return -ENOMEM;
+
+	segment->da = da;
+	segment->size = size;
+	segment->priv = priv;
+	segment->dump = dumpfn;
+
+	list_add_tail(&segment->node, &rproc->dump_segments);
+
+	return 0;
+}
+EXPORT_SYMBOL(rproc_coredump_add_custom_segment);
+
 /**
  * rproc_coredump() - perform coredump
  * @rproc:	rproc handle
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 2a93e102d2ad..0003b23ab117 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -563,6 +563,11 @@ int rproc_boot(struct rproc *rproc);
 void rproc_shutdown(struct rproc *rproc);
 void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
 int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size);
+int rproc_coredump_add_custom_segment(struct rproc *rproc,
+				      dma_addr_t da, size_t size, void *priv,
+				      void (*dumpfn)(struct rproc *rproc,
+					struct rproc_dump_segment *segment,
+					void *dest));
 
 static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
 {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v4 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence
  2018-10-09 16:23 [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 2/5] remoteproc: Add mechanism for custom dump function assignment Sibi Sankar
@ 2018-10-09 16:23 ` Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump Sibi Sankar
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:23 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

Refactor re-useable parts of mba load/unload sequence into mba_load and
mba_reclaim respectively. This is done in order to prevent code duplication
for modem coredump, which requires the mba to be loaded before dumping
the segments. No change in functionality is intended.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 239 +++++++++++++++++------------
 1 file changed, 140 insertions(+), 99 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index f52b64120877..c475af65ba1d 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -679,6 +679,143 @@ static bool q6v5_phdr_valid(const struct elf32_phdr *phdr)
 	return true;
 }
 
+static int q6v5_mba_load(struct q6v5 *qproc)
+{
+	int ret;
+	int xfermemop_ret;
+
+	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
+				    qproc->proxy_reg_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable proxy supplies\n");
+		return ret;
+	}
+
+	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
+			      qproc->proxy_clk_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable proxy clocks\n");
+		goto disable_proxy_reg;
+	}
+
+	ret = q6v5_regulator_enable(qproc, qproc->active_regs,
+				    qproc->active_reg_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable supplies\n");
+		goto disable_proxy_clk;
+	}
+
+	ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks,
+			      qproc->reset_clk_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable reset clocks\n");
+		goto disable_vdd;
+	}
+
+	ret = q6v5_reset_deassert(qproc);
+	if (ret) {
+		dev_err(qproc->dev, "failed to deassert mss restart\n");
+		goto disable_reset_clks;
+	}
+
+	ret = q6v5_clk_enable(qproc->dev, qproc->active_clks,
+			      qproc->active_clk_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable clocks\n");
+		goto assert_reset;
+	}
+
+	/* Assign MBA image access in DDR to q6 */
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
+				      qproc->mba_phys, qproc->mba_size);
+	if (ret) {
+		dev_err(qproc->dev,
+			"assigning Q6 access to mba memory failed: %d\n", ret);
+		goto disable_active_clks;
+	}
+
+	writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
+
+	ret = q6v5proc_reset(qproc);
+	if (ret)
+		goto reclaim_mba;
+
+	ret = q6v5_rmb_mba_wait(qproc, 0, 5000);
+	if (ret == -ETIMEDOUT) {
+		dev_err(qproc->dev, "MBA boot timed out\n");
+		goto halt_axi_ports;
+	} else if (ret != RMB_MBA_XPU_UNLOCKED &&
+		   ret != RMB_MBA_XPU_UNLOCKED_SCRIBBLED) {
+		dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret);
+		ret = -EINVAL;
+		goto halt_axi_ports;
+	}
+
+	return 0;
+
+halt_axi_ports:
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
+
+reclaim_mba:
+	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,
+						qproc->mba_phys,
+						qproc->mba_size);
+	if (xfermemop_ret) {
+		dev_err(qproc->dev,
+			"Failed to reclaim mba buffer, system may become unstable\n");
+	}
+
+disable_active_clks:
+	q6v5_clk_disable(qproc->dev, qproc->active_clks,
+			 qproc->active_clk_count);
+assert_reset:
+	q6v5_reset_assert(qproc);
+disable_reset_clks:
+	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
+			 qproc->reset_clk_count);
+disable_vdd:
+	q6v5_regulator_disable(qproc, qproc->active_regs,
+			       qproc->active_reg_count);
+disable_proxy_clk:
+	q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
+			 qproc->proxy_clk_count);
+disable_proxy_reg:
+	q6v5_regulator_disable(qproc, qproc->proxy_regs,
+			       qproc->proxy_reg_count);
+
+	return ret;
+}
+
+static void q6v5_mba_reclaim(struct q6v5 *qproc)
+{
+	int xfermemop_ret;
+
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
+	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,
+						qproc->mba_phys,
+						qproc->mba_size);
+	if (xfermemop_ret) {
+		dev_err(qproc->dev,
+			"Failed to reclaim mba buffer, system may become unstable\n");
+	}
+
+	q6v5_clk_disable(qproc->dev, qproc->active_clks,
+			 qproc->active_clk_count);
+	q6v5_reset_assert(qproc);
+	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
+			 qproc->reset_clk_count);
+	q6v5_regulator_disable(qproc, qproc->active_regs,
+			       qproc->active_reg_count);
+	q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
+			 qproc->proxy_clk_count);
+	q6v5_regulator_disable(qproc, qproc->proxy_regs,
+			       qproc->proxy_reg_count);
+}
+
 static int q6v5_mpss_load(struct q6v5 *qproc)
 {
 	const struct elf32_phdr *phdrs;
@@ -803,72 +940,9 @@ static int q6v5_start(struct rproc *rproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
-	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
-				    qproc->proxy_reg_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable proxy supplies\n");
-		goto disable_irqs;
-	}
-
-	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
-			      qproc->proxy_clk_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable proxy clocks\n");
-		goto disable_proxy_reg;
-	}
-
-	ret = q6v5_regulator_enable(qproc, qproc->active_regs,
-				    qproc->active_reg_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable supplies\n");
-		goto disable_proxy_clk;
-	}
-
-	ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks,
-			      qproc->reset_clk_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable reset clocks\n");
-		goto disable_vdd;
-	}
-
-	ret = q6v5_reset_deassert(qproc);
-	if (ret) {
-		dev_err(qproc->dev, "failed to deassert mss restart\n");
-		goto disable_reset_clks;
-	}
-
-	ret = q6v5_clk_enable(qproc->dev, qproc->active_clks,
-			      qproc->active_clk_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable clocks\n");
-		goto assert_reset;
-	}
-
-	/* Assign MBA image access in DDR to q6 */
-	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
-				      qproc->mba_phys, qproc->mba_size);
-	if (ret) {
-		dev_err(qproc->dev,
-			"assigning Q6 access to mba memory failed: %d\n", ret);
-		goto disable_active_clks;
-	}
-
-	writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
-
-	ret = q6v5proc_reset(qproc);
+	ret = q6v5_mba_load(qproc);
 	if (ret)
-		goto reclaim_mba;
-
-	ret = q6v5_rmb_mba_wait(qproc, 0, 5000);
-	if (ret == -ETIMEDOUT) {
-		dev_err(qproc->dev, "MBA boot timed out\n");
-		goto halt_axi_ports;
-	} else if (ret != RMB_MBA_XPU_UNLOCKED &&
-		   ret != RMB_MBA_XPU_UNLOCKED_SCRIBBLED) {
-		dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret);
-		ret = -EINVAL;
-		goto halt_axi_ports;
-	}
+		goto disable_irqs;
 
 	dev_info(qproc->dev, "MBA booted, loading mpss\n");
 
@@ -897,40 +971,7 @@ static int q6v5_start(struct rproc *rproc)
 						false, qproc->mpss_phys,
 						qproc->mpss_size);
 	WARN_ON(xfermemop_ret);
-
-halt_axi_ports:
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
-
-reclaim_mba:
-	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,
-						qproc->mba_phys,
-						qproc->mba_size);
-	if (xfermemop_ret) {
-		dev_err(qproc->dev,
-			"Failed to reclaim mba buffer, system may become unstable\n");
-	}
-
-disable_active_clks:
-	q6v5_clk_disable(qproc->dev, qproc->active_clks,
-			 qproc->active_clk_count);
-
-assert_reset:
-	q6v5_reset_assert(qproc);
-disable_reset_clks:
-	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
-			 qproc->reset_clk_count);
-disable_vdd:
-	q6v5_regulator_disable(qproc, qproc->active_regs,
-			       qproc->active_reg_count);
-disable_proxy_clk:
-	q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
-			 qproc->proxy_clk_count);
-disable_proxy_reg:
-	q6v5_regulator_disable(qproc, qproc->proxy_regs,
-			       qproc->proxy_reg_count);
-
+	q6v5_mba_reclaim(qproc);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 15%]

* [PATCH v4 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem
  2018-10-09 16:23 [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
                   ` (2 preceding siblings ...)
  2018-10-09 16:23 ` [PATCH v4 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence Sibi Sankar
@ 2018-10-09 16:23 ` Sibi Sankar
  2018-10-09 16:23 ` [PATCH v4 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump Sibi Sankar
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:23 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

The per segment dump function is responsible for loading the mba
before device memory segments associated with coredump can be populated
and for cleaning up the resources post coredump.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c475af65ba1d..85db95bfd355 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -182,6 +182,7 @@ struct q6v5 {
 	struct qcom_sysmon *sysmon;
 	bool need_mem_protection;
 	bool has_alt_reset;
+	unsigned long dump_segment_cnt;
 	int mpss_perm;
 	int mba_perm;
 	int version;
@@ -932,6 +933,30 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 	return ret < 0 ? ret : 0;
 }
 
+static void qcom_q6v5_dump_segment(struct rproc *rproc,
+				   struct rproc_dump_segment *segment,
+				   void *dest)
+{
+	int ret = 0;
+	struct q6v5 *qproc = rproc->priv;
+	unsigned long dump_cnt = (unsigned long)segment->priv;
+	void *ptr = rproc_da_to_va(rproc, segment->da, segment->size);
+
+	/* Unlock mba before copying segments */
+	if (!dump_cnt)
+		ret = q6v5_mba_load(qproc);
+
+	if (!ptr || ret)
+		memset(dest, 0xff, segment->size);
+	else
+		memcpy(dest, ptr, segment->size);
+
+	dump_cnt++;
+	/* Reclaim mba after copying segments */
+	if (dump_cnt == qproc->dump_segment_cnt)
+		q6v5_mba_reclaim(qproc);
+}
+
 static int q6v5_start(struct rproc *rproc)
 {
 	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v4 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump
  2018-10-09 16:23 [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
                   ` (3 preceding siblings ...)
  2018-10-09 16:23 ` [PATCH v4 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem Sibi Sankar
@ 2018-10-09 16:23 ` Sibi Sankar
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 16:23 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

Register the MDT segments, custom dumpfn and private data with the
remoteproc core dump functionality.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 43 ++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 85db95bfd355..bece5dd46bca 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1065,10 +1065,53 @@ static void *q6v5_da_to_va(struct rproc *rproc, u64 da, int len)
 	return qproc->mpss_region + offset;
 }
 
+static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
+				const struct firmware *mba_fw)
+{
+	const struct firmware *fw;
+	const struct elf32_phdr *phdrs;
+	const struct elf32_phdr *phdr;
+	const struct elf32_hdr *ehdr;
+	struct q6v5 *qproc = rproc->priv;
+	unsigned long segment_cnt = 0;
+	int ret;
+	int i;
+
+	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	if (ret < 0) {
+		dev_err(qproc->dev, "unable to load modem.mdt\n");
+		return ret;
+	}
+
+	ehdr = (struct elf32_hdr *)fw->data;
+	phdrs = (struct elf32_phdr *)(ehdr + 1);
+
+	for (i = 0; i < ehdr->e_phnum; i++) {
+		phdr = &phdrs[i];
+
+		if (!q6v5_phdr_valid(phdr))
+			continue;
+
+		ret = rproc_coredump_add_custom_segment(rproc, phdr->p_paddr,
+							phdr->p_memsz,
+							(void *)segment_cnt,
+							qcom_q6v5_dump_segment);
+		if (ret)
+			break;
+
+		segment_cnt++;
+	}
+
+	qproc->dump_segment_cnt = segment_cnt;
+	release_firmware(fw);
+	return ret;
+}
+
 static const struct rproc_ops q6v5_ops = {
 	.start = q6v5_start,
 	.stop = q6v5_stop,
 	.da_to_va = q6v5_da_to_va,
+	.parse_fw = qcom_q6v5_register_dump_segments,
 	.load = q6v5_load,
 };
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* Re: [PATCH] remoteproc: qcom: q6v5-pil: add SCM probe dependency
      [irrelevant]   ` <20181009170232.GA86621@ban.mtv.corp.google.com>
@ 2018-10-09 17:21     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-09 17:21 UTC (permalink / raw)
  To: Brian Norris
  Cc: Bjorn Andersson, Ohad Ben-Cohen, linux-remoteproc, linux-kernel,
	linux-arm-msm, linux-soc


On 2018-10-09 22:32, Brian Norris wrote:
> On Mon, Oct 08, 2018 at 11:21:25PM -0700, Bjorn Andersson wrote:
>> On Mon 08 Oct 19:08 PDT 2018, Brian Norris wrote:
>> 
>> > Similar to qcom_q6v5_pas and qcom_wcnss drivers, probe will fail if SCM
>> > is not up.
>> >
>> 
>> Thanks Brian, this dependency was introduced with the memory ownership
>> support.
> 
> That's a good point. I'm actually not that familiar with this 
> particular
> driver--I was just trying to resolve an OOPS I saw while bringing this
> driver up--but that does look correct.
> 
>> I applied it with an updated conditional to make it explicit that it
>> related to need_mem_protection, updated the commit message to describe
>> actual relationship to the memory protection mechanism and added a
>> Fixes: tag.
> 
> Your version looks good, thanks.
> 
>> Don't we also need to add the ability to disable need_mem_protection
>> when we're running ATF?
> 
> I'm not sure exactly, but FWIW I'm running some form of ATF on SDM845
> and I'm running with 'needs_memory_protection' (hence, this patch).
> 

AFAIK ATF will eventually support the hyp assign calls even though they
are just stubs as of now.

> Regards,
> Brian

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc
@ 2018-10-17 13:55 Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
                   ` (4 more replies)
  0 siblings, 5 replies; 200+ results
From: Sibi Sankar @ 2018-10-17 13:55 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

This patch series add coredump support for modem on SDM845, MSM8996
and MSM8916 SoCs. Modem requires the mba to be loaded before a
coredump can be performed and this is achieved using a custom per
segment dump function.

V5:
  Add software bypass to avoid high MX current in mpss_load error path.
  Remove the proxy votes of clk/regs only after the active/reset clks/regs.
  Reclaim MBA memory after mpss_load failure in mba_reclaim func.
  Revert to dump_fn to as done with v3 with a mask based approach.

V4:
  Addressed Bjorn's comments.

V3:
  [bjorn]:replace prepare/unprepare ops with a more generalised per segment
  dump function

V2:
  Introduce prepare/unprepare ops for rproc coredump

Sibi Sankar (5):
  remoteproc: Introduce custom dump function for each remoteproc segment
  remoteproc: Add mechanism for custom dump function assignment
  remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence
  remoteproc: qcom: q6v5-mss: Add custom dump function for modem
  remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump

 drivers/remoteproc/qcom_q6v5_mss.c   | 379 +++++++++++++++++----------
 drivers/remoteproc/remoteproc_core.c |  55 +++-
 include/linux/remoteproc.h           |  11 +
 3 files changed, 303 insertions(+), 142 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 15%]

* [PATCH v5 1/5] remoteproc: Introduce custom dump function for each remoteproc segment
  2018-10-17 13:55 [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
@ 2018-10-17 13:55 ` Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 2/5] remoteproc: Add mechanism for custom dump function assignment Sibi Sankar
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-17 13:55 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

Introduce custom dump function and private data per remoteproc dump
segment. The dump function is responsible for filling the device memory
segment associated with coredump

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/remoteproc_core.c | 16 ++++++++++------
 include/linux/remoteproc.h           |  6 ++++++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index aa6206706fe3..afa4274b6ccd 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1183,14 +1183,18 @@ static void rproc_coredump(struct rproc *rproc)
 		phdr->p_flags = PF_R | PF_W | PF_X;
 		phdr->p_align = 0;
 
-		ptr = rproc_da_to_va(rproc, segment->da, segment->size);
-		if (!ptr) {
-			dev_err(&rproc->dev,
+		if (segment->dump) {
+			segment->dump(rproc, segment, data + offset);
+		} else {
+			ptr = rproc_da_to_va(rproc, segment->da, segment->size);
+			if (!ptr) {
+				dev_err(&rproc->dev,
 				"invalid coredump segment (%pad, %zu)\n",
 				&segment->da, segment->size);
-			memset(data + offset, 0xff, segment->size);
-		} else {
-			memcpy(data + offset, ptr, segment->size);
+				memset(data + offset, 0xff, segment->size);
+			} else {
+				memcpy(data + offset, ptr, segment->size);
+			}
 		}
 
 		offset += phdr->p_filesz;
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index e3c5d856b6da..2a93e102d2ad 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -399,6 +399,9 @@ enum rproc_crash_type {
  * @node:	list node related to the rproc segment list
  * @da:		device address of the segment
  * @size:	size of the segment
+ * @priv:	private data associated with the dump_segment
+ * @dump:	custom dump function to fill device memory segment associated
+ *		with coredump
  */
 struct rproc_dump_segment {
 	struct list_head node;
@@ -406,6 +409,9 @@ struct rproc_dump_segment {
 	dma_addr_t da;
 	size_t size;
 
+	void *priv;
+	void (*dump)(struct rproc *rproc, struct rproc_dump_segment *segment,
+		     void *dest);
 	loff_t offset;
 };
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v5 2/5] remoteproc: Add mechanism for custom dump function assignment
  2018-10-17 13:55 [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
@ 2018-10-17 13:55 ` Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence Sibi Sankar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-17 13:55 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

This patch adds a mechanism for assigning each rproc dump segment with
a custom dump function and private data. The dump function is to be
called for each rproc segment during coredump if assigned.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/remoteproc_core.c | 39 ++++++++++++++++++++++++++++
 include/linux/remoteproc.h           |  5 ++++
 2 files changed, 44 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index afa4274b6ccd..076579f44c3a 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1121,6 +1121,45 @@ int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size)
 }
 EXPORT_SYMBOL(rproc_coredump_add_segment);
 
+/**
+ * rproc_coredump_add_custom_segment() - add segment of device memory to
+ *					 coredump and extend it with custom
+ *					 dump function
+ * @rproc:	handle of a remote processor
+ * @da:		device address
+ * @size:	size of segment
+ * @priv:	private data
+ * @dumpfn:	custom dump function called for each segment during coredump
+ *
+ * Add device memory to the list of segments to be included in the coredump
+ * and associate the segment with the given custom dump function and private
+ * data.
+ *
+ * Return: 0 on success, negative errno on error.
+ */
+int rproc_coredump_add_custom_segment(struct rproc *rproc,
+				      dma_addr_t da, size_t size, void *priv,
+				      void (*dumpfn)(struct rproc *rproc,
+					struct rproc_dump_segment *segment,
+					void *dest))
+{
+	struct rproc_dump_segment *segment;
+
+	segment = kzalloc(sizeof(*segment), GFP_KERNEL);
+	if (!segment)
+		return -ENOMEM;
+
+	segment->da = da;
+	segment->size = size;
+	segment->priv = priv;
+	segment->dump = dumpfn;
+
+	list_add_tail(&segment->node, &rproc->dump_segments);
+
+	return 0;
+}
+EXPORT_SYMBOL(rproc_coredump_add_custom_segment);
+
 /**
  * rproc_coredump() - perform coredump
  * @rproc:	rproc handle
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 2a93e102d2ad..0003b23ab117 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -563,6 +563,11 @@ int rproc_boot(struct rproc *rproc);
 void rproc_shutdown(struct rproc *rproc);
 void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
 int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size);
+int rproc_coredump_add_custom_segment(struct rproc *rproc,
+				      dma_addr_t da, size_t size, void *priv,
+				      void (*dumpfn)(struct rproc *rproc,
+					struct rproc_dump_segment *segment,
+					void *dest));
 
 static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
 {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v5 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence
  2018-10-17 13:55 [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 2/5] remoteproc: Add mechanism for custom dump function assignment Sibi Sankar
@ 2018-10-17 13:55 ` Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump Sibi Sankar
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-17 13:55 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

Refactor re-useable parts of mba load/unload sequence into mba_load and
mba_reclaim respectively. This is done in order to prevent code duplication
for modem coredump, which requires the mba to be loaded before dumping
the segments. The following changes in functionality are intended:

* Add software bypass to avoid high MX current in mpss error path.
* Remove the proxy votes of clk/regs only after the active/reset clks/regs.
* Reclaim MBA memory after mpss_load failure in mba_reclaim func.
* Set/Unset the dump_mba_loaded flag on mba_load/mba_reclaim respectively.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 308 ++++++++++++++++-------------
 1 file changed, 170 insertions(+), 138 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index f52b64120877..87d7f4d0c176 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -167,6 +167,7 @@ struct q6v5 {
 
 	bool running;
 
+	bool dump_mba_loaded;
 	phys_addr_t mba_phys;
 	void *mba_region;
 	size_t mba_size;
@@ -679,6 +680,171 @@ static bool q6v5_phdr_valid(const struct elf32_phdr *phdr)
 	return true;
 }
 
+static int q6v5_mba_load(struct q6v5 *qproc)
+{
+	int ret;
+	int xfermemop_ret;
+
+	qcom_q6v5_prepare(&qproc->q6v5);
+
+	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
+				    qproc->proxy_reg_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable proxy supplies\n");
+		goto disable_irqs;
+	}
+
+	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
+			      qproc->proxy_clk_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable proxy clocks\n");
+		goto disable_proxy_reg;
+	}
+
+	ret = q6v5_regulator_enable(qproc, qproc->active_regs,
+				    qproc->active_reg_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable supplies\n");
+		goto disable_proxy_clk;
+	}
+
+	ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks,
+			      qproc->reset_clk_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable reset clocks\n");
+		goto disable_vdd;
+	}
+
+	ret = q6v5_reset_deassert(qproc);
+	if (ret) {
+		dev_err(qproc->dev, "failed to deassert mss restart\n");
+		goto disable_reset_clks;
+	}
+
+	ret = q6v5_clk_enable(qproc->dev, qproc->active_clks,
+			      qproc->active_clk_count);
+	if (ret) {
+		dev_err(qproc->dev, "failed to enable clocks\n");
+		goto assert_reset;
+	}
+
+	/* Assign MBA image access in DDR to q6 */
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
+				      qproc->mba_phys, qproc->mba_size);
+	if (ret) {
+		dev_err(qproc->dev,
+			"assigning Q6 access to mba memory failed: %d\n", ret);
+		goto disable_active_clks;
+	}
+
+	writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
+
+	ret = q6v5proc_reset(qproc);
+	if (ret)
+		goto reclaim_mba;
+
+	ret = q6v5_rmb_mba_wait(qproc, 0, 5000);
+	if (ret == -ETIMEDOUT) {
+		dev_err(qproc->dev, "MBA boot timed out\n");
+		goto halt_axi_ports;
+	} else if (ret != RMB_MBA_XPU_UNLOCKED &&
+		   ret != RMB_MBA_XPU_UNLOCKED_SCRIBBLED) {
+		dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret);
+		ret = -EINVAL;
+		goto halt_axi_ports;
+	}
+
+	qproc->dump_mba_loaded = true;
+	return 0;
+
+halt_axi_ports:
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
+
+reclaim_mba:
+	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,
+						qproc->mba_phys,
+						qproc->mba_size);
+	if (xfermemop_ret) {
+		dev_err(qproc->dev,
+			"Failed to reclaim mba buffer, system may become unstable\n");
+	}
+
+disable_active_clks:
+	q6v5_clk_disable(qproc->dev, qproc->active_clks,
+			 qproc->active_clk_count);
+assert_reset:
+	q6v5_reset_assert(qproc);
+disable_reset_clks:
+	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
+			 qproc->reset_clk_count);
+disable_vdd:
+	q6v5_regulator_disable(qproc, qproc->active_regs,
+			       qproc->active_reg_count);
+disable_proxy_clk:
+	q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
+			 qproc->proxy_clk_count);
+disable_proxy_reg:
+	q6v5_regulator_disable(qproc, qproc->proxy_regs,
+			       qproc->proxy_reg_count);
+disable_irqs:
+	qcom_q6v5_unprepare(&qproc->q6v5);
+
+	return ret;
+}
+
+static void q6v5_mba_reclaim(struct q6v5 *qproc)
+{
+	int ret;
+	u32 val;
+
+	qproc->dump_mba_loaded = false;
+
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
+	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
+	if (qproc->version == MSS_MSM8996) {
+		/*
+		 * To avoid high MX current during LPASS/MSS restart.
+		 */
+		val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG);
+		val |= Q6SS_CLAMP_IO | QDSP6v56_CLAMP_WL |
+			QDSP6v56_CLAMP_QMC_MEM;
+		writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
+	}
+
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm,
+						false, qproc->mpss_phys,
+						qproc->mpss_size);
+	WARN_ON(ret);
+
+	q6v5_reset_assert(qproc);
+
+	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
+			 qproc->reset_clk_count);
+	q6v5_clk_disable(qproc->dev, qproc->active_clks,
+			 qproc->active_clk_count);
+	q6v5_regulator_disable(qproc, qproc->active_regs,
+			       qproc->active_reg_count);
+
+	/* In case of failure or coredump scenario where reclaiming MBA memory
+	 * could not happen reclaim it here.
+	 */
+	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,
+						qproc->mba_phys,
+						qproc->mba_size);
+	WARN_ON(ret);
+
+	ret = qcom_q6v5_unprepare(&qproc->q6v5);
+	if (ret) {
+		q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
+				 qproc->proxy_clk_count);
+		q6v5_regulator_disable(qproc, qproc->proxy_regs,
+				       qproc->proxy_reg_count);
+	}
+}
+
 static int q6v5_mpss_load(struct q6v5 *qproc)
 {
 	const struct elf32_phdr *phdrs;
@@ -801,74 +967,9 @@ static int q6v5_start(struct rproc *rproc)
 	int xfermemop_ret;
 	int ret;
 
-	qcom_q6v5_prepare(&qproc->q6v5);
-
-	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
-				    qproc->proxy_reg_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable proxy supplies\n");
-		goto disable_irqs;
-	}
-
-	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
-			      qproc->proxy_clk_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable proxy clocks\n");
-		goto disable_proxy_reg;
-	}
-
-	ret = q6v5_regulator_enable(qproc, qproc->active_regs,
-				    qproc->active_reg_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable supplies\n");
-		goto disable_proxy_clk;
-	}
-
-	ret = q6v5_clk_enable(qproc->dev, qproc->reset_clks,
-			      qproc->reset_clk_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable reset clocks\n");
-		goto disable_vdd;
-	}
-
-	ret = q6v5_reset_deassert(qproc);
-	if (ret) {
-		dev_err(qproc->dev, "failed to deassert mss restart\n");
-		goto disable_reset_clks;
-	}
-
-	ret = q6v5_clk_enable(qproc->dev, qproc->active_clks,
-			      qproc->active_clk_count);
-	if (ret) {
-		dev_err(qproc->dev, "failed to enable clocks\n");
-		goto assert_reset;
-	}
-
-	/* Assign MBA image access in DDR to q6 */
-	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, true,
-				      qproc->mba_phys, qproc->mba_size);
-	if (ret) {
-		dev_err(qproc->dev,
-			"assigning Q6 access to mba memory failed: %d\n", ret);
-		goto disable_active_clks;
-	}
-
-	writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
-
-	ret = q6v5proc_reset(qproc);
+	ret = q6v5_mba_load(qproc);
 	if (ret)
-		goto reclaim_mba;
-
-	ret = q6v5_rmb_mba_wait(qproc, 0, 5000);
-	if (ret == -ETIMEDOUT) {
-		dev_err(qproc->dev, "MBA boot timed out\n");
-		goto halt_axi_ports;
-	} else if (ret != RMB_MBA_XPU_UNLOCKED &&
-		   ret != RMB_MBA_XPU_UNLOCKED_SCRIBBLED) {
-		dev_err(qproc->dev, "MBA returned unexpected status %d\n", ret);
-		ret = -EINVAL;
-		goto halt_axi_ports;
-	}
+		return ret;
 
 	dev_info(qproc->dev, "MBA booted, loading mpss\n");
 
@@ -897,42 +998,7 @@ static int q6v5_start(struct rproc *rproc)
 						false, qproc->mpss_phys,
 						qproc->mpss_size);
 	WARN_ON(xfermemop_ret);
-
-halt_axi_ports:
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
-
-reclaim_mba:
-	xfermemop_ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,
-						qproc->mba_phys,
-						qproc->mba_size);
-	if (xfermemop_ret) {
-		dev_err(qproc->dev,
-			"Failed to reclaim mba buffer, system may become unstable\n");
-	}
-
-disable_active_clks:
-	q6v5_clk_disable(qproc->dev, qproc->active_clks,
-			 qproc->active_clk_count);
-
-assert_reset:
-	q6v5_reset_assert(qproc);
-disable_reset_clks:
-	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
-			 qproc->reset_clk_count);
-disable_vdd:
-	q6v5_regulator_disable(qproc, qproc->active_regs,
-			       qproc->active_reg_count);
-disable_proxy_clk:
-	q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
-			 qproc->proxy_clk_count);
-disable_proxy_reg:
-	q6v5_regulator_disable(qproc, qproc->proxy_regs,
-			       qproc->proxy_reg_count);
-
-disable_irqs:
-	qcom_q6v5_unprepare(&qproc->q6v5);
+	q6v5_mba_reclaim(qproc);
 
 	return ret;
 }
@@ -941,7 +1007,6 @@ static int q6v5_stop(struct rproc *rproc)
 {
 	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
 	int ret;
-	u32 val;
 
 	qproc->running = false;
 
@@ -949,40 +1014,7 @@ static int q6v5_stop(struct rproc *rproc)
 	if (ret == -ETIMEDOUT)
 		dev_err(qproc->dev, "timed out on wait\n");
 
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_q6);
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
-	q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
-	if (qproc->version == MSS_MSM8996) {
-		/*
-		 * To avoid high MX current during LPASS/MSS restart.
-		 */
-		val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-		val |= Q6SS_CLAMP_IO | QDSP6v56_CLAMP_WL |
-			QDSP6v56_CLAMP_QMC_MEM;
-		writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
-	}
-
-
-	ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, false,
-				      qproc->mpss_phys, qproc->mpss_size);
-	WARN_ON(ret);
-
-	q6v5_reset_assert(qproc);
-
-	ret = qcom_q6v5_unprepare(&qproc->q6v5);
-	if (ret) {
-		q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
-				 qproc->proxy_clk_count);
-		q6v5_regulator_disable(qproc, qproc->proxy_regs,
-				       qproc->proxy_reg_count);
-	}
-
-	q6v5_clk_disable(qproc->dev, qproc->reset_clks,
-			 qproc->reset_clk_count);
-	q6v5_clk_disable(qproc->dev, qproc->active_clks,
-			 qproc->active_clk_count);
-	q6v5_regulator_disable(qproc, qproc->active_regs,
-			       qproc->active_reg_count);
+	q6v5_mba_reclaim(qproc);
 
 	return 0;
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 14%]

* [PATCH v5 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem
  2018-10-17 13:55 [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
                   ` (2 preceding siblings ...)
  2018-10-17 13:55 ` [PATCH v5 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence Sibi Sankar
@ 2018-10-17 13:55 ` Sibi Sankar
  2018-10-17 13:55 ` [PATCH v5 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump Sibi Sankar
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-17 13:55 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

The per segment dump function is responsible for loading the mba
before device memory segments associated with coredump can be populated
and for cleaning up the resources post coredump.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 33 ++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 87d7f4d0c176..0d3b9d70823e 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -168,6 +168,9 @@ struct q6v5 {
 	bool running;
 
 	bool dump_mba_loaded;
+	unsigned long dump_segment_mask;
+	unsigned long dump_complete_mask;
+
 	phys_addr_t mba_phys;
 	void *mba_region;
 	size_t mba_size;
@@ -961,6 +964,33 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 	return ret < 0 ? ret : 0;
 }
 
+static void qcom_q6v5_dump_segment(struct rproc *rproc,
+				   struct rproc_dump_segment *segment,
+				   void *dest)
+{
+	int ret = 0;
+	struct q6v5 *qproc = rproc->priv;
+	unsigned long mask = BIT((unsigned long)segment->priv);
+	void *ptr = rproc_da_to_va(rproc, segment->da, segment->size);
+
+	/* Unlock mba before copying segments */
+	if (!qproc->dump_mba_loaded)
+		ret = q6v5_mba_load(qproc);
+
+	if (!ptr || ret)
+		memset(dest, 0xff, segment->size);
+	else
+		memcpy(dest, ptr, segment->size);
+
+	qproc->dump_segment_mask |= mask;
+
+	/* Reclaim mba after copying segments */
+	if (qproc->dump_segment_mask == qproc->dump_complete_mask) {
+		if (qproc->dump_mba_loaded)
+			q6v5_mba_reclaim(qproc);
+	}
+}
+
 static int q6v5_start(struct rproc *rproc)
 {
 	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
@@ -989,6 +1019,9 @@ static int q6v5_start(struct rproc *rproc)
 	if (xfermemop_ret)
 		dev_err(qproc->dev,
 			"Failed to reclaim mba buffer system may become unstable\n");
+
+	/* Reset Dump Segment Mask */
+	qproc->dump_segment_mask = 0;
 	qproc->running = true;
 
 	return 0;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v5 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump
  2018-10-17 13:55 [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
                   ` (3 preceding siblings ...)
  2018-10-17 13:55 ` [PATCH v5 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem Sibi Sankar
@ 2018-10-17 13:55 ` Sibi Sankar
  4 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-17 13:55 UTC (permalink / raw)
  To: bjorn.andersson, ohad
  Cc: linux-remoteproc, linux-kernel, linux-arm-msm, tsoni, sricharan,
	akdwived, kyan, Sibi Sankar

Register the MDT segments, custom dumpfn and private data with the
remoteproc core dump functionality.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 42 ++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 0d3b9d70823e..8ceebde75d02 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1064,10 +1064,52 @@ static void *q6v5_da_to_va(struct rproc *rproc, u64 da, int len)
 	return qproc->mpss_region + offset;
 }
 
+static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
+				const struct firmware *mba_fw)
+{
+	const struct firmware *fw;
+	const struct elf32_phdr *phdrs;
+	const struct elf32_phdr *phdr;
+	const struct elf32_hdr *ehdr;
+	struct q6v5 *qproc = rproc->priv;
+	unsigned long i;
+	int ret;
+
+	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	if (ret < 0) {
+		dev_err(qproc->dev, "unable to load modem.mdt\n");
+		return ret;
+	}
+
+	ehdr = (struct elf32_hdr *)fw->data;
+	phdrs = (struct elf32_phdr *)(ehdr + 1);
+	qproc->dump_complete_mask = 0;
+
+	for (i = 0; i < ehdr->e_phnum; i++) {
+		phdr = &phdrs[i];
+
+		if (!q6v5_phdr_valid(phdr))
+			continue;
+
+		ret = rproc_coredump_add_custom_segment(rproc, phdr->p_paddr,
+							phdr->p_memsz,
+							(void *)i,
+							qcom_q6v5_dump_segment);
+		if (ret)
+			break;
+
+		qproc->dump_complete_mask |= BIT(i);
+	}
+
+	release_firmware(fw);
+	return ret;
+}
+
 static const struct rproc_ops q6v5_ops = {
 	.start = q6v5_start,
 	.stop = q6v5_stop,
 	.da_to_va = q6v5_da_to_va,
+	.parse_fw = qcom_q6v5_register_dump_segments,
 	.load = q6v5_load,
 };
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* Re: [RFC PATCH v2] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem
  2018-09-30 15:56 [RFC PATCH v2] " Sibi Sankar
@ 2018-10-18  0:54 ` Brian Norris
  2018-10-31 14:32   ` Sibi Sankar
  2018-10-21 20:16 ` Bjorn Andersson
  1 sibling, 1 reply; 200+ results
From: Brian Norris @ 2018-10-18  0:54 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm, linux-soc,
	linux-arm-msm-owner

Hi Sibi,

On Sun, Sep 30, 2018 at 09:26:46PM +0530, Sibi Sankar wrote:
> From: Bjorn Andersson <bjorn.andersson@linaro.org>
> 
> rmtfs_mem provides access to physical storage and is crucial for the
> operation of the Qualcomm modem subsystem.
> 
> The rmtfs_mem implementation must be available before the modem
> subsystem is booted and a solution where the modem remoteproc will
> verify that the rmtfs_mem is available has been discussed in the past.
> But this would not handle the case where the rmtfs_mem provider is
> restarted, which would cause fatal loss of access to the storage device
> for the modem.
> 
> The suggestion is therefore to link the rmtfs_mem to its associated
> remote processor instance and control it based on the availability of
> the rmtfs_mem implementation.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> [sibis: Added qmi lookup for Remote file system service]
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> The currently implemented workaround in the Linaro QCOMLT releases is to
> blacklist the qcom_q6v5_pil kernel module and load this explicitly after rmtfs
> has been started.
> 
> With this patch the modem module can be loaded automatically by the
> platform_bus and will only be booted as the rmtfs becomes available. Performing
> actions such as upgrading (and restarting) the rmtfs service will cause the
> modem to automatically restart and hence continue to function after the
> upgrade.
> 
> v2:
>   Remove rproc_boot/shutdown from rmtfs_mem open/release and add
>   qmi lookup for Remote file system service to address Brian's
>   race concerns.
> 
>  .../reserved-memory/qcom,rmtfs-mem.txt        |  7 ++
>  drivers/remoteproc/qcom_q6v5_pil.c            |  1 +
>  drivers/soc/qcom/Kconfig                      |  2 +
>  drivers/soc/qcom/rmtfs_mem.c                  | 65 ++++++++++++++++++-
>  4 files changed, 72 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
> index 8562ba1dce69..95b209e7f5d1 100644
> --- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
> +++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
> @@ -32,6 +32,13 @@ access block device data using the Remote Filesystem protocol.
>  	Value type: <u32>
>  	Definition: vmid of the remote processor, to set up memory protection.
>  
> +- rproc:
> +	Usage: optional
> +	Value type: <phandle>
> +	Definition: reference to a remoteproc node, that should be powered up
> +		    while the remote file system memory instance is ready to
> +		    handle requests from the remote subsystem.
> +

I'll repeat my comment here: this is straying far into the territory of
putting software configuration in the device tree. Per your own
comments, the modem firmware can be configured to run with or without a
remote FS, and now you're assuming that the device tree will include
this property or not, based on how you configured said firmware. That's
not how device tree is supposed to work.

>  = EXAMPLE
>  The following example shows the remote filesystem memory setup for APQ8016,
>  with the rmtfs region for the Hexagon DSP (id #1) located at 0x86700000.
> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
> index d7a4b9eca5d2..1445a38e8b34 100644
> --- a/drivers/remoteproc/qcom_q6v5_pil.c
> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
> @@ -1142,6 +1142,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qproc = (struct q6v5 *)rproc->priv;
>  	qproc->dev = &pdev->dev;
>  	qproc->rproc = rproc;
> +	rproc->auto_boot = false;

So how is it supposed to work when you have an internal filesystem for
the modem? User space just knows about this, and manually starts the
remoteproc?

>  	platform_set_drvdata(pdev, qproc);
>  
>  	ret = q6v5_init_mem(qproc, pdev);
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index 8a7b8dea6990..4e3345944325 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -86,7 +86,9 @@ config QCOM_QMI_HELPERS
>  config QCOM_RMTFS_MEM
>  	tristate "Qualcomm Remote Filesystem memory driver"
>  	depends on ARCH_QCOM
> +	depends on REMOTEPROC
>  	select QCOM_SCM
> +	select QCOM_QMI_HELPERS
>  	help
>  	  The Qualcomm remote filesystem memory driver is used for allocating
>  	  and exposing regions of shared memory with remote processors for the
> diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
> index 97bb5989aa21..757e30083f67 100644
> --- a/drivers/soc/qcom/rmtfs_mem.c
> +++ b/drivers/soc/qcom/rmtfs_mem.c
> @@ -18,11 +18,13 @@
>  #include <linux/platform_device.h>
>  #include <linux/of.h>
>  #include <linux/of_reserved_mem.h>
> +#include <linux/remoteproc.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/slab.h>
>  #include <linux/uaccess.h>
>  #include <linux/io.h>
>  #include <linux/qcom_scm.h>
> +#include <linux/soc/qcom/qmi.h>
>  
>  #define QCOM_RMTFS_MEM_DEV_MAX	(MINORMASK + 1)
>  
> @@ -31,6 +33,7 @@ static dev_t qcom_rmtfs_mem_major;
>  struct qcom_rmtfs_mem {
>  	struct device dev;
>  	struct cdev cdev;
> +	struct qmi_handle rmtfs_hdl;
>  
>  	void *base;
>  	phys_addr_t addr;
> @@ -39,6 +42,8 @@ struct qcom_rmtfs_mem {
>  	unsigned int client_id;
>  
>  	unsigned int perms;
> +
> +	struct rproc *rproc;
>  };
>  
>  static ssize_t qcom_rmtfs_mem_show(struct device *dev,
> @@ -141,6 +146,36 @@ static const struct file_operations qcom_rmtfs_mem_fops = {
>  	.llseek = default_llseek,
>  };
>  
> +static int rmtfs_new_server(struct qmi_handle *qmi,
> +				 struct qmi_service *service)
> +{
> +	int ret = 0;
> +	struct qcom_rmtfs_mem *rmtfs_mem = container_of(qmi,
> +							struct qcom_rmtfs_mem,
> +							rmtfs_hdl);
> +
> +	if (rmtfs_mem->rproc)

Couldn't you avoid registering these callbacks entirely, if there's no
rproc device/phandle?

> +		ret = rproc_boot(rmtfs_mem->rproc);
> +
> +	return ret;
> +};
> +
> +static void rmtfs_del_server(struct qmi_handle *qmi,
> +				  struct qmi_service *service)
> +{
> +	struct qcom_rmtfs_mem *rmtfs_mem = container_of(qmi,
> +							struct qcom_rmtfs_mem,
> +							rmtfs_hdl);
> +
> +	if (rmtfs_mem->rproc)
> +		rproc_shutdown(rmtfs_mem->rproc);
> +};
> +
> +static struct qmi_ops rmtfs_lookup_ops = {
> +	.new_server = rmtfs_new_server,
> +	.del_server = rmtfs_del_server,
> +};
> +
>  static void qcom_rmtfs_mem_release_device(struct device *dev)
>  {
>  	struct qcom_rmtfs_mem *rmtfs_mem = container_of(dev,
> @@ -156,6 +191,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	struct qcom_scm_vmperm perms[2];
>  	struct reserved_mem *rmem;
>  	struct qcom_rmtfs_mem *rmtfs_mem;
> +	phandle rproc_phandle;
>  	u32 client_id;
>  	u32 vmid;
>  	int ret;
> @@ -181,6 +217,22 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	rmtfs_mem->client_id = client_id;
>  	rmtfs_mem->size = rmem->size;
>  
> +	ret = of_property_read_u32(node, "rproc", &rproc_phandle);
> +	if (!ret) {
> +		rmtfs_mem->rproc = rproc_get_by_phandle(rproc_phandle);
> +		if (!rmtfs_mem->rproc)
> +			return -EPROBE_DEFER;
> +	}
> +
> +	ret = qmi_handle_init(&rmtfs_mem->rmtfs_hdl, 0,
> +			      &rmtfs_lookup_ops, NULL);

Similar to the above comment: this should just be under the "if rproc"
condition -- also because in remove(), you only unregister these
callbacks if you have an rproc device.

> +	if (ret < 0)
> +		goto put_rproc;

You've got the error handling wrong here. You're doing the
rmtfs_mem->dev cleanup under the 'put_rproc' label, but you haven't even
started to initialize that device by now.

> +
> +	ret = qmi_add_lookup(&rmtfs_mem->rmtfs_hdl, 14, 0, 0);

I can see there are some bad examples out there already to cheat off
of...but please don't just use magic nubmers like '14' here. There
should be a defined constant for this.

And while we're at it: why isn't there a common header for QMI service
IDs? Would be nice to list all the IDs that the kernel might be using,
in one place.

> +	if (ret < 0)
> +		goto err_release_qmi_handle;
> +
>  	device_initialize(&rmtfs_mem->dev);
>  	rmtfs_mem->dev.parent = &pdev->dev;
>  	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;
> @@ -191,7 +243,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	if (IS_ERR(rmtfs_mem->base)) {
>  		dev_err(&pdev->dev, "failed to remap rmtfs_mem region\n");
>  		ret = PTR_ERR(rmtfs_mem->base);
> -		goto put_device;
> +		goto err_release_qmi_handle;
>  	}
>  
>  	cdev_init(&rmtfs_mem->cdev, &qcom_rmtfs_mem_fops);
> @@ -204,7 +256,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	ret = cdev_device_add(&rmtfs_mem->cdev, &rmtfs_mem->dev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to add cdev: %d\n", ret);
> -		goto put_device;
> +		goto err_release_qmi_handle;
>  	}
>  
>  	ret = of_property_read_u32(node, "qcom,vmid", &vmid);
> @@ -237,7 +289,10 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  
>  remove_cdev:
>  	cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
> -put_device:
> +err_release_qmi_handle:
> +	qmi_handle_release(&rmtfs_mem->rmtfs_hdl);
> +put_rproc:
> +	rproc_put(rmtfs_mem->rproc);
>  	put_device(&rmtfs_mem->dev);

As mentioned above, this is in the wrong order. You probably will need
an additional exit label too.

>  
>  	return ret;
> @@ -257,6 +312,10 @@ static int qcom_rmtfs_mem_remove(struct platform_device *pdev)
>  	}
>  
>  	cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
> +	if (rmtfs_mem->rproc) {
> +		qmi_handle_release(&rmtfs_mem->rmtfs_hdl);

As noted above, this doesn't match with probe().

Brian

> +		rproc_put(rmtfs_mem->rproc);
> +	}
>  	put_device(&rmtfs_mem->dev);
>  
>  	return 0;

^ permalink raw reply	[relevance 0%]

* Re: [RFC PATCH v2] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem
  2018-09-30 15:56 [RFC PATCH v2] " Sibi Sankar
  2018-10-18  0:54 ` Brian Norris
@ 2018-10-21 20:16 ` Bjorn Andersson
  2018-10-31 14:04   ` Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-10-21 20:16 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: briannorris, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm, linux-soc,
	linux-arm-msm-owner

On Sun 30 Sep 08:56 PDT 2018, Sibi Sankar wrote:

> From: Bjorn Andersson <bjorn.andersson@linaro.org>
> 
> rmtfs_mem provides access to physical storage and is crucial for the
> operation of the Qualcomm modem subsystem.
> 
> The rmtfs_mem implementation must be available before the modem
> subsystem is booted and a solution where the modem remoteproc will
> verify that the rmtfs_mem is available has been discussed in the past.
> But this would not handle the case where the rmtfs_mem provider is
> restarted, which would cause fatal loss of access to the storage device
> for the modem.
> 
> The suggestion is therefore to link the rmtfs_mem to its associated
> remote processor instance and control it based on the availability of
> the rmtfs_mem implementation.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> [sibis: Added qmi lookup for Remote file system service]
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Thanks Sibi,

This looks clean and straight forward, but I think the logic should be
moved into the qcom_q6v5_mss driver itself - as we now only care about
the QMI service being present, not the rmtfs_memory driver.

There's nothing left of my original patch, so please credit yourself as
author of v3.

[..]
> diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
[..]
> @@ -181,6 +217,22 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
>  	rmtfs_mem->client_id = client_id;
>  	rmtfs_mem->size = rmem->size;
>  
> +	ret = of_property_read_u32(node, "rproc", &rproc_phandle);
> +	if (!ret) {
> +		rmtfs_mem->rproc = rproc_get_by_phandle(rproc_phandle);
> +		if (!rmtfs_mem->rproc)
> +			return -EPROBE_DEFER;
> +	}
> +
> +	ret = qmi_handle_init(&rmtfs_mem->rmtfs_hdl, 0,
> +			      &rmtfs_lookup_ops, NULL);
> +	if (ret < 0)
> +		goto put_rproc;
> +
> +	ret = qmi_add_lookup(&rmtfs_mem->rmtfs_hdl, 14, 0, 0);

The 14 here deserves a define and the whole thing would benefit from a
comment describing the remoteproc's dependency on the RMTFS service
being present.

> +	if (ret < 0)
> +		goto err_release_qmi_handle;
> +
>  	device_initialize(&rmtfs_mem->dev);
>  	rmtfs_mem->dev.parent = &pdev->dev;
>  	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;

Looking forward to v3!

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node
@ 2018-10-26 12:25 Sibi Sankar
  2018-10-29  1:35 ` Bjorn Andersson
  2018-10-29  9:32 ` Stanimir Varbanov
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-10-26 12:25 UTC (permalink / raw)
  To: andy.gross, david.brown, robh+dt
  Cc: bjorn.andersson, dianders, evgreen, benchan, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, Sibi Sankar

Add SCM DT node to enable SCM functionality on SDM845.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index b72bdb0a31a5..fad22acfda4d 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -221,6 +221,12 @@
 		};
 	};
 
+	firmware {
+		scm {
+			compatible = "qcom,scm-sdm845", "qcom,scm";
+		};
+	};
+
 	tcsr_mutex: hwlock {
 		compatible = "qcom,tcsr-mutex";
 		syscon = <&tcsr_mutex_regs 0 0x1000>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH] arm64: dts: qcom: sdm845: Add PDC Global reset driver node
@ 2018-10-26 12:26 Sibi Sankar
  2018-10-29  1:38 ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-10-26 12:26 UTC (permalink / raw)
  To: andy.gross, david.brown, robh+dt
  Cc: bjorn.andersson, dianders, evgreen, benchan, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, Sibi Sankar

This patch adds the node to support PDC Global reset driver on
SDM845 SoCs

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index fad22acfda4d..d3fe012ad84e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -11,6 +11,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/phy/phy-qcom-qusb2.h>
 #include <dt-bindings/reset/qcom,sdm845-aoss.h>
+#include <dt-bindings/reset/qcom,sdm845-pdc.h>
 #include <dt-bindings/soc/qcom,rpmh-rsc.h>
 
 / {
@@ -1262,6 +1263,12 @@
 			#power-domain-cells = <1>;
 		};
 
+		pdc_reset: reset-controller@b2e0000 {
+			compatible = "qcom,sdm845-pdc-global";
+			reg = <0xb2e0000 0x20000>;
+			#reset-cells = <1>;
+		};
+
 		tsens0: thermal-sensor@c263000 {
 			compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
 			reg = <0xc263000 0x1ff>, /* TM */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes
@ 2018-10-26 12:27 Sibi Sankar
  2018-10-29  1:39 ` Bjorn Andersson
  2018-10-29 18:37 ` Doug Anderson
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-10-26 12:27 UTC (permalink / raw)
  To: andy.gross, david.brown, robh+dt
  Cc: bjorn.andersson, dianders, evgreen, benchan, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, Sibi Sankar

Add reserve-memory nodes for mpss and mba required for
remoteproc mss pil.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index d3fe012ad84e..f74892e447f9 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -88,6 +88,16 @@
 			reg = <0 0x86200000 0 0x2d00000>;
 			no-map;
 		};
+
+		mpss_region: reserved-memory@8e000000 {
+			no-map;
+			reg = <0 0x8e000000 0 0x7800000>;
+		};
+
+		mba_region: reserved-memory@96500000 {
+			no-map;
+			reg = <0 0x96500000 0 0x200000>;
+		};
 	};
 
 	cpus {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node
  2018-10-26 12:25 [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node Sibi Sankar
@ 2018-10-29  1:35 ` Bjorn Andersson
  2018-10-29  9:32 ` Stanimir Varbanov
  1 sibling, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-29  1:35 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: andy.gross, david.brown, robh+dt, dianders, evgreen, benchan,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni

On Fri 26 Oct 05:25 PDT 2018, Sibi Sankar wrote:

> Add SCM DT node to enable SCM functionality on SDM845.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index b72bdb0a31a5..fad22acfda4d 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -221,6 +221,12 @@
>  		};
>  	};
>  
> +	firmware {
> +		scm {
> +			compatible = "qcom,scm-sdm845", "qcom,scm";
> +		};
> +	};
> +
>  	tcsr_mutex: hwlock {
>  		compatible = "qcom,tcsr-mutex";
>  		syscon = <&tcsr_mutex_regs 0 0x1000>;
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add PDC Global reset driver node
  2018-10-26 12:26 [PATCH] arm64: dts: qcom: sdm845: Add PDC Global reset driver node Sibi Sankar
@ 2018-10-29  1:38 ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-29  1:38 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: andy.gross, david.brown, robh+dt, dianders, evgreen, benchan,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni

On Fri 26 Oct 05:26 PDT 2018, Sibi Sankar wrote:

> This patch adds the node to support PDC Global reset driver on
> SDM845 SoCs
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index fad22acfda4d..d3fe012ad84e 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -11,6 +11,7 @@
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>  #include <dt-bindings/phy/phy-qcom-qusb2.h>
>  #include <dt-bindings/reset/qcom,sdm845-aoss.h>
> +#include <dt-bindings/reset/qcom,sdm845-pdc.h>
>  #include <dt-bindings/soc/qcom,rpmh-rsc.h>
>  
>  / {
> @@ -1262,6 +1263,12 @@
>  			#power-domain-cells = <1>;
>  		};
>  
> +		pdc_reset: reset-controller@b2e0000 {
> +			compatible = "qcom,sdm845-pdc-global";
> +			reg = <0xb2e0000 0x20000>;
> +			#reset-cells = <1>;
> +		};
> +
>  		tsens0: thermal-sensor@c263000 {
>  			compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
>  			reg = <0xc263000 0x1ff>, /* TM */
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes
  2018-10-26 12:27 [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes Sibi Sankar
@ 2018-10-29  1:39 ` Bjorn Andersson
  2018-10-29 18:37 ` Doug Anderson
  1 sibling, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-10-29  1:39 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: andy.gross, david.brown, robh+dt, dianders, evgreen, benchan,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni

On Fri 26 Oct 05:27 PDT 2018, Sibi Sankar wrote:

> Add reserve-memory nodes for mpss and mba required for
> remoteproc mss pil.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index d3fe012ad84e..f74892e447f9 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -88,6 +88,16 @@
>  			reg = <0 0x86200000 0 0x2d00000>;
>  			no-map;
>  		};
> +
> +		mpss_region: reserved-memory@8e000000 {
> +			no-map;
> +			reg = <0 0x8e000000 0 0x7800000>;
> +		};
> +
> +		mba_region: reserved-memory@96500000 {
> +			no-map;
> +			reg = <0 0x96500000 0 0x200000>;
> +		};
>  	};
>  
>  	cpus {
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node
  2018-10-26 12:25 [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node Sibi Sankar
  2018-10-29  1:35 ` Bjorn Andersson
@ 2018-10-29  9:32 ` Stanimir Varbanov
  2018-10-29 14:54   ` Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Stanimir Varbanov @ 2018-10-29  9:32 UTC (permalink / raw)
  To: Sibi Sankar, andy.gross, david.brown, robh+dt
  Cc: bjorn.andersson, dianders, evgreen, benchan, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni

Hi Sibi,

On 10/26/2018 03:25 PM, Sibi Sankar wrote:
> Add SCM DT node to enable SCM functionality on SDM845.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index b72bdb0a31a5..fad22acfda4d 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -221,6 +221,12 @@
>  		};
>  	};
>  
> +	firmware {
> +		scm {
> +			compatible = "qcom,scm-sdm845", "qcom,scm";
> +		};
> +	};

What will happen if the platform is without tz firmware? I'd move this
DT node in sdm845-mtp.dts or at least make it status = disabled.

-- 
regards,
Stan

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node
  2018-10-29  9:32 ` Stanimir Varbanov
@ 2018-10-29 14:54   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-29 14:54 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: andy.gross, david.brown, robh+dt, bjorn.andersson, dianders,
	evgreen, benchan, linux-arm-msm, linux-soc, devicetree,
	linux-kernel, tsoni

Hi Stan,
Thanks for the review!

On 2018-10-29 15:02, Stanimir Varbanov wrote:
> Hi Sibi,
> 
> On 10/26/2018 03:25 PM, Sibi Sankar wrote:
>> Add SCM DT node to enable SCM functionality on SDM845.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi 
>> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> index b72bdb0a31a5..fad22acfda4d 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> @@ -221,6 +221,12 @@
>>  		};
>>  	};
>> 
>> +	firmware {
>> +		scm {
>> +			compatible = "qcom,scm-sdm845", "qcom,scm";
>> +		};
>> +	};
> 
> What will happen if the platform is without tz firmware? I'd move this
> DT node in sdm845-mtp.dts or at least make it status = disabled.

Even in the absence of tz firmware, ATF is expected to implement the 
necessary
handlers for the SMC calls so I don't think it is necessary to keep it 
disabled.

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes
  2018-10-26 12:27 [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes Sibi Sankar
  2018-10-29  1:39 ` Bjorn Andersson
@ 2018-10-29 18:37 ` Doug Anderson
  2018-10-31  5:58   ` Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Doug Anderson @ 2018-10-29 18:37 UTC (permalink / raw)
  To: sibis
  Cc: Andy Gross, David Brown, Rob Herring, Bjorn Andersson,
	Evan Green, benchan, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni

Hi,

On Fri, Oct 26, 2018 at 5:28 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add reserve-memory nodes for mpss and mba required for
> remoteproc mss pil.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index d3fe012ad84e..f74892e447f9 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -88,6 +88,16 @@
>                         reg = <0 0x86200000 0 0x2d00000>;
>                         no-map;
>                 };
> +
> +               mpss_region: reserved-memory@8e000000 {
> +                       no-map;
> +                       reg = <0 0x8e000000 0 0x7800000>;
> +               };
> +
> +               mba_region: reserved-memory@96500000 {

nit: All of the other reserved memory in this same section just has
the node name "memory".  Can you please follow suit?  Also above.
This is the kind of thing that Rob H. usually cares about doing right.

> +                       no-map;
> +                       reg = <0 0x96500000 0 0x200000>;

nit: All of the other reserved memory in this same section has "reg"
above "no-map".  It doesn't matter a whole lot, but why not make it
match everyone else?  Also above.


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes
  2018-10-29 18:37 ` Doug Anderson
@ 2018-10-31  5:58   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-31  5:58 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Andy Gross, David Brown, Rob Herring, Bjorn Andersson,
	Evan Green, benchan, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni

Hi Doug,
Thanks for the review!

I noticed both the quirks just after sending it out :(, will fix them.


On 2018-10-30 00:07, Doug Anderson wrote:
> Hi,
> 
> On Fri, Oct 26, 2018 at 5:28 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> Add reserve-memory nodes for mpss and mba required for
>> remoteproc mss pil.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi 
>> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> index d3fe012ad84e..f74892e447f9 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> @@ -88,6 +88,16 @@
>>                         reg = <0 0x86200000 0 0x2d00000>;
>>                         no-map;
>>                 };
>> +
>> +               mpss_region: reserved-memory@8e000000 {
>> +                       no-map;
>> +                       reg = <0 0x8e000000 0 0x7800000>;
>> +               };
>> +
>> +               mba_region: reserved-memory@96500000 {
> 
> nit: All of the other reserved memory in this same section just has
> the node name "memory".  Can you please follow suit?  Also above.
> This is the kind of thing that Rob H. usually cares about doing right.
> 
>> +                       no-map;
>> +                       reg = <0 0x96500000 0 0x200000>;
> 
> nit: All of the other reserved memory in this same section has "reg"
> above "no-map".  It doesn't matter a whole lot, but why not make it
> match everyone else?  Also above.
> 
> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v2] arm64: dts: qcom: sdm845: Add reserve-memory nodes
@ 2018-10-31  6:09 " Sibi Sankar
  2018-10-31 21:59 ` Doug Anderson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-10-31  6:09 UTC (permalink / raw)
  To: andy.gross, david.brown, robh+dt
  Cc: bjorn.andersson, dianders, evgreen, benchan, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, Sibi Sankar

Add reserve-memory nodes for mpss and mba required for
remoteproc mss pil.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index d3fe012ad84e..636c739b2981 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -88,6 +88,16 @@
 			reg = <0 0x86200000 0 0x2d00000>;
 			no-map;
 		};
+
+		mpss_region: memory@8e000000 {
+			reg = <0 0x8e000000 0 0x7800000>;
+			no-map;
+		};
+
+		mba_region: memory@96500000 {
+			reg = <0 0x96500000 0 0x200000>;
+			no-map;
+		};
 	};
 
 	cpus {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [RFC PATCH v3] remoteproc: qcom: q6v5-mss: Sync MSS with RMTFS QMI service
@ 2018-10-31 10:46 Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-31 10:46 UTC (permalink / raw)
  To: bjorn.andersson, briannorris, mark.rutland, andy.gross
  Cc: akdwived, clew, linux-kernel, linux-arm-msm, linux-soc,
	linux-arm-msm-owner, Sibi Sankar

Introduce RMTFS qmi lookup client to synchronize bring up/down modem
with the REMOTE FS QMI service.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
The currently implemented workaround in the Linaro QCOMLT releases is to
blacklist the qcom_q6v5_pil kernel module and load this explicitly after rmtfs
has been started.

With this patch the modem module can be loaded automatically by the
platform_bus and will only be booted as the rmtfs becomes available. Performing
actions such as upgrading (and restarting) the rmtfs service will cause the
modem to automatically restart and hence continue to function after the
upgrade.

v3:
  Move rmtfs lookup client to the q6v5_mss driver
  [Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>]
  [Suggested-by: Brian Norris <briannorris@chromium.org>]
  Add deny_sysfs_ops flag to prevent updation of state/firmware
  [Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>]

v2:
  Remove rproc_boot/shutdown from rmtfs_mem open/release and add
  qmi lookup for Remote file system service to address Brian's
  race concerns.

Depends on: https://patchwork.kernel.org/patch/10601325/

 drivers/remoteproc/Kconfig         |  1 +
 drivers/remoteproc/qcom_q6v5_mss.c | 41 ++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index 8894935583e2..5919098697ec 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -100,6 +100,7 @@ config QCOM_Q6V5_MSS
 	depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
 	depends on QCOM_SYSMON || QCOM_SYSMON=n
 	select MFD_SYSCON
+	select QCOM_QMI_HELPERS
 	select QCOM_Q6V5_COMMON
 	select QCOM_RPROC_COMMON
 	select QCOM_SCM
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index da4e496816aa..436a7fec84e9 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -30,6 +30,7 @@
 #include <linux/remoteproc.h>
 #include <linux/reset.h>
 #include <linux/soc/qcom/mdt_loader.h>
+#include <linux/soc/qcom/qmi.h>
 #include <linux/iopoll.h>
 
 #include "remoteproc_internal.h"
@@ -39,6 +40,7 @@
 #include <linux/qcom_scm.h>
 
 #define MPSS_CRASH_REASON_SMEM		421
+#define REMOTEFS_QMI_SVC_ID		0xE
 
 /* RMB Status Register Values */
 #define RMB_PBL_SUCCESS			0x1
@@ -180,6 +182,7 @@ struct q6v5 {
 	void *mpss_region;
 	size_t mpss_size;
 
+	struct qmi_handle lookup_client;
 	struct qcom_rproc_glink glink_subdev;
 	struct qcom_rproc_subdev smd_subdev;
 	struct qcom_rproc_ssr ssr_subdev;
@@ -991,6 +994,25 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
 	}
 }
 
+static int rmtfs_new_server(struct qmi_handle *qmi, struct qmi_service *serv)
+{
+	struct q6v5 *qproc = container_of(qmi, struct q6v5, lookup_client);
+
+	return rproc_boot(qproc->rproc);
+};
+
+static void rmtfs_del_server(struct qmi_handle *qmi, struct qmi_service *serv)
+{
+	struct q6v5 *qproc = container_of(qmi, struct q6v5, lookup_client);
+
+	rproc_shutdown(qproc->rproc);
+};
+
+static struct qmi_ops lookup_ops = {
+	.new_server = rmtfs_new_server,
+	.del_server = rmtfs_del_server,
+};
+
 static int q6v5_start(struct rproc *rproc)
 {
 	struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
@@ -1269,6 +1291,9 @@ static int q6v5_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
+	rproc->auto_boot = false;
+	rproc->deny_sysfs_ops = true;
+
 	qproc = (struct q6v5 *)rproc->priv;
 	qproc->dev = &pdev->dev;
 	qproc->rproc = rproc;
@@ -1346,8 +1371,23 @@ static int q6v5_probe(struct platform_device *pdev)
 	if (ret)
 		goto free_rproc;
 
+	/* The modem polls for REMOTE FS QMI service for a fixed period, post
+	 * which it issues a fatal error. The RMTFS lookup client handles this
+	 * dependency by ensuring that the modem is brought up/down in sync with
+	 * the REMOTE FS QMI SERVICE.
+	 */
+	ret = qmi_handle_init(&qproc->lookup_client, 0, &lookup_ops, NULL);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to initialize qmi handle.\n");
+		goto delete_rproc;
+	}
+
+	qmi_add_lookup(&qproc->lookup_client, REMOTEFS_QMI_SVC_ID, 0, 0);
+
 	return 0;
 
+delete_rproc:
+	rproc_del(rproc);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1358,6 +1398,7 @@ static int q6v5_remove(struct platform_device *pdev)
 {
 	struct q6v5 *qproc = platform_get_drvdata(pdev);
 
+	qmi_handle_release(&qproc->lookup_client);
 	rproc_del(qproc->rproc);
 
 	qcom_remove_sysmon_subdev(qproc->sysmon);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 18%]

* Re: [RFC PATCH v2] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem
  2018-10-21 20:16 ` Bjorn Andersson
@ 2018-10-31 14:04   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-31 14:04 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: briannorris, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm, linux-soc,
	linux-arm-msm-owner

Hi Bjorn,
Thanks for the review!

On 2018-10-22 01:46, Bjorn Andersson wrote:
> On Sun 30 Sep 08:56 PDT 2018, Sibi Sankar wrote:
> 
>> From: Bjorn Andersson <bjorn.andersson@linaro.org>
>> 
>> rmtfs_mem provides access to physical storage and is crucial for the
>> operation of the Qualcomm modem subsystem.
>> 
>> The rmtfs_mem implementation must be available before the modem
>> subsystem is booted and a solution where the modem remoteproc will
>> verify that the rmtfs_mem is available has been discussed in the past.
>> But this would not handle the case where the rmtfs_mem provider is
>> restarted, which would cause fatal loss of access to the storage 
>> device
>> for the modem.
>> 
>> The suggestion is therefore to link the rmtfs_mem to its associated
>> remote processor instance and control it based on the availability of
>> the rmtfs_mem implementation.
>> 
>> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> [sibis: Added qmi lookup for Remote file system service]
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> 
> Thanks Sibi,
> 
> This looks clean and straight forward, but I think the logic should be
> moved into the qcom_q6v5_mss driver itself - as we now only care about
> the QMI service being present, not the rmtfs_memory driver.
> 

Will move it to qcom_q6v5_mss in the next re-spin.

The only drawback I found is that occasionally we receive the
the watchdog immediately after we kill the rmtfs application.
But eventually it gets handled as expected.

SDM845 Logs:
2360 root       0:00 rmtfs
/ # kill 2360

remoteproc: watchdog received: sys_m_smsm_mpss.c:285:APPS force stop
remoteproc0: crash detected in 4080000.remoteproc: type watchdog
qcom-q6v5-mss 4080000.remoteproc: timed out on wait
qcom-q6v5-mss 4080000.remoteproc: port failed halt
remoteproc remoteproc0: stopped remote processor 4080000.remoteproc


> There's nothing left of my original patch, so please credit yourself as
> author of v3.
> 
> [..]
>> diff --git a/drivers/soc/qcom/rmtfs_mem.c 
>> b/drivers/soc/qcom/rmtfs_mem.c
> [..]
>> @@ -181,6 +217,22 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	rmtfs_mem->client_id = client_id;
>>  	rmtfs_mem->size = rmem->size;
>> 
>> +	ret = of_property_read_u32(node, "rproc", &rproc_phandle);
>> +	if (!ret) {
>> +		rmtfs_mem->rproc = rproc_get_by_phandle(rproc_phandle);
>> +		if (!rmtfs_mem->rproc)
>> +			return -EPROBE_DEFER;
>> +	}
>> +
>> +	ret = qmi_handle_init(&rmtfs_mem->rmtfs_hdl, 0,
>> +			      &rmtfs_lookup_ops, NULL);
>> +	if (ret < 0)
>> +		goto put_rproc;
>> +
>> +	ret = qmi_add_lookup(&rmtfs_mem->rmtfs_hdl, 14, 0, 0);
> 
> The 14 here deserves a define and the whole thing would benefit from a
> comment describing the remoteproc's dependency on the RMTFS service
> being present.
> 

Will add it in the respin

>> +	if (ret < 0)
>> +		goto err_release_qmi_handle;
>> +
>>  	device_initialize(&rmtfs_mem->dev);
>>  	rmtfs_mem->dev.parent = &pdev->dev;
>>  	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;
> 
> Looking forward to v3!
> 

Done :)

> Regards,
> Bjorn

-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [RFC PATCH v2] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem
  2018-10-18  0:54 ` Brian Norris
@ 2018-10-31 14:32   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-10-31 14:32 UTC (permalink / raw)
  To: Brian Norris
  Cc: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm, linux-soc,
	linux-arm-msm-owner, linux-kernel-owner

Hi Brian,
Thanks for the review!

On 2018-10-18 06:24, Brian Norris wrote:
> Hi Sibi,
> 
> On Sun, Sep 30, 2018 at 09:26:46PM +0530, Sibi Sankar wrote:
>> From: Bjorn Andersson <bjorn.andersson@linaro.org>
>> 
>> rmtfs_mem provides access to physical storage and is crucial for the
>> operation of the Qualcomm modem subsystem.
>> 
>> The rmtfs_mem implementation must be available before the modem
>> subsystem is booted and a solution where the modem remoteproc will
>> verify that the rmtfs_mem is available has been discussed in the past.
>> But this would not handle the case where the rmtfs_mem provider is
>> restarted, which would cause fatal loss of access to the storage 
>> device
>> for the modem.
>> 
>> The suggestion is therefore to link the rmtfs_mem to its associated
>> remote processor instance and control it based on the availability of
>> the rmtfs_mem implementation.
>> 
>> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> [sibis: Added qmi lookup for Remote file system service]
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> The currently implemented workaround in the Linaro QCOMLT releases is 
>> to
>> blacklist the qcom_q6v5_pil kernel module and load this explicitly 
>> after rmtfs
>> has been started.
>> 
>> With this patch the modem module can be loaded automatically by the
>> platform_bus and will only be booted as the rmtfs becomes available. 
>> Performing
>> actions such as upgrading (and restarting) the rmtfs service will 
>> cause the
>> modem to automatically restart and hence continue to function after 
>> the
>> upgrade.
>> 
>> v2:
>>   Remove rproc_boot/shutdown from rmtfs_mem open/release and add
>>   qmi lookup for Remote file system service to address Brian's
>>   race concerns.
>> 
>>  .../reserved-memory/qcom,rmtfs-mem.txt        |  7 ++
>>  drivers/remoteproc/qcom_q6v5_pil.c            |  1 +
>>  drivers/soc/qcom/Kconfig                      |  2 +
>>  drivers/soc/qcom/rmtfs_mem.c                  | 65 
>> ++++++++++++++++++-
>>  4 files changed, 72 insertions(+), 3 deletions(-)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt 
>> b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
>> index 8562ba1dce69..95b209e7f5d1 100644
>> --- 
>> a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
>> +++ 
>> b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.txt
>> @@ -32,6 +32,13 @@ access block device data using the Remote 
>> Filesystem protocol.
>>  	Value type: <u32>
>>  	Definition: vmid of the remote processor, to set up memory 
>> protection.
>> 
>> +- rproc:
>> +	Usage: optional
>> +	Value type: <phandle>
>> +	Definition: reference to a remoteproc node, that should be powered 
>> up
>> +		    while the remote file system memory instance is ready to
>> +		    handle requests from the remote subsystem.
>> +
> 
> I'll repeat my comment here: this is straying far into the territory of
> putting software configuration in the device tree. Per your own
> comments, the modem firmware can be configured to run with or without a
> remote FS, and now you're assuming that the device tree will include
> this property or not, based on how you configured said firmware. That's
> not how device tree is supposed to work.
> 

Yes makes sense, will remove all dt dependencies in the next re-spin

>>  = EXAMPLE
>>  The following example shows the remote filesystem memory setup for 
>> APQ8016,
>>  with the rmtfs region for the Hexagon DSP (id #1) located at 
>> 0x86700000.
>> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c 
>> b/drivers/remoteproc/qcom_q6v5_pil.c
>> index d7a4b9eca5d2..1445a38e8b34 100644
>> --- a/drivers/remoteproc/qcom_q6v5_pil.c
>> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
>> @@ -1142,6 +1142,7 @@ static int q6v5_probe(struct platform_device 
>> *pdev)
>>  	qproc = (struct q6v5 *)rproc->priv;
>>  	qproc->dev = &pdev->dev;
>>  	qproc->rproc = rproc;
>> +	rproc->auto_boot = false;
> 
> So how is it supposed to work when you have an internal filesystem for
> the modem? User space just knows about this, and manually starts the
> remoteproc?
> 

I somehow missed this

Since the default firmware configuration for 8916/8996/845 has
rmtfs dependency I plan on adding the qmi lookup by default till
we get a platform that needs rmtfs disabled by default for which
I could easily add a flag for rmtfs dependency in
rproc_hexagon_res in qcom_q6v5_mss driver and do qmi lookup only
if rmtfs is supported.

>>  	platform_set_drvdata(pdev, qproc);
>> 
>>  	ret = q6v5_init_mem(qproc, pdev);
>> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
>> index 8a7b8dea6990..4e3345944325 100644
>> --- a/drivers/soc/qcom/Kconfig
>> +++ b/drivers/soc/qcom/Kconfig
>> @@ -86,7 +86,9 @@ config QCOM_QMI_HELPERS
>>  config QCOM_RMTFS_MEM
>>  	tristate "Qualcomm Remote Filesystem memory driver"
>>  	depends on ARCH_QCOM
>> +	depends on REMOTEPROC
>>  	select QCOM_SCM
>> +	select QCOM_QMI_HELPERS
>>  	help
>>  	  The Qualcomm remote filesystem memory driver is used for 
>> allocating
>>  	  and exposing regions of shared memory with remote processors for 
>> the
>> diff --git a/drivers/soc/qcom/rmtfs_mem.c 
>> b/drivers/soc/qcom/rmtfs_mem.c
>> index 97bb5989aa21..757e30083f67 100644
>> --- a/drivers/soc/qcom/rmtfs_mem.c
>> +++ b/drivers/soc/qcom/rmtfs_mem.c
>> @@ -18,11 +18,13 @@
>>  #include <linux/platform_device.h>
>>  #include <linux/of.h>
>>  #include <linux/of_reserved_mem.h>
>> +#include <linux/remoteproc.h>
>>  #include <linux/dma-mapping.h>
>>  #include <linux/slab.h>
>>  #include <linux/uaccess.h>
>>  #include <linux/io.h>
>>  #include <linux/qcom_scm.h>
>> +#include <linux/soc/qcom/qmi.h>
>> 
>>  #define QCOM_RMTFS_MEM_DEV_MAX	(MINORMASK + 1)
>> 
>> @@ -31,6 +33,7 @@ static dev_t qcom_rmtfs_mem_major;
>>  struct qcom_rmtfs_mem {
>>  	struct device dev;
>>  	struct cdev cdev;
>> +	struct qmi_handle rmtfs_hdl;
>> 
>>  	void *base;
>>  	phys_addr_t addr;
>> @@ -39,6 +42,8 @@ struct qcom_rmtfs_mem {
>>  	unsigned int client_id;
>> 
>>  	unsigned int perms;
>> +
>> +	struct rproc *rproc;
>>  };
>> 
>>  static ssize_t qcom_rmtfs_mem_show(struct device *dev,
>> @@ -141,6 +146,36 @@ static const struct file_operations 
>> qcom_rmtfs_mem_fops = {
>>  	.llseek = default_llseek,
>>  };
>> 
>> +static int rmtfs_new_server(struct qmi_handle *qmi,
>> +				 struct qmi_service *service)
>> +{
>> +	int ret = 0;
>> +	struct qcom_rmtfs_mem *rmtfs_mem = container_of(qmi,
>> +							struct qcom_rmtfs_mem,
>> +							rmtfs_hdl);
>> +
>> +	if (rmtfs_mem->rproc)
> 
> Couldn't you avoid registering these callbacks entirely, if there's no
> rproc device/phandle?
> 

will remove all dt dependencies in the next re-spin

>> +		ret = rproc_boot(rmtfs_mem->rproc);
>> +
>> +	return ret;
>> +};
>> +
>> +static void rmtfs_del_server(struct qmi_handle *qmi,
>> +				  struct qmi_service *service)
>> +{
>> +	struct qcom_rmtfs_mem *rmtfs_mem = container_of(qmi,
>> +							struct qcom_rmtfs_mem,
>> +							rmtfs_hdl);
>> +
>> +	if (rmtfs_mem->rproc)
>> +		rproc_shutdown(rmtfs_mem->rproc);
>> +};
>> +
>> +static struct qmi_ops rmtfs_lookup_ops = {
>> +	.new_server = rmtfs_new_server,
>> +	.del_server = rmtfs_del_server,
>> +};
>> +
>>  static void qcom_rmtfs_mem_release_device(struct device *dev)
>>  {
>>  	struct qcom_rmtfs_mem *rmtfs_mem = container_of(dev,
>> @@ -156,6 +191,7 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	struct qcom_scm_vmperm perms[2];
>>  	struct reserved_mem *rmem;
>>  	struct qcom_rmtfs_mem *rmtfs_mem;
>> +	phandle rproc_phandle;
>>  	u32 client_id;
>>  	u32 vmid;
>>  	int ret;
>> @@ -181,6 +217,22 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	rmtfs_mem->client_id = client_id;
>>  	rmtfs_mem->size = rmem->size;
>> 
>> +	ret = of_property_read_u32(node, "rproc", &rproc_phandle);
>> +	if (!ret) {
>> +		rmtfs_mem->rproc = rproc_get_by_phandle(rproc_phandle);
>> +		if (!rmtfs_mem->rproc)
>> +			return -EPROBE_DEFER;
>> +	}
>> +
>> +	ret = qmi_handle_init(&rmtfs_mem->rmtfs_hdl, 0,
>> +			      &rmtfs_lookup_ops, NULL);
> 
> Similar to the above comment: this should just be under the "if rproc"
> condition -- also because in remove(), you only unregister these
> callbacks if you have an rproc device.
> 

I'll be moving qmi_lookup logic to qcom_q6v5_mss driver will fix
it there

>> +	if (ret < 0)
>> +		goto put_rproc;
> 
> You've got the error handling wrong here. You're doing the
> rmtfs_mem->dev cleanup under the 'put_rproc' label, but you haven't 
> even
> started to initialize that device by now.
> 
>> +
>> +	ret = qmi_add_lookup(&rmtfs_mem->rmtfs_hdl, 14, 0, 0);
> 
> I can see there are some bad examples out there already to cheat off
> of...but please don't just use magic nubmers like '14' here. There
> should be a defined constant for this.
> 

Yes, I'll make sure I add comments and the corresponding define

> And while we're at it: why isn't there a common header for QMI service
> IDs? Would be nice to list all the IDs that the kernel might be using,
> in one place.

I can probably take this up as a separate task if its something
Bjorn wants cleaned up?

> 
>> +	if (ret < 0)
>> +		goto err_release_qmi_handle;
>> +
>>  	device_initialize(&rmtfs_mem->dev);
>>  	rmtfs_mem->dev.parent = &pdev->dev;
>>  	rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;
>> @@ -191,7 +243,7 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	if (IS_ERR(rmtfs_mem->base)) {
>>  		dev_err(&pdev->dev, "failed to remap rmtfs_mem region\n");
>>  		ret = PTR_ERR(rmtfs_mem->base);
>> -		goto put_device;
>> +		goto err_release_qmi_handle;
>>  	}
>> 
>>  	cdev_init(&rmtfs_mem->cdev, &qcom_rmtfs_mem_fops);
>> @@ -204,7 +256,7 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>>  	ret = cdev_device_add(&rmtfs_mem->cdev, &rmtfs_mem->dev);
>>  	if (ret) {
>>  		dev_err(&pdev->dev, "failed to add cdev: %d\n", ret);
>> -		goto put_device;
>> +		goto err_release_qmi_handle;
>>  	}
>> 
>>  	ret = of_property_read_u32(node, "qcom,vmid", &vmid);
>> @@ -237,7 +289,10 @@ static int qcom_rmtfs_mem_probe(struct 
>> platform_device *pdev)
>> 
>>  remove_cdev:
>>  	cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
>> -put_device:
>> +err_release_qmi_handle:
>> +	qmi_handle_release(&rmtfs_mem->rmtfs_hdl);
>> +put_rproc:
>> +	rproc_put(rmtfs_mem->rproc);
>>  	put_device(&rmtfs_mem->dev);
> 
> As mentioned above, this is in the wrong order. You probably will need
> an additional exit label too.
> 

yes missed that but will move the qmi lookup logic to qcom_q6v5_mss
driver. will fix it there

>> 
>>  	return ret;
>> @@ -257,6 +312,10 @@ static int qcom_rmtfs_mem_remove(struct 
>> platform_device *pdev)
>>  	}
>> 
>>  	cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev);
>> +	if (rmtfs_mem->rproc) {
>> +		qmi_handle_release(&rmtfs_mem->rmtfs_hdl);
> 
> As noted above, this doesn't match with probe().
> 
> Brian
> 
>> +		rproc_put(rmtfs_mem->rproc);
>> +	}
>>  	put_device(&rmtfs_mem->dev);
>> 
>>  	return 0;

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2] arm64: dts: qcom: sdm845: Add reserve-memory nodes
  2018-10-31  6:09 [PATCH v2] " Sibi Sankar
@ 2018-10-31 21:59 ` Doug Anderson
  0 siblings, 0 replies; 200+ results
From: Doug Anderson @ 2018-10-31 21:59 UTC (permalink / raw)
  To: sibis
  Cc: Andy Gross, David Brown, Rob Herring, Bjorn Andersson,
	Evan Green, benchan, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni

Hi,

On Tue, Oct 30, 2018 at 11:09 PM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add reserve-memory nodes for mpss and mba required for
> remoteproc mss pil.
>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)

I'm not an expert on the assignment of these ranges, but my nits have
been addressed and it seems like it matches what we're doing in this
section.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[relevance 6%]

* [PATCH 4.19 296/361] remoteproc: qcom: q6v5: Propagate EPROBE_DEFER
      [irrelevant] <20181111221619.915519183@linuxfoundation.org>
@ 2018-11-11 22:20 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 200+ results
From: Greg Kroah-Hartman @ 2018-11-11 22:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Sibi Sankar, Bjorn Andersson

4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Andersson <bjorn.andersson@linaro.org>

commit d5269c4553a64b6882f2c019ae21b783a0984a83 upstream.

In the case that the interrupts fail to result because of the
interrupt-controller not yet being registered the
platform_get_irq_byname() call will fail with -EPROBE_DEFER, but passing
this into devm_request_threaded_irq() will result in -EINVAL being
returned, the driver is therefor not reprobed later.

Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource handling")
Cc: stable@vger.kernel.org
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/remoteproc/qcom_q6v5.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -198,6 +198,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v
 	}
 
 	q6v5->fatal_irq = platform_get_irq_byname(pdev, "fatal");
+	if (q6v5->fatal_irq == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+
 	ret = devm_request_threaded_irq(&pdev->dev, q6v5->fatal_irq,
 					NULL, q6v5_fatal_interrupt,
 					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
@@ -208,6 +211,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v
 	}
 
 	q6v5->ready_irq = platform_get_irq_byname(pdev, "ready");
+	if (q6v5->ready_irq == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+
 	ret = devm_request_threaded_irq(&pdev->dev, q6v5->ready_irq,
 					NULL, q6v5_ready_interrupt,
 					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
@@ -218,6 +224,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v
 	}
 
 	q6v5->handover_irq = platform_get_irq_byname(pdev, "handover");
+	if (q6v5->handover_irq == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+
 	ret = devm_request_threaded_irq(&pdev->dev, q6v5->handover_irq,
 					NULL, q6v5_handover_interrupt,
 					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
@@ -229,6 +238,9 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v
 	disable_irq(q6v5->handover_irq);
 
 	q6v5->stop_irq = platform_get_irq_byname(pdev, "stop-ack");
+	if (q6v5->stop_irq == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+
 	ret = devm_request_threaded_irq(&pdev->dev, q6v5->stop_irq,
 					NULL, q6v5_stop_interrupt,
 					IRQF_TRIGGER_RISING | IRQF_ONESHOT,



^ permalink raw reply	[relevance 6%]

* Re: [PATCH v5 14/18] arm64: dts: qcom: qcs404: Add remoteproc nodes
      [irrelevant] ` <20181109094417.12109-15-vkoul@kernel.org>
@ 2018-11-19  5:31   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-11-19  5:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, linux-arm-msm, linux-kernel, linux-arm-kernel,
	Bjorn Andersson

Hi Bjorn/Vinod,

On 2018-11-09 15:14, Vinod Koul wrote:
> From: Bjorn Andersson <bjorn.andersson@linaro.org>
> 
> Add the TrustZone based remoteproc nodes and their glink edges for
> adsp, cdsp and wcss. Enable them for EVB common DTS.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  arch/arm64/boot/dts/qcom/qcs404-evb.dtsi | 12 +++++
>  arch/arm64/boot/dts/qcom/qcs404.dtsi     | 93 
> ++++++++++++++++++++++++++++++++
>  2 files changed, 105 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/qcs404-evb.dtsi
> b/arch/arm64/boot/dts/qcom/qcs404-evb.dtsi
> index db035fef67d9..a39924efebe4 100644
> --- a/arch/arm64/boot/dts/qcom/qcs404-evb.dtsi
> +++ b/arch/arm64/boot/dts/qcom/qcs404-evb.dtsi
> @@ -21,6 +21,18 @@
>  	};
>  };
> 
> +&remoteproc_adsp {
> +	status = "ok";
> +};
> +
> +&remoteproc_cdsp {
> +	status = "ok";
> +};
> +
> +&remoteproc_wcss {
> +	status = "ok";
> +};
> +
>  &rpm_requests {
>  	pms405-regulators {
>  		compatible = "qcom,rpm-pms405-regulators";
> diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi
> b/arch/arm64/boot/dts/qcom/qcs404.dtsi
> index 46fce264c8fe..06607419c9d6 100644
> --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
> +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
> @@ -80,6 +80,99 @@
>  		method = "smc";
>  	};
> 
> +	remoteproc_adsp: remoteproc-adsp {
> +		compatible = "qcom,qcs404-adsp-pas";
> +
> +		interrupts-extended = <&intc GIC_SPI 293 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> +		interrupt-names = "wdog", "fatal", "ready",
> +				  "handover", "stop-ack";
> +
> +		clocks = <&xo_board>;
> +		clock-names = "xo";
> +
> +		memory-region = <&adsp_fw_mem>;
> +
> +		qcom,smem-states = <&adsp_smp2p_out 0>;
> +		qcom,smem-state-names = "stop";
> +
> +		status = "disabled";
> +
> +		glink-edge {
> +			interrupts = <GIC_SPI 289 IRQ_TYPE_EDGE_RISING>;
> +
> +			qcom,remote-pid = <2>;
> +			mboxes = <&apcs_glb 8>;
> +
> +			label = "adsp";
> +		};
> +	};
> +
> +	remoteproc_cdsp: remoteproc-cdsp {
> +		compatible = "qcom,qcs404-cdsp-pas";
> +
> +		interrupts-extended = <&intc GIC_SPI 229 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> +		interrupt-names = "wdog", "fatal", "ready",
> +				  "handover", "stop-ack";
> +
> +		clocks = <&xo_board>;
> +		clock-names = "xo";
> +
> +		memory-region = <&cdsp_fw_mem>;
> +
> +		qcom,smem-states = <&cdsp_smp2p_out 0>;
> +		qcom,smem-state-names = "stop";
> +
> +		status = "disabled";
> +
> +		glink-edge {
> +			interrupts = <GIC_SPI 141 IRQ_TYPE_EDGE_RISING>;
> +
> +			qcom,remote-pid = <5>;
> +			mboxes = <&apcs_glb 12>;
> +
> +			label = "cdsp";
> +		};
> +	};
> +
> +	remoteproc_wcss: remoteproc-wcss {
> +		compatible = "qcom,qcs404-wcss-pas";
> +
> +		interrupts-extended = <&intc GIC_SPI 153 IRQ_TYPE_EDGE_RISING>,
> +				      <&wcss_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +				      <&wcss_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +				      <&wcss_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +				      <&wcss_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> +		interrupt-names = "wdog", "fatal", "ready",
> +				  "handover", "stop-ack";

I can see that wcss remoteproc uses an additional smp2p interrupt called 
shutdown-ack
downstream you may want to skip wcss entry for now till the shutdown-ack 
gets posted,
reviewed and merged.

> +
> +		clocks = <&xo_board>;
> +		clock-names = "xo";
> +
> +		memory-region = <&wlan_fw_mem>;
> +
> +		qcom,smem-states = <&wcss_smp2p_out 0>;
> +		qcom,smem-state-names = "stop";
> +
> +		status = "disabled";
> +
> +		glink-edge {
> +			interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;
> +
> +			qcom,remote-pid = <1>;
> +			mboxes = <&apcs_glb 16>;
> +
> +			label = "wcss";
> +		};
> +	};
> +
>  	reserved-memory {
>  		#address-cells = <2>;
>  		#size-cells = <2>;

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown
  2018-11-20 21:02 [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5 Sibi Sankar
@ 2018-11-20 21:02 ` Sibi Sankar
  2018-12-06  7:16   ` Bjorn Andersson
  2018-12-05 22:54 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5 Rob Herring
  1 sibling, 1 reply; 200+ results
From: Sibi Sankar @ 2018-11-20 21:02 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, Sibi Sankar

After sending a sysmon shutdown request to the SSCTL service on the
subsystem, wait for the service to send shutdown-ack interrupt or
an indication message back.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_sysmon.c | 59 +++++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
index e976a602b015..a545181341d1 100644
--- a/drivers/remoteproc/qcom_sysmon.c
+++ b/drivers/remoteproc/qcom_sysmon.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2017, Linaro Ltd.
  */
 #include <linux/firmware.h>
+#include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/slab.h>
@@ -25,6 +26,7 @@ struct qcom_sysmon {
 
 	const char *name;
 
+	int shutdown_irq;
 	int ssctl_version;
 	int ssctl_instance;
 
@@ -34,6 +36,7 @@ struct qcom_sysmon {
 
 	struct rpmsg_endpoint *ept;
 	struct completion comp;
+	struct completion shutdown_comp;
 	struct mutex lock;
 
 	bool ssr_ack;
@@ -137,6 +140,7 @@ static int sysmon_callback(struct rpmsg_device *rpdev, void *data, int count,
 }
 
 #define SSCTL_SHUTDOWN_REQ		0x21
+#define SSCTL_SHUTDOWN_READY_IND	0x21
 #define SSCTL_SUBSYS_EVENT_REQ		0x23
 
 #define SSCTL_MAX_MSG_LEN		7
@@ -252,6 +256,29 @@ static struct qmi_elem_info ssctl_subsys_event_resp_ei[] = {
 	{}
 };
 
+static struct qmi_elem_info ssctl_shutdown_ind_ei[] = {
+	{}
+};
+
+static void sysmon_ind_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
+			  struct qmi_txn *txn, const void *data)
+{
+	struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, qmi);
+
+	complete(&sysmon->shutdown_comp);
+}
+
+static struct qmi_msg_handler qmi_indication_handler[] = {
+	{
+		.type = QMI_INDICATION,
+		.msg_id = SSCTL_SHUTDOWN_READY_IND,
+		.ei = ssctl_shutdown_ind_ei,
+		.decoded_size = 0,
+		.fn = sysmon_ind_cb
+	},
+	{}
+};
+
 /**
  * ssctl_request_shutdown() - request shutdown via SSCTL QMI service
  * @sysmon:	sysmon context
@@ -262,6 +289,7 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
 	struct qmi_txn txn;
 	int ret;
 
+	reinit_completion(&sysmon->shutdown_comp);
 	ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to allocate QMI txn\n");
@@ -283,6 +311,14 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
 		dev_err(sysmon->dev, "shutdown request failed\n");
 	else
 		dev_dbg(sysmon->dev, "shutdown request completed\n");
+
+	if (sysmon->shutdown_irq > 0) {
+		ret = wait_for_completion_timeout(&sysmon->shutdown_comp,
+						  msecs_to_jiffies(5000));
+		if (!ret)
+			dev_err(sysmon->dev,
+				"timeout waiting for shutdown ack\n");
+	}
 }
 
 /**
@@ -432,6 +468,15 @@ static int sysmon_notify(struct notifier_block *nb, unsigned long event,
 	return NOTIFY_DONE;
 }
 
+static irqreturn_t sysmon_shutdown_interrupt(int irq, void *data)
+{
+	struct qcom_sysmon *sysmon = data;
+
+	complete(&sysmon->shutdown_comp);
+
+	return IRQ_HANDLED;
+}
+
 /**
  * qcom_add_sysmon_subdev() - create a sysmon subdev for the given remoteproc
  * @rproc:	rproc context to associate the subdev with
@@ -445,6 +490,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 					   int ssctl_instance)
 {
 	struct qcom_sysmon *sysmon;
+	struct platform_device *pdev;
 	int ret;
 
 	sysmon = kzalloc(sizeof(*sysmon), GFP_KERNEL);
@@ -453,14 +499,25 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 
 	sysmon->dev = rproc->dev.parent;
 	sysmon->rproc = rproc;
+	pdev = container_of(sysmon->dev, struct platform_device, dev);
 
 	sysmon->name = name;
 	sysmon->ssctl_instance = ssctl_instance;
 
 	init_completion(&sysmon->comp);
+	init_completion(&sysmon->shutdown_comp);
 	mutex_init(&sysmon->lock);
 
-	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, NULL);
+	sysmon->shutdown_irq = platform_get_irq_byname(pdev, "shutdown-ack");
+	ret = devm_request_threaded_irq(sysmon->dev, sysmon->shutdown_irq,
+					NULL, sysmon_shutdown_interrupt,
+					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+					"q6v5 shutdown-ack", sysmon);
+	if (ret)
+		dev_err(sysmon->dev, "failed to acquire shutdown-ack IRQ\n");
+
+	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
+			      qmi_indication_handler);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to initialize qmi handle\n");
 		kfree(sysmon);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 18%]

* [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5
@ 2018-11-20 21:02 Sibi Sankar
  2018-11-20 21:02 ` [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
  2018-12-05 22:54 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5 Rob Herring
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-11-20 21:02 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, Sibi Sankar

Add optional shutdown-irq binding required for sysmon shutdown on
SDM845/MSM8996/QCS404 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9ff5b0309417..14947562bc67 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -29,12 +29,13 @@ on the Qualcomm Hexagon core.
 	Usage: required
 	Value type: <prop-encoded-array>
 	Definition: must list the watchdog, fatal IRQs ready, handover and
-		    stop-ack IRQs
+		    stop-ack IRQs and may optionally list shutdown-ack IRQ
 
 - interrupt-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack",
+		    "shutdown-ack"
 
 - clocks:
 	Usage: required
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
@ 2018-11-20 21:08 Sibi Sankar
  2018-12-05 22:55 ` Rob Herring
                   ` (2 more replies)
  0 siblings, 3 replies; 200+ results
From: Sibi Sankar @ 2018-11-20 21:08 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, Sibi Sankar

Add power-domain bindings for Q6V5 MSS on SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

Add dt-binding corresponding to https://patchwork.kernel.org/patch/10586893/
(remoteproc: q6v5: Add support to vote for rpmh power domains)

 .../devicetree/bindings/remoteproc/qcom,q6v5.txt      | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 14947562bc67..bd9f4882fcf0 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -75,6 +75,17 @@ on the Qualcomm Hexagon core.
 	Definition: reference to the regulators to be held on behalf of the
 		    booting of the Hexagon core
 
+- power-domains:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the cx, mx and mss power-domains to be held on
+		    behalf of the booting the Hexagon core
+
+- power-domain-names:
+	Usage: required
+	Value type: <stringlist>
+	Definition: must be "cx", "mx", "mss"
+
 - qcom,smem-states:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* Re: [PATCH] arm64: dts: sdm845: add video nodes
      [irrelevant] <1542708506-12680-1-git-send-email-mgottam@codeaurora.org>
@ 2018-11-21  6:35 ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-11-21  6:35 UTC (permalink / raw)
  To: Malathi Gottam
  Cc: stanimir.varbanov, hverkuil, mchehab, linux-media, linux-kernel,
	linux-arm-msm, acourbot, vgarodia, linux-arm-msm-owner

Hi Malathi,

On 2018-11-20 15:38, Malathi Gottam wrote:
> This adds video nodes to sdm845 based on the examples
> in the bindings.
> 
> Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 34 
> ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 0c9a2aa..d82487d 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -84,6 +84,10 @@
>  			reg = <0 0x86200000 0 0x2d00000>;
>  			no-map;
>  		};
> +		venus_region: venus@95800000 {
> +			reg = <0x0 0x95800000 0x0 0x500000>;
> +			no-map;
> +		};

nit: Please make this venus_region: memory@95800000
instead and add a new line before venus_region.

>  	};
> 
>  	cpus {
> @@ -1103,5 +1107,35 @@
>  				status = "disabled";
>  			};
>  		};
> +
> +		video-codec@aa00000 {
> +			compatible = "qcom,sdm845-venus";
> +			reg = <0x0aa00000 0xff000>;
> +			interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
> +			power-domains = <&videocc VENUS_GDSC>;
> +			clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>,
> +				 <&videocc VIDEO_CC_VENUS_AHB_CLK>,
> +				 <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>;
> +			clock-names = "core", "iface", "bus";
> +			iommus = <&apps_smmu 0x10a0 0x8>,
> +				 <&apps_smmu 0x10b0 0x0>;
> +			memory-region = <&venus_region>;
> +
> +			video-core0 {
> +				compatible = "venus-decoder";
> +				clocks = <&videocc VIDEO_CC_VCODEC0_CORE_CLK>,
> +					 <&videocc VIDEO_CC_VCODEC0_AXI_CLK>;
> +				clock-names = "core", "bus";
> +				power-domains = <&videocc VCODEC0_GDSC>;
> +			};
> +
> +			video-core1 {
> +				compatible = "venus-encoder";
> +				clocks = <&videocc VIDEO_CC_VCODEC1_CORE_CLK>,
> +					 <&videocc VIDEO_CC_VCODEC1_AXI_CLK>;
> +				clock-names = "core", "bus";
> +				power-domains = <&videocc VCODEC1_GDSC>;
> +			};
> +		};
>  	};
>  };

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
@ 2018-11-27  8:58 Sibi Sankar
  2018-12-13 22:17 ` Doug Anderson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-11-27  8:58 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, dianders, evgreen,
	briannorris, Sibi Sankar

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

The remoteproc mss node depends on the following bindings:
https://patchwork.kernel.org/patch/10490559/ - rpmhp dt bindings
https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
https://patchwork.kernel.org/patch/10691215/ - mss power-domain dt bindings
https://patchwork.kernel.org/patch/10691213/ - shutdown-ack dt bindings

It also depends on the mpss and mba memory regions and pdc reset node.
https://patchwork.kernel.org/patch/10662089/
https://patchwork.kernel.org/patch/10657325/

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 63 ++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 58870273dbc9..df16ee464872 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1095,6 +1095,69 @@
 			};
 		};
 
+		remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0x04080000 0x408>, <0x04180000 0x48>;
+
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs
+						0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp_pd AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "aop", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+				mbox-names = "mpss_smem";
+			};
+		};
+
 		usb_1_hsphy: phy@88e2000 {
 			compatible = "qcom,sdm845-qusb2-phy";
 			reg = <0x88e2000 0x400>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* Re: [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5
  2018-11-20 21:02 [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5 Sibi Sankar
  2018-11-20 21:02 ` [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
@ 2018-12-05 22:54 ` Rob Herring
  1 sibling, 0 replies; 200+ results
From: Rob Herring @ 2018-12-05 22:54 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, Sibi Sankar

On Wed, 21 Nov 2018 02:32:07 +0530, Sibi Sankar wrote:
> Add optional shutdown-irq binding required for sysmon shutdown on
> SDM845/MSM8996/QCS404 SoCs.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-11-20 21:08 [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
@ 2018-12-05 22:55 ` Rob Herring
  2018-12-06 16:58 ` Bjorn Andersson
  2018-12-13 22:05 ` Doug Anderson
  2 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-05 22:55 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, Sibi Sankar

On Wed, 21 Nov 2018 02:38:28 +0530, Sibi Sankar wrote:
> Add power-domain bindings for Q6V5 MSS on SDM845 SoCs.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> Add dt-binding corresponding to https://patchwork.kernel.org/patch/10586893/
> (remoteproc: q6v5: Add support to vote for rpmh power domains)
> 
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt      | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown
  2018-11-20 21:02 ` [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
@ 2018-12-06  7:16   ` Bjorn Andersson
  2018-12-14 17:32     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-12-06  7:16 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc

On Tue 20 Nov 13:02 PST 2018, Sibi Sankar wrote:

> After sending a sysmon shutdown request to the SSCTL service on the
> subsystem, wait for the service to send shutdown-ack interrupt or
> an indication message back.
> 

So we get a reply immediate on the shutdown request, and then some time
later we get either an indication or an interrupt to state that it's
actually complete?

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_sysmon.c | 59 +++++++++++++++++++++++++++++++-
>  1 file changed, 58 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
[..]
> @@ -283,6 +311,14 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
>  		dev_err(sysmon->dev, "shutdown request failed\n");
>  	else
>  		dev_dbg(sysmon->dev, "shutdown request completed\n");
> +
> +	if (sysmon->shutdown_irq > 0) {
> +		ret = wait_for_completion_timeout(&sysmon->shutdown_comp,
> +						  msecs_to_jiffies(5000));

5 * HZ

> +		if (!ret)
> +			dev_err(sysmon->dev,
> +				"timeout waiting for shutdown ack\n");
> +	}
>  }
[..]
> @@ -453,14 +499,25 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
>  
>  	sysmon->dev = rproc->dev.parent;
>  	sysmon->rproc = rproc;
> +	pdev = container_of(sysmon->dev, struct platform_device, dev);
>  
>  	sysmon->name = name;
>  	sysmon->ssctl_instance = ssctl_instance;
>  
>  	init_completion(&sysmon->comp);
> +	init_completion(&sysmon->shutdown_comp);
>  	mutex_init(&sysmon->lock);
>  
> -	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, NULL);
> +	sysmon->shutdown_irq = platform_get_irq_byname(pdev, "shutdown-ack");

Use of_irq_get_byname() on sysmon->dev instead of relying on the fact
that the remoteproc driver is a platform_device.

Also, check and handle the return value - because an EPROBE_DEFER here
will be turned into a -EINVAL by devm_request_threaded_irq().

> +	ret = devm_request_threaded_irq(sysmon->dev, sysmon->shutdown_irq,
> +					NULL, sysmon_shutdown_interrupt,
> +					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
> +					"q6v5 shutdown-ack", sysmon);
> +	if (ret)
> +		dev_err(sysmon->dev, "failed to acquire shutdown-ack IRQ\n");

In the event that sysmon->shutdown_irq is != -ENODATA, you should fail
here.

> +
> +	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
> +			      qmi_indication_handler);

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-11-20 21:08 [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
  2018-12-05 22:55 ` Rob Herring
@ 2018-12-06 16:58 ` Bjorn Andersson
  2018-12-06 17:44   ` Sibi Sankar
  2018-12-13 22:05 ` Doug Anderson
  2 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-12-06 16:58 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc

On Tue 20 Nov 13:08 PST 2018, Sibi Sankar wrote:

> Add power-domain bindings for Q6V5 MSS on SDM845 SoCs.
> 

Thanks Sibi,

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> Add dt-binding corresponding to https://patchwork.kernel.org/patch/10586893/
> (remoteproc: q6v5: Add support to vote for rpmh power domains)
> 
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt      | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 14947562bc67..bd9f4882fcf0 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -75,6 +75,17 @@ on the Qualcomm Hexagon core.
>  	Definition: reference to the regulators to be held on behalf of the
>  		    booting of the Hexagon core
>  
> +- power-domains:
> +	Usage: required
> +	Value type: <phandle>
> +	Definition: reference to the cx, mx and mss power-domains to be held on
> +		    behalf of the booting the Hexagon core

This should mention that these are the domains for SDM845, as the list
seems to differ somewhat between platforms. Please also define the
requirements for MSM8996 (cx & mx) here, while you're at it.

Let's also make sure it includes the "load_state", for SDM845.

Regards,
Bjorn

> +
> +- power-domain-names:
> +	Usage: required
> +	Value type: <stringlist>
> +	Definition: must be "cx", "mx", "mss"
> +
>  - qcom,smem-states:
>  	Usage: required
>  	Value type: <phandle>
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-06 16:58 ` Bjorn Andersson
@ 2018-12-06 17:44   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-06 17:44 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc

Hi Bjorn,
Thanks for the review!

On 2018-12-06 22:28, Bjorn Andersson wrote:
> On Tue 20 Nov 13:08 PST 2018, Sibi Sankar wrote:
> 
>> Add power-domain bindings for Q6V5 MSS on SDM845 SoCs.
>> 
> 
> Thanks Sibi,
> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> Add dt-binding corresponding to 
>> https://patchwork.kernel.org/patch/10586893/
>> (remoteproc: q6v5: Add support to vote for rpmh power domains)
>> 
>>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt      | 11 
>> +++++++++++
>>  1 file changed, 11 insertions(+)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 14947562bc67..bd9f4882fcf0 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -75,6 +75,17 @@ on the Qualcomm Hexagon core.
>>  	Definition: reference to the regulators to be held on behalf of the
>>  		    booting of the Hexagon core
>> 
>> +- power-domains:
>> +	Usage: required
>> +	Value type: <phandle>
>> +	Definition: reference to the cx, mx and mss power-domains to be held 
>> on
>> +		    behalf of the booting the Hexagon core
> 
> This should mention that these are the domains for SDM845, as the list
> seems to differ somewhat between platforms. Please also define the
> requirements for MSM8996 (cx & mx) here, while you're at it.
> 
> Let's also make sure it includes the "load_state", for SDM845.
> 

I'll list the power domains per SoC in the next respin

> Regards,
> Bjorn
> 
>> +
>> +- power-domain-names:
>> +	Usage: required
>> +	Value type: <stringlist>
>> +	Definition: must be "cx", "mx", "mss"
>> +
>>  - qcom,smem-states:
>>  	Usage: required
>>  	Value type: <phandle>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH 0/2] Add firmware bindings for Q6V5 MSS
@ 2018-12-12 12:44 Sibi Sankar
  2018-12-12 12:44 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: " Sibi Sankar
  2018-12-12 12:44 ` [PATCH 2/2] remoteproc: qcom: q6v5-mss: Add support for parsing fw dt bindings Sibi Sankar
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-12-12 12:44 UTC (permalink / raw)
  To: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross
  Cc: briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

Q6V5 MSS on certain SoCs like SDM845 are capable of operating under
completely different configuration (like Non-Modem WLAN configuration)
depending on the firmware loaded without any change in boot sequence
of the Hexagon core. The patch series is ultimately aimed to avoid
multiple compatibles per SoC to just specify different upstreamed firmware
locations. This is achieved by introducing "qcom,firmware" binding
to store the relative path of mba and modem metadata.

remoteproc@4080000 { 
	...
	qcom,firmware = "qcom/sdm845/mss/mba.mbn",
			"qcom/sdm845/mss/modem.mdt";
	...
}

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>

SibiSankar (2):
  dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 MSS
  remoteproc: qcom: q6v5-mss: Add support for parsing fw dt bindings

 .../bindings/remoteproc/qcom,q6v5.txt         |  7 +++
 drivers/remoteproc/qcom_q6v5_mss.c            | 49 ++++++++++++++++---
 2 files changed, 48 insertions(+), 8 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 15%]

* [PATCH 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 MSS
  2018-12-12 12:44 [PATCH 0/2] Add firmware bindings for Q6V5 MSS Sibi Sankar
@ 2018-12-12 12:44 ` " Sibi Sankar
  2018-12-20 20:10   ` Rob Herring
  2018-12-12 12:44 ` [PATCH 2/2] remoteproc: qcom: q6v5-mss: Add support for parsing fw dt bindings Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-12 12:44 UTC (permalink / raw)
  To: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross
  Cc: briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

Add optional firmware bindings for Q6V5 MSS. It lists the two relative
firmware paths which are used for booting and authenticating the Hexagon
core.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9ff5b0309417..1f6988a60636 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -36,6 +36,13 @@ on the Qualcomm Hexagon core.
 	Value type: <stringlist>
 	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
 
+- qcom,firmware:
+	Usage: optional
+	Value type: <stringlist>
+	Definition: must list the 2 relative firmware paths (mba and modem
+		    metadata respectively) which are used for booting and
+		    authenticating the Hexagon core.
+
 - clocks:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH 2/2] remoteproc: qcom: q6v5-mss: Add support for parsing fw dt bindings
  2018-12-12 12:44 [PATCH 0/2] Add firmware bindings for Q6V5 MSS Sibi Sankar
  2018-12-12 12:44 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: " Sibi Sankar
@ 2018-12-12 12:44 ` Sibi Sankar
  1 sibling, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-12 12:44 UTC (permalink / raw)
  To: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross
  Cc: briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

Add support for parsing "qcom,firmware" dt bindings which specifies
the relative paths of mba and modem metadata as a list of strings.
Fallback to the default paths for mba/modem on -EINVAL.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 49 +++++++++++++++++++++++++-----
 1 file changed, 41 insertions(+), 8 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 01be7314e176..c4e7700aee0f 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -22,6 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -30,6 +31,7 @@
 #include <linux/remoteproc.h>
 #include <linux/reset.h>
 #include <linux/soc/qcom/mdt_loader.h>
+#include <linux/string.h>
 #include <linux/iopoll.h>
 
 #include "remoteproc_internal.h"
@@ -188,6 +190,7 @@ struct q6v5 {
 	bool has_alt_reset;
 	int mpss_perm;
 	int mba_perm;
+	const char *hexagon_mdt_image;
 	int version;
 };
 
@@ -860,17 +863,29 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 	phys_addr_t min_addr = PHYS_ADDR_MAX;
 	phys_addr_t max_addr = 0;
 	bool relocate = false;
-	char seg_name[10];
+	char seg_name[35];
+	char *fw_prefix;
+	char *tmp;
 	ssize_t offset;
 	size_t size = 0;
 	void *ptr;
 	int ret;
 	int i;
 
-	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	fw_prefix = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
+	if (!fw_prefix)
+		return -ENOMEM;
+
+	/* strip out the fw extn */
+	tmp = strrchr(fw_prefix, '.');
+	if (tmp)
+		*tmp = '\0';
+
+	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
 	if (ret < 0) {
-		dev_err(qproc->dev, "unable to load modem.mdt\n");
-		return ret;
+		dev_err(qproc->dev, "unable to load %s\n",
+			qproc->hexagon_mdt_image);
+		goto release_fw_prefix;
 	}
 
 	/* Initialize the RMB validator */
@@ -918,7 +933,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 		ptr = qproc->mpss_region + offset;
 
 		if (phdr->p_filesz) {
-			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
+			snprintf(seg_name, sizeof(seg_name), "%s.b%02d",
+				 fw_prefix, i);
 			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
 			if (ret) {
 				dev_err(qproc->dev, "failed to load %s\n", seg_name);
@@ -960,6 +976,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 
 release_firmware:
 	release_firmware(fw);
+release_fw_prefix:
+	kfree(fw_prefix);
 
 	return ret < 0 ? ret : 0;
 }
@@ -1075,9 +1093,10 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 	unsigned long i;
 	int ret;
 
-	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
 	if (ret < 0) {
-		dev_err(qproc->dev, "unable to load modem.mdt\n");
+		dev_err(qproc->dev, "unable to load %s\n",
+			qproc->hexagon_mdt_image);
 		return ret;
 	}
 
@@ -1253,6 +1272,8 @@ static int q6v5_probe(struct platform_device *pdev)
 	const struct rproc_hexagon_res *desc;
 	struct q6v5 *qproc;
 	struct rproc *rproc;
+	const char *mba_image;
+	const char *fw_name[2];
 	int ret;
 
 	desc = of_device_get_match_data(&pdev->dev);
@@ -1262,8 +1283,19 @@ static int q6v5_probe(struct platform_device *pdev)
 	if (desc->need_mem_protection && !qcom_scm_is_available())
 		return -EPROBE_DEFER;
 
+	ret = of_property_count_strings(pdev->dev.of_node, "qcom,firmware");
+	if (ret != -EINVAL && ret != 2)
+		return -EINVAL;
+
+	ret = of_property_read_string_array(pdev->dev.of_node, "qcom,firmware",
+					    fw_name, 2);
+	if (ret != -EINVAL && ret != 2)
+		return -EINVAL;
+
+	mba_image = (ret != 2) ? desc->hexagon_mba_image : fw_name[0];
+
 	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
-			    desc->hexagon_mba_image, sizeof(*qproc));
+			    mba_image, sizeof(*qproc));
 	if (!rproc) {
 		dev_err(&pdev->dev, "failed to allocate rproc\n");
 		return -ENOMEM;
@@ -1272,6 +1304,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc = (struct q6v5 *)rproc->priv;
 	qproc->dev = &pdev->dev;
 	qproc->rproc = rproc;
+	qproc->hexagon_mdt_image = (ret != 2) ? "modem.mdt" : fw_name[1];
 	platform_set_drvdata(pdev, qproc);
 
 	ret = q6v5_init_mem(qproc, pdev);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 18%]

* [PATCH v4] PM / devfreq: Restart previous governor if new governor fails to start
@ 2018-12-12 13:53 Sibi Sankar
      [irrelevant] ` <CGME20181212135338epcas5p12f7a8cd1c7aab5d5c936cbc5c33eee07@epcms1p6>
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-12 13:53 UTC (permalink / raw)
  To: myungjoo.ham, kyungmin.park
  Cc: cw00.choi, linux-pm, linux-kernel, linux-arm-msm-owner, skannan,
	Sibi Sankar

From: Saravana Kannan <skannan@codeaurora.org>

If the new governor fails to start, switch back to old governor so that the
devfreq state is not left in some weird limbo.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
---

V4:
* Removed prev_governor check.

V3:
* Fix NULL deref for real this time.
* Addressed some style preferences.

V2:
* Fixed typo in commit text
* Fixed potential NULL deref

 drivers/devfreq/devfreq.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 141413067b5c..ba2875a0b90e 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1024,7 +1024,7 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
 	struct devfreq *df = to_devfreq(dev);
 	int ret;
 	char str_governor[DEVFREQ_NAME_LEN + 1];
-	struct devfreq_governor *governor;
+	const struct devfreq_governor *governor, *prev_governor;
 
 	ret = sscanf(buf, "%" __stringify(DEVFREQ_NAME_LEN) "s", str_governor);
 	if (ret != 1)
@@ -1053,12 +1053,19 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
 			goto out;
 		}
 	}
+	prev_governor = df->governor;
 	df->governor = governor;
 	strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN);
 	ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL);
-	if (ret)
+	if (ret) {
 		dev_warn(dev, "%s: Governor %s not started(%d)\n",
 			 __func__, df->governor->name, ret);
+		df->governor = prev_governor;
+		strncpy(df->governor_name, prev_governor->name,
+			DEVFREQ_NAME_LEN);
+		df->governor->event_handler(df, DEVFREQ_GOV_START,
+					    NULL);
+	}
 out:
 	mutex_unlock(&devfreq_list_lock);
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* Re: [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-11-20 21:08 [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
  2018-12-05 22:55 ` Rob Herring
  2018-12-06 16:58 ` Bjorn Andersson
@ 2018-12-13 22:05 ` Doug Anderson
  2 siblings, 0 replies; 200+ results
From: Doug Anderson @ 2018-12-13 22:05 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Ohad Ben Cohen, Mark Rutland,
	linux-remoteproc

Hi,

On Tue, Nov 20, 2018 at 1:08 PM Sibi Sankar <sibis@codeaurora.org> wrote:
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 14947562bc67..bd9f4882fcf0 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -75,6 +75,17 @@ on the Qualcomm Hexagon core.
>         Definition: reference to the regulators to be held on behalf of the
>                     booting of the Hexagon core
>
> +- power-domains:
> +       Usage: required

Assuming I understand correctly, presumably you want to say that it's
required to list _either_ power-domains or supplies.  Right now you
have the bindings saying that you need both regulators and
power-domains on all boards.


> +       Value type: <phandle>
> +       Definition: reference to the cx, mx and mss power-domains to be held on
> +                   behalf of the booting the Hexagon core
> +
> +- power-domain-names:
> +       Usage: required
> +       Value type: <stringlist>
> +       Definition: must be "cx", "mx", "mss"

Comparing to the patch you posted at
<https://lkml.kernel.org/r/20181127085828.17908-1-sibis@codeaurora.org>,
it seems like maybe you also need "aop" listed here?



-Doug

^ permalink raw reply	[relevance 8%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-11-27  8:58 [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
@ 2018-12-13 22:17 ` Doug Anderson
  2018-12-14  4:52   ` Bjorn Andersson
  2018-12-14 16:29   ` Sibi Sankar
  0 siblings, 2 replies; 200+ results
From: Doug Anderson @ 2018-12-13 22:17 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Tue, Nov 27, 2018 at 12:58 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>
> The remoteproc mss node depends on the following bindings:
> https://patchwork.kernel.org/patch/10490559/ - rpmhp dt bindings

This is an older version of the patch.  Now at v7 at
<https://patchwork.kernel.org/patch/10725801/>


> https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
> https://patchwork.kernel.org/patch/10691215/ - mss power-domain dt bindings
> https://patchwork.kernel.org/patch/10691213/ - shutdown-ack dt bindings
>
> It also depends on the mpss and mba memory regions and pdc reset node.
> https://patchwork.kernel.org/patch/10662089/
> https://patchwork.kernel.org/patch/10657325/
>
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 63 ++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 58870273dbc9..df16ee464872 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -1095,6 +1095,69 @@
>                         };
>                 };
>
> +               remoteproc@4080000 {
> +                       compatible = "qcom,sdm845-mss-pil";
> +                       reg = <0x04080000 0x408>, <0x04180000 0x48>;

s/0x04080000/0x4080000 to appease the DT folks.


> +                       reg-names = "qdsp6", "rmb";
> +
> +                       interrupts-extended =
> +                               <&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
> +
> +                       interrupt-names = "wdog", "fatal", "ready",
> +                                         "handover", "stop-ack",
> +                                         "shutdown-ack";

nit: maybe remove blank line between "interrupts-extended" and
"interrupt-names".  Nice to keep -names close to the things they're
naming.


> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
> +                                <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
> +                                <&gcc GCC_BOOT_ROM_AHB_CLK>,
> +                                <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
> +                                <&gcc GCC_MSS_MFAB_AXIS_CLK>,
> +                                <&gcc GCC_PRNG_AHB_CLK>,
> +                                <&rpmhcc RPMH_CXO_CLK>;
> +
> +                       clock-names = "iface", "bus", "mem", "gpll0_mss",
> +                                     "snoc_axi", "mnoc_axi", "prng", "xo";

Bindings list clock-names as "iface", "bus", "mem".  You have "iface",
"bus", "mem", "gpll0_mss", "snoc_axi", "mnoc_axi", "prng", "xo".  It
looks like these extra clocks were added in commit 231f67d1fb2f
("remoteproc: q6v5: Add support for mss remoteproc on SDM845") but you
forgot to update the bindings.  Looking in that patch I also see an
"axis2" which you seem to be missing.  Do you need it?


> +                       qcom,smem-states = <&modem_smp2p_out 0>;
> +                       qcom,smem-state-names = "stop";
> +
> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
> +                       reset-names = "mss_restart", "pdc_reset";
> +
> +                       qcom,halt-regs = <&tcsr_mutex_regs
> +                                               0x23000 0x25000 0x24000>;
> +
> +                       power-domains = <&aoss_qmp_pd AOSS_QMP_LS_MODEM>,
> +                                       <&rpmhpd SDM845_CX>,
> +                                       <&rpmhpd SDM845_MX>,
> +                                       <&rpmhpd SDM845_MSS>;
> +                       power-domain-names = "aop", "cx", "mx", "mss";
> +
> +                       mba {
> +                               memory-region = <&mba_region>;
> +                       };
> +
> +                       mpss {
> +                               memory-region = <&mpss_region>;
> +                       };
> +
> +                       glink-edge {
> +                               interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
> +                               label = "modem";
> +                               qcom,remote-pid = <1>;

The "qcom,remote-pid" property isn't documented for "glink-edge".  Do
you need it?  ...if you do, please send a patch to update the
bindings.


-Doug

^ permalink raw reply	[relevance 6%]

* RE: [PATCH v4] PM / devfreq: Restart previous governor if new governor fails to start
      [irrelevant] ` <CGME20181212135338epcas5p12f7a8cd1c7aab5d5c936cbc5c33eee07@epcms1p6>
@ 2018-12-14  1:45   ` MyungJoo Ham
  0 siblings, 0 replies; 200+ results
From: MyungJoo Ham @ 2018-12-14  1:45 UTC (permalink / raw)
  To: Kyungmin Park
  Cc: Chanwoo Choi, linux-pm, linux-kernel, linux-arm-msm-owner,
	skannan, Sibi Sankar

> From: Saravana Kannan <skannan@codeaurora.org>
> 
> If the new governor fails to start, switch back to old governor so that the
> devfreq state is not left in some weird limbo.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

Hello,

In overall, the idea and the implementation looks good.

However, I have a question:

What if the following line fails?

+		df->governor->event_handler(df, DEVFREQ_GOV_START,
+					    NULL);

Don't we still need something to handle for such events?

Cheers,
MyungJoo


^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-13 22:17 ` Doug Anderson
@ 2018-12-14  4:52   ` Bjorn Andersson
  2018-12-14 16:18     ` Doug Anderson
  2018-12-14 16:29   ` Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Bjorn Andersson @ 2018-12-14  4:52 UTC (permalink / raw)
  To: Doug Anderson
  Cc: sibis, Rob Herring, Andy Gross, David Brown, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni, clew,
	akdwived, Mark Rutland, linux-remoteproc, Evan Green,
	Brian Norris

On Thu 13 Dec 14:17 PST 2018, Doug Anderson wrote:
> On Tue, Nov 27, 2018 at 12:58 AM Sibi Sankar <sibis@codeaurora.org> wrote:
[..]
> > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > index 58870273dbc9..df16ee464872 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > @@ -1095,6 +1095,69 @@
> >                         };
> >                 };
> >
> > +               remoteproc@4080000 {
> > +                       compatible = "qcom,sdm845-mss-pil";
> > +                       reg = <0x04080000 0x408>, <0x04180000 0x48>;
> 
> s/0x04080000/0x4080000 to appease the DT folks.
> 

Andy requests this to be padded to 8 digits, and I've come to really
appreciate this as it makes sorting much easier.

But perhaps there's a verdict on this?

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-14  4:52   ` Bjorn Andersson
@ 2018-12-14 16:18     ` Doug Anderson
  0 siblings, 0 replies; 200+ results
From: Doug Anderson @ 2018-12-14 16:18 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: sibis, Rob Herring, Andy Gross, David Brown, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni, clew,
	akdwived, Mark Rutland, linux-remoteproc, Evan Green,
	Brian Norris

Hi,

On Thu, Dec 13, 2018 at 8:52 PM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> On Thu 13 Dec 14:17 PST 2018, Doug Anderson wrote:
> > On Tue, Nov 27, 2018 at 12:58 AM Sibi Sankar <sibis@codeaurora.org> wrote:
> [..]
> > > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > > index 58870273dbc9..df16ee464872 100644
> > > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > > @@ -1095,6 +1095,69 @@
> > >                         };
> > >                 };
> > >
> > > +               remoteproc@4080000 {
> > > +                       compatible = "qcom,sdm845-mss-pil";
> > > +                       reg = <0x04080000 0x408>, <0x04180000 0x48>;
> >
> > s/0x04080000/0x4080000 to appease the DT folks.
> >
>
> Andy requests this to be padded to 8 digits, and I've come to really
> appreciate this as it makes sorting much easier.
>
> But perhaps there's a verdict on this?

Hrm.  First I've heard of that.  ...and all of the other addresses in
this file aren't padded to 8 digits.  Ugh.  I could submit a patch to
fix them all (I actually like them padded too) but given the current
number of outstanding patches against sdm845.dtsi it's just going to
cause lots of merge conflicts?

I thought it was general DT practice to always omit leading zeros but
I just searched and it appears that policy only applies to unit
addresses.  Specifically I note that in
<https://lkml.kernel.org/r/20180111060004.9333-1-bjorn.andersson@linaro.org>
Rob H asked you to remove the leading zero from the unit address but
_not_ the "reg".  So I guess padding the reg to 8 digits is OK.

tl;dr: Sure, keep the padding the 8 digits here and eventually we can
fix-up the other nodes when there's not so much churn to sdm845.dtsi
(or maybe Andy can do it himself?)  Sound like a plan?


-Doug

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-13 22:17 ` Doug Anderson
  2018-12-14  4:52   ` Bjorn Andersson
@ 2018-12-14 16:29   ` Sibi Sankar
  1 sibling, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-14 16:29 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, linux-remoteproc-owner

Hi Doug,
Thanks for the review!

On 2018-12-14 03:47, Doug Anderson wrote:
> Hi,
> 
> On Tue, Nov 27, 2018 at 12:58 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> The remoteproc mss node depends on the following bindings:
>> https://patchwork.kernel.org/patch/10490559/ - rpmhp dt bindings
> 
> This is an older version of the patch.  Now at v7 at
> <https://patchwork.kernel.org/patch/10725801/>
> 
> 
>> https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
>> https://patchwork.kernel.org/patch/10691215/ - mss power-domain dt 
>> bindings
>> https://patchwork.kernel.org/patch/10691213/ - shutdown-ack dt 
>> bindings
>> 
>> It also depends on the mpss and mba memory regions and pdc reset node.
>> https://patchwork.kernel.org/patch/10662089/
>> https://patchwork.kernel.org/patch/10657325/
>> 
>>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 63 
>> ++++++++++++++++++++++++++++
>>  1 file changed, 63 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi 
>> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> index 58870273dbc9..df16ee464872 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> @@ -1095,6 +1095,69 @@
>>                         };
>>                 };
>> 
>> +               remoteproc@4080000 {
>> +                       compatible = "qcom,sdm845-mss-pil";
>> +                       reg = <0x04080000 0x408>, <0x04180000 0x48>;
> 
> s/0x04080000/0x4080000 to appease the DT folks.
> 

as you said in the other thread will leave the
padding untouched

> 
>> +                       reg-names = "qdsp6", "rmb";
>> +
>> +                       interrupts-extended =
>> +                               <&intc GIC_SPI 266 
>> IRQ_TYPE_EDGE_RISING>,
>> +                               <&modem_smp2p_in 0 
>> IRQ_TYPE_EDGE_RISING>,
>> +                               <&modem_smp2p_in 1 
>> IRQ_TYPE_EDGE_RISING>,
>> +                               <&modem_smp2p_in 2 
>> IRQ_TYPE_EDGE_RISING>,
>> +                               <&modem_smp2p_in 3 
>> IRQ_TYPE_EDGE_RISING>,
>> +                               <&modem_smp2p_in 7 
>> IRQ_TYPE_EDGE_RISING>;
>> +
>> +                       interrupt-names = "wdog", "fatal", "ready",
>> +                                         "handover", "stop-ack",
>> +                                         "shutdown-ack";
> 
> nit: maybe remove blank line between "interrupts-extended" and
> "interrupt-names".  Nice to keep -names close to the things they're
> naming.
> 

sure will do that.. I guess I'll have to remove
the blank line in clock-names as well

> 
>> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
>> +                                <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
>> +                                <&gcc GCC_BOOT_ROM_AHB_CLK>,
>> +                                <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
>> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
>> +                                <&gcc GCC_MSS_MFAB_AXIS_CLK>,
>> +                                <&gcc GCC_PRNG_AHB_CLK>,
>> +                                <&rpmhcc RPMH_CXO_CLK>;
>> +
>> +                       clock-names = "iface", "bus", "mem", 
>> "gpll0_mss",
>> +                                     "snoc_axi", "mnoc_axi", "prng", 
>> "xo";
> 
> Bindings list clock-names as "iface", "bus", "mem".  You have "iface",
> "bus", "mem", "gpll0_mss", "snoc_axi", "mnoc_axi", "prng", "xo".  It
> looks like these extra clocks were added in commit 231f67d1fb2f
> ("remoteproc: q6v5: Add support for mss remoteproc on SDM845") but you
> forgot to update the bindings.  Looking in that patch I also see an
> "axis2" which you seem to be missing.  Do you need it?
> 

yes missed adding them..will add them in the next respin

> 
>> +                       qcom,smem-states = <&modem_smp2p_out 0>;
>> +                       qcom,smem-state-names = "stop";
>> +
>> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
>> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
>> +                       reset-names = "mss_restart", "pdc_reset";
>> +
>> +                       qcom,halt-regs = <&tcsr_mutex_regs
>> +                                               0x23000 0x25000 
>> 0x24000>;
>> +
>> +                       power-domains = <&aoss_qmp_pd 
>> AOSS_QMP_LS_MODEM>,
>> +                                       <&rpmhpd SDM845_CX>,
>> +                                       <&rpmhpd SDM845_MX>,
>> +                                       <&rpmhpd SDM845_MSS>;
>> +                       power-domain-names = "aop", "cx", "mx", "mss";
>> +
>> +                       mba {
>> +                               memory-region = <&mba_region>;
>> +                       };
>> +
>> +                       mpss {
>> +                               memory-region = <&mpss_region>;
>> +                       };
>> +
>> +                       glink-edge {
>> +                               interrupts = <GIC_SPI 449 
>> IRQ_TYPE_EDGE_RISING>;
>> +                               label = "modem";
>> +                               qcom,remote-pid = <1>;
> 
> The "qcom,remote-pid" property isn't documented for "glink-edge".  Do
> you need it?  ...if you do, please send a patch to update the
> bindings.
> 

yes glink seems to be missing the remote-pid..
I will add that as well in v2

> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown
  2018-12-06  7:16   ` Bjorn Andersson
@ 2018-12-14 17:32     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-14 17:32 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, linux-remoteproc-owner

Hi Bjorn,
Thanks for the review!

On 2018-12-06 12:46, Bjorn Andersson wrote:
> On Tue 20 Nov 13:02 PST 2018, Sibi Sankar wrote:
> 
>> After sending a sysmon shutdown request to the SSCTL service on the
>> subsystem, wait for the service to send shutdown-ack interrupt or
>> an indication message back.
>> 
> 
> So we get a reply immediate on the shutdown request, and then some time
> later we get either an indication or an interrupt to state that it's
> actually complete?
> 

Yes, after the immediate qmi result response
we get either indication/shutdown-ack interrupt
or both. This would indicate that the graceful
shutdown is complete and wouldn't further require
a qcom_q6v5_request_stop.

>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  drivers/remoteproc/qcom_sysmon.c | 59 
>> +++++++++++++++++++++++++++++++-
>>  1 file changed, 58 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/remoteproc/qcom_sysmon.c 
>> b/drivers/remoteproc/qcom_sysmon.c
> [..]
>> @@ -283,6 +311,14 @@ static void ssctl_request_shutdown(struct 
>> qcom_sysmon *sysmon)
>>  		dev_err(sysmon->dev, "shutdown request failed\n");
>>  	else
>>  		dev_dbg(sysmon->dev, "shutdown request completed\n");
>> +
>> +	if (sysmon->shutdown_irq > 0) {
>> +		ret = wait_for_completion_timeout(&sysmon->shutdown_comp,
>> +						  msecs_to_jiffies(5000));
> 
> 5 * HZ
> 

sure

>> +		if (!ret)
>> +			dev_err(sysmon->dev,
>> +				"timeout waiting for shutdown ack\n");
>> +	}
>>  }
> [..]
>> @@ -453,14 +499,25 @@ struct qcom_sysmon 
>> *qcom_add_sysmon_subdev(struct rproc *rproc,
>> 
>>  	sysmon->dev = rproc->dev.parent;
>>  	sysmon->rproc = rproc;
>> +	pdev = container_of(sysmon->dev, struct platform_device, dev);
>> 
>>  	sysmon->name = name;
>>  	sysmon->ssctl_instance = ssctl_instance;
>> 
>>  	init_completion(&sysmon->comp);
>> +	init_completion(&sysmon->shutdown_comp);
>>  	mutex_init(&sysmon->lock);
>> 
>> -	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, 
>> NULL);
>> +	sysmon->shutdown_irq = platform_get_irq_byname(pdev, 
>> "shutdown-ack");
> 
> Use of_irq_get_byname() on sysmon->dev instead of relying on the fact
> that the remoteproc driver is a platform_device.
> 
> Also, check and handle the return value - because an EPROBE_DEFER here
> will be turned into a -EINVAL by devm_request_threaded_irq().
> 

handling -EPROBE_DEFER would require changing the prototype
of add_sysmon_subdev, so can it come as a separate patch?

>> +	ret = devm_request_threaded_irq(sysmon->dev, sysmon->shutdown_irq,
>> +					NULL, sysmon_shutdown_interrupt,
>> +					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
>> +					"q6v5 shutdown-ack", sysmon);
>> +	if (ret)
>> +		dev_err(sysmon->dev, "failed to acquire shutdown-ack IRQ\n");
> 
> In the event that sysmon->shutdown_irq is != -ENODATA, you should fail
> here.
> 

don't we want this to be a optional property? meaning we
shouldn't fail for -EINVAL..

>> +
>> +	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
>> +			      qmi_indication_handler);
> 
> Regards,
> Bjorn

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
@ 2018-12-17 10:07 Sibi Sankar
  2018-12-17 10:07 ` [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5 Sibi Sankar
                   ` (6 more replies)
  0 siblings, 7 replies; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

Add missing qcom,remote-pid dt binding required for GLINK SMEM
which specifies the remote endpoint of the GLINK edge.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
index 0b8cc533ca83..59ae603ba520 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
@@ -21,6 +21,11 @@ edge.
 	Definition: should specify the IRQ used by the remote processor to
 		    signal this processor about communication related events
 
+- qcom,remote-pid:
+	Usage: required for glink-smem
+	Value type: <u32>
+	Definition: specifies the identfier of the remote endpoint of this edge
+
 - qcom,rpm-msg-ram:
 	Usage: required for glink-rpm
 	Value type: <prop-encoded-array>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
@ 2018-12-17 10:07 ` Sibi Sankar
  2018-12-17 23:59   ` Doug Anderson
  2018-12-18 17:27   ` Rob Herring
  2018-12-17 10:07 ` [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 .../devicetree/bindings/remoteproc/qcom,q6v5.txt       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9ff5b0309417..780adc043b37 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -39,13 +39,17 @@ on the Qualcomm Hexagon core.
 - clocks:
 	Usage: required
 	Value type: <phandle>
-	Definition: reference to the iface, bus and mem clocks to be held on
-		    behalf of the booting of the Hexagon core
+	Definition: reference to the list of 4 clocks for the modem sub-system
+		    reference to the list of 8 clocks for the modem sub-system
+		    on SDM845 SoCs
 
 - clock-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "iface", "bus", "mem"
+	Definition: must be "iface", "bus", "mem", "xo" for the modem sub-system
+		    must be "iface", "bus", "mem", "gpll0_mss", "snoc_axi",
+		    "mnoc_axi", "prng", "xo" for the modem sub-system on SDM845
+		    SoCs
 
 - resets:
 	Usage: required
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
  2018-12-17 10:07 ` [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5 Sibi Sankar
@ 2018-12-17 10:07 ` Sibi Sankar
  2018-12-18  0:00   ` Doug Anderson
  2018-12-17 10:07 ` [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

Fixup regulator supply dependencies for Q6V5 MSS on MSM996 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 780adc043b37..98894e6ad456 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -76,7 +76,9 @@ on the Qualcomm Hexagon core.
 	Usage: required
 	Value type: <phandle>
 	Definition: reference to the regulators to be held on behalf of the
-		    booting of the Hexagon core
+		    booting of the Hexagon core on MSM8916 SoCs
+		    reference to the pll-supply regulator to be held on behalf
+		    of the booting of the Hexagon core on MSM8996 SoCs
 
 - qcom,smem-states:
 	Usage: required
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
  2018-12-17 10:07 ` [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5 Sibi Sankar
  2018-12-17 10:07 ` [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
@ 2018-12-17 10:07 ` Sibi Sankar
  2018-12-18  0:01   ` Doug Anderson
  2018-12-17 10:07 ` [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

Add power-domain bindings for Q6V5 MSS on MSM8996 and SDM845 SoCs.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v2:
  * Add load_state power-domain
  * List cx and mx power-domains for MSM8996

 .../devicetree/bindings/remoteproc/qcom,q6v5.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 98894e6ad456..50695cd86397 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -80,6 +80,22 @@ on the Qualcomm Hexagon core.
 		    reference to the pll-supply regulator to be held on behalf
 		    of the booting of the Hexagon core on MSM8996 SoCs
 
+- power-domains:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the list of 2 power-domains for the modem
+		    sub-system on MSM8996 SoCs
+		    reference to the list of 4 power-domains for the modem
+		    sub-system on SDM845 SoCs
+
+- power-domain-names:
+	Usage: required
+	Value type: <stringlist>
+	Definition: must be "cx", "mx" for the modem sub-system on MSM8996
+		    SoCs
+		    must be "cx", "mx", "mss", "load_state" for the modem
+		    sub-system on SDM845 SoCs
+
 - qcom,smem-states:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (2 preceding siblings ...)
  2018-12-17 10:07 ` [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
@ 2018-12-17 10:07 ` Sibi Sankar
  2018-12-18  0:02   ` Doug Anderson
  2018-12-17 10:07 ` [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for " Sibi Sankar
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v2:
  * Fixed style changes
  * Added missing clocks in the dt-bindings
  * Split mss remoteproc node into a number of patches

This patch depends on the mpss and mba memory regions and pdc reset node.
https://patchwork.kernel.org/patch/10662089/
https://patchwork.kernel.org/patch/10657325/

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 52 ++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 5da9fa1feb8a..33ff8668828f 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1366,6 +1366,58 @@
 			};
 		};
 
+		remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0x04080000 0x408>, <0x04180000 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs
+						0x23000 0x25000 0x24000>;
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+				mbox-names = "mpss_smem";
+			};
+		};
+
 		usb_1_hsphy: phy@88e2000 {
 			compatible = "qcom,sdm845-qusb2-phy";
 			reg = <0x88e2000 0x400>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for Q6V5 MSS node
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (3 preceding siblings ...)
  2018-12-17 10:07 ` [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
@ 2018-12-17 10:07 ` " Sibi Sankar
  2018-12-18  0:02   ` Doug Anderson
  2018-12-17 10:07 ` [PATCH v2 7/7] arm64: dts: qcom: sdm845: Add shutdown-ack " Sibi Sankar
  2018-12-17 23:59 ` [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Doug Anderson
  6 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

Add power-domains cx, mx, mss and load_state for Q6V5 MSS node.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

This patch depends on the following bindings:
https://patchwork.kernel.org/patch/10725801/ - rpmhpd dt bindings
https://patchwork.kernel.org/patch/10725793/ - rpmhpd dt node
https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 33ff8668828f..56f5f55db9e2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1401,6 +1401,12 @@
 			qcom,halt-regs = <&tcsr_mutex_regs
 						0x23000 0x25000 0x24000>;
 
+			power-domains = <&aoss_qmp_pd AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
 			mba {
 				memory-region = <&mba_region>;
 			};
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v2 7/7] arm64: dts: qcom: sdm845: Add shutdown-ack for Q6V5 MSS node
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (4 preceding siblings ...)
  2018-12-17 10:07 ` [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for " Sibi Sankar
@ 2018-12-17 10:07 ` " Sibi Sankar
  2018-12-18  0:02   ` Doug Anderson
  2018-12-17 23:59 ` [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Doug Anderson
  6 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-17 10:07 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	Sibi Sankar

Add shutdown-ack smp2p interrupt for Q6V5 MSS node.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

This patch depends on:
https://patchwork.kernel.org/patch/10691213/ - shutdown-ack dt bindings

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 56f5f55db9e2..db17216a5bce 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1376,9 +1376,11 @@
 				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
 				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
 				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
-				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
 			interrupt-names = "wdog", "fatal", "ready",
-					  "handover", "stop-ack";
+					  "handover", "stop-ack",
+					  "shutdown-ack";
 
 			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
 				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v2 16/19] mailbox: qcom-apcs: Use device-managed registration API
      [irrelevant] <20181217150217.32435-1-thierry.reding@gmail.com>
@ 2018-12-17 15:02 ` Thierry Reding
  2018-12-17 18:16   ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Thierry Reding @ 2018-12-17 15:02 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, Bjorn Andersson, Georgi Djakov, Sibi Sankar

From: Thierry Reding <treding@nvidia.com>

Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Georgi Djakov <georgi.djakov@linaro.org>
Cc: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/mailbox/qcom-apcs-ipc-mailbox.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
index aed23ac9550d..3cf2937be149 100644
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
@@ -91,7 +91,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 	apcs->mbox.chans = apcs->mbox_chans;
 	apcs->mbox.num_chans = ARRAY_SIZE(apcs->mbox_chans);
 
-	ret = mbox_controller_register(&apcs->mbox);
+	ret = devm_mbox_controller_register(&pdev->dev, &apcs->mbox);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register APCS IPC controller\n");
 		return ret;
@@ -115,7 +115,6 @@ static int qcom_apcs_ipc_remove(struct platform_device *pdev)
 	struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev);
 	struct platform_device *clk = apcs->clk;
 
-	mbox_controller_unregister(&apcs->mbox);
 	platform_device_unregister(clk);
 
 	return 0;
-- 
2.19.1


^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 16/19] mailbox: qcom-apcs: Use device-managed registration API
  2018-12-17 15:02 ` [PATCH v2 16/19] mailbox: qcom-apcs: Use device-managed registration API Thierry Reding
@ 2018-12-17 18:16   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2018-12-17 18:16 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Jassi Brar, linux-kernel, Georgi Djakov, Sibi Sankar

On Mon 17 Dec 07:02 PST 2018, Thierry Reding wrote:

> From: Thierry Reding <treding@nvidia.com>
> 
> Get rid of some boilerplate driver removal code by using the newly added
> device-managed registration API.
> 
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> Cc: Georgi Djakov <georgi.djakov@linaro.org>
> Cc: Sibi Sankar <sibis@codeaurora.org>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/mailbox/qcom-apcs-ipc-mailbox.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> index aed23ac9550d..3cf2937be149 100644
> --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> @@ -91,7 +91,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
>  	apcs->mbox.chans = apcs->mbox_chans;
>  	apcs->mbox.num_chans = ARRAY_SIZE(apcs->mbox_chans);
>  
> -	ret = mbox_controller_register(&apcs->mbox);
> +	ret = devm_mbox_controller_register(&pdev->dev, &apcs->mbox);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to register APCS IPC controller\n");
>  		return ret;
> @@ -115,7 +115,6 @@ static int qcom_apcs_ipc_remove(struct platform_device *pdev)
>  	struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev);
>  	struct platform_device *clk = apcs->clk;
>  
> -	mbox_controller_unregister(&apcs->mbox);
>  	platform_device_unregister(clk);
>  
>  	return 0;
> -- 
> 2.19.1
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
  2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (5 preceding siblings ...)
  2018-12-17 10:07 ` [PATCH v2 7/7] arm64: dts: qcom: sdm845: Add shutdown-ack " Sibi Sankar
@ 2018-12-17 23:59 ` Doug Anderson
  2018-12-18  5:16   ` Sibi Sankar
  6 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2018-12-17 23:59 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:07 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add missing qcom,remote-pid dt binding required for GLINK SMEM
> which specifies the remote endpoint of the GLINK edge.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
>  1 file changed, 5 insertions(+)

Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover SMEM")


> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
> index 0b8cc533ca83..59ae603ba520 100644
> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
> @@ -21,6 +21,11 @@ edge.
>         Definition: should specify the IRQ used by the remote processor to
>                     signal this processor about communication related events
>
> +- qcom,remote-pid:
> +       Usage: required for glink-smem
> +       Value type: <u32>
> +       Definition: specifies the identfier of the remote endpoint of this edge

s/identfier/identifier/


Other than the typo this seems right to me.  Feel free to add my
Reviewed-by tag when that's fixed.


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5
  2018-12-17 10:07 ` [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5 Sibi Sankar
@ 2018-12-17 23:59   ` Doug Anderson
  2018-12-18  5:52     ` Sibi Sankar
  2018-12-18 17:27   ` Rob Herring
  1 sibling, 1 reply; 200+ results
From: Doug Anderson @ 2018-12-17 23:59 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:07 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt       | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")
Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
binding for SDM845")

...it probably doesn't matter too much but if we wanted to be really
careful we could split into two patches, one for the msm8996 and one
for sdm845.  I don't think people care that much about stable
backports of bindings though (someone can feel free to correct me)...


> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 9ff5b0309417..780adc043b37 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -39,13 +39,17 @@ on the Qualcomm Hexagon core.
>  - clocks:
>         Usage: required
>         Value type: <phandle>
> -       Definition: reference to the iface, bus and mem clocks to be held on
> -                   behalf of the booting of the Hexagon core
> +       Definition: reference to the list of 4 clocks for the modem sub-system
> +                   reference to the list of 8 clocks for the modem sub-system
> +                   on SDM845 SoCs

The above is confusing because you don't list the SoCs that are
supposed to use the 4 clocks.  How about instead:

Definition: reference to the clocks that match clock-names


>  - clock-names:
>         Usage: required
>         Value type: <stringlist>
> -       Definition: must be "iface", "bus", "mem"
> +       Definition: must be "iface", "bus", "mem", "xo" for the modem sub-system
> +                   must be "iface", "bus", "mem", "gpll0_mss", "snoc_axi",
> +                   "mnoc_axi", "prng", "xo" for the modem sub-system on SDM845
> +                   SoCs

Same here where it's confusing.  ...but also, it it correct?  As far
as I can tell you're missing msm8996.  It's better to just be explicit
and list each one, ideally without all the prose.

Definition: The clocks needed depend on the compatible string:

qcom,sdm845-mss-pil: "xo", "prng", "iface", "snoc_axi", "bus", "mem",
"gpll0_mss", "mnoc_axi"
qcom,msm8996-mss-pil: "xo", "pnoc", "iface", "bus", "mem", "gpll0_mss_clk"
qcom,msm8974-mss-pil: "xo", "iface", "bus", "mem"
qcom,msm8916-mss-pil: "xo", "iface", "bus", "mem"
qcom,q6v5-pil: "xo", "iface", "bus", "mem"

...as far as I can tell this binding is supposed to account for
"qcom,ipq8074-wcss-pil" too but it seems that one doesn't have
clock-names.


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies
  2018-12-17 10:07 ` [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
@ 2018-12-18  0:00   ` Doug Anderson
  2018-12-18  6:50     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2018-12-18  0:00 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Fixup regulator supply dependencies for Q6V5 MSS on MSM996 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 780adc043b37..98894e6ad456 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -76,7 +76,9 @@ on the Qualcomm Hexagon core.
>         Usage: required
>         Value type: <phandle>
>         Definition: reference to the regulators to be held on behalf of the
> -                   booting of the Hexagon core
> +                   booting of the Hexagon core on MSM8916 SoCs
> +                   reference to the pll-supply regulator to be held on behalf
> +                   of the booting of the Hexagon core on MSM8996 SoCs

The prose gets in the way and doesn't add anything.  I also don't
understand what you're saying for msm8996.  You're saying that
"pll-supply" is required there but none of the others?  That doesn't
seem to be true in the code I have in front of me, but maybe I'm
missing some patch.  For me, I'd write:

For the compatible strings below the following supplies are required:
  "qcom,q6v5-pil"
  "qcom,msm8916-mss-pil",
  "qcom,msm8974-mss-pil"
- cx-supply:
- mss-supply:
- mx-supply:
- pll-supply:
Usage: required
Value type: <phandle>
Definition: reference to the regulators to be held on behalf of the
    booting of the Hexagon core


...and if msm8996 actually needs "pll-supply", you could add in...

For the compatible strings below the following supplies are required:
  "qcom,msm8996-mss-pil"
- pll-supply:
Usage: required
Value type: <phandle>
Definition: reference to the regulators to be held on behalf of the
    booting of the Hexagon core

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-17 10:07 ` [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
@ 2018-12-18  0:01   ` Doug Anderson
  2018-12-18  6:30     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2018-12-18  0:01 UTC (permalink / raw)
  To: sibis, Bjorn Andersson
  Cc: Rob Herring, Andy Gross, David Brown, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni, clew,
	akdwived, Mark Rutland, linux-remoteproc, Evan Green,
	Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add power-domain bindings for Q6V5 MSS on MSM8996 and SDM845 SoCs.
>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>
> v2:
>   * Add load_state power-domain
>   * List cx and mx power-domains for MSM8996
>
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 98894e6ad456..50695cd86397 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -80,6 +80,22 @@ on the Qualcomm Hexagon core.
>                     reference to the pll-supply regulator to be held on behalf
>                     of the booting of the Hexagon core on MSM8996 SoCs
>
> +- power-domains:
> +       Usage: required
> +       Value type: <phandle>
> +       Definition: reference to the list of 2 power-domains for the modem
> +                   sub-system on MSM8996 SoCs

This is truly required for msm8996 SoCs?  The code I'm looking at
doesn't try to get these power domains for 8996 so presumably you're
breaking backward compatibility with old device tree files by making
this required now.  I don't personally know how widespread msm8996
usage is w/ upstream, so I'd let Bjorn comment on whether he thinks
this is OK.

As with the other patches in this series, I personally prefer less
prose and more lists / tables of exactly what is required for which
compatible string.


> +                   reference to the list of 4 power-domains for the modem
> +                   sub-system on SDM845 SoCs
> +
> +- power-domain-names:
> +       Usage: required
> +       Value type: <stringlist>
> +       Definition: must be "cx", "mx" for the modem sub-system on MSM8996
> +                   SoCs
> +                   must be "cx", "mx", "mss", "load_state" for the modem
> +                   sub-system on SDM845 SoCs

I haven't see a patch for using "load_state".  Can you point at it?  I
guess this was "aop" in your last version?


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-17 10:07 ` [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
@ 2018-12-18  0:02   ` Doug Anderson
  2018-12-18  6:35     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2018-12-18  0:02 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>
> v2:
>   * Fixed style changes
>   * Added missing clocks in the dt-bindings
>   * Split mss remoteproc node into a number of patches

I know there was some off-list suggestion to split this into a number
of patches, but to actually make that useful to anyone we'd actually
need to _also_ post up patches to make the driver probe / work without
these power domains.  ...and as per other discussions it's kinda
"lucky" that it happens to work without them and Bjorn wasn't
supportive of making this optional.

So I'd actually fold patch 6 into patch 5 and focus on getting the
"aoss_qmp_pd" landed sooner rather than later.


Keeping the "shutdown-ack" as a separate patch makes sense though
since the bindings currently list that as "optional" and I guess
things work OK w/out it.


Once patch #6 is folded into patch #5 feel free to add my Reviewed-by tag.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for Q6V5 MSS node
  2018-12-17 10:07 ` [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for " Sibi Sankar
@ 2018-12-18  0:02   ` Doug Anderson
  2018-12-18  6:38     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2018-12-18  0:02 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add power-domains cx, mx, mss and load_state for Q6V5 MSS node.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>
> This patch depends on the following bindings:
> https://patchwork.kernel.org/patch/10725801/ - rpmhpd dt bindings
> https://patchwork.kernel.org/patch/10725793/ - rpmhpd dt node
> https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
>
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)

As per my comments on patch #5, I think this patch (AKA patch #6)
should be folded in there.


> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 33ff8668828f..56f5f55db9e2 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -1401,6 +1401,12 @@
>                         qcom,halt-regs = <&tcsr_mutex_regs
>                                                 0x23000 0x25000 0x24000>;
>
> +                       power-domains = <&aoss_qmp_pd AOSS_QMP_LS_MODEM>,
> +                                       <&rpmhpd SDM845_CX>,
> +                                       <&rpmhpd SDM845_MX>,
> +                                       <&rpmhpd SDM845_MSS>;
> +                       power-domain-names = "load_state", "cx", "mx", "mss";

I guess you changed this to "load_state" from "aop" before?  Is there
code that actually uses this?


-Doug

-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 7/7] arm64: dts: qcom: sdm845: Add shutdown-ack for Q6V5 MSS node
  2018-12-17 10:07 ` [PATCH v2 7/7] arm64: dts: qcom: sdm845: Add shutdown-ack " Sibi Sankar
@ 2018-12-18  0:02   ` Doug Anderson
  0 siblings, 0 replies; 200+ results
From: Doug Anderson @ 2018-12-18  0:02 UTC (permalink / raw)
  To: sibis
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Add shutdown-ack smp2p interrupt for Q6V5 MSS node.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>
> This patch depends on:
> https://patchwork.kernel.org/patch/10691213/ - shutdown-ack dt bindings
>
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
  2018-12-17 23:59 ` [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Doug Anderson
@ 2018-12-18  5:16   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-18  5:16 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, linux-kernel-owner

Hi Doug,
Thanks for the review :)

On 2018-12-18 05:29, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 17, 2018 at 2:07 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> Add missing qcom,remote-pid dt binding required for GLINK SMEM
>> which specifies the remote endpoint of the GLINK edge.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
>>  1 file changed, 5 insertions(+)
> 
> Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover 
> SMEM")
> 
> 
>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt 
>> b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
>> index 0b8cc533ca83..59ae603ba520 100644
>> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
>> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
>> @@ -21,6 +21,11 @@ edge.
>>         Definition: should specify the IRQ used by the remote 
>> processor to
>>                     signal this processor about communication related 
>> events
>> 
>> +- qcom,remote-pid:
>> +       Usage: required for glink-smem
>> +       Value type: <u32>
>> +       Definition: specifies the identfier of the remote endpoint of 
>> this edge
> 
> s/identfier/identifier/
> 

missed this, will correct it in v3.

> 
> Other than the typo this seems right to me.  Feel free to add my
> Reviewed-by tag when that's fixed.
> 
> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5
  2018-12-17 23:59   ` Doug Anderson
@ 2018-12-18  5:52     ` Sibi Sankar
  2018-12-18 16:07       ` Doug Anderson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-18  5:52 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi Doug,
Thanks for the review :)

On 2018-12-18 05:29, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 17, 2018 at 2:07 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt       | 10 
>> +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
> on msm8996")
> Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
> binding for SDM845")
> 
> ...it probably doesn't matter too much but if we wanted to be really
> careful we could split into two patches, one for the msm8996 and one
> for sdm845.  I don't think people care that much about stable
> backports of bindings though (someone can feel free to correct me)...
> 

I did think of splitting this up but it doesn't
actually fix 9f058fa2efb1 yet. I noticed a few missing
clocks for mss on 8996 when I did a diff with the
corresponding CAF tree. Hence couldn't add bindings for
it. Will add them once I validate mss on 8996 with the
necessary changes.

> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 9ff5b0309417..780adc043b37 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -39,13 +39,17 @@ on the Qualcomm Hexagon core.
>>  - clocks:
>>         Usage: required
>>         Value type: <phandle>
>> -       Definition: reference to the iface, bus and mem clocks to be 
>> held on
>> -                   behalf of the booting of the Hexagon core
>> +       Definition: reference to the list of 4 clocks for the modem 
>> sub-system
>> +                   reference to the list of 8 clocks for the modem 
>> sub-system
>> +                   on SDM845 SoCs
> 
> The above is confusing because you don't list the SoCs that are
> supposed to use the 4 clocks.  How about instead:
> 
> Definition: reference to the clocks that match clock-names
> 

AFAIK, only the exceptions are captured. I am fine
with both, I'll wait for Bjorn/Rob's preference.

> 
>>  - clock-names:
>>         Usage: required
>>         Value type: <stringlist>
>> -       Definition: must be "iface", "bus", "mem"
>> +       Definition: must be "iface", "bus", "mem", "xo" for the modem 
>> sub-system
>> +                   must be "iface", "bus", "mem", "gpll0_mss", 
>> "snoc_axi",
>> +                   "mnoc_axi", "prng", "xo" for the modem sub-system 
>> on SDM845
>> +                   SoCs
> 
> Same here where it's confusing.  ...but also, it it correct?  As far
> as I can tell you're missing msm8996.  It's better to just be explicit
> and list each one, ideally without all the prose.
> 
> Definition: The clocks needed depend on the compatible string:
> 

ditto

> qcom,sdm845-mss-pil: "xo", "prng", "iface", "snoc_axi", "bus", "mem",
> "gpll0_mss", "mnoc_axi"
> qcom,msm8996-mss-pil: "xo", "pnoc", "iface", "bus", "mem", 
> "gpll0_mss_clk"

ditto

> qcom,msm8974-mss-pil: "xo", "iface", "bus", "mem"
> qcom,msm8916-mss-pil: "xo", "iface", "bus", "mem"
> qcom,q6v5-pil: "xo", "iface", "bus", "mem"
> 
> ...as far as I can tell this binding is supposed to account for
> "qcom,ipq8074-wcss-pil" too but it seems that one doesn't have
> clock-names.
> 

Yeah the lack of clocks have to be documented
for ipq8074-wcss-pil.. will do it in v3

> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-18  0:01   ` Doug Anderson
@ 2018-12-18  6:30     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-18  6:30 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi Doug,
Thanks for the review :)

On 2018-12-18 05:31, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> Add power-domain bindings for Q6V5 MSS on MSM8996 and SDM845 SoCs.
>> 
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> v2:
>>   * Add load_state power-domain
>>   * List cx and mx power-domains for MSM8996
>> 
>>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt | 16 
>> ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 98894e6ad456..50695cd86397 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -80,6 +80,22 @@ on the Qualcomm Hexagon core.
>>                     reference to the pll-supply regulator to be held 
>> on behalf
>>                     of the booting of the Hexagon core on MSM8996 SoCs
>> 
>> +- power-domains:
>> +       Usage: required
>> +       Value type: <phandle>
>> +       Definition: reference to the list of 2 power-domains for the 
>> modem
>> +                   sub-system on MSM8996 SoCs
> 
> This is truly required for msm8996 SoCs?  The code I'm looking at
> doesn't try to get these power domains for 8996 so presumably you're
> breaking backward compatibility with old device tree files by making
> this required now.  I don't personally know how widespread msm8996
> usage is w/ upstream, so I'd let Bjorn comment on whether he thinks
> this is OK.
> 

This is one of the reasons why the dt node
for mss on 8996 has not been posted/merged upstream.
Hence backward compatibility is not broken yet
in mainline :) .. However it will break on official
linaro integration releases (old dt + new kernel)

> As with the other patches in this series, I personally prefer less
> prose and more lists / tables of exactly what is required for which
> compatible string.
> 
> 
>> +                   reference to the list of 4 power-domains for the 
>> modem
>> +                   sub-system on SDM845 SoCs
>> +
>> +- power-domain-names:
>> +       Usage: required
>> +       Value type: <stringlist>
>> +       Definition: must be "cx", "mx" for the modem sub-system on 
>> MSM8996
>> +                   SoCs
>> +                   must be "cx", "mx", "mss", "load_state" for the 
>> modem
>> +                   sub-system on SDM845 SoCs
> 
> I haven't see a patch for using "load_state".  Can you point at it?  I
> guess this was "aop" in your last version?
> 

using load_state was Bjorn's suggestion and seemed
more appropriate than aop

> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-18  0:02   ` Doug Anderson
@ 2018-12-18  6:35     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-18  6:35 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, linux-soc-owner

Hi Doug,
Thanks for the review :)

On 2018-12-18 05:32, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> v2:
>>   * Fixed style changes
>>   * Added missing clocks in the dt-bindings
>>   * Split mss remoteproc node into a number of patches
> 
> I know there was some off-list suggestion to split this into a number
> of patches, but to actually make that useful to anyone we'd actually
> need to _also_ post up patches to make the driver probe / work without
> these power domains.  ...and as per other discussions it's kinda
> "lucky" that it happens to work without them and Bjorn wasn't
> supportive of making this optional.
> 
> So I'd actually fold patch 6 into patch 5 and focus on getting the
> "aoss_qmp_pd" landed sooner rather than later.
> 

I'll fold them in v3

> 
> Keeping the "shutdown-ack" as a separate patch makes sense though
> since the bindings currently list that as "optional" and I guess
> things work OK w/out it.
> 
> 
> Once patch #6 is folded into patch #5 feel free to add my Reviewed-by 
> tag.

okay

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for Q6V5 MSS node
  2018-12-18  0:02   ` Doug Anderson
@ 2018-12-18  6:38     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-18  6:38 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, linux-kernel-owner

Hi Doug,
Thanks for the review :)

On 2018-12-18 05:32, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> Add power-domains cx, mx, mss and load_state for Q6V5 MSS node.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> This patch depends on the following bindings:
>> https://patchwork.kernel.org/patch/10725801/ - rpmhpd dt bindings
>> https://patchwork.kernel.org/patch/10725793/ - rpmhpd dt node
>> https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
>> 
>>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 ++++++
>>  1 file changed, 6 insertions(+)
> 
> As per my comments on patch #5, I think this patch (AKA patch #6)
> should be folded in there.
> 

okay

> 
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi 
>> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> index 33ff8668828f..56f5f55db9e2 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
>> @@ -1401,6 +1401,12 @@
>>                         qcom,halt-regs = <&tcsr_mutex_regs
>>                                                 0x23000 0x25000 
>> 0x24000>;
>> 
>> +                       power-domains = <&aoss_qmp_pd 
>> AOSS_QMP_LS_MODEM>,
>> +                                       <&rpmhpd SDM845_CX>,
>> +                                       <&rpmhpd SDM845_MX>,
>> +                                       <&rpmhpd SDM845_MSS>;
>> +                       power-domain-names = "load_state", "cx", "mx", 
>> "mss";
> 
> I guess you changed this to "load_state" from "aop" before?  Is there
> code that actually uses this?
> 

Bjorn said he will be posting the patch
for handling power-domains for mss..

> 
> -Doug
> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies
  2018-12-18  0:00   ` Doug Anderson
@ 2018-12-18  6:50     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-18  6:50 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, linux-remoteproc-owner

Hi Doug,
Thanks for the review :)

On 2018-12-18 05:30, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 17, 2018 at 2:08 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> 
>> Fixup regulator supply dependencies for Q6V5 MSS on MSM996 SoCs.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 780adc043b37..98894e6ad456 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -76,7 +76,9 @@ on the Qualcomm Hexagon core.
>>         Usage: required
>>         Value type: <phandle>
>>         Definition: reference to the regulators to be held on behalf 
>> of the
>> -                   booting of the Hexagon core
>> +                   booting of the Hexagon core on MSM8916 SoCs
>> +                   reference to the pll-supply regulator to be held 
>> on behalf
>> +                   of the booting of the Hexagon core on MSM8996 SoCs
> 
> The prose gets in the way and doesn't add anything.  I also don't
> understand what you're saying for msm8996.  You're saying that
> "pll-supply" is required there but none of the others?  That doesn't
> seem to be true in the code I have in front of me, but maybe I'm
> missing some patch.  For me, I'd write:
> 

AFAIK, only the exceptions are captured. But your
suggestion seems more simple/complete. Perhaps I'll
replace SoCs instead of compatibles? Anyway
I'll wait for Bjorn/Rob's preference.

> For the compatible strings below the following supplies are required:
>   "qcom,q6v5-pil"
>   "qcom,msm8916-mss-pil",
>   "qcom,msm8974-mss-pil"
> - cx-supply:
> - mss-supply:
> - mx-supply:
> - pll-supply:
> Usage: required
> Value type: <phandle>
> Definition: reference to the regulators to be held on behalf of the
>     booting of the Hexagon core
> 
> 
> ...and if msm8996 actually needs "pll-supply", you could add in...
> 
> For the compatible strings below the following supplies are required:
>   "qcom,msm8996-mss-pil"
> - pll-supply:
> Usage: required
> Value type: <phandle>
> Definition: reference to the regulators to be held on behalf of the
>     booting of the Hexagon core

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5
  2018-12-18  5:52     ` Sibi Sankar
@ 2018-12-18 16:07       ` Doug Anderson
  0 siblings, 0 replies; 200+ results
From: Doug Anderson @ 2018-12-18 16:07 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris

Hi,

On Mon, Dec 17, 2018 at 9:52 PM Sibi Sankar <sibis@codeaurora.org> wrote:
> >> @@ -39,13 +39,17 @@ on the Qualcomm Hexagon core.
> >>  - clocks:
> >>         Usage: required
> >>         Value type: <phandle>
> >> -       Definition: reference to the iface, bus and mem clocks to be
> >> held on
> >> -                   behalf of the booting of the Hexagon core
> >> +       Definition: reference to the list of 4 clocks for the modem
> >> sub-system
> >> +                   reference to the list of 8 clocks for the modem
> >> sub-system
> >> +                   on SDM845 SoCs
> >
> > The above is confusing because you don't list the SoCs that are
> > supposed to use the 4 clocks.  How about instead:
> >
> > Definition: reference to the clocks that match clock-names
> >
>
> AFAIK, only the exceptions are captured. I am fine
> with both, I'll wait for Bjorn/Rob's preference.

Sure, waiting for Bjron / Rob to chime in sounds good.  If you are
going to document just the exception, though, IMO at least reword it.
AKA:

reference to the list of 8 clocks for the modem sub-system on SDM845
SoCs; reference to the list of 4 clocks for the modem sub-system on
all other SoCs.

...the key being the "on all other" to make it clear.  ...but I still
like my original suggestion of using less prose and more lists, so
hopefully Bjorn / Rob are OK with that.


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5
  2018-12-17 10:07 ` [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5 Sibi Sankar
  2018-12-17 23:59   ` Doug Anderson
@ 2018-12-18 17:27   ` Rob Herring
  2018-12-19  7:04     ` Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Rob Herring @ 2018-12-18 17:27 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris

On Mon, Dec 17, 2018 at 03:37:19PM +0530, Sibi Sankar wrote:
> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt       | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 9ff5b0309417..780adc043b37 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -39,13 +39,17 @@ on the Qualcomm Hexagon core.
>  - clocks:
>  	Usage: required
>  	Value type: <phandle>
> -	Definition: reference to the iface, bus and mem clocks to be held on
> -		    behalf of the booting of the Hexagon core
> +	Definition: reference to the list of 4 clocks for the modem sub-system
> +		    reference to the list of 8 clocks for the modem sub-system
> +		    on SDM845 SoCs
>  
>  - clock-names:
>  	Usage: required
>  	Value type: <stringlist>
> -	Definition: must be "iface", "bus", "mem"
> +	Definition: must be "iface", "bus", "mem", "xo" for the modem sub-system
> +		    must be "iface", "bus", "mem", "gpll0_mss", "snoc_axi",
> +		    "mnoc_axi", "prng", "xo" for the modem sub-system on SDM845
> +		    SoCs

This seems to me a list of all clocks you need enabled, not what clocks 
actually go to the modem. Specifically, shouldn't the *noc_axi clocks be 
managed by the interconnect driver?

Rob

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5
  2018-12-18 17:27   ` Rob Herring
@ 2018-12-19  7:04     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-19  7:04 UTC (permalink / raw)
  To: Rob Herring
  Cc: bjorn.andersson, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	linux-remoteproc-owner

Hi Rob,
Thanks for the review!

On 2018-12-18 22:57, Rob Herring wrote:
> On Mon, Dec 17, 2018 at 03:37:19PM +0530, Sibi Sankar wrote:
>> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt       | 10 
>> +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 9ff5b0309417..780adc043b37 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -39,13 +39,17 @@ on the Qualcomm Hexagon core.
>>  - clocks:
>>  	Usage: required
>>  	Value type: <phandle>
>> -	Definition: reference to the iface, bus and mem clocks to be held on
>> -		    behalf of the booting of the Hexagon core
>> +	Definition: reference to the list of 4 clocks for the modem 
>> sub-system
>> +		    reference to the list of 8 clocks for the modem sub-system
>> +		    on SDM845 SoCs
>> 
>>  - clock-names:
>>  	Usage: required
>>  	Value type: <stringlist>
>> -	Definition: must be "iface", "bus", "mem"
>> +	Definition: must be "iface", "bus", "mem", "xo" for the modem 
>> sub-system
>> +		    must be "iface", "bus", "mem", "gpll0_mss", "snoc_axi",
>> +		    "mnoc_axi", "prng", "xo" for the modem sub-system on SDM845
>> +		    SoCs
> 
> This seems to me a list of all clocks you need enabled, not what clocks
> actually go to the modem. Specifically, shouldn't the *noc_axi clocks 
> be
> managed by the interconnect driver?

clocks = ...,
        <&gcc GCC_MSS_SNOC_AXI_CLK>,
        <&gcc GCC_MSS_MFAB_AXIS_CLK>,
          ...;
clock-names = ..., "snoc_axi", "mnoc_axi",...;

snoc_axi and mnoc_axi maps to above GCC clks and
both of them fall under the MSS functional group

> 
> Rob

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v3 16/19] mailbox: qcom-apcs: Use device-managed registration API
      [irrelevant] <20181220172002.9016-1-thierry.reding@gmail.com>
@ 2018-12-20 17:19 ` " Thierry Reding
  0 siblings, 0 replies; 200+ results
From: Thierry Reding @ 2018-12-20 17:19 UTC (permalink / raw)
  To: Jassi Brar; +Cc: linux-kernel, Bjorn Andersson, Georgi Djakov, Sibi Sankar

From: Thierry Reding <treding@nvidia.com>

Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Georgi Djakov <georgi.djakov@linaro.org>
Cc: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/mailbox/qcom-apcs-ipc-mailbox.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
index aed23ac9550d..3cf2937be149 100644
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
@@ -91,7 +91,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 	apcs->mbox.chans = apcs->mbox_chans;
 	apcs->mbox.num_chans = ARRAY_SIZE(apcs->mbox_chans);
 
-	ret = mbox_controller_register(&apcs->mbox);
+	ret = devm_mbox_controller_register(&pdev->dev, &apcs->mbox);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register APCS IPC controller\n");
 		return ret;
@@ -115,7 +115,6 @@ static int qcom_apcs_ipc_remove(struct platform_device *pdev)
 	struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev);
 	struct platform_device *clk = apcs->clk;
 
-	mbox_controller_unregister(&apcs->mbox);
 	platform_device_unregister(clk);
 
 	return 0;
-- 
2.19.1


^ permalink raw reply	[relevance 6%]

* Re: [PATCH 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 MSS
  2018-12-12 12:44 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: " Sibi Sankar
@ 2018-12-20 20:10   ` Rob Herring
  2018-12-28  4:47     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Rob Herring @ 2018-12-20 20:10 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, david.brown, mark.rutland, andy.gross,
	briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree

On Wed, Dec 12, 2018 at 06:14:55PM +0530, Sibi Sankar wrote:
> Add optional firmware bindings for Q6V5 MSS. It lists the two relative
> firmware paths which are used for booting and authenticating the Hexagon
> core.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 9ff5b0309417..1f6988a60636 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -36,6 +36,13 @@ on the Qualcomm Hexagon core.
>  	Value type: <stringlist>
>  	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
>  
> +- qcom,firmware:

We already have a standard name 'firmware-name'. Use that. I'm fine with 
allowing it to be more than 1 string.

> +	Usage: optional
> +	Value type: <stringlist>
> +	Definition: must list the 2 relative firmware paths (mba and modem
> +		    metadata respectively) which are used for booting and
> +		    authenticating the Hexagon core.
> +
>  - clocks:
>  	Usage: required
>  	Value type: <phandle>
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5
@ 2018-12-24  8:48 Sibi Sankar
  2018-12-24  8:48 ` [PATCH v2 2/4] remoteproc: qcom: q6v5: Add shutdown-ack irq Sibi Sankar
                   ` (3 more replies)
  0 siblings, 4 replies; 200+ results
From: Sibi Sankar @ 2018-12-24  8:48 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, dianders,
	Sibi Sankar

Introduce shutdown-irq binding required for sysmon shutdown for Q6V5 MSS
on SDM845/MSM8996 SoCs and for WCSS Q6V5 on QCS404 SoC.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v2:
  Make shutdown-ack mandatory for MSS on SDM845/MSM8996 and
  for WCSS on QCS404 (Dropping Rob's reviewed-by due to this)

 .../bindings/remoteproc/qcom,adsp.txt           | 17 ++++++++++++++---
 .../bindings/remoteproc/qcom,q6v5.txt           | 15 ++++++++++++---
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
index 9c0cff3a5ed8..50df9936763b 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
@@ -19,13 +19,24 @@ on the Qualcomm ADSP Hexagon core.
 - interrupts-extended:
 	Usage: required
 	Value type: <prop-encoded-array>
-	Definition: must list the watchdog, fatal IRQs ready, handover and
-		    stop-ack IRQs
+	Definition: reference to the interrupts that match interrupt-names
 
 - interrupt-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	Definition: The interrupts needed depends on the compatible
+		    string:
+	qcom,msm8974-adsp-pil:
+	qcom,msm8996-adsp-pil:
+	qcom,msm8996-slpi-pil:
+	qcom,qcs404-adsp-pas:
+	qcom,qcs404-cdsp-pas:
+	qcom,sdm845-adsp-pas:
+	qcom,sdm845-cdsp-pas:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	qcom,qcs404-wcss-pas:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack",
+		    "shutdown-ack"
 
 - clocks:
 	Usage: required
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 5d0b2975387e..cacbdd368fe1 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -28,13 +28,22 @@ on the Qualcomm Hexagon core.
 - interrupts-extended:
 	Usage: required
 	Value type: <prop-encoded-array>
-	Definition: must list the watchdog, fatal IRQs ready, handover and
-		    stop-ack IRQs
+	Definition: reference to the interrupts that match interrupt-names
 
 - interrupt-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	Definition: The interrupts needed depends on the the compatible
+		    string:
+	qcom,q6v5-pil:
+	qcom,ipq8074-wcss-pil:
+	qcom,msm8916-mss-pil:
+	qcom,msm8974-mss-pil:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	qcom,msm8996-mss-pil:
+	qcom,sdm845-mss-pil:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack",
+		    "shutdown-ack"
 
 - clocks:
 	Usage: required
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* [PATCH v2 2/4] remoteproc: qcom: q6v5: Add shutdown-ack irq
  2018-12-24  8:48 [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
@ 2018-12-24  8:48 ` Sibi Sankar
  2018-12-24  8:48 ` [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-24  8:48 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, dianders,
	Sibi Sankar

Add shutdown-ack irq handling for Q6V5. This patch includes enabling
shutdown-ack irq on those Q6V5 instances with "has_shutdown_irq"
flag set and exposing Q6V5 state information to the sysmon instance
which is required to ascertain graceful shutdown completion.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

 v2:
   Move shutdown-irq get to Q6V5 from sysmon to handle
   -EPROBE_DEFER cases
   Correct the shutdown-irq wait time to 10 * HZ

 drivers/remoteproc/qcom_common.h    |  7 ++--
 drivers/remoteproc/qcom_q6v5.c      | 53 +++++++++++++++++++++++++++++
 drivers/remoteproc/qcom_q6v5.h      |  5 +++
 drivers/remoteproc/qcom_q6v5_adsp.c |  3 +-
 drivers/remoteproc/qcom_q6v5_mss.c  |  3 +-
 drivers/remoteproc/qcom_q6v5_pas.c  |  3 +-
 drivers/remoteproc/qcom_sysmon.c    |  6 +++-
 drivers/remoteproc/qcom_wcnss.c     |  3 +-
 8 files changed, 76 insertions(+), 7 deletions(-)

diff --git a/drivers/remoteproc/qcom_common.h b/drivers/remoteproc/qcom_common.h
index 58de71e4781c..d938b09ad02c 100644
--- a/drivers/remoteproc/qcom_common.h
+++ b/drivers/remoteproc/qcom_common.h
@@ -7,6 +7,7 @@
 #include <linux/soc/qcom/qmi.h>
 
 struct qcom_sysmon;
+struct qcom_q6v5;
 
 struct qcom_rproc_glink {
 	struct rproc_subdev subdev;
@@ -45,12 +46,14 @@ void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr);
 #if IS_ENABLED(CONFIG_QCOM_SYSMON)
 struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 					   const char *name,
-					   int ssctl_instance);
+					   int ssctl_instance,
+					   struct qcom_q6v5 *q6v5);
 void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon);
 #else
 static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 							 const char *name,
-							 int ssctl_instance)
+							 int ssctl_instance,
+							 struct qcom_q6v5 *q6v5)
 {
 	return NULL;
 }
diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
index 0d33e3079f0d..a4c2ecae6a0f 100644
--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -25,6 +25,7 @@ int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5)
 {
 	reinit_completion(&q6v5->start_done);
 	reinit_completion(&q6v5->stop_done);
+	reinit_completion(&q6v5->shutdown_done);
 
 	q6v5->running = true;
 	q6v5->handover_issued = false;
@@ -141,6 +142,35 @@ static irqreturn_t q6v5_stop_interrupt(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
+static irqreturn_t q6v5_shutdown_interrupt(int irq, void *data)
+{
+	struct qcom_q6v5 *q6v5 = data;
+
+	complete(&q6v5->shutdown_done);
+
+	return IRQ_HANDLED;
+}
+
+/**
+ * qcom_q6v5_wait_for_shutdown() - wait for remote processor shutdown signal
+ * @q6v5:	reference to qcom_q6v5 context
+ * @timeout:	timeout to wait for the event, in jiffies
+ *
+ * Return: 0 on success, -ETIMEDOUT on timeout
+ */
+int qcom_q6v5_wait_for_shutdown(struct qcom_q6v5 *q6v5, int timeout)
+{
+	int ret;
+
+	if (!q6v5->has_shutdown_irq)
+		return 0;
+
+	ret = wait_for_completion_timeout(&q6v5->shutdown_done, timeout);
+
+	return !ret ? -ETIMEDOUT : 0;
+}
+EXPORT_SYMBOL_GPL(qcom_q6v5_wait_for_shutdown);
+
 /**
  * qcom_q6v5_request_stop() - request the remote processor to stop
  * @q6v5:	reference to qcom_q6v5 context
@@ -185,6 +215,7 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
 
 	init_completion(&q6v5->start_done);
 	init_completion(&q6v5->stop_done);
+	init_completion(&q6v5->shutdown_done);
 
 	q6v5->wdog_irq = platform_get_irq_byname(pdev, "wdog");
 	if (q6v5->wdog_irq < 0) {
@@ -277,6 +308,28 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
 		return ret;
 	}
 
+	if (q6v5->has_shutdown_irq) {
+		q6v5->shutdown_irq = platform_get_irq_byname(pdev,
+							     "shutdown-ack");
+		if (q6v5->shutdown_irq < 0) {
+			if (q6v5->shutdown_irq != -EPROBE_DEFER)
+				dev_err(&pdev->dev,
+					"failed to get shutdown-ack IRQ: %d\n",
+					q6v5->shutdown_irq);
+			return q6v5->shutdown_irq;
+		}
+
+		ret = devm_request_threaded_irq(&pdev->dev, q6v5->shutdown_irq,
+						NULL, q6v5_shutdown_interrupt,
+						IRQF_TRIGGER_RISING |
+						IRQF_ONESHOT,
+						"q6v5 shutdown", q6v5);
+		if (ret) {
+			dev_err(&pdev->dev, "failed to acquire shutdown IRQ\n");
+			return ret;
+		}
+	}
+
 	q6v5->state = qcom_smem_state_get(&pdev->dev, "stop", &q6v5->stop_bit);
 	if (IS_ERR(q6v5->state)) {
 		dev_err(&pdev->dev, "failed to acquire stop state\n");
diff --git a/drivers/remoteproc/qcom_q6v5.h b/drivers/remoteproc/qcom_q6v5.h
index 7ac92c1e0f49..5cbaf2564c3a 100644
--- a/drivers/remoteproc/qcom_q6v5.h
+++ b/drivers/remoteproc/qcom_q6v5.h
@@ -21,11 +21,15 @@ struct qcom_q6v5 {
 	int ready_irq;
 	int handover_irq;
 	int stop_irq;
+	int shutdown_irq;
+
+	u8 has_shutdown_irq;
 
 	bool handover_issued;
 
 	struct completion start_done;
 	struct completion stop_done;
+	struct completion shutdown_done;
 
 	int crash_reason;
 
@@ -42,5 +46,6 @@ int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5);
 int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5);
 int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5);
 int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout);
+int qcom_q6v5_wait_for_shutdown(struct qcom_q6v5 *q6v5, int timeout);
 
 #endif
diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 79374d1de311..5fc42d38a1cd 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -438,7 +438,8 @@ static int adsp_probe(struct platform_device *pdev)
 	qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name);
 	adsp->sysmon = qcom_add_sysmon_subdev(rproc,
 					      desc->sysmon_name,
-					      desc->ssctl_id);
+					      desc->ssctl_id,
+					      &adsp->q6v5);
 
 	ret = rproc_add(rproc);
 	if (ret)
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 01be7314e176..3bc2dec85928 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1340,7 +1340,8 @@ static int q6v5_probe(struct platform_device *pdev)
 	qcom_add_glink_subdev(rproc, &qproc->glink_subdev);
 	qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
 	qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss");
-	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
+	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12,
+					       &qproc->q6v5);
 
 	ret = rproc_add(rproc);
 	if (ret)
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index b1e63fcd5fdf..920a39ea6609 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -303,7 +303,8 @@ static int adsp_probe(struct platform_device *pdev)
 	qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name);
 	adsp->sysmon = qcom_add_sysmon_subdev(rproc,
 					      desc->sysmon_name,
-					      desc->ssctl_id);
+					      desc->ssctl_id,
+					      &adsp->q6v5);
 
 	ret = rproc_add(rproc);
 	if (ret)
diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
index e976a602b015..c0d6ee8de995 100644
--- a/drivers/remoteproc/qcom_sysmon.c
+++ b/drivers/remoteproc/qcom_sysmon.c
@@ -14,12 +14,14 @@
 #include <linux/rpmsg.h>
 
 #include "qcom_common.h"
+#include "qcom_q6v5.h"
 
 static BLOCKING_NOTIFIER_HEAD(sysmon_notifiers);
 
 struct qcom_sysmon {
 	struct rproc_subdev subdev;
 	struct rproc *rproc;
+	struct qcom_q6v5 *q6v5;
 
 	struct list_head node;
 
@@ -442,7 +444,8 @@ static int sysmon_notify(struct notifier_block *nb, unsigned long event,
  */
 struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 					   const char *name,
-					   int ssctl_instance)
+					   int ssctl_instance,
+					   struct qcom_q6v5 *q6v5)
 {
 	struct qcom_sysmon *sysmon;
 	int ret;
@@ -456,6 +459,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 
 	sysmon->name = name;
 	sysmon->ssctl_instance = ssctl_instance;
+	sysmon->q6v5 = q6v5;
 
 	init_completion(&sysmon->comp);
 	mutex_init(&sysmon->lock);
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index b0e07e9f42d5..af13cade35da 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -552,7 +552,8 @@ static int wcnss_probe(struct platform_device *pdev)
 	}
 
 	qcom_add_smd_subdev(rproc, &wcnss->smd_subdev);
-	wcnss->sysmon = qcom_add_sysmon_subdev(rproc, "wcnss", WCNSS_SSCTL_ID);
+	wcnss->sysmon = qcom_add_sysmon_subdev(rproc, "wcnss", WCNSS_SSCTL_ID,
+					       NULL);
 
 	ret = rproc_add(rproc);
 	if (ret)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 15%]

* [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown
  2018-12-24  8:48 [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
  2018-12-24  8:48 ` [PATCH v2 2/4] remoteproc: qcom: q6v5: Add shutdown-ack irq Sibi Sankar
@ 2018-12-24  8:48 ` Sibi Sankar
  2019-01-03 23:33   ` Bjorn Andersson
  2018-12-24  8:48 ` [PATCH v2 4/4] remoteproc: qcom: Enable shutdown-ack irq on Q6V5 Sibi Sankar
  2018-12-27 21:55 ` [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Rob Herring
  3 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-24  8:48 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, dianders,
	Sibi Sankar

After sending a sysmon shutdown request to the SSCTL service on the
subsystem, wait for the service to send shutdown-ack interrupt or
an indication message to signal the completion of graceful shutdown.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_sysmon.c | 40 +++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
index c0d6ee8de995..0da83638ca99 100644
--- a/drivers/remoteproc/qcom_sysmon.c
+++ b/drivers/remoteproc/qcom_sysmon.c
@@ -36,6 +36,7 @@ struct qcom_sysmon {
 
 	struct rpmsg_endpoint *ept;
 	struct completion comp;
+	struct completion ind_comp;
 	struct mutex lock;
 
 	bool ssr_ack;
@@ -139,6 +140,7 @@ static int sysmon_callback(struct rpmsg_device *rpdev, void *data, int count,
 }
 
 #define SSCTL_SHUTDOWN_REQ		0x21
+#define SSCTL_SHUTDOWN_READY_IND	0x21
 #define SSCTL_SUBSYS_EVENT_REQ		0x23
 
 #define SSCTL_MAX_MSG_LEN		7
@@ -254,6 +256,29 @@ static struct qmi_elem_info ssctl_subsys_event_resp_ei[] = {
 	{}
 };
 
+static struct qmi_elem_info ssctl_shutdown_ind_ei[] = {
+	{}
+};
+
+static void sysmon_ind_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
+			  struct qmi_txn *txn, const void *data)
+{
+	struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, qmi);
+
+	complete(&sysmon->ind_comp);
+}
+
+static struct qmi_msg_handler qmi_indication_handler[] = {
+	{
+		.type = QMI_INDICATION,
+		.msg_id = SSCTL_SHUTDOWN_READY_IND,
+		.ei = ssctl_shutdown_ind_ei,
+		.decoded_size = 0,
+		.fn = sysmon_ind_cb
+	},
+	{}
+};
+
 /**
  * ssctl_request_shutdown() - request shutdown via SSCTL QMI service
  * @sysmon:	sysmon context
@@ -264,6 +289,7 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
 	struct qmi_txn txn;
 	int ret;
 
+	reinit_completion(&sysmon->ind_comp);
 	ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to allocate QMI txn\n");
@@ -285,6 +311,16 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
 		dev_err(sysmon->dev, "shutdown request failed\n");
 	else
 		dev_dbg(sysmon->dev, "shutdown request completed\n");
+
+	if (sysmon->q6v5) {
+		ret = qcom_q6v5_wait_for_shutdown(sysmon->q6v5, 10 * HZ);
+		if (ret) {
+			ret = try_wait_for_completion(&sysmon->ind_comp);
+			if (!ret)
+				dev_err(sysmon->dev,
+					"timeout waiting for shutdown ack\n");
+		}
+	}
 }
 
 /**
@@ -462,9 +498,11 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 	sysmon->q6v5 = q6v5;
 
 	init_completion(&sysmon->comp);
+	init_completion(&sysmon->ind_comp);
 	mutex_init(&sysmon->lock);
 
-	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, NULL);
+	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
+			      qmi_indication_handler);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to initialize qmi handle\n");
 		kfree(sysmon);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v2 4/4] remoteproc: qcom: Enable shutdown-ack irq on Q6V5
  2018-12-24  8:48 [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
  2018-12-24  8:48 ` [PATCH v2 2/4] remoteproc: qcom: q6v5: Add shutdown-ack irq Sibi Sankar
  2018-12-24  8:48 ` [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
@ 2018-12-24  8:48 ` Sibi Sankar
  2018-12-27 21:55 ` [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Rob Herring
  3 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-24  8:48 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, ohad, mark.rutland, linux-remoteproc, dianders,
	Sibi Sankar

Enable shutdown-ack irq handling for MSS Q6V5 on SDM845/MSM8996
SoCs and for WCSS Q6V5 on QCS404 SoC.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 11 ++++++++---
 drivers/remoteproc/qcom_q6v5_pas.c |  9 +++++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 3bc2dec85928..fdb18d1ea177 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -134,6 +134,7 @@ struct rproc_hexagon_res {
 	int version;
 	bool need_mem_protection;
 	bool has_alt_reset;
+	u8 has_shutdown_irq;
 };
 
 struct q6v5 {
@@ -1252,6 +1253,7 @@ static int q6v5_probe(struct platform_device *pdev)
 {
 	const struct rproc_hexagon_res *desc;
 	struct q6v5 *qproc;
+	struct qcom_q6v5 *q6v5;
 	struct rproc *rproc;
 	int ret;
 
@@ -1273,6 +1275,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc->dev = &pdev->dev;
 	qproc->rproc = rproc;
 	platform_set_drvdata(pdev, qproc);
+	q6v5 = &qproc->q6v5;
 
 	ret = q6v5_init_mem(qproc, pdev);
 	if (ret)
@@ -1330,7 +1333,8 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc->version = desc->version;
 	qproc->need_mem_protection = desc->need_mem_protection;
 
-	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
+	q6v5->has_shutdown_irq = desc->has_shutdown_irq;
+	ret = qcom_q6v5_init(q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
 			     qcom_msa_handover);
 	if (ret)
 		goto free_rproc;
@@ -1340,8 +1344,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	qcom_add_glink_subdev(rproc, &qproc->glink_subdev);
 	qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
 	qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss");
-	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12,
-					       &qproc->q6v5);
+	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12, q6v5);
 
 	ret = rproc_add(rproc);
 	if (ret)
@@ -1391,6 +1394,7 @@ static const struct rproc_hexagon_res sdm845_mss = {
 	},
 	.need_mem_protection = true,
 	.has_alt_reset = true,
+	.has_shutdown_irq = true,
 	.version = MSS_SDM845,
 };
 
@@ -1410,6 +1414,7 @@ static const struct rproc_hexagon_res msm8996_mss = {
 	},
 	.need_mem_protection = true,
 	.has_alt_reset = false,
+	.has_shutdown_irq = true,
 	.version = MSS_MSM8996,
 };
 
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index 920a39ea6609..2d6ff59575cd 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -43,6 +43,7 @@ struct adsp_data {
 	const char *ssr_name;
 	const char *sysmon_name;
 	int ssctl_id;
+	u8 has_shutdown_irq;
 };
 
 struct qcom_adsp {
@@ -257,6 +258,7 @@ static int adsp_probe(struct platform_device *pdev)
 {
 	const struct adsp_data *desc;
 	struct qcom_adsp *adsp;
+	struct qcom_q6v5 *q6v5;
 	struct rproc *rproc;
 	int ret;
 
@@ -280,6 +282,7 @@ static int adsp_probe(struct platform_device *pdev)
 	adsp->pas_id = desc->pas_id;
 	adsp->has_aggre2_clk = desc->has_aggre2_clk;
 	platform_set_drvdata(pdev, adsp);
+	q6v5 = &adsp->q6v5;
 
 	ret = adsp_alloc_memory_region(adsp);
 	if (ret)
@@ -293,7 +296,8 @@ static int adsp_probe(struct platform_device *pdev)
 	if (ret)
 		goto free_rproc;
 
-	ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem,
+	q6v5->has_shutdown_irq = desc->has_shutdown_irq;
+	ret = qcom_q6v5_init(q6v5, pdev, rproc, desc->crash_reason_smem,
 			     qcom_pas_handover);
 	if (ret)
 		goto free_rproc;
@@ -304,7 +308,7 @@ static int adsp_probe(struct platform_device *pdev)
 	adsp->sysmon = qcom_add_sysmon_subdev(rproc,
 					      desc->sysmon_name,
 					      desc->ssctl_id,
-					      &adsp->q6v5);
+					      q6v5);
 
 	ret = rproc_add(rproc);
 	if (ret)
@@ -366,6 +370,7 @@ static const struct adsp_data slpi_resource_init = {
 static const struct adsp_data wcss_resource_init = {
 	.crash_reason_smem = 421,
 	.firmware_name = "wcnss.mdt",
+	.has_shutdown_irq = true,
 	.pas_id = 6,
 	.ssr_name = "mpss",
 	.sysmon_name = "wcnss",
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
@ 2018-12-26 12:52 Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
                   ` (7 more replies)
  0 siblings, 8 replies; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add missing qcom,remote-pid dt binding required for GLINK SMEM
which specifies the remote endpoint of the GLINK edge.

Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover
SMEM")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
---

v3:
  * Fixed typo

 Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
index 0b8cc533ca83..587bb1ddc8cc 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
@@ -21,6 +21,11 @@ edge.
 	Definition: should specify the IRQ used by the remote processor to
 		    signal this processor about communication related events
 
+- qcom,remote-pid:
+	Usage: required for glink-smem
+	Value type: <u32>
+	Definition: specifies the identifier of the remote endpoint of this edge
+
 - qcom,rpm-msg-ram:
 	Usage: required for glink-rpm
 	Value type: <prop-encoded-array>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
@ 2018-12-26 12:52 ` Sibi Sankar
  2018-12-27 21:21   ` Rob Herring
  2018-12-26 12:52 ` [PATCH v3 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.

Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
binding for SDM845")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v3:
  * Fixup dt-binding documentation as suggested by Doug

 .../devicetree/bindings/remoteproc/qcom,q6v5.txt   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9ff5b0309417..20dd19f9ed99 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -39,13 +39,21 @@ on the Qualcomm Hexagon core.
 - clocks:
 	Usage: required
 	Value type: <phandle>
-	Definition: reference to the iface, bus and mem clocks to be held on
-		    behalf of the booting of the Hexagon core
+	Definition: reference to the clocks that match clock-names
 
 - clock-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "iface", "bus", "mem"
+	Definition: The clocks needed depend on the compatible string:
+	qcom,ipq8074-wcss-pil:
+		    no clock names required
+	qcom,q6v5-pil:
+	qcom,msm8916-mss-pil:
+	qcom,msm8974-mss-pil:
+		    must be "iface", "bus", "mem", "xo"
+	qcom,sdm845-mss-pil:
+		    must be "xo", "prng", "iface", "bus", "mem", "gpll0_mss",
+		    "snoc_axi", "mnoc_axi"
 
 - resets:
 	Usage: required
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v3 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
@ 2018-12-26 12:52 ` Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 4/8] remoteproc: qcom: q6v5-mss: " Sibi Sankar
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add missing clock bindings for Q6V5 MSS on MSM8996 SoCs.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v3:
  * Fixup dt-binding documentation as suggested by Doug

 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 20dd19f9ed99..af8788783e2b 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -51,6 +51,9 @@ on the Qualcomm Hexagon core.
 	qcom,msm8916-mss-pil:
 	qcom,msm8974-mss-pil:
 		    must be "iface", "bus", "mem", "xo"
+	qcom,msm8996-mss-pil:
+		    must be "xo", "pnoc", "qdss", "iface", "bus", "mem",
+		    "gpll0_mss_clk", "snoc_axi", "mnoc_axi"
 	qcom,sdm845-mss-pil:
 		    must be "xo", "prng", "iface", "bus", "mem", "gpll0_mss",
 		    "snoc_axi", "mnoc_axi"
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v3 4/8] remoteproc: qcom: q6v5-mss: Add missing clocks for MSM8996
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
@ 2018-12-26 12:52 ` " Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Proxy vote for QDSS clock and remove vote on handover interrupt
to provide MSS PBL with access to STM hardware registers during
boot. Add "snoc_axi" and "mnoc_axi" to the active clock list.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 01be7314e176..2f12901dd1a7 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1398,6 +1398,7 @@ static const struct rproc_hexagon_res msm8996_mss = {
 	.proxy_clk_names = (char*[]){
 			"xo",
 			"pnoc",
+			"qdss",
 			NULL
 	},
 	.active_clk_names = (char*[]){
@@ -1405,6 +1406,8 @@ static const struct rproc_hexagon_res msm8996_mss = {
 			"bus",
 			"mem",
 			"gpll0_mss_clk",
+			"snoc_axi",
+			"mnoc_axi",
 			NULL
 	},
 	.need_mem_protection = true,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v3 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (2 preceding siblings ...)
  2018-12-26 12:52 ` [PATCH v3 4/8] remoteproc: qcom: q6v5-mss: " Sibi Sankar
@ 2018-12-26 12:52 ` Sibi Sankar
  2018-12-27 21:23   ` Rob Herring
  2018-12-26 12:52 ` [PATCH v3 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 Sibi Sankar
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Fixup regulator supply dependencies for Q6V5 MSS on MSM996 SoCs.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v3:
  * Fixup dt-binding documentation as suggested by Doug

 .../bindings/remoteproc/qcom,q6v5.txt         | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index af8788783e2b..65713de70be5 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -76,6 +76,19 @@ on the Qualcomm Hexagon core.
 		    must be "mss_restart", "pdc_reset" for the modem
 		    sub-system on SDM845 SoCs
 
+For the compatible strings below the following supplies are required:
+  "qcom,q6v5-pil"
+  "qcom,msm8916-mss-pil",
+- cx-supply:
+- mx-supply:
+- pll-supply:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the regulators to be held on behalf of the
+		    booting of the Hexagon core
+
+For the compatible string below the following supplies are required:
+  "qcom,msm8974-mss-pil"
 - cx-supply:
 - mss-supply:
 - mx-supply:
@@ -85,6 +98,14 @@ on the Qualcomm Hexagon core.
 	Definition: reference to the regulators to be held on behalf of the
 		    booting of the Hexagon core
 
+For the compatible string below the following supplies are required:
+  "qcom,msm8996-mss-pil"
+- pll-supply:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the regulators to be held on behalf of the
+		    booting of the Hexagon core
+
 - qcom,smem-states:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v3 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (3 preceding siblings ...)
  2018-12-26 12:52 ` [PATCH v3 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
@ 2018-12-26 12:52 ` Sibi Sankar
  2018-12-26 12:52 ` [PATCH v3 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add proxy vote for pll supply on MSM8996 SoC.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 2f12901dd1a7..f80b17b16e98 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1395,6 +1395,13 @@ static const struct rproc_hexagon_res sdm845_mss = {
 
 static const struct rproc_hexagon_res msm8996_mss = {
 	.hexagon_mba_image = "mba.mbn",
+	.proxy_supply = (struct qcom_mss_reg_res[]) {
+		{
+			.supply = "pll",
+			.uA = 100000,
+		},
+		{}
+	},
 	.proxy_clk_names = (char*[]){
 			"xo",
 			"pnoc",
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v3 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (4 preceding siblings ...)
  2018-12-26 12:52 ` [PATCH v3 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 Sibi Sankar
@ 2018-12-26 12:52 ` Sibi Sankar
  2018-12-27 21:11   ` Rob Herring
  2018-12-26 12:52 ` [PATCH v3 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
  2018-12-27 21:19 ` [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Rob Herring
  7 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add power-domain bindings for Q6V5 MSS on MSM8996 and SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v3:
  * Fixup dt-binding documentation as suggested by Doug
  * Dropping Rob's Reviewed-by due to documentation style
    change

v2:
  * Add load_state power-domain
  * List cx and mx power-domains for MSM8996

 .../bindings/remoteproc/qcom,q6v5.txt         | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 65713de70be5..17ecaae5e5e0 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -106,6 +106,25 @@ For the compatible string below the following supplies are required:
 	Definition: reference to the regulators to be held on behalf of the
 		    booting of the Hexagon core
 
+- power-domains:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to power-domains that match power-domain-names
+
+- power-domain-names:
+	Usage: required
+	Value type: <stringlist>
+	Definition: The power-domains needed depend on the compatible string:
+	qcom,q6v5-pil:
+	qcom,ipq8074-wcss-pil:
+	qcom,msm8916-mss-pil:
+	qcom,msm8974-mss-pil:
+		    no power-domain names required
+	qcom,msm8996-mss-pil:
+		    must be "cx", "mx"
+	qcom,sdm845-mss-pil:
+		    must be "cx", "mx", "mss", "load_state"
+
 - qcom,smem-states:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v3 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (5 preceding siblings ...)
  2018-12-26 12:52 ` [PATCH v3 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
@ 2018-12-26 12:52 ` Sibi Sankar
  2018-12-27 21:19 ` [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Rob Herring
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-26 12:52 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---

v3:
  * with shutdown-ack irq redesign make it mandatory,
    merge multiple patches into a single one

v2:
  * Fixed style changes
  * Added missing clocks in the dt-bindings
  * Split mss remoteproc node into a number of patches

This patch depends on the following bindings:
https://patchwork.kernel.org/patch/10662089/ - mba/mpss reserved regions
https://patchwork.kernel.org/patch/10657325/ - pdc reset node
https://patchwork.kernel.org/patch/10740127/ - rpmhpd dt bindings
https://patchwork.kernel.org/patch/10740109/ - rpmhpd dt node
https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
https://patchwork.kernel.org/patch/10742083/ - shutdown-irq binding

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 60 ++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 5da9fa1feb8a..db17216a5bce 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1366,6 +1366,66 @@
 			};
 		};
 
+		remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0x04080000 0x408>, <0x04180000 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs
+						0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp_pd AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+				mbox-names = "mpss_smem";
+			};
+		};
+
 		usb_1_hsphy: phy@88e2000 {
 			compatible = "qcom,sdm845-qusb2-phy";
 			reg = <0x88e2000 0x400>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* Re: [PATCH v3 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-26 12:52 ` [PATCH v3 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
@ 2018-12-27 21:11   ` Rob Herring
  0 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-27 21:11 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan

On Wed, Dec 26, 2018 at 06:22:28PM +0530, Sibi Sankar wrote:
> Add power-domain bindings for Q6V5 MSS on MSM8996 and SDM845 SoCs.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> v3:
>   * Fixup dt-binding documentation as suggested by Doug
>   * Dropping Rob's Reviewed-by due to documentation style
>     change
> 
> v2:
>   * Add load_state power-domain
>   * List cx and mx power-domains for MSM8996
> 
>  .../bindings/remoteproc/qcom,q6v5.txt         | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
  2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (6 preceding siblings ...)
  2018-12-26 12:52 ` [PATCH v3 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
@ 2018-12-27 21:19 ` Rob Herring
  7 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-27 21:19 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

On Wed, 26 Dec 2018 18:22:22 +0530, Sibi Sankar wrote:
> Add missing qcom,remote-pid dt binding required for GLINK SMEM
> which specifies the remote endpoint of the GLINK edge.
> 
> Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover
> SMEM")
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Doug Anderson <dianders@chromium.org>
> ---
> 
> v3:
>   * Fixed typo
> 
>  Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845
  2018-12-26 12:52 ` [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
@ 2018-12-27 21:21   ` Rob Herring
  2018-12-28  4:45     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Rob Herring @ 2018-12-27 21:21 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan

On Wed, Dec 26, 2018 at 06:22:23PM +0530, Sibi Sankar wrote:
> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
> 
> Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
> binding for SDM845")
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> v3:
>   * Fixup dt-binding documentation as suggested by Doug
> 
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt   | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 9ff5b0309417..20dd19f9ed99 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -39,13 +39,21 @@ on the Qualcomm Hexagon core.
>  - clocks:
>  	Usage: required
>  	Value type: <phandle>
> -	Definition: reference to the iface, bus and mem clocks to be held on
> -		    behalf of the booting of the Hexagon core
> +	Definition: reference to the clocks that match clock-names
>  
>  - clock-names:
>  	Usage: required
>  	Value type: <stringlist>
> -	Definition: must be "iface", "bus", "mem"
> +	Definition: The clocks needed depend on the compatible string:
> +	qcom,ipq8074-wcss-pil:
> +		    no clock names required
> +	qcom,q6v5-pil:
> +	qcom,msm8916-mss-pil:
> +	qcom,msm8974-mss-pil:
> +		    must be "iface", "bus", "mem", "xo"
> +	qcom,sdm845-mss-pil:
> +		    must be "xo", "prng", "iface", "bus", "mem", "gpll0_mss",
> +		    "snoc_axi", "mnoc_axi"

Please keep the same order for the 4 clocks which are the same.

Rob

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies
  2018-12-26 12:52 ` [PATCH v3 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
@ 2018-12-27 21:23   ` Rob Herring
  0 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-27 21:23 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

On Wed, 26 Dec 2018 18:22:26 +0530, Sibi Sankar wrote:
> Fixup regulator supply dependencies for Q6V5 MSS on MSM996 SoCs.
> 
> Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
> on msm8996")
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> v3:
>   * Fixup dt-binding documentation as suggested by Doug
> 
>  .../bindings/remoteproc/qcom,q6v5.txt         | 21 +++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5
  2018-12-24  8:48 [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
                   ` (2 preceding siblings ...)
  2018-12-24  8:48 ` [PATCH v2 4/4] remoteproc: qcom: Enable shutdown-ack irq on Q6V5 Sibi Sankar
@ 2018-12-27 21:55 ` Rob Herring
  3 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-27 21:55 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, dianders, Sibi Sankar

On Mon, 24 Dec 2018 14:18:21 +0530, Sibi Sankar wrote:
> Introduce shutdown-irq binding required for sysmon shutdown for Q6V5 MSS
> on SDM845/MSM8996 SoCs and for WCSS Q6V5 on QCS404 SoC.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> v2:
>   Make shutdown-ack mandatory for MSS on SDM845/MSM8996 and
>   for WCSS on QCS404 (Dropping Rob's reviewed-by due to this)
> 
>  .../bindings/remoteproc/qcom,adsp.txt           | 17 ++++++++++++++---
>  .../bindings/remoteproc/qcom,q6v5.txt           | 15 ++++++++++++---
>  2 files changed, 26 insertions(+), 6 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845
  2018-12-27 21:21   ` Rob Herring
@ 2018-12-28  4:45     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28  4:45 UTC (permalink / raw)
  To: Rob Herring
  Cc: bjorn.andersson, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan

Hi Rob,
Thanks for the review!

On 2018-12-28 02:51, Rob Herring wrote:
> On Wed, Dec 26, 2018 at 06:22:23PM +0530, Sibi Sankar wrote:
>> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
>> 
>> Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
>> binding for SDM845")
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>> 
>> v3:
>>   * Fixup dt-binding documentation as suggested by Doug
>> 
>>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt   | 14 
>> +++++++++++---
>>  1 file changed, 11 insertions(+), 3 deletions(-)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 9ff5b0309417..20dd19f9ed99 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -39,13 +39,21 @@ on the Qualcomm Hexagon core.
>>  - clocks:
>>  	Usage: required
>>  	Value type: <phandle>
>> -	Definition: reference to the iface, bus and mem clocks to be held on
>> -		    behalf of the booting of the Hexagon core
>> +	Definition: reference to the clocks that match clock-names
>> 
>>  - clock-names:
>>  	Usage: required
>>  	Value type: <stringlist>
>> -	Definition: must be "iface", "bus", "mem"
>> +	Definition: The clocks needed depend on the compatible string:
>> +	qcom,ipq8074-wcss-pil:
>> +		    no clock names required
>> +	qcom,q6v5-pil:
>> +	qcom,msm8916-mss-pil:
>> +	qcom,msm8974-mss-pil:
>> +		    must be "iface", "bus", "mem", "xo"
>> +	qcom,sdm845-mss-pil:
>> +		    must be "xo", "prng", "iface", "bus", "mem", "gpll0_mss",
>> +		    "snoc_axi", "mnoc_axi"
> 
> Please keep the same order for the 4 clocks which are the same.

Will re-order them in the next re-spin.

> 
> Rob

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 MSS
  2018-12-20 20:10   ` Rob Herring
@ 2018-12-28  4:47     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28  4:47 UTC (permalink / raw)
  To: Rob Herring
  Cc: bjorn.andersson, david.brown, mark.rutland, andy.gross,
	briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree

Hi Rob,
Thanks for the review :)

On 2018-12-21 01:40, Rob Herring wrote:
> On Wed, Dec 12, 2018 at 06:14:55PM +0530, Sibi Sankar wrote:
>> Add optional firmware bindings for Q6V5 MSS. It lists the two relative
>> firmware paths which are used for booting and authenticating the 
>> Hexagon
>> core.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 
>> +++++++
>>  1 file changed, 7 insertions(+)
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt 
>> b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> index 9ff5b0309417..1f6988a60636 100644
>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
>> @@ -36,6 +36,13 @@ on the Qualcomm Hexagon core.
>>  	Value type: <stringlist>
>>  	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
>> 
>> +- qcom,firmware:
> 
> We already have a standard name 'firmware-name'. Use that. I'm fine 
> with
> allowing it to be more than 1 string.

sure will replace "qcom,firmware" with "firmware-name" in the next 
re-spin

> 
>> +	Usage: optional
>> +	Value type: <stringlist>
>> +	Definition: must list the 2 relative firmware paths (mba and modem
>> +		    metadata respectively) which are used for booting and
>> +		    authenticating the Hexagon core.
>> +
>>  - clocks:
>>  	Usage: required
>>  	Value type: <phandle>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v2 0/2] Add firmware bindings for Q6V5 MSS/PAS
@ 2018-12-28  4:48 Sibi Sankar
  2018-12-28  4:48 ` [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 Sibi Sankar
  2018-12-28  4:48 ` [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2018-12-28  4:48 UTC (permalink / raw)
  To: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross
  Cc: briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

Q6V5 MSS on certain SoCs like SDM845 are capable of operating under
completely different configuration (like Non-Modem WLAN configuration)
depending on the firmware loaded without any change in boot sequence
of the Hexagon core. The patch series is ultimately aimed to avoid
multiple compatibles per SoC to just specify different upstreamed firmware
locations. This is achieved by using "firmware-name" binding to store
the relative path of mba/modem/pas firmware images.

remoteproc@4080000 { 
	...
	firmware-name = "qcom/sdm845/mss/mba.mbn",
			"qcom/sdm845/mss/modem.mdt";
	...
}

remoteproc@17300000 {
	...
	firmware-name = "qcom/sdm845/lpass/adsp.mdt";
	...
}

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>

v2:
  * Replace "qcom,firmware" with "firmware-name" as suggested
    by Rob
  * Include dt-bindings/parsing logic for PAS based remoteprocs 

Sibi Sankar (2):
  dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5
  remoteproc: qcom: Add support for parsing fw dt bindings

 .../bindings/remoteproc/qcom,adsp.txt         |  6 +++
 .../bindings/remoteproc/qcom,q6v5.txt         |  7 +++
 drivers/remoteproc/qcom_q6v5_mss.c            | 46 +++++++++++++++----
 drivers/remoteproc/qcom_q6v5_pas.c            | 11 ++++-
 4 files changed, 59 insertions(+), 11 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 14%]

* [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5
  2018-12-28  4:48 [PATCH v2 0/2] Add firmware bindings for Q6V5 MSS/PAS Sibi Sankar
@ 2018-12-28  4:48 ` Sibi Sankar
  2018-12-28 22:17   ` Rob Herring
  2019-01-03 23:30   ` Brian Norris
  2018-12-28  4:48 ` [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
  1 sibling, 2 replies; 200+ results
From: Sibi Sankar @ 2018-12-28  4:48 UTC (permalink / raw)
  To: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross
  Cc: briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

Add optional "firmware-name" bindings for Q6V5 MSS and PAS based
remoteprocs. For Q6V5 MSS/PAS the two/one relative firmware
paths/path are to be listed respectively. Fallback to the default
images for mba/modem for Q6V5 MSS or the default Hexagon image
for Q6V5 PAS if the "firmware-name" binding is not present.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt | 6 ++++++
 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
index 9c0cff3a5ed8..60ee0f73071a 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
@@ -27,6 +27,12 @@ on the Qualcomm ADSP Hexagon core.
 	Value type: <stringlist>
 	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
 
+- firmware-name:
+	Usage: optional
+	Value type: <string>
+	Definition: must list the relative firmware image path for the
+		    Hexagon Core.
+
 - clocks:
 	Usage: required
 	Value type: <prop-encoded-array>
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9ff5b0309417..3a99e7379d8c 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -36,6 +36,13 @@ on the Qualcomm Hexagon core.
 	Value type: <stringlist>
 	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
 
+- firmware-name:
+	Usage: optional
+	Value type: <stringlist>
+	Definition: must list the relative firmware image paths for mba and
+		    modem. They are used for booting and authenticating the
+		    Hexagon core.
+
 - clocks:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings
  2018-12-28  4:48 [PATCH v2 0/2] Add firmware bindings for Q6V5 MSS/PAS Sibi Sankar
  2018-12-28  4:48 ` [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 Sibi Sankar
@ 2018-12-28  4:48 ` Sibi Sankar
  2019-01-03 23:09   ` Bjorn Andersson
  2019-01-03 23:44   ` Brian Norris
  1 sibling, 2 replies; 200+ results
From: Sibi Sankar @ 2018-12-28  4:48 UTC (permalink / raw)
  To: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross
  Cc: briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

Add support for parsing "firmware-name" dt bindings which specifies
the relative paths of mba/modem/pas image as strings. Fallback to
the default paths for mba/modem/pas image on -EINVAL.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 46 +++++++++++++++++++++++-------
 drivers/remoteproc/qcom_q6v5_pas.c | 11 ++++++-
 2 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 01be7314e176..c75179006e24 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -188,6 +188,7 @@ struct q6v5 {
 	bool has_alt_reset;
 	int mpss_perm;
 	int mba_perm;
+	const char *hexagon_mdt_image;
 	int version;
 };
 
@@ -860,17 +861,27 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 	phys_addr_t min_addr = PHYS_ADDR_MAX;
 	phys_addr_t max_addr = 0;
 	bool relocate = false;
-	char seg_name[10];
+	char *fw_name;
+	size_t fw_name_len;
 	ssize_t offset;
 	size_t size = 0;
 	void *ptr;
 	int ret;
 	int i;
 
-	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	fw_name_len = strlen(qproc->hexagon_mdt_image);
+	if (fw_name_len <= 4)
+		return -EINVAL;
+
+	fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
+	if (!fw_name)
+		return -ENOMEM;
+
+	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
 	if (ret < 0) {
-		dev_err(qproc->dev, "unable to load modem.mdt\n");
-		return ret;
+		dev_err(qproc->dev, "unable to load %s\n",
+			qproc->hexagon_mdt_image);
+		goto out;
 	}
 
 	/* Initialize the RMB validator */
@@ -918,10 +929,12 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 		ptr = qproc->mpss_region + offset;
 
 		if (phdr->p_filesz) {
-			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
-			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
+			snprintf(fw_name + fw_name_len - 3, fw_name_len,
+				 "b%02d", i);
+			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
 			if (ret) {
-				dev_err(qproc->dev, "failed to load %s\n", seg_name);
+				dev_err(qproc->dev, "failed to load %s\n",
+					fw_name);
 				goto release_firmware;
 			}
 
@@ -960,6 +973,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 
 release_firmware:
 	release_firmware(fw);
+out:
+	kfree(fw_name);
 
 	return ret < 0 ? ret : 0;
 }
@@ -1075,9 +1090,10 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 	unsigned long i;
 	int ret;
 
-	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
 	if (ret < 0) {
-		dev_err(qproc->dev, "unable to load modem.mdt\n");
+		dev_err(qproc->dev, "unable to load %s\n",
+			qproc->hexagon_mdt_image);
 		return ret;
 	}
 
@@ -1253,6 +1269,8 @@ static int q6v5_probe(struct platform_device *pdev)
 	const struct rproc_hexagon_res *desc;
 	struct q6v5 *qproc;
 	struct rproc *rproc;
+	const char *mba_image;
+	const char *fw_name[2];
 	int ret;
 
 	desc = of_device_get_match_data(&pdev->dev);
@@ -1262,8 +1280,15 @@ static int q6v5_probe(struct platform_device *pdev)
 	if (desc->need_mem_protection && !qcom_scm_is_available())
 		return -EPROBE_DEFER;
 
+	ret = of_property_read_string_array(pdev->dev.of_node, "firmware-name",
+					    fw_name, 2);
+	if (ret != -EINVAL && ret != 2)
+		return ret > 0 ? -EINVAL : ret;
+
+	mba_image = (ret != 2) ? desc->hexagon_mba_image : fw_name[0];
+
 	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
-			    desc->hexagon_mba_image, sizeof(*qproc));
+			    mba_image, sizeof(*qproc));
 	if (!rproc) {
 		dev_err(&pdev->dev, "failed to allocate rproc\n");
 		return -ENOMEM;
@@ -1272,6 +1297,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc = (struct q6v5 *)rproc->priv;
 	qproc->dev = &pdev->dev;
 	qproc->rproc = rproc;
+	qproc->hexagon_mdt_image = (ret != 2) ? "modem.mdt" : fw_name[1];
 	platform_set_drvdata(pdev, qproc);
 
 	ret = q6v5_init_mem(qproc, pdev);
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index b1e63fcd5fdf..141c7da29e9a 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -258,6 +258,8 @@ static int adsp_probe(struct platform_device *pdev)
 	const struct adsp_data *desc;
 	struct qcom_adsp *adsp;
 	struct rproc *rproc;
+	const char *fw_name;
+	const char *of_fw_name;
 	int ret;
 
 	desc = of_device_get_match_data(&pdev->dev);
@@ -267,8 +269,15 @@ static int adsp_probe(struct platform_device *pdev)
 	if (!qcom_scm_is_available())
 		return -EPROBE_DEFER;
 
+	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
+				      &of_fw_name);
+	if (ret && ret != -EINVAL)
+		return ret;
+
+	fw_name = ret ? desc->firmware_name : of_fw_name;
+
 	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
-			    desc->firmware_name, sizeof(*adsp));
+			    fw_name, sizeof(*adsp));
 	if (!rproc) {
 		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
 		return -ENOMEM;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 17%]

* [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
@ 2018-12-28 18:53 Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
                   ` (7 more replies)
  0 siblings, 8 replies; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add missing qcom,remote-pid dt binding required for GLINK SMEM
which specifies the remote endpoint of the GLINK edge.

Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover
SMEM")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---

v3:
  * Fixed typo

 Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
index 0b8cc533ca83..587bb1ddc8cc 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
@@ -21,6 +21,11 @@ edge.
 	Definition: should specify the IRQ used by the remote processor to
 		    signal this processor about communication related events
 
+- qcom,remote-pid:
+	Usage: required for glink-smem
+	Value type: <u32>
+	Definition: specifies the identifier of the remote endpoint of this edge
+
 - qcom,rpm-msg-ram:
 	Usage: required for glink-rpm
 	Value type: <prop-encoded-array>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
@ 2018-12-28 18:53 ` Sibi Sankar
  2018-12-28 22:13   ` Rob Herring
  2018-12-28 18:53 ` [PATCH v4 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.

Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
binding for SDM845")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v4:
  * Re-order clocks for consistency as suggested by Rob

v3:
  * Fixup dt-binding documentation as suggested by Doug

 .../devicetree/bindings/remoteproc/qcom,q6v5.txt   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9ff5b0309417..d645c8db29fd 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -39,13 +39,21 @@ on the Qualcomm Hexagon core.
 - clocks:
 	Usage: required
 	Value type: <phandle>
-	Definition: reference to the iface, bus and mem clocks to be held on
-		    behalf of the booting of the Hexagon core
+	Definition: reference to the clocks that match clock-names
 
 - clock-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "iface", "bus", "mem"
+	Definition: The clocks needed depend on the compatible string:
+	qcom,ipq8074-wcss-pil:
+		    no clock names required
+	qcom,q6v5-pil:
+	qcom,msm8916-mss-pil:
+	qcom,msm8974-mss-pil:
+		    must be "iface", "bus", "mem", "xo"
+	qcom,sdm845-mss-pil:
+		    must be "iface", "bus", "mem", "xo", "gpll0_mss",
+		    "snoc_axi", "mnoc_axi", "prng"
 
 - resets:
 	Usage: required
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v4 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
@ 2018-12-28 18:53 ` Sibi Sankar
  2018-12-28 22:13   ` Rob Herring
  2018-12-28 18:53 ` [PATCH v4 4/8] remoteproc: qcom: q6v5-mss: " Sibi Sankar
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add missing clock bindings for Q6V5 MSS on MSM8996 SoCs.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v4:
  * Re-order clocks for consistency as suggested by Rob

v3:
  * Fixup dt-binding documentation as suggested by Doug

 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index d645c8db29fd..bba3d6be71c0 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -51,6 +51,9 @@ on the Qualcomm Hexagon core.
 	qcom,msm8916-mss-pil:
 	qcom,msm8974-mss-pil:
 		    must be "iface", "bus", "mem", "xo"
+	qcom,msm8996-mss-pil:
+		    must be "iface", "bus", "mem", "xo", "gpll0_mss",
+		    "snoc_axi", "mnoc_axi", "pnoc", "qdss"
 	qcom,sdm845-mss-pil:
 		    must be "iface", "bus", "mem", "xo", "gpll0_mss",
 		    "snoc_axi", "mnoc_axi", "prng"
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v4 4/8] remoteproc: qcom: q6v5-mss: Add missing clocks for MSM8996
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
@ 2018-12-28 18:53 ` " Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Proxy vote for QDSS clock and remove vote on handover interrupt
to provide MSS PBL with access to STM hardware registers during
boot. Add "snoc_axi" and "mnoc_axi" to the active clock list.
Rename "gpll0_mss_clk" to "gpll0_mss" for consistency across SoCs.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v4:
  * Rename "gpll0_mss_clk" to "gpll0_mss" for consistency across
    SoCs

 drivers/remoteproc/qcom_q6v5_mss.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 01be7314e176..cb5f0d3ac6a3 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1398,13 +1398,16 @@ static const struct rproc_hexagon_res msm8996_mss = {
 	.proxy_clk_names = (char*[]){
 			"xo",
 			"pnoc",
+			"qdss",
 			NULL
 	},
 	.active_clk_names = (char*[]){
 			"iface",
 			"bus",
 			"mem",
-			"gpll0_mss_clk",
+			"gpll0_mss",
+			"snoc_axi",
+			"mnoc_axi",
 			NULL
 	},
 	.need_mem_protection = true,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v4 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (2 preceding siblings ...)
  2018-12-28 18:53 ` [PATCH v4 4/8] remoteproc: qcom: q6v5-mss: " Sibi Sankar
@ 2018-12-28 18:53 ` Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 Sibi Sankar
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Fixup regulator supply dependencies for Q6V5 MSS on MSM996 SoCs.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---

v3:
  * Fixup dt-binding documentation as suggested by Doug

 .../bindings/remoteproc/qcom,q6v5.txt         | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index bba3d6be71c0..9db371da4897 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -76,6 +76,19 @@ on the Qualcomm Hexagon core.
 		    must be "mss_restart", "pdc_reset" for the modem
 		    sub-system on SDM845 SoCs
 
+For the compatible strings below the following supplies are required:
+  "qcom,q6v5-pil"
+  "qcom,msm8916-mss-pil",
+- cx-supply:
+- mx-supply:
+- pll-supply:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the regulators to be held on behalf of the
+		    booting of the Hexagon core
+
+For the compatible string below the following supplies are required:
+  "qcom,msm8974-mss-pil"
 - cx-supply:
 - mss-supply:
 - mx-supply:
@@ -85,6 +98,14 @@ on the Qualcomm Hexagon core.
 	Definition: reference to the regulators to be held on behalf of the
 		    booting of the Hexagon core
 
+For the compatible string below the following supplies are required:
+  "qcom,msm8996-mss-pil"
+- pll-supply:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the regulators to be held on behalf of the
+		    booting of the Hexagon core
+
 - qcom,smem-states:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 20%]

* [PATCH v4 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (3 preceding siblings ...)
  2018-12-28 18:53 ` [PATCH v4 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
@ 2018-12-28 18:53 ` Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add proxy vote for pll supply on MSM8996 SoC.

Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
on msm8996")

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index cb5f0d3ac6a3..c86dc40cfb8c 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1395,6 +1395,13 @@ static const struct rproc_hexagon_res sdm845_mss = {
 
 static const struct rproc_hexagon_res msm8996_mss = {
 	.hexagon_mba_image = "mba.mbn",
+	.proxy_supply = (struct qcom_mss_reg_res[]) {
+		{
+			.supply = "pll",
+			.uA = 100000,
+		},
+		{}
+	},
 	.proxy_clk_names = (char*[]){
 			"xo",
 			"pnoc",
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 22%]

* [PATCH v4 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (4 preceding siblings ...)
  2018-12-28 18:53 ` [PATCH v4 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 Sibi Sankar
@ 2018-12-28 18:53 ` Sibi Sankar
  2018-12-28 18:53 ` [PATCH v4 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
  2019-01-03 20:17 ` [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Bjorn Andersson
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

Add power-domain bindings for Q6V5 MSS on MSM8996 and SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---

v3:
  * Fixup dt-binding documentation as suggested by Doug
  * Dropping Rob's Reviewed-by due to documentation style
    change

v2:
  * Add load_state power-domain
  * List cx and mx power-domains for MSM8996

 .../bindings/remoteproc/qcom,q6v5.txt         | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 9db371da4897..36e91c9d76e0 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -106,6 +106,25 @@ For the compatible string below the following supplies are required:
 	Definition: reference to the regulators to be held on behalf of the
 		    booting of the Hexagon core
 
+- power-domains:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to power-domains that match power-domain-names
+
+- power-domain-names:
+	Usage: required
+	Value type: <stringlist>
+	Definition: The power-domains needed depend on the compatible string:
+	qcom,q6v5-pil:
+	qcom,ipq8074-wcss-pil:
+	qcom,msm8916-mss-pil:
+	qcom,msm8974-mss-pil:
+		    no power-domain names required
+	qcom,msm8996-mss-pil:
+		    must be "cx", "mx"
+	qcom,sdm845-mss-pil:
+		    must be "cx", "mx", "mss", "load_state"
+
 - qcom,smem-states:
 	Usage: required
 	Value type: <phandle>
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 21%]

* [PATCH v4 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (5 preceding siblings ...)
  2018-12-28 18:53 ` [PATCH v4 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
@ 2018-12-28 18:53 ` Sibi Sankar
  2019-01-03 20:17 ` [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Bjorn Andersson
  7 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2018-12-28 18:53 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---

v3:
  * with shutdown-ack irq redesign make it mandatory,
    merge multiple patches into a single one

v2:
  * Fixed style changes
  * Added missing clocks in the dt-bindings
  * Split mss remoteproc node into a number of patches

This patch depends on the following bindings:
https://patchwork.kernel.org/patch/10662089/ - mba/mpss reserved regions
https://patchwork.kernel.org/patch/10657325/ - pdc reset node
https://patchwork.kernel.org/patch/10740127/ - rpmhpd dt bindings
https://patchwork.kernel.org/patch/10740109/ - rpmhpd dt node
https://patchwork.kernel.org/patch/10678301/ - AOP QMP dt bindings
https://patchwork.kernel.org/patch/10742083/ - shutdown-irq binding

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 60 ++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 5da9fa1feb8a..db17216a5bce 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1366,6 +1366,66 @@
 			};
 		};
 
+		remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0x04080000 0x408>, <0x04180000 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs
+						0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp_pd AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+				mbox-names = "mpss_smem";
+			};
+		};
+
 		usb_1_hsphy: phy@88e2000 {
 			compatible = "qcom,sdm845-qusb2-phy";
 			reg = <0x88e2000 0x400>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* Re: [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845
  2018-12-28 18:53 ` [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
@ 2018-12-28 22:13   ` Rob Herring
  0 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-28 22:13 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

On Sat, 29 Dec 2018 00:23:01 +0530, Sibi Sankar wrote:
> Add missing clock bindings for Q6V5 MSS on SDM845 SoCs.
> 
> Fixes: fb22022ff63d ("dt-bindings: remoteproc: Add Q6v5 Modem PIL
> binding for SDM845")
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> v4:
>   * Re-order clocks for consistency as suggested by Rob
> 
> v3:
>   * Fixup dt-binding documentation as suggested by Doug
> 
>  .../devicetree/bindings/remoteproc/qcom,q6v5.txt   | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996
  2018-12-28 18:53 ` [PATCH v4 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
@ 2018-12-28 22:13   ` Rob Herring
  0 siblings, 0 replies; 200+ results
From: Rob Herring @ 2018-12-28 22:13 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders,
	linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

On Sat, 29 Dec 2018 00:23:02 +0530, Sibi Sankar wrote:
> Add missing clock bindings for Q6V5 MSS on MSM8996 SoCs.
> 
> Fixes: 9f058fa2efb1 ("remoteproc: qcom: Add support for mss remoteproc
> on msm8996")
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> v4:
>   * Re-order clocks for consistency as suggested by Rob
> 
> v3:
>   * Fixup dt-binding documentation as suggested by Doug
> 
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5
  2018-12-28  4:48 ` [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 Sibi Sankar
@ 2018-12-28 22:17   ` Rob Herring
  2019-01-03 23:30   ` Brian Norris
  1 sibling, 0 replies; 200+ results
From: Rob Herring @ 2018-12-28 22:17 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	briannorris, akdwived, clew, linux-kernel, linux-arm-msm-owner,
	ohad, linux-remoteproc, devicetree, Sibi Sankar

On Fri, 28 Dec 2018 10:18:18 +0530, Sibi Sankar wrote:
> Add optional "firmware-name" bindings for Q6V5 MSS and PAS based
> remoteprocs. For Q6V5 MSS/PAS the two/one relative firmware
> paths/path are to be listed respectively. Fallback to the default
> images for mba/modem for Q6V5 MSS or the default Hexagon image
> for Q6V5 PAS if the "firmware-name" binding is not present.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt | 6 ++++++
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 +++++++
>  2 files changed, 13 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
  2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
                   ` (6 preceding siblings ...)
  2018-12-28 18:53 ` [PATCH v4 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
@ 2019-01-03 20:17 ` Bjorn Andersson
  2019-01-08 10:26   ` Sibi Sankar
  7 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2019-01-03 20:17 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: robh+dt, andy.gross, david.brown, dianders, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, clew, akdwived,
	mark.rutland, linux-remoteproc, evgreen, briannorris, sricharan

On Fri 28 Dec 10:53 PST 2018, Sibi Sankar wrote:

> Add missing qcom,remote-pid dt binding required for GLINK SMEM
> which specifies the remote endpoint of the GLINK edge.
> 
> Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover
> SMEM")
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Doug Anderson <dianders@chromium.org>
> Reviewed-by: Rob Herring <robh@kernel.org>

Thanks for the updates Sibi!

@Andy, as this relates to rpmsg I'll take this (patch 1/8) through the
rpmsg tree.

And I'm picking 2-7 through the remoteproc tree.


PS. Please use a --cover-letter when sending a series of patches.

Regards,
Bjorn

> ---
> 
> v3:
>   * Fixed typo
> 
>  Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
> index 0b8cc533ca83..587bb1ddc8cc 100644
> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
> @@ -21,6 +21,11 @@ edge.
>  	Definition: should specify the IRQ used by the remote processor to
>  		    signal this processor about communication related events
>  
> +- qcom,remote-pid:
> +	Usage: required for glink-smem
> +	Value type: <u32>
> +	Definition: specifies the identifier of the remote endpoint of this edge
> +
>  - qcom,rpm-msg-ram:
>  	Usage: required for glink-rpm
>  	Value type: <prop-encoded-array>
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings
  2018-12-28  4:48 ` [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
@ 2019-01-03 23:09   ` Bjorn Andersson
  2019-01-03 23:44   ` Brian Norris
  1 sibling, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-03 23:09 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: david.brown, robh+dt, mark.rutland, andy.gross, briannorris,
	akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree

On Thu 27 Dec 20:48 PST 2018, Sibi Sankar wrote:

> Add support for parsing "firmware-name" dt bindings which specifies
> the relative paths of mba/modem/pas image as strings. Fallback to
> the default paths for mba/modem/pas image on -EINVAL.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Thanks Sibi, just some minor style issues I would prefer to have fixed.

I picked patch 1, so no need to resend that.

> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 46 +++++++++++++++++++++++-------
>  drivers/remoteproc/qcom_q6v5_pas.c | 11 ++++++-
>  2 files changed, 46 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index 01be7314e176..c75179006e24 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -188,6 +188,7 @@ struct q6v5 {
>  	bool has_alt_reset;
>  	int mpss_perm;
>  	int mba_perm;
> +	const char *hexagon_mdt_image;
>  	int version;
>  };
>  
> @@ -860,17 +861,27 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  	phys_addr_t min_addr = PHYS_ADDR_MAX;
>  	phys_addr_t max_addr = 0;
>  	bool relocate = false;
> -	char seg_name[10];
> +	char *fw_name;
> +	size_t fw_name_len;
>  	ssize_t offset;
>  	size_t size = 0;
>  	void *ptr;
>  	int ret;
>  	int i;
>  
> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
> +	fw_name_len = strlen(qproc->hexagon_mdt_image);
> +	if (fw_name_len <= 4)
> +		return -EINVAL;
> +
> +	fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
> +	if (!fw_name)
> +		return -ENOMEM;
> +
> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);

Use fw_name here.

>  	if (ret < 0) {
> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
> -		return ret;
> +		dev_err(qproc->dev, "unable to load %s\n",
> +			qproc->hexagon_mdt_image);
> +		goto out;
>  	}
>  
>  	/* Initialize the RMB validator */
> @@ -918,10 +929,12 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  		ptr = qproc->mpss_region + offset;
>  
>  		if (phdr->p_filesz) {
> -			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
> -			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
> +			snprintf(fw_name + fw_name_len - 3, fw_name_len,
> +				 "b%02d", i);
> +			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
>  			if (ret) {
> -				dev_err(qproc->dev, "failed to load %s\n", seg_name);
> +				dev_err(qproc->dev, "failed to load %s\n",
> +					fw_name);

Follow my lead and break the 80-char limit.

>  				goto release_firmware;
>  			}
>  
> @@ -960,6 +973,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  
>  release_firmware:
>  	release_firmware(fw);
> +out:
> +	kfree(fw_name);
>  
>  	return ret < 0 ? ret : 0;
>  }
> @@ -1075,9 +1090,10 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  	unsigned long i;
>  	int ret;
>  
> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
>  	if (ret < 0) {
> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
> +		dev_err(qproc->dev, "unable to load %s\n",
> +			qproc->hexagon_mdt_image);
>  		return ret;
>  	}
>  
> @@ -1253,6 +1269,8 @@ static int q6v5_probe(struct platform_device *pdev)
>  	const struct rproc_hexagon_res *desc;
>  	struct q6v5 *qproc;
>  	struct rproc *rproc;
> +	const char *mba_image;
> +	const char *fw_name[2];
>  	int ret;
>  
>  	desc = of_device_get_match_data(&pdev->dev);
> @@ -1262,8 +1280,15 @@ static int q6v5_probe(struct platform_device *pdev)
>  	if (desc->need_mem_protection && !qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> +	ret = of_property_read_string_array(pdev->dev.of_node, "firmware-name",
> +					    fw_name, 2);
> +	if (ret != -EINVAL && ret != 2)
> +		return ret > 0 ? -EINVAL : ret;
> +
> +	mba_image = (ret != 2) ? desc->hexagon_mba_image : fw_name[0];

Use the fact that of_property_read_string_index() leaves the output
parameter untouched if it doesn't succeed in parsing the property.

I.e. do:

mba_image = desc->hexagon_mba_image;
ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
				    0, &mba_image);
if (ret < 0 && ret != -EINVAL)
	fail();

and

qproc->hexagon_mdt_image = "modem.mdt";
ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
				    1, &qproc->hexagon_mdt_image);
if (ret < 0 && ret != -EINVAL)
	fail();

> +
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
> -			    desc->hexagon_mba_image, sizeof(*qproc));
> +			    mba_image, sizeof(*qproc));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "failed to allocate rproc\n");
>  		return -ENOMEM;
> @@ -1272,6 +1297,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qproc = (struct q6v5 *)rproc->priv;
>  	qproc->dev = &pdev->dev;
>  	qproc->rproc = rproc;
> +	qproc->hexagon_mdt_image = (ret != 2) ? "modem.mdt" : fw_name[1];
>  	platform_set_drvdata(pdev, qproc);
>  
>  	ret = q6v5_init_mem(qproc, pdev);
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index b1e63fcd5fdf..141c7da29e9a 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -258,6 +258,8 @@ static int adsp_probe(struct platform_device *pdev)
>  	const struct adsp_data *desc;
>  	struct qcom_adsp *adsp;
>  	struct rproc *rproc;
> +	const char *fw_name;
> +	const char *of_fw_name;
>  	int ret;
>  
>  	desc = of_device_get_match_data(&pdev->dev);
> @@ -267,8 +269,15 @@ static int adsp_probe(struct platform_device *pdev)
>  	if (!qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> +	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> +				      &of_fw_name);
> +	if (ret && ret != -EINVAL)
> +		return ret;
> +
> +	fw_name = ret ? desc->firmware_name : of_fw_name;

As above, please use the fact that the last parameter of
of_property_read_string() doesn't modify the output if it fails.

> +
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
> -			    desc->firmware_name, sizeof(*adsp));
> +			    fw_name, sizeof(*adsp));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
>  		return -ENOMEM;

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5
  2018-12-28  4:48 ` [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 Sibi Sankar
  2018-12-28 22:17   ` Rob Herring
@ 2019-01-03 23:30   ` Brian Norris
      [irrelevant]     ` <20190103235043.GA195759@google.com>
  1 sibling, 1 reply; 200+ results
From: Brian Norris @ 2019-01-03 23:30 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree

Hi Sibi,

On Fri, Dec 28, 2018 at 10:18:18AM +0530, Sibi Sankar wrote:
> Add optional "firmware-name" bindings for Q6V5 MSS and PAS based
> remoteprocs. For Q6V5 MSS/PAS the two/one relative firmware
> paths/path are to be listed respectively. Fallback to the default
> images for mba/modem for Q6V5 MSS or the default Hexagon image
> for Q6V5 PAS if the "firmware-name" binding is not present.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt | 6 ++++++
>  Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 7 +++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> index 9c0cff3a5ed8..60ee0f73071a 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> @@ -27,6 +27,12 @@ on the Qualcomm ADSP Hexagon core.
>  	Value type: <stringlist>
>  	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
>  
> +- firmware-name:
> +	Usage: optional
> +	Value type: <string>
> +	Definition: must list the relative firmware image path for the
> +		    Hexagon Core.

Relative to what? I still think it's a terrible idea that your driver
looks for files at the top-level /lib/firmware/ directory, but now
you're leaking this into the device tree. This should at a bare minimum
be namespaced to something like the qcom/ sub-directory. But ideally,
the driver would automatically be deriving a further sub-directory of
qcom/ based on the chipset or something, and then the only thing you'd
describe here is some kind of variant string -- something akin to
ath10k's qcom,ath10k-calibration-variant (see
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt), which
doesn't require a full path-name or any hierarchy.

Brian

> +
>  - clocks:
>  	Usage: required
>  	Value type: <prop-encoded-array>
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> index 9ff5b0309417..3a99e7379d8c 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
> @@ -36,6 +36,13 @@ on the Qualcomm Hexagon core.
>  	Value type: <stringlist>
>  	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
>  
> +- firmware-name:
> +	Usage: optional
> +	Value type: <stringlist>
> +	Definition: must list the relative firmware image paths for mba and
> +		    modem. They are used for booting and authenticating the
> +		    Hexagon core.
> +
>  - clocks:
>  	Usage: required
>  	Value type: <phandle>
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown
  2018-12-24  8:48 ` [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
@ 2019-01-03 23:33   ` Bjorn Andersson
  2019-01-08 10:14     ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2019-01-03 23:33 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, dianders

On Mon 24 Dec 00:48 PST 2018, Sibi Sankar wrote:

> After sending a sysmon shutdown request to the SSCTL service on the
> subsystem, wait for the service to send shutdown-ack interrupt or
> an indication message to signal the completion of graceful shutdown.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

I prefer something closer to v1, where you kept the handling of the
interrupt within the sysmon driver.

What I didn't like was the fact that you resolved the mss
platform_device to get to the irq, not that you grabbed the irq from the
parent's DT node from within the sysmon device.


You can get the remoteproc's DT node by rproc->dev.parent->of_node and
use of_irq_get_byname() to get an irq number, which you can request in
the sysmon device - which will work regardless of the remoteproc driver
being a platform_driver or something else.

All the logic looks sound, but by shuffling things around we should get
less coupling of the implementation (DT binding looks good).

Regards,
Bjorn

> ---
>  drivers/remoteproc/qcom_sysmon.c | 40 +++++++++++++++++++++++++++++++-
>  1 file changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
> index c0d6ee8de995..0da83638ca99 100644
> --- a/drivers/remoteproc/qcom_sysmon.c
> +++ b/drivers/remoteproc/qcom_sysmon.c
> @@ -36,6 +36,7 @@ struct qcom_sysmon {
>  
>  	struct rpmsg_endpoint *ept;
>  	struct completion comp;
> +	struct completion ind_comp;
>  	struct mutex lock;
>  
>  	bool ssr_ack;
> @@ -139,6 +140,7 @@ static int sysmon_callback(struct rpmsg_device *rpdev, void *data, int count,
>  }
>  
>  #define SSCTL_SHUTDOWN_REQ		0x21
> +#define SSCTL_SHUTDOWN_READY_IND	0x21
>  #define SSCTL_SUBSYS_EVENT_REQ		0x23
>  
>  #define SSCTL_MAX_MSG_LEN		7
> @@ -254,6 +256,29 @@ static struct qmi_elem_info ssctl_subsys_event_resp_ei[] = {
>  	{}
>  };
>  
> +static struct qmi_elem_info ssctl_shutdown_ind_ei[] = {
> +	{}
> +};
> +
> +static void sysmon_ind_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
> +			  struct qmi_txn *txn, const void *data)
> +{
> +	struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, qmi);
> +
> +	complete(&sysmon->ind_comp);
> +}
> +
> +static struct qmi_msg_handler qmi_indication_handler[] = {
> +	{
> +		.type = QMI_INDICATION,
> +		.msg_id = SSCTL_SHUTDOWN_READY_IND,
> +		.ei = ssctl_shutdown_ind_ei,
> +		.decoded_size = 0,
> +		.fn = sysmon_ind_cb
> +	},
> +	{}
> +};
> +
>  /**
>   * ssctl_request_shutdown() - request shutdown via SSCTL QMI service
>   * @sysmon:	sysmon context
> @@ -264,6 +289,7 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
>  	struct qmi_txn txn;
>  	int ret;
>  
> +	reinit_completion(&sysmon->ind_comp);
>  	ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp);
>  	if (ret < 0) {
>  		dev_err(sysmon->dev, "failed to allocate QMI txn\n");
> @@ -285,6 +311,16 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
>  		dev_err(sysmon->dev, "shutdown request failed\n");
>  	else
>  		dev_dbg(sysmon->dev, "shutdown request completed\n");
> +
> +	if (sysmon->q6v5) {
> +		ret = qcom_q6v5_wait_for_shutdown(sysmon->q6v5, 10 * HZ);
> +		if (ret) {
> +			ret = try_wait_for_completion(&sysmon->ind_comp);
> +			if (!ret)
> +				dev_err(sysmon->dev,
> +					"timeout waiting for shutdown ack\n");
> +		}
> +	}
>  }
>  
>  /**
> @@ -462,9 +498,11 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
>  	sysmon->q6v5 = q6v5;
>  
>  	init_completion(&sysmon->comp);
> +	init_completion(&sysmon->ind_comp);
>  	mutex_init(&sysmon->lock);
>  
> -	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, NULL);
> +	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
> +			      qmi_indication_handler);
>  	if (ret < 0) {
>  		dev_err(sysmon->dev, "failed to initialize qmi handle\n");
>  		kfree(sysmon);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings
  2018-12-28  4:48 ` [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
  2019-01-03 23:09   ` Bjorn Andersson
@ 2019-01-03 23:44   ` Brian Norris
  2019-01-08 10:32     ` Sibi Sankar
  1 sibling, 1 reply; 200+ results
From: Brian Norris @ 2019-01-03 23:44 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree

On Fri, Dec 28, 2018 at 10:18:19AM +0530, Sibi Sankar wrote:
> Add support for parsing "firmware-name" dt bindings which specifies
> the relative paths of mba/modem/pas image as strings. Fallback to
> the default paths for mba/modem/pas image on -EINVAL.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 46 +++++++++++++++++++++++-------
>  drivers/remoteproc/qcom_q6v5_pas.c | 11 ++++++-
>  2 files changed, 46 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index 01be7314e176..c75179006e24 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -188,6 +188,7 @@ struct q6v5 {
>  	bool has_alt_reset;
>  	int mpss_perm;
>  	int mba_perm;
> +	const char *hexagon_mdt_image;
>  	int version;
>  };
>  
> @@ -860,17 +861,27 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  	phys_addr_t min_addr = PHYS_ADDR_MAX;
>  	phys_addr_t max_addr = 0;
>  	bool relocate = false;
> -	char seg_name[10];
> +	char *fw_name;
> +	size_t fw_name_len;
>  	ssize_t offset;
>  	size_t size = 0;
>  	void *ptr;
>  	int ret;
>  	int i;
>  
> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
> +	fw_name_len = strlen(qproc->hexagon_mdt_image);
> +	if (fw_name_len <= 4)
> +		return -EINVAL;
> +
> +	fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
> +	if (!fw_name)
> +		return -ENOMEM;
> +
> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
>  	if (ret < 0) {
> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
> -		return ret;
> +		dev_err(qproc->dev, "unable to load %s\n",
> +			qproc->hexagon_mdt_image);
> +		goto out;
>  	}
>  
>  	/* Initialize the RMB validator */
> @@ -918,10 +929,12 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  		ptr = qproc->mpss_region + offset;
>  
>  		if (phdr->p_filesz) {
> -			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
> -			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
> +			snprintf(fw_name + fw_name_len - 3, fw_name_len,
> +				 "b%02d", i);

So, you're assuming that 'fw_name' ends in '.XXX' (for some 3-char value
of 'XXX')? Seems a bit odd. But if you really want this, it feels like
you should enforce this, and either comment on what you're doing or else
use a proper computation that makes it clear (e.g., strlen("bin")).

Brian

> +			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
>  			if (ret) {
> -				dev_err(qproc->dev, "failed to load %s\n", seg_name);
> +				dev_err(qproc->dev, "failed to load %s\n",
> +					fw_name);
>  				goto release_firmware;
>  			}
>  
> @@ -960,6 +973,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  
>  release_firmware:
>  	release_firmware(fw);
> +out:
> +	kfree(fw_name);
>  
>  	return ret < 0 ? ret : 0;
>  }
> @@ -1075,9 +1090,10 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  	unsigned long i;
>  	int ret;
>  
> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
>  	if (ret < 0) {
> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
> +		dev_err(qproc->dev, "unable to load %s\n",
> +			qproc->hexagon_mdt_image);
>  		return ret;
>  	}
>  
> @@ -1253,6 +1269,8 @@ static int q6v5_probe(struct platform_device *pdev)
>  	const struct rproc_hexagon_res *desc;
>  	struct q6v5 *qproc;
>  	struct rproc *rproc;
> +	const char *mba_image;
> +	const char *fw_name[2];
>  	int ret;
>  
>  	desc = of_device_get_match_data(&pdev->dev);
> @@ -1262,8 +1280,15 @@ static int q6v5_probe(struct platform_device *pdev)
>  	if (desc->need_mem_protection && !qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> +	ret = of_property_read_string_array(pdev->dev.of_node, "firmware-name",
> +					    fw_name, 2);
> +	if (ret != -EINVAL && ret != 2)
> +		return ret > 0 ? -EINVAL : ret;
> +
> +	mba_image = (ret != 2) ? desc->hexagon_mba_image : fw_name[0];
> +
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
> -			    desc->hexagon_mba_image, sizeof(*qproc));
> +			    mba_image, sizeof(*qproc));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "failed to allocate rproc\n");
>  		return -ENOMEM;
> @@ -1272,6 +1297,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qproc = (struct q6v5 *)rproc->priv;
>  	qproc->dev = &pdev->dev;
>  	qproc->rproc = rproc;
> +	qproc->hexagon_mdt_image = (ret != 2) ? "modem.mdt" : fw_name[1];
>  	platform_set_drvdata(pdev, qproc);
>  
>  	ret = q6v5_init_mem(qproc, pdev);
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index b1e63fcd5fdf..141c7da29e9a 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -258,6 +258,8 @@ static int adsp_probe(struct platform_device *pdev)
>  	const struct adsp_data *desc;
>  	struct qcom_adsp *adsp;
>  	struct rproc *rproc;
> +	const char *fw_name;
> +	const char *of_fw_name;
>  	int ret;
>  
>  	desc = of_device_get_match_data(&pdev->dev);
> @@ -267,8 +269,15 @@ static int adsp_probe(struct platform_device *pdev)
>  	if (!qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> +	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> +				      &of_fw_name);
> +	if (ret && ret != -EINVAL)
> +		return ret;
> +
> +	fw_name = ret ? desc->firmware_name : of_fw_name;
> +
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
> -			    desc->firmware_name, sizeof(*adsp));
> +			    fw_name, sizeof(*adsp));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
>  		return -ENOMEM;
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown
  2019-01-03 23:33   ` Bjorn Andersson
@ 2019-01-08 10:14     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:14 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, dianders, linux-kernel-owner

Hi Bjorn,
Thanks for the review!

On 2019-01-04 05:03, Bjorn Andersson wrote:
> On Mon 24 Dec 00:48 PST 2018, Sibi Sankar wrote:
> 
>> After sending a sysmon shutdown request to the SSCTL service on the
>> subsystem, wait for the service to send shutdown-ack interrupt or
>> an indication message to signal the completion of graceful shutdown.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> 
> I prefer something closer to v1, where you kept the handling of the
> interrupt within the sysmon driver.
> 
> What I didn't like was the fact that you resolved the mss
> platform_device to get to the irq, not that you grabbed the irq from 
> the
> parent's DT node from within the sysmon device.
> 
> 
> You can get the remoteproc's DT node by rproc->dev.parent->of_node and
> use of_irq_get_byname() to get an irq number, which you can request in
> the sysmon device - which will work regardless of the remoteproc driver
> being a platform_driver or something else.
> 
> All the logic looks sound, but by shuffling things around we should get
> less coupling of the implementation (DT binding looks good).
> 

will make it closer to v1 in the next re-spin

> Regards,
> Bjorn
> 
>> ---
>>  drivers/remoteproc/qcom_sysmon.c | 40 
>> +++++++++++++++++++++++++++++++-
>>  1 file changed, 39 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/remoteproc/qcom_sysmon.c 
>> b/drivers/remoteproc/qcom_sysmon.c
>> index c0d6ee8de995..0da83638ca99 100644
>> --- a/drivers/remoteproc/qcom_sysmon.c
>> +++ b/drivers/remoteproc/qcom_sysmon.c
>> @@ -36,6 +36,7 @@ struct qcom_sysmon {
>> 
>>  	struct rpmsg_endpoint *ept;
>>  	struct completion comp;
>> +	struct completion ind_comp;
>>  	struct mutex lock;
>> 
>>  	bool ssr_ack;
>> @@ -139,6 +140,7 @@ static int sysmon_callback(struct rpmsg_device 
>> *rpdev, void *data, int count,
>>  }
>> 
>>  #define SSCTL_SHUTDOWN_REQ		0x21
>> +#define SSCTL_SHUTDOWN_READY_IND	0x21
>>  #define SSCTL_SUBSYS_EVENT_REQ		0x23
>> 
>>  #define SSCTL_MAX_MSG_LEN		7
>> @@ -254,6 +256,29 @@ static struct qmi_elem_info 
>> ssctl_subsys_event_resp_ei[] = {
>>  	{}
>>  };
>> 
>> +static struct qmi_elem_info ssctl_shutdown_ind_ei[] = {
>> +	{}
>> +};
>> +
>> +static void sysmon_ind_cb(struct qmi_handle *qmi, struct 
>> sockaddr_qrtr *sq,
>> +			  struct qmi_txn *txn, const void *data)
>> +{
>> +	struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, 
>> qmi);
>> +
>> +	complete(&sysmon->ind_comp);
>> +}
>> +
>> +static struct qmi_msg_handler qmi_indication_handler[] = {
>> +	{
>> +		.type = QMI_INDICATION,
>> +		.msg_id = SSCTL_SHUTDOWN_READY_IND,
>> +		.ei = ssctl_shutdown_ind_ei,
>> +		.decoded_size = 0,
>> +		.fn = sysmon_ind_cb
>> +	},
>> +	{}
>> +};
>> +
>>  /**
>>   * ssctl_request_shutdown() - request shutdown via SSCTL QMI service
>>   * @sysmon:	sysmon context
>> @@ -264,6 +289,7 @@ static void ssctl_request_shutdown(struct 
>> qcom_sysmon *sysmon)
>>  	struct qmi_txn txn;
>>  	int ret;
>> 
>> +	reinit_completion(&sysmon->ind_comp);
>>  	ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, 
>> &resp);
>>  	if (ret < 0) {
>>  		dev_err(sysmon->dev, "failed to allocate QMI txn\n");
>> @@ -285,6 +311,16 @@ static void ssctl_request_shutdown(struct 
>> qcom_sysmon *sysmon)
>>  		dev_err(sysmon->dev, "shutdown request failed\n");
>>  	else
>>  		dev_dbg(sysmon->dev, "shutdown request completed\n");
>> +
>> +	if (sysmon->q6v5) {
>> +		ret = qcom_q6v5_wait_for_shutdown(sysmon->q6v5, 10 * HZ);
>> +		if (ret) {
>> +			ret = try_wait_for_completion(&sysmon->ind_comp);
>> +			if (!ret)
>> +				dev_err(sysmon->dev,
>> +					"timeout waiting for shutdown ack\n");
>> +		}
>> +	}
>>  }
>> 
>>  /**
>> @@ -462,9 +498,11 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct 
>> rproc *rproc,
>>  	sysmon->q6v5 = q6v5;
>> 
>>  	init_completion(&sysmon->comp);
>> +	init_completion(&sysmon->ind_comp);
>>  	mutex_init(&sysmon->lock);
>> 
>> -	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, 
>> NULL);
>> +	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
>> +			      qmi_indication_handler);
>>  	if (ret < 0) {
>>  		dev_err(sysmon->dev, "failed to initialize qmi handle\n");
>>  		kfree(sysmon);
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v3 1/3] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5
@ 2019-01-08 10:23 Sibi Sankar
  2019-01-08 10:23 ` [PATCH v3 2/3] remoteproc: qcom: Add shutdown-ack irq Sibi Sankar
  2019-01-08 10:23 ` [PATCH v3 3/3] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
  0 siblings, 2 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:23 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, dianders, Sibi Sankar

Introduce shutdown-irq binding required for sysmon shutdown for Q6V5 MSS
on SDM845/MSM8996 SoCs and for WCSS Q6V5 on QCS404 SoC.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v2:
  * Make shutdown-ack mandatory for MSS on SDM845/MSM8996 and
    for WCSS on QCS404 (Dropping Rob's reviewed-by due to this)

 .../bindings/remoteproc/qcom,adsp.txt           | 17 ++++++++++++++---
 .../bindings/remoteproc/qcom,q6v5.txt           | 15 ++++++++++++---
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
index 60ee0f73071a..292dfda9770d 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
@@ -19,13 +19,24 @@ on the Qualcomm ADSP Hexagon core.
 - interrupts-extended:
 	Usage: required
 	Value type: <prop-encoded-array>
-	Definition: must list the watchdog, fatal IRQs ready, handover and
-		    stop-ack IRQs
+	Definition: reference to the interrupts that match interrupt-names
 
 - interrupt-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	Definition: The interrupts needed depends on the compatible
+		    string:
+	qcom,msm8974-adsp-pil:
+	qcom,msm8996-adsp-pil:
+	qcom,msm8996-slpi-pil:
+	qcom,qcs404-adsp-pas:
+	qcom,qcs404-cdsp-pas:
+	qcom,sdm845-adsp-pas:
+	qcom,sdm845-cdsp-pas:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	qcom,qcs404-wcss-pas:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack",
+		    "shutdown-ack"
 
 - firmware-name:
 	Usage: optional
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
index 401e49ebee39..41ca5df5be5a 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
@@ -28,13 +28,22 @@ on the Qualcomm Hexagon core.
 - interrupts-extended:
 	Usage: required
 	Value type: <prop-encoded-array>
-	Definition: must list the watchdog, fatal IRQs ready, handover and
-		    stop-ack IRQs
+	Definition: reference to the interrupts that match interrupt-names
 
 - interrupt-names:
 	Usage: required
 	Value type: <stringlist>
-	Definition: must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	Definition: The interrupts needed depends on the the compatible
+		    string:
+	qcom,q6v5-pil:
+	qcom,ipq8074-wcss-pil:
+	qcom,msm8916-mss-pil:
+	qcom,msm8974-mss-pil:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack"
+	qcom,msm8996-mss-pil:
+	qcom,sdm845-mss-pil:
+		    must be "wdog", "fatal", "ready", "handover", "stop-ack",
+		    "shutdown-ack"
 
 - firmware-name:
 	Usage: optional
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* [PATCH v3 2/3] remoteproc: qcom: Add shutdown-ack irq
  2019-01-08 10:23 [PATCH v3 1/3] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
@ 2019-01-08 10:23 ` Sibi Sankar
  2019-01-08 10:23 ` [PATCH v3 3/3] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
  1 sibling, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:23 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, dianders, Sibi Sankar

Add shutdown-ack irq handling required for sysmon shutdown for
Q6V5 MSS on SDM845/MSM8996 and for WCSS Q6V5 on QCS404 SoC.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v3:
   * Move shutdown-irq handling back to sysmon and
     modify qcom_add_sysmon_subdev to handle -EPROBE_DEFER
   * Dropped has_shutdown_irq flag

v2:
   * Move shutdown-irq get to Q6V5 from sysmon to handle
     -EPROBE_DEFER cases

 drivers/remoteproc/qcom_common.h    | 16 +++++----
 drivers/remoteproc/qcom_q6v5_adsp.c |  9 +++--
 drivers/remoteproc/qcom_q6v5_mss.c  |  4 ++-
 drivers/remoteproc/qcom_q6v5_pas.c  |  9 +++--
 drivers/remoteproc/qcom_sysmon.c    | 52 +++++++++++++++++++++++++----
 drivers/remoteproc/qcom_wcnss.c     |  5 ++-
 6 files changed, 73 insertions(+), 22 deletions(-)

diff --git a/drivers/remoteproc/qcom_common.h b/drivers/remoteproc/qcom_common.h
index 58de71e4781c..afea598fdc9d 100644
--- a/drivers/remoteproc/qcom_common.h
+++ b/drivers/remoteproc/qcom_common.h
@@ -43,16 +43,18 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
 void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr);
 
 #if IS_ENABLED(CONFIG_QCOM_SYSMON)
-struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
-					   const char *name,
-					   int ssctl_instance);
+int qcom_add_sysmon_subdev(struct rproc *rproc,
+			   struct qcom_sysmon *rproc_sysmon,
+			   const char *name,
+			   int ssctl_instance);
 void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon);
 #else
-static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
-							 const char *name,
-							 int ssctl_instance)
+static inline int qcom_add_sysmon_subdev(struct rproc *rproc,
+					 struct qcom_sysmon *rproc_sysmon,
+					 const char *name,
+					 int ssctl_instance)
 {
-	return NULL;
+	return 0;
 }
 
 static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon)
diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 79374d1de311..e1db2c7a08bd 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -436,9 +436,12 @@ static int adsp_probe(struct platform_device *pdev)
 
 	qcom_add_glink_subdev(rproc, &adsp->glink_subdev);
 	qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name);
-	adsp->sysmon = qcom_add_sysmon_subdev(rproc,
-					      desc->sysmon_name,
-					      desc->ssctl_id);
+	ret = qcom_add_sysmon_subdev(rproc,
+				     adsp->sysmon,
+				     desc->sysmon_name,
+				     desc->ssctl_id);
+	if (ret)
+		goto disable_pm;
 
 	ret = rproc_add(rproc);
 	if (ret)
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c86dc40cfb8c..7a256fdb2f64 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1340,7 +1340,9 @@ static int q6v5_probe(struct platform_device *pdev)
 	qcom_add_glink_subdev(rproc, &qproc->glink_subdev);
 	qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
 	qcom_add_ssr_subdev(rproc, &qproc->ssr_subdev, "mpss");
-	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
+	ret = qcom_add_sysmon_subdev(rproc, qproc->sysmon, "modem", 0x12);
+	if (ret)
+		goto free_rproc;
 
 	ret = rproc_add(rproc);
 	if (ret)
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index b1e63fcd5fdf..942804b5fafa 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -301,9 +301,12 @@ static int adsp_probe(struct platform_device *pdev)
 	qcom_add_glink_subdev(rproc, &adsp->glink_subdev);
 	qcom_add_smd_subdev(rproc, &adsp->smd_subdev);
 	qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name);
-	adsp->sysmon = qcom_add_sysmon_subdev(rproc,
-					      desc->sysmon_name,
-					      desc->ssctl_id);
+	ret = qcom_add_sysmon_subdev(rproc,
+				     adsp->sysmon,
+				     desc->sysmon_name,
+				     desc->ssctl_id);
+	if (ret)
+		goto free_rproc;
 
 	ret = rproc_add(rproc);
 	if (ret)
diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
index e976a602b015..b17727dfc271 100644
--- a/drivers/remoteproc/qcom_sysmon.c
+++ b/drivers/remoteproc/qcom_sysmon.c
@@ -6,8 +6,10 @@
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/slab.h>
+#include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/notifier.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/remoteproc/qcom_rproc.h>
@@ -25,6 +27,7 @@ struct qcom_sysmon {
 
 	const char *name;
 
+	int shutdown_irq;
 	int ssctl_version;
 	int ssctl_instance;
 
@@ -34,6 +37,7 @@ struct qcom_sysmon {
 
 	struct rpmsg_endpoint *ept;
 	struct completion comp;
+	struct completion shutdown_comp;
 	struct mutex lock;
 
 	bool ssr_ack;
@@ -432,24 +436,35 @@ static int sysmon_notify(struct notifier_block *nb, unsigned long event,
 	return NOTIFY_DONE;
 }
 
+static irqreturn_t sysmon_shutdown_interrupt(int irq, void *data)
+{
+	struct qcom_sysmon *sysmon = data;
+
+	complete(&sysmon->shutdown_comp);
+
+	return IRQ_HANDLED;
+}
+
 /**
  * qcom_add_sysmon_subdev() - create a sysmon subdev for the given remoteproc
  * @rproc:	rproc context to associate the subdev with
+ * @rproc_sysmon: update sysmon context with a new qcom_sysmon object
  * @name:	name of this subdev, to use in SSR
  * @ssctl_instance: instance id of the ssctl QMI service
  *
- * Return: A new qcom_sysmon object, or NULL on failure
+ * Return: 0 on success, negative errno on failure
  */
-struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
-					   const char *name,
-					   int ssctl_instance)
+int qcom_add_sysmon_subdev(struct rproc *rproc,
+			   struct qcom_sysmon *rproc_sysmon,
+			   const char *name,
+			   int ssctl_instance)
 {
 	struct qcom_sysmon *sysmon;
 	int ret;
 
 	sysmon = kzalloc(sizeof(*sysmon), GFP_KERNEL);
 	if (!sysmon)
-		return NULL;
+		return -ENOMEM;
 
 	sysmon->dev = rproc->dev.parent;
 	sysmon->rproc = rproc;
@@ -458,13 +473,35 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 	sysmon->ssctl_instance = ssctl_instance;
 
 	init_completion(&sysmon->comp);
+	init_completion(&sysmon->shutdown_comp);
 	mutex_init(&sysmon->lock);
 
+	sysmon->shutdown_irq = of_irq_get_byname(sysmon->dev->of_node,
+						 "shutdown-ack");
+	if (sysmon->shutdown_irq < 0) {
+		if (sysmon->shutdown_irq != -ENODATA) {
+			dev_err(sysmon->dev,
+				"failed to retrieve shutdown-ack IRQ\n");
+			return sysmon->shutdown_irq;
+		}
+	} else {
+		ret = devm_request_threaded_irq(sysmon->dev,
+						sysmon->shutdown_irq,
+						NULL, sysmon_shutdown_interrupt,
+						IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+						"q6v5 shutdown-ack", sysmon);
+		if (ret) {
+			dev_err(sysmon->dev,
+				"failed to acquire shutdown-ack IRQ\n");
+			return ret;
+		}
+	}
+
 	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, NULL);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to initialize qmi handle\n");
 		kfree(sysmon);
-		return NULL;
+		return ret;
 	}
 
 	qmi_add_lookup(&sysmon->qmi, 43, 0, 0);
@@ -480,8 +517,9 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
 	mutex_lock(&sysmon_lock);
 	list_add(&sysmon->node, &sysmon_list);
 	mutex_unlock(&sysmon_lock);
+	rproc_sysmon = sysmon;
 
-	return sysmon;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(qcom_add_sysmon_subdev);
 
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index 1152da49a18a..920e85202c5e 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -552,7 +552,10 @@ static int wcnss_probe(struct platform_device *pdev)
 	}
 
 	qcom_add_smd_subdev(rproc, &wcnss->smd_subdev);
-	wcnss->sysmon = qcom_add_sysmon_subdev(rproc, "wcnss", WCNSS_SSCTL_ID);
+	ret = qcom_add_sysmon_subdev(rproc, wcnss->sysmon,
+				     "wcnss", WCNSS_SSCTL_ID);
+	if (ret)
+		goto free_rproc;
 
 	ret = rproc_add(rproc);
 	if (ret)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 16%]

* [PATCH v3 3/3] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown
  2019-01-08 10:23 [PATCH v3 1/3] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
  2019-01-08 10:23 ` [PATCH v3 2/3] remoteproc: qcom: Add shutdown-ack irq Sibi Sankar
@ 2019-01-08 10:23 ` Sibi Sankar
  1 sibling, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:23 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: robh+dt, andy.gross, david.brown, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, tsoni, clew, akdwived, ohad,
	mark.rutland, linux-remoteproc, dianders, Sibi Sankar

After sending a sysmon shutdown request to the SSCTL service on the
subsystem, wait for the service to send shutdown-ack interrupt or
an indication message to signal the completion of graceful shutdown.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v2:
   * Correct the shutdown-irq wait time to 10 * HZ

 drivers/remoteproc/qcom_sysmon.c | 42 +++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
index b17727dfc271..19b732e1427d 100644
--- a/drivers/remoteproc/qcom_sysmon.c
+++ b/drivers/remoteproc/qcom_sysmon.c
@@ -37,6 +37,7 @@ struct qcom_sysmon {
 
 	struct rpmsg_endpoint *ept;
 	struct completion comp;
+	struct completion ind_comp;
 	struct completion shutdown_comp;
 	struct mutex lock;
 
@@ -141,6 +142,7 @@ static int sysmon_callback(struct rpmsg_device *rpdev, void *data, int count,
 }
 
 #define SSCTL_SHUTDOWN_REQ		0x21
+#define SSCTL_SHUTDOWN_READY_IND	0x21
 #define SSCTL_SUBSYS_EVENT_REQ		0x23
 
 #define SSCTL_MAX_MSG_LEN		7
@@ -256,6 +258,29 @@ static struct qmi_elem_info ssctl_subsys_event_resp_ei[] = {
 	{}
 };
 
+static struct qmi_elem_info ssctl_shutdown_ind_ei[] = {
+	{}
+};
+
+static void sysmon_ind_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
+			  struct qmi_txn *txn, const void *data)
+{
+	struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, qmi);
+
+	complete(&sysmon->ind_comp);
+}
+
+static struct qmi_msg_handler qmi_indication_handler[] = {
+	{
+		.type = QMI_INDICATION,
+		.msg_id = SSCTL_SHUTDOWN_READY_IND,
+		.ei = ssctl_shutdown_ind_ei,
+		.decoded_size = 0,
+		.fn = sysmon_ind_cb
+	},
+	{}
+};
+
 /**
  * ssctl_request_shutdown() - request shutdown via SSCTL QMI service
  * @sysmon:	sysmon context
@@ -266,6 +291,8 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
 	struct qmi_txn txn;
 	int ret;
 
+	reinit_completion(&sysmon->ind_comp);
+	reinit_completion(&sysmon->shutdown_comp);
 	ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to allocate QMI txn\n");
@@ -287,6 +314,17 @@ static void ssctl_request_shutdown(struct qcom_sysmon *sysmon)
 		dev_err(sysmon->dev, "shutdown request failed\n");
 	else
 		dev_dbg(sysmon->dev, "shutdown request completed\n");
+
+	if (sysmon->shutdown_irq > 0) {
+		ret = wait_for_completion_timeout(&sysmon->shutdown_comp,
+						  10 * HZ);
+		if (!ret) {
+			ret = try_wait_for_completion(&sysmon->ind_comp);
+			if (!ret)
+				dev_err(sysmon->dev,
+					"timeout waiting for shutdown ack\n");
+		}
+	}
 }
 
 /**
@@ -473,6 +511,7 @@ int qcom_add_sysmon_subdev(struct rproc *rproc,
 	sysmon->ssctl_instance = ssctl_instance;
 
 	init_completion(&sysmon->comp);
+	init_completion(&sysmon->ind_comp);
 	init_completion(&sysmon->shutdown_comp);
 	mutex_init(&sysmon->lock);
 
@@ -497,7 +536,8 @@ int qcom_add_sysmon_subdev(struct rproc *rproc,
 		}
 	}
 
-	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, NULL);
+	ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops,
+			      qmi_indication_handler);
 	if (ret < 0) {
 		dev_err(sysmon->dev, "failed to initialize qmi handle\n");
 		kfree(sysmon);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* Re: [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM
  2019-01-03 20:17 ` [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Bjorn Andersson
@ 2019-01-08 10:26   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:26 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: robh+dt, andy.gross, david.brown, dianders, linux-arm-msm,
	linux-soc, devicetree, linux-kernel, tsoni, clew, akdwived,
	mark.rutland, linux-remoteproc, evgreen, briannorris, sricharan,
	linux-remoteproc-owner

Hi Bjorn,
Thanks for the review!

On 2019-01-04 01:47, Bjorn Andersson wrote:
> On Fri 28 Dec 10:53 PST 2018, Sibi Sankar wrote:
> 
>> Add missing qcom,remote-pid dt binding required for GLINK SMEM
>> which specifies the remote endpoint of the GLINK edge.
>> 
>> Fixes: 2b41d6c8e696 ("dt-bindings: soc: qcom: Extend GLINK to cover
>> SMEM")
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> Reviewed-by: Doug Anderson <dianders@chromium.org>
>> Reviewed-by: Rob Herring <robh@kernel.org>
> 
> Thanks for the updates Sibi!
> 
> @Andy, as this relates to rpmsg I'll take this (patch 1/8) through the
> rpmsg tree.
> 
> And I'm picking 2-7 through the remoteproc tree.
> 
> 
> PS. Please use a --cover-letter when sending a series of patches.

sure will do... this was never meant to be a
series (started of as a single patch) :P

> 
> Regards,
> Bjorn
> 
>> ---
>> 
>> v3:
>>   * Fixed typo
>> 
>>  Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt 
>> b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
>> index 0b8cc533ca83..587bb1ddc8cc 100644
>> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
>> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt
>> @@ -21,6 +21,11 @@ edge.
>>  	Definition: should specify the IRQ used by the remote processor to
>>  		    signal this processor about communication related events
>> 
>> +- qcom,remote-pid:
>> +	Usage: required for glink-smem
>> +	Value type: <u32>
>> +	Definition: specifies the identifier of the remote endpoint of this 
>> edge
>> +
>>  - qcom,rpm-msg-ram:
>>  	Usage: required for glink-rpm
>>  	Value type: <prop-encoded-array>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings
  2019-01-03 23:44   ` Brian Norris
@ 2019-01-08 10:32     ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:32 UTC (permalink / raw)
  To: Brian Norris
  Cc: bjorn.andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree

Hi Brian,
Thanks for the review!

On 2019-01-04 05:14, Brian Norris wrote:
> On Fri, Dec 28, 2018 at 10:18:19AM +0530, Sibi Sankar wrote:
>> Add support for parsing "firmware-name" dt bindings which specifies
>> the relative paths of mba/modem/pas image as strings. Fallback to
>> the default paths for mba/modem/pas image on -EINVAL.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  drivers/remoteproc/qcom_q6v5_mss.c | 46 
>> +++++++++++++++++++++++-------
>>  drivers/remoteproc/qcom_q6v5_pas.c | 11 ++++++-
>>  2 files changed, 46 insertions(+), 11 deletions(-)
>> 
>> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c 
>> b/drivers/remoteproc/qcom_q6v5_mss.c
>> index 01be7314e176..c75179006e24 100644
>> --- a/drivers/remoteproc/qcom_q6v5_mss.c
>> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
>> @@ -188,6 +188,7 @@ struct q6v5 {
>>  	bool has_alt_reset;
>>  	int mpss_perm;
>>  	int mba_perm;
>> +	const char *hexagon_mdt_image;
>>  	int version;
>>  };
>> 
>> @@ -860,17 +861,27 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>>  	phys_addr_t min_addr = PHYS_ADDR_MAX;
>>  	phys_addr_t max_addr = 0;
>>  	bool relocate = false;
>> -	char seg_name[10];
>> +	char *fw_name;
>> +	size_t fw_name_len;
>>  	ssize_t offset;
>>  	size_t size = 0;
>>  	void *ptr;
>>  	int ret;
>>  	int i;
>> 
>> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
>> +	fw_name_len = strlen(qproc->hexagon_mdt_image);
>> +	if (fw_name_len <= 4)
>> +		return -EINVAL;
>> +
>> +	fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
>> +	if (!fw_name)
>> +		return -ENOMEM;
>> +
>> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
>>  	if (ret < 0) {
>> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
>> -		return ret;
>> +		dev_err(qproc->dev, "unable to load %s\n",
>> +			qproc->hexagon_mdt_image);
>> +		goto out;
>>  	}
>> 
>>  	/* Initialize the RMB validator */
>> @@ -918,10 +929,12 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>>  		ptr = qproc->mpss_region + offset;
>> 
>>  		if (phdr->p_filesz) {
>> -			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
>> -			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
>> +			snprintf(fw_name + fw_name_len - 3, fw_name_len,
>> +				 "b%02d", i);
> 
> So, you're assuming that 'fw_name' ends in '.XXX' (for some 3-char 
> value
> of 'XXX')? Seems a bit odd. But if you really want this, it feels like
> you should enforce this, and either comment on what you're doing or 
> else
> use a proper computation that makes it clear (e.g., strlen("bin")).
> 
> Brian

we want to construct the names of the fw blobs
incrementally i.e xxx.xxx to xxx.bxx. Given
that we restrict the fw_name_len to be greater
than 4 at the beginning, I'll probably do
something like this.

/* Replace "xxx.xxx" with "xxx.bxx" */
sprintf(fw_name + fw_name_len - 3, "b%02d", i);

> 
>> +			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
>>  			if (ret) {
>> -				dev_err(qproc->dev, "failed to load %s\n", seg_name);
>> +				dev_err(qproc->dev, "failed to load %s\n",
>> +					fw_name);
>>  				goto release_firmware;
>>  			}
>> 
>> @@ -960,6 +973,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>> 
>>  release_firmware:
>>  	release_firmware(fw);
>> +out:
>> +	kfree(fw_name);
>> 
>>  	return ret < 0 ? ret : 0;
>>  }
>> @@ -1075,9 +1090,10 @@ static int 
>> qcom_q6v5_register_dump_segments(struct rproc *rproc,
>>  	unsigned long i;
>>  	int ret;
>> 
>> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
>> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
>>  	if (ret < 0) {
>> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
>> +		dev_err(qproc->dev, "unable to load %s\n",
>> +			qproc->hexagon_mdt_image);
>>  		return ret;
>>  	}
>> 
>> @@ -1253,6 +1269,8 @@ static int q6v5_probe(struct platform_device 
>> *pdev)
>>  	const struct rproc_hexagon_res *desc;
>>  	struct q6v5 *qproc;
>>  	struct rproc *rproc;
>> +	const char *mba_image;
>> +	const char *fw_name[2];
>>  	int ret;
>> 
>>  	desc = of_device_get_match_data(&pdev->dev);
>> @@ -1262,8 +1280,15 @@ static int q6v5_probe(struct platform_device 
>> *pdev)
>>  	if (desc->need_mem_protection && !qcom_scm_is_available())
>>  		return -EPROBE_DEFER;
>> 
>> +	ret = of_property_read_string_array(pdev->dev.of_node, 
>> "firmware-name",
>> +					    fw_name, 2);
>> +	if (ret != -EINVAL && ret != 2)
>> +		return ret > 0 ? -EINVAL : ret;
>> +
>> +	mba_image = (ret != 2) ? desc->hexagon_mba_image : fw_name[0];
>> +
>>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
>> -			    desc->hexagon_mba_image, sizeof(*qproc));
>> +			    mba_image, sizeof(*qproc));
>>  	if (!rproc) {
>>  		dev_err(&pdev->dev, "failed to allocate rproc\n");
>>  		return -ENOMEM;
>> @@ -1272,6 +1297,7 @@ static int q6v5_probe(struct platform_device 
>> *pdev)
>>  	qproc = (struct q6v5 *)rproc->priv;
>>  	qproc->dev = &pdev->dev;
>>  	qproc->rproc = rproc;
>> +	qproc->hexagon_mdt_image = (ret != 2) ? "modem.mdt" : fw_name[1];
>>  	platform_set_drvdata(pdev, qproc);
>> 
>>  	ret = q6v5_init_mem(qproc, pdev);
>> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c 
>> b/drivers/remoteproc/qcom_q6v5_pas.c
>> index b1e63fcd5fdf..141c7da29e9a 100644
>> --- a/drivers/remoteproc/qcom_q6v5_pas.c
>> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
>> @@ -258,6 +258,8 @@ static int adsp_probe(struct platform_device 
>> *pdev)
>>  	const struct adsp_data *desc;
>>  	struct qcom_adsp *adsp;
>>  	struct rproc *rproc;
>> +	const char *fw_name;
>> +	const char *of_fw_name;
>>  	int ret;
>> 
>>  	desc = of_device_get_match_data(&pdev->dev);
>> @@ -267,8 +269,15 @@ static int adsp_probe(struct platform_device 
>> *pdev)
>>  	if (!qcom_scm_is_available())
>>  		return -EPROBE_DEFER;
>> 
>> +	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
>> +				      &of_fw_name);
>> +	if (ret && ret != -EINVAL)
>> +		return ret;
>> +
>> +	fw_name = ret ? desc->firmware_name : of_fw_name;
>> +
>>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
>> -			    desc->firmware_name, sizeof(*adsp));
>> +			    fw_name, sizeof(*adsp));
>>  	if (!rproc) {
>>  		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
>>  		return -ENOMEM;
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5
      [irrelevant]           ` <20190105015430.GA67838@google.com>
@ 2019-01-08 10:50             ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-08 10:50 UTC (permalink / raw)
  To: Brian Norris
  Cc: Bjorn Andersson, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree, linux-remoteproc-owner

Hi Brian/Bjorn,
Thanks for the review!

On 2019-01-05 07:24, Brian Norris wrote:
> Hi again,
> 
> On Thu, Jan 03, 2019 at 04:11:58PM -0800, Brian Norris wrote:
>> On Thu, Jan 03, 2019 at 04:01:45PM -0800, Bjorn Andersson wrote:
>> > I share your concern about this, but I came to suggest this as the
>> > driver cares about platforms but the firmware is (often?)
>> > device/product-specific.
>> >
>> > E.g. we will serve the MTP and Pixel 3 with the qcom,sdm845-adsp-pas
>> > compatible, but they are unlikely to run the same adsp firmware. This
>> > allows the individual dtb to specify which firmware the driver should
>> > use.
>> 
>> I understand this, but that still doesn't mean we should be suggesting
>> each DTB to clutter the top-level firmware search path, especially 
>> since
>> lazy people will probably just use "modem.mdt" and similar. That means
>> you no longer can ship the same rootfs that supports both QCOM and
>> <other> modems, if <other> modem also uses the same lazy format.
>> 
>> It seems like a much better practice to at least enforce a particular
>> prefix to things. e.g., the driver could assume:
>> 
>>   qcom/sdm845-adsp-pas/ (or if you must, just qcom/)
>> 
>> and your DTB only gets to add .../<your-string-here> to that path.
>> 
>> In case it isn't clear: I think it's also severely misguided that the
>> existing driver gets away with lines like
>> 
>> 	request_firmware(&fw, "modem.mdt", ...);
>> 
>> today ;)
> 
> To add to my thoughts, since I think maybe Sibi was a little unclear of
> my thoughts:
> 
> One of my primary concerns with the existing approach is that it's
> basically a complete free-for-all. We should have some minimal 
> standards
> (enforced in code) such that our DTB can never point us at something
> like /lib/firmware/<other-vendor>/foo.bin (or /lib/firmware/modem.mdt;
> or lots of other bad examples). This could probably be done simply by
> always prefixing 'qcom/' (I don't remember -- does request_firmware()
> follow '..'? e.g., 'firmware-name = "../bar/foo.bin"'.)
> 
> As a bonus: it would be very nice if we can provide a little more
> structure by default, and avoid arbitrary hierarchy in the DTS. That's
> where I brought up ath10k's "variant" as an example; if we can use
> 'compatible' to capture most of this particular Hexagon core's
> properties, then we only leave a single level of variability to the 
> DTS.
> 
> But I might be off-base with the "bonus" paragraph. So I'd also be
> somewhat happy with something much less ambitious, like just a built-in
> prefix ('qcom/').
> 
> And you can also just ignore my thoughts entirely (and I'll be even 
> less
> happy), since Rob did already provide his Reviewed-by ;) I mostly 
> wanted
> to give food for thought, in the hopes that something in here would 
> help
> improve this a bit.

Bjorn,
let me know how you want it implemented.
I am okay with either of the following:
* (variant tag based solution)
or
* (simply going ahead with what we have now).

> 
> Regards,
> Brian

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v2 4/7] remoteproc: q6v5-mss: Vote for rpmh power domains
      [irrelevant] ` <20190106080915.4493-5-bjorn.andersson@linaro.org>
@ 2019-01-09 14:39   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-09 14:39 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland, Russell King,
	Ulf Hansson, Arun Kumar Neelakantam, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, linux-kernel-owner

Hi Bjorn,
With the changes suggested below:

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sibi Sankar <sibis@codeaurora.org>

On 2019-01-06 13:39, Bjorn Andersson wrote:
> From: Rajendra Nayak <rnayak@codeaurora.org>
> 
> With rpmh ARC resources being modelled as power domains with 
> performance
> state, we need to proxy vote on these for SDM845.
> Add support to vote on multiple of them, now that genpd supports
> associating mutliple power domains to a device.
> 
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> [bjorn: Drop device link, improve error handling, name things "proxy"]
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> This is v3 of this patch, but updated to cover "loadstate". v2 can be
> found here:
> https://lore.kernel.org/lkml/20180904071046.8152-1-rnayak@codeaurora.org/
> 
> Changes since v2:
> - Drop device links, as we can do active and proxy votes using device 
> links
> - Improved error handling, by unrolling some votes on failure
> - Rename things proxy, to follow naming of "proxy" and "active"
> 
>  drivers/remoteproc/qcom_q6v5_mss.c | 115 ++++++++++++++++++++++++++++-
>  1 file changed, 111 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c
> b/drivers/remoteproc/qcom_q6v5_mss.c
> index 01be7314e176..62cf16ddb7af 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -25,6 +25,8 @@
>  #include <linux/of_address.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/remoteproc.h>
> @@ -131,6 +133,7 @@ struct rproc_hexagon_res {
>  	char **proxy_clk_names;
>  	char **reset_clk_names;
>  	char **active_clk_names;
> +	char **proxy_pd_names;
>  	int version;
>  	bool need_mem_protection;
>  	bool has_alt_reset;
> @@ -156,9 +159,11 @@ struct q6v5 {
>  	struct clk *active_clks[8];
>  	struct clk *reset_clks[4];
>  	struct clk *proxy_clks[4];
> +	struct device *proxy_pds[3];
>  	int active_clk_count;
>  	int reset_clk_count;
>  	int proxy_clk_count;
> +	int proxy_pd_count;
> 
>  	struct reg_info active_regs[1];
>  	struct reg_info proxy_regs[3];
> @@ -321,6 +326,41 @@ static void q6v5_clk_disable(struct device *dev,
>  		clk_disable_unprepare(clks[i]);
>  }
> 
> +static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds,
> +			   size_t pd_count)
> +{
> +	int ret;
> +	int i;
> +
> +	for (i = 0; i < pd_count; i++) {
> +		dev_pm_genpd_set_performance_state(pds[i], INT_MAX);
> +		ret = pm_runtime_get_sync(pds[i]);
> +		if (ret < 0)
> +			goto unroll_pd_votes;
> +	}
> +
> +	return 0;
> +
> +unroll_pd_votes:
> +	for (i--; i >= 0; i--) {
> +		dev_pm_genpd_set_performance_state(pds[i], 0);
> +		pm_runtime_put(pds[i]);
> +	}
> +
> +	return ret;
> +};
> +
> +static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
> +			     size_t pd_count)
> +{
> +	int i;
> +
> +	for (i = 0; i < pd_count; i++) {
> +		dev_pm_genpd_set_performance_state(pds[i], 0);
> +		pm_runtime_put(pds[i]);
> +	}
> +}
> +
>  static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int 
> *current_perm,
>  				   bool remote_owner, phys_addr_t addr,
>  				   size_t size)
> @@ -690,11 +730,17 @@ static int q6v5_mba_load(struct q6v5 *qproc)
> 
>  	qcom_q6v5_prepare(&qproc->q6v5);
> 
> +	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, 
> qproc->proxy_pd_count);
> +	if (ret < 0) {
> +		dev_err(qproc->dev, "failed to enable proxy power domains\n");
> +		goto disable_irqs;
> +	}
> +
>  	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
>  				    qproc->proxy_reg_count);
>  	if (ret) {
>  		dev_err(qproc->dev, "failed to enable proxy supplies\n");
> -		goto disable_irqs;
> +		goto disable_proxy_pds;
>  	}
> 
>  	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
> @@ -791,6 +837,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  disable_proxy_reg:
>  	q6v5_regulator_disable(qproc, qproc->proxy_regs,
>  			       qproc->proxy_reg_count);
> +disable_proxy_pds:
> +	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  disable_irqs:
>  	qcom_q6v5_unprepare(&qproc->q6v5);
> 
> @@ -1121,6 +1169,7 @@ static void qcom_msa_handover(struct qcom_q6v5 
> *q6v5)
>  			 qproc->proxy_clk_count);
>  	q6v5_regulator_disable(qproc, qproc->proxy_regs,
>  			       qproc->proxy_reg_count);
> +	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);

we should call proxy pds_disable on mba_reclaim
as well:

ret = qcom_q6v5_unprepare(&qproc->q6v5);
if (ret) {
   ...
   q6v5_pds_disable(...);
}

>  }
> 
>  static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device 
> *pdev)
> @@ -1181,6 +1230,45 @@ static int q6v5_init_clocks(struct device *dev,
> struct clk **clks,
>  	return i;
>  }
> 
> +static int q6v5_pds_attach(struct device *dev, struct device **devs,
> +			   char **pd_names)
> +{
> +	size_t num_pds = 0;
> +	int ret;
> +	int i;
> +
> +	if (!pd_names)
> +		return 0;
> +
> +	while (pd_names[num_pds])
> +		num_pds++;
> +
> +	for (i = 0; i < num_pds; i++) {
> +		devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
> +		if (IS_ERR(devs[i])) {
> +			ret = PTR_ERR(devs[i]);
> +			goto unroll_attach;
> +		}
> +	}
> +
> +	return num_pds;
> +
> +unroll_attach:
> +	for (i--; i >= 0; i--)
> +		dev_pm_domain_detach(devs[i], false);
> +
> +	return ret;
> +};
> +
> +static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
> +			    size_t pd_count)
> +{
> +	int i;
> +
> +	for (i = 0; i < pd_count; i++)
> +		dev_pm_domain_detach(pds[i], false);
> +}
> +
>  static int q6v5_init_reset(struct q6v5 *qproc)
>  {
>  	qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev,
> @@ -1322,10 +1410,18 @@ static int q6v5_probe(struct platform_device 
> *pdev)
>  	}
>  	qproc->active_reg_count = ret;
> 
> +	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
> +			      desc->proxy_pd_names);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Failed to init power domains\n");

Should be "Failed to attach proxy power domains"

> +		goto free_rproc;
> +	}
> +	qproc->proxy_pd_count = ret;
> +
>  	qproc->has_alt_reset = desc->has_alt_reset;
>  	ret = q6v5_init_reset(qproc);
>  	if (ret)
> -		goto free_rproc;
> +		goto detach_proxy_pds;
> 
>  	qproc->version = desc->version;
>  	qproc->need_mem_protection = desc->need_mem_protection;
> @@ -1333,7 +1429,7 @@ static int q6v5_probe(struct platform_device 
> *pdev)
>  	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, 
> MPSS_CRASH_REASON_SMEM,
>  			     qcom_msa_handover);
>  	if (ret)
> -		goto free_rproc;
> +		goto detach_proxy_pds;
> 
>  	qproc->mpss_perm = BIT(QCOM_SCM_VMID_HLOS);
>  	qproc->mba_perm = BIT(QCOM_SCM_VMID_HLOS);
> @@ -1344,10 +1440,12 @@ static int q6v5_probe(struct platform_device 
> *pdev)
> 
>  	ret = rproc_add(rproc);
>  	if (ret)
> -		goto free_rproc;
> +		goto detach_proxy_pds;
> 
>  	return 0;
> 
> +detach_proxy_pds:
> +	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  free_rproc:
>  	rproc_free(rproc);
> 
> @@ -1364,6 +1462,9 @@ static int q6v5_remove(struct platform_device 
> *pdev)
>  	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
>  	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
>  	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
> +
> +	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +
>  	rproc_free(qproc->rproc);
> 
>  	return 0;
> @@ -1388,6 +1489,12 @@ static const struct rproc_hexagon_res sdm845_mss 
> = {
>  			"mnoc_axi",
>  			NULL
>  	},
> +	.proxy_pd_names = (char*[]){
> +			"cx",
> +			"mx",
> +			"mss",
> +			NULL
> +	},
>  	.need_mem_protection = true,
>  	.has_alt_reset = true,
>  	.version = MSS_SDM845,

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 15%]

* Re: [PATCH v2 5/7] remoteproc: q6v5-mss: Active powerdomain for SDM845
      [irrelevant] ` <20190106080915.4493-6-bjorn.andersson@linaro.org>
@ 2019-01-09 14:40   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-09 14:40 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland, Russell King,
	Ulf Hansson, Arun Kumar Neelakantam, linux-arm-msm, linux-soc,
	devicetree, linux-kernel, linux-kernel-owner

On 2019-01-06 13:39, Bjorn Andersson wrote:
> The SDM845 MSS needs the load_state powerdomain voted for during the
> duration of the MSS being powered on, to let the AOSS know that it may
> not perform certain power save measures. So vote for this.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v1:
> - New patch
> 

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sibi Sankar <sibis@codeaurora.org>

>  drivers/remoteproc/qcom_q6v5_mss.c | 31 ++++++++++++++++++++++++++++--
>  1 file changed, 29 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c
> b/drivers/remoteproc/qcom_q6v5_mss.c
> index 62cf16ddb7af..7f86d9c551c4 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -133,6 +133,7 @@ struct rproc_hexagon_res {
>  	char **proxy_clk_names;
>  	char **reset_clk_names;
>  	char **active_clk_names;
> +	char **active_pd_names;
>  	char **proxy_pd_names;
>  	int version;
>  	bool need_mem_protection;
> @@ -159,10 +160,12 @@ struct q6v5 {
>  	struct clk *active_clks[8];
>  	struct clk *reset_clks[4];
>  	struct clk *proxy_clks[4];
> +	struct device *active_pds[1];
>  	struct device *proxy_pds[3];
>  	int active_clk_count;
>  	int reset_clk_count;
>  	int proxy_clk_count;
> +	int active_pd_count;
>  	int proxy_pd_count;
> 
>  	struct reg_info active_regs[1];
> @@ -730,10 +733,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
> 
>  	qcom_q6v5_prepare(&qproc->q6v5);
> 
> +	ret = q6v5_pds_enable(qproc, qproc->active_pds, 
> qproc->active_pd_count);
> +	if (ret < 0) {
> +		dev_err(qproc->dev, "failed to enable active power domains\n");
> +		goto disable_irqs;
> +	}
> +
>  	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, 
> qproc->proxy_pd_count);
>  	if (ret < 0) {
>  		dev_err(qproc->dev, "failed to enable proxy power domains\n");
> -		goto disable_irqs;
> +		goto disable_active_pds;
>  	}
> 
>  	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
> @@ -839,6 +848,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  			       qproc->proxy_reg_count);
>  disable_proxy_pds:
>  	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +disable_active_pds:
> +	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
>  disable_irqs:
>  	qcom_q6v5_unprepare(&qproc->q6v5);
> 
> @@ -878,6 +889,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
>  			 qproc->active_clk_count);
>  	q6v5_regulator_disable(qproc, qproc->active_regs,
>  			       qproc->active_reg_count);
> +	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
> 
>  	/* In case of failure or coredump scenario where reclaiming MBA 
> memory
>  	 * could not happen reclaim it here.
> @@ -1410,11 +1422,19 @@ static int q6v5_probe(struct platform_device 
> *pdev)
>  	}
>  	qproc->active_reg_count = ret;
> 
> +	ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds,
> +			      desc->active_pd_names);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Failed to attach active power domains\n");
> +		goto free_rproc;
> +	}
> +	qproc->active_pd_count = ret;
> +
>  	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
>  			      desc->proxy_pd_names);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "Failed to init power domains\n");
> -		goto free_rproc;
> +		goto detach_active_pds;
>  	}
>  	qproc->proxy_pd_count = ret;
> 
> @@ -1446,6 +1466,8 @@ static int q6v5_probe(struct platform_device 
> *pdev)
> 
>  detach_proxy_pds:
>  	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +detach_active_pds:
> +	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
>  free_rproc:
>  	rproc_free(rproc);
> 
> @@ -1463,6 +1485,7 @@ static int q6v5_remove(struct platform_device 
> *pdev)
>  	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
>  	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
> 
> +	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
>  	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> 
>  	rproc_free(qproc->rproc);
> @@ -1489,6 +1512,10 @@ static const struct rproc_hexagon_res sdm845_mss 
> = {
>  			"mnoc_axi",
>  			NULL
>  	},
> +	.active_pd_names = (char*[]){
> +			"load_state",
> +			NULL
> +	},
>  	.proxy_pd_names = (char*[]){
>  			"cx",
>  			"mx",

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 15%]

* [PATCH v5 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
@ 2019-01-09 17:00 Sibi Sankar
  2019-01-11 21:06 ` Doug Anderson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2019-01-09 17:00 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---

v5:
  * Use qmp_aop updated dt binding

v3:
  * with shutdown-ack irq redesign make it mandatory,
    merge multiple patches into a single one

v2:
  * Fixed style changes
  * Added missing clocks in the dt-bindings
  * Split mss remoteproc node into a number of patches

This patch depends on the following bindings:
https://patchwork.kernel.org/patch/10662089/ - mba/mpss reserved regions
https://patchwork.kernel.org/patch/10657325/ - pdc reset node
https://patchwork.kernel.org/patch/10753659/ - rpmhpd dt node
https://patchwork.kernel.org/patch/10749469/ - AOP QMP dt bindings
https://patchwork.kernel.org/patch/10751757/ - shutdown-irq binding

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 60 ++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 5da9fa1feb8a..e021b15f87fd 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1366,6 +1366,66 @@
 			};
 		};
 
+		remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0x04080000 0x408>, <0x04180000 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs
+						0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+				mbox-names = "mpss_smem";
+			};
+		};
+
 		usb_1_hsphy: phy@88e2000 {
 			compatible = "qcom,sdm845-qusb2-phy";
 			reg = <0x88e2000 0x400>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* Re: [PATCH v5 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2019-01-09 17:00 [PATCH v5 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
@ 2019-01-11 21:06 ` Doug Anderson
  2019-01-12 18:42   ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2019-01-11 21:06 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, sricharan

Hi,

On Wed, Jan 9, 2019 at 9:00 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> ---
>
> v5:
>   * Use qmp_aop updated dt binding

nit: since this is now a singleton patch in v5 (because patches #1 -
#7 landed), the general policy is to drop the "8/8" in the subject.
AKA I believe the subject of the patch ought to have been:

[PATCH v5] arm64: dts: qcom: sdm845: Add Q6V5 MSS node


> v3:
>   * with shutdown-ack irq redesign make it mandatory,
>     merge multiple patches into a single one
>
> v2:
>   * Fixed style changes
>   * Added missing clocks in the dt-bindings
>   * Split mss remoteproc node into a number of patches
>
> This patch depends on the following bindings:
> https://patchwork.kernel.org/patch/10662089/ - mba/mpss reserved regions
> https://patchwork.kernel.org/patch/10657325/ - pdc reset node
> https://patchwork.kernel.org/patch/10753659/ - rpmhpd dt node
> https://patchwork.kernel.org/patch/10749469/ - AOP QMP dt bindings
> https://patchwork.kernel.org/patch/10751757/ - shutdown-irq binding
>
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 60 ++++++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 5da9fa1feb8a..e021b15f87fd 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -1366,6 +1366,66 @@
>                         };
>                 };
>
> +               remoteproc@4080000 {

It would be handy if you added a label here, AKA:

mss_pil: remoteproc@4080000 {

It's expected that boards will need to refer to this node so that they
can provide a firmware-name, so you need to give them a label to grab
onto.

...and actually, I wonder if boards will also need to be able to set
status = "okay"?  Right now they don't because you don't have a status
= "disabled" in sdm845.dtsi, but maybe you should?  Are there ever
going to be any boards with sdm845 that don't hook up the modem?


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v5 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2019-01-11 21:06 ` Doug Anderson
@ 2019-01-12 18:42   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-12 18:42 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Sibi Sankar, Rob Herring, Andy Gross, David Brown, linux-arm-msm,
	open list:ARM/QUALCOMM SUPPORT, devicetree, LKML, tsoni, clew,
	akdwived, Mark Rutland, linux-remoteproc, Evan Green,
	Brian Norris, sricharan

On Fri 11 Jan 13:06 PST 2019, Doug Anderson wrote:

> Hi,
> 
> On Wed, Jan 9, 2019 at 9:00 AM Sibi Sankar <sibis@codeaurora.org> wrote:
> >
> > This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
> >
> > Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> > Reviewed-by: Douglas Anderson <dianders@chromium.org>
> > ---
> >
> > v5:
> >   * Use qmp_aop updated dt binding
> 
> nit: since this is now a singleton patch in v5 (because patches #1 -
> #7 landed), the general policy is to drop the "8/8" in the subject.
> AKA I believe the subject of the patch ought to have been:
> 
> [PATCH v5] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
> 
> 
> > v3:
> >   * with shutdown-ack irq redesign make it mandatory,
> >     merge multiple patches into a single one
> >
> > v2:
> >   * Fixed style changes
> >   * Added missing clocks in the dt-bindings
> >   * Split mss remoteproc node into a number of patches
> >
> > This patch depends on the following bindings:
> > https://patchwork.kernel.org/patch/10662089/ - mba/mpss reserved regions
> > https://patchwork.kernel.org/patch/10657325/ - pdc reset node
> > https://patchwork.kernel.org/patch/10753659/ - rpmhpd dt node
> > https://patchwork.kernel.org/patch/10749469/ - AOP QMP dt bindings
> > https://patchwork.kernel.org/patch/10751757/ - shutdown-irq binding
> >
> >  arch/arm64/boot/dts/qcom/sdm845.dtsi | 60 ++++++++++++++++++++++++++++
> >  1 file changed, 60 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > index 5da9fa1feb8a..e021b15f87fd 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > @@ -1366,6 +1366,66 @@
> >                         };
> >                 };
> >
> > +               remoteproc@4080000 {
> 
> It would be handy if you added a label here, AKA:
> 
> mss_pil: remoteproc@4080000 {
> 
> It's expected that boards will need to refer to this node so that they
> can provide a firmware-name, so you need to give them a label to grab
> onto.
> 

I agree.

> ...and actually, I wonder if boards will also need to be able to set
> status = "okay"?  Right now they don't because you don't have a status
> = "disabled" in sdm845.dtsi, but maybe you should?  Are there ever
> going to be any boards with sdm845 that don't hook up the modem?
> 

The modem is status "ok" on my SDA845 device (but haven't verified
upstream myself yet), so I think it's fine to leave it enabled.

But merging this as is will cause the modem to crash repeatedly until
rmtfs is present. Sibi is making progress on tying this to rmtfs, which
would be accompanied by the following commit:

https://lore.kernel.org/lkml/20180524192141.20323-1-ramon.fried@gmail.com/

I'm okay with merging that now, to unblock the merge of this patch.
Would appreciate an Ack on this.


Also, Sibi, the glink-edge binding doesn't define the mbox-names
property, so please drop it.

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* [PATCH v6] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
@ 2019-01-14 19:22 " Sibi Sankar
  2019-01-17 23:05 ` Doug Anderson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2019-01-14 19:22 UTC (permalink / raw)
  To: bjorn.andersson, robh+dt, andy.gross, david.brown, dianders
  Cc: linux-arm-msm, linux-soc, devicetree, linux-kernel, tsoni, clew,
	akdwived, mark.rutland, linux-remoteproc, evgreen, briannorris,
	sricharan, Sibi Sankar

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---

v6:
  * Drop unused mbox-names property
  * Add mss_pil label
  * Rebased to Andy's for-next

v5:
  * Use qmp_aop updated dt binding

v3:
  * with shutdown-ack irq redesign make it mandatory,
    merge multiple patches into a single one

v2:
  * Fixed style changes
  * Added missing clocks in the dt-bindings
  * Split mss remoteproc node into a number of patches

This patch depends on the following bindings:
https://patchwork.kernel.org/patch/10662089/ - mba/mpss reserved regions
https://patchwork.kernel.org/patch/10657325/ - pdc reset node
https://patchwork.kernel.org/patch/10755191/ - rpmhpd dt node
https://patchwork.kernel.org/patch/10755197/ - rpmhpd dt binding
https://patchwork.kernel.org/patch/10749469/ - AOP QMP dt binding
https://patchwork.kernel.org/patch/10751757/ - shutdown-irq binding
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 59 ++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 7d05e967c9ee..b5a58e508bb2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1440,6 +1440,65 @@
 			};
 		};
 
+		mss_pil: remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0x04080000 0x408>, <0x04180000 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs
+						0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+			};
+		};
+
 		sdhc_2: sdhci@8804000 {
 			compatible = "qcom,sdm845-sdhci", "qcom,sdhci-msm-v5";
 			reg = <0x8804000 0x1000>;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 19%]

* [PATCH v3] remoteproc: qcom: Add support for parsing fw dt bindings
@ 2019-01-14 19:50 Sibi Sankar
  2019-01-30 21:04 ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2019-01-14 19:50 UTC (permalink / raw)
  To: bjorn.andersson, briannorris, david.brown, robh+dt, mark.rutland,
	andy.gross
  Cc: akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree, dianders, Sibi Sankar

Add support for parsing "firmware-name" dt bindings which specifies
the relative paths of mba/modem/pas image as strings. Fallback to
the default paths for mba/modem/pas image on -EINVAL.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

v3:
 * Fixed minor code style issues
 * Add comments for firmware blob name generation
   and use sprintf instead

 drivers/remoteproc/qcom_q6v5_mss.c | 47 +++++++++++++++++++++++-------
 drivers/remoteproc/qcom_q6v5_pas.c |  9 +++++-
 2 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c86dc40cfb8c..41e92a025d21 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -188,6 +188,7 @@ struct q6v5 {
 	bool has_alt_reset;
 	int mpss_perm;
 	int mba_perm;
+	const char *hexagon_mdt_image;
 	int version;
 };
 
@@ -860,17 +861,26 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 	phys_addr_t min_addr = PHYS_ADDR_MAX;
 	phys_addr_t max_addr = 0;
 	bool relocate = false;
-	char seg_name[10];
+	char *fw_name;
+	size_t fw_name_len;
 	ssize_t offset;
 	size_t size = 0;
 	void *ptr;
 	int ret;
 	int i;
 
-	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	fw_name_len = strlen(qproc->hexagon_mdt_image);
+	if (fw_name_len <= 4)
+		return -EINVAL;
+
+	fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
+	if (!fw_name)
+		return -ENOMEM;
+
+	ret = request_firmware(&fw, fw_name, qproc->dev);
 	if (ret < 0) {
-		dev_err(qproc->dev, "unable to load modem.mdt\n");
-		return ret;
+		dev_err(qproc->dev, "unable to load %s\n", fw_name);
+		goto out;
 	}
 
 	/* Initialize the RMB validator */
@@ -918,10 +928,11 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 		ptr = qproc->mpss_region + offset;
 
 		if (phdr->p_filesz) {
-			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
-			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
+			/* Replace "xxx.xxx" with "xxx.bxx" */
+			sprintf(fw_name + fw_name_len - 3, "b%02d", i);
+			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
 			if (ret) {
-				dev_err(qproc->dev, "failed to load %s\n", seg_name);
+				dev_err(qproc->dev, "failed to load %s\n", fw_name);
 				goto release_firmware;
 			}
 
@@ -960,6 +971,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 
 release_firmware:
 	release_firmware(fw);
+out:
+	kfree(fw_name);
 
 	return ret < 0 ? ret : 0;
 }
@@ -1075,9 +1088,10 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 	unsigned long i;
 	int ret;
 
-	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
+	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
 	if (ret < 0) {
-		dev_err(qproc->dev, "unable to load modem.mdt\n");
+		dev_err(qproc->dev, "unable to load %s\n",
+			qproc->hexagon_mdt_image);
 		return ret;
 	}
 
@@ -1253,6 +1267,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	const struct rproc_hexagon_res *desc;
 	struct q6v5 *qproc;
 	struct rproc *rproc;
+	const char *mba_image;
 	int ret;
 
 	desc = of_device_get_match_data(&pdev->dev);
@@ -1262,8 +1277,14 @@ static int q6v5_probe(struct platform_device *pdev)
 	if (desc->need_mem_protection && !qcom_scm_is_available())
 		return -EPROBE_DEFER;
 
+	mba_image = desc->hexagon_mba_image;
+	ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
+					    0, &mba_image);
+	if (ret < 0 && ret != -EINVAL)
+		return ret;
+
 	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
-			    desc->hexagon_mba_image, sizeof(*qproc));
+			    mba_image, sizeof(*qproc));
 	if (!rproc) {
 		dev_err(&pdev->dev, "failed to allocate rproc\n");
 		return -ENOMEM;
@@ -1272,6 +1293,12 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc = (struct q6v5 *)rproc->priv;
 	qproc->dev = &pdev->dev;
 	qproc->rproc = rproc;
+	qproc->hexagon_mdt_image = "modem.mdt";
+	ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
+					    1, &qproc->hexagon_mdt_image);
+	if (ret < 0 && ret != -EINVAL)
+		return ret;
+
 	platform_set_drvdata(pdev, qproc);
 
 	ret = q6v5_init_mem(qproc, pdev);
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index b1e63fcd5fdf..cfdafd68e2cd 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -258,6 +258,7 @@ static int adsp_probe(struct platform_device *pdev)
 	const struct adsp_data *desc;
 	struct qcom_adsp *adsp;
 	struct rproc *rproc;
+	const char *fw_name;
 	int ret;
 
 	desc = of_device_get_match_data(&pdev->dev);
@@ -267,8 +268,14 @@ static int adsp_probe(struct platform_device *pdev)
 	if (!qcom_scm_is_available())
 		return -EPROBE_DEFER;
 
+	fw_name = desc->firmware_name;
+	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
+				      &fw_name);
+	if (ret < 0 && ret != -EINVAL)
+		return ret;
+
 	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
-			    desc->firmware_name, sizeof(*adsp));
+			    fw_name, sizeof(*adsp));
 	if (!rproc) {
 		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
 		return -ENOMEM;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[relevance 17%]

* Re: [PATCH v6] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2019-01-14 19:22 [PATCH v6] " Sibi Sankar
@ 2019-01-17 23:05 ` Doug Anderson
  2019-01-18  5:21   ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2019-01-17 23:05 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, sricharan

Hi,

On Mon, Jan 14, 2019 at 11:22 AM Sibi Sankar <sibis@codeaurora.org> wrote:
> +               mss_pil: remoteproc@4080000 {
> +                       compatible = "qcom,sdm845-mss-pil";
> +                       reg = <0x04080000 0x408>, <0x04180000 0x48>;

This will now need to be adjusted to:

reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;

This fixes things up to deal with the patch ("arm64: dts: qcom:
sdm845: Increase address and size cells for soc"), AKA:
- https://patchwork.kernel.org/patch/10767511/
- https://lkml.kernel.org/r/20190117042940.25487-2-bjorn.andersson@linaro.org


-Doug

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v6] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2019-01-17 23:05 ` Doug Anderson
@ 2019-01-18  5:21   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-18  5:21 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Bjorn Andersson, Rob Herring, Andy Gross, David Brown,
	linux-arm-msm, open list:ARM/QUALCOMM SUPPORT, devicetree, LKML,
	tsoni, clew, akdwived, Mark Rutland, linux-remoteproc,
	Evan Green, Brian Norris, sricharan, linux-soc-owner

On 2019-01-18 04:35, Doug Anderson wrote:
> Hi,
> 
> On Mon, Jan 14, 2019 at 11:22 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> +               mss_pil: remoteproc@4080000 {
>> +                       compatible = "qcom,sdm845-mss-pil";
>> +                       reg = <0x04080000 0x408>, <0x04180000 0x48>;
> 
> This will now need to be adjusted to:
> 
> reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;

Yup, this was on my todo list after Bjorn
posted out the patch

> 
> This fixes things up to deal with the patch ("arm64: dts: qcom:
> sdm845: Increase address and size cells for soc"), AKA:
> - https://patchwork.kernel.org/patch/10767511/
> - 
> https://lkml.kernel.org/r/20190117042940.25487-2-bjorn.andersson@linaro.org
> 
> 
> -Doug

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor
      [irrelevant] ` <20180529042047.GE2259@tuxbook-pro>
@ 2019-01-18  7:04   ` Sibi Sankar
  2019-01-18 18:35     ` Brian Norris
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2019-01-18  7:04 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ramon Fried, linux-remoteproc, linux-kernel, linux-kernel-owner,
	<Brian Norris>

On 2018-05-29 09:50, Bjorn Andersson wrote:
> On Thu 24 May 12:21 PDT 2018, Ramon Fried wrote:
> 
>> Sometimes that rmtfs userspace module is not brought
>> up fast enough and the modem crashes.
>> disabling automated boot in the driver and triggering
>> the boot from user-space sovles the problem.
>> 
>> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
> 
> Thanks for your patch Ramon. While this nudges the behavior to make
> things work slightly better I think we need to describe the explicit
> dependency between the mss firmware and the existence of rmtfs.
> 
> As our remoteprocs are essentially always-on I would prefer that they
> start "automatically" and not through use of the sysfs interface.
> 
> But we're at the point where this is a real problem on 410, 820 and 
> 845,
> so we have to come up with some way to tie these pieces together. If
> your patch suits that solution I will happily take it.
> 
> Regards,
> Bjorn

After experimenting with in kernel solutions for
three revisions and observing problems on graceful
shutdown usecase, switching to controlling the
remoteproc mss through rmtfs seems to solve all
the known issues.

https://patchwork.kernel.org/patch/10662395/

we should probably get this merged in, now that
we are planning to start/stop mss through
rmtfs.


Acked-by: Sibi Sankar <sibis@codeaurora.org>

> 
>> ---
>>  drivers/remoteproc/qcom_q6v5_pil.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c 
>> b/drivers/remoteproc/qcom_q6v5_pil.c
>> index cbbafdcaaecb..719ee96445b3 100644
>> --- a/drivers/remoteproc/qcom_q6v5_pil.c
>> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
>> @@ -1133,6 +1133,8 @@ static int q6v5_probe(struct platform_device 
>> *pdev)
>>  		return -ENOMEM;
>>  	}
>> 
>> +	rproc->auto_boot = false;
>> +
>>  	qproc = (struct q6v5 *)rproc->priv;
>>  	qproc->dev = &pdev->dev;
>>  	qproc->rproc = rproc;
>> --
>> 2.17.0
>> 

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 13%]

* Re: [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor
  2019-01-18  7:04   ` [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor Sibi Sankar
@ 2019-01-18 18:35     ` Brian Norris
  2019-01-18 19:46       ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Brian Norris @ 2019-01-18 18:35 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Ramon Fried, linux-remoteproc, Linux Kernel,
	linux-kernel-owner

On Thu, Jan 17, 2019 at 11:04 PM Sibi Sankar <sibis@codeaurora.org> wrote:
> On 2018-05-29 09:50, Bjorn Andersson wrote:
> > On Thu 24 May 12:21 PDT 2018, Ramon Fried wrote:

Whoa, bringing up a 7-month old patch? Nice.

> >> Sometimes that rmtfs userspace module is not brought
> >> up fast enough and the modem crashes.
> >> disabling automated boot in the driver and triggering
> >> the boot from user-space sovles the problem.
> >>
> >> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
> >
> > Thanks for your patch Ramon. While this nudges the behavior to make
> > things work slightly better I think we need to describe the explicit
> > dependency between the mss firmware and the existence of rmtfs.
> >
> > As our remoteprocs are essentially always-on I would prefer that they
> > start "automatically" and not through use of the sysfs interface.
> >
> > But we're at the point where this is a real problem on 410, 820 and
> > 845,
> > so we have to come up with some way to tie these pieces together. If
> > your patch suits that solution I will happily take it.
> >
> > Regards,
> > Bjorn
>
> After experimenting with in kernel solutions for
> three revisions and observing problems on graceful
> shutdown usecase,

What exactly were the problems again? e.g., what were the deficiencies
with having the remoteproc device listen for the REMOTEFS_QMI_SVC_ID
service again? Sorry, but I sort of dropped off on reviewing that
stuff, and now I see this. I'd mildly prefer something that is
actually automatic, but if I'm missing some aspects, I'd like to hear
that. (And, I'd like to see them explained in the commit message, if
this is ever to be merged.)

> switching to controlling the
> remoteproc mss through rmtfs seems to solve all
> the known issues.

How so? It explicitly does NOT help at all if RMTFS crashes.
Because...who's going to stop the modem in that case? (It works if you
automatically respawn a new RMTFS daemon, to toggle the modem. But
that's kind of cheating, and you can do that anyway, even without this
patch.) On the contrary, your patch *would* resolve that, since the
modem would notice when the RMTFS server goes away, and it would stop
itself.

> https://patchwork.kernel.org/patch/10662395/
>
> we should probably get this merged in, now that
> we are planning to start/stop mss through
> rmtfs.

Sorry, who's planning to stop mss through rmtfs? Did I miss something?

Brian

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor
  2019-01-18 18:35     ` Brian Norris
@ 2019-01-18 19:46       ` Sibi Sankar
  2019-01-18 21:04         ` Brian Norris
  0 siblings, 1 reply; 200+ results
From: Sibi Sankar @ 2019-01-18 19:46 UTC (permalink / raw)
  To: Brian Norris
  Cc: Bjorn Andersson, Ramon Fried, linux-remoteproc, Linux Kernel,
	linux-kernel-owner

On 2019-01-19 00:05, Brian Norris wrote:
> On Thu, Jan 17, 2019 at 11:04 PM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> On 2018-05-29 09:50, Bjorn Andersson wrote:
>> > On Thu 24 May 12:21 PDT 2018, Ramon Fried wrote:
> 
> Whoa, bringing up a 7-month old patch? Nice.
> 
>> >> Sometimes that rmtfs userspace module is not brought
>> >> up fast enough and the modem crashes.
>> >> disabling automated boot in the driver and triggering
>> >> the boot from user-space sovles the problem.
>> >>
>> >> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
>> >
>> > Thanks for your patch Ramon. While this nudges the behavior to make
>> > things work slightly better I think we need to describe the explicit
>> > dependency between the mss firmware and the existence of rmtfs.
>> >
>> > As our remoteprocs are essentially always-on I would prefer that they
>> > start "automatically" and not through use of the sysfs interface.
>> >
>> > But we're at the point where this is a real problem on 410, 820 and
>> > 845,
>> > so we have to come up with some way to tie these pieces together. If
>> > your patch suits that solution I will happily take it.
>> >
>> > Regards,
>> > Bjorn
>> 
>> After experimenting with in kernel solutions for
>> three revisions and observing problems on graceful
>> shutdown usecase,
> 
> What exactly were the problems again? e.g., what were the deficiencies
> with having the remoteproc device listen for the REMOTEFS_QMI_SVC_ID
> service again? Sorry, but I sort of dropped off on reviewing that
> stuff, and now I see this. I'd mildly prefer something that is
> actually automatic, but if I'm missing some aspects, I'd like to hear
> that. (And, I'd like to see them explained in the commit message, if
> this is ever to be merged.)

bringing down the modem after the RMTFS server
goes down leaves the modem in limbo (It has a few
pending rmtfs transactions that cannot go through)
which results in sysmon graceful shutdown failing.
And we have to do a modem force-stop to proceed
which we want to avoid in graceful shutdown cases.
This is overcome by starting rproc mss from rmtfs
after REMOTEFS_QMI service is up and stopping
rproc mss from rmtfs on SIGKILL/SIGINT and other
program error signals before bringing down the
RMTFS_QMI service i.e before exiting the rmtfs
server loop.

> 
>> switching to controlling the
>> remoteproc mss through rmtfs seems to solve all
>> the known issues.
> 
> How so? It explicitly does NOT help at all if RMTFS crashes.
> Because...who's going to stop the modem in that case? (It works if you
> automatically respawn a new RMTFS daemon, to toggle the modem. But
> that's kind of cheating, and you can do that anyway, even without this
> patch.) On the contrary, your patch *would* resolve that, since the
> modem would notice when the RMTFS server goes away, and it would stop
> itself.

yeah we would want to mimic what the kernel
patch did with the exception of stopping modem
before bringing down the rmtfs server (not toggle
rproc state but start on rmtfs service up and stop
before rmtfs server exit). So in that case we would
not want the modem to auto-boot.

> 
>> https://patchwork.kernel.org/patch/10662395/
>> 
>> we should probably get this merged in, now that
>> we are planning to start/stop mss through
>> rmtfs.
> 
> Sorry, who's planning to stop mss through rmtfs? Did I miss something?

I have a working patch which I'll soon send
upstream for review, after it clears the internal
reviews/processes

> 
> Brian

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor
  2019-01-18 19:46       ` Sibi Sankar
@ 2019-01-18 21:04         ` Brian Norris
  2019-01-19  4:17           ` Sibi Sankar
  0 siblings, 1 reply; 200+ results
From: Brian Norris @ 2019-01-18 21:04 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Ramon Fried, linux-remoteproc, Linux Kernel,
	linux-kernel-owner

Hi Sibi,

On Fri, Jan 18, 2019 at 11:46 AM Sibi Sankar <sibis@codeaurora.org> wrote:
> On 2019-01-19 00:05, Brian Norris wrote:
> > On Thu, Jan 17, 2019 at 11:04 PM Sibi Sankar <sibis@codeaurora.org>
> >> After experimenting with in kernel solutions for
> >> three revisions and observing problems on graceful
> >> shutdown usecase,
> >
> > What exactly were the problems again? e.g., what were the deficiencies
> > with having the remoteproc device listen for the REMOTEFS_QMI_SVC_ID
> > service again? Sorry, but I sort of dropped off on reviewing that
> > stuff, and now I see this. I'd mildly prefer something that is
> > actually automatic, but if I'm missing some aspects, I'd like to hear
> > that. (And, I'd like to see them explained in the commit message, if
> > this is ever to be merged.)
>
> bringing down the modem after the RMTFS server
> goes down leaves the modem in limbo (It has a few
> pending rmtfs transactions that cannot go through)
> which results in sysmon graceful shutdown failing.

Makes sense. Probably should be described in a re-send of this patch,
if we're going with that.

> And we have to do a modem force-stop to proceed
> which we want to avoid in graceful shutdown cases.

Shouldn't you do the "force-stop" in the kernel too? e.g., if rmtfs
daemon dies without doing a properly-timed stop, then we should still
force a stop in the kernel, no? Basically, why not do both mechanisms:
REMOTEFS_QMI_SVC-activated start/stop in the kernel, and manual stop
(and start? this likely might still be redundant) in the daemon?

> This is overcome by starting rproc mss from rmtfs
> after REMOTEFS_QMI service is up and stopping
> rproc mss from rmtfs on SIGKILL/SIGINT and other
> program error signals before bringing down the
> RMTFS_QMI service i.e before exiting the rmtfs
> server loop.

That's still not really a sure-fire way of doing things. For one, you
can't catch SIGKILL. Similarly, you can't really clean up from OOM,
segfault, etc. So it would still be helpful to hook into the QMI
service notifications in the kernel, I think.

> >> switching to controlling the
> >> remoteproc mss through rmtfs seems to solve all
> >> the known issues.
> >
> > How so? It explicitly does NOT help at all if RMTFS crashes.
> > Because...who's going to stop the modem in that case? (It works if you
> > automatically respawn a new RMTFS daemon, to toggle the modem. But
> > that's kind of cheating, and you can do that anyway, even without this
> > patch.) On the contrary, your patch *would* resolve that, since the
> > modem would notice when the RMTFS server goes away, and it would stop
> > itself.
>
> yeah we would want to mimic what the kernel
> patch did with the exception of stopping modem
> before bringing down the rmtfs server (not toggle
> rproc state but start on rmtfs service up and stop
> before rmtfs server exit). So in that case we would
> not want the modem to auto-boot.

See above. You can't really mimic what the kernel patch was doing
completely. You can try (which is probably a good idea), but you
should still have some fallback in the kernel, I expect.

> >> https://patchwork.kernel.org/patch/10662395/
> >>
> >> we should probably get this merged in, now that
> >> we are planning to start/stop mss through
> >> rmtfs.
> >
> > Sorry, who's planning to stop mss through rmtfs? Did I miss something?
>
> I have a working patch which I'll soon send
> upstream for review, after it clears the internal
> reviews/processes

OK.

Brian

^ permalink raw reply	[relevance 6%]

* Re: [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor
  2019-01-18 21:04         ` Brian Norris
@ 2019-01-19  4:17           ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-19  4:17 UTC (permalink / raw)
  To: Brian Norris
  Cc: Bjorn Andersson, Ramon Fried, linux-remoteproc, Linux Kernel,
	linux-kernel-owner

Hi Brian,
Thanks for the review

On 2019-01-19 02:34, Brian Norris wrote:
> Hi Sibi,
> 
> On Fri, Jan 18, 2019 at 11:46 AM Sibi Sankar <sibis@codeaurora.org> 
> wrote:
>> On 2019-01-19 00:05, Brian Norris wrote:
>> > On Thu, Jan 17, 2019 at 11:04 PM Sibi Sankar <sibis@codeaurora.org>
>> >> After experimenting with in kernel solutions for
>> >> three revisions and observing problems on graceful
>> >> shutdown usecase,
>> >
>> > What exactly were the problems again? e.g., what were the deficiencies
>> > with having the remoteproc device listen for the REMOTEFS_QMI_SVC_ID
>> > service again? Sorry, but I sort of dropped off on reviewing that
>> > stuff, and now I see this. I'd mildly prefer something that is
>> > actually automatic, but if I'm missing some aspects, I'd like to hear
>> > that. (And, I'd like to see them explained in the commit message, if
>> > this is ever to be merged.)
>> 
>> bringing down the modem after the RMTFS server
>> goes down leaves the modem in limbo (It has a few
>> pending rmtfs transactions that cannot go through)
>> which results in sysmon graceful shutdown failing.
> 
> Makes sense. Probably should be described in a re-send of this patch,
> if we're going with that.
> 
>> And we have to do a modem force-stop to proceed
>> which we want to avoid in graceful shutdown cases.
> 
> Shouldn't you do the "force-stop" in the kernel too? e.g., if rmtfs
> daemon dies without doing a properly-timed stop, then we should still
> force a stop in the kernel, no? Basically, why not do both mechanisms:
> REMOTEFS_QMI_SVC-activated start/stop in the kernel, and manual stop
> (and start? this likely might still be redundant) in the daemon?

yeah we already have that implemented in the kernel
i.e first we try graceful shutdown followed by
force-stop which will just timeout if graceful
shutdown was already completed. We would just call
stop from rmtfs without worrying about the underlying
details.

> 
>> This is overcome by starting rproc mss from rmtfs
>> after REMOTEFS_QMI service is up and stopping
>> rproc mss from rmtfs on SIGKILL/SIGINT and other
>> program error signals before bringing down the
>> RMTFS_QMI service i.e before exiting the rmtfs
>> server loop.
> 
> That's still not really a sure-fire way of doing things. For one, you
> can't catch SIGKILL. Similarly, you can't really clean up from OOM,
> segfault, etc. So it would still be helpful to hook into the QMI
> service notifications in the kernel, I think.

yes we would want a fail safe in the kernel
as well. Sorry I meant SIGTERM instead of
SIGKILL earlier

> 
>> >> switching to controlling the
>> >> remoteproc mss through rmtfs seems to solve all
>> >> the known issues.
>> >
>> > How so? It explicitly does NOT help at all if RMTFS crashes.
>> > Because...who's going to stop the modem in that case? (It works if you
>> > automatically respawn a new RMTFS daemon, to toggle the modem. But
>> > that's kind of cheating, and you can do that anyway, even without this
>> > patch.) On the contrary, your patch *would* resolve that, since the
>> > modem would notice when the RMTFS server goes away, and it would stop
>> > itself.
>> 
>> yeah we would want to mimic what the kernel
>> patch did with the exception of stopping modem
>> before bringing down the rmtfs server (not toggle
>> rproc state but start on rmtfs service up and stop
>> before rmtfs server exit). So in that case we would
>> not want the modem to auto-boot.
> 
> See above. You can't really mimic what the kernel patch was doing
> completely. You can try (which is probably a good idea), but you
> should still have some fallback in the kernel, I expect.

yeah

> 
>> >> https://patchwork.kernel.org/patch/10662395/
>> >>
>> >> we should probably get this merged in, now that
>> >> we are planning to start/stop mss through
>> >> rmtfs.
>> >
>> > Sorry, who's planning to stop mss through rmtfs? Did I miss something?
>> 
>> I have a working patch which I'll soon send
>> upstream for review, after it clears the internal
>> reviews/processes
> 
> OK.
> 
> Brian

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v3 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
      [irrelevant] <20190122055112.30943-1-bjorn.andersson@linaro.org>
  2019-01-22  5:51 ` [PATCH v3 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
  2019-01-22  5:51 ` [PATCH v3 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
@ 2019-01-22  5:51 ` Bjorn Andersson
  2019-01-23  0:28   ` Doug Anderson
      [irrelevant] ` <20190122055112.30943-2-bjorn.andersson@linaro.org>
  3 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2019-01-22  5:51 UTC (permalink / raw)
  To: Andy Gross, David Brown, Sibi Sankar
  Cc: Rob Herring, Mark Rutland, linux-arm-msm, devicetree, linux-kernel

From: Sibi Sankar <sibis@codeaurora.org>

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v2:
- Picked up Sibi's patch
- Fixed reg to work with address/size-cells as 2

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 5cc2615461da..78df5f1bce2d 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1617,6 +1617,64 @@
 			clock-names = "xo";
 		};
 
+		mss_pil: remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+			};
+		};
+
 		sdhc_2: sdhci@8804000 {
 			compatible = "qcom,sdm845-sdhci", "qcom,sdhci-msm-v5";
 			reg = <0 0x08804000 0 0x1000>;
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* [PATCH v3 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845
      [irrelevant] <20190122055112.30943-1-bjorn.andersson@linaro.org>
  2019-01-22  5:51 ` [PATCH v3 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
@ 2019-01-22  5:51 ` Bjorn Andersson
  2019-01-22  5:51 ` [PATCH v3 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
      [irrelevant] ` <20190122055112.30943-2-bjorn.andersson@linaro.org>
  3 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-22  5:51 UTC (permalink / raw)
  To: Andy Gross, David Brown, Sibi Sankar
  Cc: Rob Herring, Mark Rutland, linux-arm-msm, devicetree, linux-kernel

The SDM845 MSS needs the load_state powerdomain voted for during the
duration of the MSS being powered on, to let the AOSS know that it may
not perform certain power save measures. So vote for this.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v2:
- None

 drivers/remoteproc/qcom_q6v5_mss.c | 31 ++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 003186ce56c7..3e25016954d9 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -133,6 +133,7 @@ struct rproc_hexagon_res {
 	char **proxy_clk_names;
 	char **reset_clk_names;
 	char **active_clk_names;
+	char **active_pd_names;
 	char **proxy_pd_names;
 	int version;
 	bool need_mem_protection;
@@ -159,10 +160,12 @@ struct q6v5 {
 	struct clk *active_clks[8];
 	struct clk *reset_clks[4];
 	struct clk *proxy_clks[4];
+	struct device *active_pds[1];
 	struct device *proxy_pds[3];
 	int active_clk_count;
 	int reset_clk_count;
 	int proxy_clk_count;
+	int active_pd_count;
 	int proxy_pd_count;
 
 	struct reg_info active_regs[1];
@@ -730,10 +733,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
+	ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count);
+	if (ret < 0) {
+		dev_err(qproc->dev, "failed to enable active power domains\n");
+		goto disable_irqs;
+	}
+
 	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 	if (ret < 0) {
 		dev_err(qproc->dev, "failed to enable proxy power domains\n");
-		goto disable_irqs;
+		goto disable_active_pds;
 	}
 
 	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
@@ -839,6 +848,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 			       qproc->proxy_reg_count);
 disable_proxy_pds:
 	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+disable_active_pds:
+	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
@@ -878,6 +889,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
 			 qproc->active_clk_count);
 	q6v5_regulator_disable(qproc, qproc->active_regs,
 			       qproc->active_reg_count);
+	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
 
 	/* In case of failure or coredump scenario where reclaiming MBA memory
 	 * could not happen reclaim it here.
@@ -1412,11 +1424,19 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds,
+			      desc->active_pd_names);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to attach active power domains\n");
+		goto free_rproc;
+	}
+	qproc->active_pd_count = ret;
+
 	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
 			      desc->proxy_pd_names);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to init power domains\n");
-		goto free_rproc;
+		goto detach_active_pds;
 	}
 	qproc->proxy_pd_count = ret;
 
@@ -1448,6 +1468,8 @@ static int q6v5_probe(struct platform_device *pdev)
 
 detach_proxy_pds:
 	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+detach_active_pds:
+	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1465,6 +1487,7 @@ static int q6v5_remove(struct platform_device *pdev)
 	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
 	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
 
+	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
 	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 
 	rproc_free(qproc->rproc);
@@ -1491,6 +1514,10 @@ static const struct rproc_hexagon_res sdm845_mss = {
 			"mnoc_axi",
 			NULL
 	},
+	.active_pd_names = (char*[]){
+			"load_state",
+			NULL
+	},
 	.proxy_pd_names = (char*[]){
 			"cx",
 			"mx",
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* [PATCH v3 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains
      [irrelevant] <20190122055112.30943-1-bjorn.andersson@linaro.org>
@ 2019-01-22  5:51 ` Bjorn Andersson
  2019-01-22  5:51 ` [PATCH v3 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-22  5:51 UTC (permalink / raw)
  To: Andy Gross, David Brown, Sibi Sankar
  Cc: Rob Herring, Mark Rutland, linux-arm-msm, devicetree, linux-kernel

From: Rajendra Nayak <rnayak@codeaurora.org>

With rpmh ARC resources being modelled as power domains with performance
state, we need to proxy vote on these for SDM845.
Add support to vote on multiple of them, now that genpd supports
associating mutliple power domains to a device.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
[bjorn: Drop device link, improve error handling, name things "proxy"]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v2:
- Disable proxy pds if handover did not arrived before stop

 drivers/remoteproc/qcom_q6v5_mss.c | 117 ++++++++++++++++++++++++++++-
 1 file changed, 113 insertions(+), 4 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 01be7314e176..003186ce56c7 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -25,6 +25,8 @@
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/remoteproc.h>
@@ -131,6 +133,7 @@ struct rproc_hexagon_res {
 	char **proxy_clk_names;
 	char **reset_clk_names;
 	char **active_clk_names;
+	char **proxy_pd_names;
 	int version;
 	bool need_mem_protection;
 	bool has_alt_reset;
@@ -156,9 +159,11 @@ struct q6v5 {
 	struct clk *active_clks[8];
 	struct clk *reset_clks[4];
 	struct clk *proxy_clks[4];
+	struct device *proxy_pds[3];
 	int active_clk_count;
 	int reset_clk_count;
 	int proxy_clk_count;
+	int proxy_pd_count;
 
 	struct reg_info active_regs[1];
 	struct reg_info proxy_regs[3];
@@ -321,6 +326,41 @@ static void q6v5_clk_disable(struct device *dev,
 		clk_disable_unprepare(clks[i]);
 }
 
+static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds,
+			   size_t pd_count)
+{
+	int ret;
+	int i;
+
+	for (i = 0; i < pd_count; i++) {
+		dev_pm_genpd_set_performance_state(pds[i], INT_MAX);
+		ret = pm_runtime_get_sync(pds[i]);
+		if (ret < 0)
+			goto unroll_pd_votes;
+	}
+
+	return 0;
+
+unroll_pd_votes:
+	for (i--; i >= 0; i--) {
+		dev_pm_genpd_set_performance_state(pds[i], 0);
+		pm_runtime_put(pds[i]);
+	}
+
+	return ret;
+};
+
+static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
+			     size_t pd_count)
+{
+	int i;
+
+	for (i = 0; i < pd_count; i++) {
+		dev_pm_genpd_set_performance_state(pds[i], 0);
+		pm_runtime_put(pds[i]);
+	}
+}
+
 static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm,
 				   bool remote_owner, phys_addr_t addr,
 				   size_t size)
@@ -690,11 +730,17 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
+	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+	if (ret < 0) {
+		dev_err(qproc->dev, "failed to enable proxy power domains\n");
+		goto disable_irqs;
+	}
+
 	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
 				    qproc->proxy_reg_count);
 	if (ret) {
 		dev_err(qproc->dev, "failed to enable proxy supplies\n");
-		goto disable_irqs;
+		goto disable_proxy_pds;
 	}
 
 	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
@@ -791,6 +837,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 disable_proxy_reg:
 	q6v5_regulator_disable(qproc, qproc->proxy_regs,
 			       qproc->proxy_reg_count);
+disable_proxy_pds:
+	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
@@ -841,6 +889,8 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
 
 	ret = qcom_q6v5_unprepare(&qproc->q6v5);
 	if (ret) {
+		q6v5_pds_disable(qproc, qproc->proxy_pds,
+				 qproc->proxy_pd_count);
 		q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
 				 qproc->proxy_clk_count);
 		q6v5_regulator_disable(qproc, qproc->proxy_regs,
@@ -1121,6 +1171,7 @@ static void qcom_msa_handover(struct qcom_q6v5 *q6v5)
 			 qproc->proxy_clk_count);
 	q6v5_regulator_disable(qproc, qproc->proxy_regs,
 			       qproc->proxy_reg_count);
+	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 }
 
 static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device *pdev)
@@ -1181,6 +1232,45 @@ static int q6v5_init_clocks(struct device *dev, struct clk **clks,
 	return i;
 }
 
+static int q6v5_pds_attach(struct device *dev, struct device **devs,
+			   char **pd_names)
+{
+	size_t num_pds = 0;
+	int ret;
+	int i;
+
+	if (!pd_names)
+		return 0;
+
+	while (pd_names[num_pds])
+		num_pds++;
+
+	for (i = 0; i < num_pds; i++) {
+		devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
+		if (IS_ERR(devs[i])) {
+			ret = PTR_ERR(devs[i]);
+			goto unroll_attach;
+		}
+	}
+
+	return num_pds;
+
+unroll_attach:
+	for (i--; i >= 0; i--)
+		dev_pm_domain_detach(devs[i], false);
+
+	return ret;
+};
+
+static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
+			    size_t pd_count)
+{
+	int i;
+
+	for (i = 0; i < pd_count; i++)
+		dev_pm_domain_detach(pds[i], false);
+}
+
 static int q6v5_init_reset(struct q6v5 *qproc)
 {
 	qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev,
@@ -1322,10 +1412,18 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
+			      desc->proxy_pd_names);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to init power domains\n");
+		goto free_rproc;
+	}
+	qproc->proxy_pd_count = ret;
+
 	qproc->has_alt_reset = desc->has_alt_reset;
 	ret = q6v5_init_reset(qproc);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	qproc->version = desc->version;
 	qproc->need_mem_protection = desc->need_mem_protection;
@@ -1333,7 +1431,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
 			     qcom_msa_handover);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	qproc->mpss_perm = BIT(QCOM_SCM_VMID_HLOS);
 	qproc->mba_perm = BIT(QCOM_SCM_VMID_HLOS);
@@ -1344,10 +1442,12 @@ static int q6v5_probe(struct platform_device *pdev)
 
 	ret = rproc_add(rproc);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	return 0;
 
+detach_proxy_pds:
+	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1364,6 +1464,9 @@ static int q6v5_remove(struct platform_device *pdev)
 	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
 	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
 	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
+
+	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+
 	rproc_free(qproc->rproc);
 
 	return 0;
@@ -1388,6 +1491,12 @@ static const struct rproc_hexagon_res sdm845_mss = {
 			"mnoc_axi",
 			NULL
 	},
+	.proxy_pd_names = (char*[]){
+			"cx",
+			"mx",
+			"mss",
+			NULL
+	},
 	.need_mem_protection = true,
 	.has_alt_reset = true,
 	.version = MSS_SDM845,
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* Re: [PATCH v3 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2019-01-22  5:51 ` [PATCH v3 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
@ 2019-01-23  0:28   ` Doug Anderson
  2019-01-23  1:10     ` Bjorn Andersson
  0 siblings, 1 reply; 200+ results
From: Doug Anderson @ 2019-01-23  0:28 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Sibi Sankar, Rob Herring, Mark Rutland,
	linux-arm-msm, devicetree, LKML

Hi,

On Mon, Jan 21, 2019 at 9:52 PM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> From: Sibi Sankar <sibis@codeaurora.org>
>
> This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>
> Changes since v2:
> - Picked up Sibi's patch
> - Fixed reg to work with address/size-cells as 2
>
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 5cc2615461da..78df5f1bce2d 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -1617,6 +1617,64 @@
>                         clock-names = "xo";
>                 };
>
> +               mss_pil: remoteproc@4080000 {
> +                       compatible = "qcom,sdm845-mss-pil";
> +                       reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;
> +                       reg-names = "qdsp6", "rmb";
> +
> +                       interrupts-extended =
> +                               <&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
> +                               <&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
> +                       interrupt-names = "wdog", "fatal", "ready",
> +                                         "handover", "stop-ack",
> +                                         "shutdown-ack";
> +
> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
> +                                <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
> +                                <&gcc GCC_BOOT_ROM_AHB_CLK>,
> +                                <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
> +                                <&gcc GCC_MSS_MFAB_AXIS_CLK>,
> +                                <&gcc GCC_PRNG_AHB_CLK>,
> +                                <&rpmhcc RPMH_CXO_CLK>;
> +                       clock-names = "iface", "bus", "mem", "gpll0_mss",
> +                                     "snoc_axi", "mnoc_axi", "prng", "xo";
> +
> +                       qcom,smem-states = <&modem_smp2p_out 0>;
> +                       qcom,smem-state-names = "stop";
> +
> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
> +                       reset-names = "mss_restart", "pdc_reset";
> +
> +                       qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>;
> +
> +                       power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
> +                                       <&rpmhpd SDM845_CX>,
> +                                       <&rpmhpd SDM845_MX>,
> +                                       <&rpmhpd SDM845_MSS>;
> +                       power-domain-names = "load_state", "cx", "mx", "mss";
> +
> +                       mba {
> +                               memory-region = <&mba_region>;
> +                       };
> +
> +                       mpss {
> +                               memory-region = <&mpss_region>;
> +                       };
> +
> +                       glink-edge {
> +                               interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
> +                               label = "modem";
> +                               qcom,remote-pid = <1>;
> +                               mboxes = <&apss_shared 12>;
> +                       };
> +               };
> +
>                 sdhc_2: sdhci@8804000 {

Can you please sort by unit address now that you have a device tree
that has more stuff?

-Doug

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
  2019-01-23  0:28   ` Doug Anderson
@ 2019-01-23  1:10     ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-23  1:10 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Andy Gross, David Brown, Sibi Sankar, Rob Herring, Mark Rutland,
	linux-arm-msm, devicetree, LKML

On Tue 22 Jan 16:28 PST 2019, Doug Anderson wrote:

> Hi,
> 
> On Mon, Jan 21, 2019 at 9:52 PM Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> >
> > From: Sibi Sankar <sibis@codeaurora.org>
> >
> > This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.
> >
> > Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> > Reviewed-by: Douglas Anderson <dianders@chromium.org>
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> >
> > Changes since v2:
> > - Picked up Sibi's patch
> > - Fixed reg to work with address/size-cells as 2
> >
> >  arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++
> >  1 file changed, 58 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > index 5cc2615461da..78df5f1bce2d 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > @@ -1617,6 +1617,64 @@
> >                         clock-names = "xo";
> >                 };
> >
> > +               mss_pil: remoteproc@4080000 {
> > +                       compatible = "qcom,sdm845-mss-pil";
> > +                       reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;
> > +                       reg-names = "qdsp6", "rmb";
> > +
> > +                       interrupts-extended =
> > +                               <&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
> > +                               <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> > +                               <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> > +                               <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> > +                               <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
> > +                               <&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
> > +                       interrupt-names = "wdog", "fatal", "ready",
> > +                                         "handover", "stop-ack",
> > +                                         "shutdown-ack";
> > +
> > +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
> > +                                <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
> > +                                <&gcc GCC_BOOT_ROM_AHB_CLK>,
> > +                                <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
> > +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
> > +                                <&gcc GCC_MSS_MFAB_AXIS_CLK>,
> > +                                <&gcc GCC_PRNG_AHB_CLK>,
> > +                                <&rpmhcc RPMH_CXO_CLK>;
> > +                       clock-names = "iface", "bus", "mem", "gpll0_mss",
> > +                                     "snoc_axi", "mnoc_axi", "prng", "xo";
> > +
> > +                       qcom,smem-states = <&modem_smp2p_out 0>;
> > +                       qcom,smem-state-names = "stop";
> > +
> > +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
> > +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
> > +                       reset-names = "mss_restart", "pdc_reset";
> > +
> > +                       qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>;
> > +
> > +                       power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
> > +                                       <&rpmhpd SDM845_CX>,
> > +                                       <&rpmhpd SDM845_MX>,
> > +                                       <&rpmhpd SDM845_MSS>;
> > +                       power-domain-names = "load_state", "cx", "mx", "mss";
> > +
> > +                       mba {
> > +                               memory-region = <&mba_region>;
> > +                       };
> > +
> > +                       mpss {
> > +                               memory-region = <&mpss_region>;
> > +                       };
> > +
> > +                       glink-edge {
> > +                               interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
> > +                               label = "modem";
> > +                               qcom,remote-pid = <1>;
> > +                               mboxes = <&apss_shared 12>;
> > +                       };
> > +               };
> > +
> >                 sdhc_2: sdhci@8804000 {
> 
> Can you please sort by unit address now that you have a device tree
> that has more stuff?
> 

Of course, sorry for missing that.

Regards,
Bjorn

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 01/10] arm64: dts: qcom: sdm845: Update PIL region memory map
      [irrelevant] ` <20190122055112.30943-2-bjorn.andersson@linaro.org>
@ 2019-01-25 17:40   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-25 17:40 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	linux-arm-msm, devicetree, linux-kernel

Hey Bjorn,

On 2019-01-22 11:21, Bjorn Andersson wrote:
> Update existing and add all missing PIL regions to the reserved memory
> map, as described in version 10.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v2:
> - New patch
> 
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 61 ++++++++++++++++++++++++++--
>  1 file changed, 58 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 0ec827394e92..cdcac3704c13 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -89,12 +89,47 @@
>  		};

Shouldn't we add hyp and xbl regions
as well?

> 
>  		memory@86200000 {
> -			reg = <0 0x86200000 0 0x2d00000>;
> +			reg = <0 0x86200000 0 0x100000>;
>  			no-map;
>  		};
> 
> -		wlan_msa_mem: memory@96700000 {
> -			reg = <0 0x96700000 0 0x100000>;
> +		memory@86300000 {
> +			reg = <0 0x86300000 0 0x4800000>;

from v10 I see we don't need to reserve the
last 28M it just needs to be

reg = <0 0x86300000 0 0x2c00000>;

> +			no-map;
> +		};
> +
> +		memory@8ab00000 {
> +			reg = <0 0x8ab00000 0 0x1400000>;
> +			no-map;
> +		};
> +
> +		memory@8bf00000 {
> +			reg = <0 0x8bf00000 0 0x500000>;
> +			no-map;
> +		};
> +
> +		ipa_fw_mem: memory@8c400000 {
> +			reg = <0 0x8c400000 0 0x10000>;
> +			no-map;
> +		};
> +
> +		ipa_gsi_mem: memory@8c410000 {
> +			reg = <0 0x8c410000 0 0x5000>;
> +			no-map;
> +		};
> +
> +		memory@8c415000 {
> +			reg = <0 0x8c415000 0 0x2000>;
> +			no-map;
> +		};
> +
> +		adsp_mem: memory@8c500000 {
> +			reg = <0 0x8c500000 0 0x1a00000>;
> +			no-map;
> +		};
> +
> +		wlan_msa_mem: memory@8df00000 {
> +			reg = <0 0x8df00000 0 0x100000>;
>  			no-map;
>  		};
> 
> @@ -103,10 +138,30 @@
>  			no-map;
>  		};
> 
> +		venus_mem: memory@95800000 {
> +			reg = <0 0x95800000 0 0x500000>;
> +			no-map;
> +		};
> +
> +		cdsp_mem: memory@95d00000 {
> +			reg = <0 0x95d00000 0 0x800000>;
> +			no-map;
> +		};
> +
>  		mba_region: memory@96500000 {

should we re-name mba_region/mpss_region
to mba_mem and mpss_mem for consistency.

>  			reg = <0 0x96500000 0 0x200000>;
>  			no-map;
>  		};
> +
> +		slpi_mem: memory@96700000 {
> +			reg = <0 0x96700000 0 0x1400000>;
> +			no-map;
> +		};
> +
> +		spss_mem: memory@97b00000 {
> +			reg = <0 0x97b00000 0 0x100000>;
> +			no-map;
> +		};
>  	};
> 
>  	cpus {

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* Re: [PATCH v5] arm64: dts: sdm845: add video nodes
      [irrelevant] <1548403893-21677-1-git-send-email-mgottam@codeaurora.org>
@ 2019-01-28  8:32 ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-28  8:32 UTC (permalink / raw)
  To: Malathi Gottam
  Cc: andy.gross, david.brown, robh+dt, mark.rutland, devicetree,
	linux-kernel, linux-arm-msm, acourbot, stanimir.varbanov,
	vgarodia, linux-arm-msm-owner, bjorn.andersson

Hi Malathi,

Bjorn has a patch adding all reserved memory
nodes from version 10 so you can probably drop
the venus_region node from the patch.

https://patchwork.kernel.org/patch/10774869/

On 2019-01-25 13:41, Malathi Gottam wrote:
> This adds video nodes to sdm845 based on the examples
> in the bindings.
> 
> Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
> ---
> Changes:
> 	Added video firmware node
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 38 
> ++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index b72bdb0..1af68f5 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -87,6 +87,11 @@
>  			reg = <0 0x86200000 0 0x2d00000>;
>  			no-map;
>  		};
> +
> +		venus_region: memory@95800000 {
> +			reg = <0x0 0x95800000 0x0 0x500000>;
> +			no-map;
> +		};
>  	};
> 
>  	cpus {
> @@ -1403,5 +1408,38 @@
>  				status = "disabled";
>  			};
>  		};
> +
> +		video-codec@aa00000 {
> +			compatible = "qcom,sdm845-venus";
> +			reg = <0x0aa00000 0xff000>;
> +			interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
> +			power-domains = <&videocc VENUS_GDSC>;
> +			clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>,
> +				 <&videocc VIDEO_CC_VENUS_AHB_CLK>,
> +				 <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>;
> +			clock-names = "core", "iface", "bus";
> +			iommus = <&apps_smmu 0x10a0 0x8>,
> +				 <&apps_smmu 0x10b0 0x0>;
> +			memory-region = <&venus_region>;
> +
> +			video-core0 {
> +				compatible = "venus-decoder";
> +				clocks = <&videocc VIDEO_CC_VCODEC0_CORE_CLK>,
> +					 <&videocc VIDEO_CC_VCODEC0_AXI_CLK>;
> +				clock-names = "core", "bus";
> +				power-domains = <&videocc VCODEC0_GDSC>;
> +			};
> +
> +			video-core1 {
> +				compatible = "venus-encoder";
> +				clocks = <&videocc VIDEO_CC_VCODEC1_CORE_CLK>,
> +					 <&videocc VIDEO_CC_VCODEC1_AXI_CLK>;
> +				clock-names = "core", "bus";
> +				power-domains = <&videocc VCODEC1_GDSC>;
> +			};
> +			video-firmware {
> +				iommus = <&apps_smmu 0x10b2 0x0>;
> +			};
> +		};
>  	};
>  };

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 6%]

* [PATCH v4 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
      [irrelevant] <20190129232009.5033-1-bjorn.andersson@linaro.org>
  2019-01-29 23:20 ` [PATCH v4 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
  2019-01-29 23:20 ` [PATCH v4 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
@ 2019-01-29 23:20 ` Bjorn Andersson
  2 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-29 23:20 UTC (permalink / raw)
  To: Andy Gross, David Brown
  Cc: Rob Herring, Mark Rutland, Ohad Ben-Cohen,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

From: Sibi Sankar <sibis@codeaurora.org>

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v3:
- Fixed sort order in /soc

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 24c30be974bf..eb02c39d2048 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1618,6 +1618,64 @@
 			};
 		};
 
+		mss_pil: remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+			};
+		};
+
 		gpucc: clock-controller@5090000 {
 			compatible = "qcom,sdm845-gpucc";
 			reg = <0 0x05090000 0 0x9000>;
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* [PATCH v4 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains
      [irrelevant] <20190129232009.5033-1-bjorn.andersson@linaro.org>
@ 2019-01-29 23:20 ` Bjorn Andersson
  2019-01-29 23:20 ` [PATCH v4 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
  2019-01-29 23:20 ` [PATCH v4 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
  2 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-29 23:20 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

From: Rajendra Nayak <rnayak@codeaurora.org>

With rpmh ARC resources being modelled as power domains with performance
state, we need to proxy vote on these for SDM845.
Add support to vote on multiple of them, now that genpd supports
associating mutliple power domains to a device.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
[bjorn: Drop device link, improve error handling, name things "proxy"]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v3:
- Rebased upon latest remoteproc branch

 drivers/remoteproc/qcom_q6v5_mss.c | 119 +++++++++++++++++++++++++++--
 1 file changed, 114 insertions(+), 5 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 07d1cc52a647..c32c63e351a0 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -25,6 +25,8 @@
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/remoteproc.h>
@@ -131,6 +133,7 @@ struct rproc_hexagon_res {
 	char **proxy_clk_names;
 	char **reset_clk_names;
 	char **active_clk_names;
+	char **proxy_pd_names;
 	int version;
 	bool need_mem_protection;
 	bool has_alt_reset;
@@ -156,9 +159,11 @@ struct q6v5 {
 	struct clk *active_clks[8];
 	struct clk *reset_clks[4];
 	struct clk *proxy_clks[4];
+	struct device *proxy_pds[3];
 	int active_clk_count;
 	int reset_clk_count;
 	int proxy_clk_count;
+	int proxy_pd_count;
 
 	struct reg_info active_regs[1];
 	struct reg_info proxy_regs[3];
@@ -321,6 +326,41 @@ static void q6v5_clk_disable(struct device *dev,
 		clk_disable_unprepare(clks[i]);
 }
 
+static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds,
+			   size_t pd_count)
+{
+	int ret;
+	int i;
+
+	for (i = 0; i < pd_count; i++) {
+		dev_pm_genpd_set_performance_state(pds[i], INT_MAX);
+		ret = pm_runtime_get_sync(pds[i]);
+		if (ret < 0)
+			goto unroll_pd_votes;
+	}
+
+	return 0;
+
+unroll_pd_votes:
+	for (i--; i >= 0; i--) {
+		dev_pm_genpd_set_performance_state(pds[i], 0);
+		pm_runtime_put(pds[i]);
+	}
+
+	return ret;
+};
+
+static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
+			     size_t pd_count)
+{
+	int i;
+
+	for (i = 0; i < pd_count; i++) {
+		dev_pm_genpd_set_performance_state(pds[i], 0);
+		pm_runtime_put(pds[i]);
+	}
+}
+
 static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm,
 				   bool remote_owner, phys_addr_t addr,
 				   size_t size)
@@ -690,11 +730,17 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
+	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+	if (ret < 0) {
+		dev_err(qproc->dev, "failed to enable proxy power domains\n");
+		goto disable_irqs;
+	}
+
 	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
 				    qproc->proxy_reg_count);
 	if (ret) {
 		dev_err(qproc->dev, "failed to enable proxy supplies\n");
-		goto disable_irqs;
+		goto disable_proxy_pds;
 	}
 
 	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
@@ -791,6 +837,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 disable_proxy_reg:
 	q6v5_regulator_disable(qproc, qproc->proxy_regs,
 			       qproc->proxy_reg_count);
+disable_proxy_pds:
+	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
@@ -841,6 +889,8 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
 
 	ret = qcom_q6v5_unprepare(&qproc->q6v5);
 	if (ret) {
+		q6v5_pds_disable(qproc, qproc->proxy_pds,
+				 qproc->proxy_pd_count);
 		q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
 				 qproc->proxy_clk_count);
 		q6v5_regulator_disable(qproc, qproc->proxy_regs,
@@ -1121,6 +1171,7 @@ static void qcom_msa_handover(struct qcom_q6v5 *q6v5)
 			 qproc->proxy_clk_count);
 	q6v5_regulator_disable(qproc, qproc->proxy_regs,
 			       qproc->proxy_reg_count);
+	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 }
 
 static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device *pdev)
@@ -1181,6 +1232,45 @@ static int q6v5_init_clocks(struct device *dev, struct clk **clks,
 	return i;
 }
 
+static int q6v5_pds_attach(struct device *dev, struct device **devs,
+			   char **pd_names)
+{
+	size_t num_pds = 0;
+	int ret;
+	int i;
+
+	if (!pd_names)
+		return 0;
+
+	while (pd_names[num_pds])
+		num_pds++;
+
+	for (i = 0; i < num_pds; i++) {
+		devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
+		if (IS_ERR(devs[i])) {
+			ret = PTR_ERR(devs[i]);
+			goto unroll_attach;
+		}
+	}
+
+	return num_pds;
+
+unroll_attach:
+	for (i--; i >= 0; i--)
+		dev_pm_domain_detach(devs[i], false);
+
+	return ret;
+};
+
+static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
+			    size_t pd_count)
+{
+	int i;
+
+	for (i = 0; i < pd_count; i++)
+		dev_pm_domain_detach(pds[i], false);
+}
+
 static int q6v5_init_reset(struct q6v5 *qproc)
 {
 	qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev,
@@ -1322,10 +1412,18 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
+			      desc->proxy_pd_names);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to init power domains\n");
+		goto free_rproc;
+	}
+	qproc->proxy_pd_count = ret;
+
 	qproc->has_alt_reset = desc->has_alt_reset;
 	ret = q6v5_init_reset(qproc);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	qproc->version = desc->version;
 	qproc->need_mem_protection = desc->need_mem_protection;
@@ -1333,7 +1431,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
 			     qcom_msa_handover);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	qproc->mpss_perm = BIT(QCOM_SCM_VMID_HLOS);
 	qproc->mba_perm = BIT(QCOM_SCM_VMID_HLOS);
@@ -1343,15 +1441,17 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
 	if (IS_ERR(qproc->sysmon)) {
 		ret = PTR_ERR(qproc->sysmon);
-		goto free_rproc;
+		goto detach_proxy_pds;
 	}
 
 	ret = rproc_add(rproc);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	return 0;
 
+detach_proxy_pds:
+	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1368,6 +1468,9 @@ static int q6v5_remove(struct platform_device *pdev)
 	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
 	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
 	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
+
+	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+
 	rproc_free(qproc->rproc);
 
 	return 0;
@@ -1392,6 +1495,12 @@ static const struct rproc_hexagon_res sdm845_mss = {
 			"mnoc_axi",
 			NULL
 	},
+	.proxy_pd_names = (char*[]){
+			"cx",
+			"mx",
+			"mss",
+			NULL
+	},
 	.need_mem_protection = true,
 	.has_alt_reset = true,
 	.version = MSS_SDM845,
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* [PATCH v4 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845
      [irrelevant] <20190129232009.5033-1-bjorn.andersson@linaro.org>
  2019-01-29 23:20 ` [PATCH v4 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
@ 2019-01-29 23:20 ` Bjorn Andersson
  2019-01-29 23:20 ` [PATCH v4 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
  2 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-29 23:20 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

The SDM845 MSS needs the load_state powerdomain voted for during the
duration of the MSS being powered on, to let the AOSS know that it may
not perform certain power save measures. So vote for this.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v3:
- None

 drivers/remoteproc/qcom_q6v5_mss.c | 31 ++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c32c63e351a0..e30f5486fd20 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -133,6 +133,7 @@ struct rproc_hexagon_res {
 	char **proxy_clk_names;
 	char **reset_clk_names;
 	char **active_clk_names;
+	char **active_pd_names;
 	char **proxy_pd_names;
 	int version;
 	bool need_mem_protection;
@@ -159,10 +160,12 @@ struct q6v5 {
 	struct clk *active_clks[8];
 	struct clk *reset_clks[4];
 	struct clk *proxy_clks[4];
+	struct device *active_pds[1];
 	struct device *proxy_pds[3];
 	int active_clk_count;
 	int reset_clk_count;
 	int proxy_clk_count;
+	int active_pd_count;
 	int proxy_pd_count;
 
 	struct reg_info active_regs[1];
@@ -730,10 +733,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
+	ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count);
+	if (ret < 0) {
+		dev_err(qproc->dev, "failed to enable active power domains\n");
+		goto disable_irqs;
+	}
+
 	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 	if (ret < 0) {
 		dev_err(qproc->dev, "failed to enable proxy power domains\n");
-		goto disable_irqs;
+		goto disable_active_pds;
 	}
 
 	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
@@ -839,6 +848,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 			       qproc->proxy_reg_count);
 disable_proxy_pds:
 	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+disable_active_pds:
+	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
@@ -878,6 +889,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
 			 qproc->active_clk_count);
 	q6v5_regulator_disable(qproc, qproc->active_regs,
 			       qproc->active_reg_count);
+	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
 
 	/* In case of failure or coredump scenario where reclaiming MBA memory
 	 * could not happen reclaim it here.
@@ -1412,11 +1424,19 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds,
+			      desc->active_pd_names);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to attach active power domains\n");
+		goto free_rproc;
+	}
+	qproc->active_pd_count = ret;
+
 	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
 			      desc->proxy_pd_names);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to init power domains\n");
-		goto free_rproc;
+		goto detach_active_pds;
 	}
 	qproc->proxy_pd_count = ret;
 
@@ -1452,6 +1472,8 @@ static int q6v5_probe(struct platform_device *pdev)
 
 detach_proxy_pds:
 	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+detach_active_pds:
+	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1469,6 +1491,7 @@ static int q6v5_remove(struct platform_device *pdev)
 	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
 	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
 
+	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
 	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 
 	rproc_free(qproc->rproc);
@@ -1495,6 +1518,10 @@ static const struct rproc_hexagon_res sdm845_mss = {
 			"mnoc_axi",
 			NULL
 	},
+	.active_pd_names = (char*[]){
+			"load_state",
+			NULL
+	},
 	.proxy_pd_names = (char*[]){
 			"cx",
 			"mx",
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* Re: [PATCH v3] remoteproc: qcom: Add support for parsing fw dt bindings
  2019-01-14 19:50 [PATCH v3] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
@ 2019-01-30 21:04 ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-30 21:04 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: briannorris, david.brown, robh+dt, mark.rutland, andy.gross,
	akdwived, clew, linux-kernel, linux-arm-msm-owner, ohad,
	linux-remoteproc, devicetree, dianders

On Mon 14 Jan 11:50 PST 2019, Sibi Sankar wrote:

> Add support for parsing "firmware-name" dt bindings which specifies
> the relative paths of mba/modem/pas image as strings. Fallback to
> the default paths for mba/modem/pas image on -EINVAL.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

Applied,

Thanks,
Bjorn

> ---
> 
> v3:
>  * Fixed minor code style issues
>  * Add comments for firmware blob name generation
>    and use sprintf instead
> 
>  drivers/remoteproc/qcom_q6v5_mss.c | 47 +++++++++++++++++++++++-------
>  drivers/remoteproc/qcom_q6v5_pas.c |  9 +++++-
>  2 files changed, 45 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index c86dc40cfb8c..41e92a025d21 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -188,6 +188,7 @@ struct q6v5 {
>  	bool has_alt_reset;
>  	int mpss_perm;
>  	int mba_perm;
> +	const char *hexagon_mdt_image;
>  	int version;
>  };
>  
> @@ -860,17 +861,26 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  	phys_addr_t min_addr = PHYS_ADDR_MAX;
>  	phys_addr_t max_addr = 0;
>  	bool relocate = false;
> -	char seg_name[10];
> +	char *fw_name;
> +	size_t fw_name_len;
>  	ssize_t offset;
>  	size_t size = 0;
>  	void *ptr;
>  	int ret;
>  	int i;
>  
> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
> +	fw_name_len = strlen(qproc->hexagon_mdt_image);
> +	if (fw_name_len <= 4)
> +		return -EINVAL;
> +
> +	fw_name = kstrdup(qproc->hexagon_mdt_image, GFP_KERNEL);
> +	if (!fw_name)
> +		return -ENOMEM;
> +
> +	ret = request_firmware(&fw, fw_name, qproc->dev);
>  	if (ret < 0) {
> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
> -		return ret;
> +		dev_err(qproc->dev, "unable to load %s\n", fw_name);
> +		goto out;
>  	}
>  
>  	/* Initialize the RMB validator */
> @@ -918,10 +928,11 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  		ptr = qproc->mpss_region + offset;
>  
>  		if (phdr->p_filesz) {
> -			snprintf(seg_name, sizeof(seg_name), "modem.b%02d", i);
> -			ret = request_firmware(&seg_fw, seg_name, qproc->dev);
> +			/* Replace "xxx.xxx" with "xxx.bxx" */
> +			sprintf(fw_name + fw_name_len - 3, "b%02d", i);
> +			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
>  			if (ret) {
> -				dev_err(qproc->dev, "failed to load %s\n", seg_name);
> +				dev_err(qproc->dev, "failed to load %s\n", fw_name);
>  				goto release_firmware;
>  			}
>  
> @@ -960,6 +971,8 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
>  
>  release_firmware:
>  	release_firmware(fw);
> +out:
> +	kfree(fw_name);
>  
>  	return ret < 0 ? ret : 0;
>  }
> @@ -1075,9 +1088,10 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
>  	unsigned long i;
>  	int ret;
>  
> -	ret = request_firmware(&fw, "modem.mdt", qproc->dev);
> +	ret = request_firmware(&fw, qproc->hexagon_mdt_image, qproc->dev);
>  	if (ret < 0) {
> -		dev_err(qproc->dev, "unable to load modem.mdt\n");
> +		dev_err(qproc->dev, "unable to load %s\n",
> +			qproc->hexagon_mdt_image);
>  		return ret;
>  	}
>  
> @@ -1253,6 +1267,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	const struct rproc_hexagon_res *desc;
>  	struct q6v5 *qproc;
>  	struct rproc *rproc;
> +	const char *mba_image;
>  	int ret;
>  
>  	desc = of_device_get_match_data(&pdev->dev);
> @@ -1262,8 +1277,14 @@ static int q6v5_probe(struct platform_device *pdev)
>  	if (desc->need_mem_protection && !qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> +	mba_image = desc->hexagon_mba_image;
> +	ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
> +					    0, &mba_image);
> +	if (ret < 0 && ret != -EINVAL)
> +		return ret;
> +
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
> -			    desc->hexagon_mba_image, sizeof(*qproc));
> +			    mba_image, sizeof(*qproc));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "failed to allocate rproc\n");
>  		return -ENOMEM;
> @@ -1272,6 +1293,12 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qproc = (struct q6v5 *)rproc->priv;
>  	qproc->dev = &pdev->dev;
>  	qproc->rproc = rproc;
> +	qproc->hexagon_mdt_image = "modem.mdt";
> +	ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
> +					    1, &qproc->hexagon_mdt_image);
> +	if (ret < 0 && ret != -EINVAL)
> +		return ret;
> +
>  	platform_set_drvdata(pdev, qproc);
>  
>  	ret = q6v5_init_mem(qproc, pdev);
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index b1e63fcd5fdf..cfdafd68e2cd 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -258,6 +258,7 @@ static int adsp_probe(struct platform_device *pdev)
>  	const struct adsp_data *desc;
>  	struct qcom_adsp *adsp;
>  	struct rproc *rproc;
> +	const char *fw_name;
>  	int ret;
>  
>  	desc = of_device_get_match_data(&pdev->dev);
> @@ -267,8 +268,14 @@ static int adsp_probe(struct platform_device *pdev)
>  	if (!qcom_scm_is_available())
>  		return -EPROBE_DEFER;
>  
> +	fw_name = desc->firmware_name;
> +	ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> +				      &fw_name);
> +	if (ret < 0 && ret != -EINVAL)
> +		return ret;
> +
>  	rproc = rproc_alloc(&pdev->dev, pdev->name, &adsp_ops,
> -			    desc->firmware_name, sizeof(*adsp));
> +			    fw_name, sizeof(*adsp));
>  	if (!rproc) {
>  		dev_err(&pdev->dev, "unable to allocate remoteproc\n");
>  		return -ENOMEM;
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[relevance 0%]

* [PATCH v5 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
      [irrelevant] <20190131003933.11436-1-bjorn.andersson@linaro.org>
  2019-01-31  0:39 ` [PATCH v5 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
  2019-01-31  0:39 ` [PATCH v5 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
@ 2019-01-31  0:39 ` Bjorn Andersson
      [irrelevant] ` <20190131003933.11436-2-bjorn.andersson@linaro.org>
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-31  0:39 UTC (permalink / raw)
  To: Andy Gross, David Brown
  Cc: Rob Herring, Mark Rutland, Ohad Ben-Cohen,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

From: Sibi Sankar <sibis@codeaurora.org>

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v4:
- None

Changes since v3:
- Fixed sort order in /soc

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index dc43fee8bb90..cba09899282e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1613,6 +1613,64 @@
 			};
 		};
 
+		mss_pil: remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+			};
+		};
+
 		gpucc: clock-controller@5090000 {
 			compatible = "qcom,sdm845-gpucc";
 			reg = <0 0x05090000 0 0x9000>;
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* [PATCH v5 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845
      [irrelevant] <20190131003933.11436-1-bjorn.andersson@linaro.org>
  2019-01-31  0:39 ` [PATCH v5 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
@ 2019-01-31  0:39 ` Bjorn Andersson
  2019-01-31  4:51   ` Bjorn Andersson
  2019-01-31  0:39 ` [PATCH v5 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2019-01-31  0:39 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

The SDM845 MSS needs the load_state powerdomain voted for during the
duration of the MSS being powered on, to let the AOSS know that it may
not perform certain power save measures. So vote for this.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v4:
- None

Changes since v3:
- None

 drivers/remoteproc/qcom_q6v5_mss.c | 31 ++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index c32c63e351a0..e30f5486fd20 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -133,6 +133,7 @@ struct rproc_hexagon_res {
 	char **proxy_clk_names;
 	char **reset_clk_names;
 	char **active_clk_names;
+	char **active_pd_names;
 	char **proxy_pd_names;
 	int version;
 	bool need_mem_protection;
@@ -159,10 +160,12 @@ struct q6v5 {
 	struct clk *active_clks[8];
 	struct clk *reset_clks[4];
 	struct clk *proxy_clks[4];
+	struct device *active_pds[1];
 	struct device *proxy_pds[3];
 	int active_clk_count;
 	int reset_clk_count;
 	int proxy_clk_count;
+	int active_pd_count;
 	int proxy_pd_count;
 
 	struct reg_info active_regs[1];
@@ -730,10 +733,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
+	ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count);
+	if (ret < 0) {
+		dev_err(qproc->dev, "failed to enable active power domains\n");
+		goto disable_irqs;
+	}
+
 	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 	if (ret < 0) {
 		dev_err(qproc->dev, "failed to enable proxy power domains\n");
-		goto disable_irqs;
+		goto disable_active_pds;
 	}
 
 	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
@@ -839,6 +848,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 			       qproc->proxy_reg_count);
 disable_proxy_pds:
 	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+disable_active_pds:
+	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
@@ -878,6 +889,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
 			 qproc->active_clk_count);
 	q6v5_regulator_disable(qproc, qproc->active_regs,
 			       qproc->active_reg_count);
+	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
 
 	/* In case of failure or coredump scenario where reclaiming MBA memory
 	 * could not happen reclaim it here.
@@ -1412,11 +1424,19 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds,
+			      desc->active_pd_names);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to attach active power domains\n");
+		goto free_rproc;
+	}
+	qproc->active_pd_count = ret;
+
 	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
 			      desc->proxy_pd_names);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to init power domains\n");
-		goto free_rproc;
+		goto detach_active_pds;
 	}
 	qproc->proxy_pd_count = ret;
 
@@ -1452,6 +1472,8 @@ static int q6v5_probe(struct platform_device *pdev)
 
 detach_proxy_pds:
 	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+detach_active_pds:
+	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1469,6 +1491,7 @@ static int q6v5_remove(struct platform_device *pdev)
 	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
 	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
 
+	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
 	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 
 	rproc_free(qproc->rproc);
@@ -1495,6 +1518,10 @@ static const struct rproc_hexagon_res sdm845_mss = {
 			"mnoc_axi",
 			NULL
 	},
+	.active_pd_names = (char*[]){
+			"load_state",
+			NULL
+	},
 	.proxy_pd_names = (char*[]){
 			"cx",
 			"mx",
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* [PATCH v5 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains
      [irrelevant] <20190131003933.11436-1-bjorn.andersson@linaro.org>
@ 2019-01-31  0:39 ` Bjorn Andersson
  2019-01-31  4:51   ` Bjorn Andersson
  2019-01-31  0:39 ` [PATCH v5 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 200+ results
From: Bjorn Andersson @ 2019-01-31  0:39 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

From: Rajendra Nayak <rnayak@codeaurora.org>

With rpmh ARC resources being modelled as power domains with performance
state, we need to proxy vote on these for SDM845.
Add support to vote on multiple of them, now that genpd supports
associating mutliple power domains to a device.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
[bjorn: Drop device link, improve error handling, name things "proxy"]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v4:
- None

Changes since v3:
- Rebased upon latest remoteproc branch

 drivers/remoteproc/qcom_q6v5_mss.c | 119 +++++++++++++++++++++++++++--
 1 file changed, 114 insertions(+), 5 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 07d1cc52a647..c32c63e351a0 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -25,6 +25,8 @@
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/remoteproc.h>
@@ -131,6 +133,7 @@ struct rproc_hexagon_res {
 	char **proxy_clk_names;
 	char **reset_clk_names;
 	char **active_clk_names;
+	char **proxy_pd_names;
 	int version;
 	bool need_mem_protection;
 	bool has_alt_reset;
@@ -156,9 +159,11 @@ struct q6v5 {
 	struct clk *active_clks[8];
 	struct clk *reset_clks[4];
 	struct clk *proxy_clks[4];
+	struct device *proxy_pds[3];
 	int active_clk_count;
 	int reset_clk_count;
 	int proxy_clk_count;
+	int proxy_pd_count;
 
 	struct reg_info active_regs[1];
 	struct reg_info proxy_regs[3];
@@ -321,6 +326,41 @@ static void q6v5_clk_disable(struct device *dev,
 		clk_disable_unprepare(clks[i]);
 }
 
+static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds,
+			   size_t pd_count)
+{
+	int ret;
+	int i;
+
+	for (i = 0; i < pd_count; i++) {
+		dev_pm_genpd_set_performance_state(pds[i], INT_MAX);
+		ret = pm_runtime_get_sync(pds[i]);
+		if (ret < 0)
+			goto unroll_pd_votes;
+	}
+
+	return 0;
+
+unroll_pd_votes:
+	for (i--; i >= 0; i--) {
+		dev_pm_genpd_set_performance_state(pds[i], 0);
+		pm_runtime_put(pds[i]);
+	}
+
+	return ret;
+};
+
+static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
+			     size_t pd_count)
+{
+	int i;
+
+	for (i = 0; i < pd_count; i++) {
+		dev_pm_genpd_set_performance_state(pds[i], 0);
+		pm_runtime_put(pds[i]);
+	}
+}
+
 static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm,
 				   bool remote_owner, phys_addr_t addr,
 				   size_t size)
@@ -690,11 +730,17 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 
 	qcom_q6v5_prepare(&qproc->q6v5);
 
+	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+	if (ret < 0) {
+		dev_err(qproc->dev, "failed to enable proxy power domains\n");
+		goto disable_irqs;
+	}
+
 	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
 				    qproc->proxy_reg_count);
 	if (ret) {
 		dev_err(qproc->dev, "failed to enable proxy supplies\n");
-		goto disable_irqs;
+		goto disable_proxy_pds;
 	}
 
 	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
@@ -791,6 +837,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
 disable_proxy_reg:
 	q6v5_regulator_disable(qproc, qproc->proxy_regs,
 			       qproc->proxy_reg_count);
+disable_proxy_pds:
+	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 disable_irqs:
 	qcom_q6v5_unprepare(&qproc->q6v5);
 
@@ -841,6 +889,8 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
 
 	ret = qcom_q6v5_unprepare(&qproc->q6v5);
 	if (ret) {
+		q6v5_pds_disable(qproc, qproc->proxy_pds,
+				 qproc->proxy_pd_count);
 		q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
 				 qproc->proxy_clk_count);
 		q6v5_regulator_disable(qproc, qproc->proxy_regs,
@@ -1121,6 +1171,7 @@ static void qcom_msa_handover(struct qcom_q6v5 *q6v5)
 			 qproc->proxy_clk_count);
 	q6v5_regulator_disable(qproc, qproc->proxy_regs,
 			       qproc->proxy_reg_count);
+	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 }
 
 static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device *pdev)
@@ -1181,6 +1232,45 @@ static int q6v5_init_clocks(struct device *dev, struct clk **clks,
 	return i;
 }
 
+static int q6v5_pds_attach(struct device *dev, struct device **devs,
+			   char **pd_names)
+{
+	size_t num_pds = 0;
+	int ret;
+	int i;
+
+	if (!pd_names)
+		return 0;
+
+	while (pd_names[num_pds])
+		num_pds++;
+
+	for (i = 0; i < num_pds; i++) {
+		devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
+		if (IS_ERR(devs[i])) {
+			ret = PTR_ERR(devs[i]);
+			goto unroll_attach;
+		}
+	}
+
+	return num_pds;
+
+unroll_attach:
+	for (i--; i >= 0; i--)
+		dev_pm_domain_detach(devs[i], false);
+
+	return ret;
+};
+
+static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
+			    size_t pd_count)
+{
+	int i;
+
+	for (i = 0; i < pd_count; i++)
+		dev_pm_domain_detach(pds[i], false);
+}
+
 static int q6v5_init_reset(struct q6v5 *qproc)
 {
 	qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev,
@@ -1322,10 +1412,18 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
+	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
+			      desc->proxy_pd_names);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to init power domains\n");
+		goto free_rproc;
+	}
+	qproc->proxy_pd_count = ret;
+
 	qproc->has_alt_reset = desc->has_alt_reset;
 	ret = q6v5_init_reset(qproc);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	qproc->version = desc->version;
 	qproc->need_mem_protection = desc->need_mem_protection;
@@ -1333,7 +1431,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
 			     qcom_msa_handover);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	qproc->mpss_perm = BIT(QCOM_SCM_VMID_HLOS);
 	qproc->mba_perm = BIT(QCOM_SCM_VMID_HLOS);
@@ -1343,15 +1441,17 @@ static int q6v5_probe(struct platform_device *pdev)
 	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
 	if (IS_ERR(qproc->sysmon)) {
 		ret = PTR_ERR(qproc->sysmon);
-		goto free_rproc;
+		goto detach_proxy_pds;
 	}
 
 	ret = rproc_add(rproc);
 	if (ret)
-		goto free_rproc;
+		goto detach_proxy_pds;
 
 	return 0;
 
+detach_proxy_pds:
+	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
 free_rproc:
 	rproc_free(rproc);
 
@@ -1368,6 +1468,9 @@ static int q6v5_remove(struct platform_device *pdev)
 	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
 	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
 	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
+
+	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
+
 	rproc_free(qproc->rproc);
 
 	return 0;
@@ -1392,6 +1495,12 @@ static const struct rproc_hexagon_res sdm845_mss = {
 			"mnoc_axi",
 			NULL
 	},
+	.proxy_pd_names = (char*[]){
+			"cx",
+			"mx",
+			"mss",
+			NULL
+	},
 	.need_mem_protection = true,
 	.has_alt_reset = true,
 	.version = MSS_SDM845,
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* Re: [PATCH v5 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains
  2019-01-31  0:39 ` [PATCH v5 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
@ 2019-01-31  4:51   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-31  4:51 UTC (permalink / raw)
  To: Ohad Ben-Cohen
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

On Wed 30 Jan 16:39 PST 2019, Bjorn Andersson wrote:

> From: Rajendra Nayak <rnayak@codeaurora.org>
> 
> With rpmh ARC resources being modelled as power domains with performance
> state, we need to proxy vote on these for SDM845.
> Add support to vote on multiple of them, now that genpd supports
> associating mutliple power domains to a device.
> 
> Tested-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> [bjorn: Drop device link, improve error handling, name things "proxy"]
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 

Applied

> Changes since v4:
> - None
> 
> Changes since v3:
> - Rebased upon latest remoteproc branch
> 
>  drivers/remoteproc/qcom_q6v5_mss.c | 119 +++++++++++++++++++++++++++--
>  1 file changed, 114 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index 07d1cc52a647..c32c63e351a0 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -25,6 +25,8 @@
>  #include <linux/of_address.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/remoteproc.h>
> @@ -131,6 +133,7 @@ struct rproc_hexagon_res {
>  	char **proxy_clk_names;
>  	char **reset_clk_names;
>  	char **active_clk_names;
> +	char **proxy_pd_names;
>  	int version;
>  	bool need_mem_protection;
>  	bool has_alt_reset;
> @@ -156,9 +159,11 @@ struct q6v5 {
>  	struct clk *active_clks[8];
>  	struct clk *reset_clks[4];
>  	struct clk *proxy_clks[4];
> +	struct device *proxy_pds[3];
>  	int active_clk_count;
>  	int reset_clk_count;
>  	int proxy_clk_count;
> +	int proxy_pd_count;
>  
>  	struct reg_info active_regs[1];
>  	struct reg_info proxy_regs[3];
> @@ -321,6 +326,41 @@ static void q6v5_clk_disable(struct device *dev,
>  		clk_disable_unprepare(clks[i]);
>  }
>  
> +static int q6v5_pds_enable(struct q6v5 *qproc, struct device **pds,
> +			   size_t pd_count)
> +{
> +	int ret;
> +	int i;
> +
> +	for (i = 0; i < pd_count; i++) {
> +		dev_pm_genpd_set_performance_state(pds[i], INT_MAX);
> +		ret = pm_runtime_get_sync(pds[i]);
> +		if (ret < 0)
> +			goto unroll_pd_votes;
> +	}
> +
> +	return 0;
> +
> +unroll_pd_votes:
> +	for (i--; i >= 0; i--) {
> +		dev_pm_genpd_set_performance_state(pds[i], 0);
> +		pm_runtime_put(pds[i]);
> +	}
> +
> +	return ret;
> +};
> +
> +static void q6v5_pds_disable(struct q6v5 *qproc, struct device **pds,
> +			     size_t pd_count)
> +{
> +	int i;
> +
> +	for (i = 0; i < pd_count; i++) {
> +		dev_pm_genpd_set_performance_state(pds[i], 0);
> +		pm_runtime_put(pds[i]);
> +	}
> +}
> +
>  static int q6v5_xfer_mem_ownership(struct q6v5 *qproc, int *current_perm,
>  				   bool remote_owner, phys_addr_t addr,
>  				   size_t size)
> @@ -690,11 +730,17 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  
>  	qcom_q6v5_prepare(&qproc->q6v5);
>  
> +	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +	if (ret < 0) {
> +		dev_err(qproc->dev, "failed to enable proxy power domains\n");
> +		goto disable_irqs;
> +	}
> +
>  	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
>  				    qproc->proxy_reg_count);
>  	if (ret) {
>  		dev_err(qproc->dev, "failed to enable proxy supplies\n");
> -		goto disable_irqs;
> +		goto disable_proxy_pds;
>  	}
>  
>  	ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks,
> @@ -791,6 +837,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  disable_proxy_reg:
>  	q6v5_regulator_disable(qproc, qproc->proxy_regs,
>  			       qproc->proxy_reg_count);
> +disable_proxy_pds:
> +	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  disable_irqs:
>  	qcom_q6v5_unprepare(&qproc->q6v5);
>  
> @@ -841,6 +889,8 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
>  
>  	ret = qcom_q6v5_unprepare(&qproc->q6v5);
>  	if (ret) {
> +		q6v5_pds_disable(qproc, qproc->proxy_pds,
> +				 qproc->proxy_pd_count);
>  		q6v5_clk_disable(qproc->dev, qproc->proxy_clks,
>  				 qproc->proxy_clk_count);
>  		q6v5_regulator_disable(qproc, qproc->proxy_regs,
> @@ -1121,6 +1171,7 @@ static void qcom_msa_handover(struct qcom_q6v5 *q6v5)
>  			 qproc->proxy_clk_count);
>  	q6v5_regulator_disable(qproc, qproc->proxy_regs,
>  			       qproc->proxy_reg_count);
> +	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  }
>  
>  static int q6v5_init_mem(struct q6v5 *qproc, struct platform_device *pdev)
> @@ -1181,6 +1232,45 @@ static int q6v5_init_clocks(struct device *dev, struct clk **clks,
>  	return i;
>  }
>  
> +static int q6v5_pds_attach(struct device *dev, struct device **devs,
> +			   char **pd_names)
> +{
> +	size_t num_pds = 0;
> +	int ret;
> +	int i;
> +
> +	if (!pd_names)
> +		return 0;
> +
> +	while (pd_names[num_pds])
> +		num_pds++;
> +
> +	for (i = 0; i < num_pds; i++) {
> +		devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]);
> +		if (IS_ERR(devs[i])) {
> +			ret = PTR_ERR(devs[i]);
> +			goto unroll_attach;
> +		}
> +	}
> +
> +	return num_pds;
> +
> +unroll_attach:
> +	for (i--; i >= 0; i--)
> +		dev_pm_domain_detach(devs[i], false);
> +
> +	return ret;
> +};
> +
> +static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds,
> +			    size_t pd_count)
> +{
> +	int i;
> +
> +	for (i = 0; i < pd_count; i++)
> +		dev_pm_domain_detach(pds[i], false);
> +}
> +
>  static int q6v5_init_reset(struct q6v5 *qproc)
>  {
>  	qproc->mss_restart = devm_reset_control_get_exclusive(qproc->dev,
> @@ -1322,10 +1412,18 @@ static int q6v5_probe(struct platform_device *pdev)
>  	}
>  	qproc->active_reg_count = ret;
>  
> +	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
> +			      desc->proxy_pd_names);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Failed to init power domains\n");
> +		goto free_rproc;
> +	}
> +	qproc->proxy_pd_count = ret;
> +
>  	qproc->has_alt_reset = desc->has_alt_reset;
>  	ret = q6v5_init_reset(qproc);
>  	if (ret)
> -		goto free_rproc;
> +		goto detach_proxy_pds;
>  
>  	qproc->version = desc->version;
>  	qproc->need_mem_protection = desc->need_mem_protection;
> @@ -1333,7 +1431,7 @@ static int q6v5_probe(struct platform_device *pdev)
>  	ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM,
>  			     qcom_msa_handover);
>  	if (ret)
> -		goto free_rproc;
> +		goto detach_proxy_pds;
>  
>  	qproc->mpss_perm = BIT(QCOM_SCM_VMID_HLOS);
>  	qproc->mba_perm = BIT(QCOM_SCM_VMID_HLOS);
> @@ -1343,15 +1441,17 @@ static int q6v5_probe(struct platform_device *pdev)
>  	qproc->sysmon = qcom_add_sysmon_subdev(rproc, "modem", 0x12);
>  	if (IS_ERR(qproc->sysmon)) {
>  		ret = PTR_ERR(qproc->sysmon);
> -		goto free_rproc;
> +		goto detach_proxy_pds;
>  	}
>  
>  	ret = rproc_add(rproc);
>  	if (ret)
> -		goto free_rproc;
> +		goto detach_proxy_pds;
>  
>  	return 0;
>  
> +detach_proxy_pds:
> +	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  free_rproc:
>  	rproc_free(rproc);
>  
> @@ -1368,6 +1468,9 @@ static int q6v5_remove(struct platform_device *pdev)
>  	qcom_remove_glink_subdev(qproc->rproc, &qproc->glink_subdev);
>  	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
>  	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
> +
> +	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +
>  	rproc_free(qproc->rproc);
>  
>  	return 0;
> @@ -1392,6 +1495,12 @@ static const struct rproc_hexagon_res sdm845_mss = {
>  			"mnoc_axi",
>  			NULL
>  	},
> +	.proxy_pd_names = (char*[]){
> +			"cx",
> +			"mx",
> +			"mss",
> +			NULL
> +	},
>  	.need_mem_protection = true,
>  	.has_alt_reset = true,
>  	.version = MSS_SDM845,
> -- 
> 2.18.0
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845
  2019-01-31  0:39 ` [PATCH v5 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
@ 2019-01-31  4:51   ` Bjorn Andersson
  0 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-01-31  4:51 UTC (permalink / raw)
  To: Ohad Ben-Cohen
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Arun Kumar Neelakantam, Sibi Sankar, linux-arm-msm, devicetree,
	linux-kernel, linux-remoteproc

On Wed 30 Jan 16:39 PST 2019, Bjorn Andersson wrote:

> The SDM845 MSS needs the load_state powerdomain voted for during the
> duration of the MSS being powered on, to let the AOSS know that it may
> not perform certain power save measures. So vote for this.
> 
> Tested-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 

Applied

> Changes since v4:
> - None
> 
> Changes since v3:
> - None
> 
>  drivers/remoteproc/qcom_q6v5_mss.c | 31 ++++++++++++++++++++++++++++--
>  1 file changed, 29 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index c32c63e351a0..e30f5486fd20 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -133,6 +133,7 @@ struct rproc_hexagon_res {
>  	char **proxy_clk_names;
>  	char **reset_clk_names;
>  	char **active_clk_names;
> +	char **active_pd_names;
>  	char **proxy_pd_names;
>  	int version;
>  	bool need_mem_protection;
> @@ -159,10 +160,12 @@ struct q6v5 {
>  	struct clk *active_clks[8];
>  	struct clk *reset_clks[4];
>  	struct clk *proxy_clks[4];
> +	struct device *active_pds[1];
>  	struct device *proxy_pds[3];
>  	int active_clk_count;
>  	int reset_clk_count;
>  	int proxy_clk_count;
> +	int active_pd_count;
>  	int proxy_pd_count;
>  
>  	struct reg_info active_regs[1];
> @@ -730,10 +733,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  
>  	qcom_q6v5_prepare(&qproc->q6v5);
>  
> +	ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count);
> +	if (ret < 0) {
> +		dev_err(qproc->dev, "failed to enable active power domains\n");
> +		goto disable_irqs;
> +	}
> +
>  	ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  	if (ret < 0) {
>  		dev_err(qproc->dev, "failed to enable proxy power domains\n");
> -		goto disable_irqs;
> +		goto disable_active_pds;
>  	}
>  
>  	ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
> @@ -839,6 +848,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
>  			       qproc->proxy_reg_count);
>  disable_proxy_pds:
>  	q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +disable_active_pds:
> +	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
>  disable_irqs:
>  	qcom_q6v5_unprepare(&qproc->q6v5);
>  
> @@ -878,6 +889,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
>  			 qproc->active_clk_count);
>  	q6v5_regulator_disable(qproc, qproc->active_regs,
>  			       qproc->active_reg_count);
> +	q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
>  
>  	/* In case of failure or coredump scenario where reclaiming MBA memory
>  	 * could not happen reclaim it here.
> @@ -1412,11 +1424,19 @@ static int q6v5_probe(struct platform_device *pdev)
>  	}
>  	qproc->active_reg_count = ret;
>  
> +	ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds,
> +			      desc->active_pd_names);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Failed to attach active power domains\n");
> +		goto free_rproc;
> +	}
> +	qproc->active_pd_count = ret;
> +
>  	ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
>  			      desc->proxy_pd_names);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "Failed to init power domains\n");
> -		goto free_rproc;
> +		goto detach_active_pds;
>  	}
>  	qproc->proxy_pd_count = ret;
>  
> @@ -1452,6 +1472,8 @@ static int q6v5_probe(struct platform_device *pdev)
>  
>  detach_proxy_pds:
>  	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
> +detach_active_pds:
> +	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
>  free_rproc:
>  	rproc_free(rproc);
>  
> @@ -1469,6 +1491,7 @@ static int q6v5_remove(struct platform_device *pdev)
>  	qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
>  	qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
>  
> +	q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
>  	q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
>  
>  	rproc_free(qproc->rproc);
> @@ -1495,6 +1518,10 @@ static const struct rproc_hexagon_res sdm845_mss = {
>  			"mnoc_axi",
>  			NULL
>  	},
> +	.active_pd_names = (char*[]){
> +			"load_state",
> +			NULL
> +	},
>  	.proxy_pd_names = (char*[]){
>  			"cx",
>  			"mx",
> -- 
> 2.18.0
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 01/10] arm64: dts: qcom: sdm845: Update reserved memory map
      [irrelevant] ` <20190131003933.11436-2-bjorn.andersson@linaro.org>
@ 2019-01-31 16:58   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-31 16:58 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Ohad Ben-Cohen, Arun Kumar Neelakantam, linux-arm-msm,
	devicetree, linux-kernel, linux-remoteproc

Hey Bjorn,

On 2019-01-31 06:09, Bjorn Andersson wrote:
> Update existing and add missing regions to the reserved memory map, as
> described in version 10.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v4:
> - Labeled aop_mem, aop_cmd_db_mem and made tz_mem span the last TZ
> related segment
> 
> Changes since v3:
> - Added hyp and xbl memory nodes.
> - Labeled all PIL nodes
> 
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 72 +++++++++++++++++++++++++---
>  1 file changed, 66 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 33f5f4ba6160..45b1616392aa 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -73,12 +73,22 @@
>  		#size-cells = <2>;
>  		ranges;
> 
> -		memory@85fc0000 {
> +		hyp_mem: memory@85700000 {
> +			reg = <0x0 0x85700000 0 0x600000>;
> +			no-map;
> +		};
> +
> +		xbl_mem: memory@85e00000 {
> +			reg = <0x0 0x85e00000 0 0x100000>;
> +			no-map;
> +		};
> +
> +		aop_mem: memory@85fc0000 {
>  			reg = <0 0x85fc0000 0 0x20000>;
>  			no-map;
>  		};
> 
> -		memory@85fe0000 {
> +		aop_cmd_db_mem: memory@85fe0000 {
>  			compatible = "qcom,cmd-db";
>  			reg = <0x0 0x85fe0000 0x0 0x20000>;
>  			no-map;
> @@ -89,13 +99,43 @@
>  			no-map;
>  		};
> 
> -		memory@86200000 {
> -			reg = <0 0x86200000 0 0x2d00000>;
> +		tz_mem: memory@86200000 {
> +			reg = <0 0x86200000 0 0x3c00000>;

should be 0x2d00000 instead of 0x3c00000
tz_mem ends at 0x88F00000 :-)

nit: Also for hyp_mem and xbl_mem you could
use 0 instead of 0x0

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>

> +			no-map;
> +		};
> +
> +		qseecom_mem: memory@8ab00000 {
> +			reg = <0 0x8ab00000 0 0x1400000>;
> +			no-map;
> +		};
> +
> +		camera_mem: memory@8bf00000 {
> +			reg = <0 0x8bf00000 0 0x500000>;
> +			no-map;
> +		};
> +
> +		ipa_fw_mem: memory@8c400000 {
> +			reg = <0 0x8c400000 0 0x10000>;
> +			no-map;
> +		};
> +
> +		ipa_gsi_mem: memory@8c410000 {
> +			reg = <0 0x8c410000 0 0x5000>;
>  			no-map;
>  		};
> 
> -		wlan_msa_mem: memory@96700000 {
> -			reg = <0 0x96700000 0 0x100000>;
> +		gpu_mem: memory@8c415000 {
> +			reg = <0 0x8c415000 0 0x2000>;
> +			no-map;
> +		};
> +
> +		adsp_mem: memory@8c500000 {
> +			reg = <0 0x8c500000 0 0x1a00000>;
> +			no-map;
> +		};
> +
> +		wlan_msa_mem: memory@8df00000 {
> +			reg = <0 0x8df00000 0 0x100000>;
>  			no-map;
>  		};
> 
> @@ -104,10 +144,30 @@
>  			no-map;
>  		};
> 
> +		venus_mem: memory@95800000 {
> +			reg = <0 0x95800000 0 0x500000>;
> +			no-map;
> +		};
> +
> +		cdsp_mem: memory@95d00000 {
> +			reg = <0 0x95d00000 0 0x800000>;
> +			no-map;
> +		};
> +
>  		mba_region: memory@96500000 {
>  			reg = <0 0x96500000 0 0x200000>;
>  			no-map;
>  		};
> +
> +		slpi_mem: memory@96700000 {
> +			reg = <0 0x96700000 0 0x1400000>;
> +			no-map;
> +		};
> +
> +		spss_mem: memory@97b00000 {
> +			reg = <0 0x97b00000 0 0x100000>;
> +			no-map;
> +		};
>  	};
> 
>  	cpus {

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 13%]

* Re: [PATCH v5 02/10] arm64: dts: qcom: sdm845: Define rmtfs memory
      [irrelevant] ` <20190131003933.11436-3-bjorn.andersson@linaro.org>
@ 2019-01-31 17:09   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-01-31 17:09 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
	Ohad Ben-Cohen, Arun Kumar Neelakantam, linux-arm-msm,
	devicetree, linux-kernel, linux-remoteproc

On 2019-01-31 06:09, Bjorn Andersson wrote:
> Define the rmtfs memory node. As the memory region specified in version
> 10 of the memory map is only 1MB a chunk of unallocated memory is
> chosen.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v4:
> - Moved rmtfs_mem, to not collide with xbl_mem
> 
> Changes since v3:
> - Labeled the node
> 
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 45b1616392aa..d19486ba1e5e 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -104,6 +104,15 @@
>  			no-map;
>  		};
> 
> +		rmtfs_mem: memory@88f0000 {

Hey Bjorn,
we are missing a trailing zero here ^^
rmtfs_mem: memory@88f00000

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>

> +			compatible = "qcom,rmtfs-mem";
> +			reg = <0 0x88f00000 0 0x200000>;
> +			no-map;
> +
> +			qcom,client-id = <1>;
> +			qcom,vmid = <15>;
> +		};
> +
>  		qseecom_mem: memory@8ab00000 {
>  			reg = <0 0x8ab00000 0 0x1400000>;
>  			no-map;

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 15%]

* Re: [PATCH v5 03/10] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes
      [irrelevant] ` <20190131003933.11436-4-bjorn.andersson@linaro.org>
@ 2019-02-01  5:49   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-02-01  5:49 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, David Brown
  Cc: Rob Herring, Mark Rutland, Ohad Ben-Cohen,
	Arun Kumar Neelakantam, linux-arm-msm, devicetree, linux-kernel,
	linux-remoteproc

Hey Bjorn,

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>

On 01/31/2019 06:09 AM, Bjorn Andersson wrote:
> Add the Audio DSP (ADSP) and Compute DSP (CDSP) nodes for TrustZone
> based remoteproc, supporting booting these cores on e.g. the MTP, and
> enable the same for the MTP.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v4:
> - None
> 
> Changes since v3:
> - Make xo reference the actual CXO clock
> 
>   arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  8 ++++
>   arch/arm64/boot/dts/qcom/sdm845.dtsi    | 58 +++++++++++++++++++++++++
>   2 files changed, 66 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> index af8c6a2445a2..02b8357c8ce8 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> @@ -48,6 +48,10 @@
>   	};
>   };
>   
> +&adsp_pas {
> +	status = "okay";
> +};
> +
>   &apps_rsc {
>   	pm8998-rpmh-regulators {
>   		compatible = "qcom,pm8998-rpmh-regulators";
> @@ -344,6 +348,10 @@
>   	};
>   };
>   
> +&cdsp_pas {
> +	status = "okay";
> +};
> +
>   &gcc {
>   	protected-clocks = <GCC_QSPI_CORE_CLK>,
>   			   <GCC_QSPI_CORE_CLK_SRC>,
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index d19486ba1e5e..07d9cd6fba7d 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -325,6 +325,64 @@
>   		};
>   	};
>   
> +	adsp_pas: remoteproc-adsp {
> +		compatible = "qcom,sdm845-adsp-pas";
> +
> +		interrupts-extended = <&intc GIC_SPI 162 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +				      <&adsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> +		interrupt-names = "wdog", "fatal", "ready",
> +				  "handover", "stop-ack";
> +
> +		clocks = <&rpmhcc RPMH_CXO_CLK>;
> +		clock-names = "xo";
> +
> +		memory-region = <&adsp_mem>;
> +
> +		qcom,smem-states = <&adsp_smp2p_out 0>;
> +		qcom,smem-state-names = "stop";
> +
> +		status = "disabled";
> +
> +		glink-edge {
> +			interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;
> +			label = "lpass";
> +			qcom,remote-pid = <2>;
> +			mboxes = <&apss_shared 8>;
> +		};
> +	};
> +
> +	cdsp_pas: remoteproc-cdsp {
> +		compatible = "qcom,sdm845-cdsp-pas";
> +
> +		interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
> +				      <&cdsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
> +		interrupt-names = "wdog", "fatal", "ready",
> +				  "handover", "stop-ack";
> +
> +		clocks = <&rpmhcc RPMH_CXO_CLK>;
> +		clock-names = "xo";
> +
> +		memory-region = <&cdsp_mem>;
> +
> +		qcom,smem-states = <&cdsp_smp2p_out 0>;
> +		qcom,smem-state-names = "stop";
> +
> +		status = "disabled";
> +
> +		glink-edge {
> +			interrupts = <GIC_SPI 574 IRQ_TYPE_EDGE_RISING>;
> +			label = "turing";
> +			qcom,remote-pid = <5>;
> +			mboxes = <&apss_shared 4>;
> +		};
> +	};
> +
>   	tcsr_mutex: hwlock {
>   		compatible = "qcom,tcsr-mutex";
>   		syscon = <&tcsr_mutex_regs 0 0x1000>;
> 

-- 
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc, is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[relevance 15%]

* Re: [PATCH v5 06/10] soc: qcom: Add AOSS QMP genpd provider
      [irrelevant] ` <20190131003933.11436-7-bjorn.andersson@linaro.org>
@ 2019-02-01  7:15   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-02-01  7:15 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, David Brown
  Cc: Rob Herring, Mark Rutland, Ohad Ben-Cohen,
	Arun Kumar Neelakantam, linux-arm-msm, devicetree, linux-kernel,
	linux-remoteproc

Hey Bjorn,

On 01/31/2019 06:09 AM, Bjorn Andersson wrote:
> The AOSS QMP genpd provider implements control over power-related
> resources related to low-power state associated with the remoteprocs in
> the system as well as control over a set of clocks related to debug
> hardware in the SoC.
> 
> Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v4:
> - None
> 
> Changes since v3:
> - None
> 
>   drivers/soc/qcom/Kconfig       |   9 +++
>   drivers/soc/qcom/Makefile      |   1 +
>   drivers/soc/qcom/aoss-qmp-pd.c | 138 +++++++++++++++++++++++++++++++++
>   3 files changed, 148 insertions(+)
>   create mode 100644 drivers/soc/qcom/aoss-qmp-pd.c
> 
> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> index 28ab19bf8c98..893b56b70957 100644
> --- a/drivers/soc/qcom/Kconfig
> +++ b/drivers/soc/qcom/Kconfig
> @@ -12,6 +12,15 @@ config QCOM_AOSS_QMP
>   	  micro-controller in the AOSS, using QMP, to control certain resource
>   	  that are not exposed through RPMh.
>   
> +config QCOM_AOSS_QMP_PD
> +	tristate "Qualcomm AOSS Messaging Power Domain driver"
> +	depends on QCOM_AOSS_QMP
> +	select PM_GENERIC_DOMAINS
> +	help
> +	  This driver provides the means of controlling the AOSS's handling of
> +	  low-power state for resources related to the remoteproc subsystems as
> +	  well as controlling the debug clocks.
> +
>   config QCOM_COMMAND_DB
>   	bool "Qualcomm Command DB"
>   	depends on ARCH_QCOM || COMPILE_TEST
> diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
> index 2c04d27fbf9e..16913e73fddf 100644
> --- a/drivers/soc/qcom/Makefile
> +++ b/drivers/soc/qcom/Makefile
> @@ -1,6 +1,7 @@
>   # SPDX-License-Identifier: GPL-2.0
>   CFLAGS_rpmh-rsc.o := -I$(src)
>   obj-$(CONFIG_QCOM_AOSS_QMP) +=	aoss-qmp.o
> +obj-$(CONFIG_QCOM_AOSS_QMP_PD) += aoss-qmp-pd.o
>   obj-$(CONFIG_QCOM_GENI_SE) +=	qcom-geni-se.o
>   obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
>   obj-$(CONFIG_QCOM_GLINK_SSR) +=	glink_ssr.o
> diff --git a/drivers/soc/qcom/aoss-qmp-pd.c b/drivers/soc/qcom/aoss-qmp-pd.c
> new file mode 100644
> index 000000000000..82dd569a2bc9
> --- /dev/null
> +++ b/drivers/soc/qcom/aoss-qmp-pd.c
> @@ -0,0 +1,138 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2018, Linaro Ltd
> + */
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/soc/qcom/aoss-qmp.h>
> +#include <dt-bindings/power/qcom-aoss-qmp.h>
> +
> +/* Requests are expected to be 96 bytes long */
> +#define AOSS_QMP_PD_MSG_LEN	96
> +
> +struct qmp_pd {
> +	struct qmp *qmp;
> +
> +	struct generic_pm_domain pd;
> +
> +	const char *name;
> +};
> +
> +#define to_qmp_pd_resource(res) container_of(res, struct qmp_pd, pd)
> +
> +struct qmp_pd_resource {
> +	const char *name;
> +	int (*on)(struct generic_pm_domain *domain);
> +	int (*off)(struct generic_pm_domain *domain);
> +};
> +
> +static int qmp_pd_clock_toggle(struct qmp_pd *res, bool enable)
> +{
> +	char buf[AOSS_QMP_PD_MSG_LEN];
> +
> +	snprintf(buf, sizeof(buf), "{class: clock, res: %s, val: %d}",
> +		 res->name, !!enable);
> +	return qmp_send(res->qmp, buf, sizeof(buf));
> +}
> +
> +static int qmp_pd_clock_on(struct generic_pm_domain *domain)
> +{
> +	return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), true);
> +}
> +
> +static int qmp_pd_clock_off(struct generic_pm_domain *domain)
> +{
> +	return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), false);
> +}
> +
> +static int qmp_pd_image_toggle(struct qmp_pd *res, bool enable)
> +{
> +	char buf[AOSS_QMP_PD_MSG_LEN];
> +
> +	snprintf(buf, sizeof(buf),
> +		 "{class: image, res: load_state, name: %s, val: %s}",
> +		 res->name, enable ? "on" : "off");
> +	return qmp_send(res->qmp, buf, sizeof(buf));
> +}
> +
> +static int qmp_pd_image_on(struct generic_pm_domain *domain)
> +{
> +	return qmp_pd_image_toggle(to_qmp_pd_resource(domain), true);
> +}
> +
> +static int qmp_pd_image_off(struct generic_pm_domain *domain)
> +{
> +	return qmp_pd_image_toggle(to_qmp_pd_resource(domain), false);
> +}
> +
> +static const struct qmp_pd_resource sdm845_resources[] = {
> +	[AOSS_QMP_QDSS_CLK] = { "qdss", qmp_pd_clock_on, qmp_pd_clock_off },
> +	[AOSS_QMP_LS_CDSP] = { "cdsp", qmp_pd_image_on, qmp_pd_image_off },
> +	[AOSS_QMP_LS_LPASS] = { "adsp", qmp_pd_image_on, qmp_pd_image_off },
> +	[AOSS_QMP_LS_MODEM] = { "modem", qmp_pd_image_on, qmp_pd_image_off },
> +	[AOSS_QMP_LS_SLPI] = { "slpi", qmp_pd_image_on, qmp_pd_image_off },
> +	[AOSS_QMP_LS_SPSS] = { "spss", qmp_pd_image_on, qmp_pd_image_off },
> +	[AOSS_QMP_LS_VENUS] = { "venus", qmp_pd_image_on, qmp_pd_image_off },
> +};
> +
> +static int qmp_pd_probe(struct platform_device *pdev)
> +{
> +	struct genpd_onecell_data *data;
> +	struct device *parent = pdev->dev.parent;
> +	struct qmp_pd *res;
> +	struct qmp *qmp;
> +	size_t num = ARRAY_SIZE(sdm845_resources);
> +	int i;
> +
> +	qmp = dev_get_drvdata(pdev->dev.parent);
> +	if (!qmp)
> +		return -EINVAL;
> +
> +	res = devm_kcalloc(&pdev->dev, num, sizeof(*res), GFP_KERNEL);
> +	if (!res)
> +		return -ENOMEM;
> +
> +	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	data->domains = devm_kcalloc(&pdev->dev, num, sizeof(*data->domains),
> +				     GFP_KERNEL);

shouldn't we error out here as well?
if (!data->domains)
         return -ENOMEM;

> +
> +	for (i = 0; i < num; i++) {
> +		pm_genpd_init(&res[i].pd, NULL, true);

shouldn't we populate the pd name before the call to
pm_genpd_init?


Apart from the above nits
Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>

> +		res[i].qmp = qmp;
> +		res[i].name = sdm845_resources[i].name;
> +
> +		res[i].pd.name = sdm845_resources[i].name;
> +		res[i].pd.power_on = sdm845_resources[i].on;
> +		res[i].pd.power_off = sdm845_resources[i].off;
> +
> +		data->domains[data->num_domains++] = &res[i].pd;
> +	}
> +
> +	return of_genpd_add_provider_onecell(parent->of_node, data);
> +}
> +
> +static int qmp_pd_remove(struct platform_device *pdev)
> +{
> +	struct device *parent = pdev->dev.parent;
> +
> +	of_genpd_del_provider(parent->of_node);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver qmp_pd_driver = {
> +	.driver = {
> +		.name		= "aoss_qmp_pd",
> +	},
> +	.probe = qmp_pd_probe,
> +	.remove = qmp_pd_remove,
> +};
> +module_platform_driver(qmp_pd_driver);
> +
> +MODULE_ALIAS("platform:aoss_qmp_pd");
> +MODULE_DESCRIPTION("Qualcomm AOSS QMP load-state driver");
> +MODULE_LICENSE("GPL v2");
> 

-- 
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc, is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[relevance 15%]

* Re: [PATCH v5 09/10] arm64: dts: qcom: Add AOSS QMP node
      [irrelevant] ` <20190131003933.11436-10-bjorn.andersson@linaro.org>
@ 2019-02-01  7:17   ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-02-01  7:17 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, David Brown
  Cc: Rob Herring, Mark Rutland, Ohad Ben-Cohen,
	Arun Kumar Neelakantam, linux-arm-msm, devicetree, linux-kernel,
	linux-remoteproc

Hey Bjorn,

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>


On 01/31/2019 06:09 AM, Bjorn Andersson wrote:
> The AOSS QMP provides a number of power domains, used for QDSS and
> PIL, add the node for this.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Changes since v4:
> - None
> 
> Changes since v3:
> - None
> 
>   arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 07d9cd6fba7d..dc43fee8bb90 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -14,6 +14,7 @@
>   #include <dt-bindings/interconnect/qcom,sdm845.h>
>   #include <dt-bindings/interrupt-controller/arm-gic.h>
>   #include <dt-bindings/phy/phy-qcom-qusb2.h>
> +#include <dt-bindings/power/qcom-aoss-qmp.h>
>   #include <dt-bindings/power/qcom-rpmpd.h>
>   #include <dt-bindings/reset/qcom,sdm845-aoss.h>
>   #include <dt-bindings/reset/qcom,sdm845-pdc.h>
> @@ -2076,6 +2077,15 @@
>   			#reset-cells = <1>;
>   		};
>   
> +		aoss_qmp: qmp@c300000 {
> +			compatible = "qcom,sdm845-aoss-qmp";
> +			reg = <0 0x0c300000 0 0x100000>;
> +			interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>;
> +			mboxes = <&apss_shared 0>;
> +
> +			#power-domain-cells = <1>;
> +		};
> +
>   		spmi_bus: spmi@c440000 {
>   			compatible = "qcom,spmi-pmic-arb";
>   			reg = <0 0x0c440000 0 0x1100>,
> 

-- 
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc, is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[relevance 15%]

* Re: [PATCH v2] arm64: dts: qcom: sdm845: Add clocks and iommus to WCN3990 WLAN node
      [irrelevant] <20190131051438.12867-1-bjorn.andersson@linaro.org>
@ 2019-02-01  8:57 ` Sibi Sankar
  0 siblings, 0 replies; 200+ results
From: Sibi Sankar @ 2019-02-01  8:57 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, David Brown, Douglas Anderson, Rob Herring,
	Mark Rutland, linux-arm-msm, devicetree, linux-kernel,
	linux-arm-msm-owner

On 2019-01-31 10:44, Bjorn Andersson wrote:
> From: Douglas Anderson <dianders@chromium.org>
> 
> When commit be7019103469 ("dts: arm64/sdm845: Add WCN3990 WLAN module
> device node") was posted upstream no clocks were specified.  However,
> when the pack was picked into the Chrome OS kernel tree (allegedly
> directly from the mailing list post) it had clock properties.
> 
> I presume that the clock should be there, so let's add it.

Tested-by: Sibi Sankar <sibis@codeaurora.org>

> 
> Fixes: be7019103469 ("dts: arm64/sdm845: Add WCN3990 WLAN module device 
> node")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> [bjorn: Add also the required iommus property]
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> 
> Hijacking Doug's fixup patch to also add the missing iommus property. 
> Without
> this the MTP reboots once the ath10k is trying to exercise the 
> copyengine.
> 
>  arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index cba09899282e..58f034664336 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -2422,6 +2422,8 @@
>  			reg = <0 0x18800000 0 0x800000>;
>  			reg-names = "membase";
>  			memory-region = <&wlan_msa_mem>;
> +			clock-names = "cxo_ref_clk_pin";
> +			clocks = <&rpmhcc RPMH_RF_CLK2>;
>  			interrupts =
>  				<GIC_SPI 414 IRQ_TYPE_LEVEL_HIGH>,
>  				<GIC_SPI 415 IRQ_TYPE_LEVEL_HIGH>,
> @@ -2435,6 +2437,7 @@
>  				<GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH>,
>  				<GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>,
>  				<GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>;
> +			iommus = <&apps_smmu 0x0040 0x1>;
>  		};
>  	};

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[relevance 13%]

* [PATCH v6 1/8] arm64: dts: qcom: sdm845: Update reserved memory map
      [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
@ 2019-02-06  5:13 ` Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 2/8] arm64: dts: qcom: sdm845: Define rmtfs memory Bjorn Andersson
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-02-06  5:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: David Brown, Rob Herring, Mark Rutland, Arun Kumar Neelakantam,
	Sibi Sankar, Doug Anderson, linux-arm-msm, devicetree,
	linux-kernel

Update existing and add missing regions to the reserved memory map, as
described in version 10.

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v5:
- Replaced a few 0x0 with 0
- Corrected size of tz_mem

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 74 +++++++++++++++++++++++++---
 1 file changed, 67 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index ade2f385507c..16a060063882 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -72,29 +72,69 @@
 		#size-cells = <2>;
 		ranges;
 
-		memory@85fc0000 {
+		hyp_mem: memory@85700000 {
+			reg = <0 0x85700000 0 0x600000>;
+			no-map;
+		};
+
+		xbl_mem: memory@85e00000 {
+			reg = <0 0x85e00000 0 0x100000>;
+			no-map;
+		};
+
+		aop_mem: memory@85fc0000 {
 			reg = <0 0x85fc0000 0 0x20000>;
 			no-map;
 		};
 
-		memory@85fe0000 {
+		aop_cmd_db_mem: memory@85fe0000 {
 			compatible = "qcom,cmd-db";
-			reg = <0x0 0x85fe0000 0x0 0x20000>;
+			reg = <0x0 0x85fe0000 0 0x20000>;
 			no-map;
 		};
 
 		smem_mem: memory@86000000 {
-			reg = <0x0 0x86000000 0x0 0x200000>;
+			reg = <0x0 0x86000000 0 0x200000>;
 			no-map;
 		};
 
-		memory@86200000 {
+		tz_mem: memory@86200000 {
 			reg = <0 0x86200000 0 0x2d00000>;
 			no-map;
 		};
 
-		wlan_msa_mem: memory@96700000 {
-			reg = <0 0x96700000 0 0x100000>;
+		qseecom_mem: memory@8ab00000 {
+			reg = <0 0x8ab00000 0 0x1400000>;
+			no-map;
+		};
+
+		camera_mem: memory@8bf00000 {
+			reg = <0 0x8bf00000 0 0x500000>;
+			no-map;
+		};
+
+		ipa_fw_mem: memory@8c400000 {
+			reg = <0 0x8c400000 0 0x10000>;
+			no-map;
+		};
+
+		ipa_gsi_mem: memory@8c410000 {
+			reg = <0 0x8c410000 0 0x5000>;
+			no-map;
+		};
+
+		gpu_mem: memory@8c415000 {
+			reg = <0 0x8c415000 0 0x2000>;
+			no-map;
+		};
+
+		adsp_mem: memory@8c500000 {
+			reg = <0 0x8c500000 0 0x1a00000>;
+			no-map;
+		};
+
+		wlan_msa_mem: memory@8df00000 {
+			reg = <0 0x8df00000 0 0x100000>;
 			no-map;
 		};
 
@@ -103,10 +143,30 @@
 			no-map;
 		};
 
+		venus_mem: memory@95800000 {
+			reg = <0 0x95800000 0 0x500000>;
+			no-map;
+		};
+
+		cdsp_mem: memory@95d00000 {
+			reg = <0 0x95d00000 0 0x800000>;
+			no-map;
+		};
+
 		mba_region: memory@96500000 {
 			reg = <0 0x96500000 0 0x200000>;
 			no-map;
 		};
+
+		slpi_mem: memory@96700000 {
+			reg = <0 0x96700000 0 0x1400000>;
+			no-map;
+		};
+
+		spss_mem: memory@97b00000 {
+			reg = <0 0x97b00000 0 0x100000>;
+			no-map;
+		};
 	};
 
 	cpus {
-- 
2.18.0


^ permalink raw reply	[relevance 6%]

* [PATCH v6 3/8] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes
      [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
  2019-02-06  5:13 ` [PATCH v6 1/8] arm64: dts: qcom: sdm845: Update reserved memory map Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 2/8] arm64: dts: qcom: sdm845: Define rmtfs memory Bjorn Andersson
@ 2019-02-06  5:13 ` Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 6/8] soc: qcom: Add AOSS QMP genpd provider Bjorn Andersson
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-02-06  5:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: David Brown, Rob Herring, Mark Rutland, Arun Kumar Neelakantam,
	Sibi Sankar, Doug Anderson, linux-arm-msm, devicetree,
	linux-kernel

Add the Audio DSP (ADSP) and Compute DSP (CDSP) nodes for TrustZone
based remoteproc, supporting booting these cores on e.g. the MTP, and
enable the same for the MTP.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v5:
- None

 arch/arm64/boot/dts/qcom/sdm845-mtp.dts |  8 ++++
 arch/arm64/boot/dts/qcom/sdm845.dtsi    | 58 +++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
index 89071463a84a..2e78638eb73b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
@@ -48,6 +48,10 @@
 	};
 };
 
+&adsp_pas {
+	status = "okay";
+};
+
 &apps_rsc {
 	pm8998-rpmh-regulators {
 		compatible = "qcom,pm8998-rpmh-regulators";
@@ -344,6 +348,10 @@
 	};
 };
 
+&cdsp_pas {
+	status = "okay";
+};
+
 &gcc {
 	protected-clocks = <GCC_QSPI_CORE_CLK>,
 			   <GCC_QSPI_CORE_CLK_SRC>,
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index a33d27b3a389..12efbdb1fa2e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -324,6 +324,64 @@
 		};
 	};
 
+	adsp_pas: remoteproc-adsp {
+		compatible = "qcom,sdm845-adsp-pas";
+
+		interrupts-extended = <&intc GIC_SPI 162 IRQ_TYPE_EDGE_RISING>,
+				      <&adsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				      <&adsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				      <&adsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				      <&adsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "wdog", "fatal", "ready",
+				  "handover", "stop-ack";
+
+		clocks = <&rpmhcc RPMH_CXO_CLK>;
+		clock-names = "xo";
+
+		memory-region = <&adsp_mem>;
+
+		qcom,smem-states = <&adsp_smp2p_out 0>;
+		qcom,smem-state-names = "stop";
+
+		status = "disabled";
+
+		glink-edge {
+			interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;
+			label = "lpass";
+			qcom,remote-pid = <2>;
+			mboxes = <&apss_shared 8>;
+		};
+	};
+
+	cdsp_pas: remoteproc-cdsp {
+		compatible = "qcom,sdm845-cdsp-pas";
+
+		interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>,
+				      <&cdsp_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				      <&cdsp_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				      <&cdsp_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				      <&cdsp_smp2p_in 3 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "wdog", "fatal", "ready",
+				  "handover", "stop-ack";
+
+		clocks = <&rpmhcc RPMH_CXO_CLK>;
+		clock-names = "xo";
+
+		memory-region = <&cdsp_mem>;
+
+		qcom,smem-states = <&cdsp_smp2p_out 0>;
+		qcom,smem-state-names = "stop";
+
+		status = "disabled";
+
+		glink-edge {
+			interrupts = <GIC_SPI 574 IRQ_TYPE_EDGE_RISING>;
+			label = "turing";
+			qcom,remote-pid = <5>;
+			mboxes = <&apss_shared 4>;
+		};
+	};
+
 	tcsr_mutex: hwlock {
 		compatible = "qcom,tcsr-mutex";
 		syscon = <&tcsr_mutex_regs 0 0x1000>;
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* [PATCH v6 2/8] arm64: dts: qcom: sdm845: Define rmtfs memory
      [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
  2019-02-06  5:13 ` [PATCH v6 1/8] arm64: dts: qcom: sdm845: Update reserved memory map Bjorn Andersson
@ 2019-02-06  5:13 ` Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 3/8] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes Bjorn Andersson
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-02-06  5:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: David Brown, Rob Herring, Mark Rutland, Arun Kumar Neelakantam,
	Sibi Sankar, Doug Anderson, linux-arm-msm, devicetree,
	linux-kernel

Define the rmtfs memory node. As the memory region specified in version
10 of the memory map is only 1MB a chunk of unallocated memory is
chosen.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v5:
- Corrected unit address

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 16a060063882..a33d27b3a389 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -103,6 +103,15 @@
 			no-map;
 		};
 
+		rmtfs_mem: memory@88f00000 {
+			compatible = "qcom,rmtfs-mem";
+			reg = <0 0x88f00000 0 0x200000>;
+			no-map;
+
+			qcom,client-id = <1>;
+			qcom,vmid = <15>;
+		};
+
 		qseecom_mem: memory@8ab00000 {
 			reg = <0 0x8ab00000 0 0x1400000>;
 			no-map;
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* [PATCH v6 6/8] soc: qcom: Add AOSS QMP genpd provider
      [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
                   ` (2 preceding siblings ...)
  2019-02-06  5:13 ` [PATCH v6 3/8] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes Bjorn Andersson
@ 2019-02-06  5:13 ` Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 7/8] arm64: dts: qcom: Add AOSS QMP node Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
  5 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-02-06  5:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: David Brown, Rob Herring, Mark Rutland, Arun Kumar Neelakantam,
	Sibi Sankar, Doug Anderson, linux-arm-msm, devicetree,
	linux-kernel

The AOSS QMP genpd provider implements control over power-related
resources related to low-power state associated with the remoteprocs in
the system as well as control over a set of clocks related to debug
hardware in the SoC.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v5:
- Clear outgoing buffer, to avoid sending unitialized stack content to AOP
- Fix domain initialization
- Clean up domains on failure and remove

 drivers/soc/qcom/Kconfig       |   9 ++
 drivers/soc/qcom/Makefile      |   1 +
 drivers/soc/qcom/aoss-qmp-pd.c | 158 +++++++++++++++++++++++++++++++++
 3 files changed, 168 insertions(+)
 create mode 100644 drivers/soc/qcom/aoss-qmp-pd.c

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 28ab19bf8c98..893b56b70957 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -12,6 +12,15 @@ config QCOM_AOSS_QMP
 	  micro-controller in the AOSS, using QMP, to control certain resource
 	  that are not exposed through RPMh.
 
+config QCOM_AOSS_QMP_PD
+	tristate "Qualcomm AOSS Messaging Power Domain driver"
+	depends on QCOM_AOSS_QMP
+	select PM_GENERIC_DOMAINS
+	help
+	  This driver provides the means of controlling the AOSS's handling of
+	  low-power state for resources related to the remoteproc subsystems as
+	  well as controlling the debug clocks.
+
 config QCOM_COMMAND_DB
 	bool "Qualcomm Command DB"
 	depends on ARCH_QCOM || COMPILE_TEST
diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile
index 2c04d27fbf9e..16913e73fddf 100644
--- a/drivers/soc/qcom/Makefile
+++ b/drivers/soc/qcom/Makefile
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS_rpmh-rsc.o := -I$(src)
 obj-$(CONFIG_QCOM_AOSS_QMP) +=	aoss-qmp.o
+obj-$(CONFIG_QCOM_AOSS_QMP_PD) += aoss-qmp-pd.o
 obj-$(CONFIG_QCOM_GENI_SE) +=	qcom-geni-se.o
 obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
 obj-$(CONFIG_QCOM_GLINK_SSR) +=	glink_ssr.o
diff --git a/drivers/soc/qcom/aoss-qmp-pd.c b/drivers/soc/qcom/aoss-qmp-pd.c
new file mode 100644
index 000000000000..a375abcbe9c7
--- /dev/null
+++ b/drivers/soc/qcom/aoss-qmp-pd.c
@@ -0,0 +1,158 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2018, Linaro Ltd
+ */
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/soc/qcom/aoss-qmp.h>
+#include <dt-bindings/power/qcom-aoss-qmp.h>
+
+/* Requests are expected to be 96 bytes long */
+#define AOSS_QMP_PD_MSG_LEN	96
+
+struct qmp_pd {
+	struct qmp *qmp;
+	struct generic_pm_domain pd;
+};
+
+#define to_qmp_pd_resource(res) container_of(res, struct qmp_pd, pd)
+
+struct qmp_pd_resource {
+	const char *name;
+	int (*on)(struct generic_pm_domain *domain);
+	int (*off)(struct generic_pm_domain *domain);
+};
+
+static int qmp_pd_clock_toggle(struct qmp_pd *res, bool enable)
+{
+	char buf[AOSS_QMP_PD_MSG_LEN];
+
+	memset(buf, 0, sizeof(buf));
+	snprintf(buf, sizeof(buf), "{class: clock, res: %s, val: %d}",
+		 res->pd.name, enable);
+	return qmp_send(res->qmp, buf, sizeof(buf));
+}
+
+static int qmp_pd_clock_on(struct generic_pm_domain *domain)
+{
+	return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), true);
+}
+
+static int qmp_pd_clock_off(struct generic_pm_domain *domain)
+{
+	return qmp_pd_clock_toggle(to_qmp_pd_resource(domain), false);
+}
+
+static int qmp_pd_image_toggle(struct qmp_pd *res, bool enable)
+{
+	char buf[AOSS_QMP_PD_MSG_LEN];
+
+	memset(buf, 0, sizeof(buf));
+	snprintf(buf, sizeof(buf),
+		 "{class: image, res: load_state, name: %s, val: %s}",
+		 res->pd.name, enable ? "on" : "off");
+	return qmp_send(res->qmp, buf, sizeof(buf));
+}
+
+static int qmp_pd_image_on(struct generic_pm_domain *domain)
+{
+	return qmp_pd_image_toggle(to_qmp_pd_resource(domain), true);
+}
+
+static int qmp_pd_image_off(struct generic_pm_domain *domain)
+{
+	return qmp_pd_image_toggle(to_qmp_pd_resource(domain), false);
+}
+
+static const struct qmp_pd_resource sdm845_resources[] = {
+	[AOSS_QMP_QDSS_CLK] = { "qdss", qmp_pd_clock_on, qmp_pd_clock_off },
+	[AOSS_QMP_LS_CDSP] = { "cdsp", qmp_pd_image_on, qmp_pd_image_off },
+	[AOSS_QMP_LS_LPASS] = { "adsp", qmp_pd_image_on, qmp_pd_image_off },
+	[AOSS_QMP_LS_MODEM] = { "modem", qmp_pd_image_on, qmp_pd_image_off },
+	[AOSS_QMP_LS_SLPI] = { "slpi", qmp_pd_image_on, qmp_pd_image_off },
+	[AOSS_QMP_LS_SPSS] = { "spss", qmp_pd_image_on, qmp_pd_image_off },
+	[AOSS_QMP_LS_VENUS] = { "venus", qmp_pd_image_on, qmp_pd_image_off },
+};
+
+static int qmp_pd_probe(struct platform_device *pdev)
+{
+	struct genpd_onecell_data *data;
+	struct device *parent = pdev->dev.parent;
+	struct qmp_pd *res;
+	struct qmp *qmp;
+	size_t num = ARRAY_SIZE(sdm845_resources);
+	int ret;
+	int i;
+
+	qmp = dev_get_drvdata(pdev->dev.parent);
+	if (!qmp)
+		return -EINVAL;
+
+	res = devm_kcalloc(&pdev->dev, num, sizeof(*res), GFP_KERNEL);
+	if (!res)
+		return -ENOMEM;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	data->domains = devm_kcalloc(&pdev->dev, num, sizeof(*data->domains),
+				     GFP_KERNEL);
+	if (!data->domains)
+		return -ENOMEM;
+
+	for (i = 0; i < num; i++) {
+		res[i].qmp = qmp;
+		res[i].pd.name = sdm845_resources[i].name;
+		res[i].pd.power_on = sdm845_resources[i].on;
+		res[i].pd.power_off = sdm845_resources[i].off;
+
+		ret = pm_genpd_init(&res[i].pd, NULL, true);
+		if (ret < 0) {
+			dev_err(&pdev->dev, "failed to init genpd\n");
+			goto unroll_genpds;
+		}
+
+		data->domains[i] = &res[i].pd;
+	}
+
+	data->num_domains = i;
+
+	platform_set_drvdata(pdev, data);
+
+	return of_genpd_add_provider_onecell(parent->of_node, data);
+
+unroll_genpds:
+	for (i--; i >= 0; i--)
+		pm_genpd_remove(data->domains[i]);
+
+	return ret;
+}
+
+static int qmp_pd_remove(struct platform_device *pdev)
+{
+	struct device *parent = pdev->dev.parent;
+	struct genpd_onecell_data *data = platform_get_drvdata(pdev);
+	int i;
+
+	of_genpd_del_provider(parent->of_node);
+
+	for (i = 0; i < data->num_domains; i++)
+		pm_genpd_remove(data->domains[i]);
+
+	return 0;
+}
+
+static struct platform_driver qmp_pd_driver = {
+	.driver = {
+		.name		= "aoss_qmp_pd",
+	},
+	.probe = qmp_pd_probe,
+	.remove = qmp_pd_remove,
+};
+module_platform_driver(qmp_pd_driver);
+
+MODULE_ALIAS("platform:aoss_qmp_pd");
+MODULE_DESCRIPTION("Qualcomm AOSS QMP load-state driver");
+MODULE_LICENSE("GPL v2");
-- 
2.18.0


^ permalink raw reply	[relevance 7%]

* [PATCH v6 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node
      [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
                   ` (4 preceding siblings ...)
  2019-02-06  5:13 ` [PATCH v6 7/8] arm64: dts: qcom: Add AOSS QMP node Bjorn Andersson
@ 2019-02-06  5:13 ` Bjorn Andersson
  5 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-02-06  5:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: David Brown, Rob Herring, Mark Rutland, Arun Kumar Neelakantam,
	Sibi Sankar, Doug Anderson, linux-arm-msm, devicetree,
	linux-kernel

From: Sibi Sankar <sibis@codeaurora.org>

This patch adds Q6V5 MSS remoteproc node for SDM845 SoCs.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v5:
- None

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 58 ++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 560c16616ee6..5c41f6fe3e1b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1612,6 +1612,64 @@
 			};
 		};
 
+		mss_pil: remoteproc@4080000 {
+			compatible = "qcom,sdm845-mss-pil";
+			reg = <0 0x04080000 0 0x408>, <0 0x04180000 0 0x48>;
+			reg-names = "qdsp6", "rmb";
+
+			interrupts-extended =
+				<&intc GIC_SPI 266 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+				<&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "wdog", "fatal", "ready",
+					  "handover", "stop-ack",
+					  "shutdown-ack";
+
+			clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
+				 <&gcc GCC_MSS_Q6_MEMNOC_AXI_CLK>,
+				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
+				 <&gcc GCC_MSS_GPLL0_DIV_CLK_SRC>,
+				 <&gcc GCC_MSS_SNOC_AXI_CLK>,
+				 <&gcc GCC_MSS_MFAB_AXIS_CLK>,
+				 <&gcc GCC_PRNG_AHB_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "bus", "mem", "gpll0_mss",
+				      "snoc_axi", "mnoc_axi", "prng", "xo";
+
+			qcom,smem-states = <&modem_smp2p_out 0>;
+			qcom,smem-state-names = "stop";
+
+			resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
+				 <&pdc_reset PDC_MODEM_SYNC_RESET>;
+			reset-names = "mss_restart", "pdc_reset";
+
+			qcom,halt-regs = <&tcsr_mutex_regs 0x23000 0x25000 0x24000>;
+
+			power-domains = <&aoss_qmp AOSS_QMP_LS_MODEM>,
+					<&rpmhpd SDM845_CX>,
+					<&rpmhpd SDM845_MX>,
+					<&rpmhpd SDM845_MSS>;
+			power-domain-names = "load_state", "cx", "mx", "mss";
+
+			mba {
+				memory-region = <&mba_region>;
+			};
+
+			mpss {
+				memory-region = <&mpss_region>;
+			};
+
+			glink-edge {
+				interrupts = <GIC_SPI 449 IRQ_TYPE_EDGE_RISING>;
+				label = "modem";
+				qcom,remote-pid = <1>;
+				mboxes = <&apss_shared 12>;
+			};
+		};
+
 		gpucc: clock-controller@5090000 {
 			compatible = "qcom,sdm845-gpucc";
 			reg = <0 0x05090000 0 0x9000>;
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

* [PATCH v6 7/8] arm64: dts: qcom: Add AOSS QMP node
      [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
                   ` (3 preceding siblings ...)
  2019-02-06  5:13 ` [PATCH v6 6/8] soc: qcom: Add AOSS QMP genpd provider Bjorn Andersson
@ 2019-02-06  5:13 ` Bjorn Andersson
  2019-02-06  5:13 ` [PATCH v6 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
  5 siblings, 0 replies; 200+ results
From: Bjorn Andersson @ 2019-02-06  5:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: David Brown, Rob Herring, Mark Rutland, Arun Kumar Neelakantam,
	Sibi Sankar, Doug Anderson, linux-arm-msm, devicetree,
	linux-kernel

The AOSS QMP provides a number of power domains, used for QDSS and
PIL, add the node for this.

Tested-by: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v5:
- None

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 12efbdb1fa2e..560c16616ee6 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -13,6 +13,7 @@
 #include <dt-bindings/clock/qcom,videocc-sdm845.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/phy/phy-qcom-qusb2.h>
+#include <dt-bindings/power/qcom-aoss-qmp.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/reset/qcom,sdm845-aoss.h>
 #include <dt-bindings/reset/qcom,sdm845-pdc.h>
@@ -2080,6 +2081,15 @@
 			#reset-cells = <1>;
 		};
 
+		aoss_qmp: qmp@c300000 {
+			compatible = "qcom,sdm845-aoss-qmp";
+			reg = <0 0x0c300000 0 0x100000>;
+			interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>;
+			mboxes = <&apss_shared 0>;
+
+			#power-domain-cells = <1>;
+		};
+
 		spmi_bus: spmi@c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0 0x0c440000 0 0x1100>,
-- 
2.18.0


^ permalink raw reply	[relevance 8%]

Results 1-200 of 358 (estimated)  
    [irrelevant] <20180829191215.10071-1-sibis@codeaurora.org>
2018-08-29 19:12 ` [PATCH v3 6/6] remoteproc: qcom: q6v5-pil: Add PDC reset for modem on SDM845 SoCs Sibi Sankar
    [irrelevant] ` <20180829191215.10071-3-sibis@codeaurora.org>
2018-09-03 19:31   ` [PATCH v3 2/6] reset: qcom: PDC Global (Power Domain Controller) reset controller Bjorn Andersson
    [irrelevant] ` <20180829191215.10071-4-sibis@codeaurora.org>
2018-09-03 19:32   ` [PATCH v3 3/6] dt-bindings: remoteproc: qcom: Remove additional definition tag Bjorn Andersson
2018-09-10 18:28   ` Rob Herring
    [irrelevant] ` <20180903193647.GJ3456@tuxbook-pro>
2018-10-04 18:27   ` [PATCH v3 0/6] Add support for PDC Global on SDM845 SoCs Sibi Sankar
2018-09-01 22:23 [PATCH] arm64: dts: qcom: Add AOSS reset driver node for SDM845 Bjorn Andersson
2018-09-06 16:00 ` Doug Anderson
    [irrelevant] <1533171465-25508-1-git-send-email-skannan@codeaurora.org>
    [irrelevant] ` <CGME20180802005756epcas4p465a12f42a0e36f0af6fd276a3a56957f@epcms1p3>
    [irrelevant]   ` <20180802095608epcms1p33fb061543efc9ceb3ec12d5567ceffbc@epcms1p3>
    [irrelevant]     ` <45c77ee02536e237c054399cad4c7669@codeaurora.org>
    [irrelevant]       ` <35ff3e303f5de9980979b49c89f9a687@codeaurora.org>
2018-09-10 18:45         ` [PATCH v3 1/2] PM / devfreq: Generic CPU frequency to device frequency mapping governor Sibi Sankar
    [irrelevant] <1533171465-25508-2-git-send-email-skannan@codeaurora.org>
    [irrelevant] ` <4fcac639-cba9-1a71-9b78-326ebb9242da@linaro.org>
2018-09-10 18:55   ` [PATCH v3 2/2] PM / devfreq: Add devfreq driver for interconnect bandwidth voting Sibi Sankar
2018-09-14 12:53 ` Sibi Sankar
    [irrelevant] <20180915012944.179481-1-alexander.levin@microsoft.com>
2018-09-15  1:30 ` [PATCH AUTOSEL 4.18 74/92] remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote Sasha Levin
    [irrelevant] <1535975560-8200-1-git-send-email-rohitkr@codeaurora.org>
    [irrelevant] ` <1535975560-8200-3-git-send-email-rohitkr@codeaurora.org>
2018-09-21 19:41   ` [PATCH v3 2/2] remoteproc: qcom: Introduce Non-PAS ADSP PIL driver Sibi Sankar
    [irrelevant]     ` <79bee282-e8a4-a1e6-56e3-6ea7e20c0233@codeaurora.org>
    [irrelevant]       ` <614ab0e7-b751-4bf9-72f9-33fdd57594ec@codeaurora.org>
2018-09-24 12:02         ` Sibi Sankar
2018-09-24 12:04       ` Sibi Sankar
2018-09-24 11:49 [PATCH 4.18 000/235] 4.18.10-stable review Greg Kroah-Hartman
2018-09-24 11:53 ` [PATCH 4.18 217/235] remoteproc: qcom: q6v5-pil: fix modem hang on SDM845 after axis2 clk unvote Greg Kroah-Hartman
    [irrelevant] <1537787270-29630-1-git-send-email-rohitkr@codeaurora.org>
2018-09-24 12:08 ` [PATCH v4] remoteproc: qcom: Introduce Non-PAS ADSP PIL driver Sibi Sankar
    [irrelevant] <20180920015151.15957-1-bjorn.andersson@linaro.org>
2018-09-25  6:50 ` [PATCH] remoteproc: qcom: q6v5: Propagate EPROBE_DEFER Sibi Sankar
2018-10-06  6:39   ` Bjorn Andersson
    [irrelevant] <20180920172237.30965-1-bjorn.andersson@linaro.org>
2018-09-25 10:18 ` [PATCH] remoteproc: qcom: pas: Add QCS404 remoteprocs Sibi Sankar
    [irrelevant]   ` <20180925233550.GB27436@tuxbook-pro>
2018-09-26 15:48     ` Sibi Sankar
    [irrelevant] <20180927190346.2984-1-bjorn.andersson@linaro.org>
2018-09-28  6:27 ` [PATCH v2] " Sibi Sankar
2018-10-06  6:38   ` Bjorn Andersson
    [irrelevant] <20180925080607.30565-1-bjorn.andersson@linaro.org>
    [irrelevant] ` <20180925172943.GA118699@ban.mtv.corp.google.com>
2018-09-30 15:28   ` [RFC PATCH] soc: qcom: rmtfs_mem: Control remoteproc from rmtfs_mem Sibi Sankar
2018-09-30 15:56 [RFC PATCH v2] " Sibi Sankar
2018-10-18  0:54 ` Brian Norris
2018-10-31 14:32   ` Sibi Sankar
2018-10-21 20:16 ` Bjorn Andersson
2018-10-31 14:04   ` Sibi Sankar
2018-10-01 14:25 [PATCH] remoteproc: qcom: q6v5: Fix a race condition on fatal crash Sibi Sankar
2018-10-06  6:35 ` Bjorn Andersson
    [irrelevant] <20180727152003.11663-1-sibis@codeaurora.org>
    [irrelevant] ` <20180727152003.11663-2-sibis@codeaurora.org>
2018-10-08  6:23   ` [PATCH v3 1/6] remoteproc: Introduce custom dump function for each remoteproc segment Bjorn Andersson
2018-10-09 16:08     ` Sibi Sankar
    [irrelevant] ` <20180727152003.11663-6-sibis@codeaurora.org>
2018-10-08  6:48   ` [PATCH v3 5/6] remoteproc: qcom: q6v5-pil: Register segments/dumpfn for coredump Bjorn Andersson
2018-10-09 16:21     ` Sibi Sankar
    [irrelevant] ` <20180727152003.11663-7-sibis@codeaurora.org>
2018-10-08  6:55   ` [PATCH v3 6/6] remoteproc: qcom: q6v5-pil: Assign the relocated address Bjorn Andersson
    [irrelevant] ` <20180727152003.11663-5-sibis@codeaurora.org>
    [irrelevant]   ` <20181008064505.GO12063@builder>
2018-10-09 16:19     ` [PATCH v3 4/6] remoteproc: qcom: q6v5-pil: Add custom dump function for modem Sibi Sankar
2018-10-09 16:23 [PATCH v4 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
2018-10-09 16:23 ` [PATCH v4 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
2018-10-09 16:23 ` [PATCH v4 2/5] remoteproc: Add mechanism for custom dump function assignment Sibi Sankar
2018-10-09 16:23 ` [PATCH v4 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence Sibi Sankar
2018-10-09 16:23 ` [PATCH v4 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem Sibi Sankar
2018-10-09 16:23 ` [PATCH v4 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump Sibi Sankar
    [irrelevant] <20181009020805.143982-1-briannorris@chromium.org>
    [irrelevant] ` <20181009062125.GA2518@tuxbook-pro>
    [irrelevant]   ` <20181009170232.GA86621@ban.mtv.corp.google.com>
2018-10-09 17:21     ` [PATCH] remoteproc: qcom: q6v5-pil: add SCM probe dependency Sibi Sankar
2018-10-17 13:55 [PATCH v5 0/5] Add coredump support for Q6v5 Modem remoteproc Sibi Sankar
2018-10-17 13:55 ` [PATCH v5 1/5] remoteproc: Introduce custom dump function for each remoteproc segment Sibi Sankar
2018-10-17 13:55 ` [PATCH v5 2/5] remoteproc: Add mechanism for custom dump function assignment Sibi Sankar
2018-10-17 13:55 ` [PATCH v5 3/5] remoteproc: qcom: q6v5-mss: Refactor mba load/unload sequence Sibi Sankar
2018-10-17 13:55 ` [PATCH v5 4/5] remoteproc: qcom: q6v5-mss: Add custom dump function for modem Sibi Sankar
2018-10-17 13:55 ` [PATCH v5 5/5] remoteproc: qcom: q6v5-mss: Register segments/dumpfn for coredump Sibi Sankar
2018-10-26 12:25 [PATCH] arm64: dts: qcom: sdm845: Add SCM DT node Sibi Sankar
2018-10-29  1:35 ` Bjorn Andersson
2018-10-29  9:32 ` Stanimir Varbanov
2018-10-29 14:54   ` Sibi Sankar
2018-10-26 12:26 [PATCH] arm64: dts: qcom: sdm845: Add PDC Global reset driver node Sibi Sankar
2018-10-29  1:38 ` Bjorn Andersson
2018-10-26 12:27 [PATCH] arm64: dts: qcom: sdm845: Add reserve-memory nodes Sibi Sankar
2018-10-29  1:39 ` Bjorn Andersson
2018-10-29 18:37 ` Doug Anderson
2018-10-31  5:58   ` Sibi Sankar
2018-10-31  6:09 [PATCH v2] " Sibi Sankar
2018-10-31 21:59 ` Doug Anderson
2018-10-31 10:46 [RFC PATCH v3] remoteproc: qcom: q6v5-mss: Sync MSS with RMTFS QMI service Sibi Sankar
    [irrelevant] <20181111221619.915519183@linuxfoundation.org>
2018-11-11 22:20 ` [PATCH 4.19 296/361] remoteproc: qcom: q6v5: Propagate EPROBE_DEFER Greg Kroah-Hartman
    [irrelevant] <20181109094417.12109-1-vkoul@kernel.org>
    [irrelevant] ` <20181109094417.12109-15-vkoul@kernel.org>
2018-11-19  5:31   ` [PATCH v5 14/18] arm64: dts: qcom: qcs404: Add remoteproc nodes Sibi Sankar
2018-11-20 21:02 [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5 Sibi Sankar
2018-11-20 21:02 ` [PATCH 2/2] remoteproc: sysmon: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
2018-12-06  7:16   ` Bjorn Andersson
2018-12-14 17:32     ` Sibi Sankar
2018-12-05 22:54 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: Add shutdown-ack irq for Q6v5 Rob Herring
2018-11-20 21:08 [PATCH] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
2018-12-05 22:55 ` Rob Herring
2018-12-06 16:58 ` Bjorn Andersson
2018-12-06 17:44   ` Sibi Sankar
2018-12-13 22:05 ` Doug Anderson
    [irrelevant] <1542708506-12680-1-git-send-email-mgottam@codeaurora.org>
2018-11-21  6:35 ` [PATCH] arm64: dts: sdm845: add video nodes Sibi Sankar
2018-11-27  8:58 [PATCH] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
2018-12-13 22:17 ` Doug Anderson
2018-12-14  4:52   ` Bjorn Andersson
2018-12-14 16:18     ` Doug Anderson
2018-12-14 16:29   ` Sibi Sankar
2018-12-12 12:44 [PATCH 0/2] Add firmware bindings for Q6V5 MSS Sibi Sankar
2018-12-12 12:44 ` [PATCH 1/2] dt-bindings: remoteproc: qcom: " Sibi Sankar
2018-12-20 20:10   ` Rob Herring
2018-12-28  4:47     ` Sibi Sankar
2018-12-12 12:44 ` [PATCH 2/2] remoteproc: qcom: q6v5-mss: Add support for parsing fw dt bindings Sibi Sankar
2018-12-12 13:53 [PATCH v4] PM / devfreq: Restart previous governor if new governor fails to start Sibi Sankar
    [irrelevant] ` <CGME20181212135338epcas5p12f7a8cd1c7aab5d5c936cbc5c33eee07@epcms1p6>
2018-12-14  1:45   ` MyungJoo Ham
2018-12-17 10:07 [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
2018-12-17 10:07 ` [PATCH v2 2/7] dt-bindings: remoteproc: qcom: Add clock bindings for Q6V5 Sibi Sankar
2018-12-17 23:59   ` Doug Anderson
2018-12-18  5:52     ` Sibi Sankar
2018-12-18 16:07       ` Doug Anderson
2018-12-18 17:27   ` Rob Herring
2018-12-19  7:04     ` Sibi Sankar
2018-12-17 10:07 ` [PATCH v2 3/7] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
2018-12-18  0:00   ` Doug Anderson
2018-12-18  6:50     ` Sibi Sankar
2018-12-17 10:07 ` [PATCH v2 4/7] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
2018-12-18  0:01   ` Doug Anderson
2018-12-18  6:30     ` Sibi Sankar
2018-12-17 10:07 ` [PATCH v2 5/7] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
2018-12-18  0:02   ` Doug Anderson
2018-12-18  6:35     ` Sibi Sankar
2018-12-17 10:07 ` [PATCH v2 6/7] arm64: dts: qcom: sdm845: Add power-domain for " Sibi Sankar
2018-12-18  0:02   ` Doug Anderson
2018-12-18  6:38     ` Sibi Sankar
2018-12-17 10:07 ` [PATCH v2 7/7] arm64: dts: qcom: sdm845: Add shutdown-ack " Sibi Sankar
2018-12-18  0:02   ` Doug Anderson
2018-12-17 23:59 ` [PATCH v2 1/7] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Doug Anderson
2018-12-18  5:16   ` Sibi Sankar
    [irrelevant] <20181217150217.32435-1-thierry.reding@gmail.com>
2018-12-17 15:02 ` [PATCH v2 16/19] mailbox: qcom-apcs: Use device-managed registration API Thierry Reding
2018-12-17 18:16   ` Bjorn Andersson
    [irrelevant] <20181220172002.9016-1-thierry.reding@gmail.com>
2018-12-20 17:19 ` [PATCH v3 " Thierry Reding
2018-12-24  8:48 [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
2018-12-24  8:48 ` [PATCH v2 2/4] remoteproc: qcom: q6v5: Add shutdown-ack irq Sibi Sankar
2018-12-24  8:48 ` [PATCH v2 3/4] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
2019-01-03 23:33   ` Bjorn Andersson
2019-01-08 10:14     ` Sibi Sankar
2018-12-24  8:48 ` [PATCH v2 4/4] remoteproc: qcom: Enable shutdown-ack irq on Q6V5 Sibi Sankar
2018-12-27 21:55 ` [PATCH v2 1/4] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Rob Herring
2018-12-26 12:52 [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
2018-12-26 12:52 ` [PATCH v3 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
2018-12-27 21:21   ` Rob Herring
2018-12-28  4:45     ` Sibi Sankar
2018-12-26 12:52 ` [PATCH v3 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
2018-12-26 12:52 ` [PATCH v3 4/8] remoteproc: qcom: q6v5-mss: " Sibi Sankar
2018-12-26 12:52 ` [PATCH v3 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
2018-12-27 21:23   ` Rob Herring
2018-12-26 12:52 ` [PATCH v3 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 Sibi Sankar
2018-12-26 12:52 ` [PATCH v3 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
2018-12-27 21:11   ` Rob Herring
2018-12-26 12:52 ` [PATCH v3 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
2018-12-27 21:19 ` [PATCH v3 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Rob Herring
2018-12-28  4:48 [PATCH v2 0/2] Add firmware bindings for Q6V5 MSS/PAS Sibi Sankar
2018-12-28  4:48 ` [PATCH v2 1/2] dt-bindings: remoteproc: qcom: Add firmware bindings for Q6V5 Sibi Sankar
2018-12-28 22:17   ` Rob Herring
2019-01-03 23:30   ` Brian Norris
    [irrelevant]     ` <20190103235043.GA195759@google.com>
    [irrelevant]       ` <20190104000145.GJ31596@builder>
    [irrelevant]         ` <20190104001158.GA200069@google.com>
    [irrelevant]           ` <20190105015430.GA67838@google.com>
2019-01-08 10:50             ` Sibi Sankar
2018-12-28  4:48 ` [PATCH v2 2/2] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
2019-01-03 23:09   ` Bjorn Andersson
2019-01-03 23:44   ` Brian Norris
2019-01-08 10:32     ` Sibi Sankar
2018-12-28 18:53 [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Sibi Sankar
2018-12-28 18:53 ` [PATCH v4 2/8] dt-bindings: remoteproc: qcom: Add missing clocks for SDM845 Sibi Sankar
2018-12-28 22:13   ` Rob Herring
2018-12-28 18:53 ` [PATCH v4 3/8] dt-bindings: remoteproc: qcom: Add missing clocks for MSM8996 Sibi Sankar
2018-12-28 22:13   ` Rob Herring
2018-12-28 18:53 ` [PATCH v4 4/8] remoteproc: qcom: q6v5-mss: " Sibi Sankar
2018-12-28 18:53 ` [PATCH v4 5/8] dt-bindings: remoteproc: qcom: Fixup regulator dependencies Sibi Sankar
2018-12-28 18:53 ` [PATCH v4 6/8] remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996 Sibi Sankar
2018-12-28 18:53 ` [PATCH v4 7/8] dt-bindings: remoteproc: qcom: Add power-domain bindings for Q6V5 Sibi Sankar
2018-12-28 18:53 ` [PATCH v4 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
2019-01-03 20:17 ` [PATCH v4 1/8] dt-bindings: soc: qcom: Add remote-pid binding for GLINK SMEM Bjorn Andersson
2019-01-08 10:26   ` Sibi Sankar
2019-01-08 10:23 [PATCH v3 1/3] dt-bindings: remoteproc: qcom: Introduce shutdown-ack irq for Q6V5 Sibi Sankar
2019-01-08 10:23 ` [PATCH v3 2/3] remoteproc: qcom: Add shutdown-ack irq Sibi Sankar
2019-01-08 10:23 ` [PATCH v3 3/3] remoteproc: qcom: Wait for shutdown-ack/ind on sysmon shutdown Sibi Sankar
    [irrelevant] <20190106080915.4493-1-bjorn.andersson@linaro.org>
    [irrelevant] ` <20190106080915.4493-5-bjorn.andersson@linaro.org>
2019-01-09 14:39   ` [PATCH v2 4/7] remoteproc: q6v5-mss: Vote for rpmh power domains Sibi Sankar
    [irrelevant] ` <20190106080915.4493-6-bjorn.andersson@linaro.org>
2019-01-09 14:40   ` [PATCH v2 5/7] remoteproc: q6v5-mss: Active powerdomain for SDM845 Sibi Sankar
2019-01-09 17:00 [PATCH v5 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Sibi Sankar
2019-01-11 21:06 ` Doug Anderson
2019-01-12 18:42   ` Bjorn Andersson
2019-01-14 19:22 [PATCH v6] " Sibi Sankar
2019-01-17 23:05 ` Doug Anderson
2019-01-18  5:21   ` Sibi Sankar
2019-01-14 19:50 [PATCH v3] remoteproc: qcom: Add support for parsing fw dt bindings Sibi Sankar
2019-01-30 21:04 ` Bjorn Andersson
    [irrelevant] <20180524192141.20323-1-ramon.fried@gmail.com>
    [irrelevant] ` <20180529042047.GE2259@tuxbook-pro>
2019-01-18  7:04   ` [PATCH] remoteproc: qcom_q6v5: don't auto boot remote processor Sibi Sankar
2019-01-18 18:35     ` Brian Norris
2019-01-18 19:46       ` Sibi Sankar
2019-01-18 21:04         ` Brian Norris
2019-01-19  4:17           ` Sibi Sankar
    [irrelevant] <20190122055112.30943-1-bjorn.andersson@linaro.org>
2019-01-22  5:51 ` [PATCH v3 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
2019-01-22  5:51 ` [PATCH v3 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
2019-01-22  5:51 ` [PATCH v3 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
2019-01-23  0:28   ` Doug Anderson
2019-01-23  1:10     ` Bjorn Andersson
    [irrelevant] ` <20190122055112.30943-2-bjorn.andersson@linaro.org>
2019-01-25 17:40   ` [PATCH v3 01/10] arm64: dts: qcom: sdm845: Update PIL region memory map Sibi Sankar
    [irrelevant] <1548403893-21677-1-git-send-email-mgottam@codeaurora.org>
2019-01-28  8:32 ` [PATCH v5] arm64: dts: sdm845: add video nodes Sibi Sankar
    [irrelevant] <20190129232009.5033-1-bjorn.andersson@linaro.org>
2019-01-29 23:20 ` [PATCH v4 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
2019-01-29 23:20 ` [PATCH v4 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
2019-01-29 23:20 ` [PATCH v4 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
    [irrelevant] <20190131003933.11436-1-bjorn.andersson@linaro.org>
2019-01-31  0:39 ` [PATCH v5 07/10] remoteproc: q6v5-mss: Vote for rpmh power domains Bjorn Andersson
2019-01-31  4:51   ` Bjorn Andersson
2019-01-31  0:39 ` [PATCH v5 08/10] remoteproc: q6v5-mss: Active powerdomain for SDM845 Bjorn Andersson
2019-01-31  4:51   ` Bjorn Andersson
2019-01-31  0:39 ` [PATCH v5 10/10] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson
    [irrelevant] ` <20190131003933.11436-2-bjorn.andersson@linaro.org>
2019-01-31 16:58   ` [PATCH v5 01/10] arm64: dts: qcom: sdm845: Update reserved memory map Sibi Sankar
    [irrelevant] ` <20190131003933.11436-3-bjorn.andersson@linaro.org>
2019-01-31 17:09   ` [PATCH v5 02/10] arm64: dts: qcom: sdm845: Define rmtfs memory Sibi Sankar
    [irrelevant] ` <20190131003933.11436-4-bjorn.andersson@linaro.org>
2019-02-01  5:49   ` [PATCH v5 03/10] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes Sibi Sankar
    [irrelevant] ` <20190131003933.11436-7-bjorn.andersson@linaro.org>
2019-02-01  7:15   ` [PATCH v5 06/10] soc: qcom: Add AOSS QMP genpd provider Sibi Sankar
    [irrelevant] ` <20190131003933.11436-10-bjorn.andersson@linaro.org>
2019-02-01  7:17   ` [PATCH v5 09/10] arm64: dts: qcom: Add AOSS QMP node Sibi Sankar
    [irrelevant] <20190131051438.12867-1-bjorn.andersson@linaro.org>
2019-02-01  8:57 ` [PATCH v2] arm64: dts: qcom: sdm845: Add clocks and iommus to WCN3990 WLAN node Sibi Sankar
    [irrelevant] <20190206051335.23799-1-bjorn.andersson@linaro.org>
2019-02-06  5:13 ` [PATCH v6 1/8] arm64: dts: qcom: sdm845: Update reserved memory map Bjorn Andersson
2019-02-06  5:13 ` [PATCH v6 2/8] arm64: dts: qcom: sdm845: Define rmtfs memory Bjorn Andersson
2019-02-06  5:13 ` [PATCH v6 3/8] arm64: dts: sdm845: Introduce ADSP and CDSP PAS nodes Bjorn Andersson
2019-02-06  5:13 ` [PATCH v6 6/8] soc: qcom: Add AOSS QMP genpd provider Bjorn Andersson
2019-02-06  5:13 ` [PATCH v6 7/8] arm64: dts: qcom: Add AOSS QMP node Bjorn Andersson
2019-02-06  5:13 ` [PATCH v6 8/8] arm64: dts: qcom: sdm845: Add Q6V5 MSS node Bjorn Andersson


LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox