aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-06-02 21:55:35 -0400
committerIan Moffett <ian@osmora.org>2024-06-02 22:08:16 -0400
commiteebca89bf99b4cd835df42d8ce36b42220f9c643 (patch)
tree142f16bd7321eadcfd0663b47e924a6a1ddba600 /sys/dev/ic
parent312b5687c905a7614cdd1e5080a69bd12cbc95b4 (diff)
kernel: ahci: Acquire global "io_lock" during cmd
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ahci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c
index e7b2b7e..e140636 100644
--- a/sys/dev/ic/ahci.c
+++ b/sys/dev/ic/ahci.c
@@ -48,6 +48,7 @@ __KERNEL_META("$Hyra$: ahci.c, Ian Marco Moffett, "
static struct pci_device *dev;
static struct timer driver_tmr;
+static struct mutex io_lock;
/*
* Poll register to have `bits' set/unset.
@@ -271,7 +272,7 @@ ahci_submit_cmd(struct ahci_hba *hba, struct hba_port *port, uint8_t cmdslot)
}
/* Activate the command slot */
- mutex_acquire(&hba->lock);
+ mutex_acquire(&io_lock);
mmio_write32(&port->ci, __BIT(cmdslot));
/*
@@ -291,7 +292,7 @@ ahci_submit_cmd(struct ahci_hba *hba, struct hba_port *port, uint8_t cmdslot)
pr_error("IDENTIFY timeout: slot %d still set!\n", cmdslot);
}
- mutex_release(&hba->lock);
+ mutex_release(&io_lock);
return status;
}