aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_sas.c
diff options
context:
space:
mode:
authorSumant Patro <sumantp@lsil.com>2007-02-14 15:55:45 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-02-16 11:20:33 -0500
commit9f35fa8a14e6216a859e2dfbe50ade497f9603ef (patch)
tree96290f23f7f7ae7b51d3b5ccb9ed5bce89df471e /drivers/scsi/megaraid/megaraid_sas.c
parentcf62a0a543fbab15286509d2e04e3dcf5549e966 (diff)
[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 <sumant.patro@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 9c5e4da5a132..4070894ed5f0 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,
2711 * For each user buffer, create a mirror buffer and copy in 2711 * For each user buffer, create a mirror buffer and copy in
2712 */ 2712 */
2713 for (i = 0; i < ioc->sge_count; i++) { 2713 for (i = 0; i < ioc->sge_count; i++) {
2714 kbuff_arr[i] = pci_alloc_consistent(instance->pdev, 2714 kbuff_arr[i] = dma_alloc_coherent(&instance->pdev->dev,
2715 ioc->sgl[i].iov_len, 2715 ioc->sgl[i].iov_len,
2716 &buf_handle); 2716 &buf_handle, GFP_KERNEL);
2717 if (!kbuff_arr[i]) { 2717 if (!kbuff_arr[i]) {
2718 printk(KERN_DEBUG "megasas: Failed to alloc " 2718 printk(KERN_DEBUG "megasas: Failed to alloc "
2719 "kernel SGL buffer for IOCTL \n"); 2719 "kernel SGL buffer for IOCTL \n");
@@ -2740,8 +2740,8 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
2740 } 2740 }
2741 2741
2742 if (ioc->sense_len) { 2742 if (ioc->sense_len) {
2743 sense = pci_alloc_consistent(instance->pdev, ioc->sense_len, 2743 sense = dma_alloc_coherent(&instance->pdev->dev, ioc->sense_len,
2744 &sense_handle); 2744 &sense_handle, GFP_KERNEL);
2745 if (!sense) { 2745 if (!sense) {
2746 error = -ENOMEM; 2746 error = -ENOMEM;
2747 goto out; 2747 goto out;
@@ -2800,12 +2800,12 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
2800 2800
2801 out: 2801 out:
2802 if (sense) { 2802 if (sense) {
2803 pci_free_consistent(instance->pdev, ioc->sense_len, 2803 dma_free_coherent(&instance->pdev->dev, ioc->sense_len,
2804 sense, sense_handle); 2804 sense, sense_handle);
2805 } 2805 }
2806 2806
2807 for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) { 2807 for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) {
2808 pci_free_consistent(instance->pdev, 2808 dma_free_coherent(&instance->pdev->dev,
2809 kern_sge32[i].length, 2809 kern_sge32[i].length,
2810 kbuff_arr[i], kern_sge32[i].phys_addr); 2810 kbuff_arr[i], kern_sge32[i].phys_addr);
2811 } 2811 }