From patchwork Wed Jan 28 20:35: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: 20682 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 1081B474FA for ; Thu, 29 Jan 2009 07:36:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757590AbZA1Ufu (ORCPT ); Wed, 28 Jan 2009 15:35:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756295AbZA1Uft (ORCPT ); Wed, 28 Jan 2009 15:35:49 -0500 Received: from rtsoft3.corbina.net ([85.21.88.6]:29362 "EHLO buildserver.ru.mvista.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754661AbZA1Ufs (ORCPT ); Wed, 28 Jan 2009 15:35:48 -0500 Received: from localhost (unknown [10.150.0.9]) by buildserver.ru.mvista.com (Postfix) with ESMTP id F08CF881F; Thu, 29 Jan 2009 01:35:47 +0400 (SAMT) Date: Wed, 28 Jan 2009 23:35:45 +0300 From: Anton Vorontsov To: Jeff Garzik Cc: David Miller , Andy Fleming , Giuseppe Cavallaro , netdev@vger.kernel.org, linuxppc-dev@ozlabs.org Subject: [PATCH] gianfar: Fix Wake-on-LAN support Message-ID: <20090128203545.GA13928@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org commit 0f0ca340e57bd7446855fefd07a64249acf81223 ("phy: power management support") caused a regression in the gianfar driver. Now phylib turns off PHY power during suspend, and thus WOL doesn't work anymore. This patch workarounds the issue by enabling wakeup in the MDIO device, i.e. just restores the old behaviour for the gianfar driver. Note that this way all PHYs on a given MDIO bus won't be turned off during suspend, which isn't good from the power saving point of view. A proper, per netdevice wakeup management support will need a bit reworked phylib suspend/resume logic. Signed-off-by: Anton Vorontsov --- drivers/net/gianfar_mii.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index f3706e4..f49a426 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c @@ -234,6 +234,8 @@ static int gfar_mdio_probe(struct of_device *ofdev, if (NULL == new_bus) return -ENOMEM; + device_init_wakeup(&ofdev->dev, 1); + new_bus->name = "Gianfar MII Bus", new_bus->read = &gfar_mdio_read, new_bus->write = &gfar_mdio_write,