]> git.itanic.dy.fi Git - linux-stable/commit
cxl/pci: Cleanup 'sanitize' to always poll
authorDan Williams <dan.j.williams@intel.com>
Fri, 29 Sep 2023 19:44:20 +0000 (12:44 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 29 Sep 2023 22:43:34 +0000 (15:43 -0700)
commite30a106558e7d1e06d1fcfd12466dc646673d03d
tree0f74ed85e69eff71aca3b8554468d72370ac6c62
parent76fe8713dd0a1331d84d767e8e5d3f365d959e8a
cxl/pci: Cleanup 'sanitize' to always poll

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: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/memdev.c
drivers/cxl/cxlmem.h
drivers/cxl/pci.c