All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: robh+dt@kernel.org, angelogioacchino.delregno@somainline.org,
	jamipkettunen@gmail.com, bjorn.andersson@linaro.org,
	agross@kernel.org, elder@kernel.org,
	linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 4/6] net: ipa: FLAVOR_0 register doesn't exist until IPA v3.5
Date: Mon, 21 Jun 2021 12:56:25 -0500	[thread overview]
Message-ID: <20210621175627.238474-5-elder@linaro.org> (raw)
In-Reply-To: <20210621175627.238474-1-elder@linaro.org>

The FLAVOR_0 version first appears in IPA v3.5, so avoid attempting
to read it for versions prior to that.

This register contains a concise definition of the number and
direction of endpoints supported by the hardware, and without it
we can't verify endpoint configuration in ipa_endpoint_config().
In this case, just indicate that any endpoint number is available
for use.

Originally proposed by AngeloGioacchino Del Regno.

Link: https://lore.kernel.org/netdev/20210211175015.200772-3-angelogioacchino.delregno@somainline.org
Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/ipa_endpoint.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c
index 3520852936ed1..ab02669bae4e6 100644
--- a/drivers/net/ipa/ipa_endpoint.c
+++ b/drivers/net/ipa/ipa_endpoint.c
@@ -1731,6 +1731,21 @@ int ipa_endpoint_config(struct ipa *ipa)
 	u32 max;
 	u32 val;
 
+	/* Prior to IPAv3.5, the FLAVOR_0 register was not supported.
+	 * Furthermore, the endpoints were not grouped such that TX
+	 * endpoint numbers started with 0 and RX endpoints had numbers
+	 * higher than all TX endpoints, so we can't do the simple
+	 * direction check used for newer hardware below.
+	 *
+	 * For hardware that doesn't support the FLAVOR_0 register,
+	 * just set the available mask to support any endpoint, and
+	 * assume the configuration is valid.
+	 */
+	if (ipa->version < IPA_VERSION_3_5) {
+		ipa->available = ~0;
+		return 0;
+	}
+
 	/* Find out about the endpoints supplied by the hardware, and ensure
 	 * the highest one doesn't exceed the number we support.
 	 */
-- 
2.27.0


  parent reply	other threads:[~2021-06-21 18:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 17:56 [PATCH net-next 0/6] net: ipa: add support for IPA v3.1 Alex Elder
2021-06-21 17:56 ` [PATCH net-next 1/6] dt-bindings: net: qcom,ipa: add support for MSM8998 Alex Elder
2021-06-21 17:56 ` [PATCH net-next 2/6] net: ipa: inter-EE interrupts aren't always available Alex Elder
2021-06-21 18:41   ` AngeloGioacchino Del Regno
2021-06-21 17:56 ` [PATCH net-next 3/6] net: ipa: disable misc clock gating for IPA v3.1 Alex Elder
2021-06-21 18:40   ` AngeloGioacchino Del Regno
2021-06-21 17:56 ` Alex Elder [this message]
2021-06-21 18:42   ` [PATCH net-next 4/6] net: ipa: FLAVOR_0 register doesn't exist until IPA v3.5 AngeloGioacchino Del Regno
2021-06-21 17:56 ` [PATCH net-next 5/6] net: ipa: introduce gsi_ring_setup() Alex Elder
2021-06-21 18:42   ` AngeloGioacchino Del Regno
2021-06-21 17:56 ` [PATCH net-next 6/6] net: ipa: add IPA v3.1 configuration data Alex Elder
2021-06-21 18:43   ` AngeloGioacchino Del Regno
2021-06-21 19:50 ` [PATCH net-next 0/6] net: ipa: add support for IPA v3.1 patchwork-bot+netdevbpf

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=20210621175627.238474-5-elder@linaro.org \
    --to=elder@linaro.org \
    --cc=agross@kernel.org \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@kernel.org \
    --cc=jamipkettunen@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.