* Re: [TG3 1/8]: Save MSI state before suspend.
2007-02-13 20:13 [TG3 1/8]: Save MSI state before suspend Michael Chan
@ 2007-02-13 19:45 ` Jeff Garzik
2007-02-13 20:34 ` Michael Chan
2007-02-13 19:58 ` Stephen Hemminger
2007-02-13 20:19 ` David Miller
2 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2007-02-13 19:45 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev
On Tue, Feb 13, 2007 at 12:13:32PM -0800, Michael Chan wrote:
> [TG3]: Save MSI state before suspend.
>
> This fixes the following problem:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=7969
>
> The MSI state needs to be saved during suspend. PCI state saved
> during tg3_init_one() does not contain valid MSI state because
> MSI hasn't been enabled.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
I'm curious if, after this patch is applied, all the pci_save_state()
calls are truly necessary?
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [TG3 1/8]: Save MSI state before suspend.
2007-02-13 20:13 [TG3 1/8]: Save MSI state before suspend Michael Chan
2007-02-13 19:45 ` Jeff Garzik
@ 2007-02-13 19:58 ` Stephen Hemminger
2007-02-13 20:01 ` Jeff Garzik
2007-02-13 20:54 ` Michael Chan
2007-02-13 20:19 ` David Miller
2 siblings, 2 replies; 7+ messages in thread
From: Stephen Hemminger @ 2007-02-13 19:58 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev
On Tue, 13 Feb 2007 12:13:32 -0800
"Michael Chan" <mchan@broadcom.com> wrote:
> [TG3]: Save MSI state before suspend.
>
> This fixes the following problem:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=7969
>
> The MSI state needs to be saved during suspend. PCI state saved
> during tg3_init_one() does not contain valid MSI state because
> MSI hasn't been enabled.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
>
I think you have to move the original pci_save_state call, otherwise
you will call pci_save_state twice and leak memory. pci_save_state
allocates memory to store MSI and other information. Look at pci_save_pcie_state
etc.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [TG3 1/8]: Save MSI state before suspend.
2007-02-13 19:58 ` Stephen Hemminger
@ 2007-02-13 20:01 ` Jeff Garzik
2007-02-13 20:54 ` Michael Chan
1 sibling, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2007-02-13 20:01 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Michael Chan, davem, netdev
On Tue, Feb 13, 2007 at 11:58:25AM -0800, Stephen Hemminger wrote:
> I think you have to move the original pci_save_state call, otherwise
> you will call pci_save_state twice and leak memory. pci_save_state
> allocates memory to store MSI and other information. Look at pci_save_pcie_state
> etc.
That's a bug in the PCI layer. Patches welcome...
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* [TG3 1/8]: Save MSI state before suspend.
@ 2007-02-13 20:13 Michael Chan
2007-02-13 19:45 ` Jeff Garzik
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Michael Chan @ 2007-02-13 20:13 UTC (permalink / raw)
To: davem, netdev
[TG3]: Save MSI state before suspend.
This fixes the following problem:
http://bugzilla.kernel.org/show_bug.cgi?id=7969
The MSI state needs to be saved during suspend. PCI state saved
during tg3_init_one() does not contain valid MSI state because
MSI hasn't been enabled.
Signed-off-by: Michael Chan <mchan@broadcom.com>
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e136bae..0b5b8e7 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -12016,6 +12016,9 @@ static int tg3_suspend(struct pci_dev *p
tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
tg3_full_unlock(tp);
+ /* Save MSI address and data for resume. */
+ pci_save_state(pdev);
+
err = tg3_set_power_state(tp, pci_choose_state(pdev, state));
if (err) {
tg3_full_lock(tp, 0);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [TG3 1/8]: Save MSI state before suspend.
2007-02-13 20:13 [TG3 1/8]: Save MSI state before suspend Michael Chan
2007-02-13 19:45 ` Jeff Garzik
2007-02-13 19:58 ` Stephen Hemminger
@ 2007-02-13 20:19 ` David Miller
2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2007-02-13 20:19 UTC (permalink / raw)
To: mchan; +Cc: netdev
From: "Michael Chan" <mchan@broadcom.com>
Date: Tue, 13 Feb 2007 12:13:32 -0800
> [TG3]: Save MSI state before suspend.
>
> This fixes the following problem:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=7969
>
> The MSI state needs to be saved during suspend. PCI state saved
> during tg3_init_one() does not contain valid MSI state because
> MSI hasn't been enabled.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [TG3 1/8]: Save MSI state before suspend.
2007-02-13 19:45 ` Jeff Garzik
@ 2007-02-13 20:34 ` Michael Chan
0 siblings, 0 replies; 7+ messages in thread
From: Michael Chan @ 2007-02-13 20:34 UTC (permalink / raw)
To: Jeff Garzik; +Cc: davem, netdev
On Tue, 2007-02-13 at 14:45 -0500, Jeff Garzik wrote:
>
> I'm curious if, after this patch is applied, all the pci_save_state()
> calls are truly necessary?
>
The others are necessary to save/restore the memory enable bit in the
PCI command register. This bit gets reset after chip reset.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [TG3 1/8]: Save MSI state before suspend.
2007-02-13 19:58 ` Stephen Hemminger
2007-02-13 20:01 ` Jeff Garzik
@ 2007-02-13 20:54 ` Michael Chan
1 sibling, 0 replies; 7+ messages in thread
From: Michael Chan @ 2007-02-13 20:54 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, netdev
On Tue, 2007-02-13 at 11:58 -0800, Stephen Hemminger wrote:
>
> I think you have to move the original pci_save_state call, otherwise
> you will call pci_save_state twice and leak memory. pci_save_state
> allocates memory to store MSI and other information. Look at pci_save_pcie_state
> etc.
>
I think it is ok the way it is. We call pci_restore_state() at least
once during tg3_chip_reset(). This will free any memory allocated
during tg3_init_one()'s call to pci_save_state(), before we even get to
tg3_suspend().
The memory allocated in tg3_suspend()'s call to pci_save_state() will be
freed when tg3_resume() calls pci_restore_state().
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-02-13 20:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-13 20:13 [TG3 1/8]: Save MSI state before suspend Michael Chan
2007-02-13 19:45 ` Jeff Garzik
2007-02-13 20:34 ` Michael Chan
2007-02-13 19:58 ` Stephen Hemminger
2007-02-13 20:01 ` Jeff Garzik
2007-02-13 20:54 ` Michael Chan
2007-02-13 20:19 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).