diff options
author | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2019-03-17 17:01:18 +0100 |
---|---|---|
committer | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2019-03-21 14:30:56 +0000 |
commit | 554f80e97289e58da5f8cd5d6334edd78d1f0461 (patch) | |
tree | e8aee16fb167ebb9198fa42fa4f839aceb7145f0 | |
parent | 8e6d083b0f4cf225cf85597a4b87f60d7cc25a4a (diff) | |
download | illumos-joyent-554f80e97289e58da5f8cd5d6334edd78d1f0461.tar.gz |
OS-7672 recursive mutex enter in ahci
-rw-r--r-- | usr/src/uts/common/io/sata/adapters/ahci/ahci.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr/src/uts/common/io/sata/adapters/ahci/ahci.c b/usr/src/uts/common/io/sata/adapters/ahci/ahci.c index 5365f4d98b..0e4fb433cf 100644 --- a/usr/src/uts/common/io/sata/adapters/ahci/ahci.c +++ b/usr/src/uts/common/io/sata/adapters/ahci/ahci.c @@ -82,6 +82,7 @@ */ #include <sys/note.h> +#include <sys/debug.h> #include <sys/scsi/scsi.h> #include <sys/pci.h> #include <sys/disp.h> @@ -10839,22 +10840,19 @@ static void ahci_em_quiesce(ahci_ctl_t *ahci_ctlp) { ASSERT(ahci_ctlp->ahcictl_em_flags & AHCI_EM_PRESENT); + VERIFY(mutex_owned(&ahci_ctlp->ahcictl_mutex)); - mutex_enter(&ahci_ctlp->ahcictl_mutex); ahci_ctlp->ahcictl_em_flags |= AHCI_EM_QUIESCE; - mutex_exit(&ahci_ctlp->ahcictl_mutex); - ddi_taskq_wait(ahci_ctlp->ahcictl_em_taskq); } static void ahci_em_suspend(ahci_ctl_t *ahci_ctlp) { - ahci_em_quiesce(ahci_ctlp); + VERIFY(mutex_owned(&ahci_ctlp->ahcictl_mutex)); - mutex_enter(&ahci_ctlp->ahcictl_mutex); + ahci_em_quiesce(ahci_ctlp); ahci_ctlp->ahcictl_em_flags &= ~AHCI_EM_READY; - mutex_exit(&ahci_ctlp->ahcictl_mutex); } static void @@ -10875,7 +10873,10 @@ ahci_em_fini(ahci_ctl_t *ahci_ctlp) return; } + mutex_enter(&ahci_ctlp->ahcictl_mutex); ahci_em_quiesce(ahci_ctlp); + mutex_exit(&ahci_ctlp->ahcictl_mutex); + ddi_taskq_destroy(ahci_ctlp->ahcictl_em_taskq); ahci_ctlp->ahcictl_em_taskq = NULL; } |