Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9f35fa8a14e6216a859e2dfbe50ade497f9603ef Commit: 9f35fa8a14e6216a859e2dfbe50ade497f9603ef Parent: cf62a0a543fbab15286509d2e04e3dcf5549e966 Author: Sumant Patro <[EMAIL PROTECTED]> AuthorDate: Wed Feb 14 12:55:45 2007 -0800 Committer: James Bottomley <[EMAIL PROTECTED]> CommitDate: Fri Feb 16 10:20:33 2007 -0600
[SCSI] megaraid_sas: replace pci_alloc_consitent with dma_alloc_coherent in ioctl path Replaced pci_alloc_consistent with dma_alloc_coherent from the ioctl path. This is to avoid situations where ioctl fails for lack of memory (when system under heavy stress). Signed-off-by: Sumant Patro <[EMAIL PROTECTED]> Signed-off-by: James Bottomley <[EMAIL PROTECTED]> --- drivers/scsi/megaraid/megaraid_sas.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 9c5e4da..4070894 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c @@ -2711,9 +2711,9 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, * For each user buffer, create a mirror buffer and copy in */ for (i = 0; i < ioc->sge_count; i++) { - kbuff_arr[i] = pci_alloc_consistent(instance->pdev, + kbuff_arr[i] = dma_alloc_coherent(&instance->pdev->dev, ioc->sgl[i].iov_len, - &buf_handle); + &buf_handle, GFP_KERNEL); if (!kbuff_arr[i]) { printk(KERN_DEBUG "megasas: Failed to alloc " "kernel SGL buffer for IOCTL \n"); @@ -2740,8 +2740,8 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, } if (ioc->sense_len) { - sense = pci_alloc_consistent(instance->pdev, ioc->sense_len, - &sense_handle); + sense = dma_alloc_coherent(&instance->pdev->dev, ioc->sense_len, + &sense_handle, GFP_KERNEL); if (!sense) { error = -ENOMEM; goto out; @@ -2800,12 +2800,12 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, out: if (sense) { - pci_free_consistent(instance->pdev, ioc->sense_len, + dma_free_coherent(&instance->pdev->dev, ioc->sense_len, sense, sense_handle); } for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) { - pci_free_consistent(instance->pdev, + dma_free_coherent(&instance->pdev->dev, kern_sge32[i].length, kbuff_arr[i], kern_sge32[i].phys_addr); } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html