From fa00575bb6d47af2f2db30098ff042f755d806b8 Mon Sep 17 00:00:00 2001 From: Peter Milne Date: Mon, 19 Sep 2016 11:35:50 +0100 Subject: [PATCH] decode KMCU z_ident correctly BUG: sync DMA_FROMDEVICE, even when cpu flush modified: acq-fiber-hba.c modified: afhba_stream_drv.c deleted: mtd-utils --- acq-fiber-hba.c | 2 +- afhba_stream_drv.c | 13 ++++++++++--- mtd-utils | 1 - 3 files changed, 11 insertions(+), 5 deletions(-) delete mode 160000 mtd-utils diff --git a/acq-fiber-hba.c b/acq-fiber-hba.c index 92e7f51..f0a4ac0 100644 --- a/acq-fiber-hba.c +++ b/acq-fiber-hba.c @@ -492,7 +492,7 @@ int afhba_mtca_probe(struct AFHBA_DEV *adev) { int (*_init)(struct AFHBA_DEV* adev) = afhba4_stream? STREAM: NOSTREAM; - dev_info(pdev(adev), "AFHBA404 detected"); + dev_info(pdev(adev), "AFHBA404 detected %s", afhba4_stream? "STREAM": "NOSTREAM"); adev->map_count = MAP_COUNT_4G1; adev->remote_com_bar = MAP_COUNT_4G1-1; if (bad_bios_bar_limit){ diff --git a/afhba_stream_drv.c b/afhba_stream_drv.c index 1aae080..ed3aad9 100644 --- a/afhba_stream_drv.c +++ b/afhba_stream_drv.c @@ -39,7 +39,7 @@ #include -#define REVID "1010" +#define REVID "1011" #define DEF_BUFFER_LEN 0x100000 @@ -476,6 +476,14 @@ static int is_valid_z_ident(unsigned z_ident, char buf[], int maxbuf) snprintf(buf, maxbuf, "acq2106_%03d.comms%X", z_ident&0x0ffff, (z_ident&0x00f00000)>>20); return 1; + }else if ((z_ident&0xe4330000) == 0xe4330000){ + snprintf(buf, maxbuf, "kmcu_%03d.comms%x", + z_ident&0x0ffff, (z_ident&0x00f00000)>>20); + return 1; + }else if ((z_ident&0x43000000) == 0x43000000){ + snprintf(buf, maxbuf, "kmcu_%03d.comms%x", + z_ident&0x0ffff, 0); + return 1; }else{ return 0; } @@ -581,8 +589,7 @@ static void mark_empty(struct device *dev, struct HostBuffer *hb){ pmark[0] = EMPTY1; pmark[1] = EMPTY2; - /* direction may be wrong - we're trying to flush */ - dma_sync_single_for_device(dev, hb->pa, hb->req_len, PCI_DMA_TODEVICE); + dma_sync_single_for_device(dev, hb->pa, hb->req_len, PCI_DMA_FROMDEVICE); } diff --git a/mtd-utils b/mtd-utils deleted file mode 160000 index ed27779..0000000 --- a/mtd-utils +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ed27779bd72c11cb12a422533bc9dbfe91de1fba