From aed7daa2f2c5ec6bbec93f33b167fcba4eaf90bc Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 22 May 2015 06:50:55 +0000 Subject: Limit the number of dma segments used for transmitting packets to IWM_NUM_OF_TBS - 2. We have IWM_NUM_OF_TBS slots, but use two of those for sending commands to the firmware. Hopefully fixes the iwm0: hardware error, stopping device errors I've seen somewhat regularly. ok claudio@, deraadt@ --- sys/dev/pci/if_iwm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 00ca5329e75..adb334fc623 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.40 2015/05/21 22:13:55 kettenis Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.41 2015/05/22 06:50:54 kettenis Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -1113,7 +1113,8 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, struct iwm_tx_ring *ring, int qid) paddr += sizeof(struct iwm_device_cmd); error = bus_dmamap_create(sc->sc_dmat, MCLBYTES, - IWM_NUM_OF_TBS, MCLBYTES, 0, BUS_DMA_NOWAIT, &data->map); + IWM_NUM_OF_TBS - 2, MCLBYTES, 0, BUS_DMA_NOWAIT, + &data->map); if (error != 0) { printf("%s: could not create TX buf DMA map\n", DEVNAME(sc)); goto fail; -- cgit v1.2.3