aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Cameron <stephenmcameron@gmail.com>2015-01-23 17:42:59 -0500
committerJames Bottomley <JBottomley@Parallels.com>2015-02-02 12:57:39 -0500
commitd54c5c24870ff4d581ce17f09d0c5fcb728c1d02 (patch)
treed4ebdf43365b50dac74bca1331143dd211fd0323 /drivers
parent8947fd10865db321205faa0e4123d165aff0781c (diff)
hpsa: reserve some commands for use by driver
We need to reserve some commands for device rescans, aborts, and the pass through ioctls, etc. so we cannot give them all to the scsi mid layer. This is in preparation for removing cmd_special_alloc and cmd_special_free so that we can stop queuing commands internally in the driver so that we can remove the locks thta protect the queue that we will no longer have. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/hpsa.c7
-rw-r--r--drivers/scsi/hpsa.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index bee24b21c1c4..99c32a0ea15b 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4064,11 +4064,14 @@ static int hpsa_register_scsi(struct ctlr_info *h)
4064 sh->max_cmd_len = MAX_COMMAND_SIZE; 4064 sh->max_cmd_len = MAX_COMMAND_SIZE;
4065 sh->max_lun = HPSA_MAX_LUN; 4065 sh->max_lun = HPSA_MAX_LUN;
4066 sh->max_id = HPSA_MAX_LUN; 4066 sh->max_id = HPSA_MAX_LUN;
4067 sh->can_queue = h->nr_cmds; 4067 sh->can_queue = h->nr_cmds -
4068 HPSA_CMDS_RESERVED_FOR_ABORTS -
4069 HPSA_CMDS_RESERVED_FOR_DRIVER -
4070 HPSA_MAX_CONCURRENT_PASSTHRUS;
4068 if (h->hba_mode_enabled) 4071 if (h->hba_mode_enabled)
4069 sh->cmd_per_lun = 7; 4072 sh->cmd_per_lun = 7;
4070 else 4073 else
4071 sh->cmd_per_lun = h->nr_cmds; 4074 sh->cmd_per_lun = sh->can_queue;
4072 sh->sg_tablesize = h->maxsgentries; 4075 sh->sg_tablesize = h->maxsgentries;
4073 h->scsi_host = sh; 4076 h->scsi_host = sh;
4074 sh->hostdata[0] = (unsigned long) h; 4077 sh->hostdata[0] = (unsigned long) h;
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
index 8e06d9e280ec..5ee6c6a73b0c 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -115,6 +115,8 @@ struct ctlr_info {
115 void __iomem *vaddr; 115 void __iomem *vaddr;
116 unsigned long paddr; 116 unsigned long paddr;
117 int nr_cmds; /* Number of commands allowed on this controller */ 117 int nr_cmds; /* Number of commands allowed on this controller */
118#define HPSA_CMDS_RESERVED_FOR_ABORTS 2
119#define HPSA_CMDS_RESERVED_FOR_DRIVER 1
118 struct CfgTable __iomem *cfgtable; 120 struct CfgTable __iomem *cfgtable;
119 int interrupts_enabled; 121 int interrupts_enabled;
120 int max_commands; 122 int max_commands;