* Re: Another holiday, another set of tg3 releases.
@ 2003-01-12 0:14 Jean-Daniel Pauget
2003-01-12 0:57 ` [PATCH] " Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Daniel Pauget @ 2003-01-12 0:14 UTC (permalink / raw)
To: Jeff Garzik; +Cc: lkml
on 2002-12-30, Jeff Garzik <jgarzik@pobox.com> wrote :
> Another holiday, another set of tg3 releases.
in my seek for unexpected freeze of my box (not yet figured which
hardware is involved exactly) I updated to tg3-1.2a and applied
both tg3-1.2a-00_irqsave and tg3-1.2a-01_mask_rewrite.
as a result, after working a few seconds the network card freezes, and
no ifupdown would permit any recovery.
on the other hand, with only the first patch tg3-1.2a-00_irqsave, things
seems ok and I'm waiting for my machine to freeze... ...or not. (the freeze
frequency is ~10hours )...
though, on your page you mention a fifth patch concerning mtu, as I'm
running with an unusual mtu of 1452 because of internet over internet
encapsulation on my DSL, maybe I'm concerned ?
here-below my /proc/pci
--
Quand les plombs pêtent : « Ðïsjüñ£t.¢€× »
--
PCI devices found:
Bus 0, device 0, function 0:
Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev 2).
Prefetchable 32 bit memory at 0xf0000000 [0xf7ffffff].
Bus 0, device 1, function 0:
PCI bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset AGP Bridge (rev 2).
Master Capable. Latency=64. Min Gnt=8.
Bus 0, device 29, function 0:
USB Controller: Intel Corp. 82801DB USB (Hub #1) (rev 2).
IRQ 11.
I/O at 0xd800 [0xd81f].
Bus 0, device 29, function 1:
USB Controller: Intel Corp. 82801DB USB (Hub #2) (rev 2).
IRQ 5.
I/O at 0xd400 [0xd41f].
Bus 0, device 29, function 2:
USB Controller: Intel Corp. 82801DB USB (Hub #3) (rev 2).
IRQ 9.
I/O at 0xd000 [0xd01f].
Bus 0, device 29, function 7:
USB Controller: Intel Corp. 82801DB USB EHCI Controller (rev 2).
Non-prefetchable 32 bit memory at 0xe5800000 [0xe58003ff].
Bus 0, device 30, function 0:
PCI bridge: Intel Corp. 82801BA/CA/DB PCI Bridge (rev 130).
Master Capable. No bursts. Min Gnt=6.
Bus 0, device 31, function 0:
ISA bridge: Intel Corp. 82801DB ISA Bridge (LPC) (rev 2).
Bus 0, device 31, function 1:
IDE interface: Intel Corp. 82801DB ICH4 IDE (rev 2).
IRQ 9.
I/O at 0x0 [0x7].
I/O at 0x0 [0x3].
I/O at 0x0 [0x7].
I/O at 0x0 [0x3].
I/O at 0xf000 [0xf00f].
Non-prefetchable 32 bit memory at 0x10000000 [0x100003ff].
Bus 0, device 31, function 5:
Multimedia audio controller: Intel Corp. 82801DB AC'97 Audio (rev 2).
I/O at 0xa800 [0xa8ff].
I/O at 0xa400 [0xa43f].
Non-prefetchable 32 bit memory at 0xe4000000 [0xe40001ff].
Non-prefetchable 32 bit memory at 0xe3800000 [0xe38000ff].
Bus 1, device 0, function 0:
VGA compatible controller: nVidia Corporation NV25 [GeForce4 Ti4200] (rev 163).
IRQ 11.
Master Capable. Latency=248. Min Gnt=5.Max Lat=1.
Non-prefetchable 32 bit memory at 0xe6000000 [0xe6ffffff].
Prefetchable 32 bit memory at 0xe8000000 [0xefffffff].
Prefetchable 32 bit memory at 0xe7800000 [0xe787ffff].
Bus 2, device 3, function 0:
FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 128).
IRQ 5.
Master Capable. Latency=32. Max Lat=32.
Non-prefetchable 32 bit memory at 0xe5000000 [0xe50007ff].
I/O at 0xb800 [0xb87f].
Bus 2, device 5, function 0:
Ethernet controller: Broadcom Corporation NetXtreme BCM5702X Gigabit Ethernet (rev 2).
IRQ 10.
Master Capable. Latency=64. Min Gnt=64.
Non-prefetchable 64 bit memory at 0xe4800000 [0xe480ffff].
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] Re: Another holiday, another set of tg3 releases.
2003-01-12 0:14 Another holiday, another set of tg3 releases Jean-Daniel Pauget
@ 2003-01-12 0:57 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2003-01-12 0:57 UTC (permalink / raw)
To: Jean-Daniel Pauget; +Cc: lkml, netdev, davem
[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]
On Sun, Jan 12, 2003 at 01:14:03AM +0100, Jean-Daniel Pauget wrote:
>
> on 2002-12-30, Jeff Garzik <jgarzik@pobox.com> wrote :
>
> > Another holiday, another set of tg3 releases.
>
> in my seek for unexpected freeze of my box (not yet figured which
> hardware is involved exactly) I updated to tg3-1.2a and applied
> both tg3-1.2a-00_irqsave and tg3-1.2a-01_mask_rewrite.
> as a result, after working a few seconds the network card freezes, and
> no ifupdown would permit any recovery.
>
> on the other hand, with only the first patch tg3-1.2a-00_irqsave, things
> seems ok and I'm waiting for my machine to freeze... ...or not. (the freeze
> frequency is ~10hours )...
Thanks, please do keep us posted.
I have attached two patches, with accompanying descriptions, that I have
been testing locally on UP and SMP. They are a bit more conservative
than tg3-1.2a-01_mask_rewrite while still addressing the same issue.
Right now my plan for tg3 version 1.3 (next release) is:
tg3-1.2a-00_irqsave
tg3-irq-mask-2.patch (attached), and
tg3-irq-flush.patch (attached)
and maybe the MTU stuff [more on that below]
The first patch, 00_irqsave, is a bit too paranoid for DaveM's liking,
so even though I will to apply 00_irqsave, that area will get further
attention once existing bug reports are resolved.
[Note to DaveM -- tg3_timer is not a fast path, so extra paranoia there
won't hurt]
> though, on your page you mention a fifth patch concerning mtu, as I'm
> running with an unusual mtu of 1452 because of internet over internet
> encapsulation on my DSL, maybe I'm concerned ?
MTU of 1452 should not be a problem. The issue is more of correcting
handling of change-MTU condition that rarely happens.
Jeff
[-- Attachment #2: tg3-irq-mask-2.patch --]
[-- Type: text/plain, Size: 3615 bytes --]
# --------------------------------------------
# 03/01/05 jgarzik@redhat.com 1.926.1.2
# [netdrvr tg3] Better interrupt masking
#
# The bcm570x chips provide a register that disables (masks) or enables
# interrupts, and as a side effect, each write to this register regardless
# of value clears various PCI and internal interrupt-pending flags. This
# register, intr-mbox-0, provides a superset of the function provided
# by the mask-pci-int and clear-pci-int bits in the misc-host-ctrl register.
#
# Furthermore, the documentation clearly implies use of this register,
# as an indicator that the host [tg3 driver] is in its interrupt handler.
#
# The new tg3 logic, taking this knowledge into account, masks-and-clears
# irqs using intr-mbox-0 [only] when a hard irq is received, and
# unmasks-and-clears irqs at the end of tg3_poll after all NAPI events
# have been exhausted.
#
# The old logic twiddled the misc-host-ctrl irq masking bits separately
# from intr-mbox-0 bits, which was not only inconsistent but also
# a few additional I/Os that were not needed.
# --------------------------------------------
#
diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c Sat Jan 11 19:42:56 2003
+++ b/drivers/net/tg3.c Sat Jan 11 19:42:56 2003
@@ -217,22 +217,6 @@
tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
}
-static inline void tg3_mask_ints(struct tg3 *tp)
-{
- tw32(TG3PCI_MISC_HOST_CTRL,
- (tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT));
-}
-
-static inline void tg3_unmask_ints(struct tg3 *tp)
-{
- tw32(TG3PCI_MISC_HOST_CTRL,
- (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT));
- if (tp->hw_status->status & SD_STATUS_UPDATED) {
- tw32(GRC_LOCAL_CTRL,
- tp->grc_local_ctrl | GRC_LCLCTRL_SETINT);
- }
-}
-
static void tg3_switch_clocks(struct tg3 *tp)
{
if (tr32(TG3PCI_CLOCK_CTRL) & CLOCK_CTRL_44MHZ_CORE) {
@@ -2052,7 +2036,7 @@
if (done) {
netif_rx_complete(netdev);
- tg3_unmask_ints(tp);
+ tg3_enable_ints(tp);
}
spin_unlock_irq(&tp->lock);
@@ -2060,10 +2044,10 @@
return (done ? 0 : 1);
}
-static __inline__ void tg3_interrupt_main_work(struct net_device *dev, struct tg3 *tp)
+static inline unsigned int tg3_has_work(struct net_device *dev, struct tg3 *tp)
{
struct tg3_hw_status *sblk = tp->hw_status;
- int work_exists = 0;
+ unsigned int work_exists = 0;
if (!(tp->tg3_flags &
(TG3_FLAG_USE_LINKCHG_REG |
@@ -2075,19 +2059,7 @@
sblk->idx[0].rx_producer != tp->rx_rcb_ptr)
work_exists = 1;
- if (!work_exists)
- return;
-
- if (netif_rx_schedule_prep(dev)) {
- /* NOTE: These writes are posted by the readback of
- * the mailbox register done by our caller.
- */
- tg3_mask_ints(tp);
- __netif_rx_schedule(dev);
- } else {
- printk(KERN_ERR PFX "%s: Error, poll already scheduled\n",
- dev->name);
- }
+ return work_exists;
}
static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -2102,13 +2074,16 @@
if (sblk->status & SD_STATUS_UPDATED) {
tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
0x00000001);
+ tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
sblk->status &= ~SD_STATUS_UPDATED;
- tg3_interrupt_main_work(dev, tp);
-
- tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
- 0x00000000);
- tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
+ if (likely(tg3_has_work(dev, tp)))
+ netif_rx_schedule(dev);
+ else {
+ tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
+ 0x00000000);
+ tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
+ }
}
spin_unlock_irqrestore(&tp->lock, flags);
[-- Attachment #3: tg3-irq-flush.patch --]
[-- Type: text/plain, Size: 892 bytes --]
# --------------------------------------------
# 03/01/05 jgarzik@redhat.com 1.926.1.3
# [netdrvr tg3] flush irq-mask reg write before checking hw status block,
# in tg3_enable_ints.
# --------------------------------------------
#
diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c Sat Jan 11 19:43:21 2003
+++ b/drivers/net/tg3.c Sat Jan 11 19:43:21 2003
@@ -209,12 +209,11 @@
tw32(TG3PCI_MISC_HOST_CTRL,
(tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT));
tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000);
+ tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
- if (tp->hw_status->status & SD_STATUS_UPDATED) {
+ if (tp->hw_status->status & SD_STATUS_UPDATED)
tw32(GRC_LOCAL_CTRL,
tp->grc_local_ctrl | GRC_LCLCTRL_SETINT);
- }
- tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW);
}
static void tg3_switch_clocks(struct tg3 *tp)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-12 0:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-12 0:14 Another holiday, another set of tg3 releases Jean-Daniel Pauget
2003-01-12 0:57 ` [PATCH] " Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®