• Sumit.Saxena@avagotech.com's avatar
    megaraid_sas : Firmware crash dump feature support · fc62b3fc
    Sumit.Saxena@avagotech.com authored
    Resending the patch. Addressed the review comments from Tomas Henzl.
    Move buff_offset inside spinlock, corrected loop at crash dump buffer free,
    reset_devices check is added to disable fw crash dump feature in kdump kernel.
    
    This feature will provide similar interface as kernel crash dump feature.
    When megaraid firmware encounter any crash, driver will collect the firmware raw image and
    dump it into pre-configured location.
    
    Driver will allocate two different segment of memory.
    #1 Non-DMA able large buffer (will be allocated on demand) to capture actual FW crash dump.
    #2 DMA buffer (persistence allocation) just to do a arbitrator job.
    
    Firmware will keep writing Crash dump data in chucks of DMA buffer size into #2,
    which will be copy back by driver to the host memory as described in #1.
    
    Driver-Firmware interface:
    ==================
    A.) Host driver can allocate maximum 512MB Host memory to store crash dump data.
    
    This memory will be internal to the host and will not be exposed to the Firmware.
    Driver may not be able to allocate 512 MB. In that case, driver will do possible memory
    (available at run time) allocation to store crash dump data.
    
    Let’s call this buffer as Host Crash Buffer.
    
    Host Crash buffer will not be contigious as a whole, but it will have multiple chunk of contigious memory.
    This will be internal to driver and firmware/application are unaware of it.
    Partial allocation of Host Crash buffer may have valid information to debug depending upon
    what was collected in that buffer and depending on nature of failure.
    
    Complete Crash dump is the best case, but we do want to capture partial buffer just to grab something rather than nothing.
    Host Crash buffer will be allocated only when FW Crash dump data is available,
    and will be deallocated once application copy Host Crash buffer to the file.
    Host Crash buffer size can be anything between 1MB to 512MB. (It will be multiple of 1MBs)
    
    B.) Irrespective of underlying Firmware capability of crash dump support,
    driver will allocate DMA buffer at start of the day for each MR controllers.
    Let’s call this buffer as “DMA Crash Buffer”.
    
    For this feature, size of DMA crash buffer will be 1MB.
    (We will not gain much even if DMA buffer size is increased.)
    
    C.) Driver will now read Controller Info sending existing dcmd “MR_DCMD_CTRL_GET_INFO”.
    Driver should extract the information from ctrl info provided by firmware and
    figure out if firmware support crash dump feature or not.
    
    Driver will enable crash dump feature only if
    “Firmware support Crash dump” +
    “Driver was able to create DMA Crash Buffer”.
    
    If either one from above is not set, Crash dump feature should be disable in driver.
    Firmware will enable crash dump feature only if “Driver Send DCMD- MR_DCMD_SET_CRASH_BUF_PARA with MR_CRASH_BUF_TURN_ON”
    
    Helper application/script should use sysfs parameter fw_crash_xxx to actually copy data from
    host memory to the filesystem.
    Signed-off-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
    Signed-off-by: default avatarKashyap Desai <kashyap.desai@avagotech.com>
    Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    fc62b3fc
megaraid_sas_fusion.c 82.2 KB