netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Williams <sam8641@gmail.com>
To: mlindner@marvell.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Samuel Williams <sam8641@gmail.com>
Subject: [PATCH] sky2: detect and prevent kernel panic from a possible faulty hardware
Date: Sat, 27 Jul 2013 15:35:54 -0500	[thread overview]
Message-ID: <1374957354-10142-1-git-send-email-sam8641@gmail.com> (raw)

A possible faulty hardware might interrupt with a status of 0xffffffff which
may kernel panic if sky2 driver tries to handle it. Detecting this problem
may avoid kernel panic.

Signed-off-by: Samuel Williams <sam8641@gmail.com>
---
 drivers/net/ethernet/marvell/sky2.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index e09a8c6..43fe2f3 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -3049,8 +3049,17 @@ static int sky2_poll(struct napi_struct *napi, int work_limit)
 	int work_done = 0;
 	u16 idx;
 
-	if (unlikely(status & Y2_IS_ERROR))
+	if (unlikely(status & Y2_IS_ERROR)) {
+		if (status == 0xFFFFFFFF) {
+			dev_err(&hw->pdev->dev,
+				"fatal hardware inturrupt error\n");
+			napi_complete(napi);
+			napi_disable(&hw->napi);
+			return 0;
+		}
 		sky2_err_intr(hw, status);
+	}
+
 
 	if (status & Y2_IS_IRQ_PHY1)
 		sky2_phy_intr(hw, 0);
-- 
1.7.10.4

             reply	other threads:[~2013-07-27 20:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 20:35 Samuel Williams [this message]
2013-07-30 23:19 ` [PATCH] sky2: detect and prevent kernel panic from a possible faulty hardware David Miller
2013-07-30 23:32   ` Stephen Hemminger
2013-07-31  8:18   ` Oliver Neukum

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=1374957354-10142-1-git-send-email-sam8641@gmail.com \
    --to=sam8641@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlindner@marvell.com \
    --cc=netdev@vger.kernel.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 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).