aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authorYang, Bo <Bo.Yang@lsi.com>2009-10-06 16:40:58 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-10-29 13:03:20 -0400
commit7bebf5c79cb62766c76c6c1b9c77b86496fd363e (patch)
tree2b3fa5e3f17087ab1677ac25ab2e955d5a4b6191 /drivers/scsi/megaraid
parent044833b572b96afe91506a0edec42efd84ba4939 (diff)
[SCSI] megaraid_sas: allocate the application cmds to sas2 controller
MegaRAID SAS2 controller ioctl can't use 32 cmd for applications. Driver need to divide different number of cmds to IO and application. Signed-off-by Bo Yang<bo.yang@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c24
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h1
2 files changed, 22 insertions, 3 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 9967ee72a967..5afd65121725 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -1239,7 +1239,14 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)
1239 1239
1240 spin_lock_irqsave(instance->host->host_lock, flags); 1240 spin_lock_irqsave(instance->host->host_lock, flags);
1241 instance->flag &= ~MEGASAS_FW_BUSY; 1241 instance->flag &= ~MEGASAS_FW_BUSY;
1242 instance->host->can_queue = 1242 if ((instance->pdev->device ==
1243 PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
1244 (instance->pdev->device ==
1245 PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
1246 instance->host->can_queue =
1247 instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS;
1248 } else
1249 instance->host->can_queue =
1243 instance->max_fw_cmds - MEGASAS_INT_CMDS; 1250 instance->max_fw_cmds - MEGASAS_INT_CMDS;
1244 1251
1245 spin_unlock_irqrestore(instance->host->host_lock, flags); 1252 spin_unlock_irqrestore(instance->host->host_lock, flags);
@@ -2774,7 +2781,13 @@ static int megasas_io_attach(struct megasas_instance *instance)
2774 */ 2781 */
2775 host->irq = instance->pdev->irq; 2782 host->irq = instance->pdev->irq;
2776 host->unique_id = instance->unique_id; 2783 host->unique_id = instance->unique_id;
2777 host->can_queue = instance->max_fw_cmds - MEGASAS_INT_CMDS; 2784 if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
2785 (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
2786 host->can_queue =
2787 instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS;
2788 } else
2789 host->can_queue =
2790 instance->max_fw_cmds - MEGASAS_INT_CMDS;
2778 host->this_id = instance->init_id; 2791 host->this_id = instance->init_id;
2779 host->sg_tablesize = instance->max_num_sge; 2792 host->sg_tablesize = instance->max_num_sge;
2780 host->max_sectors = instance->max_sectors_per_req; 2793 host->max_sectors = instance->max_sectors_per_req;
@@ -2909,7 +2922,6 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2909 spin_lock_init(&poll_aen_lock); 2922 spin_lock_init(&poll_aen_lock);
2910 2923
2911 mutex_init(&instance->aen_mutex); 2924 mutex_init(&instance->aen_mutex);
2912 sema_init(&instance->ioctl_sem, MEGASAS_INT_CMDS);
2913 2925
2914 /* 2926 /*
2915 * Initialize PCI related and misc parameters 2927 * Initialize PCI related and misc parameters
@@ -2919,6 +2931,12 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
2919 instance->unique_id = pdev->bus->number << 8 | pdev->devfn; 2931 instance->unique_id = pdev->bus->number << 8 | pdev->devfn;
2920 instance->init_id = MEGASAS_DEFAULT_INIT_ID; 2932 instance->init_id = MEGASAS_DEFAULT_INIT_ID;
2921 2933
2934 if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
2935 (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
2936 sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
2937 } else
2938 sema_init(&instance->ioctl_sem, MEGASAS_INT_CMDS);
2939
2922 megasas_dbg_lvl = 0; 2940 megasas_dbg_lvl = 0;
2923 instance->flag = 0; 2941 instance->flag = 0;
2924 instance->unload = 0; 2942 instance->unload = 0;
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 8ac6b2659c12..4c78cd32e757 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -655,6 +655,7 @@ struct megasas_ctrl_info {
655 * is shown below 655 * is shown below
656 */ 656 */
657#define MEGASAS_INT_CMDS 32 657#define MEGASAS_INT_CMDS 32
658#define MEGASAS_SKINNY_INT_CMDS 5
658 659
659/* 660/*
660 * FW can accept both 32 and 64 bit SGLs. We want to allocate 32/64 bit 661 * FW can accept both 32 and 64 bit SGLs. We want to allocate 32/64 bit