Skip to content

Commit

Permalink
Remove some duplicate IRQ difference handling
Browse files Browse the repository at this point in the history
Signed-off-by: juliab <[email protected]>
  • Loading branch information
midnightveil committed Jul 22, 2024
1 parent d89f36e commit c112164
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/blk/mmc/imx/usdhc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand All @@ -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:
Expand Down

0 comments on commit c112164

Please sign in to comment.