[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#841044: Problem with gem network card



Hey, Christian.

Can you build a patched kernel or a patched driver? If you need help, I
can provide some instructions later this week, after I do it myself on a
G4 I am about to put my hands on.

If you already know how to do it, the patch below does two things: it
will do a chip reset instead of only a MAC reset when there is an
overflow. I hope this will fix things for you, but I would like to do
more tests so we can find out why the MAC reset is not working so I can
convince upstream to accept such an approach (which would require a
different patch).

The second thing it does is accept an ioctl to do the MAC and chip
reset, likely during normal operation. This will require a small
userspace program I will send later, so we can test whether the MAC and
chip reset work under light load on the card. The test would go this
way: setup the interface up, issue one of the resets, then try to use
the network. If it works fine, great, the reset didn't break anything,
and we need to investigate the specific occasion when there is an
overflow. If things stop working, then the reset itself is causing the
problem.

Thanks.
Cascardo.
---
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index d6ad0fb..e140363 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -473,6 +473,10 @@ static int gem_rxmac_interrupt(struct net_device *dev, struct gem *gp, u32 gem_s
 		dev->stats.rx_fifo_errors++;
 
 		ret = gem_rxmac_reset(gp);
+		if (ret == 0) {
+			netdev_err(dev, "RXMAC reset succeeded, will reset everything anyway.\n");
+			ret = 1;
+		}
 	}
 
 	if (rxmac_stat & MAC_RXSTAT_ACE)
@@ -2705,6 +2709,13 @@ static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 			    data->val_in);
 		rc = 0;
 		break;
+	case SIOCDEVPRIVATE:
+		rc = gem_rxmac_reset(gp);
+		break;
+	case SIOCDEVPRIVATE + 1:
+		gem_schedule_reset(gp);
+		rc = 0;
+		break;
 	}
 	return rc;
 }


Reply to: