diff options
author | Alex Elder <elder@linaro.org> | 2022-10-21 14:13:40 -0500 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-10-25 11:15:19 +0200 |
commit | 73da9cac517ce4dc3a00b87f800846dcc2469ddf (patch) | |
tree | 4c8419100b6b3ca7fa623ffbab551e24d271ef2c /drivers/net/ipa/ipa_mem.c | |
parent | 39ad815244ac3746c0194ae3eb45cb1f51d3489a (diff) |
net: ipa: check table memory regions earlier
Verify that the sizes of the routing and filter table memory regions
are valid as part of memory initialization, rather than waiting for
table initialization. The main reason to do this is that upcoming
patches use these memory region sizes to determine the number of
entries in these tables, and we'll want to know these sizes are good
sooner.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ipa/ipa_mem.c')
-rw-r--r-- | drivers/net/ipa/ipa_mem.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index 4022ae01a131..a3d2317452ac 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -617,6 +617,12 @@ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) ipa->mem_count = mem_data->local_count; ipa->mem = mem_data->local; + /* Check the route and filter table memory regions */ + if (!ipa_table_mem_valid(ipa, 0)) + return -EINVAL; + if (!ipa_table_mem_valid(ipa, IPA_ROUTE_MODEM_COUNT)) + return -EINVAL; + ret = dma_set_mask_and_coherent(&ipa->pdev->dev, DMA_BIT_MASK(64)); if (ret) { dev_err(dev, "error %d setting DMA mask\n", ret); |