From c1121648d9450496874bf2b1bc50cc272f5fef0c Mon Sep 17 00:00:00 2001 From: juliab Date: Mon, 22 Jul 2024 12:27:34 +1000 Subject: [PATCH] Remove some duplicate IRQ difference handling Signed-off-by: juliab --- drivers/blk/mmc/imx/usdhc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/blk/mmc/imx/usdhc.c b/drivers/blk/mmc/imx/usdhc.c index b0b1a6412..e551eb130 100644 --- a/drivers/blk/mmc/imx/usdhc.c +++ b/drivers/blk/mmc/imx/usdhc.c @@ -859,7 +859,7 @@ void setup_blk_queues() LOG_DRIVER("Driver initialisation complete\n"); } -void handle_clients(bool is_irq) +void handle_clients(void) { static blk_request_code_t req_code; static uintptr_t req_offset; @@ -871,11 +871,6 @@ void handle_clients(bool is_irq) // TODO: Handle overflow with this multiplication...? uint32_t block_to_sectors = BLK_TRANSFER_SIZE / SD_BLOCK_SIZE; - if (!is_irq && driver_state.clients != ClientStateIdle) { - /* Only do something with client requests when we're idle */ - return; - } - switch (driver_state.clients) { case ClientStateIdle: err = blk_dequeue_req(&blk_queue, &req_code, &req_offset, &req_block_number, &req_count, &req_id); @@ -938,7 +933,7 @@ void handle_clients(bool is_irq) microkit_notify(USDHC_CLIENT_CHANNEL); driver_state.clients = ClientStateIdle; - return handle_clients(false); + return handle_clients(); } default: @@ -966,7 +961,7 @@ void usdhc_executor(bool is_irq) fallthrough; case ExecutorStateActive: - handle_clients(is_irq); + handle_clients(); // We always stay in the Active state now. break; @@ -979,8 +974,11 @@ void notified(microkit_channel ch) { switch (ch) { case USDHC_IRQ_CHANNEL: + usdhc_executor(true); + break; + case USDHC_CLIENT_CHANNEL: - usdhc_executor(ch == USDHC_IRQ_CHANNEL); + usdhc_executor(false); break; case USDHC_TIMER_CHANNEL: