summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/amdiic.c5
-rw-r--r--sys/dev/pci/amdpm.c5
-rw-r--r--sys/dev/pci/arc.c15
-rw-r--r--sys/dev/pci/cz.c4
-rw-r--r--sys/dev/pci/ichiic.c5
-rw-r--r--sys/dev/pci/if_bwfm_pci.c4
-rw-r--r--sys/dev/pci/if_tht.c4
-rw-r--r--sys/dev/pci/piixpm.c5
-rw-r--r--sys/dev/pci/viapm.c5
9 files changed, 30 insertions, 22 deletions
diff --git a/sys/dev/pci/amdiic.c b/sys/dev/pci/amdiic.c
index fa3b31646ab..612e20cee76 100644
--- a/sys/dev/pci/amdiic.c
+++ b/sys/dev/pci/amdiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdiic.c,v 1.11 2013/10/01 20:06:00 sf Exp $ */
+/* $OpenBSD: amdiic.c,v 1.12 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -348,7 +348,8 @@ amdiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
amdiic_intr(sc);
} else {
/* Wait for interrupt */
- if (tsleep(sc, PRIBIO, "amdiic", AMDIIC_TIMEOUT * hz))
+ if (tsleep_nsec(sc, PRIBIO, "amdiic",
+ SEC_TO_NSEC(AMDIIC_TIMEOUT)))
return (1);
}
diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c
index 7a0cff54547..3abe03de722 100644
--- a/sys/dev/pci/amdpm.c
+++ b/sys/dev/pci/amdpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdpm.c,v 1.33 2018/04/28 15:44:59 jasper Exp $ */
+/* $OpenBSD: amdpm.c,v 1.34 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -485,7 +485,8 @@ amdpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
amdpm_intr(sc);
} else {
/* Wait for interrupt */
- if (tsleep(sc, PRIBIO, "amdpm", AMDPM_SMBUS_TIMEOUT * hz))
+ if (tsleep_nsec(sc, PRIBIO, "amdpm",
+ SEC_TO_NSEC(AMDPM_SMBUS_TIMEOUT)))
goto timeout;
}
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index d88304eebc1..f5ad53b7a38 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.107 2015/09/10 18:10:33 deraadt Exp $ */
+/* $OpenBSD: arc.c,v 1.108 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -2571,7 +2571,7 @@ arc_unlock(struct arc_softc *sc)
void
arc_wait(struct arc_softc *sc)
{
- int s;
+ int error, s;
u_int32_t int_mask;
s = splbio();
@@ -2579,7 +2579,8 @@ arc_wait(struct arc_softc *sc)
case ARC_HBA_TYPE_A:
int_mask = arc_read(sc, ARC_RA_INTRMASK) & ~ARC_RA_INTRMASK_DOORBELL;
arc_write(sc, ARC_RA_INTRMASK, int_mask);
- if (tsleep(sc, PWAIT, "arcdb", hz) == EWOULDBLOCK) {
+ error = tsleep_nsec(sc, PWAIT, "arcdb", SEC_TO_NSEC(1));
+ if (error == EWOULDBLOCK) {
int_mask = arc_read(sc, ARC_RA_INTRMASK) | ARC_RA_INTRMASK_DOORBELL;
arc_write(sc, ARC_RA_INTRMASK, int_mask);
}
@@ -2587,7 +2588,8 @@ arc_wait(struct arc_softc *sc)
case ARC_HBA_TYPE_C:
int_mask = arc_read(sc, ARC_RC_INTR_MASK) & ~ARC_RC_INTR_MASK_DOORBELL;
arc_write(sc, ARC_RC_INTR_MASK, int_mask);
- if (tsleep(sc, PWAIT, "arcdb", hz) == EWOULDBLOCK) {
+ error = tsleep_nsec(sc, PWAIT, "arcdb", SEC_TO_NSEC(1));
+ if (error == EWOULDBLOCK) {
int_mask = arc_read(sc, ARC_RC_INTR_MASK) | ARC_RC_INTR_MASK_DOORBELL;
arc_write(sc, ARC_RC_INTR_MASK, int_mask);
}
@@ -2595,7 +2597,8 @@ arc_wait(struct arc_softc *sc)
case ARC_HBA_TYPE_D:
int_mask = arc_read(sc, ARC_RD_INTR_ENABLE) | ARC_RD_INTR_ENABLE_DOORBELL;
arc_write(sc, ARC_RD_INTR_ENABLE, int_mask);
- if (tsleep(sc, PWAIT, "arcdb", hz) == EWOULDBLOCK) {
+ error = tsleep_nsec(sc, PWAIT, "arcdb", SEC_TO_NSEC(1));
+ if (error == EWOULDBLOCK) {
int_mask = arc_read(sc, ARC_RD_INTR_ENABLE) & ~ARC_RD_INTR_ENABLE_DOORBELL;
arc_write(sc, ARC_RD_INTR_ENABLE, int_mask);
}
@@ -2621,7 +2624,7 @@ arc_create_sensors(void *xat)
* XXX * this is bollocks. the firmware has garbage coming out of it
* so we have to wait a bit for it to finish spewing.
*/
- tsleep(sc, PWAIT, "arcspew", 2 * hz);
+ tsleep_nsec(sc, PWAIT, "arcspew", SEC_TO_NSEC(2));
bzero(&bi, sizeof(bi));
if (arc_bio_inq(sc, &bi) != 0) {
diff --git a/sys/dev/pci/cz.c b/sys/dev/pci/cz.c
index a9fb72c8c71..54945003eee 100644
--- a/sys/dev/pci/cz.c
+++ b/sys/dev/pci/cz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cz.c,v 1.21 2018/02/19 08:59:52 mpi Exp $ */
+/* $OpenBSD: cz.c,v 1.22 2020/01/09 14:35:19 mpi Exp $ */
/* $NetBSD: cz.c,v 1.15 2001/01/20 19:10:36 thorpej Exp $ */
/*-
@@ -921,7 +921,7 @@ cztty_shutdown(struct cztty_softc *sc)
*/
if (ISSET(tp->t_cflag, HUPCL)) {
cztty_modem(sc, 0);
- (void) tsleep(tp, TTIPRI, ttclos, hz);
+ tsleep_nsec(tp, TTIPRI, ttclos, SEC_TO_NSEC(1));
}
/* Disable the channel. */
diff --git a/sys/dev/pci/ichiic.c b/sys/dev/pci/ichiic.c
index 2be25f6cf2e..c42944e5463 100644
--- a/sys/dev/pci/ichiic.c
+++ b/sys/dev/pci/ichiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ichiic.c,v 1.42 2019/05/08 15:20:05 jsg Exp $ */
+/* $OpenBSD: ichiic.c,v 1.43 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -311,7 +311,8 @@ ichiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
ichiic_intr(sc);
} else {
/* Wait for interrupt */
- if (tsleep(sc, PRIBIO, "ichiic", ICHIIC_TIMEOUT * hz))
+ if (tsleep_nsec(sc, PRIBIO, "ichiic",
+ SEC_TO_NSEC(ICHIIC_TIMEOUT)))
goto timeout;
}
diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c
index d3ef993b28a..16fc305957a 100644
--- a/sys/dev/pci/if_bwfm_pci.c
+++ b/sys/dev/pci/if_bwfm_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bwfm_pci.c,v 1.29 2019/02/07 07:39:56 patrick Exp $ */
+/* $OpenBSD: if_bwfm_pci.c,v 1.30 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -1971,7 +1971,7 @@ bwfm_pci_msgbuf_query_dcmd(struct bwfm_softc *bwfm, int ifidx,
bwfm_pci_ring_write_commit(sc, &sc->sc_ctrl_submit);
- tsleep(ctl, PWAIT, "bwfm", hz);
+ tsleep_nsec(ctl, PWAIT, "bwfm", SEC_TO_NSEC(1));
TAILQ_REMOVE(&sc->sc_ioctlq, ctl, next);
if (ctl->m == NULL) {
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c
index 001c6353389..a562222fcb8 100644
--- a/sys/dev/pci/if_tht.c
+++ b/sys/dev/pci/if_tht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tht.c,v 1.140 2017/01/22 10:17:38 dlg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.141 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -1066,7 +1066,7 @@ tht_down(struct tht_softc *sc)
while (tht_fifo_writable(sc, &sc->sc_txt) < sc->sc_txt.tf_len &&
tht_fifo_readable(sc, &sc->sc_txf) > 0)
- tsleep(sc, 0, "thtdown", hz);
+ tsleep_nsec(sc, 0, "thtdown", SEC_TO_NSEC(1));
sc->sc_imr = THT_IMR_DOWN(sc->sc_port);
tht_write(sc, THT_REG_IMR, sc->sc_imr);
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index 170e7115d0d..e6f4ec3abeb 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixpm.c,v 1.40 2019/12/16 21:39:40 claudio Exp $ */
+/* $OpenBSD: piixpm.c,v 1.41 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -421,7 +421,8 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
piixpm_intr(sc);
} else {
/* Wait for interrupt */
- if (tsleep(sc, PRIBIO, "piixpm", PIIXPM_TIMEOUT * hz))
+ if (tsleep_nsec(sc, PRIBIO, "piixpm",
+ SEC_TO_NSEC(PIIXPM_TIMEOUT)))
goto timeout;
}
diff --git a/sys/dev/pci/viapm.c b/sys/dev/pci/viapm.c
index 3a698512888..db806eedf80 100644
--- a/sys/dev/pci/viapm.c
+++ b/sys/dev/pci/viapm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: viapm.c,v 1.17 2018/07/05 10:09:11 fcambus Exp $ */
+/* $OpenBSD: viapm.c,v 1.18 2020/01/09 14:35:19 mpi Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis <kettenis@openbsd.org>
@@ -602,7 +602,8 @@ viapm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
viapm_intr(sc);
} else {
/* Wait for interrupt */
- if (tsleep(sc, PRIBIO, "iicexec", VIAPM_SMBUS_TIMEOUT * hz))
+ if (tsleep_nsec(sc, PRIBIO, "iicexec",
+ SEC_TO_NSEC(VIAPM_SMBUS_TIMEOUT)))
goto timeout;
}