Skip to content

Commit

Permalink
[PATCH] skge: stop bogus sensor messages
Browse files Browse the repository at this point in the history
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@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@pobox.com>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Aug 16, 2005
1 parent ab707da commit 050ec18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 10 additions & 14 deletions drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -2670,18 +2670,6 @@ static void skge_error_irq(struct skge_hw *hw)
/* 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) {
Expand Down Expand Up @@ -2712,9 +2700,10 @@ static void skge_error_irq(struct skge_hw *hw)

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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions drivers/net/skge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down

0 comments on commit 050ec18

Please sign in to comment.