Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759581Ab2BNIZW (ORCPT ); Tue, 14 Feb 2012 03:25:22 -0500 Received: from mailout01.t-online.de ([194.25.134.80]:48851 "EHLO mailout01.t-online.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751763Ab2BNIZT (ORCPT ); Tue, 14 Feb 2012 03:25:19 -0500 Message-ID: <4F3A1A5E.9090803@t-online.de> Date: Tue, 14 Feb 2012 09:25:02 +0100 From: Knut Petersen User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Linus Torvalds CC: shemminger@vyatta.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, dilieto@lineone.net Subject: [REGRESSION, PATCH] sky2 WOL fix Content-Type: multipart/mixed; boundary="------------010001020305050508040602" X-ID: G-bo78ZlwhTNnT9dwj6VNHu3Er3zMXgi8mD+kbj5TxnDclaKwA9-lO2xouebavIwJ4 X-TOI-MSGID: 4dc40c50-0629-4feb-8418-73db9f368069 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3506 Lines: 108 This is a multi-part message in MIME format. --------------010001020305050508040602 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit This patch fixes the regression introduced with 2.6.38 on my system, the patch is safe as the reintroduced code is only executed after the motherboard model is identified by dmi. Probably the dmi_system_id list will grow, a hot candidate is the ASUS P5LD2 motherboard, see Debian bug #647560 Nick: Try the patch with your system added to dmi_system_id need_legacy. Feel free to send the output of dmidecode if you cannot do that yourself. cu, Knut --------------010001020305050508040602 Content-Type: text/x-patch; name="0001-Fix-an-old-sky2-WOL-regression.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-an-old-sky2-WOL-regression.patch" >From f3a7086638b0ee1f9d9e9028a188d96646671088 Mon Sep 17 00:00:00 2001 From: Knut Petersen Date: Tue, 14 Feb 2012 08:35:17 +0100 Subject: [PATCH] Fix an old sky2 WOL regression Wake-On-Lan was broken for a few systems with commit 87b09f1f25cd1e01d7c50bf423c7fe33027d7511 more than a year ago. This commit fixes the regression for the AOpen i915GMm-HFS motherboard. It reintroduces the old code, but that code is only executed for those system included in a dmi_system_id list. Currently there is only one entry in that list, but it probably will grow. Signed-off-by: Knut Petersen --- drivers/net/ethernet/marvell/sky2.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index 760c2b1..02f5b44 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -807,6 +808,18 @@ static void sky2_phy_reinit(struct sky2_port *sky2) spin_unlock_bh(&sky2->phy_lock); } +/* A few systems do need PCI_Y2_PME_LEGACY for WOL, add them here */ +static const struct dmi_system_id need_legacy[] = { + { + .ident = "AOpen i915GMm-HFS", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), + DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), + }, + }, + { NULL } +}; + /* Put device in state to listen for Wake On Lan */ static void sky2_wol_init(struct sky2_port *sky2) { @@ -814,6 +827,7 @@ static void sky2_wol_init(struct sky2_port *sky2) unsigned port = sky2->port; enum flow_control save_mode; u16 ctrl; + u32 reg1; /* Bring hardware out of reset */ sky2_write16(hw, B0_CTST, CS_RST_CLR); @@ -867,6 +881,13 @@ static void sky2_wol_init(struct sky2_port *sky2) /* Disable PiG firmware */ sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF); + /* set legacy pm bit on those systems that need it */ + if (dmi_check_system(need_legacy)) { + reg1 = sky2_pci_read32(hw, PCI_DEV_REG1); + reg1 |= PCI_Y2_PME_LEGACY; + sky2_pci_write32(hw, PCI_DEV_REG1, reg1); + } + /* block receiver */ sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); sky2_read32(hw, B0_CTST); -- 1.7.9 --------------010001020305050508040602-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/