* [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
@ 2017-10-26 10:33 Ashish Kumar
2017-10-26 15:19 ` York Sun
2017-11-17 17:16 ` York Sun
0 siblings, 2 replies; 6+ messages in thread
From: Ashish Kumar @ 2017-10-26 10:33 UTC (permalink / raw)
To: u-boot
Correcting error handing for qbman_swp_acquire. The return value is zero is
an error condition since number of buffer copied is zero meaning
there are no free buffers for allocation.
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kushwaha Prabhakar <prabhakar@freescale.com>
---
drivers/net/ldpaa_eth/ldpaa_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index f235b62..21be79a 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -334,7 +334,7 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len)
&buffer_start, 1);
} while (err == -EBUSY);
- if (err < 0) {
+ if (err <= 0) {
printf("qbman_swp_acquire() failed\n");
return -ENOMEM;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
2017-10-26 10:33 [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire() Ashish Kumar
@ 2017-10-26 15:19 ` York Sun
2017-10-30 5:23 ` Ashish Kumar
2017-11-17 17:16 ` York Sun
1 sibling, 1 reply; 6+ messages in thread
From: York Sun @ 2017-10-26 15:19 UTC (permalink / raw)
To: u-boot
On 10/26/2017 03:33 AM, Ashish Kumar wrote:
> Correcting error handing for qbman_swp_acquire. The return value is zero is
> an error condition since number of buffer copied is zero meaning
> there are no free buffers for allocation.
>
> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> Signed-off-by: Kushwaha Prabhakar <prabhakar@freescale.com>
> ---
> drivers/net/ldpaa_eth/ldpaa_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
> index f235b62..21be79a 100644
> --- a/drivers/net/ldpaa_eth/ldpaa_eth.c
> +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
> @@ -334,7 +334,7 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len)
> &buffer_start, 1);
> } while (err == -EBUSY);
>
> - if (err < 0) {
> + if (err <= 0) {
> printf("qbman_swp_acquire() failed\n");
> return -ENOMEM;
> }
>
Since you already check for errors in qbman_swp_acquire(), would it be
better to check if "num" is zero there?
York
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
2017-10-26 15:19 ` York Sun
@ 2017-10-30 5:23 ` Ashish Kumar
2017-10-30 19:02 ` York Sun
0 siblings, 1 reply; 6+ messages in thread
From: Ashish Kumar @ 2017-10-30 5:23 UTC (permalink / raw)
To: u-boot
Hello York,
The definition of qbman_swp_acquire(), is not owned by u-boot, it is part of qbman drivers which is owned by Roy.
u-boot gets this definition from flib code and same is used in u-boot as it is.
So, moving this error handler in qbman_swp_acquire for num == 0, may result in inconsistency in flib code that was provided at the time of integration.
Please suggest.
Regards
Ashish
-----Original Message-----
From: York Sun
Sent: Thursday, October 26, 2017 8:49 PM
To: Ashish Kumar <ashish.kumar@nxp.com>; u-boot at lists.denx.de
Cc: joe.hershberger at gmail.com; Kushwaha Prabhakar <prabhakar@freescale.com>
Subject: Re: [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
On 10/26/2017 03:33 AM, Ashish Kumar wrote:
> Correcting error handing for qbman_swp_acquire. The return value is
> zero is an error condition since number of buffer copied is zero
> meaning there are no free buffers for allocation.
>
> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> Signed-off-by: Kushwaha Prabhakar <prabhakar@freescale.com>
> ---
> drivers/net/ldpaa_eth/ldpaa_eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c
> b/drivers/net/ldpaa_eth/ldpaa_eth.c
> index f235b62..21be79a 100644
> --- a/drivers/net/ldpaa_eth/ldpaa_eth.c
> +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
> @@ -334,7 +334,7 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void *buf, int len)
> &buffer_start, 1);
> } while (err == -EBUSY);
>
> - if (err < 0) {
> + if (err <= 0) {
> printf("qbman_swp_acquire() failed\n");
> return -ENOMEM;
> }
>
Since you already check for errors in qbman_swp_acquire(), would it be better to check if "num" is zero there?
York
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
2017-10-30 5:23 ` Ashish Kumar
@ 2017-10-30 19:02 ` York Sun
2017-10-31 5:19 ` Ashish Kumar
0 siblings, 1 reply; 6+ messages in thread
From: York Sun @ 2017-10-30 19:02 UTC (permalink / raw)
To: u-boot
On 10/29/2017 10:23 PM, Ashish Kumar wrote:
> Hello York,
>
> The definition of qbman_swp_acquire(), is not owned by u-boot, it is part of qbman drivers which is owned by Roy.
> u-boot gets this definition from flib code and same is used in u-boot as it is.
>
> So, moving this error handler in qbman_swp_acquire for num == 0, may result in inconsistency in flib code that was provided at the time of integration.
>
OK. Let's keep it that way.
BTW, please do not top post if you can avoid it. Please always use
common quotation style when you reply.
York
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
2017-10-30 19:02 ` York Sun
@ 2017-10-31 5:19 ` Ashish Kumar
0 siblings, 0 replies; 6+ messages in thread
From: Ashish Kumar @ 2017-10-31 5:19 UTC (permalink / raw)
To: u-boot
Please see inline.
-----Original Message-----
From: York Sun
Sent: Tuesday, October 31, 2017 12:32 AM
To: Ashish Kumar <ashish.kumar@nxp.com>; Roy Pledge <roy.pledge@nxp.com>
Cc: joe.hershberger at gmail.com; Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; u-boot at lists.denx.de
Subject: Re: [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
On 10/29/2017 10:23 PM, Ashish Kumar wrote:
> Hello York,
>
> The definition of qbman_swp_acquire(), is not owned by u-boot, it is part of qbman drivers which is owned by Roy.
> u-boot gets this definition from flib code and same is used in u-boot as it is.
>
> So, moving this error handler in qbman_swp_acquire for num == 0, may result in inconsistency in flib code that was provided at the time of integration.
>
OK. Let's keep it that way.
BTW, please do not top post if you can avoid it. Please always use common quotation style when you reply.
Sure, I will take care.
York
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire()
2017-10-26 10:33 [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire() Ashish Kumar
2017-10-26 15:19 ` York Sun
@ 2017-11-17 17:16 ` York Sun
1 sibling, 0 replies; 6+ messages in thread
From: York Sun @ 2017-11-17 17:16 UTC (permalink / raw)
To: u-boot
On 10/26/2017 03:33 AM, Ashish Kumar wrote:
> Correcting error handing for qbman_swp_acquire. The return value is zero is
> an error condition since number of buffer copied is zero meaning
> there are no free buffers for allocation.
>
> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> Signed-off-by: Kushwaha Prabhakar <prabhakar@freescale.com>
> ---
Applied to fsl-qoriq master. Thanks.
York
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-11-17 17:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26 10:33 [U-Boot] [PATCH] drivers: net: ldpaa_eth: Correct error handler for qbman_swp_acquire() Ashish Kumar
2017-10-26 15:19 ` York Sun
2017-10-30 5:23 ` Ashish Kumar
2017-10-30 19:02 ` York Sun
2017-10-31 5:19 ` Ashish Kumar
2017-11-17 17:16 ` York Sun
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.