login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
August
»
9
Re: [RFC][PATCH] uli526x: Add suspend and resume routines (updated)
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Grant Grundler <grundler@...>
To: Rafael J. Wysocki <rjw@...>
Cc: Jeff Garzik <jeff@...>, Kyle McMartin <kyle@...>, LKML <linux-kernel@...>, pm list <linux-pm@...>, Grant Grundler <grundler@...>
Subject:
Re: [RFC][PATCH] uli526x: Add suspend and resume routines (updated)
Date: Thursday, August 9, 2007 - 2:27 am
On Wed, Aug 08, 2007 at 12:56:41AM +0200, Rafael J. Wysocki wrote: ...
quoted text
> > Apologies, I missed this. I'll look to our new tulip maintainer to > > queue your resent patch, or at least ACK it... > > OK > > Below is the updated version. It's functionally equivalent to the previous one.
ACK. Looks fine to me too. I don't have the HW to test it though. cheers, grant
quoted text
> > Greetings, > Rafael > > > --- > From: Rafael J. Wysocki <rjw@sisk.pl> > > Add suspend/resume support to the uli526x network driver (tested on x86_64, > with 'Ethernet controller: ALi Corporation M5263 Ethernet Controller, rev 40'). > > This patch is based on the suspend/resume code in the tg3 driver. > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> > --- > drivers/net/tulip/uli526x.c | 109 +++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 103 insertions(+), 6 deletions(-) > > Index: linux-2.6.23-rc2/drivers/net/tulip/uli526x.c > =================================================================== > --- linux-2.6.23-rc2.orig/drivers/net/tulip/uli526x.c > +++ linux-2.6.23-rc2/drivers/net/tulip/uli526x.c > @@ -1110,19 +1110,15 @@ static void uli526x_timer(unsigned long > > > /* > - * Dynamic reset the ULI526X board > * Stop ULI526X board > * Free Tx/Rx allocated memory > - * Reset ULI526X board > - * Re-initialize ULI526X board > + * Init system variable > */ > > -static void uli526x_dynamic_reset(struct net_device *dev) > +static void uli526x_reset_prepare(struct net_device *dev) > { > struct uli526x_board_info *db = netdev_priv(dev); > > - ULI526X_DBUG(0, "uli526x_dynamic_reset()", 0); > - > /* Sopt MAC controller */ > db->cr6_data &= ~(CR6_RXSC | CR6_TXSC); /* Disable Tx/Rx */ > update_cr6(db->cr6_data, dev->base_addr); > @@ -1141,6 +1137,22 @@ static void uli526x_dynamic_reset(struct > db->link_failed = 1; > db->init=1; > db->wait_reset = 0; > +} > + > + > +/* > + * Dynamic reset the ULI526X board > + * Stop ULI526X board > + * Free Tx/Rx allocated memory > + * Reset ULI526X board > + * Re-initialize ULI526X board > + */ > + > +static void uli526x_dynamic_reset(struct net_device *dev) > +{ > + ULI526X_DBUG(0, "uli526x_dynamic_reset()", 0); > + > + uli526x_reset_prepare(dev); > > /* Re-initialize ULI526X board */ > uli526x_init(dev); > @@ -1150,6 +1162,89 @@ static void uli526x_dynamic_reset(struct > } > > > +#ifdef CONFIG_PM_SLEEP > + > +/* > + * Suspend the interface. > + */ > + > +static int uli526x_suspend(struct pci_dev *pdev, pm_message_t state) > +{ > + struct net_device *dev = pci_get_drvdata(pdev); > + pci_power_t power_state; > + int err; > + > + ULI526X_DBUG(0, "uli526x_suspend", 0); > + > + if (!(dev && netdev_priv(dev))) > + return 0; > + > + pci_save_state(pdev); > + > + if (!netif_running(dev)) > + return 0; > + > + netif_device_detach(dev); > + uli526x_reset_prepare(dev); > + > + power_state = pci_choose_state(pdev, state); > + pci_enable_wake(pdev, power_state, 0); > + err = pci_set_power_state(pdev, power_state); > + if (err) { > + netif_device_attach(dev); > + /* Re-initialize ULI526X board */ > + uli526x_init(dev); > + /* Restart upper layer interface */ > + netif_wake_queue(dev); > + } > + > + return err; > +} > + > +/* > + * Resume the interface. > + */ > + > +static int uli526x_resume(struct pci_dev *pdev) > +{ > + struct net_device *dev = pci_get_drvdata(pdev); > + struct uli526x_board_info *db = netdev_priv(dev); > + int err; > + > + ULI526X_DBUG(0, "uli526x_resume", 0); > + > + if (!(dev && db)) > + return 0; > + > + pci_restore_state(pdev); > + > + if (!netif_running(dev)) > + return 0; > + > + err = pci_set_power_state(pdev, PCI_D0); > + if (err) { > + printk(KERN_WARNING "%s: Could not put device into D0\n", > + dev->name); > + return err; > + } > + > + netif_device_attach(dev); > + /* Re-initialize ULI526X board */ > + uli526x_init(dev); > + /* Restart upper layer interface */ > + netif_wake_queue(dev); > + > + return 0; > +} > + > +#else /* !CONFIG_PM_SLEEP */ > + > +#define uli526x_suspend NULL > +#define uli526x_resume NULL > + > +#endif /* !CONFIG_PM_SLEEP */ > + > + > /* > * free all allocated rx buffer > */ > @@ -1689,6 +1784,8 @@ static struct pci_driver uli526x_driver > .id_table = uli526x_pci_tbl, > .probe = uli526x_init_one, > .remove = __devexit_p(uli526x_remove_one), > + .suspend = uli526x_suspend, > + .resume = uli526x_resume, > }; > > MODULE_AUTHOR("Peer Chen, peer.chen@uli.com.tw");
-
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[RFC][PATCH] uli526x: Add suspend and resume routines
, Rafael J. Wysocki
, (Sun Aug 5, 3:14 pm)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines
, Andrew Morton
, (Tue Aug 7, 7:03 pm)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines
, Rafael J. Wysocki
, (Wed Aug 8, 8:05 am)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines
, Rafael J. Wysocki
, (Wed Aug 8, 8:09 am)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines
, Jeff Garzik
, (Tue Aug 7, 5:40 pm)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines
, Rafael J. Wysocki
, (Tue Aug 7, 6:24 pm)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines
, Jeff Garzik
, (Tue Aug 7, 6:26 pm)
[RFC][PATCH] uli526x: Add suspend and resume routines (updat...
, Rafael J. Wysocki
, (Tue Aug 7, 6:56 pm)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines (u...
, Jeff Garzik
, (Tue Aug 14, 1:58 am)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines (u...
, Rafael J. Wysocki
, (Tue Aug 14, 2:09 pm)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines (u...
, Jeff Garzik
, (Fri Aug 31, 8:52 am)
Re: [RFC][PATCH] uli526x: Add suspend and resume routines (u...
, Grant Grundler
, (Thu Aug 9, 2:27 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Bart Van Assche
Integration of SCST in the mainstream Linux kernel
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Roland McGrath
Re: Linus 2.6.23-rc1
Rafael J. Wysocki
[Bug #10984] MMC print trace information when resume from suspend
git
:
linux-netdev
:
Gerrit Renker
[PATCH 03/37] dccp: List management for new feature negotiation
Corey Minyard
[PATCH 3/3] Convert the UDP hash lock to RCU
David Miller
[GIT]: Networking
David Miller
xfrm_state locking regression...
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
648 guests
online.
Online users
seownik
Syndicate