Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304308
b: refs/heads/master
c: 3abc48a
h: refs/heads/master
v: v3
  • Loading branch information
Martyn Welch authored and Greg Kroah-Hartman committed Apr 10, 2012
1 parent b9b3e9a commit f22bd63
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59b2bbb614ca1bd934bb0e5c615a0849d11d8858
refs/heads/master: 3abc48ae35ef7cff845a8d57322c19cc153fb482
22 changes: 15 additions & 7 deletions trunk/drivers/staging/vme/bridges/vme_tsi148.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,6 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
struct vme_dma_pattern *pattern_attr;
struct vme_dma_pci *pci_attr;
struct vme_dma_vme *vme_attr;
dma_addr_t desc_ptr;
int retval = 0;
struct vme_bridge *tsi148_bridge;

Expand Down Expand Up @@ -1739,9 +1738,12 @@ static int tsi148_dma_list_add(struct vme_dma_list *list,
prev = list_entry(entry->list.prev, struct tsi148_dma_entry,
list);
/* We need the bus address for the pointer */
desc_ptr = virt_to_bus(&entry->descriptor);
reg_split(desc_ptr, &prev->descriptor.dnlau,
&prev->descriptor.dnlal);
entry->dma_handle = dma_map_single(tsi148_bridge->parent,
&entry->descriptor,
sizeof(struct tsi148_dma_descriptor), DMA_TO_DEVICE);

reg_split((unsigned long long)entry->dma_handle,
&prev->descriptor.dnlau, &prev->descriptor.dnlal);
}

return 0;
Expand Down Expand Up @@ -1784,7 +1786,6 @@ static int tsi148_dma_list_exec(struct vme_dma_list *list)
struct vme_dma_resource *ctrlr;
int channel, retval = 0;
struct tsi148_dma_entry *entry;
dma_addr_t bus_addr;
u32 bus_addr_high, bus_addr_low;
u32 val, dctlreg = 0;
struct vme_bridge *tsi148_bridge;
Expand Down Expand Up @@ -1817,11 +1818,13 @@ static int tsi148_dma_list_exec(struct vme_dma_list *list)
entry = list_first_entry(&list->entries, struct tsi148_dma_entry,
list);

bus_addr = virt_to_bus(&entry->descriptor);
entry->dma_handle = dma_map_single(tsi148_bridge->parent,
&entry->descriptor,
sizeof(struct tsi148_dma_descriptor), DMA_TO_DEVICE);

mutex_unlock(&ctrlr->mtx);

reg_split(bus_addr, &bus_addr_high, &bus_addr_low);
reg_split(entry->dma_handle, &bus_addr_high, &bus_addr_low);

iowrite32be(bus_addr_high, bridge->base +
TSI148_LCSR_DMA[channel] + TSI148_LCSR_OFFSET_DNLAU);
Expand Down Expand Up @@ -1864,10 +1867,15 @@ static int tsi148_dma_list_empty(struct vme_dma_list *list)
struct list_head *pos, *temp;
struct tsi148_dma_entry *entry;

struct vme_bridge *tsi148_bridge = list->parent->parent;

/* detach and free each entry */
list_for_each_safe(pos, temp, &list->entries) {
list_del(pos);
entry = list_entry(pos, struct tsi148_dma_entry, list);

dma_unmap_single(tsi148_bridge->parent, entry->dma_handle,
sizeof(struct tsi148_dma_descriptor), DMA_TO_DEVICE);
kfree(entry);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/vme/bridges/vme_tsi148.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct tsi148_dma_entry {
*/
struct tsi148_dma_descriptor descriptor;
struct list_head list;
dma_addr_t dma_handle;
};

/*
Expand Down

0 comments on commit f22bd63

Please sign in to comment.