All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karol Kolacinski <karol.kolacinski@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Karol Kolacinski <karol.kolacinski@intel.com>
Subject: [Intel-wired-lan] [PATCH v3 net] ice: Write all GNSS buffers instead of first one
Date: Fri, 17 Feb 2023 13:05:41 +0100	[thread overview]
Message-ID: <20230217120541.16745-1-karol.kolacinski@intel.com> (raw)

When user writes multiple messages in a short period of time, the driver
writes only the first one and buffers others in a linked list.

Fix this behavior to write all pending buffers instead of only the first
one.

To reproduce this issue, open the GNSS device with cat, send a few
messages to the device, e.g. multiple commands using echo. The issue
manifests itself as response to only first message. Then, after issuing
a single or multiple commands, user can see that response from the
device was not for recent ones but for the next single buffered one from
the first batch.

Fixes: d6b98c8d242a ("ice: add write functionality for GNSS TTY")
Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
---
V2 -> V3: Switched to net-queue tree instead of next-queue.
V1 -> V2: Added reproduction steps in the commit message.

 drivers/net/ethernet/intel/ice/ice_gnss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c
index 43e199b5b513..02533014f24a 100644
--- a/drivers/net/ethernet/intel/ice/ice_gnss.c
+++ b/drivers/net/ethernet/intel/ice/ice_gnss.c
@@ -82,7 +82,7 @@ static void ice_gnss_write_pending(struct kthread_work *work)
 						write_work);
 	struct ice_pf *pf = gnss->back;
 
-	if (!list_empty(&gnss->queue)) {
+	while (!list_empty(&gnss->queue)) {
 		struct gnss_write_buf *write_buf = NULL;
 		unsigned int bytes;
 
-- 
2.37.2

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

             reply	other threads:[~2023-02-17 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 12:05 Karol Kolacinski [this message]
2023-03-24 16:47 ` [Intel-wired-lan] [PATCH v3 net] ice: Write all GNSS buffers instead of first one Michal Schmidt
2023-04-04 15:57   ` Mekala, SunithaX D

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=20230217120541.16745-1-karol.kolacinski@intel.com \
    --to=karol.kolacinski@intel.com \
    --cc=intel-wired-lan@lists.osuosl.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.