Skip to content

Commit 734affd

Browse files
committed
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>
1 parent 8bc1e5a commit 734affd

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎drivers/ide/hpt366.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
727727
struct pci_dev *dev = to_pci_dev(hwif->dev);
728728
struct hpt_info *info = hpt3xx_get_info(hwif->dev);
729729

730-
if (drive->quirk_list == 0)
730+
if ((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) == 0)
731731
return;
732732

733733
if (info->chip_type >= HPT370) {

‎drivers/ide/ide-eh.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
407407
/* more than enough time */
408408
udelay(10);
409409
/* clear SRST, leave nIEN (unless device is on the quirk list) */
410-
tp_ops->write_devctl(hwif, (drive->quirk_list == 2 ? 0 : ATA_NIEN) |
411-
ATA_DEVCTL_OBS);
410+
tp_ops->write_devctl(hwif,
411+
((drive->dev_flags & IDE_DFLAG_NIEN_QUIRK) ? 0 : ATA_NIEN) |
412+
ATA_DEVCTL_OBS);
412413
/* more than enough time */
413414
udelay(10);
414415
hwif->poll_timeout = jiffies + WAIT_WORSTCASE;

‎drivers/ide/ide-io.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,15 @@ void do_ide_request(struct request_queue *q)
488488

489489
if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) &&
490490
hwif != prev_port) {
491+
ide_drive_t *cur_dev =
492+
prev_port ? prev_port->cur_dev : NULL;
493+
491494
/*
492495
* set nIEN for previous port, drives in the
493-
* quirk_list may not like intr setups/cleanups
496+
* quirk list may not like intr setups/cleanups
494497
*/
495-
if (prev_port && prev_port->cur_dev->quirk_list == 0)
498+
if (cur_dev &&
499+
(cur_dev->dev_flags & IDE_DFLAG_NIEN_QUIRK) == 0)
496500
prev_port->tp_ops->write_devctl(prev_port,
497501
ATA_NIEN |
498502
ATA_DEVCTL_OBS);

‎drivers/ide/ide-iops.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,9 @@ void ide_check_nien_quirk_list(ide_drive_t *drive)
300300

301301
for (list = nien_quirk_list; *list != NULL; list++)
302302
if (strstr(m, *list) != NULL) {
303-
drive->quirk_list = 2;
303+
drive->dev_flags |= IDE_DFLAG_NIEN_QUIRK;
304304
return;
305305
}
306-
307-
drive->quirk_list = 0;
308306
}
309307

310308
int ide_driveid_update(ide_drive_t *drive)
@@ -389,7 +387,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
389387

390388
tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES);
391389

392-
if (drive->quirk_list == 2)
390+
if (drive->dev_flags & IDE_DFLAG_NIEN_QUIRK)
393391
tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
394392

395393
error = __ide_wait_stat(drive, drive->ready_stat,

‎include/linux/ide.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ enum {
499499
/* write protect */
500500
IDE_DFLAG_WP = (1 << 29),
501501
IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
502+
IDE_DFLAG_NIEN_QUIRK = (1 << 31),
502503
};
503504

504505
struct ide_drive_s {
@@ -530,7 +531,6 @@ struct ide_drive_s {
530531
u8 waiting_for_dma; /* dma currently in progress */
531532
u8 dma; /* atapi dma flag */
532533

533-
u8 quirk_list; /* considered quirky, set for a specific host */
534534
u8 init_speed; /* transfer rate set at boot */
535535
u8 current_speed; /* current transfer rate set */
536536
u8 desired_speed; /* desired transfer rate set */

0 commit comments

Comments
 (0)