From a502e20888f5a09c1de9dd0902dbc07b078d1a44 Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 11 Jun 2010 03:00:32 +0000 Subject: [PATCH] Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4) in particular, do not handle deferred DMA map load operations at all. Any error, and especially EINPROGRESS, is treated as a hard error and typically abort the current operation. The fact that the busdma code queues the load operation for when resources (i.e. bounce buffers in this particular case) are available makes this especially problematic. Bounce buffering, unlike what the PR synopsis would suggest, works fine. While on the subject, properly implement swi_vm(). PR: 147502 MFC after: 1 week --- sys/ia64/ia64/busdma_machdep.c | 4 ++-- sys/ia64/ia64/vm_machdep.c | 5 ++--- sys/ia64/include/md_var.h | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c index 7e7366a3d513..4121742d459c 100644 --- a/sys/ia64/ia64/busdma_machdep.c +++ b/sys/ia64/ia64/busdma_machdep.c @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define MAX_BPAGES 256 +#define MAX_BPAGES 1024 struct bus_dma_tag { bus_dma_tag_t parent; @@ -77,7 +77,7 @@ struct bounce_page { STAILQ_ENTRY(bounce_page) links; }; -int busdma_swi_pending; +u_int busdma_swi_pending; static struct mtx bounce_lock; static STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 6222d3382af4..1711f1a6d425 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -378,9 +378,8 @@ sf_buf_free(struct sf_buf *sf) */ void swi_vm(void *dummy) -{ -#if 0 +{ + if (busdma_swi_pending != 0) busdma_swi(); -#endif } diff --git a/sys/ia64/include/md_var.h b/sys/ia64/include/md_var.h index 9a2f92a53b2c..f64e4c9b8563 100644 --- a/sys/ia64/include/md_var.h +++ b/sys/ia64/include/md_var.h @@ -75,6 +75,7 @@ struct ia64_init_return { extern uint64_t ia64_lapic_addr; extern long Maxmem; +extern u_int busdma_swi_pending; void busdma_swi(void); int copyout_regstack(struct thread *, uint64_t *, uint64_t *);