Skip to contentSkip to conversation

ide-cd: fix register loading order in cdrom_start_packet_command()

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 3 messages Oct 30, 2007 – Nov 9, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 8/15 ide-cd: fix register loading order in cdrom_start_packet_command()

Load IDE_CONTROL_REG before other registers in cdrom_start_packet_command().

It shouldn't affect anything (just a usual paranoia to separate changes which change the way in which hardware is accessed from code cleanups).

While at it move misplaced FIXME comment in the right place.

---
 drivers/ide/ide-cd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ide/ide-cd.c +3 -3
Index: b/drivers/ide/ide-cd.c
===================================================================
@@ -917,19 +917,19 @@ static ide_startstop_t cdrom_start_packe
 	if (ide_wait_stat(&startstop, drive, 0, BUSY_STAT, WAIT_READY))
 		return startstop;
 
+	/* FIXME: for Virtual DMA we must check harder */
 	if (info->dma)
 		info->dma = !hwif->dma_setup(drive);
 
 	/* Set up the controller registers. */
-	/* FIXME: for Virtual DMA we must check harder */
+	if (IDE_CONTROL_REG)
+		HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
 	HWIF(drive)->OUTB(info->dma, IDE_FEATURE_REG);
 	HWIF(drive)->OUTB(0, IDE_IREASON_REG);
 	HWIF(drive)->OUTB(0, IDE_SECTOR_REG);
 
 	HWIF(drive)->OUTB(xferlen & 0xff, IDE_BCOUNTL_REG);
 	HWIF(drive)->OUTB(xferlen >> 8  , IDE_BCOUNTH_REG);
-	if (IDE_CONTROL_REG)
-		HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
  
 	if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) {
 		/* waiting for CDB interrupt, not DMA yet. */
Acked-by on v1 8/15
#1 lore raw
Quoted 8 lines · Bartlomiej Zolnierkiewicz

Load IDE_CONTROL_REG before other registers in cdrom_start_packet_command().

It shouldn't affect anything (just a usual paranoia to separate changes which change the way in which hardware is accessed from code cleanups).

While at it move misplaced FIXME comment in the right place.

MBR, Sergei

Acked-by on v1 8/15
#2 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 8 lines · Bartlomiej Zolnierkiewicz

Load IDE_CONTROL_REG before other registers in cdrom_start_packet_command().

It shouldn't affect anything (just a usual paranoia to separate changes which change the way in which hardware is accessed from code cleanups).

While at it move misplaced FIXME comment in the right place.

MBR, Sergei