All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/3] net: ipa: three bug fixes
@ 2020-04-30 21:35 Alex Elder
  2020-04-30 21:35 ` [PATCH net 1/3] net: ipa: fix a bug in ipa_endpoint_stop() Alex Elder
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alex Elder @ 2020-04-30 21:35 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

This series fixes three bugs in the Qualcomm IPA code.  The third
adds a missing error code initialization step.

					-Alex

Alex Elder (3):
  net: ipa: fix a bug in ipa_endpoint_stop()
  net: ipa: fix an error message in gsi_channel_init_one()
  net: ipa: zero return code before issuing generic EE command

 drivers/net/ipa/gsi.c          | 11 +++++++++--
 drivers/net/ipa/gsi_reg.h      |  2 ++
 drivers/net/ipa/ipa_endpoint.c |  7 ++-----
 3 files changed, 13 insertions(+), 7 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 1/3] net: ipa: fix a bug in ipa_endpoint_stop()
  2020-04-30 21:35 [PATCH net 0/3] net: ipa: three bug fixes Alex Elder
@ 2020-04-30 21:35 ` Alex Elder
  2020-04-30 21:35 ` [PATCH net 2/3] net: ipa: fix an error message in gsi_channel_init_one() Alex Elder
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Alex Elder @ 2020-04-30 21:35 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

In ipa_endpoint_stop(), for TX endpoints we set the number of retries
to 0.  When we break out of the loop, retries being 0 means we return
EIO rather than the value of ret (which should be 0).

Fix this by using a non-zero retry count for both RX and TX
channels, and just break out of the loop after calling
gsi_channel_stop() for TX channels.  This way only RX channels
will retry, and the retry count will be non-zero at the end
for TX channels (so the proper value gets returned).

Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/ipa_endpoint.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c
index 6de03be28784..a21534f1462f 100644
--- a/drivers/net/ipa/ipa_endpoint.c
+++ b/drivers/net/ipa/ipa_endpoint.c
@@ -1283,7 +1283,7 @@ static int ipa_endpoint_stop_rx_dma(struct ipa *ipa)
  */
 int ipa_endpoint_stop(struct ipa_endpoint *endpoint)
 {
-	u32 retries = endpoint->toward_ipa ? 0 : IPA_ENDPOINT_STOP_RX_RETRIES;
+	u32 retries = IPA_ENDPOINT_STOP_RX_RETRIES;
 	int ret;
 
 	do {
@@ -1291,12 +1291,9 @@ int ipa_endpoint_stop(struct ipa_endpoint *endpoint)
 		struct gsi *gsi = &ipa->gsi;
 
 		ret = gsi_channel_stop(gsi, endpoint->channel_id);
-		if (ret != -EAGAIN)
+		if (ret != -EAGAIN || endpoint->toward_ipa)
 			break;
 
-		if (endpoint->toward_ipa)
-			continue;
-
 		/* For IPA v3.5.1, send a DMA read task and check again */
 		if (ipa->version == IPA_VERSION_3_5_1) {
 			ret = ipa_endpoint_stop_rx_dma(ipa);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 2/3] net: ipa: fix an error message in gsi_channel_init_one()
  2020-04-30 21:35 [PATCH net 0/3] net: ipa: three bug fixes Alex Elder
  2020-04-30 21:35 ` [PATCH net 1/3] net: ipa: fix a bug in ipa_endpoint_stop() Alex Elder
