From d3cb355fa2aa377efebbeeeb7f9d2cd732761849 Mon Sep 17 00:00:00 2001 From: Patrick Wildt Date: Wed, 16 May 2018 14:10:27 +0000 Subject: After having finished transmitting the last mbuf, don't just return to the caller. Otherwise we skip restarting the ifq which means that if we ever have a full queue and go oactive, there is no coming back. So break out from the loop and call ifq restart if the queue is not full. --- sys/dev/sdmmc/if_bwfm_sdio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/dev/sdmmc/if_bwfm_sdio.c b/sys/dev/sdmmc/if_bwfm_sdio.c index 732b0098d93..10c402544e2 100644 --- a/sys/dev/sdmmc/if_bwfm_sdio.c +++ b/sys/dev/sdmmc/if_bwfm_sdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_sdio.c,v 1.8 2018/05/16 08:20:00 patrick Exp $ */ +/* $OpenBSD: if_bwfm_sdio.c,v 1.9 2018/05/16 14:10:26 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -962,7 +962,7 @@ bwfm_sdio_tx_dataframe(struct bwfm_sdio_softc *sc) for (;;) { m = mq_dequeue(&sc->sc_txdata_queue); if (m == NULL) - return; + break; len = sizeof(*hwhdr) + sizeof(*swhdr) + sizeof(*bcdc) + m->m_pkthdr.len; @@ -993,7 +993,8 @@ bwfm_sdio_tx_dataframe(struct bwfm_sdio_softc *sc) m_freem(m); } - ifq_restart(&ifp->if_snd); + if (!mq_full(&sc->sc_txdata_queue)) + ifq_restart(&ifp->if_snd); } void -- cgit v1.2.3