Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (5 weeks ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.18/drivers/xen/xen-acpi-processor.c

    r30344 r31885  
    2828#include <linux/module.h>
    2929#include <linux/types.h>
     30#include <linux/syscore_ops.h>
    3031#include <linux/acpi.h>
    3132#include <acpi/processor.h>
    3233#include <xen/xen.h>
    33 #include <xen/xen-ops.h>
    3434#include <xen/interface/platform.h>
    3535#include <asm/xen/hypercall.h>
     
    467467}
    468468
    469 static int xen_acpi_processor_resume(struct notifier_block *nb,
    470                                      unsigned long action, void *data)
    471 {
     469static void xen_acpi_processor_resume_worker(struct work_struct *dummy)
     470{
     471        int rc;
     472
    472473        bitmap_zero(acpi_ids_done, nr_acpi_bits);
    473         return xen_upload_processor_pm_data();
    474 }
    475 
    476 struct notifier_block xen_acpi_processor_resume_nb = {
    477         .notifier_call = xen_acpi_processor_resume,
     474
     475        rc = xen_upload_processor_pm_data();
     476        if (rc != 0)
     477                pr_info("ACPI data upload failed, error = %d\n", rc);
     478}
     479
     480static void xen_acpi_processor_resume(void)
     481{
     482        static DECLARE_WORK(wq, xen_acpi_processor_resume_worker);
     483
     484        /*
     485         * xen_upload_processor_pm_data() calls non-atomic code.
     486         * However, the context for xen_acpi_processor_resume is syscore
     487         * with only the boot CPU online and in an atomic context.
     488         *
     489         * So defer the upload for some point safer.
     490         */
     491        schedule_work(&wq);
     492}
     493
     494static struct syscore_ops xap_syscore_ops = {
     495        .resume = xen_acpi_processor_resume,
    478496};
    479497
     
    528546                goto err_unregister;
    529547
    530         xen_resume_notifier_register(&xen_acpi_processor_resume_nb);
     548        register_syscore_ops(&xap_syscore_ops);
    531549
    532550        return 0;
     
    547565        int i;
    548566
    549         xen_resume_notifier_unregister(&xen_acpi_processor_resume_nb);
     567        unregister_syscore_ops(&xap_syscore_ops);
    550568        kfree(acpi_ids_done);
    551569        kfree(acpi_id_present);
Note: See TracChangeset for help on using the changeset viewer.