[PATCH 15/20] ide: don't enable local IRQs for PIO-in in driver_cmd_intr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't enable local IRQs for PIO-in protocol in driver_cmd_intr().

While at it:

* Remove redundant rq->cmd_type check.

* Read status register after enabling local IRQs for no-data protocol.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
 drivers/ide/ide-io.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -638,17 +638,18 @@ static ide_startstop_t drive_cmd_intr (i
 {
 	struct request *rq = HWGROUP(drive)->rq;
 	ide_hwif_t *hwif = HWIF(drive);
-	u8 *args = (u8 *) rq->buffer;
-	u8 stat = hwif->INB(IDE_STATUS_REG);
+	u8 *args = (u8 *)rq->buffer, pio_in = (args && args[3]) ? 1 : 0, stat;
 
-	local_irq_enable_in_hardirq();
-	if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
-	    (stat & DRQ_STAT) && args && args[3]) {
+	if (pio_in) {
 		u8 io_32bit = drive->io_32bit;
+		stat = hwif->INB(IDE_STATUS_REG);
 		drive->io_32bit = 0;
 		hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
 		drive->io_32bit = io_32bit;
 		stat = wait_drive_not_busy(drive);
+	} else {
+		local_irq_enable_in_hardirq();
+		stat = hwif->INB(IDE_STATUS_REG);
 	}
 
 	if (!OK_STAT(stat, READY_STAT, BAD_STAT))
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux