All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dm9000: Correctly handle empty FIFO
@ 2022-04-25 18:28 Marek Vasut
  2022-04-30 23:33 ` Ramon Fried
  2022-08-08 19:07 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2022-04-25 18:28 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Joe Hershberger, Ramon Fried

Assign packet pointer only in case the MAC reports anything in the FIFO.
In case the MAC indicates empty FIFO, return 0 to pass that information
to the network stack.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
---
 drivers/net/dm9000x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 78ce536d4a3..07733df533e 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -666,10 +666,10 @@ static int dm9000_recv(struct udevice *dev, int flags, uchar **packetp)
 	int ret;
 
 	ret = dm9000_recv_common(db, data);
-	if (ret)
+	if (ret > 0)
 		*packetp = (void *)data;
 
-	return ret ? ret : -EAGAIN;
+	return ret >= 0 ? ret : -EAGAIN;
 }
 
 static int dm9000_write_hwaddr(struct udevice *dev)
-- 
2.35.1


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

* Re: [PATCH] net: dm9000: Correctly handle empty FIFO
  2022-04-25 18:28 [PATCH] net: dm9000: Correctly handle empty FIFO Marek Vasut
@ 2022-04-30 23:33 ` Ramon Fried
  2022-08-08 19:07 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Ramon Fried @ 2022-04-30 23:33 UTC (permalink / raw)
  To: Marek Vasut; +Cc: U-Boot Mailing List, Joe Hershberger

On Mon, Apr 25, 2022 at 9:28 PM Marek Vasut <marex@denx.de> wrote:
>
> Assign packet pointer only in case the MAC reports anything in the FIFO.
> In case the MAC indicates empty FIFO, return 0 to pass that information
> to the network stack.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> ---
>  drivers/net/dm9000x.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
> index 78ce536d4a3..07733df533e 100644
> --- a/drivers/net/dm9000x.c
> +++ b/drivers/net/dm9000x.c
> @@ -666,10 +666,10 @@ static int dm9000_recv(struct udevice *dev, int flags, uchar **packetp)
>         int ret;
>
>         ret = dm9000_recv_common(db, data);
> -       if (ret)
> +       if (ret > 0)
>                 *packetp = (void *)data;
>
> -       return ret ? ret : -EAGAIN;
> +       return ret >= 0 ? ret : -EAGAIN;
>  }
>
>  static int dm9000_write_hwaddr(struct udevice *dev)
> --
> 2.35.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

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

* Re: [PATCH] net: dm9000: Correctly handle empty FIFO
  2022-04-25 18:28 [PATCH] net: dm9000: Correctly handle empty FIFO Marek Vasut
  2022-04-30 23:33 ` Ramon Fried
@ 2022-08-08 19:07 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-08-08 19:07 UTC (permalink / raw)
  To: Marek Vasut; +Cc: u-boot, Joe Hershberger, Ramon Fried

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

On Mon, Apr 25, 2022 at 08:28:05PM +0200, Marek Vasut wrote:

> Assign packet pointer only in case the MAC reports anything in the FIFO.
> In case the MAC indicates empty FIFO, return 0 to pass that information
> to the network stack.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2022-08-08 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 18:28 [PATCH] net: dm9000: Correctly handle empty FIFO Marek Vasut
2022-04-30 23:33 ` Ramon Fried
2022-08-08 19:07 ` Tom Rini

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.