From patchwork Thu Sep 10 02:01:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 33266 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 38686B7D4C for ; Thu, 10 Sep 2009 12:01:50 +1000 (EST) Received: by ozlabs.org (Postfix) id 2213BDDD0B; Thu, 10 Sep 2009 12:01:50 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id BFA77DDD01 for ; Thu, 10 Sep 2009 12:01:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754925AbZIJCBn (ORCPT ); Wed, 9 Sep 2009 22:01:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754917AbZIJCBn (ORCPT ); Wed, 9 Sep 2009 22:01:43 -0400 Received: from ru.mvista.com ([213.79.90.228]:26237 "EHLO buildserver.ru.mvista.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754872AbZIJCBm (ORCPT ); Wed, 9 Sep 2009 22:01:42 -0400 Received: from localhost (unknown [10.150.0.9]) by buildserver.ru.mvista.com (Postfix) with ESMTP id 6A7558824; Thu, 10 Sep 2009 07:01:45 +0500 (SAMST) Date: Thu, 10 Sep 2009 06:01:45 +0400 From: Anton Vorontsov To: David Miller Cc: Andy Fleming , Timur Tabi , Li Yang , Kumar Gala , netdev@vger.kernel.org, linuxppc-dev@ozlabs.org Subject: [PATCH 3/3] ucc_geth: Fix hangs after switching from full to half duplex Message-ID: <20090910020145.GC31083@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org MPC8360 QE UCC ethernet controllers hang when changing link duplex under a load (a bit of NFS activity is enough). PHY: mdio@e0102120:00 - Link is Up - 1000/Full sh-3.00# ethtool -s eth0 speed 100 duplex half autoneg off PHY: mdio@e0102120:00 - Link is Down PHY: mdio@e0102120:00 - Link is Up - 100/Half NETDEV WATCHDOG: eth0 (ucc_geth): transmit queue 0 timed out ------------[ cut here ]------------ Badness at c01fcbd0 [verbose debug info unavailable] NIP: c01fcbd0 LR: c01fcbd0 CTR: c0194e44 ... The cure is to disable the controller before changing speed/duplex and enable it afterwards. Signed-off-by: Anton Vorontsov --- drivers/net/ucc_geth.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 2a2c973..9ad9015 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -1631,9 +1631,13 @@ static void adjust_link(struct net_device *dev) ugeth->oldspeed = phydev->speed; } + ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); + out_be32(&ug_regs->maccfg2, tempval); out_be32(&uf_regs->upsmr, upsmr); + ugeth_enable(ugeth, COMM_DIR_RX_AND_TX); + if (!ugeth->oldlink) { new_state = 1; ugeth->oldlink = 1;