diff options
author | Mike Miller <mike.miller@hp.com> | 2008-07-04 13:00:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-04 13:40:09 -0400 |
commit | 491539982aa01fa71de93c2a06ac5d890d4cf1e2 (patch) | |
tree | b99f725a5f289ddbaba20a5bbd1505839c39b30d /drivers/block | |
parent | 8deacee4f5a64a79a626479ba5d05e5643467513 (diff) |
cciss: read config to obtain max outstanding commands per controller
This patch changes the way we determine the maximum number of outstanding
commands for each controller.
Most Smart Array controllers can support up to 1024 commands, the notable
exceptions are the E200 and E200i.
The next generation of controllers which were just added support a mode of
operation called Zero Memory Raid (ZMR). In this mode they only support
64 outstanding commands. In Full Function Raid (FFR) mode they support
1024.
We have been setting the queue depth by arbitrarily assigning some value
for each controller. We needed a better way to set the queue depth to
avoid lots of annoying "fifo full" messages. So we made the driver a
little smarter. We now read the config table and subtract 4 from the
returned value. The -4 is to allow some room for ioctl calls which are
not tracked the same way as io commands are tracked.
Please consider this for inclusion.
Signed-off-by: Mike Miller <mike.miller@hp.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/cciss.c | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index f5521051a8dc..d81632cd7d06 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -106,35 +106,34 @@ MODULE_DEVICE_TABLE(pci, cciss_pci_device_id); | |||
106 | /* board_id = Subsystem Device ID & Vendor ID | 106 | /* board_id = Subsystem Device ID & Vendor ID |
107 | * product = Marketing Name for the board | 107 | * product = Marketing Name for the board |
108 | * access = Address of the struct of function pointers | 108 | * access = Address of the struct of function pointers |
109 | * nr_cmds = Number of commands supported by controller | ||
110 | */ | 109 | */ |
111 | static struct board_type products[] = { | 110 | static struct board_type products[] = { |
112 | {0x40700E11, "Smart Array 5300", &SA5_access, 512}, | 111 | {0x40700E11, "Smart Array 5300", &SA5_access}, |
113 | {0x40800E11, "Smart Array 5i", &SA5B_access, 512}, | 112 | {0x40800E11, "Smart Array 5i", &SA5B_access}, |
114 | {0x40820E11, "Smart Array 532", &SA5B_access, 512}, | 113 | {0x40820E11, "Smart Array 532", &SA5B_access}, |
115 | {0x40830E11, "Smart Array 5312", &SA5B_access, 512}, | 114 | {0x40830E11, "Smart Array 5312", &SA5B_access}, |
116 | {0x409A0E11, "Smart Array 641", &SA5_access, 512}, | 115 | {0x409A0E11, "Smart Array 641", &SA5_access}, |
117 | {0x409B0E11, "Smart Array 642", &SA5_access, 512}, | 116 | {0x409B0E11, "Smart Array 642", &SA5_access}, |
118 | {0x409C0E11, "Smart Array 6400", &SA5_access, 512}, | 117 | {0x409C0E11, "Smart Array 6400", &SA5_access}, |
119 | {0x409D0E11, "Smart Array 6400 EM", &SA5_access, 512}, | 118 | {0x409D0E11, "Smart Array 6400 EM", &SA5_access}, |
120 | {0x40910E11, "Smart Array 6i", &SA5_access, 512}, | 119 | {0x40910E11, "Smart Array 6i", &SA5_access}, |
121 | {0x3225103C, "Smart Array P600", &SA5_access, 512}, | 120 | {0x3225103C, "Smart Array P600", &SA5_access}, |
122 | {0x3223103C, "Smart Array P800", &SA5_access, 512}, | 121 | {0x3223103C, "Smart Array P800", &SA5_access}, |
123 | {0x3234103C, "Smart Array P400", &SA5_access, 512}, | 122 | {0x3234103C, "Smart Array P400", &SA5_access}, |
124 | {0x3235103C, "Smart Array P400i", &SA5_access, 512}, | 123 | {0x3235103C, "Smart Array P400i", &SA5_access}, |
125 | {0x3211103C, "Smart Array E200i", &SA5_access, 120}, | 124 | {0x3211103C, "Smart Array E200i", &SA5_access}, |
126 | {0x3212103C, "Smart Array E200", &SA5_access, 120}, | 125 | {0x3212103C, "Smart Array E200", &SA5_access}, |
127 | {0x3213103C, "Smart Array E200i", &SA5_access, 120}, | 126 | {0x3213103C, "Smart Array E200i", &SA5_access}, |
128 | {0x3214103C, "Smart Array E200i", &SA5_access, 120}, | 127 | {0x3214103C, "Smart Array E200i", &SA5_access}, |
129 | {0x3215103C, "Smart Array E200i", &SA5_access, 120}, | 128 | {0x3215103C, "Smart Array E200i", &SA5_access}, |
130 | {0x3237103C, "Smart Array E500", &SA5_access, 512}, | 129 | {0x3237103C, "Smart Array E500", &SA5_access}, |
131 | {0x323D103C, "Smart Array P700m", &SA5_access, 512}, | 130 | {0x323D103C, "Smart Array P700m", &SA5_access}, |
132 | {0x3241103C, "Smart Array P212", &SA5_access, 384}, | 131 | {0x3241103C, "Smart Array P212", &SA5_access}, |
133 | {0x3243103C, "Smart Array P410", &SA5_access, 384}, | 132 | {0x3243103C, "Smart Array P410", &SA5_access}, |
134 | {0x3245103C, "Smart Array P410i", &SA5_access, 384}, | 133 | {0x3245103C, "Smart Array P410i", &SA5_access}, |
135 | {0x3247103C, "Smart Array P411", &SA5_access, 384}, | 134 | {0x3247103C, "Smart Array P411", &SA5_access}, |
136 | {0x3249103C, "Smart Array P812", &SA5_access, 384}, | 135 | {0x3249103C, "Smart Array P812", &SA5_access}, |
137 | {0xFFFF103C, "Unknown Smart Array", &SA5_access, 120}, | 136 | {0xFFFF103C, "Unknown Smart Array", &SA5_access}, |
138 | }; | 137 | }; |
139 | 138 | ||
140 | /* How long to wait (in milliseconds) for board to go into simple mode */ | 139 | /* How long to wait (in milliseconds) for board to go into simple mode */ |
@@ -3086,11 +3085,20 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3086 | print_cfg_table(c->cfgtable); | 3085 | print_cfg_table(c->cfgtable); |
3087 | #endif /* CCISS_DEBUG */ | 3086 | #endif /* CCISS_DEBUG */ |
3088 | 3087 | ||
3088 | /* Some controllers support Zero Memory Raid (ZMR). | ||
3089 | * When configured in ZMR mode the number of supported | ||
3090 | * commands drops to 64. So instead of just setting an | ||
3091 | * arbitrary value we make the driver a little smarter. | ||
3092 | * We read the config table to tell us how many commands | ||
3093 | * are supported on the controller then subtract 4 to | ||
3094 | * leave a little room for ioctl calls. | ||
3095 | */ | ||
3096 | c->max_commands = readl(&(c->cfgtable->CmdsOutMax)); | ||
3089 | for (i = 0; i < ARRAY_SIZE(products); i++) { | 3097 | for (i = 0; i < ARRAY_SIZE(products); i++) { |
3090 | if (board_id == products[i].board_id) { | 3098 | if (board_id == products[i].board_id) { |
3091 | c->product_name = products[i].product_name; | 3099 | c->product_name = products[i].product_name; |
3092 | c->access = *(products[i].access); | 3100 | c->access = *(products[i].access); |
3093 | c->nr_cmds = products[i].nr_cmds; | 3101 | c->nr_cmds = c->max_commands - 4; |
3094 | break; | 3102 | break; |
3095 | } | 3103 | } |
3096 | } | 3104 | } |
@@ -3110,7 +3118,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3110 | if (subsystem_vendor_id == PCI_VENDOR_ID_HP) { | 3118 | if (subsystem_vendor_id == PCI_VENDOR_ID_HP) { |
3111 | c->product_name = products[i-1].product_name; | 3119 | c->product_name = products[i-1].product_name; |
3112 | c->access = *(products[i-1].access); | 3120 | c->access = *(products[i-1].access); |
3113 | c->nr_cmds = products[i-1].nr_cmds; | 3121 | c->nr_cmds = c->max_commands - 4; |
3114 | printk(KERN_WARNING "cciss: This is an unknown " | 3122 | printk(KERN_WARNING "cciss: This is an unknown " |
3115 | "Smart Array controller.\n" | 3123 | "Smart Array controller.\n" |
3116 | "cciss: Please update to the latest driver " | 3124 | "cciss: Please update to the latest driver " |