• Davidlohr Bueso's avatar
    cxl/mem: Wire up event interrupts · a49aa814
    Davidlohr Bueso authored
    Currently the only CXL features targeted for irq support require their
    message numbers to be within the first 16 entries.  The device may
    however support less than 16 entries depending on the support it
    provides.
    
    Attempt to allocate these 16 irq vectors.  If the device supports less
    then the PCI infrastructure will allocate that number.  Upon successful
    allocation, users can plug in their respective isr at any point
    thereafter.
    
    CXL device events are signaled via interrupts.  Each event log may have
    a different interrupt message number.  These message numbers are
    reported in the Get Event Interrupt Policy mailbox command.
    
    Add interrupt support for event logs.  Interrupts are allocated as
    shared interrupts.  Therefore, all or some event logs can share the same
    message number.
    
    In addition all logs are queried on any interrupt in order of the most
    to least severe based on the status register.
    
    Finally place all event configuration logic into cxl_event_config().
    Previously the logic was a simple 'read all' on start up.  But
    interrupts must be configured prior to any reads to ensure no events are
    missed.  A single event configuration function results in a cleaner over
    all implementation.
    
    Cc: Bjorn Helgaas <helgaas@kernel.org>
    Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Co-developed-by: default avatarIra Weiny <ira.weiny@intel.com>
    Signed-off-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
    Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
    Link: https://lore.kernel.org/r/20221216-cxl-ev-log-v7-2-2316a5c8f7d8@intel.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    a49aa814
cxl.h 23.1 KB