@ 2020-04-30 21:35 ` Alex Elder
  2020-04-30 21:35 ` [PATCH net 3/3] net: ipa: zero return code before issuing generic EE command Alex Elder
  2020-05-01  1:05 ` [PATCH net 0/3] net: ipa: three bug fixes David Miller
  3 siblings, 0 replies; 8+ messages in thread
From: Alex Elder @ 2020-04-30 21:35 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

An error message about limiting the number of TREs used prints the
wrong value.  Fix this bug.

Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/gsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 845478a19a4f..b4206fda0b22 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -1798,9 +1798,9 @@ static int gsi_channel_init_one(struct gsi *gsi,
 
 	/* Worst case we need an event for every outstanding TRE */
 	if (data->channel.tre_count > data->channel.event_count) {
-		dev_warn(gsi->dev, "channel %u limited to %u TREs\n",
-			data->channel_id, data->channel.tre_count);
 		tre_count = data->channel.event_count;
+		dev_warn(gsi->dev, "channel %u limited to %u TREs\n",
+			 data->channel_id, tre_count);
 	} else {
 		tre_count = data->channel.tre_count;
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 3/3] net: ipa: zero return code before issuing generic EE command
  2020-04-30 21:35 [PATCH net 0/3] net: ipa: three bug fixes Alex Elder
  2020-04-30 21:35 ` [PATCH net 1/3] net: ipa: fix a bug in ipa_endpoint_stop() Alex Elder
  2020-04-30 21:35 ` [PATCH net 2/3] net: ipa: fix an error message in gsi_channel_init_one() Alex Elder
@ 2020-04-30 21:35 ` Alex Elder
  2020-05-01  1:05 ` [PATCH net 0/3] net: ipa: three bug fixes David Miller
  3 siblings, 0 replies; 8+ messages in thread
From: Alex Elder @ 2020-04-30 21:35 UTC (permalink / raw)
  To: davem; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

Zero the result code stored in a field of the scratch 0 register
before issuing a generic EE command.  This just guarantees that
the value we read later was actually written as a result of the
command.

Also add the definitions of two more possible result codes that can
be returned when issuing flow control enable or disable commands:
  INCORRECT_CHANNEL_STATE: - channel must be in started state
  INCORRECT_DIRECTION - flow control is only valid for TX channels

Signed-off-by: Alex Elder <elder@linaro.org>
---
 drivers/net/ipa/gsi.c     | 7 +++++++
 drivers/net/ipa/gsi_reg.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index b4206fda0b22..b671bea0aa7c 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -1041,6 +1041,7 @@ static void gsi_isr_gp_int1(struct gsi *gsi)
 
 	complete(&gsi->completion);
 }
+
 /* Inter-EE interrupt handler */
 static void gsi_isr_glob_ee(struct gsi *gsi)
 {
@@ -1493,6 +1494,12 @@ static int gsi_generic_command(struct gsi *gsi, u32 channel_id,
 	struct completion *completion = &gsi->completion;
 	u32 val;
 
+	/* First zero the result code field */
+	val = ioread32(gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
+	val &= ~GENERIC_EE_RESULT_FMASK;
+	iowrite32(val, gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET);
+
+	/* Now issue the command */
 	val = u32_encode_bits(opcode, GENERIC_OPCODE_FMASK);
 	val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK);
 	val |= u32_encode_bits(GSI_EE_MODEM, GENERIC_EE_FMASK);
diff --git a/drivers/net/ipa/gsi_reg.h b/drivers/net/ipa/gsi_reg.h
index 7613b9cc7cf6..acc9e744c67d 100644
--- a/drivers/net/ipa/gsi_reg.h
+++ b/drivers/net/ipa/gsi_reg.h
@@ -410,6 +410,8 @@
 #define INTER_EE_RESULT_FMASK		GENMASK(2, 0)
 #define GENERIC_EE_RESULT_FMASK		GENMASK(7, 5)
 #define GENERIC_EE_SUCCESS_FVAL			1
+#define GENERIC_EE_INCORRECT_DIRECTION_FVAL	3
+#define GENERIC_EE_INCORRECT_CHANNEL_FVAL	5
 #define GENERIC_EE_NO_RESOURCES_FVAL		7
 #define USB_MAX_PACKET_FMASK		GENMASK(15, 15)	/* 0: HS; 1: SS */
 #define MHI_BASE_CHANNEL_FMASK		GENMASK(31, 24)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net 0/3] net: ipa: three bug fixes
  2020-04-30 21:35 [PATCH net 0/3] net: ipa: three bug fixes Alex Elder
                   ` (2 preceding siblings ...)
  2020-04-30 21:35 ` [PATCH net 3/3] net: ipa: zero return code before issuing generic EE command Alex Elder
@ 2020-05-01  1:05 ` David Miller
  3 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2020-05-01  1:05 UTC (permalink / raw)
  To: elder; +Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

