Commit 8be2b2b9 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-ipa-remove-a-build-dependency'

Alex Elder says:

====================
net: ipa: remove a build dependency

Unlike the original (temporary) IPA notification mechanism, the
generic remoteproc SSR notification code does not require the IPA
driver to maintain a pointer to the modem subsystem remoteproc
structure.

The IPA driver was converted to use the newer SSR notifiers, but the
specification and use of a phandle for the modem subsystem was never
removed.

This series removes the lookup of the remoteproc pointer, and that
removes the need for the modem DT property.  It also removes the
reference to the "modem-remoteproc" property from the DT binding,
and from the DT files that specified them.
====================

Link: https://lore.kernel.org/r/20210120212606.12556-1-elder@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 43e57631 5da1fca9
...@@ -113,13 +113,6 @@ properties: ...@@ -113,13 +113,6 @@ properties:
performing early IPA initialization, including loading and performing early IPA initialization, including loading and
validating firwmare used by the GSI. validating firwmare used by the GSI.
modem-remoteproc:
$ref: /schemas/types.yaml#/definitions/phandle
description:
This defines the phandle to the remoteproc node representing
the modem subsystem. This is requied so the IPA driver can
receive and act on notifications of modem up/down events.
memory-region: memory-region:
maxItems: 1 maxItems: 1
description: description:
...@@ -135,7 +128,6 @@ required: ...@@ -135,7 +128,6 @@ required:
- interrupts - interrupts
- interconnects - interconnects
- qcom,smem-states - qcom,smem-states
- modem-remoteproc
oneOf: oneOf:
- required: - required:
...@@ -147,7 +139,7 @@ additionalProperties: false ...@@ -147,7 +139,7 @@ additionalProperties: false
examples: examples:
- | - |
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,rpmh.h> #include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/interconnect/qcom,sdm845.h> #include <dt-bindings/interconnect/qcom,sdm845.h>
...@@ -168,7 +160,6 @@ examples: ...@@ -168,7 +160,6 @@ examples:
compatible = "qcom,sdm845-ipa"; compatible = "qcom,sdm845-ipa";
modem-init; modem-init;
modem-remoteproc = <&mss_pil>;
iommus = <&apps_smmu 0x720 0x3>; iommus = <&apps_smmu 0x720 0x3>;
reg = <0x1e40000 0x7000>, reg = <0x1e40000 0x7000>,
...@@ -178,8 +169,8 @@ examples: ...@@ -178,8 +169,8 @@ examples:
"ipa-shared", "ipa-shared",
"gsi"; "gsi";
interrupts-extended = <&intc 0 311 IRQ_TYPE_EDGE_RISING>, interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>,
<&intc 0 432 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
<&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>, <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
<&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>; <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "ipa", interrupt-names = "ipa",
......
...@@ -1434,8 +1434,6 @@ ipa: ipa@1e40000 { ...@@ -1434,8 +1434,6 @@ ipa: ipa@1e40000 {
qcom,smem-state-names = "ipa-clock-enabled-valid", qcom,smem-state-names = "ipa-clock-enabled-valid",
"ipa-clock-enabled"; "ipa-clock-enabled";
modem-remoteproc = <&remoteproc_mpss>;
status = "disabled"; status = "disabled";
}; };
......
...@@ -2366,8 +2366,6 @@ ipa: ipa@1e40000 { ...@@ -2366,8 +2366,6 @@ ipa: ipa@1e40000 {
qcom,smem-state-names = "ipa-clock-enabled-valid", qcom,smem-state-names = "ipa-clock-enabled-valid",
"ipa-clock-enabled"; "ipa-clock-enabled";
modem-remoteproc = <&mss_pil>;
status = "disabled"; status = "disabled";
}; };
......
...@@ -43,7 +43,6 @@ enum ipa_flag { ...@@ -43,7 +43,6 @@ enum ipa_flag {
* @flags: Boolean state flags * @flags: Boolean state flags
* @version: IPA hardware version * @version: IPA hardware version
* @pdev: Platform device * @pdev: Platform device
* @modem_rproc: Remoteproc handle for modem subsystem
* @smp2p: SMP2P information * @smp2p: SMP2P information
* @clock: IPA clocking information * @clock: IPA clocking information
* @table_addr: DMA address of filter/route table content * @table_addr: DMA address of filter/route table content
...@@ -83,7 +82,6 @@ struct ipa { ...@@ -83,7 +82,6 @@ struct ipa {
DECLARE_BITMAP(flags, IPA_FLAG_COUNT); DECLARE_BITMAP(flags, IPA_FLAG_COUNT);
enum ipa_version version; enum ipa_version version;
struct platform_device *pdev; struct platform_device *pdev;
struct rproc *modem_rproc;
struct notifier_block nb; struct notifier_block nb;
void *notifier; void *notifier;
struct ipa_smp2p *smp2p; struct ipa_smp2p *smp2p;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/remoteproc.h>
#include <linux/qcom_scm.h> #include <linux/qcom_scm.h>
#include <linux/soc/qcom/mdt_loader.h> #include <linux/soc/qcom/mdt_loader.h>
...@@ -729,19 +728,6 @@ static const struct of_device_id ipa_match[] = { ...@@ -729,19 +728,6 @@ static const struct of_device_id ipa_match[] = {
}; };
MODULE_DEVICE_TABLE(of, ipa_match); MODULE_DEVICE_TABLE(of, ipa_match);
static phandle of_property_read_phandle(const struct device_node *np,
const char *name)
{
struct property *prop;
int len = 0;
prop = of_find_property(np, name, &len);
if (!prop || len != sizeof(__be32))
return 0;
return be32_to_cpup(prop->value);
}
/* Check things that can be validated at build time. This just /* Check things that can be validated at build time. This just
* groups these things BUILD_BUG_ON() calls don't clutter the rest * groups these things BUILD_BUG_ON() calls don't clutter the rest
* of the code. * of the code.
...@@ -807,10 +793,8 @@ static int ipa_probe(struct platform_device *pdev) ...@@ -807,10 +793,8 @@ static int ipa_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct ipa_data *data; const struct ipa_data *data;
struct ipa_clock *clock; struct ipa_clock *clock;
struct rproc *rproc;
bool modem_init; bool modem_init;
struct ipa *ipa; struct ipa *ipa;
phandle ph;
int ret; int ret;
ipa_validate_build(); ipa_validate_build();
...@@ -829,25 +813,12 @@ static int ipa_probe(struct platform_device *pdev) ...@@ -829,25 +813,12 @@ static int ipa_probe(struct platform_device *pdev)
if (!qcom_scm_is_available()) if (!qcom_scm_is_available())
return -EPROBE_DEFER; return -EPROBE_DEFER;
/* We rely on remoteproc to tell us about modem state changes */
ph = of_property_read_phandle(dev->of_node, "modem-remoteproc");
if (!ph) {
dev_err(dev, "DT missing \"modem-remoteproc\" property\n");
return -EINVAL;
}
rproc = rproc_get_by_phandle(ph);
if (!rproc)
return -EPROBE_DEFER;
/* The clock and interconnects might not be ready when we're /* The clock and interconnects might not be ready when we're
* probed, so might return -EPROBE_DEFER. * probed, so might return -EPROBE_DEFER.
*/ */
clock = ipa_clock_init(dev, data->clock_data); clock = ipa_clock_init(dev, data->clock_data);
if (IS_ERR(clock)) { if (IS_ERR(clock))
ret = PTR_ERR(clock); return PTR_ERR(clock);
goto err_rproc_put;
}
/* No more EPROBE_DEFER. Allocate and initialize the IPA structure */ /* No more EPROBE_DEFER. Allocate and initialize the IPA structure */
ipa = kzalloc(sizeof(*ipa), GFP_KERNEL); ipa = kzalloc(sizeof(*ipa), GFP_KERNEL);
...@@ -858,7 +829,6 @@ static int ipa_probe(struct platform_device *pdev) ...@@ -858,7 +829,6 @@ static int ipa_probe(struct platform_device *pdev)
ipa->pdev = pdev; ipa->pdev = pdev;
dev_set_drvdata(dev, ipa); dev_set_drvdata(dev, ipa);
ipa->modem_rproc = rproc;
ipa->clock = clock; ipa->clock = clock;
ipa->version = data->version; ipa->version = data->version;
...@@ -935,8 +905,6 @@ static int ipa_probe(struct platform_device *pdev) ...@@ -935,8 +905,6 @@ static int ipa_probe(struct platform_device *pdev)
kfree(ipa); kfree(ipa);
err_clock_exit: err_clock_exit:
ipa_clock_exit(clock); ipa_clock_exit(clock);
err_rproc_put:
rproc_put(rproc);
return ret; return ret;
} }
...@@ -944,7 +912,6 @@ static int ipa_probe(struct platform_device *pdev) ...@@ -944,7 +912,6 @@ static int ipa_probe(struct platform_device *pdev)
static int ipa_remove(struct platform_device *pdev) static int ipa_remove(struct platform_device *pdev)
{ {
struct ipa *ipa = dev_get_drvdata(&pdev->dev); struct ipa *ipa = dev_get_drvdata(&pdev->dev);
struct rproc *rproc = ipa->modem_rproc;
struct ipa_clock *clock = ipa->clock; struct ipa_clock *clock = ipa->clock;
int ret; int ret;
...@@ -970,7 +937,6 @@ static int ipa_remove(struct platform_device *pdev) ...@@ -970,7 +937,6 @@ static int ipa_remove(struct platform_device *pdev)
ipa_reg_exit(ipa); ipa_reg_exit(ipa);
kfree(ipa); kfree(ipa);
ipa_clock_exit(clock); ipa_clock_exit(clock);
rproc_put(rproc);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment