ide: add IDE_DFLAG_NIEN_QUIRK device flag

Add IDE_DFLAG_NIEN_QUIRK device flag and use it instead of
drive->quirk_list.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
Bartlomiej Zolnierkiewicz 2009-06-07 15:37:10 +02:00
parent 8bc1e5aa06
commit 734affdcae
5 changed files with 13 additions and 10 deletions

View File

@ -727,7 +727,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
struct pci_dev *dev = to_pci_dev(hwif->dev); struct pci_dev *dev = to_pci_dev(hwif->dev);
struct hpt_info *info = hpt3xx_get_info(hwif->dev); struct hpt_info *info = hpt3xx_get_info(hwif->dev);
if (drive->quirk_list == 0) if ((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) == 0)
return; return;
if (info->chip_type >= HPT370) { if (info->chip_type >= HPT370) {

View File

@ -407,8 +407,9 @@ static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
/* more than enough time */ /* more than enough time */
udelay(10); udelay(10);
/* clear SRST, leave nIEN (unless device is on the quirk list) */ /* clear SRST, leave nIEN (unless device is on the quirk list) */
tp_ops->write_devctl(hwif, (drive->quirk_list == 2 ? 0 : ATA_NIEN) | tp_ops->write_devctl(hwif,
ATA_DEVCTL_OBS); ((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) ? 0 : ATA_NIEN) |
ATA_DEVCTL_OBS);
/* more than enough time */ /* more than enough time */
udelay(10); udelay(10);
hwif->poll_timeout = jiffies + WAIT_WORSTCASE; hwif->poll_timeout = jiffies + WAIT_WORSTCASE;

View File

@ -488,11 +488,15 @@ repeat:
if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) && if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) &&
hwif != prev_port) { hwif != prev_port) {
ide_drive_t *cur_dev =
prev_port ? prev_port->cur_dev : NULL;
/* /*
* set nIEN for previous port, drives in the * set nIEN for previous port, drives in the
* quirk_list may not like intr setups/cleanups * quirk list may not like intr setups/cleanups
*/ */
if (prev_port && prev_port->cur_dev->quirk_list == 0) if (cur_dev &&
(cur_dev->dev_flags & IDE_DFLAG_NIEN_QUIRK) == 0)
prev_port->tp_ops->write_devctl(prev_port, prev_port->tp_ops->write_devctl(prev_port,
ATA_NIEN | ATA_NIEN |
ATA_DEVCTL_OBS); ATA_DEVCTL_OBS);

View File

@ -300,11 +300,9 @@ void ide_check_nien_quirk_list(ide_drive_t *drive)
for (list = nien_quirk_list; *list != NULL; list++) for (list = nien_quirk_list; *list != NULL; list++)
if (strstr(m, *list) != NULL) { if (strstr(m, *list) != NULL) {
drive->quirk_list = 2; drive->dev_flags |= IDE_DFLAG_NIEN_QUIRK;
return; return;
} }
drive->quirk_list = 0;
} }
int ide_driveid_update(ide_drive_t *drive) int ide_driveid_update(ide_drive_t *drive)
@ -389,7 +387,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES); tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES);
if (drive->quirk_list == 2) if (drive->dev_flags & IDE_DFLAG_NIEN_QUIRK)
tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
error = __ide_wait_stat(drive, drive->ready_stat, error = __ide_wait_stat(drive, drive->ready_stat,

View File

@ -499,6 +499,7 @@ enum {
/* write protect */ /* write protect */
IDE_DFLAG_WP = (1 << 29), IDE_DFLAG_WP = (1 << 29),
IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
IDE_DFLAG_NIEN_QUIRK = (1 << 31),
}; };
struct ide_drive_s { struct ide_drive_s {
@ -530,7 +531,6 @@ struct ide_drive_s {
u8 waiting_for_dma; /* dma currently in progress */ u8 waiting_for_dma; /* dma currently in progress */
u8 dma; /* atapi dma flag */ u8 dma; /* atapi dma flag */
u8 quirk_list; /* considered quirky, set for a specific host */
u8 init_speed; /* transfer rate set at boot */ u8 init_speed; /* transfer rate set at boot */
u8 current_speed; /* current transfer rate set */ u8 current_speed; /* current transfer rate set */
u8 desired_speed; /* desired transfer rate set */ u8 desired_speed; /* desired transfer rate set */