LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* sky2 still broken in 2.6.20.3
@ 2007-03-21 20:26 Chuck Ebbert
2007-03-21 21:40 ` Stephen Hemminger
2007-04-06 16:43 ` Stephen Hemminger
0 siblings, 2 replies; 5+ messages in thread
From: Chuck Ebbert @ 2007-03-21 20:26 UTC (permalink / raw)
To: Stephen Hemminger, linux-kernel
Transmit timeouts and locked-up adapters still occur in kernel
2.6.20.3. It looks like the patch that was applied to 2.6.20.2
is not enough. Unfortunately that one isn't the same as what
went upstream. Looks like it needs to be reverted, then the two
upstream patches applied?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sky2 still broken in 2.6.20.3
2007-03-21 20:26 sky2 still broken in 2.6.20.3 Chuck Ebbert
@ 2007-03-21 21:40 ` Stephen Hemminger
2007-03-21 22:01 ` Chuck Ebbert
2007-04-06 16:43 ` Stephen Hemminger
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2007-03-21 21:40 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: linux-kernel
On Wed, 21 Mar 2007 16:26:53 -0400
Chuck Ebbert <cebbert@redhat.com> wrote:
> Transmit timeouts and locked-up adapters still occur in kernel
> 2.6.20.3.
There is more changes in 2.6.21-rc4 please try that.
I am still getting reports of timeouts with that code but
it does recover better. It may be the case that with hardware
flow control transmits can take an indefinite period so increasing
the timeout value could help.
> It looks like the patch that was applied to 2.6.20.2
> is not enough. Unfortunately that one isn't the same as what
> went upstream. Looks like it needs to be reverted, then the two
> upstream patches applied?
Until, unless the problem is reproducible with my hardware
there is not much that can be done. I'll add the better recovery
logic to for next stable cycle, but still not clear what causes
all the timeouts.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sky2 still broken in 2.6.20.3
2007-03-21 21:40 ` Stephen Hemminger
@ 2007-03-21 22:01 ` Chuck Ebbert
2007-03-22 19:18 ` Stephen Hemminger
0 siblings, 1 reply; 5+ messages in thread
From: Chuck Ebbert @ 2007-03-21 22:01 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: linux-kernel
Stephen Hemminger wrote:
> On Wed, 21 Mar 2007 16:26:53 -0400
> Chuck Ebbert <cebbert@redhat.com> wrote:
>
>> Transmit timeouts and locked-up adapters still occur in kernel
>> 2.6.20.3.
>
> There is more changes in 2.6.21-rc4 please try that.
Yes, but I have to figure out how to get those to apply to
2.6.20.3. I was hoping you'd do that. :)
> I am still getting reports of timeouts with that code but
> it does recover better. It may be the case that with hardware
> flow control transmits can take an indefinite period so increasing
> the timeout value could help.
>
>> It looks like the patch that was applied to 2.6.20.2
>> is not enough. Unfortunately that one isn't the same as what
>> went upstream. Looks like it needs to be reverted, then the two
>> upstream patches applied?
>
> Until, unless the problem is reproducible with my hardware
> there is not much that can be done. I'll add the better recovery
> logic to for next stable cycle, but still not clear what causes
> all the timeouts.
I have a bug report and tester:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227420
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sky2 still broken in 2.6.20.3
2007-03-21 22:01 ` Chuck Ebbert
@ 2007-03-22 19:18 ` Stephen Hemminger
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-03-22 19:18 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: linux-kernel
The following is a backport of the 2.6.21 logic to do more complete
recovery in case of transmit timeout. I added a little more diagnostic
output as well.
Since I can't reproduce a real timeout (my switches seem to work correctly).
Someone else needs to test this.
--- linux-2.6.20.y.orig/drivers/net/sky2.c 2007-03-21 15:10:56.000000000 -0700
+++ linux-2.6.20.y/drivers/net/sky2.c 2007-03-22 11:23:19.000000000 -0700
@@ -1802,38 +1802,22 @@
{
struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;
- unsigned txq = txqaddr[sky2->port];
- u16 report, done;
+ unsigned port = sky2->port;
if (netif_msg_timer(sky2))
printk(KERN_ERR PFX "%s: tx timeout\n", dev->name);
- report = sky2_read16(hw, sky2->port == 0 ? STAT_TXA1_RIDX : STAT_TXA2_RIDX);
- done = sky2_read16(hw, Q_ADDR(txq, Q_DONE));
-
- printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n",
- dev->name,
- sky2->tx_cons, sky2->tx_prod, report, done);
-
- if (report != done) {
- printk(KERN_INFO PFX "status burst pending (irq moderation?)\n");
+ /* Get information for bug report :-) */
+ printk(KERN_INFO PFX "%s: transmit ring %u .. %u report=%u done=%u\n",
+ dev->name, sky2->tx_cons, sky2->tx_prod,
+ sky2_read16(hw, port == 0 ? STAT_TXA1_RIDX : STAT_TXA2_RIDX),
+ sky2_read16(hw, Q_ADDR(txqaddr[sky2->port], Q_DONE)));
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
- } else if (report != sky2->tx_cons) {
- printk(KERN_INFO PFX "status report lost?\n");
- sky2_tx_complete(sky2, report);
- } else {
- printk(KERN_INFO PFX "hardware hung? flushing\n");
+ printk(KERN_INFO PFX "gmac control %#x status %#x\n",
+ gma_read16(hw, port, GM_GP_CTRL), gma_read16(hw, port, GM_GP_STAT));
- sky2_write32(hw, Q_ADDR(txq, Q_CSR), BMU_STOP);
- sky2_write32(hw, Y2_QADDR(txq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
-
- sky2_tx_complete(sky2, sky2->tx_prod);
-
- sky2_qset(hw, txq);
- sky2_prefetch_init(hw, txq, sky2->tx_le_map, TX_RING_SIZE - 1);
- }
+ /* can't restart safely under softirq */
+ schedule_work(&hw->restart_work);
}
static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -2565,6 +2549,49 @@
return 0;
}
+static void sky2_restart(struct work_struct *work)
+{
+ struct sky2_hw *hw = container_of(work, struct sky2_hw, restart_work);
+ struct net_device *dev;
+ int i, err;
+
+ dev_dbg(&hw->pdev->dev, "restarting\n");
+
+ del_timer_sync(&hw->idle_timer);
+
+ rtnl_lock();
+ sky2_write32(hw, B0_IMSK, 0);
+ sky2_read32(hw, B0_IMSK);
+
+ netif_poll_disable(hw->dev[0]);
+
+ for (i = 0; i < hw->ports; i++) {
+ dev = hw->dev[i];
+ if (netif_running(dev))
+ sky2_down(dev);
+ }
+
+ sky2_reset(hw);
+ sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
+ netif_poll_enable(hw->dev[0]);
+
+ for (i = 0; i < hw->ports; i++) {
+ dev = hw->dev[i];
+ if (netif_running(dev)) {
+ err = sky2_up(dev);
+ if (err) {
+ printk(KERN_INFO PFX "%s: could not restart %d\n",
+ dev->name, err);
+ dev_close(dev);
+ }
+ }
+ }
+
+ sky2_idle_start(hw);
+
+ rtnl_unlock();
+}
+
static u32 sky2_supported_modes(const struct sky2_hw *hw)
{
if (sky2_is_copper(hw)) {
@@ -3508,6 +3535,8 @@
}
setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
+ INIT_WORK(&hw->restart_work, sky2_restart);
+
sky2_idle_start(hw);
pci_set_drvdata(pdev, hw);
--- linux-2.6.20.y.orig/drivers/net/sky2.h 2007-03-21 15:16:54.000000000 -0700
+++ linux-2.6.20.y/drivers/net/sky2.h 2007-03-21 15:17:19.000000000 -0700
@@ -1898,6 +1898,7 @@
dma_addr_t st_dma;
struct timer_list idle_timer;
+ struct work_struct restart_work;
int msi;
wait_queue_head_t msi_wait;
};
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sky2 still broken in 2.6.20.3
2007-03-21 20:26 sky2 still broken in 2.6.20.3 Chuck Ebbert
2007-03-21 21:40 ` Stephen Hemminger
@ 2007-04-06 16:43 ` Stephen Hemminger
1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2007-04-06 16:43 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: linux-kernel
On Wed, 21 Mar 2007 16:26:53 -0400
Chuck Ebbert <cebbert@redhat.com> wrote:
> Transmit timeouts and locked-up adapters still occur in kernel
> 2.6.20.3. It looks like the patch that was applied to 2.6.20.2
> is not enough. Unfortunately that one isn't the same as what
> went upstream. Looks like it needs to be reverted, then the two
> upstream patches applied?
Which chipset do you have? I am currently working on problems with
the 88e8056.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-04-06 16:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-21 20:26 sky2 still broken in 2.6.20.3 Chuck Ebbert
2007-03-21 21:40 ` Stephen Hemminger
2007-03-21 22:01 ` Chuck Ebbert
2007-03-22 19:18 ` Stephen Hemminger
2007-04-06 16:43 ` Stephen Hemminger
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).