• Sreekanth Reddy's avatar
    scsi: mpt3sas: Reuse diag buffer allocated at load time · a066f4c3
    Sreekanth Reddy authored
    The diag buffer which is allocated during driver load time or through sysfs
    parameter is marked as driver allocated diag buffer.
    MPT3_DIAG_BUFFER_IS_DRIVER_ALLOCATED bit will be set for this buffer.
    
    This buffer won't be de-allocated even when application issues unregister
    command, driver just clears the registered status bit. Same buffer will be
    reused while re-registering the same diag buffer type by any application.
    While re-registering the same diag buffer type application has to register
    with the same size that the buffer was allocated during driver load
    time. This buffer size can be read by the application by issuing diag
    'query' command.
    
    This always makes sure that the memory is available for applications for
    collecting the firmware logs. Only thing is that this won't allow the
    application to re-register the diag buffer with different size, but the
    buffer size which is allocated during driver load time will be enough for
    most of the cases for collecting the firmware logs.
    
    Link: https://lore.kernel.org/r/1568379890-18347-8-git-send-email-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    a066f4c3
mpt3sas_ctl.c 109 KB