netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genet:Fix error handling in the function bcmgenet_fini_gma
Date: Wed, 12 Aug 2015 21:13:45 -0700	[thread overview]
Message-ID: <55CC1979.2080608@gmail.com> (raw)
In-Reply-To: <1439432875-2992-1-git-send-email-xerofoify@gmail.com>

Le 08/12/15 19:27, Nicholas Krause a écrit :
> This fixes error handing in the function bcmgenet_fini_gma to
> properly check if its internal call to the function
> bcm_genet_teardown has failed by returning a error code and if
> so return immediately to this function's caller with a return
> statement as this function call can no longer continue without
> issues arising from the call to the function bcm_genet_teardown.

NACK, this is not a good idea, there are specific reasons why the DMA
teardown can fail, e.g: when no bandwidth has been allocated at the
memory controller level, and we still want to keep tearing down and
freeing up resources while we reconfigure the controller one way or the
other, this can happen while debugging a system, and this is specific to
how GENET is integrated on Broadcom BCM7xxx SoCs.

Also, if you ever need to submit more patches, please look at the git
log history and use consistent prefixes, for this driver this would be
"net: bcmgenet: blah blah"

> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 64c1e9d..50e6183 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -2180,7 +2180,8 @@ static void bcmgenet_fini_dma(struct bcmgenet_priv *priv)
>  	bcmgenet_fini_tx_napi(priv);
>  
>  	/* disable DMA */
> -	bcmgenet_dma_teardown(priv);
> +	if (bcmgenet_dma_teardown(priv))
> +		return;
>  
>  	for (i = 0; i < priv->num_tx_bds; i++) {
>  		if (priv->tx_cbs[i].skb != NULL) {
> 


-- 
Florian

           reply	other threads:[~2015-08-13  4:13 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1439432875-2992-1-git-send-email-xerofoify@gmail.com>]

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=55CC1979.2080608@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xerofoify@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).