summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-05-22 16:55:11 +0100
committerJeff Garzik <jeff@garzik.org>2006-05-24 01:53:00 -0400
commitf79d409fae879d135d1aaca6d83451f2787aec07 (patch)
treeee96566a7472e6953bb1b7993414063b9c9f6f24 /drivers/scsi/libata-scsi.c
parentb6079ca409bf88c248992e96510dd6f610f7ed89 (diff)
downloadop-kernel-dev-f79d409fae879d135d1aaca6d83451f2787aec07.zip
op-kernel-dev-f79d409fae879d135d1aaca6d83451f2787aec07.tar.gz
[PATCH] libata - fix bracketing and DMA oops
The upstream tree has the ATA_DFLAG_PIO bug fixed but does not have the pass throuugh bug fix Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 2007b4b..3ce7c19 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -1921,7 +1921,7 @@ unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf,
return 0;
dpofua = 0;
- if (ata_dev_supports_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 &&
+ if (ata_dev_supports_fua(args->id) && (dev->flags & ATA_DFLAG_LBA48) &&
(!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count))
dpofua = 1 << 4;
@@ -2408,9 +2408,14 @@ ata_scsi_pass_thru(struct ata_queued_cmd *qc, const u8 *scsicmd)
{
struct ata_taskfile *tf = &(qc->tf);
struct scsi_cmnd *cmd = qc->scsicmd;
+ struct ata_device *dev = qc->dev;
if ((tf->protocol = ata_scsi_map_proto(scsicmd[1])) == ATA_PROT_UNKNOWN)
goto invalid_fld;
+
+ /* We may not issue DMA commands if no DMA mode is set */
+ if (tf->protocol == ATA_PROT_DMA && dev->dma_mode == 0)
+ goto invalid_fld;
if (scsicmd[1] & 0xe0)
/* PIO multi not supported yet */
OpenPOWER on IntegriCloud