scsi: megaraid_sas: Block PCI config space access from userspace during OCR
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Tue, 7 May 2019 17:05:34 +0000 (10:05 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Jun 2019 23:46:19 +0000 (19:46 -0400)
commit78409d4b47b83d81d29450ef890e07d9ce629fdd
treec6073bd5b8c39aa7212e968e5f68aa932121ebb2
parent44e8d6930ff67ce5e72a6a81c2a578c801eb2e39
scsi: megaraid_sas: Block PCI config space access from userspace during OCR

While an online controller reset(OCR) is in progress, there is short
duration where all access to controller's PCI config space from the host
needs to be blocked.  This is due to a hardware limitation of MegaRAID
controllers.

With this patch, driver will block all access to controller's config space
from userland applications by calling pci_cfg_access_lock() while OCR is in
progress and unlocking after controller comes back to ready state.

Added helper function which locks the config space before initiating OCR
and wait for controller to become READY.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fusion.c