From 8b858379e2f557358634f5e96ab4d18b3b488b88 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 20 Feb 2022 10:17:09 +0100 Subject: [PATCH] sdhci: do the wait for interrupts the straightforward way again In a previous commit I flipped this around because the command interrupt doesn't always trigger on Ricoh controllers. However, this leads to command execution continuing before the interrupt actually triggers on some other controllers. Might solve #17031 but it could also break things on other hardware. Change-Id: I96cba90358f0b04ef1ac319aead898c0f4155114 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4985 Tested-by: Commit checker robot Reviewed-by: Fredrik Holmqvist --- src/add-ons/kernel/busses/mmc/sdhci_pci.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/busses/mmc/sdhci_pci.cpp b/src/add-ons/kernel/busses/mmc/sdhci_pci.cpp index b770111b3b..437e4ff216 100644 --- a/src/add-ons/kernel/busses/mmc/sdhci_pci.cpp +++ b/src/add-ons/kernel/busses/mmc/sdhci_pci.cpp @@ -259,13 +259,13 @@ SdhciBus::ExecuteCommand(uint8_t command, uint32_t argument, uint32_t* response) // Wait for command response to be available ("command complete" interrupt) TRACE("Wait for command complete..."); - while (fCommandResult == 0) { + do { acquire_sem(fSemaphore); TRACE("command complete sem acquired, status: %x\n", fCommandResult); TRACE("real status = %x command line busy: %d\n", fRegisters->interrupt_status, fRegisters->present_state.CommandInhibit()); - } + } while (fCommandResult == 0); TRACE("Command response available\n");