Author: blueswirl Date: 2010-01-16 11:35:58 +0100 (Sat, 16 Jan 2010) New Revision: 666
Modified: trunk/openbios-devel/drivers/esp.c Log: ESP: fix breakage by r667, status getting erased by interrupt register read
Reading the interrupt status register clears also status register, therefore the interrupt status must be read only after reading the status.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/drivers/esp.c =================================================================== --- trunk/openbios-devel/drivers/esp.c 2010-01-16 08:47:39 UTC (rev 665) +++ trunk/openbios-devel/drivers/esp.c 2010-01-16 10:35:58 UTC (rev 666) @@ -101,12 +101,11 @@ esp->ll->regs[ESP_CMD] = ESP_CMD_SELA | ESP_CMD_DMA; // Wait for DMA to complete. Can this fail? while ((esp->espdma.regs->cond_reg & DMA_HNDL_INTR) == 0) /* no-op */; + // Check status + status = esp->ll->regs[ESP_STATUS]; // Clear interrupts to avoid guests seeing spurious interrupts (void)esp->ll->regs[ESP_INTRPT];
- // Check status - status = esp->ll->regs[ESP_STATUS]; - DPRINTF("do_command: id %d, cmd[0] 0x%x, status 0x%x\n", sd->id, esp->buffer[0], status);
// Target didn't want all command data or went to status phase @@ -127,13 +126,11 @@ esp->ll->regs[ESP_CMD] = ESP_CMD_TI | ESP_CMD_DMA; // Wait for DMA to complete while ((esp->espdma.regs->cond_reg & DMA_HNDL_INTR) == 0) /* no-op */; - + // Check status + status = esp->ll->regs[ESP_STATUS]; // Clear interrupts to avoid guests seeing spurious interrupts (void)esp->ll->regs[ESP_INTRPT];
- // Check status - status = esp->ll->regs[ESP_STATUS]; - DPRINTF("do_command_reply: status 0x%x\n", status);
if ((status & ESP_STAT_TCNT) != ESP_STAT_TCNT)