From: Alex Elder <elder@linaro.org>
Date: Thu, 30 Apr 2020 16:35:09 -0500

> This series fixes three bugs in the Qualcomm IPA code.  The third
> adds a missing error code initialization step.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 0/3] net: ipa: three bug fixes
  2022-05-12 15:10 Alex Elder
@ 2022-05-13 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-13 11:50 UTC (permalink / raw)
  To: Alex Elder
  Cc: davem, kuba, pabeni, lkp, mka, evgreen, bjorn.andersson,
	quic_cpratapa, quic_avuyyuru, quic_jponduru, quic_subashab,
	elder, netdev, linux-arm-msm, linux-kernel

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 12 May 2022 10:10:30 -0500 you wrote:
> This series contains three somewhat unrelated minor bug fixes.
> 
> 					-Alex
> 
> Alex Elder (3):
>   net: ipa: certain dropped packets aren't accounted for
>   net: ipa: record proper RX transaction count
>   net: ipa: get rid of a duplicate initialization
> 
> [...]

Here is the summary with links:
  - [net,1/3] net: ipa: certain dropped packets aren't accounted for
    https://git.kernel.org/netdev/net/c/30b338ff7998
  - [net,2/3] net: ipa: record proper RX transaction count
    https://git.kernel.org/netdev/net/c/d8290cbe1111
  - [net,3/3] net: ipa: get rid of a duplicate initialization
    https://git.kernel.org/netdev/net/c/8d017efb1eaa

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 0/3] net: ipa: three bug fixes
@ 2022-05-12 15:10 Alex Elder
  2022-05-13 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Elder @ 2022-05-12 15:10 UTC (permalink / raw)
  To: davem, kuba, pabeni
  Cc: lkp, mka, evgreen, bjorn.andersson, quic_cpratapa, quic_avuyyuru,
	quic_jponduru, quic_subashab, elder, netdev, linux-arm-msm,
	linux-kernel

This series contains three somewhat unrelated minor bug fixes.

					-Alex

Alex Elder (3):
  net: ipa: certain dropped packets aren't accounted for
  net: ipa: record proper RX transaction count
  net: ipa: get rid of a duplicate initialization

 drivers/net/ipa/gsi.c          |  6 ++++--
 drivers/net/ipa/ipa_endpoint.c | 13 ++++++-------
 drivers/net/ipa/ipa_qmi.c      |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 0/3] net: ipa: three bug fixes
@ 2020-06-29 21:20 Alex Elder
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Elder @ 2020-06-29 21:20 UTC (permalink / raw)
  To: davem, kuba
  Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel

This series contains three bug fixes for the Qualcomm IPA driver.
In practice these bugs are unlikke.y to be harmful, but they do
represent incorrect code.

					-Alex

Alex Elder (3):
  net: ipa: always check for stopped channel
  net: ipa: no checksum offload for SDM845 LAN RX
  net: ipa: introduce ipa_cmd_tag_process()

 drivers/net/ipa/gsi.c             | 16 +++++++---------
 drivers/net/ipa/ipa_cmd.c         | 15 +++++++++++++++
 drivers/net/ipa/ipa_cmd.h         |  8 ++++++++
 drivers/net/ipa/ipa_data-sdm845.c |  1 -
 drivers/net/ipa/ipa_endpoint.c    |  2 ++
 5 files changed, 32 insertions(+), 10 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-13 11:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 21:35 [PATCH net 0/3] net: ipa: three bug fixes Alex Elder
2020-04-30 21:35 ` [PATCH net 1/3] net: ipa: fix a bug in ipa_endpoint_stop() Alex Elder
2020-04-30 21:35 ` [PATCH net 2/3] net: ipa: fix an error message in gsi_channel_init_one() Alex Elder
2020-04-30 21:35 ` [PATCH net 3/3] net: ipa: zero return code before issuing generic EE command Alex Elder
2020-05-01  1:05 ` [PATCH net 0/3] net: ipa: three bug fixes David Miller
2020-06-29 21:20 Alex Elder
2022-05-12 15:10 Alex Elder
2022-05-13 11:50 ` patchwork-bot+netdevbpf

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.