From patchwork Wed Dec 3 07:36:36 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ohashi-h@mb.dnes.nec.co.jp X-Patchwork-Id: 11904 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org 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 09646DDDEC for ; Wed, 3 Dec 2008 18:37:03 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753552AbYLCHgt (ORCPT ); Wed, 3 Dec 2008 02:36:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753479AbYLCHgt (ORCPT ); Wed, 3 Dec 2008 02:36:49 -0500 Received: from TYO202.gate.nec.co.jp ([202.32.8.206]:39216 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753410AbYLCHgs (ORCPT ); Wed, 3 Dec 2008 02:36:48 -0500 Received: from mailgate3.nec.co.jp ([10.7.69.162]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id mB37ad4V028938; Wed, 3 Dec 2008 16:36:39 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id mB37adJ03765; Wed, 3 Dec 2008 16:36:39 +0900 (JST) Received: from kaishu.jp.nec.com (kaishu.jp.nec.com [10.26.220.5]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id mB37aclE016415; Wed, 3 Dec 2008 16:36:38 +0900 (JST) Received: from DNES-SD-OHASHI2 ([10.68.76.127] [10.68.76.127]) by mail.jp.nec.com with ESMTP; Wed, 3 Dec 2008 16:36:36 +0900 To: jeffrey.t.kirsher@intel.com, jesse.brandeburg@intel.com, bruce.w.allan@intel.com, peter.p.waskiewicz.jr@intel.com, john.ronciak@intel.com, jgarzik@pobox.com Cc: netdev@vger.kernel.org, e1000-devel@lists.sourceforge.net Subject: e1000: LED indicates trouble, and [PATCH] enable/disable of force-link-up Message-Id: <20081203163636ohashi-h@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: StarOffice21/MailClient[4.65 Step9] From: ohashi-h@mb.dnes.nec.co.jp Date: Wed, 3 Dec 2008 16:36:36 +0900 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Hiroki Ohashi Hi all, I faced the following situations. The LED of NIC was indicated, even when the system was not linked the network (auto-negotiation failed or link partner cannot auto-negotiate). LED should be indicate only when the network was linked. And so, it is a problem that LED indicates. I think the indicating the LED is a problem for maintenance. I cannot know the condition of the link, because I confirm to link up by LED's indication. We are using 82571EB ethernet controler and serdes interface. I think this problem is caused by the e1000 device driver setting LU and SLU bits in the interface and forcing the link to go up. I deleted this logic. (the following modification.) Then, LED was turned off. ================================ --- 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 ================================ --- e1000_hw.c.org +++ e1000_hw.c @@ -3069,6 +3069,7 @@I hw->autoneg_failed = 1; return 0; } +#if 0 DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n"); /* Disable auto-negotiation in the TXCW register */ @@ -3078,6 +3079,7 @@ ctrl = E1000_READ_REG(hw, CTRL); ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD); E1000_WRITE_REG(hw, CTRL, ctrl); +#endif /* Configure Flow Control after forcing link up. */ ret_val = e1000_config_fc_after_link_up(hw); ================================ I think the e1000 driver should enable/disable force-link-up depending on the condition of the link. But I don't know a good way to do this. If you have any good ideas, please let me know. As a temporary idea, I thought of a way of adding a module parameter to control enable/disable force-link-up. The patch is as follows. This patch adds "disable_force_link_up_when_autoneg_failed" as module parameter. When this is 0, force-link-up is disable. From: Hiroshi Shimamoto Signed-off-by: Hiroshi Shimamoto ================================ --- drivers/net/e1000/e1000_hw.h.org +++ drivers/net/e1000/e1000_hw.h @@ -1469,6 +1469,7 @@ struct e1000_hw { bool has_manc2h; bool rx_needs_kicking; bool has_smbus; + bool disable_force_link_up_when_autoneg_failed; }; --- drivers/net/e1000/e1000_param.c.org +++ drivers/net/e1000/e1000_param.c @@ -196,6 +196,13 @@ E1000_PARAM(SmartPowerDownEnable, "Enabl */ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); +/* Enable Force Link Up When AutoNeg Failed + * + * Valid Range: 0, 1 + * + * Default Value: 1 (force link up enabled) */ +E1000_PARAM(EnableForceLinkOnSERDES, "Enable force link up when AutoNeg failed"); + struct e1000_option { enum { enable_option, range_option, list_option } type; const char *name; @@ -534,6 +541,23 @@ void __devinit e1000_check_options(struc adapter->hw.kmrn_lock_loss_workaround_disabled = !opt.def; } } + { /* Enable Force Link Up When AutoNeg Failed */ + struct e1000_option opt = { + .type = enable_option, + .name = "Enable Force Link Up When AutoNeg Failed", + .err = "defaulting to Enabled", + .def = OPTION_ENABLED + }; + + if (num_EnableForceLinkOnSERDES > bd) { + unsigned int force_link_up = EnableForceLinkOnSERDES [bd]; + e1000_validate_option(&force_link_up, &opt, adapter); + adapter->hw.disable_force_link_up_when_autoneg_failed = !force_link_up; + + } else { + adapter->hw.disable_force_link_up_when_autoneg_failed = !opt.def; + } + } switch (adapter->hw.media_type) { case e1000_media_type_fiber: --- drivers/net/e1000/e1000_hw.c.org +++ drivers/net/e1000/e1000_hw.c @@ -3062,6 +3062,12 @@ s32 e1000_check_for_link(struct e1000_hw hw->autoneg_failed = 1; return 0; } + + if (hw->disable_force_link_up_when_autoneg_failed) { + DEBUGOUT("Force Link Up Disabled\n"); + return -E1000_ERR_PHY; + } + DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n"); /* Disable auto-negotiation in the TXCW register */