Skip to content

Commit

Permalink
sata_mv: correct S/G table limits
Browse files Browse the repository at this point in the history
The recent mv_fill_sg() rewrite, to fix a data corruption problem
related to IOMMU virtual merging, forgot to account for the
potentially-increased size of the scatter/gather table after its run.

Additionally, the DMA boundary is reduced from 0xffffffff to 0xffff
to more closely match the needs of mv_fill_sg().

Signed-off-by: Jeff Garzik <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jeff Garzik authored and Linus Torvalds committed Oct 9, 2007
1 parent e2a57a8 commit baf14aa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ enum {
#define IS_GEN_IIE(hpriv) ((hpriv)->hp_flags & MV_HP_GEN_IIE)

enum {
MV_DMA_BOUNDARY = 0xffffffffU,
/* DMA boundary 0xffff is required by the s/g splitting
* we need on /length/ in mv_fill-sg().
*/
MV_DMA_BOUNDARY = 0xffffU,

/* mask of register bits containing lower 32 bits
* of EDMA request queue DMA address
Expand Down Expand Up @@ -448,7 +451,7 @@ static struct scsi_host_template mv5_sht = {
.queuecommand = ata_scsi_queuecmd,
.can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID,
.sg_tablesize = MV_MAX_SG_CT,
.sg_tablesize = MV_MAX_SG_CT / 2,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED,
.use_clustering = 1,
Expand All @@ -466,7 +469,7 @@ static struct scsi_host_template mv6_sht = {
.queuecommand = ata_scsi_queuecmd,
.can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID,
.sg_tablesize = MV_MAX_SG_CT,
.sg_tablesize = MV_MAX_SG_CT / 2,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED,
.use_clustering = 1,
Expand Down

0 comments on commit baf14aa

Please sign in to comment.