mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
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> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@666 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -101,11 +101,10 @@ do_command(esp_private_t *esp, sd_private_t *sd, int cmdlen, int replylen)
|
||||
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 */;
|
||||
// Clear interrupts to avoid guests seeing spurious interrupts
|
||||
(void)esp->ll->regs[ESP_INTRPT];
|
||||
|
||||
// Check status
|
||||
status = esp->ll->regs[ESP_STATUS];
|
||||
// Clear interrupts to avoid guests seeing spurious interrupts
|
||||
(void)esp->ll->regs[ESP_INTRPT];
|
||||
|
||||
DPRINTF("do_command: id %d, cmd[0] 0x%x, status 0x%x\n", sd->id, esp->buffer[0], status);
|
||||
|
||||
@@ -127,12 +126,10 @@ do_command(esp_private_t *esp, sd_private_t *sd, int cmdlen, int replylen)
|
||||
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 */;
|
||||
|
||||
// Clear interrupts to avoid guests seeing spurious interrupts
|
||||
(void)esp->ll->regs[ESP_INTRPT];
|
||||
|
||||
// Check status
|
||||
status = esp->ll->regs[ESP_STATUS];
|
||||
// Clear interrupts to avoid guests seeing spurious interrupts
|
||||
(void)esp->ll->regs[ESP_INTRPT];
|
||||
|
||||
DPRINTF("do_command_reply: status 0x%x\n", status);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user