• Davidlohr Bueso's avatar
    cxl/mbox: Add background cmd handling machinery · ccadf131
    Davidlohr Bueso authored
    This adds support for handling background operations, as defined in
    the CXL 3.0 spec. Commands that can take too long (over ~2 seconds)
    can run in the background asynchronously (to the hardware).
    
    The driver will deal with such commands synchronously, blocking all
    other incoming commands for a specified period of time, allowing
    time-slicing the command such that the caller can send incremental
    requests to avoid monopolizing the driver/device. Any out of sync
    (timeout) between the driver and hardware is just disregarded as
    an invalid state until the next successful submission. Such timeouts
    are considered a rare occurrence, either a real device problem or a
    driver issue that needs to reduce the size of the background operation
    to fit the timeout.
    
    On devices where mbox interrupts are supported, this will still use
    a poller that will wakeup in the specified wait intervals. The irq
    handler will simply awake the blocked cmd, which is also safe vs a
    task that is either waking (timing out) or already awoken. Similarly
    any irq setup error during the probing falls back to polling, thus
    avoids unnecessarily erroring out.
    Signed-off-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
    Link: https://lore.kernel.org/r/20230523170927.20685-5-dave@stgolabs.netSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    ccadf131
cxl.h 25.9 KB