From f92b235f72be34e66357df72794f2baa0221524d Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Fri, 23 Jun 2006 12:49:52 +0800 Subject: [PATCH] [PATCH] libata: minor patch for ATA_DFLAG_PIO Problem: - With 2.6.17 libata, some PIO-only devices are given DMA commands. Changes: - Do not clear the ATA_DFLAG_PIO flag in ata_dev_configure(). Signed-off-by: Tejun Heo Signed-off-by: Albert Lee Signed-off-by: Chris Wright --- drivers/scsi/libata-core.c | 2 +- include/linux/libata.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index b046ffa22101..6cd197d4474f 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -1229,7 +1229,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, id[84], id[85], id[86], id[87], id[88]); /* initialize to-be-configured parameters */ - dev->flags = 0; + dev->flags &= ~ATA_DFLAG_CFG_MASK; dev->max_sectors = 0; dev->cdb_len = 0; dev->n_sectors = 0; diff --git a/include/linux/libata.h b/include/linux/libata.h index b80d2e7fa6d2..05d3fb33b06f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -120,9 +120,12 @@ enum { ATA_SHT_USE_CLUSTERING = 1, /* struct ata_device stuff */ - ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ - ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ - ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ + ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */ + ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ + + ATA_DFLAG_CFG_MASK = (1 << 8) - 1, + + ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ ATA_DEV_UNKNOWN = 0, /* unknown device */ ATA_DEV_ATA = 1, /* ATA device */ -- 2.39.5