Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 793bc0af authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Jeff Garzik
Browse files

tc35815: Fix an usage of streaming DMA API.



The tc35815 driver lacks a call to pci_dma_sync_single_for_device() on
receiving.  Recent fix of MIPS dma_sync_single_for_cpu() reveal this
bug.

Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 1e56a4b4
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -58,12 +58,13 @@
 *	1.34	Fix netpoll locking.  "BH rule" for NAPI is not enough with
 *	1.34	Fix netpoll locking.  "BH rule" for NAPI is not enough with
 *		netpoll, hard_start_xmit might be called from irq context.
 *		netpoll, hard_start_xmit might be called from irq context.
 *		PM support.
 *		PM support.
 *	1.35	Fix an usage of streaming DMA API.
 */
 */


#ifdef TC35815_NAPI
#ifdef TC35815_NAPI
#define DRV_VERSION	"1.34-NAPI"
#define DRV_VERSION	"1.35-NAPI"
#else
#else
#define DRV_VERSION	"1.34"
#define DRV_VERSION	"1.35"
#endif
#endif
static const char *version = "tc35815.c:v" DRV_VERSION "\n";
static const char *version = "tc35815.c:v" DRV_VERSION "\n";
#define MODNAME			"tc35815"
#define MODNAME			"tc35815"
@@ -1550,6 +1551,11 @@ tc35815_rx(struct net_device *dev)
							    PCI_DMA_FROMDEVICE);
							    PCI_DMA_FROMDEVICE);
#endif
#endif
				memcpy(data + offset, rxbuf, len);
				memcpy(data + offset, rxbuf, len);
#ifdef TC35815_DMA_SYNC_ONDEMAND
				pci_dma_sync_single_for_device(lp->pci_dev,
							       dma, len,
							       PCI_DMA_FROMDEVICE);
#endif
				offset += len;
				offset += len;
				cur_bd++;
				cur_bd++;
			}
			}