• Dan Williams's avatar
    cxl/pci: Cleanup 'sanitize' to always poll · e30a1065
    Dan Williams authored
    In preparation for fixing the init/teardown of the 'sanitize' workqueue
    and sysfs notification mechanism, arrange for cxl_mbox_sanitize_work()
    to be the single location where the sysfs attribute is notified. With
    that change there is no distinction between polled mode and interrupt
    mode. All the interrupt does is accelerate the polling interval.
    
    The change to check for "mds->security.sanitize_node" under the lock is
    there to ensure that the interrupt, the work routine and the
    setup/teardown code can all have a consistent view of the registered
    notifier and the workqueue state. I.e. the expectation is that the
    interrupt is live past the point that the sanitize sysfs attribute is
    published, and it may race teardown, so it must be consulted under a
    lock. Given that new locking requirement, cxl_pci_mbox_irq() is moved
    from hard to thread irq context.
    
    Lastly, some opportunistic replacements of
    "queue_delayed_work(system_wq, ...)", which is just open coded
    schedule_delayed_work(), are included.
    Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
    Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
    Reviewed-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    e30a1065
cxlmem.h 26.2 KB