netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: hau@realtek.com
Cc: netdev@vger.kernel.org, nic_swsd@realtek.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] 8139too:fix system hang when there is a tx timeout event.
Date: Sat, 30 Jul 2016 20:37:57 -0700 (PDT)	[thread overview]
Message-ID: <20160730.203757.2140649329519453835.davem@davemloft.net> (raw)
In-Reply-To: <1469644797-13334-1-git-send-email-hau@realtek.com>

From: Chunhao Lin <hau@realtek.com>
Date: Thu, 28 Jul 2016 02:39:57 +0800

> If tx timeout event occur, kernel will call rtl8139_tx_timeout_task() to reset
> hardware. But in this function, driver does not stop tx and rx function before
> reset hardware, that will cause system hang.
> 
> In this patch, add stop tx and rx function before reset hardware.
> 
> Signed-off-by: Chunhao Lin <hau@realtek.com>

First, please always place a space after the subsystem prefix in your Subject
lines "8139too: ".

> @@ -1667,6 +1667,10 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
>  	int i;
>  	u8 tmp8;
>  
> +	napi_disable(&tp->napi);
> +	netif_stop_queue(dev);
> +	synchronize_sched();
> +
>  	netdev_dbg(dev, "Transmit timeout, status %02x %04x %04x media %02x\n",
>  		   RTL_R8(ChipCmd), RTL_R16(IntrStatus),
>  		   RTL_R16(IntrMask), RTL_R8(MediaStatus));
> @@ -1696,10 +1700,10 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
>  	spin_unlock_irq(&tp->lock);
>  
>  	/* ...and finally, reset everything */
> -	if (netif_running(dev)) {
> -		rtl8139_hw_start (dev);
> -		netif_wake_queue (dev);
> -	}
> +	napi_enable(&tp->napi);
> +	rtl8139_hw_start (dev);
> +	netif_wake_queue (dev);
> +

Get rid of these spaces in these function calls before the openning parenthesis.

      reply	other threads:[~2016-07-31  3:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 18:39 [PATCH net] 8139too:fix system hang when there is a tx timeout event Chunhao Lin
2016-07-31  3:37 ` David Miller [this message]

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=20160730.203757.2140649329519453835.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hau@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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).