From efaebcf96405cba8f5b7cbea29a7b8316321a34f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 22 May 2006 16:55:11 +0100 Subject: [PATCH] --- yaml --- r: 29459 b: refs/heads/master c: f79d409fae879d135d1aaca6d83451f2787aec07 h: refs/heads/master i: 29457: 82ba96c7733fb773c78030a98dd0fd990bfe4099 29455: 0b7987da38d6186c5c2d509af345a7b1831c13ff v: v3 --- [refs] | 2 +- trunk/drivers/scsi/libata-scsi.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2ea158c59776..4f5f498d753d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b6079ca409bf88c248992e96510dd6f610f7ed89 +refs/heads/master: f79d409fae879d135d1aaca6d83451f2787aec07 diff --git a/trunk/drivers/scsi/libata-scsi.c b/trunk/drivers/scsi/libata-scsi.c index 2007b4b6e1b4..3ce7c198ff0d 100644 --- a/trunk/drivers/scsi/libata-scsi.c +++ b/trunk/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 */