[Bug 36986] [Breezy] skge bogus sensor

C. Cartier cleff at lognet.com.br
Tue Mar 28 11:37:07 UTC 2006


Public bug reported:
https://launchpad.net/malone/bugs/36986

Affects: linux-source-2.6.12 (Ubuntu)
       Severity: Normal
       Priority: (none set)
         Status: Unconfirmed

Description:
skge: stop bogus sensor messages

Some versions of the Marvell yukon generate bogus sensor warning
interrupts. The driver would flood log with these messages. Handle this
situation cleanly by masking away at boot time.

The problem comes from all kernels above 2.6.10.*

To be moke precise, it comes from ubuntu skge.ko module bundled with those kernels.This module are supposed to handle Marvell based NICs, included the 3Com Gigabit LOM (3C940), embedded in ASUS P4P800 Motherboard.
  
Fixes: http://bugs.gentoo.org/show_bug.cgi?id=87182
  
Signed-off-by: Stephen Hemminger <shemminger at osdl.org>

Heres the working solution:

1- Prepare to recompile the kernel in ubuntu official way (see
https://wiki.ubuntu.com/KernelBuildpackageDetailedHowto)

2- Setup config file under this section:

#
# Ethernet (1000 Mbit)
#
...
CONFIG_SKGE=y
# CONFIG_SKY2_EC_A1 is not set
CONFIG_SK98LIN=y
# CONFIG_SK98LIN_NAPI is not set
... 

3- include the DIFF file below with DPatch:

-------- START of Diff File --------
From: Stephen Hemminger <shemminger at osdl.org>
Date: Tue, 16 Aug 2005 21:00:54 +0000 (-0700)
Subject: [PATCH] skge: stop bogus sensor messages
X-Git-Tag: v2.6.12-rc2
X-Git-Url: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/jgarzik/netdev-2.6.git;a=commitdiff;h=050ec18a35f3106437da8e9c55e441c076c7b93e

  [PATCH] skge: stop bogus sensor messages
  
  Some versions of the Marvell yukon generate bogus sensor warning interrupts.
  The driver would flood log with these messages.  Handle this situation
  cleanly by masking away at boot time.
  
  Fixes: http://bugs.gentoo.org/show_bug.cgi?id=87182
  
  Signed-off-by: Stephen Hemminger <shemminger at osdl.org>
  
   drivers/net/skge.c |   24 ++++++++++--------------
   drivers/net/skge.h |    8 ++++++--
   2 files changed, 16 insertions(+), 16 deletions(-)
  Signed-off-by: Jeff Garzik <jgarzik at pobox.com>
---

--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2670,18 +2670,6 @@ static void skge_error_irq(struct skge_h
 		/* Timestamp (unused) overflow */
 		if (hwstatus & IS_IRQ_TIST_OV)
 			skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ);
-
-		if (hwstatus & IS_IRQ_SENSOR) {
-			/* no sensors on 32-bit Yukon */
-			if (!(skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ)) {
-				printk(KERN_ERR PFX "ignoring bogus sensor interrups\n");
-				skge_write32(hw, B0_HWE_IMSK,
-					     IS_ERR_MSK & ~IS_IRQ_SENSOR);
-			} else
-				printk(KERN_WARNING PFX "sensor interrupt\n");
-		}
-
-
 	}
 
 	if (hwstatus & IS_RAM_RD_PAR) {
@@ -2712,9 +2700,10 @@ static void skge_error_irq(struct skge_h
 
 		skge_pci_clear(hw);
 
+		/* if error still set then just ignore it */
 		hwstatus = skge_read32(hw, B0_HWE_ISRC);
 		if (hwstatus & IS_IRQ_STAT) {
-			printk(KERN_WARNING PFX "IRQ status %x: still set ignoring hardware errors\n",
+			pr_debug("IRQ status %x: still set ignoring hardware errors\n",
 			       hwstatus);
 			hw->intr_mask &= ~IS_HW_ERR;
 		}
@@ -2948,12 +2937,20 @@ static int skge_reset(struct skge_hw *hw
 	else
 		hw->ram_size = t8 * 4096;
 
+	hw->intr_mask = IS_HW_ERR | IS_EXT_REG;
 	if (hw->chip_id == CHIP_ID_GENESIS)
 		genesis_init(hw);
 	else {
 		/* switch power to VCC (WA for VAUX problem) */
 		skge_write8(hw, B0_POWER_CTRL,
 			    PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON);
+		/* avoid boards with stuck Hardware error bits */
+		if ((skge_read32(hw, B0_ISRC) & IS_HW_ERR) &&
+		    (skge_read32(hw, B0_HWE_ISRC) & IS_IRQ_SENSOR)) {
+			printk(KERN_WARNING PFX "stuck hardware sensor bit\n");
+			hw->intr_mask &= ~IS_HW_ERR;
+		}
+
 		for (i = 0; i < hw->ports; i++) {
 			skge_write16(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
 			skge_write16(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR);
@@ -2994,7 +2991,6 @@ static int skge_reset(struct skge_hw *hw
 	skge_write32(hw, B2_IRQM_INI, skge_usecs2clk(hw, 100));
 	skge_write32(hw, B2_IRQM_CTRL, TIM_START);
 
-	hw->intr_mask = IS_HW_ERR | IS_EXT_REG;
 	skge_write32(hw, B0_IMSK, hw->intr_mask);
 
 	if (hw->chip_id != CHIP_ID_GENESIS)
--- a/drivers/net/skge.h
+++ b/drivers/net/skge.h
@@ -214,8 +214,6 @@ enum {
 
 /*	B2_IRQM_HWE_MSK	32 bit	IRQ Moderation HW Error Mask */
 enum {
-	IS_ERR_MSK	= 0x00003fff,/* 		All Error bits */
-
 	IS_IRQ_TIST_OV	= 1<<13, /* Time Stamp Timer Overflow (YUKON only) */
 	IS_IRQ_SENSOR	= 1<<12, /* IRQ from Sensor (YUKON only) */
 	IS_IRQ_MST_ERR	= 1<<11, /* IRQ master error detected */
@@ -230,6 +228,12 @@ enum {
 	IS_M2_PAR_ERR	= 1<<2,	/* MAC 2 Parity Error */
 	IS_R1_PAR_ERR	= 1<<1,	/* Queue R1 Parity Error */
 	IS_R2_PAR_ERR	= 1<<0,	/* Queue R2 Parity Error */
+
+	IS_ERR_MSK	= IS_IRQ_MST_ERR | IS_IRQ_STAT
+			| IS_NO_STAT_M1 | IS_NO_STAT_M2
+			| IS_RAM_RD_PAR | IS_RAM_WR_PAR
+			| IS_M1_PAR_ERR | IS_M2_PAR_ERR
+			| IS_R1_PAR_ERR | IS_R2_PAR_ERR,
 };
 
 /*	B2_TST_CTRL1	 8 bit	Test Control Register 1 */
-------- END of Diff File --------

4- Recompile the kernel in any Arch you wish... it will work!

Please: include this patch in official distro. Or at least fix the next
Dapper kernel to handle it!




More information about the kernel-bugs mailing list