lkml.org 
[lkml]   [2011]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    SubjectRe: [PATCH 4/8] staging: et131x: Add pci suspend & resume functions
    On 1 October 2011 12:03, Francois Romieu <romieu@fr.zoreil.com> wrote:
    > Mark Einon <mark.einon@gmail.com> :
    >> Added basic suspend & resume functionality.
    >> Tested on an et1310 device, and putting Fedora15 host in and out of
    >> hibernation successfully.
    ---
    >> +static int et131x_pci_resume(struct pci_dev *pdev)
    >> +{
    >> +     struct net_device *netdev = pci_get_drvdata(pdev);
    >> +     int err = 0;
    >> +
    >> +     if (!netif_running(netdev))
    >> +             return 0;
    >> +
    >> +     pci_set_power_state(pdev, PCI_D0);
    >> +     pci_restore_state(pdev);
    >> +
    >> +     err = et131x_open(netdev);
    >> +     if (err) {
    >> +             dev_err(&pdev->dev, "Can't resume interface!\n");
    >> +             goto out;
    >> +     }
    >
    > You can/should split et131x_{open/close} to remove this failure point.

    Hi, thanks for the comments francois,
    I'm not quite sure what you mean here. Can you expand on your comment please?

    >
    > [...]
    >> @@ -884,8 +923,10 @@ static struct pci_driver et131x_driver = {
    >>       .id_table       = et131x_pci_table,
    >>       .probe          = et131x_pci_setup,
    >>       .remove         = __devexit_p(et131x_pci_remove),
    >> -     .suspend        = NULL,         /* et131x_pci_suspend */
    >> -     .resume         = NULL,         /* et131x_pci_resume */
    >> +#ifdef CONFIG_PM
    >> +     .suspend        = et131x_pci_suspend,
    >> +     .resume         = et131x_pci_resume,
    >> +#endif
    >
    > There is not much driver specific there. It should probably go through
    > pci_driver.driver.pm.

    Ok, understood. I'll do this.

    >
    > --
    > Ueimor
    >
    --
    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/

    \
     
     \ /
      Last update: 2011-10-01 16:05    [W:0.021 / U:305.388 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site