RE: [RFC 3/5] pci wakeup handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>-----Original Message-----
>From: linux-acpi-owner@xxxxxxxxxxxxxxx [mailto:linux-acpi-
>owner@xxxxxxxxxxxxxxx] On Behalf Of Rafael J. Wysocki
>Sent: Monday, September 08, 2008 9:10 PM
>To: Li, Shaohua
>Cc: linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx; linux-acpi@xxxxxxxxxxxxxxx;
>stern@xxxxxxxxxxxxxxxxxxx; dbrownell@xxxxxxxxxxxxxxxxxxxxx; Jesse Barnes
>Subject: Re: [RFC 3/5] pci wakeup handler
>
>On Monday, 8 of September 2008, shaohua.li@xxxxxxxxx wrote:
>> pci subsystem wakeup handler.
>> ---
>>  drivers/pci/pci-driver.c |   46
>++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 46 insertions(+)
>>
>> Index: linux/drivers/pci/pci-driver.c
>> ===================================================================
>> --- linux.orig/drivers/pci/pci-driver.c       2008-09-08
>13:55:56.000000000 +0800
>> +++ linux/drivers/pci/pci-driver.c    2008-09-08 14:24:42.000000000 +0800
>> @@ -472,12 +472,57 @@ static int pci_pm_resume_noirq(struct de
>>       return error;
>>  }
>>
>> +/*
>> + * Called when dev is suspected to invoke a wakeup event, return 0 if
>yes
>> + * */
>> +static int pci_pm_wakeup_event(struct device *dev)
>> +{
>> +     struct pci_dev *pdev = to_pci_dev(dev);
>> +     int pme_pos = pci_find_capability(pdev, PCI_CAP_ID_PM);
>
>Pleae use dev->pm_cap instead.
Ok, I'll address your other comments too.

>        if (drv && drv->pm && drv->pm->base.wakeup_event) {
>                int dev_ret = drv->pm->base.wakeup_event(&pdev->dev);
>                if (ret)
>                        ret = dev_ret;
>        }
>
>Also, why do you think we should ignore the returned value if ret is zero?
Because we already identified the device which invokes PME. Even the .wakeup_event() returns an error, we should populate It's this device which has wakeup event. In my mind, driver isn't required to provide .wakeup_event() unless device has non-standard regs for wakeup event or some special to handle. Generic PME handling should be fine for most devices (for PCI devices).

Thanks,
Shaohua
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux