Re: tg3 ethernet not coming back properly after S3 suspend on Dell M70

Vladimir Vukicevic
2005-06-10T02:28:58Z

On 6/9/05, Shaohua Li <shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> Please try below patch.
>
> Long, is this patch ok to you? PCIE bridge itself requires to
> save/restore config space.
>
> Thanks,
> Shaohua
>
>
> --- a/drivers/pci/pcie/portdrv_pci.c 2005-06-08 10:36:05.000000000 +0800
> +++ b/drivers/pci/pcie/portdrv_pci.c 2005-06-10 09:34:55.760496584 +0800
> @@ -69,11 +69,16 @@ static void pcie_portdrv_remove (struct
> #ifdef CONFIG_PM
> static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state)
> {
> - return pcie_port_device_suspend(dev, state);
> + int ret = pcie_port_device_suspend(dev, state);
> + pci_save_state(dev);
> + return ret;
> }
>
> static int pcie_portdrv_resume (struct pci_dev *dev)
> {
> + pci_restore_state(dev);
> + pci_enable_device(dev);
> + pci_set_master(dev);
> return pcie_port_device_resume(dev);
> }
> #endif

That patch did the trick! All the devices seem to come back with
their config space identical to before the suspend. I noticed that
pci_save_state/pci_restore_state only save 64 bytes of state -- I did
a separate patch before I saw your mail that saved the full size of
the config space (based on dev->cfg_size) that also fixed things...
should the full config space size be saved, or is that not necessary?

Even with the patches (either one or both), I'm unable to suspend the
nvidia, but that's for them to fix most likely...