From patchwork Wed Jul 1 23:28:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 29378 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 539CEB70F6 for ; Thu, 2 Jul 2009 09:29:47 +1000 (EST) Received: by ozlabs.org (Postfix) id 452DADDD1C; Thu, 2 Jul 2009 09:29:47 +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 D403FDDD0C for ; Thu, 2 Jul 2009 09:29:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753334AbZGAX3G (ORCPT ); Wed, 1 Jul 2009 19:29:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752982AbZGAX3F (ORCPT ); Wed, 1 Jul 2009 19:29:05 -0400 Received: from qmta05.emeryville.ca.mail.comcast.net ([76.96.30.48]:54430 "EHLO QMTA05.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbZGAX3D (ORCPT ); Wed, 1 Jul 2009 19:29:03 -0400 Received: from OMTA15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by QMTA05.emeryville.ca.mail.comcast.net with comcast id AmKS1c0041Y3wxoA5nV8LE; Wed, 01 Jul 2009 23:29:08 +0000 Received: from localhost.localdomain ([63.64.152.142]) by OMTA15.emeryville.ca.mail.comcast.net with comcast id AnUr1c00834bfcX8bnUt7b; Wed, 01 Jul 2009 23:29:06 +0000 From: Jeff Kirsher Subject: [net-2.6 PATCH 5/6] e1000e: delay second read of PHY_STATUS register on failure of first read To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, Bruce Allan , Jeff Kirsher Date: Wed, 01 Jul 2009 16:28:50 -0700 Message-ID: <20090701232850.20555.69711.stgit@localhost.localdomain> In-Reply-To: <20090701232731.20555.63487.stgit@localhost.localdomain> References: <20090701232731.20555.63487.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bruce Allan Some PHYs may require two reads of the PHY_STATUS register to determine the link status. If the PHY is being accessed by another thread it is possible the first read could timeout and fail. In this case, put a delay in so the second read will pick up the correct link status. Signed-off-by: Bruce Allan Signed-off-by: Jeff Kirsher --- drivers/net/e1000e/phy.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index d845394..994401f 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c @@ -1531,7 +1531,12 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, */ ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); if (ret_val) - break; + /* + * If the first read fails, another entity may have + * ownership of the resources, wait and try again to + * see if they have relinquished the resources yet. + */ + udelay(usec_interval); ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); if (ret_val) break;