scsi: mpt3sas: Add app owned flag support for diag buffer
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Fri, 13 Sep 2019 13:04:45 +0000 (09:04 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 1 Oct 2019 02:32:47 +0000 (22:32 -0400)
commita8a6cbcd038de4ee3722c17edd7a4d84ce423f7d
tree27f56d95142f7ea835ca3f5e4924aa5b7b8b3816
parenta066f4c31359d07b1a2c5144b4b9a29901365fd0
scsi: mpt3sas: Add app owned flag support for diag buffer

Added a new status flag named MPT3_DIAG_BUFFER_IS_APP_OWNED and it will set
whenever application registers the diag buffer & it will be cleared when
application unregisters the buffer.

When this flag is enabled, and if application issues diag buffer register
command without releasing the buffer, then register command will be failed
with -EINVAL status by saying that this buffer is already registered by the
application.

When user issues a trace buffer register command through sysfs parameter,
and if trace buffer is in released stated but not yet unregistered by the
application which was owning it, then driver will unregister the buffer by
itself and freshly register the 1MB sized trace buffer with the HBA
firmware.

Link: https://lore.kernel.org/r/1568379890-18347-9-git-send-email-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.h
drivers/scsi/mpt3sas/mpt3sas_ctl.c