Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+5 -54
+3 -12
Documentation/devicetree/bindings/net/qcom,ipa.yaml
··· 113 113 performing early IPA initialization, including loading and 114 114 validating firwmare used by the GSI. 115 115 116 - modem-remoteproc: 117 - $ref: /schemas/types.yaml#/definitions/phandle 118 - description: 119 - This defines the phandle to the remoteproc node representing 120 - the modem subsystem. This is requied so the IPA driver can 121 - receive and act on notifications of modem up/down events. 122 - 123 116 memory-region: 124 117 maxItems: 1 125 118 description: ··· 128 135 - interrupts 129 136 - interconnects 130 137 - qcom,smem-states 131 - - modem-remoteproc 132 138 133 139 oneOf: 134 140 - required: ··· 139 147 140 148 examples: 141 149 - | 142 - #include <dt-bindings/interrupt-controller/irq.h> 150 + #include <dt-bindings/interrupt-controller/arm-gic.h> 143 151 #include <dt-bindings/clock/qcom,rpmh.h> 144 152 #include <dt-bindings/interconnect/qcom,sdm845.h> 145 153 ··· 160 168 compatible = "qcom,sdm845-ipa"; 161 169 162 170 modem-init; 163 - modem-remoteproc = <&mss_pil>; 164 171 165 172 iommus = <&apps_smmu 0x720 0x3>; 166 173 reg = <0x1e40000 0x7000>, ··· 169 178 "ipa-shared", 170 179 "gsi"; 171 180 172 - interrupts-extended = <&intc 0 311 IRQ_TYPE_EDGE_RISING>, 173 - <&intc 0 432 IRQ_TYPE_LEVEL_HIGH>, 181 + interrupts-extended = <&intc GIC_SPI 311 IRQ_TYPE_EDGE_RISING>, 182 + <&intc GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>, 174 183 <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>, 175 184 <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>; 176 185 interrupt-names = "ipa",
-2
arch/arm64/boot/dts/qcom/sc7180.dtsi
··· 1434 1434 qcom,smem-state-names = "ipa-clock-enabled-valid", 1435 1435 "ipa-clock-enabled"; 1436 1436 1437 - modem-remoteproc = <&remoteproc_mpss>; 1438 - 1439 1437 status = "disabled"; 1440 1438 }; 1441 1439
-2
arch/arm64/boot/dts/qcom/sdm845.dtsi
··· 2366 2366 qcom,smem-state-names = "ipa-clock-enabled-valid", 2367 2367 "ipa-clock-enabled"; 2368 2368 2369 - modem-remoteproc = <&mss_pil>; 2370 - 2371 2369 status = "disabled"; 2372 2370 }; 2373 2371
-2
drivers/net/ipa/ipa.h
··· 43 43 * @flags: Boolean state flags 44 44 * @version: IPA hardware version 45 45 * @pdev: Platform device 46 - * @modem_rproc: Remoteproc handle for modem subsystem 47 46 * @smp2p: SMP2P information 48 47 * @clock: IPA clocking information 49 48 * @table_addr: DMA address of filter/route table content ··· 82 83 DECLARE_BITMAP(flags, IPA_FLAG_COUNT); 83 84 enum ipa_version version; 84 85 struct platform_device *pdev; 85 - struct rproc *modem_rproc; 86 86 struct notifier_block nb; 87 87 void *notifier; 88 88 struct ipa_smp2p *smp2p;
+2 -36
drivers/net/ipa/ipa_main.c
··· 15 15 #include <linux/of.h> 16 16 #include <linux/of_device.h> 17 17 #include <linux/of_address.h> 18 - #include <linux/remoteproc.h> 19 18 #include <linux/qcom_scm.h> 20 19 #include <linux/soc/qcom/mdt_loader.h> 21 20 ··· 728 729 }; 729 730 MODULE_DEVICE_TABLE(of, ipa_match); 730 731 731 - static phandle of_property_read_phandle(const struct device_node *np, 732 - const char *name) 733 - { 734 - struct property *prop; 735 - int len = 0; 736 - 737 - prop = of_find_property(np, name, &len); 738 - if (!prop || len != sizeof(__be32)) 739 - return 0; 740 - 741 - return be32_to_cpup(prop->value); 742 - } 743 - 744 732 /* Check things that can be validated at build time. This just 745 733 * groups these things BUILD_BUG_ON() calls don't clutter the rest 746 734 * of the code. ··· 793 807 struct device *dev = &pdev->dev; 794 808 const struct ipa_data *data; 795 809 struct ipa_clock *clock; 796 - struct rproc *rproc; 797 810 bool modem_init; 798 811 struct ipa *ipa; 799 - phandle ph; 800 812 int ret; 801 813 802 814 ipa_validate_build(); ··· 813 829 if (!qcom_scm_is_available()) 814 830 return -EPROBE_DEFER; 815 831 816 - /* We rely on remoteproc to tell us about modem state changes */ 817 - ph = of_property_read_phandle(dev->of_node, "modem-remoteproc"); 818 - if (!ph) { 819 - dev_err(dev, "DT missing \"modem-remoteproc\" property\n"); 820 - return -EINVAL; 821 - } 822 - 823 - rproc = rproc_get_by_phandle(ph); 824 - if (!rproc) 825 - return -EPROBE_DEFER; 826 - 827 832 /* The clock and interconnects might not be ready when we're 828 833 * probed, so might return -EPROBE_DEFER. 829 834 */ 830 835 clock = ipa_clock_init(dev, data->clock_data); 831 - if (IS_ERR(clock)) { 832 - ret = PTR_ERR(clock); 833 - goto err_rproc_put; 834 - } 836 + if (IS_ERR(clock)) 837 + return PTR_ERR(clock); 835 838 836 839 /* No more EPROBE_DEFER. Allocate and initialize the IPA structure */ 837 840 ipa = kzalloc(sizeof(*ipa), GFP_KERNEL); ··· 829 858 830 859 ipa->pdev = pdev; 831 860 dev_set_drvdata(dev, ipa); 832 - ipa->modem_rproc = rproc; 833 861 ipa->clock = clock; 834 862 ipa->version = data->version; 835 863 ··· 905 935 kfree(ipa); 906 936 err_clock_exit: 907 937 ipa_clock_exit(clock); 908 - err_rproc_put: 909 - rproc_put(rproc); 910 938 911 939 return ret; 912 940 } ··· 912 944 static int ipa_remove(struct platform_device *pdev) 913 945 { 914 946 struct ipa *ipa = dev_get_drvdata(&pdev->dev); 915 - struct rproc *rproc = ipa->modem_rproc; 916 947 struct ipa_clock *clock = ipa->clock; 917 948 int ret; 918 949 ··· 937 970 ipa_reg_exit(ipa); 938 971 kfree(ipa); 939 972 ipa_clock_exit(clock); 940 - rproc_put(rproc); 941 973 942 974 return 0; 943 975 }