From 77149420e662d1103e4459d7809dc0ffa223c9a5 Mon Sep 17 00:00:00 2001 From: purplerain Date: Sun, 10 Mar 2024 20:44:41 +0000 Subject: [PATCH] sync with OpenBSD -current --- sys/arch/armv7/stand/efiboot/conf.c | 4 +-- sys/arch/armv7/stand/efiboot/exec.c | 46 ++--------------------------- sys/conf/GENERIC | 4 +-- sys/dev/ic/qwx.c | 22 ++++++++++---- 4 files changed, 23 insertions(+), 53 deletions(-) diff --git a/sys/arch/armv7/stand/efiboot/conf.c b/sys/arch/armv7/stand/efiboot/conf.c index e7ffa3d7a..de536fb96 100644 --- a/sys/arch/armv7/stand/efiboot/conf.c +++ b/sys/arch/armv7/stand/efiboot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.34 2024/03/03 17:00:14 kettenis Exp $ */ +/* $OpenBSD: conf.c,v 1.35 2024/03/10 15:37:54 kettenis Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -42,7 +42,7 @@ #include "efidev.h" #include "efipxe.h" -const char version[] = "1.21"; +const char version[] = "1.22"; int debug = 0; struct fs_ops file_system[] = { diff --git a/sys/arch/armv7/stand/efiboot/exec.c b/sys/arch/armv7/stand/efiboot/exec.c index 4cd1f89be..9ea1eac51 100644 --- a/sys/arch/armv7/stand/efiboot/exec.c +++ b/sys/arch/armv7/stand/efiboot/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.17 2024/03/03 17:00:14 kettenis Exp $ */ +/* $OpenBSD: exec.c,v 1.18 2024/03/10 15:37:54 kettenis Exp $ */ /* * Copyright (c) 2006, 2016 Mark Kettenis @@ -86,47 +86,6 @@ dcache_wbinv_all(void) __asm volatile("dsb"); } -void -dcache_inv_all(void) -{ - uint32_t clidr; - uint32_t ccsidr; - uint32_t val; - int nways, nsets; - int wshift, sshift; - int way, set; - int level; - - __asm volatile("mrc p15, 1, %0, c0, c0, 1" : "=r"(clidr)); - for (level = 0; level < CLIDR_LOC(clidr); level++) { - if (CLIDR_CTYPE(clidr, level) == CLIDR_CTYPE_NOCACHE) - break; - if (CLIDR_CTYPE(clidr, level) == CLIDR_CTYPE_ICACHE) - continue; - - __asm volatile("mcr p15, 2, %0, c0, c0, 0" :: "r"(level << 1)); - __asm volatile("isb"); - __asm volatile("mrc p15, 1, %0, c0, c0, 0" : "=r"(ccsidr)); - - nways = CCSIDR_ASSOCIATIVITY(ccsidr) + 1; - nsets = CCSIDR_NUMSETS(ccsidr) + 1; - - sshift = CCSIDR_LINESZ(ccsidr) + 4; - wshift = __builtin_clz(CCSIDR_ASSOCIATIVITY(ccsidr)); - - for (way = 0; way < nways; way++) { - for (set = 0; set < nsets; set++) { - val = (way << wshift) | (set << sshift) | - (level << 1); - __asm volatile("mcr p15, 0, %0, c7, c6, 2" - :: "r"(val)); - } - } - } - - __asm volatile("dsb"); -} - void icache_inv_all(void) { @@ -225,9 +184,8 @@ run_loadfile(uint64_t *marks, int howto) dcache_wbinv_all(); dcache_disable(); - dcache_inv_all(); - icache_disable(); icache_inv_all(); + icache_disable(); mmu_disable(); (*(startfuncp)(marks[MARK_ENTRY]))((void *)esym, NULL, fdt); diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC index c2575622a..ac7ab88e7 100644 --- a/sys/conf/GENERIC +++ b/sys/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.293 2024/01/02 16:40:03 bluhm Exp $ +# $OpenBSD: GENERIC,v 1.294 2024/03/10 13:25:10 jsg Exp $ # # Machine-independent option; used by all architectures for their # GENERIC kernel @@ -16,7 +16,7 @@ option KMEMSTATS # collect malloc(9) statistics option PTRACE # ptrace(2) system call #option KVA_GUARDPAGES # slow virtual address recycling (+ guarding) -option POOL_DEBUG # pool corruption detection +#option POOL_DEBUG # pool corruption detection #option VFSLCKDEBUG # VFS locking checks option CRYPTO # Cryptographic framework diff --git a/sys/dev/ic/qwx.c b/sys/dev/ic/qwx.c index bd7aff150..3f38f408b 100644 --- a/sys/dev/ic/qwx.c +++ b/sys/dev/ic/qwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qwx.c,v 1.57 2024/03/02 15:18:57 stsp Exp $ */ +/* $OpenBSD: qwx.c,v 1.58 2024/03/09 23:29:53 stsp Exp $ */ /* * Copyright 2023 Stefan Sperling @@ -12870,11 +12870,16 @@ qwx_wmi_process_mgmt_tx_comp(struct qwx_softc *sc, if (arvif->txmgmt.queued > 0) arvif->txmgmt.queued--; - if (arvif->txmgmt.queued < nitems(arvif->txmgmt.data) - 1) - sc->qfullmsk &= ~(1U << QWX_MGMT_QUEUE_ID); - if (tx_compl_param->status != 0) ifp->if_oerrors++; + + if (arvif->txmgmt.queued < nitems(arvif->txmgmt.data) - 1) { + sc->qfullmsk &= ~(1U << QWX_MGMT_QUEUE_ID); + if (sc->qfullmsk == 0 && ifq_is_oactive(&ifp->if_snd)) { + ifq_clr_oactive(&ifp->if_snd); + (*ifp->if_start)(ifp); + } + } } void @@ -15159,6 +15164,8 @@ qwx_dp_tx_complete_msdu(struct qwx_softc *sc, struct dp_tx_ring *tx_ring, int qwx_dp_tx_completion_handler(struct qwx_softc *sc, int ring_id) { + struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = &ic->ic_if; struct qwx_dp *dp = &sc->dp; int hal_ring_id = dp->tx_ring[ring_id].tcl_comp_ring.ring_id; struct hal_srng *status_ring = &sc->hal.srng_list[hal_ring_id]; @@ -15235,8 +15242,13 @@ qwx_dp_tx_completion_handler(struct qwx_softc *sc, int ring_id) qwx_dp_tx_complete_msdu(sc, tx_ring, msdu_id, &ts); } - if (tx_ring->queued < sc->hw_params.tx_ring_size - 1) + if (tx_ring->queued < sc->hw_params.tx_ring_size - 1) { sc->qfullmsk &= ~(1 << ring_id); + if (sc->qfullmsk == 0 && ifq_is_oactive(&ifp->if_snd)) { + ifq_clr_oactive(&ifp->if_snd); + (*ifp->if_start)(ifp); + } + } return 0; }