From: kettenis Date: Fri, 22 May 2015 06:50:54 +0000 (+0000) Subject: Limit the number of dma segments used for transmitting packets to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=617b19c0ad47f30a05ea15c59f9c9c90662093d1;p=openbsd 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@ --- 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;