[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250523131744.GU365796@horms.kernel.org>
Date: Fri, 23 May 2025 14:17:44 +0100
From: Simon Horman <horms@...nel.org>
To: Konrad Dybcio <konradybcio@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Alex Elder <elder@...nel.org>,
Marijn Suijten <marijn.suijten@...ainline.org>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Konrad Dybcio <konrad.dybcio@....qualcomm.com>
Subject: Re: [PATCH 3/3] net: ipa: Grab IMEM slice base/size from DTS
On Fri, May 23, 2025 at 01:08:34AM +0200, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
>
> This is a detail that differ per chip, and not per IPA version (and
> there are cases of the same IPA versions being implemented across very
> very very different SoCs).
>
> This region isn't actually used by the driver, but we most definitely
> want to iommu-map it, so that IPA can poke at the data within.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
It looks like these patches are for net-next. For future reference,
it's best to note that in the subject.
Subject: [PATCH net-next 3/3 v2] ...
> ---
> drivers/net/ipa/ipa_data.h | 3 +++
> drivers/net/ipa/ipa_mem.c | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h
> index 2fd03f0799b207833f9f2b421ce043534720d718..a384df91b5ee3ed2db9c7812ad43d03424b82a6f 100644
> --- a/drivers/net/ipa/ipa_data.h
> +++ b/drivers/net/ipa/ipa_data.h
> @@ -185,8 +185,11 @@ struct ipa_resource_data {
> struct ipa_mem_data {
> u32 local_count;
> const struct ipa_mem *local;
> +
> + /* DEPRECATED (now passed via DT) fallback data, varies per chip and not per IPA version */
For Networking code, please restrict lines to 80 columns wide or less where
that can be done without reducing readability (which is the case here).
/* DEPRECATED (now passed via DT) fallback data,
* varies per chip and not per IPA version */
> u32 imem_addr;
> u32 imem_size;
> +
> u32 smem_size;
> };
>
> diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c
> index 835a3c9c1fd47167da3396424a1653ebcae81d40..020508ab47d92b5cca9d5b467e3fef46936b4a82 100644
> --- a/drivers/net/ipa/ipa_mem.c
> +++ b/drivers/net/ipa/ipa_mem.c
> @@ -7,6 +7,7 @@
> #include <linux/dma-mapping.h>
> #include <linux/io.h>
> #include <linux/iommu.h>
> +#include <linux/of_address.h>
> #include <linux/platform_device.h>
> #include <linux/types.h>
>
> @@ -617,7 +618,9 @@ static void ipa_smem_exit(struct ipa *ipa)
> int ipa_mem_init(struct ipa *ipa, struct platform_device *pdev,
> const struct ipa_mem_data *mem_data)
> {
> + struct device_node *ipa_slice_np;
> struct device *dev = &pdev->dev;
> + u32 imem_base, imem_size;
> struct resource *res;
> int ret;
>
> @@ -656,6 +659,21 @@ int ipa_mem_init(struct ipa *ipa, struct platform_device *pdev,
> ipa->mem_addr = res->start;
> ipa->mem_size = resource_size(res);
>
> + ipa_slice_np = of_parse_phandle(dev->of_node, "sram", 0);
> + if (ipa_slice_np) {
> + ret = of_address_to_resource(ipa_slice_np, 0, res);
> + of_node_put(ipa_slice_np);
> + if (ret)
> + return ret;
> +
> + imem_base = res->start;
> + imem_size = resource_size(res);
> + } else {
> + /* Backwards compatibility for DTs lacking an explicit reference */
Ditto.
> + imem_base = mem_data->imem_addr;
> + imem_size = mem_data->imem_size;
> + }
> +
> ret = ipa_imem_init(ipa, mem_data->imem_addr, mem_data->imem_size);
I think you also need to update this line to use the local
variables imem_addr and imem_size.
> if (ret)
> goto err_unmap;
Please do observe the 24h rule [1] if you post a v2 of this patchset.
[1] https://docs.kernel.org/process/maintainer-netdev.html#resending-after-review
Powered by blists - more mailing lists