Skip to content

Commit

Permalink
[PATCH] libata - fix bracketing and DMA oops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Jeff Garzik committed May 24, 2006
1 parent b6079ca commit f79d409
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/scsi/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit f79d409

Please sign in to comment.