From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: evgreen@chromium.org, subashab@codeaurora.org,
cpratapa@codeaurora.org, bjorn.andersson@linaro.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 3/6] net: ipa: use version in gsi_channel_init()
Date: Mon, 2 Nov 2020 11:53:57 -0600 [thread overview]
Message-ID: <20201102175400.6282-4-elder@linaro.org> (raw)
In-Reply-To: <20201102175400.6282-1-elder@linaro.org>
A quirk of IPA v4.2 requires the AP to allocate the GSI channels
that are owned by the modem.
Rather than pass a flag argument to gsi_channel_init(), use the
IPA version directly in that function to determine whether modem
channels need to be allocated.
Signed-off-by: Alex Elder <elder@linaro.org>
---
drivers/net/ipa/gsi.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 178d6ec2699eb..eae8ed83c1004 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -1894,12 +1894,15 @@ static void gsi_channel_exit_one(struct gsi_channel *channel)
/* Init function for channels */
static int gsi_channel_init(struct gsi *gsi, u32 count,
- const struct ipa_gsi_endpoint_data *data,
- bool modem_alloc)
+ const struct ipa_gsi_endpoint_data *data)
{
+ bool modem_alloc;
int ret = 0;
u32 i;
+ /* IPA v4.2 requires the AP to allocate channels for the modem */
+ modem_alloc = gsi->version == IPA_VERSION_4_2;
+
gsi_evt_ring_init(gsi);
/* The endpoint data array is indexed by endpoint name */
@@ -1961,14 +1964,10 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev,
struct resource *res;
resource_size_t size;
unsigned int irq;
- bool modem_alloc;
int ret;
gsi_validate_build();
- /* IPA v4.2 requires the AP to allocate channels for the modem */
- modem_alloc = version == IPA_VERSION_4_2;
-
gsi->dev = dev;
gsi->version = version;
@@ -2014,7 +2013,7 @@ int gsi_init(struct gsi *gsi, struct platform_device *pdev,
goto err_free_irq;
}
- ret = gsi_channel_init(gsi, count, data, modem_alloc);
+ ret = gsi_channel_init(gsi, count, data);
if (ret)
goto err_iounmap;
--
2.20.1
next prev parent reply other threads:[~2020-11-02 17:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 17:53 [PATCH net-next 0/6] net: ipa: tell GSI the IPA version Alex Elder
2020-11-02 17:53 ` [PATCH net-next 1/6] net: ipa: expose IPA version to the GSI layer Alex Elder
2020-11-02 17:53 ` [PATCH net-next 2/6] net: ipa: record IPA version in GSI structure Alex Elder
2020-11-02 17:53 ` Alex Elder [this message]
2020-11-02 17:53 ` [PATCH net-next 4/6] net: ipa: use version in gsi_channel_reset() Alex Elder
2020-11-02 17:53 ` [PATCH net-next 5/6] net: ipa: use version in gsi_channel_program() Alex Elder
2020-11-02 17:54 ` [PATCH net-next 6/6] net: ipa: eliminate legacy arguments Alex Elder
2020-11-05 0:31 ` [PATCH net-next 0/6] net: ipa: tell GSI the IPA version Jakub Kicinski
2020-11-05 13:40 ` Alex Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201102175400.6282-4-elder@linaro.org \
--to=elder@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=cpratapa@codeaurora.org \
--cc=davem@davemloft.net \
--cc=evgreen@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).