aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 104fd9a63e73..ee3f1050fb5f 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -150,10 +150,10 @@ struct ata_queued_cmd *ata_scsi_qc_new(struct ata_port *ap,
150 qc->scsidone = done; 150 qc->scsidone = done;
151 151
152 if (cmd->use_sg) { 152 if (cmd->use_sg) {
153 qc->sg = (struct scatterlist *) cmd->request_buffer; 153 qc->__sg = (struct scatterlist *) cmd->request_buffer;
154 qc->n_elem = cmd->use_sg; 154 qc->n_elem = cmd->use_sg;
155 } else { 155 } else {
156 qc->sg = &qc->sgent; 156 qc->__sg = &qc->sgent;
157 qc->n_elem = 1; 157 qc->n_elem = 1;
158 } 158 }
159 } else { 159 } else {
@@ -364,6 +364,16 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
364 */ 364 */
365 blk_queue_max_sectors(sdev->request_queue, 2048); 365 blk_queue_max_sectors(sdev->request_queue, 2048);
366 } 366 }
367
368 /*
369 * SATA DMA transfers must be multiples of 4 byte, so
370 * we need to pad ATAPI transfers using an extra sg.
371 * Decrement max hw segments accordingly.
372 */
373 if (dev->class == ATA_DEV_ATAPI) {
374 request_queue_t *q = sdev->request_queue;
375 blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
376 }
367 } 377 }
368 378
369 return 0; /* scsi layer doesn't check return value, sigh */ 379 return 0; /* scsi layer doesn't check return value, sigh */