scsi: megaraid_sas: Pre-allocate frequently used DMA buffers
Pre-allocate few of the frequently used DMA buffers during load time. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:

committed by
Martin K. Petersen

parent
1b4bed2061
commit
9b3d028f34
@@ -776,6 +776,9 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
|
||||
|
||||
fusion = instance->ctrl_context;
|
||||
|
||||
ioc_init_handle = fusion->ioc_init_request_phys;
|
||||
IOCInitMessage = fusion->ioc_init_request;
|
||||
|
||||
cmd = megasas_get_cmd(instance);
|
||||
|
||||
if (!cmd) {
|
||||
@@ -801,18 +804,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
|
||||
dev_info(&instance->pdev->dev, "FW supports sync cache\t: %s\n",
|
||||
instance->fw_sync_cache_support ? "Yes" : "No");
|
||||
|
||||
IOCInitMessage =
|
||||
dma_alloc_coherent(&instance->pdev->dev,
|
||||
sizeof(struct MPI2_IOC_INIT_REQUEST),
|
||||
&ioc_init_handle, GFP_KERNEL);
|
||||
|
||||
if (!IOCInitMessage) {
|
||||
dev_err(&instance->pdev->dev, "Could not allocate memory for "
|
||||
"IOCInitMessage\n");
|
||||
ret = 1;
|
||||
goto fail_fw_init;
|
||||
}
|
||||
|
||||
memset(IOCInitMessage, 0, sizeof(struct MPI2_IOC_INIT_REQUEST));
|
||||
|
||||
IOCInitMessage->Function = MPI2_FUNCTION_IOC_INIT;
|
||||
@@ -921,10 +912,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
|
||||
|
||||
fail_fw_init:
|
||||
megasas_return_cmd(instance, cmd);
|
||||
if (IOCInitMessage)
|
||||
dma_free_coherent(&instance->pdev->dev,
|
||||
sizeof(struct MPI2_IOC_INIT_REQUEST),
|
||||
IOCInitMessage, ioc_init_handle);
|
||||
fail_get_cmd:
|
||||
dev_err(&instance->pdev->dev,
|
||||
"Init cmd return status %s for SCSI host %d\n",
|
||||
|
Reference in New Issue
Block a user