ide: add IDE_DFLAG_NIEN_QUIRK device flag
PATCH 4/4 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.
Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>
--- drivers/ide/hpt366.c | 2 +- drivers/ide/ide-eh.c | 5 +++-- drivers/ide/ide-io.c | 8 ++++++-- drivers/ide/ide-iops.c | 6 ++---- include/linux/ide.h | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-)
drivers/ide/hpt366.c +1 -1
@@ -727,7 +727,7 @@ static void hpt3xx_maskproc(ide_drive_tstruct pci_dev *dev =to_pci_dev (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 ;if (info->chip_type >=HPT370 ) {
drivers/ide/ide-eh.c +3 -2
@@ -408,8 +408,9 @@ static ide_startstop_t do_reset1(ide_dri/* more than enough time */ udelay (10 );/* clear SRST, leave nIEN (unless device is on the quirk list) */ - tp_ops->write_devctl (hwif, (drive->quirk_list ==2 ?0 :ATA_NIEN ) | -ATA_DEVCTL_OBS ); + tp_ops->write_devctl (hwif, + ((drive->dev_flags &IDE_DFLAG_NIEN_QUIRK ) ?0 :ATA_NIEN ) | +ATA_DEVCTL_OBS );/* more than enough time */ udelay (10 ); hwif->poll_timeout = jiffies +WAIT_WORSTCASE ;
drivers/ide/ide-io.c +6 -2
@@ -503,11 +503,15 @@ repeat:if ((hwif->host->host_flags &IDE_HFLAG_SERIALIZE ) && hwif != prev_port) { +ide_drive_t *cur_dev = + prev_port ? prev_port->cur_dev :NULL ; +/* * 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,ATA_NIEN |ATA_DEVCTL_OBS );
drivers/ide/ide-iops.c +2 -4
@@ -287,11 +287,9 @@ void ide_check_nien_quirk_list(ide_drivefor (list = nien_quirk_list; *list !=NULL ; list++)if (strstr (m, *list) !=NULL ) { - drive->quirk_list =2 ; + drive->dev_flags |=IDE_DFLAG_NIEN_QUIRK ;return ; } - - drive->quirk_list =0 ; }int ide_driveid_update (ide_drive_t *drive)
@@ -377,7 +375,7 @@ int ide_config_drive_speed(ide_drive_t * 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 ); error = __ide_wait_stat(drive, drive->ready_stat,
include/linux/ide.h +1 -1
@@ -474,6 +474,7 @@ enum {IDE_DFLAG_NICE1 = (1 <<5 ),/* device is physically present */ IDE_DFLAG_PRESENT = (1 <<6 ), +IDE_DFLAG_NIEN_QUIRK = (1 <<7 ),/* id read from device (synthetic if not set) */ IDE_DFLAG_ID_READ = (1 <<8 ), IDE_DFLAG_NOPROBE = (1 << 9),
@@ -543,7 +544,6 @@ struct ide_drive_s {u8 waiting_for_dma;/* dma currently in progress */ u8 dma;/* atapi dma flag */ -u8 quirk_list;/* considered quirky, set for a specific host */ u8 init_speed;/* transfer rate set at boot */ u8 current_speed;/* current transfer rate set */ u8 desired_speed;/* desired transfer rate set */
Hello.
Quoted 6 lines · Bartlomiej Zolnierkiewicz
Add
IDE_DFLAG_NIEN_QUIRKdevice flag and use it instead ofdrive->quirk_list.There should be no functional changes caused by this patch.
Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>
Acked-by Sergei Shtylyov <[email protected]>
MBR, Sergei