• Wesley Sheng's avatar
    switchtec: Add MRPC DMA mode support · f7eb7b8a
    Wesley Sheng authored
    MRPC normal mode requires the host to read the MRPC command status and
    output data from BAR.  This results in high latency responses from the
    Memory Read TLP and potential Completion Timeout (CTO).
    
    Add support for MRPC DMA mode, including related macro definitions and data
    structures and code to:
    
      * Retrieve MRPC DMA mode version from adapter firmware
      * Allocate DMA buffer, register ISR, and enable DMA during init
      * Check MRPC execution status and get execution results from DMA buffer
      * Release DMA buffer and disable DMA function when unloading module
    
    MRPC DMA mode is a new feature of firmware, and the driver will fall back
    to MRPC normal mode if there is no support in the legacy firmware.
    
    Add a module parameter, "use_dma_mrpc", to select between MRPC DMA mode and
    MRPC normal mode.  Since the driver automatically detects DMA support in
    the firmware, this parameter is just for debugging and testing.
    
    Include <linux/io-64-nonatomic-lo-hi.h> so that readq/writeq is replaced by
    two readl/writel on systems that do not support it.
    Signed-off-by: default avatarWesley Sheng <wesley.sheng@microchip.com>
    [bhelgaas: changelog, simplify dma_ver check]
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
    f7eb7b8a
switchtec.c 38.2 KB