[SCSI] hpsa: fix block fetch table problem.
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 27 May 2010 20:14:39 +0000 (15:14 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 27 Jul 2010 17:01:17 +0000 (12:01 -0500)
commitdef342bd745d88ed73541b9c07cefb13d8c576fd
tree2ed39e2ac30fc7af9529906a2450e96830282844
parentd28ce020fb0ef9254fc9e0bd07f5898c69af9f7d
[SCSI] hpsa: fix block fetch table problem.

We have 32 (MAXSGENTRIES) scatter gather elements embedded
in the command.  With all these, the total command size is
about 576 bytes.  However, the last entry in the block fetch table
is 35.  (the block fetch table contains the number of 16-byte chunks
the firmware needs to fetch for a given number of scatter gather
elements.)  35 * 16 = 560 bytes, which isn't enough.  It needs to be
36. (36 * 16 == 576) or, MAXSGENTRIES + 4.  (plus 4 because there's a
bunch of stuff at the front of the command before the first scatter
gather element that takes up 4 * 16 bytes.)  Without this fix, the
controller may have to perform two DMA operations to fetch the
command since the first one may not get the whole thing.

Signed-off-by: Don Brace <brace@beardog.cce.hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/hpsa.c