View | Details | Raw Unified | Return to bug 235542 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/arm/arm/busdma_machdep-v6.c (-3 / +19 lines)
Lines 431-437 dflt_lock(void *arg, bus_dma_lock_op_t op) Link Here
431
431
432
	panic("driver error: busdma dflt_lock called");
432
	panic("driver error: busdma dflt_lock called");
433
}
433
}
434
434
int busdma_debug = 0;
435
/*
435
/*
436
 * Allocate a device specific dma_tag.
436
 * Allocate a device specific dma_tag.
437
 */
437
 */
Lines 536-542 bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, Link Here
536
			return (error);
536
			return (error);
537
		}
537
		}
538
		bz = newtag->bounce_zone;
538
		bz = newtag->bounce_zone;
539
539
if (busdma_debug) {
540
 printf("%s: bz->total_bpages: %d, maxsize: %lu\n", __func__, bz->total_bpages, maxsize);
541
}
540
		if (ptoa(bz->total_bpages) < maxsize) {
542
		if (ptoa(bz->total_bpages) < maxsize) {
541
			int pages;
543
			int pages;
542
544
Lines 1110-1115 _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, Link Here
1110
	struct sync_list *sl;
1112
	struct sync_list *sl;
1111
	int error;
1113
	int error;
1112
1114
1115
if (busdma_debug)
1116
 printf("%s: Enter\n", __func__);
1113
	counter_u64_add(maploads_total, 1);
1117
	counter_u64_add(maploads_total, 1);
1114
	if (map->flags & DMAMAP_COHERENT)
1118
	if (map->flags & DMAMAP_COHERENT)
1115
		counter_u64_add(maploads_coherent, 1);
1119
		counter_u64_add(maploads_coherent, 1);
Lines 1123-1128 _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, Link Here
1123
		counter_u64_add(maploads_mbuf, 1);
1127
		counter_u64_add(maploads_mbuf, 1);
1124
		map->flags |= DMAMAP_MBUF;
1128
		map->flags |= DMAMAP_MBUF;
1125
	}
1129
	}
1130
if (busdma_debug) {
1131
 printf("%s: buf: 0x%08lX, buflen: %lu\n",
1132
  __func__, (bus_addr_t)buf, buflen);
1133
 printf("%s: might_bounce: %d\n",
1134
  __func__, might_bounce(dmat, map, (bus_addr_t)buf, buflen));
1135
}
1126
1136
1127
	if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) {
1137
	if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) {
1128
		_bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, flags);
1138
		_bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, flags);
Lines 1157-1165 _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, Link Here
1157
			sgsize = dmat->maxsegsz;
1167
			sgsize = dmat->maxsegsz;
1158
		if (buflen < sgsize)
1168
		if (buflen < sgsize)
1159
			sgsize = buflen;
1169
			sgsize = buflen;
1160
1170
if (busdma_debug) {
1171
 printf("%s: curaddr: 0x%08lX, sgsize: %lu, buflen: %lu, map->pagesneeded: %d\n",
1172
     __func__, curaddr, sgsize, buflen, map->pagesneeded);
1173
}
1161
		if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr,
1174
		if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr,
1162
		    sgsize)) {
1175
		    sgsize)) {
1176
if (busdma_debug) {
1177
 printf("%s: add_bounce_page\n", __func__);
1178
}
1163
			curaddr = add_bounce_page(dmat, map, kvaddr, curaddr,
1179
			curaddr = add_bounce_page(dmat, map, kvaddr, curaddr,
1164
			    sgsize);
1180
			    sgsize);
1165
		} else if ((dmat->flags & BUS_DMA_COHERENT) == 0) {
1181
		} else if ((dmat->flags & BUS_DMA_COHERENT) == 0) {
(-)b/sys/dev/sdhci/sdhci.c (-1 / +4 lines)
Lines 740-746 sdhci_card_poll(void *arg) Link Here
740
	callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS,
740
	callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS,
741
	    sdhci_card_poll, slot);
741
	    sdhci_card_poll, slot);
742
}
742
}
743
743
extern int busdma_debug;
744
static int
744
static int
745
sdhci_dma_alloc(struct sdhci_slot *slot)
745
sdhci_dma_alloc(struct sdhci_slot *slot)
746
{
746
{
Lines 774-779 sdhci_dma_alloc(struct sdhci_slot *slot) Link Here
774
	 * forming the actual address of data, requiring the SDMA buffer to
774
	 * forming the actual address of data, requiring the SDMA buffer to
775
	 * be aligned to the SDMA boundary.
775
	 * be aligned to the SDMA boundary.
776
	 */
776
	 */
777
printf("%s: bus_get_dma_tag: %p\n", __func__, bus_get_dma_tag(slot->bus));
778
busdma_debug = 1;
777
	err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz,
779
	err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz,
778
	    0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
780
	    0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
779
	    slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW,
781
	    slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW,
Lines 794-799 sdhci_dma_alloc(struct sdhci_slot *slot) Link Here
794
	err = bus_dmamap_load(slot->dmatag, slot->dmamap,
796
	err = bus_dmamap_load(slot->dmatag, slot->dmamap,
795
	    (void *)slot->dmamem, slot->sdma_bbufsz, sdhci_getaddr,
797
	    (void *)slot->dmamem, slot->sdma_bbufsz, sdhci_getaddr,
796
	    &slot->paddr, 0);
798
	    &slot->paddr, 0);
799
busdma_debug = 0;
797
	if (err != 0 || slot->paddr == 0) {
800
	if (err != 0 || slot->paddr == 0) {
798
		slot_printf(slot, "Can't load DMA memory for SDMA\n");
801
		slot_printf(slot, "Can't load DMA memory for SDMA\n");
799
		bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap);
802
		bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap);

Return to bug 235542