]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line...
authorsreekanth.reddy@lsi.com <sreekanth.reddy@lsi.com>
Tue, 17 Jul 2012 10:27:05 +0000 (15:57 +0530)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 27 Aug 2012 14:09:29 +0000 (07:09 -0700)
commitd0cfe5214050aa1b4348aba1ae97aa8a816ba198
tree4c4e88c7696c72afe82547d08ca31fc13855fc29
parent52bb84a5741c81a658e4b78e9d1378904d23f123
mpt2sas: Fix for Driver oops, when loading driver with max_queue_depth command line option to a very small value

If the specified max_queue_depth setting is less than the
expected number of internal commands, then driver will calculate
the queue depth size to a negitive number. This negitive number
is actually a very large number because variable is unsigned
16bit integer. So, the driver will ask for a very large amount of
memory for message frames and resulting into oops as memory
allocation routines will not able to handle such a large request.

So, in order to limit this kind of oops, The driver need to set
the max_queue_depth to a scsi mid layer's can_queue value. Then
the overall message frames required for IO is minimum of either
(max_queue_depth plus internal commands) or the IOC global
credits.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@lsi.com>
Cc: <stable@kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mpt2sas/mpt2sas_base.c