FreeBSD Bugzilla – Attachment 201833 Details for
Bug 235542
Jetson TK1 SD Card Controller causes kernel panic on FreeBSD 13.0-CURRENT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
testing patch
test_dma.diff (text/plain), 3.28 KB, created by
Michal Meloun
on 2019-02-08 09:08:19 UTC
(
hide
)
Description:
testing patch
Filename:
MIME Type:
Creator:
Michal Meloun
Created:
2019-02-08 09:08:19 UTC
Size:
3.28 KB
patch
obsolete
>diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c >index 2aff3f8a150..43a0d25b54b 100644 >--- a/sys/arm/arm/busdma_machdep-v6.c >+++ b/sys/arm/arm/busdma_machdep-v6.c >@@ -431,7 +431,7 @@ dflt_lock(void *arg, bus_dma_lock_op_t op) > > panic("driver error: busdma dflt_lock called"); > } >- >+int busdma_debug = 0; > /* > * Allocate a device specific dma_tag. > */ >@@ -536,7 +536,9 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, > return (error); > } > bz = newtag->bounce_zone; >- >+if (busdma_debug) { >+ printf("%s: bz->total_bpages: %d, maxsize: %lu\n", __func__, bz->total_bpages, maxsize); >+} > if (ptoa(bz->total_bpages) < maxsize) { > int pages; > >@@ -1110,6 +1112,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, > struct sync_list *sl; > int error; > >+if (busdma_debug) >+ printf("%s: Enter\n", __func__); > counter_u64_add(maploads_total, 1); > if (map->flags & DMAMAP_COHERENT) > counter_u64_add(maploads_coherent, 1); >@@ -1123,6 +1127,12 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, > counter_u64_add(maploads_mbuf, 1); > map->flags |= DMAMAP_MBUF; > } >+if (busdma_debug) { >+ printf("%s: buf: 0x%08lX, buflen: %lu\n", >+ __func__, (bus_addr_t)buf, buflen); >+ printf("%s: might_bounce: %d\n", >+ __func__, might_bounce(dmat, map, (bus_addr_t)buf, buflen)); >+} > > if (might_bounce(dmat, map, (bus_addr_t)buf, buflen)) { > _bus_dmamap_count_pages(dmat, pmap, map, buf, buflen, flags); >@@ -1157,9 +1167,15 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, > sgsize = dmat->maxsegsz; > if (buflen < sgsize) > sgsize = buflen; >- >+if (busdma_debug) { >+ printf("%s: curaddr: 0x%08lX, sgsize: %lu, buflen: %lu, map->pagesneeded: %d\n", >+ __func__, curaddr, sgsize, buflen, map->pagesneeded); >+} > if (map->pagesneeded != 0 && must_bounce(dmat, map, curaddr, > sgsize)) { >+if (busdma_debug) { >+ printf("%s: add_bounce_page\n", __func__); >+} > curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, > sgsize); > } else if ((dmat->flags & BUS_DMA_COHERENT) == 0) { >diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c >index 81bee8b880d..3ac729d01f6 100644 >--- a/sys/dev/sdhci/sdhci.c >+++ b/sys/dev/sdhci/sdhci.c >@@ -740,7 +740,7 @@ sdhci_card_poll(void *arg) > callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS, > sdhci_card_poll, slot); > } >- >+extern int busdma_debug; > static int > sdhci_dma_alloc(struct sdhci_slot *slot) > { >@@ -774,6 +774,8 @@ sdhci_dma_alloc(struct sdhci_slot *slot) > * forming the actual address of data, requiring the SDMA buffer to > * be aligned to the SDMA boundary. > */ >+printf("%s: bus_get_dma_tag: %p\n", __func__, bus_get_dma_tag(slot->bus)); >+busdma_debug = 1; > err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz, > 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, > slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW, >@@ -794,6 +796,7 @@ sdhci_dma_alloc(struct sdhci_slot *slot) > err = bus_dmamap_load(slot->dmatag, slot->dmamap, > (void *)slot->dmamem, slot->sdma_bbufsz, sdhci_getaddr, > &slot->paddr, 0); >+busdma_debug = 0; > if (err != 0 || slot->paddr == 0) { > slot_printf(slot, "Can't load DMA memory for SDMA\n"); > bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 235542
:
201780
|
201781
|
201790
|
201793
| 201833 |
201848
|
201864
Working