scsi: megaraid: Replace PCI pool old API
The PCI pool API is deprecated. This commit replaces the PCI pool old API by the appropriate function with the DMA pool API. Signed-off-by: Romain Perier <romain.perier@collabora.com> Reviewed-by: Peter Senna Tschudin <peter.senna@collabora.com> Acked-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
771db5c0e3
commit
fc69d86dcb
|
@ -1153,8 +1153,8 @@ megaraid_mbox_setup_dma_pools(adapter_t *adapter)
|
||||||
|
|
||||||
|
|
||||||
// Allocate memory for 16-bytes aligned mailboxes
|
// Allocate memory for 16-bytes aligned mailboxes
|
||||||
raid_dev->mbox_pool_handle = pci_pool_create("megaraid mbox pool",
|
raid_dev->mbox_pool_handle = dma_pool_create("megaraid mbox pool",
|
||||||
adapter->pdev,
|
&adapter->pdev->dev,
|
||||||
sizeof(mbox64_t) + 16,
|
sizeof(mbox64_t) + 16,
|
||||||
16, 0);
|
16, 0);
|
||||||
|
|
||||||
|
@ -1164,7 +1164,7 @@ megaraid_mbox_setup_dma_pools(adapter_t *adapter)
|
||||||
|
|
||||||
mbox_pci_blk = raid_dev->mbox_pool;
|
mbox_pci_blk = raid_dev->mbox_pool;
|
||||||
for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
|
for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
|
||||||
mbox_pci_blk[i].vaddr = pci_pool_alloc(
|
mbox_pci_blk[i].vaddr = dma_pool_alloc(
|
||||||
raid_dev->mbox_pool_handle,
|
raid_dev->mbox_pool_handle,
|
||||||
GFP_KERNEL,
|
GFP_KERNEL,
|
||||||
&mbox_pci_blk[i].dma_addr);
|
&mbox_pci_blk[i].dma_addr);
|
||||||
|
@ -1181,8 +1181,8 @@ megaraid_mbox_setup_dma_pools(adapter_t *adapter)
|
||||||
* share common memory pool. Passthru structures piggyback on memory
|
* share common memory pool. Passthru structures piggyback on memory
|
||||||
* allocted to extended passthru since passthru is smaller of the two
|
* allocted to extended passthru since passthru is smaller of the two
|
||||||
*/
|
*/
|
||||||
raid_dev->epthru_pool_handle = pci_pool_create("megaraid mbox pthru",
|
raid_dev->epthru_pool_handle = dma_pool_create("megaraid mbox pthru",
|
||||||
adapter->pdev, sizeof(mraid_epassthru_t), 128, 0);
|
&adapter->pdev->dev, sizeof(mraid_epassthru_t), 128, 0);
|
||||||
|
|
||||||
if (raid_dev->epthru_pool_handle == NULL) {
|
if (raid_dev->epthru_pool_handle == NULL) {
|
||||||
goto fail_setup_dma_pool;
|
goto fail_setup_dma_pool;
|
||||||
|
@ -1190,7 +1190,7 @@ megaraid_mbox_setup_dma_pools(adapter_t *adapter)
|
||||||
|
|
||||||
epthru_pci_blk = raid_dev->epthru_pool;
|
epthru_pci_blk = raid_dev->epthru_pool;
|
||||||
for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
|
for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
|
||||||
epthru_pci_blk[i].vaddr = pci_pool_alloc(
|
epthru_pci_blk[i].vaddr = dma_pool_alloc(
|
||||||
raid_dev->epthru_pool_handle,
|
raid_dev->epthru_pool_handle,
|
||||||
GFP_KERNEL,
|
GFP_KERNEL,
|
||||||
&epthru_pci_blk[i].dma_addr);
|
&epthru_pci_blk[i].dma_addr);
|
||||||
|
@ -1202,8 +1202,8 @@ megaraid_mbox_setup_dma_pools(adapter_t *adapter)
|
||||||
|
|
||||||
// Allocate memory for each scatter-gather list. Request for 512 bytes
|
// Allocate memory for each scatter-gather list. Request for 512 bytes
|
||||||
// alignment for each sg list
|
// alignment for each sg list
|
||||||
raid_dev->sg_pool_handle = pci_pool_create("megaraid mbox sg",
|
raid_dev->sg_pool_handle = dma_pool_create("megaraid mbox sg",
|
||||||
adapter->pdev,
|
&adapter->pdev->dev,
|
||||||
sizeof(mbox_sgl64) * MBOX_MAX_SG_SIZE,
|
sizeof(mbox_sgl64) * MBOX_MAX_SG_SIZE,
|
||||||
512, 0);
|
512, 0);
|
||||||
|
|
||||||
|
@ -1213,7 +1213,7 @@ megaraid_mbox_setup_dma_pools(adapter_t *adapter)
|
||||||
|
|
||||||
sg_pci_blk = raid_dev->sg_pool;
|
sg_pci_blk = raid_dev->sg_pool;
|
||||||
for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
|
for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
|
||||||
sg_pci_blk[i].vaddr = pci_pool_alloc(
|
sg_pci_blk[i].vaddr = dma_pool_alloc(
|
||||||
raid_dev->sg_pool_handle,
|
raid_dev->sg_pool_handle,
|
||||||
GFP_KERNEL,
|
GFP_KERNEL,
|
||||||
&sg_pci_blk[i].dma_addr);
|
&sg_pci_blk[i].dma_addr);
|
||||||
|
@ -1249,29 +1249,29 @@ megaraid_mbox_teardown_dma_pools(adapter_t *adapter)
|
||||||
|
|
||||||
sg_pci_blk = raid_dev->sg_pool;
|
sg_pci_blk = raid_dev->sg_pool;
|
||||||
for (i = 0; i < MBOX_MAX_SCSI_CMDS && sg_pci_blk[i].vaddr; i++) {
|
for (i = 0; i < MBOX_MAX_SCSI_CMDS && sg_pci_blk[i].vaddr; i++) {
|
||||||
pci_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr,
|
dma_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr,
|
||||||
sg_pci_blk[i].dma_addr);
|
sg_pci_blk[i].dma_addr);
|
||||||
}
|
}
|
||||||
if (raid_dev->sg_pool_handle)
|
if (raid_dev->sg_pool_handle)
|
||||||
pci_pool_destroy(raid_dev->sg_pool_handle);
|
dma_pool_destroy(raid_dev->sg_pool_handle);
|
||||||
|
|
||||||
|
|
||||||
epthru_pci_blk = raid_dev->epthru_pool;
|
epthru_pci_blk = raid_dev->epthru_pool;
|
||||||
for (i = 0; i < MBOX_MAX_SCSI_CMDS && epthru_pci_blk[i].vaddr; i++) {
|
for (i = 0; i < MBOX_MAX_SCSI_CMDS && epthru_pci_blk[i].vaddr; i++) {
|
||||||
pci_pool_free(raid_dev->epthru_pool_handle,
|
dma_pool_free(raid_dev->epthru_pool_handle,
|
||||||
epthru_pci_blk[i].vaddr, epthru_pci_blk[i].dma_addr);
|
epthru_pci_blk[i].vaddr, epthru_pci_blk[i].dma_addr);
|
||||||
}
|
}
|
||||||
if (raid_dev->epthru_pool_handle)
|
if (raid_dev->epthru_pool_handle)
|
||||||
pci_pool_destroy(raid_dev->epthru_pool_handle);
|
dma_pool_destroy(raid_dev->epthru_pool_handle);
|
||||||
|
|
||||||
|
|
||||||
mbox_pci_blk = raid_dev->mbox_pool;
|
mbox_pci_blk = raid_dev->mbox_pool;
|
||||||
for (i = 0; i < MBOX_MAX_SCSI_CMDS && mbox_pci_blk[i].vaddr; i++) {
|
for (i = 0; i < MBOX_MAX_SCSI_CMDS && mbox_pci_blk[i].vaddr; i++) {
|
||||||
pci_pool_free(raid_dev->mbox_pool_handle,
|
dma_pool_free(raid_dev->mbox_pool_handle,
|
||||||
mbox_pci_blk[i].vaddr, mbox_pci_blk[i].dma_addr);
|
mbox_pci_blk[i].vaddr, mbox_pci_blk[i].dma_addr);
|
||||||
}
|
}
|
||||||
if (raid_dev->mbox_pool_handle)
|
if (raid_dev->mbox_pool_handle)
|
||||||
pci_pool_destroy(raid_dev->mbox_pool_handle);
|
dma_pool_destroy(raid_dev->mbox_pool_handle);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -574,7 +574,7 @@ mraid_mm_attach_buf(mraid_mmadp_t *adp, uioc_t *kioc, int xferlen)
|
||||||
|
|
||||||
kioc->pool_index = right_pool;
|
kioc->pool_index = right_pool;
|
||||||
kioc->free_buf = 1;
|
kioc->free_buf = 1;
|
||||||
kioc->buf_vaddr = pci_pool_alloc(pool->handle, GFP_ATOMIC,
|
kioc->buf_vaddr = dma_pool_alloc(pool->handle, GFP_ATOMIC,
|
||||||
&kioc->buf_paddr);
|
&kioc->buf_paddr);
|
||||||
spin_unlock_irqrestore(&pool->lock, flags);
|
spin_unlock_irqrestore(&pool->lock, flags);
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ mraid_mm_dealloc_kioc(mraid_mmadp_t *adp, uioc_t *kioc)
|
||||||
* not in use
|
* not in use
|
||||||
*/
|
*/
|
||||||
if (kioc->free_buf == 1)
|
if (kioc->free_buf == 1)
|
||||||
pci_pool_free(pool->handle, kioc->buf_vaddr,
|
dma_pool_free(pool->handle, kioc->buf_vaddr,
|
||||||
kioc->buf_paddr);
|
kioc->buf_paddr);
|
||||||
else
|
else
|
||||||
pool->in_use = 0;
|
pool->in_use = 0;
|
||||||
|
@ -940,8 +940,8 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
adapter->mbox_list = kmalloc(sizeof(mbox64_t) * lld_adp->max_kioc,
|
adapter->mbox_list = kmalloc(sizeof(mbox64_t) * lld_adp->max_kioc,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
adapter->pthru_dma_pool = pci_pool_create("megaraid mm pthru pool",
|
adapter->pthru_dma_pool = dma_pool_create("megaraid mm pthru pool",
|
||||||
adapter->pdev,
|
&adapter->pdev->dev,
|
||||||
sizeof(mraid_passthru_t),
|
sizeof(mraid_passthru_t),
|
||||||
16, 0);
|
16, 0);
|
||||||
|
|
||||||
|
@ -970,7 +970,7 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
|
||||||
|
|
||||||
kioc = adapter->kioc_list + i;
|
kioc = adapter->kioc_list + i;
|
||||||
kioc->cmdbuf = (uint64_t)(unsigned long)(mbox_list + i);
|
kioc->cmdbuf = (uint64_t)(unsigned long)(mbox_list + i);
|
||||||
kioc->pthru32 = pci_pool_alloc(adapter->pthru_dma_pool,
|
kioc->pthru32 = dma_pool_alloc(adapter->pthru_dma_pool,
|
||||||
GFP_KERNEL, &kioc->pthru32_h);
|
GFP_KERNEL, &kioc->pthru32_h);
|
||||||
|
|
||||||
if (!kioc->pthru32) {
|
if (!kioc->pthru32) {
|
||||||
|
@ -1006,7 +1006,7 @@ pthru_dma_pool_error:
|
||||||
for (i = 0; i < lld_adp->max_kioc; i++) {
|
for (i = 0; i < lld_adp->max_kioc; i++) {
|
||||||
kioc = adapter->kioc_list + i;
|
kioc = adapter->kioc_list + i;
|
||||||
if (kioc->pthru32) {
|
if (kioc->pthru32) {
|
||||||
pci_pool_free(adapter->pthru_dma_pool, kioc->pthru32,
|
dma_pool_free(adapter->pthru_dma_pool, kioc->pthru32,
|
||||||
kioc->pthru32_h);
|
kioc->pthru32_h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1017,7 +1017,7 @@ memalloc_error:
|
||||||
kfree(adapter->mbox_list);
|
kfree(adapter->mbox_list);
|
||||||
|
|
||||||
if (adapter->pthru_dma_pool)
|
if (adapter->pthru_dma_pool)
|
||||||
pci_pool_destroy(adapter->pthru_dma_pool);
|
dma_pool_destroy(adapter->pthru_dma_pool);
|
||||||
|
|
||||||
kfree(adapter);
|
kfree(adapter);
|
||||||
|
|
||||||
|
@ -1086,14 +1086,15 @@ mraid_mm_setup_dma_pools(mraid_mmadp_t *adp)
|
||||||
pool->buf_size = bufsize;
|
pool->buf_size = bufsize;
|
||||||
spin_lock_init(&pool->lock);
|
spin_lock_init(&pool->lock);
|
||||||
|
|
||||||
pool->handle = pci_pool_create("megaraid mm data buffer",
|
pool->handle = dma_pool_create("megaraid mm data buffer",
|
||||||
adp->pdev, bufsize, 16, 0);
|
&adp->pdev->dev, bufsize,
|
||||||
|
16, 0);
|
||||||
|
|
||||||
if (!pool->handle) {
|
if (!pool->handle) {
|
||||||
goto dma_pool_setup_error;
|
goto dma_pool_setup_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pool->vaddr = pci_pool_alloc(pool->handle, GFP_KERNEL,
|
pool->vaddr = dma_pool_alloc(pool->handle, GFP_KERNEL,
|
||||||
&pool->paddr);
|
&pool->paddr);
|
||||||
|
|
||||||
if (!pool->vaddr)
|
if (!pool->vaddr)
|
||||||
|
@ -1163,14 +1164,14 @@ mraid_mm_free_adp_resources(mraid_mmadp_t *adp)
|
||||||
|
|
||||||
kioc = adp->kioc_list + i;
|
kioc = adp->kioc_list + i;
|
||||||
|
|
||||||
pci_pool_free(adp->pthru_dma_pool, kioc->pthru32,
|
dma_pool_free(adp->pthru_dma_pool, kioc->pthru32,
|
||||||
kioc->pthru32_h);
|
kioc->pthru32_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(adp->kioc_list);
|
kfree(adp->kioc_list);
|
||||||
kfree(adp->mbox_list);
|
kfree(adp->mbox_list);
|
||||||
|
|
||||||
pci_pool_destroy(adp->pthru_dma_pool);
|
dma_pool_destroy(adp->pthru_dma_pool);
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -1194,10 +1195,10 @@ mraid_mm_teardown_dma_pools(mraid_mmadp_t *adp)
|
||||||
if (pool->handle) {
|
if (pool->handle) {
|
||||||
|
|
||||||
if (pool->vaddr)
|
if (pool->vaddr)
|
||||||
pci_pool_free(pool->handle, pool->vaddr,
|
dma_pool_free(pool->handle, pool->vaddr,
|
||||||
pool->paddr);
|
pool->paddr);
|
||||||
|
|
||||||
pci_pool_destroy(pool->handle);
|
dma_pool_destroy(pool->handle);
|
||||||
pool->handle = NULL;
|
pool->handle = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3862,19 +3862,19 @@ static void megasas_teardown_frame_pool(struct megasas_instance *instance)
|
||||||
cmd = instance->cmd_list[i];
|
cmd = instance->cmd_list[i];
|
||||||
|
|
||||||
if (cmd->frame)
|
if (cmd->frame)
|
||||||
pci_pool_free(instance->frame_dma_pool, cmd->frame,
|
dma_pool_free(instance->frame_dma_pool, cmd->frame,
|
||||||
cmd->frame_phys_addr);
|
cmd->frame_phys_addr);
|
||||||
|
|
||||||
if (cmd->sense)
|
if (cmd->sense)
|
||||||
pci_pool_free(instance->sense_dma_pool, cmd->sense,
|
dma_pool_free(instance->sense_dma_pool, cmd->sense,
|
||||||
cmd->sense_phys_addr);
|
cmd->sense_phys_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now destroy the pool itself
|
* Now destroy the pool itself
|
||||||
*/
|
*/
|
||||||
pci_pool_destroy(instance->frame_dma_pool);
|
dma_pool_destroy(instance->frame_dma_pool);
|
||||||
pci_pool_destroy(instance->sense_dma_pool);
|
dma_pool_destroy(instance->sense_dma_pool);
|
||||||
|
|
||||||
instance->frame_dma_pool = NULL;
|
instance->frame_dma_pool = NULL;
|
||||||
instance->sense_dma_pool = NULL;
|
instance->sense_dma_pool = NULL;
|
||||||
|
@ -3925,22 +3925,23 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
|
||||||
/*
|
/*
|
||||||
* Use DMA pool facility provided by PCI layer
|
* Use DMA pool facility provided by PCI layer
|
||||||
*/
|
*/
|
||||||
instance->frame_dma_pool = pci_pool_create("megasas frame pool",
|
instance->frame_dma_pool = dma_pool_create("megasas frame pool",
|
||||||
instance->pdev, instance->mfi_frame_size,
|
&instance->pdev->dev,
|
||||||
256, 0);
|
instance->mfi_frame_size, 256, 0);
|
||||||
|
|
||||||
if (!instance->frame_dma_pool) {
|
if (!instance->frame_dma_pool) {
|
||||||
dev_printk(KERN_DEBUG, &instance->pdev->dev, "failed to setup frame pool\n");
|
dev_printk(KERN_DEBUG, &instance->pdev->dev, "failed to setup frame pool\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
instance->sense_dma_pool = pci_pool_create("megasas sense pool",
|
instance->sense_dma_pool = dma_pool_create("megasas sense pool",
|
||||||
instance->pdev, 128, 4, 0);
|
&instance->pdev->dev, 128,
|
||||||
|
4, 0);
|
||||||
|
|
||||||
if (!instance->sense_dma_pool) {
|
if (!instance->sense_dma_pool) {
|
||||||
dev_printk(KERN_DEBUG, &instance->pdev->dev, "failed to setup sense pool\n");
|
dev_printk(KERN_DEBUG, &instance->pdev->dev, "failed to setup sense pool\n");
|
||||||
|
|
||||||
pci_pool_destroy(instance->frame_dma_pool);
|
dma_pool_destroy(instance->frame_dma_pool);
|
||||||
instance->frame_dma_pool = NULL;
|
instance->frame_dma_pool = NULL;
|
||||||
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -3955,10 +3956,10 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
|
||||||
|
|
||||||
cmd = instance->cmd_list[i];
|
cmd = instance->cmd_list[i];
|
||||||
|
|
||||||
cmd->frame = pci_pool_alloc(instance->frame_dma_pool,
|
cmd->frame = dma_pool_alloc(instance->frame_dma_pool,
|
||||||
GFP_KERNEL, &cmd->frame_phys_addr);
|
GFP_KERNEL, &cmd->frame_phys_addr);
|
||||||
|
|
||||||
cmd->sense = pci_pool_alloc(instance->sense_dma_pool,
|
cmd->sense = dma_pool_alloc(instance->sense_dma_pool,
|
||||||
GFP_KERNEL, &cmd->sense_phys_addr);
|
GFP_KERNEL, &cmd->sense_phys_addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3966,7 +3967,7 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
|
||||||
* whatever has been allocated
|
* whatever has been allocated
|
||||||
*/
|
*/
|
||||||
if (!cmd->frame || !cmd->sense) {
|
if (!cmd->frame || !cmd->sense) {
|
||||||
dev_printk(KERN_DEBUG, &instance->pdev->dev, "pci_pool_alloc failed\n");
|
dev_printk(KERN_DEBUG, &instance->pdev->dev, "dma_pool_alloc failed\n");
|
||||||
megasas_teardown_frame_pool(instance);
|
megasas_teardown_frame_pool(instance);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,20 +313,20 @@ megasas_free_cmds_fusion(struct megasas_instance *instance)
|
||||||
cmd = fusion->cmd_list[i];
|
cmd = fusion->cmd_list[i];
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
if (cmd->sg_frame)
|
if (cmd->sg_frame)
|
||||||
pci_pool_free(fusion->sg_dma_pool, cmd->sg_frame,
|
dma_pool_free(fusion->sg_dma_pool, cmd->sg_frame,
|
||||||
cmd->sg_frame_phys_addr);
|
cmd->sg_frame_phys_addr);
|
||||||
if (cmd->sense)
|
if (cmd->sense)
|
||||||
pci_pool_free(fusion->sense_dma_pool, cmd->sense,
|
dma_pool_free(fusion->sense_dma_pool, cmd->sense,
|
||||||
cmd->sense_phys_addr);
|
cmd->sense_phys_addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fusion->sg_dma_pool) {
|
if (fusion->sg_dma_pool) {
|
||||||
pci_pool_destroy(fusion->sg_dma_pool);
|
dma_pool_destroy(fusion->sg_dma_pool);
|
||||||
fusion->sg_dma_pool = NULL;
|
fusion->sg_dma_pool = NULL;
|
||||||
}
|
}
|
||||||
if (fusion->sense_dma_pool) {
|
if (fusion->sense_dma_pool) {
|
||||||
pci_pool_destroy(fusion->sense_dma_pool);
|
dma_pool_destroy(fusion->sense_dma_pool);
|
||||||
fusion->sense_dma_pool = NULL;
|
fusion->sense_dma_pool = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,11 +343,11 @@ megasas_free_cmds_fusion(struct megasas_instance *instance)
|
||||||
fusion->request_alloc_sz, fusion->req_frames_desc,
|
fusion->request_alloc_sz, fusion->req_frames_desc,
|
||||||
fusion->req_frames_desc_phys);
|
fusion->req_frames_desc_phys);
|
||||||
if (fusion->io_request_frames)
|
if (fusion->io_request_frames)
|
||||||
pci_pool_free(fusion->io_request_frames_pool,
|
dma_pool_free(fusion->io_request_frames_pool,
|
||||||
fusion->io_request_frames,
|
fusion->io_request_frames,
|
||||||
fusion->io_request_frames_phys);
|
fusion->io_request_frames_phys);
|
||||||
if (fusion->io_request_frames_pool) {
|
if (fusion->io_request_frames_pool) {
|
||||||
pci_pool_destroy(fusion->io_request_frames_pool);
|
dma_pool_destroy(fusion->io_request_frames_pool);
|
||||||
fusion->io_request_frames_pool = NULL;
|
fusion->io_request_frames_pool = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,12 +376,12 @@ static int megasas_create_sg_sense_fusion(struct megasas_instance *instance)
|
||||||
|
|
||||||
|
|
||||||
fusion->sg_dma_pool =
|
fusion->sg_dma_pool =
|
||||||
pci_pool_create("mr_sg", instance->pdev,
|
dma_pool_create("mr_sg", &instance->pdev->dev,
|
||||||
instance->max_chain_frame_sz,
|
instance->max_chain_frame_sz,
|
||||||
MR_DEFAULT_NVME_PAGE_SIZE, 0);
|
MR_DEFAULT_NVME_PAGE_SIZE, 0);
|
||||||
/* SCSI_SENSE_BUFFERSIZE = 96 bytes */
|
/* SCSI_SENSE_BUFFERSIZE = 96 bytes */
|
||||||
fusion->sense_dma_pool =
|
fusion->sense_dma_pool =
|
||||||
pci_pool_create("mr_sense", instance->pdev,
|
dma_pool_create("mr_sense", &instance->pdev->dev,
|
||||||
SCSI_SENSE_BUFFERSIZE, 64, 0);
|
SCSI_SENSE_BUFFERSIZE, 64, 0);
|
||||||
|
|
||||||
if (!fusion->sense_dma_pool || !fusion->sg_dma_pool) {
|
if (!fusion->sense_dma_pool || !fusion->sg_dma_pool) {
|
||||||
|
@ -395,10 +395,10 @@ static int megasas_create_sg_sense_fusion(struct megasas_instance *instance)
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < max_cmd; i++) {
|
for (i = 0; i < max_cmd; i++) {
|
||||||
cmd = fusion->cmd_list[i];
|
cmd = fusion->cmd_list[i];
|
||||||
cmd->sg_frame = pci_pool_alloc(fusion->sg_dma_pool,
|
cmd->sg_frame = dma_pool_alloc(fusion->sg_dma_pool,
|
||||||
GFP_KERNEL, &cmd->sg_frame_phys_addr);
|
GFP_KERNEL, &cmd->sg_frame_phys_addr);
|
||||||
|
|
||||||
cmd->sense = pci_pool_alloc(fusion->sense_dma_pool,
|
cmd->sense = dma_pool_alloc(fusion->sense_dma_pool,
|
||||||
GFP_KERNEL, &cmd->sense_phys_addr);
|
GFP_KERNEL, &cmd->sense_phys_addr);
|
||||||
if (!cmd->sg_frame || !cmd->sense) {
|
if (!cmd->sg_frame || !cmd->sense) {
|
||||||
dev_err(&instance->pdev->dev,
|
dev_err(&instance->pdev->dev,
|
||||||
|
@ -410,7 +410,7 @@ static int megasas_create_sg_sense_fusion(struct megasas_instance *instance)
|
||||||
/* create sense buffer for the raid 1/10 fp */
|
/* create sense buffer for the raid 1/10 fp */
|
||||||
for (i = max_cmd; i < instance->max_mpt_cmds; i++) {
|
for (i = max_cmd; i < instance->max_mpt_cmds; i++) {
|
||||||
cmd = fusion->cmd_list[i];
|
cmd = fusion->cmd_list[i];
|
||||||
cmd->sense = pci_pool_alloc(fusion->sense_dma_pool,
|
cmd->sense = dma_pool_alloc(fusion->sense_dma_pool,
|
||||||
GFP_KERNEL, &cmd->sense_phys_addr);
|
GFP_KERNEL, &cmd->sense_phys_addr);
|
||||||
if (!cmd->sense) {
|
if (!cmd->sense) {
|
||||||
dev_err(&instance->pdev->dev,
|
dev_err(&instance->pdev->dev,
|
||||||
|
@ -479,7 +479,7 @@ megasas_alloc_request_fusion(struct megasas_instance *instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
fusion->io_request_frames_pool =
|
fusion->io_request_frames_pool =
|
||||||
pci_pool_create("mr_ioreq", instance->pdev,
|
dma_pool_create("mr_ioreq", &instance->pdev->dev,
|
||||||
fusion->io_frames_alloc_sz, 16, 0);
|
fusion->io_frames_alloc_sz, 16, 0);
|
||||||
|
|
||||||
if (!fusion->io_request_frames_pool) {
|
if (!fusion->io_request_frames_pool) {
|
||||||
|
@ -489,7 +489,7 @@ megasas_alloc_request_fusion(struct megasas_instance *instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
fusion->io_request_frames =
|
fusion->io_request_frames =
|
||||||
pci_pool_alloc(fusion->io_request_frames_pool,
|
dma_pool_alloc(fusion->io_request_frames_pool,
|
||||||
GFP_KERNEL, &fusion->io_request_frames_phys);
|
GFP_KERNEL, &fusion->io_request_frames_phys);
|
||||||
if (!fusion->io_request_frames) {
|
if (!fusion->io_request_frames) {
|
||||||
dev_err(&instance->pdev->dev,
|
dev_err(&instance->pdev->dev,
|
||||||
|
@ -509,7 +509,7 @@ megasas_alloc_reply_fusion(struct megasas_instance *instance)
|
||||||
|
|
||||||
count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
|
count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
|
||||||
fusion->reply_frames_desc_pool =
|
fusion->reply_frames_desc_pool =
|
||||||
pci_pool_create("mr_reply", instance->pdev,
|
dma_pool_create("mr_reply", &instance->pdev->dev,
|
||||||
fusion->reply_alloc_sz * count, 16, 0);
|
fusion->reply_alloc_sz * count, 16, 0);
|
||||||
|
|
||||||
if (!fusion->reply_frames_desc_pool) {
|
if (!fusion->reply_frames_desc_pool) {
|
||||||
|
@ -519,7 +519,7 @@ megasas_alloc_reply_fusion(struct megasas_instance *instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
fusion->reply_frames_desc[0] =
|
fusion->reply_frames_desc[0] =
|
||||||
pci_pool_alloc(fusion->reply_frames_desc_pool,
|
dma_pool_alloc(fusion->reply_frames_desc_pool,
|
||||||
GFP_KERNEL, &fusion->reply_frames_desc_phys[0]);
|
GFP_KERNEL, &fusion->reply_frames_desc_phys[0]);
|
||||||
if (!fusion->reply_frames_desc[0]) {
|
if (!fusion->reply_frames_desc[0]) {
|
||||||
dev_err(&instance->pdev->dev,
|
dev_err(&instance->pdev->dev,
|
||||||
|
@ -562,8 +562,10 @@ megasas_alloc_rdpq_fusion(struct megasas_instance *instance)
|
||||||
memset(fusion->rdpq_virt, 0,
|
memset(fusion->rdpq_virt, 0,
|
||||||
sizeof(struct MPI2_IOC_INIT_RDPQ_ARRAY_ENTRY) * MAX_MSIX_QUEUES_FUSION);
|
sizeof(struct MPI2_IOC_INIT_RDPQ_ARRAY_ENTRY) * MAX_MSIX_QUEUES_FUSION);
|
||||||
count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
|
count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
|
||||||
fusion->reply_frames_desc_pool = pci_pool_create("mr_rdpq",
|
fusion->reply_frames_desc_pool = dma_pool_create("mr_rdpq",
|
||||||
instance->pdev, fusion->reply_alloc_sz, 16, 0);
|
&instance->pdev->dev,
|
||||||
|
fusion->reply_alloc_sz,
|
||||||
|
16, 0);
|
||||||
|
|
||||||
if (!fusion->reply_frames_desc_pool) {
|
if (!fusion->reply_frames_desc_pool) {
|
||||||
dev_err(&instance->pdev->dev,
|
dev_err(&instance->pdev->dev,
|
||||||
|
@ -573,7 +575,7 @@ megasas_alloc_rdpq_fusion(struct megasas_instance *instance)
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
fusion->reply_frames_desc[i] =
|
fusion->reply_frames_desc[i] =
|
||||||
pci_pool_alloc(fusion->reply_frames_desc_pool,
|
dma_pool_alloc(fusion->reply_frames_desc_pool,
|
||||||
GFP_KERNEL, &fusion->reply_frames_desc_phys[i]);
|
GFP_KERNEL, &fusion->reply_frames_desc_phys[i]);
|
||||||
if (!fusion->reply_frames_desc[i]) {
|
if (!fusion->reply_frames_desc[i]) {
|
||||||
dev_err(&instance->pdev->dev,
|
dev_err(&instance->pdev->dev,
|
||||||
|
@ -601,13 +603,13 @@ megasas_free_rdpq_fusion(struct megasas_instance *instance) {
|
||||||
|
|
||||||
for (i = 0; i < MAX_MSIX_QUEUES_FUSION; i++) {
|
for (i = 0; i < MAX_MSIX_QUEUES_FUSION; i++) {
|
||||||
if (fusion->reply_frames_desc[i])
|
if (fusion->reply_frames_desc[i])
|
||||||
pci_pool_free(fusion->reply_frames_desc_pool,
|
dma_pool_free(fusion->reply_frames_desc_pool,
|
||||||
fusion->reply_frames_desc[i],
|
fusion->reply_frames_desc[i],
|
||||||
fusion->reply_frames_desc_phys[i]);
|
fusion->reply_frames_desc_phys[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fusion->reply_frames_desc_pool)
|
if (fusion->reply_frames_desc_pool)
|
||||||
pci_pool_destroy(fusion->reply_frames_desc_pool);
|
dma_pool_destroy(fusion->reply_frames_desc_pool);
|
||||||
|
|
||||||
if (fusion->rdpq_virt)
|
if (fusion->rdpq_virt)
|
||||||
pci_free_consistent(instance->pdev,
|
pci_free_consistent(instance->pdev,
|
||||||
|
@ -623,12 +625,12 @@ megasas_free_reply_fusion(struct megasas_instance *instance) {
|
||||||
fusion = instance->ctrl_context;
|
fusion = instance->ctrl_context;
|
||||||
|
|
||||||
if (fusion->reply_frames_desc[0])
|
if (fusion->reply_frames_desc[0])
|
||||||
pci_pool_free(fusion->reply_frames_desc_pool,
|
dma_pool_free(fusion->reply_frames_desc_pool,
|
||||||
fusion->reply_frames_desc[0],
|
fusion->reply_frames_desc[0],
|
||||||
fusion->reply_frames_desc_phys[0]);
|
fusion->reply_frames_desc_phys[0]);
|
||||||
|
|
||||||
if (fusion->reply_frames_desc_pool)
|
if (fusion->reply_frames_desc_pool)
|
||||||
pci_pool_destroy(fusion->reply_frames_desc_pool);
|
dma_pool_destroy(fusion->reply_frames_desc_pool);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue